@searchcraft/javascript-sdk 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/components/defineCustomElements.js +25 -23
  2. package/dist/components/html.js +1 -1
  3. package/dist/components/index.d.ts +131 -5
  4. package/dist/components/index.js +245 -62
  5. package/dist/components/index.js.map +1 -1
  6. package/dist/components/{searchcraft-summary-box2.js → marked.esm.js} +3 -101
  7. package/dist/components/marked.esm.js.map +1 -0
  8. package/dist/components/searchcraft-ad.js +1 -1
  9. package/dist/components/searchcraft-ad2.js +4 -4
  10. package/dist/components/searchcraft-button.js +1 -1
  11. package/dist/components/searchcraft-button2.js +2 -2
  12. package/dist/components/searchcraft-error-message.js +1 -1
  13. package/dist/components/searchcraft-error-message2.js +1 -1
  14. package/dist/components/searchcraft-facet-list.js +1 -1
  15. package/dist/components/searchcraft-facet-list2.js +2 -2
  16. package/dist/components/searchcraft-filter-panel.js +5 -5
  17. package/dist/components/searchcraft-input-form.js +1 -1
  18. package/dist/components/searchcraft-input-form2.js +6 -6
  19. package/dist/components/searchcraft-input-label.js +1 -1
  20. package/dist/components/searchcraft-input-label2.js +2 -2
  21. package/dist/components/searchcraft-loading.js +1 -1
  22. package/dist/components/searchcraft-loading2.js +1 -1
  23. package/dist/components/searchcraft-pagination.js +4 -4
  24. package/dist/components/searchcraft-popover-button.js +6 -4
  25. package/dist/components/searchcraft-popover-button.js.map +1 -1
  26. package/dist/components/searchcraft-popover-footer.js +1 -1
  27. package/dist/components/searchcraft-popover-footer2.js +5 -7
  28. package/dist/components/searchcraft-popover-footer2.js.map +1 -1
  29. package/dist/components/searchcraft-popover-form.js +18 -18
  30. package/dist/components/searchcraft-popover-form.js.map +1 -1
  31. package/dist/components/searchcraft-popover-list-item.js +1 -1
  32. package/dist/components/searchcraft-popover-list-item2.js +4 -4
  33. package/dist/components/searchcraft-popover-list-view.js +1 -1
  34. package/dist/components/searchcraft-popover-list-view2.js +4 -4
  35. package/dist/components/searchcraft-results-info.js +4 -4
  36. package/dist/components/searchcraft-results-summary.d.ts +11 -0
  37. package/dist/components/searchcraft-results-summary.js +9 -0
  38. package/dist/components/searchcraft-results-summary.js.map +1 -0
  39. package/dist/components/searchcraft-results-summary2.js +97 -0
  40. package/dist/components/searchcraft-results-summary2.js.map +1 -0
  41. package/dist/components/searchcraft-search-result.js +1 -1
  42. package/dist/components/searchcraft-search-result2.js +3 -3
  43. package/dist/components/searchcraft-search-results-per-page.js +3 -3
  44. package/dist/components/searchcraft-search-results.js +5 -5
  45. package/dist/components/searchcraft-select.js +1 -1
  46. package/dist/components/searchcraft-select2.js +1 -1
  47. package/dist/components/searchcraft-slider.js +1 -1
  48. package/dist/components/searchcraft-slider2.js +5 -5
  49. package/dist/components/searchcraft-summary-box.js +89 -1
  50. package/dist/components/searchcraft-summary-box.js.map +1 -1
  51. package/dist/components/searchcraft-theme.js +3 -3
  52. package/dist/components/searchcraft-theme.js.map +1 -1
  53. package/dist/components/searchcraft-toggle-button.js +1 -1
  54. package/dist/components/searchcraft-toggle-button2.js +5 -5
  55. package/dist/hydrate/index.js +2075 -1973
  56. package/dist/hydrate/index.mjs +2075 -1973
  57. package/dist/themes/hologram.css +1 -1
  58. package/dist/themes/hologram.css.map +1 -1
  59. package/dist/types/clients/SummaryClient.d.ts +10 -1
  60. package/dist/types/components/searchcraft-popover-button/searchcraft-popover-button.d.ts +1 -1
  61. package/dist/types/components/searchcraft-results-summary/searchcraft-results-summary.d.ts +65 -0
  62. package/dist/types/components/searchcraft-summary-box/searchcraft-summary-box.d.ts +5 -5
  63. package/dist/types/components.d.ts +119 -2
  64. package/dist/types/store/SearchcraftStore.types.d.ts +1 -0
  65. package/dist/types/types/core-types/SearchcraftConfig.types.d.ts +2 -2
  66. package/package.json +2 -2
  67. package/dist/components/searchcraft-summary-box2.js.map +0 -1
@@ -6309,12 +6309,14 @@ class SearchcraftPopoverButton {
6309
6309
  switch (this.type) {
6310
6310
  case 'skeuomorphic':
6311
6311
  return this.renderSkeuomorphicSlot();
6312
+ case 'magnifying-glass':
6313
+ return (hAsync("div", { class: 'searchcraft-popover-button-input' }, hAsync("svg", { class: 'searchcraft-popover-button-input-search-icon', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', version: '1.1', "aria-hidden": 'true' }, hAsync("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: 'currentColor', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' }))));
6312
6314
  default:
6313
6315
  return (hAsync("div", null, hAsync("slot", null)));
6314
6316
  }
6315
6317
  }
6316
6318
  render() {
6317
- return (hAsync("button", { key: 'af0bb449457f7dbefa00ac690e7d3490b5162883', class: `searchcraft-popover-button ${this.type ? ` searchcraft-popover-button-${this.type}` : ''}`, innerHTML: typeof this.template !== 'undefined'
6319
+ return (hAsync("button", { key: '760f4f8d8daddaaadc0367e21b9efe23c4ef7c7d', "aria-label": this.type === 'magnifying-glass' ? 'Search' : undefined, class: `searchcraft-popover-button ${this.type ? ` searchcraft-popover-button-${this.type}` : ''}`, innerHTML: typeof this.template !== 'undefined'
6318
6320
  ? this.template({ isPopoverVisible: this.isPopoverVisible }, { html: html$1 })
6319
6321
  : undefined, onClick: this.handleOnClick.bind(this), type: 'button' }, typeof this.template !== 'undefined'
6320
6322
  ? undefined
@@ -6341,7 +6343,7 @@ class SearchcraftPopoverButton {
6341
6343
  }; }
6342
6344
  }
6343
6345
 
6344
- const version = "0.14.0";
6346
+ const version = "0.15.0";
6345
6347
 
6346
6348
  /**
6347
6349
  * Renders the footer for the searchcraft-popover-form.
@@ -6413,9 +6415,7 @@ class SearchcraftPopoverFooter {
6413
6415
  const hasResults = typeof this.searchResultsCount === 'number' &&
6414
6416
  this.searchResultsCount > 0;
6415
6417
  const showViewAll = !!this.safeViewAllHref && hasResults;
6416
- return (hAsync("footer", { key: '548704335f80a2b4bc7ebd4ea2d0a2eb73376fde', class: 'searchcraft-popover-footer' }, hAsync("a", { key: 'a10cbfd833ef0c6016932fede6ca3195eecdfaea', class: 'searchcraft-popover-footer-link', href: href, target: '_blank', rel: 'noreferrer' }, hAsync("svg", { key: 'a053515f5656f1fa9a44f5590847f0a63b0b5b4f', class: 'searchcraft-popover-footer-link-image', width: '169', height: '20', viewBox: '0 0 169 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' }, hAsync("title", { key: '9ebd08877c49cf03f00d88f59834b8cce2f3e707' }, "Powered by Searchcraft"), hAsync("path", { key: 'b60c62800241cb02097381351e2a36524d5c1263', d: 'M5.07288 0.608C7.60088 0.608 8.84888 2.064 8.84888 4.112C8.84888 6.16 7.60088 7.616 5.07288 7.616H1.68088V12H0.336875V0.608H5.07288ZM5.07288 6.4C6.67288 6.4 7.45688 5.552 7.45688 4.112C7.45688 2.672 6.67288 1.824 5.07288 1.824H1.68088V6.4H5.07288ZM13.31 12.192C10.99 12.192 9.31 10.512 9.31 7.872C9.31 5.232 10.99 3.552 13.31 3.552C15.63 3.552 17.31 5.232 17.31 7.872C17.31 10.512 15.63 12.192 13.31 12.192ZM13.31 11.04C14.91 11.04 15.966 9.872 15.966 7.872C15.966 5.872 14.91 4.704 13.31 4.704C11.71 4.704 10.654 5.872 10.654 7.872C10.654 9.872 11.71 11.04 13.31 11.04ZM28.3826 3.744H29.7586L27.0066 12H25.6626L24.4466 8.176C24.1586 7.264 23.8706 6.304 23.6146 5.376C23.3426 6.304 23.0546 7.264 22.7666 8.176L21.5666 12H20.2226L17.4706 3.744H18.8466L20.0146 7.472C20.3346 8.48 20.6226 9.472 20.9106 10.48C21.1826 9.472 21.4706 8.48 21.7906 7.472L22.9426 3.744H24.2866L25.4386 7.472C25.7426 8.464 26.0466 9.456 26.3346 10.448C26.6066 9.456 26.9106 8.464 27.2146 7.472L28.3826 3.744ZM37.5194 7.872V8.32H31.2474C31.3754 10.176 32.3514 11.024 33.7914 11.024C34.9594 11.024 35.6954 10.416 35.9834 9.488H37.3114C36.9114 11.04 35.7274 12.192 33.7594 12.192C31.5034 12.192 29.9194 10.544 29.9194 7.872C29.9194 5.28 31.4394 3.552 33.7274 3.552C36.1914 3.552 37.5194 5.504 37.5194 7.872ZM33.7274 4.72C32.4314 4.72 31.4874 5.536 31.2794 7.168H36.1434C36.0154 5.808 35.1994 4.72 33.7274 4.72ZM42.9101 3.616C43.0381 3.616 43.1661 3.616 43.3421 3.632V4.864H43.0221C41.3741 4.864 40.3181 5.696 40.3181 7.296V12H39.0381V3.744H40.2541V5.2C40.7181 4.336 41.5661 3.616 42.9101 3.616ZM51.2538 7.872V8.32H44.9818C45.1098 10.176 46.0858 11.024 47.5258 11.024C48.6938 11.024 49.4298 10.416 49.7178 9.488H51.0458C50.6458 11.04 49.4618 12.192 47.4938 12.192C45.2378 12.192 43.6538 10.544 43.6538 7.872C43.6538 5.28 45.1738 3.552 47.4618 3.552C49.9258 3.552 51.2538 5.504 51.2538 7.872ZM47.4618 4.72C46.1658 4.72 45.2218 5.536 45.0138 7.168H49.8778C49.7498 5.808 48.9338 4.72 47.4618 4.72ZM58.9805 0.608H60.2605V12H59.0445V10.72C58.4205 11.664 57.4445 12.192 56.2125 12.192C53.8925 12.192 52.3725 10.512 52.3725 7.872C52.3725 5.232 53.8925 3.552 56.2125 3.552C57.4125 3.552 58.3565 4.048 58.9805 4.928V0.608ZM56.3725 11.04C57.9725 11.04 59.0285 9.872 59.0285 7.872C59.0285 5.872 57.9725 4.704 56.3725 4.704C54.7725 4.704 53.7165 5.936 53.7165 7.936C53.7165 9.936 54.7725 11.04 56.3725 11.04ZM69.2736 3.552C71.5936 3.552 73.1136 5.232 73.1136 7.872C73.1136 10.512 71.5936 12.192 69.2736 12.192C68.0416 12.192 67.0656 11.664 66.4416 10.72V12H65.2256V0.608H66.5056V4.928C67.1296 4.048 68.0736 3.552 69.2736 3.552ZM69.1136 11.04C70.7136 11.04 71.7696 9.808 71.7696 7.808C71.7696 5.808 70.7136 4.704 69.1136 4.704C67.5136 4.704 66.4576 5.872 66.4576 7.872C66.4576 9.872 67.5136 11.04 69.1136 11.04ZM79.3795 3.744H80.7715L77.2835 13.296C76.7555 14.752 75.9075 15.184 74.5955 15.184C74.3395 15.184 74.0995 15.168 73.8275 15.136V14.064H74.5795C75.3955 14.064 75.8275 13.696 76.0835 13.04C76.1795 12.8 76.2755 12.528 76.3715 12.272L73.2675 3.744H74.6755L75.8435 7.184C76.2595 8.384 76.6435 9.568 77.0275 10.752C77.3955 9.568 77.7955 8.368 78.2115 7.168L79.3795 3.744ZM89.1546 12.256C86.1146 12.256 84.2906 10.864 84.2746 8.24H86.4026C86.4346 10.032 87.6346 10.512 89.2186 10.512C90.7066 10.512 91.5226 9.936 91.5226 8.864C91.5226 7.968 90.9306 7.568 89.1866 7.216L88.2266 7.024C86.0186 6.608 84.5626 5.632 84.5626 3.568C84.5626 1.68 86.0506 0.351999 88.7866 0.351999C91.9866 0.351999 93.3466 1.856 93.4266 4H91.3306C91.2506 2.784 90.6266 2.096 88.8186 2.096C87.4426 2.096 86.7706 2.64 86.7706 3.504C86.7706 4.416 87.2986 4.832 88.9946 5.184L89.9866 5.376C92.6746 5.904 93.7626 6.944 93.7626 8.752C93.7626 11.008 92.0026 12.256 89.1546 12.256ZM102.952 8.016V8.496H96.7758C96.9198 9.968 97.7518 10.624 98.9198 10.624C99.8798 10.624 100.504 10.176 100.808 9.44H102.744C102.328 11.12 100.888 12.192 98.9038 12.192C96.4718 12.192 94.7918 10.512 94.7918 7.872C94.7918 5.28 96.4238 3.552 98.8718 3.552C101.4 3.552 102.952 5.392 102.952 8.016ZM98.8558 5.12C97.7838 5.12 96.9838 5.728 96.7918 7.088H100.936C100.776 5.92 100.056 5.12 98.8558 5.12ZM111.599 12H109.583C109.455 11.776 109.391 11.392 109.359 10.992C108.815 11.76 107.919 12.192 106.703 12.192C104.943 12.192 103.727 11.312 103.727 9.712C103.727 8.336 104.559 7.36 106.895 7.136L108.143 7.024C108.911 6.928 109.311 6.688 109.311 6.08C109.311 5.44 108.975 5.056 107.807 5.056C106.655 5.056 106.175 5.36 106.095 6.368H104.111C104.223 4.624 105.247 3.552 107.823 3.552C110.287 3.552 111.263 4.544 111.263 6.032V10.432C111.263 11.024 111.375 11.68 111.599 12ZM107.183 10.752C108.255 10.752 109.311 10.176 109.311 8.736V7.984C109.103 8.176 108.799 8.272 108.367 8.32L107.279 8.448C106.159 8.576 105.791 8.976 105.791 9.632C105.791 10.32 106.255 10.752 107.183 10.752ZM117.216 3.616C117.392 3.616 117.536 3.616 117.712 3.648V5.504H117.2C115.712 5.504 114.816 6.24 114.816 7.808V12H112.8V3.744H114.752V5.216C115.152 4.288 115.936 3.616 117.216 3.616ZM122.137 12.192C119.689 12.192 118.057 10.512 118.057 7.872C118.057 5.232 119.673 3.552 122.137 3.552C124.297 3.552 125.737 4.784 125.977 6.72H123.961C123.769 5.696 123.033 5.232 122.137 5.232C120.937 5.232 120.121 6.064 120.121 7.872C120.121 9.68 120.969 10.512 122.137 10.512C123.049 10.512 123.833 10.016 123.993 8.928H126.009C125.785 10.944 124.249 12.192 122.137 12.192ZM131.641 3.552C133.369 3.552 134.537 4.56 134.537 6.528V12H132.521V6.864C132.521 5.808 131.993 5.296 130.969 5.296C130.089 5.296 129.129 5.904 129.129 7.376V12H127.113V0.608H129.129V4.848C129.673 4.096 130.521 3.552 131.641 3.552ZM139.887 12.192C137.439 12.192 135.807 10.512 135.807 7.872C135.807 5.232 137.423 3.552 139.887 3.552C142.047 3.552 143.487 4.784 143.727 6.72H141.711C141.519 5.696 140.783 5.232 139.887 5.232C138.687 5.232 137.871 6.064 137.871 7.872C137.871 9.68 138.719 10.512 139.887 10.512C140.799 10.512 141.583 10.016 141.743 8.928H143.759C143.535 10.944 141.999 12.192 139.887 12.192ZM149.279 3.616C149.455 3.616 149.599 3.616 149.775 3.648V5.504H149.263C147.775 5.504 146.879 6.24 146.879 7.808V12H144.863V3.744H146.815V5.216C147.215 4.288 147.999 3.616 149.279 3.616ZM157.803 12H155.787C155.659 11.776 155.595 11.392 155.563 10.992C155.019 11.76 154.123 12.192 152.907 12.192C151.147 12.192 149.931 11.312 149.931 9.712C149.931 8.336 150.763 7.36 153.099 7.136L154.347 7.024C155.115 6.928 155.515 6.688 155.515 6.08C155.515 5.44 155.179 5.056 154.011 5.056C152.859 5.056 152.379 5.36 152.299 6.368H150.315C150.427 4.624 151.451 3.552 154.027 3.552C156.491 3.552 157.467 4.544 157.467 6.032V10.432C157.467 11.024 157.579 11.68 157.803 12ZM153.387 10.752C154.459 10.752 155.515 10.176 155.515 8.736V7.984C155.307 8.176 155.003 8.272 154.571 8.32L153.483 8.448C152.363 8.576 151.995 8.976 151.995 9.632C151.995 10.32 152.459 10.752 153.387 10.752ZM162.466 2.16C161.746 2.16 161.426 2.512 161.426 3.152V3.744H163.122V5.28H161.426V12H159.426V5.28H158.146V3.744H159.426V3.12C159.426 1.664 160.146 0.559999 162.13 0.559999C162.45 0.559999 162.882 0.575999 163.17 0.608V2.16H162.466ZM168.636 5.28H167.004V9.744C167.004 10.288 167.276 10.464 167.948 10.464H168.636V12C168.268 12.032 167.9 12.064 167.58 12.064C165.836 12.064 165.004 11.472 165.004 9.952V5.28H163.724V3.744H165.004V1.344H167.004V3.744H168.636V5.28Z', fill: 'currentColor' }))), hAsync("div", { key: '75aaa228b8c01975fa957d33bc33b1e29f66ce03', class: 'searchcraft-popover-footer-results' }, hAsync("p", { key: '6a55da1e5a3a67a2eb2b9118ddfd49af3446c2ed', class: 'searchcraft-popover-footer-results-info' }, hasResults
6417
- ? `${formatNumberWithCommas(this.searchResultsCount)} Results Found`
6418
- : ' '), showViewAll && (hAsync("a", { key: 'f6b5d3d55a90ac722ad561a9dc1fe9435607a15f', class: 'searchcraft-popover-footer-view-all', href: this.safeViewAllHref }, hAsync("span", { key: '50bc54b0a295738323790ff8d95f83c4771ad1c6', class: 'searchcraft-popover-footer-view-all-label' }, this.viewAllResultsLabel), hAsync("span", { key: '5da21f2ae33b48f548ba3a3174798ae833fa622f', class: 'searchcraft-popover-footer-view-all-shortcut', "aria-hidden": 'true' }, hAsync("kbd", { key: 'be6a5e1b8fdc3fd01412735180ff94fecf69247e' }, "\u2318"), hAsync("kbd", { key: 'e98f65b70e75f3be6623cd768afade9bf19301d5' }, "\u21B5")))))));
6418
+ return (hAsync("footer", { key: '548704335f80a2b4bc7ebd4ea2d0a2eb73376fde', class: 'searchcraft-popover-footer' }, hAsync("a", { key: 'a10cbfd833ef0c6016932fede6ca3195eecdfaea', class: 'searchcraft-popover-footer-link', href: href, target: '_blank', rel: 'noreferrer' }, hAsync("span", { key: '6c6333a61ae282419e32721fc9760d3d237870df', class: 'searchcraft-popover-footer-link-prefix' }, "Powered by\u00A0"), " Searchcraft"), hAsync("div", { key: 'c35f7d6c5b16510fa58301b8fad070e6cd14d72f', class: 'searchcraft-popover-footer-results' }, hAsync("p", { key: 'e1576404d2d23a7b53e761e617720cc4fb45ea8d', class: 'searchcraft-popover-footer-results-info' }, hasResults ? (hAsync("span", null, formatNumberWithCommas(this.searchResultsCount), " Results", hAsync("span", { class: 'searchcraft-popover-footer-results-found' }, ' Found'))) : (' ')), showViewAll && (hAsync("a", { key: '6f5585d1a75ccc44174a22603d13f3604078ca63', class: 'searchcraft-popover-footer-view-all', href: this.safeViewAllHref }, hAsync("span", { key: '12d8202b01d4493700fafd61f81989458d7620c4', class: 'searchcraft-popover-footer-view-all-label' }, this.viewAllResultsLabel), hAsync("span", { key: '3b26ffdc731827612e789fdb38c751062c1077ff', class: 'searchcraft-popover-footer-view-all-shortcut', "aria-hidden": 'true' }, hAsync("kbd", { key: '6999416b99a6b4b5b24702597736846b9168b12d' }, "\u2318"), hAsync("kbd", { key: '8a7f8ee088d037e96102dab463eb93a9d27d85ea' }, "\u21B5")))))));
6419
6419
  }
6420
6420
  static get cmpMeta() { return {
6421
6421
  "$flags$": 768,
@@ -6748,20 +6748,20 @@ class SearchcraftPopoverForm {
6748
6748
  const isListViewVisible = this.hasResultsToShow && this.isFocused;
6749
6749
  return (hAsync("div", { class: classNames('searchcraft-popover-form searchcraft-popover-form-inline', {
6750
6750
  'searchcraft-popover-form-active': isListViewVisible,
6751
- }) }, hAsync("div", { class: 'searchcraft-popover-form-input searchcraft-popover-form-inline-input' }, hAsync("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior })), isListViewVisible && (hAsync("div", { class: 'searchcraft-popover-form-inline-wrapper' }, this.showSummaryBox && (hAsync("searchcraft-summary-box", { searchcraftId: this.searchcraftId })), hAsync("searchcraft-popover-list-view", { popoverResultMappings: this.popoverResultMappings, searchClientResponseItems: this.searchClientResponseItems, adClientResponseItems: this.adClientResponseItems, searchResultsPage: this.searchResultsPage, searchResultsPerPage: this.searchResultsPerPage, searchcraftId: this.searchcraftId }), hAsync("searchcraft-popover-footer", { searchcraftId: this.searchcraftId, sdkVariant: this.sdkVariant, viewAllResultsHref: this.viewAllResultsHref, viewAllResultsLabel: this.resolvedViewAllResultsLabel })))));
6751
+ }) }, hAsync("div", { class: 'searchcraft-popover-form-input searchcraft-popover-form-inline-input' }, hAsync("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior })), isListViewVisible && (hAsync("div", { class: 'searchcraft-popover-form-inline-wrapper' }, this.showSummaryBox && (hAsync("searchcraft-results-summary", { searchcraftId: this.searchcraftId })), hAsync("searchcraft-popover-list-view", { popoverResultMappings: this.popoverResultMappings, searchClientResponseItems: this.searchClientResponseItems, adClientResponseItems: this.adClientResponseItems, searchResultsPage: this.searchResultsPage, searchResultsPerPage: this.searchResultsPerPage, searchcraftId: this.searchcraftId }), hAsync("searchcraft-popover-footer", { searchcraftId: this.searchcraftId, sdkVariant: this.sdkVariant, viewAllResultsHref: this.viewAllResultsHref, viewAllResultsLabel: this.resolvedViewAllResultsLabel })))));
6752
6752
  }
6753
6753
  renderModalPopover() {
6754
6754
  if (this.isPopoverVisibleInState) {
6755
6755
  return (hAsync("div", { class: classNames('searchcraft-popover-form searchcraft-popover-form-modal', {
6756
6756
  'searchcraft-popover-form-active': this.hasResultsToShow,
6757
- }) }, hAsync("div", { class: 'searchcraft-popover-form-modal-backdrop', onClick: this.handleModalBackdropClick }), hAsync("div", { class: 'searchcraft-popover-form-modal-wrapper' }, hAsync("div", { class: 'searchcraft-popover-form-input searchcraft-popover-form-modal-input' }, hAsync("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), onInputInit: this.handleInputInit.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior }), hAsync("button", { type: 'button', class: 'searchcraft-popover-form-cancel-button searchcraft-popover-form-modal-cancel-button', onClick: this.handleCancelButtonClick.bind(this) }, "Cancel")), hAsync("div", { class: 'searchcraft-popover-form-modal-popover-list-view' }, this.showSummaryBox && this.hasResultsToShow && (hAsync("searchcraft-summary-box", { searchcraftId: this.searchcraftId })), this.hasResultsToShow && (hAsync("searchcraft-popover-list-view", { popoverResultMappings: this.popoverResultMappings, searchClientResponseItems: this.searchClientResponseItems, adClientResponseItems: this.adClientResponseItems, searchResultsPage: this.searchResultsPage, searchResultsPerPage: this.searchResultsPerPage, searchcraftId: this.searchcraftId }))), hAsync("searchcraft-popover-footer", { searchcraftId: this.searchcraftId, sdkVariant: this.sdkVariant, viewAllResultsHref: this.viewAllResultsHref, viewAllResultsLabel: this.resolvedViewAllResultsLabel }))));
6757
+ }) }, hAsync("div", { class: 'searchcraft-popover-form-modal-backdrop', onClick: this.handleModalBackdropClick }), hAsync("div", { class: 'searchcraft-popover-form-modal-wrapper' }, hAsync("div", { class: 'searchcraft-popover-form-input searchcraft-popover-form-modal-input' }, hAsync("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), onInputInit: this.handleInputInit.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior }), hAsync("button", { type: 'button', class: 'searchcraft-popover-form-cancel-button searchcraft-popover-form-modal-cancel-button', onClick: this.handleCancelButtonClick.bind(this) }, "Cancel")), hAsync("div", { class: 'searchcraft-popover-form-modal-popover-list-view' }, this.showSummaryBox && this.hasResultsToShow && (hAsync("searchcraft-results-summary", { searchcraftId: this.searchcraftId })), this.hasResultsToShow && (hAsync("searchcraft-popover-list-view", { popoverResultMappings: this.popoverResultMappings, searchClientResponseItems: this.searchClientResponseItems, adClientResponseItems: this.adClientResponseItems, searchResultsPage: this.searchResultsPage, searchResultsPerPage: this.searchResultsPerPage, searchcraftId: this.searchcraftId }))), hAsync("searchcraft-popover-footer", { searchcraftId: this.searchcraftId, sdkVariant: this.sdkVariant, viewAllResultsHref: this.viewAllResultsHref, viewAllResultsLabel: this.resolvedViewAllResultsLabel }))));
6758
6758
  }
6759
6759
  }
6760
6760
  renderFullscreenPopover() {
6761
6761
  if (this.isPopoverVisibleInState) {
6762
6762
  return (hAsync("div", { class: classNames('searchcraft-popover-form searchcraft-popover-form-fullscreen', {
6763
6763
  'searchcraft-popover-form-active': this.hasResultsToShow,
6764
- }) }, hAsync("div", { class: 'searchcraft-popover-form-input searchcraft-popover-form-fullscreen-input' }, hAsync("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), onInputInit: this.handleInputInit.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior }), hAsync("button", { type: 'button', class: 'searchcraft-popover-form-cancel-button searchcraft-popover-form-fullscreen-cancel-button', onClick: this.handleCancelButtonClick.bind(this) }, "Cancel")), hAsync("div", { class: 'searchcraft-popover-form-fullscreen-popover-list-view' }, this.showSummaryBox && this.hasResultsToShow && (hAsync("searchcraft-summary-box", { searchcraftId: this.searchcraftId })), this.hasResultsToShow && (hAsync("searchcraft-popover-list-view", { popoverResultMappings: this.popoverResultMappings, searchClientResponseItems: this.searchClientResponseItems, adClientResponseItems: this.adClientResponseItems, searchResultsPage: this.searchResultsPage, searchResultsPerPage: this.searchResultsPerPage, searchcraftId: this.searchcraftId }))), hAsync("searchcraft-popover-footer", { searchcraftId: this.searchcraftId, sdkVariant: this.sdkVariant, viewAllResultsHref: this.viewAllResultsHref, viewAllResultsLabel: this.resolvedViewAllResultsLabel })));
6764
+ }) }, hAsync("div", { class: 'searchcraft-popover-form-input searchcraft-popover-form-fullscreen-input' }, hAsync("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), onInputInit: this.handleInputInit.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior }), hAsync("button", { type: 'button', class: 'searchcraft-popover-form-cancel-button searchcraft-popover-form-fullscreen-cancel-button', onClick: this.handleCancelButtonClick.bind(this) }, "Cancel")), hAsync("div", { class: 'searchcraft-popover-form-fullscreen-popover-list-view' }, this.showSummaryBox && this.hasResultsToShow && (hAsync("searchcraft-results-summary", { searchcraftId: this.searchcraftId })), this.hasResultsToShow && (hAsync("searchcraft-popover-list-view", { popoverResultMappings: this.popoverResultMappings, searchClientResponseItems: this.searchClientResponseItems, adClientResponseItems: this.adClientResponseItems, searchResultsPage: this.searchResultsPage, searchResultsPerPage: this.searchResultsPerPage, searchcraftId: this.searchcraftId }))), hAsync("searchcraft-popover-footer", { searchcraftId: this.searchcraftId, sdkVariant: this.sdkVariant, viewAllResultsHref: this.viewAllResultsHref, viewAllResultsLabel: this.resolvedViewAllResultsLabel })));
6765
6765
  }
6766
6766
  }
6767
6767
  render() {
@@ -6863,7 +6863,7 @@ class SearchcraftPopoverListItem {
6863
6863
  }
6864
6864
  };
6865
6865
  render() {
6866
- return (hAsync("div", { key: '119fc0a527160924a22d185ce764202b1d342e9b', class: 'searchcraft-popover-list-item' }, hAsync("a", { key: '95a5db24035c3be7decb2f062710214fa5726f27', class: 'searchcraft-popover-list-item-link', href: this.href, onClick: this.handleLinkClick.bind(this) }, this.imageSource && (hAsync("div", { key: '6a5ddee0b5f03bc7cf5c5dacc5b4a5ee2fcbe511', class: 'searchcraft-popover-list-item-image-wrapper' }, hAsync("img", { key: '3cdae906aee5b6ef7d1f618419476e75af4c4ebe', alt: this.imageAlt, src: this.imageSource, class: 'searchcraft-popover-list-item-image' }))), hAsync("div", { key: 'd0b55113188fb8fafff8ee15d3dc919617852b62', class: 'searchcraft-popover-list-item-content' }, this.title && (hAsync("p", { key: '1482260827b057f03db9eb6e8d7df7f5977fe3dc', class: 'searchcraft-popover-list-item-content-title' }, this.title)), this.subtitle && (hAsync("p", { key: 'c4210cef3c4372ee4f9ce4a41dbea10d0e915175', class: 'searchcraft-popover-list-item-content-subtitle' }, this.subtitle))))));
6866
+ return (hAsync("div", { key: 'd1c9c310b8abc9d2370efb802eac1edf4189519d', class: 'searchcraft-popover-list-item' }, hAsync("a", { key: '30eb1a5076c5b4b95ae43147eaee0bb72ce46179', class: 'searchcraft-popover-list-item-link', href: this.href, onClick: this.handleLinkClick.bind(this) }, this.imageSource && (hAsync("div", { key: 'd18ff55823dc2c61f3786f423936af8b009aeeda', class: 'searchcraft-popover-list-item-image-wrapper' }, hAsync("img", { key: '56f4cc1d472f7da05e64fcf52c560a7ad0cdf7a6', alt: this.imageAlt, src: this.imageSource, class: 'searchcraft-popover-list-item-image' }))), hAsync("div", { key: '78a0f0235d5e71d10076b70ccbaf4b58e0d6fea0', class: 'searchcraft-popover-list-item-content' }, this.title && (hAsync("p", { key: '4489047af56e5aa295cb5f036e970dcad053d3b7', class: 'searchcraft-popover-list-item-content-title' }, this.title)), this.subtitle && (hAsync("p", { key: '4d177c227a1dbf1233022d738403c8eb93ba328d', class: 'searchcraft-popover-list-item-content-subtitle' }, this.subtitle))))));
6867
6867
  }
6868
6868
  static get cmpMeta() { return {
6869
6869
  "$flags$": 768,
@@ -7370,718 +7370,6 @@ class SearchcraftResultsInfo {
7370
7370
  }; }
7371
7371
  }
7372
7372
 
7373
- /**
7374
- * This web component is designed to display detailed information for a single search result. Once a query is submitted, the component formats and presents the result.
7375
- *
7376
- * @internal
7377
- */
7378
- class SearchcraftSearchResult {
7379
- constructor(hostRef) {
7380
- registerInstance(this, hostRef);
7381
- }
7382
- item;
7383
- /**
7384
- * The index.
7385
- */
7386
- index;
7387
- /**
7388
- * The position in the document. Used with the "document_clicked" measure event.
7389
- */
7390
- documentPosition = 0;
7391
- /**
7392
- * A callback function responsible for rendering a result.
7393
- */
7394
- template;
7395
- /**
7396
- * The id of the Searchcraft instance that this component should use.
7397
- */
7398
- searchcraftId;
7399
- templateHtml;
7400
- get hostElement() { return getElement(this); }
7401
- core;
7402
- cleanupCore;
7403
- onCoreAvailable(core) {
7404
- this.core = core;
7405
- }
7406
- connectedCallback() {
7407
- this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
7408
- if (this.item) {
7409
- try {
7410
- this.templateHtml = this.template?.(this.item.document, this.index, {
7411
- html: html$1,
7412
- source_index: this.item.source_index,
7413
- });
7414
- }
7415
- catch (error) {
7416
- console.error('Invalid search result template:', error);
7417
- }
7418
- }
7419
- }
7420
- disconnectedCallback() {
7421
- this.cleanupCore?.();
7422
- }
7423
- handleResultContainerClick = (event) => {
7424
- if (!event.target) {
7425
- return;
7426
- }
7427
- const target = event.target;
7428
- const link = target.closest('a');
7429
- if (!link ||
7430
- !this.hostElement?.contains(link) ||
7431
- !this.core ||
7432
- !this.core.measureClient) {
7433
- return;
7434
- }
7435
- const document_position = this.documentPosition;
7436
- const search_term = this.core.store.getState().searchTerm;
7437
- const number_of_documents = this.core.store.getState().searchClientResponseItems.length || 0;
7438
- this.core.measureClient.sendMeasureEvent('document_clicked', {
7439
- document_position,
7440
- number_of_documents,
7441
- search_term,
7442
- });
7443
- };
7444
- handleKeyDown = () => { };
7445
- render() {
7446
- if (!this.item) {
7447
- return;
7448
- }
7449
- if (typeof this.template === 'undefined') {
7450
- return (hAsync("div", { class: 'searchcraft-search-result searchcraft-search-result-no-template', onClick: this.handleResultContainerClick, onKeyDown: this.handleKeyDown }, Object.entries(this.item.document).map(([key, value]) => (hAsync("p", { key: key }, hAsync("strong", null, key), ": ", value)))));
7451
- }
7452
- return (hAsync("div", { class: 'searchcraft-search-result', innerHTML: this.templateHtml, onClick: this.handleResultContainerClick, onKeyDown: this.handleKeyDown }));
7453
- }
7454
- static get cmpMeta() { return {
7455
- "$flags$": 768,
7456
- "$tagName$": "searchcraft-search-result",
7457
- "$members$": {
7458
- "item": [16],
7459
- "index": [2],
7460
- "documentPosition": [2, "document-position"],
7461
- "template": [16],
7462
- "searchcraftId": [1, "searchcraft-id"],
7463
- "templateHtml": [32]
7464
- },
7465
- "$listeners$": undefined,
7466
- "$lazyBundleId$": "-",
7467
- "$attrsToReflect$": []
7468
- }; }
7469
- }
7470
-
7471
- /**
7472
- * This web component is responsible for displaying the results of a search query. Once a query is submitted, the component formats and presents an ordered list of the results.
7473
- *
7474
- *
7475
- * @react-import
7476
- * ```jsx
7477
- * import { SearchcraftSearchResults } from "@searchcraft/react-sdk";
7478
- * ```
7479
- *
7480
- * @vue-import
7481
- * ```jsx
7482
- * import { SearchcraftSearchResults } from "@searchcraft/vue-sdk";
7483
- * ```
7484
- *
7485
- * @js-example
7486
- * ```html
7487
- * <!-- index.html -->
7488
- * <searchcraft-search-results
7489
- * ad-interval="4"
7490
- * place-ad-at-start="true"
7491
- * />
7492
- * ```
7493
- *
7494
- * ```js
7495
- * // index.js
7496
- * const searchResults = document.querySelector('searchcraft-search-results');
7497
- *
7498
- * searchResults.template = (item, index, { html }) => html`
7499
- * <h2>${item.title}</h2>
7500
- * `;
7501
- * ```
7502
- *
7503
- * @react-example
7504
- * ```jsx
7505
- * <SearchcraftSearchResults
7506
- * adInterval={4}
7507
- * placeAdAtState={true}
7508
- * template={(item, index, { html }) => html`
7509
- * <h2>${item.title}</h2>
7510
- * `}
7511
- * />
7512
- * ```
7513
- *
7514
- * @vue-example
7515
- * ```jsx
7516
- * <SearchcraftSearchResults
7517
- * adInterval={4}
7518
- * placeAdAtState={true}
7519
- * :template={(item, index, { html }) => html`
7520
- * <h2>${item.title}</h2>
7521
- * `}
7522
- * />
7523
- * ```
7524
- */
7525
- class SearchcraftSearchResults {
7526
- constructor(hostRef) {
7527
- registerInstance(this, hostRef);
7528
- }
7529
- /**
7530
- * The id of the Searchcraft instance that this component should use.
7531
- */
7532
- searchcraftId;
7533
- /**
7534
- * A query that will appears when the component initializes or the search term is ''..
7535
- */
7536
- initialQuery;
7537
- /**
7538
- * A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
7539
- */
7540
- template;
7541
- adClientResponseItems = [];
7542
- config;
7543
- isSearchInProgress = true;
7544
- searchClientResponseItems;
7545
- searchResultsPage;
7546
- searchResultsPerPage;
7547
- searchTerm = '';
7548
- unsubscribe;
7549
- cleanupCore;
7550
- onCoreAvailable(core) {
7551
- const state = core.store.getState();
7552
- this.handleStateChange(state);
7553
- this.searchClientResponseItems = state.searchClientResponseItems;
7554
- this.searchTerm = state.searchTerm;
7555
- this.config = state.core?.config;
7556
- this.unsubscribe = core.store.subscribe((state) => this.handleStateChange(state));
7557
- }
7558
- connectedCallback() {
7559
- this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
7560
- }
7561
- disconnectedCallback() {
7562
- this.unsubscribe?.();
7563
- this.cleanupCore?.();
7564
- }
7565
- handleStateChange(state) {
7566
- this.adClientResponseItems = [...state.adClientResponseItems];
7567
- this.config = state.core?.config;
7568
- this.isSearchInProgress = state.isSearchInProgress;
7569
- this.searchClientResponseItems = [...state.searchClientResponseItems];
7570
- this.searchResultsPage = state.searchResultsPage;
7571
- this.searchResultsPerPage = state.searchResultsPerPage;
7572
- this.searchTerm = state.searchTerm;
7573
- }
7574
- renderEmptyState() {
7575
- return (hAsync("div", { class: 'searchcraft-search-results-empty-state' }, hAsync("slot", { name: 'empty-search' })));
7576
- }
7577
- renderNoResultsFoundState() {
7578
- return (hAsync("div", { class: 'searchcraft-search-results' }, hAsync("div", { class: 'searchcraft-search-results-error-message' }, hAsync("searchcraft-error-message", null, "No search results found for \"", this.searchTerm, "\" query."))));
7579
- }
7580
- renderWithADMAds() {
7581
- const items = this.searchClientResponseItems || [];
7582
- return (hAsync("div", { class: 'searchcraft-search-results' }, this.adClientResponseItems?.map((item) => (hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'adMarketplace', adClientResponseItem: item, key: item.id, renderPosition: 'top' }))), items.map((item, index) => (hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template })))));
7583
- }
7584
- renderWithCustomAds() {
7585
- const itemsToRender = [];
7586
- const interstitialInterval = this.config?.customAdConfig?.adInterstitialInterval || 0;
7587
- const interstitialQuantity = this.config?.customAdConfig?.adInterstitialQuantity || 1;
7588
- const adStartQuantity = this.config?.customAdConfig?.adStartQuantity || 0;
7589
- const adEndQuantity = this.config?.customAdConfig?.adEndQuantity || 0;
7590
- const items = this.searchClientResponseItems || [];
7591
- // Renders ads at beginning
7592
- for (let n = 0; n < adStartQuantity; n++) {
7593
- itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Custom', key: `${n}-ad`, renderPosition: 'top' }));
7594
- }
7595
- // Renders search results + interstitial ads
7596
- items.forEach((item, index) => {
7597
- if (interstitialInterval &&
7598
- index % interstitialInterval === 0 &&
7599
- index + interstitialInterval < items.length &&
7600
- index >= interstitialInterval) {
7601
- for (let n = 0; n < interstitialQuantity; n++) {
7602
- itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Custom', key: `${item.id}-ad-${n}`, renderPosition: 'interstitial' }));
7603
- }
7604
- }
7605
- itemsToRender.push(hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template }));
7606
- });
7607
- // Renders ads at end
7608
- for (let n = 0; n < adEndQuantity; n++) {
7609
- itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Custom', key: `${n}-ad`, renderPosition: 'bottom' }));
7610
- }
7611
- return hAsync("div", { class: 'searchcraft-search-results' }, itemsToRender);
7612
- }
7613
- renderWithNativoAds() {
7614
- const itemsToRender = [];
7615
- const interstitialStartIndex = this.config?.nativoConfig?.adInterstialStartIndex || 0;
7616
- const interstitialInterval = this.config?.nativoConfig?.adInterstitialInterval || 0;
7617
- const interstitialQuantity = this.config?.nativoConfig?.adInterstitialQuantity || 1;
7618
- const adStartQuantity = this.config?.nativoConfig?.adStartQuantity || 0;
7619
- const adEndQuantity = this.config?.nativoConfig?.adEndQuantity || 0;
7620
- const items = this.searchClientResponseItems || [];
7621
- // Renders ads at beginning
7622
- for (let n = 0; n < adStartQuantity; n++) {
7623
- itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Nativo', key: `${n}-ad`, renderPosition: 'top' }));
7624
- }
7625
- // Renders search results + interstitial ads
7626
- items.forEach((item, index) => {
7627
- if (interstitialInterval &&
7628
- (index + interstitialStartIndex) % interstitialInterval === 0 &&
7629
- index + interstitialInterval < items.length &&
7630
- index >= interstitialInterval) {
7631
- for (let n = 0; n < interstitialQuantity; n++) {
7632
- itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Nativo', key: `${item.id}-ad-${n}`, renderPosition: 'interstitial' }));
7633
- }
7634
- }
7635
- itemsToRender.push(hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template }));
7636
- });
7637
- // Renders ads at end
7638
- for (let n = 0; n < adEndQuantity; n++) {
7639
- itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Nativo', key: `${n}-ad`, renderPosition: 'bottom' }));
7640
- }
7641
- return hAsync("div", { class: 'searchcraft-search-results' }, itemsToRender);
7642
- }
7643
- renderWithNoAds() {
7644
- const items = this.searchClientResponseItems || [];
7645
- return (hAsync("div", { class: 'searchcraft-search-results' }, items.map((item, index) => (hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template })))));
7646
- }
7647
- render() {
7648
- const searchClientResponseItems = this.searchClientResponseItems || [];
7649
- if (searchClientResponseItems.length === 0 && !this.isSearchInProgress) {
7650
- return this.renderEmptyState();
7651
- }
7652
- if (this.searchTerm.length > 0 &&
7653
- searchClientResponseItems.length === 0 &&
7654
- !this.isSearchInProgress) {
7655
- return this.renderNoResultsFoundState();
7656
- }
7657
- if (this.config?.customAdConfig) {
7658
- return this.renderWithCustomAds();
7659
- }
7660
- if (this.config?.admAdConfig) {
7661
- return this.renderWithNativoAds();
7662
- }
7663
- if (this.config?.nativoConfig) {
7664
- return this.renderWithNativoAds();
7665
- }
7666
- return this.renderWithNoAds();
7667
- }
7668
- static get cmpMeta() { return {
7669
- "$flags$": 772,
7670
- "$tagName$": "searchcraft-search-results",
7671
- "$members$": {
7672
- "searchcraftId": [1, "searchcraft-id"],
7673
- "initialQuery": [1, "initial-query"],
7674
- "template": [16],
7675
- "adClientResponseItems": [32],
7676
- "config": [32],
7677
- "isSearchInProgress": [32],
7678
- "searchClientResponseItems": [32],
7679
- "searchResultsPage": [32],
7680
- "searchResultsPerPage": [32],
7681
- "searchTerm": [32]
7682
- },
7683
- "$listeners$": undefined,
7684
- "$lazyBundleId$": "-",
7685
- "$attrsToReflect$": []
7686
- }; }
7687
- }
7688
-
7689
- /**
7690
- * This web component is designed to choose the number of search results displayed.
7691
- *
7692
- * @react-import
7693
- * ```jsx
7694
- * import { SearchcraftSearchResultsPerPage } from "@searchcraft/react-sdk";
7695
- * ```
7696
- *
7697
- * @vue-import
7698
- * ```jsx
7699
- * import { SearchcraftSearchResultsPerPage } from "@searchcraft/vue-sdk";
7700
- * ```
7701
- *
7702
- * @js-example
7703
- * ```html
7704
- * <!-- index.html -->
7705
- * <searchcraft-search-results-per-page increment="20" />
7706
- * ```
7707
- *
7708
- * @react-example
7709
- * ```jsx
7710
- * <SearchcraftSearchResultsPerPage increment={20} />
7711
- * ```
7712
- *
7713
- * @vue-example
7714
- * ```jsx
7715
- * <SearchcraftSearchResultsPerPage increment="20" />
7716
- * ```
7717
- */
7718
- class SearchcraftSearchResultsPerPage {
7719
- constructor(hostRef) {
7720
- registerInstance(this, hostRef);
7721
- }
7722
- /**
7723
- * The amount the options will increase (e.g. 20 = [20, 40, 60, 80, 100]).
7724
- * The base value is defined by the `searchResultsPerPage` option in the configuration.
7725
- */
7726
- increment = 20;
7727
- /**
7728
- * The id of the Searchcraft instance that this component should use.
7729
- */
7730
- searchcraftId;
7731
- // store vars
7732
- searchTerm;
7733
- searchResultsPage;
7734
- searchResultsPerPage;
7735
- searchResultsCount;
7736
- searchResultsPagesCount;
7737
- searchClientRequestProperties;
7738
- // local vars
7739
- initialSearchResultsPerPage;
7740
- // store functions
7741
- setSearchResultsPerPage = () => { };
7742
- setSearchResultsPage = () => { };
7743
- unsubscribe = () => { };
7744
- cleanupCore;
7745
- onCoreAvailable(core) {
7746
- this.unsubscribe = core.store.subscribe((state) => {
7747
- // store vars
7748
- this.searchTerm = state.searchTerm;
7749
- this.searchResultsPerPage = state.searchResultsPerPage;
7750
- this.searchResultsPage = state.searchResultsPage;
7751
- this.searchResultsCount = state.searchResultsCount;
7752
- this.searchClientRequestProperties = state.searchClientRequestProperties;
7753
- // local vars
7754
- this.searchResultsPagesCount = Math.ceil(this.searchResultsCount / this.searchResultsPerPage);
7755
- // store functions
7756
- this.setSearchResultsPage = state.setSearchResultsPage;
7757
- this.setSearchResultsPerPage = state.setSearchResultsPerPage;
7758
- });
7759
- this.initialSearchResultsPerPage =
7760
- core.store.getState().searchResultsPerPage;
7761
- }
7762
- connectedCallback() {
7763
- this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
7764
- }
7765
- disconnectedCallback() {
7766
- this.unsubscribe?.();
7767
- this.cleanupCore?.();
7768
- }
7769
- render() {
7770
- // Check if this is an initialQuery case (string requestProperties with empty searchTerm)
7771
- const isInitialQuery = typeof this.searchClientRequestProperties === 'string' &&
7772
- this.searchTerm.trim() === '';
7773
- // early return if there isn't a searchTerm (unless it's initialQuery) or there is 1 or fewer pages of results
7774
- if ((!this.searchTerm && !isInitialQuery) ||
7775
- this.searchResultsPagesCount <= 1) {
7776
- return;
7777
- }
7778
- return (hAsync("div", { class: 'searchcraft-search-results-per-page' }, hAsync("div", { class: 'searchcraft-search-results-per-page-select' }, hAsync("label", { class: 'searchcraft-search-results-per-page-select-label', htmlFor: 'searchcraft-search-results-per-page-select-input' }, "Results Per Page"), hAsync("div", { class: 'searchcraft-search-results-per-page-select-input' }, hAsync("searchcraft-select", { inputId: 'searchcraft-search-results-per-page-select-input', name: 'results-per-page', options: [...Array(5)].map((_, index) => {
7779
- const value = this.initialSearchResultsPerPage +
7780
- Number(this.increment) * index;
7781
- return {
7782
- label: `${value}`,
7783
- value,
7784
- };
7785
- }), onSelectChange: (event) => {
7786
- this.setSearchResultsPerPage(Number(event.detail));
7787
- this.setSearchResultsPage(1);
7788
- } })))));
7789
- }
7790
- static get cmpMeta() { return {
7791
- "$flags$": 768,
7792
- "$tagName$": "searchcraft-search-results-per-page",
7793
- "$members$": {
7794
- "increment": [8],
7795
- "searchcraftId": [1, "searchcraft-id"],
7796
- "searchTerm": [32],
7797
- "searchResultsPage": [32],
7798
- "searchResultsPerPage": [32],
7799
- "searchResultsCount": [32],
7800
- "searchResultsPagesCount": [32],
7801
- "searchClientRequestProperties": [32],
7802
- "initialSearchResultsPerPage": [32],
7803
- "setSearchResultsPerPage": [32],
7804
- "setSearchResultsPage": [32]
7805
- },
7806
- "$listeners$": undefined,
7807
- "$lazyBundleId$": "-",
7808
- "$attrsToReflect$": []
7809
- }; }
7810
- }
7811
-
7812
- /**
7813
- * This web component is designed to allow users to select between a group of options.
7814
- *
7815
- * @js-example
7816
- * ```html
7817
- * <!-- index.html -->
7818
- * <searchcraft-select
7819
- * inputId="searchcraft-select"
7820
- * name="searchcraft-select"
7821
- * options="[{ label: 'label', value: 'value' }]"
7822
- * />
7823
- * ```
7824
- *
7825
- * @internal
7826
- */
7827
- class SearchcraftSelect {
7828
- constructor(hostRef) {
7829
- registerInstance(this, hostRef);
7830
- this.selectChange = createEvent(this, "selectChange");
7831
- }
7832
- /**
7833
- * The caption displayed below the select input.
7834
- */
7835
- caption;
7836
- /**
7837
- * Whether the select input is disabled.
7838
- */
7839
- disabled = false;
7840
- /**
7841
- * The ID for the select input.
7842
- */
7843
- inputId;
7844
- /**
7845
- * The label of the select input.
7846
- */
7847
- label;
7848
- /**
7849
- * The ID for the label of the select input.
7850
- */
7851
- labelId;
7852
- /**
7853
- * The name of the select input.
7854
- */
7855
- name;
7856
- /**
7857
- * The options for the select input.
7858
- */
7859
- options = [];
7860
- /**
7861
- * The event fired when the select is changed.
7862
- */
7863
- selectChange;
7864
- searchResultsPerPage;
7865
- setSearchResultsPage = () => { };
7866
- setSearchResultsPerPage = () => { };
7867
- handleSelectChange = (event) => {
7868
- this.selectChange.emit(event.target.value);
7869
- };
7870
- handleGoToPage(page) {
7871
- this.setSearchResultsPage(page);
7872
- }
7873
- render() {
7874
- return (hAsync("div", { key: '15ecbf48c824a161cd83bdab99dace8e44f1ab39', class: 'searchcraft-select' }, this.label && (hAsync("label", { key: 'aba433ae9c27c9405099cffcef923c3ad22d7fda', class: 'searchcraft-select-label', id: this.labelId || `${this.inputId}-label`, htmlFor: this.inputId }, this.label)), hAsync("div", { key: '8df8a2ff05924c9c55cdd6e3827cd927cddab82a', class: 'searchcraft-select-input-wrapper' }, hAsync("select", { key: '1d5f492c2255f8ca1b6ea5e04a2726dda2f2c52f', "aria-labelledby": this.label ? this.labelId || `${this.inputId}-label` : undefined, class: 'searchcraft-select-input', disabled: this.disabled, id: this.inputId, name: this.name, onChange: this.handleSelectChange }, (typeof this.options === 'string'
7875
- ? JSON.parse(this.options)
7876
- : this.options).map(({ label, value, selected }) => {
7877
- return (hAsync("option", { key: value, value: value, selected: selected }, label));
7878
- })), hAsync("svg", { key: '0ec6892b529f2e70027aadea47208582a65a97b7', class: 'searchcraft-select-input-icon', width: '20', height: '20', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' }, hAsync("title", { key: 'bced6b62378491d1d1c629b602d7d033d912c761' }, "Select dropdown icon"), hAsync("path", { key: '659f8ebf9129e2e7941da949d29688c41c1472bb', d: 'M5 7.5L10 12.5L15 7.5', stroke: 'currentColor', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' }))), this.caption && (hAsync("p", { key: '51217d926f68f79b6c3514f5fd769b56549fdce9', class: 'searchcraft-select-caption' }, this.caption))));
7879
- }
7880
- static get cmpMeta() { return {
7881
- "$flags$": 768,
7882
- "$tagName$": "searchcraft-select",
7883
- "$members$": {
7884
- "caption": [1],
7885
- "disabled": [4],
7886
- "inputId": [1, "input-id"],
7887
- "label": [1],
7888
- "labelId": [1, "label-id"],
7889
- "name": [1],
7890
- "options": [1],
7891
- "searchResultsPerPage": [32],
7892
- "setSearchResultsPage": [32],
7893
- "setSearchResultsPerPage": [32]
7894
- },
7895
- "$listeners$": undefined,
7896
- "$lazyBundleId$": "-",
7897
- "$attrsToReflect$": []
7898
- }; }
7899
- }
7900
-
7901
- /**
7902
- * Creates a throttled version of the given function that only invokes
7903
- * the original function at most once every specified number of milliseconds.
7904
- *
7905
- * The logic is written in a way that the last invocation is always called, after the
7906
- * throttle cooldown period has ended.
7907
- *
7908
- * @template Arguments - The argument types for the function to throttle
7909
- * @param callback - The function to throttle
7910
- * @param delayInMilliseconds - The number of milliseconds to wait before allowing the next invocation
7911
- * @returns A throttled version of the original function
7912
- */
7913
- function throttle(callback, delayInMilliseconds) {
7914
- let isThrottleOnCooldown = false;
7915
- let trailingCallArgs = null;
7916
- const invokeAction = (args) => {
7917
- callback(...args);
7918
- isThrottleOnCooldown = true;
7919
- setTimeout(() => {
7920
- isThrottleOnCooldown = false;
7921
- if (trailingCallArgs) {
7922
- const nextArgs = trailingCallArgs;
7923
- trailingCallArgs = null;
7924
- invokeAction(nextArgs);
7925
- }
7926
- }, delayInMilliseconds);
7927
- };
7928
- return (...args) => {
7929
- if (!isThrottleOnCooldown) {
7930
- invokeAction(args);
7931
- }
7932
- else {
7933
- trailingCallArgs = args;
7934
- }
7935
- };
7936
- }
7937
-
7938
- /**
7939
- * This web component is designed to allow users to select a value from a range defined by a minimum and maximum value. The component renders a slider interface, which can be used to visually choose a value between two boundaries.
7940
- *
7941
- * @internal
7942
- */
7943
- class SearchcraftSlider {
7944
- constructor(hostRef) {
7945
- registerInstance(this, hostRef);
7946
- this.rangeChanged = createEvent(this, "rangeChanged");
7947
- }
7948
- /**
7949
- * The maximum value allowed.
7950
- */
7951
- max = 100;
7952
- /**
7953
- * The minimum value allowed.
7954
- */
7955
- min = 0;
7956
- /**
7957
- * The step amount for the slider inputs.
7958
- */
7959
- step = 1;
7960
- /** The type of data the sliders are using. */
7961
- dataType = 'number';
7962
- /** The date granularity to use. Used to format date labels. */
7963
- dateGranularity;
7964
- lowerBound = 0;
7965
- upperBound = 1;
7966
- endValue = 0;
7967
- startValue = 0;
7968
- lastFocusedHandle = 'max';
7969
- throttledEmitUpdate = () => { };
7970
- /**
7971
- * When the range has changed.
7972
- * */
7973
- rangeChanged;
7974
- connectedCallback() {
7975
- switch (this.dataType) {
7976
- case 'number':
7977
- this.startValue = this.min;
7978
- this.endValue = this.max;
7979
- this.lowerBound = this.min;
7980
- this.upperBound = this.max;
7981
- break;
7982
- case 'date': {
7983
- this.startValue = 0;
7984
- this.endValue = getDifferenceInUnits(this.dateGranularity || 'year', this.min, this.max);
7985
- this.lowerBound = 0;
7986
- this.upperBound = this.endValue;
7987
- break;
7988
- }
7989
- }
7990
- this.throttledEmitUpdate = throttle(this.emitUpdate, 120);
7991
- }
7992
- emitUpdate = async () => {
7993
- switch (this.dataType) {
7994
- case 'number':
7995
- this.rangeChanged?.emit({
7996
- startValue: this.startValue,
7997
- endValue: this.endValue,
7998
- });
7999
- break;
8000
- case 'date': {
8001
- const granularity = this.dateGranularity || 'year';
8002
- const startTimestamp = getStartOf(this.min, granularity, this.lowerBound + this.startValue);
8003
- const endTimestamp = getStartOf(this.min, granularity, this.lowerBound + this.endValue + 1);
8004
- this.rangeChanged?.emit({
8005
- startValue: startTimestamp,
8006
- endValue: endTimestamp,
8007
- });
8008
- break;
8009
- }
8010
- }
8011
- };
8012
- handleStartValueChange = (event) => {
8013
- const inputElement = event.target;
8014
- const value = Number.parseInt(inputElement.value, 10);
8015
- this.lastFocusedHandle = 'min';
8016
- if (value <= this.endValue) {
8017
- this.startValue = value;
8018
- this.throttledEmitUpdate();
8019
- }
8020
- else {
8021
- this.startValue = this.endValue;
8022
- inputElement.value = `${this.endValue}`;
8023
- }
8024
- };
8025
- handleEndValueChange = (event) => {
8026
- const inputElement = event.target;
8027
- const value = Number.parseInt(inputElement.value, 10);
8028
- this.lastFocusedHandle = 'max';
8029
- if (value >= this.startValue) {
8030
- this.endValue = value;
8031
- this.throttledEmitUpdate();
8032
- }
8033
- else {
8034
- this.endValue = this.startValue;
8035
- inputElement.value = `${this.startValue}`;
8036
- }
8037
- };
8038
- getLabel = (value) => {
8039
- switch (this.dataType) {
8040
- case 'number':
8041
- return `${this.startValue}`;
8042
- case 'date': {
8043
- const granularity = this.dateGranularity || 'year';
8044
- const dateOffset = this.lowerBound + value;
8045
- const timestamp = getStartOf(this.min, granularity, dateOffset);
8046
- return getFormattedDateString(this.dateGranularity || 'year', new Date(timestamp));
8047
- }
8048
- }
8049
- };
8050
- render() {
8051
- const startPercent = ((this.startValue - this.lowerBound) /
8052
- (this.upperBound - this.lowerBound)) *
8053
- 100;
8054
- const endPercent = ((this.endValue - this.lowerBound) /
8055
- (this.upperBound - this.lowerBound)) *
8056
- 100;
8057
- const startLabel = this.getLabel(this.startValue);
8058
- const endLabel = this.getLabel(this.endValue);
8059
- return (hAsync("div", { key: '59b07f5c8a14f6cbad8bae6faebf12e9a511bcbb', class: 'searchcraft-slider' }, hAsync("div", { key: '603c0bc39c6fe018016caf17b3b73f5b3c410fba', class: 'searchcraft-slider-range' }, hAsync("div", { key: '31d4097f29aa13d0ab14ec861ecea803e8190ed0', class: 'searchcraft-slider-active-range', style: {
8060
- left: `${startPercent}%`,
8061
- width: `${endPercent - startPercent}%`,
8062
- } }), hAsync("input", { key: '40299fe0d7b973b448151a045b7a7f6c3b8846fd', class: classNames('searchcraft-slider-input', 'searchcraft-slider-input-min-handle'), max: this.upperBound, min: this.lowerBound, onInput: this.handleStartValueChange.bind(this), step: this.step, style: { zIndex: this.lastFocusedHandle === 'min' ? '2' : '1' }, type: 'range', value: this.startValue }), hAsync("input", { key: 'd46ad0cee946b168cd6004f8a2f819f6e46c50e4', class: classNames('searchcraft-slider-input', 'searchcraft-slider-input-max-handle'), max: this.upperBound, min: this.lowerBound, onInput: this.handleEndValueChange.bind(this), step: this.step, style: { zIndex: this.lastFocusedHandle === 'max' ? '2' : '1' }, type: 'range', value: this.endValue })), hAsync("div", { key: 'e65452bc456b0fa69d0dc0dd1276e19b9cf521e6', class: 'searchcraft-slider-label' }, hAsync("span", { key: '2b5aec3e96d9bc9420b047a1d00cce40f361c729', class: 'searchcraft-slider-start-label' }, startLabel), hAsync("span", { key: 'fce2109bd481b3df9ac4beee3731a24c012e4512', class: 'searchcraft-slider-end-label' }, endLabel))));
8063
- }
8064
- static get cmpMeta() { return {
8065
- "$flags$": 768,
8066
- "$tagName$": "searchcraft-slider",
8067
- "$members$": {
8068
- "max": [2],
8069
- "min": [2],
8070
- "step": [2],
8071
- "dataType": [1, "data-type"],
8072
- "dateGranularity": [1, "date-granularity"],
8073
- "lowerBound": [32],
8074
- "upperBound": [32],
8075
- "endValue": [32],
8076
- "startValue": [32],
8077
- "lastFocusedHandle": [32]
8078
- },
8079
- "$listeners$": undefined,
8080
- "$lazyBundleId$": "-",
8081
- "$attrsToReflect$": []
8082
- }; }
8083
- }
8084
-
8085
7373
  /**
8086
7374
  * marked v15.0.12 - a markdown parser
8087
7375
  * Copyright (c) 2011-2025, Christopher Jeffrey. (MIT Licensed)
@@ -8844,1404 +8132,2226 @@ ${currentText}` : currentText;
8844
8132
  };
8845
8133
  }));
8846
8134
  }
8847
- return item;
8135
+ return item;
8136
+ }
8137
+ lheading(src) {
8138
+ const cap = this.rules.block.lheading.exec(src);
8139
+ if (cap) {
8140
+ return {
8141
+ type: "heading",
8142
+ raw: cap[0],
8143
+ depth: cap[2].charAt(0) === "=" ? 1 : 2,
8144
+ text: cap[1],
8145
+ tokens: this.lexer.inline(cap[1])
8146
+ };
8147
+ }
8148
+ }
8149
+ paragraph(src) {
8150
+ const cap = this.rules.block.paragraph.exec(src);
8151
+ if (cap) {
8152
+ const text = cap[1].charAt(cap[1].length - 1) === "\n" ? cap[1].slice(0, -1) : cap[1];
8153
+ return {
8154
+ type: "paragraph",
8155
+ raw: cap[0],
8156
+ text,
8157
+ tokens: this.lexer.inline(text)
8158
+ };
8159
+ }
8160
+ }
8161
+ text(src) {
8162
+ const cap = this.rules.block.text.exec(src);
8163
+ if (cap) {
8164
+ return {
8165
+ type: "text",
8166
+ raw: cap[0],
8167
+ text: cap[0],
8168
+ tokens: this.lexer.inline(cap[0])
8169
+ };
8170
+ }
8171
+ }
8172
+ escape(src) {
8173
+ const cap = this.rules.inline.escape.exec(src);
8174
+ if (cap) {
8175
+ return {
8176
+ type: "escape",
8177
+ raw: cap[0],
8178
+ text: cap[1]
8179
+ };
8180
+ }
8181
+ }
8182
+ tag(src) {
8183
+ const cap = this.rules.inline.tag.exec(src);
8184
+ if (cap) {
8185
+ if (!this.lexer.state.inLink && this.rules.other.startATag.test(cap[0])) {
8186
+ this.lexer.state.inLink = true;
8187
+ } else if (this.lexer.state.inLink && this.rules.other.endATag.test(cap[0])) {
8188
+ this.lexer.state.inLink = false;
8189
+ }
8190
+ if (!this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(cap[0])) {
8191
+ this.lexer.state.inRawBlock = true;
8192
+ } else if (this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(cap[0])) {
8193
+ this.lexer.state.inRawBlock = false;
8194
+ }
8195
+ return {
8196
+ type: "html",
8197
+ raw: cap[0],
8198
+ inLink: this.lexer.state.inLink,
8199
+ inRawBlock: this.lexer.state.inRawBlock,
8200
+ block: false,
8201
+ text: cap[0]
8202
+ };
8203
+ }
8204
+ }
8205
+ link(src) {
8206
+ const cap = this.rules.inline.link.exec(src);
8207
+ if (cap) {
8208
+ const trimmedUrl = cap[2].trim();
8209
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(trimmedUrl)) {
8210
+ if (!this.rules.other.endAngleBracket.test(trimmedUrl)) {
8211
+ return;
8212
+ }
8213
+ const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), "\\");
8214
+ if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
8215
+ return;
8216
+ }
8217
+ } else {
8218
+ const lastParenIndex = findClosingBracket(cap[2], "()");
8219
+ if (lastParenIndex === -2) {
8220
+ return;
8221
+ }
8222
+ if (lastParenIndex > -1) {
8223
+ const start = cap[0].indexOf("!") === 0 ? 5 : 4;
8224
+ const linkLen = start + cap[1].length + lastParenIndex;
8225
+ cap[2] = cap[2].substring(0, lastParenIndex);
8226
+ cap[0] = cap[0].substring(0, linkLen).trim();
8227
+ cap[3] = "";
8228
+ }
8229
+ }
8230
+ let href = cap[2];
8231
+ let title = "";
8232
+ if (this.options.pedantic) {
8233
+ const link2 = this.rules.other.pedanticHrefTitle.exec(href);
8234
+ if (link2) {
8235
+ href = link2[1];
8236
+ title = link2[3];
8237
+ }
8238
+ } else {
8239
+ title = cap[3] ? cap[3].slice(1, -1) : "";
8240
+ }
8241
+ href = href.trim();
8242
+ if (this.rules.other.startAngleBracket.test(href)) {
8243
+ if (this.options.pedantic && !this.rules.other.endAngleBracket.test(trimmedUrl)) {
8244
+ href = href.slice(1);
8245
+ } else {
8246
+ href = href.slice(1, -1);
8247
+ }
8248
+ }
8249
+ return outputLink(cap, {
8250
+ href: href ? href.replace(this.rules.inline.anyPunctuation, "$1") : href,
8251
+ title: title ? title.replace(this.rules.inline.anyPunctuation, "$1") : title
8252
+ }, cap[0], this.lexer, this.rules);
8253
+ }
8254
+ }
8255
+ reflink(src, links) {
8256
+ let cap;
8257
+ if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) {
8258
+ const linkString = (cap[2] || cap[1]).replace(this.rules.other.multipleSpaceGlobal, " ");
8259
+ const link2 = links[linkString.toLowerCase()];
8260
+ if (!link2) {
8261
+ const text = cap[0].charAt(0);
8262
+ return {
8263
+ type: "text",
8264
+ raw: text,
8265
+ text
8266
+ };
8267
+ }
8268
+ return outputLink(cap, link2, cap[0], this.lexer, this.rules);
8269
+ }
8270
+ }
8271
+ emStrong(src, maskedSrc, prevChar = "") {
8272
+ let match = this.rules.inline.emStrongLDelim.exec(src);
8273
+ if (!match) return;
8274
+ if (match[3] && prevChar.match(this.rules.other.unicodeAlphaNumeric)) return;
8275
+ const nextChar = match[1] || match[2] || "";
8276
+ if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {
8277
+ const lLength = [...match[0]].length - 1;
8278
+ let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;
8279
+ const endReg = match[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
8280
+ endReg.lastIndex = 0;
8281
+ maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
8282
+ while ((match = endReg.exec(maskedSrc)) != null) {
8283
+ rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];
8284
+ if (!rDelim) continue;
8285
+ rLength = [...rDelim].length;
8286
+ if (match[3] || match[4]) {
8287
+ delimTotal += rLength;
8288
+ continue;
8289
+ } else if (match[5] || match[6]) {
8290
+ if (lLength % 3 && !((lLength + rLength) % 3)) {
8291
+ midDelimTotal += rLength;
8292
+ continue;
8293
+ }
8294
+ }
8295
+ delimTotal -= rLength;
8296
+ if (delimTotal > 0) continue;
8297
+ rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
8298
+ const lastCharLength = [...match[0]][0].length;
8299
+ const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);
8300
+ if (Math.min(lLength, rLength) % 2) {
8301
+ const text2 = raw.slice(1, -1);
8302
+ return {
8303
+ type: "em",
8304
+ raw,
8305
+ text: text2,
8306
+ tokens: this.lexer.inlineTokens(text2)
8307
+ };
8308
+ }
8309
+ const text = raw.slice(2, -2);
8310
+ return {
8311
+ type: "strong",
8312
+ raw,
8313
+ text,
8314
+ tokens: this.lexer.inlineTokens(text)
8315
+ };
8316
+ }
8317
+ }
8318
+ }
8319
+ codespan(src) {
8320
+ const cap = this.rules.inline.code.exec(src);
8321
+ if (cap) {
8322
+ let text = cap[2].replace(this.rules.other.newLineCharGlobal, " ");
8323
+ const hasNonSpaceChars = this.rules.other.nonSpaceChar.test(text);
8324
+ const hasSpaceCharsOnBothEnds = this.rules.other.startingSpaceChar.test(text) && this.rules.other.endingSpaceChar.test(text);
8325
+ if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
8326
+ text = text.substring(1, text.length - 1);
8327
+ }
8328
+ return {
8329
+ type: "codespan",
8330
+ raw: cap[0],
8331
+ text
8332
+ };
8333
+ }
8848
8334
  }
8849
- lheading(src) {
8850
- const cap = this.rules.block.lheading.exec(src);
8335
+ br(src) {
8336
+ const cap = this.rules.inline.br.exec(src);
8851
8337
  if (cap) {
8852
8338
  return {
8853
- type: "heading",
8339
+ type: "br",
8340
+ raw: cap[0]
8341
+ };
8342
+ }
8343
+ }
8344
+ del(src) {
8345
+ const cap = this.rules.inline.del.exec(src);
8346
+ if (cap) {
8347
+ return {
8348
+ type: "del",
8854
8349
  raw: cap[0],
8855
- depth: cap[2].charAt(0) === "=" ? 1 : 2,
8856
- text: cap[1],
8857
- tokens: this.lexer.inline(cap[1])
8350
+ text: cap[2],
8351
+ tokens: this.lexer.inlineTokens(cap[2])
8858
8352
  };
8859
8353
  }
8860
8354
  }
8861
- paragraph(src) {
8862
- const cap = this.rules.block.paragraph.exec(src);
8355
+ autolink(src) {
8356
+ const cap = this.rules.inline.autolink.exec(src);
8863
8357
  if (cap) {
8864
- const text = cap[1].charAt(cap[1].length - 1) === "\n" ? cap[1].slice(0, -1) : cap[1];
8358
+ let text, href;
8359
+ if (cap[2] === "@") {
8360
+ text = cap[1];
8361
+ href = "mailto:" + text;
8362
+ } else {
8363
+ text = cap[1];
8364
+ href = text;
8365
+ }
8865
8366
  return {
8866
- type: "paragraph",
8367
+ type: "link",
8867
8368
  raw: cap[0],
8868
8369
  text,
8869
- tokens: this.lexer.inline(text)
8370
+ href,
8371
+ tokens: [
8372
+ {
8373
+ type: "text",
8374
+ raw: text,
8375
+ text
8376
+ }
8377
+ ]
8870
8378
  };
8871
8379
  }
8872
8380
  }
8873
- text(src) {
8874
- const cap = this.rules.block.text.exec(src);
8875
- if (cap) {
8381
+ url(src) {
8382
+ let cap;
8383
+ if (cap = this.rules.inline.url.exec(src)) {
8384
+ let text, href;
8385
+ if (cap[2] === "@") {
8386
+ text = cap[0];
8387
+ href = "mailto:" + text;
8388
+ } else {
8389
+ let prevCapZero;
8390
+ do {
8391
+ prevCapZero = cap[0];
8392
+ cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? "";
8393
+ } while (prevCapZero !== cap[0]);
8394
+ text = cap[0];
8395
+ if (cap[1] === "www.") {
8396
+ href = "http://" + cap[0];
8397
+ } else {
8398
+ href = cap[0];
8399
+ }
8400
+ }
8876
8401
  return {
8877
- type: "text",
8402
+ type: "link",
8878
8403
  raw: cap[0],
8879
- text: cap[0],
8880
- tokens: this.lexer.inline(cap[0])
8404
+ text,
8405
+ href,
8406
+ tokens: [
8407
+ {
8408
+ type: "text",
8409
+ raw: text,
8410
+ text
8411
+ }
8412
+ ]
8881
8413
  };
8882
8414
  }
8883
8415
  }
8884
- escape(src) {
8885
- const cap = this.rules.inline.escape.exec(src);
8416
+ inlineText(src) {
8417
+ const cap = this.rules.inline.text.exec(src);
8886
8418
  if (cap) {
8419
+ const escaped = this.lexer.state.inRawBlock;
8887
8420
  return {
8888
- type: "escape",
8421
+ type: "text",
8889
8422
  raw: cap[0],
8890
- text: cap[1]
8423
+ text: cap[0],
8424
+ escaped
8891
8425
  };
8892
8426
  }
8893
8427
  }
8894
- tag(src) {
8895
- const cap = this.rules.inline.tag.exec(src);
8896
- if (cap) {
8897
- if (!this.lexer.state.inLink && this.rules.other.startATag.test(cap[0])) {
8898
- this.lexer.state.inLink = true;
8899
- } else if (this.lexer.state.inLink && this.rules.other.endATag.test(cap[0])) {
8900
- this.lexer.state.inLink = false;
8428
+ };
8429
+
8430
+ // src/Lexer.ts
8431
+ var _Lexer = class __Lexer {
8432
+ tokens;
8433
+ options;
8434
+ state;
8435
+ tokenizer;
8436
+ inlineQueue;
8437
+ constructor(options2) {
8438
+ this.tokens = [];
8439
+ this.tokens.links = /* @__PURE__ */ Object.create(null);
8440
+ this.options = options2 || _defaults;
8441
+ this.options.tokenizer = this.options.tokenizer || new _Tokenizer();
8442
+ this.tokenizer = this.options.tokenizer;
8443
+ this.tokenizer.options = this.options;
8444
+ this.tokenizer.lexer = this;
8445
+ this.inlineQueue = [];
8446
+ this.state = {
8447
+ inLink: false,
8448
+ inRawBlock: false,
8449
+ top: true
8450
+ };
8451
+ const rules = {
8452
+ other,
8453
+ block: block.normal,
8454
+ inline: inline.normal
8455
+ };
8456
+ if (this.options.pedantic) {
8457
+ rules.block = block.pedantic;
8458
+ rules.inline = inline.pedantic;
8459
+ } else if (this.options.gfm) {
8460
+ rules.block = block.gfm;
8461
+ if (this.options.breaks) {
8462
+ rules.inline = inline.breaks;
8463
+ } else {
8464
+ rules.inline = inline.gfm;
8465
+ }
8466
+ }
8467
+ this.tokenizer.rules = rules;
8468
+ }
8469
+ /**
8470
+ * Expose Rules
8471
+ */
8472
+ static get rules() {
8473
+ return {
8474
+ block,
8475
+ inline
8476
+ };
8477
+ }
8478
+ /**
8479
+ * Static Lex Method
8480
+ */
8481
+ static lex(src, options2) {
8482
+ const lexer2 = new __Lexer(options2);
8483
+ return lexer2.lex(src);
8484
+ }
8485
+ /**
8486
+ * Static Lex Inline Method
8487
+ */
8488
+ static lexInline(src, options2) {
8489
+ const lexer2 = new __Lexer(options2);
8490
+ return lexer2.inlineTokens(src);
8491
+ }
8492
+ /**
8493
+ * Preprocessing
8494
+ */
8495
+ lex(src) {
8496
+ src = src.replace(other.carriageReturn, "\n");
8497
+ this.blockTokens(src, this.tokens);
8498
+ for (let i = 0; i < this.inlineQueue.length; i++) {
8499
+ const next = this.inlineQueue[i];
8500
+ this.inlineTokens(next.src, next.tokens);
8501
+ }
8502
+ this.inlineQueue = [];
8503
+ return this.tokens;
8504
+ }
8505
+ blockTokens(src, tokens = [], lastParagraphClipped = false) {
8506
+ if (this.options.pedantic) {
8507
+ src = src.replace(other.tabCharGlobal, " ").replace(other.spaceLine, "");
8508
+ }
8509
+ while (src) {
8510
+ let token;
8511
+ if (this.options.extensions?.block?.some((extTokenizer) => {
8512
+ if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
8513
+ src = src.substring(token.raw.length);
8514
+ tokens.push(token);
8515
+ return true;
8516
+ }
8517
+ return false;
8518
+ })) {
8519
+ continue;
8520
+ }
8521
+ if (token = this.tokenizer.space(src)) {
8522
+ src = src.substring(token.raw.length);
8523
+ const lastToken = tokens.at(-1);
8524
+ if (token.raw.length === 1 && lastToken !== void 0) {
8525
+ lastToken.raw += "\n";
8526
+ } else {
8527
+ tokens.push(token);
8528
+ }
8529
+ continue;
8530
+ }
8531
+ if (token = this.tokenizer.code(src)) {
8532
+ src = src.substring(token.raw.length);
8533
+ const lastToken = tokens.at(-1);
8534
+ if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
8535
+ lastToken.raw += "\n" + token.raw;
8536
+ lastToken.text += "\n" + token.text;
8537
+ this.inlineQueue.at(-1).src = lastToken.text;
8538
+ } else {
8539
+ tokens.push(token);
8540
+ }
8541
+ continue;
8542
+ }
8543
+ if (token = this.tokenizer.fences(src)) {
8544
+ src = src.substring(token.raw.length);
8545
+ tokens.push(token);
8546
+ continue;
8547
+ }
8548
+ if (token = this.tokenizer.heading(src)) {
8549
+ src = src.substring(token.raw.length);
8550
+ tokens.push(token);
8551
+ continue;
8552
+ }
8553
+ if (token = this.tokenizer.hr(src)) {
8554
+ src = src.substring(token.raw.length);
8555
+ tokens.push(token);
8556
+ continue;
8557
+ }
8558
+ if (token = this.tokenizer.blockquote(src)) {
8559
+ src = src.substring(token.raw.length);
8560
+ tokens.push(token);
8561
+ continue;
8562
+ }
8563
+ if (token = this.tokenizer.list(src)) {
8564
+ src = src.substring(token.raw.length);
8565
+ tokens.push(token);
8566
+ continue;
8567
+ }
8568
+ if (token = this.tokenizer.html(src)) {
8569
+ src = src.substring(token.raw.length);
8570
+ tokens.push(token);
8571
+ continue;
8572
+ }
8573
+ if (token = this.tokenizer.def(src)) {
8574
+ src = src.substring(token.raw.length);
8575
+ const lastToken = tokens.at(-1);
8576
+ if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
8577
+ lastToken.raw += "\n" + token.raw;
8578
+ lastToken.text += "\n" + token.raw;
8579
+ this.inlineQueue.at(-1).src = lastToken.text;
8580
+ } else if (!this.tokens.links[token.tag]) {
8581
+ this.tokens.links[token.tag] = {
8582
+ href: token.href,
8583
+ title: token.title
8584
+ };
8585
+ }
8586
+ continue;
8901
8587
  }
8902
- if (!this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(cap[0])) {
8903
- this.lexer.state.inRawBlock = true;
8904
- } else if (this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(cap[0])) {
8905
- this.lexer.state.inRawBlock = false;
8588
+ if (token = this.tokenizer.table(src)) {
8589
+ src = src.substring(token.raw.length);
8590
+ tokens.push(token);
8591
+ continue;
8906
8592
  }
8907
- return {
8908
- type: "html",
8909
- raw: cap[0],
8910
- inLink: this.lexer.state.inLink,
8911
- inRawBlock: this.lexer.state.inRawBlock,
8912
- block: false,
8913
- text: cap[0]
8914
- };
8915
- }
8916
- }
8917
- link(src) {
8918
- const cap = this.rules.inline.link.exec(src);
8919
- if (cap) {
8920
- const trimmedUrl = cap[2].trim();
8921
- if (!this.options.pedantic && this.rules.other.startAngleBracket.test(trimmedUrl)) {
8922
- if (!this.rules.other.endAngleBracket.test(trimmedUrl)) {
8923
- return;
8924
- }
8925
- const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), "\\");
8926
- if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
8927
- return;
8928
- }
8929
- } else {
8930
- const lastParenIndex = findClosingBracket(cap[2], "()");
8931
- if (lastParenIndex === -2) {
8932
- return;
8593
+ if (token = this.tokenizer.lheading(src)) {
8594
+ src = src.substring(token.raw.length);
8595
+ tokens.push(token);
8596
+ continue;
8597
+ }
8598
+ let cutSrc = src;
8599
+ if (this.options.extensions?.startBlock) {
8600
+ let startIndex = Infinity;
8601
+ const tempSrc = src.slice(1);
8602
+ let tempStart;
8603
+ this.options.extensions.startBlock.forEach((getStartIndex) => {
8604
+ tempStart = getStartIndex.call({ lexer: this }, tempSrc);
8605
+ if (typeof tempStart === "number" && tempStart >= 0) {
8606
+ startIndex = Math.min(startIndex, tempStart);
8607
+ }
8608
+ });
8609
+ if (startIndex < Infinity && startIndex >= 0) {
8610
+ cutSrc = src.substring(0, startIndex + 1);
8933
8611
  }
8934
- if (lastParenIndex > -1) {
8935
- const start = cap[0].indexOf("!") === 0 ? 5 : 4;
8936
- const linkLen = start + cap[1].length + lastParenIndex;
8937
- cap[2] = cap[2].substring(0, lastParenIndex);
8938
- cap[0] = cap[0].substring(0, linkLen).trim();
8939
- cap[3] = "";
8612
+ }
8613
+ if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {
8614
+ const lastToken = tokens.at(-1);
8615
+ if (lastParagraphClipped && lastToken?.type === "paragraph") {
8616
+ lastToken.raw += "\n" + token.raw;
8617
+ lastToken.text += "\n" + token.text;
8618
+ this.inlineQueue.pop();
8619
+ this.inlineQueue.at(-1).src = lastToken.text;
8620
+ } else {
8621
+ tokens.push(token);
8940
8622
  }
8623
+ lastParagraphClipped = cutSrc.length !== src.length;
8624
+ src = src.substring(token.raw.length);
8625
+ continue;
8941
8626
  }
8942
- let href = cap[2];
8943
- let title = "";
8944
- if (this.options.pedantic) {
8945
- const link2 = this.rules.other.pedanticHrefTitle.exec(href);
8946
- if (link2) {
8947
- href = link2[1];
8948
- title = link2[3];
8627
+ if (token = this.tokenizer.text(src)) {
8628
+ src = src.substring(token.raw.length);
8629
+ const lastToken = tokens.at(-1);
8630
+ if (lastToken?.type === "text") {
8631
+ lastToken.raw += "\n" + token.raw;
8632
+ lastToken.text += "\n" + token.text;
8633
+ this.inlineQueue.pop();
8634
+ this.inlineQueue.at(-1).src = lastToken.text;
8635
+ } else {
8636
+ tokens.push(token);
8949
8637
  }
8950
- } else {
8951
- title = cap[3] ? cap[3].slice(1, -1) : "";
8638
+ continue;
8952
8639
  }
8953
- href = href.trim();
8954
- if (this.rules.other.startAngleBracket.test(href)) {
8955
- if (this.options.pedantic && !this.rules.other.endAngleBracket.test(trimmedUrl)) {
8956
- href = href.slice(1);
8640
+ if (src) {
8641
+ const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
8642
+ if (this.options.silent) {
8643
+ console.error(errMsg);
8644
+ break;
8957
8645
  } else {
8958
- href = href.slice(1, -1);
8646
+ throw new Error(errMsg);
8959
8647
  }
8960
8648
  }
8961
- return outputLink(cap, {
8962
- href: href ? href.replace(this.rules.inline.anyPunctuation, "$1") : href,
8963
- title: title ? title.replace(this.rules.inline.anyPunctuation, "$1") : title
8964
- }, cap[0], this.lexer, this.rules);
8965
8649
  }
8650
+ this.state.top = true;
8651
+ return tokens;
8966
8652
  }
8967
- reflink(src, links) {
8968
- let cap;
8969
- if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) {
8970
- const linkString = (cap[2] || cap[1]).replace(this.rules.other.multipleSpaceGlobal, " ");
8971
- const link2 = links[linkString.toLowerCase()];
8972
- if (!link2) {
8973
- const text = cap[0].charAt(0);
8974
- return {
8975
- type: "text",
8976
- raw: text,
8977
- text
8978
- };
8653
+ inline(src, tokens = []) {
8654
+ this.inlineQueue.push({ src, tokens });
8655
+ return tokens;
8656
+ }
8657
+ /**
8658
+ * Lexing/Compiling
8659
+ */
8660
+ inlineTokens(src, tokens = []) {
8661
+ let maskedSrc = src;
8662
+ let match = null;
8663
+ if (this.tokens.links) {
8664
+ const links = Object.keys(this.tokens.links);
8665
+ if (links.length > 0) {
8666
+ while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
8667
+ if (links.includes(match[0].slice(match[0].lastIndexOf("[") + 1, -1))) {
8668
+ maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
8669
+ }
8670
+ }
8979
8671
  }
8980
- return outputLink(cap, link2, cap[0], this.lexer, this.rules);
8981
8672
  }
8982
- }
8983
- emStrong(src, maskedSrc, prevChar = "") {
8984
- let match = this.rules.inline.emStrongLDelim.exec(src);
8985
- if (!match) return;
8986
- if (match[3] && prevChar.match(this.rules.other.unicodeAlphaNumeric)) return;
8987
- const nextChar = match[1] || match[2] || "";
8988
- if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {
8989
- const lLength = [...match[0]].length - 1;
8990
- let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;
8991
- const endReg = match[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
8992
- endReg.lastIndex = 0;
8993
- maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
8994
- while ((match = endReg.exec(maskedSrc)) != null) {
8995
- rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];
8996
- if (!rDelim) continue;
8997
- rLength = [...rDelim].length;
8998
- if (match[3] || match[4]) {
8999
- delimTotal += rLength;
9000
- continue;
9001
- } else if (match[5] || match[6]) {
9002
- if (lLength % 3 && !((lLength + rLength) % 3)) {
9003
- midDelimTotal += rLength;
9004
- continue;
8673
+ while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {
8674
+ maskedSrc = maskedSrc.slice(0, match.index) + "++" + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
8675
+ }
8676
+ while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
8677
+ maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
8678
+ }
8679
+ let keepPrevChar = false;
8680
+ let prevChar = "";
8681
+ while (src) {
8682
+ if (!keepPrevChar) {
8683
+ prevChar = "";
8684
+ }
8685
+ keepPrevChar = false;
8686
+ let token;
8687
+ if (this.options.extensions?.inline?.some((extTokenizer) => {
8688
+ if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
8689
+ src = src.substring(token.raw.length);
8690
+ tokens.push(token);
8691
+ return true;
8692
+ }
8693
+ return false;
8694
+ })) {
8695
+ continue;
8696
+ }
8697
+ if (token = this.tokenizer.escape(src)) {
8698
+ src = src.substring(token.raw.length);
8699
+ tokens.push(token);
8700
+ continue;
8701
+ }
8702
+ if (token = this.tokenizer.tag(src)) {
8703
+ src = src.substring(token.raw.length);
8704
+ tokens.push(token);
8705
+ continue;
8706
+ }
8707
+ if (token = this.tokenizer.link(src)) {
8708
+ src = src.substring(token.raw.length);
8709
+ tokens.push(token);
8710
+ continue;
8711
+ }
8712
+ if (token = this.tokenizer.reflink(src, this.tokens.links)) {
8713
+ src = src.substring(token.raw.length);
8714
+ const lastToken = tokens.at(-1);
8715
+ if (token.type === "text" && lastToken?.type === "text") {
8716
+ lastToken.raw += token.raw;
8717
+ lastToken.text += token.text;
8718
+ } else {
8719
+ tokens.push(token);
8720
+ }
8721
+ continue;
8722
+ }
8723
+ if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {
8724
+ src = src.substring(token.raw.length);
8725
+ tokens.push(token);
8726
+ continue;
8727
+ }
8728
+ if (token = this.tokenizer.codespan(src)) {
8729
+ src = src.substring(token.raw.length);
8730
+ tokens.push(token);
8731
+ continue;
8732
+ }
8733
+ if (token = this.tokenizer.br(src)) {
8734
+ src = src.substring(token.raw.length);
8735
+ tokens.push(token);
8736
+ continue;
8737
+ }
8738
+ if (token = this.tokenizer.del(src)) {
8739
+ src = src.substring(token.raw.length);
8740
+ tokens.push(token);
8741
+ continue;
8742
+ }
8743
+ if (token = this.tokenizer.autolink(src)) {
8744
+ src = src.substring(token.raw.length);
8745
+ tokens.push(token);
8746
+ continue;
8747
+ }
8748
+ if (!this.state.inLink && (token = this.tokenizer.url(src))) {
8749
+ src = src.substring(token.raw.length);
8750
+ tokens.push(token);
8751
+ continue;
8752
+ }
8753
+ let cutSrc = src;
8754
+ if (this.options.extensions?.startInline) {
8755
+ let startIndex = Infinity;
8756
+ const tempSrc = src.slice(1);
8757
+ let tempStart;
8758
+ this.options.extensions.startInline.forEach((getStartIndex) => {
8759
+ tempStart = getStartIndex.call({ lexer: this }, tempSrc);
8760
+ if (typeof tempStart === "number" && tempStart >= 0) {
8761
+ startIndex = Math.min(startIndex, tempStart);
9005
8762
  }
8763
+ });
8764
+ if (startIndex < Infinity && startIndex >= 0) {
8765
+ cutSrc = src.substring(0, startIndex + 1);
8766
+ }
8767
+ }
8768
+ if (token = this.tokenizer.inlineText(cutSrc)) {
8769
+ src = src.substring(token.raw.length);
8770
+ if (token.raw.slice(-1) !== "_") {
8771
+ prevChar = token.raw.slice(-1);
9006
8772
  }
9007
- delimTotal -= rLength;
9008
- if (delimTotal > 0) continue;
9009
- rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
9010
- const lastCharLength = [...match[0]][0].length;
9011
- const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);
9012
- if (Math.min(lLength, rLength) % 2) {
9013
- const text2 = raw.slice(1, -1);
9014
- return {
9015
- type: "em",
9016
- raw,
9017
- text: text2,
9018
- tokens: this.lexer.inlineTokens(text2)
9019
- };
8773
+ keepPrevChar = true;
8774
+ const lastToken = tokens.at(-1);
8775
+ if (lastToken?.type === "text") {
8776
+ lastToken.raw += token.raw;
8777
+ lastToken.text += token.text;
8778
+ } else {
8779
+ tokens.push(token);
9020
8780
  }
9021
- const text = raw.slice(2, -2);
9022
- return {
9023
- type: "strong",
9024
- raw,
9025
- text,
9026
- tokens: this.lexer.inlineTokens(text)
9027
- };
8781
+ continue;
9028
8782
  }
9029
- }
9030
- }
9031
- codespan(src) {
9032
- const cap = this.rules.inline.code.exec(src);
9033
- if (cap) {
9034
- let text = cap[2].replace(this.rules.other.newLineCharGlobal, " ");
9035
- const hasNonSpaceChars = this.rules.other.nonSpaceChar.test(text);
9036
- const hasSpaceCharsOnBothEnds = this.rules.other.startingSpaceChar.test(text) && this.rules.other.endingSpaceChar.test(text);
9037
- if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
9038
- text = text.substring(1, text.length - 1);
8783
+ if (src) {
8784
+ const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
8785
+ if (this.options.silent) {
8786
+ console.error(errMsg);
8787
+ break;
8788
+ } else {
8789
+ throw new Error(errMsg);
8790
+ }
9039
8791
  }
9040
- return {
9041
- type: "codespan",
9042
- raw: cap[0],
9043
- text
9044
- };
9045
8792
  }
8793
+ return tokens;
9046
8794
  }
9047
- br(src) {
9048
- const cap = this.rules.inline.br.exec(src);
9049
- if (cap) {
9050
- return {
9051
- type: "br",
9052
- raw: cap[0]
9053
- };
8795
+ };
8796
+
8797
+ // src/Renderer.ts
8798
+ var _Renderer = class {
8799
+ options;
8800
+ parser;
8801
+ // set by the parser
8802
+ constructor(options2) {
8803
+ this.options = options2 || _defaults;
8804
+ }
8805
+ space(token) {
8806
+ return "";
8807
+ }
8808
+ code({ text, lang, escaped }) {
8809
+ const langString = (lang || "").match(other.notSpaceStart)?.[0];
8810
+ const code = text.replace(other.endingNewline, "") + "\n";
8811
+ if (!langString) {
8812
+ return "<pre><code>" + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
9054
8813
  }
8814
+ return '<pre><code class="language-' + escape2(langString) + '">' + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
9055
8815
  }
9056
- del(src) {
9057
- const cap = this.rules.inline.del.exec(src);
9058
- if (cap) {
9059
- return {
9060
- type: "del",
9061
- raw: cap[0],
9062
- text: cap[2],
9063
- tokens: this.lexer.inlineTokens(cap[2])
9064
- };
8816
+ blockquote({ tokens }) {
8817
+ const body = this.parser.parse(tokens);
8818
+ return `<blockquote>
8819
+ ${body}</blockquote>
8820
+ `;
8821
+ }
8822
+ html({ text }) {
8823
+ return text;
8824
+ }
8825
+ heading({ tokens, depth }) {
8826
+ return `<h${depth}>${this.parser.parseInline(tokens)}</h${depth}>
8827
+ `;
8828
+ }
8829
+ hr(token) {
8830
+ return "<hr>\n";
8831
+ }
8832
+ list(token) {
8833
+ const ordered = token.ordered;
8834
+ const start = token.start;
8835
+ let body = "";
8836
+ for (let j = 0; j < token.items.length; j++) {
8837
+ const item = token.items[j];
8838
+ body += this.listitem(item);
9065
8839
  }
8840
+ const type = ordered ? "ol" : "ul";
8841
+ const startAttr = ordered && start !== 1 ? ' start="' + start + '"' : "";
8842
+ return "<" + type + startAttr + ">\n" + body + "</" + type + ">\n";
9066
8843
  }
9067
- autolink(src) {
9068
- const cap = this.rules.inline.autolink.exec(src);
9069
- if (cap) {
9070
- let text, href;
9071
- if (cap[2] === "@") {
9072
- text = cap[1];
9073
- href = "mailto:" + text;
8844
+ listitem(item) {
8845
+ let itemBody = "";
8846
+ if (item.task) {
8847
+ const checkbox = this.checkbox({ checked: !!item.checked });
8848
+ if (item.loose) {
8849
+ if (item.tokens[0]?.type === "paragraph") {
8850
+ item.tokens[0].text = checkbox + " " + item.tokens[0].text;
8851
+ if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === "text") {
8852
+ item.tokens[0].tokens[0].text = checkbox + " " + escape2(item.tokens[0].tokens[0].text);
8853
+ item.tokens[0].tokens[0].escaped = true;
8854
+ }
8855
+ } else {
8856
+ item.tokens.unshift({
8857
+ type: "text",
8858
+ raw: checkbox + " ",
8859
+ text: checkbox + " ",
8860
+ escaped: true
8861
+ });
8862
+ }
9074
8863
  } else {
9075
- text = cap[1];
9076
- href = text;
8864
+ itemBody += checkbox + " ";
9077
8865
  }
9078
- return {
9079
- type: "link",
9080
- raw: cap[0],
9081
- text,
9082
- href,
9083
- tokens: [
9084
- {
9085
- type: "text",
9086
- raw: text,
9087
- text
9088
- }
9089
- ]
9090
- };
9091
8866
  }
8867
+ itemBody += this.parser.parse(item.tokens, !!item.loose);
8868
+ return `<li>${itemBody}</li>
8869
+ `;
9092
8870
  }
9093
- url(src) {
9094
- let cap;
9095
- if (cap = this.rules.inline.url.exec(src)) {
9096
- let text, href;
9097
- if (cap[2] === "@") {
9098
- text = cap[0];
9099
- href = "mailto:" + text;
9100
- } else {
9101
- let prevCapZero;
9102
- do {
9103
- prevCapZero = cap[0];
9104
- cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? "";
9105
- } while (prevCapZero !== cap[0]);
9106
- text = cap[0];
9107
- if (cap[1] === "www.") {
9108
- href = "http://" + cap[0];
9109
- } else {
9110
- href = cap[0];
9111
- }
8871
+ checkbox({ checked }) {
8872
+ return "<input " + (checked ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
8873
+ }
8874
+ paragraph({ tokens }) {
8875
+ return `<p>${this.parser.parseInline(tokens)}</p>
8876
+ `;
8877
+ }
8878
+ table(token) {
8879
+ let header = "";
8880
+ let cell = "";
8881
+ for (let j = 0; j < token.header.length; j++) {
8882
+ cell += this.tablecell(token.header[j]);
8883
+ }
8884
+ header += this.tablerow({ text: cell });
8885
+ let body = "";
8886
+ for (let j = 0; j < token.rows.length; j++) {
8887
+ const row = token.rows[j];
8888
+ cell = "";
8889
+ for (let k = 0; k < row.length; k++) {
8890
+ cell += this.tablecell(row[k]);
9112
8891
  }
9113
- return {
9114
- type: "link",
9115
- raw: cap[0],
9116
- text,
9117
- href,
9118
- tokens: [
9119
- {
9120
- type: "text",
9121
- raw: text,
9122
- text
9123
- }
9124
- ]
9125
- };
8892
+ body += this.tablerow({ text: cell });
8893
+ }
8894
+ if (body) body = `<tbody>${body}</tbody>`;
8895
+ return "<table>\n<thead>\n" + header + "</thead>\n" + body + "</table>\n";
8896
+ }
8897
+ tablerow({ text }) {
8898
+ return `<tr>
8899
+ ${text}</tr>
8900
+ `;
8901
+ }
8902
+ tablecell(token) {
8903
+ const content = this.parser.parseInline(token.tokens);
8904
+ const type = token.header ? "th" : "td";
8905
+ const tag2 = token.align ? `<${type} align="${token.align}">` : `<${type}>`;
8906
+ return tag2 + content + `</${type}>
8907
+ `;
8908
+ }
8909
+ /**
8910
+ * span level renderer
8911
+ */
8912
+ strong({ tokens }) {
8913
+ return `<strong>${this.parser.parseInline(tokens)}</strong>`;
8914
+ }
8915
+ em({ tokens }) {
8916
+ return `<em>${this.parser.parseInline(tokens)}</em>`;
8917
+ }
8918
+ codespan({ text }) {
8919
+ return `<code>${escape2(text, true)}</code>`;
8920
+ }
8921
+ br(token) {
8922
+ return "<br>";
8923
+ }
8924
+ del({ tokens }) {
8925
+ return `<del>${this.parser.parseInline(tokens)}</del>`;
8926
+ }
8927
+ link({ href, title, tokens }) {
8928
+ const text = this.parser.parseInline(tokens);
8929
+ const cleanHref = cleanUrl(href);
8930
+ if (cleanHref === null) {
8931
+ return text;
8932
+ }
8933
+ href = cleanHref;
8934
+ let out = '<a href="' + href + '"';
8935
+ if (title) {
8936
+ out += ' title="' + escape2(title) + '"';
9126
8937
  }
8938
+ out += ">" + text + "</a>";
8939
+ return out;
9127
8940
  }
9128
- inlineText(src) {
9129
- const cap = this.rules.inline.text.exec(src);
9130
- if (cap) {
9131
- const escaped = this.lexer.state.inRawBlock;
9132
- return {
9133
- type: "text",
9134
- raw: cap[0],
9135
- text: cap[0],
9136
- escaped
9137
- };
8941
+ image({ href, title, text, tokens }) {
8942
+ if (tokens) {
8943
+ text = this.parser.parseInline(tokens, this.parser.textRenderer);
8944
+ }
8945
+ const cleanHref = cleanUrl(href);
8946
+ if (cleanHref === null) {
8947
+ return escape2(text);
8948
+ }
8949
+ href = cleanHref;
8950
+ let out = `<img src="${href}" alt="${text}"`;
8951
+ if (title) {
8952
+ out += ` title="${escape2(title)}"`;
9138
8953
  }
8954
+ out += ">";
8955
+ return out;
8956
+ }
8957
+ text(token) {
8958
+ return "tokens" in token && token.tokens ? this.parser.parseInline(token.tokens) : "escaped" in token && token.escaped ? token.text : escape2(token.text);
9139
8959
  }
9140
8960
  };
9141
8961
 
9142
- // src/Lexer.ts
9143
- var _Lexer = class __Lexer {
9144
- tokens;
8962
+ // src/TextRenderer.ts
8963
+ var _TextRenderer = class {
8964
+ // no need for block level renderers
8965
+ strong({ text }) {
8966
+ return text;
8967
+ }
8968
+ em({ text }) {
8969
+ return text;
8970
+ }
8971
+ codespan({ text }) {
8972
+ return text;
8973
+ }
8974
+ del({ text }) {
8975
+ return text;
8976
+ }
8977
+ html({ text }) {
8978
+ return text;
8979
+ }
8980
+ text({ text }) {
8981
+ return text;
8982
+ }
8983
+ link({ text }) {
8984
+ return "" + text;
8985
+ }
8986
+ image({ text }) {
8987
+ return "" + text;
8988
+ }
8989
+ br() {
8990
+ return "";
8991
+ }
8992
+ };
8993
+
8994
+ // src/Parser.ts
8995
+ var _Parser = class __Parser {
9145
8996
  options;
9146
- state;
9147
- tokenizer;
9148
- inlineQueue;
8997
+ renderer;
8998
+ textRenderer;
9149
8999
  constructor(options2) {
9150
- this.tokens = [];
9151
- this.tokens.links = /* @__PURE__ */ Object.create(null);
9152
9000
  this.options = options2 || _defaults;
9153
- this.options.tokenizer = this.options.tokenizer || new _Tokenizer();
9154
- this.tokenizer = this.options.tokenizer;
9155
- this.tokenizer.options = this.options;
9156
- this.tokenizer.lexer = this;
9157
- this.inlineQueue = [];
9158
- this.state = {
9159
- inLink: false,
9160
- inRawBlock: false,
9161
- top: true
9162
- };
9163
- const rules = {
9164
- other,
9165
- block: block.normal,
9166
- inline: inline.normal
9167
- };
9168
- if (this.options.pedantic) {
9169
- rules.block = block.pedantic;
9170
- rules.inline = inline.pedantic;
9171
- } else if (this.options.gfm) {
9172
- rules.block = block.gfm;
9173
- if (this.options.breaks) {
9174
- rules.inline = inline.breaks;
9175
- } else {
9176
- rules.inline = inline.gfm;
9177
- }
9178
- }
9179
- this.tokenizer.rules = rules;
9180
- }
9181
- /**
9182
- * Expose Rules
9183
- */
9184
- static get rules() {
9185
- return {
9186
- block,
9187
- inline
9188
- };
9001
+ this.options.renderer = this.options.renderer || new _Renderer();
9002
+ this.renderer = this.options.renderer;
9003
+ this.renderer.options = this.options;
9004
+ this.renderer.parser = this;
9005
+ this.textRenderer = new _TextRenderer();
9189
9006
  }
9190
9007
  /**
9191
- * Static Lex Method
9008
+ * Static Parse Method
9192
9009
  */
9193
- static lex(src, options2) {
9194
- const lexer2 = new __Lexer(options2);
9195
- return lexer2.lex(src);
9010
+ static parse(tokens, options2) {
9011
+ const parser2 = new __Parser(options2);
9012
+ return parser2.parse(tokens);
9196
9013
  }
9197
9014
  /**
9198
- * Static Lex Inline Method
9015
+ * Static Parse Inline Method
9199
9016
  */
9200
- static lexInline(src, options2) {
9201
- const lexer2 = new __Lexer(options2);
9202
- return lexer2.inlineTokens(src);
9017
+ static parseInline(tokens, options2) {
9018
+ const parser2 = new __Parser(options2);
9019
+ return parser2.parseInline(tokens);
9203
9020
  }
9204
9021
  /**
9205
- * Preprocessing
9022
+ * Parse Loop
9206
9023
  */
9207
- lex(src) {
9208
- src = src.replace(other.carriageReturn, "\n");
9209
- this.blockTokens(src, this.tokens);
9210
- for (let i = 0; i < this.inlineQueue.length; i++) {
9211
- const next = this.inlineQueue[i];
9212
- this.inlineTokens(next.src, next.tokens);
9213
- }
9214
- this.inlineQueue = [];
9215
- return this.tokens;
9216
- }
9217
- blockTokens(src, tokens = [], lastParagraphClipped = false) {
9218
- if (this.options.pedantic) {
9219
- src = src.replace(other.tabCharGlobal, " ").replace(other.spaceLine, "");
9220
- }
9221
- while (src) {
9222
- let token;
9223
- if (this.options.extensions?.block?.some((extTokenizer) => {
9224
- if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
9225
- src = src.substring(token.raw.length);
9226
- tokens.push(token);
9227
- return true;
9024
+ parse(tokens, top = true) {
9025
+ let out = "";
9026
+ for (let i = 0; i < tokens.length; i++) {
9027
+ const anyToken = tokens[i];
9028
+ if (this.options.extensions?.renderers?.[anyToken.type]) {
9029
+ const genericToken = anyToken;
9030
+ const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);
9031
+ if (ret !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(genericToken.type)) {
9032
+ out += ret || "";
9033
+ continue;
9228
9034
  }
9229
- return false;
9230
- })) {
9231
- continue;
9232
9035
  }
9233
- if (token = this.tokenizer.space(src)) {
9234
- src = src.substring(token.raw.length);
9235
- const lastToken = tokens.at(-1);
9236
- if (token.raw.length === 1 && lastToken !== void 0) {
9237
- lastToken.raw += "\n";
9238
- } else {
9239
- tokens.push(token);
9036
+ const token = anyToken;
9037
+ switch (token.type) {
9038
+ case "space": {
9039
+ out += this.renderer.space(token);
9040
+ continue;
9240
9041
  }
9241
- continue;
9242
- }
9243
- if (token = this.tokenizer.code(src)) {
9244
- src = src.substring(token.raw.length);
9245
- const lastToken = tokens.at(-1);
9246
- if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
9247
- lastToken.raw += "\n" + token.raw;
9248
- lastToken.text += "\n" + token.text;
9249
- this.inlineQueue.at(-1).src = lastToken.text;
9250
- } else {
9251
- tokens.push(token);
9042
+ case "hr": {
9043
+ out += this.renderer.hr(token);
9044
+ continue;
9252
9045
  }
9253
- continue;
9254
- }
9255
- if (token = this.tokenizer.fences(src)) {
9256
- src = src.substring(token.raw.length);
9257
- tokens.push(token);
9258
- continue;
9259
- }
9260
- if (token = this.tokenizer.heading(src)) {
9261
- src = src.substring(token.raw.length);
9262
- tokens.push(token);
9263
- continue;
9264
- }
9265
- if (token = this.tokenizer.hr(src)) {
9266
- src = src.substring(token.raw.length);
9267
- tokens.push(token);
9268
- continue;
9269
- }
9270
- if (token = this.tokenizer.blockquote(src)) {
9271
- src = src.substring(token.raw.length);
9272
- tokens.push(token);
9273
- continue;
9274
- }
9275
- if (token = this.tokenizer.list(src)) {
9276
- src = src.substring(token.raw.length);
9277
- tokens.push(token);
9278
- continue;
9279
- }
9280
- if (token = this.tokenizer.html(src)) {
9281
- src = src.substring(token.raw.length);
9282
- tokens.push(token);
9283
- continue;
9284
- }
9285
- if (token = this.tokenizer.def(src)) {
9286
- src = src.substring(token.raw.length);
9287
- const lastToken = tokens.at(-1);
9288
- if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
9289
- lastToken.raw += "\n" + token.raw;
9290
- lastToken.text += "\n" + token.raw;
9291
- this.inlineQueue.at(-1).src = lastToken.text;
9292
- } else if (!this.tokens.links[token.tag]) {
9293
- this.tokens.links[token.tag] = {
9294
- href: token.href,
9295
- title: token.title
9296
- };
9046
+ case "heading": {
9047
+ out += this.renderer.heading(token);
9048
+ continue;
9049
+ }
9050
+ case "code": {
9051
+ out += this.renderer.code(token);
9052
+ continue;
9053
+ }
9054
+ case "table": {
9055
+ out += this.renderer.table(token);
9056
+ continue;
9057
+ }
9058
+ case "blockquote": {
9059
+ out += this.renderer.blockquote(token);
9060
+ continue;
9061
+ }
9062
+ case "list": {
9063
+ out += this.renderer.list(token);
9064
+ continue;
9297
9065
  }
9298
- continue;
9299
- }
9300
- if (token = this.tokenizer.table(src)) {
9301
- src = src.substring(token.raw.length);
9302
- tokens.push(token);
9303
- continue;
9304
- }
9305
- if (token = this.tokenizer.lheading(src)) {
9306
- src = src.substring(token.raw.length);
9307
- tokens.push(token);
9308
- continue;
9309
- }
9310
- let cutSrc = src;
9311
- if (this.options.extensions?.startBlock) {
9312
- let startIndex = Infinity;
9313
- const tempSrc = src.slice(1);
9314
- let tempStart;
9315
- this.options.extensions.startBlock.forEach((getStartIndex) => {
9316
- tempStart = getStartIndex.call({ lexer: this }, tempSrc);
9317
- if (typeof tempStart === "number" && tempStart >= 0) {
9318
- startIndex = Math.min(startIndex, tempStart);
9319
- }
9320
- });
9321
- if (startIndex < Infinity && startIndex >= 0) {
9322
- cutSrc = src.substring(0, startIndex + 1);
9066
+ case "html": {
9067
+ out += this.renderer.html(token);
9068
+ continue;
9323
9069
  }
9324
- }
9325
- if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {
9326
- const lastToken = tokens.at(-1);
9327
- if (lastParagraphClipped && lastToken?.type === "paragraph") {
9328
- lastToken.raw += "\n" + token.raw;
9329
- lastToken.text += "\n" + token.text;
9330
- this.inlineQueue.pop();
9331
- this.inlineQueue.at(-1).src = lastToken.text;
9332
- } else {
9333
- tokens.push(token);
9070
+ case "paragraph": {
9071
+ out += this.renderer.paragraph(token);
9072
+ continue;
9334
9073
  }
9335
- lastParagraphClipped = cutSrc.length !== src.length;
9336
- src = src.substring(token.raw.length);
9337
- continue;
9338
- }
9339
- if (token = this.tokenizer.text(src)) {
9340
- src = src.substring(token.raw.length);
9341
- const lastToken = tokens.at(-1);
9342
- if (lastToken?.type === "text") {
9343
- lastToken.raw += "\n" + token.raw;
9344
- lastToken.text += "\n" + token.text;
9345
- this.inlineQueue.pop();
9346
- this.inlineQueue.at(-1).src = lastToken.text;
9347
- } else {
9348
- tokens.push(token);
9074
+ case "text": {
9075
+ let textToken = token;
9076
+ let body = this.renderer.text(textToken);
9077
+ while (i + 1 < tokens.length && tokens[i + 1].type === "text") {
9078
+ textToken = tokens[++i];
9079
+ body += "\n" + this.renderer.text(textToken);
9080
+ }
9081
+ if (top) {
9082
+ out += this.renderer.paragraph({
9083
+ type: "paragraph",
9084
+ raw: body,
9085
+ text: body,
9086
+ tokens: [{ type: "text", raw: body, text: body, escaped: true }]
9087
+ });
9088
+ } else {
9089
+ out += body;
9090
+ }
9091
+ continue;
9349
9092
  }
9350
- continue;
9351
- }
9352
- if (src) {
9353
- const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
9354
- if (this.options.silent) {
9355
- console.error(errMsg);
9356
- break;
9357
- } else {
9358
- throw new Error(errMsg);
9093
+ default: {
9094
+ const errMsg = 'Token with "' + token.type + '" type was not found.';
9095
+ if (this.options.silent) {
9096
+ console.error(errMsg);
9097
+ return "";
9098
+ } else {
9099
+ throw new Error(errMsg);
9100
+ }
9359
9101
  }
9360
9102
  }
9361
9103
  }
9362
- this.state.top = true;
9363
- return tokens;
9364
- }
9365
- inline(src, tokens = []) {
9366
- this.inlineQueue.push({ src, tokens });
9367
- return tokens;
9104
+ return out;
9368
9105
  }
9369
9106
  /**
9370
- * Lexing/Compiling
9107
+ * Parse Inline Tokens
9371
9108
  */
9372
- inlineTokens(src, tokens = []) {
9373
- let maskedSrc = src;
9374
- let match = null;
9375
- if (this.tokens.links) {
9376
- const links = Object.keys(this.tokens.links);
9377
- if (links.length > 0) {
9378
- while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
9379
- if (links.includes(match[0].slice(match[0].lastIndexOf("[") + 1, -1))) {
9380
- maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
9381
- }
9109
+ parseInline(tokens, renderer = this.renderer) {
9110
+ let out = "";
9111
+ for (let i = 0; i < tokens.length; i++) {
9112
+ const anyToken = tokens[i];
9113
+ if (this.options.extensions?.renderers?.[anyToken.type]) {
9114
+ const ret = this.options.extensions.renderers[anyToken.type].call({ parser: this }, anyToken);
9115
+ if (ret !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(anyToken.type)) {
9116
+ out += ret || "";
9117
+ continue;
9382
9118
  }
9383
9119
  }
9384
- }
9385
- while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {
9386
- maskedSrc = maskedSrc.slice(0, match.index) + "++" + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
9387
- }
9388
- while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
9389
- maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
9390
- }
9391
- let keepPrevChar = false;
9392
- let prevChar = "";
9393
- while (src) {
9394
- if (!keepPrevChar) {
9395
- prevChar = "";
9396
- }
9397
- keepPrevChar = false;
9398
- let token;
9399
- if (this.options.extensions?.inline?.some((extTokenizer) => {
9400
- if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
9401
- src = src.substring(token.raw.length);
9402
- tokens.push(token);
9403
- return true;
9120
+ const token = anyToken;
9121
+ switch (token.type) {
9122
+ case "escape": {
9123
+ out += renderer.text(token);
9124
+ break;
9404
9125
  }
9405
- return false;
9406
- })) {
9407
- continue;
9408
- }
9409
- if (token = this.tokenizer.escape(src)) {
9410
- src = src.substring(token.raw.length);
9411
- tokens.push(token);
9412
- continue;
9413
- }
9414
- if (token = this.tokenizer.tag(src)) {
9415
- src = src.substring(token.raw.length);
9416
- tokens.push(token);
9417
- continue;
9418
- }
9419
- if (token = this.tokenizer.link(src)) {
9420
- src = src.substring(token.raw.length);
9421
- tokens.push(token);
9422
- continue;
9423
- }
9424
- if (token = this.tokenizer.reflink(src, this.tokens.links)) {
9425
- src = src.substring(token.raw.length);
9426
- const lastToken = tokens.at(-1);
9427
- if (token.type === "text" && lastToken?.type === "text") {
9428
- lastToken.raw += token.raw;
9429
- lastToken.text += token.text;
9430
- } else {
9431
- tokens.push(token);
9126
+ case "html": {
9127
+ out += renderer.html(token);
9128
+ break;
9432
9129
  }
9433
- continue;
9434
- }
9435
- if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {
9436
- src = src.substring(token.raw.length);
9437
- tokens.push(token);
9438
- continue;
9439
- }
9440
- if (token = this.tokenizer.codespan(src)) {
9441
- src = src.substring(token.raw.length);
9442
- tokens.push(token);
9443
- continue;
9444
- }
9445
- if (token = this.tokenizer.br(src)) {
9446
- src = src.substring(token.raw.length);
9447
- tokens.push(token);
9448
- continue;
9449
- }
9450
- if (token = this.tokenizer.del(src)) {
9451
- src = src.substring(token.raw.length);
9452
- tokens.push(token);
9453
- continue;
9454
- }
9455
- if (token = this.tokenizer.autolink(src)) {
9456
- src = src.substring(token.raw.length);
9457
- tokens.push(token);
9458
- continue;
9459
- }
9460
- if (!this.state.inLink && (token = this.tokenizer.url(src))) {
9461
- src = src.substring(token.raw.length);
9462
- tokens.push(token);
9463
- continue;
9464
- }
9465
- let cutSrc = src;
9466
- if (this.options.extensions?.startInline) {
9467
- let startIndex = Infinity;
9468
- const tempSrc = src.slice(1);
9469
- let tempStart;
9470
- this.options.extensions.startInline.forEach((getStartIndex) => {
9471
- tempStart = getStartIndex.call({ lexer: this }, tempSrc);
9472
- if (typeof tempStart === "number" && tempStart >= 0) {
9473
- startIndex = Math.min(startIndex, tempStart);
9474
- }
9475
- });
9476
- if (startIndex < Infinity && startIndex >= 0) {
9477
- cutSrc = src.substring(0, startIndex + 1);
9130
+ case "link": {
9131
+ out += renderer.link(token);
9132
+ break;
9478
9133
  }
9479
- }
9480
- if (token = this.tokenizer.inlineText(cutSrc)) {
9481
- src = src.substring(token.raw.length);
9482
- if (token.raw.slice(-1) !== "_") {
9483
- prevChar = token.raw.slice(-1);
9134
+ case "image": {
9135
+ out += renderer.image(token);
9136
+ break;
9484
9137
  }
9485
- keepPrevChar = true;
9486
- const lastToken = tokens.at(-1);
9487
- if (lastToken?.type === "text") {
9488
- lastToken.raw += token.raw;
9489
- lastToken.text += token.text;
9490
- } else {
9491
- tokens.push(token);
9138
+ case "strong": {
9139
+ out += renderer.strong(token);
9140
+ break;
9141
+ }
9142
+ case "em": {
9143
+ out += renderer.em(token);
9144
+ break;
9145
+ }
9146
+ case "codespan": {
9147
+ out += renderer.codespan(token);
9148
+ break;
9149
+ }
9150
+ case "br": {
9151
+ out += renderer.br(token);
9152
+ break;
9153
+ }
9154
+ case "del": {
9155
+ out += renderer.del(token);
9156
+ break;
9492
9157
  }
9493
- continue;
9494
- }
9495
- if (src) {
9496
- const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
9497
- if (this.options.silent) {
9498
- console.error(errMsg);
9158
+ case "text": {
9159
+ out += renderer.text(token);
9499
9160
  break;
9500
- } else {
9501
- throw new Error(errMsg);
9161
+ }
9162
+ default: {
9163
+ const errMsg = 'Token with "' + token.type + '" type was not found.';
9164
+ if (this.options.silent) {
9165
+ console.error(errMsg);
9166
+ return "";
9167
+ } else {
9168
+ throw new Error(errMsg);
9169
+ }
9502
9170
  }
9503
9171
  }
9504
9172
  }
9505
- return tokens;
9173
+ return out;
9506
9174
  }
9507
9175
  };
9508
9176
 
9509
- // src/Renderer.ts
9510
- var _Renderer = class {
9177
+ // src/Hooks.ts
9178
+ var _Hooks = class {
9511
9179
  options;
9512
- parser;
9513
- // set by the parser
9180
+ block;
9514
9181
  constructor(options2) {
9515
9182
  this.options = options2 || _defaults;
9516
9183
  }
9517
- space(token) {
9518
- return "";
9184
+ static passThroughHooks = /* @__PURE__ */ new Set([
9185
+ "preprocess",
9186
+ "postprocess",
9187
+ "processAllTokens"
9188
+ ]);
9189
+ /**
9190
+ * Process markdown before marked
9191
+ */
9192
+ preprocess(markdown) {
9193
+ return markdown;
9519
9194
  }
9520
- code({ text, lang, escaped }) {
9521
- const langString = (lang || "").match(other.notSpaceStart)?.[0];
9522
- const code = text.replace(other.endingNewline, "") + "\n";
9523
- if (!langString) {
9524
- return "<pre><code>" + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
9525
- }
9526
- return '<pre><code class="language-' + escape2(langString) + '">' + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
9195
+ /**
9196
+ * Process HTML after marked is finished
9197
+ */
9198
+ postprocess(html2) {
9199
+ return html2;
9527
9200
  }
9528
- blockquote({ tokens }) {
9529
- const body = this.parser.parse(tokens);
9530
- return `<blockquote>
9531
- ${body}</blockquote>
9532
- `;
9201
+ /**
9202
+ * Process all tokens before walk tokens
9203
+ */
9204
+ processAllTokens(tokens) {
9205
+ return tokens;
9533
9206
  }
9534
- html({ text }) {
9535
- return text;
9207
+ /**
9208
+ * Provide function to tokenize markdown
9209
+ */
9210
+ provideLexer() {
9211
+ return this.block ? _Lexer.lex : _Lexer.lexInline;
9536
9212
  }
9537
- heading({ tokens, depth }) {
9538
- return `<h${depth}>${this.parser.parseInline(tokens)}</h${depth}>
9539
- `;
9213
+ /**
9214
+ * Provide function to parse tokens
9215
+ */
9216
+ provideParser() {
9217
+ return this.block ? _Parser.parse : _Parser.parseInline;
9540
9218
  }
9541
- hr(token) {
9542
- return "<hr>\n";
9219
+ };
9220
+
9221
+ // src/Instance.ts
9222
+ var Marked = class {
9223
+ defaults = _getDefaults();
9224
+ options = this.setOptions;
9225
+ parse = this.parseMarkdown(true);
9226
+ parseInline = this.parseMarkdown(false);
9227
+ Parser = _Parser;
9228
+ Renderer = _Renderer;
9229
+ TextRenderer = _TextRenderer;
9230
+ Lexer = _Lexer;
9231
+ Tokenizer = _Tokenizer;
9232
+ Hooks = _Hooks;
9233
+ constructor(...args) {
9234
+ this.use(...args);
9543
9235
  }
9544
- list(token) {
9545
- const ordered = token.ordered;
9546
- const start = token.start;
9547
- let body = "";
9548
- for (let j = 0; j < token.items.length; j++) {
9549
- const item = token.items[j];
9550
- body += this.listitem(item);
9236
+ /**
9237
+ * Run callback for every token
9238
+ */
9239
+ walkTokens(tokens, callback) {
9240
+ let values = [];
9241
+ for (const token of tokens) {
9242
+ values = values.concat(callback.call(this, token));
9243
+ switch (token.type) {
9244
+ case "table": {
9245
+ const tableToken = token;
9246
+ for (const cell of tableToken.header) {
9247
+ values = values.concat(this.walkTokens(cell.tokens, callback));
9248
+ }
9249
+ for (const row of tableToken.rows) {
9250
+ for (const cell of row) {
9251
+ values = values.concat(this.walkTokens(cell.tokens, callback));
9252
+ }
9253
+ }
9254
+ break;
9255
+ }
9256
+ case "list": {
9257
+ const listToken = token;
9258
+ values = values.concat(this.walkTokens(listToken.items, callback));
9259
+ break;
9260
+ }
9261
+ default: {
9262
+ const genericToken = token;
9263
+ if (this.defaults.extensions?.childTokens?.[genericToken.type]) {
9264
+ this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {
9265
+ const tokens2 = genericToken[childTokens].flat(Infinity);
9266
+ values = values.concat(this.walkTokens(tokens2, callback));
9267
+ });
9268
+ } else if (genericToken.tokens) {
9269
+ values = values.concat(this.walkTokens(genericToken.tokens, callback));
9270
+ }
9271
+ }
9272
+ }
9551
9273
  }
9552
- const type = ordered ? "ol" : "ul";
9553
- const startAttr = ordered && start !== 1 ? ' start="' + start + '"' : "";
9554
- return "<" + type + startAttr + ">\n" + body + "</" + type + ">\n";
9274
+ return values;
9555
9275
  }
9556
- listitem(item) {
9557
- let itemBody = "";
9558
- if (item.task) {
9559
- const checkbox = this.checkbox({ checked: !!item.checked });
9560
- if (item.loose) {
9561
- if (item.tokens[0]?.type === "paragraph") {
9562
- item.tokens[0].text = checkbox + " " + item.tokens[0].text;
9563
- if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === "text") {
9564
- item.tokens[0].tokens[0].text = checkbox + " " + escape2(item.tokens[0].tokens[0].text);
9565
- item.tokens[0].tokens[0].escaped = true;
9276
+ use(...args) {
9277
+ const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} };
9278
+ args.forEach((pack) => {
9279
+ const opts = { ...pack };
9280
+ opts.async = this.defaults.async || opts.async || false;
9281
+ if (pack.extensions) {
9282
+ pack.extensions.forEach((ext) => {
9283
+ if (!ext.name) {
9284
+ throw new Error("extension name required");
9285
+ }
9286
+ if ("renderer" in ext) {
9287
+ const prevRenderer = extensions.renderers[ext.name];
9288
+ if (prevRenderer) {
9289
+ extensions.renderers[ext.name] = function(...args2) {
9290
+ let ret = ext.renderer.apply(this, args2);
9291
+ if (ret === false) {
9292
+ ret = prevRenderer.apply(this, args2);
9293
+ }
9294
+ return ret;
9295
+ };
9296
+ } else {
9297
+ extensions.renderers[ext.name] = ext.renderer;
9298
+ }
9299
+ }
9300
+ if ("tokenizer" in ext) {
9301
+ if (!ext.level || ext.level !== "block" && ext.level !== "inline") {
9302
+ throw new Error("extension level must be 'block' or 'inline'");
9303
+ }
9304
+ const extLevel = extensions[ext.level];
9305
+ if (extLevel) {
9306
+ extLevel.unshift(ext.tokenizer);
9307
+ } else {
9308
+ extensions[ext.level] = [ext.tokenizer];
9309
+ }
9310
+ if (ext.start) {
9311
+ if (ext.level === "block") {
9312
+ if (extensions.startBlock) {
9313
+ extensions.startBlock.push(ext.start);
9314
+ } else {
9315
+ extensions.startBlock = [ext.start];
9316
+ }
9317
+ } else if (ext.level === "inline") {
9318
+ if (extensions.startInline) {
9319
+ extensions.startInline.push(ext.start);
9320
+ } else {
9321
+ extensions.startInline = [ext.start];
9322
+ }
9323
+ }
9324
+ }
9325
+ }
9326
+ if ("childTokens" in ext && ext.childTokens) {
9327
+ extensions.childTokens[ext.name] = ext.childTokens;
9328
+ }
9329
+ });
9330
+ opts.extensions = extensions;
9331
+ }
9332
+ if (pack.renderer) {
9333
+ const renderer = this.defaults.renderer || new _Renderer(this.defaults);
9334
+ for (const prop in pack.renderer) {
9335
+ if (!(prop in renderer)) {
9336
+ throw new Error(`renderer '${prop}' does not exist`);
9337
+ }
9338
+ if (["options", "parser"].includes(prop)) {
9339
+ continue;
9340
+ }
9341
+ const rendererProp = prop;
9342
+ const rendererFunc = pack.renderer[rendererProp];
9343
+ const prevRenderer = renderer[rendererProp];
9344
+ renderer[rendererProp] = (...args2) => {
9345
+ let ret = rendererFunc.apply(renderer, args2);
9346
+ if (ret === false) {
9347
+ ret = prevRenderer.apply(renderer, args2);
9348
+ }
9349
+ return ret || "";
9350
+ };
9351
+ }
9352
+ opts.renderer = renderer;
9353
+ }
9354
+ if (pack.tokenizer) {
9355
+ const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);
9356
+ for (const prop in pack.tokenizer) {
9357
+ if (!(prop in tokenizer)) {
9358
+ throw new Error(`tokenizer '${prop}' does not exist`);
9359
+ }
9360
+ if (["options", "rules", "lexer"].includes(prop)) {
9361
+ continue;
9362
+ }
9363
+ const tokenizerProp = prop;
9364
+ const tokenizerFunc = pack.tokenizer[tokenizerProp];
9365
+ const prevTokenizer = tokenizer[tokenizerProp];
9366
+ tokenizer[tokenizerProp] = (...args2) => {
9367
+ let ret = tokenizerFunc.apply(tokenizer, args2);
9368
+ if (ret === false) {
9369
+ ret = prevTokenizer.apply(tokenizer, args2);
9370
+ }
9371
+ return ret;
9372
+ };
9373
+ }
9374
+ opts.tokenizer = tokenizer;
9375
+ }
9376
+ if (pack.hooks) {
9377
+ const hooks = this.defaults.hooks || new _Hooks();
9378
+ for (const prop in pack.hooks) {
9379
+ if (!(prop in hooks)) {
9380
+ throw new Error(`hook '${prop}' does not exist`);
9381
+ }
9382
+ if (["options", "block"].includes(prop)) {
9383
+ continue;
9384
+ }
9385
+ const hooksProp = prop;
9386
+ const hooksFunc = pack.hooks[hooksProp];
9387
+ const prevHook = hooks[hooksProp];
9388
+ if (_Hooks.passThroughHooks.has(prop)) {
9389
+ hooks[hooksProp] = (arg) => {
9390
+ if (this.defaults.async) {
9391
+ return Promise.resolve(hooksFunc.call(hooks, arg)).then((ret2) => {
9392
+ return prevHook.call(hooks, ret2);
9393
+ });
9394
+ }
9395
+ const ret = hooksFunc.call(hooks, arg);
9396
+ return prevHook.call(hooks, ret);
9397
+ };
9398
+ } else {
9399
+ hooks[hooksProp] = (...args2) => {
9400
+ let ret = hooksFunc.apply(hooks, args2);
9401
+ if (ret === false) {
9402
+ ret = prevHook.apply(hooks, args2);
9403
+ }
9404
+ return ret;
9405
+ };
9566
9406
  }
9567
- } else {
9568
- item.tokens.unshift({
9569
- type: "text",
9570
- raw: checkbox + " ",
9571
- text: checkbox + " ",
9572
- escaped: true
9573
- });
9574
9407
  }
9575
- } else {
9576
- itemBody += checkbox + " ";
9408
+ opts.hooks = hooks;
9577
9409
  }
9578
- }
9579
- itemBody += this.parser.parse(item.tokens, !!item.loose);
9580
- return `<li>${itemBody}</li>
9581
- `;
9582
- }
9583
- checkbox({ checked }) {
9584
- return "<input " + (checked ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
9585
- }
9586
- paragraph({ tokens }) {
9587
- return `<p>${this.parser.parseInline(tokens)}</p>
9588
- `;
9589
- }
9590
- table(token) {
9591
- let header = "";
9592
- let cell = "";
9593
- for (let j = 0; j < token.header.length; j++) {
9594
- cell += this.tablecell(token.header[j]);
9595
- }
9596
- header += this.tablerow({ text: cell });
9597
- let body = "";
9598
- for (let j = 0; j < token.rows.length; j++) {
9599
- const row = token.rows[j];
9600
- cell = "";
9601
- for (let k = 0; k < row.length; k++) {
9602
- cell += this.tablecell(row[k]);
9410
+ if (pack.walkTokens) {
9411
+ const walkTokens2 = this.defaults.walkTokens;
9412
+ const packWalktokens = pack.walkTokens;
9413
+ opts.walkTokens = function(token) {
9414
+ let values = [];
9415
+ values.push(packWalktokens.call(this, token));
9416
+ if (walkTokens2) {
9417
+ values = values.concat(walkTokens2.call(this, token));
9418
+ }
9419
+ return values;
9420
+ };
9603
9421
  }
9604
- body += this.tablerow({ text: cell });
9605
- }
9606
- if (body) body = `<tbody>${body}</tbody>`;
9607
- return "<table>\n<thead>\n" + header + "</thead>\n" + body + "</table>\n";
9608
- }
9609
- tablerow({ text }) {
9610
- return `<tr>
9611
- ${text}</tr>
9612
- `;
9613
- }
9614
- tablecell(token) {
9615
- const content = this.parser.parseInline(token.tokens);
9616
- const type = token.header ? "th" : "td";
9617
- const tag2 = token.align ? `<${type} align="${token.align}">` : `<${type}>`;
9618
- return tag2 + content + `</${type}>
9619
- `;
9620
- }
9621
- /**
9622
- * span level renderer
9623
- */
9624
- strong({ tokens }) {
9625
- return `<strong>${this.parser.parseInline(tokens)}</strong>`;
9626
- }
9627
- em({ tokens }) {
9628
- return `<em>${this.parser.parseInline(tokens)}</em>`;
9629
- }
9630
- codespan({ text }) {
9631
- return `<code>${escape2(text, true)}</code>`;
9632
- }
9633
- br(token) {
9634
- return "<br>";
9635
- }
9636
- del({ tokens }) {
9637
- return `<del>${this.parser.parseInline(tokens)}</del>`;
9638
- }
9639
- link({ href, title, tokens }) {
9640
- const text = this.parser.parseInline(tokens);
9641
- const cleanHref = cleanUrl(href);
9642
- if (cleanHref === null) {
9643
- return text;
9644
- }
9645
- href = cleanHref;
9646
- let out = '<a href="' + href + '"';
9647
- if (title) {
9648
- out += ' title="' + escape2(title) + '"';
9649
- }
9650
- out += ">" + text + "</a>";
9651
- return out;
9652
- }
9653
- image({ href, title, text, tokens }) {
9654
- if (tokens) {
9655
- text = this.parser.parseInline(tokens, this.parser.textRenderer);
9656
- }
9657
- const cleanHref = cleanUrl(href);
9658
- if (cleanHref === null) {
9659
- return escape2(text);
9660
- }
9661
- href = cleanHref;
9662
- let out = `<img src="${href}" alt="${text}"`;
9663
- if (title) {
9664
- out += ` title="${escape2(title)}"`;
9665
- }
9666
- out += ">";
9667
- return out;
9668
- }
9669
- text(token) {
9670
- return "tokens" in token && token.tokens ? this.parser.parseInline(token.tokens) : "escaped" in token && token.escaped ? token.text : escape2(token.text);
9671
- }
9672
- };
9673
-
9674
- // src/TextRenderer.ts
9675
- var _TextRenderer = class {
9676
- // no need for block level renderers
9677
- strong({ text }) {
9678
- return text;
9679
- }
9680
- em({ text }) {
9681
- return text;
9682
- }
9683
- codespan({ text }) {
9684
- return text;
9685
- }
9686
- del({ text }) {
9687
- return text;
9688
- }
9689
- html({ text }) {
9690
- return text;
9691
- }
9692
- text({ text }) {
9693
- return text;
9694
- }
9695
- link({ text }) {
9696
- return "" + text;
9697
- }
9698
- image({ text }) {
9699
- return "" + text;
9700
- }
9701
- br() {
9702
- return "";
9422
+ this.defaults = { ...this.defaults, ...opts };
9423
+ });
9424
+ return this;
9703
9425
  }
9704
- };
9705
-
9706
- // src/Parser.ts
9707
- var _Parser = class __Parser {
9708
- options;
9709
- renderer;
9710
- textRenderer;
9711
- constructor(options2) {
9712
- this.options = options2 || _defaults;
9713
- this.options.renderer = this.options.renderer || new _Renderer();
9714
- this.renderer = this.options.renderer;
9715
- this.renderer.options = this.options;
9716
- this.renderer.parser = this;
9717
- this.textRenderer = new _TextRenderer();
9426
+ setOptions(opt) {
9427
+ this.defaults = { ...this.defaults, ...opt };
9428
+ return this;
9718
9429
  }
9719
- /**
9720
- * Static Parse Method
9721
- */
9722
- static parse(tokens, options2) {
9723
- const parser2 = new __Parser(options2);
9724
- return parser2.parse(tokens);
9430
+ lexer(src, options2) {
9431
+ return _Lexer.lex(src, options2 ?? this.defaults);
9725
9432
  }
9726
- /**
9727
- * Static Parse Inline Method
9728
- */
9729
- static parseInline(tokens, options2) {
9730
- const parser2 = new __Parser(options2);
9731
- return parser2.parseInline(tokens);
9433
+ parser(tokens, options2) {
9434
+ return _Parser.parse(tokens, options2 ?? this.defaults);
9732
9435
  }
9733
- /**
9734
- * Parse Loop
9735
- */
9736
- parse(tokens, top = true) {
9737
- let out = "";
9738
- for (let i = 0; i < tokens.length; i++) {
9739
- const anyToken = tokens[i];
9740
- if (this.options.extensions?.renderers?.[anyToken.type]) {
9741
- const genericToken = anyToken;
9742
- const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);
9743
- if (ret !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(genericToken.type)) {
9744
- out += ret || "";
9745
- continue;
9746
- }
9436
+ parseMarkdown(blockType) {
9437
+ const parse2 = (src, options2) => {
9438
+ const origOpt = { ...options2 };
9439
+ const opt = { ...this.defaults, ...origOpt };
9440
+ const throwError = this.onError(!!opt.silent, !!opt.async);
9441
+ if (this.defaults.async === true && origOpt.async === false) {
9442
+ return throwError(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
9747
9443
  }
9748
- const token = anyToken;
9749
- switch (token.type) {
9750
- case "space": {
9751
- out += this.renderer.space(token);
9752
- continue;
9753
- }
9754
- case "hr": {
9755
- out += this.renderer.hr(token);
9756
- continue;
9444
+ if (typeof src === "undefined" || src === null) {
9445
+ return throwError(new Error("marked(): input parameter is undefined or null"));
9446
+ }
9447
+ if (typeof src !== "string") {
9448
+ return throwError(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(src) + ", string expected"));
9449
+ }
9450
+ if (opt.hooks) {
9451
+ opt.hooks.options = opt;
9452
+ opt.hooks.block = blockType;
9453
+ }
9454
+ const lexer2 = opt.hooks ? opt.hooks.provideLexer() : blockType ? _Lexer.lex : _Lexer.lexInline;
9455
+ const parser2 = opt.hooks ? opt.hooks.provideParser() : blockType ? _Parser.parse : _Parser.parseInline;
9456
+ if (opt.async) {
9457
+ return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src).then((src2) => lexer2(src2, opt)).then((tokens) => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens).then((tokens) => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens).then((tokens) => parser2(tokens, opt)).then((html2) => opt.hooks ? opt.hooks.postprocess(html2) : html2).catch(throwError);
9458
+ }
9459
+ try {
9460
+ if (opt.hooks) {
9461
+ src = opt.hooks.preprocess(src);
9757
9462
  }
9758
- case "heading": {
9759
- out += this.renderer.heading(token);
9760
- continue;
9463
+ let tokens = lexer2(src, opt);
9464
+ if (opt.hooks) {
9465
+ tokens = opt.hooks.processAllTokens(tokens);
9761
9466
  }
9762
- case "code": {
9763
- out += this.renderer.code(token);
9764
- continue;
9467
+ if (opt.walkTokens) {
9468
+ this.walkTokens(tokens, opt.walkTokens);
9765
9469
  }
9766
- case "table": {
9767
- out += this.renderer.table(token);
9768
- continue;
9470
+ let html2 = parser2(tokens, opt);
9471
+ if (opt.hooks) {
9472
+ html2 = opt.hooks.postprocess(html2);
9769
9473
  }
9770
- case "blockquote": {
9771
- out += this.renderer.blockquote(token);
9772
- continue;
9474
+ return html2;
9475
+ } catch (e) {
9476
+ return throwError(e);
9477
+ }
9478
+ };
9479
+ return parse2;
9480
+ }
9481
+ onError(silent, async) {
9482
+ return (e) => {
9483
+ e.message += "\nPlease report this to https://github.com/markedjs/marked.";
9484
+ if (silent) {
9485
+ const msg = "<p>An error occurred:</p><pre>" + escape2(e.message + "", true) + "</pre>";
9486
+ if (async) {
9487
+ return Promise.resolve(msg);
9773
9488
  }
9774
- case "list": {
9775
- out += this.renderer.list(token);
9776
- continue;
9489
+ return msg;
9490
+ }
9491
+ if (async) {
9492
+ return Promise.reject(e);
9493
+ }
9494
+ throw e;
9495
+ };
9496
+ }
9497
+ };
9498
+
9499
+ // src/marked.ts
9500
+ var markedInstance = new Marked();
9501
+ function marked(src, opt) {
9502
+ return markedInstance.parse(src, opt);
9503
+ }
9504
+ marked.options = marked.setOptions = function(options2) {
9505
+ markedInstance.setOptions(options2);
9506
+ marked.defaults = markedInstance.defaults;
9507
+ changeDefaults(marked.defaults);
9508
+ return marked;
9509
+ };
9510
+ marked.getDefaults = _getDefaults;
9511
+ marked.defaults = _defaults;
9512
+ marked.use = function(...args) {
9513
+ markedInstance.use(...args);
9514
+ marked.defaults = markedInstance.defaults;
9515
+ changeDefaults(marked.defaults);
9516
+ return marked;
9517
+ };
9518
+ marked.walkTokens = function(tokens, callback) {
9519
+ return markedInstance.walkTokens(tokens, callback);
9520
+ };
9521
+ marked.parseInline = markedInstance.parseInline;
9522
+ marked.Parser = _Parser;
9523
+ marked.parser = _Parser.parse;
9524
+ marked.Renderer = _Renderer;
9525
+ marked.TextRenderer = _TextRenderer;
9526
+ marked.Lexer = _Lexer;
9527
+ marked.lexer = _Lexer.lex;
9528
+ marked.Tokenizer = _Tokenizer;
9529
+ marked.Hooks = _Hooks;
9530
+ marked.parse = marked;
9531
+
9532
+ /**
9533
+ * This component renders a results summary for RAG search result summaries.
9534
+ * When the user makes a search, a network call is made to retrieve the summary content, which is then
9535
+ * rendered in this box.
9536
+ *
9537
+ * NOTE: This component requires the usage of a read key that has "SUMMARY" permissions.
9538
+ *
9539
+ * @react-import
9540
+ * ```jsx
9541
+ * import { SearchcraftResultsSummary } from "@searchcraft/react-sdk";
9542
+ * ```
9543
+ *
9544
+ * @vue-import
9545
+ * ```ts
9546
+ * import { SearchcraftResultsSummary } from "@searchcraft/vue-sdk";
9547
+ * ```
9548
+ *
9549
+ * @js-example
9550
+ * ```html
9551
+ * <searchcraft-results-summary />
9552
+ * ```
9553
+ *
9554
+ * @react-example
9555
+ * ```jsx
9556
+ * <SearchcraftResultsSummary />
9557
+ * ```
9558
+ *
9559
+ * @vue-example
9560
+ * ```jsx
9561
+ * <SearchcraftResultsSummary />
9562
+ * ```
9563
+ */
9564
+ class SearchcraftResultsSummary {
9565
+ constructor(hostRef) {
9566
+ registerInstance(this, hostRef);
9567
+ }
9568
+ /**
9569
+ * The id of the Searchcraft instance that this component should use.
9570
+ */
9571
+ searchcraftId;
9572
+ summary = '';
9573
+ summaryErrorMessage = '';
9574
+ isLoading = false;
9575
+ isSummaryNotEnabled = false;
9576
+ unsubscribe;
9577
+ cleanupCore;
9578
+ /**
9579
+ * Callback invoked when the Searchcraft core instance is available.
9580
+ */
9581
+ onCoreAvailable(core) {
9582
+ core.store.setState({ hasSummaryBox: true });
9583
+ this.unsubscribe = core.store.subscribe(this.handleStateChange.bind(this));
9584
+ }
9585
+ connectedCallback() {
9586
+ this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
9587
+ }
9588
+ disconnectedCallback() {
9589
+ this.unsubscribe?.();
9590
+ this.cleanupCore?.();
9591
+ }
9592
+ /**
9593
+ * Handles state changes from the store and updates component state.
9594
+ */
9595
+ handleStateChange(state) {
9596
+ this.isLoading = state.isSummaryLoading;
9597
+ this.isSummaryNotEnabled = state.isSummaryNotEnabled;
9598
+ this.summaryErrorMessage = state.summaryErrorMessage;
9599
+ this.summary = this.sanitizeMarkdown(state.summary);
9600
+ }
9601
+ /**
9602
+ * Sanitizes and converts markdown to HTML.
9603
+ */
9604
+ sanitizeMarkdown(markdown) {
9605
+ return purify.sanitize(marked.parse(markdown));
9606
+ }
9607
+ /**
9608
+ * Renders the appropriate content based on current state.
9609
+ */
9610
+ renderContent() {
9611
+ if (this.isLoading) {
9612
+ return hAsync("searchcraft-loading", { label: 'LOADING' });
9777
9613
  }
9778
- case "html": {
9779
- out += this.renderer.html(token);
9780
- continue;
9614
+ if (this.isSummaryNotEnabled) {
9615
+ return (hAsync("div", { class: 'searchcraft-results-summary-content' }, this.summaryErrorMessage || 'AI summaries are not enabled'));
9781
9616
  }
9782
- case "paragraph": {
9783
- out += this.renderer.paragraph(token);
9784
- continue;
9617
+ return (hAsync("div", { class: 'searchcraft-results-summary-content', innerHTML: this.summary, "aria-live": "polite" }));
9618
+ }
9619
+ render() {
9620
+ return (hAsync("div", { key: '4fabef16a76b57d737aa47fcf106c7375d19a5bc', class: 'searchcraft-results-summary' }, this.renderContent()));
9621
+ }
9622
+ static get cmpMeta() { return {
9623
+ "$flags$": 768,
9624
+ "$tagName$": "searchcraft-results-summary",
9625
+ "$members$": {
9626
+ "searchcraftId": [1, "searchcraft-id"],
9627
+ "summary": [32],
9628
+ "summaryErrorMessage": [32],
9629
+ "isLoading": [32],
9630
+ "isSummaryNotEnabled": [32]
9631
+ },
9632
+ "$listeners$": undefined,
9633
+ "$lazyBundleId$": "-",
9634
+ "$attrsToReflect$": []
9635
+ }; }
9636
+ }
9637
+
9638
+ /**
9639
+ * This web component is designed to display detailed information for a single search result. Once a query is submitted, the component formats and presents the result.
9640
+ *
9641
+ * @internal
9642
+ */
9643
+ class SearchcraftSearchResult {
9644
+ constructor(hostRef) {
9645
+ registerInstance(this, hostRef);
9646
+ }
9647
+ item;
9648
+ /**
9649
+ * The index.
9650
+ */
9651
+ index;
9652
+ /**
9653
+ * The position in the document. Used with the "document_clicked" measure event.
9654
+ */
9655
+ documentPosition = 0;
9656
+ /**
9657
+ * A callback function responsible for rendering a result.
9658
+ */
9659
+ template;
9660
+ /**
9661
+ * The id of the Searchcraft instance that this component should use.
9662
+ */
9663
+ searchcraftId;
9664
+ templateHtml;
9665
+ get hostElement() { return getElement(this); }
9666
+ core;
9667
+ cleanupCore;
9668
+ onCoreAvailable(core) {
9669
+ this.core = core;
9670
+ }
9671
+ connectedCallback() {
9672
+ this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
9673
+ if (this.item) {
9674
+ try {
9675
+ this.templateHtml = this.template?.(this.item.document, this.index, {
9676
+ html: html$1,
9677
+ source_index: this.item.source_index,
9678
+ });
9679
+ }
9680
+ catch (error) {
9681
+ console.error('Invalid search result template:', error);
9682
+ }
9785
9683
  }
9786
- case "text": {
9787
- let textToken = token;
9788
- let body = this.renderer.text(textToken);
9789
- while (i + 1 < tokens.length && tokens[i + 1].type === "text") {
9790
- textToken = tokens[++i];
9791
- body += "\n" + this.renderer.text(textToken);
9792
- }
9793
- if (top) {
9794
- out += this.renderer.paragraph({
9795
- type: "paragraph",
9796
- raw: body,
9797
- text: body,
9798
- tokens: [{ type: "text", raw: body, text: body, escaped: true }]
9799
- });
9800
- } else {
9801
- out += body;
9802
- }
9803
- continue;
9684
+ }
9685
+ disconnectedCallback() {
9686
+ this.cleanupCore?.();
9687
+ }
9688
+ handleResultContainerClick = (event) => {
9689
+ if (!event.target) {
9690
+ return;
9804
9691
  }
9805
- default: {
9806
- const errMsg = 'Token with "' + token.type + '" type was not found.';
9807
- if (this.options.silent) {
9808
- console.error(errMsg);
9809
- return "";
9810
- } else {
9811
- throw new Error(errMsg);
9812
- }
9692
+ const target = event.target;
9693
+ const link = target.closest('a');
9694
+ if (!link ||
9695
+ !this.hostElement?.contains(link) ||
9696
+ !this.core ||
9697
+ !this.core.measureClient) {
9698
+ return;
9813
9699
  }
9814
- }
9815
- }
9816
- return out;
9817
- }
9818
- /**
9819
- * Parse Inline Tokens
9820
- */
9821
- parseInline(tokens, renderer = this.renderer) {
9822
- let out = "";
9823
- for (let i = 0; i < tokens.length; i++) {
9824
- const anyToken = tokens[i];
9825
- if (this.options.extensions?.renderers?.[anyToken.type]) {
9826
- const ret = this.options.extensions.renderers[anyToken.type].call({ parser: this }, anyToken);
9827
- if (ret !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(anyToken.type)) {
9828
- out += ret || "";
9829
- continue;
9700
+ const document_position = this.documentPosition;
9701
+ const search_term = this.core.store.getState().searchTerm;
9702
+ const number_of_documents = this.core.store.getState().searchClientResponseItems.length || 0;
9703
+ this.core.measureClient.sendMeasureEvent('document_clicked', {
9704
+ document_position,
9705
+ number_of_documents,
9706
+ search_term,
9707
+ });
9708
+ };
9709
+ handleKeyDown = () => { };
9710
+ render() {
9711
+ if (!this.item) {
9712
+ return;
9830
9713
  }
9831
- }
9832
- const token = anyToken;
9833
- switch (token.type) {
9834
- case "escape": {
9835
- out += renderer.text(token);
9836
- break;
9714
+ if (typeof this.template === 'undefined') {
9715
+ return (hAsync("div", { class: 'searchcraft-search-result searchcraft-search-result-no-template', onClick: this.handleResultContainerClick, onKeyDown: this.handleKeyDown }, Object.entries(this.item.document).map(([key, value]) => (hAsync("p", { key: key }, hAsync("strong", null, key), ": ", value)))));
9837
9716
  }
9838
- case "html": {
9839
- out += renderer.html(token);
9840
- break;
9717
+ return (hAsync("div", { class: 'searchcraft-search-result', innerHTML: this.templateHtml, onClick: this.handleResultContainerClick, onKeyDown: this.handleKeyDown }));
9718
+ }
9719
+ static get cmpMeta() { return {
9720
+ "$flags$": 768,
9721
+ "$tagName$": "searchcraft-search-result",
9722
+ "$members$": {
9723
+ "item": [16],
9724
+ "index": [2],
9725
+ "documentPosition": [2, "document-position"],
9726
+ "template": [16],
9727
+ "searchcraftId": [1, "searchcraft-id"],
9728
+ "templateHtml": [32]
9729
+ },
9730
+ "$listeners$": undefined,
9731
+ "$lazyBundleId$": "-",
9732
+ "$attrsToReflect$": []
9733
+ }; }
9734
+ }
9735
+
9736
+ /**
9737
+ * This web component is responsible for displaying the results of a search query. Once a query is submitted, the component formats and presents an ordered list of the results.
9738
+ *
9739
+ *
9740
+ * @react-import
9741
+ * ```jsx
9742
+ * import { SearchcraftSearchResults } from "@searchcraft/react-sdk";
9743
+ * ```
9744
+ *
9745
+ * @vue-import
9746
+ * ```jsx
9747
+ * import { SearchcraftSearchResults } from "@searchcraft/vue-sdk";
9748
+ * ```
9749
+ *
9750
+ * @js-example
9751
+ * ```html
9752
+ * <!-- index.html -->
9753
+ * <searchcraft-search-results
9754
+ * ad-interval="4"
9755
+ * place-ad-at-start="true"
9756
+ * />
9757
+ * ```
9758
+ *
9759
+ * ```js
9760
+ * // index.js
9761
+ * const searchResults = document.querySelector('searchcraft-search-results');
9762
+ *
9763
+ * searchResults.template = (item, index, { html }) => html`
9764
+ * <h2>${item.title}</h2>
9765
+ * `;
9766
+ * ```
9767
+ *
9768
+ * @react-example
9769
+ * ```jsx
9770
+ * <SearchcraftSearchResults
9771
+ * adInterval={4}
9772
+ * placeAdAtState={true}
9773
+ * template={(item, index, { html }) => html`
9774
+ * <h2>${item.title}</h2>
9775
+ * `}
9776
+ * />
9777
+ * ```
9778
+ *
9779
+ * @vue-example
9780
+ * ```jsx
9781
+ * <SearchcraftSearchResults
9782
+ * adInterval={4}
9783
+ * placeAdAtState={true}
9784
+ * :template={(item, index, { html }) => html`
9785
+ * <h2>${item.title}</h2>
9786
+ * `}
9787
+ * />
9788
+ * ```
9789
+ */
9790
+ class SearchcraftSearchResults {
9791
+ constructor(hostRef) {
9792
+ registerInstance(this, hostRef);
9793
+ }
9794
+ /**
9795
+ * The id of the Searchcraft instance that this component should use.
9796
+ */
9797
+ searchcraftId;
9798
+ /**
9799
+ * A query that will appears when the component initializes or the search term is ''..
9800
+ */
9801
+ initialQuery;
9802
+ /**
9803
+ * A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
9804
+ */
9805
+ template;
9806
+ adClientResponseItems = [];
9807
+ config;
9808
+ isSearchInProgress = true;
9809
+ searchClientResponseItems;
9810
+ searchResultsPage;
9811
+ searchResultsPerPage;
9812
+ searchTerm = '';
9813
+ unsubscribe;
9814
+ cleanupCore;
9815
+ onCoreAvailable(core) {
9816
+ const state = core.store.getState();
9817
+ this.handleStateChange(state);
9818
+ this.searchClientResponseItems = state.searchClientResponseItems;
9819
+ this.searchTerm = state.searchTerm;
9820
+ this.config = state.core?.config;
9821
+ this.unsubscribe = core.store.subscribe((state) => this.handleStateChange(state));
9822
+ }
9823
+ connectedCallback() {
9824
+ this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
9825
+ }
9826
+ disconnectedCallback() {
9827
+ this.unsubscribe?.();
9828
+ this.cleanupCore?.();
9829
+ }
9830
+ handleStateChange(state) {
9831
+ this.adClientResponseItems = [...state.adClientResponseItems];
9832
+ this.config = state.core?.config;
9833
+ this.isSearchInProgress = state.isSearchInProgress;
9834
+ this.searchClientResponseItems = [...state.searchClientResponseItems];
9835
+ this.searchResultsPage = state.searchResultsPage;
9836
+ this.searchResultsPerPage = state.searchResultsPerPage;
9837
+ this.searchTerm = state.searchTerm;
9838
+ }
9839
+ renderEmptyState() {
9840
+ return (hAsync("div", { class: 'searchcraft-search-results-empty-state' }, hAsync("slot", { name: 'empty-search' })));
9841
+ }
9842
+ renderNoResultsFoundState() {
9843
+ return (hAsync("div", { class: 'searchcraft-search-results' }, hAsync("div", { class: 'searchcraft-search-results-error-message' }, hAsync("searchcraft-error-message", null, "No search results found for \"", this.searchTerm, "\" query."))));
9844
+ }
9845
+ renderWithADMAds() {
9846
+ const items = this.searchClientResponseItems || [];
9847
+ return (hAsync("div", { class: 'searchcraft-search-results' }, this.adClientResponseItems?.map((item) => (hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'adMarketplace', adClientResponseItem: item, key: item.id, renderPosition: 'top' }))), items.map((item, index) => (hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template })))));
9848
+ }
9849
+ renderWithCustomAds() {
9850
+ const itemsToRender = [];
9851
+ const interstitialInterval = this.config?.customAdConfig?.adInterstitialInterval || 0;
9852
+ const interstitialQuantity = this.config?.customAdConfig?.adInterstitialQuantity || 1;
9853
+ const adStartQuantity = this.config?.customAdConfig?.adStartQuantity || 0;
9854
+ const adEndQuantity = this.config?.customAdConfig?.adEndQuantity || 0;
9855
+ const items = this.searchClientResponseItems || [];
9856
+ // Renders ads at beginning
9857
+ for (let n = 0; n < adStartQuantity; n++) {
9858
+ itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Custom', key: `${n}-ad`, renderPosition: 'top' }));
9841
9859
  }
9842
- case "link": {
9843
- out += renderer.link(token);
9844
- break;
9860
+ // Renders search results + interstitial ads
9861
+ items.forEach((item, index) => {
9862
+ if (interstitialInterval &&
9863
+ index % interstitialInterval === 0 &&
9864
+ index + interstitialInterval < items.length &&
9865
+ index >= interstitialInterval) {
9866
+ for (let n = 0; n < interstitialQuantity; n++) {
9867
+ itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Custom', key: `${item.id}-ad-${n}`, renderPosition: 'interstitial' }));
9868
+ }
9869
+ }
9870
+ itemsToRender.push(hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template }));
9871
+ });
9872
+ // Renders ads at end
9873
+ for (let n = 0; n < adEndQuantity; n++) {
9874
+ itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Custom', key: `${n}-ad`, renderPosition: 'bottom' }));
9845
9875
  }
9846
- case "image": {
9847
- out += renderer.image(token);
9848
- break;
9876
+ return hAsync("div", { class: 'searchcraft-search-results' }, itemsToRender);
9877
+ }
9878
+ renderWithNativoAds() {
9879
+ const itemsToRender = [];
9880
+ const interstitialStartIndex = this.config?.nativoConfig?.adInterstialStartIndex || 0;
9881
+ const interstitialInterval = this.config?.nativoConfig?.adInterstitialInterval || 0;
9882
+ const interstitialQuantity = this.config?.nativoConfig?.adInterstitialQuantity || 1;
9883
+ const adStartQuantity = this.config?.nativoConfig?.adStartQuantity || 0;
9884
+ const adEndQuantity = this.config?.nativoConfig?.adEndQuantity || 0;
9885
+ const items = this.searchClientResponseItems || [];
9886
+ // Renders ads at beginning
9887
+ for (let n = 0; n < adStartQuantity; n++) {
9888
+ itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Nativo', key: `${n}-ad`, renderPosition: 'top' }));
9849
9889
  }
9850
- case "strong": {
9851
- out += renderer.strong(token);
9852
- break;
9890
+ // Renders search results + interstitial ads
9891
+ items.forEach((item, index) => {
9892
+ if (interstitialInterval &&
9893
+ (index + interstitialStartIndex) % interstitialInterval === 0 &&
9894
+ index + interstitialInterval < items.length &&
9895
+ index >= interstitialInterval) {
9896
+ for (let n = 0; n < interstitialQuantity; n++) {
9897
+ itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Nativo', key: `${item.id}-ad-${n}`, renderPosition: 'interstitial' }));
9898
+ }
9899
+ }
9900
+ itemsToRender.push(hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template }));
9901
+ });
9902
+ // Renders ads at end
9903
+ for (let n = 0; n < adEndQuantity; n++) {
9904
+ itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Nativo', key: `${n}-ad`, renderPosition: 'bottom' }));
9853
9905
  }
9854
- case "em": {
9855
- out += renderer.em(token);
9856
- break;
9906
+ return hAsync("div", { class: 'searchcraft-search-results' }, itemsToRender);
9907
+ }
9908
+ renderWithNoAds() {
9909
+ const items = this.searchClientResponseItems || [];
9910
+ return (hAsync("div", { class: 'searchcraft-search-results' }, items.map((item, index) => (hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template })))));
9911
+ }
9912
+ render() {
9913
+ const searchClientResponseItems = this.searchClientResponseItems || [];
9914
+ if (searchClientResponseItems.length === 0 && !this.isSearchInProgress) {
9915
+ return this.renderEmptyState();
9857
9916
  }
9858
- case "codespan": {
9859
- out += renderer.codespan(token);
9860
- break;
9917
+ if (this.searchTerm.length > 0 &&
9918
+ searchClientResponseItems.length === 0 &&
9919
+ !this.isSearchInProgress) {
9920
+ return this.renderNoResultsFoundState();
9861
9921
  }
9862
- case "br": {
9863
- out += renderer.br(token);
9864
- break;
9922
+ if (this.config?.customAdConfig) {
9923
+ return this.renderWithCustomAds();
9865
9924
  }
9866
- case "del": {
9867
- out += renderer.del(token);
9868
- break;
9925
+ if (this.config?.admAdConfig) {
9926
+ return this.renderWithNativoAds();
9869
9927
  }
9870
- case "text": {
9871
- out += renderer.text(token);
9872
- break;
9928
+ if (this.config?.nativoConfig) {
9929
+ return this.renderWithNativoAds();
9873
9930
  }
9874
- default: {
9875
- const errMsg = 'Token with "' + token.type + '" type was not found.';
9876
- if (this.options.silent) {
9877
- console.error(errMsg);
9878
- return "";
9879
- } else {
9880
- throw new Error(errMsg);
9881
- }
9931
+ return this.renderWithNoAds();
9932
+ }
9933
+ static get cmpMeta() { return {
9934
+ "$flags$": 772,
9935
+ "$tagName$": "searchcraft-search-results",
9936
+ "$members$": {
9937
+ "searchcraftId": [1, "searchcraft-id"],
9938
+ "initialQuery": [1, "initial-query"],
9939
+ "template": [16],
9940
+ "adClientResponseItems": [32],
9941
+ "config": [32],
9942
+ "isSearchInProgress": [32],
9943
+ "searchClientResponseItems": [32],
9944
+ "searchResultsPage": [32],
9945
+ "searchResultsPerPage": [32],
9946
+ "searchTerm": [32]
9947
+ },
9948
+ "$listeners$": undefined,
9949
+ "$lazyBundleId$": "-",
9950
+ "$attrsToReflect$": []
9951
+ }; }
9952
+ }
9953
+
9954
+ /**
9955
+ * This web component is designed to choose the number of search results displayed.
9956
+ *
9957
+ * @react-import
9958
+ * ```jsx
9959
+ * import { SearchcraftSearchResultsPerPage } from "@searchcraft/react-sdk";
9960
+ * ```
9961
+ *
9962
+ * @vue-import
9963
+ * ```jsx
9964
+ * import { SearchcraftSearchResultsPerPage } from "@searchcraft/vue-sdk";
9965
+ * ```
9966
+ *
9967
+ * @js-example
9968
+ * ```html
9969
+ * <!-- index.html -->
9970
+ * <searchcraft-search-results-per-page increment="20" />
9971
+ * ```
9972
+ *
9973
+ * @react-example
9974
+ * ```jsx
9975
+ * <SearchcraftSearchResultsPerPage increment={20} />
9976
+ * ```
9977
+ *
9978
+ * @vue-example
9979
+ * ```jsx
9980
+ * <SearchcraftSearchResultsPerPage increment="20" />
9981
+ * ```
9982
+ */
9983
+ class SearchcraftSearchResultsPerPage {
9984
+ constructor(hostRef) {
9985
+ registerInstance(this, hostRef);
9986
+ }
9987
+ /**
9988
+ * The amount the options will increase (e.g. 20 = [20, 40, 60, 80, 100]).
9989
+ * The base value is defined by the `searchResultsPerPage` option in the configuration.
9990
+ */
9991
+ increment = 20;
9992
+ /**
9993
+ * The id of the Searchcraft instance that this component should use.
9994
+ */
9995
+ searchcraftId;
9996
+ // store vars
9997
+ searchTerm;
9998
+ searchResultsPage;
9999
+ searchResultsPerPage;
10000
+ searchResultsCount;
10001
+ searchResultsPagesCount;
10002
+ searchClientRequestProperties;
10003
+ // local vars
10004
+ initialSearchResultsPerPage;
10005
+ // store functions
10006
+ setSearchResultsPerPage = () => { };
10007
+ setSearchResultsPage = () => { };
10008
+ unsubscribe = () => { };
10009
+ cleanupCore;
10010
+ onCoreAvailable(core) {
10011
+ this.unsubscribe = core.store.subscribe((state) => {
10012
+ // store vars
10013
+ this.searchTerm = state.searchTerm;
10014
+ this.searchResultsPerPage = state.searchResultsPerPage;
10015
+ this.searchResultsPage = state.searchResultsPage;
10016
+ this.searchResultsCount = state.searchResultsCount;
10017
+ this.searchClientRequestProperties = state.searchClientRequestProperties;
10018
+ // local vars
10019
+ this.searchResultsPagesCount = Math.ceil(this.searchResultsCount / this.searchResultsPerPage);
10020
+ // store functions
10021
+ this.setSearchResultsPage = state.setSearchResultsPage;
10022
+ this.setSearchResultsPerPage = state.setSearchResultsPerPage;
10023
+ });
10024
+ this.initialSearchResultsPerPage =
10025
+ core.store.getState().searchResultsPerPage;
10026
+ }
10027
+ connectedCallback() {
10028
+ this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
10029
+ }
10030
+ disconnectedCallback() {
10031
+ this.unsubscribe?.();
10032
+ this.cleanupCore?.();
10033
+ }
10034
+ render() {
10035
+ // Check if this is an initialQuery case (string requestProperties with empty searchTerm)
10036
+ const isInitialQuery = typeof this.searchClientRequestProperties === 'string' &&
10037
+ this.searchTerm.trim() === '';
10038
+ // early return if there isn't a searchTerm (unless it's initialQuery) or there is 1 or fewer pages of results
10039
+ if ((!this.searchTerm && !isInitialQuery) ||
10040
+ this.searchResultsPagesCount <= 1) {
10041
+ return;
9882
10042
  }
9883
- }
10043
+ return (hAsync("div", { class: 'searchcraft-search-results-per-page' }, hAsync("div", { class: 'searchcraft-search-results-per-page-select' }, hAsync("label", { class: 'searchcraft-search-results-per-page-select-label', htmlFor: 'searchcraft-search-results-per-page-select-input' }, "Results Per Page"), hAsync("div", { class: 'searchcraft-search-results-per-page-select-input' }, hAsync("searchcraft-select", { inputId: 'searchcraft-search-results-per-page-select-input', name: 'results-per-page', options: [...Array(5)].map((_, index) => {
10044
+ const value = this.initialSearchResultsPerPage +
10045
+ Number(this.increment) * index;
10046
+ return {
10047
+ label: `${value}`,
10048
+ value,
10049
+ };
10050
+ }), onSelectChange: (event) => {
10051
+ this.setSearchResultsPerPage(Number(event.detail));
10052
+ this.setSearchResultsPage(1);
10053
+ } })))));
9884
10054
  }
9885
- return out;
9886
- }
9887
- };
10055
+ static get cmpMeta() { return {
10056
+ "$flags$": 768,
10057
+ "$tagName$": "searchcraft-search-results-per-page",
10058
+ "$members$": {
10059
+ "increment": [8],
10060
+ "searchcraftId": [1, "searchcraft-id"],
10061
+ "searchTerm": [32],
10062
+ "searchResultsPage": [32],
10063
+ "searchResultsPerPage": [32],
10064
+ "searchResultsCount": [32],
10065
+ "searchResultsPagesCount": [32],
10066
+ "searchClientRequestProperties": [32],
10067
+ "initialSearchResultsPerPage": [32],
10068
+ "setSearchResultsPerPage": [32],
10069
+ "setSearchResultsPage": [32]
10070
+ },
10071
+ "$listeners$": undefined,
10072
+ "$lazyBundleId$": "-",
10073
+ "$attrsToReflect$": []
10074
+ }; }
10075
+ }
9888
10076
 
9889
- // src/Hooks.ts
9890
- var _Hooks = class {
9891
- options;
9892
- block;
9893
- constructor(options2) {
9894
- this.options = options2 || _defaults;
9895
- }
9896
- static passThroughHooks = /* @__PURE__ */ new Set([
9897
- "preprocess",
9898
- "postprocess",
9899
- "processAllTokens"
9900
- ]);
9901
- /**
9902
- * Process markdown before marked
9903
- */
9904
- preprocess(markdown) {
9905
- return markdown;
9906
- }
9907
- /**
9908
- * Process HTML after marked is finished
9909
- */
9910
- postprocess(html2) {
9911
- return html2;
9912
- }
9913
- /**
9914
- * Process all tokens before walk tokens
9915
- */
9916
- processAllTokens(tokens) {
9917
- return tokens;
9918
- }
9919
- /**
9920
- * Provide function to tokenize markdown
9921
- */
9922
- provideLexer() {
9923
- return this.block ? _Lexer.lex : _Lexer.lexInline;
9924
- }
9925
- /**
9926
- * Provide function to parse tokens
9927
- */
9928
- provideParser() {
9929
- return this.block ? _Parser.parse : _Parser.parseInline;
9930
- }
9931
- };
10077
+ /**
10078
+ * This web component is designed to allow users to select between a group of options.
10079
+ *
10080
+ * @js-example
10081
+ * ```html
10082
+ * <!-- index.html -->
10083
+ * <searchcraft-select
10084
+ * inputId="searchcraft-select"
10085
+ * name="searchcraft-select"
10086
+ * options="[{ label: 'label', value: 'value' }]"
10087
+ * />
10088
+ * ```
10089
+ *
10090
+ * @internal
10091
+ */
10092
+ class SearchcraftSelect {
10093
+ constructor(hostRef) {
10094
+ registerInstance(this, hostRef);
10095
+ this.selectChange = createEvent(this, "selectChange");
10096
+ }
10097
+ /**
10098
+ * The caption displayed below the select input.
10099
+ */
10100
+ caption;
10101
+ /**
10102
+ * Whether the select input is disabled.
10103
+ */
10104
+ disabled = false;
10105
+ /**
10106
+ * The ID for the select input.
10107
+ */
10108
+ inputId;
10109
+ /**
10110
+ * The label of the select input.
10111
+ */
10112
+ label;
10113
+ /**
10114
+ * The ID for the label of the select input.
10115
+ */
10116
+ labelId;
10117
+ /**
10118
+ * The name of the select input.
10119
+ */
10120
+ name;
10121
+ /**
10122
+ * The options for the select input.
10123
+ */
10124
+ options = [];
10125
+ /**
10126
+ * The event fired when the select is changed.
10127
+ */
10128
+ selectChange;
10129
+ searchResultsPerPage;
10130
+ setSearchResultsPage = () => { };
10131
+ setSearchResultsPerPage = () => { };
10132
+ handleSelectChange = (event) => {
10133
+ this.selectChange.emit(event.target.value);
10134
+ };
10135
+ handleGoToPage(page) {
10136
+ this.setSearchResultsPage(page);
10137
+ }
10138
+ render() {
10139
+ return (hAsync("div", { key: '15ecbf48c824a161cd83bdab99dace8e44f1ab39', class: 'searchcraft-select' }, this.label && (hAsync("label", { key: 'aba433ae9c27c9405099cffcef923c3ad22d7fda', class: 'searchcraft-select-label', id: this.labelId || `${this.inputId}-label`, htmlFor: this.inputId }, this.label)), hAsync("div", { key: '8df8a2ff05924c9c55cdd6e3827cd927cddab82a', class: 'searchcraft-select-input-wrapper' }, hAsync("select", { key: '1d5f492c2255f8ca1b6ea5e04a2726dda2f2c52f', "aria-labelledby": this.label ? this.labelId || `${this.inputId}-label` : undefined, class: 'searchcraft-select-input', disabled: this.disabled, id: this.inputId, name: this.name, onChange: this.handleSelectChange }, (typeof this.options === 'string'
10140
+ ? JSON.parse(this.options)
10141
+ : this.options).map(({ label, value, selected }) => {
10142
+ return (hAsync("option", { key: value, value: value, selected: selected }, label));
10143
+ })), hAsync("svg", { key: '0ec6892b529f2e70027aadea47208582a65a97b7', class: 'searchcraft-select-input-icon', width: '20', height: '20', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' }, hAsync("title", { key: 'bced6b62378491d1d1c629b602d7d033d912c761' }, "Select dropdown icon"), hAsync("path", { key: '659f8ebf9129e2e7941da949d29688c41c1472bb', d: 'M5 7.5L10 12.5L15 7.5', stroke: 'currentColor', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' }))), this.caption && (hAsync("p", { key: '51217d926f68f79b6c3514f5fd769b56549fdce9', class: 'searchcraft-select-caption' }, this.caption))));
10144
+ }
10145
+ static get cmpMeta() { return {
10146
+ "$flags$": 768,
10147
+ "$tagName$": "searchcraft-select",
10148
+ "$members$": {
10149
+ "caption": [1],
10150
+ "disabled": [4],
10151
+ "inputId": [1, "input-id"],
10152
+ "label": [1],
10153
+ "labelId": [1, "label-id"],
10154
+ "name": [1],
10155
+ "options": [1],
10156
+ "searchResultsPerPage": [32],
10157
+ "setSearchResultsPage": [32],
10158
+ "setSearchResultsPerPage": [32]
10159
+ },
10160
+ "$listeners$": undefined,
10161
+ "$lazyBundleId$": "-",
10162
+ "$attrsToReflect$": []
10163
+ }; }
10164
+ }
9932
10165
 
9933
- // src/Instance.ts
9934
- var Marked = class {
9935
- defaults = _getDefaults();
9936
- options = this.setOptions;
9937
- parse = this.parseMarkdown(true);
9938
- parseInline = this.parseMarkdown(false);
9939
- Parser = _Parser;
9940
- Renderer = _Renderer;
9941
- TextRenderer = _TextRenderer;
9942
- Lexer = _Lexer;
9943
- Tokenizer = _Tokenizer;
9944
- Hooks = _Hooks;
9945
- constructor(...args) {
9946
- this.use(...args);
9947
- }
9948
- /**
9949
- * Run callback for every token
9950
- */
9951
- walkTokens(tokens, callback) {
9952
- let values = [];
9953
- for (const token of tokens) {
9954
- values = values.concat(callback.call(this, token));
9955
- switch (token.type) {
9956
- case "table": {
9957
- const tableToken = token;
9958
- for (const cell of tableToken.header) {
9959
- values = values.concat(this.walkTokens(cell.tokens, callback));
9960
- }
9961
- for (const row of tableToken.rows) {
9962
- for (const cell of row) {
9963
- values = values.concat(this.walkTokens(cell.tokens, callback));
10166
+ /**
10167
+ * Creates a throttled version of the given function that only invokes
10168
+ * the original function at most once every specified number of milliseconds.
10169
+ *
10170
+ * The logic is written in a way that the last invocation is always called, after the
10171
+ * throttle cooldown period has ended.
10172
+ *
10173
+ * @template Arguments - The argument types for the function to throttle
10174
+ * @param callback - The function to throttle
10175
+ * @param delayInMilliseconds - The number of milliseconds to wait before allowing the next invocation
10176
+ * @returns A throttled version of the original function
10177
+ */
10178
+ function throttle(callback, delayInMilliseconds) {
10179
+ let isThrottleOnCooldown = false;
10180
+ let trailingCallArgs = null;
10181
+ const invokeAction = (args) => {
10182
+ callback(...args);
10183
+ isThrottleOnCooldown = true;
10184
+ setTimeout(() => {
10185
+ isThrottleOnCooldown = false;
10186
+ if (trailingCallArgs) {
10187
+ const nextArgs = trailingCallArgs;
10188
+ trailingCallArgs = null;
10189
+ invokeAction(nextArgs);
9964
10190
  }
9965
- }
9966
- break;
9967
- }
9968
- case "list": {
9969
- const listToken = token;
9970
- values = values.concat(this.walkTokens(listToken.items, callback));
9971
- break;
10191
+ }, delayInMilliseconds);
10192
+ };
10193
+ return (...args) => {
10194
+ if (!isThrottleOnCooldown) {
10195
+ invokeAction(args);
9972
10196
  }
9973
- default: {
9974
- const genericToken = token;
9975
- if (this.defaults.extensions?.childTokens?.[genericToken.type]) {
9976
- this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {
9977
- const tokens2 = genericToken[childTokens].flat(Infinity);
9978
- values = values.concat(this.walkTokens(tokens2, callback));
9979
- });
9980
- } else if (genericToken.tokens) {
9981
- values = values.concat(this.walkTokens(genericToken.tokens, callback));
9982
- }
10197
+ else {
10198
+ trailingCallArgs = args;
9983
10199
  }
9984
- }
10200
+ };
10201
+ }
10202
+
10203
+ /**
10204
+ * This web component is designed to allow users to select a value from a range defined by a minimum and maximum value. The component renders a slider interface, which can be used to visually choose a value between two boundaries.
10205
+ *
10206
+ * @internal
10207
+ */
10208
+ class SearchcraftSlider {
10209
+ constructor(hostRef) {
10210
+ registerInstance(this, hostRef);
10211
+ this.rangeChanged = createEvent(this, "rangeChanged");
9985
10212
  }
9986
- return values;
9987
- }
9988
- use(...args) {
9989
- const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} };
9990
- args.forEach((pack) => {
9991
- const opts = { ...pack };
9992
- opts.async = this.defaults.async || opts.async || false;
9993
- if (pack.extensions) {
9994
- pack.extensions.forEach((ext) => {
9995
- if (!ext.name) {
9996
- throw new Error("extension name required");
9997
- }
9998
- if ("renderer" in ext) {
9999
- const prevRenderer = extensions.renderers[ext.name];
10000
- if (prevRenderer) {
10001
- extensions.renderers[ext.name] = function(...args2) {
10002
- let ret = ext.renderer.apply(this, args2);
10003
- if (ret === false) {
10004
- ret = prevRenderer.apply(this, args2);
10005
- }
10006
- return ret;
10007
- };
10008
- } else {
10009
- extensions.renderers[ext.name] = ext.renderer;
10010
- }
10011
- }
10012
- if ("tokenizer" in ext) {
10013
- if (!ext.level || ext.level !== "block" && ext.level !== "inline") {
10014
- throw new Error("extension level must be 'block' or 'inline'");
10015
- }
10016
- const extLevel = extensions[ext.level];
10017
- if (extLevel) {
10018
- extLevel.unshift(ext.tokenizer);
10019
- } else {
10020
- extensions[ext.level] = [ext.tokenizer];
10021
- }
10022
- if (ext.start) {
10023
- if (ext.level === "block") {
10024
- if (extensions.startBlock) {
10025
- extensions.startBlock.push(ext.start);
10026
- } else {
10027
- extensions.startBlock = [ext.start];
10028
- }
10029
- } else if (ext.level === "inline") {
10030
- if (extensions.startInline) {
10031
- extensions.startInline.push(ext.start);
10032
- } else {
10033
- extensions.startInline = [ext.start];
10034
- }
10035
- }
10036
- }
10037
- }
10038
- if ("childTokens" in ext && ext.childTokens) {
10039
- extensions.childTokens[ext.name] = ext.childTokens;
10040
- }
10041
- });
10042
- opts.extensions = extensions;
10043
- }
10044
- if (pack.renderer) {
10045
- const renderer = this.defaults.renderer || new _Renderer(this.defaults);
10046
- for (const prop in pack.renderer) {
10047
- if (!(prop in renderer)) {
10048
- throw new Error(`renderer '${prop}' does not exist`);
10049
- }
10050
- if (["options", "parser"].includes(prop)) {
10051
- continue;
10052
- }
10053
- const rendererProp = prop;
10054
- const rendererFunc = pack.renderer[rendererProp];
10055
- const prevRenderer = renderer[rendererProp];
10056
- renderer[rendererProp] = (...args2) => {
10057
- let ret = rendererFunc.apply(renderer, args2);
10058
- if (ret === false) {
10059
- ret = prevRenderer.apply(renderer, args2);
10060
- }
10061
- return ret || "";
10062
- };
10063
- }
10064
- opts.renderer = renderer;
10065
- }
10066
- if (pack.tokenizer) {
10067
- const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);
10068
- for (const prop in pack.tokenizer) {
10069
- if (!(prop in tokenizer)) {
10070
- throw new Error(`tokenizer '${prop}' does not exist`);
10071
- }
10072
- if (["options", "rules", "lexer"].includes(prop)) {
10073
- continue;
10074
- }
10075
- const tokenizerProp = prop;
10076
- const tokenizerFunc = pack.tokenizer[tokenizerProp];
10077
- const prevTokenizer = tokenizer[tokenizerProp];
10078
- tokenizer[tokenizerProp] = (...args2) => {
10079
- let ret = tokenizerFunc.apply(tokenizer, args2);
10080
- if (ret === false) {
10081
- ret = prevTokenizer.apply(tokenizer, args2);
10213
+ /**
10214
+ * The maximum value allowed.
10215
+ */
10216
+ max = 100;
10217
+ /**
10218
+ * The minimum value allowed.
10219
+ */
10220
+ min = 0;
10221
+ /**
10222
+ * The step amount for the slider inputs.
10223
+ */
10224
+ step = 1;
10225
+ /** The type of data the sliders are using. */
10226
+ dataType = 'number';
10227
+ /** The date granularity to use. Used to format date labels. */
10228
+ dateGranularity;
10229
+ lowerBound = 0;
10230
+ upperBound = 1;
10231
+ endValue = 0;
10232
+ startValue = 0;
10233
+ lastFocusedHandle = 'max';
10234
+ throttledEmitUpdate = () => { };
10235
+ /**
10236
+ * When the range has changed.
10237
+ * */
10238
+ rangeChanged;
10239
+ connectedCallback() {
10240
+ switch (this.dataType) {
10241
+ case 'number':
10242
+ this.startValue = this.min;
10243
+ this.endValue = this.max;
10244
+ this.lowerBound = this.min;
10245
+ this.upperBound = this.max;
10246
+ break;
10247
+ case 'date': {
10248
+ this.startValue = 0;
10249
+ this.endValue = getDifferenceInUnits(this.dateGranularity || 'year', this.min, this.max);
10250
+ this.lowerBound = 0;
10251
+ this.upperBound = this.endValue;
10252
+ break;
10082
10253
  }
10083
- return ret;
10084
- };
10085
10254
  }
10086
- opts.tokenizer = tokenizer;
10087
- }
10088
- if (pack.hooks) {
10089
- const hooks = this.defaults.hooks || new _Hooks();
10090
- for (const prop in pack.hooks) {
10091
- if (!(prop in hooks)) {
10092
- throw new Error(`hook '${prop}' does not exist`);
10093
- }
10094
- if (["options", "block"].includes(prop)) {
10095
- continue;
10096
- }
10097
- const hooksProp = prop;
10098
- const hooksFunc = pack.hooks[hooksProp];
10099
- const prevHook = hooks[hooksProp];
10100
- if (_Hooks.passThroughHooks.has(prop)) {
10101
- hooks[hooksProp] = (arg) => {
10102
- if (this.defaults.async) {
10103
- return Promise.resolve(hooksFunc.call(hooks, arg)).then((ret2) => {
10104
- return prevHook.call(hooks, ret2);
10255
+ this.throttledEmitUpdate = throttle(this.emitUpdate, 120);
10256
+ }
10257
+ emitUpdate = async () => {
10258
+ switch (this.dataType) {
10259
+ case 'number':
10260
+ this.rangeChanged?.emit({
10261
+ startValue: this.startValue,
10262
+ endValue: this.endValue,
10105
10263
  });
10106
- }
10107
- const ret = hooksFunc.call(hooks, arg);
10108
- return prevHook.call(hooks, ret);
10109
- };
10110
- } else {
10111
- hooks[hooksProp] = (...args2) => {
10112
- let ret = hooksFunc.apply(hooks, args2);
10113
- if (ret === false) {
10114
- ret = prevHook.apply(hooks, args2);
10115
- }
10116
- return ret;
10117
- };
10118
- }
10264
+ break;
10265
+ case 'date': {
10266
+ const granularity = this.dateGranularity || 'year';
10267
+ const startTimestamp = getStartOf(this.min, granularity, this.lowerBound + this.startValue);
10268
+ const endTimestamp = getStartOf(this.min, granularity, this.lowerBound + this.endValue + 1);
10269
+ this.rangeChanged?.emit({
10270
+ startValue: startTimestamp,
10271
+ endValue: endTimestamp,
10272
+ });
10273
+ break;
10274
+ }
10119
10275
  }
10120
- opts.hooks = hooks;
10121
- }
10122
- if (pack.walkTokens) {
10123
- const walkTokens2 = this.defaults.walkTokens;
10124
- const packWalktokens = pack.walkTokens;
10125
- opts.walkTokens = function(token) {
10126
- let values = [];
10127
- values.push(packWalktokens.call(this, token));
10128
- if (walkTokens2) {
10129
- values = values.concat(walkTokens2.call(this, token));
10130
- }
10131
- return values;
10132
- };
10133
- }
10134
- this.defaults = { ...this.defaults, ...opts };
10135
- });
10136
- return this;
10137
- }
10138
- setOptions(opt) {
10139
- this.defaults = { ...this.defaults, ...opt };
10140
- return this;
10141
- }
10142
- lexer(src, options2) {
10143
- return _Lexer.lex(src, options2 ?? this.defaults);
10144
- }
10145
- parser(tokens, options2) {
10146
- return _Parser.parse(tokens, options2 ?? this.defaults);
10147
- }
10148
- parseMarkdown(blockType) {
10149
- const parse2 = (src, options2) => {
10150
- const origOpt = { ...options2 };
10151
- const opt = { ...this.defaults, ...origOpt };
10152
- const throwError = this.onError(!!opt.silent, !!opt.async);
10153
- if (this.defaults.async === true && origOpt.async === false) {
10154
- return throwError(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
10155
- }
10156
- if (typeof src === "undefined" || src === null) {
10157
- return throwError(new Error("marked(): input parameter is undefined or null"));
10158
- }
10159
- if (typeof src !== "string") {
10160
- return throwError(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(src) + ", string expected"));
10161
- }
10162
- if (opt.hooks) {
10163
- opt.hooks.options = opt;
10164
- opt.hooks.block = blockType;
10165
- }
10166
- const lexer2 = opt.hooks ? opt.hooks.provideLexer() : blockType ? _Lexer.lex : _Lexer.lexInline;
10167
- const parser2 = opt.hooks ? opt.hooks.provideParser() : blockType ? _Parser.parse : _Parser.parseInline;
10168
- if (opt.async) {
10169
- return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src).then((src2) => lexer2(src2, opt)).then((tokens) => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens).then((tokens) => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens).then((tokens) => parser2(tokens, opt)).then((html2) => opt.hooks ? opt.hooks.postprocess(html2) : html2).catch(throwError);
10170
- }
10171
- try {
10172
- if (opt.hooks) {
10173
- src = opt.hooks.preprocess(src);
10276
+ };
10277
+ handleStartValueChange = (event) => {
10278
+ const inputElement = event.target;
10279
+ const value = Number.parseInt(inputElement.value, 10);
10280
+ this.lastFocusedHandle = 'min';
10281
+ if (value <= this.endValue) {
10282
+ this.startValue = value;
10283
+ this.throttledEmitUpdate();
10174
10284
  }
10175
- let tokens = lexer2(src, opt);
10176
- if (opt.hooks) {
10177
- tokens = opt.hooks.processAllTokens(tokens);
10285
+ else {
10286
+ this.startValue = this.endValue;
10287
+ inputElement.value = `${this.endValue}`;
10178
10288
  }
10179
- if (opt.walkTokens) {
10180
- this.walkTokens(tokens, opt.walkTokens);
10289
+ };
10290
+ handleEndValueChange = (event) => {
10291
+ const inputElement = event.target;
10292
+ const value = Number.parseInt(inputElement.value, 10);
10293
+ this.lastFocusedHandle = 'max';
10294
+ if (value >= this.startValue) {
10295
+ this.endValue = value;
10296
+ this.throttledEmitUpdate();
10181
10297
  }
10182
- let html2 = parser2(tokens, opt);
10183
- if (opt.hooks) {
10184
- html2 = opt.hooks.postprocess(html2);
10298
+ else {
10299
+ this.endValue = this.startValue;
10300
+ inputElement.value = `${this.startValue}`;
10185
10301
  }
10186
- return html2;
10187
- } catch (e) {
10188
- return throwError(e);
10189
- }
10190
10302
  };
10191
- return parse2;
10192
- }
10193
- onError(silent, async) {
10194
- return (e) => {
10195
- e.message += "\nPlease report this to https://github.com/markedjs/marked.";
10196
- if (silent) {
10197
- const msg = "<p>An error occurred:</p><pre>" + escape2(e.message + "", true) + "</pre>";
10198
- if (async) {
10199
- return Promise.resolve(msg);
10303
+ getLabel = (value) => {
10304
+ switch (this.dataType) {
10305
+ case 'number':
10306
+ return `${this.startValue}`;
10307
+ case 'date': {
10308
+ const granularity = this.dateGranularity || 'year';
10309
+ const dateOffset = this.lowerBound + value;
10310
+ const timestamp = getStartOf(this.min, granularity, dateOffset);
10311
+ return getFormattedDateString(this.dateGranularity || 'year', new Date(timestamp));
10312
+ }
10200
10313
  }
10201
- return msg;
10202
- }
10203
- if (async) {
10204
- return Promise.reject(e);
10205
- }
10206
- throw e;
10207
10314
  };
10208
- }
10209
- };
10210
-
10211
- // src/marked.ts
10212
- var markedInstance = new Marked();
10213
- function marked(src, opt) {
10214
- return markedInstance.parse(src, opt);
10315
+ render() {
10316
+ const startPercent = ((this.startValue - this.lowerBound) /
10317
+ (this.upperBound - this.lowerBound)) *
10318
+ 100;
10319
+ const endPercent = ((this.endValue - this.lowerBound) /
10320
+ (this.upperBound - this.lowerBound)) *
10321
+ 100;
10322
+ const startLabel = this.getLabel(this.startValue);
10323
+ const endLabel = this.getLabel(this.endValue);
10324
+ return (hAsync("div", { key: '2c72254f52151edd2e2fa89c092fc788db0b5562', class: 'searchcraft-slider' }, hAsync("div", { key: '98c25badf2c9386d7173ea552e510dcc168e7fc7', class: 'searchcraft-slider-range' }, hAsync("div", { key: '50774db2253e34b1bce68acc0a40b2706cab542d', class: 'searchcraft-slider-active-range', style: {
10325
+ left: `${startPercent}%`,
10326
+ width: `${endPercent - startPercent}%`,
10327
+ } }), hAsync("input", { key: '229afedc1318a63cbd75806805210cf4f5695e6e', class: classNames('searchcraft-slider-input', 'searchcraft-slider-input-min-handle'), max: this.upperBound, min: this.lowerBound, onInput: this.handleStartValueChange.bind(this), step: this.step, style: { zIndex: this.lastFocusedHandle === 'min' ? '2' : '1' }, type: 'range', value: this.startValue }), hAsync("input", { key: '6aa038b01daaba86f501ebbbec30fc6720b549b3', class: classNames('searchcraft-slider-input', 'searchcraft-slider-input-max-handle'), max: this.upperBound, min: this.lowerBound, onInput: this.handleEndValueChange.bind(this), step: this.step, style: { zIndex: this.lastFocusedHandle === 'max' ? '2' : '1' }, type: 'range', value: this.endValue })), hAsync("div", { key: 'f70501538635c3b08ad1e6ac101d0b3192ef8e04', class: 'searchcraft-slider-label' }, hAsync("span", { key: 'ddd539b86774f8900771d77d5ef7eb3a67c98d59', class: 'searchcraft-slider-start-label' }, startLabel), hAsync("span", { key: 'b754a9c8d284e0623032cee6b92f9df88873ec04', class: 'searchcraft-slider-end-label' }, endLabel))));
10328
+ }
10329
+ static get cmpMeta() { return {
10330
+ "$flags$": 768,
10331
+ "$tagName$": "searchcraft-slider",
10332
+ "$members$": {
10333
+ "max": [2],
10334
+ "min": [2],
10335
+ "step": [2],
10336
+ "dataType": [1, "data-type"],
10337
+ "dateGranularity": [1, "date-granularity"],
10338
+ "lowerBound": [32],
10339
+ "upperBound": [32],
10340
+ "endValue": [32],
10341
+ "startValue": [32],
10342
+ "lastFocusedHandle": [32]
10343
+ },
10344
+ "$listeners$": undefined,
10345
+ "$lazyBundleId$": "-",
10346
+ "$attrsToReflect$": []
10347
+ }; }
10215
10348
  }
10216
- marked.options = marked.setOptions = function(options2) {
10217
- markedInstance.setOptions(options2);
10218
- marked.defaults = markedInstance.defaults;
10219
- changeDefaults(marked.defaults);
10220
- return marked;
10221
- };
10222
- marked.getDefaults = _getDefaults;
10223
- marked.defaults = _defaults;
10224
- marked.use = function(...args) {
10225
- markedInstance.use(...args);
10226
- marked.defaults = markedInstance.defaults;
10227
- changeDefaults(marked.defaults);
10228
- return marked;
10229
- };
10230
- marked.walkTokens = function(tokens, callback) {
10231
- return markedInstance.walkTokens(tokens, callback);
10232
- };
10233
- marked.parseInline = markedInstance.parseInline;
10234
- marked.Parser = _Parser;
10235
- marked.parser = _Parser.parse;
10236
- marked.Renderer = _Renderer;
10237
- marked.TextRenderer = _TextRenderer;
10238
- marked.Lexer = _Lexer;
10239
- marked.lexer = _Lexer.lex;
10240
- marked.Tokenizer = _Tokenizer;
10241
- marked.Hooks = _Hooks;
10242
- marked.parse = marked;
10243
10349
 
10244
10350
  /**
10351
+ * @deprecated Use `searchcraft-results-summary` instead.
10352
+ * This component is deprecated and will be removed in a future version.
10353
+ * Please update to use `searchcraft-results-summary` which has the same functionality.
10354
+ *
10245
10355
  * This component renders a summary box for RAG search result summaries.
10246
10356
  * When the user makes a search, a network call is made to retrieve the summary content, which is then
10247
10357
  * rendered in this box.
@@ -10282,9 +10392,9 @@ class SearchcraftSummaryBox {
10282
10392
  */
10283
10393
  searchcraftId;
10284
10394
  summary = '';
10395
+ summaryErrorMessage = '';
10285
10396
  isLoading = false;
10286
10397
  isSummaryNotEnabled = false;
10287
- get hostElement() { return getElement(this); }
10288
10398
  unsubscribe;
10289
10399
  cleanupCore;
10290
10400
  onCoreAvailable(core) {
@@ -10304,9 +10414,8 @@ class SearchcraftSummaryBox {
10304
10414
  handleStateChange(state) {
10305
10415
  this.isLoading = state.isSummaryLoading;
10306
10416
  this.isSummaryNotEnabled = state.isSummaryNotEnabled;
10417
+ this.summaryErrorMessage = state.summaryErrorMessage;
10307
10418
  this.summary = this.sanitizeMarkdown(state.summary);
10308
- // Update DOM directly for performance (avoids re-render)
10309
- this.updateContentElement(state.summary);
10310
10419
  }
10311
10420
  /**
10312
10421
  * Sanitizes and converts markdown to HTML.
@@ -10314,15 +10423,6 @@ class SearchcraftSummaryBox {
10314
10423
  sanitizeMarkdown(markdown) {
10315
10424
  return purify.sanitize(marked.parse(markdown));
10316
10425
  }
10317
- /**
10318
- * Updates the content element directly without triggering a re-render.
10319
- */
10320
- updateContentElement(markdown) {
10321
- const contentElement = this.hostElement?.querySelector('.searchcraft-summary-box-content');
10322
- if (contentElement) {
10323
- contentElement.innerHTML = this.sanitizeMarkdown(markdown);
10324
- }
10325
- }
10326
10426
  /**
10327
10427
  * Renders the appropriate content based on current state.
10328
10428
  */
@@ -10331,12 +10431,12 @@ class SearchcraftSummaryBox {
10331
10431
  return hAsync("searchcraft-loading", { label: 'LOADING' });
10332
10432
  }
10333
10433
  if (this.isSummaryNotEnabled) {
10334
- return (hAsync("div", { class: 'searchcraft-summary-box-content' }, "AI summaries are not enabled"));
10434
+ return (hAsync("div", { class: 'searchcraft-summary-box-content' }, this.summaryErrorMessage || 'AI summaries are not enabled'));
10335
10435
  }
10336
- return hAsync("div", { class: 'searchcraft-summary-box-content' }, this.summary);
10436
+ return (hAsync("div", { class: 'searchcraft-summary-box-content', innerHTML: this.summary }));
10337
10437
  }
10338
10438
  render() {
10339
- return hAsync("div", { key: '82fe97172c3299643ba0ac303031166502c4101a', class: 'searchcraft-summary-box' }, this.renderContent());
10439
+ return hAsync("div", { key: 'a33091962cfbbcf0399e9e15e8346590511090e1', class: 'searchcraft-summary-box' }, this.renderContent());
10340
10440
  }
10341
10441
  static get cmpMeta() { return {
10342
10442
  "$flags$": 768,
@@ -10344,6 +10444,7 @@ class SearchcraftSummaryBox {
10344
10444
  "$members$": {
10345
10445
  "searchcraftId": [1, "searchcraft-id"],
10346
10446
  "summary": [32],
10447
+ "summaryErrorMessage": [32],
10347
10448
  "isLoading": [32],
10348
10449
  "isSummaryNotEnabled": [32]
10349
10450
  },
@@ -10353,7 +10454,7 @@ class SearchcraftSummaryBox {
10353
10454
  }; }
10354
10455
  }
10355
10456
 
10356
- var styles = `[class*=searchcraft-],[class*=searchcraft-] *,[class*=searchcraft-]::before,[class*=searchcraft-]::after,[class*=searchcraft-] *,::before,[class*=searchcraft-] *,::after{box-sizing:border-box;padding:0;margin:0}:root{--sc-text-base-size: 1em;--sc-text-scale-ratio: 1.1;--sc-font-family: sans-serif;--sc-font-bold: 700;--sc-font-normal: 400;--sc-heading-1-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-2-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-3-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-4-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-5-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-6-font-size: calc( var(--sc-text-base-size) / ( var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) ) );--sc-body-font-size: calc(var(--sc-text-base-size));--sc-body-small-font-size: calc( var(--sc-text-base-size) / ( var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) ) )}:root{--sc-border-radius: 8px;--sc-border-radius-sm: calc(var(--sc-border-radius) / 2);--sc-border-radius-lg: calc(var(--sc-border-radius) * 2);--sc-border-radius-xl: calc(var(--sc-border-radius) * 3);--sc-border-radius-2xl: calc(var(--sc-border-radius) * 4);--sc-border-radius-full: 9999px}:root{--sc-breakpoint-sm: 576px;--sc-breakpoint-md: 768px;--sc-breakpoint-lg: 992px}:root{--sc-surface-neutral-primary: var(--sc-color-background, #ffffff);--sc-color-background-hover-computed: hsl( from var(--sc-color-background) h s clamp(10, calc(l + 5), 95) );--sc-surface-neutral-primary-hover: var( --sc-color-background-hover, var(--sc-color-background-hover-computed, #fafafa) );--sc-color-background-active-computed: hsl( from var(--sc-color-background) h s clamp(5, calc(l - 5), 90) );--sc-surface-neutral-primary-active: var( --sc-color-background-active, var(--sc-color-background-active-computed, #f7f7f7) );--sc-surface-neutral-secondary: var( --sc-color-background-secondary, var(--sc-color-background, #f3f3f3) );--sc-color-background-secondary-hover-computed: hsl( from var(--sc-color-background-secondary) h s clamp(10, calc(l + 5), 95) );--sc-surface-neutral-secondary-hover: var( --sc-color-background-hover, var(--sc-color-background-hover-computed, #e6e6e6) );--sc-color-background-secondary-active-computed: hsl( from var(--sc-color-background-secondary) h s clamp(5, calc(l - 5), 90) );--sc-surface-neutral-secondary-active: var( --sc-color-background-secondary-active, var(--sc-color-background-active-computed, #e0e0e0) );--sc-surface-neutral-light: #ffffff;--sc-content-neutral-primary: var(--sc-color-foreground, #292929);--sc-color-foreground-secondary-computed: hsl( from var(--sc-color-foreground) h s clamp(10, calc(l + 5), 90) );--sc-content-neutral-secondary: var( --sc-color-foreground-secondary, var(--sc-color-foreground-secondary-computed, #404040) );--sc-border-neutral: var(--sc-color-border, rgba(0, 0, 0, 0.1));--sc-surface-brand-primary: var(--sc-color-brand, #000000);--sc-color-brand-hover-computed: hsl( from var(--sc-color-brand) h s clamp(20, calc(l + 5), 95) );--sc-surface-brand-primary-hover: var( --sc-color-brand-hover, var(--sc-color-brand-hover-computed, #2e2e2e) );--sc-color-brand-active-computed: hsl( from var(--sc-color-brand) h s clamp(10, calc(l - 5), 85) );--sc-surface-brand-primary-active: var( --sc-color-brand-active, var(--sc-color-brand-active-computed, #292929) );--sc-surface-brand-secondary: var( --sc-color-brand-secondary, var(--sc-color-brand, #e6e6e6) );--sc-color-brand-secondary-hover-computed: hsl( from var(--sc-color-brand-secondary) h s clamp(10, calc(l + 5), 95) );--sc-surface-brand-secondary-hover: var( --sc-color-background-hover, var(--sc-color-background-hover-computed, #ebebeb) );--sc-color-brand-secondary-active-computed: hsl( from var(--sc-color-brand-secondary) h s clamp(5, calc(l - 5), 90) );--sc-surface-brand-secondary-active: var( --sc-color-brand-secondary-active, var(--sc-color-brand-active-computed, #e0e0e0) );--sc-content-brand: var( --sc-color-brand-text, var(--sc-surface-brand-primary) );--sc-content-brand-on-primary: #ffffff;--sc-border-brand: var(--sc-surface-brand-primary);--sc-surface-success-primary: var(--sc-color-success, #008000);--sc-color-success-primary-hover-computed: hsl( from var(--sc-color-success) h s 30 );--sc-surface-success-primary-hover: var( --sc-color-success-primary-hover, var(--sc-color-success-primary-hover-computed, #009900) );--sc-color-success-primary-active-computed: hsl( from var(--sc-color-success) h s 20 );--sc-surface-success-primary-active: var( --sc-color-success-primary-active, var(--sc-color-success-primary-active-computed, #006600) );--sc-color-success-secondary-computed: hsl( from var(--sc-color-success) h s 90 );--sc-surface-success-secondary: var( --sc-color-success-secondary, var(--sc-color-success-secondary-computed, #ccffcc) );--sc-color-success-secondary-hover-computed: hsl( from var(--sc-color-success-secondary) h s 95 );--sc-surface-success-secondary-hover: var( --sc-color-success-secondary-hover, var(--sc-color-success-secondary-hover-computed, #e6ffe6) );--sc-color-success-secondary-active-computed: hsl( from var(--sc-color-success-secondary) h s 85 );--sc-surface-success-secondary-active: var( --sc-color-success-secondary-active, var(--sc-color-success-secondary-active-computed, #b2ffb2) );--sc-content-success: var( --sc-color-brand-text, hsl(from var(--sc-surface-success-primary) h s 30) );--sc-content-success-on-primary: #ffffff;--sc-border-success: var(--sc-surface-success-primary);--sc-surface-caution-primary: var(--sc-color-caution, #cc6600);--sc-color-caution-primary-hover-computed: hsl( from var(--sc-color-caution) h s 30 );--sc-surface-caution-primary-hover: var( --sc-color-caution-primary-hover, var(--sc-color-caution-primary-hover-computed, #e57300) );--sc-color-caution-primary-active-computed: hsl( from var(--sc-color-caution) h s 20 );--sc-surface-caution-primary-active: var( --sc-color-caution-primary-active, var(--sc-color-caution-primary-active-computed, #b25a00) );--sc-color-caution-secondary-computed: hsl( from var(--sc-color-caution) h s 90 );--sc-surface-caution-secondary: var( --sc-color-caution-secondary, var(--sc-color-caution-secondary-computed, #ffd9b3) );--sc-color-caution-secondary-hover-computed: hsl( from var(--sc-color-caution-secondary) h s 95 );--sc-surface-caution-secondary-hover: var( --sc-color-caution-secondary-hover, var(--sc-color-caution-secondary-hover-computed, #ffe5cc) );--sc-color-caution-secondary-active-computed: hsl( from var(--sc-color-caution-secondary) h s 85 );--sc-surface-caution-secondary-active: var( --sc-color-caution-secondary-active, var(--sc-color-caution-secondary-active-computed, #ffcc99) );--sc-content-caution: var( --sc-color-caution-text, hsl(from var(--sc-surface-caution-primary) h s 30) );--sc-content-caution-on-primary: #ffffff;--sc-border-caution: var(--sc-surface-caution-primary);--sc-surface-danger-primary: var(--sc-color-danger, #cc0000);--sc-color-danger-primary-hover-computed: hsl( from var(--sc-color-danger) h s 30 );--sc-surface-danger-primary-hover: var( --sc-color-danger-primary-hover, var(--sc-color-danger-primary-hover-computed, #e50000) );--sc-color-danger-primary-active-computed: hsl( from var(--sc-color-danger) h s 20 );--sc-surface-danger-primary-active: var( --sc-color-danger-primary-active, var(--sc-color-danger-primary-active-computed, #b30000) );--sc-color-danger-secondary-computed: hsl(from var(--sc-color-danger) h s 90);--sc-surface-danger-secondary: var( --sc-color-danger-secondary, var(--sc-color-danger-secondary-computed, #ffcccc) );--sc-color-danger-secondary-hover-computed: hsl( from var(--sc-color-danger-secondary) h s 95 );--sc-surface-danger-secondary-hover: var( --sc-color-danger-secondary-hover, var(--sc-color-danger-secondary-hover-computed, #ffe7e7) );--sc-color-danger-secondary-active-computed: hsl( from var(--sc-color-danger-secondary) h s 85 );--sc-surface-danger-secondary-active: var( --sc-color-danger-secondary-active, var(--sc-color-danger-secondary-active-computed, #ffb3b3) );--sc-content-danger: var( --sc-color-caution-text, hsl(from var(--sc-surface-danger-primary) h s 30) );--sc-content-danger-on-primary: #ffffff;--sc-border-danger: var(--sc-surface-danger-primary);--sc-color-disabled: hsl(from var(--sc-color-page-primary) h s calc(l * 0.5));--sc-surface-disabled: var(--sc-color-disabled, #d9d9d9);--sc-color-disabled-text: hsl( from var(--sc-color-text-primary) h s calc(l * 0.5) );--sc-content-disabled: var(--sc-color-disabled-text, #737373);--sc-content-disabled-on-disabled: var(--sc-color-disabled-text, #737373)}@supports(hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none){:root{--sc-color-background-hover-computed: hsl( from var(--sc-color-background) h s clamp(10%, calc(l + 5%), 95%) );--sc-color-background-active-computed: hsl( from var(--sc-color-background) h s clamp(5%, calc(l - 5%), 90%) );--sc-color-foreground-secondary-computed: hsl( from var(--sc-color-foreground) h s clamp(10%, calc(l + 5%), 90%) );--sc-color-brand-hover-computed: hsl( from var(--sc-color-brand) h s clamp(20%, calc(l + 5%), 95%) );--sc-color-brand-active-computed: hsl( from var(--sc-color-brand) h s clamp(10%, calc(l - 5%), 85%) );--sc-color-success-primary-hover-computed: hsl( from var(--sc-color-success) h s 30% );--sc-color-success-primary-active-computed: hsl( from var(--sc-color-success) h s 20% );--sc-color-success-secondary-computed: hsl( from var(--sc-color-success) h s 90% );--sc-color-success-secondary-hover-computed: hsl( from var(--sc-color-success-secondary) h s 95% );--sc-color-success-secondary-active-computed: hsl( from var(--sc-color-success-secondary) h s 85% );--sc-content-success: var( --sc-color-brand-text, hsl(from var(--sc-surface-success-primary) h s 30%) );--sc-color-caution-primary-hover-computed: hsl( from var(--sc-color-caution) h s 30% );--sc-color-caution-primary-active-computed: hsl( from var(--sc-color-caution) h s 20% );--sc-color-caution-secondary-computed: hsl( from var(--sc-color-caution) h s 90% );--sc-color-caution-secondary-hover-computed: hsl( from var(--sc-color-caution-secondary) h s 95% );--sc-color-caution-secondary-active-computed: hsl( from var(--sc-color-caution-secondary) h s 85% );--sc-content-caution: var( --sc-color-caution-text, hsl(from var(--sc-surface-caution-primary) h s 30%) );--sc-color-danger-primary-hover-computed: hsl( from var(--sc-color-danger) h s 30% );--sc-color-danger-primary-active-computed: hsl( from var(--sc-color-danger) h s 20% );--sc-color-danger-secondary-computed: hsl( from var(--sc-color-danger) h s 90% );--sc-color-danger-secondary-hover-computed: hsl( from var(--sc-color-danger-secondary) h s 95% );--sc-color-danger-secondary-active-computed: hsl( from var(--sc-color-danger-secondary) h s 85% );--sc-content-danger: var( --sc-color-caution-text, hsl(from var(--sc-surface-danger-primary) h s 30%) )}}.searchcraft-ad{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased}.searchcraft-ad-no-template{display:flex;flex-direction:column;font-size:.875rem}.searchcraft-ad-no-template>p{margin:0}.searchcraft-adm-ad{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-search-result{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased}.searchcraft-search-result-no-template{display:flex;flex-direction:column;font-size:.875rem}.searchcraft-search-result-no-template>p{margin:0}.searchcraft-search-results{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-search-results-empty-state{text-align:center}.searchcraft-search-results-error-message{text-align:center}.searchcraft-button{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);background:none;border:2px solid rgba(0,0,0,0);border-radius:var(--sc-border-radius);cursor:pointer;display:flex;gap:4px;padding:12px;position:relative}.searchcraft-button.searchcraft-button-disabled{cursor:not-allowed}.searchcraft-button-primary{background-color:var(--sc-surface-brand-primary);color:var(--sc-content-brand-on-primary);font-weight:var(--sc-font-bold)}.searchcraft-button-primary:hover{background-color:var(--sc-surface-brand-primary-hover)}.searchcraft-button-primary:focus{border-color:var(--sc-border-primary)}.searchcraft-button-primary:active{background-color:var(--sc-surface-brand-primary-active)}.searchcraft-button-primary.searchcraft-button-disabled,.searchcraft-button-primary.searchcraft-button-disabled:hover,.searchcraft-button-primary.searchcraft-button-disabled:focus,.searchcraft-button-primary.searchcraft-button-disabled:active{background-color:var(--sc-surface-disabled);border-color:rgba(0,0,0,0);color:var(--sc-content-disabled)}.searchcraft-button-tertiary{background-color:var(--sc-surface-neutral-primary);color:var(--sc-content-brand);font-weight:var(--sc-font-normal)}.searchcraft-button-tertiary:hover{background-color:var(--sc-surface-brand-secondary-hover)}.searchcraft-button-tertiary:focus{background-color:var(--sc-surface-neutral-light);border-color:var(--sc-border-primary)}.searchcraft-button-tertiary:active{background-color:var(--sc-surface-brand-secondary-active)}.searchcraft-button-tertiary.searchcraft-button-disabled,.searchcraft-button-tertiary.searchcraft-button-disabled:hover,.searchcraft-button-tertiary.searchcraft-button-disabled:focus,.searchcraft-button-tertiary.searchcraft-button-disabled:active{background-color:var(--sc-surface-neutral-light);border-color:rgba(0,0,0,0);color:var(--sc-content-disabled)}.searchcraft-button-icon{fill:none}.searchcraft-error-message{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-danger);margin:0}.searchcraft-facet-list{display:flex;flex-direction:column;gap:8px;width:100%}.searchcraft-facet-list-checkbox-label{align-items:center;color:var(--sc-content-neutral-primary);display:flex;font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);gap:8px;position:relative;-webkit-font-smoothing:antialiased}.searchcraft-facet-list-checkbox-input-wrapper{position:relative}.searchcraft-facet-list-checkbox-input{align-items:center;appearance:none;background-color:var(--sc-surface-neutral-secondary);border:1px solid var(--sc-surface-disabled);border-radius:var(--sc-border-radius);cursor:pointer;display:flex;height:24px;justify-content:center;width:24px;margin:0}.searchcraft-facet-list-checkbox-input:focus{outline:2px solid var(--sc-surface-brand-primary);outline-offset:2px}.searchcraft-facet-list-checkbox-input:checked{background-color:var(--sc-surface-brand-primary);position:relative}.searchcraft-facet-list-checkbox-input:checked+.searchcraft-facet-list-checkbox-input-check-icon{display:flex}.searchcraft-facet-list-checkbox-input:checked+.searchcraft-facet-list-checkbox-input-dash-icon{display:flex}.searchcraft-facet-child-list{display:flex;flex-direction:column;gap:6px}.searchcraft-facet-child-list-checkbox-label{margin-left:24px}.searchcraft-facet-child-list-checkbox-label:first-child{margin-top:6px}.searchcraft-facet-list-checkbox-input-check-icon{display:none;height:16px;left:50%;position:absolute;margin-top:2px;top:50%;transform:translate(-50%, -50%);width:16px}.searchcraft-facet-list-checkbox-input-dash-icon{display:none;height:3px;left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);width:14px}.searchcraft-facet-list-message{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-disabled);text-align:center}.searchcraft-facet-list-wrapper{display:flex;flex-direction:column;width:100%;min-height:0}.searchcraft-facet-list-content{display:flex;flex-direction:column;gap:8px;min-height:0;flex-shrink:0}.searchcraft-facet-list-view-more{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);background:none;border:none;color:var(--sc-content-brand);cursor:pointer;padding:8px 0;text-align:left;text-decoration:underline}.searchcraft-facet-list-view-more:hover{color:var(--sc-surface-brand-primary-hover)}.searchcraft-facet-list-view-more:focus{outline:2px solid var(--sc-surface-brand-primary);outline-offset:2px}.searchcraft-filter-panel{display:flex;flex-direction:column;gap:16px}.searchcraft-filter-panel-section{display:flex;flex-direction:column;gap:8px}.searchcraft-filter-panel-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);font-weight:var(--sc-font-bold)}[data-toggle-facet-section]{cursor:pointer;display:flex;align-items:center;justify-content:space-between;width:100%;position:relative}[data-toggle-facet-section]::after{content:"›";display:inline-block;font-size:1.5em;line-height:1;margin-left:auto;flex-shrink:0;transition:transform .2s ease;transform-origin:center}[data-toggle-facet-section][data-facet-section-collapsed]::after{transform:rotate(90deg)}[data-toggle-facet-section][data-facet-section-expanded]::after{transform:rotate(-90deg)}@media(max-width: 767px){[data-toggle-filter-panel]{cursor:pointer;display:flex !important;align-items:center;justify-content:space-between;width:100%}[data-toggle-filter-panel]::after{content:"›";display:inline-block;font-size:1.5em;line-height:1;margin-left:auto;flex-shrink:0;transition:transform .2s ease;transform-origin:center}[data-toggle-filter-panel][data-filter-panel-collapsed]::after{transform:rotate(90deg)}[data-toggle-filter-panel][data-filter-panel-expanded]::after{transform:rotate(-90deg)}}@media(min-width: 768px){[data-toggle-filter-panel]{cursor:default}[data-toggle-filter-panel]::after{display:none}}:root{--sc-input-form-border-radius: var(--sc-border-radius);--sc-input-form-search-icon-size: 20px;--sc-input-form-clear-icon-size: 20px}.searchcraft-input-form-grid{display:grid;gap:4px 8px}.searchcraft-input-form-grid-button-left{grid-template-rows:repeat(3, auto);grid-template-columns:auto 1fr}.searchcraft-input-form-grid-button-left .searchcraft-input-form-button{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-left .searchcraft-input-form-label{grid-column:2/span 1;grid-row:1/span 1}.searchcraft-input-form-grid-button-left .searchcraft-input-form-error-message{grid-column:2/span 1;grid-row:3/span 1}.searchcraft-input-form-grid-button-left .searchcraft-input-form-input-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-right{grid-template-rows:repeat(3, auto);grid-template-columns:1fr auto}.searchcraft-input-form-grid-button-right .searchcraft-input-form-button{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-right .searchcraft-input-form-label{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-form-grid-button-right .searchcraft-input-form-error-message{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-form-grid-button-right .searchcraft-input-form-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-none{grid-template-rows:repeat(3, auto);grid-template-columns:auto}.searchcraft-input-form-grid-button-none .searchcraft-input-form-button{display:none}.searchcraft-input-form-grid-button-none .searchcraft-input-form-label{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-form-grid-button-none .searchcraft-input-form-error-message{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-form-grid-button-none .searchcraft-input-form-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-form-input-wrapper{display:flex;position:relative}.searchcraft-input-form-input{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);background-color:var(--sc-surface-neutral-secondary);border-radius:var(--sc-input-form-border-radius);border:none;color:var(--sc-content-neutral-primary);flex:1;outline:none;padding:12px 44px}.searchcraft-input-form-input::placeholder{color:var(--sc-content-disabled)}.searchcraft-input-form-input:focus{outline:var(--sc-border-brand) solid 2px;outline-offset:-1px}.searchcraft-input-form-input.searchcraft-placeholder-hide-on-focus:focus::placeholder{opacity:0}.searchcraft-input-form-error{color:var(--sc-content-danger);outline:var(--sc-border-danger) solid 2px}.searchcraft-input-form-error:focus{outline:var(--sc-border-danger) solid 2px}.searchcraft-input-form-input-icon{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;pointer-events:none;top:0;width:44px}.searchcraft-input-form-input-search-icon{color:var(--sc-content-neutral-secondary);fill:none;height:var(--sc-input-form-search-icon-size);pointer-events:none;width:var(--sc-input-form-search-icon-size)}.searchcraft-input-form-clear-button{all:unset;align-items:center;bottom:0;border:none;cursor:pointer;display:flex;justify-content:center;outline:none;position:absolute;right:0;top:0;width:44px}.searchcraft-input-form-clear-icon{color:var(--sc-content-brand);fill:none;height:var(--sc-input-form-clear-icon-size);width:var(--sc-input-form-clear-icon-size)}.searchcraft-input-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-neutral-primary);font-weight:var(--sc-font-bold);margin-top:4px;margin-bottom:4px}:root{--sc-popover-button-border-radius: var(--sc-border-radius)}@media(min-width: 576px){:root{--sc-popover-button-border-radius: var(--sc-border-radius-lg)}}.searchcraft-popover-button{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);cursor:pointer}.searchcraft-popover-button-skeuomorphic{appearance:none;background:none;border:none;color:var(--sc-content-neutral-primary);display:block;width:100%}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-wrapper{border:1px solid var(--sc-border-neutral);border-radius:var(--sc-popover-button-border-radius);box-shadow:0 1px 1px rgb(from var(--sc-content-neutral-secondary) r g b/10%) inset,0 2px 4px rgb(from var(--sc-content-neutral-secondary) r g b/5%) inset;display:flex;gap:24px;height:40px;justify-content:space-between;line-height:1;padding:4px 5px 4px 10px;background:var(--sc-surface-neutral-primary)}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-wrapper{box-shadow:0 1px 1px rgb(from var(--sc-content-neutral-secondary) r g b/10%) inset,0 2px 2px rgb(from var(--sc-content-neutral-secondary) r g b/5%) inset,0 4px 4px rgb(from var(--sc-content-neutral-secondary) r g b/5%) inset;height:63px;padding:8px 10px 8px 16px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input{align-items:center;display:flex;gap:4px}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input{gap:8px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps{color:var(--sc-content-neutral-secondary);display:flex;gap:4px;font-size:20px;font-weight:500}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps{gap:8px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap{border-radius:calc(var(--sc-popover-button-border-radius) - 3px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 3px);background-color:var(--sc-surface-neutral-primary);box-shadow:0 3px hsl(from var(--sc-surface-neutral-secondary) h s calc(l - 5)),0 1px 2px rgb(from var(--sc-content-neutral-secondary) r g b/10%),0 6px 4px rgb(from var(--sc-content-neutral-secondary) r g b/5%);height:calc(100% - 2px);position:relative}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap{border-radius:calc(var(--sc-popover-button-border-radius) - 8px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 8px);box-shadow:0 4px hsl(from var(--sc-surface-neutral-secondary) h s calc(l - 5)),0 1px 2px rgb(from var(--sc-content-neutral-secondary) r g b/15%),0 6px 1px rgb(from var(--sc-content-neutral-secondary) r g b/20%),0 7px 2px rgb(from var(--sc-content-neutral-secondary) r g b/15%),0 9px 4px rgb(from var(--sc-content-neutral-secondary) r g b/10%),0 13px 8px rgb(from var(--sc-content-neutral-secondary) r g b/5%);height:calc(100% - 5px)}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::before,.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::after{content:"";display:block}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::before{border-radius:calc(var(--sc-popover-button-border-radius) - 4px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 4px);background:linear-gradient(340deg, rgb(from var(--sc-surface-neutral-secondary) r g b/2%) 0%, var(--sc-surface-neutral-secondary) 100%);inset:2px;position:absolute}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::before{border-radius:calc(var(--sc-popover-button-border-radius) - 12px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 12px);inset:4px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::after{aspect-ratio:1/1;height:100%}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap>span{display:flex;line-height:1;left:50%;margin-top:2%;position:absolute;top:50%;transform:translate(-50%, -50%)}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input-search-icon{height:60%;width:auto}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input-search-icon{height:50%}}:root{--sc-popover-list-view-height: 600px;--sc-popover-modal-max-width: 800px}.searchcraft-popover-form{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);display:flex;flex:1;flex-direction:column}.searchcraft-popover-form searchcraft-input-form,.searchcraft-popover-form searchcraft-popover-footer{width:100%}.searchcraft-popover-form.searchcraft-popover-form-active .searchcraft-popover-form-input{padding-bottom:1px}.searchcraft-popover-form searchcraft-popover-list-view{flex-shrink:1;height:100%;min-height:0;overflow:auto;padding:0 24px}.searchcraft-popover-form searchcraft-summary-box{margin-bottom:16px}.searchcraft-popover-form-input{display:flex;flex-direction:row;gap:12px}.searchcraft-popover-form-input .searchcraft-input-form-input{background-color:var(--sc-surface-neutral-primary);border:1px solid var(--sc-border-neutral);border-radius:var(--sc-border-radius-lg);box-shadow:0 1px 1px rgb(from var(--sc-content-neutral-primary) r g b/10%) inset,0 2px 2px rgb(from var(--sc-content-neutral-primary) r g b/5%) inset,0 4px 4px rgb(from var(--sc-content-neutral-primary) r g b/5%) inset;width:0}.searchcraft-popover-form-cancel-button{background:none;border:none;cursor:pointer;font-size:14px}.searchcraft-popover-form-modal-input,.searchcraft-popover-form-fullscreen-input{padding:24px}.searchcraft-popover-form-modal-popover-list-view,.searchcraft-popover-form-fullscreen-popover-list-view{flex-grow:1;flex-shrink:1;min-height:0;overflow:auto;padding:0 24px}.searchcraft-popover-form-modal-popover-list-view searchcraft-summary-box,.searchcraft-popover-form-fullscreen-popover-list-view searchcraft-summary-box{padding:20px 0;margin-bottom:0;border-bottom:1px solid var(--sc-border-neutral-subtle)}.searchcraft-popover-form-inline{background-color:var(--sc-surface-neutral-primary);border:1px solid rgba(0,0,0,0);border-radius:var(--sc-border-radius-xl);padding:12px;position:relative}.searchcraft-popover-form-inline.searchcraft-popover-form-active{border:1px solid var(--sc-border-neutral);border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;padding-bottom:1px}.searchcraft-popover-form-inline searchcraft-popover-list-view{padding:0 12px}.searchcraft-popover-form-inline .searchcraft-input-form-input,.searchcraft-popover-form-inline .searchcraft-popover-list-item-link,.searchcraft-popover-form-inline .searchcraft-adm-ad-link{border-radius:calc(--sc-border-radius-xl - 12px);border-radius:calc(var(--sc-border-radius-xl) - 12px)}.searchcraft-popover-form-inline-wrapper{background-color:var(--sc-surface-neutral-primary);border:1px solid var(--sc-border-neutral);border-top:none;border-bottom-left-radius:var(--sc-border-radius-xl);border-bottom-right-radius:var(--sc-border-radius-xl);display:flex;flex-direction:column;left:-1px;max-height:var(--sc-popover-list-view-height);overflow:hidden;position:absolute;right:-1px;top:100%}.searchcraft-popover-form-inline-wrapper searchcraft-summary-box{padding:16px 12px;margin-bottom:0;border-bottom:1px solid var(--sc-border-neutral-subtle)}.searchcraft-popover-form-modal{align-items:center;display:flex;inset:0;position:fixed;z-index:1000}.searchcraft-popover-form-modal .searchcraft-input-form-input,.searchcraft-popover-form-modal .searchcraft-popover-list-item-link,.searchcraft-popover-form-modal .searchcraft-adm-ad-link{border-radius:calc(--sc-border-radius-2xl - 20px);border-radius:calc(var(--sc-border-radius-2xl) - 20px)}.searchcraft-popover-form-modal-backdrop{background-color:rgb(from var(--sc-content-neutral-primary) r g b/50%);display:none;inset:0;position:fixed}@media(min-width: 576px){.searchcraft-popover-form-modal-backdrop{display:block}}.searchcraft-popover-form-modal-wrapper{background-color:var(--sc-surface-neutral-primary);box-shadow:1px 2px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 2px 4px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 4px 8px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 8px 16px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 16px 32px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 32px 64px rgb(from var(--sc-content-neutral-primary) r g b/7%);display:flex;flex-direction:column;inset:0;max-width:var(--sc-popover-modal-max-width);overflow:hidden;position:absolute;width:100%;z-index:1001}@media(min-width: 576px){.searchcraft-popover-form-modal-wrapper{border-radius:var(--sc-border-radius-2xl);inset:0;margin-top:100px;max-height:var(--sc-popover-list-view-height);max-width:var(--sc-popover-modal-max-width);position:relative}}.searchcraft-popover-form-modal-cancel-button{border-radius:calc(--sc-border-radius-2xl - 20px);border-radius:calc(var(--sc-border-radius-2xl) - 20px);padding:8px}@media(min-width: 576px){.searchcraft-popover-form-modal-cancel-button{padding:8px 12px}}.searchcraft-popover-form-fullscreen{background-color:var(--sc-surface-neutral-primary);display:flex;flex-direction:column;justify-content:space-between;inset:0;position:fixed;z-index:1000}.searchcraft-popover-form-fullscreen .searchcraft-popover-list-item-link,.searchcraft-popover-form-fullscreen .searchcraft-adm-ad-link{border-radius:var(--sc-border-radius-lg)}.searchcraft-popover-form-fullscreen-cancel-button{border-radius:var(--sc-border-radius-lg);padding:8px}@media(min-width: 576px){.searchcraft-popover-form-fullscreen-cancel-button{padding:8px 12px}}.searchcraft-popover-footer{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;background-color:var(--sc-surface-neutral-secondary);box-shadow:0 1px 1px rgb(from var(--sc-content-neutral-primary) r g b/10%) inset,0 2px 2px rgb(from var(--sc-content-neutral-primary) r g b/5%) inset,0 4px 4px rgb(from var(--sc-content-neutral-primary) r g b/5%) inset;display:flex;gap:8px;justify-content:space-between;line-height:1;padding:20px 24px}@media(min-width: 576px){.searchcraft-popover-footer{padding:20px 32px}}.searchcraft-popover-footer-results-info{margin:0}.searchcraft-popover-footer-link{align-items:center;color:var(--sc-content-neutral-primary);display:flex;max-width:160px;padding-top:6px;width:100%}.searchcraft-popover-footer-results{align-items:center;display:flex;gap:8px}.searchcraft-popover-footer-view-all{align-items:center;border-radius:999px;border:1px solid var(--sc-border-neutral-strong);color:var(--sc-content-neutral-primary);display:inline-flex;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-bold);gap:6px;line-height:1;padding:6px 10px;text-decoration:none}.searchcraft-popover-footer-view-all-shortcut{display:inline-flex;gap:2px}.searchcraft-popover-footer-view-all-shortcut kbd{background-color:var(--sc-surface-neutral-primary);border-radius:4px;border:1px solid var(--sc-border-neutral-subtle);line-height:1;padding:1px 4px}:root{--sc-popover-list-item-image-fit: contain}.searchcraft-popover-list-item{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;border-bottom:1px solid var(--sc-border-neutral);padding:12px 0}searchcraft-popover-list-item:last-child .searchcraft-popover-list-item{border-bottom:none}.searchcraft-popover-list-item-link{align-items:flex-start;color:var(--sc-content-neutral-primary);display:flex;gap:24px;padding:12px;text-decoration:none}.searchcraft-popover-list-item-link:focus,.searchcraft-popover-list-item-link:active{background-color:var(--sc-surface-neutral-primary-active)}.searchcraft-popover-list-item-link:hover{background-color:var(--sc-surface-neutral-primary-hover)}.searchcraft-popover-list-item-image-wrapper{align-items:center;aspect-ratio:16/9;display:flex;flex-shrink:0;justify-content:center;width:160px}.searchcraft-popover-list-item-image{height:100%;object-fit:var(--sc-popover-list-item-image-fit);width:100%}.searchcraft-popover-list-item-content{display:flex;flex-direction:column;flex-grow:1;gap:4px;justify-content:center}.searchcraft-popover-list-item-content-title,.searchcraft-popover-list-item-content-subtitle{display:-webkit-box;line-clamp:2;margin:0;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical}.searchcraft-popover-list-item-content-title{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-heading-5-font-size);font-weight:var(--sc-font-bold)}.searchcraft-popover-list-item-content-subtitle{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-popover-list-view{display:flex;flex-direction:column}.searchcraft-results-info{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-primary);margin:0}.searchcraft-slider{align-items:center;display:flex;flex-direction:column;gap:10px;width:100%;margin-top:4px}.searchcraft-slider-range{align-items:center;background-color:var(--sc-surface-disabled);border-radius:999px;display:flex;position:relative;height:4px;width:100%}.searchcraft-slider-range::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range .searchcraft-slider-active-range{background-color:var(--sc-surface-brand-primary);border-radius:2px;height:4px;position:absolute;top:50%;transform:translateY(-50%);z-index:0}.searchcraft-slider-range .searchcraft-slider-active-range::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range .searchcraft-slider-active-range::-moz-range-track{pointer-events:none}.searchcraft-slider-range .searchcraft-slider-input{appearance:none;background:rgba(0,0,0,0);border-radius:2px;height:4px;margin:0;outline:none;pointer-events:none;position:absolute;width:100%;-webkit-appearance:none}.searchcraft-slider-range .searchcraft-slider-input::-webkit-slider-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:1px solid var(--sc-border-neutral);cursor:pointer;height:18px;pointer-events:all;width:18px;-webkit-appearance:none}.searchcraft-slider-range .searchcraft-slider-input::-moz-range-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:1px solid var(--sc-border-neutral);cursor:pointer;height:18px;pointer-events:all;width:18px}.searchcraft-slider-range .searchcraft-slider-input:focus::-webkit-slider-thumb{outline:2px solid var(--sc-surface-brand-primary)}.searchcraft-slider-range .searchcraft-slider-input:focus::-moz-range-thumb{outline:2px solid var(--sc-surface-brand-primary)}.searchcraft-slider-label{color:var(--sc-content-primary);display:flex;font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);justify-content:space-between;margin-top:4px;width:100%}.searchcraft-slider-start-label,.searchcraft-slider-end-label{min-width:30px;text-align:center}.searchcraft-toggle-button{align-items:flex-start;display:flex;gap:10px;justify-content:space-between}.searchcraft-toggle-button-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-neutral-primary);margin:0}.searchcraft-toggle-button-sub-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-neutral-secondary);margin:0}.searchcraft-toggle-button-background{background:var(--sc-surface-disabled);border-radius:var(--sc-border-radius-full);border:none;cursor:pointer;flex-shrink:0;height:26px;position:relative;transition:background-color .2s;width:44px}.searchcraft-toggle-button-handle{background:var(--sc-surface-neutral-light);border-radius:50%;height:18px;left:4px;position:absolute;top:calc(50% - 9px);transition:transform .3s ease;width:18px}.searchcraft-toggle-button-active .searchcraft-toggle-button-background{background:var(--sc-surface-brand-primary);box-shadow:0px 0px 0px 1px rgba(0,0,0,.05)}.searchcraft-toggle-button-active .searchcraft-toggle-button-handle{transform:translateX(16px)}.searchcraft-pagination{display:inline-grid;gap:16px;grid-template-columns:repeat(3, auto);grid-template-rows:1fr}.searchcraft-pagination-list{border:1px solid var(--sc-border-neutral);border-radius:var(--sc-border-radius);display:flex;list-style-type:none;margin:0;overflow:hidden;padding:0;width:auto}.searchcraft-pagination-list li{border-right:1px solid var(--sc-border-neutral);height:100%;min-height:44px;width:44px}.searchcraft-pagination-list li:last-child{border-right:none}.searchcraft-pagination-item{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);align-items:center;background-color:var(--sc-surface-neutral-primary);border:none;display:flex;height:100%;justify-content:center;width:100%}.searchcraft-pagination-item-active{background-color:var(--sc-surface-brand-secondary);font-weight:var(--sc-font-bold)}.searchcraft-pagination-control{border:1px solid var(--sc-border-neutral);border-radius:var(--sc-border-radius)}.searchcraft-pagination-range{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);align-items:center;display:flex}.searchcraft-select{display:flex;flex-direction:column;gap:4px}.searchcraft-select-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);font-weight:var(--sc-font-bold)}.searchcraft-select-input-wrapper{position:relative}.searchcraft-select-input{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);appearance:none;background-color:var(--sc-surface-neutral-secondary);border:2px solid rgba(0,0,0,0);border-radius:var(--sc-border-radius);cursor:pointer;height:44px;padding:0 44px 0 16px;width:100%}.searchcraft-select-input:hover{background-color:var(--sc-surface-neutral-secondary-hover)}.searchcraft-select-input:active{background-color:var(--sc-surface-neutral-secondary-active)}.searchcraft-select-input:focus{border-color:var(--sc-border-brand);outline:none}.searchcraft-select-input-icon{fill:none;pointer-events:none;position:absolute;right:12px;top:50%;transform:translateY(-50%)}.searchcraft-select-caption{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal)}.searchcraft-search-results-per-page{display:flex}.searchcraft-search-results-per-page-select{align-items:center;display:flex;gap:12px}.searchcraft-search-results-per-page-select-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-search-results-per-page-select-input{min-width:120px}.searchcraft-summary-box{padding:20px;border-radius:var(--sc-border-radius);background-color:var(--sc-surface-neutral-secondary);position:relative;min-height:200px;color:var(--sc-content-neutral-primary);font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-summary-box h1,.searchcraft-summary-box h2,.searchcraft-summary-box h3,.searchcraft-summary-box h4,.searchcraft-summary-box h5{padding-top:10px;padding-bottom:10px}.searchcraft-summary-box p{padding-bottom:10px}.searchcraft-summary-box img{max-width:200px}.searchcraft-summary-box ol,.searchcraft-summary-box ul{padding-left:1em;padding-bottom:10px}.searchcraft-summary-box a{color:var(--sc-content-brand)}.searchcraft-loading{display:flex;flex-direction:column;align-items:center;gap:12px;position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}.searchcraft-loading-dots{display:flex;gap:8px;align-items:center;height:40px}.searchcraft-loading-dots>div{width:10px;height:10px;border-radius:50%;background-color:var(--sc-surface-brand-primary);animation:searchcraft-jump .6s ease-in-out infinite}.searchcraft-loading-dots .searchcraft-loading-dot-2{animation-delay:.15s}.searchcraft-loading-dots .searchcraft-loading-dot-3{animation-delay:.3s}.searchcraft-loading-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);letter-spacing:2px;color:#828282;margin:0}@keyframes searchcraft-jump{0%{transform:translateY(0);animation-timing-function:cubic-bezier(0.33, 1, 0.68, 1)}50%{transform:translateY(-20px);animation-timing-function:cubic-bezier(0.32, 0, 0.67, 0)}100%{transform:translateY(0)}}/*# sourceMappingURL=hologram.css.map */
10457
+ var styles = `[class*=searchcraft-],[class*=searchcraft-] *,[class*=searchcraft-]::before,[class*=searchcraft-]::after,[class*=searchcraft-] *,::before,[class*=searchcraft-] *,::after{box-sizing:border-box;padding:0;margin:0}:root{--sc-text-base-size: 1em;--sc-text-scale-ratio: 1.1;--sc-font-family: sans-serif;--sc-font-bold: 700;--sc-font-normal: 400;--sc-heading-1-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-2-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-3-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-4-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-5-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-6-font-size: calc( var(--sc-text-base-size) / ( var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) ) );--sc-body-font-size: calc(var(--sc-text-base-size));--sc-body-small-font-size: calc( var(--sc-text-base-size) / ( var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) ) )}:root{--sc-border-radius: 8px;--sc-border-radius-sm: calc(var(--sc-border-radius) / 2);--sc-border-radius-lg: calc(var(--sc-border-radius) * 2);--sc-border-radius-xl: calc(var(--sc-border-radius) * 3);--sc-border-radius-2xl: calc(var(--sc-border-radius) * 4);--sc-border-radius-full: 9999px}:root{--sc-breakpoint-sm: 576px;--sc-breakpoint-md: 768px;--sc-breakpoint-lg: 992px}:root{--sc-surface-neutral-primary: var(--sc-color-background, #ffffff);--sc-color-background-hover-computed: hsl( from var(--sc-color-background) h s clamp(10, calc(l + 5), 95) );--sc-surface-neutral-primary-hover: var( --sc-color-background-hover, var(--sc-color-background-hover-computed, #fafafa) );--sc-color-background-active-computed: hsl( from var(--sc-color-background) h s clamp(5, calc(l - 5), 90) );--sc-surface-neutral-primary-active: var( --sc-color-background-active, var(--sc-color-background-active-computed, #f7f7f7) );--sc-surface-neutral-secondary: var( --sc-color-background-secondary, var(--sc-color-background, #f3f3f3) );--sc-color-background-secondary-hover-computed: hsl( from var(--sc-color-background-secondary) h s clamp(10, calc(l + 5), 95) );--sc-surface-neutral-secondary-hover: var( --sc-color-background-hover, var(--sc-color-background-hover-computed, #e6e6e6) );--sc-color-background-secondary-active-computed: hsl( from var(--sc-color-background-secondary) h s clamp(5, calc(l - 5), 90) );--sc-surface-neutral-secondary-active: var( --sc-color-background-secondary-active, var(--sc-color-background-active-computed, #e0e0e0) );--sc-surface-neutral-light: #ffffff;--sc-content-neutral-primary: var(--sc-color-foreground, #292929);--sc-color-foreground-secondary-computed: hsl( from var(--sc-color-foreground) h s clamp(10, calc(l + 5), 90) );--sc-content-neutral-secondary: var( --sc-color-foreground-secondary, var(--sc-color-foreground-secondary-computed, #404040) );--sc-border-neutral: var(--sc-color-border, rgba(0, 0, 0, 0.1));--sc-surface-brand-primary: var(--sc-color-brand, #000000);--sc-color-brand-hover-computed: hsl( from var(--sc-color-brand) h s clamp(20, calc(l + 5), 95) );--sc-surface-brand-primary-hover: var( --sc-color-brand-hover, var(--sc-color-brand-hover-computed, #2e2e2e) );--sc-color-brand-active-computed: hsl( from var(--sc-color-brand) h s clamp(10, calc(l - 5), 85) );--sc-surface-brand-primary-active: var( --sc-color-brand-active, var(--sc-color-brand-active-computed, #292929) );--sc-surface-brand-secondary: var( --sc-color-brand-secondary, var(--sc-color-brand, #e6e6e6) );--sc-color-brand-secondary-hover-computed: hsl( from var(--sc-color-brand-secondary) h s clamp(10, calc(l + 5), 95) );--sc-surface-brand-secondary-hover: var( --sc-color-background-hover, var(--sc-color-background-hover-computed, #ebebeb) );--sc-color-brand-secondary-active-computed: hsl( from var(--sc-color-brand-secondary) h s clamp(5, calc(l - 5), 90) );--sc-surface-brand-secondary-active: var( --sc-color-brand-secondary-active, var(--sc-color-brand-active-computed, #e0e0e0) );--sc-content-brand: var( --sc-color-brand-text, var(--sc-surface-brand-primary) );--sc-content-brand-on-primary: #ffffff;--sc-border-brand: var(--sc-surface-brand-primary);--sc-surface-success-primary: var(--sc-color-success, #008000);--sc-color-success-primary-hover-computed: hsl( from var(--sc-color-success) h s 30 );--sc-surface-success-primary-hover: var( --sc-color-success-primary-hover, var(--sc-color-success-primary-hover-computed, #009900) );--sc-color-success-primary-active-computed: hsl( from var(--sc-color-success) h s 20 );--sc-surface-success-primary-active: var( --sc-color-success-primary-active, var(--sc-color-success-primary-active-computed, #006600) );--sc-color-success-secondary-computed: hsl( from var(--sc-color-success) h s 90 );--sc-surface-success-secondary: var( --sc-color-success-secondary, var(--sc-color-success-secondary-computed, #ccffcc) );--sc-color-success-secondary-hover-computed: hsl( from var(--sc-color-success-secondary) h s 95 );--sc-surface-success-secondary-hover: var( --sc-color-success-secondary-hover, var(--sc-color-success-secondary-hover-computed, #e6ffe6) );--sc-color-success-secondary-active-computed: hsl( from var(--sc-color-success-secondary) h s 85 );--sc-surface-success-secondary-active: var( --sc-color-success-secondary-active, var(--sc-color-success-secondary-active-computed, #b2ffb2) );--sc-content-success: var( --sc-color-brand-text, hsl(from var(--sc-surface-success-primary) h s 30) );--sc-content-success-on-primary: #ffffff;--sc-border-success: var(--sc-surface-success-primary);--sc-surface-caution-primary: var(--sc-color-caution, #cc6600);--sc-color-caution-primary-hover-computed: hsl( from var(--sc-color-caution) h s 30 );--sc-surface-caution-primary-hover: var( --sc-color-caution-primary-hover, var(--sc-color-caution-primary-hover-computed, #e57300) );--sc-color-caution-primary-active-computed: hsl( from var(--sc-color-caution) h s 20 );--sc-surface-caution-primary-active: var( --sc-color-caution-primary-active, var(--sc-color-caution-primary-active-computed, #b25a00) );--sc-color-caution-secondary-computed: hsl( from var(--sc-color-caution) h s 90 );--sc-surface-caution-secondary: var( --sc-color-caution-secondary, var(--sc-color-caution-secondary-computed, #ffd9b3) );--sc-color-caution-secondary-hover-computed: hsl( from var(--sc-color-caution-secondary) h s 95 );--sc-surface-caution-secondary-hover: var( --sc-color-caution-secondary-hover, var(--sc-color-caution-secondary-hover-computed, #ffe5cc) );--sc-color-caution-secondary-active-computed: hsl( from var(--sc-color-caution-secondary) h s 85 );--sc-surface-caution-secondary-active: var( --sc-color-caution-secondary-active, var(--sc-color-caution-secondary-active-computed, #ffcc99) );--sc-content-caution: var( --sc-color-caution-text, hsl(from var(--sc-surface-caution-primary) h s 30) );--sc-content-caution-on-primary: #ffffff;--sc-border-caution: var(--sc-surface-caution-primary);--sc-surface-danger-primary: var(--sc-color-danger, #cc0000);--sc-color-danger-primary-hover-computed: hsl( from var(--sc-color-danger) h s 30 );--sc-surface-danger-primary-hover: var( --sc-color-danger-primary-hover, var(--sc-color-danger-primary-hover-computed, #e50000) );--sc-color-danger-primary-active-computed: hsl( from var(--sc-color-danger) h s 20 );--sc-surface-danger-primary-active: var( --sc-color-danger-primary-active, var(--sc-color-danger-primary-active-computed, #b30000) );--sc-color-danger-secondary-computed: hsl(from var(--sc-color-danger) h s 90);--sc-surface-danger-secondary: var( --sc-color-danger-secondary, var(--sc-color-danger-secondary-computed, #ffcccc) );--sc-color-danger-secondary-hover-computed: hsl( from var(--sc-color-danger-secondary) h s 95 );--sc-surface-danger-secondary-hover: var( --sc-color-danger-secondary-hover, var(--sc-color-danger-secondary-hover-computed, #ffe7e7) );--sc-color-danger-secondary-active-computed: hsl( from var(--sc-color-danger-secondary) h s 85 );--sc-surface-danger-secondary-active: var( --sc-color-danger-secondary-active, var(--sc-color-danger-secondary-active-computed, #ffb3b3) );--sc-content-danger: var( --sc-color-caution-text, hsl(from var(--sc-surface-danger-primary) h s 30) );--sc-content-danger-on-primary: #ffffff;--sc-border-danger: var(--sc-surface-danger-primary);--sc-color-disabled: hsl(from var(--sc-color-page-primary) h s calc(l * 0.5));--sc-surface-disabled: var(--sc-color-disabled, #d9d9d9);--sc-color-disabled-text: hsl( from var(--sc-color-text-primary) h s calc(l * 0.5) );--sc-content-disabled: var(--sc-color-disabled-text, #737373);--sc-content-disabled-on-disabled: var(--sc-color-disabled-text, #737373)}@supports(hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none){:root{--sc-color-background-hover-computed: hsl( from var(--sc-color-background) h s clamp(10%, calc(l + 5%), 95%) );--sc-color-background-active-computed: hsl( from var(--sc-color-background) h s clamp(5%, calc(l - 5%), 90%) );--sc-color-foreground-secondary-computed: hsl( from var(--sc-color-foreground) h s clamp(10%, calc(l + 5%), 90%) );--sc-color-brand-hover-computed: hsl( from var(--sc-color-brand) h s clamp(20%, calc(l + 5%), 95%) );--sc-color-brand-active-computed: hsl( from var(--sc-color-brand) h s clamp(10%, calc(l - 5%), 85%) );--sc-color-success-primary-hover-computed: hsl( from var(--sc-color-success) h s 30% );--sc-color-success-primary-active-computed: hsl( from var(--sc-color-success) h s 20% );--sc-color-success-secondary-computed: hsl( from var(--sc-color-success) h s 90% );--sc-color-success-secondary-hover-computed: hsl( from var(--sc-color-success-secondary) h s 95% );--sc-color-success-secondary-active-computed: hsl( from var(--sc-color-success-secondary) h s 85% );--sc-content-success: var( --sc-color-brand-text, hsl(from var(--sc-surface-success-primary) h s 30%) );--sc-color-caution-primary-hover-computed: hsl( from var(--sc-color-caution) h s 30% );--sc-color-caution-primary-active-computed: hsl( from var(--sc-color-caution) h s 20% );--sc-color-caution-secondary-computed: hsl( from var(--sc-color-caution) h s 90% );--sc-color-caution-secondary-hover-computed: hsl( from var(--sc-color-caution-secondary) h s 95% );--sc-color-caution-secondary-active-computed: hsl( from var(--sc-color-caution-secondary) h s 85% );--sc-content-caution: var( --sc-color-caution-text, hsl(from var(--sc-surface-caution-primary) h s 30%) );--sc-color-danger-primary-hover-computed: hsl( from var(--sc-color-danger) h s 30% );--sc-color-danger-primary-active-computed: hsl( from var(--sc-color-danger) h s 20% );--sc-color-danger-secondary-computed: hsl( from var(--sc-color-danger) h s 90% );--sc-color-danger-secondary-hover-computed: hsl( from var(--sc-color-danger-secondary) h s 95% );--sc-color-danger-secondary-active-computed: hsl( from var(--sc-color-danger-secondary) h s 85% );--sc-content-danger: var( --sc-color-caution-text, hsl(from var(--sc-surface-danger-primary) h s 30%) )}}.searchcraft-ad{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased}.searchcraft-ad-no-template{display:flex;flex-direction:column;font-size:.875rem}.searchcraft-ad-no-template>p{margin:0}.searchcraft-adm-ad{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-search-result{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased}.searchcraft-search-result-no-template{display:flex;flex-direction:column;font-size:.875rem}.searchcraft-search-result-no-template>p{margin:0}.searchcraft-search-results{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-search-results-empty-state{text-align:center}.searchcraft-search-results-error-message{text-align:center}.searchcraft-button{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);background:none;border:2px solid rgba(0,0,0,0);border-radius:var(--sc-border-radius);cursor:pointer;display:flex;gap:4px;padding:12px;position:relative}.searchcraft-button.searchcraft-button-disabled{cursor:not-allowed}.searchcraft-button-primary{background-color:var(--sc-surface-brand-primary);color:var(--sc-content-brand-on-primary);font-weight:var(--sc-font-bold)}.searchcraft-button-primary:hover{background-color:var(--sc-surface-brand-primary-hover)}.searchcraft-button-primary:focus{border-color:var(--sc-border-primary)}.searchcraft-button-primary:active{background-color:var(--sc-surface-brand-primary-active)}.searchcraft-button-primary.searchcraft-button-disabled,.searchcraft-button-primary.searchcraft-button-disabled:hover,.searchcraft-button-primary.searchcraft-button-disabled:focus,.searchcraft-button-primary.searchcraft-button-disabled:active{background-color:var(--sc-surface-disabled);border-color:rgba(0,0,0,0);color:var(--sc-content-disabled)}.searchcraft-button-tertiary{background-color:var(--sc-surface-neutral-primary);color:var(--sc-content-brand);font-weight:var(--sc-font-normal)}.searchcraft-button-tertiary:hover{background-color:var(--sc-surface-brand-secondary-hover)}.searchcraft-button-tertiary:focus{background-color:var(--sc-surface-neutral-light);border-color:var(--sc-border-primary)}.searchcraft-button-tertiary:active{background-color:var(--sc-surface-brand-secondary-active)}.searchcraft-button-tertiary.searchcraft-button-disabled,.searchcraft-button-tertiary.searchcraft-button-disabled:hover,.searchcraft-button-tertiary.searchcraft-button-disabled:focus,.searchcraft-button-tertiary.searchcraft-button-disabled:active{background-color:var(--sc-surface-neutral-light);border-color:rgba(0,0,0,0);color:var(--sc-content-disabled)}.searchcraft-button-icon{fill:none}.searchcraft-error-message{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-danger);margin:0}.searchcraft-facet-list{display:flex;flex-direction:column;gap:8px;width:100%}.searchcraft-facet-list-checkbox-label{align-items:center;color:var(--sc-content-neutral-primary);display:flex;font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);gap:8px;position:relative;-webkit-font-smoothing:antialiased}.searchcraft-facet-list-checkbox-input-wrapper{position:relative}.searchcraft-facet-list-checkbox-input{align-items:center;appearance:none;background-color:var(--sc-surface-neutral-secondary);border:1px solid var(--sc-surface-disabled);border-radius:var(--sc-border-radius);cursor:pointer;display:flex;height:24px;justify-content:center;width:24px;margin:0}.searchcraft-facet-list-checkbox-input:focus{outline:2px solid var(--sc-surface-brand-primary);outline-offset:2px}.searchcraft-facet-list-checkbox-input:checked{background-color:var(--sc-surface-brand-primary);position:relative}.searchcraft-facet-list-checkbox-input:checked+.searchcraft-facet-list-checkbox-input-check-icon{display:flex}.searchcraft-facet-list-checkbox-input:checked+.searchcraft-facet-list-checkbox-input-dash-icon{display:flex}.searchcraft-facet-child-list{display:flex;flex-direction:column;gap:6px}.searchcraft-facet-child-list-checkbox-label{margin-left:24px}.searchcraft-facet-child-list-checkbox-label:first-child{margin-top:6px}.searchcraft-facet-list-checkbox-input-check-icon{display:none;height:16px;left:50%;position:absolute;margin-top:2px;top:50%;transform:translate(-50%, -50%);width:16px}.searchcraft-facet-list-checkbox-input-dash-icon{display:none;height:3px;left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);width:14px}.searchcraft-facet-list-message{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-disabled);text-align:center}.searchcraft-facet-list-wrapper{display:flex;flex-direction:column;width:100%;min-height:0}.searchcraft-facet-list-content{display:flex;flex-direction:column;gap:8px;min-height:0;flex-shrink:0}.searchcraft-facet-list-view-more{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);background:none;border:none;color:var(--sc-content-brand);cursor:pointer;padding:8px 0;text-align:left;text-decoration:underline}.searchcraft-facet-list-view-more:hover{color:var(--sc-surface-brand-primary-hover)}.searchcraft-facet-list-view-more:focus{outline:2px solid var(--sc-surface-brand-primary);outline-offset:2px}.searchcraft-filter-panel{display:flex;flex-direction:column;gap:16px}.searchcraft-filter-panel-section{display:flex;flex-direction:column;gap:8px}.searchcraft-filter-panel-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);font-weight:var(--sc-font-bold)}[data-toggle-facet-section]{cursor:pointer;display:flex;align-items:center;justify-content:space-between;width:100%;position:relative}[data-toggle-facet-section]::after{content:"›";display:inline-block;font-size:1.5em;line-height:1;margin-left:auto;flex-shrink:0;transition:transform .2s ease;transform-origin:center}[data-toggle-facet-section][data-facet-section-collapsed]::after{transform:rotate(90deg)}[data-toggle-facet-section][data-facet-section-expanded]::after{transform:rotate(-90deg)}@media(max-width: 767px){[data-toggle-filter-panel]{cursor:pointer;display:flex !important;align-items:center;justify-content:space-between;width:100%}[data-toggle-filter-panel]::after{content:"›";display:inline-block;font-size:1.5em;line-height:1;margin-left:auto;flex-shrink:0;transition:transform .2s ease;transform-origin:center}[data-toggle-filter-panel][data-filter-panel-collapsed]::after{transform:rotate(90deg)}[data-toggle-filter-panel][data-filter-panel-expanded]::after{transform:rotate(-90deg)}}@media(min-width: 768px){[data-toggle-filter-panel]{cursor:default}[data-toggle-filter-panel]::after{display:none}}:root{--sc-input-form-border-radius: var(--sc-border-radius);--sc-input-form-search-icon-size: 20px;--sc-input-form-clear-icon-size: 20px}.searchcraft-input-form-grid{display:grid;gap:4px 8px}.searchcraft-input-form-grid-button-left{grid-template-rows:repeat(3, auto);grid-template-columns:auto 1fr}.searchcraft-input-form-grid-button-left .searchcraft-input-form-button{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-left .searchcraft-input-form-label{grid-column:2/span 1;grid-row:1/span 1}.searchcraft-input-form-grid-button-left .searchcraft-input-form-error-message{grid-column:2/span 1;grid-row:3/span 1}.searchcraft-input-form-grid-button-left .searchcraft-input-form-input-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-right{grid-template-rows:repeat(3, auto);grid-template-columns:1fr auto}.searchcraft-input-form-grid-button-right .searchcraft-input-form-button{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-right .searchcraft-input-form-label{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-form-grid-button-right .searchcraft-input-form-error-message{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-form-grid-button-right .searchcraft-input-form-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-none{grid-template-rows:repeat(3, auto);grid-template-columns:auto}.searchcraft-input-form-grid-button-none .searchcraft-input-form-button{display:none}.searchcraft-input-form-grid-button-none .searchcraft-input-form-label{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-form-grid-button-none .searchcraft-input-form-error-message{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-form-grid-button-none .searchcraft-input-form-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-form-input-wrapper{display:flex;position:relative}.searchcraft-input-form-input{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);background-color:var(--sc-surface-neutral-secondary);border-radius:var(--sc-input-form-border-radius);border:none;color:var(--sc-content-neutral-primary);flex:1;outline:none;padding:12px 44px}.searchcraft-input-form-input::placeholder{color:var(--sc-content-disabled)}.searchcraft-input-form-input:focus{outline:var(--sc-border-brand) solid 2px;outline-offset:-1px}.searchcraft-input-form-input.searchcraft-placeholder-hide-on-focus:focus::placeholder{opacity:0}.searchcraft-input-form-error{color:var(--sc-content-danger);outline:var(--sc-border-danger) solid 2px}.searchcraft-input-form-error:focus{outline:var(--sc-border-danger) solid 2px}.searchcraft-input-form-input-icon{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;pointer-events:none;top:0;width:44px}.searchcraft-input-form-input-search-icon{color:var(--sc-content-neutral-secondary);fill:none;height:var(--sc-input-form-search-icon-size);pointer-events:none;width:var(--sc-input-form-search-icon-size)}.searchcraft-input-form-clear-button{all:unset;align-items:center;bottom:0;border:none;cursor:pointer;display:flex;justify-content:center;outline:none;position:absolute;right:0;top:0;width:44px}.searchcraft-input-form-clear-icon{color:var(--sc-content-brand);fill:none;height:var(--sc-input-form-clear-icon-size);width:var(--sc-input-form-clear-icon-size)}.searchcraft-input-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-neutral-primary);font-weight:var(--sc-font-bold);margin-top:4px;margin-bottom:4px}:root{--sc-popover-button-border-radius: var(--sc-border-radius)}@media(min-width: 576px){:root{--sc-popover-button-border-radius: var(--sc-border-radius-lg)}}.searchcraft-popover-button{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);cursor:pointer}.searchcraft-popover-button-skeuomorphic{appearance:none;background:none;border:none;color:var(--sc-content-neutral-primary);display:block;width:100%}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-wrapper{border:1px solid var(--sc-border-neutral);border-radius:var(--sc-popover-button-border-radius);box-shadow:0 1px 1px rgb(from var(--sc-content-neutral-secondary) r g b/10%) inset,0 2px 4px rgb(from var(--sc-content-neutral-secondary) r g b/5%) inset;display:flex;gap:24px;height:40px;justify-content:space-between;line-height:1;padding:4px 5px 4px 10px;background:var(--sc-surface-neutral-primary)}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-wrapper{box-shadow:0 1px 1px rgb(from var(--sc-content-neutral-secondary) r g b/10%) inset,0 2px 2px rgb(from var(--sc-content-neutral-secondary) r g b/5%) inset,0 4px 4px rgb(from var(--sc-content-neutral-secondary) r g b/5%) inset;height:63px;padding:8px 10px 8px 16px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input{align-items:center;display:flex;gap:4px}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input{gap:8px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps{color:var(--sc-content-neutral-secondary);display:flex;gap:4px;font-size:20px;font-weight:500}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps{gap:8px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap{border-radius:calc(var(--sc-popover-button-border-radius) - 3px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 3px);background-color:var(--sc-surface-neutral-primary);box-shadow:0 3px hsl(from var(--sc-surface-neutral-secondary) h s calc(l - 5)),0 1px 2px rgb(from var(--sc-content-neutral-secondary) r g b/10%),0 6px 4px rgb(from var(--sc-content-neutral-secondary) r g b/5%);height:calc(100% - 2px);position:relative}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap{border-radius:calc(var(--sc-popover-button-border-radius) - 8px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 8px);box-shadow:0 4px hsl(from var(--sc-surface-neutral-secondary) h s calc(l - 5)),0 1px 2px rgb(from var(--sc-content-neutral-secondary) r g b/15%),0 6px 1px rgb(from var(--sc-content-neutral-secondary) r g b/20%),0 7px 2px rgb(from var(--sc-content-neutral-secondary) r g b/15%),0 9px 4px rgb(from var(--sc-content-neutral-secondary) r g b/10%),0 13px 8px rgb(from var(--sc-content-neutral-secondary) r g b/5%);height:calc(100% - 5px)}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::before,.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::after{content:"";display:block}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::before{border-radius:calc(var(--sc-popover-button-border-radius) - 4px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 4px);background:linear-gradient(340deg, rgb(from var(--sc-surface-neutral-secondary) r g b/2%) 0%, var(--sc-surface-neutral-secondary) 100%);inset:2px;position:absolute}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::before{border-radius:calc(var(--sc-popover-button-border-radius) - 12px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 12px);inset:4px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::after{aspect-ratio:1/1;height:100%}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap>span{display:flex;line-height:1;left:50%;margin-top:2%;position:absolute;top:50%;transform:translate(-50%, -50%)}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input-search-icon{height:60%;width:auto}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input-search-icon{height:50%}}:root{--sc-popover-button-magnifying-glass-icon-size: 20px;--sc-popover-button-magnifying-glass-icon-color: var(--sc-content-neutral-secondary);--sc-popover-button-magnifying-glass-icon-color-hover: var(--sc-content-brand);--sc-popover-button-magnifying-glass-padding: 12px}@media(min-width: 576px){:root{--sc-popover-button-magnifying-glass-padding: 16px}}.searchcraft-popover-button-magnifying-glass{appearance:none;background:none;border:none;color:var(--sc-content-neutral-primary);cursor:pointer;display:flex;align-items:center;justify-content:center}.searchcraft-popover-button-magnifying-glass .searchcraft-popover-button-input{display:flex;align-items:center;justify-content:center;padding:var(--sc-popover-button-magnifying-glass-padding)}.searchcraft-popover-button-magnifying-glass .searchcraft-popover-button-input-search-icon{color:var(--sc-popover-button-magnifying-glass-icon-color);display:block;fill:none;stroke:currentcolor;stroke-width:1.5;width:var(--sc-popover-button-magnifying-glass-icon-size);height:var(--sc-popover-button-magnifying-glass-icon-size);transition:color .2s ease}.searchcraft-popover-button-magnifying-glass:hover .searchcraft-popover-button-input-search-icon{color:var(--sc-popover-button-magnifying-glass-icon-color-hover)}:root{--sc-popover-list-view-height: 600px;--sc-popover-modal-max-width: 800px}.searchcraft-popover-form{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);display:flex;flex:1;flex-direction:column}.searchcraft-popover-form searchcraft-input-form,.searchcraft-popover-form searchcraft-popover-footer{width:100%}.searchcraft-popover-form.searchcraft-popover-form-active .searchcraft-popover-form-input{padding-bottom:1px}.searchcraft-popover-form searchcraft-popover-list-view{flex-shrink:1;height:100%;min-height:0;overflow:auto;padding:0 24px}.searchcraft-popover-form searchcraft-results-summary,.searchcraft-popover-form searchcraft-summary-box{margin-bottom:16px}.searchcraft-popover-form-input{display:flex;flex-direction:row;gap:12px}.searchcraft-popover-form-input .searchcraft-input-form-input{background-color:var(--sc-surface-neutral-primary);border:1px solid var(--sc-border-neutral);border-radius:var(--sc-border-radius-lg);width:0}.searchcraft-popover-form-cancel-button{background:none;border:none;cursor:pointer;font-size:14px}.searchcraft-popover-form-modal-input,.searchcraft-popover-form-fullscreen-input{padding:24px}.searchcraft-popover-form-modal-popover-list-view,.searchcraft-popover-form-fullscreen-popover-list-view{flex-grow:1;flex-shrink:1;min-height:0;overflow:auto;padding:0 24px}.searchcraft-popover-form-modal-popover-list-view searchcraft-results-summary,.searchcraft-popover-form-modal-popover-list-view searchcraft-summary-box,.searchcraft-popover-form-fullscreen-popover-list-view searchcraft-results-summary,.searchcraft-popover-form-fullscreen-popover-list-view searchcraft-summary-box{padding:20px 0;margin-bottom:0;border-bottom:1px solid var(--sc-border-neutral-subtle)}.searchcraft-popover-form-inline{background-color:var(--sc-surface-neutral-primary);border:1px solid rgba(0,0,0,0);border-radius:var(--sc-border-radius-xl);padding:12px;position:relative}.searchcraft-popover-form-inline.searchcraft-popover-form-active{border:1px solid var(--sc-border-neutral);border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;padding-bottom:1px}.searchcraft-popover-form-inline searchcraft-popover-list-view{padding:0 12px}.searchcraft-popover-form-inline .searchcraft-input-form-input,.searchcraft-popover-form-inline .searchcraft-popover-list-item-link,.searchcraft-popover-form-inline .searchcraft-adm-ad-link{border-radius:calc(--sc-border-radius-xl - 12px);border-radius:calc(var(--sc-border-radius-xl) - 12px)}.searchcraft-popover-form-inline-wrapper{background-color:var(--sc-surface-neutral-primary);border:1px solid var(--sc-border-neutral);border-top:none;border-bottom-left-radius:var(--sc-border-radius-xl);border-bottom-right-radius:var(--sc-border-radius-xl);display:flex;flex-direction:column;left:-1px;max-height:var(--sc-popover-list-view-height);overflow:hidden;position:absolute;right:-1px;top:100%}.searchcraft-popover-form-inline-wrapper searchcraft-results-summary,.searchcraft-popover-form-inline-wrapper searchcraft-summary-box{padding:16px 12px;margin-bottom:0;border-bottom:1px solid var(--sc-border-neutral-subtle)}.searchcraft-popover-form-modal{align-items:center;display:flex;inset:0;position:fixed;z-index:1000}.searchcraft-popover-form-modal .searchcraft-input-form-input,.searchcraft-popover-form-modal .searchcraft-popover-list-item-link,.searchcraft-popover-form-modal .searchcraft-adm-ad-link{border-radius:calc(--sc-border-radius-2xl - 20px);border-radius:calc(var(--sc-border-radius-2xl) - 20px)}.searchcraft-popover-form-modal-backdrop{background-color:rgb(from var(--sc-content-neutral-primary) r g b/50%);display:none;inset:0;position:fixed}@media(min-width: 576px){.searchcraft-popover-form-modal-backdrop{display:block}}.searchcraft-popover-form-modal-wrapper{background-color:var(--sc-surface-neutral-primary);box-shadow:1px 2px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 2px 4px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 4px 8px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 8px 16px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 16px 32px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 32px 64px rgb(from var(--sc-content-neutral-primary) r g b/7%);display:flex;flex-direction:column;inset:0;max-width:var(--sc-popover-modal-max-width);overflow:hidden;position:absolute;width:100%;z-index:1001}@media(min-width: 576px){.searchcraft-popover-form-modal-wrapper{border-radius:var(--sc-border-radius-2xl);inset:0;margin-top:100px;max-height:var(--sc-popover-list-view-height);max-width:var(--sc-popover-modal-max-width);position:relative}}.searchcraft-popover-form-modal-cancel-button{border-radius:calc(--sc-border-radius-2xl - 20px);border-radius:calc(var(--sc-border-radius-2xl) - 20px);padding:8px}@media(min-width: 576px){.searchcraft-popover-form-modal-cancel-button{padding:8px 12px}}.searchcraft-popover-form-fullscreen{background-color:var(--sc-surface-neutral-primary);display:flex;flex-direction:column;justify-content:space-between;inset:0;position:fixed;z-index:1000}.searchcraft-popover-form-fullscreen .searchcraft-popover-list-item-link,.searchcraft-popover-form-fullscreen .searchcraft-adm-ad-link{border-radius:var(--sc-border-radius-lg)}.searchcraft-popover-form-fullscreen-cancel-button{border-radius:var(--sc-border-radius-lg);padding:8px}@media(min-width: 576px){.searchcraft-popover-form-fullscreen-cancel-button{padding:8px 12px}}.searchcraft-popover-footer{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;align-items:center;background-color:var(--sc-surface-neutral-secondary);display:flex;gap:.5rem;justify-content:space-between;line-height:1;padding:1.25rem 1.5rem}@media(min-width: 576px){.searchcraft-popover-footer{padding:1.25rem 2rem}}.searchcraft-popover-footer-results-info{margin:0}.searchcraft-popover-footer-results-found{display:none}@media(min-width: 576px){.searchcraft-popover-footer-results-found{display:inline}}.searchcraft-popover-footer-link{align-items:center;color:var(--sc-content-neutral-primary);display:flex;font-weight:var(--sc-font-bold);text-decoration:none;white-space:nowrap}.searchcraft-popover-footer-link-prefix{display:none;font-weight:var(--sc-font-normal)}@media(min-width: 576px){.searchcraft-popover-footer-link-prefix{display:inline}}.searchcraft-popover-footer-results{align-items:center;display:flex;gap:.5rem}.searchcraft-popover-footer-view-all{align-items:center;border-radius:999px;border:.0625rem solid var(--sc-border-neutral-strong);color:var(--sc-content-neutral-primary);display:inline-flex;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-bold);gap:.375rem;line-height:1;padding:.375rem .625rem;text-decoration:none}.searchcraft-popover-footer-view-all-shortcut{display:none}@media(min-width: 576px){.searchcraft-popover-footer-view-all-shortcut{display:inline-flex;gap:.125rem}.searchcraft-popover-footer-view-all-shortcut kbd{align-items:center;border-radius:.25rem;border:1px solid var(--sc-content-neutral-primary);display:flex;font-family:Helvetica,Arial,sans-serif;font-size:.75rem;font-style:normal;font-weight:400;height:1.5rem;justify-content:center;line-height:1rem;width:1.5rem}}:root{--sc-popover-list-item-image-fit: contain}.searchcraft-popover-list-item{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;border-bottom:1px solid var(--sc-border-neutral);padding:12px 0}searchcraft-popover-list-item:last-child .searchcraft-popover-list-item{border-bottom:none}.searchcraft-popover-list-item-link{align-items:flex-start;color:var(--sc-content-neutral-primary);display:flex;gap:24px;padding:12px;text-decoration:none}.searchcraft-popover-list-item-link:focus,.searchcraft-popover-list-item-link:active{background-color:var(--sc-surface-neutral-primary-active)}.searchcraft-popover-list-item-link:hover{background-color:var(--sc-surface-neutral-primary-hover)}.searchcraft-popover-list-item-image-wrapper{align-items:center;aspect-ratio:16/9;display:flex;flex-shrink:0;justify-content:center;width:160px}.searchcraft-popover-list-item-image{height:100%;object-fit:var(--sc-popover-list-item-image-fit);width:100%}.searchcraft-popover-list-item-content{display:flex;flex-direction:column;flex-grow:1;gap:4px;justify-content:center}.searchcraft-popover-list-item-content-title,.searchcraft-popover-list-item-content-subtitle{display:-webkit-box;line-clamp:2;margin:0;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical}.searchcraft-popover-list-item-content-title{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-heading-5-font-size);font-weight:var(--sc-font-bold)}.searchcraft-popover-list-item-content-subtitle{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-popover-list-view{display:flex;flex-direction:column}.searchcraft-results-info{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-primary);margin:0}.searchcraft-slider{align-items:center;display:flex;flex-direction:column;gap:10px;width:100%;margin-top:4px}.searchcraft-slider-range{align-items:center;background-color:var(--sc-surface-disabled);border-radius:999px;display:flex;position:relative;height:4px;width:100%}.searchcraft-slider-range::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range .searchcraft-slider-active-range{background-color:var(--sc-surface-brand-primary);border-radius:2px;height:4px;position:absolute;top:50%;transform:translateY(-50%);z-index:0}.searchcraft-slider-range .searchcraft-slider-active-range::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range .searchcraft-slider-active-range::-moz-range-track{pointer-events:none}.searchcraft-slider-range .searchcraft-slider-input{appearance:none;background:rgba(0,0,0,0);border-radius:2px;height:4px;margin:0;outline:none;pointer-events:none;position:absolute;width:100%;-webkit-appearance:none}.searchcraft-slider-range .searchcraft-slider-input::-webkit-slider-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:1px solid var(--sc-border-neutral);cursor:pointer;height:18px;pointer-events:all;width:18px;-webkit-appearance:none}.searchcraft-slider-range .searchcraft-slider-input::-moz-range-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:1px solid var(--sc-border-neutral);cursor:pointer;height:18px;pointer-events:all;width:18px}.searchcraft-slider-range .searchcraft-slider-input:focus::-webkit-slider-thumb{outline:2px solid var(--sc-surface-brand-primary)}.searchcraft-slider-range .searchcraft-slider-input:focus::-moz-range-thumb{outline:2px solid var(--sc-surface-brand-primary)}.searchcraft-slider-label{color:var(--sc-content-primary);display:flex;font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);justify-content:space-between;margin-top:4px;width:100%}.searchcraft-slider-start-label,.searchcraft-slider-end-label{min-width:30px;text-align:center}.searchcraft-toggle-button{align-items:flex-start;display:flex;gap:10px;justify-content:space-between}.searchcraft-toggle-button-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-neutral-primary);margin:0}.searchcraft-toggle-button-sub-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-neutral-secondary);margin:0}.searchcraft-toggle-button-background{background:var(--sc-surface-disabled);border-radius:var(--sc-border-radius-full);border:none;cursor:pointer;flex-shrink:0;height:26px;position:relative;transition:background-color .2s;width:44px}.searchcraft-toggle-button-handle{background:var(--sc-surface-neutral-light);border-radius:50%;height:18px;left:4px;position:absolute;top:calc(50% - 9px);transition:transform .3s ease;width:18px}.searchcraft-toggle-button-active .searchcraft-toggle-button-background{background:var(--sc-surface-brand-primary);box-shadow:0px 0px 0px 1px rgba(0,0,0,.05)}.searchcraft-toggle-button-active .searchcraft-toggle-button-handle{transform:translateX(16px)}.searchcraft-pagination{display:inline-grid;gap:16px;grid-template-columns:repeat(3, auto);grid-template-rows:1fr}.searchcraft-pagination-list{border:1px solid var(--sc-border-neutral);border-radius:var(--sc-border-radius);display:flex;list-style-type:none;margin:0;overflow:hidden;padding:0;width:auto}.searchcraft-pagination-list li{border-right:1px solid var(--sc-border-neutral);height:100%;min-height:44px;width:44px}.searchcraft-pagination-list li:last-child{border-right:none}.searchcraft-pagination-item{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);align-items:center;background-color:var(--sc-surface-neutral-primary);border:none;display:flex;height:100%;justify-content:center;width:100%}.searchcraft-pagination-item-active{background-color:var(--sc-surface-brand-secondary);font-weight:var(--sc-font-bold)}.searchcraft-pagination-control{border:1px solid var(--sc-border-neutral);border-radius:var(--sc-border-radius)}.searchcraft-pagination-range{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);align-items:center;display:flex}.searchcraft-select{display:flex;flex-direction:column;gap:4px}.searchcraft-select-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);font-weight:var(--sc-font-bold)}.searchcraft-select-input-wrapper{position:relative}.searchcraft-select-input{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);appearance:none;background-color:var(--sc-surface-neutral-secondary);border:2px solid rgba(0,0,0,0);border-radius:var(--sc-border-radius);cursor:pointer;height:44px;padding:0 44px 0 16px;width:100%}.searchcraft-select-input:hover{background-color:var(--sc-surface-neutral-secondary-hover)}.searchcraft-select-input:active{background-color:var(--sc-surface-neutral-secondary-active)}.searchcraft-select-input:focus{border-color:var(--sc-border-brand);outline:none}.searchcraft-select-input-icon{fill:none;pointer-events:none;position:absolute;right:12px;top:50%;transform:translateY(-50%)}.searchcraft-select-caption{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal)}.searchcraft-search-results-per-page{display:flex}.searchcraft-search-results-per-page-select{align-items:center;display:flex;gap:12px}.searchcraft-search-results-per-page-select-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-search-results-per-page-select-input{min-width:120px}.searchcraft-results-summary{padding:20px;border-radius:var(--sc-border-radius);background-color:var(--sc-surface-neutral-secondary);position:relative;min-height:200px;color:var(--sc-content-neutral-primary);font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-results-summary h1,.searchcraft-results-summary h2,.searchcraft-results-summary h3,.searchcraft-results-summary h4,.searchcraft-results-summary h5{padding-top:10px;padding-bottom:10px}.searchcraft-results-summary p{padding-bottom:10px}.searchcraft-results-summary img{max-width:200px}.searchcraft-results-summary ol,.searchcraft-results-summary ul{padding-left:1em;padding-bottom:10px}.searchcraft-results-summary a{color:var(--sc-content-brand)}.searchcraft-summary-box{padding:20px;border-radius:var(--sc-border-radius);background-color:var(--sc-surface-neutral-secondary);position:relative;min-height:200px;color:var(--sc-content-neutral-primary);font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-summary-box h1,.searchcraft-summary-box h2,.searchcraft-summary-box h3,.searchcraft-summary-box h4,.searchcraft-summary-box h5{padding-top:10px;padding-bottom:10px}.searchcraft-summary-box p{padding-bottom:10px}.searchcraft-summary-box img{max-width:200px}.searchcraft-summary-box ol,.searchcraft-summary-box ul{padding-left:1em;padding-bottom:10px}.searchcraft-summary-box a{color:var(--sc-content-brand)}.searchcraft-loading{display:flex;flex-direction:column;align-items:center;gap:12px;position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}.searchcraft-loading-dots{display:flex;gap:8px;align-items:center;height:40px}.searchcraft-loading-dots>div{width:10px;height:10px;border-radius:50%;background-color:var(--sc-surface-brand-primary);animation:searchcraft-jump .6s ease-in-out infinite}.searchcraft-loading-dots .searchcraft-loading-dot-2{animation-delay:.15s}.searchcraft-loading-dots .searchcraft-loading-dot-3{animation-delay:.3s}.searchcraft-loading-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);letter-spacing:2px;color:#828282;margin:0}@keyframes searchcraft-jump{0%{transform:translateY(0);animation-timing-function:cubic-bezier(0.33, 1, 0.68, 1)}50%{transform:translateY(-20px);animation-timing-function:cubic-bezier(0.32, 0, 0.67, 0)}100%{transform:translateY(0)}}/*# sourceMappingURL=hologram.css.map */
10357
10458
  `;
10358
10459
 
10359
10460
  /**
@@ -10389,7 +10490,7 @@ class SearchcraftTheme {
10389
10490
  registerInstance(this, hostRef);
10390
10491
  }
10391
10492
  render() {
10392
- return hAsync("style", { key: 'e4b7c8e8d20a108df303156af5f9fcb4a19bbbe6' }, styles);
10493
+ return hAsync("style", { key: 'ef26626cdfa4fa98d516802d71443c49a9c6ecf9' }, styles);
10393
10494
  }
10394
10495
  static get cmpMeta() { return {
10395
10496
  "$flags$": 256,
@@ -10453,9 +10554,9 @@ class SearchcraftToggleButton {
10453
10554
  this.cleanupCore?.();
10454
10555
  }
10455
10556
  render() {
10456
- return (hAsync("div", { key: '27d05b370fcb2a4ca440abc3ef777c264f6139a6', class: classNames('searchcraft-toggle-button', {
10557
+ return (hAsync("div", { key: 'ab1d5ee21c7aaa28af1c405edc986556858366e8', class: classNames('searchcraft-toggle-button', {
10457
10558
  'searchcraft-toggle-button-active': this.isActive,
10458
- }) }, hAsync("div", { key: 'e3079a80acf706576a36efb04c52c84bda90be8a' }, hAsync("p", { key: 'cbd732b19bd408e9b3dc3602b16a47060603e4f6', class: 'searchcraft-toggle-button-label' }, this.label), this.subLabel && (hAsync("p", { key: '7b68d0c50b9498e9f64968987b0d433b6bdf6327', class: 'searchcraft-toggle-button-sub-label' }, this.subLabel))), hAsync("button", { key: '05366d9f252746d4860909de37b01e908f85f2fb', class: 'searchcraft-toggle-button-background', onClick: this.handleToggle, type: 'button' }, hAsync("div", { key: '26d3ab13df50e18e6f7ec76da55089feed6d53b9', class: 'searchcraft-toggle-button-handle' }))));
10559
+ }) }, hAsync("div", { key: '44f86a16d796d448bdb2fb3af72d4d8e1484364b' }, hAsync("p", { key: '9fedb38795d6379cae56dc005ab8e4a944b4261b', class: 'searchcraft-toggle-button-label' }, this.label), this.subLabel && (hAsync("p", { key: '44f3d17175184032275fec89a4cfe7f8266b7014', class: 'searchcraft-toggle-button-sub-label' }, this.subLabel))), hAsync("button", { key: '15fc18906ff2fb21fe646a4e3a8a2ace4a37cae2', class: 'searchcraft-toggle-button-background', onClick: this.handleToggle, type: 'button' }, hAsync("div", { key: '716d29c65a199f63f5fd294dc3e3ad2ea4d53aa3', class: 'searchcraft-toggle-button-handle' }))));
10459
10560
  }
10460
10561
  static get cmpMeta() { return {
10461
10562
  "$flags$": 768,
@@ -10489,6 +10590,7 @@ registerComponents([
10489
10590
  SearchcraftPopoverListItemAd,
10490
10591
  SearchcraftPopoverListView,
10491
10592
  SearchcraftResultsInfo,
10593
+ SearchcraftResultsSummary,
10492
10594
  SearchcraftSearchResult,
10493
10595
  SearchcraftSearchResults,
10494
10596
  SearchcraftSearchResultsPerPage,