[
  {
    "path": ".gitattributes",
    "content": "# A set of files you probably don't want in your WordPress.org distribution\n.babelrc export-ignore\n.circleci/config.yml export-ignore\n.deployignore export-ignore\n.distignore export-ignore\n.DS_Store export-ignore\n.editorconfig export-ignore\n.eslintignore export-ignore\n.eslintrc export-ignore\n.git export-ignore\n.gitattributes export-ignore\n.github export-ignore\n.gitignore export-ignore\n.gitlab-ci.yml export-ignore\n.phpcs.xml export-ignore\n.phpcs.xml.dist export-ignore\n.travis.yml export-ignore\n*.sql export-ignore\n*.tar.gz export-ignore\n*.zip export-ignore\nbehat.yml export-ignore\nbin export-ignore\nbitbucket-pipelines.yml export-ignore\ncomposer.json export-ignore\ncomposer.lock export-ignore\ndependencies.yml export-ignore\nGruntfile.js export-ignore\nmultisite.xml export-ignore\nmultisite.xml.dist export-ignore\nnode_modules export-ignore\npackage-lock.json export-ignore\npackage.json export-ignore\nphpcs.xml export-ignore\nphpcs.xml.dist export-ignore\nphpunit.xml export-ignore\nphpunit.xml.dist export-ignore\nREADME.md export-ignore\ntests export-ignore\nThumbs.db export-ignore\nwebpack.config.js export-ignore\nwp-cli.local.yml export-ignore\nyarn.lock export-ignore\n/assets export-ignore\n/vendor export-ignore\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Describe the bug**\nA clear and concise description of what the bug is.\n\n**To Reproduce**\nSteps to reproduce the behavior:\n1. Go to '...'\n2. Click on '....'\n3. Scroll down to '....'\n4. See error\n\n**Expected behavior**\nA clear and concise description of what you expected to happen.\n\n**Screenshots**\nIf applicable, add screenshots to help explain your problem.\n\n**Desktop (please complete the following information):**\n - OS: [e.g. iOS]\n - Browser [e.g. chrome, safari]\n - Version [e.g. 22]\n\n**Smartphone (please complete the following information):**\n - Device: [e.g. iPhone6]\n - OS: [e.g. iOS8.1]\n - Browser [e.g. stock browser, safari]\n - Version [e.g. 22]\n\n**Additional context**\nAdd any other context about the problem here.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "content": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Is your feature request related to a problem? Please describe.**\nA clear and concise description of what the problem is. Ex. I'm always frustrated when [...]\n\n**Describe the solution you'd like**\nA clear and concise description of what you want to happen.\n\n**Describe alternatives you've considered**\nA clear and concise description of any alternative solutions or features you've considered.\n\n**Additional context**\nAdd any other context or screenshots about the feature request here.\n"
  },
  {
    "path": ".github/LICENSE.md",
    "content": "GNU GENERAL PUBLIC LICENSE\n                       Version 2, June 1991\n\n Copyright (C) 1989, 1991 Free Software Foundation, Inc.,\n 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The licenses for most software are designed to take away your\nfreedom to share and change it.  By contrast, the GNU General Public\nLicense is intended to guarantee your freedom to share and change free\nsoftware--to make sure the software is free for all its users.  This\nGeneral Public License applies to most of the Free Software\nFoundation's software and to any other program whose authors commit to\nusing it.  (Some other Free Software Foundation software is covered by\nthe GNU Lesser General Public License instead.)  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthis service if you wish), that you receive source code or can get it\nif you want it, that you can change the software or use pieces of it\nin new free programs; and that you know you can do these things.\n\n  To protect your rights, we need to make restrictions that forbid\nanyone to deny you these rights or to ask you to surrender the rights.\nThese restrictions translate to certain responsibilities for you if you\ndistribute copies of the software, or if you modify it.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must give the recipients all the rights that\nyou have.  You must make sure that they, too, receive or can get the\nsource code.  And you must show them these terms so they know their\nrights.\n\n  We protect your rights with two steps: (1) copyright the software, and\n(2) offer you this license which gives you legal permission to copy,\ndistribute and/or modify the software.\n\n  Also, for each author's protection and ours, we want to make certain\nthat everyone understands that there is no warranty for this free\nsoftware.  If the software is modified by someone else and passed on, we\nwant its recipients to know that what they have is not the original, so\nthat any problems introduced by others will not reflect on the original\nauthors' reputations.\n\n  Finally, any free program is threatened constantly by software\npatents.  We wish to avoid the danger that redistributors of a free\nprogram will individually obtain patent licenses, in effect making the\nprogram proprietary.  To prevent this, we have made it clear that any\npatent must be licensed for everyone's free use or not licensed at all.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                    GNU GENERAL PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. This License applies to any program or other work which contains\na notice placed by the copyright holder saying it may be distributed\nunder the terms of this General Public License.  The \"Program\", below,\nrefers to any such program or work, and a \"work based on the Program\"\nmeans either the Program or any derivative work under copyright law:\nthat is to say, a work containing the Program or a portion of it,\neither verbatim or with modifications and/or translated into another\nlanguage.  (Hereinafter, translation is included without limitation in\nthe term \"modification\".)  Each licensee is addressed as \"you\".\n\nActivities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope.  The act of\nrunning the Program is not restricted, and the output from the Program\nis covered only if its contents constitute a work based on the\nProgram (independent of having been made by running the Program).\nWhether that is true depends on what the Program does.\n\n  1. You may copy and distribute verbatim copies of the Program's\nsource code as you receive it, in any medium, provided that you\nconspicuously and appropriately publish on each copy an appropriate\ncopyright notice and disclaimer of warranty; keep intact all the\nnotices that refer to this License and to the absence of any warranty;\nand give any other recipients of the Program a copy of this License\nalong with the Program.\n\nYou may charge a fee for the physical act of transferring a copy, and\nyou may at your option offer warranty protection in exchange for a fee.\n\n  2. You may modify your copy or copies of the Program or any portion\nof it, thus forming a work based on the Program, and copy and\ndistribute such modifications or work under the terms of Section 1\nabove, provided that you also meet all of these conditions:\n\n    a) You must cause the modified files to carry prominent notices\n    stating that you changed the files and the date of any change.\n\n    b) You must cause any work that you distribute or publish, that in\n    whole or in part contains or is derived from the Program or any\n    part thereof, to be licensed as a whole at no charge to all third\n    parties under the terms of this License.\n\n    c) If the modified program normally reads commands interactively\n    when run, you must cause it, when started running for such\n    interactive use in the most ordinary way, to print or display an\n    announcement including an appropriate copyright notice and a\n    notice that there is no warranty (or else, saying that you provide\n    a warranty) and that users may redistribute the program under\n    these conditions, and telling the user how to view a copy of this\n    License.  (Exception: if the Program itself is interactive but\n    does not normally print such an announcement, your work based on\n    the Program is not required to print an announcement.)\n\nThese requirements apply to the modified work as a whole.  If\nidentifiable sections of that work are not derived from the Program,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works.  But when you\ndistribute the same sections as part of a whole which is a work based\non the Program, the distribution of the whole must be on the terms of\nthis License, whose permissions for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote it.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Program.\n\nIn addition, mere aggregation of another work not based on the Program\nwith the Program (or with a work based on the Program) on a volume of\na storage or distribution medium does not bring the other work under\nthe scope of this License.\n\n  3. You may copy and distribute the Program (or a work based on it,\nunder Section 2) in object code or executable form under the terms of\nSections 1 and 2 above provided that you also do one of the following:\n\n    a) Accompany it with the complete corresponding machine-readable\n    source code, which must be distributed under the terms of Sections\n    1 and 2 above on a medium customarily used for software interchange; or,\n\n    b) Accompany it with a written offer, valid for at least three\n    years, to give any third party, for a charge no more than your\n    cost of physically performing source distribution, a complete\n    machine-readable copy of the corresponding source code, to be\n    distributed under the terms of Sections 1 and 2 above on a medium\n    customarily used for software interchange; or,\n\n    c) Accompany it with the information you received as to the offer\n    to distribute corresponding source code.  (This alternative is\n    allowed only for noncommercial distribution and only if you\n    received the program in object code or executable form with such\n    an offer, in accord with Subsection b above.)\n\nThe source code for a work means the preferred form of the work for\nmaking modifications to it.  For an executable work, complete source\ncode means all the source code for all modules it contains, plus any\nassociated interface definition files, plus the scripts used to\ncontrol compilation and installation of the executable.  However, as a\nspecial exception, the source code distributed need not include\nanything that is normally distributed (in either source or binary\nform) with the major components (compiler, kernel, and so on) of the\noperating system on which the executable runs, unless that component\nitself accompanies the executable.\n\nIf distribution of executable or object code is made by offering\naccess to copy from a designated place, then offering equivalent\naccess to copy the source code from the same place counts as\ndistribution of the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\n  4. You may not copy, modify, sublicense, or distribute the Program\nexcept as expressly provided under this License.  Any attempt\notherwise to copy, modify, sublicense or distribute the Program is\nvoid, and will automatically terminate your rights under this License.\nHowever, parties who have received copies, or rights, from you under\nthis License will not have their licenses terminated so long as such\nparties remain in full compliance.\n\n  5. You are not required to accept this License, since you have not\nsigned it.  However, nothing else grants you permission to modify or\ndistribute the Program or its derivative works.  These actions are\nprohibited by law if you do not accept this License.  Therefore, by\nmodifying or distributing the Program (or any work based on the\nProgram), you indicate your acceptance of this License to do so, and\nall its terms and conditions for copying, distributing or modifying\nthe Program or works based on it.\n\n  6. Each time you redistribute the Program (or any work based on the\nProgram), the recipient automatically receives a license from the\noriginal licensor to copy, distribute or modify the Program subject to\nthese terms and conditions.  You may not impose any further\nrestrictions on the recipients' exercise of the rights granted herein.\nYou are not responsible for enforcing compliance by third parties to\nthis License.\n\n  7. If, as a consequence of a court judgment or allegation of patent\ninfringement or for any other reason (not limited to patent issues),\nconditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot\ndistribute so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you\nmay not distribute the Program at all.  For example, if a patent\nlicense would not permit royalty-free redistribution of the Program by\nall those who receive copies directly or indirectly through you, then\nthe only way you could satisfy both it and this License would be to\nrefrain entirely from distribution of the Program.\n\nIf any portion of this section is held invalid or unenforceable under\nany particular circumstance, the balance of the section is intended to\napply and the section as a whole is intended to apply in other\ncircumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system, which is\nimplemented by public license practices.  Many people have made\ngenerous contributions to the wide range of software distributed\nthrough that system in reliance on consistent application of that\nsystem; it is up to the author/donor to decide if he or she is willing\nto distribute software through any other system and a licensee cannot\nimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed to\nbe a consequence of the rest of this License.\n\n  8. If the distribution and/or use of the Program is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Program under this License\nmay add an explicit geographical distribution limitation excluding\nthose countries, so that distribution is permitted only in or among\ncountries not thus excluded.  In such case, this License incorporates\nthe limitation as if written in the body of this License.\n\n  9. The Free Software Foundation may publish revised and/or new versions\nof the General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\nEach version is given a distinguishing version number.  If the Program\nspecifies a version number of this License which applies to it and \"any\nlater version\", you have the option of following the terms and conditions\neither of that version or of any later version published by the Free\nSoftware Foundation.  If the Program does not specify a version number of\nthis License, you may choose any version ever published by the Free Software\nFoundation.\n\n  10. If you wish to incorporate parts of the Program into other free\nprograms whose distribution conditions are different, write to the author\nto ask for permission.  For software which is copyrighted by the Free\nSoftware Foundation, write to the Free Software Foundation; we sometimes\nmake exceptions for this.  Our decision will be guided by the two goals\nof preserving the free status of all derivatives of our free software and\nof promoting the sharing and reuse of software generally.\n\n                            NO WARRANTY\n\n  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\nFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\nOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\nPROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\nOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\nTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\nPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\nREPAIR OR CORRECTION.\n\n  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\nREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\nINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\nOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\nTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\nYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\nPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGES.\n"
  },
  {
    "path": ".github/MIT-LICENSE.md",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2016 Algolia\nhttp://www.algolia.com/\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": ".gitignore",
    "content": "*.sql\n*.tar.gz\n*.zip\n.DS_Store\n.editorconfig\nThumbs.db\nbin\npublic\nnode_modules\ntests\ntmp\n/vendor\n"
  },
  {
    "path": ".nvmrc",
    "content": "lts/erbium\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "## 2.11.3\n* Fixed: minimum requirement discrepancies in readme and defined constant.\n* Updated: cleaned out some unused CSS selectors from really old functionality.\n* Updated: make use of `.card` class from WP core for more consistant styling.\n* Updated: Admin notice around term updating when term is assigned to many posts.\n\n## 2.11.2\n* Fixed: Valid Search key checks for new applications.\n\n## 2.11.1\n* Fixed: Fatal error if not able to retreive searchable posts index object.\n* Fixed: Fatal error potential for non-set debounce array index.\n\n## 2.11.0\n* Updated: Algolia PHP client (addresses PHP 8.4 compatibility notices)\n* Updated: UI wording to match Algolia references and Instantsearch notes.\n* Fixed: Return JSON error instead of echo exception message and continue to throw exception.\n* Added: Inline documentation for various custom filters and actions.\n* Added: Output custom debounce values in Autocomplete settings UI.\n\n## 2.10.4\n\n* Fixed: revised asset loading for InstantSearch with Full Site Editing enabled.\n* Added: Striping styles for Autocomplete table list.\n\n## 2.10.3\n\n* Added: Filter to still output frontend config data when using Instantsearch and FSE Theme.\n* Added: Filtering of new filter to attempt auto-detection of a FSE theme being in use.\n\n## 2.10.2\n\n* Added: Checkbox option to enable insights in Instantsearch templates. Please review changes to those.\n\n## 2.10.1\n\n* Fixed: Issues around admin notifications on the Autocomplete settings page, introduced in 2.10.0\n\n## 2.10.0\n\n* Added an option to set the debounce timeout value which applies to all indexes by default, but can be customized for\n  each index with a filter:\n\nDynamic filter name: `algolia_autocomplete_debounce_{$index_name}_{$index_type}`\n\nWhere `$index_name` is defined by the Index name prefix set on the WP Search with Algolia settings page and\n`$index_type` is the type of index.\n\nAssuming `wp_` is the Index name prefix, the debounce timeout filters would be:\n\n```\nalgolia_autocomplete_debounce_wp_searchable_posts\nalgolia_autocomplete_debounce_wp_post\nalgolia_autocomplete_debounce_wp_page\nalgolia_autocomplete_debounce_wp_my_custom_post_type\nalgolia_autocomplete_debounce_wp_users\nalgolia_autocomplete_debounce_wp_terms_category\nalgolia_autocomplete_debounce_wp_terms_post_tag\nalgolia_autocomplete_debounce_wp_terms_my_custom_taxonomy\n```\n\nNote that the Algolia Autocomplete settings must be saved after creating one of the above filters.\n\n## 2.9.0\n\n* Added: Instantsearch Template options. Choose between “Legacy” hogan.js/WP Utils templates and “Modern” Javascript string literals. “Modern” is more in line with Algolia Documentation.\n* Added: ability to customize default Headers for Algolia Search Client configuration.\n* Added: Initial support for programmatic Secured API key creation.\n* Updated: Sync’d up get_items() methods to allow for specifying specific IDs for posts, terms, and users.\n* Updated: Instantsearch templates use “Posts per page” amount by default, from WordPress Reading settings.\n* Updated: Amended Autocomplete settings page to remove more builtin post types that don’t need to be available.\n\n## 2.8.3\n* Fixed: \"Function _load_textdomain_just_in_time was called incorrectly\" notices.\n\n## 2.8.2\n* Updated: Wording and UI details around the settings pages for better and more accurate reflection.\n* Updated: Confirmed compatibility with WP 6.7.x\n* Added: New page regarding Premium support from WebDevStudios. Let's work together.\n\n## 2.8.1\n* Updated: WP Search with Algolia Pro features list for version 1.4.0\n\n## 2.8.0\n* Added: Filter to customize Algolia SearchClient configuration with connect/read/write timeouts.\n* Updated: Prevent table content from being concatenated. Thanks @rodrigo-arias\n* Updated: Pass `$post_id` to `algolia_get_post_images` filter.\n* Updated: Confirmed compatibility with WP 6.5\n\n## 2.7.1\n* Fixed: Instantsearch.php template file. \"Powered By Algolia\" Instantsearch widget wrapped in a check for if the \"Remove powered by\" option is checked. This should match already working behavior with Autocomplete dropdown.\n\n## 2.7.0\n* Updated: Moved post sync action from `save_post` to `wp_after_insert_post`. This allows for the sync to wait until after post meta and terms have been updated. Removes need to click save twice to sync everything.\n* Updated: WP Search with Algolia feature list.\n\n## 2.6.2\n* Fixed: More performance updates and resolutions around WP All Import.\n\n## 2.6.1\n* Fixed: Performance issues related to delete operations.\n\n* Fixed: Performance issues around WP All Import.\n\n## 2.6.0\n\n* Added: Support for syncing imported items when \"fast mode\" from WP All Import enabled.\n* Added: Support for updating child posts if parent post's slug has been updated.\n* Added: Support for updating posts when an associated term has been updatd.\n* Added: Wait for delete operations to complete before moving to updates.\n* Updated: Algolia Search library to 4.18.x\n* Updated: InstantSearch library to 4.56.x\n\n## 2.5.4\n\n* Updated: Ensure reindexing completes when using the from_batch flag with CLI.\n* Updated: Assigned Algolia_Admin instance to a property for access elsewhere.\n\n## 2.5.3\n\n* Updated: Autocomplete template file with user link fix when cmd/ctrl clicking.\n* Updated: Class method visibility from protected to public.\n\n## 2.5.2\n\n* Updated: Fixed hits per page configuration for instantsearch\n* Added: Custom hook for settings page override.\n\n## 2.5.1\n\n* Updated readme.txt with more plugin information.\n* Repositioned help info on settings screens.\n\n## 2.5.0\n\n* Introduction of WP Search with Algolia Pro availability.\n* Added `algolia_custom_template_location` filter to allow specifying custom template locations besides just your active\n  theme.\n* Templates: added action hooks at the end of Autocomplete and Instantsearch hit template blocks.\n* Updated `algolia_changes_watchers` filter to also receive the current indices.\n* Added watcher support for term and user meta updates.\n* Updated bundled CSS to better match selectors for default used widgets in the templates.\n* Clarified some details around Autocomplete settings and what can be done in each setting state.\n* Updated admin menu icon to use Algolia logo when no settings configured.\n\n## 2.4.0\n\n* Increase minimum PHP version to PHP 7.4\n* Fixed PHP8 compatibility issues\n* Prefixed Algolia library to avoid potential conflicts with other code using the same libraries.\n* Revised copy and wording around the plugin for better clarity.\n* Deprecate the `algolia_should_require_search_client` filter in favor of prefixed Algolia PHP Client namespace\n\n## 2.3.1\n\n* Update autocomplete template to use addEventListener instead of onload function\n* Update Algolia InstantSearch.js to 4.49.1\n\n## 2.3.0\n\n* Add algolia_should_override_autocomplete filter to override enable/disable status of Autocomplete\n* Add from_batch argument to the re-index WP-CLI command\n* Update excluded custom post types and taxonomies to include Core WordPress' internal CPTs and taxonomies\n* Update Algolia logos to match the latest version\n* Remove jQuery usage and dependency from templates\n* Update Algolia JavaScript API Client to 4.14.2\n* Update Algolia InstantSearch.js to 4.49.0\n* Update Algolia PHP API Client to 3.3.2\n\n## 2.2.0\n\n* Add alert to Push Settings button on the Search Page.\n* Replace attributesToIndex index setting with searchableAttributes.\n* Replace outdated Instant Search widget class.\n* Improve drag and drop column description text on the Autocomplete page.\n* Remove inline CSS for Max. Suggestions input.\n* Update Algolia JavaScript API Client to 4.13.0\n* Update Algolia InstantSearch.js to 4.40.5\n* Update Algolia Autocomplete.js to 0.38.1\n* Update Algolia PHP API Client to 3.2.0\n\n## 2.1.0\n\n* Add algolia_update_records filter to allow inspection and filtering records during update operation.\n* Add algolia_re_index_records filter to allow inspection and filtering records during re-index operation.\n* Catch some Aloglia PHP Client exceptions that were previously uncaught during record updating and re-indexing.\n* Fix an issue where SearchIndex::saveObjects was called twice during re-index operations.\n* Update Algolia PHP API Client to 3.1.0\n\n## 2.0.1\n\n* Fix for users that enable intstantsearch but not autocomplete by adding algoliasearch client as direct dependency of\n  both\n\n## 2.0.0\n\n* Breaking changes for users with customized autocomplete.php / instantsearch.php template in their theme.\n* Update autocomplete.php and instantsearch.php templates for compatibility with new JS libs.\n* Update Algolia JavaScript API Client to 4.10.3\n* Update Algolia InstantSearch.js to 4.25.2\n* Update Algolia Autocomplete.js to 0.38.0\n* Update Algolia PHP API Client to 3.0.2\n\n## 1.8.0\n\n* Focus on template versioning and update messaging\n* Add Algolia_Template_Utils class\n* Deprecate Algolia_Template_Loader::locate_template method\n* Deprecate Algolia_Plugin::get_templates_path method\n* Deprecate algolia_templates_path filter\n* Add Algolia_Update_Messages class\n* Add Algolia_Admin_Template_Notices class\n* Add Algolia_Version_Utils class\n\n## 1.7.0\n\n* Remove 'screen' media attribute from enqueued CSS\n* Update Algolia PHP Search Client to version 2.7.3.\n* Add \"exclude\" methods and filters\n* Deprecate \"blacklist\" methods and filters\n* Fix replica RequestOptions error\n* Fix PHP 8 usort deprecation warning\n* Fix JQMIGRATE event shorthand is deprecated warnings in instantsearch.php and autocomplete.php templates\n* Add \"@version\" to template file headers\n\n## 1.6.0\n\n* Fix deletion of post records created before indexing was enabled\n* Update Algolia PHP Search Client to version 2.7.1.\n* Add Algolia_Plugin_Factory to create and return a shared Algolia_Plugin instance\n* Add Algolia_Search_Client_Factory to return a new Algolia\\AlgoliaSearch\\SearchClient instance\n* Add Algolia_Http_Client_Interface_Factory to create and return a shared Php53HttpClient instance\n* Add algolia_php_53_http_client_options filter to supply cURL options to Php53HttpClient instance\n* Deprecate Algolia_Plugin:get_instance() which will be removed in an upcoming release\n\n## 1.5.0\n\n* Fix an issue where Pinterest follows a link to the Algolia domain to source text and/or images\n* Move Algolia scripts to footer by default\n* Changes algolia_load_scripts_in_footer filter default argument to \"true\"\n* Move autocomplete.php template output to footer by default\n\n## 1.4.0\n\n* Update Algolia PHP Search Client version 2.7.0.\n* Update Algolia JS libraries to most recent compatible (non-breaking) versions\n* Updates autocomplete.js to 0.37.1 (current release as of 2020-01-27)\n* Updates algoliasearch to 3.35.1 (last of the 3.x series)\n* Updates instantsearch.js to 1.12.1 (last of the 1.x series)\n\n## 1.3.0\n\n* Fix an issue where, under some circumstances, when a post with a featured image was deleted, the post might be\n  accidentally re-indexed\n* Fix bug that prevented reindex display notices\n* Add algolia_load_scripts_in_footer filter to allow enqueueing the scripts in the footer instead of in the head\n* Add new filters for multisite developers\n\n## 1.2.0\n\n* Use filtered value of 'hitsPerPage' as 'posts_per_page' query param\n* Fix broken SVG\n* Add highlighting to backend search results - props @philipnewcomer\n\n## 1.1.0\n\n* Minimum PHP version requirement is now PHP 7.2\n* Minimum WordPress version requirement is now WP 5.0\n* Internationalization/localization improvements, textdomain matches plugin slug\n* Addressed a potential WSOD if minimum PHP and WP version requirements were not met\n* Tested on WP 5.3\n\n## 1.0.0\n\n* Initial release.\n"
  },
  {
    "path": "README.txt",
    "content": "=== WP Search with Algolia ===\r\nContributors: WebDevStudios, williamsba1, tw2113, mrasharirfan, scottbasgaard, gregrickaby, richaber, daveromsey\r\nTags: algolia, autocomplete, instantsearch, relevance search, ai search\r\nRequires at least: 6.7.2\r\nTested up to: 6.9\r\nRequires PHP: 7.4\r\nStable tag: 2.11.3\r\nLicense: GNU General Public License v2.0, MIT License\r\n\r\nUse the power of Algolia AI Search & Discovery to enhance your website's search. Enable AI-powered Autocomplete and InstantSearch for fast, accurate results and relevance.\r\n\r\n== Description ==\r\n\r\nEasily integrate the powerful search tool Algolia AI Search & Discovery directly into your WordPress website. Quickly index all of your website’s content and provide lightning fast and accurate search results within minutes!\r\n\r\nBuilt and supported by WebDevStudios, the website agency behind Custom Post Type UI, WP Search with Algolia immediately improves search on your website. Your users will be impressed!\r\n\r\nEnable Autocomplete and Instantsearch to immediately provide a more robust search experience to your visitors. Plus, you receive full control over the look, feel, and relevance of your users' search experience.\r\n\r\n= Features =\r\n* One-click indexing of all content in WordPress\r\n* Relevant, faceted ready search results in milliseconds with native typo-tolerance from Algolia AI Search & Discovery\r\n* Super granular control on search content relevancy and content positioning\r\n* Language-agnostic\r\n* WordPress hooks and filters available for easy customization of indexed content.\r\n\r\nThis plugin requires API keys from [Algolia](https://www.algolia.com/). API keys are free for small personal projects and non-commercial use. Learn more about [commercial use pricing](https://www.algolia.com/pricing/).\r\n\r\n=== WP Search with Algolia Pro ===\r\nIntroducing **WP Search with Algolia Pro**, our new premium version of WP Search with Algolia! Pro features include:\r\n\r\n* Multisite Network-wide support!\r\n\t* Create a global search for content across all the sites in your network all in one Algolia index.\r\n* WooCommerce support\r\n  * Indexing Product data including SKU, pricing (standard and variable), short descriptions, dimensions, and more.\r\n  * Total sales and total ratings indexed for popularity\r\n* Advanced SEO support with Yoast SEO, All in One SEO, Rank Math SEO, SEOPress, and The SEO Framework.\r\n  * Content level settings to exclude individual content from the search index\r\n  * Set Algolia’s indexing to match with existing search engine “noindex” settings\r\n\r\nAre you ready to go Pro? Check out [WP Search with Algolia Pro on Pluginize](https://pluginize.com/plugins/wp-search-with-algolia-pro/)!\r\n\r\n= Links =\r\n* [WebDevStudios](https://webdevstudios.com)\r\n* [Algolia](https://algolia.com)\r\n* [Documentation](https://github.com/WebDevStudios/wp-search-with-algolia/wiki)\r\n* [Support](https://wordpress.org/support/plugin/wp-search-with-algolia/)\r\n* [Feature requests and bugs](https://github.com/WebDevStudios/wp-search-with-algolia/issues)\r\n* [WP Search with Algolia Snippet Library](https://github.com/WebDevStudios/algolia-snippet-library)\r\n\r\n*This plugin is a derivative work of the code from the [Search by Algolia – Instant & Relevant results](https://wordpress.org/plugins/search-by-algolia-instant-relevant-results/) plugin for WordPress, which is licensed under the GPLv2.*\r\n\r\n== Installation ==\r\n\r\nFrom your WordPress dashboard:\r\n\r\n1. **Visit** Plugins > Add New\r\n2. **Search** for \"WP Search with Algolia\"\r\n3. **Activate** WP Search with Algolia from your Plugins page\r\n4. **Click** on the new menu item \"Algolia Search\" and enter your API keys\r\n5. **Read** the step by step [configuration guide](https://github.com/WebDevStudios/wp-search-with-algolia/wiki/Getting-Started)\r\n\r\n== Frequently Asked Questions ==\r\n\r\n= I see you now have a Pro addon, what features are available with it? =\r\n\r\nWhen you purchase a copy of [WP Search with Algolia Pro](https://pluginize.com/plugins/wp-search-with-algolia-pro/) you are getting access to the start of WooCommerce integration as well as Search Engine Optimization mirroring.\r\n\r\nWith WooCommerce, you'll be able to manage settings to start including product information as part of indexed products, including out of box display with both Autocomplete and Instantsearch hit templates. You can also include details like product SKU values, total sales, and ratings to help with index ranking and relevance.\r\n\r\nWith SEO settings, you can configure your content to manage itself in your Algolia indexes based on your \"noindex\" settings from your dedicated SEO plugins.\r\n\r\nWe intend to continue adding and evolving all the extra features in WP Search with Algolia Pro\r\n\r\n= Is this plugin a fork? =\r\n\r\nYes. The Algolia Team **[no longer supports their original plugin](https://community.algolia.com/wordpress/)**. The engineering team at WebDevStudios has forked the original plugin, and is now maintaining it.\r\n\r\n= Should I switch to this plugin? =\r\n\r\nYes. Because Algolia no longer supports their plugin, you will no longer receive updates. WebDevStudios uses Algolia on many of its projects, and is committed to maintaining this plugin.\r\n\r\n= What are the minimum requirements? =\r\n\r\n* Requires WordPress 5.3+\r\n* PHP version 7.4 or greater\r\n* MySQL version 5.0 or greater (MySQL 5.6 or greater is recommended)\r\n* cURL PHP extension\r\n* mbstring PHP extension\r\n* OpenSSL greater than 1.0.1\r\n* Some payment gateways require fsockopen support (for IPN access)\r\n\r\nVisit the [WP Search with Algolia server requirements documentation](https://github.com/WebDevStudios/wp-search-with-algolia/wiki/WP-Search-with-Algolia-plugin-Installation) for a detailed list of server requirements.\r\n\r\n= Where can I find WP Search with Algolia documentation and user guides? =\r\n\r\n- For help setting up and configuring WP Search with Algolia please refer to the [user guide](https://github.com/WebDevStudios/wp-search-with-algolia/wiki/WP-Search-with-Algolia-plugin-Installation).\r\n- For extending or theming the Autocomplete dropdown, see the [Autocomplete Customization guide](https://github.com/WebDevStudios/wp-search-with-algolia/wiki/Customize-the-Autocomplete-dropdown).\r\n- For extending or theming the Instant Search results page, see the [Search Page Customization guide](https://github.com/WebDevStudios/wp-search-with-algolia/wiki/Customize-your-search-page).\r\n\r\n= Will it work with my theme? =\r\n\r\nYes. This plugin should work with most themes that do not override the default WordPress search behavior. Instant Search results page may require some styling to make it match nicely. See the [Search Page Customization](https://github.com/WebDevStudios/wp-search-with-algolia/wiki/Customize-your-search-page).\r\n\r\n= Where can I report bugs, request features, or contribute to the project? =\r\n\r\nAll development is handled on [GitHub](https://github.com/WebDevStudios/wp-search-with-algolia/issues).\r\n\r\n== Screenshots ==\r\n\r\n1. Algolia Settings\r\n2. Search Page Settings\r\n3. Autocomplete Settings\r\n4. InstantSearch Dropdown\r\n5. Search Results\r\n\r\n== Changelog ==\r\n\r\nFollow along with the changelog on [Github](https://github.com/WebDevStudios/wp-search-with-algolia/releases).\r\n\r\n= 2.11.3 =\r\n* Fixed: minimum requirement discrepancies in readme and defined constant.\r\n* Updated: cleaned out some unused CSS selectors from really old functionality.\r\n* Updated: make use of `.card` class from WP core for more consistant styling.\r\n* Updated: Admin notice around term updating when term is assigned to many posts.\r\n\r\n= 2.11.2 =\r\n* Fixed: Valid Search key checks for new applications.\r\n\r\n= 2.11.1 =\r\n* Fixed: Fatal error if not able to retreive searchable posts index object.\r\n* Fixed: Fatal error potential for non-set debounce array index.\r\n\r\n= 2.11.0 =\r\n* Updated: Algolia PHP client (addresses PHP 8.4 compatibility notices)\r\n* Updated: UI wording to match Algolia references and Instantsearch notes.\r\n* Fixed: Return JSON error instead of echo exception message and continue to throw exception.\r\n* Added: Inline documentation for various custom filters and actions.\r\n* Added: Output custom debounce values in Autocomplete settings UI.\r\n\r\n= 2.10.4 =\r\n* Fixed: revised asset loading for InstantSearch with Full Site Editing enabled.\r\n* Added: Striping styles for Autocomplete table list.\r\n\r\n= 2.10.3 =\r\n* Added: Filter to still output frontend config data when using Instantsearch and FSE Theme.\r\n* Added: Filtering of new filter to attempt auto-detection of a FSE theme being in use.\r\n\r\n= 2.10.2 =\r\n* Added: Checkbox option to enable insights in Instantsearch templates. Please review changes to those.\r\n\r\n= 2.10.1 =\r\n* Fixed: Issues around admin notifications on the Autocomplete settings page, introduced in 2.10.0\r\n\r\n= 2.10.0 =\r\n* Added: Debounce option for Autocomplete.\r\n* Added: Initial integration with Health Panel.\r\n* Updated: Instantsearch to version 4.78.3\r\n* Updated: Prevent loading of API credentials on frontend when not using Autocomplete or Instantsearch.\r\n* Updated: Removed WooCommerce internal post types and taxonomies from Autocomplete list.\r\n* Updated: Prevent errors with Yoast SEO function checks.\r\n* Updated: Sync'd up internal code for `get_re_index_items_count()`\r\n\r\n= 2.9.0 =\r\n* Added: Instantsearch Template options. Choose between \"Legacy\" hogan.js/WP Utils templates and \"Modern\" Javascript string literals. \"Modern\" is more in line with Algolia Documentation.\r\n* Added: ability to customize default Headers for Algolia Search Client configuration.\r\n* Added: Initial support for programmatic Secured API key creation.\r\n* Updated: Sync'd up `get_items()` methods to allow for specifying specific IDs for posts, terms, and users.\r\n* Updated: Instantsearch templates use \"Posts per page\" amount by default, from WordPress Reading settings.\r\n* Updated: Amended Autocomplete settings page to remove more builtin post types that don't need to be available.\r\n\r\n= 2.8.3 =\r\n* Fixed: \"Function _load_textdomain_just_in_time was called incorrectly\" notices.\r\n\r\n= 2.8.2 =\r\n* Updated: Wording and UI details around the settings pages for better and more accurate reflection.\r\n* Updated: Confirmed compatibility with WP 6.7.x\r\n* Added: New page regarding Premium support from WebDevStudios. Let's work together.\r\n\r\n= 2.8.1 =\r\n* Updated: WP Search with Algolia Pro features list for version 1.4.0\r\n\r\n= 2.8.0 =\r\n* Added: Filter to customize Algolia SearchClient configuration with connect/read/write timeouts.\r\n* Updated: Prevent table content from being concatenated. Thanks @rodrigo-arias\r\n* Updated: Pass `$post_id` to `algolia_get_post_images` filter.\r\n* Updated: Confirmed compatibility with WP 6.5\r\n\r\n= 2.7.1 =\r\n* Fixed: Instantsearch.php template file. \"Powered By Algolia\" Instantsearch widget wrapped in a check for if the \"Remove powered by\" option is checked. This should match already working behavior with Autocomplete dropdown.\r\n\r\n= 2.7.0 =\r\n* Updated: Moved post sync action from `save_post` to `wp_after_insert_post`. This allows for the sync to wait until after post meta and terms have been updated. Removes need to click save twice to sync everything.\r\n* Updated: WP Search with Algolia feature list.\r\n\r\n= 2.6.2 =\r\n* Fixed: More performance updates and resolutions around WP All Import.\r\n\r\n= 2.6.1 =\r\n* Fixed: Performance issues related to delete operations.\r\n* Fixed: Performance issues around WP All Import.\r\n\r\n= 2.6.0 =\r\n* Added: Support for syncing imported items when \"fast mode\" from WP All Import enabled.\r\n* Added: Support for updating child posts if parent post's slug has been updated.\r\n* Added: Support for updating posts when an associated term has been updatd.\r\n* Added: Wait for delete operations to complete before moving to updates.\r\n* Updated: Algolia Search library to 4.18.x\r\n* Updated: InstantSearch library to 4.56.x\r\n\r\n= 2.5.4 =\r\n* Updated: Ensure reindexing completes when using the from_batch flag with CLI.\r\n* Updated: Assigned Algolia_Admin instance to a property for access elsewhere.\r\n\r\n= 2.5.3 =\r\n* Updated: Autocomplete template file with user link fix when cmd/ctrl clicking.\r\n* Updated: Class method visibility from protected to public.\r\n\r\n= 2.5.2 =\r\n* Updated: Fixed hits per page configuration for instantsearch\r\n* Added: Custom hook for settings page override.\r\n\r\n= 2.5.1 =\r\n* Updated readme.txt with more plugin information.\r\n* Repositioned help info on settings screens.\r\n\r\n= 2.5.0 =\r\n* Introduction of WP Search with Algolia Pro availability.\r\n* Added `algolia_custom_template_location` filter to allow specifying custom template locations besides just your active theme.\r\n* Templates: added action hooks at the end of Autocomplete and Instantsearch hit template blocks.\r\n* Updated `algolia_changes_watchers` filter to also receive the current indices.\r\n* Added watcher support for term and user meta updates.\r\n* Updated bundled CSS to better match selectors for default used widgets in the templates.\r\n* Clarified some details around Autocomplete settings and what can be done in each setting state.\r\n* Updated admin menu icon to use Algolia logo when no settings configured.\r\n"
  },
  {
    "path": "algolia.php",
    "content": "<?php\n/**\n * Plugin Name:       WP Search with Algolia\n * Plugin URI:        https://github.com/WebDevStudios/wp-search-with-algolia\n * Description:       Integrate the powerful Algolia search service with WordPress\n * Version:           2.11.3\n * Requires at least: 6.7.2\n * Requires PHP:      7.4\n * Author:            WebDevStudios\n * Author URI:        https://webdevstudios.com\n * License:           GNU General Public License v2.0 / MIT License\n * Text Domain:       wp-search-with-algolia\n * Domain Path:       /languages\n *\n * @since   1.0.0\n * @package WebDevStudios\\WPSWA\n */\n\n// The following code is a derivative work of the code from the\n// Algolia Search plugin for WordPress, which is licensed GPLv2.\n// This code therefore is also licensed under the terms of the GNU Public License v2.0.\n\n// Nothing to see here if not loaded in WP context.\nif ( ! defined( 'WPINC' ) ) {\n\tdie;\n}\n\n// The Algolia Search plugin version.\ndefine( 'ALGOLIA_VERSION', '2.11.3' );\n\n// The minmum required PHP version.\ndefine( 'ALGOLIA_MIN_PHP_VERSION', '7.4' );\n\n// The minimum required WordPress version.\ndefine( 'ALGOLIA_MIN_WP_VERSION', '6.7.2' );\n\ndefine( 'ALGOLIA_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );\n\ndefine( 'ALGOLIA_PLUGIN_URL', plugins_url( '/', __FILE__ ) );\n\nif ( ! defined( 'ALGOLIA_PATH' ) ) {\n\tdefine( 'ALGOLIA_PATH', __DIR__ . '/' );\n}\n\n/**\n * Check for required PHP version.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.1.0\n *\n * @return bool\n */\nfunction algolia_php_version_check() {\n\tif ( version_compare( PHP_VERSION, ALGOLIA_MIN_PHP_VERSION, '<' ) ) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\n/**\n * Check for required WordPress version.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.1.0\n *\n * @return bool\n */\nfunction algolia_wp_version_check() {\n\tif ( version_compare( $GLOBALS['wp_version'], ALGOLIA_MIN_WP_VERSION, '<' ) ) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\n/**\n * Check if WP Search with Algolia Pro is active.\n *\n * @author Webdevstudios <contact@webdevstudios.com>\n * @since 2.5.0\n *\n * @return bool\n */\nfunction algolia_is_pro_active() {\n\tif ( ! defined( 'WPSWA_PRO_VERSION' ) ) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\n/**\n * Admin notices if requirements aren't met.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.1.0\n */\nfunction algolia_requirements_error_notice() {\n\n\t$notices = [];\n\n\tif ( ! algolia_php_version_check() ) {\n\t\t$notices[] = sprintf(\n\t\t\t// translators: placeholder 1 is minimum required PHP version, placeholder 2 is installed PHP version.\n\t\t\tesc_html__( 'Algolia plugin requires PHP %1$s or higher. You’re still on %2$s.', 'wp-search-with-algolia' ),\n\t\t\tesc_html( ALGOLIA_MIN_PHP_VERSION ),\n\t\t\tesc_html( PHP_VERSION )\n\t\t);\n\t}\n\n\tif ( ! algolia_wp_version_check() ) {\n\t\t$notices[] = sprintf(\n\t\t\t// translators: placeholder 1 is minimum required WordPress version, placeholder 2 is installed WordPress version.\n\t\t\tesc_html__( 'Algolia plugin requires at least WordPress in version %1$s, You are on %2$s.', 'wp-search-with-algolia' ),\n\t\t\tesc_html( ALGOLIA_MIN_WP_VERSION ),\n\t\t\tesc_html( $GLOBALS['wp_version'] )\n\t\t);\n\t}\n\n\tforeach ( $notices as $notice ) {\n\t\techo '<div class=\"notice notice-error\"><p>' . esc_html( $notice ) . '</p></div>';\n\t}\n}\n\n/**\n * I18n.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n */\nfunction algolia_load_textdomain() {\n\n\t// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals -- This is a legitimate use of a global filter.\n\t$locale = apply_filters( 'plugin_locale', get_locale(), 'wp-search-with-algolia' );\n\n\tload_textdomain( 'wp-search-with-algolia', WP_LANG_DIR . '/wp-search-with-algolia/wp-search-with-algolia-' . $locale . '.mo' );\n\n\tload_plugin_textdomain( 'wp-search-with-algolia', false, plugin_basename( dirname( __FILE__ ) ) . '/languages/' );\n}\n\nadd_action( 'init', 'algolia_load_textdomain' );\n\nif ( algolia_php_version_check() && algolia_wp_version_check() ) {\n\trequire_once ALGOLIA_PATH . 'classmap.php';\n\n\t$algolia = Algolia_Plugin_Factory::create();\n\n\tif ( defined( 'WP_CLI' ) && WP_CLI ) {\n\t\tWP_CLI::add_command( 'algolia', new Algolia_CLI() );\n\t}\n} else {\n\tadd_action( 'admin_notices', 'algolia_requirements_error_notice' );\n}\n"
  },
  {
    "path": "classmap.php",
    "content": "<?php\n/**\n * WP Search With Algolia \"Classmap\" file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\nif ( ! defined( 'ALGOLIA_PATH' ) ) {\n\texit();\n}\n\n/**\n * Filters whether to include the Algolia PHP API Client library.\n *\n * @since      1.0.0\n * @deprecated 2.3.2 No longer necessary as the Algolia PHP API Client library is now prefixed.\n *\n * @param bool $true Include the Algolia PHP API Client library.\n */\napply_filters_deprecated(\n\t'algolia_should_require_search_client',\n\t[ true ],\n\t'2.3.2',\n\t'',\n\t'The \"algolia_should_require_search_client\" filter is deprecated and no longer has any effect.',\n);\n\n// Autoload vendor dependencies, that have been prefixed to prevent namespace collision.\nrequire_once ALGOLIA_PATH . 'vendor_prefixed/autoload.php';\n\nrequire_once ALGOLIA_PATH . 'includes/factories/class-algolia-http-client-interface-factory.php';\nrequire_once ALGOLIA_PATH . 'includes/factories/class-algolia-search-client-factory.php';\nrequire_once ALGOLIA_PATH . 'includes/factories/class-algolia-plugin-factory.php';\n\nrequire_once ALGOLIA_PATH . 'includes/class-algolia-api.php';\nrequire_once ALGOLIA_PATH . 'includes/class-algolia-autocomplete-config.php';\nrequire_once ALGOLIA_PATH . 'includes/class-algolia-cli.php';\nrequire_once ALGOLIA_PATH . 'includes/class-algolia-compatibility.php';\nrequire_once ALGOLIA_PATH . 'includes/class-algolia-plugin.php';\nrequire_once ALGOLIA_PATH . 'includes/class-algolia-search.php';\nrequire_once ALGOLIA_PATH . 'includes/class-algolia-settings.php';\nrequire_once ALGOLIA_PATH . 'includes/class-algolia-template-loader.php';\nrequire_once ALGOLIA_PATH . 'includes/class-algolia-utils.php';\nrequire_once ALGOLIA_PATH . 'includes/class-algolia-styles.php';\nrequire_once ALGOLIA_PATH . 'includes/class-algolia-scripts.php';\n\nrequire_once ALGOLIA_PATH . 'includes/indices/class-algolia-index.php';\nrequire_once ALGOLIA_PATH . 'includes/indices/class-algolia-index-replica.php';\nrequire_once ALGOLIA_PATH . 'includes/indices/class-algolia-searchable-posts-index.php';\nrequire_once ALGOLIA_PATH . 'includes/indices/class-algolia-posts-index.php';\nrequire_once ALGOLIA_PATH . 'includes/indices/class-algolia-terms-index.php';\nrequire_once ALGOLIA_PATH . 'includes/indices/class-algolia-users-index.php';\n\nrequire_once ALGOLIA_PATH . 'includes/watchers/class-algolia-changes-watcher.php';\nrequire_once ALGOLIA_PATH . 'includes/watchers/class-algolia-post-changes-watcher.php';\nrequire_once ALGOLIA_PATH . 'includes/watchers/class-algolia-term-changes-watcher.php';\nrequire_once ALGOLIA_PATH . 'includes/watchers/class-algolia-user-changes-watcher.php';\n\nrequire_once ALGOLIA_PATH . 'includes/utilities/class-algolia-health-panel.php';\nrequire_once ALGOLIA_PATH . 'includes/utilities/class-algolia-template-utils.php';\nrequire_once ALGOLIA_PATH . 'includes/utilities/class-algolia-version-utils.php';\nrequire_once ALGOLIA_PATH . 'includes/utilities/class-algolia-update-messages.php';\n\nif ( is_admin() ) {\n\trequire_once ALGOLIA_PATH . 'includes/admin/class-algolia-admin.php';\n\trequire_once ALGOLIA_PATH . 'includes/admin/class-algolia-admin-page-settings.php';\n\trequire_once ALGOLIA_PATH . 'includes/admin/class-algolia-admin-page-autocomplete.php';\n\trequire_once ALGOLIA_PATH . 'includes/admin/class-algolia-admin-page-native-search.php';\n\trequire_once ALGOLIA_PATH . 'includes/admin/class-algolia-admin-page-woocommerce.php';\n\trequire_once ALGOLIA_PATH . 'includes/admin/class-algolia-admin-page-premium-support.php';\n\trequire_once ALGOLIA_PATH . 'includes/admin/class-algolia-admin-page-seo.php';\n\trequire_once ALGOLIA_PATH . 'includes/admin/class-algolia-admin-template-notices.php';\n}\n"
  },
  {
    "path": "composer.json",
    "content": "{\n  \"name\": \"webdevstudios/wp-search-with-algolia\",\n  \"version\": \"2.11.3\",\n  \"description\": \"Integrate the powerful Algolia search service with WordPress.\",\n  \"authors\": [\n    {\n      \"name\": \"WebDevStudios\",\n      \"email\": \"contact@webdevstudios.com\"\n    }\n  ],\n  \"license\": \"GPL-3.0\",\n  \"keywords\": [\n    \"algolia\"\n  ],\n  \"homepage\": \"https://github.com/WebDevStudios/wp-search-with-algolia\",\n  \"type\": \"wordpress-plugin\",\n  \"minimum-stability\": \"dev\",\n  \"prefer-stable\": true,\n  \"require\": {\n    \"php\": \">=7.4\",\n    \"composer/installers\": \"~1.0\"\n  },\n  \"require-dev\": {\n    \"dealerdirect/phpcodesniffer-composer-installer\": \"^0.7.1\",\n    \"phpcompatibility/phpcompatibility-wp\": \"^2.1.2\",\n    \"wp-coding-standards/wpcs\": \"^2.3.0\",\n    \"psr/http-message\": \"^1.0\",\n    \"psr/log\": \"^1.1\",\n    \"psr/simple-cache\": \"^1.0\",\n    \"brianhenryie/strauss\": \"^0.11.1\",\n    \"php-stubs/wp-cli-stubs\": \"^2.7\",\n    \"php-stubs/wordpress-stubs\": \"^6.1\",\n    \"algolia/algoliasearch-client-php\": \"3.4.2\"\n  },\n  \"extra\": {\n    \"installer-name\": \"wp-search-with-algolia\",\n    \"strauss\": {\n      \"target_directory\": \"vendor_prefixed\",\n      \"namespace_prefix\": \"WebDevStudios\\\\WPSWA\\\\\",\n      \"classmap_prefix\": \"WDS_WPSWA_\",\n      \"constant_prefix\": \"WDS_WPSWA_\",\n      \"packages\": [\n        \"algolia/algoliasearch-client-php\",\n        \"psr/http-message\",\n        \"psr/log\",\n        \"psr/simple-cache\"\n      ],\n      \"override_autoload\": {\n      },\n      \"exclude_from_copy\": {\n        \"packages\": [\n        ],\n        \"namespaces\": [\n        ],\n        \"file_patterns\": [\n        ]\n      },\n      \"exclude_from_prefix\": {\n        \"packages\": [\n        ],\n        \"namespaces\": [\n        ],\n        \"file_patterns\": [\n        ]\n      },\n      \"namespace_replacement_patterns\" : {\n      },\n      \"delete_vendor_files\": false\n    },\n    \"copy-file\": {\n    },\n    \"copy-file-dev\": {\n    }\n  },\n  \"scripts\": {\n    \"lint\": \"@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --standard=phpcs.xml --extensions=php .\",\n    \"lint:fix\": \"@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --standard=phpcs.xml --extensions=php .\",\n    \"post-install-cmd\": [\n      \"@php ./vendor/bin/strauss\"\n    ],\n    \"post-update-cmd\": [\n      \"@php ./vendor/bin/strauss\"\n    ]\n  },\n  \"config\": {\n    \"allow-plugins\": {\n      \"composer/installers\": true,\n      \"dealerdirect/phpcodesniffer-composer-installer\": true\n    }\n  }\n}\n"
  },
  {
    "path": "css/algolia-autocomplete.css",
    "content": ".algolia-autocomplete {\n\tz-index: 999999 !important;\n}\n.aa-dropdown-menu {\n\t/* we set the width in JS */\n\tfont-family: sans-serif;\n\tbackground-color: #fff;\n\tborder-top: none;\n\tborder-bottom-left-radius: 4px;\n\tborder-bottom-right-radius: 4px;\n\tbox-shadow: 0 1px 2px rgba(0,0,0,.25),0 0 1px rgba(0,0,0,.35);\n}\n\n.aa-dropdown-menu:after {\n\tcontent: \" \";\n\tdisplay: block;\n\tclear: both;\n\n}\n\n.aa-dropdown-menu .aa-input, .aa-dropdown-menu .aa-hint {\n\twidth: 100%;\n}\n.aa-dropdown-menu .aa-hint {\n\tcolor: #999;\n}\n\n/* Font */\n.aa-dropdown-menu {\n\tcolor: #1a1a1a;\n\tfont-size: 12px;\n}\n\n.aa-dropdown-menu a {\n\tfont-size: 12px;\n\tcolor: #1a1a1a;\n\tfont-weight: normal;\n\ttext-decoration: none;\n}\n.aa-dropdown-menu a:hover {\n\ttext-decoration: none;\n}\n\n/* Header */\n.aa-dropdown-menu .autocomplete-header {\n\tmargin: 0 14px;\n\tline-height: 3em;\n\tborder-bottom: 1px solid rgba(0,0,0,.05);\n}\n.aa-dropdown-menu .autocomplete-header-title,\n.aa-dropdown-menu .autocomplete-header-more\n{\n\tletter-spacing: 1px;\n\ttext-transform: uppercase;\n\tfont-weight: bold;\n}\n\n.aa-dropdown-menu .autocomplete-header-title {\n\tfloat: left;\n}\n\n.aa-dropdown-menu .autocomplete-header-more {\n\tfloat: right;\n}\n\n.aa-dropdown-menu .autocomplete-header-more a {\n\tcolor: rgba(0,0,0,.3);\n\tfont-weight: bold;\n}\n\n.aa-dropdown-menu .autocomplete-header-more a:hover {\n\tcolor:  rgba(0,0,0,.4);\n}\n\n/* Suggestion */\n\n.aa-dropdown-menu .aa-suggestion {\n\tpadding: 5px 0;\n\n}\n\n.aa-dropdown-menu .aa-suggestion:after {\n\tvisibility: hidden;\n\tdisplay: block;\n\tfont-size: 0;\n\tcontent: \" \";\n\tclear: both;\n\theight: 0;\n}\n\n.aa-dropdown-menu .aa-suggestion em {\n\tcolor: #174d8c;\n\tbackground: rgba(143,187,237,.1);\n\tfont-style: normal;\n}\n\n.aa-dropdown-menu .aa-suggestion .suggestion-post-title {\n\tfont-weight: bold;\n\tdisplay: block;\n\twhite-space: nowrap;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n}\n\n.aa-dropdown-menu .aa-suggestion .suggestion-post-content {\n\tcolor: #63676d;\n\tdisplay: block;\n\twhite-space: nowrap;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n}\n\n.aa-dropdown-menu .aa-suggestion .suggestion-post-content em {\n\tpadding: 0 0 1px;\n\tbackground: inherit;\n\tbox-shadow: inset 0 -2px 0 0 rgba(69,142,225,.8);\n\tcolor: inherit;\n}\n\n.aa-dropdown-menu .aa-suggestion.aa-cursor {\n\tbackground-color: #f9f9f9;\n\n}\n\n.aa-dropdown-menu a.suggestion-link {\n\tdisplay: block;\n\tpadding: 0 14px;\n}\n\n.aa-dropdown-menu a.suggestion-link.user-suggestion-link {\n\tline-height: 32px;\n}\n\n\n.aa-dropdown-menu a.suggestion-link svg {\n\tvertical-align: middle;\n\tfill: rgba(0,0,0,.3);\n\tfloat: left;\n}\n\n.aa-dropdown-menu .suggestion-post-thumbnail {\n\tfloat: left;\n\tmargin-right: 5px;\n\tmargin-bottom: 5px;\n\tborder-radius: 3px;\n\twidth: 32px;\n\theight: 32px;\n}\n\n.aa-dropdown-menu .suggestion-user-thumbnail {\n\tfloat: left;\n\tmargin-right: 5px;\n\tmargin-bottom: 5px;\n\tborder-radius: 16px;\n\twidth: 32px;\n\theight: 32px;\n}\n\n/* Footer */\n.aa-dropdown-menu .autocomplete-footer-branding {\n\tpadding: 15px 14px 0px;\n\tfloat: right;\n\tcolor: rgba(0,0,0,.3);\n\tmargin-bottom: 7px;\n}\n\n/* Clearfix */\n.aa-dropdown-menu .clear {\n\tclear: both;\n}\n\n/* Empty */\n.autocomplete-empty {\n\tclear: both;\n\tpadding: 15px;\n}\n\n.autocomplete-empty .empty-query {\n\tfont-weight: bold;\n}\n"
  },
  {
    "path": "css/algolia-instantsearch.css",
    "content": "#ais-wrapper {\n\tdisplay: flex;\n}\n\n#ais-main {\n\tpadding: 1rem;\n\twidth: 100%;\n}\n\n#ais-facets {\n\twidth: 40%;\n\tpadding: 1rem;\n}\n\n.ais-facets {\n\tmargin-bottom: 2rem;\n\tpadding: 0;\n}\n\n.ais-facets ul {\n\tlist-style: none;\n\tpadding-left: 0;\n\tmargin-left: 0;\n}\n\n.ais-facets li {\n\tmargin-left: 0;\n}\n\n.ais-clearfix {\n\tclear: both;\n}\n\n.algolia-search-box-wrapper {\n\tposition: relative;\n}\n\n.algolia-search-box-wrapper .search-icon {\n\tposition: absolute;\n\tleft: 0px;\n\ttop: 14px;\n\tfill: #21a4d7;\n}\n\n#algolia-search-box {\n\tmargin-bottom: 3rem;\n}\n\n#algolia-search-box input {\n\tborder: none;\n\tborder-bottom: 2px solid #21a4d7;\n\tbackground: transparent;\n\twidth: 100%;\n\tline-height: 30px;\n\tfont-size: 22px;\n\tpadding: 10px 0 10px 30px;\n\tfont-weight: 200;\n\tbox-sizing: border-box;\n\toutline: none;\n\tbox-shadow: none;\n\tappearance: none;\n\t-webkit-appearance: none;\n\t-moz-appearance: none;\n\t-ms-appearance: none;\n}\n\n.ais-SearchBox-form {\n\tdisplay: block;\n\tposition: relative;\n}\n\n.ais-SearchBox-submit[hidden],\n.ais-SearchBox-reset[hidden],\n.ais-SearchBox-loadingIndicator[hidden] {\n\tdisplay: none;\n}\n\n#algolia-powered-by {\n\tposition: absolute;\n\ttop: 60px;\n\tright: 0;\n\tfont-size: 14px;\n\ttext-align: right;\n}\n\n.ais-Stats {\n\tposition: absolute;\n\ttop: 60px;\n\tfont-size: 14px;\n}\n\n.ais-Hits-list {\n\tlist-style: none;\n\tpadding-left: 0;\n\tmargin-left: 0;\n}\n\n.ais-Hits-item {\n\t/* hit item */\n\tmargin: 0 0 2rem 0;\n}\n\n.ais-Hits-item h2 {\n\tmargin: 0;\n}\n\n.ais-Hits-item em, .ais-Hits-item a em,\n.ais-Hits-item mark, .ais-Hits-item a mark {\n\tfont-style: normal;\n\tbackground: #fffbcc;\n\tborder-radius: 2px;\n}\n\n.ais-hits--thumbnail {\n\tfloat: left;\n\tmargin-right: 2rem;\n}\n\n.ais-hits--content {\n\toverflow: hidden;\n}\n\n.ais-hits--thumbnail img {\n\tborder-radius: 3px;\n}\n\n.ais-Pagination {\n\tmargin: 0;\n}\n\n.ais-Pagination-list {\n\tmargin-left: 0;\n}\n\n.ais-Pagination-item {\n\t/* Pagination item */\n\tdisplay: inline-block;\n\tpadding: 3px;\n}\n\n.ais-Pagination-item--disabled {\n\t/* disabled Pagination item */\n\tdisplay: none;\n}\n\n.ais-Pagination-item--selected {\n\tfont-weight: bold;\n}\n\n.ais-Menu-item--selected {\n\t/* active list item */\n\tfont-weight: bold;\n}\n\n.ais-HierarchicalMenu-item--selected {\n\t/* Hierarchical Menu: Categories */\n\tfont-weight: bold;\n}\n\n.ais-Menu-count,\n.ais-HierarchicalMenu-count,\n.ais-RefinementList-count {\n\tmargin-left: 5px;\n}\n\n.ais-HierarchicalMenu-list--child {\n\t/* item list level 1 */\n\tmargin-left: 10px;\n}\n\n.ais-RangeSlider .rheostat {\n\toverflow: visible;\n\tmargin-top: 40px;\n\tmargin-bottom: 40px;\n}\n\n.ais-RangeSlider .rheostat-background {\n\theight: 6px;\n\ttop: 0px;\n\twidth: 100%;\n}\n\n.ais-RangeSlider .rheostat-handle {\n\tmargin-left: -12px;\n\ttop: -7px;\n}\n\n.ais-RangeSlider .rheostat-background {\n\tposition: relative;\n\tbackground-color: #fff;\n\tborder: 1px solid #003dff;\n}\n\n.ais-RangeSlider .rheostat-progress {\n\tposition: absolute;\n\ttop: 1px;\n\theight: 4px;\n\tbackground-color: #333;\n}\n\n.rheostat-handle {\n\tposition: relative;\n\tz-index: 1;\n\twidth: 20px;\n\theight: 20px;\n\tbackground-color: #fff;\n\tborder: 1px solid #333;\n\tborder-radius: 50%;\n\tcursor: -webkit-grab;\n\tcursor: grab;\n}\n\n.rheostat-marker {\n\tmargin-left: -1px;\n\tposition: absolute;\n\twidth: 1px;\n\theight: 5px;\n\tbackground-color: #aaa;\n}\n\n.rheostat-marker--large {\n\theight: 9px;\n}\n\n.rheostat-value {\n\tmargin-left: 50%;\n\tpadding-top: 15px;\n\tposition: absolute;\n\ttext-align: center;\n\t-webkit-transform: translateX(-50%);\n\ttransform: translateX(-50%);\n}\n\n.rheostat-tooltip {\n\tmargin-left: 50%;\n\tposition: absolute;\n\ttop: -22px;\n\ttext-align: center;\n\t-webkit-transform: translateX(-50%);\n\ttransform: translateX(-50%);\n}\n\n.ais-RatingMenu-item {\n\t/* list item */\n\tvertical-align: middle;\n}\n\n.ais-RatingMenu-item--selected {\n\t/* active list item */\n\tfont-weight: bold;\n}\n\n.ais-RatingMenu-starIcon {\n\t/* item star */\n\tdisplay: inline-block;\n\twidth: 1em;\n\theight: 1em;\n}\n\n.ais-RatingMenu-starIcon:before {\n\tcontent: '\\2605';\n\tcolor: #fbae00;\n}\n\n.ais-RatingMenu-starIcon--empty {\n\t/* empty star */\n\tdisplay: inline-block;\n\twidth: 1em;\n\theight: 1em;\n}\n\n.ais-RatingMenu-starIcon--empty:before {\n\tcontent: '\\2606';\n\tcolor: #fbae00;\n}\n\n.ais-RatingMenu-item--disabled .ais-star-rating--star:before {\n\tcolor: #c9c9c9;\n}\n\n.ais-RatingMenu-item--disabled .ais-star-rating--star__empty:before {\n\tcolor: #c9c9c9;\n}\n\n.ais-root__collapsible .ais-header {\n\tcursor: pointer;\n}\n\n.ais-root__collapsed .ais-body, .ais-root__collapsed .ais-footer {\n\tdisplay: none;\n}\n\n/* Responsive */\n@media only screen and (max-width: 1000px) {\n\t#ais-facets {\n\t\tdisplay: none;\n\t}\n\n\t.ais-hits--thumbnail img {\n\t\twidth: 100% !important;\n\t}\n\n\t.ais-Hits-item {\n\t\tborder-bottom: 1px solid gainsboro;\n\t\tpadding-bottom: 23px;\n\t}\n}\n\n@media only screen and (max-width: 500px) {\n\t.ais-hits--thumbnail {\n\t\tmargin-right: 0 !important;\n\t\tmargin-bottom: 10px;\n\t\tfloat: none !important;\n\t}\n}\n"
  },
  {
    "path": "css/index.php",
    "content": "<?php // Silence is golden\n"
  },
  {
    "path": "includes/admin/class-algolia-admin-page-autocomplete.php",
    "content": "<?php\n/**\n * Algolia_Admin_Page_Autocomplete class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Admin_Page_Autocomplete\n *\n * @since 1.0.0\n */\nclass Algolia_Admin_Page_Autocomplete {\n\n\t/**\n\t * Admin page slug.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprivate $slug = 'algolia';\n\n\t/**\n\t * Admin page capabilities.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprivate $capability = 'manage_options';\n\n\t/**\n\t * Admin page section.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprivate $section = 'algolia_section_autocomplete';\n\n\t/**\n\t * Admin page option group.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprivate $option_group = 'algolia_autocomplete';\n\n\t/**\n\t * The Algolia_Settings object.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var Algolia_Settings\n\t */\n\tprivate $settings;\n\n\t/**\n\t * The Algolia_Autocomplete_Config object.\n\t *\n\t * @since 1.0.0\n\t *\n\t * @var Algolia_Autocomplete_Config\n\t */\n\tprivate $autocomplete_config;\n\n\t/**\n\t * Algolia_Admin_Page_Autocomplete constructor.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param Algolia_Settings            $settings            The Algolia_Settings object.\n\t * @param Algolia_Autocomplete_Config $autocomplete_config The Algolia_Autocomplete_Config object.\n\t */\n\tpublic function __construct( Algolia_Settings $settings, Algolia_Autocomplete_Config $autocomplete_config ) {\n\t\t$this->settings            = $settings;\n\t\t$this->autocomplete_config = $autocomplete_config;\n\n\t\tadd_action( 'admin_menu', array( $this, 'add_page' ) );\n\t\tadd_action( 'admin_init', array( $this, 'add_settings' ) );\n\t\tadd_action( 'admin_notices', array( $this, 'display_errors' ) );\n\n\t\t// @todo: Listen for de-index to remove from autocomplete.\n\t}\n\n\t/**\n\t * Add menu pages.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function add_page() {\n\t\tadd_menu_page(\n\t\t\tesc_html__( 'Algolia Search', 'wp-search-with-algolia' ),\n\t\t\tesc_html__( 'Algolia Search', 'wp-search-with-algolia' ),\n\t\t\t'manage_options',\n\t\t\t'algolia',\n\t\t\tarray( $this, 'display_page' ),\n\t\t\t'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MDAgNTAwLjM0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzAwM2RmZjt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMjUwLDBDMTEzLjM4LDAsMiwxMTAuMTYsLjAzLDI0Ni4zMmMtMiwxMzguMjksMTEwLjE5LDI1Mi44NywyNDguNDksMjUzLjY3LDQyLjcxLC4yNSw4My44NS0xMC4yLDEyMC4zOC0zMC4wNSwzLjU2LTEuOTMsNC4xMS02LjgzLDEuMDgtOS41MmwtMjMuMzktMjAuNzRjLTQuNzUtNC4yMi0xMS41Mi01LjQxLTE3LjM3LTIuOTItMjUuNSwxMC44NS01My4yMSwxNi4zOS04MS43NiwxNi4wNC0xMTEuNzUtMS4zNy0yMDIuMDQtOTQuMzUtMjAwLjI2LTIwNi4xLDEuNzYtMTEwLjMzLDkyLjA2LTE5OS41NSwyMDIuOC0xOTkuNTVoMjAyLjgzVjQwNy42OGwtMTE1LjA4LTEwMi4yNWMtMy43Mi0zLjMxLTkuNDMtMi42Ni0xMi40MywxLjMxLTE4LjQ3LDI0LjQ2LTQ4LjU2LDM5LjY3LTgxLjk4LDM3LjM2LTQ2LjM2LTMuMi04My45Mi00MC41Mi04Ny40LTg2Ljg2LTQuMTUtNTUuMjgsMzkuNjUtMTAxLjU4LDk0LjA3LTEwMS41OCw0OS4yMSwwLDg5Ljc0LDM3Ljg4LDkzLjk3LDg2LjAxLC4zOCw0LjI4LDIuMzEsOC4yOCw1LjUzLDExLjEzbDI5Ljk3LDI2LjU3YzMuNCwzLjAxLDguOCwxLjE3LDkuNjMtMy4zLDIuMTYtMTEuNTUsMi45Mi0yMy42LDIuMDctMzUuOTUtNC44My03MC4zOS02MS44NC0xMjcuMDEtMTMyLjI2LTEzMS4zNS04MC43My00Ljk4LTE0OC4yMyw1OC4xOC0xNTAuMzcsMTM3LjM1LTIuMDksNzcuMTUsNjEuMTIsMTQzLjY2LDEzOC4yOCwxNDUuMzYsMzIuMjEsLjcxLDYyLjA3LTkuNDIsODYuMi0yNi45N2wxNTAuMzYsMTMzLjI5YzYuNDUsNS43MSwxNi42MiwxLjE0LDE2LjYyLTcuNDhWOS40OUM1MDAsNC4yNSw0OTUuNzUsMCw0OTAuNTEsMEgyNTBaIi8+PC9zdmc+'\n\t\t);\n\t\tadd_submenu_page(\n\t\t\t'algolia',\n\t\t\tesc_html__( 'Autocomplete', 'wp-search-with-algolia' ),\n\t\t\tesc_html__( 'Autocomplete', 'wp-search-with-algolia' ),\n\t\t\t$this->capability,\n\t\t\t$this->slug,\n\t\t\tarray( $this, 'display_page' )\n\t\t);\n\t}\n\n\t/**\n\t * Add and register settings.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function add_settings() {\n\t\tadd_settings_section(\n\t\t\t$this->section,\n\t\t\tnull,\n\t\t\tarray( $this, 'print_section_settings' ),\n\t\t\t$this->slug\n\t\t);\n\n\t\tadd_settings_field(\n\t\t\t'algolia_autocomplete_enabled',\n\t\t\tesc_html__( 'Enable Autocomplete', 'wp-search-with-algolia' ),\n\t\t\tarray( $this, 'autocomplete_enabled_callback' ),\n\t\t\t$this->slug,\n\t\t\t$this->section\n\t\t);\n\n\t\tadd_settings_field(\n\t\t\t'algolia_autocomplete_debounce',\n\t\t\tesc_html__( 'Autocomplete Debounce', 'wp-search-with-algolia' ),\n\t\t\tarray( $this, 'autocomplete_debounce_callback' ),\n\t\t\t$this->slug,\n\t\t\t$this->section\n\t\t);\n\n\t\tadd_settings_field(\n\t\t\t'algolia_autocomplete_config',\n\t\t\tesc_html__( 'Autocomplete Config', 'wp-search-with-algolia' ),\n\t\t\tarray( $this, 'autocomplete_config_callback' ),\n\t\t\t$this->slug,\n\t\t\t$this->section\n\t\t);\n\n\t\tregister_setting( $this->option_group, 'algolia_autocomplete_enabled', array( $this, 'sanitize_autocomplete_enabled' ) );\n\t\tregister_setting( $this->option_group, 'algolia_autocomplete_debounce', array( $this, 'sanitize_autocomplete_debounce' ) );\n\t\tregister_setting( $this->option_group, 'algolia_autocomplete_config', array( $this, 'sanitize_autocomplete_config' ) );\n\t}\n\n\t/**\n\t * Callback to print the autocomplete enabled checkbox.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function autocomplete_enabled_callback() {\n\t\t$value    = $this->settings->get_autocomplete_enabled();\n\t\t$indices  = $this->autocomplete_config->get_form_data();\n\t\t$checked  = 'yes' === $value ? 'checked ' : '';\n\t\t$disabled = empty( $indices ) ? 'disabled ' : '';\n\t\t?>\n\t\t<input type='checkbox' name='algolia_autocomplete_enabled' value='yes' <?php echo esc_html( $checked . ' ' . $disabled ); ?>/>\n\t\t<?php\n\t}\n\n\t/**\n\t * Callback to print the autocomplete debounce value.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since 2.10.0\n\t */\n\tpublic function autocomplete_debounce_callback() {\n\t\t$value   = $this->settings->get_autocomplete_debounce();\n\t\t$indices = $this->autocomplete_config->get_form_data();\n\t\t?>\n\t\t<input type=\"number\" name=\"algolia_autocomplete_debounce\" class=\"small-text\" min=\"0\" value=\"<?php echo esc_attr( $value ); ?>\" <?php disabled( empty( $indices ) ); ?>/>\n\t\t<p class=\"description\" id=\"home-description\">\n\t\t\t<?php esc_html_e( 'Enter the debounce timeout value in milliseconds. Use 0 (default) to disable debounce.', 'wp-search-with-algolia' ); ?>\n\t\t\t<a href=\"https://www.algolia.com/doc/ui-libraries/autocomplete/guides/debouncing-sources/\" target=\"_blank\"><?php esc_html_e( 'Debouncing sources documentation', 'wp-search-with-algolia' ); ?></a>\n\t\t</p>\n\t\t<?php\n\t}\n\n\t/**\n\t * Sanitize the Autocomplete enabled setting.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string $value The original value.\n\t *\n\t * @return string\n\t */\n\tpublic function sanitize_autocomplete_enabled( $value ) {\n\n\t\tadd_settings_error(\n\t\t\t$this->option_group,\n\t\t\t'autocomplete_enabled',\n\t\t\tesc_html__( 'Autocomplete configuration has been saved. Make sure to hit the \"re-index\" buttons of the different indices that are not indexed yet.', 'wp-search-with-algolia' ),\n\t\t\t'updated'\n\t\t);\n\n\t\treturn 'yes' === $value ? 'yes' : 'no';\n\t}\n\n\t/**\n\t * Sanitize the Autocomplete debounce setting.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.10.0\n\t *\n\t * @param int $value The original value.\n\t *\n\t * @return int The sanitized value.\n\t */\n\tpublic function sanitize_autocomplete_debounce( $value ) {\n\t\treturn intval( $value );\n\t}\n\n\t/**\n\t * Autocomplete Config Callback.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function autocomplete_config_callback() {\n\t\t$indices = $this->autocomplete_config->get_form_data();\n\n\t\trequire_once dirname( __FILE__ ) . '/partials/page-autocomplete-config.php';\n\t}\n\n\t/**\n\t * Sanitize Autocomplete Config.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param array $values Array of autocomplete config values.\n\t *\n\t * @return array|mixed\n\t */\n\tpublic function sanitize_autocomplete_config( $values ) {\n\t\treturn $this->autocomplete_config->sanitize_form_data( $values );\n\t}\n\n\t/**\n\t * Display the page.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function display_page() {\n\t\trequire_once dirname( __FILE__ ) . '/partials/page-autocomplete.php';\n\t}\n\n\t/**\n\t * Display the errors.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return void\n\t */\n\tpublic function display_errors() {\n\t\tsettings_errors( $this->option_group );\n\n\t\tif ( defined( 'ALGOLIA_HIDE_HELP_NOTICES' ) && ALGOLIA_HIDE_HELP_NOTICES ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$is_enabled = 'yes' === $this->settings->get_autocomplete_enabled();\n\t\t$indices    = $this->autocomplete_config->get_config();\n\n\t\tif ( true === $is_enabled && empty( $indices ) ) {\n\t\t\t// translators: placeholder contains the URL to the autocomplete configuration page.\n\t\t\t$message = sprintf( __( 'Please select one or multiple indices on the <a href=\"%s\">Algolia: Autocomplete configuration page</a>.', 'wp-search-with-algolia' ), esc_url( admin_url( 'admin.php?page=' . $this->slug ) ) );\n\t\t\techo '<div class=\"error notice\">\n\t\t\t\t\t  <p>' . esc_html__( 'You have enabled the Algolia Autocomplete feature but did not choose any index to search in.', 'wp-search-with-algolia' ) . '</p>\n\t\t\t\t\t  <p>' . wp_kses_post( $message ) . '</p>\n\t\t\t\t  </div>';\n\t\t}\n\t}\n\n\t/**\n\t * Prints the section text.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function print_section_settings() {\n\t\techo '<p>' . esc_html__( 'Autocomplete adds a search-as-you-type dropdown to your search field(s).', 'wp-search-with-algolia' ) . '</p>';\n\n\t\techo '<p>' . esc_html__( 'Enabling Autocomplete adds the functionality to your site\\'s frontend search. Indexing and settings pushes can be done regardless of enabled status.', 'wp-search-with-algolia' ) . '</p>';\n\t}\n}\n"
  },
  {
    "path": "includes/admin/class-algolia-admin-page-native-search.php",
    "content": "<?php\n/**\n * Algolia_Admin_Page_Native_Search class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Admin_Page_Native_Search\n *\n * @since 1.0.0\n */\nclass Algolia_Admin_Page_Native_Search {\n\n\t/**\n\t * Admin page slug.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprivate $slug = 'algolia-search-page';\n\n\t/**\n\t * Admin page capabilities.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprivate $capability = 'manage_options';\n\n\t/**\n\t * Admin page section.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprivate $section = 'algolia_section_native_search';\n\n\t/**\n\t * Admin page option group.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprivate $option_group = 'algolia_native_search';\n\n\t/**\n\t * The Algolia_Plugin instance.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var Algolia_Plugin\n\t */\n\tprivate $plugin;\n\n\t/**\n\t * Algolia_Admin_Page_Native_Search constructor.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param Algolia_Plugin $plugin The Algolia_Plugin instance.\n\t */\n\tpublic function __construct( Algolia_Plugin $plugin ) {\n\t\t$this->plugin = $plugin;\n\n\t\tadd_action( 'admin_menu', array( $this, 'add_page' ) );\n\t\tadd_action( 'admin_init', array( $this, 'add_settings' ) );\n\t\tadd_action( 'admin_notices', array( $this, 'display_errors' ) );\n\t}\n\n\t/**\n\t * Add submenu page.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function add_page() {\n\t\tadd_submenu_page(\n\t\t\t'algolia',\n\t\t\tesc_html__( 'Search Page', 'wp-search-with-algolia' ),\n\t\t\tesc_html__( 'Search Page', 'wp-search-with-algolia' ),\n\t\t\t$this->capability,\n\t\t\t$this->slug,\n\t\t\tarray( $this, 'display_page' ),\n\t\t\t0\n\t\t);\n\t}\n\n\t/**\n\t * Add settings.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function add_settings() {\n\t\tadd_settings_section(\n\t\t\t$this->section,\n\t\t\tnull,\n\t\t\tarray( $this, 'print_section_settings' ),\n\t\t\t$this->slug\n\t\t);\n\n\t\tadd_settings_field(\n\t\t\t'algolia_override_native_search',\n\t\t\tesc_html__( 'Search results', 'wp-search-with-algolia' ),\n\t\t\tarray( $this, 'override_native_search_callback' ),\n\t\t\t$this->slug,\n\t\t\t$this->section\n\t\t);\n\n\t\tadd_settings_field(\n\t\t\t'algolia_instantsearch_template_version',\n\t\t\tesc_html__( 'Instantsearch Template version', 'wp-search-with-algolia' ),\n\t\t\t[ $this, 'instantsearch_template_version' ],\n\t\t\t$this->slug,\n\t\t\t$this->section\n\t\t);\n\n\t\tregister_setting( $this->option_group, 'algolia_override_native_search', array( $this, 'sanitize_override_native_search' ) );\n\n\t\tregister_setting(\n\t\t\t$this->option_group,\n\t\t\t'algolia_instantsearch_template_version',\n\t\t\t[\n\t\t\t\t'type'              => 'string',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'default'           => 'legacy',\n\t\t\t]\n\t\t);\n\t}\n\n\t/**\n\t * Override native search callback.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function override_native_search_callback() {\n\t\t$value = $this->plugin->get_settings()->get_override_native_search();\n\n\t\trequire_once dirname( __FILE__ ) . '/partials/form-override-search-option.php';\n\t}\n\n\t/**\n\t * Get Instantsearch template version\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.9.0\n\t */\n\tpublic function instantsearch_template_version() {\n\t\t$value = $this->plugin->get_settings()->get_instantsearch_template_version();\n\n\t\trequire_once dirname( __FILE__ ) . '/partials/form-override-search-version-option.php';\n\t}\n\n\t/**\n\t * Sanitize override native search.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string $value The value to sanitize.\n\t *\n\t * @return array\n\t */\n\tpublic function sanitize_override_native_search( $value ) {\n\n\t\tif ( 'backend' === $value ) {\n\t\t\tadd_settings_error(\n\t\t\t\t$this->option_group,\n\t\t\t\t'native_search_enabled',\n\t\t\t\tesc_html__( 'WordPress search is now based on Algolia!', 'wp-search-with-algolia' ),\n\t\t\t\t'updated'\n\t\t\t);\n\t\t} elseif ( 'instantsearch' === $value ) {\n\t\t\tadd_settings_error(\n\t\t\t\t$this->option_group,\n\t\t\t\t'native_search_enabled',\n\t\t\t\tesc_html__( 'WordPress search is now based on Algolia instantsearch.js!', 'wp-search-with-algolia' ),\n\t\t\t\t'updated'\n\t\t\t);\n\t\t} else {\n\t\t\t$value = 'native';\n\t\t\tadd_settings_error(\n\t\t\t\t$this->option_group,\n\t\t\t\t'native_search_disabled',\n\t\t\t\tesc_html__( 'You chose to keep the WordPress native search instead of Algolia. If you are using the autocomplete feature of the plugin we highly recommend you turn Algolia search on instead of the WordPress native search.', 'wp-search-with-algolia' ),\n\t\t\t\t'updated'\n\t\t\t);\n\t\t}\n\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Display the page.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function display_page() {\n\t\trequire_once dirname( __FILE__ ) . '/partials/page-search.php';\n\t}\n\n\t/**\n\t * Display the errors.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return void\n\t */\n\tpublic function display_errors() {\n\t\tsettings_errors( $this->option_group );\n\n\t\tif ( defined( 'ALGOLIA_HIDE_HELP_NOTICES' ) && ALGOLIA_HIDE_HELP_NOTICES ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$settings = $this->plugin->get_settings();\n\n\t\tif ( ! $settings->should_override_search_in_backend() && ! $settings->should_override_search_with_instantsearch() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$maybe_get_page = filter_input( INPUT_GET, 'page', FILTER_SANITIZE_SPECIAL_CHARS );\n\n\t\t$searchable_posts_index = $this->plugin->get_index( 'searchable_posts' );\n\t\tif ( empty( $searchable_posts_index ) ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( false === $searchable_posts_index->is_enabled() && ( ! empty( $maybe_get_page ) ) && $maybe_get_page === $this->slug ) {\n\t\t\t// translators: placeholder contains the link to the indexing page.\n\t\t\t$message = sprintf( __( 'Searchable posts index needs to be checked on the <a href=\"%s\">Algolia: Indexing page</a> for the search results to be powered by Algolia.', 'wp-search-with-algolia' ), esc_url( admin_url( 'admin.php?page=algolia-indexing' ) ) );\n\t\t\techo '<div class=\"error notice\">\n\t\t\t\t\t  <p>' . wp_kses_post( $message ) . '</p>\n\t\t\t\t  </div>';\n\t\t}\n\t}\n\n\t/**\n\t * Prints the section text.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function print_section_settings() {\n\t\techo '<p>' . esc_html__( 'By enabling these settings to override the native WordPress search, your search results will be powered by Algolia\\'s typo-tolerant & relevant search algorithms.', 'wp-search-with-algolia' ) . '</p>';\n\n\t\techo '<p>' . sprintf(\n\t\t\t'<strong>%1$s</strong> - %2$s',\n\t\t\tesc_html__( 'Re-index All Content', 'wp-search-with-algolia' ),\n\t\t\tesc_html__( 'Resubmit all of your content to the Algolia search API. Search results will be updated once the re-index has completed.', 'wp-search-with-algolia' )\n\t\t) . '</p>';\n\n\t\techo '<p>' . sprintf(\n\t\t\t'<strong>%1$s</strong> - %2$s <strong>%3$s</strong>',\n\t\t\tesc_html__( 'Push Settings', 'wp-search-with-algolia' ),\n\t\t\tesc_html__( 'Sync your search index settings to code-based overrides and plugin defaults.', 'wp-search-with-algolia' ),\n\t\t\tesc_html__( 'WARNING this will override or reset configuration changes originally made within your Algolia dashboard.', 'wp-search-with-algolia' )\n\t\t) . '</p>';\n\n\t\t// @Todo: replace this with a check on the searchable_posts_index.\n\t\t$indices = $this->plugin->get_indices(\n\t\t\tarray(\n\t\t\t\t'enabled'  => true,\n\t\t\t\t'contains' => 'posts',\n\t\t\t)\n\t\t);\n\n\t\tif ( empty( $indices ) ) {\n\t\t\techo '<div class=\"error-message\"><p>' .\n\t\t\t\t\tesc_html( __( 'You have no index containing only posts yet. Please index some content with the \"Re-index All Content\" button above.', 'wp-search-with-algolia' ) ) .\n\t\t\t\t\t'</p></div>';\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/admin/class-algolia-admin-page-premium-support.php",
    "content": "<?php\n/**\n * Algolia_Admin_Page_Premiun_Support class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   2.8.2\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Admin_Page_Premium_Support\n *\n * @since 2.8.2\n */\nclass Algolia_Admin_Page_Premium_Support {\n\n\t/**\n\t * Admin page slug.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.8.2\n\t * @var string\n\t */\n\tprivate $slug = 'algolia-account-premium-support';\n\n\t/**\n\t * Admin page capabilities.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.8.2\n\t * @var string\n\t */\n\tprivate $capability = 'manage_options';\n\n\t/**\n\t * Admin page section.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.8.2\n\t * @var string\n\t */\n\tprivate $section = 'algolia_section_premium_support';\n\n\t/**\n\t * Admin page option group.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.8.2\n\t * @var string\n\t */\n\tprivate $option_group = 'algolia_settings';\n\n\t/**\n\t * The Algolia_Plugin instance.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.8.2\n\t * @var Algolia_Plugin\n\t */\n\tprivate $plugin;\n\n\t/**\n\t * Algolia_Admin_Page_Premium_Support constructor.\n\t *\n\t * @param Algolia_Plugin $plugin The Algolia_Plugin instance.\n\t *\n\t * @since  2.8.2\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t */\n\tpublic function __construct( Algolia_Plugin $plugin ) {\n\t\t$this->plugin = $plugin;\n\n\t\tadd_action( 'admin_menu', [ $this, 'add_page' ] );\n\t\tadd_action( 'admin_init', [ $this, 'add_settings' ] );\n\t}\n\n\t/**\n\t * Add admin menu page.\n\t *\n\t * @since  2.8.2\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t *\n\t * @return string|void The resulting page's hook_suffix.\n\t */\n\tpublic function add_page() {\n\t\t$api         = $this->plugin->get_api();\n\t\t$parent_slug = ! $api->is_reachable() ? 'algolia-account-settings' : 'algolia';\n\t\tadd_submenu_page(\n\t\t\t$parent_slug,\n\t\t\tesc_html__( 'Premium Support from WebDevStudios', 'wp-search-with-algolia' ),\n\t\t\tesc_html__( 'Premium Support', 'wp-search-with-algolia' ),\n\t\t\t$this->capability,\n\t\t\t$this->slug,\n\t\t\t[ $this, 'display_page' ]\n\t\t);\n\t}\n\n\t/**\n\t * Add settings.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.8.2\n\t */\n\tpublic function add_settings() {\n\t\tadd_settings_section(\n\t\t\t$this->section,\n\t\t\tnull,\n\t\t\t[ $this, 'print_section_settings' ],\n\t\t\t$this->slug\n\t\t);\n\t}\n\n\t/**\n\t * Display the page.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.8.2\n\t */\n\tpublic function display_page() {\n\t\trequire_once dirname( __FILE__ ) . '/partials/form-options-premium-support.php';\n\t}\n\n\t/**\n\t * Print the settings section.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.8.2\n\t */\n\tpublic function print_section_settings() {\n\n\t}\n}\n"
  },
  {
    "path": "includes/admin/class-algolia-admin-page-seo.php",
    "content": "<?php\n/**\n * Algolia_Admin_Page_SEO class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   2.5.0\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Admin_Page_SEO\n *\n * @since 2.5.0\n */\nclass Algolia_Admin_Page_SEO {\n\n\t/**\n\t * Admin page slug.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.5.0\n\t * @var string\n\t */\n\tprivate $slug = 'algolia-account-seo';\n\n\t/**\n\t * Admin page capabilities.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.5.0\n\t * @var string\n\t */\n\tprivate $capability = 'manage_options';\n\n\t/**\n\t * Admin page section.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.5.0\n\t * @var string\n\t */\n\tprivate $section = 'algolia_section_seo';\n\n\t/**\n\t * Admin page option group.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.5.0\n\t * @var string\n\t */\n\tprivate $option_group = 'algolia_settings';\n\n\t/**\n\t * The Algolia_Plugin instance.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.5.0\n\t * @var Algolia_Plugin\n\t */\n\tprivate $plugin;\n\n\t/**\n\t * Algolia_Admin_Page_SEO constructor.\n\t *\n\t * @param Algolia_Plugin $plugin The Algolia_Plugin instance.\n\t *\n\t * @since  2.5.0\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t */\n\tpublic function __construct( Algolia_Plugin $plugin ) {\n\t\t$this->plugin = $plugin;\n\n\t\tadd_action( 'admin_menu', [ $this, 'add_page' ] );\n\t\tadd_action( 'admin_init', [ $this, 'add_settings' ] );\n\t}\n\n\t/**\n\t * Add admin menu page.\n\t *\n\t * @return string|void The resulting page's hook_suffix.\n\t * @since  2.5.0\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t */\n\tpublic function add_page() {\n\t\t$api = $this->plugin->get_api();\n\t\tif ( ! $api->is_reachable() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tadd_submenu_page(\n\t\t\t'algolia',\n\t\t\tesc_html__( 'SEO', 'wp-search-with-algolia' ),\n\t\t\tsprintf(\n\t\t\t\t// translators: Placeholders are just for HTML markup that doesn't need translated.\n\t\t\t\tesc_html__( 'SEO %s', 'wp-search-with-algolia' ),\n\t\t\t\tsprintf(\n\t\t\t\t\t'<span class=\"algolia-pro-indicator\">%s</span>',\n\t\t\t\t\tesc_html__( 'Pro', 'wp-search-with-algolia' )\n\t\t\t\t)\n\t\t\t),\n\t\t\t$this->capability,\n\t\t\t$this->slug,\n\t\t\t[ $this, 'display_page' ]\n\t\t);\n\t}\n\n\t/**\n\t * Add settings.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.5.0\n\t */\n\tpublic function add_settings() {\n\t\tadd_settings_section(\n\t\t\t$this->section,\n\t\t\tnull,\n\t\t\t[ $this, 'print_section_settings' ],\n\t\t\t$this->slug\n\t\t);\n\t}\n\n\t/**\n\t * Display the page.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.5.0\n\t */\n\tpublic function display_page() {\n\t\trequire_once dirname( __FILE__ ) . '/partials/form-options-seo.php';\n\t}\n\n\t/**\n\t * Print the settings section.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.5.0\n\t */\n\tpublic function print_section_settings() {\n\n\t}\n}\n"
  },
  {
    "path": "includes/admin/class-algolia-admin-page-settings.php",
    "content": "<?php\n/**\n * Algolia_Admin_Page_Settings class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Admin_Page_Settings\n *\n * @since 1.0.0\n */\nclass Algolia_Admin_Page_Settings {\n\n\t/**\n\t * Admin page slug.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprivate $slug = 'algolia-account-settings';\n\n\t/**\n\t * Admin page capabilities.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprivate $capability = 'manage_options';\n\n\t/**\n\t * Admin page section.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprivate $section = 'algolia_section_settings';\n\n\t/**\n\t * Admin page option group.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprivate $option_group = 'algolia_settings';\n\n\t/**\n\t * The Algolia_Plugin instance.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var Algolia_Plugin\n\t */\n\tprivate $plugin;\n\n\t/**\n\t * Algolia_Admin_Page_Settings constructor.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param Algolia_Plugin $plugin The Algolia_Plugin instance.\n\t */\n\tpublic function __construct( Algolia_Plugin $plugin ) {\n\t\t$this->plugin = $plugin;\n\n\t\tadd_action( 'admin_menu', array( $this, 'add_page' ) );\n\t\tadd_action( 'admin_init', array( $this, 'add_settings' ) );\n\t\tadd_action( 'admin_notices', array( $this, 'display_errors' ) );\n\n\t\t// Display a link to this page from the plugins page.\n\t\tadd_filter( 'plugin_action_links_' . ALGOLIA_PLUGIN_BASENAME, array( $this, 'add_action_links' ) );\n\t}\n\n\t/**\n\t * Add action links.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param array $links Array of action links.\n\t *\n\t * @return array\n\t */\n\tpublic function add_action_links( array $links ) {\n\t\treturn array_merge(\n\t\t\t$links,\n\t\t\tarray(\n\t\t\t\t'<a href=\"' . esc_url( admin_url( 'admin.php?page=' . $this->slug ) ) . '\">' . esc_html__( 'Settings', 'wp-search-with-algolia' ) . '</a>',\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Add admin menu page.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return string|void The resulting page's hook_suffix.\n\t */\n\tpublic function add_page() {\n\t\t$api = $this->plugin->get_api();\n\t\tif ( ! $api->is_reachable() ) {\n\t\t\t// Means this is the only reachable admin page, so make it the default one!\n\t\t\treturn add_menu_page(\n\t\t\t\t'WP Search with Algolia',\n\t\t\t\tesc_html__( 'Algolia Search', 'wp-search-with-algolia' ),\n\t\t\t\t'manage_options',\n\t\t\t\t$this->slug,\n\t\t\t\tarray( $this, 'display_page' ),\n\t\t\t\t'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MDAgNTAwLjM0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzAwM2RmZjt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMjUwLDBDMTEzLjM4LDAsMiwxMTAuMTYsLjAzLDI0Ni4zMmMtMiwxMzguMjksMTEwLjE5LDI1Mi44NywyNDguNDksMjUzLjY3LDQyLjcxLC4yNSw4My44NS0xMC4yLDEyMC4zOC0zMC4wNSwzLjU2LTEuOTMsNC4xMS02LjgzLDEuMDgtOS41MmwtMjMuMzktMjAuNzRjLTQuNzUtNC4yMi0xMS41Mi01LjQxLTE3LjM3LTIuOTItMjUuNSwxMC44NS01My4yMSwxNi4zOS04MS43NiwxNi4wNC0xMTEuNzUtMS4zNy0yMDIuMDQtOTQuMzUtMjAwLjI2LTIwNi4xLDEuNzYtMTEwLjMzLDkyLjA2LTE5OS41NSwyMDIuOC0xOTkuNTVoMjAyLjgzVjQwNy42OGwtMTE1LjA4LTEwMi4yNWMtMy43Mi0zLjMxLTkuNDMtMi42Ni0xMi40MywxLjMxLTE4LjQ3LDI0LjQ2LTQ4LjU2LDM5LjY3LTgxLjk4LDM3LjM2LTQ2LjM2LTMuMi04My45Mi00MC41Mi04Ny40LTg2Ljg2LTQuMTUtNTUuMjgsMzkuNjUtMTAxLjU4LDk0LjA3LTEwMS41OCw0OS4yMSwwLDg5Ljc0LDM3Ljg4LDkzLjk3LDg2LjAxLC4zOCw0LjI4LDIuMzEsOC4yOCw1LjUzLDExLjEzbDI5Ljk3LDI2LjU3YzMuNCwzLjAxLDguOCwxLjE3LDkuNjMtMy4zLDIuMTYtMTEuNTUsMi45Mi0yMy42LDIuMDctMzUuOTUtNC44My03MC4zOS02MS44NC0xMjcuMDEtMTMyLjI2LTEzMS4zNS04MC43My00Ljk4LTE0OC4yMyw1OC4xOC0xNTAuMzcsMTM3LjM1LTIuMDksNzcuMTUsNjEuMTIsMTQzLjY2LDEzOC4yOCwxNDUuMzYsMzIuMjEsLjcxLDYyLjA3LTkuNDIsODYuMi0yNi45N2wxNTAuMzYsMTMzLjI5YzYuNDUsNS43MSwxNi42MiwxLjE0LDE2LjYyLTcuNDhWOS40OUM1MDAsNC4yNSw0OTUuNzUsMCw0OTAuNTEsMEgyNTBaIi8+PC9zdmc+'\n\t\t\t);\n\t\t}\n\n\t\tadd_submenu_page(\n\t\t\t'algolia',\n\t\t\tesc_html__( 'WP Search with Algolia Settings', 'wp-search-with-algolia' ),\n\t\t\tesc_html__( 'Settings', 'wp-search-with-algolia' ),\n\t\t\t$this->capability,\n\t\t\t$this->slug,\n\t\t\tarray( $this, 'display_page' ),\n\t\t\t0\n\t\t);\n\t}\n\n\t/**\n\t * Add settings.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function add_settings() {\n\t\tadd_settings_section(\n\t\t\t$this->section,\n\t\t\tnull,\n\t\t\tarray( $this, 'print_section_settings' ),\n\t\t\t$this->slug\n\t\t);\n\n\t\tadd_settings_field(\n\t\t\t'algolia_application_id',\n\t\t\tesc_html__( 'Application ID', 'wp-search-with-algolia' ),\n\t\t\tarray( $this, 'application_id_callback' ),\n\t\t\t$this->slug,\n\t\t\t$this->section\n\t\t);\n\n\t\tadd_settings_field(\n\t\t\t'algolia_search_api_key',\n\t\t\tesc_html__( 'Search API key', 'wp-search-with-algolia' ),\n\t\t\tarray( $this, 'search_api_key_callback' ),\n\t\t\t$this->slug,\n\t\t\t$this->section\n\t\t);\n\n\t\tadd_settings_field(\n\t\t\t'algolia_api_key',\n\t\t\tesc_html__( 'Admin API key', 'wp-search-with-algolia' ),\n\t\t\tarray( $this, 'api_key_callback' ),\n\t\t\t$this->slug,\n\t\t\t$this->section\n\t\t);\n\n\t\tadd_settings_field(\n\t\t\t'algolia_index_name_prefix',\n\t\t\tesc_html__( 'Index name prefix', 'wp-search-with-algolia' ),\n\t\t\tarray( $this, 'index_name_prefix_callback' ),\n\t\t\t$this->slug,\n\t\t\t$this->section\n\t\t);\n\n\t\tadd_settings_field(\n\t\t\t'algolia_powered_by_enabled',\n\t\t\tesc_html__( 'Remove Algolia powered by logo', 'wp-search-with-algolia' ),\n\t\t\tarray( $this, 'powered_by_enabled_callback' ),\n\t\t\t$this->slug,\n\t\t\t$this->section\n\t\t);\n\n\t\tadd_settings_field(\n\t\t\t'algolia_insights_enabled',\n\t\t\tesc_html__( 'Enable Insight events', 'wp-search-with-algolia' ),\n\t\t\tarray( $this, 'insights_enabled_callback' ),\n\t\t\t$this->slug,\n\t\t\t$this->section\n\t\t);\n\n\t\tregister_setting( $this->option_group, 'algolia_application_id', array( $this, 'sanitize_application_id' ) );\n\t\tregister_setting( $this->option_group, 'algolia_search_api_key', array( $this, 'sanitize_search_api_key' ) );\n\t\tregister_setting( $this->option_group, 'algolia_api_key', array( $this, 'sanitize_api_key' ) );\n\t\tregister_setting( $this->option_group, 'algolia_index_name_prefix', array( $this, 'sanitize_index_name_prefix' ) );\n\t\tregister_setting( $this->option_group, 'algolia_powered_by_enabled', array( $this, 'sanitize_powered_by_enabled' ) );\n\t\tregister_setting( $this->option_group, 'algolia_insights_enabled', array( $this, 'sanitize_insights_enabled' ) );\n\t}\n\n\t/**\n\t * Application ID callback.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function application_id_callback() {\n\n\t\t$settings      = $this->plugin->get_settings();\n\t\t$setting       = $settings->get_application_id();\n\t\t$disabled_html = $settings->is_application_id_in_config() ? ' disabled' : '';\n\t\t?>\n\t\t<input type=\"text\" name=\"algolia_application_id\" class=\"regular-text\" value=\"<?php echo esc_attr( $setting ); ?>\" <?php echo esc_html( $disabled_html ); ?>/>\n\t\t<p class=\"description\" id=\"home-description\">\n\t\t\t<?php esc_html_e( 'Your Algolia Application ID.', 'wp-search-with-algolia' ); ?>\n\t\t</p>\n\t\t<?php\n\t}\n\n\t/**\n\t * Search API key callback.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function search_api_key_callback() {\n\t\t$settings      = $this->plugin->get_settings();\n\t\t$setting       = $settings->get_search_api_key();\n\t\t$disabled_html = $settings->is_search_api_key_in_config() ? ' disabled' : '';\n\n\t\t?>\n\t\t<input type=\"text\" name=\"algolia_search_api_key\" class=\"regular-text\" value=\"<?php echo esc_attr( $setting ); ?>\" <?php echo esc_html( $disabled_html ); ?>/>\n\t\t<p class=\"description\" id=\"home-description\">\n\t\t\t<?php esc_html_e( 'Your Algolia Search API key (public).', 'wp-search-with-algolia' ); ?>\n\t\t</p>\n\t\t<?php\n\t}\n\n\t/**\n\t * Admin API key callback.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function api_key_callback() {\n\t\t$settings      = $this->plugin->get_settings();\n\t\t$setting       = $settings->get_api_key();\n\t\t$disabled_html = $settings->is_api_key_in_config() ? ' disabled' : '';\n\t\t?>\n\t\t<input type=\"password\" name=\"algolia_api_key\" class=\"regular-text\" value=\"<?php echo esc_attr( $setting ); ?>\" <?php echo esc_html( $disabled_html ); ?>/>\n\t\t<p class=\"description\" id=\"home-description\">\n\t\t\t<?php esc_html_e( 'Your Algolia ADMIN API key (kept private).', 'wp-search-with-algolia' ); ?>\n\t\t</p>\n\t\t<?php\n\t}\n\n\t/**\n\t * Index name prefix callback.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function index_name_prefix_callback() {\n\t\t$settings          = $this->plugin->get_settings();\n\t\t$index_name_prefix = $settings->get_index_name_prefix();\n\t\t$disabled_html     = $settings->is_index_name_prefix_in_config() ? ' disabled' : '';\n\t\t?>\n\t\t<input type=\"text\" name=\"algolia_index_name_prefix\" value=\"<?php echo esc_attr( $index_name_prefix ); ?>\" <?php echo esc_html( $disabled_html ); ?>/>\n\t\t<p class=\"description\" id=\"home-description\"><?php esc_html_e( 'This prefix will be prepended to your index names.', 'wp-search-with-algolia' ); ?></p>\n\t\t<?php\n\t}\n\n\t/**\n\t * Powered by enabled callback.\n\t *\n\t * @author Richard Aber <richard.aber@webdevstudios.com>\n\t * @since  2020-07-24\n\t */\n\tpublic function powered_by_enabled_callback() {\n\t\t$powered_by_enabled = $this->plugin->get_settings()->is_powered_by_enabled();\n\t\t$checked            = '';\n\t\tif ( ! $powered_by_enabled ) {\n\t\t\t$checked = ' checked';\n\t\t}\n\t\techo \"<input type='checkbox' name='algolia_powered_by_enabled' value='no' \" . esc_html( $checked ) . ' />' .\n\t\t\t'<p class=\"description\" id=\"home-description\">' . esc_html( __( 'This will remove the Algolia logo from the autocomplete and the search page. Algolia requires that you keep the logo if you are using a free plan.', 'wp-search-with-algolia' ) ) . '</p>';\n\t}\n\n\t/**\n\t * Insights enabled callback.\n\t *\n\t * @since 2.10.2\n\t */\n\tpublic function insights_enabled_callback() {\n\t\t$insights_enabled = $this->plugin->get_settings()->is_insights_enabled();\n\t\t$checked          = '';\n\t\tif ( $insights_enabled ) {\n\t\t\t$checked = ' checked';\n\t\t}\n\t\techo \"<input type='checkbox' name='algolia_insights_enabled' value='yes' \" . esc_html( $checked ) . ' />' .\n\t\t\t'<p class=\"description\" id=\"home-description\">' . esc_html( __( 'This will enable insights and events tracking to help boost your Algolia results.', 'wp-search-with-algolia' ) ) . '</p>';\n\t}\n\n\t/**\n\t * Sanitize application ID.\n\t *\n\t * @author Richard Aber <richard.aber@webdevstudios.com>\n\t * @since  2020-07-24\n\t *\n\t * @param string $value The value to sanitize.\n\t *\n\t * @return string\n\t */\n\tpublic function sanitize_application_id( $value ) {\n\t\tif ( $this->plugin->get_settings()->is_application_id_in_config() ) {\n\t\t\t$value = $this->plugin->get_settings()->get_application_id();\n\t\t}\n\t\t$value = sanitize_text_field( $value );\n\n\t\tif ( empty( $value ) ) {\n\t\t\tadd_settings_error(\n\t\t\t\t$this->option_group,\n\t\t\t\t'empty',\n\t\t\t\tesc_html__( 'Application ID should not be empty.', 'wp-search-with-algolia' )\n\t\t\t);\n\n\t\t}\n\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Sanitize search API key.\n\t *\n\t * @author Richard Aber <richard.aber@webdevstudios.com>\n\t * @since  2020-07-24\n\t *\n\t * @param string $value The value to sanitize.\n\t *\n\t * @return string\n\t */\n\tpublic function sanitize_search_api_key( $value ) {\n\t\tif ( $this->plugin->get_settings()->is_search_api_key_in_config() ) {\n\t\t\t$value = $this->plugin->get_settings()->get_search_api_key();\n\t\t}\n\t\t$value = sanitize_text_field( $value );\n\n\t\tif ( empty( $value ) ) {\n\t\t\tadd_settings_error(\n\t\t\t\t$this->option_group,\n\t\t\t\t'empty',\n\t\t\t\tesc_html__( 'Search API key should not be empty.', 'wp-search-with-algolia' )\n\t\t\t);\n\t\t}\n\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Sanitize Admin API key.\n\t *\n\t * @author Richard Aber <richard.aber@webdevstudios.com>\n\t * @since  2020-07-24\n\t *\n\t * @param string $value The value to sanitize.\n\t *\n\t * @return string\n\t */\n\tpublic function sanitize_api_key( $value ) {\n\t\tif ( $this->plugin->get_settings()->is_api_key_in_config() ) {\n\t\t\t$value = $this->plugin->get_settings()->get_api_key();\n\t\t}\n\t\t$value = sanitize_text_field( $value );\n\n\t\tif ( empty( $value ) ) {\n\t\t\tadd_settings_error(\n\t\t\t\t$this->option_group,\n\t\t\t\t'empty',\n\t\t\t\tesc_html__( 'API key should not be empty', 'wp-search-with-algolia' )\n\t\t\t);\n\t\t}\n\n\t\t$errors = get_settings_errors( $this->option_group );\n\n\t\t// @todo Not 100% clear why this is returning here.\n\t\tif ( ! empty( $errors ) ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\t$settings = $this->plugin->get_settings();\n\n\t\t$valid_credentials = true;\n\t\ttry {\n\t\t\tAlgolia_API::assert_valid_credentials( $settings->get_application_id(), $value );\n\t\t} catch ( Exception $exception ) {\n\t\t\t$valid_credentials = false;\n\t\t\tadd_settings_error(\n\t\t\t\t$this->option_group,\n\t\t\t\t'login_exception',\n\t\t\t\t$exception->getMessage()\n\t\t\t);\n\t\t}\n\n\t\tif ( ! $valid_credentials ) {\n\t\t\tadd_settings_error(\n\t\t\t\t$this->option_group,\n\t\t\t\t'no_connection',\n\t\t\t\tesc_html__(\n\t\t\t\t\t'We were unable to authenticate you against the Algolia servers with the provided information. Please ensure that you used a valid Application ID and Admin API key.',\n\t\t\t\t\t'wp-search-with-algolia'\n\t\t\t\t)\n\t\t\t);\n\t\t\t$settings->set_api_is_reachable( false );\n\t\t} else {\n\t\t\tif ( ! Algolia_API::is_valid_search_api_key( $settings->get_application_id(), $settings->get_search_api_key() ) ) {\n\t\t\t\tadd_settings_error(\n\t\t\t\t\t$this->option_group,\n\t\t\t\t\t'wrong_search_API_key',\n\t\t\t\t\tesc_html__(\n\t\t\t\t\t\t'It looks like your search API key is wrong. Ensure that the key you entered has only the search capability and nothing else. Also ensure that the key has no limited time validity.',\n\t\t\t\t\t\t'wp-search-with-algolia'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$settings->set_api_is_reachable( false );\n\t\t\t} else {\n\t\t\t\tadd_settings_error(\n\t\t\t\t\t$this->option_group,\n\t\t\t\t\t'connection_success',\n\t\t\t\t\tesc_html__( 'Connection to the Algolia servers was succesful! Configure your Search Page to start using Algolia!', 'wp-search-with-algolia' ),\n\t\t\t\t\t'updated'\n\t\t\t\t);\n\t\t\t\t$settings->set_api_is_reachable( true );\n\t\t\t}\n\t\t}\n\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Determine if the index name prefix is valid.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string $index_name_prefix The index name prefix.\n\t *\n\t * @return bool\n\t */\n\tpublic function is_valid_index_name_prefix( $index_name_prefix ) {\n\t\t$to_validate = str_replace( '_', '', $index_name_prefix );\n\n\t\treturn ctype_alnum( $to_validate );\n\t}\n\n\t/**\n\t * Sanitize the index name prefix.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string $value The value to sanitize.\n\t *\n\t * @return bool|mixed|string|void\n\t */\n\tpublic function sanitize_index_name_prefix( $value ) {\n\t\tif ( $this->plugin->get_settings()->is_index_name_prefix_in_config() ) {\n\t\t\t$value = $this->plugin->get_settings()->get_index_name_prefix();\n\t\t}\n\n\t\tif ( $this->is_valid_index_name_prefix( $value ) ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\tadd_settings_error(\n\t\t\t$this->option_group,\n\t\t\t'wrong_prefix',\n\t\t\tesc_html__( 'Indices prefix can only contain alphanumeric characters and underscores.', 'wp-search-with-algolia' )\n\t\t);\n\n\t\t$value = get_option( 'algolia_index_name_prefix' );\n\n\t\treturn $this->is_valid_index_name_prefix( $value ) ? $value : 'wp_';\n\t}\n\n\t/**\n\t * Sanitize the powered by enabled setting.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string $value The value to sanitize.\n\t *\n\t * @return string\n\t */\n\tpublic function sanitize_powered_by_enabled( $value ) {\n\t\treturn 'no' === $value ? 'no' : 'yes';\n\t}\n\n\t/**\n\t * Sanitize the insights enabled setting.\n\t *\n\t * @since 2.10.2\n\t *\n\t * @param string $value The value to sanitize.\n\t *\n\t * @return string\n\t */\n\tpublic function sanitize_insights_enabled( $value ) {\n\t\treturn 'yes' === $value ? 'yes' : 'no';\n\t}\n\n\t/**\n\t * Display the page.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function display_page() {\n\t\trequire_once dirname( __FILE__ ) . '/partials/form-options.php';\n\t}\n\n\t/**\n\t * Display errors.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function display_errors() {\n\t\tsettings_errors( $this->option_group );\n\t}\n\n\t/**\n\t * Print the settings section.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function print_section_settings() {\n\t\techo '<p>' .\n\t\t\twp_kses(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: URL to API keys section in Algolia dashboard.\n\t\t\t\t\t__( 'Configure your Algolia account credentials. You can find them in the <a href=\"%s\" target=\"_blank\">API Keys</a> section of your Algolia dashboard.', 'wp-search-with-algolia' ),\n\t\t\t\t\t'https://dashboard.algolia.com/account/api-keys/all'\n\t\t\t\t),\n\t\t\t\t[\n\t\t\t\t\t'a' => [\n\t\t\t\t\t\t'href'   => [],\n\t\t\t\t\t\t'target' => [],\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t) . '</p>';\n\t\t// translators: the placeholder contains the URL to Algolia's website.\n\t\techo '<p>' . wp_kses_post( sprintf( __( 'No Algolia account yet? <a href=\"%s\">Follow this link</a> to create one for free in a couple of minutes!', 'wp-search-with-algolia' ), 'https://dashboard.algolia.com/users/sign_up' ) ) . '</p>';\n\n\t\techo '<p>' . esc_html__( 'Once you provide your Algolia Application ID and API key, this plugin will be able to securely communicate with Algolia servers.', 'wp-search-with-algolia' ) . '<br/>' . esc_html__( 'We ensure your information is correct by testing them against the Algolia servers upon save.', 'wp-search-with-algolia' ) . '</p>';\n\t\t?>\n\t\t<a href=\"https://dashboard.algolia.com/account/api-keys/all\" target=\"_blank\"><?php esc_html_e( 'Manage your Algolia API Keys', 'wp-search-with-algolia' ); ?></a>\n\t\t<?php\n\t}\n}\n"
  },
  {
    "path": "includes/admin/class-algolia-admin-page-woocommerce.php",
    "content": "<?php\n/**\n * Algolia_Admin_Page_WooCommerce class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   2.5.0\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Admin_Page_WooCommerce\n *\n * @since 2.5.0\n */\nclass Algolia_Admin_Page_WooCommerce {\n\n\t/**\n\t * Admin page slug.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.5.0\n\t * @var string\n\t */\n\tprivate $slug = 'algolia-account-woocommerce';\n\n\t/**\n\t * Admin page capabilities.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.5.0\n\t * @var string\n\t */\n\tprivate $capability = 'manage_options';\n\n\t/**\n\t * Admin page section.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.5.0\n\t * @var string\n\t */\n\tprivate $section = 'algolia_section_woocommerce';\n\n\t/**\n\t * Admin page option group.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.5.0\n\t * @var string\n\t */\n\tprivate $option_group = 'algolia_settings';\n\n\t/**\n\t * The Algolia_Plugin instance.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.5.0\n\t * @var Algolia_Plugin\n\t */\n\tprivate $plugin;\n\n\t/**\n\t * Algolia_Admin_Page_WooCommerce constructor.\n\t *\n\t * @param Algolia_Plugin $plugin The Algolia_Plugin instance.\n\t *\n\t * @since  2.5.0\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t */\n\tpublic function __construct( Algolia_Plugin $plugin ) {\n\t\t$this->plugin = $plugin;\n\n\t\tadd_action( 'admin_menu', [ $this, 'add_page' ] );\n\t\tadd_action( 'admin_init', [ $this, 'add_settings' ] );\n\t}\n\n\t/**\n\t * Add admin menu page.\n\t *\n\t * @return string|void The resulting page's hook_suffix.\n\t * @since  2.5.0\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t */\n\tpublic function add_page() {\n\t\t$api = $this->plugin->get_api();\n\t\tif ( ! $api->is_reachable() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tadd_submenu_page(\n\t\t\t'algolia',\n\t\t\tesc_html__( 'WooCommerce', 'wp-search-with-algolia' ),\n\t\t\tsprintf(\n\t\t\t\t// translators: Placeholders are just for HTML markup that doesn't need translated.\n\t\t\t\tesc_html__( 'WooCommerce %s', 'wp-search-with-algolia' ),\n\t\t\t\tsprintf(\n\t\t\t\t\t'<span class=\"algolia-pro-indicator\">%s</span>',\n\t\t\t\t\tesc_html__( 'Pro', 'wp-search-with-algolia' )\n\t\t\t\t)\n\t\t\t),\n\t\t\t$this->capability,\n\t\t\t$this->slug,\n\t\t\t[ $this, 'display_page' ]\n\t\t);\n\t}\n\n\t/**\n\t * Add settings.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.5.0\n\t */\n\tpublic function add_settings() {\n\t\tadd_settings_section(\n\t\t\t$this->section,\n\t\t\tnull,\n\t\t\t[ $this, 'print_section_settings' ],\n\t\t\t$this->slug\n\t\t);\n\t}\n\n\t/**\n\t * Display the page.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.5.0\n\t */\n\tpublic function display_page() {\n\t\trequire_once dirname( __FILE__ ) . '/partials/form-options-woocommerce.php';\n\t}\n\n\t/**\n\t * Print the settings section.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.5.0\n\t */\n\tpublic function print_section_settings() {\n\n\t}\n}\n"
  },
  {
    "path": "includes/admin/class-algolia-admin-template-notices.php",
    "content": "<?php\n/**\n * Algolia_Admin_Template_Notices class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.8.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Admin_Template_Notices\n *\n * @since 1.8.0\n */\nclass Algolia_Admin_Template_Notices {\n\n\t/**\n\t * Algolia_Admin_Template_Notices constructor.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.8.0\n\t */\n\tpublic function __construct() {\n\t\tadd_action( 'admin_notices', [ $this, 'template_version_notices' ] );\n\t}\n\n\t/**\n\t * Display template version discrepencany notices.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.8.0\n\t *\n\t * @return void\n\t */\n\tpublic function template_version_notices() {\n\n\t\t$core_template_paths = Algolia_Template_Utils::get_core_template_paths();\n\n\t\t$custom_template_paths = Algolia_Template_Utils::get_custom_template_paths();\n\n\t\tif ( empty( $custom_template_paths ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$core_template_versions = [];\n\n\t\t$custom_template_versions = [];\n\n\t\tforeach ( $custom_template_paths as $filename => $file_path ) {\n\t\t\t$core_template_versions[ $filename ]   = Algolia_Template_Utils::get_template_version(\n\t\t\t\t$core_template_paths[ $filename ]\n\t\t\t);\n\t\t\t$custom_template_versions[ $filename ] = Algolia_Template_Utils::get_template_version(\n\t\t\t\t$file_path\n\t\t\t);\n\t\t}\n\n\t\tforeach ( $custom_template_versions as $filename => $file_version ) {\n\t\t\t// Error if versions do not match, or custom template version unknown.\n\t\t\tif ( version_compare( $file_version, $core_template_versions[ $filename ], '!=' ) ) {\n\t\t\t\t$error_notices[] = sprintf(\n\t\t\t\t\t// translators: placeholder 1 is template filename, placeholder 2 is custom template version, placeholder 3 is core template version.\n\t\t\t\t\tesc_html__(\n\t\t\t\t\t\t'Your custom WP Search With Algolia template file, %1$s, version %2$s is out of date. The core version is %3$s',\n\t\t\t\t\t\t'wp-search-with-algolia'\n\t\t\t\t\t),\n\t\t\t\t\t$filename,\n\t\t\t\t\t! empty( $file_version ) ? $file_version : __( 'unknown', 'wp-search-with-algolia' ),\n\t\t\t\t\t$core_template_versions[ $filename ]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $error_notices ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $error_notices as $error_notice ) {\n\t\t\techo '<div class=\"notice notice-error\"><p>' . esc_html( $error_notice ) . '</p></div>';\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/admin/class-algolia-admin.php",
    "content": "<?php\n/**\n * Algolia_Admin class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n// phpcs:disable Squiz.Commenting.FunctionCommentThrowTag.WrongNumber -- We're using RuntimeException.\n\n/**\n * Class Algolia_Admin\n *\n * @since 1.0.0\n */\nclass Algolia_Admin {\n\n\t/**\n\t * The Algolia Plugin.\n\t *\n\t * @since   1.0.0\n\t *\n\t * @var Algolia_Plugin\n\t */\n\tprivate $plugin;\n\n\t/**\n\t * Algolia_Admin constructor.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param Algolia_Plugin $plugin The Algolia Plugin.\n\t */\n\tpublic function __construct( Algolia_Plugin $plugin ) {\n\t\t$this->plugin = $plugin;\n\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles' ) );\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'localize_scripts' ) );\n\n\t\t$api = $plugin->get_api();\n\t\tif ( $api->is_reachable() ) {\n\t\t\tnew Algolia_Admin_Page_Autocomplete( $plugin->get_settings(), $this->plugin->get_autocomplete_config() );\n\t\t\tnew Algolia_Admin_Page_Native_Search( $plugin );\n\n\t\t\tadd_action( 'wp_ajax_algolia_re_index', array( $this, 're_index' ) );\n\t\t\tadd_action( 'wp_ajax_algolia_push_settings', array( $this, 'push_settings' ) );\n\n\t\t\t$maybe_get_page = filter_input( INPUT_GET, 'page', FILTER_SANITIZE_SPECIAL_CHARS );\n\t\t\tif ( ! empty( $maybe_get_page ) && 'algolia' === substr( $maybe_get_page, 0, 7 ) ) {\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'display_reindexing_notices' ) );\n\t\t\t}\n\t\t}\n\n\t\tnew Algolia_Admin_Template_Notices();\n\n\t\tnew Algolia_Admin_Page_Settings( $plugin );\n\n\t\tnew Algolia_Admin_Page_WooCommerce( $plugin );\n\t\tnew Algolia_Admin_Page_SEO( $plugin );\n\t\tnew Algolia_Admin_Page_Premium_Support( $plugin );\n\n\t\tadd_action( 'admin_notices', array( $this, 'display_unmet_requirements_notices' ) );\n\n\t\tadd_filter( 'admin_footer_text', array( $this, 'algolia_footer' ) );\n\t\tadd_action( 'admin_menu', [ $this, 'add_pro_menu_item' ], 1000 );\n\t\tadd_action( 'admin_init', [ $this, 'handle_pro_redirect' ] );\n\t}\n\n\t/**\n\t * Enqueue styles.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t */\n\tpublic function enqueue_styles() {\n\t\twp_enqueue_style( 'algolia-admin', plugin_dir_url( __FILE__ ) . 'css/algolia-admin.css', array(), ALGOLIA_VERSION );\n\t}\n\n\t/**\n\t * Enqueue scripts.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t */\n\tpublic function enqueue_scripts() {\n\t\twp_enqueue_script(\n\t\t\t'algolia-admin',\n\t\t\tplugin_dir_url( __FILE__ ) . 'js/algolia-admin.js',\n\t\t\tarray( 'jquery', 'jquery-ui-sortable' ),\n\t\t\tALGOLIA_VERSION,\n\t\t\tfalse\n\t\t);\n\t\twp_enqueue_script(\n\t\t\t'algolia-admin-reindex-button',\n\t\t\tplugin_dir_url( __FILE__ ) . 'js/reindex-button.js',\n\t\t\tarray( 'jquery' ),\n\t\t\tALGOLIA_VERSION,\n\t\t\tfalse\n\t\t);\n\t\twp_enqueue_script(\n\t\t\t'algolia-admin-push-settings-button',\n\t\t\tplugin_dir_url( __FILE__ ) . 'js/push-settings-button.js',\n\t\t\tarray( 'jquery' ),\n\t\t\tALGOLIA_VERSION,\n\t\t\tfalse\n\t\t);\n\t}\n\n\t/**\n\t * Add localize strings to scripts.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.2.0\n\t */\n\tpublic function localize_scripts() {\n\n\t\twp_localize_script(\n\t\t\t'algolia-admin-push-settings-button',\n\t\t\t'algoliaPushSettingsButton',\n\t\t\tarray(\n\t\t\t\t'pushBtnAlert' => esc_html__( 'Warning: Pushing settings will override the settings in the Algolia dashboard. Do you want to continue?', 'wp-search-with-algolia' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Displays an error notice for every unmet requirement.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @return void\n\t */\n\tpublic function display_unmet_requirements_notices() {\n\t\tif ( ! extension_loaded( 'mbstring' ) ) {\n\t\t\techo '<div class=\"error notice\">\n\t\t\t\t\t  <p>' . esc_html__( 'Algolia Search requires the \"mbstring\" PHP extension to be enabled. Please contact your hosting provider.', 'wp-search-with-algolia' ) . '</p>\n\t\t\t\t  </div>';\n\t\t} elseif ( ! function_exists( 'mb_ereg_replace' ) ) {\n\t\t\techo '<div class=\"error notice\">\n\t\t\t\t\t  <p>' . esc_html__( 'Algolia needs \"mbregex\" NOT to be disabled. Please contact your hosting provider.', 'wp-search-with-algolia' ) . '</p>\n\t\t\t\t  </div>';\n\t\t}\n\n\t\tif ( ! extension_loaded( 'curl' ) ) {\n\t\t\techo '<div class=\"error notice\">\n\t\t\t\t\t  <p>' . esc_html__( 'Algolia Search requires the \"cURL\" PHP extension to be enabled. Please contact your hosting provider.', 'wp-search-with-algolia' ) . '</p>\n\t\t\t\t  </div>';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$this->w3tc_notice();\n\t}\n\n\t/**\n\t * Display notice to help users adding 'algolia_' as an ignored query string to the db caching configuration.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @return void\n\t */\n\tpublic function w3tc_notice() {\n\t\tif ( ! function_exists( 'w3tc_pgcache_flush' ) || ! function_exists( 'w3_instance' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$config   = w3_instance( 'W3_Config' );\n\t\t$enabled  = $config->get_integer( 'dbcache.enabled' );\n\t\t$settings = array_map( 'trim', $config->get_array( 'dbcache.reject.sql' ) );\n\n\t\tif ( $enabled && ! in_array( 'algolia_', $settings, true ) ) {\n\t\t\t// translators: placeholder contains the URL to the caching plugin's config page.\n\t\t\t$message = sprintf( __( 'In order for <strong>database caching</strong> to work with Algolia you must add <code>algolia_</code> to the \"Ignored Query Stems\" option in W3 Total Cache settings <a href=\"%s\">here</a>.', 'wp-search-with-algolia' ), esc_url( admin_url( 'admin.php?page=w3tc_dbcache' ) ) );\n\t\t\t?>\n\t\t\t<div class=\"error\">\n\t\t\t\t<p><?php echo wp_kses_post( $message ); ?></p>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t}\n\n\t/**\n\t * Display reindexing notices.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t */\n\tpublic function display_reindexing_notices() {\n\t\t$indices = $this->plugin->get_indices(\n\t\t\tarray(\n\t\t\t\t'enabled' => true,\n\t\t\t)\n\t\t);\n\n\t\t$allowed_html = array(\n\t\t\t'strong' => array(),\n\t\t);\n\n\t\tforeach ( $indices as $index ) {\n\t\t\tif ( $index->exists() ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t?>\n\t\t\t<div class=\"error\">\n\t\t\t\t<p>\n\t\t\t\t\t<?php\n\t\t\t\t\techo wp_kses(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t// translators: placeholder is an Algolia index name.\n\t\t\t\t\t\t\t__( 'For Algolia search to work properly, you need to index: <strong>%1$s</strong>', 'wp-search-with-algolia' ),\n\t\t\t\t\t\t\tesc_html( $index->get_admin_name() )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t$allowed_html\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t\t<p>\n\t\t\t\t\t<button class=\"algolia-reindex-button button button-primary\" data-index=\"<?php echo esc_attr( $index->get_id() ); ?>\">\n\t\t\t\t\t\t<?php esc_html_e( 'Index now', 'wp-search-with-algolia' ); ?>\n\t\t\t\t\t</button>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t}\n\n\t/**\n\t * Re index.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @throws RuntimeException If index ID or page are not provided, or index name dies not exist.\n\t * @throws Exception If index ID or page are not provided, or index name dies not exist.\n\t */\n\tpublic function re_index() {\n\n\t\t$index_id = filter_input( INPUT_POST, 'index_id', FILTER_SANITIZE_SPECIAL_CHARS );\n\t\t$page     = filter_input( INPUT_POST, 'p', FILTER_SANITIZE_SPECIAL_CHARS );\n\n\t\ttry {\n\t\t\tif ( empty( $index_id ) ) {\n\t\t\t\tthrow new RuntimeException( 'Index ID should be provided.' );\n\t\t\t}\n\n\t\t\tif ( ! ctype_digit( $page ) ) {\n\t\t\t\tthrow new RuntimeException( 'Page should be provided.' );\n\t\t\t}\n\t\t\t$page = (int) $page;\n\n\t\t\t$index = $this->plugin->get_index( $index_id );\n\t\t\tif ( null === $index ) {\n\t\t\t\tthrow new RuntimeException( sprintf( 'Index named %s does not exist.', $index_id ) );\n\t\t\t}\n\n\t\t\t$total_pages = $index->get_re_index_max_num_pages();\n\n\t\t\tob_start();\n\t\t\tif ( $page <= $total_pages || 0 === $total_pages ) {\n\t\t\t\t$index->re_index( $page );\n\t\t\t}\n\t\t\tob_end_clean();\n\n\t\t\t$response = array(\n\t\t\t\t'totalPagesCount' => $total_pages,\n\t\t\t\t'finished'        => $page >= $total_pages,\n\t\t\t);\n\n\t\t\twp_send_json( $response );\n\t\t} catch ( Exception $exception ) {\n\t\t\twp_send_json_error( array( 'message' => $exception->getMessage() ) );\n\t\t}\n\t}\n\n\t/**\n\t * Push settings.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @throws RuntimeException If index_id is not provided or if the corresponding index is null.\n\t * @throws Exception If index_id is not provided or if the corresponding index is null.\n\t */\n\tpublic function push_settings() {\n\n\t\t$index_id = filter_input( INPUT_POST, 'index_id', FILTER_SANITIZE_SPECIAL_CHARS );\n\n\t\ttry {\n\t\t\tif ( empty( $index_id ) ) {\n\t\t\t\tthrow new RuntimeException( 'index_id should be provided.' );\n\t\t\t}\n\n\t\t\t$index = $this->plugin->get_index( $index_id );\n\t\t\tif ( null === $index ) {\n\t\t\t\tthrow new RuntimeException( sprintf( 'Index named %s does not exist.', $index_id ) );\n\t\t\t}\n\n\t\t\t$index->push_settings();\n\n\t\t\t$response = array(\n\t\t\t\t'success' => true,\n\t\t\t);\n\t\t\twp_send_json( $response );\n\t\t} catch ( Exception $exception ) {\n\t\t\twp_send_json_error( array( 'message' => $exception->getMessage() ) );\n\t\t}\n\t}\n\n\t/**\n\t * Display footer links and plugin credits.\n\t *\n\t * @since 0.3.0\n\t *\n\t * @internal\n\t *\n\t * @param string $original Original footer content. Optional. Default empty string.\n\t * @return string $value HTML for footer.\n\t */\n\tpublic function algolia_footer( $original = '' ) {\n\n\t\t$screen = get_current_screen();\n\n\t\tif ( ! is_object( $screen ) || 'algolia' !== $screen->parent_base ) {\n\t\t\treturn $original;\n\t\t}\n\n\t\treturn sprintf(\n\t\t\t// translators: Placeholder will hold the name of the plugin, version of the plugin and a link to WebdevStudios.\n\t\t\tesc_attr__( '%1$s version %2$s by %3$s', 'wp-search-with-algolia' ),\n\t\t\tesc_attr__( 'WP Search with Algolia', 'wp-search-with-algolia' ),\n\t\t\tALGOLIA_VERSION,\n\t\t\t'<a href=\"https://webdevstudios.com\" target=\"_blank\" rel=\"noopener\">WebDevStudios</a>'\n\t\t) . ' - ' .\n\t\tsprintf(\n\t\t\t// translators: Placeholders are just for HTML markup that doesn't need translated.\n\t\t\t'<a href=\"https://wordpress.org/support/plugin/wp-search-with-algolia/\" target=\"_blank\" rel=\"noopener\">%s</a>',\n\t\t\tesc_attr__( 'Support', 'wp-search-with-algolia' )\n\t\t) . ' - ' .\n\t\tsprintf(\n\t\t\t// translators: Placeholders are just for HTML markup that doesn't need translated.\n\t\t\t'<a href=\"https://wordpress.org/plugins/wp-search-with-algolia/#reviews\" target=\"_blank\" rel=\"noopener\">%s</a>',\n\t\t\tesc_attr__( 'Review', 'wp-search-with-algolia' )\n\t\t) . ' - ' .\n\t\tsprintf(\n\t\t\t// translators: Placeholders are just for HTML markup that doesn't need translated.\n\t\t\t'<a href=\"https://pluginize.com/plugins/wp-search-with-algolia-pro/\" target=\"_blank\" rel=\"noopener\"><strong>%s</strong></a>',\n\t\t\tesc_attr__( 'Go Pro', 'wp-search-with-algolia' )\n\t\t) . ' - ' .\n\t\tesc_attr__( 'Follow on X:', 'wp-search-with-algolia' ) .\n\t\tsprintf(\n\t\t\t// translators: Placeholders are just for HTML markup that doesn't need translated.\n\t\t\t' %s',\n\t\t\t'<a href=\"https://x.com/webdevstudios\" target=\"_blank\" rel=\"noopener\">WebDevStudios</a>'\n\t\t);\n\t}\n\n\t/**\n\t * Add an \"Upgrade to Pro\" submenu link.\n\t *\n\t * @internal\n\t *\n\t * @since 2.5.0\n\t */\n\tpublic function add_pro_menu_item() {\n\t\tglobal $submenu;\n\n\t\t$submenu['algolia'][] = [ // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- Only real way to modify in this way.\n\t\t\t'<span class=\"algolia-menu-highlight\">' . esc_html__( 'Upgrade to Pro', 'wp-search-with-algolia' ) . '</span>',\n\t\t\t'manage_options',\n\t\t\twp_nonce_url(\n\t\t\t\tadd_query_arg(\n\t\t\t\t\t[\n\t\t\t\t\t\t'page'                => 'algolia-account-settings',\n\t\t\t\t\t\t'algolia-pro-upgrade' => wp_create_nonce( 'algolia-pro-nonce' ),\n\t\t\t\t\t],\n\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t'admin.php'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t];\n\t}\n\n\t/**\n\t * Handle redirect to purchase WP Search with Algolia Pro link click.\n\t *\n\t * @since 2.5.0\n\t */\n\tpublic function handle_pro_redirect() {\n\t\tif ( isset( $_GET['algolia-pro-upgrade'] ) && wp_verify_nonce( $_GET['algolia-pro-upgrade'], 'algolia-pro-nonce' ) ) {\n\t\t\twp_redirect( 'https://pluginize.com/plugins/wp-search-with-algolia-pro/' ); // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect\n\t\t\texit();\n\t\t}\n\t}\n}\n\n// phpcs:enable Squiz.Commenting.FunctionCommentThrowTag.WrongNumber -- We're using RuntimeException.\n"
  },
  {
    "path": "includes/admin/css/algolia-admin.css",
    "content": "/**\n * All of the CSS for your admin-specific functionality should be\n * included in this file.\n */\n\n/*\n * https://algolia.frontify.com/document/1?#/basics/colors\n */\n:root {\n  --algolia-white: #fff;\n  --algolia-gray: #f5f5fa;\n  --algolia-blue: #003dff;\n  --algolia-blue-lighten: #07f;\n  --algolia-dark-blue: #003;\n  --algolia-neon: #ceff00;\n}\n\n.form-table .table-autocomplete th {\n  padding: 8px 10px !important;\n}\n\n.form-table .table-autocomplete {\n  width: auto;\n}\n\n.table-autocomplete .dashicons-move {\n  cursor: pointer;\n}\n\n/* Native search page */\nform .input-radio label {\n  font-weight: bold;\n}\nform .radio-info {\n  margin-bottom: 15px;\n  padding-left: 25px;\n}\n\n#toplevel_page_algolia .algolia-pro-indicator {\n  background-color: var(--algolia-blue);\n  border-radius: 3px;\n  color: var(--algolia-white);\n  font-size: 10px;\n  padding: 2px 3px;\n  vertical-align: text-top;\n}\n.algolia-menu-highlight {\n  color: var(--algolia-white);\n}\n#toplevel_page_algolia .algolia-submenu-highlight {\n  background-color: var(--algolia-blue);\n  font-weight: bold;\n}\n\n.algolia-pro-cta {\n  background-color: var(--algolia-white);\n  left: 50%;\n  margin-top: 0;\n  max-width: 850px;\n  padding: 30px 20px 40px;\n  position: absolute;\n  text-align: center;\n  top: 50px;\n  transform: translate(-50%) translateY(0);\n  width: 100%;\n}\n.algolia-pro-cta .algolia-pro-title {\n  color: #41495b;\n  font-size: 46px;\n  font-weight: 800;\n  line-height: 58px;\n  margin: 0 auto;\n  max-width: 600px;\n}\n.algolia-pro-cta .algolia-pro-desc {\n  color: #41495b;\n  font-size: 22px;\n  font-weight: 500;\n  line-height: 27px;\n  margin: 20px auto 20px;\n  max-width: 560px;\n}\n.algolia-pro-cta .algolia-pro-button {\n  background-color: var(--algolia-blue);\n  border-bottom: 0;\n  border-radius: 4px;\n  color: var(--algolia-white);\n  cursor: pointer;\n  display: inline-block;\n  font-size: 24px;\n  font-weight: 700;\n  line-height: 26px;\n  padding: 15px 40px;\n  text-decoration: none;\n}\n.algolia-pro-cta .algolia-pro-button:hover {\n  background-color: var(--algolia-blue-lighten);\n}\n.algolia-pro-cta .algolia-pro-more {\n  display: block;\n  font-size: 14px;\n  margin-top: 15px;\n  position: relative;\n  text-align: center;\n}\n.algolia-pro-cta .algolia-pro-more a {\n  color: var(--algolia-blue);\n  display: inline-block;\n  font-size: 14px;\n  font-style: italic;\n  outline: none;\n  text-decoration: none;\n}\n.algolia-pro-cta .algolia-pro-more a:hover {\n  color: var(--algolia-blue-lighten);\n}\n.algolia-pro-cta .algolia-pro-features {\n  display: flex;\n  gap: 40px;\n  justify-content: center;\n  margin: 20px auto 40px;\n  text-align: left;\n}\n.algolia-pro-cta .algolia-pro-features h4 {\n  font-size: 18px;\n  margin: 12px;\n}\n.algolia-pro-cta .algolia-pro-feature {\n  align-items: center;\n  display: flex;\n}\n.algolia-pro-cta .algolia-pro-feature svg {\n  padding-right: 4px;\n}\n.algolia-premium-wrap-block {\n  display: flex;\n  flex-direction: column;\n  gap: 20px;\n  justify-content: space-between;\n}\n.algolia-premium-support-block {\n  text-align: center;\n}\n.algolia-premium-support-block.algolia-pro-block {\n  text-align: left;\n}\n.wds-premium {\n  background: var(--algolia-blue);\n  color: var(--algolia-white);\n  padding: 10px;\n  border-radius: 9999px;\n  text-decoration: none;\n}\n.wds-premium:hover {\n  color: var(--algolia-white);\n}\n.algolia-flex {\n  align-items: center;\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: center;\n}\n.algolia-flex-item {\n  padding: 5px 10px;\n}\n.algolia-pro-flex-wrap {\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-between;\n  align-content: space-between;\n  gap: 10px;\n}\n.algolia-pro-flex-item {\n  border-color: var(--algolia-blue);\n  border-radius: 15px;\n  flex: 1;\n  width: 33%;\n}\n.algolia-pro-features {\n  padding-left: 15px;\n}\n.algolia-pro-features li {\n  list-style: disc;\n}\n"
  },
  {
    "path": "includes/admin/css/index.php",
    "content": "<?php // Silence is golden\n"
  },
  {
    "path": "includes/admin/fonts/index.php",
    "content": "<?php // Silence is golden\n"
  },
  {
    "path": "includes/admin/img/index.php",
    "content": "<?php // Silence is golden\n"
  },
  {
    "path": "includes/admin/index.php",
    "content": "<?php // Silence is golden\n"
  },
  {
    "path": "includes/admin/js/algolia-admin.js",
    "content": "(function( $ ) {\n\t'use strict';\n\n\t$(\n\t\tfunction() {\n\n\t\t\tfunction updateAutocompletePositions () {\n\t\t\t\t$( '.table-autocomplete .position-input' ).each(\n\t\t\t\t\tfunction(index, value) {\n\t\t\t\t\t\t$( value ).val( index );\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t\t$( '.table-autocomplete tbody' ).sortable(\n\t\t\t\t{\n\t\t\t\t\tupdate: function() {\n\t\t\t\t\t\tupdateAutocompletePositions();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tfunction submenuHighlight () {\n\t\t\t\tlet menu = document.querySelector('#toplevel_page_algolia')\n\t\t\t\tif (!menu) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tlet children = menu.querySelectorAll('.wp-submenu li')\n\t\t\t\tchildren.forEach(child => {\n\t\t\t\t\tlet link = child.querySelector('a')\n\t\t\t\t\tif (!link) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tlet linkChild = link.querySelector('.algolia-menu-highlight')\n\t\t\t\t\tif (linkChild) {\n\t\t\t\t\t\tchild.classList.add('algolia-submenu-highlight')\n\n\t\t\t\t\t\tlet link = child.querySelector('a')\n\t\t\t\t\t\tif (link) {\n\t\t\t\t\t\t\tlink.setAttribute('target', '_blank')\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tsubmenuHighlight();\n\t\t}\n\t);\n})( jQuery );\n"
  },
  {
    "path": "includes/admin/js/index.php",
    "content": "<?php // Silence is golden\n"
  },
  {
    "path": "includes/admin/js/push-settings-button.js",
    "content": "(function($) {\n\n\t/* global algoliaPushSettingsButton */\n\n\t$(\n\t\tfunction() {\n\t\t\tvar $buttons = $( '.algolia-push-settings-button' );\n\t\t\t$buttons.on( 'click', handleButtonClick );\n\t\t}\n\t);\n\n\tfunction handleButtonClick(e) {\n\t\t$clickedButton = $( e.currentTarget );\n\t\tvar index      = $clickedButton.data( 'index' );\n\t\tif ( ! index) {\n\t\t\tthrow new Error( 'Clicked button has no \"data-index\" set.' );\n\t\t}\n\n\t\tif ( ! window.confirm( algoliaPushSettingsButton.pushBtnAlert ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdisableButton( $clickedButton );\n\n\t\tpushSettings( $clickedButton, index );\n\t}\n\n\tfunction disableButton($button) {\n\t\t$button.prop( 'disabled', true );\n\t}\n\n\tfunction enableButton($button) {\n\t\t$button.prop( 'disabled', false );\n\t}\n\n\tfunction pushSettings($clickedButton, index) {\n\n\t\tvar data = {\n\t\t\t'action': 'algolia_push_settings',\n\t\t\t'index_id': index\n\t\t};\n\n\t\t$.post(\n\t\t\tajaxurl, data, function(response) {\n\t\t\t\tif (typeof response.success === 'undefined') {\n\t\t\t\t\talert( 'An error occurred' );\n\t\t\t\t\tenableButton( $clickedButton );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talert( 'Settings correctly pushed for index: ' + index );\n\t\t\t\tenableButton( $clickedButton );\n\t\t\t}\n\t\t).fail(\n\t\t\tfunction(response) {\n\t\t\t\talert( 'An error occurred: ' + response.responseText );\n\t\t\t\tenableButton( $clickedButton );\n\t\t\t}\n\t\t);\n\t}\n\n})( jQuery );\n"
  },
  {
    "path": "includes/admin/js/reindex-button.js",
    "content": "(function($) {\n\n\t$(\n\t\tfunction() {\n\t\t\tvar $reindexButtons = $( '.algolia-reindex-button' );\n\t\t\t$reindexButtons.on( 'click', handleReindexButtonClick );\n\t\t}\n\t);\n\n\tvar ongoing = 0;\n\n\t$( window ).on(\n\t\t'beforeunload', function() {\n\t\t\tif (ongoing > 0) {\n\t\t\t\treturn 'If you leave now, re-indexing tasks in progress will be aborted';\n\t\t\t}\n\t\t}\n\t);\n\n\tfunction handleReindexButtonClick(e) {\n\n\t\t$clickedButton = $( e.currentTarget );\n\t\tvar index      = $clickedButton.data( 'index' );\n\t\tif ( ! index) {\n\t\t\tthrow new Error( 'Clicked button has no \"data-index\" set.' );\n\t\t}\n\n\t\tongoing++;\n\n\t\t$clickedButton.attr( 'disabled', 'disabled' );\n\t\t$clickedButton.data( 'originalText', $clickedButton.text() );\n\t\tupdateIndexingPourcentage( $clickedButton, 0 );\n\n\t\treIndex( $clickedButton, index );\n\t}\n\n\tfunction updateIndexingPourcentage($clickedButton, amount) {\n\t\t$clickedButton.text( 'Processing, please be patient ... ' + amount + '%' );\n\t}\n\n\tfunction reIndex($clickedButton, index, currentPage) {\n\t\tif ( ! currentPage) {\n\t\t\tcurrentPage = 1;\n\t\t}\n\n\t\tvar data = {\n\t\t\t'action': 'algolia_re_index',\n\t\t\t'index_id': index,\n\t\t\t'p': currentPage\n\t\t};\n\n\t\t$.post(\n\t\t\tajaxurl, data, function(response) {\n\t\t\t\tif (typeof response.totalPagesCount === 'undefined') {\n\t\t\t\t\talert( 'An error occurred' );\n\t\t\t\t\tresetButton( $clickedButton );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (response.totalPagesCount === 0) {\n\t\t\t\t\t$clickedButton.parents( '.error' ).fadeOut();\n\t\t\t\t\tresetButton( $clickedButton );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tprogress = Math.round( (currentPage / response.totalPagesCount) * 100 );\n\t\t\t\tupdateIndexingPourcentage( $clickedButton, progress );\n\n\t\t\t\tif (response.finished !== true) {\n\t\t\t\t\treIndex( $clickedButton, index, ++currentPage );\n\t\t\t\t} else {\n\t\t\t\t\t$clickedButton.parents( '.error' ).fadeOut();\n\t\t\t\t\tresetButton( $clickedButton );\n\t\t\t\t}\n\t\t\t}\n\t\t).fail(\n\t\t\tfunction(response) {\n\t\t\t\talert( 'An error occurred: ' + response.responseText );\n\t\t\t\tresetButton( $clickedButton );\n\t\t\t}\n\t\t);\n\t}\n\n\tfunction resetButton($clickedButton) {\n\t\tongoing--;\n\t\t$clickedButton.text( $clickedButton.data( 'originalText' ) );\n\t\t$clickedButton.removeAttr( 'disabled' );\n\t\t$clickedButton.data( 'currentPage', 1 );\n\t}\n\n})( jQuery );\n"
  },
  {
    "path": "includes/admin/partials/form-options-premium-support.php",
    "content": "<?php\n/**\n * Form options admin template partial.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   2.5.0\n * @package WebDevStudios\\WPSWA\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n?>\n\n<div class=\"wrap about-wrap\">\n\t<h1>\n\t\t<?php echo esc_html( get_admin_page_title() ); ?>\n\t</h1>\n\t<div class=\"algolia-premium-wrap-block\">\n\t\t<div class=\"algolia-premium-support-block\">\n\t\t\t<p>\n\t\t\t\t<?php esc_html_e( 'Thank you for using WP Search with Algolia to enhance your website\\'s search experience. We are happy to have you as a user.', 'wp-search-with-algolia' ); ?>\n\t\t\t</p>\n\t\t</div>\n\n\t\t<div class=\"algolia-premium-support-block\">\n\t\t\t<h2><?php esc_html_e( 'Seeking help?', 'wp-search-with-algolia' ); ?></h2>\n\t\t\t<p>\n\t\t\t\t<?php esc_html_e( 'Our premium support and integration services ensure a seamless implementation of Algolia into your WordPress site. Whether you’re running a blog, eCommerce platform, or enterprise-level application, we’ll handle every detail—from setup and configuration to advanced customizations that match your unique needs.', 'wp-search-with-algolia' ); ?>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<?php esc_html_e( 'At WebDevStudios, we’re not just delivering tools—we’re empowering you with a scalable, high-performing search experience. Ready to elevate your WordPress website? Let’s make it happen!', 'wp-search-with-algolia' ); ?>\n\t\t\t</p>\n\t\t</div>\n\n\t\t<div class=\"algolia-premium-support-block\">\n\t\t\t<h2><?php esc_html_e( 'Ready to work with us?', 'wp-search-with-algolia' ); ?></h2>\n\t\t\t<div class=\"algolia-flex\">\n\t\t\t\t<div class=\"algolia-flex-item\">\n\t\t\t\t\t<p><a class=\"wds-premium\" href=\"https://webdevstudios.com/contact/\" target=\"_blank\" rel=\"noopener\"><?php esc_html_e( 'Contact WebDevStudios', 'wp-search-with-algolia' ); ?></a>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"algolia-premium-support-block algolia-pro-block\">\n\t\t\t<h2><a href=\"https://pluginize.com/plugins/wp-search-with-algolia-pro/\" target=\"_blank\"><?php esc_html_e( 'WP Search with Algolia Pro', 'wp-search-with-algolia' ); ?></a></h2>\n\t\t\t<div class=\"algolia-pro-flex-wrap\">\n\t\t\t\t<div class=\"algolia-pro-flex-item card\">\n\t\t\t\t\t<h3><?php esc_html_e( 'Multisite Indexing', 'wp-search-with-algolia' ); ?></h3>\n\t\t\t\t\t<ul class=\"algolia-pro-features\">\n\t\t\t\t\t\t<li><?php esc_html_e( 'Multisite network indexing into a single search index to provide a global Algolia-powered search experience.', 'wp-search-with-algolia' ); ?></li>\n\t\t\t\t\t\t<li><?php esc_html_e( 'Easily search all sites in your Multisite network with a single search experience!', 'wp-search-with-algolia' ); ?></li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"algolia-pro-flex-item card\">\n\t\t\t\t\t<h3><?php esc_html_e( 'WooCommerce Support', 'wp-search-with-algolia' ); ?></h3>\n\t\t\t\t\t<ul class=\"algolia-pro-features\">\n\t\t\t\t\t\t<li><?php esc_html_e( 'Index product SKUs, prices, short descriptions and product dimensions/weight for display.', 'wp-search-with-algolia' ); ?>'</li>\n\t\t\t\t\t\t<li><?php esc_html_e( 'Index product total sales ratings for relevance.', 'wp-search-with-algolia' ); ?></li>\n\t\t\t\t\t\t<li><?php esc_html_e( 'Index product total and average ratings for relevance.', 'wp-search-with-algolia' ); ?></li>\n\t\t\t\t\t\t<li><?php esc_html_e( 'Control whether or not sold out products are indexed.', 'wp-search-with-algolia' ); ?></li>\n\t\t\t\t\t\t<li><?php esc_html_e( 'Control whether or not \"shop only\" or \"hidden\" products are indexed.', 'wp-search-with-algolia' ); ?></li>\n\t\t\t\t\t\t<li><?php esc_html_e( 'Amend indexing to only include WooCommerce products.', 'wp-search-with-algolia' ); ?></li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"algolia-pro-flex-item card\">\n\t\t\t\t\t<h3><?php esc_html_e( 'Search Engine Optimization', 'wp-search-with-algolia' ); ?></h3>\n\t\t\t\t\t<ul class=\"algolia-pro-features\">\n\t\t\t\t\t\t<li><?php esc_html_e( 'Fine tune indexing on selected pieces of content', 'wp-search-with-algolia' ); ?></li>\n\t\t\t\t\t\t<li><?php esc_html_e( 'Yoast SEO', 'wp-search-with-algolia' ); ?></li>\n\t\t\t\t\t\t<li><?php esc_html_e( 'All in One SEO', 'wp-search-with-algolia' ); ?></li>\n\t\t\t\t\t\t<li><?php esc_html_e( 'Rank Math SEO', 'wp-search-with-algolia' ); ?></li>\n\t\t\t\t\t\t<li><?php esc_html_e( 'SEOPress', 'wp-search-with-algolia' ); ?></li>\n\t\t\t\t\t\t<li><?php esc_html_e( 'The SEO Framework Support', 'wp-search-with-algolia' ); ?></li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n"
  },
  {
    "path": "includes/admin/partials/form-options-seo.php",
    "content": "<?php\n/**\n * Form options admin template partial.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   2.5.0\n * @package WebDevStudios\\WPSWA\n */\n\n?>\n\n<div class=\"wrap\">\n\t<h1>\n\t\t<?php esc_html_e( 'WP Search with Algolia and Search Engine Optimization', 'wp-search-with-algolia' ); ?>\n\t</h1>\n\t<img style=\"max-width: 100%;\" src=\"<?php echo esc_url( ALGOLIA_PLUGIN_URL . 'includes/admin/img/algolia-pro-seo.jpg' ); ?>\" alt=\"<?php esc_attr_e( 'Blurry representiation of features available with WP Search with Algolia Pro.', 'wp-search-with-algolia' ); ?>\" />\n\t<?php echo Algolia_Utils::pro_cta_content(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>\n</div>\n"
  },
  {
    "path": "includes/admin/partials/form-options-woocommerce.php",
    "content": "<?php\n/**\n * Form options admin template partial.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   2.5.0\n * @package WebDevStudios\\WPSWA\n */\n\n?>\n\n<div class=\"wrap\">\n\t<h1>\n\t\t<?php esc_html_e( 'WP Search with Algolia and WooCommerce', 'wp-search-with-algolia' ); ?>\n\t</h1>\n\t<img style=\"max-width: 100%;\" src=\"<?php echo esc_url( ALGOLIA_PLUGIN_URL . 'includes/admin/img/algolia-pro-woocommerce.jpg' ); ?>\" alt=\"<?php esc_attr_e( 'Blurry representiation of features available with WP Search with Algolia Pro.', 'wp-search-with-algolia' ); ?>\" />\n\t<?php echo Algolia_Utils::pro_cta_content(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>\n</div>\n"
  },
  {
    "path": "includes/admin/partials/form-options.php",
    "content": "<?php\n/**\n * Form options admin template partial.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n?>\n\n<div class=\"wrap\">\n\t<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>\n\t<?php if ( ! has_action( 'wpswa_pro_override_settings_output' ) ) : ?>\n\t\t<form method=\"post\" action=\"options.php\">\n\t\t\t<?php\n\t\t\tsettings_fields( $this->option_group );\n\t\t\tdo_settings_sections( $this->slug );\n\t\t\tsubmit_button();\n\t\t\t?>\n\t\t</form>\n\t<?php else : ?>\n\t\t<?php\n\t\t/**\n\t\t * Allows for custom output of settings page content.\n\t\t *\n\t\t * Most specifically used for WP Search with Algolia Pro\n\t\t *\n\t\t * @since 2.5.2\n\t\t */\n\t\tdo_action( 'wpswa_pro_override_settings_output' ); ?>\n\t<?php endif; ?>\n</div>\n"
  },
  {
    "path": "includes/admin/partials/form-override-search-option.php",
    "content": "<?php\n/**\n * Form override search option admin template partial.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n?>\n\n<div class=\"input-radio\">\n\t<label>\n\t\t<input type=\"radio\" value=\"native\"\n\t\t\tname=\"algolia_override_native_search\" <?php checked( $value, 'native' ); ?>>\n\t\t<?php esc_html_e( 'Do not use Algolia', 'wp-search-with-algolia' ); ?>\n\t</label>\n\t<div class=\"radio-info\">\n\t\t<?php\n\t\techo wp_kses(\n\t\t\t__(\n\t\t\t\t'Do not use Algolia for any search. This option disables the search integration completely.',\n\t\t\t\t'wp-search-with-algolia'\n\t\t\t),\n\t\t\t[\n\t\t\t\t'br' => [],\n\t\t\t]\n\t\t);\n\t\t?>\n\t</div>\n\n\t<label>\n\t\t<input type=\"radio\" value=\"backend\"\n\t\t\tname=\"algolia_override_native_search\" <?php checked( $value, 'backend' ); ?>>\n\t\t<?php esc_html_e( 'Use Algolia with the native WordPress search template', 'wp-search-with-algolia' ); ?>\n\t</label>\n\t<div class=\"radio-info\">\n\t\t<?php\n\t\techo wp_kses(\n\t\t\t__(\n\t\t\t\t'Search results will be powered by Algolia and will use the standard WordPress search template for displaying the results.<br/>This option has the advantage to play nicely with any theme but does not support filtering and displaying InstantSearch results.',\n\t\t\t\t'wp-search-with-algolia'\n\t\t\t),\n\t\t\t[\n\t\t\t\t'br' => [],\n\t\t\t\t'b'  => [],\n\t\t\t]\n\t\t);\n\t\t?>\n\t</div>\n\n\t<label>\n\t\t<input type=\"radio\" value=\"instantsearch\"\n\t\t\tname=\"algolia_override_native_search\" <?php checked( $value, 'instantsearch' ); ?>>\n\t\t<?php esc_html_e( 'Use Algolia with Instantsearch.js', 'wp-search-with-algolia' ); ?>\n\t</label>\n\t<div class=\"radio-info\">\n\t\t<?php\n\t\techo wp_kses(\n\t\t\t__(\n\t\t\t\t'This will replace the WordPress search page with an InstantSearch experience powered by Algolia.<br/>By default you will be able to filter by post type, categories, tags and authors.',\n\t\t\t\t'wp-search-with-algolia'\n\t\t\t),\n\t\t\t[\n\t\t\t\t'br' => [],\n\t\t\t]\n\t\t);\n\t\t?>\n\t</div>\n</div>\n"
  },
  {
    "path": "includes/admin/partials/form-override-search-version-option.php",
    "content": "<?php\n/**\n * Form override search option admin template partial.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   2.9.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n?>\n\n<div class=\"input-radio\">\n\t<label>\n\t\t<input type=\"radio\" value=\"legacy\"\n\t\t\tname=\"algolia_instantsearch_template_version\" <?php checked( $value, 'legacy' ); ?>>\n\t\t<?php esc_html_e( 'Legacy (instantsearch.php)', 'wp-search-with-algolia' ); ?>\n\t</label>\n\t<div class=\"radio-info\">\n\t\t<?php\n\t\techo wp_kses(\n\t\t\t__(\n\t\t\t\t'Utilizes WP Utils library.',\n\t\t\t\t'wp-search-with-algolia'\n\t\t\t),\n\t\t\t[\n\t\t\t\t'br' => [],\n\t\t\t]\n\t\t);\n\t\t?>\n\t</div>\n\n\t<label>\n\t\t<input type=\"radio\" value=\"modern\"\n\t\t\tname=\"algolia_instantsearch_template_version\" <?php checked( $value, 'modern' ); ?>>\n\t\t<?php esc_html_e( 'Modern (instantsearch-modern.php)', 'wp-search-with-algolia' ); ?>\n\t</label>\n\t<div class=\"radio-info\">\n\t\t<?php\n\t\techo wp_kses(\n\t\t\t__(\n\t\t\t\t'Uses Javascript template string literals and is more in line with Algolia documentation.',\n\t\t\t\t'wp-search-with-algolia'\n\t\t\t),\n\t\t\t[\n\t\t\t\t'br' => [],\n\t\t\t]\n\t\t);\n\t\t?>\n\t</div>\n\t<p><strong><?php esc_html_e( 'Leave on current setting if you have InstantSearch customized via files in your active theme.', 'wp-search-with-algolia' ); ?></strong></p>\n</div>\n"
  },
  {
    "path": "includes/admin/partials/index.php",
    "content": "<?php // Silence is golden\n"
  },
  {
    "path": "includes/admin/partials/page-autocomplete-config.php",
    "content": "<?php\n/**\n * Autocomplete config admin template partial.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n?>\n\n<p class=\"description\" id=\"home-description\">\n\t<?php esc_html_e( 'Configure the indices you want to display in the autocomplete search dropdown menu.', 'wp-search-with-algolia' ); ?>\n\t<br />\n\t<?php esc_html_e( 'Use the `Max. Suggestions` column to configure the number of results displayed by section.', 'wp-search-with-algolia' ); ?>\n\t<br />\n\t<?php esc_html_e( 'Use drag and drop to control the order of the sections in the autocomplete search dropdown menu.', 'wp-search-with-algolia' ); ?>\n</p>\n<table class=\"widefat table-autocomplete striped\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th style=\"width: 20px;\"></th>\n\t\t\t<th style=\"width: 75px;\"><?php esc_html_e( 'Enable', 'wp-search-with-algolia' ); ?></th>\n\t\t\t<th><?php esc_html_e( 'Index', 'wp-search-with-algolia' ); ?></th>\n\t\t\t<th><?php esc_html_e( 'Label', 'wp-search-with-algolia' ); ?></th>\n\t\t\t<th style=\"width: 75px;\"><?php esc_html_e( 'Max. Suggestions', 'wp-search-with-algolia' ); ?></th>\n\t\t\t<th><?php esc_html_e( 'Actions', 'wp-search-with-algolia' ); ?></th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t<?php\n\t\t$prefix = $this->settings->get_index_name_prefix(); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound\n\t\tforeach ( $indices as $index ) : // phpcs:ignore -- This is an admin partial.  ?>\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t<span class=\"dashicons dashicons-move\"></span>\n\t\t\t\t<input type=\"hidden\" class=\"position-input\" name=\"algolia_autocomplete_config[<?php echo esc_attr( $index['index_id'] ); ?>][position]\"  value=\"<?php echo (int) $index['position']; ?>\" />\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<input type=\"checkbox\" name=\"algolia_autocomplete_config[<?php echo esc_attr( $index['index_id'] ); ?>][enabled]\" <?php echo $index['enabled'] ? 'checked=\"checked\"' : ''; ?>/>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<?php echo esc_html( $index['admin_name'] ); ?><br>\n\t\t\t\t<small>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t// translators: placeholder is the name of an Algolia search index.\n\t\t\t\t\t\tesc_html__( 'Index name: %s', 'wp-search-with-algolia' ),\n\t\t\t\t\t\tesc_html( $index['index_id'] )\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t</small><br/>\n\t\t\t\t<small>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t// translators: placeholder is the name of an Algolia search index.\n\t\t\t\t\t\tesc_html__( 'Prefixed: %1$s%2$s', 'wp-search-with-algolia' ),\n\t\t\t\t\t\tesc_html( $prefix ),\n\t\t\t\t\t\tesc_html( $index['index_id'] )\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t</small>\n\t\t\t\t<?php if ( ! empty( $index['debounce'] ) && $index['debounce'] > 0 ) : ?>\n\t\t\t\t\t<br /><small>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t// translators: placeholder is the custom debounce value.\n\t\t\t\t\t\t\tesc_html__( 'Custom debounce timing: %s ms', 'wp-search-with-algolia' ),\n\t\t\t\t\t\t\tesc_html( $index['debounce'] )\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t</small>\n\t\t\t\t<?php endif; ?>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<input type=\"text\" name=\"algolia_autocomplete_config[<?php echo esc_attr( $index['index_id'] ); ?>][label]\"  value=\"<?php echo esc_attr( $index['label'] ); ?>\" />\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<input type=\"number\" class=\"small-text\" name=\"algolia_autocomplete_config[<?php echo esc_attr( $index['index_id'] ); ?>][max_suggestions]\"  value=\"<?php echo (int) $index['max_suggestions']; ?>\" />\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<button type=\"button\" class=\"algolia-reindex-button button button-primary\" data-index=\"<?php echo esc_attr( $index['index_id'] ); ?>\"><?php esc_html_e( 'Re-index', 'wp-search-with-algolia' ); ?></button>\n\t\t\t\t<button type=\"button\" class=\"algolia-push-settings-button button\" data-index=\"<?php echo esc_attr( $index['index_id'] ); ?>\"><?php esc_html_e( 'Push Settings', 'wp-search-with-algolia' ); ?></button>\n\t\t\t</td>\n\t\t</tr>\n\t\t<?php endforeach; ?>\n\t</tbody>\n</table>\n<p class=\"description\" id=\"home-description\">\n\t<?php esc_html_e( 'Configure the indices you want to display in the autocomplete search dropdown menu.', 'wp-search-with-algolia' ); ?>\n\t<br />\n\t<?php esc_html_e( 'Use the `Max. Suggestions` column to configure the number of results displayed by section.', 'wp-search-with-algolia' ); ?>\n\t<br />\n\t<?php esc_html_e( 'Use drag and drop to control the order of the sections in the autocomplete search dropdown menu.', 'wp-search-with-algolia' ); ?>\n</p>\n"
  },
  {
    "path": "includes/admin/partials/page-autocomplete.php",
    "content": "<?php\n/**\n * Autocomplete admin template partial.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n?>\n\n<div class=\"wrap\">\n\t<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>\n\t<form method=\"post\" action=\"options.php\">\n\t\t<?php\n\t\tsettings_fields( $this->option_group );\n\t\tdo_settings_sections( $this->slug );\n\t\tsubmit_button();\n\t\t?>\n\t</form>\n</div>\n"
  },
  {
    "path": "includes/admin/partials/page-search.php",
    "content": "<?php\n/**\n * Search admin template partial.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n?>\n\n<div class=\"wrap\">\n\t<h1>\n\t\t<?php echo esc_html( get_admin_page_title() ); ?>\n\t\t<button type=\"button\" class=\"algolia-reindex-button button button-primary\" data-index=\"searchable_posts\">\n\t\t\t<?php esc_html_e( 'Re-index All Content', 'wp-search-with-algolia' ); ?>\n\t\t</button>\n\t\t<button type=\"button\" class=\"algolia-push-settings-button button\" data-index=\"searchable_posts\">\n\t\t\t<?php esc_html_e( 'Push Settings', 'wp-search-with-algolia' ); ?>\n\t\t</button>\n\t</h1>\n\t<form method=\"post\" action=\"options.php\">\n\t\t<?php\n\t\tsettings_fields( $this->option_group );\n\t\tdo_settings_sections( $this->slug );\n\t\tsubmit_button();\n\t\t?>\n\t</form>\n</div>\n"
  },
  {
    "path": "includes/class-algolia-api.php",
    "content": "<?php\n/**\n * Algolia_API class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\AlgoliaException;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchClient;\n\n/**\n * Class Algolia_API\n *\n * @since 1.0.0\n */\nclass Algolia_API {\n\n\t/**\n\t * The SearchClient instance.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var SearchClient\n\t */\n\tprivate $client;\n\n\t/**\n\t * The Algolia_Settings instance.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var Algolia_Settings\n\t */\n\tprivate $settings;\n\n\t/**\n\t * Algolia_API constructor.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param Algolia_Settings $settings The Algolia_Settings instance.\n\t */\n\tpublic function __construct( Algolia_Settings $settings ) {\n\t\t$this->settings = $settings;\n\t}\n\n\t/**\n\t * Check if the Aloglia API is reachable.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return bool\n\t */\n\tpublic function is_reachable() {\n\t\tif ( ! $this->settings->get_api_is_reachable() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\t// Here we check that all requirements for the PHP API SearchClient are met.\n\t\t\t// If they are not, instantiating the client will throw exceptions.\n\t\t\t$client = $this->get_client();\n\t\t} catch ( Exception $e ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn null !== $client;\n\t}\n\n\t/**\n\t * Get the SearchClient.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return SearchClient|null\n\t */\n\tpublic function get_client(): ?SearchClient {\n\n\t\t$application_id = $this->settings->get_application_id();\n\t\t$api_key        = $this->settings->get_api_key();\n\n\t\tif (\n\t\t\tempty( $application_id ) ||\n\t\t\tempty( $api_key )\n\t\t) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( null === $this->client ) {\n\t\t\t$this->client = Algolia_Search_Client_Factory::create(\n\t\t\t\t(string) $this->settings->get_application_id(),\n\t\t\t\t(string) $this->settings->get_api_key()\n\t\t\t);\n\t\t}\n\n\t\treturn $this->client;\n\t}\n\n\t/**\n\t * Assert that the credentials are valid.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string $application_id The Algolia Application ID.\n\t * @param string $api_key        The Algolia Admin API Key.\n\t *\n\t * @return void\n\t *\n\t * @throws Exception If the Algolia Admin API Key does not have correct ACLs.\n\t */\n\tpublic static function assert_valid_credentials( $application_id, $api_key ) {\n\n\t\t$client = Algolia_Search_Client_Factory::create(\n\t\t\t(string) $application_id,\n\t\t\t(string) $api_key\n\t\t);\n\n\t\t// This checks if the API Key is an Admin API key.\n\t\t// Admin API keys have no scopes so we need a separate check here.\n\t\ttry {\n\t\t\t$client->listApiKeys();\n\n\t\t\treturn;\n\t\t} catch ( Exception $exception ) { // phpcs:ignore --- intentionally empty catch.\n\t\t}\n\n\t\t// If this call does not succeed, then the application_ID or API_key is/are wrong.\n\t\t// This will raise an exception.\n\t\t$key = $client->getApiKey( (string) $api_key );\n\n\t\t$required_acls = array(\n\t\t\t'addObject',\n\t\t\t'deleteObject',\n\t\t\t'listIndexes',\n\t\t\t'deleteIndex',\n\t\t\t'settings',\n\t\t\t'editSettings',\n\t\t);\n\n\t\t$missing_acls = array();\n\t\tforeach ( $required_acls as $required_acl ) {\n\t\t\tif ( ! in_array( $required_acl, $key['acl'], true ) ) {\n\t\t\t\t$missing_acls[] = $required_acl;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $missing_acls ) ) {\n\t\t\tthrow new Exception(\n\t\t\t\t'Your admin API key is missing the following ACLs: ' . implode( ', ', $missing_acls )\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Check if the credentials are valid.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string $application_id The Algolia Application ID.\n\t * @param string $api_key        The Algolia Admin API Key.\n\t *\n\t * @return bool\n\t */\n\tpublic static function is_valid_credentials( $application_id, $api_key ) {\n\t\ttry {\n\t\t\tself::assert_valid_credentials( $application_id, $api_key );\n\t\t} catch ( Exception $e ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Check if the Search API Key is valid.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string $application_id The Algolia Application ID.\n\t * @param string $search_api_key The Algolia Search API Key.\n\t *\n\t * @return bool\n\t */\n\tpublic static function is_valid_search_api_key( $application_id, $search_api_key ) {\n\n\t\t$client = Algolia_Search_Client_Factory::create(\n\t\t\t(string) $application_id,\n\t\t\t(string) $search_api_key\n\t\t);\n\n\t\t// If this call does not succeed, the application_ID and/or API_key are wrong.\n\t\ttry {\n\t\t\t$acl = $client->getApiKey( $search_api_key );\n\t\t} catch ( AlgoliaException $e ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// We expect a search only key for security reasons. Will be used in front.\n\t\t$scopes = array_flip( $acl['acl'] );\n\t\tif ( ! isset( $scopes['search'] ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tunset( $scopes['search'] );\n\n\t\tif ( isset( $scopes['settings'] ) ) {\n\t\t\tunset( $scopes['settings'] );\n\t\t}\n\n\t\tif ( isset( $scopes['listIndexes'] ) ) {\n\t\t\tunset( $scopes['listIndexes'] );\n\t\t}\n\n\t\tif ( isset( $scopes['browse'] ) ) {\n\t\t\tunset( $scopes['browse'] );\n\t\t}\n\n\t\t// Short circuit ACL checks for local development.\n\t\tif ( defined( 'WP_LOCAL_DEV' ) && WP_LOCAL_DEV ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( ! empty( $scopes ) ) {\n\t\t\t// The API key has more permissions than allowed.\n\t\t\treturn false;\n\t\t}\n\n\t\t// We do expect a search key without unlimited TTL.\n\t\tif ( 0 !== $acl['validity'] ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n}\n"
  },
  {
    "path": "includes/class-algolia-autocomplete-config.php",
    "content": "<?php\n/**\n * Algolia_Autocomplete_Config class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Autocomplete_Config\n *\n * @since 1.0.0\n */\nclass Algolia_Autocomplete_Config {\n\n\t/**\n\t * The Algolia_Plugin instance.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var Algolia_Plugin\n\t */\n\tprivate $plugin;\n\n\t/**\n\t * Algolia_Autocomplete_Config constructor.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param Algolia_Plugin $plugin The Algolia_Plugin instance.\n\t */\n\tpublic function __construct( Algolia_Plugin $plugin ) {\n\t\t$this->plugin = $plugin;\n\t}\n\n\t/**\n\t * Get form data.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return array\n\t */\n\tpublic function get_form_data() {\n\t\t$indices = $this->plugin->get_indices();\n\t\t$config  = array();\n\n\t\t$existing_config = $this->get_config();\n\n\t\t/**\n\t\t * Loop over the indices.\n\t\t *\n\t\t * @author WebDevStudios <contact@webdevstudios.com>\n\t\t * @since  1.0.0\n\t\t *\n\t\t * @var Algolia_Index $index\n\t\t */\n\t\tforeach ( $indices as $index ) {\n\t\t\t$index_config = $this->extract_index_config( $existing_config, $index->get_id() );\n\t\t\tif ( $index_config ) {\n\t\t\t\t// If there is an existing configuration, add it.\n\t\t\t\t$config[] = $index_config;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$default_config            = $index->get_default_autocomplete_config();\n\t\t\t$default_config['enabled'] = false;\n\n\t\t\t$config[] = $default_config;\n\t\t}\n\n\t\tusort(\n\t\t\t$config,\n\t\t\tfunction( $a, $b ):int {\n\t\t\t\treturn $a['position'] <=> $b['position'];\n\t\t\t}\n\t\t);\n\n\t\treturn $config;\n\t}\n\n\t/**\n\t * Sanitize form data.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param array $data The data to sanitize.\n\t *\n\t * @return mixed\n\t */\n\tpublic function sanitize_form_data( $data ) {\n\n\t\tif ( ! is_array( $data ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$sanitized = array();\n\n\t\tforeach ( $data as $index_id => $config ) {\n\t\t\t$index = $this->plugin->get_index( $index_id );\n\n\t\t\t// Remove disabled indices.\n\t\t\tif ( ! isset( $config['enabled'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$merged_config = array_merge(\n\t\t\t\t$index->get_default_autocomplete_config(),\n\t\t\t\tarray(\n\t\t\t\t\t'position'        => (int) $config['position'],\n\t\t\t\t\t'max_suggestions' => (int) $config['max_suggestions'],\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( isset( $config['label'] ) && ! empty( $config['label'] ) ) {\n\t\t\t\t$merged_config['label'] = $config['label'];\n\t\t\t}\n\n\t\t\t$sanitized[] = $merged_config;\n\t\t}\n\n\t\treturn $sanitized;\n\t}\n\n\t/**\n\t * Extract index config.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param array  $config   The config.\n\t * @param string $index_id The index id.\n\t *\n\t * @return mixed|void\n\t */\n\tprivate function extract_index_config( array $config, $index_id ) {\n\t\tforeach ( $config as $entry ) {\n\t\t\tif ( $index_id === $entry['index_id'] ) {\n\t\t\t\treturn $entry;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Get config.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return array\n\t */\n\tpublic function get_config() {\n\t\t$settings = $this->plugin->get_settings();\n\t\t$config   = $settings->get_autocomplete_config();\n\t\tforeach ( $config as $key => &$entry ) {\n\t\t\tif ( ! isset( $entry['index_id'] ) ) {\n\t\t\t\tunset( $config[ $key ] );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$index = $this->plugin->get_index( $entry['index_id'] );\n\t\t\tif ( null === $index ) {\n\t\t\t\tunset( $config[ $key ] );\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$entry['index_name'] = $index->get_name();\n\t\t\t$entry['enabled']    = true;\n\t\t}\n\n\t\t/**\n\t\t * Filters the configuration settings for Autocomplete.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param array $config Array of configuration options to be used with Autocomplete javascript configuration.\n\t\t */\n\t\t$config = (array) apply_filters( 'algolia_autocomplete_config', $config );\n\n\t\t// Remove manually disabled indices.\n\t\t$config = array_filter(\n\t\t\t$config,\n\t\t\tfunction( $item ) {\n\t\t\t\treturn (bool) $item['enabled'];\n\t\t\t}\n\t\t);\n\n\t\t// Sort the indices.\n\t\tusort(\n\t\t\t$config,\n\t\t\tfunction( $a, $b ):int {\n\t\t\t\treturn $a['position'] <=> $b['position'];\n\t\t\t}\n\t\t);\n\n\t\treturn $config;\n\t}\n}\n"
  },
  {
    "path": "includes/class-algolia-cli.php",
    "content": "<?php\n/**\n * Algolia_CLI class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_CLI\n *\n * Push and re-index records into Algolia indices.\n *\n * @since 1.0.0\n */\nclass Algolia_CLI {\n\n\t/**\n\t * The Algolia_Plugin instance.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var Algolia_Plugin\n\t */\n\tprivate $plugin;\n\n\t/**\n\t * Algolia_CLI constructor.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function __construct() {\n\t\t$this->plugin = Algolia_Plugin_Factory::create();\n\t}\n\n\t/**\n\t * Push all records to Algolia for a given index.\n\t *\n\t * ## OPTIONS\n\t *\n\t * [<indexName>]\n\t * : The id of the index without the prefix.\n\t *\n\t * [--clear]\n\t * : Clear all existing records prior to pushing the records.\n\t *\n\t * [--all]\n\t * : Re-indexes all the enabled indices.\n\t *\n\t * [--from_batch=<from_batch>]\n\t * : Re-index starting from the provided batch (instead of the first page).\n\t *\n\t * ## EXAMPLES\n\t *\n\t *     wp algolia re-index\n\t *\n\t * @alias re-index\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param array $args       Positional arguments.\n\t * @param array $assoc_args Associative arguments.\n\t */\n\tpublic function reindex( $args, $assoc_args ) {\n\t\tif ( ! $this->plugin->get_api()->is_reachable() ) {\n\t\t\tWP_CLI::error( 'The configuration for this website does not allow to contact the Algolia API.' );\n\t\t}\n\n\t\t$index_id   = isset( $args[0] ) ? $args[0] : null;\n\t\t$clear      = WP_CLI\\Utils\\get_flag_value( $assoc_args, 'clear' );\n\t\t$all        = WP_CLI\\Utils\\get_flag_value( $assoc_args, 'all' );\n\t\t$from_batch = intval( WP_CLI\\Utils\\get_flag_value( $assoc_args, 'from_batch', 1 ) );\n\n\t\tif ( ! $index_id && ! $all ) {\n\t\t\tWP_CLI::error( 'You need to either provide an index name or specify the --all argument to re-index all enabled indices.' );\n\t\t}\n\n\t\tif ( $index_id && $all ) {\n\t\t\tWP_CLI::error( 'You can not give both an index name and the --all parameter.' );\n\t\t}\n\n\t\tif ( $all ) {\n\t\t\t$indices = $this->plugin->get_indices(\n\t\t\t\tarray(\n\t\t\t\t\t'enabled' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t$index = $this->plugin->get_index( $index_id );\n\t\t\tif ( ! $index ) {\n\t\t\t\tWP_CLI::error( sprintf( 'Index with id \"%s\" does not exist. Make sure you don\\'t include the prefix.', $index_id ) );\n\t\t\t}\n\t\t\t$indices = array( $index );\n\t\t}\n\n\t\tforeach ( $indices as $index ) {\n\t\t\t$this->do_reindex( $index, $clear, $from_batch );\n\t\t}\n\t}\n\n\t/**\n\t * Do reindex.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param Algolia_Index $index Algolia_Index instance.\n\t * @param bool          $clear Clear all existing records prior to pushing the records.\n\t * @param int           $from_batch The batch to start indexing from.\n\t *\n\t * @return void\n\t */\n\tprivate function do_reindex( Algolia_Index $index, $clear, $from_batch ) {\n\n\t\tif ( $clear ) {\n\t\t\t// translators: the placeholder will contain the name of the index.\n\t\t\tWP_CLI::log( sprintf( __( 'About to clear index %s...', 'wp-search-with-algolia' ), $index->get_name() ) );\n\t\t\t$index->clear();\n\t\t\t// translators: the placeholder will contain the name of the index.\n\t\t\tWP_CLI::success( sprintf( __( 'Correctly cleared index \"%s\".', 'wp-search-with-algolia' ), $index->get_name() ) );\n\t\t}\n\n\t\t$total_pages = $index->get_re_index_max_num_pages() - ( $from_batch - 1 );\n\n\t\tif ( 0 > $total_pages ) {\n\t\t\tWP_CLI::error( 'from_batch value for re-indexing is out of bounds.' );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 0 === $total_pages ) {\n\t\t\t$index->re_index( 1 );\n\t\t\tWP_CLI::success( sprintf( 'Index %s was created but no entries were sent.', $index->get_name() ) );\n\n\t\t\treturn;\n\t\t}\n\n\t\t$progress = WP_CLI\\Utils\\make_progress_bar( sprintf( 'Processing %s batches of results.', $total_pages ), $total_pages );\n\n\t\t$page = $from_batch;\n\t\tdo {\n\t\t\tWP_CLI::log( sprintf( 'Indexing batch %s.', $page ) );\n\t\t\t$index->re_index( $page++ );\n\t\t\tWP_CLI::log( sprintf( 'Indexed batch %s.', ( $page - 1 ) ) );\n\t\t\t$progress->tick();\n\t\t} while ( $page <= ( $total_pages + $from_batch - 1 ) );\n\n\t\t$progress->finish();\n\n\t\tWP_CLI::success( sprintf( 'Indexed \"%s\" batches of results inside index \"%s\"', $total_pages, $index->get_name() ) );\n\t}\n}\n"
  },
  {
    "path": "includes/class-algolia-compatibility.php",
    "content": "<?php\n/**\n * Algolia_Compatibility class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\nuse Yoast\\WP\\SEO\\Memoizers\\Meta_Tags_Context_Memoizer;\nuse Yoast\\WP\\SEO\\Surfaces\\Helpers_Surface;\n\n/**\n * Class Algolia_Compatibility\n *\n * @since 1.0.0\n */\nclass Algolia_Compatibility {\n\n\t/**\n\t * The \"current language\" from WPML, if available, else null.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string|null\n\t */\n\tprivate $current_language;\n\n\t/**\n\t * Algolia_Compatibility constructor.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function __construct() {\n\t\tadd_action( 'algolia_before_get_records', array( $this, 'register_vc_shortcodes' ) );\n\t\tadd_action( 'algolia_before_get_records', array( $this, 'enable_yoast_frontend' ) );\n\t\tadd_action( 'algolia_before_get_records', array( $this, 'wpml_switch_language' ) );\n\t\tadd_action( 'algolia_after_get_records', array( $this, 'wpml_switch_back_language' ) );\n\t\tadd_action( 'algolia_excluded_post_types', [ $this, 'woocommerce_post_types' ] );\n\t\tadd_action( 'algolia_excluded_taxonomies', [ $this, 'woocommerce_internal_taxonomies' ] );\n\t\tadd_filter( 'algolia_is_block_theme', [ $this, 'maybe_block_theme' ] );\n\t}\n\n\t/**\n\t * Enable Yoast frontend.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function enable_yoast_frontend() {\n\t\tif ( ! function_exists( 'YoastSEO' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tclass_exists( 'Meta_Tags_Context_Memoizer' ) &&\n\t\t\tclass_exists( 'WPSEO_Replace_Vars' ) &&\n\t\t\tclass_exists( 'Helpers_Surface' )\n\t\t) {\n\t\t\tYoastSEO()->classes->get( Meta_Tags_Context_Memoizer::class );\n\t\t\tYoastSEO()->classes->get( WPSEO_Replace_Vars::class );\n\t\t\tYoastSEO()->classes->get( Helpers_Surface::class );\n\t\t}\n\t}\n\n\t/**\n\t * Register VC shortcodes.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function register_vc_shortcodes() {\n\t\tif ( class_exists( 'WPBMap' ) && method_exists( 'WPBMap', 'addAllMappedShortcodes' ) ) {\n\t\t\tWPBMap::addAllMappedShortcodes();\n\t\t}\n\t}\n\n\t/**\n\t * WPML switch language.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @global \\SitePress $sitepress The WPML global SitePress instance.\n\t *\n\t * @param mixed $post Maybe post object.\n\t *\n\t * @return void\n\t */\n\tpublic function wpml_switch_language( $post ) {\n\t\tif ( ! $post instanceof WP_Post || ! $this->is_wpml_enabled() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tglobal $sitepress;\n\t\t$lang_info              = wpml_get_language_information( null, $post->ID );\n\t\t$this->current_language = $sitepress->get_current_language();\n\t\t$sitepress->switch_lang( $lang_info['language_code'] );\n\t}\n\n\t/**\n\t * WPML switch back language.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @global \\SitePress $sitepress The WPML global SitePress instance.\n\t *\n\t * @param mixed $post Maybe post object.\n\t *\n\t * @return void\n\t */\n\tpublic function wpml_switch_back_language( $post ) {\n\t\tif ( ! $post instanceof WP_Post || ! $this->is_wpml_enabled() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tglobal $sitepress;\n\n\t\t$sitepress->switch_lang( $this->current_language );\n\t}\n\n\t/**\n\t * Check if WPML is enabled.\n\t *\n\t * @link https://github.com/algolia/algoliasearch-wordpress/issues/567\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return bool\n\t */\n\tprivate function is_wpml_enabled() {\n\t\treturn function_exists( 'icl_object_id' ) && ! class_exists( 'Polylang' );\n\t}\n\n\t/**\n\t * Add internal WooCommerce post types to our excluded list on Autocomplete page.\n\t *\n\t * @since 2.10.0\n\t *\n\t * @param array $post_types Array of post types to exclude from listing.\n\t * @return array\n\t */\n\tpublic function woocommerce_post_types( array $post_types ) {\n\t\tif ( ! defined( 'WC_PLUGIN_FILE' ) ) {\n\t\t\treturn $post_types;\n\t\t}\n\n\t\t$post_types[] = 'patterns_ai_data';\n\t\t$post_types[] = 'shop_order';\n\t\t$post_types[] = 'shop_order_placehold';\n\t\t$post_types[] = 'shop_order_refund';\n\t\treturn $post_types;\n\t}\n\n\t/**\n\t * Add internal WooCommerce taxonomies to our excluded list on Autocomplete page.\n\t *\n\t * @since 2.10.0\n\t *\n\t * @param array $taxonomies Array of taxonomies to exclude from listing.\n\t * @return array\n\t */\n\tpublic function woocommerce_internal_taxonomies( array $taxonomies ) {\n\t\tif ( ! defined( 'WC_PLUGIN_FILE' ) ) {\n\t\t\treturn $taxonomies;\n\t\t}\n\n\t\t$taxonomies[] = 'product_visibility';\n\t\t$taxonomies[] = 'product_shipping_class';\n\n\t\treturn $taxonomies;\n\t}\n\n\t/**\n\t * Return whether or not the current theme is block based.\n\t *\n\t * @since 2.10.3\n\t *\n\t * @param bool $maybe_block_theme Whether or not a block theme is active.\n\t * @return bool\n\t */\n\tpublic function maybe_block_theme( $maybe_block_theme ) {\n\t\t// return early if it has already been determined.\n\t\tif ( true === $maybe_block_theme ) {\n\t\t\treturn $maybe_block_theme;\n\t\t}\n\n\t\treturn wp_is_block_theme();\n\t}\n}\n"
  },
  {
    "path": "includes/class-algolia-plugin.php",
    "content": "<?php\n/**\n * Algolia_Plugin class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Plugin\n *\n * @since 1.0.0\n */\nclass Algolia_Plugin {\n\n\tconst NAME = 'algolia';\n\n\t/**\n\t * Instance of Algolia_API.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var Algolia_API\n\t */\n\tprotected $api;\n\n\t/**\n\t * Instance of Algolia_Settings.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var Algolia_Settings\n\t */\n\tprivate $settings;\n\n\t/**\n\t * Instance of Algolia_Autocomplete_Config.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var Algolia_Autocomplete_Config\n\t */\n\tprivate $autocomplete_config;\n\n\t/**\n\t * Array of indices.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var array\n\t */\n\tprivate $indices;\n\n\t/**\n\t * Array of watchers.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var array\n\t */\n\tprivate $changes_watchers;\n\n\t/**\n\t * Instance of Algolia_Styles.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.5.0\n\t *\n\t * @var Algolia_Styles\n\t */\n\tprivate $styles;\n\n\t/**\n\t * Instance of Algolia_Scripts.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.5.0\n\t *\n\t * @var Algolia_Scripts\n\t */\n\tprivate $scripts;\n\n\t/**\n\t * Instance of Algolia_Update_Messages.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.8.0\n\t *\n\t * @var Algolia_Update_Messages\n\t */\n\tprivate $update_messages;\n\n\t/**\n\t * Instance of Algolia_Template_Loader.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var Algolia_Template_Loader\n\t */\n\tprivate $template_loader;\n\n\t/**\n\t * Instance of Algolia_Admin.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.5.4\n\t *\n\t * @var Algolia_Admin\n\t */\n\tpublic $admin;\n\n\t/**\n\t * Instance of Algolia_Compatibility.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var Algolia_Compatibility\n\t */\n\tprivate $compatibility;\n\n\t/**\n\t * Instance of Algoolia_Health_Panel\n\t *\n\t * @since 2.10.0\n\t *\n\t * @var Algolia_Health_Panel\n\t */\n\tprivate $health;\n\n\t/**\n\t * Get the singleton instance of Algolia_Plugin.\n\t *\n\t * @author     WebDevStudios <contact@webdevstudios.com>\n\t * @since      1.0.0\n\t * @deprecated 1.6.0 Use Algolia_Plugin_Factory::create()\n\t * @see        Algolia_Plugin_Factory::create()\n\t *\n\t * @return Algolia_Plugin\n\t */\n\tpublic static function get_instance() {\n\t\t_deprecated_function( __METHOD__, '1.6.0', 'Algolia_Plugin_Factory::create();' );\n\t\treturn Algolia_Plugin_Factory::create();\n\t}\n\n\t/**\n\t * Algolia_Plugin constructor.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function __construct() {\n\t\t$this->settings        = new Algolia_Settings();\n\t\t$this->api             = new Algolia_API( $this->settings );\n\t\t$this->compatibility   = new Algolia_Compatibility();\n\t\t$this->styles          = new Algolia_Styles();\n\t\t$this->scripts         = new Algolia_Scripts();\n\t\t$this->update_messages = new Algolia_Update_Messages();\n\n\t\tadd_action( 'init', array( $this, 'load' ), 20 );\n\t}\n\n\t/**\n\t * Load.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function load() {\n\t\tif ( $this->api->is_reachable() ) {\n\t\t\t$this->load_indices();\n\t\t\t$this->override_wordpress_search();\n\t\t\t$this->autocomplete_config = new Algolia_Autocomplete_Config( $this );\n\t\t\t$this->template_loader     = new Algolia_Template_Loader( $this );\n\t\t}\n\n\t\t// Load admin or public part of the plugin.\n\t\tif ( is_admin() ) {\n\t\t\t$this->admin  = new Algolia_Admin( $this );\n\t\t\t$this->health = new Algolia_Health_Panel( $this );\n\t\t}\n\t}\n\n\t/**\n\t * Get the plugin name.\n\t *\n\t * The name of the plugin used to uniquely identify it within the context of\n\t * WordPress and to define internationalization functionality.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return string The name of the plugin.\n\t */\n\tpublic function get_name() {\n\t\treturn self::NAME;\n\t}\n\n\t/**\n\t * Retrieve the version number of the plugin.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return string The version number of the plugin.\n\t */\n\tpublic function get_version() {\n\t\treturn ALGOLIA_VERSION;\n\t}\n\n\t/**\n\t * Get the Aloglia_API.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return Algolia_API\n\t */\n\tpublic function get_api() {\n\t\treturn $this->api;\n\t}\n\n\t/**\n\t * Get the Algolia_Settings.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return Algolia_Settings\n\t */\n\tpublic function get_settings() {\n\t\treturn $this->settings;\n\t}\n\n\t/**\n\t * Override WordPress native search.\n\t *\n\t * Replaces native WordPress search results by Algolia ranked results.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return void\n\t */\n\tprivate function override_wordpress_search() {\n\t\t// Do not override native search if the feature is not enabled.\n\t\tif ( ! $this->settings->should_override_search_in_backend() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$index_id = $this->settings->get_native_search_index_id();\n\t\t$index    = $this->get_index( $index_id );\n\n\t\tif ( null === $index ) {\n\t\t\treturn;\n\t\t}\n\n\t\tnew Algolia_Search( $index );\n\t}\n\n\t/**\n\t * Get the Algolia_Autocomplete_Config.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return Algolia_Autocomplete_Config\n\t */\n\tpublic function get_autocomplete_config() {\n\t\treturn $this->autocomplete_config;\n\t}\n\n\t/**\n\t * Load indices.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function load_indices() {\n\t\t$synced_indices_ids = $this->settings->get_synced_indices_ids();\n\n\t\t$client            = $this->get_api()->get_client();\n\t\t$index_name_prefix = $this->settings->get_index_name_prefix();\n\n\t\t// Add a searchable posts index.\n\t\t$searchable_post_types = get_post_types(\n\t\t\tarray(\n\t\t\t\t'exclude_from_search' => false,\n\t\t\t),\n\t\t\t'names'\n\t\t);\n\n\t\t/**\n\t\t * Filters the array of searchable post types.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array $searchable_post_types Array of registered post types that are not excluded from search.\n\t\t * @return array $value                 Filtered array of post types.\n\t\t */\n\t\t$searchable_post_types = (array) apply_filters( 'algolia_searchable_post_types', $searchable_post_types );\n\t\t$this->indices[]       = new Algolia_Searchable_Posts_Index( $searchable_post_types );\n\n\t\t// Add one posts index per post type.\n\t\t$post_types = get_post_types();\n\n\t\t$excluded_post_types = $this->settings->get_excluded_post_types();\n\t\tforeach ( $post_types as $post_type ) {\n\t\t\t// Skip excluded post types.\n\t\t\tif ( in_array( $post_type, $excluded_post_types, true ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->indices[] = new Algolia_Posts_Index( $post_type );\n\t\t}\n\n\t\t// Add one terms index per taxonomy.\n\t\t$taxonomies          = get_taxonomies();\n\t\t$excluded_taxonomies = $this->settings->get_excluded_taxonomies();\n\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t// Skip excluded taxonomies.\n\t\t\tif ( in_array( $taxonomy, $excluded_taxonomies, true ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->indices[] = new Algolia_Terms_Index( $taxonomy );\n\t\t}\n\n\t\t// Add the users index.\n\t\t$this->indices[] = new Algolia_Users_Index();\n\n\t\t/**\n\t\t * Filters the array of indices to load.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array $indices Array of indices to load.\n\t\t * @return array $value   Filtered array of indices.\n\t\t */\n\t\t$this->indices = (array) apply_filters( 'algolia_indices', $this->indices );\n\n\t\tforeach ( $this->indices as $index ) {\n\t\t\t$index->set_name_prefix( $index_name_prefix );\n\t\t\t$index->set_client( $client );\n\n\t\t\tif ( in_array( $index->get_id(), $synced_indices_ids, true ) ) {\n\t\t\t\t$index->set_enabled( true );\n\n\t\t\t\tif ( $index->contains_only( 'posts' ) ) {\n\t\t\t\t\t$this->changes_watchers[] = new Algolia_Post_Changes_Watcher( $index );\n\t\t\t\t} elseif ( $index->contains_only( 'terms' ) ) {\n\t\t\t\t\t$this->changes_watchers[] = new Algolia_Term_Changes_Watcher( $index );\n\t\t\t\t} elseif ( $index->contains_only( 'users' ) ) {\n\t\t\t\t\t$this->changes_watchers[] = new Algolia_User_Changes_Watcher( $index );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the array of changes watchers to work with.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array $change_watchers Array of watchers to work with.\n\t\t * @param  array $indices         Array of indices.\n\t\t * @return array $value           Filtered array of watchers.\n\t\t */\n\t\t$this->changes_watchers = (array) apply_filters( 'algolia_changes_watchers', $this->changes_watchers, $this->indices );\n\n\t\tforeach ( $this->changes_watchers as $watcher ) {\n\t\t\t$watcher->watch();\n\t\t}\n\t}\n\n\t/**\n\t * Get indices.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param array $args Array of arguments.\n\t *\n\t * @return array\n\t */\n\tpublic function get_indices( array $args = array() ) {\n\t\tif ( empty( $args ) ) {\n\t\t\treturn $this->indices;\n\t\t}\n\n\t\t$indices = $this->indices;\n\n\t\tif ( isset( $args['enabled'] ) && true === $args['enabled'] ) {\n\t\t\t$indices = array_filter(\n\t\t\t\t$indices,\n\t\t\t\tfunction( $index ) {\n\t\t\t\t\treturn $index->is_enabled();\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tif ( isset( $args['contains'] ) ) {\n\t\t\t$contains = (string) $args['contains'];\n\t\t\t$indices  = array_filter(\n\t\t\t\t$indices,\n\t\t\t\tfunction( $index ) use ( $contains ) {\n\t\t\t\t\treturn $index->contains_only( $contains );\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\treturn $indices;\n\t}\n\n\t/**\n\t * Get index.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string $index_id The ID of the index to get.\n\t *\n\t * @return Algolia_Index|null\n\t */\n\tpublic function get_index( $index_id ) {\n\t\tforeach ( $this->indices as $index ) {\n\t\t\tif ( $index_id === $index->get_id() ) {\n\t\t\t\treturn $index;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the plugin path.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return string\n\t */\n\tpublic function get_path() {\n\t\treturn untrailingslashit( ALGOLIA_PATH );\n\t}\n\n\t/**\n\t * Get the templates path.\n\t *\n\t * Somewhat misleading method name.\n\t * Actually returns a path segment (directory name) with trailing slash.\n\t *\n\t * @author     WebDevStudios <contact@webdevstudios.com>\n\t * @since      1.0.0\n\t * @deprecated 1.8.0 Use Algolia_Template_Utils::get_filtered_theme_templates_dirname()\n\t * @see        Algolia_Template_Utils::get_filtered_theme_templates_dirname()\n\t *\n\t * @return string\n\t */\n\tpublic function get_templates_path() {\n\t\t_deprecated_function(\n\t\t\t__METHOD__,\n\t\t\t'1.8.0',\n\t\t\t'Algolia_Template_Utils::get_filtered_theme_templates_dirname()'\n\t\t);\n\t\treturn (string) Algolia_Template_Utils::get_filtered_theme_templates_dirname();\n\t}\n\n\t/**\n\t * Get the Algolia_Template_Loader.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return Algolia_Template_Loader\n\t */\n\tpublic function get_template_loader() {\n\t\treturn $this->template_loader;\n\t}\n\n\t/**\n\t * Get the Algolia_Styles.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.5.0\n\t *\n\t * @return Algolia_Styles\n\t */\n\tpublic function get_styles() {\n\t\treturn $this->styles;\n\t}\n\n\t/**\n\t * Get the Algolia_Scripts.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.5.0\n\t *\n\t * @return Algolia_Scripts\n\t */\n\tpublic function get_scripts() {\n\t\treturn $this->scripts;\n\t}\n}\n"
  },
  {
    "path": "includes/class-algolia-scripts.php",
    "content": "<?php\n/**\n * Algolia_Scripts class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.5.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Scripts\n *\n * @since 1.5.0\n */\nclass Algolia_Scripts {\n\n\t/**\n\t * Algolia_Scripts constructor.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.5.0\n\t */\n\tpublic function __construct() {\n\t\tadd_action( 'wp_enqueue_scripts', [ $this, 'register_scripts' ] );\n\t}\n\n\t/**\n\t * Register scripts.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.5.0\n\t */\n\tpublic function register_scripts() {\n\n\t\t$in_footer = Algolia_Utils::get_scripts_in_footer_argument();\n\n\t\t$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';\n\n\t\t$ais_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG\n\t\t\t? '.development'\n\t\t\t: '.production';\n\n\t\twp_register_script(\n\t\t\t'algolia-search',\n\t\t\tALGOLIA_PLUGIN_URL . 'js/algoliasearch/dist/algoliasearch-lite.umd.js',\n\t\t\t[\n\t\t\t\t'underscore',\n\t\t\t\t'wp-util',\n\t\t\t],\n\t\t\tALGOLIA_VERSION,\n\t\t\t$in_footer\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'algolia-autocomplete',\n\t\t\tALGOLIA_PLUGIN_URL . 'js/autocomplete.js/dist/autocomplete' . $suffix . '.js',\n\t\t\t[\n\t\t\t\t'underscore',\n\t\t\t\t'wp-util',\n\t\t\t\t'algolia-search',\n\t\t\t],\n\t\t\tALGOLIA_VERSION,\n\t\t\t$in_footer\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'algolia-autocomplete-noconflict',\n\t\t\tALGOLIA_PLUGIN_URL . 'js/autocomplete-noconflict.js',\n\t\t\t[\n\t\t\t\t'algolia-autocomplete',\n\t\t\t],\n\t\t\tALGOLIA_VERSION,\n\t\t\t$in_footer\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'algolia-instantsearch',\n\t\t\tALGOLIA_PLUGIN_URL . 'js/instantsearch.js/dist/instantsearch' . $ais_suffix . $suffix . '.js',\n\t\t\t[\n\t\t\t\t'underscore',\n\t\t\t\t'wp-util',\n\t\t\t\t'algolia-search',\n\t\t\t],\n\t\t\tALGOLIA_VERSION,\n\t\t\t$in_footer\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "includes/class-algolia-search.php",
    "content": "<?php\n/**\n * Algolia_Search class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\AlgoliaException;\n\n/**\n * Class Algolia_Search\n *\n * @since 1.0.0\n */\nclass Algolia_Search {\n\n\t/**\n\t * Current page hits.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var array\n\t */\n\tprivate $current_page_hits = [];\n\n\t/**\n\t * Total hits.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var int\n\t */\n\tprivate $total_hits;\n\n\t/**\n\t * Instance of Algolia_Index.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var Algolia_Index\n\t */\n\tprivate $index;\n\n\t/**\n\t * Algolia_Search constructor.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param Algolia_Index $index Instance of Algolia_Index.\n\t */\n\tpublic function __construct( Algolia_Index $index ) {\n\t\t$this->index = $index;\n\n\t\tadd_action( 'loop_start', [ $this, 'begin_highlighting' ] );\n\t\tadd_action( 'pre_get_posts', array( $this, 'pre_get_posts' ) );\n\t\tadd_action( 'wp_head', [ $this, 'output_highlighting_bundled_styles' ] );\n\t}\n\n\t/**\n\t * Determines if we should filter the query passed as argument.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param WP_Query $query The WP_Query to check.\n\t *\n\t * @return bool\n\t */\n\tprivate function should_filter_query( WP_Query $query ) {\n\t\t$should_filter = ! $query->is_admin && $query->is_search() && $query->is_main_query();\n\n\t\t/**\n\t\t * Allow developers to override the return value of `should_filter_query()`.\n\t\t *\n\t\t * @since  1.3.0\n\t\t *\n\t\t * @param bool     $should_filter Whether Algolia should filter the search query.\n\t\t * @param WP_Query $query         The WP_Query that was tested for Algolia Search filtering.\n\t\t */\n\t\treturn (bool) apply_filters(\n\t\t\t'algolia_should_filter_query',\n\t\t\t$should_filter,\n\t\t\t$query\n\t\t);\n\t}\n\n\t/**\n\t * We force the WP_Query to only return records according to Algolia's ranking.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param WP_Query $query The WP_Query being filtered.\n\t *\n\t * @return void\n\t */\n\tpublic function pre_get_posts( WP_Query $query ) {\n\t\tif ( ! $this->should_filter_query( $query ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$current_page = 1;\n\t\tif ( get_query_var( 'paged' ) ) {\n\t\t\t$current_page = get_query_var( 'paged' );\n\t\t} elseif ( get_query_var( 'page' ) ) {\n\t\t\t$current_page = get_query_var( 'page' );\n\t\t}\n\n\t\t/**\n\t\t * Filters the array of parameters used in the Algolia Index search.\n\t\t *\n\t\t * @author WebDevStudios <contact@webdevstudios.com>\n\t\t * @since  1.0.0\n\t\t * @since  1.2.0 Introduced 'highlightPreTag' and 'highlightPostTag` parameters.\n\t\t *\n\t\t * @param array $params {\n\t\t *     Search parameters for the Algolia Index search.\n\t\t *\n\t\t *     @type string $attributesToRetrieve Which attributes to retrieve.\n\t\t *     @type int    $hitsPerPage          Pagination parameter. The number of hits per page to retrieve.\n\t\t *     @type int    $page                 Pagination parameter. The page of results to retrieve.\n\t\t *     @type string $highlightPreTag      HTML string to insert before highlights in result snippets.\n\t\t *     @type string $highlightPostTag     HTML string to insert after highlights in result snippets.\n\t\t * }\n\t\t */\n\t\t$params = apply_filters(\n\t\t\t'algolia_search_params',\n\t\t\tarray(\n\t\t\t\t'attributesToRetrieve' => 'post_id',\n\t\t\t\t'hitsPerPage'          => (int) get_option( 'posts_per_page' ),\n\t\t\t\t'page'                 => $current_page - 1, // Algolia pages are zero indexed.\n\t\t\t\t'highlightPreTag'      => '<em class=\"algolia-search-highlight\">',\n\t\t\t\t'highlightPostTag'     => '</em>',\n\t\t\t)\n\t\t);\n\n\t\t/**\n\t\t * Filters the order by clause for our backend search query.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  null   $value Order by parameter. Default null.\n\t\t * @return string $value Filtered order by parameter.\n\t\t */\n\t\t$order_by = apply_filters( 'algolia_search_order_by', null );\n\n\t\t/**\n\t\t * Filters the order clause for our backend search query.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  string $value Order parameter. Default 'desc'.\n\t\t * @return string $value Filtered order parameter.\n\t\t */\n\t\t$order    = apply_filters( 'algolia_search_order', 'desc' );\n\n\t\ttry {\n\t\t\t$results = $this->index->search( $query->query['s'], $params, $order_by, $order );\n\t\t} catch ( AlgoliaException $exception ) {\n\t\t\terror_log( $exception->getMessage() ); // phpcs:ignore -- Legacy.\n\n\t\t\treturn;\n\t\t}\n\n\t\tadd_filter( 'found_posts', array( $this, 'found_posts' ), 10, 2 );\n\t\tadd_filter( 'posts_search', array( $this, 'posts_search' ), 10, 2 );\n\n\t\t// Store the current page hits, so that we can use them for highlighting later on.\n\t\tforeach ( $results['hits'] as $hit ) {\n\t\t\t$this->current_page_hits[ $hit['post_id'] ] = $hit;\n\t\t}\n\n\t\t// Store the total number of its, so that we can hook into the `found_posts`.\n\t\t// This is useful for pagination.\n\t\t$this->total_hits = $results['nbHits'];\n\n\t\t$post_ids = array();\n\t\tforeach ( $results['hits'] as $result ) {\n\t\t\t$post_ids[] = $result['post_id'];\n\t\t}\n\n\t\t// Make sure there are not results by tricking WordPress in trying to find\n\t\t// a non existing post ID.\n\t\t// Otherwise, the query returns all the results.\n\t\tif ( empty( $post_ids ) ) {\n\t\t\t$post_ids = array( 0 );\n\t\t}\n\n\t\t$query->set( 'posts_per_page', $params['hitsPerPage'] );\n\t\t$query->set( 'offset', 0 );\n\n\t\t$post_types = 'any';\n\n\t\t$maybe_post_type = filter_input( INPUT_GET, 'post_type', FILTER_SANITIZE_SPECIAL_CHARS );\n\n\t\tif ( ! empty( $maybe_post_type ) ) {\n\t\t\t$post_type = get_post_type_object( $maybe_post_type );\n\t\t\tif ( null !== $post_type ) {\n\t\t\t\t$post_types = $post_type->name;\n\t\t\t}\n\t\t}\n\n\t\t$query->set( 'post_type', $post_types );\n\t\t$query->set( 'post__in', $post_ids );\n\t\t$query->set( 'orderby', 'post__in' );\n\n\t\t// @todo: This actually still excludes trash and auto-drafts.\n\t\t$query->set( 'post_status', 'any' );\n\t}\n\n\t/**\n\t * This hook returns the actual real number of results available in Algolia.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param int      $found_posts The number of posts found.\n\t * @param WP_Query $query       The WP_Query instance (passed by reference).\n\t *\n\t * @return int\n\t */\n\tpublic function found_posts( $found_posts, WP_Query $query ) {\n\t\treturn $this->should_filter_query( $query ) ? $this->total_hits : $found_posts;\n\t}\n\n\t/**\n\t * Filter the search SQL that is used in the WHERE clause of WP_Query.\n\t * Removes the where Like part of the queries as we consider Algolia as being the source of truth.\n\t * We don't want to filter by anything but the actual list of post_ids resulting\n\t * from the Algolia search.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string   $search Search SQL for WHERE clause.\n\t * @param WP_Query $query  The current WP_Query object.\n\t *\n\t * @return string\n\t */\n\tpublic function posts_search( $search, WP_Query $query ) {\n\t\treturn $this->should_filter_query( $query ) ? '' : $search;\n\t}\n\n\t/**\n\t * Output the bundled styles for highlighting search result matches, if enabled.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.2.0\n\t *\n\t * @return void\n\t */\n\tpublic function output_highlighting_bundled_styles() {\n\t\tif ( ! $this->highlighting_enabled() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Filters whether or not to output styling for search highlight.\n\t\t *\n\t\t * @since 1.2.0\n\t\t *\n\t\t * @param  bool $value Whether or not to output styling CSS\n\t\t * @return bool $value Filtered determination.\n\t\t */\n\t\tif ( ! apply_filters( 'algolia_search_highlighting_enable_bundled_styles', true ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t?>\n\t\t<style>\n\t\t\t.algolia-search-highlight {\n\t\t\t\tbackground-color: #fffbcc;\n\t\t\t\tborder-radius: 2px;\n\t\t\t\tfont-style: normal;\n\t\t\t}\n\t\t</style>\n\t\t<?php\n\t}\n\n\t/**\n\t * Begin highlighting search result matches, if enabled.\n\t *\n\t * This method is called on the loop_start action, where we want to begin highlighting search result matches.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param WP_Query $query The WP_Query.\n\t *\n\t * @return void\n\t */\n\tpublic function begin_highlighting( $query ) {\n\t\tif ( ! $this->should_filter_query( $query ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $this->highlighting_enabled() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tadd_filter( 'the_title', [ $this, 'highlight_the_title' ], 10, 2 );\n\t\tadd_filter( 'get_the_excerpt', [ $this, 'highlight_get_the_excerpt' ], 10, 2 );\n\n\t\tadd_action( 'loop_end', [ $this, 'end_highlighting' ] );\n\t}\n\n\t/**\n\t * Stop highlighting search result matches.\n\t *\n\t * This method is called on the loop_end action, where we want to stop highlighting search result matches.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param WP_Query $query The WP_Query.\n\t */\n\tpublic function end_highlighting( $query ) {\n\t\tremove_filter( 'the_title', [ $this, 'highlight_the_title' ], 10 );\n\t\tremove_filter( 'get_the_excerpt', [ $this, 'highlight_get_the_excerpt' ], 10 );\n\n\t\tremove_action( 'loop_end', [ $this, 'end_highlighting' ] );\n\t}\n\n\t/**\n\t * Filter the_title, replacing it with the highlighted title from the Algolia index.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string $title   The title string.\n\t * @param int    $post_id The post ID.\n\t *\n\t * @return string\n\t */\n\tpublic function highlight_the_title( $title, $post_id ) {\n\t\t$highlighted_title = $this->current_page_hits[ $post_id ]['_highlightResult']['post_title']['value'] ?? null;\n\n\t\tif ( ! empty( $highlighted_title ) ) {\n\t\t\t$title = $highlighted_title;\n\t\t}\n\n\t\treturn $title;\n\t}\n\n\t/**\n\t * Filter get_the_excerpt, replacing it with the highlighted excerpt from the Algolia index.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string  $excerpt The excerpt string.\n\t * @param WP_Post $post    The post object.\n\t *\n\t * @return string\n\t */\n\tpublic function highlight_get_the_excerpt( $excerpt, $post ) {\n\t\t$highlighted_excerpt = $this->current_page_hits[ $post->ID ]['_snippetResult']['content']['value'] ?? null;\n\n\t\tif ( ! empty( $highlighted_excerpt ) ) {\n\t\t\t$excerpt = $highlighted_excerpt;\n\t\t}\n\n\t\treturn $excerpt;\n\t}\n\n\t/**\n\t * Determine whether highlighting is enabled.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return bool\n\t */\n\tprivate function highlighting_enabled() : bool {\n\n\t\t/**\n\t\t * Filters whether or not highlighting is enabled.\n\t\t *\n\t\t * @since 1.2.0\n\t\t *\n\t\t * @param  bool  $value Whether or not highlighting is enabled.\n\t\t * @return mixed $value Determined highlight enabled status.\n\t\t */\n\t\treturn apply_filters( 'algolia_search_highlighting_enabled', true );\n\t}\n}\n"
  },
  {
    "path": "includes/class-algolia-settings.php",
    "content": "<?php\n/**\n * Algolia_Settings class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Settings\n *\n * @since 1.0.0\n */\nclass Algolia_Settings {\n\n\t/**\n\t * Algolia_Settings constructor.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t */\n\tpublic function __construct() {\n\t\tadd_option( 'algolia_application_id', '' );\n\t\tadd_option( 'algolia_search_api_key', '' );\n\t\tadd_option( 'algolia_api_key', '' );\n\t\tadd_option( 'algolia_synced_indices_ids', array() );\n\t\tadd_option( 'algolia_autocomplete_enabled', 'no' );\n\t\tadd_option( 'algolia_autocomplete_debounce', 0 );\n\t\tadd_option( 'algolia_autocomplete_config', array() );\n\t\tadd_option( 'algolia_override_native_search', 'native' );\n\t\tadd_option( 'algolia_instantsearch_template_version', 'legacy' );\n\t\tadd_option( 'algolia_index_name_prefix', 'wp_' );\n\t\tadd_option( 'algolia_api_is_reachable', 'no' );\n\t\tadd_option( 'algolia_powered_by_enabled', 'yes' );\n\t\tadd_option( 'algolia_insights_enabled', 'no' );\n\t}\n\n\t/**\n\t * Get the Algolia Application ID.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @return string\n\t */\n\tpublic function get_application_id() {\n\t\tif ( ! $this->is_application_id_in_config() ) {\n\n\t\t\treturn (string) get_option( 'algolia_application_id', '' );\n\t\t}\n\n\t\t$this->assert_constant_is_non_empty_string( ALGOLIA_APPLICATION_ID, 'ALGOLIA_APPLICATION_ID' );\n\n\t\treturn ALGOLIA_APPLICATION_ID;\n\t}\n\n\t/**\n\t * Get the Algolia Search-Only API Key.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @return string\n\t */\n\tpublic function get_search_api_key() {\n\t\tif ( ! $this->is_search_api_key_in_config() ) {\n\n\t\t\treturn (string) get_option( 'algolia_search_api_key', '' );\n\t\t}\n\n\t\t$this->assert_constant_is_non_empty_string( ALGOLIA_SEARCH_API_KEY, 'ALGOLIA_SEARCH_API_KEY' );\n\n\t\treturn ALGOLIA_SEARCH_API_KEY;\n\t}\n\n\t/**\n\t * Get the Algolia Admin API Key\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @return string\n\t */\n\tpublic function get_api_key() {\n\t\tif ( ! $this->is_api_key_in_config() ) {\n\n\t\t\treturn (string) get_option( 'algolia_api_key', '' );\n\t\t}\n\n\t\t$this->assert_constant_is_non_empty_string( ALGOLIA_API_KEY, 'ALGOLIA_API_KEY' );\n\n\t\treturn ALGOLIA_API_KEY;\n\t}\n\n\t/**\n\t * Get the excluded post types.\n\t *\n\t * @author     WebDevStudios <contact@webdevstudios.com>\n\t * @since      1.0.0\n\t * @deprecated 1.7.0 Use Algolia_Settings::get_excluded_post_types()\n\t * @see        Algolia_Settings::get_excluded_post_types()\n\t *\n\t * @return array\n\t */\n\tpublic function get_post_types_blacklist() {\n\t\t_deprecated_function(\n\t\t\t__METHOD__,\n\t\t\t'1.7.0',\n\t\t\t'Algolia_Settings::get_excluded_post_types();'\n\t\t);\n\n\t\treturn $this->get_excluded_post_types();\n\t}\n\n\t/**\n\t * Get the excluded post types.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.7.0\n\t *\n\t * @return array\n\t */\n\tpublic function get_excluded_post_types() {\n\n\t\t// Default array of excluded post types.\n\t\t$excluded = [ 'nav_menu_item' ];\n\n\t\t/**\n\t\t * Filters excluded post types.\n\t\t *\n\t\t * @since      1.0.0\n\t\t * @deprecated 1.7.0 Use {@see 'algolia_excluded_post_types'} instead.\n\t\t *\n\t\t * @param array $excluded The excluded post types.\n\t\t */\n\t\t$excluded = (array) apply_filters_deprecated(\n\t\t\t'algolia_post_types_blacklist',\n\t\t\t[ $excluded ],\n\t\t\t'1.7.0',\n\t\t\t'algolia_excluded_post_types'\n\t\t);\n\n\t\t/**\n\t\t * Filters excluded post types.\n\t\t *\n\t\t * @since 1.7.0\n\t\t *\n\t\t * @param array $excluded The excluded post types.\n\t\t */\n\t\t$excluded = (array) apply_filters( 'algolia_excluded_post_types', $excluded );\n\n\t\t// Native WordPress.\n\t\t$builtin = get_post_types( [ '_builtin' => true ] );\n\t\t// Preserve posts, pages, and attachments.\n\t\tunset( $builtin['post'] );\n\t\tunset( $builtin['page'] );\n\t\tunset( $builtin['attachment'] );\n\n\t\tforeach ( $builtin as $type ) {\n\t\t\t$excluded[] = $type;\n\t\t}\n\n\t\t// Native to WordPress VIP platform.\n\t\t$excluded[] = 'kr_request_token';\n\t\t$excluded[] = 'kr_access_token';\n\t\t$excluded[] = 'deprecated_log';\n\t\t$excluded[] = 'async-scan-result';\n\t\t$excluded[] = 'scanresult';\n\n\t\treturn array_unique( $excluded );\n\t}\n\n\t/**\n\t * Get synced indices IDs.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @return array\n\t */\n\tpublic function get_synced_indices_ids() {\n\t\t$ids = array();\n\n\t\t// Gather indices used in autocomplete experience.\n\t\t$config = $this->get_autocomplete_config();\n\t\tforeach ( $config as $index ) {\n\t\t\tif ( isset( $index['index_id'] ) ) {\n\t\t\t\t$ids[] = $index['index_id'];\n\t\t\t}\n\t\t}\n\n\t\t// Push index used in instantsearch experience.\n\t\t// Todo: we should allow users to index without using the shipped search UI or backend implementation.\n\t\tif ( $this->should_override_search_in_backend() || $this->should_override_search_with_instantsearch() ) {\n\t\t\t$ids[] = $this->get_native_search_index_id();\n\t\t}\n\n\t\t/**\n\t\t * Filters the indices IDs that will be synced.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array $ids   Array of IDs to sync.\n\t\t * @return array $value Filtered array of IDs.\n\t\t */\n\t\treturn (array) apply_filters( 'algolia_get_synced_indices_ids', $ids );\n\t}\n\n\t/**\n\t * Get excluded taxonomies.\n\t *\n\t * @author     WebDevStudios <contact@webdevstudios.com>\n\t * @since      1.0.0\n\t * @deprecated 1.7.0 Use Algolia_Settings::get_excluded_taxonomies()\n\t * @see        Algolia_Settings::get_excluded_taxonomies()\n\t *\n\t * @return array\n\t */\n\tpublic function get_taxonomies_blacklist() {\n\t\t_deprecated_function(\n\t\t\t__METHOD__,\n\t\t\t'1.7.0',\n\t\t\t'Algolia_Settings::get_excluded_taxonomies();'\n\t\t);\n\n\t\treturn $this->get_excluded_taxonomies();\n\t}\n\n\t/**\n\t * Get excluded taxonomies.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.7.0\n\t *\n\t * @return array\n\t */\n\tpublic function get_excluded_taxonomies() {\n\n\t\t// Default array of excluded taxonomies.\n\t\t$excluded = [\n\t\t\t'nav_menu',\n\t\t\t'link_category',\n\t\t\t'post_format',\n\t\t\t'wp_theme',\n\t\t\t'wp_template_part_area',\n\t\t];\n\n\t\t/**\n\t\t * Filters excluded taxonomies.\n\t\t *\n\t\t * @since      1.0.0\n\t\t * @deprecated 1.7.0 Use {@see 'algolia_excluded_taxonomies'} instead.\n\t\t *\n\t\t * @param array $excluded The excluded taxonomies.\n\t\t */\n\t\t$excluded = (array) apply_filters_deprecated(\n\t\t\t'algolia_taxonomies_blacklist',\n\t\t\t[ $excluded ],\n\t\t\t'1.7.0',\n\t\t\t'algolia_excluded_taxonomies'\n\t\t);\n\n\t\t/**\n\t\t * Filters the array of taxonomies to be excluded from syncing.\n\t\t *\n\t\t * @since 1.7.0\n\t\t *\n\t\t * @param  array $excluded Array of taxonomies to exclude.\n\t\t * @return array $value    Filtered array of taxonomies.\n\t\t */\n\t\t$excluded = (array) apply_filters( 'algolia_excluded_taxonomies', $excluded );\n\n\t\treturn $excluded;\n\t}\n\n\t/**\n\t * Get the autocomplete enabled option setting.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @return string Can be 'yes' or 'no'.\n\t */\n\tpublic function get_autocomplete_enabled() {\n\t\t$enabled = get_option( 'algolia_autocomplete_enabled', 'no' );\n\n\t\t/**\n\t\t * Filters the autocomplete enabled option for algolia search.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @param string $enabled Can be 'yes' or 'no'.\n\t\t */\n\t\treturn apply_filters( 'algolia_should_override_autocomplete', $enabled );\n\t}\n\n\t/**\n\t * Get the autocomplete debounce timeout settings value in milliseconds.\n\t * 0 will disable the feature (default).\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   2.10.0\n\t *\n\t * @return int Debounce value in milliseconds.\n\t */\n\tpublic function get_autocomplete_debounce() {\n\t\t$debounce = (int) get_option( 'algolia_autocomplete_debounce', 0 );\n\n\t\t/**\n\t\t * Filters the autocomplete debounce option for algolia autocomplete.\n\t\t *\n\t\t * @since 2.10.0\n\t\t *\n\t\t * @param int Debounce value in milliseconds.\n\t\t */\n\t\treturn (int) apply_filters( 'algolia_autocomplete_debounce', $debounce );\n\t}\n\n\t/**\n\t * Get the autocomplete config.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @return array\n\t */\n\tpublic function get_autocomplete_config() {\n\t\treturn (array) get_option( 'algolia_autocomplete_config', array() );\n\t}\n\n\t/**\n\t * Get the override native search option setting.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @return string Can be 'native' 'backend' or 'instantsearch'.\n\t */\n\tpublic function get_override_native_search() {\n\t\t$search_type = get_option( 'algolia_override_native_search', 'native' );\n\n\t\t// BC compatibility.\n\t\tif ( 'yes' === $search_type ) {\n\t\t\t$search_type = 'backend';\n\t\t}\n\n\t\treturn $search_type;\n\t}\n\n\t/**\n\t * Determines whether we should override search in backend.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @return bool\n\t */\n\tpublic function should_override_search_in_backend() {\n\t\treturn $this->get_override_native_search() === 'backend' || $this->should_override_search_with_instantsearch();\n\t}\n\n\t/**\n\t * Determines whether we should override search with instantsearch.js.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @return bool\n\t */\n\tpublic function should_override_search_with_instantsearch() {\n\t\t$value = $this->get_override_native_search() === 'instantsearch';\n\n\t\t/**\n\t\t * Filters whether or not we should override search with instantsearch.js\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  bool $value Whether or not we should override.\n\t\t * @return bool $value Filtered determination of override.\n\t\t */\n\t\treturn (bool) apply_filters( 'algolia_should_override_search_with_instantsearch', $value );\n\t}\n\n\t/**\n\t * Get native search index ID.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @return string\n\t */\n\tpublic function get_native_search_index_id() {\n\n\t\t/**\n\t\t * Filters the native search index ID.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  string $value The index ID for native search.\n\t\t * @return string $vaule The filtered index ID.\n\t\t */\n\t\treturn (string) apply_filters( 'algolia_native_search_index_id', 'searchable_posts' );\n\t}\n\n\t/**\n\t * Get the index name prefix.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @return string\n\t */\n\tpublic function get_index_name_prefix() {\n\t\tif ( ! $this->is_index_name_prefix_in_config() ) {\n\n\t\t\treturn (string) get_option( 'algolia_index_name_prefix', 'wp_' );\n\t\t}\n\n\t\t$this->assert_constant_is_non_empty_string( ALGOLIA_INDEX_NAME_PREFIX, 'ALGOLIA_INDEX_NAME_PREFIX' );\n\n\t\treturn ALGOLIA_INDEX_NAME_PREFIX;\n\t}\n\n\t/**\n\t * Makes sure that constants are non empty strings.\n\t *\n\t * This makes sure that we fail early if the environment configuration is wrong.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @param mixed  $value         The constant value to check.\n\t * @param string $constant_name The constant name to check.\n\t *\n\t * @throws RuntimeException If the constant is not a string or is empty.\n\t */\n\tprotected function assert_constant_is_non_empty_string( $value, $constant_name ) {\n\t\tif ( ! is_string( $value ) ) {\n\t\t\tthrow new RuntimeException( sprintf( 'Constant %s in wp-config.php should be a string, %s given.', $constant_name, gettype( $value ) ) );\n\t\t}\n\n\t\tif ( 0 === mb_strlen( $value ) ) {\n\t\t\tthrow new RuntimeException( sprintf( 'Constant %s in wp-config.php cannot be empty.', $constant_name ) );\n\t\t}\n\t}\n\n\t/**\n\t * Determines if the ALGOLIA_APPLICATION_ID is defined.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @return bool\n\t */\n\tpublic function is_application_id_in_config() {\n\t\treturn defined( 'ALGOLIA_APPLICATION_ID' );\n\t}\n\n\t/**\n\t * Determines if the ALGOLIA_SEARCH_API_KEY is defined.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @return bool\n\t */\n\tpublic function is_search_api_key_in_config() {\n\t\treturn defined( 'ALGOLIA_SEARCH_API_KEY' );\n\t}\n\n\t/**\n\t * Determines if the ALGOLIA_API_KEY is defined.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @return bool\n\t */\n\tpublic function is_api_key_in_config() {\n\t\treturn defined( 'ALGOLIA_API_KEY' );\n\t}\n\n\t/**\n\t * Determines if the ALGOLIA_INDEX_NAME_PREFIX is defined.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t * @return bool\n\t */\n\tpublic function is_index_name_prefix_in_config() {\n\t\treturn defined( 'ALGOLIA_INDEX_NAME_PREFIX' );\n\t}\n\n\t/**\n\t * Get the API is reachable option setting.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @return bool\n\t */\n\tpublic function get_api_is_reachable() {\n\t\t$enabled = get_option( 'algolia_api_is_reachable', 'no' );\n\n\t\treturn 'yes' === $enabled;\n\t}\n\n\t/**\n\t * Set the API is reachable option setting.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @param bool $flag If the API is reachable or not, 'yes' or 'no'.\n\t */\n\tpublic function set_api_is_reachable( $flag ) {\n\t\t$value = (bool) true === $flag ? 'yes' : 'no';\n\t\tupdate_option( 'algolia_api_is_reachable', $value );\n\t}\n\n\t/**\n\t * Determine if powered by is enabled.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @return bool\n\t */\n\tpublic function is_powered_by_enabled() {\n\t\t$enabled = get_option( 'algolia_powered_by_enabled', 'yes' );\n\n\t\treturn 'yes' === $enabled;\n\t}\n\n\t/**\n\t * Enable the powered by option setting.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t */\n\tpublic function enable_powered_by() {\n\t\tupdate_option( 'algolia_powered_by_enabled', 'yes' );\n\t}\n\n\t/**\n\t * Disable the powered by option setting.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t */\n\tpublic function disable_powered_by() {\n\t\tupdate_option( 'algolia_powered_by_enabled', 'no' );\n\t}\n\n\t/**\n\t * Determine if Insights is enabled.\n\t *\n\t * @since 2.10.2\n\t * @return bool\n\t */\n\tpublic function is_insights_enabled() {\n\t\treturn 'yes' === get_option( 'algolia_insights_enabled', 'no' );\n\t}\n\n\t/**\n\t * Return the version keyword for Instantsearch version to use.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @return mixed|null\n\t */\n\tpublic function get_instantsearch_template_version() {\n\t\t$chosen = get_option( 'algolia_instantsearch_template_version', 'legacy' );\n\n\t\t/**\n\t\t * Filters the chosen InstantSearch template version. Non-numerical.\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param  string $chosen Current template version.\n\t\t * @return string $value  Final template version.\n\t\t */\n\t\treturn apply_filters( 'algolia_instantsearch_template_version', $chosen );\n\t}\n\n\t/**\n\t * Return whether or not the keyword version is set to 'modern' or 'legacy'.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @return bool\n\t */\n\tpublic function should_use_instantsearch_modern() {\n\t\t$version = $this->get_instantsearch_template_version();\n\n\t\treturn 'modern' === $version;\n\t}\n}\n"
  },
  {
    "path": "includes/class-algolia-styles.php",
    "content": "<?php\n/**\n * Algolia_Styles class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.5.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Styles\n *\n * @since 1.5.0\n */\nclass Algolia_Styles {\n\n\t/**\n\t * Algolia_Styles constructor.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.5.0\n\t */\n\tpublic function __construct() {\n\t\tadd_action( 'wp_enqueue_scripts', [ $this, 'register_styles' ] );\n\t}\n\n\t/**\n\t * Register styles.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.5.0\n\t */\n\tpublic function register_styles() {\n\n\t\twp_register_style(\n\t\t\t'algolia-autocomplete',\n\t\t\tALGOLIA_PLUGIN_URL . 'css/algolia-autocomplete.css',\n\t\t\t[],\n\t\t\tALGOLIA_VERSION\n\t\t);\n\n\t\twp_register_style(\n\t\t\t'algolia-instantsearch',\n\t\t\tALGOLIA_PLUGIN_URL . 'css/algolia-instantsearch.css',\n\t\t\t[],\n\t\t\tALGOLIA_VERSION\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "includes/class-algolia-template-loader.php",
    "content": "<?php\n/**\n * Algolia_Template_Loader class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Template_Loader\n *\n * @since 1.0.0\n */\nclass Algolia_Template_Loader {\n\n\t/**\n\t * The Algolia Plugin.\n\t *\n\t * @since 1.0.0\n\t *\n\t * @var Algolia_Plugin\n\t */\n\tprivate $plugin;\n\n\t/**\n\t * Algolia_Template_Loader constructor.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @param Algolia_Plugin $plugin The Algolia Plugin.\n\t */\n\tpublic function __construct( Algolia_Plugin $plugin ) {\n\t\t$this->plugin = $plugin;\n\n\t\t$settings = $this->plugin->get_settings();\n\t\t$is_fse   = apply_filters( 'algolia_is_block_theme', false );\n\t\tif (\n\t\t\t! $this->should_load_autocomplete() &&\n\t\t\t! $settings->should_override_search_with_instantsearch() &&\n\t\t\t/**\n\t\t\t * Filters whether or not the current theme is a block based theme.\n\t\t\t *\n\t\t\t * WP Search with Algolia will help automatically detect and use this filter.\n\t\t\t *\n\t\t\t * @since 2.10.3\n\t\t\t *\n\t\t\t * @param bool $value Whether or not the current theme is block based. Default false.\n\t\t\t */\n\t\t\t! apply_filters( 'algolia_is_block_theme', false )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t$in_footer = Algolia_Utils::get_scripts_in_footer_argument();\n\n\t\t// Inject Algolia configuration in a JavaScript variable.\n\t\tif ( true === $in_footer ) {\n\t\t\tadd_filter(\n\t\t\t\t'wp_footer',\n\t\t\t\t[ $this, 'load_algolia_config' ]\n\t\t\t);\n\t\t} else {\n\t\t\tadd_filter(\n\t\t\t\t'wp_head',\n\t\t\t\t[ $this, 'load_algolia_config' ]\n\t\t\t);\n\t\t}\n\n\t\t// Listen for native templates to override.\n\t\tadd_filter( 'template_include', array( $this, 'template_loader' ) );\n\n\t\t// Load autocomplete.js search experience if its enabled.\n\t\tif ( $this->should_load_autocomplete() ) {\n\t\t\tadd_filter( 'wp_enqueue_scripts', array( $this, 'enqueue_autocomplete_scripts' ) );\n\n\t\t\tif ( true === $in_footer ) {\n\t\t\t\tadd_filter( 'wp_footer', array( $this, 'load_autocomplete_template' ) );\n\t\t\t} else {\n\t\t\t\tadd_filter( 'wp_head', array( $this, 'load_autocomplete_template' ) );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Load config.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t */\n\tpublic function load_algolia_config() {\n\t\t$settings            = $this->plugin->get_settings();\n\t\t$autocomplete_config = $this->plugin->get_autocomplete_config();\n\n\t\t$config = [\n\t\t\t'debug'                => defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG,\n\t\t\t'application_id'       => $settings->get_application_id(),\n\t\t\t'search_api_key'       => $settings->get_search_api_key(),\n\t\t\t'powered_by_enabled'   => $settings->is_powered_by_enabled(),\n\t\t\t'insights_enabled'     => $settings->is_insights_enabled(),\n\t\t\t'search_hits_per_page' => get_option( 'posts_per_page' ),\n\t\t\t'query'                => get_search_query(),\n\t\t\t'indices'              => [],\n\t\t\t'autocomplete'         => [\n\t\t\t\t'sources'        => $autocomplete_config->get_config(),\n\n\t\t\t\t/**\n\t\t\t\t * Filters the CSS-style selector used to locate search inputs to add Autocomplete to.\n\t\t\t\t *\n\t\t\t\t * @since 1.0.0\n\t\t\t\t *\n\t\t\t\t * @param  string $value Selector to target with.\n\t\t\t\t * @return string $value Updated selector.\n\t\t\t\t */\n\t\t\t\t'input_selector' => (string) apply_filters( 'algolia_autocomplete_input_selector', \"input[name='s']:not(.no-autocomplete):not(#adminbar-search)\" ),\n\t\t\t],\n\t\t];\n\n\t\t// Inject all the indices into the config to ease instantsearch.js integrations.\n\t\t$indices = $this->plugin->get_indices(\n\t\t\tarray(\n\t\t\t\t'enabled' => true,\n\t\t\t)\n\t\t);\n\t\tforeach ( $indices as $index ) {\n\t\t\t$config['indices'][ $index->get_id() ] = $index->to_array();\n\t\t}\n\n\t\t/**\n\t\t * Filters the final result of the algolia config object to be used.\n\t\t *\n\t\t * Gives developers one last change to alter the configuration.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array $config Array of configuration options\n\t\t * @return array $config Final configuration.\n\t\t */\n\t\t$config = (array) apply_filters( 'algolia_config', $config );\n\n\t\techo '<script type=\"text/javascript\">var algolia = ' . wp_json_encode( $config ) . ';</script>';\n\t}\n\n\t/**\n\t * Determines whether we should load autocomplete.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @return bool\n\t */\n\tprivate function should_load_autocomplete() {\n\t\t$settings     = $this->plugin->get_settings();\n\t\t$autocomplete = $this->plugin->get_autocomplete_config();\n\n\t\tif ( null === $autocomplete ) {\n\t\t\t// The user has not provided his credentials yet.\n\t\t\treturn false;\n\t\t}\n\n\t\t$config = $autocomplete->get_config();\n\t\tif ( 'yes' !== $settings->get_autocomplete_enabled() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn ! empty( $config );\n\t}\n\n\t/**\n\t * Enqueue Algolia autocomplete.js scripts.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t */\n\tpublic function enqueue_autocomplete_scripts() {\n\n\t\t// Enqueue the autocomplete.js default styles.\n\t\twp_enqueue_style( 'algolia-autocomplete' );\n\n\t\t// Javascript.\n\t\twp_enqueue_script( 'algolia-search' );\n\n\t\t// Enqueue the autocomplete.js library.\n\t\twp_enqueue_script( 'algolia-autocomplete' );\n\t\twp_enqueue_script( 'algolia-autocomplete-noconflict' );\n\n\t\t/**\n\t\t * Fires after Algolia Autocomplete assets have been enqueued.\n\t\t *\n\t\t * Allows users to easily enqueue custom styles and scripts that could depend on Autocomplete.\n\t\t *\n\t\t * @since 1.0.0\n\t\t */\n\t\tdo_action( 'algolia_autocomplete_scripts' );\n\t}\n\n\t/**\n\t * Load a template.\n\t *\n\t * Handles template usage so that we can use our own templates instead of the themes.\n\t *\n\t * Plugin templates are located in the 'templates' directory.\n\t * Customized templates are in the theme's 'algolia' directory.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @param mixed $template The template to load.\n\t *\n\t * @return string\n\t */\n\tpublic function template_loader( $template ) {\n\t\t$settings = $this->plugin->get_settings();\n\t\tif ( is_search() && $settings->should_override_search_with_instantsearch() ) {\n\t\t\t$is_fse = apply_filters( 'algolia_is_block_theme', false );\n\n\t\t\t// Don't need a custom instantsearch template file, but still need assets.\n\t\t\tif ( $is_fse ) {\n\t\t\t\t$this->load_instantsearch_assets();\n\t\t\t\treturn $template;\n\t\t\t}\n\n\t\t\treturn $this->load_instantsearch_template();\n\t\t}\n\n\t\treturn $template;\n\t}\n\n\t/**\n\t * Load the InstantSearch assets.\n\t *\n\t * @since 2.10.4\n\t */\n\tpublic function load_instantsearch_assets() {\n\t\tadd_action(\n\t\t\t'wp_enqueue_scripts',\n\t\t\tfunction () {\n\t\t\t\t// Enqueue the instantsearch.js default styles.\n\t\t\t\twp_enqueue_style( 'algolia-instantsearch' );\n\n\t\t\t\t// Enqueue the instantsearch.js library.\n\t\t\t\twp_enqueue_script( 'algolia-instantsearch' );\n\n\t\t\t\t/**\n\t\t\t\t * Fires after Algolia Instantsearch assets have been enqueued.\n\t\t\t\t *\n\t\t\t\t * Allow users to easily enqueue custom styles and scripts that could depend on InstantSearch.\n\t\t\t\t *\n\t\t\t\t * @since 1.0.0\n\t\t\t\t */\n\t\t\t\tdo_action( 'algolia_instantsearch_scripts' );\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Load the InstantSearch template.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @return string\n\t */\n\tpublic function load_instantsearch_template() {\n\t\t// Need both assets and Instantsearch template.\n\t\t$this->load_instantsearch_assets();\n\n\t\t$instantsearch_is_modern = $this->plugin->get_settings()->should_use_instantsearch_modern();\n\t\t$chosen_file             = ( $instantsearch_is_modern ) ? 'instantsearch-modern.php' : 'instantsearch.php';\n\t\treturn Algolia_Template_Utils::locate_template( $chosen_file );\n\t}\n\n\t/**\n\t * Load the autocomplete template.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t */\n\tpublic function load_autocomplete_template() {\n\t\trequire Algolia_Template_Utils::locate_template( 'autocomplete.php' );\n\t}\n\n\t/**\n\t * Locate a template.\n\t *\n\t * @author     WebDevStudios <contact@webdevstudios.com>\n\t * @since      1.0.0\n\t * @deprecated 1.8.0 Use Algolia_Template_Utils::locate_template()\n\t * @see        Algolia_Template_Utils::locate_template()\n\t *\n\t * @param string $file The template file.\n\t *\n\t * @return string\n\t */\n\tprivate function locate_template( $file ) {\n\t\t_deprecated_function(\n\t\t\t__METHOD__,\n\t\t\t'1.8.0',\n\t\t\t'Algolia_Template_Utils::locate_template()'\n\t\t);\n\t\treturn Algolia_Template_Utils::locate_template( $file );\n\t}\n}\n"
  },
  {
    "path": "includes/class-algolia-utils.php",
    "content": "<?php\n/**\n * Algolia_Utils class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Utils\n *\n * @since 1.0.0\n */\nclass Algolia_Utils {\n\n\t/**\n\t * Retrieve term parents with separator.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @param int    $id        Term ID.\n\t * @param string $taxonomy  The taxonomy.\n\t * @param string $separator Optional, default is '/'. How to separate terms.\n\t * @param bool   $nicename  Optional, default is false. Whether to use nice name for display.\n\t * @param array  $visited   Optional. Already linked to terms to prevent duplicates.\n\t *\n\t * @return string|WP_Error A list of terms parents on success, WP_Error on failure.\n\t */\n\tpublic static function get_term_parents( $id, $taxonomy, $separator = '/', $nicename = false, $visited = array() ) {\n\t\t$chain  = '';\n\t\t$parent = get_term( $id, $taxonomy );\n\t\tif ( is_wp_error( $parent ) ) {\n\t\t\treturn $parent;\n\t\t}\n\n\t\tif ( $nicename ) {\n\t\t\t$name = $parent->slug;\n\t\t} else {\n\t\t\t$name = $parent->name;\n\t\t}\n\n\t\tif ( $parent->parent && ( $parent->parent !== $parent->term_id ) && ! in_array( $parent->parent, $visited, true ) ) {\n\t\t\t$visited[] = $parent->parent;\n\t\t\t$chain    .= self::get_term_parents( $parent->parent, $taxonomy, $separator, $nicename, $visited );\n\t\t}\n\n\t\t$chain .= $name . $separator;\n\n\t\treturn $chain;\n\t}\n\n\t/**\n\t * Get taxonomy tree.\n\t *\n\t * This is useful when building hierarchical menus.\n\t *\n\t * Returns an array like:\n\t * array(\n\t *    'lvl0' => ['Sales', 'Marketing'],\n\t *    'lvl1' => ['Sales > Strategies', 'Marketing > Tips & Tricks']\n\t *    ...\n\t * );.\n\t *\n\t * @link    https://community.algolia.com/instantsearch.js/documentation/#hierarchicalmenu\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @param array  $terms     The terms.\n\t * @param string $taxonomy  The taxonomy.\n\t * @param string $separator The separator.\n\t *\n\t * @return array\n\t */\n\tpublic static function get_taxonomy_tree( array $terms, $taxonomy, $separator = ' > ' ) {\n\t\t$term_ids = wp_list_pluck( $terms, 'term_id' );\n\n\t\t$parents = array();\n\t\tforeach ( $term_ids as $term_id ) {\n\t\t\t$path      = self::get_term_parents( $term_id, $taxonomy, $separator );\n\t\t\t$parents[] = rtrim( $path, $separator );\n\t\t}\n\n\t\t$terms = array();\n\t\tforeach ( $parents as $parent ) {\n\t\t\t$levels = explode( $separator, $parent );\n\n\t\t\t$previous_lvl = '';\n\t\t\tforeach ( $levels as $index => $level ) {\n\t\t\t\t$terms[ 'lvl' . $index ][] = $previous_lvl . $level;\n\t\t\t\t$previous_lvl             .= $level . $separator;\n\n\t\t\t\t// Make sure we have not duplicate.\n\t\t\t\t// The call to `array_values` ensures that we do not end up with an object in JSON.\n\t\t\t\t$terms[ 'lvl' . $index ] = array_values( array_unique( $terms[ 'lvl' . $index ] ) );\n\t\t\t}\n\t\t}\n\n\t\treturn $terms;\n\t}\n\n\t/**\n\t * Get post images.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @param int $post_id The post ID.\n\t *\n\t * @return array\n\t */\n\tpublic static function get_post_images( $post_id ) {\n\t\t$images = array();\n\n\t\tif ( get_post_type( $post_id ) === 'attachment' ) {\n\t\t\t$post_thumbnail_id = (int) $post_id;\n\t\t} else {\n\t\t\t$post_thumbnail_id = get_post_thumbnail_id( (int) $post_id );\n\t\t}\n\n\t\tif ( $post_thumbnail_id ) {\n\n\t\t\t/**\n\t\t\t * Filters the sizes to fetch image paths for.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t *\n\t\t\t * @param  array $value Array of image sizes to fetch. Default: thumbnail.\n\t\t\t * @return array $value Amended array of images sizes.\n\t\t\t */\n\t\t\t$sizes = (array) apply_filters( 'algolia_post_images_sizes', array( 'thumbnail' ) );\n\t\t\tforeach ( $sizes as $size ) {\n\t\t\t\t$info = wp_get_attachment_image_src( $post_thumbnail_id, $size );\n\t\t\t\tif ( ! $info ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$images[ $size ] = array(\n\t\t\t\t\t'url'    => $info[0],\n\t\t\t\t\t'width'  => $info[1],\n\t\t\t\t\t'height' => $info[2],\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the final array of images and image data.\n\t\t *\n\t\t * Parameter will be an array keyed by image size, and has\n\t\t * URL, width and height details for each image.\n\t\t *\n\t\t * @since 1.0.0\n\t\t * @since 2.8.0 Added `$post_id` as second parameter\n\t\t *\n\t\t * @param array  $images  Array of images data.\n\t\t * @param int    $post_id Current post ID being indexed.\n\t\t * @return array $images  Final array of images data.\n\t\t */\n\t\treturn (array) apply_filters( 'algolia_get_post_images', $images, $post_id );\n\t}\n\n\t/**\n\t * Prepare content.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @param string $content The content to prepare.\n\t *\n\t * @return string\n\t */\n\tpublic static function prepare_content( $content ) {\n\t\t$content = self::remove_content_noise( $content );\n\n\t\treturn wp_strip_all_tags( $content );\n\t}\n\n\t/**\n\t * Remove noise from content.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @param string $content The content to remove noise from.\n\t *\n\t * @return string\n\t */\n\tpublic static function remove_content_noise( $content ) {\n\t\t$noise_patterns = array(\n\t\t\t// strip out comments.\n\t\t\t\"'<!--(.*?)-->'is\",\n\t\t\t// strip out cdata.\n\t\t\t\"'<!\\[CDATA\\[(.*?)\\]\\]>'is\",\n\t\t\t// Per sourceforge http://sourceforge.net/tracker/?func=detail&aid=2949097&group_id=218559&atid=1044037\n\t\t\t// Script tags removal now preceeds style tag removal.\n\t\t\t// strip out <script> tags.\n\t\t\t\"'<\\s*script[^>]*[^/]>(.*?)<\\s*/\\s*script\\s*>'is\",\n\t\t\t\"'<\\s*script\\s*>(.*?)<\\s*/\\s*script\\s*>'is\",\n\t\t\t// strip out <style> tags.\n\t\t\t\"'<\\s*style[^>]*[^/]>(.*?)<\\s*/\\s*style\\s*>'is\",\n\t\t\t\"'<\\s*style\\s*>(.*?)<\\s*/\\s*style\\s*>'is\",\n\t\t\t// strip out preformatted tags.\n\t\t\t\"'<\\s*(?:code)[^>]*>(.*?)<\\s*/\\s*(?:code)\\s*>'is\",\n\t\t\t// strip out <pre> tags.\n\t\t\t\"'<\\s*pre[^>]*[^/]>(.*?)<\\s*/\\s*pre\\s*>'is\",\n\t\t\t\"'<\\s*pre\\s*>(.*?)<\\s*/\\s*pre\\s*>'is\",\n\t\t);\n\n\t\t// If there is ET builder (Divi), remove shortcodes.\n\t\tif ( function_exists( 'et_pb_is_pagebuilder_used' ) ) {\n\t\t\t$noise_patterns[] = '/\\[\\/?et_pb.*?\\]/';\n\t\t}\n\n\t\t/**\n\t\t * Filters the \"noise\" patterns to run content through.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array $value Array of REGEX patterns to use.\n\t\t * @return array Amended array of patterns.\n\t\t */\n\t\t$noise_patterns = (array) apply_filters( 'algolia_strip_patterns', $noise_patterns );\n\n\t\tforeach ( $noise_patterns as $pattern ) {\n\t\t\t$content = preg_replace( $pattern, '', $content );\n\t\t}\n\n\t\t$content = str_replace( '&nbsp;', ' ', $content );\n\n\t\t// Prevent table content from being concatenated.\n\t\t$content = str_replace( [ '</td>', '</th>' ], ' ', $content );\n\n\t\treturn html_entity_decode( $content );\n\t}\n\n\t/**\n\t * Explode content.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @param string $content The content to explode.\n\t *\n\t * @return array\n\t */\n\tpublic static function explode_content( $content ) {\n\t\t$max_size = 2000;\n\t\tif ( defined( 'ALGOLIA_CONTENT_MAX_SIZE' ) ) {\n\t\t\t$max_size = (int) ALGOLIA_CONTENT_MAX_SIZE;\n\t\t}\n\n\t\t$parts  = array();\n\t\t$prefix = '';\n\t\twhile ( true ) {\n\t\t\t$content = trim( (string) $content );\n\t\t\tif ( strlen( $content ) <= $max_size ) {\n\t\t\t\t$parts[] = $prefix . $content;\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$offset          = -( strlen( $content ) - $max_size );\n\t\t\t$cut_at_position = strrpos( $content, ' ', $offset );\n\n\t\t\tif ( false === $cut_at_position ) {\n\t\t\t\t$cut_at_position = $max_size;\n\t\t\t}\n\t\t\t$parts[] = $prefix . substr( $content, 0, $cut_at_position );\n\t\t\t$content = substr( $content, $cut_at_position );\n\n\t\t\t$prefix = '… ';\n\t\t}\n\n\t\treturn $parts;\n\t}\n\n\t/**\n\t * Get the `$in_footer` argument for registering scripts.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.5.0\n\t *\n\t * @return bool\n\t */\n\tpublic static function get_scripts_in_footer_argument() {\n\n\t\t/**\n\t\t * Filters the `$in_footer` argument to `wp_register_script()` for Algolia Scripts.\n\t\t *\n\t\t * @since 1.3.0\n\t\t * @since 1.5.0 The default changed from 'false' to 'true'.\n\t\t *\n\t\t * @param bool $in_footer Whether to enqueue the script before </body> instead of in the <head>. Default 'true'.\n\t\t */\n\t\treturn (bool) apply_filters(\n\t\t\t'algolia_load_scripts_in_footer',\n\t\t\ttrue\n\t\t);\n\t}\n\n\t/**\n\t * Return markup for WP Search with Algolia Pro Call To Action.\n\t *\n\t * @since 2.5.0\n\t * @return false|string\n\t */\n\tpublic static function pro_cta_content() {\n\t\tob_start();\n\t\t?>\n\t\t<div class=\"algolia-pro-cta\">\n\t\t\t<h2 class=\"algolia-pro-title\"><?php esc_html_e( 'WP Search with Algolia Pro', 'wp-search-with-algolia' ); ?></h2>\n\t\t\t<h3 class=\"algolia-pro-desc\">\n\t\t\t\t<?php esc_html_e( 'A premium Algolia search plugin specifically designed for enterprise-grade WordPress websites, including eCommerce', 'wp-search-with-algolia' ); ?>\n\t\t\t</h3>\n\t\t\t<div class=\"algolia-pro-features\">\n\t\t\t\t<div>\n\t\t\t\t\t<?php $svg = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#0077ff\" stroke-width=\"1\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"20 6 9 17 4 12\"></polyline></svg>'; ?>\n\t\t\t\t\t<h4><?php esc_html_e( 'WooCommerce Support', 'wp-search-with-algolia' ); ?></h4>\n\t\t\t\t\t<span class=\"algolia-pro-feature\">\n\t\t\t\t\t\t<?php echo $svg; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- This is a hardcoded SVG. ?>\n\t\t\t\t\t\t<span><?php esc_html_e( 'Index product SKUs, prices, short descriptions and product dimensions/weight for display.', 'wp-search-with-algolia' ); ?></span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"algolia-pro-feature\">\n\t\t\t\t\t\t<?php echo $svg; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- This is a hardcoded SVG. ?>\n\t\t\t\t\t\t<span><?php esc_html_e( 'Index product total sales ratings for relevance.', 'wp-search-with-algolia' ); ?></span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"algolia-pro-feature\">\n\t\t\t\t\t\t<?php echo $svg; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- This is a hardcoded SVG. ?>\n\t\t\t\t\t\t<span><?php esc_html_e( 'Index product total and average ratings for relevance.', 'wp-search-with-algolia' ); ?></span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"algolia-pro-feature\">\n\t\t\t\t\t\t<?php echo $svg; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- This is a hardcoded SVG. ?>\n\t\t\t\t\t\t<span><?php esc_html_e( 'Control whether or not sold out products are indexed', 'wp-search-with-algolia' ); ?></span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"algolia-pro-feature\">\n\t\t\t\t\t\t<?php echo $svg; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- This is a hardcoded SVG. ?>\n\t\t\t\t\t\t<span><?php esc_html_e( 'Control whether or not \"shop only\" or \"hidden\" products are indexed.', 'wp-search-with-algolia' ); ?></span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"algolia-pro-feature\">\n\t\t\t\t\t\t<?php echo $svg; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- This is a hardcoded SVG. ?>\n\t\t\t\t\t\t<span><?php esc_html_e( 'Amend indexing to only include WooCommerce products.', 'wp-search-with-algolia' ); ?></span>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<h4><?php esc_html_e( 'Additional Features', 'wp-search-with-algolia' ); ?></h4>\n\t\t\t\t\t<span class=\"algolia-pro-feature\">\n\t\t\t\t\t\t<?php echo $svg; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- This is a hardcoded SVG. ?>\n\t\t\t\t\t\t<span><?php esc_html_e( 'Multisite indexing into a single network index to provide a global Algolia-powered search experience.', 'wp-search-with-algolia' ); ?></span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"algolia-pro-feature\">\n\t\t\t\t\t\t<?php echo $svg; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- This is a hardcoded SVG. ?>\n\t\t\t\t\t\t<span><?php esc_html_e( 'Fine tune indexing on selected pieces of content', 'wp-search-with-algolia' ); ?></span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"algolia-pro-feature\">\n\t\t\t\t\t\t<?php echo $svg; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- This is a hardcoded SVG. ?>\n\t\t\t\t\t\t<span><?php esc_html_e( 'Yoast SEO, All in One SEO, Rank Math SEO, SEOPress, and The SEO Framework Support', 'wp-search-with-algolia' ); ?></span>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<a href=\"https://pluginize.com/plugins/wp-search-with-algolia-pro/\" class=\"algolia-pro-button\" target=\"_blank\" rel=\"noopener\"><?php esc_html_e( 'Upgrade Now and Go Pro', 'wp-search-with-algolia' ); ?></a>\n\t\t\t\t<span class=\"algolia-pro-more\">\n\t\t\t\t<a href=\"https://pluginize.com/plugins/wp-search-with-algolia-pro/\" target=\"_blank\" rel=\"noopener\"><?php esc_html_e( 'Learn more and see all the features', 'wp-search-with-algolia' ); ?></a>\n\t\t\t</span>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t\treturn ob_get_clean();\n\t}\n}\n"
  },
  {
    "path": "includes/factories/class-algolia-http-client-interface-factory.php",
    "content": "<?php\n/**\n * Algolia_Http_Client_Interface_Factory class file.\n *\n * @since   1.6.0\n * @package WebDevStudios\\WPSWA\n */\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\Guzzle6HttpClient;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\HttpClientInterface;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\CurlHttpClient;\n\n/**\n * Class Algolia_Http_Client_Interface_Factory\n *\n * Responsible for creating a shared instance of the HttpClientInterface object.\n *\n * @since 1.6.0\n */\nclass Algolia_Http_Client_Interface_Factory {\n\n\t/**\n\t * Create and return a shared instance of the HttpClientInterface.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.6.0\n\t *\n\t * @return HttpClientInterface The shared HttpClientInterface instance.\n\t */\n\tpublic static function create(): HttpClientInterface {\n\t\t/**\n\t\t * The static instance to share, else null.\n\t\t *\n\t\t * @since 1.6.0\n\t\t *\n\t\t * @var null|HttpClientInterface $http_client\n\t\t */\n\t\tstatic $http_client = null;\n\n\t\tif ( null !== $http_client ) {\n\t\t\treturn $http_client;\n\t\t}\n\n\t\t$http_client = self::create_http_client();\n\n\t\treturn $http_client;\n\t}\n\n\t/**\n\t * Create HttpClientInterface.\n\t *\n\t * @author     WebDevStudios <contact@webdevstudios.com>\n\t * @since      1.6.0\n\t *\n\t * @deprecated 2.0.0 Use Algolia_Http_Client_Interface_Factory::create_http_client()\n\t * @see        Algolia_Http_Client_Interface_Factory::create_http_client()\n\t *\n\t * @return HttpClientInterface\n\t */\n\tpublic static function create_php53_http_client(): HttpClientInterface {\n\t\t_deprecated_function(\n\t\t\t__METHOD__,\n\t\t\t'2.0.0',\n\t\t\t'Algolia_Http_Client_Interface_Factory::create_http_client();'\n\t\t);\n\t\treturn self::create_http_client();\n\t}\n\n\t/**\n\t * Create HttpClientInterface.\n\t *\n\t * Note: Algolia PHP Client 2.x used the `Php53HttpClient` class\n\t * when Guzzle was not available.\n\t * Algolia PHP Client v 3.x changed that class to `CurlHttpClient`.\n\t * Ideally we would implement Guzzle support at some point,\n\t * but we need to explore PHP Scoper or Mozart before doing so.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.0.0\n\t *\n\t * @return HttpClientInterface\n\t */\n\tpublic static function create_http_client(): HttpClientInterface {\n\n\t\t$options = [];\n\n\t\t/**\n\t\t * Allow developers to override the HttpClientInterface options.\n\t\t *\n\t\t * @author     WebDevStudios <contact@webdevstudios.com>\n\t\t * @since      1.6.0\n\t\t * @deprecated 2.0.0 Use {@see 'algolia_http_client_options'} instead.\n\t\t *\n\t\t * @param array $options Options for HttpClientInterface construction.\n\t\t */\n\t\t$options = (array) apply_filters_deprecated(\n\t\t\t'algolia_php_53_http_client_options',\n\t\t\t[ $options ],\n\t\t\t'2.0.0',\n\t\t\t'algolia_http_client_options'\n\t\t);\n\n\t\t/**\n\t\t * Allow developers to override the HttpClientInterface options.\n\t\t *\n\t\t * @link   https://www.algolia.com/doc/api-client/advanced/pass-options-to-the-http-client/php/?language=php#using-the-default-php53httpclient\n\t\t * @link   https://www.algolia.com/doc/api-client/getting-started/upgrade-guides/php/#curl-options\n\t\t * @link   https://curl.haxx.se/libcurl/c/curl_easy_setopt.html\n\t\t *\n\t\t * @author WebDevStudios <contact@webdevstudios.com>\n\t\t * @since  2.0.0\n\t\t *\n\t\t * @param array $options Options for HttpClientInterface construction.\n\t\t */\n\t\t$options = (array) apply_filters( 'algolia_http_client_options', $options );\n\n\t\treturn new CurlHttpClient( $options );\n\t}\n}\n"
  },
  {
    "path": "includes/factories/class-algolia-plugin-factory.php",
    "content": "<?php\n/**\n * Algolia_Plugin_Factory class file.\n *\n * @since   1.6.0\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Plugin_Factory\n *\n * Responsible for creating a shared instance of the main Algolia_Plugin object.\n *\n * @since 1.6.0\n */\nclass Algolia_Plugin_Factory {\n\n\t/**\n\t * Create and return a shared instance of the Algolia_Plugin.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.6.0\n\t *\n\t * @return Algolia_Plugin The shared plugin instance.\n\t */\n\tpublic static function create(): Algolia_Plugin {\n\n\t\t/**\n\t\t * The static instance to share, else null.\n\t\t *\n\t\t * @since  1.6.0\n\t\t *\n\t\t * @var null|Algolia_Plugin $plugin\n\t\t */\n\t\tstatic $plugin = null;\n\n\t\tif ( null !== $plugin ) {\n\t\t\treturn $plugin;\n\t\t}\n\n\t\t$plugin = new Algolia_Plugin();\n\n\t\treturn $plugin;\n\t}\n}\n"
  },
  {
    "path": "includes/factories/class-algolia-search-client-factory.php",
    "content": "<?php\n/**\n * Algolia_Search_Client_Factory class file.\n *\n * @since   1.6.0\n * @package WebDevStudios\\WPSWA\n */\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\SearchConfig;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Algolia;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchClient;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Support\\UserAgent;\n\n/**\n * Class Algolia_Search_Client_Factory\n *\n * @since 1.6.0\n */\nclass Algolia_Search_Client_Factory {\n\n\t/**\n\t * Create an Algolia SearchClient.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.6.0\n\t *\n\t * @param string $app_id  The Algolia Application ID.\n\t * @param string $api_key The Algolia API Key.\n\t *\n\t * @return SearchClient\n\t */\n\tpublic static function create( string $app_id, string $api_key ): SearchClient {\n\n\t\t/**\n\t\t * Filters the UA Integration name value.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  string $value Default: \"WP Search with Algolia\"\n\t\t * @return string $value New UA integration name.\n\t\t */\n\t\t$integration_name = (string) apply_filters(\n\t\t\t'algolia_ua_integration_name',\n\t\t\t'WP Search with Algolia'\n\t\t);\n\n\t\t/**\n\t\t * Filters the UA Integration version value.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  string $value Default: Current Algolia plugin version.\n\t\t * @return string $value Custom UA integration version.\n\t\t */\n\t\t$integration_version = (string) apply_filters(\n\t\t\t'algolia_ua_integration_version',\n\t\t\tALGOLIA_VERSION\n\t\t);\n\n\t\tUserAgent::addCustomUserAgent(\n\t\t\t$integration_name,\n\t\t\t$integration_version\n\t\t);\n\n\t\tglobal $wp_version;\n\n\t\tUserAgent::addCustomUserAgent(\n\t\t\t'WordPress',\n\t\t\t$wp_version\n\t\t);\n\n\t\t$http_client = Algolia_Http_Client_Interface_Factory::create();\n\n\t\tAlgolia::setHttpClient( $http_client );\n\n\t\t/**\n\t\t * Allows for providing custom configuration arguments for Algolia Search Client.\n\t\t *\n\t\t * @see https://www.algolia.com/doc/api-reference/api-methods/configuring-timeouts/\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param array $value Array of values for Algolia Config. Default empty array.\n\t\t */\n\t\t$custom_config = apply_filters(\n\t\t\t'algolia_custom_search_config',\n\t\t\t[]\n\t\t);\n\n\t\t/**\n\t\t * Allows for customizing an Algolia secured API key.\n\t\t *\n\t\t * @see https://www.algolia.com/doc/api-reference/api-methods/generate-secured-api-key/\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param array $value Array of secured API key arguments. Default empty array.\n\t\t */\n\t\t$custom_secured_key_config = apply_filters(\n\t\t\t'algolia_custom_secured_key',\n\t\t\t[]\n\t\t);\n\n\t\tif ( ! empty( $custom_secured_key_config ) && is_array( $custom_secured_key_config ) ) {\n\t\t\t$custom_secured_key_config = wp_parse_args(\n\t\t\t\t$custom_secured_key_config,\n\t\t\t\t[\n\t\t\t\t\t'filters'         => '',\n\t\t\t\t\t'validUntil'      => '',\n\t\t\t\t\t'restrictIndices' => [],\n\t\t\t\t\t'restrictSources' => '',\n\t\t\t\t\t'userToken'       => '',\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$api_key = SearchClient::generateSecuredApiKey( $api_key, $custom_secured_key_config );\n\t\t}\n\n\t\tif ( ! empty( $custom_config ) && is_array( $custom_config ) ) {\n\t\t\t$config = SearchConfig::create( $app_id, $api_key );\n\n\t\t\tif ( ! empty( $custom_config['connectTimeout'] ) ) {\n\t\t\t\t$config->setConnectTimeout( (int) $custom_config['connectTimeout'] );\n\t\t\t}\n\t\t\tif ( ! empty( $custom_config['readTimeout'] ) ) {\n\t\t\t\t$config->setReadTimeout( (int) $custom_config['readTimeout'] );\n\t\t\t}\n\t\t\tif ( ! empty( $custom_config['writeTimeout'] ) ) {\n\t\t\t\t$config->setWriteTimeout( (int) $custom_config['writeTimeout'] );\n\t\t\t}\n\n\t\t\tif ( is_array( $custom_config['DefaultHeaders'] ) && ! empty( $custom_config['DefaultHeaders'] ) ) {\n\t\t\t\t$config->setDefaultHeaders( $custom_config['DefaultHeaders'] );\n\t\t\t}\n\n\t\t\treturn SearchClient::createWithConfig( $config );\n\t\t}\n\n\t\treturn SearchClient::create(\n\t\t\t(string) $app_id,\n\t\t\t(string) $api_key\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "includes/index.php",
    "content": "<?php // Silence is golden\n"
  },
  {
    "path": "includes/indices/class-algolia-index-replica.php",
    "content": "<?php\n/**\n * Algolia_Index_Replica class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Index_Replica\n *\n * @since 1.0.0\n */\nclass Algolia_Index_Replica {\n\n\tconst ORDER_ASC  = 'asc';\n\tconst ORDER_DESC = 'desc';\n\n\t/**\n\t * The attribute name.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprivate $attribute_name;\n\n\t/**\n\t * The order.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprivate $order;\n\n\t/**\n\t * Algolia_Index_Replica constructor.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string $attribute_name The attribute name.\n\t * @param string $order          The order.\n\t *\n\t * @throws InvalidArgumentException If order is not `asc` or `desc`.\n\t */\n\tpublic function __construct( $attribute_name, $order ) {\n\t\t$this->attribute_name = (string) $attribute_name;\n\n\t\tif ( self::ORDER_ASC !== $order && self::ORDER_DESC !== $order ) {\n\t\t\tthrow new InvalidArgumentException( 'Order should be one of \\'asc\\' or \\'desc\\'.' );\n\t\t}\n\n\t\t$this->order = $order;\n\t}\n\n\t/**\n\t * Get replica index name.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param Algolia_Index $index The Algolia_Index instance.\n\t *\n\t * @return string\n\t */\n\tpublic function get_replica_index_name( Algolia_Index $index ) {\n\t\treturn (string) $index->get_name() . '_' . $this->attribute_name . '_' . $this->order;\n\t}\n\n\t/**\n\t * Get ranking.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return array\n\t */\n\tpublic function get_ranking() {\n\t\treturn array( $this->order . '(' . $this->attribute_name . ')', 'typo', 'geo', 'words', 'filters', 'proximity', 'attribute', 'exact', 'custom' );\n\t}\n\n\t/**\n\t * Get attribute name.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return string\n\t */\n\tpublic function get_attribute_name() {\n\t\treturn $this->attribute_name;\n\t}\n\n\t/**\n\t * Get order.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return string\n\t */\n\tpublic function get_order() {\n\t\treturn $this->order;\n\t}\n}\n"
  },
  {
    "path": "includes/indices/class-algolia-index.php",
    "content": "<?php\n/**\n * Algolia_Index class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\AlgoliaException;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchClient;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchIndex;\n\n/**\n * Class Algolia_Index\n *\n * @since 1.0.0\n */\nabstract class Algolia_Index {\n\n\t/**\n\t * The SearchClient instance.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var SearchClient\n\t */\n\tprivate $client;\n\n\t/**\n\t * Whether this index is enabled or not.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var bool\n\t */\n\tprivate $enabled = false;\n\n\t/**\n\t * Index name prefix.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprivate $name_prefix = '';\n\n\t/**\n\t * What this index contains.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string|null Should be one of posts, terms or users or left null.\n\t */\n\tprotected $contains_only;\n\n\t/**\n\t * Whether the reindexing operation is running or not.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.1.0\n\t *\n\t * @var bool\n\t */\n\tprotected $reindexing = false;\n\n\t/**\n\t * Get the admin name for this index.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return string The name displayed in the admin UI.\n\t */\n\tabstract public function get_admin_name();\n\n\t/**\n\t * Check if this index contains the given type.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string $type The type to check against.\n\t *\n\t * @return bool\n\t */\n\tfinal public function contains_only( $type ) {\n\t\tif ( null === $this->contains_only ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->contains_only === $type;\n\t}\n\n\t/**\n\t * Check if this index supports the given item.\n\t *\n\t * A performing function that return true if the item can potentially\n\t * be subject for indexation or not. This will be used to determine if an item is part of the index\n\t * As this function will be called synchronously during other operations,\n\t * it has to be as lightweight as possible. No db calls or huge loops.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to check against.\n\t *\n\t * @return bool\n\t */\n\tabstract public function supports( $item );\n\n\t/**\n\t * Assert if the given item is supported.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to check against.\n\t *\n\t * @throws RuntimeException If the given item is not supported.\n\t */\n\tpublic function assert_is_supported( $item ) {\n\t\tif ( ! $this->supports( $item ) ) {\n\t\t\tthrow new RuntimeException( 'Item is no supported on this index.' );\n\t\t}\n\t}\n\n\t/**\n\t * Set the SearchClient.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param SearchClient $client The SearchClient instance.\n\t */\n\tfinal public function set_client( SearchClient $client ) {\n\t\t$this->client = $client;\n\t}\n\n\t/**\n\t * Get the SearchClient.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return SearchClient The SearchClient instance.\n\t *\n\t * @throws LogicException If the SearchClient has not been set.\n\t */\n\tfinal protected function get_client() {\n\t\tif ( null === $this->client ) {\n\t\t\tthrow new LogicException( 'SearchClient has not been set.' );\n\t\t}\n\n\t\treturn $this->client;\n\t}\n\n\t/**\n\t * Search.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string     $query    The query.\n\t * @param array|null $args     The args.\n\t * @param string     $order_by The order by.\n\t * @param string     $order    The order.\n\t *\n\t * @return array\n\t */\n\tfinal public function search( $query, $args = null, $order_by = null, $order = 'desc' ) {\n\n\t\tif ( null !== $order_by ) {\n\t\t\treturn $this->search_in_replica( $query, $args, $order_by, $order );\n\t\t}\n\n\t\treturn $this->get_index()->search( $query, $args );\n\t}\n\n\t/**\n\t * Search in replica.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string $query    The query.\n\t * @param array  $args     The args.\n\t * @param string $order_by The order by.\n\t * @param string $order    The order.\n\t *\n\t * @return array\n\t */\n\tprivate function search_in_replica( $query, $args, $order_by, $order = 'desc' ) {\n\t\t$replica      = $this->get_replica( $order_by, $order );\n\t\t$replica_name = $replica->get_replica_index_name( $this );\n\n\t\t$index = $this->client->initIndex( $replica_name );\n\n\t\treturn $index->search( $query, $args );\n\t}\n\n\t/**\n\t * Get replica.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string $attribute_name The attribute name.\n\t * @param string $order          The order.\n\t *\n\t * @return Algolia_Index_Replica\n\t *\n\t * @throws RuntimeException If the replica can't be found.\n\t */\n\tprivate function get_replica( $attribute_name, $order ) {\n\t\t$replicas = $this->get_replicas();\n\t\t/**\n\t\t * Loop over the replicas.\n\t\t *\n\t\t * @author WebDevStudios <contact@webdevstudios.com>\n\t\t * @since  1.0.0\n\t\t *\n\t\t * @var Algolia_Index_Replica $replica\n\t\t */\n\t\tforeach ( $replicas as $replica ) {\n\t\t\tif ( $replica->get_attribute_name() === $attribute_name && $replica->get_order() === $order ) {\n\t\t\t\treturn $replica;\n\t\t\t}\n\t\t}\n\n\t\tthrow new RuntimeException( sprintf( 'Unable to find replica for attribute \"%s\" with order \"%s\".', $attribute_name, $order ) );\n\t}\n\n\t/**\n\t * Set enabled.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param bool $flag Enabled or not.\n\t */\n\tfinal public function set_enabled( $flag ) {\n\t\t$this->enabled = (bool) $flag;\n\t}\n\n\t/**\n\t * Check if this index is enabled.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return bool\n\t */\n\tfinal public function is_enabled() {\n\t\treturn $this->enabled;\n\t}\n\n\t/**\n\t * Set the index name prefix.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string $prefix The prefix to set.\n\t */\n\tfinal public function set_name_prefix( $prefix ) {\n\t\t$this->name_prefix = (string) $prefix;\n\t}\n\n\t/**\n\t * Sync item.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to sync.\n\t *\n\t * @return void\n\t */\n\tpublic function sync( $item ) {\n\t\t$this->assert_is_supported( $item );\n\t\tif ( $this->should_index( $item ) ) {\n\n\t\t\t/**\n\t\t\t * Fires before the sync of an item.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t *\n\t\t\t * @param mixed $item The item to sync.\n\t\t\t */\n\t\t\tdo_action( 'algolia_before_get_records', $item );\n\t\t\t$records = $this->get_records( $item );\n\n\t\t\t/**\n\t\t\t * Fires after the sync of an item.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t *\n\t\t\t * @param mixed $item The item that was sync'd.\n\t\t\t */\n\t\t\tdo_action( 'algolia_after_get_records', $item );\n\n\t\t\t$this->update_records( $item, $records );\n\t\t\treturn;\n\t\t}\n\n\t\t$this->delete_item( $item );\n\t}\n\n\t/**\n\t * Check if the item should be indexed.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to check.\n\t *\n\t * @return bool\n\t */\n\tabstract protected function should_index( $item );\n\n\t/**\n\t * Get records for the item.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to get records for.\n\t *\n\t * @return array\n\t */\n\tabstract protected function get_records( $item );\n\n\t/**\n\t * Update records.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item    The item to update records for.\n\t * @param array $records The records.\n\t *\n\t * @return void\n\t */\n\tprotected function update_records( $item, array $records ) {\n\n\t\tif ( empty( $records ) ) {\n\t\t\t$this->delete_item( $item );\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * If update_records is called from re_index,\n\t\t * skip sanitizing and saving records here,\n\t\t * as it will trigger duplicate API calls.\n\t\t */\n\t\tif ( true === $this->reindexing ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Filters the records to be updated.\n\t\t *\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param array  $records  Array of records to update.\n\t\t * @param object $item     The item to update records for.\n\t\t * @param string $index_id The index ID without prefix.\n\t\t */\n\t\t$records = apply_filters(\n\t\t\t'algolia_update_records',\n\t\t\t$records,\n\t\t\t$item,\n\t\t\t$this->get_id()\n\t\t);\n\n\t\ttry {\n\t\t\t$sanitized_records = $this->sanitize_json_data( $records );\n\t\t} catch ( \\Throwable $throwable ) {\n\t\t\terror_log( $throwable->getMessage() ); // phpcs:ignore -- Need a real logger.\n\t\t}\n\n\t\t// Don't saveObjects if sanitize_json_data failed.\n\t\tif ( empty( $sanitized_records ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$index = $this->get_index();\n\n\t\ttry {\n\t\t\t$index->saveObjects( $sanitized_records );\n\t\t} catch ( \\Throwable $throwable ) {\n\t\t\terror_log( $throwable->getMessage() ); // phpcs:ignore -- Need a real logger.\n\t\t}\n\t}\n\n\t/**\n\t * Get index.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return SearchIndex\n\t */\n\tpublic function get_index() {\n\t\treturn $this->client->initIndex( (string) $this->get_name() );\n\t}\n\n\t/**\n\t * Get name.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string|null $prefix The prefix.\n\t *\n\t * @return string\n\t */\n\tpublic function get_name( $prefix = null ) {\n\t\tif ( null === $prefix ) {\n\t\t\t$prefix = $this->name_prefix;\n\t\t}\n\n\t\treturn $prefix . $this->get_id();\n\t}\n\n\t/**\n\t * Re index.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t * @since  2.6.2 Added $specific_ids parameter\n\t *\n\t * @param int   $page         Page of the index.\n\t * @param array $specific_ids Array of IDs to specifically fetch and index.\n\t *\n\t * @throws InvalidArgumentException If the page is less than 1.\n\t */\n\tpublic function re_index( $page, $specific_ids = [] ) {\n\t\t$page = (int) $page;\n\n\t\tif ( $page < 1 ) {\n\t\t\tthrow new InvalidArgumentException( 'Page should be superior to 0.' );\n\t\t}\n\n\t\tif ( 1 === $page ) {\n\t\t\t$this->create_index_if_not_existing();\n\t\t}\n\n\t\t$batch_size = (int) $this->get_re_index_batch_size();\n\n\t\tif ( $batch_size < 1 ) {\n\t\t\tthrow new InvalidArgumentException( 'Re-index batch size can not be lower than 1.' );\n\t\t}\n\n\t\t$items_count = $this->get_re_index_items_count();\n\n\t\t$max_num_pages = (int) max( ceil( $items_count / $batch_size ), 1 );\n\n\t\t$items = $this->get_items( $page, $batch_size, $specific_ids );\n\n\t\t$records = array();\n\n\t\t/**\n\t\t * Set the reindexing bit to true.\n\t\t */\n\t\t$this->reindexing = true;\n\n\t\tforeach ( $items as $item ) {\n\t\t\tif ( ! $this->should_index( $item ) ) {\n\t\t\t\t$this->delete_item( $item );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Fires before the retrieval of a record to be re-indexed.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t *\n\t\t\t * @param mixed $item The item to be re-indexed.\n\t\t\t */\n\t\t\tdo_action( 'algolia_before_get_records', $item );\n\t\t\t$item_records = $this->get_records( $item );\n\t\t\t$records      = array_merge( $records, $item_records );\n\n\t\t\t/**\n\t\t\t * Fires after the retrieval of a record to be re-indexed.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t *\n\t\t\t * @param mixed $item The item to be re-indexed.\n\t\t\t */\n\t\t\tdo_action( 'algolia_after_get_records', $item );\n\n\t\t\t$this->update_records( $item, $item_records );\n\t\t}\n\n\t\tif ( ! empty( $records ) ) {\n\n\t\t\t/**\n\t\t\t * Filters the records to be reindexed.\n\t\t\t *\n\t\t\t * @since 2.1.0\n\t\t\t *\n\t\t\t * @param array  $records  Array of records to re-index.\n\t\t\t * @param int    $page     Page to re-index.\n\t\t\t * @param string $index_id The index ID without prefix.\n\t\t\t */\n\t\t\t$records = apply_filters(\n\t\t\t\t'algolia_re_index_records',\n\t\t\t\t$records,\n\t\t\t\t$page,\n\t\t\t\t$this->get_id()\n\t\t\t);\n\n\t\t\ttry {\n\t\t\t\t$sanitized_records = $this->sanitize_json_data( $records );\n\t\t\t} catch ( \\Throwable $throwable ) {\n\t\t\t\terror_log( $throwable->getMessage() ); // phpcs:ignore -- Need a real logger.\n\t\t\t}\n\t\t}\n\n\t\t// Don't saveObjects if sanitize_json_data failed.\n\t\tif ( ! empty( $sanitized_records ) ) {\n\n\t\t\t$index = $this->get_index();\n\n\t\t\ttry {\n\t\t\t\t$index->saveObjects( $sanitized_records );\n\t\t\t} catch ( \\Throwable $throwable ) {\n\t\t\t\terror_log( $throwable->getMessage() ); // phpcs:ignore -- Need a real logger.\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Set the reindexing bit back to false.\n\t\t */\n\t\t$this->reindexing = false;\n\n\t\tif ( $page === $max_num_pages ) {\n\n\t\t\t/**\n\t\t\t * Fires at the end of the re-index process when all items have been processed.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t *\n\t\t\t * @param string $value The ID of the index being re-indexed.\n\t\t\t */\n\t\t\tdo_action( 'algolia_re_indexed_items', $this->get_id() );\n\t\t}\n\t}\n\n\t/**\n\t * Create index if it doesn't exist.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param bool $clear_if_existing Whether to clear an existing index or not.\n\t */\n\tpublic function create_index_if_not_existing( $clear_if_existing = true ) {\n\t\t$index = $this->get_index();\n\n\t\ttry {\n\t\t\t$index->getSettings();\n\t\t\t$index_exists = true;\n\t\t} catch ( AlgoliaException $exception ) {\n\t\t\t$index_exists = false;\n\t\t}\n\n\t\tif ( true === $index_exists ) {\n\n\t\t\t/**\n\t\t\t * Allow developers to skip clearing the index.\n\t\t\t *\n\t\t\t * @since 1.3.0\n\t\t\t *\n\t\t\t * @param bool   $clear_if_existing Whether to clear the existing index or not.\n\t\t\t * @param string $index_id          The index ID without prefix.\n\t\t\t */\n\t\t\t$clear_if_existing = (bool) apply_filters(\n\t\t\t\t'algolia_clear_index_if_existing',\n\t\t\t\t$clear_if_existing,\n\t\t\t\t$this->get_id()\n\t\t\t);\n\n\t\t\tif ( true === $clear_if_existing ) {\n\t\t\t\t$index->clearObjects();\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters whether or not to force through settings for an existing index.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t *\n\t\t\t * @param bool   $value    Whether or not to force through settings. Default false.\n\t\t\t * @param string $index_id The ID of the index being considered.\n\t\t\t * @return bool  $value    Whether or not to force through settings.\n\t\t\t */\n\t\t\t$force_settings_update = (bool) apply_filters( 'algolia_should_force_settings_update', false, $this->get_id() );\n\n\t\t\t/*\n\t\t\t * No need to go further in this case.\n\t\t\t * We don't change anything when the index already exists.\n\t\t\t * This means that to override, or go back to default settings you have to\n\t\t\t * clear the index and re-index again or use the\n\t\t\t * 'algolia_force_settings_update' filter to force a settings update.\n\t\t\t */\n\t\t\tif ( false === $force_settings_update ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$this->push_settings();\n\t}\n\n\t/**\n\t * Push settings.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function push_settings() {\n\t\t$index = $this->get_index();\n\n\t\t// This will create the index if it does not exist.\n\t\t$settings = $this->get_settings();\n\t\t$index->setSettings( $settings );\n\n\t\t// Push synonyms.\n\t\t$synonyms = $this->get_synonyms();\n\t\tif ( ! empty( $synonyms ) ) {\n\t\t\t$index->saveSynonyms( $synonyms );\n\t\t}\n\n\t\t$this->sync_replicas();\n\t}\n\n\t/**\n\t * Sanitize JSON data.\n\t *\n\t * Sanitize data to allow non UTF-8 content to pass.\n\t * Here we use a private function introduced in WP 4.1.\n\t *\n\t * Since WPSWA v 1.1.0, minimum suppported WordPress version is 5.0.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $data Variable (usually an array or object) to encode as JSON.\n\t *\n\t * @return mixed The sanitized data that shall be encoded to JSON.\n\t *\n\t * @throws Exception If depth limit is reached.\n\t */\n\tprotected function sanitize_json_data( $data ) {\n\t\treturn _wp_json_sanity_check( $data, 512 );\n\t}\n\n\t/**\n\t * Get re-index items count.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return int\n\t */\n\tabstract protected function get_re_index_items_count();\n\n\t/**\n\t * Check if this is the last page to re-index.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param int $page The page to check.\n\t *\n\t * @return bool\n\t */\n\tprotected function is_last_page_to_re_index( $page ) {\n\t\treturn (int) $page >= $this->get_re_index_max_num_pages();\n\t}\n\n\t/**\n\t * Get the max number of pages for re-indexing.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return int\n\t */\n\tpublic function get_re_index_max_num_pages() {\n\t\t$items_count = $this->get_re_index_items_count();\n\n\t\treturn (int) ceil( $items_count / $this->get_re_index_batch_size() );\n\t}\n\n\t/**\n\t * De-index items.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t *\n\t * @since  1.0.0\n\t */\n\tpublic function de_index_items() {\n\t\t$index_name = $this->get_name();\n\t\t$this->client->deleteIndex( $index_name );\n\n\t\t/**\n\t\t * Fires inside the de_index_items method.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param string $value The ID of the index being de-indexed\n\t\t */\n\t\tdo_action( 'algolia_de_indexed_items', $this->get_id() );\n\t}\n\n\t/**\n\t * Get re-index batch size.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return int\n\t */\n\tpublic function get_re_index_batch_size() {\n\n\t\t/**\n\t\t * Filters the batch size to use for reindexing.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  int $value Amount of items per batch. Default 100.\n\t\t * @return int $value Amount of items per batch.\n\t\t */\n\t\t$batch_size = (int) apply_filters( 'algolia_indexing_batch_size', 100 );\n\n\t\t/**\n\t\t * Filters the batch size to use for re-indexing.\n\t\t *\n\t\t * This is a dynamic filter with `$this->get_id()` portion allowing to filter batch size for specific indexes.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param int $value      Amount of items per batch. Default 100.\n\t\t * @param int $batch_size Amount of items per batch.\n\t\t */\n\t\t$batch_size = (int) apply_filters( 'algolia_' . $this->get_id() . '_indexing_batch_size', $batch_size );\n\n\t\treturn $batch_size;\n\t}\n\n\t/**\n\t * Get settings.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return array\n\t */\n\tabstract protected function get_settings();\n\n\t/**\n\t * Get synonyms.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return array\n\t */\n\tabstract protected function get_synonyms();\n\n\t/**\n\t * Get ID.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return string\n\t */\n\tabstract public function get_id();\n\n\t/**\n\t * Get items.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param int   $page         The page.\n\t * @param int   $batch_size   The batch size.\n\t * @param array $specific_ids Array of IDs to retrieve and index.\n\t *\n\t * @return array\n\t */\n\tabstract protected function get_items( $page, $batch_size, $specific_ids = [] );\n\n\t/**\n\t * Get default autocomplete config.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return array Autocomplete config.\n\t */\n\tpublic function get_default_autocomplete_config() {\n\t\t$plugin   = Algolia_Plugin_Factory::create();\n\t\t$debounce = $plugin->get_settings()->get_autocomplete_debounce();\n\n\t\treturn array(\n\t\t\t'index_id'        => $this->get_id(),\n\t\t\t'index_name'      => $this->get_name(),\n\t\t\t'label'           => $this->get_admin_name(),\n\t\t\t'admin_name'      => $this->get_admin_name(),\n\t\t\t'position'        => 10,\n\t\t\t'max_suggestions' => 5,\n\t\t\t'debounce'        => $debounce,\n\t\t\t'tmpl_suggestion' => 'autocomplete-post-suggestion',\n\t\t);\n\t}\n\n\t/**\n\t * To array method.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return array\n\t */\n\tpublic function to_array() {\n\t\t$replicas = $this->get_replicas();\n\n\t\t$items = array();\n\t\tforeach ( $replicas as $replica ) {\n\t\t\t$items[] = array(\n\t\t\t\t'name' => $replica->get_replica_index_name( $this ),\n\t\t\t);\n\t\t}\n\n\t\treturn array(\n\t\t\t'name'     => $this->get_name(),\n\t\t\t'id'       => $this->get_id(),\n\t\t\t'enabled'  => $this->enabled,\n\t\t\t'replicas' => $items,\n\t\t);\n\t}\n\n\t/**\n\t * Get replicas.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return array\n\t */\n\tpublic function get_replicas() {\n\n\t\t/**\n\t\t * Filters the array of index replicas.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array  $value Array of replicas. Default empty array.\n\t\t * @param  object $this  Current class instance.\n\t\t * @return array  $value Array of replicas to use.\n\t\t */\n\t\t$replicas = (array) apply_filters( 'algolia_index_replicas', array(), $this );\n\n\t\t/**\n\t\t * Filters the array of index replicas\n\t\t *\n\t\t * This is a dynamic filter with the `$this->get_id()` portion allowing to filter replicas for specific indexes.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array  $value Array of replicas. Default empty array.\n\t\t * @param  object $this  Current class instance.\n\t\t * @return array  $value Array of replicas to use.\n\t\t */\n\t\t$replicas = (array) apply_filters( 'algolia_' . $this->get_id() . '_index_replicas', $replicas, $this );\n\n\t\t$filtered = array();\n\t\t// Filter out invalid inputs.\n\t\tforeach ( $replicas as $replica ) {\n\t\t\tif ( ! $replica instanceof Algolia_Index_Replica ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$filtered[] = $replica;\n\t\t}\n\n\t\treturn $filtered;\n\t}\n\n\t/**\n\t * Sync replicas.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tprivate function sync_replicas() {\n\t\t$replicas = $this->get_replicas();\n\t\tif ( empty( $replicas ) ) {\n\t\t\t// No need to go further if there are no replicas!\n\t\t\treturn;\n\t\t}\n\n\t\t$replica_index_names = array();\n\n\t\t/**\n\t\t * Loop over the replicas.\n\t\t *\n\t\t * @author WebDevStudios <contact@webdevstudios.com>\n\t\t * @since  1.0.0\n\t\t *\n\t\t * @var Algolia_Index_Replica $replica\n\t\t */\n\t\tforeach ( $replicas as $replica ) {\n\t\t\t$replica_index_names[] = $replica->get_replica_index_name( $this );\n\t\t}\n\n\t\t$this->get_index()->setSettings(\n\t\t\tarray(\n\t\t\t\t'replicas' => $replica_index_names,\n\t\t\t)\n\t\t);\n\n\t\t$client = $this->get_client();\n\n\t\t// Ensure we re-push the master index settings each time.\n\t\t$settings = $this->get_settings();\n\n\t\t/**\n\t\t * Loop over the replicas.\n\t\t *\n\t\t * @author WebDevStudios <contact@webdevstudios.com>\n\t\t * @since  1.0.0\n\t\t *\n\t\t * @var Algolia_Index_Replica $replica\n\t\t */\n\t\tforeach ( $replicas as $replica ) {\n\t\t\t$settings['ranking'] = $replica->get_ranking();\n\t\t\t$replica_index_name  = $replica->get_replica_index_name( $this );\n\t\t\t$index               = $client->initIndex( $replica_index_name );\n\t\t\t$index->setSettings( $settings );\n\t\t}\n\t}\n\n\t/**\n\t * Delete item.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to delete.\n\t */\n\tabstract public function delete_item( $item );\n\n\t/**\n\t * Check if the index exists in Algolia.\n\t *\n\t * Returns true if the index exists in Algolia.\n\t * false otherwise.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return bool\n\t *\n\t * @throws AlgoliaException If the index does not exist in Algolia.\n\t */\n\tpublic function exists() {\n\t\ttry {\n\t\t\t$this->get_index()->getSettings();\n\t\t} catch ( AlgoliaException $exception ) {\n\t\t\tif ( $exception->getMessage() === 'Index does not exist' ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\terror_log( $exception->getMessage() ); // phpcs:ignore -- Legacy.\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Clear the index.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t */\n\tpublic function clear() {\n\t\t$this->get_index()->clearObjects();\n\t}\n}\n"
  },
  {
    "path": "includes/indices/class-algolia-posts-index.php",
    "content": "<?php\n/**\n * Algolia_Posts_Index class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Posts_Index\n *\n * @since 1.0.0\n */\nfinal class Algolia_Posts_Index extends Algolia_Index {\n\n\t/**\n\t * The post type.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprivate $post_type;\n\n\t/**\n\t * What this index contains.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprotected $contains_only = 'posts';\n\n\t/**\n\t * Algolia_Posts_Index constructor.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string $post_type The post type.\n\t */\n\tpublic function __construct( $post_type ) {\n\t\t$this->post_type = (string) $post_type;\n\t}\n\n\t/**\n\t * Check if this index supports the given item.\n\t *\n\t * A performing function that return true if the item can potentially\n\t * be subject for indexation or not. This will be used to determine if an item is part of the index\n\t * As this function will be called synchronously during other operations,\n\t * it has to be as lightweight as possible. No db calls or huge loops.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to check against.\n\t *\n\t * @return bool\n\t */\n\tpublic function supports( $item ) {\n\t\treturn $item instanceof WP_Post && $item->post_type === $this->post_type;\n\t}\n\n\t/**\n\t * Get default autocomplete config.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.10.0\n\t *\n\t * @return array Autocomplete config.\n\t */\n\tpublic function get_default_autocomplete_config() {\n\t\t$default_config = parent::get_default_autocomplete_config();\n\t\t$index_name     = $this->get_name();\n\n\t\t/**\n\t\t * Filters the autocomplete debounce option for this index.\n\t\t *\n\t\t * @since 2.10.0\n\t\t *\n\t\t * @param int Debounce value in milliseconds.\n\t\t */\n\t\t$debounce = apply_filters(\n\t\t\t\"algolia_autocomplete_debounce_{$index_name}\",\n\t\t\t$default_config['debounce']\n\t\t);\n\n\t\t$config = array(\n\t\t\t'debounce' => $debounce,\n\t\t);\n\n\t\treturn array_merge( $default_config, $config );\n\t}\n\n\t/**\n\t * Get the admin name for this index.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return string The name displayed in the admin UI.\n\t */\n\tpublic function get_admin_name() {\n\t\t$post_type = get_post_type_object( $this->post_type );\n\n\t\treturn null === $post_type ? $this->post_type : $post_type->labels->name;\n\t}\n\n\t/**\n\t * Check if the item should be indexed.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to check.\n\t *\n\t * @return bool\n\t */\n\tprotected function should_index( $item ) {\n\t\treturn $this->should_index_post( $item );\n\t}\n\n\t/**\n\t * Check if the post should be indexed.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param WP_Post $post The post to check.\n\t *\n\t * @return bool\n\t */\n\tprivate function should_index_post( WP_Post $post ) {\n\t\t$post_status = $post->post_status;\n\n\t\tif ( 'inherit' === $post_status ) {\n\t\t\t$parent_post = ( $post->post_parent ) ? get_post( $post->post_parent ) : null;\n\t\t\tif ( null !== $parent_post ) {\n\t\t\t\t$post_status = $parent_post->post_status;\n\t\t\t} else {\n\t\t\t\t$post_status = 'publish';\n\t\t\t}\n\t\t}\n\n\t\t$should_index = 'publish' === $post_status && empty( $post->post_password );\n\n\t\t/**\n\t\t * Filters whether or not to index a post.\n\t\t *\n\t\t * This filter is based on if the post is published and not private.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  bool    $should_index Whether or not the post should be indexed.\n\t\t * @param  WP_Post $post         The post object.\n\t\t * @return bool    $value        Filtered should index status.\n\t\t */\n\t\treturn (bool) apply_filters( 'algolia_should_index_post', $should_index, $post );\n\t}\n\n\t/**\n\t * Get records for the item.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to get records for.\n\t *\n\t * @return array\n\t */\n\tprotected function get_records( $item ) {\n\t\treturn $this->get_post_records( $item );\n\t}\n\n\t/**\n\t * Get records for the post.\n\t *\n\t * Turns a WP_Post in a collection of records to be pushed to Algolia.\n\t * Given every single post is splitted into several Algolia records,\n\t * we also attribute an objectID that follows a naming convention for\n\t * every record.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param WP_Post $post The post to get records for.\n\t *\n\t * @return array\n\t */\n\tprivate function get_post_records( WP_Post $post ) {\n\t\t$shared_attributes = $this->get_post_shared_attributes( $post );\n\n\t\t$removed = remove_filter( 'the_content', 'wptexturize', 10 );\n\n\t\t/**\n\t\t * Filters the post's content before preparing to send to Algolia.\n\t\t *\n\t\t * This filter is run right before running through WordPress' `the_content` filter.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  string  $post_content The post's content to be indexed.\n\t\t * @param  WP_Post $post         The post object.\n\t\t * @return string  $value        The filtered content.\n\t\t */\n\t\t$post_content = apply_filters( 'algolia_post_content', $post->post_content, $post );\n\n\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t$post_content = apply_filters( 'the_content', $post_content ); // phpcs:ignore -- Legitimate use of Core hook.\n\n\t\tif ( true === $removed ) {\n\t\t\tadd_filter( 'the_content', 'wptexturize', 10 );\n\t\t}\n\n\t\t$post_content = Algolia_Utils::prepare_content( $post_content );\n\t\t$parts        = Algolia_Utils::explode_content( $post_content );\n\n\t\tif ( defined( 'ALGOLIA_SPLIT_POSTS' ) && false === ALGOLIA_SPLIT_POSTS ) {\n\t\t\t$parts = array( array_shift( $parts ) );\n\t\t}\n\n\t\t$records = array();\n\t\tforeach ( $parts as $i => $part ) {\n\t\t\t$record                 = $shared_attributes;\n\t\t\t$record['objectID']     = $this->get_post_object_id( $post->ID, $i );\n\t\t\t$record['content']      = $part;\n\t\t\t$record['record_index'] = $i;\n\t\t\t$records[]              = $record;\n\t\t}\n\n\t\t/**\n\t\t * Filters the post information that will go into the Algolia object.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array   $records Array of post information.\n\t\t * @param  WP_Post $post    The post object.\n\t\t * @return array   $value   Filtered post information.\n\t\t */\n\t\t$records = (array) apply_filters( 'algolia_post_records', $records, $post );\n\n\t\t/**\n\t\t * Filters the post information that will go into the Algolia object.\n\t\t *\n\t\t * This is a dynamic filter with the `$post->post_type` portion allowing to filter for just specific post types.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array   $records Array of post information.\n\t\t * @param  WP_Post $post    The post object.\n\t\t * @return array   $value   Filtered post information.\n\t\t */\n\t\t$records = (array) apply_filters( 'algolia_post_' . $post->post_type . '_records', $records, $post );\n\n\t\treturn $records;\n\t}\n\n\t/**\n\t * Get post shared attributes.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param WP_Post $post The post to get shared attributes for.\n\t *\n\t * @return array\n\t */\n\tprivate function get_post_shared_attributes( WP_Post $post ) {\n\t\t$shared_attributes                        = array();\n\t\t$shared_attributes['post_id']             = $post->ID;\n\t\t$shared_attributes['post_type']           = $post->post_type;\n\t\t$shared_attributes['post_type_label']     = $this->get_admin_name();\n\t\t$shared_attributes['post_title']          = $post->post_title;\n\t\t$shared_attributes['post_excerpt']        = apply_filters( 'the_excerpt', $post->post_excerpt ); // phpcs:ignore -- Legitimate use of Core hook.\n\t\t$shared_attributes['post_date']           = get_post_time( 'U', false, $post );\n\t\t$shared_attributes['post_date_formatted'] = get_the_date( '', $post );\n\t\t$shared_attributes['post_modified']       = get_post_modified_time( 'U', false, $post );\n\t\t$shared_attributes['comment_count']       = (int) $post->comment_count;\n\t\t$shared_attributes['menu_order']          = (int) $post->menu_order;\n\n\t\t$author = get_userdata( $post->post_author );\n\t\tif ( $author ) {\n\t\t\t$shared_attributes['post_author'] = array(\n\t\t\t\t'user_id'      => (int) $post->post_author,\n\t\t\t\t'display_name' => $author->display_name,\n\t\t\t\t'user_url'     => $author->user_url,\n\t\t\t\t'user_login'   => $author->user_login,\n\t\t\t);\n\t\t}\n\n\t\t$shared_attributes['images'] = Algolia_Utils::get_post_images( $post->ID );\n\n\t\t$shared_attributes['permalink']      = get_permalink( $post );\n\t\t$shared_attributes['post_mime_type'] = $post->post_mime_type;\n\n\t\t// Push all taxonomies by default, including custom ones.\n\t\t$taxonomy_objects = get_object_taxonomies( $post->post_type, 'objects' );\n\n\t\t$shared_attributes['taxonomies']              = array();\n\t\t$shared_attributes['taxonomies_hierarchical'] = array();\n\t\tforeach ( $taxonomy_objects as $taxonomy ) {\n\n\t\t\t$terms = wp_get_object_terms( $post->ID, $taxonomy->name );\n\t\t\t$terms = is_array( $terms ) ? $terms : array();\n\n\t\t\tif ( $taxonomy->hierarchical ) {\n\t\t\t\t$hierarchical_taxonomy_values = Algolia_Utils::get_taxonomy_tree( $terms, $taxonomy->name );\n\t\t\t\tif ( ! empty( $hierarchical_taxonomy_values ) ) {\n\t\t\t\t\t$shared_attributes['taxonomies_hierarchical'][ $taxonomy->name ] = $hierarchical_taxonomy_values;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$taxonomy_values = wp_list_pluck( $terms, 'name' );\n\t\t\tif ( ! empty( $taxonomy_values ) ) {\n\t\t\t\t$shared_attributes['taxonomies'][ $taxonomy->name ] = $taxonomy_values;\n\t\t\t}\n\t\t}\n\n\t\t$shared_attributes['is_sticky'] = is_sticky( $post->ID ) ? 1 : 0;\n\n\t\tif ( 'attachment' === $post->post_type ) {\n\t\t\t$shared_attributes['alt'] = get_post_meta( $post->ID, '_wp_attachment_image_alt', true );\n\n\t\t\t$metadata = get_post_meta( $post->ID, '_wp_attachment_metadata', true );\n\t\t\t$metadata = (array) apply_filters( 'wp_get_attachment_metadata', $metadata, $post->ID ); // phpcs:ignore -- Legitimate use of Core hook.\n\n\t\t\t$shared_attributes['metadata'] = $metadata;\n\t\t}\n\n\t\t/**\n\t\t * Filters the shared attributes for a post object going into Algolia.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array   $shared_attributes Array of shared attributes between posts.\n\t\t * @param  WP_Post $post              The post object.\n\t\t * @return array   $value             Array of attributes to include on the post objects.\n\t\t */\n\t\t$shared_attributes = (array) apply_filters( 'algolia_post_shared_attributes', $shared_attributes, $post );\n\n\t\t/**\n\t\t * Filters the shared attributes for a post object going into Algolia.\n\t\t *\n\t\t * This is a dynamic filter with the `$post->post_type` portion allowing to filter for just specific post types.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array   $shared_attributes Array of shared attributes between posts.\n\t\t * @param  WP_Post $post              The post object.\n\t\t * @return array   $value             Array of attributes to include on the post objects.\n\t\t */\n\t\t$shared_attributes = (array) apply_filters( 'algolia_post_' . $post->post_type . '_shared_attributes', $shared_attributes, $post );\n\n\t\treturn $shared_attributes;\n\t}\n\n\t/**\n\t * Get settings.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return array\n\t */\n\tprotected function get_settings() {\n\t\t$settings = array(\n\t\t\t'searchableAttributes'  => array(\n\t\t\t\t'unordered(post_title)',\n\t\t\t\t'unordered(taxonomies)',\n\t\t\t\t'unordered(content)',\n\t\t\t),\n\t\t\t'customRanking'         => array(\n\t\t\t\t'desc(is_sticky)',\n\t\t\t\t'desc(post_date)',\n\t\t\t\t'asc(record_index)',\n\t\t\t),\n\t\t\t'attributeForDistinct'  => 'post_id',\n\t\t\t'distinct'              => true,\n\t\t\t'attributesForFaceting' => array(\n\t\t\t\t'taxonomies',\n\t\t\t\t'taxonomies_hierarchical',\n\t\t\t\t'post_author.display_name',\n\t\t\t),\n\t\t\t'attributesToSnippet'   => array(\n\t\t\t\t'post_title:30',\n\t\t\t\t'content:30',\n\t\t\t),\n\t\t\t'snippetEllipsisText'   => '…',\n\t\t);\n\n\t\t/**\n\t\t * Filters the settings for the posts index settings.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array  $settings  Array of settings to use for the index.\n\t\t * @param  string $post_type The post type being set up.\n\t\t * @return array  $value     Filtered index settings.\n\t\t */\n\t\t$settings = (array) apply_filters( 'algolia_posts_index_settings', $settings, $this->post_type );\n\n\t\t/**\n\t\t * Filters the settings for the posts index settings.\n\t\t *\n\t\t * This is a dynamic filter with the `$this->post_type` portion allowing to filter for just specific post types.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array $settings Array of settings to use for the index.\n\t\t * @return array $value    Filtered index settings.\n\t\t */\n\t\t$settings = (array) apply_filters( 'algolia_posts_' . $this->post_type . '_index_settings', $settings );\n\n\t\t/**\n\t\t * Replacing `attributesToIndex` with `searchableAttributes` as\n\t\t * it has been replaced by Algolia.\n\t\t *\n\t\t * @link  https://www.algolia.com/doc/api-reference/api-parameters/searchableAttributes/\n\t\t * @since 2.2.0\n\t\t */\n\t\tif (\n\t\t\tarray_key_exists( 'attributesToIndex', $settings )\n\t\t\t&& is_array( $settings['attributesToIndex'] )\n\t\t) {\n\t\t\t$settings['searchableAttributes'] = array_merge(\n\t\t\t\t$settings['searchableAttributes'],\n\t\t\t\t$settings['attributesToIndex']\n\t\t\t);\n\t\t\tunset( $settings['attributesToIndex'] );\n\t\t}\n\n\t\treturn $settings;\n\t}\n\n\t/**\n\t * Get synonyms.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return array\n\t */\n\tprotected function get_synonyms() {\n\n\t\t/**\n\t\t * Filters the posts index synonyms to use.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array  $value     Array of synonyms to use. Default empty array.\n\t\t * @param  string $post_type The post type being set up.\n\t\t * @return array  $value     Filtered array of synonyms.\n\t\t */\n\t\t$synonyms = (array) apply_filters( 'algolia_posts_index_synonyms', array(), $this->post_type );\n\n\t\t/**\n\t\t * Filters the posts index synonyms to use.\n\t\t *\n\t\t * This is a dynamic filter with the `$this->post_type` portion allowing to filter for just specific post types.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array $value Array of synonyms to use. Default empty array.\n\t\t * @return array $value Filtered array of synonyms.\n\t\t */\n\t\t$synonyms = (array) apply_filters( 'algolia_posts_' . $this->post_type . '_index_synonyms', $synonyms );\n\n\t\treturn $synonyms;\n\t}\n\n\t/**\n\t * Get post object ID.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param int $post_id      The WP_Post ID.\n\t * @param int $record_index The split record index.\n\t *\n\t * @return string\n\t */\n\tprivate function get_post_object_id( $post_id, $record_index ) {\n\t\t/**\n\t\t * Allow filtering of the post object ID.\n\t\t *\n\t\t * @since 1.3.0\n\t\t *\n\t\t * @param string $post_object_id The Algolia objectID.\n\t\t * @param int    $post_id        The WordPress post ID.\n\t\t * @param int    $record_index   Index of the split post record.\n\t\t */\n\t\treturn apply_filters(\n\t\t\t'algolia_get_post_object_id',\n\t\t\t$post_id . '-' . $record_index,\n\t\t\t$post_id,\n\t\t\t$record_index\n\t\t);\n\t}\n\n\t/**\n\t * Update records.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item    The item to update records for.\n\t * @param array $records The records.\n\t */\n\tprotected function update_records( $item, array $records ) {\n\t\t$this->update_post_records( $item, $records );\n\t}\n\n\t/**\n\t * Update post records.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param WP_Post $post    The post to update records for.\n\t * @param array   $records The records.\n\t */\n\tprivate function update_post_records( WP_Post $post, array $records ) {\n\t\t// If there are no records, parent `update_records` will take care of the deletion.\n\t\t// In case of posts, we ALWAYS need to delete existing records.\n\t\tif ( ! empty( $records ) ) {\n\t\t\t/**\n\t\t\t * Filters whether or not to use synchronous wait on record update operations.\n\t\t\t *\n\t\t\t * @author WebDevStudios <contact@webdevstudios.com>\n\t\t\t * @since 2.6.1\n\t\t\t *\n\t\t\t * @param bool    $value   Whether or not to use synchronous wait. Default false.\n\t\t\t * @param WP_Post $post    Current post object being updated.\n\t\t\t * @param array   $records The records\n\t\t\t *\n\t\t\t * @return bool\n\t\t\t */\n\t\t\t$should_wait = (bool) apply_filters( 'algolia_should_wait_on_delete_item', false, $post, $records );\n\t\t\t$this->delete_item( $post, $should_wait );\n\t\t}\n\n\t\tparent::update_records( $post, $records );\n\n\t\t// Keep track of the new record count for future updates relying on the objectID's naming convention .\n\t\t$new_records_count = count( $records );\n\t\t$this->set_post_records_count( $post, $new_records_count );\n\n\t\t/**\n\t\t * Fires after a given post was updated in Algolia.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param WP_Post $post    The post object being updated.\n\t\t * @param array   $records The records.\n\t\t */\n\t\tdo_action( 'algolia_posts_index_post_updated', $post, $records );\n\n\t\t/**\n\t\t * Fires after a given post was updated in Algolia.\n\t\t *\n\t\t * This is a dynamic action hook with the `$post->post_type` portion allowing to hook in for only specific post types.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param WP_Post $post    The post object being updated.\n\t\t * @param array   $records The records.\n\t\t */\n\t\tdo_action( 'algolia_posts_index_post_' . $post->post_type . '_updated', $post, $records );\n\t}\n\n\t/**\n\t * Get ID.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return string\n\t */\n\tpublic function get_id() {\n\t\treturn 'posts_' . $this->post_type;\n\t}\n\n\t/**\n\t * Get re-index items count.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return int\n\t */\n\tprotected function get_re_index_items_count() {\n\t\t$query = new WP_Query(\n\t\t\t[\n\t\t\t\t'post_type'              => $this->post_type,\n\t\t\t\t'post_status'            => 'any', // Let the `should_index` take care of the filtering.\n\t\t\t\t'suppress_filters'       => true,\n\t\t\t\t'cache_results'          => false,\n\t\t\t\t'update_post_term_cache' => false,\n\t\t\t]\n\t\t);\n\n\t\treturn (int) $query->found_posts;\n\t}\n\n\t/**\n\t * Get items.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t * @since  2.6.2 Added $specific_ids parameter\n\t *\n\t * @param int   $page         The page.\n\t * @param int   $batch_size   The batch size.\n\t * @param array $specific_ids Array of post IDs to retrieve and index.\n\t *\n\t * @return array\n\t */\n\tprotected function get_items( $page, $batch_size, $specific_ids = [] ) {\n\t\t$args = [\n\t\t\t'post_type'        => $this->post_type,\n\t\t\t'posts_per_page'   => $batch_size,\n\t\t\t'post_status'      => 'any',\n\t\t\t'order'            => 'ASC',\n\t\t\t'orderby'          => 'ID',\n\t\t\t'paged'            => $page,\n\t\t\t'suppress_filters' => true,\n\t\t];\n\t\tif ( ! empty( $specific_ids ) && is_array( $specific_ids ) ) {\n\t\t\t$args['post__in'] = $specific_ids;\n\t\t}\n\t\t$query = new WP_Query( $args );\n\n\t\treturn $query->posts;\n\t}\n\n\t/**\n\t * Delete item.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to delete.\n\t * @param bool  $wait Wait for the operation to complete synchronously.\n\t */\n\tpublic function delete_item( $item, $wait = false ) {\n\t\t$this->assert_is_supported( $item );\n\n\t\t$records_count = $this->get_post_records_count( $item->ID );\n\t\t$object_ids    = array();\n\t\tfor ( $i = 0; $i < $records_count; $i++ ) {\n\t\t\t$object_ids[] = $this->get_post_object_id( $item->ID, $i );\n\t\t}\n\n\t\tif ( empty( $object_ids ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $wait ) {\n\t\t\t$this->get_index()->deleteObjects( $object_ids )->wait();\n\t\t\treturn;\n\t\t}\n\n\t\t$this->get_index()->deleteObjects( $object_ids );\n\t}\n\n\t/**\n\t * Get post records count.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param int $post_id The post ID.\n\t *\n\t * @return int\n\t */\n\tprivate function get_post_records_count( $post_id ) {\n\t\treturn (int) get_post_meta( (int) $post_id, 'algolia_' . $this->get_id() . '_records_count', true );\n\t}\n\n\t/**\n\t * Get post records count.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param WP_Post $post  The post.\n\t * @param int     $count The count of records.\n\t */\n\tprivate function set_post_records_count( WP_Post $post, $count ) {\n\t\tupdate_post_meta( (int) $post->ID, 'algolia_' . $this->get_id() . '_records_count', (int) $count );\n\t}\n}\n"
  },
  {
    "path": "includes/indices/class-algolia-searchable-posts-index.php",
    "content": "<?php\n/**\n * Algolia_Searchable_Posts_Index class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Searchable_Posts_Index\n *\n * @since 1.0.0\n */\nfinal class Algolia_Searchable_Posts_Index extends Algolia_Index {\n\n\t/**\n\t * What this index contains.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprotected $contains_only = 'posts';\n\n\t/**\n\t * Array of post types for the searchable posts index.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var array\n\t */\n\tprivate $post_types;\n\n\t/**\n\t * Algolia_Searchable_Posts_Index constructor.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param array $post_types The post types.\n\t */\n\tpublic function __construct( array $post_types ) {\n\t\t$this->post_types = $post_types;\n\t}\n\n\t/**\n\t * Check if this index supports the given item.\n\t *\n\t * A performing function that return true if the item can potentially\n\t * be subject for indexation or not. This will be used to determine if an item is part of the index\n\t * As this function will be called synchronously during other operations,\n\t * it has to be as lightweight as possible. No db calls or huge loops.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to check against.\n\t *\n\t * @return bool\n\t */\n\tpublic function supports( $item ) {\n\t\treturn $item instanceof WP_Post && in_array( $item->post_type, $this->post_types, true );\n\t}\n\n\t/**\n\t * Get default autocomplete config.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.10.0\n\t *\n\t * @return array Autocomplete config.\n\t */\n\tpublic function get_default_autocomplete_config() {\n\t\t$default_config = parent::get_default_autocomplete_config();\n\t\t$index_name     = $this->get_name();\n\n\t\t/**\n\t\t * Filters the autocomplete debounce value for this index.\n\t\t *\n\t\t * @since 2.10.0\n\t\t *\n\t\t * @param int Debounce value in milliseconds.\n\t\t */\n\t\t$debounce = apply_filters(\n\t\t\t\"algolia_autocomplete_debounce_{$index_name}\",\n\t\t\t$default_config['debounce']\n\t\t);\n\n\t\t$config = array(\n\t\t\t'debounce' => $debounce,\n\t\t);\n\n\t\treturn array_merge( $default_config, $config );\n\t}\n\n\t/**\n\t * Get the admin name for this index.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return string The name displayed in the admin UI.\n\t */\n\tpublic function get_admin_name() {\n\t\treturn __( 'All posts', 'wp-search-with-algolia' );\n\t}\n\n\t/**\n\t * Check if the item should be indexed.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to check.\n\t *\n\t * @return bool\n\t */\n\tprotected function should_index( $item ) {\n\t\treturn $this->should_index_post( $item );\n\t}\n\n\t/**\n\t * Check if the post should be indexed.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param WP_Post $post The post to check.\n\t *\n\t * @return bool\n\t */\n\tprivate function should_index_post( WP_Post $post ) {\n\t\t$should_index = 'publish' === $post->post_status && empty( $post->post_password );\n\n\t\t/**\n\t\t * Filters whether or not to index a searchable post.\n\t\t *\n\t\t * This filter is based on if the post is published and not private.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  bool    $should_index Whether or not the post should be indexed.\n\t\t * @param  WP_Post $post         The post object.\n\t\t * @return bool    $value        Filtered should index status.\n\t\t */\n\t\treturn (bool) apply_filters( 'algolia_should_index_searchable_post', $should_index, $post );\n\t}\n\n\t/**\n\t * Get records for the item.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to get records for.\n\t *\n\t * @return array\n\t */\n\tprotected function get_records( $item ) {\n\t\treturn $this->get_post_records( $item );\n\t}\n\n\t/**\n\t * Get records for the post.\n\t *\n\t * Turns a WP_Post in a collection of records to be pushed to Algolia.\n\t * Given every single post is splitted into several Algolia records,\n\t * we also attribute an objectID that follows a naming convention for\n\t * every record.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param WP_Post $post The post to get records for.\n\t *\n\t * @return array\n\t */\n\tprivate function get_post_records( WP_Post $post ) {\n\t\t$shared_attributes = $this->get_post_shared_attributes( $post );\n\n\t\t$removed = remove_filter( 'the_content', 'wptexturize', 10 );\n\n\t\t/**\n\t\t * Filters the searchable post's content before preparing to send to Algolia.\n\t\t *\n\t\t * This filter is run right before running through WordPress' `the_content` filter.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  string  $post_content The post's content to be indexed.\n\t\t * @param  WP_Post $post         The post object.\n\t\t * @return string  $value        The filtered content.\n\t\t */\n\t\t$post_content = apply_filters( 'algolia_searchable_post_content', $post->post_content, $post );\n\n\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t$post_content = apply_filters( 'the_content', $post_content ); // phpcs:ignore -- Legitimate use of Core hook.\n\n\t\tif ( true === $removed ) {\n\t\t\tadd_filter( 'the_content', 'wptexturize', 10 );\n\t\t}\n\n\t\t$post_content = Algolia_Utils::prepare_content( $post_content );\n\t\t$parts        = Algolia_Utils::explode_content( $post_content );\n\n\t\tif ( defined( 'ALGOLIA_SPLIT_POSTS' ) && false === ALGOLIA_SPLIT_POSTS ) {\n\t\t\t$parts = array( array_shift( $parts ) );\n\t\t}\n\n\t\t$records = array();\n\t\tforeach ( $parts as $i => $part ) {\n\t\t\t$record                 = $shared_attributes;\n\t\t\t$record['objectID']     = $this->get_post_object_id( $post->ID, $i );\n\t\t\t$record['content']      = $part;\n\t\t\t$record['record_index'] = $i;\n\t\t\t$records[]              = $record;\n\t\t}\n\n\t\t/**\n\t\t * Filters the searchable post information that will go into the Algolia object.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array   $records Array of post information.\n\t\t * @param  WP_Post $post    The post object.\n\t\t * @return array   $value   Filtered post information.\n\t\t */\n\t\t$records = (array) apply_filters( 'algolia_searchable_post_records', $records, $post );\n\n\t\t/**\n\t\t * Filters the searchable post information that will go into the Algolia object.\n\t\t *\n\t\t * This is a dynamic filter with the `$post->post_type` portion allowing to filter for just specific post types.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array   $records Array of post information.\n\t\t * @param  WP_Post $post    The post object.\n\t\t * @return array   $value   Filtered post information.\n\t\t */\n\t\t$records = (array) apply_filters( 'algolia_searchable_post_' . $post->post_type . '_records', $records, $post );\n\n\t\treturn $records;\n\t}\n\n\t/**\n\t * Get post shared attributes.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param WP_Post $post The post to get shared attributes for.\n\t *\n\t * @return array\n\t *\n\t * @throws RuntimeException If post type information unknown.\n\t */\n\tprivate function get_post_shared_attributes( WP_Post $post ) {\n\t\t$shared_attributes              = array();\n\t\t$shared_attributes['post_id']   = $post->ID;\n\t\t$shared_attributes['post_type'] = $post->post_type;\n\n\t\t$post_type = get_post_type_object( $post->post_type );\n\t\tif ( null === $post_type ) {\n\t\t\tthrow new RuntimeException( 'Unable to fetch the post type information.' );\n\t\t}\n\t\t$shared_attributes['post_type_label']     = $post_type->labels->name;\n\t\t$shared_attributes['post_title']          = $post->post_title;\n\t\t$shared_attributes['post_excerpt']        = apply_filters( 'the_excerpt', $post->post_excerpt ); // phpcs:ignore -- Legitimate use of Core hook.\n\t\t$shared_attributes['post_date']           = get_post_time( 'U', false, $post );\n\t\t$shared_attributes['post_date_formatted'] = get_the_date( '', $post );\n\t\t$shared_attributes['post_modified']       = get_post_modified_time( 'U', false, $post );\n\t\t$shared_attributes['comment_count']       = (int) $post->comment_count;\n\t\t$shared_attributes['menu_order']          = (int) $post->menu_order;\n\n\t\t$author = get_userdata( $post->post_author );\n\t\tif ( $author ) {\n\t\t\t$shared_attributes['post_author'] = array(\n\t\t\t\t'user_id'      => (int) $post->post_author,\n\t\t\t\t'display_name' => $author->display_name,\n\t\t\t\t'user_url'     => $author->user_url,\n\t\t\t\t'user_login'   => $author->user_login,\n\t\t\t);\n\t\t}\n\n\t\t$shared_attributes['images'] = Algolia_Utils::get_post_images( $post->ID );\n\n\t\t$shared_attributes['permalink']      = get_permalink( $post );\n\t\t$shared_attributes['post_mime_type'] = $post->post_mime_type;\n\n\t\t// Push all taxonomies by default, including custom ones.\n\t\t$taxonomy_objects = get_object_taxonomies( $post->post_type, 'objects' );\n\n\t\t$shared_attributes['taxonomies']              = array();\n\t\t$shared_attributes['taxonomies_hierarchical'] = array();\n\t\tforeach ( $taxonomy_objects as $taxonomy ) {\n\t\t\t$terms = wp_get_object_terms( $post->ID, $taxonomy->name );\n\t\t\t$terms = is_array( $terms ) ? $terms : array();\n\n\t\t\tif ( $taxonomy->hierarchical ) {\n\t\t\t\t$hierarchical_taxonomy_values = Algolia_Utils::get_taxonomy_tree( $terms, $taxonomy->name );\n\t\t\t\tif ( ! empty( $hierarchical_taxonomy_values ) ) {\n\t\t\t\t\t$shared_attributes['taxonomies_hierarchical'][ $taxonomy->name ] = $hierarchical_taxonomy_values;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$taxonomy_values = wp_list_pluck( $terms, 'name' );\n\t\t\tif ( ! empty( $taxonomy_values ) ) {\n\t\t\t\t$shared_attributes['taxonomies'][ $taxonomy->name ] = $taxonomy_values;\n\t\t\t}\n\t\t}\n\n\t\t$shared_attributes['is_sticky'] = is_sticky( $post->ID ) ? 1 : 0;\n\n\t\t/**\n\t\t * Filters the shared attributes for a searchable post object going into Algolia.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array   $shared_attributes Array of shared attributes between posts.\n\t\t * @param  WP_Post $post              The post object.\n\t\t * @return array   $value             Array of attributes to include on the post objects.\n\t\t */\n\t\t$shared_attributes = (array) apply_filters( 'algolia_searchable_post_shared_attributes', $shared_attributes, $post );\n\n\t\t/**\n\t\t * Filters the shared attributes for a searchable post object going into Algolia.\n\t\t *\n\t\t * This is a dynamic filter with the `$post->post_type` portion allowing to filter for just specific post types.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array   $shared_attributes Array of shared attributes between posts.\n\t\t * @param  WP_Post $post              The post object.\n\t\t * @return array   $value             Array of attributes to include on the post objects.\n\t\t */\n\t\t$shared_attributes = (array) apply_filters( 'algolia_searchable_post_' . $post->post_type . '_shared_attributes', $shared_attributes, $post );\n\n\t\treturn $shared_attributes;\n\t}\n\n\t/**\n\t * Get settings.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return array\n\t */\n\tprotected function get_settings() {\n\t\t$settings = array(\n\t\t\t'searchableAttributes'  => array(\n\t\t\t\t'unordered(post_title)',\n\t\t\t\t'unordered(taxonomies)',\n\t\t\t\t'unordered(content)',\n\t\t\t),\n\t\t\t'customRanking'         => array(\n\t\t\t\t'desc(is_sticky)',\n\t\t\t\t'desc(post_date)',\n\t\t\t\t'asc(record_index)',\n\t\t\t),\n\t\t\t'attributeForDistinct'  => 'post_id',\n\t\t\t'distinct'              => true,\n\t\t\t'attributesForFaceting' => array(\n\t\t\t\t'taxonomies',\n\t\t\t\t'taxonomies_hierarchical',\n\t\t\t\t'post_author.display_name',\n\t\t\t\t'post_type_label',\n\t\t\t),\n\t\t\t'attributesToSnippet'   => array(\n\t\t\t\t'post_title:30',\n\t\t\t\t'content:' . intval( apply_filters( 'excerpt_length', 55 ) ), // phpcs:ignore -- Legitimate use of Core hook.\n\t\t\t),\n\t\t\t'snippetEllipsisText'   => '…',\n\t\t);\n\n\t\t/**\n\t\t * Filters the settings for the searchable posts index settings.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array $settings Array of settings to use for the index.\n\t\t * @return array $value    Filtered index settings.\n\t\t */\n\t\t$settings = (array) apply_filters( 'algolia_searchable_posts_index_settings', $settings );\n\n\t\t/**\n\t\t * Replacing `attributesToIndex` with `searchableAttributes` as\n\t\t * it has been replaced by Algolia.\n\t\t *\n\t\t * @link  https://www.algolia.com/doc/api-reference/api-parameters/searchableAttributes/\n\t\t * @since 2.2.0\n\t\t */\n\t\tif (\n\t\t\tarray_key_exists( 'attributesToIndex', $settings )\n\t\t\t&& is_array( $settings['attributesToIndex'] )\n\t\t) {\n\t\t\t$settings['searchableAttributes'] = array_merge(\n\t\t\t\t$settings['searchableAttributes'],\n\t\t\t\t$settings['attributesToIndex']\n\t\t\t);\n\t\t\tunset( $settings['attributesToIndex'] );\n\t\t}\n\n\t\treturn $settings;\n\t}\n\n\t/**\n\t * Get synonyms.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return array\n\t */\n\tprotected function get_synonyms() {\n\t\t/**\n\t\t * Filters the searchable posts index synonyms to use.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array $value Array of synonyms to use. Default empty array.\n\t\t * @return array $value Filtered array of synonyms.\n\t\t */\n\t\t$synonyms = (array) apply_filters( 'algolia_searchable_posts_index_synonyms', array() );\n\n\t\treturn $synonyms;\n\t}\n\n\t/**\n\t * Get post object ID.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param int $post_id      The WP_Post ID.\n\t * @param int $record_index The split record index.\n\t *\n\t * @return string\n\t */\n\tprivate function get_post_object_id( $post_id, $record_index ) {\n\t\t/**\n\t\t * This filter is documented in includes/indices/class-algolia-posts-index.php\n\t\t *\n\t\t * @since 1.3.0\n\t\t *\n\t\t * @see Algolia_Posts_Index::get_post_object_id()\n\t\t */\n\t\treturn apply_filters(\n\t\t\t'algolia_get_post_object_id',\n\t\t\t$post_id . '-' . $record_index,\n\t\t\t$post_id,\n\t\t\t$record_index\n\t\t);\n\t}\n\n\t/**\n\t * Update records.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item    The item to update records for.\n\t * @param array $records The records.\n\t */\n\tprotected function update_records( $item, array $records ) {\n\t\t$this->update_post_records( $item, $records );\n\t}\n\n\t/**\n\t * Update post records.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param WP_Post $post    The post to update records for.\n\t * @param array   $records The records.\n\t */\n\tprivate function update_post_records( WP_Post $post, array $records ) {\n\t\t// If there are no records, parent `update_records` will take care of the deletion.\n\t\t// In case of posts, we ALWAYS need to delete existing records.\n\t\tif ( ! empty( $records ) ) {\n\t\t\t/**\n\t\t\t * Filters whether or not to use synchronous wait on record update operations.\n\t\t\t *\n\t\t\t * @author WebDevStudios <contact@webdevstudios.com>\n\t\t\t * @since 2.6.1\n\t\t\t *\n\t\t\t * @param bool    $value   Whether or not to use synchronous wait. Default false.\n\t\t\t * @param WP_Post $post    Current post object being updated.\n\t\t\t * @param array   $records The records.\n\t\t\t *\n\t\t\t * @return bool\n\t\t\t */\n\t\t\t$should_wait = (bool) apply_filters( 'algolia_should_wait_on_delete_item', false, $post, $records );\n\t\t\t$this->delete_item( $post, $should_wait );\n\t\t}\n\n\t\tparent::update_records( $post, $records );\n\n\t\t// Keep track of the new record count for future updates relying on the objectID's naming convention .\n\t\t$new_records_count = count( $records );\n\t\t$this->set_post_records_count( $post, $new_records_count );\n\n\t\t/**\n\t\t * Fires after a given post was updated in Algolia.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param WP_Post $post    The post object being updated.\n\t\t * @param array   $records The records.\n\t\t */\n\t\tdo_action( 'algolia_searchable_posts_index_post_updated', $post, $records );\n\n\t\t/**\n\t\t * Fires after a given post was updated in Algolia.\n\t\t *\n\t\t * This is a dynamic action hook with the `$post->post_type` portion allowing to hook in for only specific post types.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param WP_Post $post    The post object being updated.\n\t\t * @param array   $records The records.\n\t\t */\n\t\tdo_action( 'algolia_searchable_posts_index_post_' . $post->post_type . '_updated', $post, $records );\n\t}\n\n\t/**\n\t * Get ID.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return string\n\t */\n\tpublic function get_id() {\n\t\treturn 'searchable_posts';\n\t}\n\n\t/**\n\t * Get re-index items count.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return int\n\t */\n\tprotected function get_re_index_items_count() {\n\t\t$query = new WP_Query(\n\t\t\t[\n\t\t\t\t'post_type'              => $this->post_types,\n\t\t\t\t'post_status'            => 'any', // Let the `should_index` take care of the filtering.\n\t\t\t\t'suppress_filters'       => true,\n\t\t\t\t'cache_results'          => false,\n\t\t\t\t'update_post_term_cache' => false,\n\t\t\t]\n\t\t);\n\n\t\treturn (int) $query->found_posts;\n\t}\n\n\t/**\n\t * Get items.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t * @since  2.6.2 Added $specific_ids parameter\n\t *\n\t * @param int   $page         The page.\n\t * @param int   $batch_size   The batch size.\n\t * @param array $specific_ids Array of post IDs to retrieve and index.\n\t *\n\t * @return array\n\t */\n\tpublic function get_items( $page, $batch_size, $specific_ids = [] ) {\n\t\t$args = [\n\t\t\t'post_type'              => $this->post_types,\n\t\t\t'posts_per_page'         => $batch_size,\n\t\t\t'post_status'            => 'any',\n\t\t\t'order'                  => 'ASC',\n\t\t\t'orderby'                => 'ID',\n\t\t\t'paged'                  => $page,\n\t\t\t'suppress_filters'       => true,\n\t\t\t'cache_results'          => false,\n\t\t\t'lazy_load_term_meta'    => false,\n\t\t\t'update_post_term_cache' => false,\n\t\t];\n\t\tif ( ! empty( $specific_ids ) && is_array( $specific_ids ) ) {\n\t\t\t$args['post__in'] = $specific_ids;\n\t\t}\n\t\t$query = new WP_Query( $args );\n\n\t\treturn $query->posts;\n\t}\n\n\t/**\n\t * Delete item.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to delete.\n\t * @param bool  $wait Wait for the operation to complete synchronously.\n\t */\n\tpublic function delete_item( $item, $wait = false ) {\n\t\t$this->assert_is_supported( $item );\n\n\t\t$records_count = $this->get_post_records_count( $item->ID );\n\t\t$object_ids    = array();\n\t\tfor ( $i = 0; $i < $records_count; $i++ ) {\n\t\t\t$object_ids[] = $this->get_post_object_id( $item->ID, $i );\n\t\t}\n\n\t\tif ( empty( $object_ids ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $wait ) {\n\t\t\t$this->get_index()->deleteObjects( $object_ids )->wait();\n\t\t\treturn;\n\t\t}\n\n\t\t$this->get_index()->deleteObjects( $object_ids );\n\t}\n\n\t/**\n\t * Get post records count.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param int $post_id The post ID.\n\t *\n\t * @return int\n\t */\n\tprivate function get_post_records_count( $post_id ) {\n\t\treturn (int) get_post_meta( (int) $post_id, 'algolia_' . $this->get_id() . '_records_count', true );\n\t}\n\t/**\n\t * Set post records count.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param WP_Post $post  The post.\n\t * @param int     $count The count of records.\n\t */\n\tprivate function set_post_records_count( WP_Post $post, $count ) {\n\t\tupdate_post_meta( (int) $post->ID, 'algolia_' . $this->get_id() . '_records_count', (int) $count );\n\t}\n}\n"
  },
  {
    "path": "includes/indices/class-algolia-terms-index.php",
    "content": "<?php\n/**\n * Algolia_Terms_Index class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Terms_Index\n *\n * @since 1.0.0\n */\nfinal class Algolia_Terms_Index extends Algolia_Index {\n\n\t/**\n\t * What this index contains.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprotected $contains_only = 'terms';\n\n\t/**\n\t * The taxonomy for this index.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprivate $taxonomy;\n\n\t/**\n\t * Algolia_Terms_Index constructor.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string $taxonomy The taxonomy for this index.\n\t */\n\tpublic function __construct( $taxonomy ) {\n\t\t$this->taxonomy = (string) $taxonomy;\n\t}\n\n\t/**\n\t * Get the admin name for this index.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return string The name displayed in the admin UI.\n\t */\n\tpublic function get_admin_name() {\n\t\t$taxonomy = get_taxonomy( $this->taxonomy );\n\n\t\treturn $taxonomy->labels->name;\n\t}\n\n\t/**\n\t * Check if the item should be indexed.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to check.\n\t *\n\t * @return bool\n\t */\n\tprotected function should_index( $item ) {\n\t\t// For now we index the term if it is in use somewhere.\n\t\t$should_index = $item->count > 0;\n\n\t\t/**\n\t\t * Filters whether or not to index a term.\n\t\t *\n\t\t * This filter is based on if it is used on at least one post.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  bool  $should_index Whether or not the term should be indexed.\n\t\t * @param  mixed $item         The term object.\n\t\t * @return bool  $value        Filtered should index status.\n\t\t */\n\t\treturn (bool) apply_filters( 'algolia_should_index_term', $should_index, $item );\n\t}\n\n\t/**\n\t * Get records for the item.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to get records for.\n\t *\n\t * @return array\n\t */\n\tprotected function get_records( $item ) {\n\t\t$record                = array();\n\t\t$record['objectID']    = $item->term_id;\n\t\t$record['term_id']     = $item->term_id;\n\t\t$record['taxonomy']    = $item->taxonomy;\n\t\t$record['name']        = html_entity_decode( $item->name );\n\t\t$record['description'] = $item->description;\n\t\t$record['slug']        = $item->slug;\n\t\t$record['posts_count'] = (int) $item->count;\n\t\tif ( function_exists( 'wpcom_vip_get_term_link' ) ) {\n\t\t\t$record['permalink'] = wpcom_vip_get_term_link( $item );\n\t\t} else {\n\t\t\t$record['permalink'] = get_term_link( $item );\n\t\t}\n\n\t\t/**\n\t\t * Filters the term information that will go into the Algolia object.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array $record Array of term information.\n\t\t * @param  mixed $item   The term object.\n\t\t * @return array $value  Filtered term information.\n\t\t */\n\t\t$record = (array) apply_filters( 'algolia_term_record', $record, $item );\n\n\t\t/**\n\t\t * Filters the term information that will go into the Algolia object.\n\t\t *\n\t\t * This is a dynamic filter with the `$item->taxonomy` portion allowing to filter for just specific taxonomies.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array $record Array of term information.\n\t\t * @param  mixed $item   The term object.\n\t\t * @return array $value  Filtered term information.\n\t\t */\n\t\t$record = (array) apply_filters( 'algolia_term_' . $item->taxonomy . '_record', $record, $item );\n\n\t\treturn array( $record );\n\t}\n\n\t/**\n\t * Get re-index items count.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return int\n\t */\n\tprotected function get_re_index_items_count() {\n\t\treturn (int) wp_count_terms( $this->taxonomy );\n\t}\n\n\t/**\n\t * Get settings.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return array\n\t */\n\tprotected function get_settings() {\n\t\t$settings = array(\n\t\t\t'searchableAttributes' => array(\n\t\t\t\t'unordered(name)',\n\t\t\t\t'unordered(description)',\n\t\t\t),\n\t\t\t'customRanking'        => array(\n\t\t\t\t'desc(posts_count)',\n\t\t\t),\n\t\t);\n\n\t\t/**\n\t\t * Filters the settings for the terms index settings.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array  $settings Array of settings to use for the index.\n\t\t * @param  string $taxonomy Taxonomy slug for the current taxonomy index.\n\t\t * @return array  $value    Filtered index settings.\n\t\t */\n\t\t$settings = (array) apply_filters( 'algolia_terms_index_settings', $settings, $this->taxonomy );\n\n\t\t/**\n\t\t * Filters the settings for the terms index settings.\n\t\t *\n\t\t * This is a dynamic filter with the `$item->taxonomy` portion allowing to filter for just specific taxonomies.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array $settings Array of settings to use for the index\n\t\t * @return array $value    Filtered index settings.\n\t\t */\n\t\t$settings = (array) apply_filters( 'algolia_terms_' . $this->taxonomy . '_index_settings', $settings );\n\n\t\t/**\n\t\t * Replacing `attributesToIndex` with `searchableAttributes` as\n\t\t * it has been replaced by Algolia.\n\t\t *\n\t\t * @link  https://www.algolia.com/doc/api-reference/api-parameters/searchableAttributes/\n\t\t * @since 2.2.0\n\t\t */\n\t\tif (\n\t\t\tarray_key_exists( 'attributesToIndex', $settings )\n\t\t\t&& is_array( $settings['attributesToIndex'] )\n\t\t) {\n\t\t\t$settings['searchableAttributes'] = array_merge(\n\t\t\t\t$settings['searchableAttributes'],\n\t\t\t\t$settings['attributesToIndex']\n\t\t\t);\n\t\t\tunset( $settings['attributesToIndex'] );\n\t\t}\n\n\t\treturn $settings;\n\t}\n\n\t/**\n\t * Get synonyms.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return array\n\t */\n\tprotected function get_synonyms() {\n\n\t\t/**\n\t\t * Filters the terms index synonyms to use.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array $value Array of synonyms to use. Default empty array.\n\t\t * @return array $value Filtered array of synonyms.\n\t\t */\n\t\treturn (array) apply_filters( 'algolia_terms_index_synonyms', array() );\n\t}\n\n\t/**\n\t * Get ID.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return string\n\t */\n\tpublic function get_id() {\n\t\treturn 'terms_' . $this->taxonomy;\n\t}\n\n\n\t/**\n\t * Get items.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param int   $page         The page.\n\t * @param int   $batch_size   The batch size.\n\t * @param array $specific_ids Array of terms to retrieve and index.\n\t *\n\t * @return array\n\t */\n\tprotected function get_items( $page, $batch_size, $specific_ids = [] ) {\n\t\t$offset = $batch_size * ( $page - 1 );\n\n\t\t$args = [\n\t\t\t'taxonomy'   => $this->taxonomy,\n\t\t\t'order'      => 'ASC',\n\t\t\t'orderby'    => 'id',\n\t\t\t'offset'     => $offset,\n\t\t\t'number'     => $batch_size,\n\t\t\t'hide_empty' => false, // Let users choose what to index.\n\t\t];\n\n\t\tif ( ! empty( $specific_ids ) && is_array( $specific_ids ) ) {\n\t\t\t$args['include'] = $specific_ids;\n\t\t}\n\n\t\treturn get_terms( $args );\n\t}\n\n\t/**\n\t * Check if this index supports the given item.\n\t *\n\t * A performing function that return true if the item can potentially\n\t * be subject for indexation or not. This will be used to determine if an item is part of the index\n\t * As this function will be called synchronously during other operations,\n\t * it has to be as lightweight as possible. No db calls or huge loops.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to check against.\n\t *\n\t * @return bool\n\t */\n\tpublic function supports( $item ) {\n\t\treturn isset( $item->term_id )\n\t\t\t&& is_int( $item->term_id )\n\t\t\t&& isset( $item->taxonomy )\n\t\t\t&& $item->taxonomy === $this->taxonomy;\n\t}\n\n\t/**\n\t * Get default autocomplete config.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return array Autocomplete config.\n\t */\n\tpublic function get_default_autocomplete_config() {\n\t\t$default_config = parent::get_default_autocomplete_config();\n\t\t$index_name     = $this->get_name();\n\n\t\t/**\n\t\t * Filters the autocomplete debounce option for this index.\n\t\t *\n\t\t * @since 2.10.0\n\t\t *\n\t\t * @param int Debounce value in milliseconds.\n\t\t */\n\t\t$debounce = apply_filters(\n\t\t\t\"algolia_autocomplete_debounce_{$index_name}\",\n\t\t\t$default_config['debounce']\n\t\t);\n\n\t\t$config = array(\n\t\t\t'position'        => 20,\n\t\t\t'max_suggestions' => 3,\n\t\t\t'debounce'        => $debounce,\n\t\t\t'tmpl_suggestion' => 'autocomplete-term-suggestion',\n\t\t);\n\n\t\treturn array_merge( $default_config, $config );\n\t}\n\n\t/**\n\t * Delete item.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to delete.\n\t */\n\tpublic function delete_item( $item ) {\n\t\t$this->assert_is_supported( $item );\n\t\t$this->get_index()->deleteObject( $item->term_id );\n\t}\n}\n"
  },
  {
    "path": "includes/indices/class-algolia-users-index.php",
    "content": "<?php\n/**\n * Algolia_Users_Index class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Users_Index\n *\n * @since 1.0.0\n */\nfinal class Algolia_Users_Index extends Algolia_Index {\n\n\t/**\n\t * What this index contains.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var string\n\t */\n\tprotected $contains_only = 'users';\n\n\t/**\n\t * Get the admin name for this index.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return string The name displayed in the admin UI.\n\t */\n\tpublic function get_admin_name() {\n\t\treturn __( 'Users', 'wp-search-with-algolia' );\n\t}\n\n\t/**\n\t * Check if the item should be indexed.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to check.\n\t *\n\t * @return bool\n\t */\n\tprotected function should_index( $item ) {\n\t\tif ( function_exists( 'wpcom_vip_count_user_posts' ) ) {\n\t\t\t$should_index = (int) wpcom_vip_count_user_posts( $item->ID ) > 0;\n\t\t} else {\n\t\t\t$should_index = (int) count_user_posts( $item->ID ) > 0;\n\t\t}\n\n\t\t/**\n\t\t * Filters whether or not to index a user.\n\t\t *\n\t\t * This filter is based on if the user has a published post.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  bool  $should_index Whether or not the user should be indexed.\n\t\t * @param  mixed $item         The user object.\n\t\t * @return bool  $value        Filtered should index status.\n\t\t */\n\t\treturn (bool) apply_filters( 'algolia_should_index_user', $should_index, $item );\n\t}\n\n\t/**\n\t * Get records for the item.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to get records for.\n\t *\n\t * @return array\n\t */\n\tprotected function get_records( $item ) {\n\t\t$record                 = array();\n\t\t$record['objectID']     = $item->ID;\n\t\t$record['user_id']      = $item->ID;\n\t\t$record['display_name'] = $item->display_name;\n\t\t$record['posts_url']    = get_author_posts_url( $item->ID, $item->user_nicename );\n\t\t$record['description']  = get_the_author_meta( 'description', $item->ID );\n\n\t\tif ( function_exists( 'wpcom_vip_count_user_posts' ) ) {\n\t\t\t$record['posts_count'] = (int) wpcom_vip_count_user_posts( $item->ID );\n\t\t} else {\n\t\t\t$record['posts_count'] = (int) count_user_posts( $item->ID );\n\t\t}\n\n\t\t$avatar_size = 32;\n\t\tif ( function_exists( 'get_avatar_url' ) ) {\n\t\t\t$record['avatar_url'] = get_avatar_url(\n\t\t\t\t$item->ID,\n\t\t\t\tarray(\n\t\t\t\t\t'size' => $avatar_size,\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t$email_hash           = md5( strtolower( trim( $item->user_email ) ) );\n\t\t\t$record['avatar_url'] = 'https://www.gravatar.com/avatar/' . $email_hash . '?s=' . $avatar_size;\n\t\t}\n\n\t\t/**\n\t\t * Filters the user information that will go into the Algolia object.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array $record Array of user information.\n\t\t * @param  mixed $item   The user object.\n\t\t * @return array $value  Filtered user information.\n\t\t */\n\t\t$record = (array) apply_filters( 'algolia_user_record', $record, $item );\n\n\t\treturn array( $record );\n\t}\n\n\t/**\n\t * Get re-index items count.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return int\n\t */\n\tprotected function get_re_index_items_count() {\n\t\t$users_count = count_users();\n\n\t\treturn (int) $users_count['total_users'];\n\t}\n\n\t/**\n\t * Get settings.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return array\n\t */\n\tprotected function get_settings() {\n\t\t$settings = array(\n\t\t\t'searchableAttributes' => array(\n\t\t\t\t'unordered(display_name)',\n\t\t\t),\n\t\t\t'customRanking'        => array(\n\t\t\t\t'desc(posts_count)',\n\t\t\t),\n\t\t);\n\n\t\t/**\n\t\t * Filters the settings for the users index settings.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array $settings Array of settings to use for the index.\n\t\t * @return array $value    Filtered index settings.\n\t\t */\n\t\t$settings = (array) apply_filters( 'algolia_users_index_settings', $settings );\n\n\t\t/**\n\t\t * Replacing `attributesToIndex` with `searchableAttributes` as\n\t\t * it has been replaced by Algolia.\n\t\t *\n\t\t * @link  https://www.algolia.com/doc/api-reference/api-parameters/searchableAttributes/\n\t\t * @since 2.2.0\n\t\t */\n\t\tif (\n\t\t\tarray_key_exists( 'attributesToIndex', $settings )\n\t\t\t&& is_array( $settings['attributesToIndex'] )\n\t\t) {\n\t\t\t$settings['searchableAttributes'] = array_merge(\n\t\t\t\t$settings['searchableAttributes'],\n\t\t\t\t$settings['attributesToIndex']\n\t\t\t);\n\t\t\tunset( $settings['attributesToIndex'] );\n\t\t}\n\n\t\treturn $settings;\n\t}\n\n\t/**\n\t * Get synonyms.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return array\n\t */\n\tprotected function get_synonyms() {\n\n\t\t/**\n\t\t * Filters the users index synonyms to use.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param  array $value Array of synonyms to use.\n\t\t * @return array $value Filtered array of synonyms.\n\t\t */\n\t\treturn (array) apply_filters( 'algolia_users_index_synonyms', array() );\n\t}\n\n\t/**\n\t * Get ID.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return string\n\t */\n\tpublic function get_id() {\n\t\treturn 'users';\n\t}\n\n\n\t/**\n\t * Get items.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param int   $page         The page.\n\t * @param int   $batch_size   The batch size.\n\t * @param array $specific_ids Array of user to retrieve and index.\n\t *\n\t * @return array\n\t */\n\tprotected function get_items( $page, $batch_size, $specific_ids = [] ) {\n\t\t$offset = $batch_size * ( $page - 1 );\n\n\t\t$args = [\n\t\t\t'order'   => 'ASC',\n\t\t\t'orderby' => 'ID',\n\t\t\t'offset'  => $offset,\n\t\t\t'number'  => $batch_size,\n\t\t];\n\n\t\tif ( ! empty( $specific_ids ) && is_array( $specific_ids ) ) {\n\t\t\t$args['include'] = $specific_ids;\n\t\t}\n\n\t\t// We use prior to 4.5 syntax for BC purposes, no `paged` arg.\n\t\treturn get_users( $args );\n\t}\n\n\t/**\n\t * Check if this index supports the given item.\n\t *\n\t * A performing function that return true if the item can potentially\n\t * be subject for indexation or not. This will be used to determine if an item is part of the index\n\t * As this function will be called synchronously during other operations,\n\t * it has to be as lightweight as possible. No db calls or huge loops.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to check against.\n\t *\n\t * @return bool\n\t */\n\tpublic function supports( $item ) {\n\t\treturn $item instanceof WP_User;\n\t}\n\n\t/**\n\t * Get default autocomplete config.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @return array Autocomplete config.\n\t */\n\tpublic function get_default_autocomplete_config() {\n\t\t$default_config = parent::get_default_autocomplete_config();\n\t\t$index_name     = $this->get_name();\n\n\t\t/**\n\t\t * Filters the autocomplete debounce value for this index.\n\t\t *\n\t\t * @since 2.10.0\n\t\t *\n\t\t * @param int Debounce value in milliseconds.\n\t\t */\n\t\t$debounce = apply_filters(\n\t\t\t\"algolia_autocomplete_debounce_{$index_name}\",\n\t\t\t$default_config['debounce']\n\t\t);\n\n\t\t$config = array(\n\t\t\t'position'        => 30,\n\t\t\t'max_suggestions' => 3,\n\t\t\t'debounce'        => $debounce,\n\t\t\t'tmpl_suggestion' => 'autocomplete-user-suggestion',\n\t\t);\n\n\t\treturn array_merge( $default_config, $config );\n\t}\n\n\t/**\n\t * Delete item.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param mixed $item The item to delete.\n\t */\n\tpublic function delete_item( $item ) {\n\t\t$this->assert_is_supported( $item );\n\t\t$this->get_index()->deleteObject( $item->ID );\n\t}\n}\n"
  },
  {
    "path": "includes/indices/index.php",
    "content": "<?php // Silence is golden\n"
  },
  {
    "path": "includes/utilities/class-algolia-health-panel.php",
    "content": "<?php\n/**\n * Algolia_Health_Panel class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   2.10.0\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Health_Panel\n *\n * @since 2.10.0\n */\nclass Algolia_Health_Panel {\n\n\t/**\n\t * The Algolia Plugin.\n\t *\n\t * @since   2.10.0\n\t * @var Algolia_Plugin\n\t */\n\tprivate $plugin;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @param Algolia_Plugin $plugin The Algolia Plugin instance.\n\t */\n\tpublic function __construct( Algolia_Plugin $plugin ) {\n\t\t$this->plugin = $plugin;\n\n\t\tadd_filter( 'debug_information', [ $this, 'health_panel' ], 1 );\n\t}\n\n\t/**\n\t * Add a Site Health panel for our plugin.\n\t *\n\t * @since 2.10.0\n\t * @param array $debug_info The debug information array to filter.\n\t *\n\t * @return array\n\t */\n\tpublic function health_panel( array $debug_info ) {\n\n\t\t$set_constants = [];\n\t\tforeach ( $this->get_constants() as $constant ) {\n\t\t\t$set_constants[ $constant ] = defined( $constant ) ? 'constant' : 'db/default';\n\t\t}\n\n\t\t$debug_info['wp-search-with-algolia'] = [\n\t\t\t'label'       => esc_html__( 'WP Search with Algolia', 'wp-search-with-algolia' ),\n\t\t\t'description' => esc_html__( 'Debugging and troubleshooting information for support purposes', 'wp-search-with-algolia' ),\n\t\t\t'fields'      => [\n\t\t\t\t[\n\t\t\t\t\t'label' => esc_html__( 'Constants', 'wp-search-with-algolia' ),\n\t\t\t\t\t'value' => $set_constants,\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'label' => 'Reachable API',\n\t\t\t\t\t'value' => $this->plugin->get_settings()->get_api_is_reachable() ? 'true' : 'false',\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'label' => 'Searchable Posts Index Enabled',\n\t\t\t\t\t'value' => $this->plugin->get_index( 'searchable_posts' )->is_enabled() ? 'true' : 'false',\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'label' => 'Autocomplete Enabled',\n\t\t\t\t\t'value' => $this->plugin->get_settings()->get_autocomplete_enabled() ? 'true' : 'false',\n\t\t\t\t],\n\t\t\t],\n\t\t];\n\n\t\treturn $debug_info;\n\t}\n\n\t/**\n\t * Return an array of constants to check set status for.\n\t *\n\t * @since 2.10.0\n\t *\n\t * @return array\n\t */\n\tprotected function get_constants() : array {\n\t\treturn [\n\t\t\t'ALGOLIA_HIDE_HELP_NOTICES',\n\t\t\t'ALGOLIA_SPLIT_POSTS',\n\t\t\t'ALGOLIA_CONTENT_MAX_SIZE',\n\t\t\t'ALGOLIA_APPLICATION_ID',\n\t\t\t'ALGOLIA_SEARCH_API_KEY',\n\t\t\t'ALGOLIA_API_KEY',\n\t\t\t'ALGOLIA_INDEX_NAME_PREFIX',\n\t\t];\n\t}\n}\n"
  },
  {
    "path": "includes/utilities/class-algolia-template-utils.php",
    "content": "<?php\n/**\n * Algolia_Template_Utils class file.\n *\n * @since   1.8.0\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Template_Utils\n *\n * @since 1.8.0\n */\nclass Algolia_Template_Utils {\n\n\t/**\n\t * The plugin template directory name.\n\t *\n\t * @since 1.8.0\n\t *\n\t * @var string\n\t */\n\tconst PLUGIN_TEMPLATES_DIR = 'templates';\n\n\t/**\n\t * The theme template directory name.\n\t *\n\t * @since 1.8.0\n\t *\n\t * @var string\n\t */\n\tconst THEME_TEMPLATES_DIR = 'algolia';\n\n\t/**\n\t * The template file names.\n\t *\n\t * @since 1.8.0\n\t *\n\t * @var string[]\n\t */\n\tconst TEMPLATE_FILE_NAMES = [\n\t\t'autocomplete.php',\n\t\t'instantsearch.php',\n\t\t'instantsearch-modern.php',\n\t];\n\n\t/**\n\t * Get the plugin templates directory with trailing slash.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.8.0\n\t *\n\t * @return string The plugin templates directory name with trailing slash.\n\t */\n\tpublic static function get_plugin_templates_dirname() {\n\t\treturn (string) self::PLUGIN_TEMPLATES_DIR . '/';\n\t}\n\n\t/**\n\t * Get the \"unfiltered\" theme templates directory with trailing slash.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.8.0\n\t *\n\t * @return string The theme templates directory name with trailing slash.\n\t */\n\tpublic static function get_theme_templates_dirname() {\n\t\treturn (string) self::THEME_TEMPLATES_DIR . '/';\n\t}\n\n\t/**\n\t * Get the \"filtered\" theme templates directory name with trailing slash.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.8.0\n\t *\n\t * @return string The theme templates directory name with trailing slash.\n\t */\n\tpublic static function get_filtered_theme_templates_dirname() {\n\n\t\t$path = self::get_theme_templates_dirname();\n\n\t\t/**\n\t\t * Allow developers to override the theme templates dirname.\n\t\t *\n\t\t * @since      1.0.0\n\t\t * @deprecated 1.8.0 Use {@see 'algolia_theme_templates_dirname'} instead.\n\t\t *\n\t\t * @param string $path The theme templates directory name with trailing slash.\n\t\t *                     Defaults to 'algolia/'.\n\t\t */\n\t\t$path = (string) apply_filters_deprecated(\n\t\t\t'algolia_templates_path',\n\t\t\t[ $path ],\n\t\t\t'1.8.0',\n\t\t\t'algolia_theme_templates_dirname'\n\t\t);\n\n\t\t/**\n\t\t * Allow developers to override the theme templates dirname.\n\t\t *\n\t\t * @since  1.8.0\n\t\t *\n\t\t * @param string $path The theme templates directory name with trailing slash.\n\t\t *                     Defaults to 'algolia/'.\n\t\t */\n\t\treturn (string) apply_filters(\n\t\t\t'algolia_theme_templates_dirname',\n\t\t\t$path\n\t\t);\n\t}\n\n\t/**\n\t * Get the \"unfiltered\" full path to the default template file in the plugin.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.8.0\n\t *\n\t * @param string $file The template filename.\n\t *\n\t * @return string Full path to the template file.\n\t */\n\tpublic static function get_default_template( $file ) {\n\t\treturn (string) ALGOLIA_PATH . self::get_plugin_templates_dirname() . $file;\n\t}\n\n\t/**\n\t * Get the \"filtered\" full path to the default template file in the plugin.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.8.0\n\t *\n\t * @param string $file The template filename.\n\t *\n\t * @return string Full path to the template file.\n\t */\n\tpublic static function get_filtered_default_template( $file ) {\n\t\t/**\n\t\t * Allow developers to override the default template.\n\t\t *\n\t\t * @todo Should this even be allowed?\n\t\t *\n\t\t * @since  1.0.0\n\t\t *\n\t\t * @param string $template Full path to the default template file.\n\t\t * @param string $file     The default template file.\n\t\t */\n\t\treturn (string) apply_filters(\n\t\t\t'algolia_default_template',\n\t\t\tself::get_default_template( $file ),\n\t\t\t$file\n\t\t);\n\t}\n\n\t/**\n\t * Locate a template.\n\t *\n\t * There are numerous filters related to changing template locations,\n\t * which makes it a little more difficult than it should be\n\t * to find where a \"customized\" template actually exists.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.8.0\n\t *\n\t * @param string $file The template file.\n\t *\n\t * @return string Full path to the template file.\n\t */\n\tpublic static function locate_template( $file ) {\n\n\t\t/**\n\t\t * FIlters the location to look for template files.\n\t\t *\n\t\t * Allows for providing template files outside of the active theme\n\t\t * and outside of the plugin's default chain to check.\n\t\t *\n\t\t * Return null to resume checking all normal paths.\n\t\t *\n\t\t * @since 2.5.0\n\t\t *\n\t\t * @param  mixed  $value Custom server path to check for a file at. Default null.\n\t\t * @param  string $file  The current template file being requested.\n\t\t * @return string $value Specified file path.\n\t\t */\n\t\t$custom_location = apply_filters(\n\t\t\t'algolia_custom_template_location',\n\t\t\tnull,\n\t\t\t$file\n\t\t);\n\n\t\tif ( ! empty( $custom_location ) ) {\n\t\t\treturn $custom_location;\n\t\t}\n\n\t\t$locations = [\n\t\t\t$file,\n\t\t];\n\n\t\t$templates_path = self::get_filtered_theme_templates_dirname();\n\n\t\tif ( self::get_theme_templates_dirname() !== $templates_path ) {\n\t\t\t$locations[] = self::get_theme_templates_dirname() . $file;\n\t\t}\n\n\t\t$locations[] = $templates_path . $file;\n\n\t\t/**\n\t\t * Allow developers to override the template locations.\n\t\t *\n\t\t * @todo Should this even be allowed?\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param array  $locations Array of template locations.\n\t\t * @param string $file      The template file.\n\t\t */\n\t\t$locations = (array) apply_filters(\n\t\t\t'algolia_template_locations',\n\t\t\t$locations,\n\t\t\t$file\n\t\t);\n\n\t\t$template = locate_template(\n\t\t\tarray_unique( $locations )\n\t\t);\n\n\t\t$filtered_default = self::get_filtered_default_template( $file );\n\n\t\treturn (string) $template ? $template : $filtered_default;\n\t}\n\n\t/**\n\t * Retrieve template version.\n\t *\n\t * Based on WooCommerce's WC_Admin_Status::get_file_version() method.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.8.0\n\t *\n\t * @param string $template Full path to the template file.\n\t *\n\t * @return null|string Template version number string if it exists,\n\t *                     empty string if no version number exists,\n\t *                     else null if template file is not found or can't be read.\n\t */\n\tpublic static function get_template_version( $template ): ?string {\n\n\t\t// Null, if template file does not exist or cannot be read.\n\t\tif ( ! is_file( $template ) || ! is_readable( $template ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fopen\n\t\t$pointer = fopen( $template, 'r' );\n\n\t\t// phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fread\n\t\t$file_data = fread( $pointer, 8192 );\n\n\t\t// phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fclose\n\t\tfclose( $pointer );\n\n\t\t$file_data = str_replace( \"\\r\", \"\\n\", $file_data );\n\n\t\t// Empty string, if version cannot be determined.\n\t\t$version = '';\n\n\t\tpreg_match(\n\t\t\t'/^[ \\t\\/*#@]*' . preg_quote( '@version', '/' ) . '(.*)$/mi',\n\t\t\t$file_data,\n\t\t\t$matches\n\t\t);\n\n\t\tif ( empty( $matches[1] ) ) {\n\t\t\treturn $version;\n\t\t}\n\n\t\treturn _cleanup_header_comment( $matches[1] );\n\t}\n\n\t/**\n\t * Get the Alglia Template File Names.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.8.0\n\t *\n\t * @return array\n\t */\n\tpublic static function get_template_file_names(): array {\n\t\treturn (array) self::TEMPLATE_FILE_NAMES;\n\t}\n\n\t/**\n\t * Get unfiltered array of plugin's core template paths.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.8.0\n\t *\n\t * @return array An array of the plugin's core template paths.\n\t */\n\tpublic static function get_core_template_paths(): array {\n\t\t$plugin_template_paths = [];\n\t\t$template_filenames    = self::get_template_file_names();\n\t\tforeach ( $template_filenames as $file ) {\n\t\t\t$plugin_template_paths[ $file ] = self::get_default_template( $file );\n\t\t}\n\n\t\treturn (array) $plugin_template_paths;\n\t}\n\n\t/**\n\t * Get array of located template paths.\n\t *\n\t * There are numerous filters related to changing template locations,\n\t * which makes it a little more difficult than it should be\n\t * to find where a \"customized\" template actually exists.\n\t * For that reason, we will call this \"located template paths.\"\n\t * They aren't necessarily customized template paths from the theme,\n\t * they might be the same as the plugin's core templates.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.8.0\n\t *\n\t * @return array\n\t */\n\tpublic static function get_located_template_paths(): array {\n\t\t$located_template_paths = [];\n\t\t$template_filenames     = self::get_template_file_names();\n\t\tforeach ( $template_filenames as $file ) {\n\t\t\t$located_template_paths[ $file ] = self::locate_template( $file );\n\t\t}\n\n\t\treturn (array) $located_template_paths;\n\t}\n\n\t/**\n\t * Get array of custom template paths.\n\t *\n\t * Diffs the plugin's core template paths against the located template paths.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.8.0\n\t *\n\t * @return array Array of custom template paths,\n\t *               else empty array if no custom templates found.\n\t */\n\tpublic static function get_custom_template_paths(): array {\n\n\t\t$customized_template_paths = array_diff(\n\t\t\tself::get_located_template_paths(),\n\t\t\tself::get_core_template_paths()\n\t\t);\n\n\t\tif ( empty( $customized_template_paths ) ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn (array) $customized_template_paths;\n\t}\n}\n"
  },
  {
    "path": "includes/utilities/class-algolia-update-messages.php",
    "content": "<?php\n/**\n * Algolia_Update_Messages class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.8.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Update_Messages\n *\n * @since 1.8.0\n */\nclass Algolia_Update_Messages {\n\n\t/**\n\t * Constructor.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.8.0\n\t */\n\tpublic function __construct() {\n\t\tadd_action(\n\t\t\t'in_plugin_update_message-' . ALGOLIA_PLUGIN_BASENAME,\n\t\t\t[ $this, 'in_plugin_update_message' ],\n\t\t\t10,\n\t\t\t2\n\t\t);\n\t}\n\n\t/**\n\t * Update notice.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.8.0\n\t *\n\t * @param array  $plugin_data {\n\t *     An array of plugin metadata.\n\t *\n\t *     @type string $name        The human-readable name of the plugin.\n\t *     @type string $plugin_uri  Plugin URI.\n\t *     @type string $version     Plugin version.\n\t *     @type string $description Plugin description.\n\t *     @type string $author      Plugin author.\n\t *     @type string $author_uri  Plugin author URI.\n\t *     @type string $text_domain Plugin text domain.\n\t *     @type string $domain_path Relative path to the plugin's .mo file(s).\n\t *     @type bool   $network     Whether the plugin can only be activated network wide.\n\t *     @type string $title       The human-readable title of the plugin.\n\t *     @type string $author_name Plugin author's name.\n\t *     @type bool   $update      Whether there's an available update. Default null.\n\t * }\n\t *\n\t * @param object $response {\n\t *     An array of metadata about the available plugin update.\n\t *\n\t *     @type int    $id          Plugin ID.\n\t *     @type string $slug        Plugin slug.\n\t *     @type string $new_version New plugin version.\n\t *     @type string $url         Plugin URL.\n\t *     @type string $package     Plugin update package URL.\n\t * }\n\t *\n\t * @return void\n\t */\n\tpublic function in_plugin_update_message( $plugin_data, $response ) {\n\n\t\t$h4_open  = '<h4 class=\"update-available\">';\n\t\t$h4_close = '</h4>';\n\n\t\t$ul_open  = '<ul class=\"update-available\">';\n\t\t$ul_close = '</ul>';\n\n\t\t$changelist = '';\n\n\t\t$current_major_version = Algolia_Version_Utils::get_major_version(\n\t\t\t$plugin_data['Version']\n\t\t);\n\n\t\t$new_major_version = Algolia_Version_Utils::get_major_version(\n\t\t\t$response->new_version\n\t\t);\n\n\t\tif ( $current_major_version === $new_major_version ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$update_title = sprintf(\n\t\t\t// translators: placeholder 1 is current plugin version, placeholder 2 is the available update version.\n\t\t\tesc_html__( 'This is a major version update, from %1$s to %2$s, which may contain backwards incompatible changes.', 'wp-search-with-algolia' ),\n\t\t\t$plugin_data['Version'],\n\t\t\t$response->new_version\n\t\t);\n\n\t\trequire_once ABSPATH . 'wp-admin/includes/plugin-install.php';\n\n\t\t$plugin_information = plugins_api(\n\t\t\t'plugin_information',\n\t\t\t[ 'slug' => $response->slug ]\n\t\t);\n\n\t\tif (\n\t\t\t! $plugin_information\n\t\t\t|| is_wp_error( $plugin_information )\n\t\t\t|| empty( $plugin_information->sections['changelog'] )\n\t\t) {\n\t\t\techo wp_kses_post( $h4_open . $update_title . $h4_close );\n\t\t\treturn;\n\t\t}\n\n\t\t$changelog = $plugin_information->sections['changelog'];\n\n\t\t$changes = preg_replace( '#<\\s*?p\\b[^>]*>(.*?)</p\\b[^>]*>#s', '', $changelog );\n\n\t\t$pos = stripos( $changes, '<h4>' . $plugin_data['Version'] . '</h4>' );\n\n\t\tif ( false === $pos ) {\n\t\t\techo wp_kses_post( $h4_open . $update_title . $h4_close );\n\t\t\treturn;\n\t\t}\n\n\t\t$changes = trim( substr( $changes, 0, $pos ) );\n\n\t\t$changes = preg_replace( '/<h4>(.*)<\\/h4>.*/iU', '', $changes );\n\n\t\t$changelist .= $ul_open . strip_tags( $changes, '<li>' ) . $ul_close;\n\n\t\techo wp_kses_post( $h4_open . $update_title . $h4_close . $changelist );\n\t}\n}\n"
  },
  {
    "path": "includes/utilities/class-algolia-version-utils.php",
    "content": "<?php\n/**\n * Algolia_Version_Utils class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.8.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Class Algolia_Version_Utils\n *\n * @since 1.8.0\n */\nclass Algolia_Version_Utils {\n\n\t/**\n\t * Semantic versioning regular expression pattern.\n\t *\n\t * @link https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n\t * @link https://regex101.com/r/Ly7O1x/3/\n\t *\n\t * @since   1.8.0\n\t *\n\t * @var string\n\t */\n\tconst SEMVER_PATTERN = '%^(?P<major>0|[1-9]\\d*)\\.(?P<minor>0|[1-9]\\d*)\\.(?P<patch>0|[1-9]\\d*)(?:-(?P<prerelease>(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$%';\n\n\t/**\n\t * Parse version string into array of semver components.\n\t *\n\t * Supports MAJOR.MINOR.PATCH-prerelease+buildmetadata.\n\t * Given a valid semantic version string, such as '1.8.0-dev+build.1',\n\t * will return an array of matches that follow Semantic Versioning 2.0.0.\n\t * Example return...\n\t *     $matches = [\n\t *         0               => '1.8.0-dev+build.1',\n\t *         'major'         => '1',\n\t *         1               => '1',\n\t *         'minor'         => '8',\n\t *         2               => '8',\n\t *         'patch'         => '0',\n\t *         3               => '0',\n\t *         'prerelease'    => 'dev',\n\t *         4               => 'dev',\n\t *         'buildmetadata' => 'build.1',\n\t *         5               => 'build.1',\n\t *     ];\n\t *\n\t * @link https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.8.0\n\t *\n\t * @param string $version Version number string.\n\t *\n\t * @return array\n\t */\n\tpublic static function parse_semver_version_string( string $version ): array {\n\t\t$matches = [];\n\t\tpreg_match(\n\t\t\tself::SEMVER_PATTERN,\n\t\t\t$version,\n\t\t\t$matches\n\t\t);\n\n\t\treturn $matches;\n\t}\n\n\t/**\n\t * Get the MAJOR version number from version string.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.8.0\n\t *\n\t * @param string $version Version number string.\n\t *\n\t * @return int|null\n\t */\n\tpublic static function get_major_version( string $version ): ?int {\n\t\t$matches = self::parse_semver_version_string( $version );\n\t\tif ( empty( $matches['major'] ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (int) $matches['major'];\n\t}\n\n\t/**\n\t * Get the MINOR version number from version string.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.8.0\n\t *\n\t * @param string $version Version number string.\n\t *\n\t * @return int|null\n\t */\n\tpublic static function get_minor_version( string $version ): ?int {\n\t\t$matches = self::parse_semver_version_string( $version );\n\t\tif ( empty( $matches['minor'] ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (int) $matches['minor'];\n\t}\n\n\t/**\n\t * Get the PATCH version number from version string.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.8.0\n\t *\n\t * @param string $version Version number string.\n\t *\n\t * @return int|null\n\t */\n\tpublic static function get_patch_version( string $version ): ?int {\n\t\t$matches = self::parse_semver_version_string( $version );\n\t\tif ( empty( $matches['patch'] ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (int) $matches['patch'];\n\t}\n}\n"
  },
  {
    "path": "includes/watchers/class-algolia-changes-watcher.php",
    "content": "<?php\n/**\n * Algolia_Changes_Watcher interface file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\n/**\n * Interface Algolia_Changes_Watcher\n *\n * @since 1.0.0\n */\ninterface Algolia_Changes_Watcher {\n\n\t/**\n\t * Watch WordPress events.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t */\n\tpublic function watch();\n}\n"
  },
  {
    "path": "includes/watchers/class-algolia-post-changes-watcher.php",
    "content": "<?php\n/**\n * Algolia_Post_Changes_Watcher class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\AlgoliaException;\n\n/**\n * Class Algolia_Post_Changes_Watcher\n *\n * @since 1.0.0\n */\nclass Algolia_Post_Changes_Watcher implements Algolia_Changes_Watcher {\n\n\t/**\n\t * Algolia_Index instance.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var Algolia_Index\n\t */\n\tprivate $index;\n\n\t/**\n\t * Deleted posts array.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var array\n\t */\n\tprivate $posts_deleted = array();\n\n\t/**\n\t * Updated posts array.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.6.0\n\t *\n\t * @var array\n\t */\n\tprivate $posts_updated = [];\n\n\t/**\n\t * Whether or not we have detected fast mode for a given import.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since 2.6.1\n\t *\n\t * @var bool\n\t */\n\tpublic static $pmxi_is_fast_mode;\n\n\t/**\n\t * All Import Batch size being processed.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since 2.6.2\n\t *\n\t * @var int\n\t */\n\tpublic static $pmxi_batch_size;\n\n\t/**\n\t * All Import total count being processed.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since 2.6.2\n\t *\n\t * @var int\n\t */\n\tpublic static $pmxi_total_count;\n\n\t/**\n\t * All Import max pages being processed.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since 2.6.2\n\t *\n\t * @var int\n\t */\n\tpublic static $pmxi_max_num_pages;\n\n\t/**\n\t * Algolia_Post_Changes_Watcher constructor.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param Algolia_Index $index Algolia_Index instance.\n\t */\n\tpublic function __construct( Algolia_Index $index ) {\n\t\t$this->index = $index;\n\t}\n\n\t/**\n\t * Watch WordPress events.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t */\n\tpublic function watch() {\n\t\t// Fires once a post has been saved.\n\t\t// Moved from save_post to wp_after_insert_post in version 2.7.0.\n\t\tadd_action( 'wp_after_insert_post', array( $this, 'sync_item' ) );\n\n\t\t// Fires before a post is deleted, at the start of wp_delete_post().\n\t\t// At this stage the post metas are still available, and we need them.\n\t\tadd_action( 'before_delete_post', array( $this, 'delete_item' ) );\n\n\t\t// Handle meta changes after the change occurred.\n\t\tadd_action( 'added_post_meta', array( $this, 'on_meta_change' ), 10, 4 );\n\t\tadd_action( 'updated_post_meta', array( $this, 'on_meta_change' ), 10, 4 );\n\t\tadd_action( 'deleted_post_meta', array( $this, 'on_meta_change' ), 10, 4 );\n\n\t\t// Handle attachment changes. These are required because the other post hooks are not triggered.\n\t\tadd_action( 'add_attachment', array( $this, 'sync_item' ) );\n\t\tadd_action( 'attachment_updated', array( $this, 'sync_item' ) );\n\t\tadd_action( 'delete_attachment', array( $this, 'delete_item' ) );\n\t\tadd_action( 'pre_post_update', [ $this, 'check_slug_update' ], 10, 2 );\n\n\t\t// Support for WP All Import \"fast mode\".\n\t\tadd_action( 'pmxi_saved_post', [ $this, 'track_updated_posts' ] );\n\t\tadd_action( 'pmxi_after_post_import', [ $this, 'sync_item_for_pmxi' ] );\n\t}\n\n\t/**\n\t * Sync item.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @param int $post_id The post ID to sync.\n\t *\n\t * @return void\n\t */\n\tpublic function sync_item( $post_id ) {\n\n\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( in_array( $post_id, $this->posts_deleted, true ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$post = get_post( (int) $post_id );\n\t\tif ( ! $post || ! $this->index->supports( $post ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$child_posts = get_transient( 'wp_algolia_child_posts_' . $post_id );\n\n\t\tif ( false !== $child_posts ) {\n\t\t\tforeach ( $child_posts as $child_post ) {\n\t\t\t\t$this->index->sync( $child_post );\n\t\t\t}\n\t\t\tdelete_transient( 'wp_algolia_child_posts_' . $post_id );\n\t\t}\n\t\ttry {\n\t\t\t$this->index->sync( $post );\n\t\t} catch ( AlgoliaException $exception ) {\n\t\t\terror_log( $exception->getMessage() ); // phpcs:ignore -- Legacy.\n\t\t}\n\t}\n\n\t/**\n\t * Check if a slug has been changed and add the childrens into a transient ( if it has children ).\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param int   $post_id The parent ID.\n\t * @param array $post_data An array containing the new post data.\n\t * @return void\n\t */\n\tpublic function check_slug_update( $post_id, $post_data ) {\n\t\t$post = get_post( (int) $post_id );\n\t\tif ( isset( $post_data['post_name'] ) && $post_data['post_name'] !== $post->post_name ) {\n\n\t\t\t$child_posts = get_children(\n\t\t\t\t[\n\t\t\t\t\t'post_parent' => $post_id,\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$pending_childs = [];\n\t\t\tforeach ( $child_posts as $child_post ) {\n\t\t\t\tif ( 'inherit' !== $child_post->post_status ) {\n\t\t\t\t\t$pending_childs[] = $child_post;\n\t\t\t\t}\n\t\t\t}\n\t\t\tset_transient( 'wp_algolia_child_posts_' . $post_id, $pending_childs, 60 );\n\t\t}\n\n\t}\n\n\t/**\n\t * Delete item.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @param int $post_id The post ID to delete.\n\t *\n\t * @return void\n\t */\n\tpublic function delete_item( $post_id ) {\n\n\t\t$post = get_post( (int) $post_id );\n\t\tif ( ! $post || ! $this->index->supports( $post ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\t$this->index->delete_item( $post );\n\t\t\t$this->posts_deleted[] = $post->ID;\n\t\t} catch ( AlgoliaException $exception ) {\n\t\t\terror_log( $exception->getMessage() ); // phpcs:ignore -- Legacy.\n\t\t}\n\t}\n\n\t/**\n\t * Watch meta changes for item.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param string|array $meta_id    The meta ID.\n\t * @param int          $object_id  The post ID.\n\t * @param string       $meta_key   The meta key.\n\t * @param mixed        $meta_value The meta value.\n\t *\n\t * @return void\n\t */\n\tpublic function on_meta_change( $meta_id, $object_id, $meta_key, $meta_value ) {\n\t\t$keys = array( '_thumbnail_id' );\n\n\t\t/**\n\t\t * Filters the meta keys to watch for changes on for posts.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param array  $keys      Array of meta keys to listen to. Default: '_thumbnail_id'.\n\t\t * @param int    $object_id The post ID.\n\t\t * @return array $value     Array of keys to listen to changes on.\n\t\t */\n\t\t$keys = (array) apply_filters( 'algolia_watch_post_meta_keys', $keys, $object_id );\n\n\t\tif ( ! in_array( $meta_key, $keys, true ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->sync_item( $object_id );\n\t}\n\n\t/**\n\t * Track updated post ids.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.6.0\n\t *\n\t * @param int $post_id Post id.\n\t * @return void\n\t */\n\tpublic function track_updated_posts( $post_id ) {\n\n\t\t// If `save_post` has not been executed, it means \"fast mode\" of WP All Import is enabled.\n\t\tif ( in_array( $post_id, $this->posts_updated, true ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->posts_updated[] = $post_id;\n\t}\n\n\t/**\n\t * Sync item to Algolia if \"Fast Mode\" option is enabled for WP All Import.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.6.0\n\t *\n\t * @param int $import_id Import id.\n\t * @return void\n\t */\n\tpublic function sync_item_for_pmxi( $import_id ) {\n\t\t$current_page = (int) get_option( 'algolia_pmxi_page', 1 );\n\n\t\tif ( null === self::$pmxi_is_fast_mode ) {\n\t\t\ttry {\n\t\t\t\t$import = new PMXI_Import_Record();\n\t\t\t\t$import->getBy( 'id', $import_id );\n\n\t\t\t\tself::$pmxi_is_fast_mode  = ( ! empty( $import->options['is_fast_mode'] ) );\n\t\t\t\tself::$pmxi_batch_size    = (int) $import->options['records_per_request'];\n\t\t\t\tself::$pmxi_total_count   = (int) $import->count;\n\t\t\t\tself::$pmxi_max_num_pages = (int) max( ceil( self::$pmxi_total_count / self::$pmxi_batch_size ), 1 );\n\t\t\t} catch ( Exception $exception ) {\n\t\t\t\terror_log( $exception->getMessage() ); // phpcs:ignore -- Legacy.\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! self::$pmxi_is_fast_mode ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $current_page <= self::$pmxi_max_num_pages ) {\n\t\t\t$current_total_posts = count( $this->posts_updated );\n\t\t\t// Majority of the time, this if statement will hit\n\t\t\t// for iterations where we will bundle up a re-index request.\n\t\t\tif ( $current_total_posts === self::$pmxi_batch_size ) {\n\t\t\t\t// Prevent clearing out our existing index.\n\t\t\t\tadd_filter( 'algolia_clear_index_if_existing', '__return_false' );\n\n\t\t\t\t// Push up our current batch, clear out the queue, and increment our current page.\n\t\t\t\t$this->index->re_index( 1, $this->posts_updated );\n\t\t\t\t$this->posts_updated = [];\n\t\t\t\t$current_page++;\n\n\t\t\t\tupdate_option( 'algolia_pmxi_page', $current_page );\n\t\t\t\t// Exit out of this iteration to prevent the rest of the method.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( $current_page === self::$pmxi_max_num_pages ) {\n\t\t\t\t// We round up to the next batch to cover anything less than batch size.\n\t\t\t\t// Subtract one so we can check on the partial.\n\t\t\t\t$almost_max_num_pages = self::$pmxi_max_num_pages - 1;\n\t\t\t\t// Get our total item amount based on how many fullfilled pages we'll have, by batch size.\n\t\t\t\t$almost_remainder = $almost_max_num_pages * self::$pmxi_batch_size;\n\t\t\t\t// Get our target remainder by taking off almost remainder from total count.\n\t\t\t\t$total_remainder   = self::$pmxi_total_count - $almost_remainder;\n\t\t\t\t$current_remainder = count( $this->posts_updated );\n\n\t\t\t\t// We have finally collected them all.\n\t\t\t\tif ( $current_remainder === $total_remainder ) {\n\t\t\t\t\t// Still prevent clearing out our existing index.\n\t\t\t\t\tadd_filter( 'algolia_clear_index_if_existing', '__return_false' );\n\n\t\t\t\t\t// Push up our final batch, clear out the queue just in case.\n\t\t\t\t\t$this->index->re_index( 1, $this->posts_updated );\n\t\t\t\t\t$this->posts_updated = [];\n\n\t\t\t\t\t// Clear out for next import run.\n\t\t\t\t\tdelete_option( 'algolia_pmxi_page' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/watchers/class-algolia-term-changes-watcher.php",
    "content": "<?php\n/**\n * Algolia_Term_Changes_Watcher class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\AlgoliaException;\n/**\n * Class Algolia_Term_Changes_Watcher\n *\n * @since 1.0.0\n */\nclass Algolia_Term_Changes_Watcher implements Algolia_Changes_Watcher {\n\n\t/**\n\t * Algolia_Index instance.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var Algolia_Index\n\t */\n\tprivate $index;\n\n\t/**\n\t * Active Algolia Indices\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.6.0\n\t * @var post_indices\n\t */\n\tprivate $post_indices;\n\n\t/**\n\t * Algolia_Term_Changes_Watcher constructor.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param Algolia_Index $index Algolia_Index instance.\n\t */\n\tpublic function __construct( Algolia_Index $index ) {\n\t\t$this->index = $index;\n\t}\n\n\t/**\n\t * Watch WordPress events.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t */\n\tpublic function watch() {\n\t\t// Fires immediately after the given terms are edited.\n\t\tadd_action( 'edited_term', array( $this, 'sync_item' ) );\n\t\tadd_action( 'edited_term', [ $this, 'sync_term_posts' ], 10, 3 );\n\n\t\t// Fires after an object's terms have been set.\n\t\tadd_action( 'set_object_terms', array( $this, 'handle_changes' ), 10, 6 );\n\n\t\t// Handle meta changes after the change occurred.\n\t\tadd_action( 'added_term_meta', [ $this, 'on_meta_change' ], 10, 4 );\n\t\tadd_action( 'updated_term_meta', [ $this, 'on_meta_change' ], 10, 4 );\n\t\tadd_action( 'deleted_term_meta', [ $this, 'on_meta_change' ], 10, 4 );\n\n\t\t// Fires after a term is deleted from the database and the cache is cleaned.\n\t\tadd_action( 'delete_term', array( $this, 'on_delete_term' ), 10, 4 );\n\n\t\tadd_action( 'admin_notices', [ $this, 'large_count_notice'] );\n\t}\n\n\t/**\n\t * Check if the current term has post assigned to it, if it does and it supports posts, then sync them.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param int    $term_id  The current term to be updated.\n\t * @param int    $tt_id    The Term Taxonomy ID.\n\t * @param string $taxonomy The taxonomy slug.\n\t *\n\t * @return void\n\t */\n\tpublic function sync_term_posts( $term_id, $tt_id, $taxonomy ) {\n\t\t$term = get_term( (int) $term_id );\n\t\tif ( ! $term || ! $this->index->supports( $term ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Filters whether or not to update posts with the edited term.\n\t\t *\n\t\t * @since 2.11.3\n\t\t *\n\t\t * @param bool   $value    Whether or not to sync posts with this term.\n\t\t * @param int    $term_id  The current term to be updated.\n\t\t * @param int    $tt_id    The term taxonomy ID.\n\t\t * @param string $taxonomy The taxonomy slug.\n\t\t */\n\t\t$should_sync_term_posts = apply_filters( 'algolia_should_sync_term_posts', true, $term_id, $tt_id, $taxonomy );\n\t\tif ( ! $should_sync_term_posts ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * This filters a cap of how many posts to fetch for the updated term, to update their algolia records.\n\t\t *\n\t\t * @since 2.11.3\n\t\t *\n\t\t * @param int $value Amount of posts to update.\n\t\t */\n\t\t$limit = apply_filters( 'algolia_term_update_post_limit', 50 );\n\n\t\t$args = [\n\t\t\t'posts_per_page' => $limit,\n\t\t\t'tax_query'      => [\n\t\t\t\t[\n\t\t\t\t\t'taxonomy' => $taxonomy,\n\t\t\t\t\t'field'    => 'term_id',\n\t\t\t\t\t'terms'    => $term_id,\n\t\t\t\t],\n\t\t\t],\n\t\t];\n\n\t\t$posts              = get_posts( $args );\n\t\t$post_types         = wp_list_pluck( $posts, 'post_type' );\n\t\t$post_types         = array_unique( $post_types );\n\t\t$this->post_indices = $this->get_searchable_indexes( $post_types );\n\t\t$this->sync_posts( $posts );\n\t}\n\n\t/**\n\t * Returns an array of indexes based on selected post types.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param array $post_types An array of searchable post_types.\n\t */\n\tprivate function get_searchable_indexes( $post_types ) {\n\n\t\t$post_indices          = [];\n\t\t$algolia_plugin        = \\Algolia_Plugin_Factory::create();\n\t\t$synced_indices_ids    = $algolia_plugin->get_settings()->get_synced_indices_ids();\n\t\t$index_name_prefix     = $algolia_plugin->get_settings()->get_index_name_prefix();\n\t\t$client                = $algolia_plugin->get_api()->get_client();\n\t\t$searchable_post_types = get_post_types(\n\t\t\t[\n\t\t\t\t'exclude_from_search' => false,\n\t\t\t]\n\t\t);\n\t\t$searchable_index      = new \\Algolia_Searchable_Posts_Index( $searchable_post_types );\n\t\t$searchable_index->set_name_prefix( $index_name_prefix );\n\t\t$searchable_index->set_client( $client );\n\t\t$searchable_index->set_enabled( true );\n\t\t$post_indices[] = $searchable_index;\n\n\t\tforeach ( $post_types as $post_type ) {\n\t\t\t$post_index = new \\Algolia_Posts_Index( $post_type );\n\t\t\t$post_index->set_name_prefix( $index_name_prefix );\n\t\t\t$post_index->set_client( $client );\n\t\t\t$post_index->set_enabled( true );\n\t\t\t$post_indices[] = $post_index;\n\n\t\t}\n\t\treturn $post_indices;\n\t}\n\n\t/**\n\t * Looks for a valid index base on the post type and triggers an Algolia sync.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param array $posts The post type to look for an index.\n\t *\n\t * @return void\n\t */\n\tpublic function sync_posts( $posts ) {\n\t\ttry {\n\t\t\tforeach ( $this->post_indices as $index ) {\n\t\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t\t$index->sync( $post );\n\t\t\t\t}\n\t\t\t}\n\t\t} catch ( AlgoliaException $exception ) {\n\t\t\terror_log( $exception->getMessage() ); // phpcs:ignore -- Legacy.\n\t\t}\n\t}\n\n\t/**\n\t * Sync item.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @param int $term_id The term ID to sync.\n\t *\n\t * @return void\n\t */\n\tpublic function sync_item( $term_id ) {\n\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$term = get_term( (int) $term_id );\n\n\t\tif ( ! $term || ! $this->index->supports( $term ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\t$this->index->sync( $term );\n\t\t} catch ( AlgoliaException $exception ) {\n\t\t\terror_log( $exception->getMessage() ); // phpcs:ignore -- Legacy.\n\t\t}\n\t}\n\n\t/**\n\t * Handle term changes.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @param int    $object_id  Object ID.\n\t * @param array  $terms      An array of object terms.\n\t * @param array  $tt_ids     An array of term taxonomy IDs.\n\t * @param string $taxonomy   Taxonomy slug.\n\t * @param bool   $append     Whether to append new terms to the old terms.\n\t * @param array  $old_tt_ids Old array of term taxonomy IDs.\n\t */\n\tpublic function handle_changes( $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids ) {\n\t\t$terms_to_sync = array_unique( array_merge( $terms, $old_tt_ids ) );\n\n\t\tforeach ( $terms_to_sync as $term_id ) {\n\t\t\t$this->sync_item( $term_id );\n\t\t}\n\t}\n\n\t/**\n\t * Delete item.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @param int    $term         Term ID.\n\t * @param int    $tt_id        Term taxonomy ID.\n\t * @param string $taxonomy     Taxonomy slug.\n\t * @param mixed  $deleted_term Copy of the already-deleted term, in the form specified\n\t *                             by the parent function. WP_Error otherwise.\n\t *\n\t * @return void\n\t */\n\tpublic function on_delete_term( $term, $tt_id, $taxonomy, $deleted_term ) {\n\t\tif ( ! $this->index->supports( $deleted_term ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\t$this->index->delete_item( $deleted_term );\n\t\t} catch ( AlgoliaException $exception ) {\n\t\t\terror_log( $exception->getMessage() ); // phpcs:ignore -- Legacy.\n\t\t}\n\t}\n\n\t/**\n\t * Watch meta changes for item.\n\t *\n\t * @param string|array $meta_id    The meta ID.\n\t * @param int          $object_id  The term ID.\n\t * @param string       $meta_key   The meta key.\n\t * @param mixed        $meta_value The meta value.\n\t *\n\t * @return void\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.5.0\n\t */\n\tpublic function on_meta_change( $meta_id, $object_id, $meta_key, $meta_value ) {\n\n\t\t// We will not listen for any specific key by default.\n\t\t$keys = [];\n\n\t\t/**\n\t\t * Filters the meta keys to watch for changes on for terms.\n\t\t *\n\t\t * @since 2.5.0\n\t\t *\n\t\t * @param  array $keys      Array of meta keys to listen to. Default: empty array.\n\t\t * @param  int   $object_id The term ID.\n\t\t * @return array $value     Array of meta keys to listen to changes on.\n\t\t */\n\t\t$keys = (array) apply_filters( 'algolia_watch_term_meta_keys', $keys, $object_id );\n\n\t\tif ( empty( $keys ) || ! in_array( $meta_key, $keys, true ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->sync_item( $object_id );\n\t}\n\n\t/**\n\t * Conditionally set an admin notice about maybe bulk re-indexing to update\n\t * Algolia post records that have this term.\n\t *\n\t * @since 2.11.3\n\t */\n\tpublic function large_count_notice() {\n\t\tglobal $current_screen;\n\n\t\tif ( ! $current_screen || 'term' !== $current_screen->base ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( ! empty( $_GET['tag_ID'] ) && is_numeric( $_GET['tag_ID'] ) ) {\n\t\t\t$termID = absint( $_GET['tag_ID'] );\n\t\t}\n\n\t\t$term = get_term( $termID );\n\t\tif ( ! $term ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// This filter is documented in includes/watchers/class-algolia-term-changes-watcher.php\n\t\t$limit = apply_filters( 'algolia_term_update_post_limit', 50 );\n\t\tif ( $term->count > absint( $limit ) ) {\n\t\t\twp_admin_notice(\n\t\t\t\tsprintf(\n\t\t\t\t\tesc_html__( 'Only the first %1$s posts with this term have been sync\\'d to your Algolia indexes. Please run a bulk re-index to get the rest.', 'wp-search-with-algolia' ),\n\t\t\t\t\t$limit\n\t\t\t\t),\n\t\t\t\t[\n\t\t\t\t\t'id'                 => 'message',\n\t\t\t\t\t'additional_classes' => array( 'updated' ),\n\t\t\t\t\t'dismissible'        => true,\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/watchers/class-algolia-user-changes-watcher.php",
    "content": "<?php\n/**\n * Algolia_User_Changes_Watcher class file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\AlgoliaException;\n\n/**\n * Class Algolia_User_Changes_Watcher\n *\n * @since 1.0.0\n */\nclass Algolia_User_Changes_Watcher implements Algolia_Changes_Watcher {\n\n\t/**\n\t * Algolia_Index instance.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @var Algolia_Index\n\t */\n\tprivate $index;\n\n\t/**\n\t * Algolia_User_Changes_Watcher constructor.\n\t *\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  1.0.0\n\t *\n\t * @param Algolia_Index $index Algolia_Index instance.\n\t */\n\tpublic function __construct( Algolia_Index $index ) {\n\t\t$this->index = $index;\n\t}\n\n\t/**\n\t * Watch WordPress events.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t */\n\tpublic function watch() {\n\t\t// Fires immediately after an existing user is updated.\n\t\tadd_action( 'profile_update', array( $this, 'sync_item' ) );\n\n\t\t// Fires immediately after a new user is registered.\n\t\tadd_action( 'user_register', array( $this, 'sync_item' ) );\n\n\t\t// Handle meta changes after the change occurred.\n\t\tadd_action( 'added_user_meta', [ $this, 'on_meta_change' ], 10, 4 );\n\t\tadd_action( 'updated_user_meta', [ $this, 'on_meta_change' ], 10, 4 );\n\t\tadd_action( 'deleted_user_meta', [ $this, 'on_meta_change' ], 10, 4 );\n\n\t\t// Fires immediately before a user is deleted.\n\t\tadd_action( 'delete_user', array( $this, 'delete_item' ) );\n\n\t\t// Fires once a post has been saved.\n\t\tadd_action( 'save_post', array( $this, 'on_save_post' ), 10, 2 );\n\n\t\t// Fires before a post is deleted, at the start of wp_delete_post().\n\t\t// At this stage the post metas are still available, and we need them.\n\t\tadd_action( 'before_delete_post', array( $this, 'on_delete_post' ) );\n\t}\n\n\t/**\n\t * Sync item.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @param int $user_id User ID.\n\t *\n\t * @return void\n\t */\n\tpublic function sync_item( $user_id ) {\n\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$user = get_user_by( 'id', $user_id );\n\n\t\tif ( ! $user || ! $this->index->supports( $user ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\t$this->index->sync( $user );\n\t\t} catch ( AlgoliaException $exception ) {\n\t\t\terror_log( $exception->getMessage() ); // phpcs:ignore -- Legacy.\n\t\t}\n\t}\n\n\t/**\n\t * Delete item.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @param int $user_id ID of the user to delete.\n\t *\n\t * @return void\n\t */\n\tpublic function delete_item( $user_id ) {\n\t\t$user = get_user_by( 'id', $user_id );\n\n\t\tif ( ! $user || ! $this->index->supports( $user ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\t$this->index->delete_item( $user );\n\t\t} catch ( AlgoliaException $exception ) {\n\t\t\terror_log( $exception->getMessage() ); // phpcs:ignore -- Legacy.\n\t\t}\n\t}\n\n\t/**\n\t * Ensures that the user post count gets updated.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @param int     $post_id Post ID.\n\t * @param WP_Post $post    Post object.\n\t */\n\tpublic function on_save_post( $post_id, WP_Post $post ) {\n\t\t$this->sync_item( (int) $post->post_author );\n\t}\n\n\t/**\n\t * Ensures that the user post count gets updated.\n\t *\n\t * @author  WebDevStudios <contact@webdevstudios.com>\n\t * @since   1.0.0\n\t *\n\t * @param int $post_id Post ID.\n\t *\n\t * @return void\n\t */\n\tpublic function on_delete_post( $post_id ) {\n\t\t$post = get_post( (int) $post_id );\n\n\t\tif ( ! $post ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$watcher   = $this;\n\t\t$author_id = $post->post_author;\n\n\t\t// We delay the sync until after the post was deleted to propagate the change\n\t\t// posts count change for the author.\n\t\t// Todo: this is not optimal given it would be triggered for every future triggered hook.\n\t\t// Todo: needs to be changed.\n\t\tadd_action(\n\t\t\t'after_delete_post',\n\t\t\tfunction() use ( $watcher, $author_id ) {\n\t\t\t\t$watcher->sync_item( $author_id );\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Watch meta changes for item.\n\t *\n\t * @param string|array $meta_id    The meta ID.\n\t * @param int          $object_id  The user ID.\n\t * @param string       $meta_key   The meta key.\n\t * @param mixed        $meta_value The meta value.\n\t *\n\t * @return void\n\t * @author WebDevStudios <contact@webdevstudios.com>\n\t * @since  2.5.0\n\t */\n\tpublic function on_meta_change( $meta_id, $object_id, $meta_key, $meta_value ) {\n\n\t\t// We will not listen for any specific key by default.\n\t\t$keys = [];\n\t\t/**\n\t\t * Filters the meta keys to watch for changes on for terms.\n\t\t *\n\t\t * @since 2.5.0\n\t\t *\n\t\t * @param  array $keys      Array of meta keys to listen to. Default: empty array.\n\t\t * @param  int   $object_id The user ID.\n\t\t * @return array $value     Array of meta keys to listen to changes on.\n\t\t */\n\t\t$keys = (array) apply_filters( 'algolia_watch_user_meta_keys', $keys, $object_id );\n\n\t\tif ( empty( $keys ) || ! in_array( $meta_key, $keys, true ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->sync_item( $object_id );\n\t}\n}\n"
  },
  {
    "path": "includes/watchers/index.php",
    "content": "<?php // Silence is golden\n"
  },
  {
    "path": "index.php",
    "content": "<?php // Silence is golden\n"
  },
  {
    "path": "js/algoliasearch/README.md",
    "content": "<p align=\"center\">\n  <a href=\"https://www.algolia.com\">\n    <img alt=\"Algolia for JavaScript\" src=\"https://raw.githubusercontent.com/algolia/algoliasearch-client-common/master/banners/javascript.png\" >\n  </a>\n\n  <h4 align=\"center\">The perfect starting point to integrate <a href=\"https://algolia.com\" target=\"_blank\">Algolia</a> within your JavaScript project</h4>\n\n  <p align=\"center\">\n    <a href=\"https://npmjs.org/package/algoliasearch\"><img src=\"https://img.shields.io/npm/v/algoliasearch.svg?style=flat-square\" alt=\"NPM version\"></img></a>\n    <a href=\"http://npm-stat.com/charts.html?package=algoliasearch\"><img src=\"https://img.shields.io/npm/dm/algoliasearch.svg?style=flat-square\" alt=\"NPM downloads\"></a>\n    <a href=\"https://www.jsdelivr.com/package/npm/algoliasearch\"><img src=\"https://data.jsdelivr.com/v1/package/npm/algoliasearch/badge\" alt=\"jsDelivr Downloads\"></img></a>\n    <a href=\"LICENSE.md\"><img src=\"https://img.shields.io/badge/license-MIT-green.svg?style=flat-square\" alt=\"License\"></a>\n  </p>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.algolia.com/doc/api-client/getting-started/install/javascript/\" target=\"_blank\">Documentation</a>  •\n  <a href=\"https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/\" target=\"_blank\">InstantSearch</a>  •\n  <a href=\"https://discourse.algolia.com\" target=\"_blank\">Community Forum</a>  •\n  <a href=\"http://stackoverflow.com/questions/tagged/algolia\" target=\"_blank\">Stack Overflow</a>  •\n  <a href=\"https://github.com/algolia/algoliasearch-client-javascript/issues\" target=\"_blank\">Report a bug</a>  •\n  <a href=\"https://www.algolia.com/support\" target=\"_blank\">Support</a>\n</p>\n\n## ✨ Features\n\n- Thin & **minimal low-level HTTP client** to interact with Algolia's API\n- Works both on the **browser** and **node.js**\n- **UMD compatible**, you can use it with any module loader\n- Built with TypeScript\n\n## 💡 Getting Started\n\nFirst, install Algolia JavaScript API Client via the [npm](https://www.npmjs.com/get-npm) package manager:\n\n```bash\nnpm install algoliasearch\n```\n\nThen, create objects on your index:\n\n```js\nconst algoliasearch = require(\"algoliasearch\");\n\nconst client = algoliasearch(\"YourApplicationID\", \"YourAdminAPIKey\");\nconst index = client.initIndex(\"your_index_name\");\n\nconst objects = [\n  {\n    objectID: 1,\n    name: \"Foo\"\n  }\n];\n\nindex\n  .saveObjects(objects)\n  .then(({ objectIDs }) => {\n    console.log(objectIDs);\n  })\n  .catch(err => {\n    console.log(err);\n  });\n```\n\nFinally, let's actually search using the `search` method:\n\n```js\nindex\n  .search(\"Fo\")\n  .then(({ hits }) => {\n    console.log(hits);\n  })\n  .catch(err => {\n    console.log(err);\n  });\n```\n\nFor full documentation, visit the **[online documentation](https://www.algolia.com/doc/api-client/getting-started/install/javascript/)**.\n\n## 📄 License\n\nAlgolia JavaScript API Client is an open-sourced software licensed under the [MIT license](LICENSE.md).\n"
  },
  {
    "path": "js/algoliasearch/dist/algoliasearch-lite.d.ts",
    "content": "import { ClientTransporterOptions } from '@algolia/client-common';\r\nimport { FindAnswersOptions } from '@algolia/client-search';\r\nimport { FindAnswersResponse } from '@algolia/client-search';\r\nimport { MultipleQueriesOptions } from '@algolia/client-search';\r\nimport { MultipleQueriesQuery } from '@algolia/client-search';\r\nimport { MultipleQueriesResponse } from '@algolia/client-search';\r\nimport { Request } from '@algolia/transporter';\r\nimport { RequestOptions } from '@algolia/transporter';\r\nimport { SearchClient as SearchClient_2 } from '@algolia/client-search';\r\nimport { SearchClientOptions } from '@algolia/client-search';\r\nimport { SearchForFacetValuesQueryParams } from '@algolia/client-search';\r\nimport { SearchForFacetValuesResponse } from '@algolia/client-search';\r\nimport { SearchIndex as SearchIndex_2 } from '@algolia/client-search';\r\nimport { SearchOptions } from '@algolia/client-search';\r\nimport { SearchResponse } from '@algolia/client-search';\r\n\r\ndeclare function algoliasearch(appId: string, apiKey: string, options?: AlgoliaSearchOptions): SearchClient;\r\n\r\ndeclare namespace algoliasearch {\r\n    var version: string;\r\n}\r\nexport default algoliasearch;\r\n\r\nexport declare type AlgoliaSearchOptions = Partial<ClientTransporterOptions> & WithoutCredentials<SearchClientOptions>;\r\n\r\ndeclare type Credentials = {\r\n    readonly appId: string;\r\n    readonly apiKey: string;\r\n};\r\n\r\nexport declare type SearchClient = SearchClient_2 & {\r\n    readonly initIndex: (indexName: string) => SearchIndex;\r\n    readonly search: <TObject>(queries: readonly MultipleQueriesQuery[], requestOptions?: RequestOptions & MultipleQueriesOptions) => Readonly<Promise<MultipleQueriesResponse<TObject>>>;\r\n    readonly searchForFacetValues: (queries: ReadonlyArray<{\r\n        readonly indexName: string;\r\n        readonly params: SearchForFacetValuesQueryParams & SearchOptions;\r\n    }>, requestOptions?: RequestOptions) => Readonly<Promise<readonly SearchForFacetValuesResponse[]>>;\r\n    readonly customRequest: <TResponse>(request: Request, requestOptions?: RequestOptions) => Readonly<Promise<TResponse>>;\r\n};\r\n\r\nexport declare type SearchIndex = SearchIndex_2 & {\r\n    readonly search: <TObject>(query: string, requestOptions?: RequestOptions & SearchOptions) => Readonly<Promise<SearchResponse<TObject>>>;\r\n    readonly searchForFacetValues: (facetName: string, facetQuery: string, requestOptions?: RequestOptions & SearchOptions) => Readonly<Promise<SearchForFacetValuesResponse>>;\r\n    readonly findAnswers: <TObject>(query: string, queryLanguages: readonly string[], requestOptions?: RequestOptions & FindAnswersOptions) => Readonly<Promise<FindAnswersResponse<TObject>>>;\r\n};\r\n\r\nexport declare type WithoutCredentials<TClientOptions extends Credentials> = Omit<TClientOptions, keyof Credentials>;\r\n\r\nexport { }\r\n"
  },
  {
    "path": "js/algoliasearch/dist/algoliasearch-lite.esm.browser.js",
    "content": "function createBrowserLocalStorageCache(options) {\r\n    const namespaceKey = `algoliasearch-client-js-${options.key}`;\r\n    // eslint-disable-next-line functional/no-let\r\n    let storage;\r\n    const getStorage = () => {\r\n        if (storage === undefined) {\r\n            storage = options.localStorage || window.localStorage;\r\n        }\r\n        return storage;\r\n    };\r\n    const getNamespace = () => {\r\n        return JSON.parse(getStorage().getItem(namespaceKey) || '{}');\r\n    };\r\n    const setNamespace = (namespace) => {\r\n        getStorage().setItem(namespaceKey, JSON.stringify(namespace));\r\n    };\r\n    const removeOutdatedCacheItems = () => {\r\n        const timeToLive = options.timeToLive ? options.timeToLive * 1000 : null;\r\n        const namespace = getNamespace();\r\n        const filteredNamespaceWithoutOldFormattedCacheItems = Object.fromEntries(Object.entries(namespace).filter(([, cacheItem]) => {\r\n            return cacheItem.timestamp !== undefined;\r\n        }));\r\n        setNamespace(filteredNamespaceWithoutOldFormattedCacheItems);\r\n        if (!timeToLive)\r\n            return;\r\n        const filteredNamespaceWithoutExpiredItems = Object.fromEntries(Object.entries(filteredNamespaceWithoutOldFormattedCacheItems).filter(([, cacheItem]) => {\r\n            const currentTimestamp = new Date().getTime();\r\n            const isExpired = cacheItem.timestamp + timeToLive < currentTimestamp;\r\n            return !isExpired;\r\n        }));\r\n        setNamespace(filteredNamespaceWithoutExpiredItems);\r\n    };\r\n    return {\r\n        get(key, defaultValue, events = {\r\n            miss: () => Promise.resolve(),\r\n        }) {\r\n            return Promise.resolve()\r\n                .then(() => {\r\n                removeOutdatedCacheItems();\r\n                const keyAsString = JSON.stringify(key);\r\n                return getNamespace()[keyAsString];\r\n            })\r\n                .then(value => {\r\n                return Promise.all([value ? value.value : defaultValue(), value !== undefined]);\r\n            })\r\n                .then(([value, exists]) => {\r\n                return Promise.all([value, exists || events.miss(value)]);\r\n            })\r\n                .then(([value]) => value);\r\n        },\r\n        set(key, value) {\r\n            return Promise.resolve().then(() => {\r\n                const namespace = getNamespace();\r\n                // eslint-disable-next-line functional/immutable-data\r\n                namespace[JSON.stringify(key)] = {\r\n                    timestamp: new Date().getTime(),\r\n                    value,\r\n                };\r\n                getStorage().setItem(namespaceKey, JSON.stringify(namespace));\r\n                return value;\r\n            });\r\n        },\r\n        delete(key) {\r\n            return Promise.resolve().then(() => {\r\n                const namespace = getNamespace();\r\n                // eslint-disable-next-line functional/immutable-data\r\n                delete namespace[JSON.stringify(key)];\r\n                getStorage().setItem(namespaceKey, JSON.stringify(namespace));\r\n            });\r\n        },\r\n        clear() {\r\n            return Promise.resolve().then(() => {\r\n                getStorage().removeItem(namespaceKey);\r\n            });\r\n        },\r\n    };\r\n}\n\n// @todo Add logger on options to debug when caches go wrong.\r\nfunction createFallbackableCache(options) {\r\n    const caches = [...options.caches];\r\n    const current = caches.shift(); // eslint-disable-line functional/immutable-data\r\n    if (current === undefined) {\r\n        return createNullCache();\r\n    }\r\n    return {\r\n        get(key, defaultValue, events = {\r\n            miss: () => Promise.resolve(),\r\n        }) {\r\n            return current.get(key, defaultValue, events).catch(() => {\r\n                return createFallbackableCache({ caches }).get(key, defaultValue, events);\r\n            });\r\n        },\r\n        set(key, value) {\r\n            return current.set(key, value).catch(() => {\r\n                return createFallbackableCache({ caches }).set(key, value);\r\n            });\r\n        },\r\n        delete(key) {\r\n            return current.delete(key).catch(() => {\r\n                return createFallbackableCache({ caches }).delete(key);\r\n            });\r\n        },\r\n        clear() {\r\n            return current.clear().catch(() => {\r\n                return createFallbackableCache({ caches }).clear();\r\n            });\r\n        },\r\n    };\r\n}\n\nfunction createNullCache() {\r\n    return {\r\n        get(_key, defaultValue, events = {\r\n            miss: () => Promise.resolve(),\r\n        }) {\r\n            const value = defaultValue();\r\n            return value\r\n                .then(result => Promise.all([result, events.miss(result)]))\r\n                .then(([result]) => result);\r\n        },\r\n        set(_key, value) {\r\n            return Promise.resolve(value);\r\n        },\r\n        delete(_key) {\r\n            return Promise.resolve();\r\n        },\r\n        clear() {\r\n            return Promise.resolve();\r\n        },\r\n    };\r\n}\n\nfunction createInMemoryCache(options = { serializable: true }) {\r\n    // eslint-disable-next-line functional/no-let\r\n    let cache = {};\r\n    return {\r\n        get(key, defaultValue, events = {\r\n            miss: () => Promise.resolve(),\r\n        }) {\r\n            const keyAsString = JSON.stringify(key);\r\n            if (keyAsString in cache) {\r\n                return Promise.resolve(options.serializable ? JSON.parse(cache[keyAsString]) : cache[keyAsString]);\r\n            }\r\n            const promise = defaultValue();\r\n            const miss = (events && events.miss) || (() => Promise.resolve());\r\n            return promise.then((value) => miss(value)).then(() => promise);\r\n        },\r\n        set(key, value) {\r\n            // eslint-disable-next-line functional/immutable-data\r\n            cache[JSON.stringify(key)] = options.serializable ? JSON.stringify(value) : value;\r\n            return Promise.resolve(value);\r\n        },\r\n        delete(key) {\r\n            // eslint-disable-next-line functional/immutable-data\r\n            delete cache[JSON.stringify(key)];\r\n            return Promise.resolve();\r\n        },\r\n        clear() {\r\n            cache = {};\r\n            return Promise.resolve();\r\n        },\r\n    };\r\n}\n\nfunction createAuth(authMode, appId, apiKey) {\r\n    const credentials = {\r\n        'x-algolia-api-key': apiKey,\r\n        'x-algolia-application-id': appId,\r\n    };\r\n    return {\r\n        headers() {\r\n            return authMode === AuthMode.WithinHeaders ? credentials : {};\r\n        },\r\n        queryParameters() {\r\n            return authMode === AuthMode.WithinQueryParameters ? credentials : {};\r\n        },\r\n    };\r\n}\n\n// eslint-disable-next-line functional/prefer-readonly-type\r\nfunction shuffle(array) {\r\n    let c = array.length - 1; // eslint-disable-line functional/no-let\r\n    // eslint-disable-next-line functional/no-loop-statement\r\n    for (c; c > 0; c--) {\r\n        const b = Math.floor(Math.random() * (c + 1));\r\n        const a = array[c];\r\n        array[c] = array[b]; // eslint-disable-line functional/immutable-data, no-param-reassign\r\n        array[b] = a; // eslint-disable-line functional/immutable-data, no-param-reassign\r\n    }\r\n    return array;\r\n}\r\nfunction addMethods(base, methods) {\r\n    if (!methods) {\r\n        return base;\r\n    }\r\n    Object.keys(methods).forEach(key => {\r\n        // eslint-disable-next-line functional/immutable-data, no-param-reassign\r\n        base[key] = methods[key](base);\r\n    });\r\n    return base;\r\n}\r\nfunction encode(format, ...args) {\r\n    // eslint-disable-next-line functional/no-let\r\n    let i = 0;\r\n    return format.replace(/%s/g, () => encodeURIComponent(args[i++]));\r\n}\n\nconst version = '4.18.0';\n\nconst AuthMode = {\r\n    /**\r\n     * If auth credentials should be in query parameters.\r\n     */\r\n    WithinQueryParameters: 0,\r\n    /**\r\n     * If auth credentials should be in headers.\r\n     */\r\n    WithinHeaders: 1,\r\n};\n\nfunction createMappedRequestOptions(requestOptions, timeout) {\r\n    const options = requestOptions || {};\r\n    const data = options.data || {};\r\n    Object.keys(options).forEach(key => {\r\n        if (['timeout', 'headers', 'queryParameters', 'data', 'cacheable'].indexOf(key) === -1) {\r\n            data[key] = options[key]; // eslint-disable-line functional/immutable-data\r\n        }\r\n    });\r\n    return {\r\n        data: Object.entries(data).length > 0 ? data : undefined,\r\n        timeout: options.timeout || timeout,\r\n        headers: options.headers || {},\r\n        queryParameters: options.queryParameters || {},\r\n        cacheable: options.cacheable,\r\n    };\r\n}\n\nconst CallEnum = {\r\n    /**\r\n     * If the host is read only.\r\n     */\r\n    Read: 1,\r\n    /**\r\n     * If the host is write only.\r\n     */\r\n    Write: 2,\r\n    /**\r\n     * If the host is both read and write.\r\n     */\r\n    Any: 3,\r\n};\n\nconst HostStatusEnum = {\r\n    Up: 1,\r\n    Down: 2,\r\n    Timeouted: 3,\r\n};\n\n// By default, API Clients at Algolia have expiration delay\r\n// of 5 mins. In the JavaScript client, we have 2 mins.\r\nconst EXPIRATION_DELAY = 2 * 60 * 1000;\r\nfunction createStatefulHost(host, status = HostStatusEnum.Up) {\r\n    return {\r\n        ...host,\r\n        status,\r\n        lastUpdate: Date.now(),\r\n    };\r\n}\r\nfunction isStatefulHostUp(host) {\r\n    return host.status === HostStatusEnum.Up || Date.now() - host.lastUpdate > EXPIRATION_DELAY;\r\n}\r\nfunction isStatefulHostTimeouted(host) {\r\n    return (host.status === HostStatusEnum.Timeouted && Date.now() - host.lastUpdate <= EXPIRATION_DELAY);\r\n}\n\nfunction createStatelessHost(options) {\r\n    if (typeof options === 'string') {\r\n        return {\r\n            protocol: 'https',\r\n            url: options,\r\n            accept: CallEnum.Any,\r\n        };\r\n    }\r\n    return {\r\n        protocol: options.protocol || 'https',\r\n        url: options.url,\r\n        accept: options.accept || CallEnum.Any,\r\n    };\r\n}\n\nconst MethodEnum = {\r\n    Delete: 'DELETE',\r\n    Get: 'GET',\r\n    Post: 'POST',\r\n    Put: 'PUT',\r\n};\n\nfunction createRetryableOptions(hostsCache, statelessHosts) {\r\n    return Promise.all(statelessHosts.map(statelessHost => {\r\n        return hostsCache.get(statelessHost, () => {\r\n            return Promise.resolve(createStatefulHost(statelessHost));\r\n        });\r\n    })).then(statefulHosts => {\r\n        const hostsUp = statefulHosts.filter(host => isStatefulHostUp(host));\r\n        const hostsTimeouted = statefulHosts.filter(host => isStatefulHostTimeouted(host));\r\n        /**\r\n         * Note, we put the hosts that previously timeouted on the end of the list.\r\n         */\r\n        const hostsAvailable = [...hostsUp, ...hostsTimeouted];\r\n        const statelessHostsAvailable = hostsAvailable.length > 0\r\n            ? hostsAvailable.map(host => createStatelessHost(host))\r\n            : statelessHosts;\r\n        return {\r\n            getTimeout(timeoutsCount, baseTimeout) {\r\n                /**\r\n                 * Imagine that you have 4 hosts, if timeouts will increase\r\n                 * on the following way: 1 (timeouted) > 4 (timeouted) > 5 (200)\r\n                 *\r\n                 * Note that, the very next request, we start from the previous timeout\r\n                 *\r\n                 *  5 (timeouted) > 6 (timeouted) > 7 ...\r\n                 *\r\n                 * This strategy may need to be reviewed, but is the strategy on the our\r\n                 * current v3 version.\r\n                 */\r\n                const timeoutMultiplier = hostsTimeouted.length === 0 && timeoutsCount === 0\r\n                    ? 1\r\n                    : hostsTimeouted.length + 3 + timeoutsCount;\r\n                return timeoutMultiplier * baseTimeout;\r\n            },\r\n            statelessHosts: statelessHostsAvailable,\r\n        };\r\n    });\r\n}\n\nconst isNetworkError = ({ isTimedOut, status }) => {\r\n    return !isTimedOut && ~~status === 0;\r\n};\r\nconst isRetryable = (response) => {\r\n    const status = response.status;\r\n    const isTimedOut = response.isTimedOut;\r\n    return (isTimedOut || isNetworkError(response) || (~~(status / 100) !== 2 && ~~(status / 100) !== 4));\r\n};\r\nconst isSuccess = ({ status }) => {\r\n    return ~~(status / 100) === 2;\r\n};\r\nconst retryDecision = (response, outcomes) => {\r\n    if (isRetryable(response)) {\r\n        return outcomes.onRetry(response);\r\n    }\r\n    if (isSuccess(response)) {\r\n        return outcomes.onSuccess(response);\r\n    }\r\n    return outcomes.onFail(response);\r\n};\n\nfunction retryableRequest(transporter, statelessHosts, request, requestOptions) {\r\n    const stackTrace = []; // eslint-disable-line functional/prefer-readonly-type\r\n    /**\r\n     * First we prepare the payload that do not depend from hosts.\r\n     */\r\n    const data = serializeData(request, requestOptions);\r\n    const headers = serializeHeaders(transporter, requestOptions);\r\n    const method = request.method;\r\n    // On `GET`, the data is proxied to query parameters.\r\n    const dataQueryParameters = request.method !== MethodEnum.Get\r\n        ? {}\r\n        : {\r\n            ...request.data,\r\n            ...requestOptions.data,\r\n        };\r\n    const queryParameters = {\r\n        'x-algolia-agent': transporter.userAgent.value,\r\n        ...transporter.queryParameters,\r\n        ...dataQueryParameters,\r\n        ...requestOptions.queryParameters,\r\n    };\r\n    let timeoutsCount = 0; // eslint-disable-line functional/no-let\r\n    const retry = (hosts, // eslint-disable-line functional/prefer-readonly-type\r\n    getTimeout) => {\r\n        /**\r\n         * We iterate on each host, until there is no host left.\r\n         */\r\n        const host = hosts.pop(); // eslint-disable-line functional/immutable-data\r\n        if (host === undefined) {\r\n            throw createRetryError(stackTraceWithoutCredentials(stackTrace));\r\n        }\r\n        const payload = {\r\n            data,\r\n            headers,\r\n            method,\r\n            url: serializeUrl(host, request.path, queryParameters),\r\n            connectTimeout: getTimeout(timeoutsCount, transporter.timeouts.connect),\r\n            responseTimeout: getTimeout(timeoutsCount, requestOptions.timeout),\r\n        };\r\n        /**\r\n         * The stackFrame is pushed to the stackTrace so we\r\n         * can have information about onRetry and onFailure\r\n         * decisions.\r\n         */\r\n        const pushToStackTrace = (response) => {\r\n            const stackFrame = {\r\n                request: payload,\r\n                response,\r\n                host,\r\n                triesLeft: hosts.length,\r\n            };\r\n            // eslint-disable-next-line functional/immutable-data\r\n            stackTrace.push(stackFrame);\r\n            return stackFrame;\r\n        };\r\n        const decisions = {\r\n            onSuccess: response => deserializeSuccess(response),\r\n            onRetry(response) {\r\n                const stackFrame = pushToStackTrace(response);\r\n                /**\r\n                 * If response is a timeout, we increaset the number of\r\n                 * timeouts so we can increase the timeout later.\r\n                 */\r\n                if (response.isTimedOut) {\r\n                    timeoutsCount++;\r\n                }\r\n                return Promise.all([\r\n                    /**\r\n                     * Failures are individually send the logger, allowing\r\n                     * the end user to debug / store stack frames even\r\n                     * when a retry error does not happen.\r\n                     */\r\n                    transporter.logger.info('Retryable failure', stackFrameWithoutCredentials(stackFrame)),\r\n                    /**\r\n                     * We also store the state of the host in failure cases. If the host, is\r\n                     * down it will remain down for the next 2 minutes. In a timeout situation,\r\n                     * this host will be added end of the list of hosts on the next request.\r\n                     */\r\n                    transporter.hostsCache.set(host, createStatefulHost(host, response.isTimedOut ? HostStatusEnum.Timeouted : HostStatusEnum.Down)),\r\n                ]).then(() => retry(hosts, getTimeout));\r\n            },\r\n            onFail(response) {\r\n                pushToStackTrace(response);\r\n                throw deserializeFailure(response, stackTraceWithoutCredentials(stackTrace));\r\n            },\r\n        };\r\n        return transporter.requester.send(payload).then(response => {\r\n            return retryDecision(response, decisions);\r\n        });\r\n    };\r\n    /**\r\n     * Finally, for each retryable host perform request until we got a non\r\n     * retryable response. Some notes here:\r\n     *\r\n     * 1. The reverse here is applied so we can apply a `pop` later on => more performant.\r\n     * 2. We also get from the retryable options a timeout multiplier that is tailored\r\n     * for the current context.\r\n     */\r\n    return createRetryableOptions(transporter.hostsCache, statelessHosts).then(options => {\r\n        return retry([...options.statelessHosts].reverse(), options.getTimeout);\r\n    });\r\n}\n\nfunction createTransporter(options) {\r\n    const { hostsCache, logger, requester, requestsCache, responsesCache, timeouts, userAgent, hosts, queryParameters, headers, } = options;\r\n    const transporter = {\r\n        hostsCache,\r\n        logger,\r\n        requester,\r\n        requestsCache,\r\n        responsesCache,\r\n        timeouts,\r\n        userAgent,\r\n        headers,\r\n        queryParameters,\r\n        hosts: hosts.map(host => createStatelessHost(host)),\r\n        read(request, requestOptions) {\r\n            /**\r\n             * First, we compute the user request options. Now, keep in mind,\r\n             * that using request options the user is able to modified the intire\r\n             * payload of the request. Such as headers, query parameters, and others.\r\n             */\r\n            const mappedRequestOptions = createMappedRequestOptions(requestOptions, transporter.timeouts.read);\r\n            const createRetryableRequest = () => {\r\n                /**\r\n                 * Then, we prepare a function factory that contains the construction of\r\n                 * the retryable request. At this point, we may *not* perform the actual\r\n                 * request. But we want to have the function factory ready.\r\n                 */\r\n                return retryableRequest(transporter, transporter.hosts.filter(host => (host.accept & CallEnum.Read) !== 0), request, mappedRequestOptions);\r\n            };\r\n            /**\r\n             * Once we have the function factory ready, we need to determine of the\r\n             * request is \"cacheable\" - should be cached. Note that, once again,\r\n             * the user can force this option.\r\n             */\r\n            const cacheable = mappedRequestOptions.cacheable !== undefined\r\n                ? mappedRequestOptions.cacheable\r\n                : request.cacheable;\r\n            /**\r\n             * If is not \"cacheable\", we immediatly trigger the retryable request, no\r\n             * need to check cache implementations.\r\n             */\r\n            if (cacheable !== true) {\r\n                return createRetryableRequest();\r\n            }\r\n            /**\r\n             * If the request is \"cacheable\", we need to first compute the key to ask\r\n             * the cache implementations if this request is on progress or if the\r\n             * response already exists on the cache.\r\n             */\r\n            const key = {\r\n                request,\r\n                mappedRequestOptions,\r\n                transporter: {\r\n                    queryParameters: transporter.queryParameters,\r\n                    headers: transporter.headers,\r\n                },\r\n            };\r\n            /**\r\n             * With the computed key, we first ask the responses cache\r\n             * implemention if this request was been resolved before.\r\n             */\r\n            return transporter.responsesCache.get(key, () => {\r\n                /**\r\n                 * If the request has never resolved before, we actually ask if there\r\n                 * is a current request with the same key on progress.\r\n                 */\r\n                return transporter.requestsCache.get(key, () => {\r\n                    return (transporter.requestsCache\r\n                        /**\r\n                         * Finally, if there is no request in progress with the same key,\r\n                         * this `createRetryableRequest()` will actually trigger the\r\n                         * retryable request.\r\n                         */\r\n                        .set(key, createRetryableRequest())\r\n                        .then(response => Promise.all([transporter.requestsCache.delete(key), response]), err => Promise.all([transporter.requestsCache.delete(key), Promise.reject(err)]))\r\n                        .then(([_, response]) => response));\r\n                });\r\n            }, {\r\n                /**\r\n                 * Of course, once we get this response back from the server, we\r\n                 * tell response cache to actually store the received response\r\n                 * to be used later.\r\n                 */\r\n                miss: response => transporter.responsesCache.set(key, response),\r\n            });\r\n        },\r\n        write(request, requestOptions) {\r\n            /**\r\n             * On write requests, no cache mechanisms are applied, and we\r\n             * proxy the request immediately to the requester.\r\n             */\r\n            return retryableRequest(transporter, transporter.hosts.filter(host => (host.accept & CallEnum.Write) !== 0), request, createMappedRequestOptions(requestOptions, transporter.timeouts.write));\r\n        },\r\n    };\r\n    return transporter;\r\n}\n\nfunction createUserAgent(version) {\r\n    const userAgent = {\r\n        value: `Algolia for JavaScript (${version})`,\r\n        add(options) {\r\n            const addedUserAgent = `; ${options.segment}${options.version !== undefined ? ` (${options.version})` : ''}`;\r\n            if (userAgent.value.indexOf(addedUserAgent) === -1) {\r\n                // eslint-disable-next-line functional/immutable-data\r\n                userAgent.value = `${userAgent.value}${addedUserAgent}`;\r\n            }\r\n            return userAgent;\r\n        },\r\n    };\r\n    return userAgent;\r\n}\n\nfunction deserializeSuccess(response) {\r\n    // eslint-disable-next-line functional/no-try-statement\r\n    try {\r\n        return JSON.parse(response.content);\r\n    }\r\n    catch (e) {\r\n        throw createDeserializationError(e.message, response);\r\n    }\r\n}\r\nfunction deserializeFailure({ content, status }, stackFrame) {\r\n    // eslint-disable-next-line functional/no-let\r\n    let message = content;\r\n    // eslint-disable-next-line functional/no-try-statement\r\n    try {\r\n        message = JSON.parse(content).message;\r\n    }\r\n    catch (e) {\r\n        // ..\r\n    }\r\n    return createApiError(message, status, stackFrame);\r\n}\n\nfunction serializeUrl(host, path, queryParameters) {\r\n    const queryParametersAsString = serializeQueryParameters(queryParameters);\r\n    // eslint-disable-next-line functional/no-let\r\n    let url = `${host.protocol}://${host.url}/${path.charAt(0) === '/' ? path.substr(1) : path}`;\r\n    if (queryParametersAsString.length) {\r\n        url += `?${queryParametersAsString}`;\r\n    }\r\n    return url;\r\n}\r\nfunction serializeQueryParameters(parameters) {\r\n    const isObjectOrArray = (value) => Object.prototype.toString.call(value) === '[object Object]' ||\r\n        Object.prototype.toString.call(value) === '[object Array]';\r\n    return Object.keys(parameters)\r\n        .map(key => encode('%s=%s', key, isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key]))\r\n        .join('&');\r\n}\r\nfunction serializeData(request, requestOptions) {\r\n    if (request.method === MethodEnum.Get ||\r\n        (request.data === undefined && requestOptions.data === undefined)) {\r\n        return undefined;\r\n    }\r\n    const data = Array.isArray(request.data)\r\n        ? request.data\r\n        : { ...request.data, ...requestOptions.data };\r\n    return JSON.stringify(data);\r\n}\r\nfunction serializeHeaders(transporter, requestOptions) {\r\n    const headers = {\r\n        ...transporter.headers,\r\n        ...requestOptions.headers,\r\n    };\r\n    const serializedHeaders = {};\r\n    Object.keys(headers).forEach(header => {\r\n        const value = headers[header];\r\n        // @ts-ignore\r\n        // eslint-disable-next-line functional/immutable-data\r\n        serializedHeaders[header.toLowerCase()] = value;\r\n    });\r\n    return serializedHeaders;\r\n}\n\nfunction stackTraceWithoutCredentials(stackTrace) {\r\n    return stackTrace.map(stackFrame => stackFrameWithoutCredentials(stackFrame));\r\n}\r\nfunction stackFrameWithoutCredentials(stackFrame) {\r\n    const modifiedHeaders = stackFrame.request.headers['x-algolia-api-key']\r\n        ? { 'x-algolia-api-key': '*****' }\r\n        : {};\r\n    return {\r\n        ...stackFrame,\r\n        request: {\r\n            ...stackFrame.request,\r\n            headers: {\r\n                ...stackFrame.request.headers,\r\n                ...modifiedHeaders,\r\n            },\r\n        },\r\n    };\r\n}\n\nfunction createApiError(message, status, transporterStackTrace) {\r\n    return {\r\n        name: 'ApiError',\r\n        message,\r\n        status,\r\n        transporterStackTrace,\r\n    };\r\n}\n\nfunction createDeserializationError(message, response) {\r\n    return {\r\n        name: 'DeserializationError',\r\n        message,\r\n        response,\r\n    };\r\n}\n\nfunction createRetryError(transporterStackTrace) {\r\n    return {\r\n        name: 'RetryError',\r\n        message: 'Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.',\r\n        transporterStackTrace,\r\n    };\r\n}\n\nconst createSearchClient = options => {\r\n    const appId = options.appId;\r\n    const auth = createAuth(options.authMode !== undefined ? options.authMode : AuthMode.WithinHeaders, appId, options.apiKey);\r\n    const transporter = createTransporter({\r\n        hosts: [\r\n            { url: `${appId}-dsn.algolia.net`, accept: CallEnum.Read },\r\n            { url: `${appId}.algolia.net`, accept: CallEnum.Write },\r\n        ].concat(shuffle([\r\n            { url: `${appId}-1.algolianet.com` },\r\n            { url: `${appId}-2.algolianet.com` },\r\n            { url: `${appId}-3.algolianet.com` },\r\n        ])),\r\n        ...options,\r\n        headers: {\r\n            ...auth.headers(),\r\n            ...{ 'content-type': 'application/x-www-form-urlencoded' },\r\n            ...options.headers,\r\n        },\r\n        queryParameters: {\r\n            ...auth.queryParameters(),\r\n            ...options.queryParameters,\r\n        },\r\n    });\r\n    const base = {\r\n        transporter,\r\n        appId,\r\n        addAlgoliaAgent(segment, version) {\r\n            transporter.userAgent.add({ segment, version });\r\n        },\r\n        clearCache() {\r\n            return Promise.all([\r\n                transporter.requestsCache.clear(),\r\n                transporter.responsesCache.clear(),\r\n            ]).then(() => undefined);\r\n        },\r\n    };\r\n    return addMethods(base, options.methods);\r\n};\n\nconst customRequest = (base) => {\r\n    return (request, requestOptions) => {\r\n        if (request.method === MethodEnum.Get) {\r\n            return base.transporter.read(request, requestOptions);\r\n        }\r\n        return base.transporter.write(request, requestOptions);\r\n    };\r\n};\n\nconst initIndex = (base) => {\r\n    return (indexName, options = {}) => {\r\n        const searchIndex = {\r\n            transporter: base.transporter,\r\n            appId: base.appId,\r\n            indexName,\r\n        };\r\n        return addMethods(searchIndex, options.methods);\r\n    };\r\n};\n\nconst multipleQueries = (base) => {\r\n    return (queries, requestOptions) => {\r\n        const requests = queries.map(query => {\r\n            return {\r\n                ...query,\r\n                params: serializeQueryParameters(query.params || {}),\r\n            };\r\n        });\r\n        return base.transporter.read({\r\n            method: MethodEnum.Post,\r\n            path: '1/indexes/*/queries',\r\n            data: {\r\n                requests,\r\n            },\r\n            cacheable: true,\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst multipleSearchForFacetValues = (base) => {\r\n    return (queries, requestOptions) => {\r\n        return Promise.all(queries.map(query => {\r\n            const { facetName, facetQuery, ...params } = query.params;\r\n            return initIndex(base)(query.indexName, {\r\n                methods: { searchForFacetValues },\r\n            }).searchForFacetValues(facetName, facetQuery, {\r\n                ...requestOptions,\r\n                ...params,\r\n            });\r\n        }));\r\n    };\r\n};\n\nconst findAnswers = (base) => {\r\n    return (query, queryLanguages, requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Post,\r\n            path: encode('1/answers/%s/prediction', base.indexName),\r\n            data: {\r\n                query,\r\n                queryLanguages,\r\n            },\r\n            cacheable: true,\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst search = (base) => {\r\n    return (query, requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Post,\r\n            path: encode('1/indexes/%s/query', base.indexName),\r\n            data: {\r\n                query,\r\n            },\r\n            cacheable: true,\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst searchForFacetValues = (base) => {\r\n    return (facetName, facetQuery, requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Post,\r\n            path: encode('1/indexes/%s/facets/%s/query', base.indexName, facetName),\r\n            data: {\r\n                facetQuery,\r\n            },\r\n            cacheable: true,\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst LogLevelEnum = {\r\n    Debug: 1,\r\n    Info: 2,\r\n    Error: 3,\r\n};\n\n/* eslint no-console: 0 */\r\nfunction createConsoleLogger(logLevel) {\r\n    return {\r\n        debug(message, args) {\r\n            if (LogLevelEnum.Debug >= logLevel) {\r\n                console.debug(message, args);\r\n            }\r\n            return Promise.resolve();\r\n        },\r\n        info(message, args) {\r\n            if (LogLevelEnum.Info >= logLevel) {\r\n                console.info(message, args);\r\n            }\r\n            return Promise.resolve();\r\n        },\r\n        error(message, args) {\r\n            console.error(message, args);\r\n            return Promise.resolve();\r\n        },\r\n    };\r\n}\n\nfunction createBrowserXhrRequester() {\r\n    return {\r\n        send(request) {\r\n            return new Promise((resolve) => {\r\n                const baseRequester = new XMLHttpRequest();\r\n                baseRequester.open(request.method, request.url, true);\r\n                Object.keys(request.headers).forEach(key => baseRequester.setRequestHeader(key, request.headers[key]));\r\n                const createTimeout = (timeout, content) => {\r\n                    return setTimeout(() => {\r\n                        baseRequester.abort();\r\n                        resolve({\r\n                            status: 0,\r\n                            content,\r\n                            isTimedOut: true,\r\n                        });\r\n                    }, timeout * 1000);\r\n                };\r\n                const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');\r\n                // eslint-disable-next-line functional/no-let\r\n                let responseTimeout;\r\n                // eslint-disable-next-line functional/immutable-data\r\n                baseRequester.onreadystatechange = () => {\r\n                    if (baseRequester.readyState > baseRequester.OPENED && responseTimeout === undefined) {\r\n                        clearTimeout(connectTimeout);\r\n                        responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');\r\n                    }\r\n                };\r\n                // eslint-disable-next-line functional/immutable-data\r\n                baseRequester.onerror = () => {\r\n                    // istanbul ignore next\r\n                    if (baseRequester.status === 0) {\r\n                        clearTimeout(connectTimeout);\r\n                        clearTimeout(responseTimeout);\r\n                        resolve({\r\n                            content: baseRequester.responseText || 'Network request failed',\r\n                            status: baseRequester.status,\r\n                            isTimedOut: false,\r\n                        });\r\n                    }\r\n                };\r\n                //  eslint-disable-next-line functional/immutable-data\r\n                baseRequester.onload = () => {\r\n                    clearTimeout(connectTimeout);\r\n                    clearTimeout(responseTimeout);\r\n                    resolve({\r\n                        content: baseRequester.responseText,\r\n                        status: baseRequester.status,\r\n                        isTimedOut: false,\r\n                    });\r\n                };\r\n                baseRequester.send(request.data);\r\n            });\r\n        },\r\n    };\r\n}\n\nfunction algoliasearch(appId, apiKey, options) {\r\n    const commonOptions = {\r\n        appId,\r\n        apiKey,\r\n        timeouts: {\r\n            connect: 1,\r\n            read: 2,\r\n            write: 30,\r\n        },\r\n        requester: createBrowserXhrRequester(),\r\n        logger: createConsoleLogger(LogLevelEnum.Error),\r\n        responsesCache: createInMemoryCache(),\r\n        requestsCache: createInMemoryCache({ serializable: false }),\r\n        hostsCache: createFallbackableCache({\r\n            caches: [\r\n                createBrowserLocalStorageCache({ key: `${version}-${appId}` }),\r\n                createInMemoryCache(),\r\n            ],\r\n        }),\r\n        userAgent: createUserAgent(version).add({\r\n            segment: 'Browser',\r\n            version: 'lite',\r\n        }),\r\n        authMode: AuthMode.WithinQueryParameters,\r\n    };\r\n    return createSearchClient({\r\n        ...commonOptions,\r\n        ...options,\r\n        methods: {\r\n            search: multipleQueries,\r\n            searchForFacetValues: multipleSearchForFacetValues,\r\n            multipleQueries,\r\n            multipleSearchForFacetValues,\r\n            customRequest,\r\n            initIndex: base => (indexName) => {\r\n                return initIndex(base)(indexName, {\r\n                    methods: { search, searchForFacetValues, findAnswers },\r\n                });\r\n            },\r\n        },\r\n    });\r\n}\r\n// eslint-disable-next-line functional/immutable-data\r\nalgoliasearch.version = version;\n\nexport default algoliasearch;\n"
  },
  {
    "path": "js/algoliasearch/dist/algoliasearch-lite.umd.js",
    "content": "/*! algoliasearch-lite.umd.js | 4.18.0 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */\n!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):(e=e||self).algoliasearch=t()}(this,(function(){\"use strict\";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(r){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}function n(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||\"[object Arguments]\"===Object.prototype.toString.call(e)))return;var r=[],n=!0,o=!1,a=void 0;try{for(var u,i=e[Symbol.iterator]();!(n=(u=i.next()).done)&&(r.push(u.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==i.return||i.return()}finally{if(o)throw a}}return r}(e,t)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function a(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||\"[object Arguments]\"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function u(e){var t,r=\"algoliasearch-client-js-\".concat(e.key),n=function(){return void 0===t&&(t=e.localStorage||window.localStorage),t},a=function(){return JSON.parse(n().getItem(r)||\"{}\")},u=function(e){n().setItem(r,JSON.stringify(e))},i=function(){var t=e.timeToLive?1e3*e.timeToLive:null,r=a(),n=Object.fromEntries(Object.entries(r).filter((function(e){return void 0!==o(e,2)[1].timestamp})));if(u(n),t){var i=Object.fromEntries(Object.entries(n).filter((function(e){var r=o(e,2)[1],n=(new Date).getTime();return!(r.timestamp+t<n)})));u(i)}};return{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){i();var t=JSON.stringify(e);return a()[t]})).then((function(e){return Promise.all([e?e.value:t(),void 0!==e])})).then((function(e){var t=o(e,2),n=t[0],a=t[1];return Promise.all([n,a||r.miss(n)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var o=a();return o[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},n().setItem(r,JSON.stringify(o)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=a();delete t[JSON.stringify(e)],n().setItem(r,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){n().removeItem(r)}))}}}function i(e){var t=a(e.caches),r=t.shift();return void 0===r?{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},n=t();return n.then((function(e){return Promise.all([e,r.miss(e)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return r.get(e,n,o).catch((function(){return i({caches:t}).get(e,n,o)}))},set:function(e,n){return r.set(e,n).catch((function(){return i({caches:t}).set(e,n)}))},delete:function(e){return r.delete(e).catch((function(){return i({caches:t}).delete(e)}))},clear:function(){return r.clear().catch((function(){return i({caches:t}).clear()}))}}}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(r,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(r);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var u=n(),i=o&&o.miss||function(){return Promise.resolve()};return u.then((function(e){return i(e)})).then((function(){return u}))},set:function(r,n){return t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function c(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function l(e,t){return t?(Object.keys(t).forEach((function(r){e[r]=t[r](e)})),e):e}function f(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=0;return e.replace(/%s/g,(function(){return encodeURIComponent(r[o++])}))}var m={WithinQueryParameters:0,WithinHeaders:1};function h(e,t){var r=e||{},n=r.data||{};return Object.keys(r).forEach((function(e){-1===[\"timeout\",\"headers\",\"queryParameters\",\"data\",\"cacheable\"].indexOf(e)&&(n[e]=r[e])})),{data:Object.entries(n).length>0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var d={Read:1,Write:2,Any:3},p=1,v=2,g=3;function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;return r(r({},e),{},{status:t,lastUpdate:Date.now()})}function b(e){return\"string\"==typeof e?{protocol:\"https\",url:e,accept:d.Any}:{protocol:e.protocol||\"https\",url:e.url,accept:e.accept||d.Any}}var O=\"GET\",P=\"POST\";function q(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(y(t))}))}))).then((function(e){var r=e.filter((function(e){return function(e){return e.status===p||Date.now()-e.lastUpdate>12e4}(e)})),n=e.filter((function(e){return function(e){return e.status===g&&Date.now()-e.lastUpdate<=12e4}(e)})),o=[].concat(a(r),a(n));return{getTimeout:function(e,t){return(0===n.length&&0===e?1:n.length+3+e)*t},statelessHosts:o.length>0?o.map((function(e){return b(e)})):t}}))}function j(e,t,n,o){var u=[],i=function(e,t){if(e.method===O||void 0===e.data&&void 0===t.data)return;var n=Array.isArray(e.data)?e.data:r(r({},e.data),t.data);return JSON.stringify(n)}(n,o),s=function(e,t){var n=r(r({},e.headers),t.headers),o={};return Object.keys(n).forEach((function(e){var t=n[e];o[e.toLowerCase()]=t})),o}(e,o),c=n.method,l=n.method!==O?{}:r(r({},n.data),o.data),f=r(r(r({\"x-algolia-agent\":e.userAgent.value},e.queryParameters),l),o.queryParameters),m=0,h=function t(r,a){var l=r.pop();if(void 0===l)throw{name:\"RetryError\",message:\"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.\",transporterStackTrace:A(u)};var h={data:i,headers:s,method:c,url:S(l,n.path,f),connectTimeout:a(m,e.timeouts.connect),responseTimeout:a(m,o.timeout)},d=function(e){var t={request:h,response:e,host:l,triesLeft:r.length};return u.push(t),t},p={onSuccess:function(e){return function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:\"DeserializationError\",message:e,response:t}}(t.message,e)}}(e)},onRetry:function(n){var o=d(n);return n.isTimedOut&&m++,Promise.all([e.logger.info(\"Retryable failure\",N(o)),e.hostsCache.set(l,y(l,n.isTimedOut?g:v))]).then((function(){return t(r,a)}))},onFail:function(e){throw d(e),function(e,t){var r=e.content,n=e.status,o=r;try{o=JSON.parse(r).message}catch(e){}return function(e,t,r){return{name:\"ApiError\",message:e,status:t,transporterStackTrace:r}}(o,n,t)}(e,A(u))}};return e.requester.send(h).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,r=e.status;return!t&&0==~~r}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSuccess(e):t.onFail(e)}(e,p)}))};return q(e.hostsCache,t).then((function(e){return h(a(e.statelessHosts).reverse(),e.getTimeout)}))}function w(e){var t={value:\"Algolia for JavaScript (\".concat(e,\")\"),add:function(e){var r=\"; \".concat(e.segment).concat(void 0!==e.version?\" (\".concat(e.version,\")\"):\"\");return-1===t.value.indexOf(r)&&(t.value=\"\".concat(t.value).concat(r)),t}};return t}function S(e,t,r){var n=T(r),o=\"\".concat(e.protocol,\"://\").concat(e.url,\"/\").concat(\"/\"===t.charAt(0)?t.substr(1):t);return n.length&&(o+=\"?\".concat(n)),o}function T(e){return Object.keys(e).map((function(t){return f(\"%s=%s\",t,(r=e[t],\"[object Object]\"===Object.prototype.toString.call(r)||\"[object Array]\"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r})).join(\"&\")}function A(e){return e.map((function(e){return N(e)}))}function N(e){var t=e.request.headers[\"x-algolia-api-key\"]?{\"x-algolia-api-key\":\"*****\"}:{};return r(r({},e),{},{request:r(r({},e.request),{},{headers:r(r({},e.request.headers),t)})})}var x=function(e){var t=e.appId,n=function(e,t,r){var n={\"x-algolia-api-key\":r,\"x-algolia-application-id\":t};return{headers:function(){return e===m.WithinHeaders?n:{}},queryParameters:function(){return e===m.WithinQueryParameters?n:{}}}}(void 0!==e.authMode?e.authMode:m.WithinHeaders,t,e.apiKey),a=function(e){var t=e.hostsCache,r=e.logger,n=e.requester,a=e.requestsCache,u=e.responsesCache,i=e.timeouts,s=e.userAgent,c=e.hosts,l=e.queryParameters,f={hostsCache:t,logger:r,requester:n,requestsCache:a,responsesCache:u,timeouts:i,userAgent:s,headers:e.headers,queryParameters:l,hosts:c.map((function(e){return b(e)})),read:function(e,t){var r=h(t,f.timeouts.read),n=function(){return j(f,f.hosts.filter((function(e){return 0!=(e.accept&d.Read)})),e,r)};if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();var a={request:e,mappedRequestOptions:r,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(a,(function(){return f.requestsCache.get(a,(function(){return f.requestsCache.set(a,n()).then((function(e){return Promise.all([f.requestsCache.delete(a),e])}),(function(e){return Promise.all([f.requestsCache.delete(a),Promise.reject(e)])})).then((function(e){var t=o(e,2);t[0];return t[1]}))}))}),{miss:function(e){return f.responsesCache.set(a,e)}})},write:function(e,t){return j(f,f.hosts.filter((function(e){return 0!=(e.accept&d.Write)})),e,h(t,f.timeouts.write))}};return f}(r(r({hosts:[{url:\"\".concat(t,\"-dsn.algolia.net\"),accept:d.Read},{url:\"\".concat(t,\".algolia.net\"),accept:d.Write}].concat(c([{url:\"\".concat(t,\"-1.algolianet.com\")},{url:\"\".concat(t,\"-2.algolianet.com\")},{url:\"\".concat(t,\"-3.algolianet.com\")}]))},e),{},{headers:r(r(r({},n.headers()),{\"content-type\":\"application/x-www-form-urlencoded\"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return l({transporter:a,appId:t,addAlgoliaAgent:function(e,t){a.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then((function(){}))}},e.methods)},C=function(e){return function(t,r){return t.method===O?e.transporter.read(t,r):e.transporter.write(t,r)}},E=function(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={transporter:e.transporter,appId:e.appId,indexName:t};return l(n,r.methods)}},J=function(e){return function(t,n){var o=t.map((function(e){return r(r({},e),{},{params:T(e.params||{})})}));return e.transporter.read({method:P,path:\"1/indexes/*/queries\",data:{requests:o},cacheable:!0},n)}},k=function(e){return function(t,o){return Promise.all(t.map((function(t){var a=t.params,u=a.facetName,i=a.facetQuery,s=n(a,[\"facetName\",\"facetQuery\"]);return E(e)(t.indexName,{methods:{searchForFacetValues:R}}).searchForFacetValues(u,i,r(r({},o),s))})))}},I=function(e){return function(t,r,n){return e.transporter.read({method:P,path:f(\"1/answers/%s/prediction\",e.indexName),data:{query:t,queryLanguages:r},cacheable:!0},n)}},F=function(e){return function(t,r){return e.transporter.read({method:P,path:f(\"1/indexes/%s/query\",e.indexName),data:{query:t},cacheable:!0},r)}},R=function(e){return function(t,r,n){return e.transporter.read({method:P,path:f(\"1/indexes/%s/facets/%s/query\",e.indexName,t),data:{facetQuery:r},cacheable:!0},n)}},D=1,W=2,H=3;function Q(e,t,n){var o,a={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return r.setRequestHeader(t,e.headers[t])}));var n,o=function(e,n){return setTimeout((function(){r.abort(),t({status:0,content:n,isTimedOut:!0})}),1e3*e)},a=o(e.connectTimeout,\"Connection timeout\");r.onreadystatechange=function(){r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=o(e.responseTimeout,\"Socket timeout\"))},r.onerror=function(){0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||\"Network request failed\",status:r.status,isTimedOut:!1}))},r.onload=function(){clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},logger:(o=H,{debug:function(e,t){return D>=o&&console.debug(e,t),Promise.resolve()},info:function(e,t){return W>=o&&console.info(e,t),Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}}),responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:i({caches:[u({key:\"\".concat(\"4.18.0\",\"-\").concat(e)}),s()]}),userAgent:w(\"4.18.0\").add({segment:\"Browser\",version:\"lite\"}),authMode:m.WithinQueryParameters};return x(r(r(r({},a),n),{},{methods:{search:J,searchForFacetValues:k,multipleQueries:J,multipleSearchForFacetValues:k,customRequest:C,initIndex:function(e){return function(t){return E(e)(t,{methods:{search:F,searchForFacetValues:R,findAnswers:I}})}}}}))}return Q.version=\"4.18.0\",Q}));\n"
  },
  {
    "path": "js/algoliasearch/dist/algoliasearch.cjs.js",
    "content": "'use strict';\n\nvar cacheCommon = require('@algolia/cache-common');\nvar cacheInMemory = require('@algolia/cache-in-memory');\nvar clientAnalytics = require('@algolia/client-analytics');\nvar clientCommon = require('@algolia/client-common');\nvar clientPersonalization = require('@algolia/client-personalization');\nvar clientSearch = require('@algolia/client-search');\nvar loggerCommon = require('@algolia/logger-common');\nvar requesterNodeHttp = require('@algolia/requester-node-http');\nvar transporter = require('@algolia/transporter');\n\nfunction algoliasearch(appId, apiKey, options) {\r\n    const commonOptions = {\r\n        appId,\r\n        apiKey,\r\n        timeouts: {\r\n            connect: 2,\r\n            read: 5,\r\n            write: 30,\r\n        },\r\n        requester: requesterNodeHttp.createNodeHttpRequester(),\r\n        logger: loggerCommon.createNullLogger(),\r\n        responsesCache: cacheCommon.createNullCache(),\r\n        requestsCache: cacheCommon.createNullCache(),\r\n        hostsCache: cacheInMemory.createInMemoryCache(),\r\n        userAgent: transporter.createUserAgent(clientCommon.version).add({\r\n            segment: 'Node.js',\r\n            version: process.versions.node,\r\n        }),\r\n    };\r\n    const searchClientOptions = { ...commonOptions, ...options };\r\n    const initPersonalization = () => (clientOptions) => {\r\n        return clientPersonalization.createPersonalizationClient({\r\n            ...commonOptions,\r\n            ...clientOptions,\r\n            methods: {\r\n                getPersonalizationStrategy: clientPersonalization.getPersonalizationStrategy,\r\n                setPersonalizationStrategy: clientPersonalization.setPersonalizationStrategy,\r\n            },\r\n        });\r\n    };\r\n    return clientSearch.createSearchClient({\r\n        ...searchClientOptions,\r\n        methods: {\r\n            search: clientSearch.multipleQueries,\r\n            searchForFacetValues: clientSearch.multipleSearchForFacetValues,\r\n            multipleBatch: clientSearch.multipleBatch,\r\n            multipleGetObjects: clientSearch.multipleGetObjects,\r\n            multipleQueries: clientSearch.multipleQueries,\r\n            copyIndex: clientSearch.copyIndex,\r\n            copySettings: clientSearch.copySettings,\r\n            copyRules: clientSearch.copyRules,\r\n            copySynonyms: clientSearch.copySynonyms,\r\n            moveIndex: clientSearch.moveIndex,\r\n            listIndices: clientSearch.listIndices,\r\n            getLogs: clientSearch.getLogs,\r\n            listClusters: clientSearch.listClusters,\r\n            multipleSearchForFacetValues: clientSearch.multipleSearchForFacetValues,\r\n            getApiKey: clientSearch.getApiKey,\r\n            addApiKey: clientSearch.addApiKey,\r\n            listApiKeys: clientSearch.listApiKeys,\r\n            updateApiKey: clientSearch.updateApiKey,\r\n            deleteApiKey: clientSearch.deleteApiKey,\r\n            restoreApiKey: clientSearch.restoreApiKey,\r\n            assignUserID: clientSearch.assignUserID,\r\n            assignUserIDs: clientSearch.assignUserIDs,\r\n            getUserID: clientSearch.getUserID,\r\n            searchUserIDs: clientSearch.searchUserIDs,\r\n            listUserIDs: clientSearch.listUserIDs,\r\n            getTopUserIDs: clientSearch.getTopUserIDs,\r\n            removeUserID: clientSearch.removeUserID,\r\n            hasPendingMappings: clientSearch.hasPendingMappings,\r\n            generateSecuredApiKey: clientSearch.generateSecuredApiKey,\r\n            getSecuredApiKeyRemainingValidity: clientSearch.getSecuredApiKeyRemainingValidity,\r\n            destroy: clientCommon.destroy,\r\n            clearDictionaryEntries: clientSearch.clearDictionaryEntries,\r\n            deleteDictionaryEntries: clientSearch.deleteDictionaryEntries,\r\n            getDictionarySettings: clientSearch.getDictionarySettings,\r\n            getAppTask: clientSearch.getAppTask,\r\n            replaceDictionaryEntries: clientSearch.replaceDictionaryEntries,\r\n            saveDictionaryEntries: clientSearch.saveDictionaryEntries,\r\n            searchDictionaryEntries: clientSearch.searchDictionaryEntries,\r\n            setDictionarySettings: clientSearch.setDictionarySettings,\r\n            waitAppTask: clientSearch.waitAppTask,\r\n            customRequest: clientSearch.customRequest,\r\n            initIndex: base => (indexName) => {\r\n                return clientSearch.initIndex(base)(indexName, {\r\n                    methods: {\r\n                        batch: clientSearch.batch,\r\n                        delete: clientSearch.deleteIndex,\r\n                        findAnswers: clientSearch.findAnswers,\r\n                        getObject: clientSearch.getObject,\r\n                        getObjects: clientSearch.getObjects,\r\n                        saveObject: clientSearch.saveObject,\r\n                        saveObjects: clientSearch.saveObjects,\r\n                        search: clientSearch.search,\r\n                        searchForFacetValues: clientSearch.searchForFacetValues,\r\n                        waitTask: clientSearch.waitTask,\r\n                        setSettings: clientSearch.setSettings,\r\n                        getSettings: clientSearch.getSettings,\r\n                        partialUpdateObject: clientSearch.partialUpdateObject,\r\n                        partialUpdateObjects: clientSearch.partialUpdateObjects,\r\n                        deleteObject: clientSearch.deleteObject,\r\n                        deleteObjects: clientSearch.deleteObjects,\r\n                        deleteBy: clientSearch.deleteBy,\r\n                        clearObjects: clientSearch.clearObjects,\r\n                        browseObjects: clientSearch.browseObjects,\r\n                        getObjectPosition: clientSearch.getObjectPosition,\r\n                        findObject: clientSearch.findObject,\r\n                        exists: clientSearch.exists,\r\n                        saveSynonym: clientSearch.saveSynonym,\r\n                        saveSynonyms: clientSearch.saveSynonyms,\r\n                        getSynonym: clientSearch.getSynonym,\r\n                        searchSynonyms: clientSearch.searchSynonyms,\r\n                        browseSynonyms: clientSearch.browseSynonyms,\r\n                        deleteSynonym: clientSearch.deleteSynonym,\r\n                        clearSynonyms: clientSearch.clearSynonyms,\r\n                        replaceAllObjects: clientSearch.replaceAllObjects,\r\n                        replaceAllSynonyms: clientSearch.replaceAllSynonyms,\r\n                        searchRules: clientSearch.searchRules,\r\n                        getRule: clientSearch.getRule,\r\n                        deleteRule: clientSearch.deleteRule,\r\n                        saveRule: clientSearch.saveRule,\r\n                        saveRules: clientSearch.saveRules,\r\n                        replaceAllRules: clientSearch.replaceAllRules,\r\n                        browseRules: clientSearch.browseRules,\r\n                        clearRules: clientSearch.clearRules,\r\n                    },\r\n                });\r\n            },\r\n            initAnalytics: () => (clientOptions) => {\r\n                return clientAnalytics.createAnalyticsClient({\r\n                    ...commonOptions,\r\n                    ...clientOptions,\r\n                    methods: {\r\n                        addABTest: clientAnalytics.addABTest,\r\n                        getABTest: clientAnalytics.getABTest,\r\n                        getABTests: clientAnalytics.getABTests,\r\n                        stopABTest: clientAnalytics.stopABTest,\r\n                        deleteABTest: clientAnalytics.deleteABTest,\r\n                    },\r\n                });\r\n            },\r\n            initPersonalization,\r\n            initRecommendation: () => (clientOptions) => {\r\n                searchClientOptions.logger.info('The `initRecommendation` method is deprecated. Use `initPersonalization` instead.');\r\n                return initPersonalization()(clientOptions);\r\n            },\r\n        },\r\n    });\r\n}\r\n// eslint-disable-next-line functional/immutable-data\r\nalgoliasearch.version = clientCommon.version;\n\nmodule.exports = algoliasearch;\n"
  },
  {
    "path": "js/algoliasearch/dist/algoliasearch.d.ts",
    "content": "import { ABTest } from '@algolia/client-analytics';\r\nimport { AddABTestResponse } from '@algolia/client-analytics';\r\nimport { AddApiKeyOptions } from '@algolia/client-search';\r\nimport { AddApiKeyResponse } from '@algolia/client-search';\r\nimport { AnalyticsClient as AnalyticsClient_2 } from '@algolia/client-analytics';\r\nimport { AnalyticsClientOptions } from '@algolia/client-analytics';\r\nimport { ApiKeyACLType } from '@algolia/client-search';\r\nimport { AssignUserIDResponse } from '@algolia/client-search';\r\nimport { AssignUserIDsResponse } from '@algolia/client-search';\r\nimport { BatchRequest } from '@algolia/client-search';\r\nimport { BatchResponse } from '@algolia/client-search';\r\nimport { BrowseOptions } from '@algolia/client-search';\r\nimport { ChunkedBatchResponse } from '@algolia/client-search';\r\nimport { ChunkOptions } from '@algolia/client-search';\r\nimport { ClearRulesOptions } from '@algolia/client-search';\r\nimport { ClearSynonymsOptions } from '@algolia/client-search';\r\nimport { ClientTransporterOptions } from '@algolia/client-common';\r\nimport { CopyIndexOptions } from '@algolia/client-search';\r\nimport { DeleteABTestResponse } from '@algolia/client-analytics';\r\nimport { DeleteApiKeyResponse } from '@algolia/client-search';\r\nimport { DeleteByFiltersOptions } from '@algolia/client-search';\r\nimport { DeleteResponse } from '@algolia/client-search';\r\nimport { DeleteSynonymOptions } from '@algolia/client-search';\r\nimport { Destroyable } from '@algolia/requester-common';\r\nimport { DictionaryEntriesOptions } from '@algolia/client-search';\r\nimport { DictionaryEntriesResponse } from '@algolia/client-search';\r\nimport { DictionaryEntry } from '@algolia/client-search';\r\nimport { DictionaryName } from '@algolia/client-search';\r\nimport { DictionarySettings } from '@algolia/client-search';\r\nimport { FindAnswersOptions } from '@algolia/client-search';\r\nimport { FindAnswersResponse } from '@algolia/client-search';\r\nimport { FindObjectOptions } from '@algolia/client-search';\r\nimport { FindObjectResponse } from '@algolia/client-search';\r\nimport { GetABTestResponse } from '@algolia/client-analytics';\r\nimport { GetABTestsOptions } from '@algolia/client-analytics';\r\nimport { GetABTestsResponse } from '@algolia/client-analytics';\r\nimport { GetApiKeyResponse } from '@algolia/client-search';\r\nimport { GetDictionarySettingsResponse } from '@algolia/client-search';\r\nimport { GetLogsResponse } from '@algolia/client-search';\r\nimport { GetObjectOptions } from '@algolia/client-search';\r\nimport { GetObjectsOptions } from '@algolia/client-search';\r\nimport { GetObjectsResponse } from '@algolia/client-search';\r\nimport { GetPersonalizationStrategyResponse } from '@algolia/client-personalization';\r\nimport { GetTopUserIDsResponse } from '@algolia/client-search';\r\nimport { HasPendingMappingsOptions } from '@algolia/client-search';\r\nimport { HasPendingMappingsResponse } from '@algolia/client-search';\r\nimport { IndexOperationResponse } from '@algolia/client-search';\r\nimport { ListApiKeysResponse } from '@algolia/client-search';\r\nimport { ListClustersResponse } from '@algolia/client-search';\r\nimport { ListIndicesResponse } from '@algolia/client-search';\r\nimport { ListUserIDsOptions } from '@algolia/client-search';\r\nimport { ListUserIDsResponse } from '@algolia/client-search';\r\nimport { MultipleBatchRequest } from '@algolia/client-search';\r\nimport { MultipleBatchResponse } from '@algolia/client-search';\r\nimport { MultipleGetObject } from '@algolia/client-search';\r\nimport { MultipleGetObjectsResponse } from '@algolia/client-search';\r\nimport { MultipleQueriesOptions } from '@algolia/client-search';\r\nimport { MultipleQueriesQuery } from '@algolia/client-search';\r\nimport { MultipleQueriesResponse } from '@algolia/client-search';\r\nimport { ObjectWithObjectID } from '@algolia/client-search';\r\nimport { PartialUpdateObjectResponse } from '@algolia/client-search';\r\nimport { PartialUpdateObjectsOptions } from '@algolia/client-search';\r\nimport { PersonalizationClient as PersonalizationClient_2 } from '@algolia/client-personalization';\r\nimport { PersonalizationClientOptions } from '@algolia/client-personalization';\r\nimport { PersonalizationStrategy } from '@algolia/client-personalization';\r\nimport { RemoveUserIDResponse } from '@algolia/client-search';\r\nimport { ReplaceAllObjectsOptions } from '@algolia/client-search';\r\nimport { Request } from '@algolia/transporter';\r\nimport { RequestOptions } from '@algolia/transporter';\r\nimport { RestoreApiKeyResponse } from '@algolia/client-search';\r\nimport { Rule } from '@algolia/client-search';\r\nimport { SaveObjectResponse } from '@algolia/client-search';\r\nimport { SaveObjectsOptions } from '@algolia/client-search';\r\nimport { SaveRuleResponse } from '@algolia/client-search';\r\nimport { SaveRulesOptions } from '@algolia/client-search';\r\nimport { SaveRulesResponse } from '@algolia/client-search';\r\nimport { SaveSynonymResponse } from '@algolia/client-search';\r\nimport { SaveSynonymsOptions } from '@algolia/client-search';\r\nimport { SaveSynonymsResponse } from '@algolia/client-search';\r\nimport { SearchClient as SearchClient_2 } from '@algolia/client-search';\r\nimport { SearchClientOptions } from '@algolia/client-search';\r\nimport { SearchDictionaryEntriesResponse } from '@algolia/client-search';\r\nimport { SearchForFacetValuesQueryParams } from '@algolia/client-search';\r\nimport { SearchForFacetValuesResponse } from '@algolia/client-search';\r\nimport { SearchIndex as SearchIndex_2 } from '@algolia/client-search';\r\nimport { SearchOptions } from '@algolia/client-search';\r\nimport { SearchResponse } from '@algolia/client-search';\r\nimport { SearchRulesOptions } from '@algolia/client-search';\r\nimport { SearchSynonymsOptions } from '@algolia/client-search';\r\nimport { SearchSynonymsResponse } from '@algolia/client-search';\r\nimport { SearchUserIDsOptions } from '@algolia/client-search';\r\nimport { SearchUserIDsResponse } from '@algolia/client-search';\r\nimport { SecuredApiKeyRestrictions } from '@algolia/client-search';\r\nimport { SetPersonalizationStrategyResponse } from '@algolia/client-personalization';\r\nimport { SetSettingsResponse } from '@algolia/client-search';\r\nimport { Settings } from '@algolia/client-search';\r\nimport { StopABTestResponse } from '@algolia/client-analytics';\r\nimport { Synonym } from '@algolia/client-search';\r\nimport { TaskStatusResponse } from '@algolia/client-search';\r\nimport { UpdateApiKeyOptions } from '@algolia/client-search';\r\nimport { UpdateApiKeyResponse } from '@algolia/client-search';\r\nimport { UserIDResponse } from '@algolia/client-search';\r\nimport { WaitablePromise } from '@algolia/client-common';\r\n\r\ndeclare function algoliasearch(appId: string, apiKey: string, options?: AlgoliaSearchOptions): SearchClient;\r\n\r\ndeclare namespace algoliasearch {\r\n    var version: string;\r\n}\r\nexport default algoliasearch;\r\n\r\nexport declare type AlgoliaSearchOptions = Partial<ClientTransporterOptions> & WithoutCredentials<SearchClientOptions>;\r\n\r\nexport declare type AnalyticsClient = AnalyticsClient_2 & {\r\n    readonly addABTest: (abTest: ABTest, requestOptions?: RequestOptions) => Readonly<Promise<AddABTestResponse>>;\r\n    readonly getABTest: (abTestID: number, requestOptions?: RequestOptions) => Readonly<Promise<GetABTestResponse>>;\r\n    readonly getABTests: (requestOptions?: RequestOptions & GetABTestsOptions) => Readonly<Promise<GetABTestsResponse>>;\r\n    readonly stopABTest: (abTestID: number, requestOptions?: RequestOptions) => Readonly<Promise<StopABTestResponse>>;\r\n    readonly deleteABTest: (abTestID: number, requestOptions?: RequestOptions) => Readonly<Promise<DeleteABTestResponse>>;\r\n};\r\n\r\ndeclare type Credentials = {\r\n    readonly appId: string;\r\n    readonly apiKey: string;\r\n};\r\n\r\nexport declare type InitAnalyticsOptions = Partial<ClientTransporterOptions> & OptionalCredentials<AnalyticsClientOptions>;\r\n\r\nexport declare type InitPersonalizationOptions = Partial<ClientTransporterOptions> & OptionalCredentials<PersonalizationClientOptions>;\r\n\r\n/**\r\n * @deprecated Use `InitPersonalizationOptions` instead.\r\n */\r\nexport declare type InitRecommendationOptions = InitPersonalizationOptions;\r\n\r\nexport declare type OptionalCredentials<TClientOptions extends Credentials> = Omit<TClientOptions, keyof Credentials> & Pick<Partial<TClientOptions>, keyof Credentials>;\r\n\r\nexport declare type PersonalizationClient = PersonalizationClient_2 & {\r\n    readonly getPersonalizationStrategy: (requestOptions?: RequestOptions) => Readonly<Promise<GetPersonalizationStrategyResponse>>;\r\n    readonly setPersonalizationStrategy: (personalizationStrategy: PersonalizationStrategy, requestOptions?: RequestOptions) => Readonly<Promise<SetPersonalizationStrategyResponse>>;\r\n};\r\n\r\n/**\r\n * @deprecated Use `PersonalizationClient` instead.\r\n */\r\nexport declare type RecommendationClient = PersonalizationClient;\r\n\r\nexport declare type SearchClient = SearchClient_2 & {\r\n    readonly initIndex: (indexName: string) => SearchIndex;\r\n    readonly search: <TObject>(queries: readonly MultipleQueriesQuery[], requestOptions?: RequestOptions & MultipleQueriesOptions) => Readonly<Promise<MultipleQueriesResponse<TObject>>>;\r\n    readonly searchForFacetValues: (queries: ReadonlyArray<{\r\n        readonly indexName: string;\r\n        readonly params: SearchForFacetValuesQueryParams & SearchOptions;\r\n    }>, requestOptions?: RequestOptions) => Readonly<Promise<readonly SearchForFacetValuesResponse[]>>;\r\n    readonly multipleBatch: (requests: readonly MultipleBatchRequest[], requestOptions?: RequestOptions) => Readonly<WaitablePromise<MultipleBatchResponse>>;\r\n    readonly multipleGetObjects: <TObject>(requests: readonly MultipleGetObject[], requestOptions?: RequestOptions) => Readonly<Promise<MultipleGetObjectsResponse<TObject>>>;\r\n    readonly multipleQueries: <TObject>(queries: readonly MultipleQueriesQuery[], requestOptions?: RequestOptions & MultipleQueriesOptions) => Readonly<Promise<MultipleQueriesResponse<TObject>>>;\r\n    readonly copyIndex: (from: string, to: string, requestOptions?: CopyIndexOptions & RequestOptions) => Readonly<WaitablePromise<IndexOperationResponse>>;\r\n    readonly copySettings: (from: string, to: string, requestOptions?: RequestOptions) => Readonly<WaitablePromise<IndexOperationResponse>>;\r\n    readonly copyRules: (from: string, to: string, requestOptions?: RequestOptions) => Readonly<WaitablePromise<IndexOperationResponse>>;\r\n    readonly copySynonyms: (from: string, to: string, requestOptions?: RequestOptions) => Readonly<WaitablePromise<IndexOperationResponse>>;\r\n    readonly moveIndex: (from: string, to: string, requestOptions?: RequestOptions) => Readonly<WaitablePromise<IndexOperationResponse>>;\r\n    readonly listIndices: (requestOptions?: RequestOptions) => Readonly<Promise<ListIndicesResponse>>;\r\n    readonly getLogs: (requestOptions?: RequestOptions) => Readonly<Promise<GetLogsResponse>>;\r\n    readonly listClusters: (requestOptions?: RequestOptions) => Readonly<Promise<ListClustersResponse>>;\r\n    readonly multipleSearchForFacetValues: (queries: ReadonlyArray<{\r\n        readonly indexName: string;\r\n        readonly params: SearchForFacetValuesQueryParams & SearchOptions;\r\n    }>, requestOptions?: RequestOptions) => Readonly<Promise<readonly SearchForFacetValuesResponse[]>>;\r\n    readonly getApiKey: (apiKey: string, requestOptions?: RequestOptions) => Readonly<Promise<GetApiKeyResponse>>;\r\n    readonly addApiKey: (acl: readonly ApiKeyACLType[], requestOptions?: AddApiKeyOptions & Pick<RequestOptions, Exclude<keyof RequestOptions, 'queryParameters'>>) => Readonly<WaitablePromise<AddApiKeyResponse>>;\r\n    readonly listApiKeys: (requestOptions?: RequestOptions) => Readonly<Promise<ListApiKeysResponse>>;\r\n    readonly updateApiKey: (apiKey: string, requestOptions?: UpdateApiKeyOptions & Pick<RequestOptions, Exclude<keyof RequestOptions, 'queryParameters'>>) => Readonly<WaitablePromise<UpdateApiKeyResponse>>;\r\n    readonly deleteApiKey: (apiKey: string, requestOptions?: RequestOptions) => Readonly<WaitablePromise<DeleteApiKeyResponse>>;\r\n    readonly restoreApiKey: (apiKey: string, requestOptions?: RequestOptions) => Readonly<WaitablePromise<RestoreApiKeyResponse>>;\r\n    readonly assignUserID: (userID: string, clusterName: string, requestOptions?: RequestOptions) => Readonly<Promise<AssignUserIDResponse>>;\r\n    readonly assignUserIDs: (userIDs: readonly string[], clusterName: string, requestOptions?: RequestOptions) => Readonly<Promise<AssignUserIDsResponse>>;\r\n    readonly getUserID: (userID: string, requestOptions?: RequestOptions) => Readonly<Promise<UserIDResponse>>;\r\n    readonly searchUserIDs: (query: string, requestOptions?: SearchUserIDsOptions & RequestOptions) => Readonly<Promise<SearchUserIDsResponse>>;\r\n    readonly listUserIDs: (requestOptions?: ListUserIDsOptions & RequestOptions) => Readonly<Promise<ListUserIDsResponse>>;\r\n    readonly getTopUserIDs: (requestOptions?: RequestOptions) => Readonly<Promise<GetTopUserIDsResponse>>;\r\n    readonly removeUserID: (userID: string, requestOptions?: RequestOptions) => Readonly<Promise<RemoveUserIDResponse>>;\r\n    readonly hasPendingMappings: (requestOptions?: HasPendingMappingsOptions & RequestOptions) => Readonly<Promise<HasPendingMappingsResponse>>;\r\n    readonly generateSecuredApiKey: (parentApiKey: string, restrictions: SecuredApiKeyRestrictions) => string;\r\n    readonly getSecuredApiKeyRemainingValidity: (securedApiKey: string) => number;\r\n    readonly clearDictionaryEntries: (dictionary: DictionaryName, requestOptions?: RequestOptions & DictionaryEntriesOptions) => Readonly<WaitablePromise<DictionaryEntriesResponse>>;\r\n    readonly deleteDictionaryEntries: (dictionary: DictionaryName, objectIDs: readonly string[], requestOptions?: RequestOptions & DictionaryEntriesOptions) => Readonly<WaitablePromise<DictionaryEntriesResponse>>;\r\n    readonly replaceDictionaryEntries: (dictionary: DictionaryName, entries: readonly DictionaryEntry[], requestOptions?: RequestOptions & DictionaryEntriesOptions) => Readonly<WaitablePromise<DictionaryEntriesResponse>>;\r\n    readonly saveDictionaryEntries: (dictionary: DictionaryName, entries: readonly DictionaryEntry[], requestOptions?: RequestOptions & DictionaryEntriesOptions) => Readonly<WaitablePromise<DictionaryEntriesResponse>>;\r\n    readonly searchDictionaryEntries: (dictionary: DictionaryName, query: string, requestOptions?: RequestOptions) => Readonly<Promise<SearchDictionaryEntriesResponse>>;\r\n    readonly getDictionarySettings: (requestOptions?: RequestOptions) => Readonly<Promise<GetDictionarySettingsResponse>>;\r\n    readonly setDictionarySettings: (settings: DictionarySettings, requestOptions?: RequestOptions) => Readonly<WaitablePromise<DictionaryEntriesResponse>>;\r\n    readonly getAppTask: (taskID: number, requestOptions?: RequestOptions) => Readonly<Promise<TaskStatusResponse>>;\r\n    readonly customRequest: <TResponse>(request: Request, requestOptions?: RequestOptions) => Readonly<Promise<TResponse>>;\r\n    readonly initAnalytics: (options?: InitAnalyticsOptions) => AnalyticsClient;\r\n    readonly initPersonalization: (options?: InitPersonalizationOptions) => PersonalizationClient;\r\n    /**\r\n     * @deprecated Use `initPersonalization` instead.\r\n     */\r\n    readonly initRecommendation: (options?: InitPersonalizationOptions) => PersonalizationClient;\r\n} & Destroyable;\r\n\r\nexport declare type SearchIndex = SearchIndex_2 & {\r\n    readonly search: <TObject>(query: string, requestOptions?: RequestOptions & SearchOptions) => Readonly<Promise<SearchResponse<TObject>>>;\r\n    readonly searchForFacetValues: (facetName: string, facetQuery: string, requestOptions?: RequestOptions & SearchOptions) => Readonly<Promise<SearchForFacetValuesResponse>>;\r\n    readonly findAnswers: <TObject>(query: string, queryLanguages: readonly string[], requestOptions?: RequestOptions & FindAnswersOptions) => Readonly<Promise<FindAnswersResponse<TObject>>>;\r\n    readonly batch: (requests: readonly BatchRequest[], requestOptions?: RequestOptions) => Readonly<WaitablePromise<BatchResponse>>;\r\n    readonly delete: (requestOptions?: RequestOptions) => Readonly<WaitablePromise<DeleteResponse>>;\r\n    readonly getObject: <TObject>(objectID: string, requestOptions?: RequestOptions & GetObjectOptions) => Readonly<Promise<TObject & ObjectWithObjectID>>;\r\n    readonly getObjects: <TObject>(objectIDs: readonly string[], requestOptions?: RequestOptions & GetObjectsOptions) => Readonly<Promise<GetObjectsResponse<TObject>>>;\r\n    readonly saveObject: (object: Readonly<Record<string, any>>, requestOptions?: RequestOptions & ChunkOptions & SaveObjectsOptions) => Readonly<WaitablePromise<SaveObjectResponse>>;\r\n    readonly saveObjects: (objects: ReadonlyArray<Readonly<Record<string, any>>>, requestOptions?: RequestOptions & ChunkOptions & SaveObjectsOptions) => Readonly<WaitablePromise<ChunkedBatchResponse>>;\r\n    readonly waitTask: (taskID: number, requestOptions?: RequestOptions) => Readonly<Promise<void>>;\r\n    readonly setSettings: (settings: Settings, requestOptions?: RequestOptions) => Readonly<WaitablePromise<SetSettingsResponse>>;\r\n    readonly getSettings: (requestOptions?: RequestOptions) => Readonly<Promise<Settings>>;\r\n    readonly partialUpdateObject: (object: Record<string, any>, requestOptions?: RequestOptions & ChunkOptions & PartialUpdateObjectsOptions) => Readonly<WaitablePromise<PartialUpdateObjectResponse>>;\r\n    readonly partialUpdateObjects: (objects: ReadonlyArray<Record<string, any>>, requestOptions?: RequestOptions & ChunkOptions & PartialUpdateObjectsOptions) => Readonly<WaitablePromise<ChunkedBatchResponse>>;\r\n    readonly deleteObject: (objectID: string, requestOptions?: RequestOptions) => Readonly<WaitablePromise<DeleteResponse>>;\r\n    readonly deleteObjects: (objectIDs: readonly string[], requestOptions?: RequestOptions & ChunkOptions) => Readonly<WaitablePromise<ChunkedBatchResponse>>;\r\n    readonly deleteBy: (filters: DeleteByFiltersOptions, requestOptions?: RequestOptions) => Readonly<WaitablePromise<DeleteResponse>>;\r\n    readonly clearObjects: (requestOptions?: RequestOptions) => Readonly<WaitablePromise<DeleteResponse>>;\r\n    readonly browseObjects: <TObject>(requestOptions?: SearchOptions & BrowseOptions<TObject> & RequestOptions) => Readonly<Promise<void>>;\r\n    readonly getObjectPosition: (searchResponse: SearchResponse<{}>, objectID: string) => number;\r\n    readonly findObject: <TObject>(callback: (object: TObject & ObjectWithObjectID) => boolean, requestOptions?: FindObjectOptions & RequestOptions) => Readonly<Promise<FindObjectResponse<TObject>>>;\r\n    readonly exists: (requestOptions?: RequestOptions) => Readonly<Promise<boolean>>;\r\n    readonly saveSynonym: (synonym: Synonym, requestOptions?: RequestOptions & SaveSynonymsOptions) => Readonly<WaitablePromise<SaveSynonymResponse>>;\r\n    readonly saveSynonyms: (synonyms: readonly Synonym[], requestOptions?: SaveSynonymsOptions & RequestOptions) => Readonly<WaitablePromise<SaveSynonymsResponse>>;\r\n    readonly getSynonym: (objectID: string, requestOptions?: RequestOptions) => Readonly<Promise<Synonym>>;\r\n    readonly searchSynonyms: (query: string, requestOptions?: SearchSynonymsOptions & RequestOptions) => Readonly<Promise<SearchSynonymsResponse>>;\r\n    readonly browseSynonyms: (requestOptions?: SearchSynonymsOptions & BrowseOptions<Synonym> & RequestOptions) => Readonly<Promise<void>>;\r\n    readonly deleteSynonym: (objectID: string, requestOptions?: DeleteSynonymOptions & RequestOptions) => Readonly<WaitablePromise<DeleteResponse>>;\r\n    readonly clearSynonyms: (requestOptions?: ClearSynonymsOptions & RequestOptions) => Readonly<WaitablePromise<DeleteResponse>>;\r\n    readonly replaceAllObjects: (objects: ReadonlyArray<Readonly<Record<string, any>>>, requestOptions?: ReplaceAllObjectsOptions & ChunkOptions & SaveObjectsOptions & RequestOptions) => Readonly<WaitablePromise<ChunkedBatchResponse>>;\r\n    readonly replaceAllSynonyms: (synonyms: readonly Synonym[], requestOptions?: RequestOptions & Pick<SaveSynonymsOptions, Exclude<keyof SaveSynonymsOptions, 'clearExistingSynonyms' | 'replaceExistingSynonyms'>>) => Readonly<WaitablePromise<SaveSynonymsResponse>>;\r\n    readonly searchRules: (query: string, requestOptions?: RequestOptions & SearchRulesOptions) => Readonly<Promise<SearchResponse<Rule>>>;\r\n    readonly getRule: (objectID: string, requestOptions?: RequestOptions) => Readonly<Promise<Rule>>;\r\n    readonly deleteRule: (objectID: string, requestOptions?: RequestOptions) => Readonly<WaitablePromise<DeleteResponse>>;\r\n    readonly saveRule: (rule: Rule, requestOptions?: RequestOptions & SaveRulesOptions) => Readonly<WaitablePromise<SaveRuleResponse>>;\r\n    readonly saveRules: (rules: readonly Rule[], requestOptions?: RequestOptions & SaveRulesOptions) => Readonly<WaitablePromise<SaveRulesResponse>>;\r\n    readonly replaceAllRules: (rules: readonly Rule[], requestOptions?: RequestOptions & SaveRulesOptions) => Readonly<WaitablePromise<SaveRulesResponse>>;\r\n    readonly browseRules: (requestOptions?: SearchRulesOptions & BrowseOptions<Rule> & RequestOptions) => Readonly<Promise<void>>;\r\n    readonly clearRules: (requestOptions?: RequestOptions & ClearRulesOptions) => Readonly<WaitablePromise<DeleteResponse>>;\r\n};\r\n\r\nexport declare type WithoutCredentials<TClientOptions extends Credentials> = Omit<TClientOptions, keyof Credentials>;\r\n\r\nexport { }\r\n"
  },
  {
    "path": "js/algoliasearch/dist/algoliasearch.esm.browser.js",
    "content": "function createBrowserLocalStorageCache(options) {\r\n    const namespaceKey = `algoliasearch-client-js-${options.key}`;\r\n    // eslint-disable-next-line functional/no-let\r\n    let storage;\r\n    const getStorage = () => {\r\n        if (storage === undefined) {\r\n            storage = options.localStorage || window.localStorage;\r\n        }\r\n        return storage;\r\n    };\r\n    const getNamespace = () => {\r\n        return JSON.parse(getStorage().getItem(namespaceKey) || '{}');\r\n    };\r\n    const setNamespace = (namespace) => {\r\n        getStorage().setItem(namespaceKey, JSON.stringify(namespace));\r\n    };\r\n    const removeOutdatedCacheItems = () => {\r\n        const timeToLive = options.timeToLive ? options.timeToLive * 1000 : null;\r\n        const namespace = getNamespace();\r\n        const filteredNamespaceWithoutOldFormattedCacheItems = Object.fromEntries(Object.entries(namespace).filter(([, cacheItem]) => {\r\n            return cacheItem.timestamp !== undefined;\r\n        }));\r\n        setNamespace(filteredNamespaceWithoutOldFormattedCacheItems);\r\n        if (!timeToLive)\r\n            return;\r\n        const filteredNamespaceWithoutExpiredItems = Object.fromEntries(Object.entries(filteredNamespaceWithoutOldFormattedCacheItems).filter(([, cacheItem]) => {\r\n            const currentTimestamp = new Date().getTime();\r\n            const isExpired = cacheItem.timestamp + timeToLive < currentTimestamp;\r\n            return !isExpired;\r\n        }));\r\n        setNamespace(filteredNamespaceWithoutExpiredItems);\r\n    };\r\n    return {\r\n        get(key, defaultValue, events = {\r\n            miss: () => Promise.resolve(),\r\n        }) {\r\n            return Promise.resolve()\r\n                .then(() => {\r\n                removeOutdatedCacheItems();\r\n                const keyAsString = JSON.stringify(key);\r\n                return getNamespace()[keyAsString];\r\n            })\r\n                .then(value => {\r\n                return Promise.all([value ? value.value : defaultValue(), value !== undefined]);\r\n            })\r\n                .then(([value, exists]) => {\r\n                return Promise.all([value, exists || events.miss(value)]);\r\n            })\r\n                .then(([value]) => value);\r\n        },\r\n        set(key, value) {\r\n            return Promise.resolve().then(() => {\r\n                const namespace = getNamespace();\r\n                // eslint-disable-next-line functional/immutable-data\r\n                namespace[JSON.stringify(key)] = {\r\n                    timestamp: new Date().getTime(),\r\n                    value,\r\n                };\r\n                getStorage().setItem(namespaceKey, JSON.stringify(namespace));\r\n                return value;\r\n            });\r\n        },\r\n        delete(key) {\r\n            return Promise.resolve().then(() => {\r\n                const namespace = getNamespace();\r\n                // eslint-disable-next-line functional/immutable-data\r\n                delete namespace[JSON.stringify(key)];\r\n                getStorage().setItem(namespaceKey, JSON.stringify(namespace));\r\n            });\r\n        },\r\n        clear() {\r\n            return Promise.resolve().then(() => {\r\n                getStorage().removeItem(namespaceKey);\r\n            });\r\n        },\r\n    };\r\n}\n\n// @todo Add logger on options to debug when caches go wrong.\r\nfunction createFallbackableCache(options) {\r\n    const caches = [...options.caches];\r\n    const current = caches.shift(); // eslint-disable-line functional/immutable-data\r\n    if (current === undefined) {\r\n        return createNullCache();\r\n    }\r\n    return {\r\n        get(key, defaultValue, events = {\r\n            miss: () => Promise.resolve(),\r\n        }) {\r\n            return current.get(key, defaultValue, events).catch(() => {\r\n                return createFallbackableCache({ caches }).get(key, defaultValue, events);\r\n            });\r\n        },\r\n        set(key, value) {\r\n            return current.set(key, value).catch(() => {\r\n                return createFallbackableCache({ caches }).set(key, value);\r\n            });\r\n        },\r\n        delete(key) {\r\n            return current.delete(key).catch(() => {\r\n                return createFallbackableCache({ caches }).delete(key);\r\n            });\r\n        },\r\n        clear() {\r\n            return current.clear().catch(() => {\r\n                return createFallbackableCache({ caches }).clear();\r\n            });\r\n        },\r\n    };\r\n}\n\nfunction createNullCache() {\r\n    return {\r\n        get(_key, defaultValue, events = {\r\n            miss: () => Promise.resolve(),\r\n        }) {\r\n            const value = defaultValue();\r\n            return value\r\n                .then(result => Promise.all([result, events.miss(result)]))\r\n                .then(([result]) => result);\r\n        },\r\n        set(_key, value) {\r\n            return Promise.resolve(value);\r\n        },\r\n        delete(_key) {\r\n            return Promise.resolve();\r\n        },\r\n        clear() {\r\n            return Promise.resolve();\r\n        },\r\n    };\r\n}\n\nfunction createInMemoryCache(options = { serializable: true }) {\r\n    // eslint-disable-next-line functional/no-let\r\n    let cache = {};\r\n    return {\r\n        get(key, defaultValue, events = {\r\n            miss: () => Promise.resolve(),\r\n        }) {\r\n            const keyAsString = JSON.stringify(key);\r\n            if (keyAsString in cache) {\r\n                return Promise.resolve(options.serializable ? JSON.parse(cache[keyAsString]) : cache[keyAsString]);\r\n            }\r\n            const promise = defaultValue();\r\n            const miss = (events && events.miss) || (() => Promise.resolve());\r\n            return promise.then((value) => miss(value)).then(() => promise);\r\n        },\r\n        set(key, value) {\r\n            // eslint-disable-next-line functional/immutable-data\r\n            cache[JSON.stringify(key)] = options.serializable ? JSON.stringify(value) : value;\r\n            return Promise.resolve(value);\r\n        },\r\n        delete(key) {\r\n            // eslint-disable-next-line functional/immutable-data\r\n            delete cache[JSON.stringify(key)];\r\n            return Promise.resolve();\r\n        },\r\n        clear() {\r\n            cache = {};\r\n            return Promise.resolve();\r\n        },\r\n    };\r\n}\n\nfunction createAuth(authMode, appId, apiKey) {\r\n    const credentials = {\r\n        'x-algolia-api-key': apiKey,\r\n        'x-algolia-application-id': appId,\r\n    };\r\n    return {\r\n        headers() {\r\n            return authMode === AuthMode.WithinHeaders ? credentials : {};\r\n        },\r\n        queryParameters() {\r\n            return authMode === AuthMode.WithinQueryParameters ? credentials : {};\r\n        },\r\n    };\r\n}\n\nfunction createRetryablePromise(callback) {\r\n    let retriesCount = 0; // eslint-disable-line functional/no-let\r\n    const retry = () => {\r\n        retriesCount++;\r\n        return new Promise((resolve) => {\r\n            setTimeout(() => {\r\n                resolve(callback(retry));\r\n            }, Math.min(100 * retriesCount, 1000));\r\n        });\r\n    };\r\n    return callback(retry);\r\n}\n\nfunction createWaitablePromise(promise, wait = (_response, _requestOptions) => {\r\n    return Promise.resolve();\r\n}) {\r\n    // eslint-disable-next-line functional/immutable-data\r\n    return Object.assign(promise, {\r\n        wait(requestOptions) {\r\n            return createWaitablePromise(promise\r\n                .then(response => Promise.all([wait(response, requestOptions), response]))\r\n                .then(promiseResults => promiseResults[1]));\r\n        },\r\n    });\r\n}\n\n// eslint-disable-next-line functional/prefer-readonly-type\r\nfunction shuffle(array) {\r\n    let c = array.length - 1; // eslint-disable-line functional/no-let\r\n    // eslint-disable-next-line functional/no-loop-statement\r\n    for (c; c > 0; c--) {\r\n        const b = Math.floor(Math.random() * (c + 1));\r\n        const a = array[c];\r\n        array[c] = array[b]; // eslint-disable-line functional/immutable-data, no-param-reassign\r\n        array[b] = a; // eslint-disable-line functional/immutable-data, no-param-reassign\r\n    }\r\n    return array;\r\n}\r\nfunction addMethods(base, methods) {\r\n    if (!methods) {\r\n        return base;\r\n    }\r\n    Object.keys(methods).forEach(key => {\r\n        // eslint-disable-next-line functional/immutable-data, no-param-reassign\r\n        base[key] = methods[key](base);\r\n    });\r\n    return base;\r\n}\r\nfunction encode(format, ...args) {\r\n    // eslint-disable-next-line functional/no-let\r\n    let i = 0;\r\n    return format.replace(/%s/g, () => encodeURIComponent(args[i++]));\r\n}\n\nconst version = '4.18.0';\n\nconst AuthMode = {\r\n    /**\r\n     * If auth credentials should be in query parameters.\r\n     */\r\n    WithinQueryParameters: 0,\r\n    /**\r\n     * If auth credentials should be in headers.\r\n     */\r\n    WithinHeaders: 1,\r\n};\n\nfunction createMappedRequestOptions(requestOptions, timeout) {\r\n    const options = requestOptions || {};\r\n    const data = options.data || {};\r\n    Object.keys(options).forEach(key => {\r\n        if (['timeout', 'headers', 'queryParameters', 'data', 'cacheable'].indexOf(key) === -1) {\r\n            data[key] = options[key]; // eslint-disable-line functional/immutable-data\r\n        }\r\n    });\r\n    return {\r\n        data: Object.entries(data).length > 0 ? data : undefined,\r\n        timeout: options.timeout || timeout,\r\n        headers: options.headers || {},\r\n        queryParameters: options.queryParameters || {},\r\n        cacheable: options.cacheable,\r\n    };\r\n}\n\nconst CallEnum = {\r\n    /**\r\n     * If the host is read only.\r\n     */\r\n    Read: 1,\r\n    /**\r\n     * If the host is write only.\r\n     */\r\n    Write: 2,\r\n    /**\r\n     * If the host is both read and write.\r\n     */\r\n    Any: 3,\r\n};\n\nconst HostStatusEnum = {\r\n    Up: 1,\r\n    Down: 2,\r\n    Timeouted: 3,\r\n};\n\n// By default, API Clients at Algolia have expiration delay\r\n// of 5 mins. In the JavaScript client, we have 2 mins.\r\nconst EXPIRATION_DELAY = 2 * 60 * 1000;\r\nfunction createStatefulHost(host, status = HostStatusEnum.Up) {\r\n    return {\r\n        ...host,\r\n        status,\r\n        lastUpdate: Date.now(),\r\n    };\r\n}\r\nfunction isStatefulHostUp(host) {\r\n    return host.status === HostStatusEnum.Up || Date.now() - host.lastUpdate > EXPIRATION_DELAY;\r\n}\r\nfunction isStatefulHostTimeouted(host) {\r\n    return (host.status === HostStatusEnum.Timeouted && Date.now() - host.lastUpdate <= EXPIRATION_DELAY);\r\n}\n\nfunction createStatelessHost(options) {\r\n    if (typeof options === 'string') {\r\n        return {\r\n            protocol: 'https',\r\n            url: options,\r\n            accept: CallEnum.Any,\r\n        };\r\n    }\r\n    return {\r\n        protocol: options.protocol || 'https',\r\n        url: options.url,\r\n        accept: options.accept || CallEnum.Any,\r\n    };\r\n}\n\nconst MethodEnum = {\r\n    Delete: 'DELETE',\r\n    Get: 'GET',\r\n    Post: 'POST',\r\n    Put: 'PUT',\r\n};\n\nfunction createRetryableOptions(hostsCache, statelessHosts) {\r\n    return Promise.all(statelessHosts.map(statelessHost => {\r\n        return hostsCache.get(statelessHost, () => {\r\n            return Promise.resolve(createStatefulHost(statelessHost));\r\n        });\r\n    })).then(statefulHosts => {\r\n        const hostsUp = statefulHosts.filter(host => isStatefulHostUp(host));\r\n        const hostsTimeouted = statefulHosts.filter(host => isStatefulHostTimeouted(host));\r\n        /**\r\n         * Note, we put the hosts that previously timeouted on the end of the list.\r\n         */\r\n        const hostsAvailable = [...hostsUp, ...hostsTimeouted];\r\n        const statelessHostsAvailable = hostsAvailable.length > 0\r\n            ? hostsAvailable.map(host => createStatelessHost(host))\r\n            : statelessHosts;\r\n        return {\r\n            getTimeout(timeoutsCount, baseTimeout) {\r\n                /**\r\n                 * Imagine that you have 4 hosts, if timeouts will increase\r\n                 * on the following way: 1 (timeouted) > 4 (timeouted) > 5 (200)\r\n                 *\r\n                 * Note that, the very next request, we start from the previous timeout\r\n                 *\r\n                 *  5 (timeouted) > 6 (timeouted) > 7 ...\r\n                 *\r\n                 * This strategy may need to be reviewed, but is the strategy on the our\r\n                 * current v3 version.\r\n                 */\r\n                const timeoutMultiplier = hostsTimeouted.length === 0 && timeoutsCount === 0\r\n                    ? 1\r\n                    : hostsTimeouted.length + 3 + timeoutsCount;\r\n                return timeoutMultiplier * baseTimeout;\r\n            },\r\n            statelessHosts: statelessHostsAvailable,\r\n        };\r\n    });\r\n}\n\nconst isNetworkError = ({ isTimedOut, status }) => {\r\n    return !isTimedOut && ~~status === 0;\r\n};\r\nconst isRetryable = (response) => {\r\n    const status = response.status;\r\n    const isTimedOut = response.isTimedOut;\r\n    return (isTimedOut || isNetworkError(response) || (~~(status / 100) !== 2 && ~~(status / 100) !== 4));\r\n};\r\nconst isSuccess = ({ status }) => {\r\n    return ~~(status / 100) === 2;\r\n};\r\nconst retryDecision = (response, outcomes) => {\r\n    if (isRetryable(response)) {\r\n        return outcomes.onRetry(response);\r\n    }\r\n    if (isSuccess(response)) {\r\n        return outcomes.onSuccess(response);\r\n    }\r\n    return outcomes.onFail(response);\r\n};\n\nfunction retryableRequest(transporter, statelessHosts, request, requestOptions) {\r\n    const stackTrace = []; // eslint-disable-line functional/prefer-readonly-type\r\n    /**\r\n     * First we prepare the payload that do not depend from hosts.\r\n     */\r\n    const data = serializeData(request, requestOptions);\r\n    const headers = serializeHeaders(transporter, requestOptions);\r\n    const method = request.method;\r\n    // On `GET`, the data is proxied to query parameters.\r\n    const dataQueryParameters = request.method !== MethodEnum.Get\r\n        ? {}\r\n        : {\r\n            ...request.data,\r\n            ...requestOptions.data,\r\n        };\r\n    const queryParameters = {\r\n        'x-algolia-agent': transporter.userAgent.value,\r\n        ...transporter.queryParameters,\r\n        ...dataQueryParameters,\r\n        ...requestOptions.queryParameters,\r\n    };\r\n    let timeoutsCount = 0; // eslint-disable-line functional/no-let\r\n    const retry = (hosts, // eslint-disable-line functional/prefer-readonly-type\r\n    getTimeout) => {\r\n        /**\r\n         * We iterate on each host, until there is no host left.\r\n         */\r\n        const host = hosts.pop(); // eslint-disable-line functional/immutable-data\r\n        if (host === undefined) {\r\n            throw createRetryError(stackTraceWithoutCredentials(stackTrace));\r\n        }\r\n        const payload = {\r\n            data,\r\n            headers,\r\n            method,\r\n            url: serializeUrl(host, request.path, queryParameters),\r\n            connectTimeout: getTimeout(timeoutsCount, transporter.timeouts.connect),\r\n            responseTimeout: getTimeout(timeoutsCount, requestOptions.timeout),\r\n        };\r\n        /**\r\n         * The stackFrame is pushed to the stackTrace so we\r\n         * can have information about onRetry and onFailure\r\n         * decisions.\r\n         */\r\n        const pushToStackTrace = (response) => {\r\n            const stackFrame = {\r\n                request: payload,\r\n                response,\r\n                host,\r\n                triesLeft: hosts.length,\r\n            };\r\n            // eslint-disable-next-line functional/immutable-data\r\n            stackTrace.push(stackFrame);\r\n            return stackFrame;\r\n        };\r\n        const decisions = {\r\n            onSuccess: response => deserializeSuccess(response),\r\n            onRetry(response) {\r\n                const stackFrame = pushToStackTrace(response);\r\n                /**\r\n                 * If response is a timeout, we increaset the number of\r\n                 * timeouts so we can increase the timeout later.\r\n                 */\r\n                if (response.isTimedOut) {\r\n                    timeoutsCount++;\r\n                }\r\n                return Promise.all([\r\n                    /**\r\n                     * Failures are individually send the logger, allowing\r\n                     * the end user to debug / store stack frames even\r\n                     * when a retry error does not happen.\r\n                     */\r\n                    transporter.logger.info('Retryable failure', stackFrameWithoutCredentials(stackFrame)),\r\n                    /**\r\n                     * We also store the state of the host in failure cases. If the host, is\r\n                     * down it will remain down for the next 2 minutes. In a timeout situation,\r\n                     * this host will be added end of the list of hosts on the next request.\r\n                     */\r\n                    transporter.hostsCache.set(host, createStatefulHost(host, response.isTimedOut ? HostStatusEnum.Timeouted : HostStatusEnum.Down)),\r\n                ]).then(() => retry(hosts, getTimeout));\r\n            },\r\n            onFail(response) {\r\n                pushToStackTrace(response);\r\n                throw deserializeFailure(response, stackTraceWithoutCredentials(stackTrace));\r\n            },\r\n        };\r\n        return transporter.requester.send(payload).then(response => {\r\n            return retryDecision(response, decisions);\r\n        });\r\n    };\r\n    /**\r\n     * Finally, for each retryable host perform request until we got a non\r\n     * retryable response. Some notes here:\r\n     *\r\n     * 1. The reverse here is applied so we can apply a `pop` later on => more performant.\r\n     * 2. We also get from the retryable options a timeout multiplier that is tailored\r\n     * for the current context.\r\n     */\r\n    return createRetryableOptions(transporter.hostsCache, statelessHosts).then(options => {\r\n        return retry([...options.statelessHosts].reverse(), options.getTimeout);\r\n    });\r\n}\n\nfunction createTransporter(options) {\r\n    const { hostsCache, logger, requester, requestsCache, responsesCache, timeouts, userAgent, hosts, queryParameters, headers, } = options;\r\n    const transporter = {\r\n        hostsCache,\r\n        logger,\r\n        requester,\r\n        requestsCache,\r\n        responsesCache,\r\n        timeouts,\r\n        userAgent,\r\n        headers,\r\n        queryParameters,\r\n        hosts: hosts.map(host => createStatelessHost(host)),\r\n        read(request, requestOptions) {\r\n            /**\r\n             * First, we compute the user request options. Now, keep in mind,\r\n             * that using request options the user is able to modified the intire\r\n             * payload of the request. Such as headers, query parameters, and others.\r\n             */\r\n            const mappedRequestOptions = createMappedRequestOptions(requestOptions, transporter.timeouts.read);\r\n            const createRetryableRequest = () => {\r\n                /**\r\n                 * Then, we prepare a function factory that contains the construction of\r\n                 * the retryable request. At this point, we may *not* perform the actual\r\n                 * request. But we want to have the function factory ready.\r\n                 */\r\n                return retryableRequest(transporter, transporter.hosts.filter(host => (host.accept & CallEnum.Read) !== 0), request, mappedRequestOptions);\r\n            };\r\n            /**\r\n             * Once we have the function factory ready, we need to determine of the\r\n             * request is \"cacheable\" - should be cached. Note that, once again,\r\n             * the user can force this option.\r\n             */\r\n            const cacheable = mappedRequestOptions.cacheable !== undefined\r\n                ? mappedRequestOptions.cacheable\r\n                : request.cacheable;\r\n            /**\r\n             * If is not \"cacheable\", we immediatly trigger the retryable request, no\r\n             * need to check cache implementations.\r\n             */\r\n            if (cacheable !== true) {\r\n                return createRetryableRequest();\r\n            }\r\n            /**\r\n             * If the request is \"cacheable\", we need to first compute the key to ask\r\n             * the cache implementations if this request is on progress or if the\r\n             * response already exists on the cache.\r\n             */\r\n            const key = {\r\n                request,\r\n                mappedRequestOptions,\r\n                transporter: {\r\n                    queryParameters: transporter.queryParameters,\r\n                    headers: transporter.headers,\r\n                },\r\n            };\r\n            /**\r\n             * With the computed key, we first ask the responses cache\r\n             * implemention if this request was been resolved before.\r\n             */\r\n            return transporter.responsesCache.get(key, () => {\r\n                /**\r\n                 * If the request has never resolved before, we actually ask if there\r\n                 * is a current request with the same key on progress.\r\n                 */\r\n                return transporter.requestsCache.get(key, () => {\r\n                    return (transporter.requestsCache\r\n                        /**\r\n                         * Finally, if there is no request in progress with the same key,\r\n                         * this `createRetryableRequest()` will actually trigger the\r\n                         * retryable request.\r\n                         */\r\n                        .set(key, createRetryableRequest())\r\n                        .then(response => Promise.all([transporter.requestsCache.delete(key), response]), err => Promise.all([transporter.requestsCache.delete(key), Promise.reject(err)]))\r\n                        .then(([_, response]) => response));\r\n                });\r\n            }, {\r\n                /**\r\n                 * Of course, once we get this response back from the server, we\r\n                 * tell response cache to actually store the received response\r\n                 * to be used later.\r\n                 */\r\n                miss: response => transporter.responsesCache.set(key, response),\r\n            });\r\n        },\r\n        write(request, requestOptions) {\r\n            /**\r\n             * On write requests, no cache mechanisms are applied, and we\r\n             * proxy the request immediately to the requester.\r\n             */\r\n            return retryableRequest(transporter, transporter.hosts.filter(host => (host.accept & CallEnum.Write) !== 0), request, createMappedRequestOptions(requestOptions, transporter.timeouts.write));\r\n        },\r\n    };\r\n    return transporter;\r\n}\n\nfunction createUserAgent(version) {\r\n    const userAgent = {\r\n        value: `Algolia for JavaScript (${version})`,\r\n        add(options) {\r\n            const addedUserAgent = `; ${options.segment}${options.version !== undefined ? ` (${options.version})` : ''}`;\r\n            if (userAgent.value.indexOf(addedUserAgent) === -1) {\r\n                // eslint-disable-next-line functional/immutable-data\r\n                userAgent.value = `${userAgent.value}${addedUserAgent}`;\r\n            }\r\n            return userAgent;\r\n        },\r\n    };\r\n    return userAgent;\r\n}\n\nfunction deserializeSuccess(response) {\r\n    // eslint-disable-next-line functional/no-try-statement\r\n    try {\r\n        return JSON.parse(response.content);\r\n    }\r\n    catch (e) {\r\n        throw createDeserializationError(e.message, response);\r\n    }\r\n}\r\nfunction deserializeFailure({ content, status }, stackFrame) {\r\n    // eslint-disable-next-line functional/no-let\r\n    let message = content;\r\n    // eslint-disable-next-line functional/no-try-statement\r\n    try {\r\n        message = JSON.parse(content).message;\r\n    }\r\n    catch (e) {\r\n        // ..\r\n    }\r\n    return createApiError(message, status, stackFrame);\r\n}\n\nfunction serializeUrl(host, path, queryParameters) {\r\n    const queryParametersAsString = serializeQueryParameters(queryParameters);\r\n    // eslint-disable-next-line functional/no-let\r\n    let url = `${host.protocol}://${host.url}/${path.charAt(0) === '/' ? path.substr(1) : path}`;\r\n    if (queryParametersAsString.length) {\r\n        url += `?${queryParametersAsString}`;\r\n    }\r\n    return url;\r\n}\r\nfunction serializeQueryParameters(parameters) {\r\n    const isObjectOrArray = (value) => Object.prototype.toString.call(value) === '[object Object]' ||\r\n        Object.prototype.toString.call(value) === '[object Array]';\r\n    return Object.keys(parameters)\r\n        .map(key => encode('%s=%s', key, isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key]))\r\n        .join('&');\r\n}\r\nfunction serializeData(request, requestOptions) {\r\n    if (request.method === MethodEnum.Get ||\r\n        (request.data === undefined && requestOptions.data === undefined)) {\r\n        return undefined;\r\n    }\r\n    const data = Array.isArray(request.data)\r\n        ? request.data\r\n        : { ...request.data, ...requestOptions.data };\r\n    return JSON.stringify(data);\r\n}\r\nfunction serializeHeaders(transporter, requestOptions) {\r\n    const headers = {\r\n        ...transporter.headers,\r\n        ...requestOptions.headers,\r\n    };\r\n    const serializedHeaders = {};\r\n    Object.keys(headers).forEach(header => {\r\n        const value = headers[header];\r\n        // @ts-ignore\r\n        // eslint-disable-next-line functional/immutable-data\r\n        serializedHeaders[header.toLowerCase()] = value;\r\n    });\r\n    return serializedHeaders;\r\n}\n\nfunction stackTraceWithoutCredentials(stackTrace) {\r\n    return stackTrace.map(stackFrame => stackFrameWithoutCredentials(stackFrame));\r\n}\r\nfunction stackFrameWithoutCredentials(stackFrame) {\r\n    const modifiedHeaders = stackFrame.request.headers['x-algolia-api-key']\r\n        ? { 'x-algolia-api-key': '*****' }\r\n        : {};\r\n    return {\r\n        ...stackFrame,\r\n        request: {\r\n            ...stackFrame.request,\r\n            headers: {\r\n                ...stackFrame.request.headers,\r\n                ...modifiedHeaders,\r\n            },\r\n        },\r\n    };\r\n}\n\nfunction createApiError(message, status, transporterStackTrace) {\r\n    return {\r\n        name: 'ApiError',\r\n        message,\r\n        status,\r\n        transporterStackTrace,\r\n    };\r\n}\n\nfunction createDeserializationError(message, response) {\r\n    return {\r\n        name: 'DeserializationError',\r\n        message,\r\n        response,\r\n    };\r\n}\n\nfunction createRetryError(transporterStackTrace) {\r\n    return {\r\n        name: 'RetryError',\r\n        message: 'Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.',\r\n        transporterStackTrace,\r\n    };\r\n}\n\nconst createAnalyticsClient = options => {\r\n    const region = options.region || 'us';\r\n    const auth = createAuth(AuthMode.WithinHeaders, options.appId, options.apiKey);\r\n    const transporter = createTransporter({\r\n        hosts: [{ url: `analytics.${region}.algolia.com` }],\r\n        ...options,\r\n        headers: {\r\n            ...auth.headers(),\r\n            ...{ 'content-type': 'application/json' },\r\n            ...options.headers,\r\n        },\r\n        queryParameters: {\r\n            ...auth.queryParameters(),\r\n            ...options.queryParameters,\r\n        },\r\n    });\r\n    const appId = options.appId;\r\n    return addMethods({ appId, transporter }, options.methods);\r\n};\n\nconst addABTest = (base) => {\r\n    return (abTest, requestOptions) => {\r\n        return base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: '2/abtests',\r\n            data: abTest,\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst deleteABTest = (base) => {\r\n    return (abTestID, requestOptions) => {\r\n        return base.transporter.write({\r\n            method: MethodEnum.Delete,\r\n            path: encode('2/abtests/%s', abTestID),\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst getABTest = (base) => {\r\n    return (abTestID, requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Get,\r\n            path: encode('2/abtests/%s', abTestID),\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst getABTests = (base) => {\r\n    return (requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Get,\r\n            path: '2/abtests',\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst stopABTest = (base) => {\r\n    return (abTestID, requestOptions) => {\r\n        return base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: encode('2/abtests/%s/stop', abTestID),\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst createPersonalizationClient = options => {\r\n    const region = options.region || 'us';\r\n    const auth = createAuth(AuthMode.WithinHeaders, options.appId, options.apiKey);\r\n    const transporter = createTransporter({\r\n        hosts: [{ url: `personalization.${region}.algolia.com` }],\r\n        ...options,\r\n        headers: {\r\n            ...auth.headers(),\r\n            ...{ 'content-type': 'application/json' },\r\n            ...options.headers,\r\n        },\r\n        queryParameters: {\r\n            ...auth.queryParameters(),\r\n            ...options.queryParameters,\r\n        },\r\n    });\r\n    return addMethods({ appId: options.appId, transporter }, options.methods);\r\n};\n\nconst getPersonalizationStrategy = (base) => {\r\n    return (requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Get,\r\n            path: '1/strategies/personalization',\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst setPersonalizationStrategy = (base) => {\r\n    return (personalizationStrategy, requestOptions) => {\r\n        return base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: '1/strategies/personalization',\r\n            data: personalizationStrategy,\r\n        }, requestOptions);\r\n    };\r\n};\n\nfunction createBrowsablePromise(options) {\r\n    const browse = (data) => {\r\n        return options.request(data).then(response => {\r\n            /**\r\n             * First we send to the developer the\r\n             * batch retrieved from the API.\r\n             */\r\n            if (options.batch !== undefined) {\r\n                options.batch(response.hits);\r\n            }\r\n            /**\r\n             * Then, we ask to the browse concrete implementation\r\n             * if we should stop browsing. As example, the `browseObjects`\r\n             * method will stop if the cursor is not present on the response.\r\n             */\r\n            if (options.shouldStop(response)) {\r\n                return undefined;\r\n            }\r\n            /**\r\n             * Finally, if the response contains a cursor, we browse to the next\r\n             * batch using that same cursor. Otherwise, we just use the traditional\r\n             * browsing using the page element.\r\n             */\r\n            if (response.cursor) {\r\n                return browse({\r\n                    cursor: response.cursor,\r\n                });\r\n            }\r\n            return browse({\r\n                page: (data.page || 0) + 1,\r\n            });\r\n        });\r\n    };\r\n    return browse({});\r\n}\n\nconst createSearchClient = options => {\r\n    const appId = options.appId;\r\n    const auth = createAuth(options.authMode !== undefined ? options.authMode : AuthMode.WithinHeaders, appId, options.apiKey);\r\n    const transporter = createTransporter({\r\n        hosts: [\r\n            { url: `${appId}-dsn.algolia.net`, accept: CallEnum.Read },\r\n            { url: `${appId}.algolia.net`, accept: CallEnum.Write },\r\n        ].concat(shuffle([\r\n            { url: `${appId}-1.algolianet.com` },\r\n            { url: `${appId}-2.algolianet.com` },\r\n            { url: `${appId}-3.algolianet.com` },\r\n        ])),\r\n        ...options,\r\n        headers: {\r\n            ...auth.headers(),\r\n            ...{ 'content-type': 'application/x-www-form-urlencoded' },\r\n            ...options.headers,\r\n        },\r\n        queryParameters: {\r\n            ...auth.queryParameters(),\r\n            ...options.queryParameters,\r\n        },\r\n    });\r\n    const base = {\r\n        transporter,\r\n        appId,\r\n        addAlgoliaAgent(segment, version) {\r\n            transporter.userAgent.add({ segment, version });\r\n        },\r\n        clearCache() {\r\n            return Promise.all([\r\n                transporter.requestsCache.clear(),\r\n                transporter.responsesCache.clear(),\r\n            ]).then(() => undefined);\r\n        },\r\n    };\r\n    return addMethods(base, options.methods);\r\n};\n\nfunction createMissingObjectIDError() {\r\n    return {\r\n        name: 'MissingObjectIDError',\r\n        message: 'All objects must have an unique objectID ' +\r\n            '(like a primary key) to be valid. ' +\r\n            'Algolia is also able to generate objectIDs ' +\r\n            \"automatically but *it's not recommended*. \" +\r\n            \"To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option.\",\r\n    };\r\n}\n\nfunction createObjectNotFoundError() {\r\n    return {\r\n        name: 'ObjectNotFoundError',\r\n        message: 'Object not found.',\r\n    };\r\n}\n\nconst addApiKey = (base) => {\r\n    return (acl, requestOptions) => {\r\n        const { queryParameters, ...options } = requestOptions || {};\r\n        const data = {\r\n            acl,\r\n            ...(queryParameters !== undefined ? { queryParameters } : {}),\r\n        };\r\n        const wait = (response, waitRequestOptions) => {\r\n            return createRetryablePromise(retry => {\r\n                return getApiKey(base)(response.key, waitRequestOptions).catch((apiError) => {\r\n                    if (apiError.status !== 404) {\r\n                        throw apiError;\r\n                    }\r\n                    return retry();\r\n                });\r\n            });\r\n        };\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: '1/keys',\r\n            data,\r\n        }, options), wait);\r\n    };\r\n};\n\nconst assignUserID = (base) => {\r\n    return (userID, clusterName, requestOptions) => {\r\n        const mappedRequestOptions = createMappedRequestOptions(requestOptions);\r\n        // eslint-disable-next-line functional/immutable-data\r\n        mappedRequestOptions.queryParameters['X-Algolia-User-ID'] = userID;\r\n        return base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: '1/clusters/mapping',\r\n            data: { cluster: clusterName },\r\n        }, mappedRequestOptions);\r\n    };\r\n};\n\nconst assignUserIDs = (base) => {\r\n    return (userIDs, clusterName, requestOptions) => {\r\n        return base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: '1/clusters/mapping/batch',\r\n            data: {\r\n                users: userIDs,\r\n                cluster: clusterName,\r\n            },\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst clearDictionaryEntries = (base) => {\r\n    return (dictionary, requestOptions) => {\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: encode('/1/dictionaries/%s/batch', dictionary),\r\n            data: {\r\n                clearExistingDictionaryEntries: true,\r\n                requests: { action: 'addEntry', body: [] },\r\n            },\r\n        }, requestOptions), (response, waitRequestOptions) => waitAppTask(base)(response.taskID, waitRequestOptions));\r\n    };\r\n};\n\nconst copyIndex = (base) => {\r\n    return (from, to, requestOptions) => {\r\n        const wait = (response, waitRequestOptions) => {\r\n            return initIndex(base)(from, {\r\n                methods: { waitTask },\r\n            }).waitTask(response.taskID, waitRequestOptions);\r\n        };\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: encode('1/indexes/%s/operation', from),\r\n            data: {\r\n                operation: 'copy',\r\n                destination: to,\r\n            },\r\n        }, requestOptions), wait);\r\n    };\r\n};\n\nconst copyRules = (base) => {\r\n    return (from, to, requestOptions) => {\r\n        return copyIndex(base)(from, to, {\r\n            ...requestOptions,\r\n            scope: [ScopeEnum.Rules],\r\n        });\r\n    };\r\n};\n\nconst copySettings = (base) => {\r\n    return (from, to, requestOptions) => {\r\n        return copyIndex(base)(from, to, {\r\n            ...requestOptions,\r\n            scope: [ScopeEnum.Settings],\r\n        });\r\n    };\r\n};\n\nconst copySynonyms = (base) => {\r\n    return (from, to, requestOptions) => {\r\n        return copyIndex(base)(from, to, {\r\n            ...requestOptions,\r\n            scope: [ScopeEnum.Synonyms],\r\n        });\r\n    };\r\n};\n\nconst customRequest = (base) => {\r\n    return (request, requestOptions) => {\r\n        if (request.method === MethodEnum.Get) {\r\n            return base.transporter.read(request, requestOptions);\r\n        }\r\n        return base.transporter.write(request, requestOptions);\r\n    };\r\n};\n\nconst deleteApiKey = (base) => {\r\n    return (apiKey, requestOptions) => {\r\n        const wait = (_, waitRequestOptions) => {\r\n            return createRetryablePromise(retry => {\r\n                return getApiKey(base)(apiKey, waitRequestOptions)\r\n                    .then(retry)\r\n                    .catch((apiError) => {\r\n                    if (apiError.status !== 404) {\r\n                        throw apiError;\r\n                    }\r\n                });\r\n            });\r\n        };\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Delete,\r\n            path: encode('1/keys/%s', apiKey),\r\n        }, requestOptions), wait);\r\n    };\r\n};\n\nconst deleteDictionaryEntries = (base) => {\r\n    return (dictionary, objectIDs, requestOptions) => {\r\n        const requests = objectIDs.map(objectID => ({\r\n            action: 'deleteEntry',\r\n            body: { objectID },\r\n        }));\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: encode('/1/dictionaries/%s/batch', dictionary),\r\n            data: { clearExistingDictionaryEntries: false, requests },\r\n        }, requestOptions), (response, waitRequestOptions) => waitAppTask(base)(response.taskID, waitRequestOptions));\r\n    };\r\n};\n\nconst getApiKey = (base) => {\r\n    return (apiKey, requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Get,\r\n            path: encode('1/keys/%s', apiKey),\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst getAppTask = (base) => {\r\n    return (taskID, requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Get,\r\n            path: encode('1/task/%s', taskID.toString()),\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst getDictionarySettings = (base) => {\r\n    return (requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Get,\r\n            path: '/1/dictionaries/*/settings',\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst getLogs = (base) => {\r\n    return (requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Get,\r\n            path: '1/logs',\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst getTopUserIDs = (base) => {\r\n    return (requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Get,\r\n            path: '1/clusters/mapping/top',\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst getUserID = (base) => {\r\n    return (userID, requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Get,\r\n            path: encode('1/clusters/mapping/%s', userID),\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst hasPendingMappings = (base) => {\r\n    return (requestOptions) => {\r\n        const { retrieveMappings, ...options } = requestOptions || {};\r\n        if (retrieveMappings === true) {\r\n            // eslint-disable-next-line functional/immutable-data\r\n            options.getClusters = true;\r\n        }\r\n        return base.transporter.read({\r\n            method: MethodEnum.Get,\r\n            path: '1/clusters/mapping/pending',\r\n        }, options);\r\n    };\r\n};\n\nconst initIndex = (base) => {\r\n    return (indexName, options = {}) => {\r\n        const searchIndex = {\r\n            transporter: base.transporter,\r\n            appId: base.appId,\r\n            indexName,\r\n        };\r\n        return addMethods(searchIndex, options.methods);\r\n    };\r\n};\n\nconst listApiKeys = (base) => {\r\n    return (requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Get,\r\n            path: '1/keys',\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst listClusters = (base) => {\r\n    return (requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Get,\r\n            path: '1/clusters',\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst listIndices = (base) => {\r\n    return (requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Get,\r\n            path: '1/indexes',\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst listUserIDs = (base) => {\r\n    return (requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Get,\r\n            path: '1/clusters/mapping',\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst moveIndex = (base) => {\r\n    return (from, to, requestOptions) => {\r\n        const wait = (response, waitRequestOptions) => {\r\n            return initIndex(base)(from, {\r\n                methods: { waitTask },\r\n            }).waitTask(response.taskID, waitRequestOptions);\r\n        };\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: encode('1/indexes/%s/operation', from),\r\n            data: {\r\n                operation: 'move',\r\n                destination: to,\r\n            },\r\n        }, requestOptions), wait);\r\n    };\r\n};\n\nconst multipleBatch = (base) => {\r\n    return (requests, requestOptions) => {\r\n        const wait = (response, waitRequestOptions) => {\r\n            return Promise.all(Object.keys(response.taskID).map(indexName => {\r\n                return initIndex(base)(indexName, {\r\n                    methods: { waitTask },\r\n                }).waitTask(response.taskID[indexName], waitRequestOptions);\r\n            }));\r\n        };\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: '1/indexes/*/batch',\r\n            data: {\r\n                requests,\r\n            },\r\n        }, requestOptions), wait);\r\n    };\r\n};\n\nconst multipleGetObjects = (base) => {\r\n    return (requests, requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Post,\r\n            path: '1/indexes/*/objects',\r\n            data: {\r\n                requests,\r\n            },\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst multipleQueries = (base) => {\r\n    return (queries, requestOptions) => {\r\n        const requests = queries.map(query => {\r\n            return {\r\n                ...query,\r\n                params: serializeQueryParameters(query.params || {}),\r\n            };\r\n        });\r\n        return base.transporter.read({\r\n            method: MethodEnum.Post,\r\n            path: '1/indexes/*/queries',\r\n            data: {\r\n                requests,\r\n            },\r\n            cacheable: true,\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst multipleSearchForFacetValues = (base) => {\r\n    return (queries, requestOptions) => {\r\n        return Promise.all(queries.map(query => {\r\n            const { facetName, facetQuery, ...params } = query.params;\r\n            return initIndex(base)(query.indexName, {\r\n                methods: { searchForFacetValues },\r\n            }).searchForFacetValues(facetName, facetQuery, {\r\n                ...requestOptions,\r\n                ...params,\r\n            });\r\n        }));\r\n    };\r\n};\n\nconst removeUserID = (base) => {\r\n    return (userID, requestOptions) => {\r\n        const mappedRequestOptions = createMappedRequestOptions(requestOptions);\r\n        // eslint-disable-next-line functional/immutable-data\r\n        mappedRequestOptions.queryParameters['X-Algolia-User-ID'] = userID;\r\n        return base.transporter.write({\r\n            method: MethodEnum.Delete,\r\n            path: '1/clusters/mapping',\r\n        }, mappedRequestOptions);\r\n    };\r\n};\n\nconst replaceDictionaryEntries = (base) => {\r\n    return (dictionary, entries, requestOptions) => {\r\n        const requests = entries.map(entry => ({\r\n            action: 'addEntry',\r\n            body: entry,\r\n        }));\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: encode('/1/dictionaries/%s/batch', dictionary),\r\n            data: { clearExistingDictionaryEntries: true, requests },\r\n        }, requestOptions), (response, waitRequestOptions) => waitAppTask(base)(response.taskID, waitRequestOptions));\r\n    };\r\n};\n\nconst restoreApiKey = (base) => {\r\n    return (apiKey, requestOptions) => {\r\n        const wait = (_, waitRequestOptions) => {\r\n            return createRetryablePromise(retry => {\r\n                return getApiKey(base)(apiKey, waitRequestOptions).catch((apiError) => {\r\n                    if (apiError.status !== 404) {\r\n                        throw apiError;\r\n                    }\r\n                    return retry();\r\n                });\r\n            });\r\n        };\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: encode('1/keys/%s/restore', apiKey),\r\n        }, requestOptions), wait);\r\n    };\r\n};\n\nconst saveDictionaryEntries = (base) => {\r\n    return (dictionary, entries, requestOptions) => {\r\n        const requests = entries.map(entry => ({\r\n            action: 'addEntry',\r\n            body: entry,\r\n        }));\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: encode('/1/dictionaries/%s/batch', dictionary),\r\n            data: { clearExistingDictionaryEntries: false, requests },\r\n        }, requestOptions), (response, waitRequestOptions) => waitAppTask(base)(response.taskID, waitRequestOptions));\r\n    };\r\n};\n\nconst searchDictionaryEntries = (base) => {\r\n    return (dictionary, query, requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Post,\r\n            path: encode('/1/dictionaries/%s/search', dictionary),\r\n            data: {\r\n                query,\r\n            },\r\n            cacheable: true,\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst searchUserIDs = (base) => {\r\n    return (query, requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Post,\r\n            path: '1/clusters/mapping/search',\r\n            data: {\r\n                query,\r\n            },\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst setDictionarySettings = (base) => {\r\n    return (settings, requestOptions) => {\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Put,\r\n            path: '/1/dictionaries/*/settings',\r\n            data: settings,\r\n        }, requestOptions), (response, waitRequestOptions) => waitAppTask(base)(response.taskID, waitRequestOptions));\r\n    };\r\n};\n\nconst updateApiKey = (base) => {\r\n    return (apiKey, requestOptions) => {\r\n        const updatedFields = Object.assign({}, requestOptions);\r\n        const { queryParameters, ...options } = requestOptions || {};\r\n        const data = queryParameters ? { queryParameters } : {};\r\n        const apiKeyFields = [\r\n            'acl',\r\n            'indexes',\r\n            'referers',\r\n            'restrictSources',\r\n            'queryParameters',\r\n            'description',\r\n            'maxQueriesPerIPPerHour',\r\n            'maxHitsPerQuery',\r\n        ];\r\n        // Check that all the fields retrieved through getApiKey are the same as the ones we wanted to update\r\n        const hasChanged = (getApiKeyResponse) => {\r\n            return Object.keys(updatedFields)\r\n                .filter((updatedField) => apiKeyFields.indexOf(updatedField) !== -1)\r\n                .every(updatedField => {\r\n                // If the field is an array, we need to check that they are the same length and that all the values are the same\r\n                if (Array.isArray(getApiKeyResponse[updatedField]) &&\r\n                    Array.isArray(updatedFields[updatedField])) {\r\n                    const getApiKeyResponseArray = getApiKeyResponse[updatedField];\r\n                    return (getApiKeyResponseArray.length === updatedFields[updatedField].length &&\r\n                        getApiKeyResponseArray.every((value, index) => value === updatedFields[updatedField][index]));\r\n                }\r\n                else {\r\n                    return getApiKeyResponse[updatedField] === updatedFields[updatedField];\r\n                }\r\n            });\r\n        };\r\n        const wait = (_, waitRequestOptions) => createRetryablePromise(retry => {\r\n            return getApiKey(base)(apiKey, waitRequestOptions).then(getApiKeyResponse => {\r\n                return hasChanged(getApiKeyResponse) ? Promise.resolve() : retry();\r\n            });\r\n        });\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Put,\r\n            path: encode('1/keys/%s', apiKey),\r\n            data,\r\n        }, options), wait);\r\n    };\r\n};\n\nconst waitAppTask = (base) => {\r\n    return (taskID, requestOptions) => {\r\n        return createRetryablePromise(retry => {\r\n            return getAppTask(base)(taskID, requestOptions).then(response => {\r\n                return response.status !== 'published' ? retry() : undefined;\r\n            });\r\n        });\r\n    };\r\n};\n\nconst batch = (base) => {\r\n    return (requests, requestOptions) => {\r\n        const wait = (response, waitRequestOptions) => {\r\n            return waitTask(base)(response.taskID, waitRequestOptions);\r\n        };\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: encode('1/indexes/%s/batch', base.indexName),\r\n            data: {\r\n                requests,\r\n            },\r\n        }, requestOptions), wait);\r\n    };\r\n};\n\nconst browseObjects = (base) => {\r\n    return (requestOptions) => {\r\n        return createBrowsablePromise({\r\n            shouldStop: response => response.cursor === undefined,\r\n            ...requestOptions,\r\n            request: (data) => base.transporter.read({\r\n                method: MethodEnum.Post,\r\n                path: encode('1/indexes/%s/browse', base.indexName),\r\n                data,\r\n            }, requestOptions),\r\n        });\r\n    };\r\n};\n\nconst browseRules = (base) => {\r\n    return (requestOptions) => {\r\n        const options = {\r\n            hitsPerPage: 1000,\r\n            ...requestOptions,\r\n        };\r\n        return createBrowsablePromise({\r\n            shouldStop: response => response.hits.length < options.hitsPerPage,\r\n            ...options,\r\n            request(data) {\r\n                return searchRules(base)('', { ...options, ...data }).then((response) => {\r\n                    return {\r\n                        ...response,\r\n                        hits: response.hits.map(rule => {\r\n                            // eslint-disable-next-line functional/immutable-data,no-param-reassign\r\n                            delete rule._highlightResult;\r\n                            return rule;\r\n                        }),\r\n                    };\r\n                });\r\n            },\r\n        });\r\n    };\r\n};\n\nconst browseSynonyms = (base) => {\r\n    return (requestOptions) => {\r\n        const options = {\r\n            hitsPerPage: 1000,\r\n            ...requestOptions,\r\n        };\r\n        return createBrowsablePromise({\r\n            shouldStop: response => response.hits.length < options.hitsPerPage,\r\n            ...options,\r\n            request(data) {\r\n                return searchSynonyms(base)('', { ...options, ...data }).then((response) => {\r\n                    return {\r\n                        ...response,\r\n                        hits: response.hits.map(synonym => {\r\n                            // eslint-disable-next-line functional/immutable-data,no-param-reassign\r\n                            delete synonym._highlightResult;\r\n                            return synonym;\r\n                        }),\r\n                    };\r\n                });\r\n            },\r\n        });\r\n    };\r\n};\n\nconst chunkedBatch = (base) => {\r\n    return (bodies, action, requestOptions) => {\r\n        const { batchSize, ...options } = requestOptions || {};\r\n        const response = {\r\n            taskIDs: [],\r\n            objectIDs: [],\r\n        };\r\n        const forEachBatch = (lastIndex = 0) => {\r\n            // eslint-disable-next-line functional/prefer-readonly-type\r\n            const bodiesChunk = [];\r\n            // eslint-disable-next-line functional/no-let\r\n            let index;\r\n            /* eslint-disable-next-line functional/no-loop-statement */\r\n            for (index = lastIndex; index < bodies.length; index++) {\r\n                // eslint-disable-next-line functional/immutable-data\r\n                bodiesChunk.push(bodies[index]);\r\n                if (bodiesChunk.length === (batchSize || 1000)) {\r\n                    break;\r\n                }\r\n            }\r\n            if (bodiesChunk.length === 0) {\r\n                return Promise.resolve(response);\r\n            }\r\n            return batch(base)(bodiesChunk.map(body => {\r\n                return {\r\n                    action,\r\n                    body,\r\n                };\r\n            }), options).then(res => {\r\n                response.objectIDs = response.objectIDs.concat(res.objectIDs); // eslint-disable-line functional/immutable-data\r\n                response.taskIDs.push(res.taskID); // eslint-disable-line functional/immutable-data\r\n                index++;\r\n                return forEachBatch(index);\r\n            });\r\n        };\r\n        return createWaitablePromise(forEachBatch(), (chunkedBatchResponse, waitRequestOptions) => {\r\n            return Promise.all(chunkedBatchResponse.taskIDs.map(taskID => {\r\n                return waitTask(base)(taskID, waitRequestOptions);\r\n            }));\r\n        });\r\n    };\r\n};\n\nconst clearObjects = (base) => {\r\n    return (requestOptions) => {\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: encode('1/indexes/%s/clear', base.indexName),\r\n        }, requestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions));\r\n    };\r\n};\n\nconst clearRules = (base) => {\r\n    return (requestOptions) => {\r\n        const { forwardToReplicas, ...options } = requestOptions || {};\r\n        const mappedRequestOptions = createMappedRequestOptions(options);\r\n        if (forwardToReplicas) {\r\n            mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data\r\n        }\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: encode('1/indexes/%s/rules/clear', base.indexName),\r\n        }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions));\r\n    };\r\n};\n\nconst clearSynonyms = (base) => {\r\n    return (requestOptions) => {\r\n        const { forwardToReplicas, ...options } = requestOptions || {};\r\n        const mappedRequestOptions = createMappedRequestOptions(options);\r\n        if (forwardToReplicas) {\r\n            mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data\r\n        }\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: encode('1/indexes/%s/synonyms/clear', base.indexName),\r\n        }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions));\r\n    };\r\n};\n\nconst deleteBy = (base) => {\r\n    return (filters, requestOptions) => {\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: encode('1/indexes/%s/deleteByQuery', base.indexName),\r\n            data: filters,\r\n        }, requestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions));\r\n    };\r\n};\n\nconst deleteIndex = (base) => {\r\n    return (requestOptions) => {\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Delete,\r\n            path: encode('1/indexes/%s', base.indexName),\r\n        }, requestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions));\r\n    };\r\n};\n\nconst deleteObject = (base) => {\r\n    return (objectID, requestOptions) => {\r\n        return createWaitablePromise(deleteObjects(base)([objectID], requestOptions).then(response => {\r\n            return { taskID: response.taskIDs[0] };\r\n        }), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions));\r\n    };\r\n};\n\nconst deleteObjects = (base) => {\r\n    return (objectIDs, requestOptions) => {\r\n        const objects = objectIDs.map(objectID => {\r\n            return { objectID };\r\n        });\r\n        return chunkedBatch(base)(objects, BatchActionEnum.DeleteObject, requestOptions);\r\n    };\r\n};\n\nconst deleteRule = (base) => {\r\n    return (objectID, requestOptions) => {\r\n        const { forwardToReplicas, ...options } = requestOptions || {};\r\n        const mappedRequestOptions = createMappedRequestOptions(options);\r\n        if (forwardToReplicas) {\r\n            mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data\r\n        }\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Delete,\r\n            path: encode('1/indexes/%s/rules/%s', base.indexName, objectID),\r\n        }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions));\r\n    };\r\n};\n\nconst deleteSynonym = (base) => {\r\n    return (objectID, requestOptions) => {\r\n        const { forwardToReplicas, ...options } = requestOptions || {};\r\n        const mappedRequestOptions = createMappedRequestOptions(options);\r\n        if (forwardToReplicas) {\r\n            mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data\r\n        }\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Delete,\r\n            path: encode('1/indexes/%s/synonyms/%s', base.indexName, objectID),\r\n        }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions));\r\n    };\r\n};\n\nconst exists = (base) => {\r\n    return (requestOptions) => {\r\n        return getSettings(base)(requestOptions)\r\n            .then(() => true)\r\n            .catch(error => {\r\n            if (error.status !== 404) {\r\n                throw error;\r\n            }\r\n            return false;\r\n        });\r\n    };\r\n};\n\nconst findAnswers = (base) => {\r\n    return (query, queryLanguages, requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Post,\r\n            path: encode('1/answers/%s/prediction', base.indexName),\r\n            data: {\r\n                query,\r\n                queryLanguages,\r\n            },\r\n            cacheable: true,\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst findObject = (base) => {\r\n    return (callback, requestOptions) => {\r\n        const { query, paginate, ...options } = requestOptions || {};\r\n        // eslint-disable-next-line functional/no-let\r\n        let page = 0;\r\n        const forEachPage = () => {\r\n            return search(base)(query || '', { ...options, page }).then(result => {\r\n                // eslint-disable-next-line functional/no-loop-statement\r\n                for (const [position, hit] of Object.entries(result.hits)) {\r\n                    // eslint-disable-next-line promise/no-callback-in-promise\r\n                    if (callback(hit)) {\r\n                        return {\r\n                            object: hit,\r\n                            position: parseInt(position, 10),\r\n                            page,\r\n                        };\r\n                    }\r\n                }\r\n                page++;\r\n                // paginate if option was set and has next page\r\n                if (paginate === false || page >= result.nbPages) {\r\n                    throw createObjectNotFoundError();\r\n                }\r\n                return forEachPage();\r\n            });\r\n        };\r\n        return forEachPage();\r\n    };\r\n};\n\nconst getObject = (base) => {\r\n    return (objectID, requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Get,\r\n            path: encode('1/indexes/%s/%s', base.indexName, objectID),\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst getObjectPosition = () => {\r\n    return (searchResponse, objectID) => {\r\n        // eslint-disable-next-line functional/no-loop-statement\r\n        for (const [position, hit] of Object.entries(searchResponse.hits)) {\r\n            if (hit.objectID === objectID) {\r\n                return parseInt(position, 10);\r\n            }\r\n        }\r\n        return -1;\r\n    };\r\n};\n\nconst getObjects = (base) => {\r\n    return (objectIDs, requestOptions) => {\r\n        const { attributesToRetrieve, ...options } = requestOptions || {};\r\n        const requests = objectIDs.map(objectID => {\r\n            return {\r\n                indexName: base.indexName,\r\n                objectID,\r\n                ...(attributesToRetrieve ? { attributesToRetrieve } : {}),\r\n            };\r\n        });\r\n        return base.transporter.read({\r\n            method: MethodEnum.Post,\r\n            path: '1/indexes/*/objects',\r\n            data: {\r\n                requests,\r\n            },\r\n        }, options);\r\n    };\r\n};\n\nconst getRule = (base) => {\r\n    return (objectID, requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Get,\r\n            path: encode('1/indexes/%s/rules/%s', base.indexName, objectID),\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst getSettings = (base) => {\r\n    return (requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Get,\r\n            path: encode('1/indexes/%s/settings', base.indexName),\r\n            data: {\r\n                getVersion: 2,\r\n            },\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst getSynonym = (base) => {\r\n    return (objectID, requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Get,\r\n            path: encode(`1/indexes/%s/synonyms/%s`, base.indexName, objectID),\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst getTask = (base) => {\r\n    return (taskID, requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Get,\r\n            path: encode('1/indexes/%s/task/%s', base.indexName, taskID.toString()),\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst partialUpdateObject = (base) => {\r\n    return (object, requestOptions) => {\r\n        return createWaitablePromise(partialUpdateObjects(base)([object], requestOptions).then(response => {\r\n            return {\r\n                objectID: response.objectIDs[0],\r\n                taskID: response.taskIDs[0],\r\n            };\r\n        }), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions));\r\n    };\r\n};\n\nconst partialUpdateObjects = (base) => {\r\n    return (objects, requestOptions) => {\r\n        const { createIfNotExists, ...options } = requestOptions || {};\r\n        const action = createIfNotExists\r\n            ? BatchActionEnum.PartialUpdateObject\r\n            : BatchActionEnum.PartialUpdateObjectNoCreate;\r\n        return chunkedBatch(base)(objects, action, options);\r\n    };\r\n};\n\nconst replaceAllObjects = (base) => {\r\n    return (objects, requestOptions) => {\r\n        const { safe, autoGenerateObjectIDIfNotExist, batchSize, ...options } = requestOptions || {};\r\n        const operation = (from, to, type, operationRequestOptions) => {\r\n            return createWaitablePromise(base.transporter.write({\r\n                method: MethodEnum.Post,\r\n                path: encode('1/indexes/%s/operation', from),\r\n                data: {\r\n                    operation: type,\r\n                    destination: to,\r\n                },\r\n            }, operationRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions));\r\n        };\r\n        const randomSuffix = Math.random()\r\n            .toString(36)\r\n            .substring(7);\r\n        const temporaryIndexName = `${base.indexName}_tmp_${randomSuffix}`;\r\n        const saveObjectsInTemporary = saveObjects({\r\n            appId: base.appId,\r\n            transporter: base.transporter,\r\n            indexName: temporaryIndexName,\r\n        });\r\n        // @ts-ignore\r\n        // eslint-disable-next-line prefer-const, functional/no-let, functional/prefer-readonly-type\r\n        let responses = [];\r\n        const copyWaitablePromise = operation(base.indexName, temporaryIndexName, 'copy', {\r\n            ...options,\r\n            scope: ['settings', 'synonyms', 'rules'],\r\n        });\r\n        // eslint-disable-next-line functional/immutable-data\r\n        responses.push(copyWaitablePromise);\r\n        const result = (safe\r\n            ? copyWaitablePromise.wait(options)\r\n            : copyWaitablePromise)\r\n            .then(() => {\r\n            const saveObjectsWaitablePromise = saveObjectsInTemporary(objects, {\r\n                ...options,\r\n                autoGenerateObjectIDIfNotExist,\r\n                batchSize,\r\n            });\r\n            // eslint-disable-next-line functional/immutable-data\r\n            responses.push(saveObjectsWaitablePromise);\r\n            return safe ? saveObjectsWaitablePromise.wait(options) : saveObjectsWaitablePromise;\r\n        })\r\n            .then(() => {\r\n            const moveWaitablePromise = operation(temporaryIndexName, base.indexName, 'move', options);\r\n            // eslint-disable-next-line functional/immutable-data\r\n            responses.push(moveWaitablePromise);\r\n            return safe ? moveWaitablePromise.wait(options) : moveWaitablePromise;\r\n        })\r\n            .then(() => Promise.all(responses))\r\n            .then(([copyResponse, saveObjectsResponse, moveResponse]) => {\r\n            return {\r\n                objectIDs: saveObjectsResponse.objectIDs,\r\n                taskIDs: [copyResponse.taskID, ...saveObjectsResponse.taskIDs, moveResponse.taskID],\r\n            };\r\n        });\r\n        return createWaitablePromise(result, (_, waitRequestOptions) => {\r\n            return Promise.all(responses.map(response => response.wait(waitRequestOptions)));\r\n        });\r\n    };\r\n};\n\nconst replaceAllRules = (base) => {\r\n    return (rules, requestOptions) => {\r\n        return saveRules(base)(rules, {\r\n            ...requestOptions,\r\n            clearExistingRules: true,\r\n        });\r\n    };\r\n};\n\nconst replaceAllSynonyms = (base) => {\r\n    return (synonyms, requestOptions) => {\r\n        return saveSynonyms(base)(synonyms, {\r\n            ...requestOptions,\r\n            clearExistingSynonyms: true,\r\n        });\r\n    };\r\n};\n\nconst saveObject = (base) => {\r\n    return (object, requestOptions) => {\r\n        return createWaitablePromise(saveObjects(base)([object], requestOptions).then(response => {\r\n            return {\r\n                objectID: response.objectIDs[0],\r\n                taskID: response.taskIDs[0],\r\n            };\r\n        }), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions));\r\n    };\r\n};\n\nconst saveObjects = (base) => {\r\n    return (objects, requestOptions) => {\r\n        const { autoGenerateObjectIDIfNotExist, ...options } = requestOptions || {};\r\n        const action = autoGenerateObjectIDIfNotExist\r\n            ? BatchActionEnum.AddObject\r\n            : BatchActionEnum.UpdateObject;\r\n        if (action === BatchActionEnum.UpdateObject) {\r\n            // eslint-disable-next-line functional/no-loop-statement\r\n            for (const object of objects) {\r\n                if (object.objectID === undefined) {\r\n                    return createWaitablePromise(Promise.reject(createMissingObjectIDError()));\r\n                }\r\n            }\r\n        }\r\n        return chunkedBatch(base)(objects, action, options);\r\n    };\r\n};\n\nconst saveRule = (base) => {\r\n    return (rule, requestOptions) => {\r\n        return saveRules(base)([rule], requestOptions);\r\n    };\r\n};\n\nconst saveRules = (base) => {\r\n    return (rules, requestOptions) => {\r\n        const { forwardToReplicas, clearExistingRules, ...options } = requestOptions || {};\r\n        const mappedRequestOptions = createMappedRequestOptions(options);\r\n        if (forwardToReplicas) {\r\n            mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data\r\n        }\r\n        if (clearExistingRules) {\r\n            mappedRequestOptions.queryParameters.clearExistingRules = 1; // eslint-disable-line functional/immutable-data\r\n        }\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: encode('1/indexes/%s/rules/batch', base.indexName),\r\n            data: rules,\r\n        }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions));\r\n    };\r\n};\n\nconst saveSynonym = (base) => {\r\n    return (synonym, requestOptions) => {\r\n        return saveSynonyms(base)([synonym], requestOptions);\r\n    };\r\n};\n\nconst saveSynonyms = (base) => {\r\n    return (synonyms, requestOptions) => {\r\n        const { forwardToReplicas, clearExistingSynonyms, replaceExistingSynonyms, ...options } = requestOptions || {};\r\n        const mappedRequestOptions = createMappedRequestOptions(options);\r\n        if (forwardToReplicas) {\r\n            mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data\r\n        }\r\n        if (replaceExistingSynonyms || clearExistingSynonyms) {\r\n            mappedRequestOptions.queryParameters.replaceExistingSynonyms = 1; // eslint-disable-line functional/immutable-data\r\n        }\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Post,\r\n            path: encode('1/indexes/%s/synonyms/batch', base.indexName),\r\n            data: synonyms,\r\n        }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions));\r\n    };\r\n};\n\nconst search = (base) => {\r\n    return (query, requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Post,\r\n            path: encode('1/indexes/%s/query', base.indexName),\r\n            data: {\r\n                query,\r\n            },\r\n            cacheable: true,\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst searchForFacetValues = (base) => {\r\n    return (facetName, facetQuery, requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Post,\r\n            path: encode('1/indexes/%s/facets/%s/query', base.indexName, facetName),\r\n            data: {\r\n                facetQuery,\r\n            },\r\n            cacheable: true,\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst searchRules = (base) => {\r\n    return (query, requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Post,\r\n            path: encode('1/indexes/%s/rules/search', base.indexName),\r\n            data: {\r\n                query,\r\n            },\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst searchSynonyms = (base) => {\r\n    return (query, requestOptions) => {\r\n        return base.transporter.read({\r\n            method: MethodEnum.Post,\r\n            path: encode('1/indexes/%s/synonyms/search', base.indexName),\r\n            data: {\r\n                query,\r\n            },\r\n        }, requestOptions);\r\n    };\r\n};\n\nconst setSettings = (base) => {\r\n    return (settings, requestOptions) => {\r\n        const { forwardToReplicas, ...options } = requestOptions || {};\r\n        const mappedRequestOptions = createMappedRequestOptions(options);\r\n        if (forwardToReplicas) {\r\n            mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data\r\n        }\r\n        return createWaitablePromise(base.transporter.write({\r\n            method: MethodEnum.Put,\r\n            path: encode('1/indexes/%s/settings', base.indexName),\r\n            data: settings,\r\n        }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions));\r\n    };\r\n};\n\nconst waitTask = (base) => {\r\n    return (taskID, requestOptions) => {\r\n        return createRetryablePromise(retry => {\r\n            return getTask(base)(taskID, requestOptions).then(response => {\r\n                return response.status !== 'published' ? retry() : undefined;\r\n            });\r\n        });\r\n    };\r\n};\n\nconst BatchActionEnum = {\r\n    AddObject: 'addObject',\r\n    UpdateObject: 'updateObject',\r\n    PartialUpdateObject: 'partialUpdateObject',\r\n    PartialUpdateObjectNoCreate: 'partialUpdateObjectNoCreate',\r\n    DeleteObject: 'deleteObject',\r\n    DeleteIndex: 'delete',\r\n    ClearIndex: 'clear',\r\n};\n\nconst ScopeEnum = {\r\n    Settings: 'settings',\r\n    Synonyms: 'synonyms',\r\n    Rules: 'rules',\r\n};\n\nconst LogLevelEnum = {\r\n    Debug: 1,\r\n    Info: 2,\r\n    Error: 3,\r\n};\n\n/* eslint no-console: 0 */\r\nfunction createConsoleLogger(logLevel) {\r\n    return {\r\n        debug(message, args) {\r\n            if (LogLevelEnum.Debug >= logLevel) {\r\n                console.debug(message, args);\r\n            }\r\n            return Promise.resolve();\r\n        },\r\n        info(message, args) {\r\n            if (LogLevelEnum.Info >= logLevel) {\r\n                console.info(message, args);\r\n            }\r\n            return Promise.resolve();\r\n        },\r\n        error(message, args) {\r\n            console.error(message, args);\r\n            return Promise.resolve();\r\n        },\r\n    };\r\n}\n\nfunction createBrowserXhrRequester() {\r\n    return {\r\n        send(request) {\r\n            return new Promise((resolve) => {\r\n                const baseRequester = new XMLHttpRequest();\r\n                baseRequester.open(request.method, request.url, true);\r\n                Object.keys(request.headers).forEach(key => baseRequester.setRequestHeader(key, request.headers[key]));\r\n                const createTimeout = (timeout, content) => {\r\n                    return setTimeout(() => {\r\n                        baseRequester.abort();\r\n                        resolve({\r\n                            status: 0,\r\n                            content,\r\n                            isTimedOut: true,\r\n                        });\r\n                    }, timeout * 1000);\r\n                };\r\n                const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');\r\n                // eslint-disable-next-line functional/no-let\r\n                let responseTimeout;\r\n                // eslint-disable-next-line functional/immutable-data\r\n                baseRequester.onreadystatechange = () => {\r\n                    if (baseRequester.readyState > baseRequester.OPENED && responseTimeout === undefined) {\r\n                        clearTimeout(connectTimeout);\r\n                        responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');\r\n                    }\r\n                };\r\n                // eslint-disable-next-line functional/immutable-data\r\n                baseRequester.onerror = () => {\r\n                    // istanbul ignore next\r\n                    if (baseRequester.status === 0) {\r\n                        clearTimeout(connectTimeout);\r\n                        clearTimeout(responseTimeout);\r\n                        resolve({\r\n                            content: baseRequester.responseText || 'Network request failed',\r\n                            status: baseRequester.status,\r\n                            isTimedOut: false,\r\n                        });\r\n                    }\r\n                };\r\n                //  eslint-disable-next-line functional/immutable-data\r\n                baseRequester.onload = () => {\r\n                    clearTimeout(connectTimeout);\r\n                    clearTimeout(responseTimeout);\r\n                    resolve({\r\n                        content: baseRequester.responseText,\r\n                        status: baseRequester.status,\r\n                        isTimedOut: false,\r\n                    });\r\n                };\r\n                baseRequester.send(request.data);\r\n            });\r\n        },\r\n    };\r\n}\n\nfunction algoliasearch(appId, apiKey, options) {\r\n    const commonOptions = {\r\n        appId,\r\n        apiKey,\r\n        timeouts: {\r\n            connect: 1,\r\n            read: 2,\r\n            write: 30,\r\n        },\r\n        requester: createBrowserXhrRequester(),\r\n        logger: createConsoleLogger(LogLevelEnum.Error),\r\n        responsesCache: createInMemoryCache(),\r\n        requestsCache: createInMemoryCache({ serializable: false }),\r\n        hostsCache: createFallbackableCache({\r\n            caches: [\r\n                createBrowserLocalStorageCache({ key: `${version}-${appId}` }),\r\n                createInMemoryCache(),\r\n            ],\r\n        }),\r\n        userAgent: createUserAgent(version).add({ segment: 'Browser' }),\r\n    };\r\n    const searchClientOptions = { ...commonOptions, ...options };\r\n    const initPersonalization = () => (clientOptions) => {\r\n        return createPersonalizationClient({\r\n            ...commonOptions,\r\n            ...clientOptions,\r\n            methods: {\r\n                getPersonalizationStrategy,\r\n                setPersonalizationStrategy,\r\n            },\r\n        });\r\n    };\r\n    return createSearchClient({\r\n        ...searchClientOptions,\r\n        methods: {\r\n            search: multipleQueries,\r\n            searchForFacetValues: multipleSearchForFacetValues,\r\n            multipleBatch,\r\n            multipleGetObjects,\r\n            multipleQueries,\r\n            copyIndex,\r\n            copySettings,\r\n            copySynonyms,\r\n            copyRules,\r\n            moveIndex,\r\n            listIndices,\r\n            getLogs,\r\n            listClusters,\r\n            multipleSearchForFacetValues,\r\n            getApiKey,\r\n            addApiKey,\r\n            listApiKeys,\r\n            updateApiKey,\r\n            deleteApiKey,\r\n            restoreApiKey,\r\n            assignUserID,\r\n            assignUserIDs,\r\n            getUserID,\r\n            searchUserIDs,\r\n            listUserIDs,\r\n            getTopUserIDs,\r\n            removeUserID,\r\n            hasPendingMappings,\r\n            clearDictionaryEntries,\r\n            deleteDictionaryEntries,\r\n            getDictionarySettings,\r\n            getAppTask,\r\n            replaceDictionaryEntries,\r\n            saveDictionaryEntries,\r\n            searchDictionaryEntries,\r\n            setDictionarySettings,\r\n            waitAppTask,\r\n            customRequest,\r\n            initIndex: base => (indexName) => {\r\n                return initIndex(base)(indexName, {\r\n                    methods: {\r\n                        batch,\r\n                        delete: deleteIndex,\r\n                        findAnswers,\r\n                        getObject,\r\n                        getObjects,\r\n                        saveObject,\r\n                        saveObjects,\r\n                        search,\r\n                        searchForFacetValues,\r\n                        waitTask,\r\n                        setSettings,\r\n                        getSettings,\r\n                        partialUpdateObject,\r\n                        partialUpdateObjects,\r\n                        deleteObject,\r\n                        deleteObjects,\r\n                        deleteBy,\r\n                        clearObjects,\r\n                        browseObjects,\r\n                        getObjectPosition,\r\n                        findObject,\r\n                        exists,\r\n                        saveSynonym,\r\n                        saveSynonyms,\r\n                        getSynonym,\r\n                        searchSynonyms,\r\n                        browseSynonyms,\r\n                        deleteSynonym,\r\n                        clearSynonyms,\r\n                        replaceAllObjects,\r\n                        replaceAllSynonyms,\r\n                        searchRules,\r\n                        getRule,\r\n                        deleteRule,\r\n                        saveRule,\r\n                        saveRules,\r\n                        replaceAllRules,\r\n                        browseRules,\r\n                        clearRules,\r\n                    },\r\n                });\r\n            },\r\n            initAnalytics: () => (clientOptions) => {\r\n                return createAnalyticsClient({\r\n                    ...commonOptions,\r\n                    ...clientOptions,\r\n                    methods: {\r\n                        addABTest,\r\n                        getABTest,\r\n                        getABTests,\r\n                        stopABTest,\r\n                        deleteABTest,\r\n                    },\r\n                });\r\n            },\r\n            initPersonalization,\r\n            initRecommendation: () => (clientOptions) => {\r\n                searchClientOptions.logger.info('The `initRecommendation` method is deprecated. Use `initPersonalization` instead.');\r\n                return initPersonalization()(clientOptions);\r\n            },\r\n        },\r\n    });\r\n}\r\n// eslint-disable-next-line functional/immutable-data\r\nalgoliasearch.version = version;\n\nexport default algoliasearch;\n"
  },
  {
    "path": "js/algoliasearch/dist/algoliasearch.umd.js",
    "content": "/*! algoliasearch.umd.js | 4.18.0 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */\n!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=t||self).algoliasearch=e()}(this,(function(){\"use strict\";function t(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function r(r){for(var n=1;n<arguments.length;n++){var a=null!=arguments[n]?arguments[n]:{};n%2?e(Object(a),!0).forEach((function(e){t(r,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(a,t))}))}return r}function n(t,e){if(null==t)return{};var r,n,a=function(t,e){if(null==t)return{};var r,n,a={},o=Object.keys(t);for(n=0;n<o.length;n++)r=o[n],e.indexOf(r)>=0||(a[r]=t[r]);return a}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)r=o[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t)))return;var r=[],n=!0,a=!1,o=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){a=!0,o=t}finally{try{n||null==u.return||u.return()}finally{if(a)throw o}}return r}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function o(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function i(t){var e,r=\"algoliasearch-client-js-\".concat(t.key),n=function(){return void 0===e&&(e=t.localStorage||window.localStorage),e},o=function(){return JSON.parse(n().getItem(r)||\"{}\")},i=function(t){n().setItem(r,JSON.stringify(t))},u=function(){var e=t.timeToLive?1e3*t.timeToLive:null,r=o(),n=Object.fromEntries(Object.entries(r).filter((function(t){return void 0!==a(t,2)[1].timestamp})));if(i(n),e){var u=Object.fromEntries(Object.entries(n).filter((function(t){var r=a(t,2)[1],n=(new Date).getTime();return!(r.timestamp+e<n)})));i(u)}};return{get:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){u();var e=JSON.stringify(t);return o()[e]})).then((function(t){return Promise.all([t?t.value:e(),void 0!==t])})).then((function(t){var e=a(t,2),n=e[0],o=e[1];return Promise.all([n,o||r.miss(n)])})).then((function(t){return a(t,1)[0]}))},set:function(t,e){return Promise.resolve().then((function(){var a=o();return a[JSON.stringify(t)]={timestamp:(new Date).getTime(),value:e},n().setItem(r,JSON.stringify(a)),e}))},delete:function(t){return Promise.resolve().then((function(){var e=o();delete e[JSON.stringify(t)],n().setItem(r,JSON.stringify(e))}))},clear:function(){return Promise.resolve().then((function(){n().removeItem(r)}))}}}function u(t){var e=o(t.caches),r=e.shift();return void 0===r?{get:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},n=e();return n.then((function(t){return Promise.all([t,r.miss(t)])})).then((function(t){return a(t,1)[0]}))},set:function(t,e){return Promise.resolve(e)},delete:function(t){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(t,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return r.get(t,n,a).catch((function(){return u({caches:e}).get(t,n,a)}))},set:function(t,n){return r.set(t,n).catch((function(){return u({caches:e}).set(t,n)}))},delete:function(t){return r.delete(t).catch((function(){return u({caches:e}).delete(t)}))},clear:function(){return r.clear().catch((function(){return u({caches:e}).clear()}))}}}function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},e={};return{get:function(r,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},o=JSON.stringify(r);if(o in e)return Promise.resolve(t.serializable?JSON.parse(e[o]):e[o]);var i=n(),u=a&&a.miss||function(){return Promise.resolve()};return i.then((function(t){return u(t)})).then((function(){return i}))},set:function(r,n){return e[JSON.stringify(r)]=t.serializable?JSON.stringify(n):n,Promise.resolve(n)},delete:function(t){return delete e[JSON.stringify(t)],Promise.resolve()},clear:function(){return e={},Promise.resolve()}}}function c(t,e,r){var n={\"x-algolia-api-key\":r,\"x-algolia-application-id\":e};return{headers:function(){return t===m.WithinHeaders?n:{}},queryParameters:function(){return t===m.WithinQueryParameters?n:{}}}}function f(t){var e=0;return t((function r(){return e++,new Promise((function(n){setTimeout((function(){n(t(r))}),Math.min(100*e,1e3))}))}))}function d(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t,e){return Promise.resolve()};return Object.assign(t,{wait:function(r){return d(t.then((function(t){return Promise.all([e(t,r),t])})).then((function(t){return t[1]})))}})}function l(t){for(var e=t.length-1;e>0;e--){var r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}function p(t,e){return e?(Object.keys(e).forEach((function(r){t[r]=e[r](t)})),t):t}function h(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var a=0;return t.replace(/%s/g,(function(){return encodeURIComponent(r[a++])}))}var m={WithinQueryParameters:0,WithinHeaders:1};function y(t,e){var r=t||{},n=r.data||{};return Object.keys(r).forEach((function(t){-1===[\"timeout\",\"headers\",\"queryParameters\",\"data\",\"cacheable\"].indexOf(t)&&(n[t]=r[t])})),{data:Object.entries(n).length>0?n:void 0,timeout:r.timeout||e,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var g={Read:1,Write:2,Any:3},v=1,b=2,O=3;function P(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;return r(r({},t),{},{status:e,lastUpdate:Date.now()})}function w(t){return\"string\"==typeof t?{protocol:\"https\",url:t,accept:g.Any}:{protocol:t.protocol||\"https\",url:t.url,accept:t.accept||g.Any}}var I=\"DELETE\",j=\"GET\",x=\"POST\",D=\"PUT\";function q(t,e){return Promise.all(e.map((function(e){return t.get(e,(function(){return Promise.resolve(P(e))}))}))).then((function(t){var r=t.filter((function(t){return function(t){return t.status===v||Date.now()-t.lastUpdate>12e4}(t)})),n=t.filter((function(t){return function(t){return t.status===O&&Date.now()-t.lastUpdate<=12e4}(t)})),a=[].concat(o(r),o(n));return{getTimeout:function(t,e){return(0===n.length&&0===t?1:n.length+3+t)*e},statelessHosts:a.length>0?a.map((function(t){return w(t)})):e}}))}function S(t,e,n,a){var i=[],u=function(t,e){if(t.method===j||void 0===t.data&&void 0===e.data)return;var n=Array.isArray(t.data)?t.data:r(r({},t.data),e.data);return JSON.stringify(n)}(n,a),s=function(t,e){var n=r(r({},t.headers),e.headers),a={};return Object.keys(n).forEach((function(t){var e=n[t];a[t.toLowerCase()]=e})),a}(t,a),c=n.method,f=n.method!==j?{}:r(r({},n.data),a.data),d=r(r(r({\"x-algolia-agent\":t.userAgent.value},t.queryParameters),f),a.queryParameters),l=0,p=function e(r,o){var f=r.pop();if(void 0===f)throw{name:\"RetryError\",message:\"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.\",transporterStackTrace:R(i)};var p={data:u,headers:s,method:c,url:N(f,n.path,d),connectTimeout:o(l,t.timeouts.connect),responseTimeout:o(l,a.timeout)},h=function(t){var e={request:p,response:t,host:f,triesLeft:r.length};return i.push(e),e},m={onSuccess:function(t){return function(t){try{return JSON.parse(t.content)}catch(e){throw function(t,e){return{name:\"DeserializationError\",message:t,response:e}}(e.message,t)}}(t)},onRetry:function(n){var a=h(n);return n.isTimedOut&&l++,Promise.all([t.logger.info(\"Retryable failure\",A(a)),t.hostsCache.set(f,P(f,n.isTimedOut?O:b))]).then((function(){return e(r,o)}))},onFail:function(t){throw h(t),function(t,e){var r=t.content,n=t.status,a=r;try{a=JSON.parse(r).message}catch(t){}return function(t,e,r){return{name:\"ApiError\",message:t,status:e,transporterStackTrace:r}}(a,n,e)}(t,R(i))}};return t.requester.send(p).then((function(t){return function(t,e){return function(t){var e=t.status;return t.isTimedOut||function(t){var e=t.isTimedOut,r=t.status;return!e&&0==~~r}(t)||2!=~~(e/100)&&4!=~~(e/100)}(t)?e.onRetry(t):2==~~(t.status/100)?e.onSuccess(t):e.onFail(t)}(t,m)}))};return q(t.hostsCache,e).then((function(t){return p(o(t.statelessHosts).reverse(),t.getTimeout)}))}function k(t){var e=t.hostsCache,r=t.logger,n=t.requester,o=t.requestsCache,i=t.responsesCache,u=t.timeouts,s=t.userAgent,c=t.hosts,f=t.queryParameters,d={hostsCache:e,logger:r,requester:n,requestsCache:o,responsesCache:i,timeouts:u,userAgent:s,headers:t.headers,queryParameters:f,hosts:c.map((function(t){return w(t)})),read:function(t,e){var r=y(e,d.timeouts.read),n=function(){return S(d,d.hosts.filter((function(t){return 0!=(t.accept&g.Read)})),t,r)};if(!0!==(void 0!==r.cacheable?r.cacheable:t.cacheable))return n();var o={request:t,mappedRequestOptions:r,transporter:{queryParameters:d.queryParameters,headers:d.headers}};return d.responsesCache.get(o,(function(){return d.requestsCache.get(o,(function(){return d.requestsCache.set(o,n()).then((function(t){return Promise.all([d.requestsCache.delete(o),t])}),(function(t){return Promise.all([d.requestsCache.delete(o),Promise.reject(t)])})).then((function(t){var e=a(t,2);e[0];return e[1]}))}))}),{miss:function(t){return d.responsesCache.set(o,t)}})},write:function(t,e){return S(d,d.hosts.filter((function(t){return 0!=(t.accept&g.Write)})),t,y(e,d.timeouts.write))}};return d}function T(t){var e={value:\"Algolia for JavaScript (\".concat(t,\")\"),add:function(t){var r=\"; \".concat(t.segment).concat(void 0!==t.version?\" (\".concat(t.version,\")\"):\"\");return-1===e.value.indexOf(r)&&(e.value=\"\".concat(e.value).concat(r)),e}};return e}function N(t,e,r){var n=E(r),a=\"\".concat(t.protocol,\"://\").concat(t.url,\"/\").concat(\"/\"===e.charAt(0)?e.substr(1):e);return n.length&&(a+=\"?\".concat(n)),a}function E(t){return Object.keys(t).map((function(e){return h(\"%s=%s\",e,(r=t[e],\"[object Object]\"===Object.prototype.toString.call(r)||\"[object Array]\"===Object.prototype.toString.call(r)?JSON.stringify(t[e]):t[e]));var r})).join(\"&\")}function R(t){return t.map((function(t){return A(t)}))}function A(t){var e=t.request.headers[\"x-algolia-api-key\"]?{\"x-algolia-api-key\":\"*****\"}:{};return r(r({},t),{},{request:r(r({},t.request),{},{headers:r(r({},t.request.headers),e)})})}var C=function(t){return function(e,r){return t.transporter.write({method:x,path:\"2/abtests\",data:e},r)}},U=function(t){return function(e,r){return t.transporter.write({method:I,path:h(\"2/abtests/%s\",e)},r)}},z=function(t){return function(e,r){return t.transporter.read({method:j,path:h(\"2/abtests/%s\",e)},r)}},J=function(t){return function(e){return t.transporter.read({method:j,path:\"2/abtests\"},e)}},F=function(t){return function(e,r){return t.transporter.write({method:x,path:h(\"2/abtests/%s/stop\",e)},r)}},H=function(t){return function(e){return t.transporter.read({method:j,path:\"1/strategies/personalization\"},e)}},M=function(t){return function(e,r){return t.transporter.write({method:x,path:\"1/strategies/personalization\",data:e},r)}};function K(t){return function e(r){return t.request(r).then((function(n){if(void 0!==t.batch&&t.batch(n.hits),!t.shouldStop(n))return n.cursor?e({cursor:n.cursor}):e({page:(r.page||0)+1})}))}({})}var W=function(t){return function(e,a){var o=a||{},i=o.queryParameters,u=n(o,[\"queryParameters\"]),s=r({acl:e},void 0!==i?{queryParameters:i}:{});return d(t.transporter.write({method:x,path:\"1/keys\",data:s},u),(function(e,r){return f((function(n){return tt(t)(e.key,r).catch((function(t){if(404!==t.status)throw t;return n()}))}))}))}},B=function(t){return function(e,r,n){var a=y(n);return a.queryParameters[\"X-Algolia-User-ID\"]=e,t.transporter.write({method:x,path:\"1/clusters/mapping\",data:{cluster:r}},a)}},Q=function(t){return function(e,r,n){return t.transporter.write({method:x,path:\"1/clusters/mapping/batch\",data:{users:e,cluster:r}},n)}},G=function(t){return function(e,r){return d(t.transporter.write({method:x,path:h(\"/1/dictionaries/%s/batch\",e),data:{clearExistingDictionaryEntries:!0,requests:{action:\"addEntry\",body:[]}}},r),(function(e,r){return xt(t)(e.taskID,r)}))}},L=function(t){return function(e,r,n){return d(t.transporter.write({method:x,path:h(\"1/indexes/%s/operation\",e),data:{operation:\"copy\",destination:r}},n),(function(r,n){return ut(t)(e,{methods:{waitTask:de}}).waitTask(r.taskID,n)}))}},V=function(t){return function(e,n,a){return L(t)(e,n,r(r({},a),{},{scope:[pe.Rules]}))}},_=function(t){return function(e,n,a){return L(t)(e,n,r(r({},a),{},{scope:[pe.Settings]}))}},X=function(t){return function(e,n,a){return L(t)(e,n,r(r({},a),{},{scope:[pe.Synonyms]}))}},Y=function(t){return function(e,r){return e.method===j?t.transporter.read(e,r):t.transporter.write(e,r)}},Z=function(t){return function(e,r){return d(t.transporter.write({method:I,path:h(\"1/keys/%s\",e)},r),(function(r,n){return f((function(r){return tt(t)(e,n).then(r).catch((function(t){if(404!==t.status)throw t}))}))}))}},$=function(t){return function(e,r,n){var a=r.map((function(t){return{action:\"deleteEntry\",body:{objectID:t}}}));return d(t.transporter.write({method:x,path:h(\"/1/dictionaries/%s/batch\",e),data:{clearExistingDictionaryEntries:!1,requests:a}},n),(function(e,r){return xt(t)(e.taskID,r)}))}},tt=function(t){return function(e,r){return t.transporter.read({method:j,path:h(\"1/keys/%s\",e)},r)}},et=function(t){return function(e,r){return t.transporter.read({method:j,path:h(\"1/task/%s\",e.toString())},r)}},rt=function(t){return function(e){return t.transporter.read({method:j,path:\"/1/dictionaries/*/settings\"},e)}},nt=function(t){return function(e){return t.transporter.read({method:j,path:\"1/logs\"},e)}},at=function(t){return function(e){return t.transporter.read({method:j,path:\"1/clusters/mapping/top\"},e)}},ot=function(t){return function(e,r){return t.transporter.read({method:j,path:h(\"1/clusters/mapping/%s\",e)},r)}},it=function(t){return function(e){var r=e||{},a=r.retrieveMappings,o=n(r,[\"retrieveMappings\"]);return!0===a&&(o.getClusters=!0),t.transporter.read({method:j,path:\"1/clusters/mapping/pending\"},o)}},ut=function(t){return function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={transporter:t.transporter,appId:t.appId,indexName:e};return p(n,r.methods)}},st=function(t){return function(e){return t.transporter.read({method:j,path:\"1/keys\"},e)}},ct=function(t){return function(e){return t.transporter.read({method:j,path:\"1/clusters\"},e)}},ft=function(t){return function(e){return t.transporter.read({method:j,path:\"1/indexes\"},e)}},dt=function(t){return function(e){return t.transporter.read({method:j,path:\"1/clusters/mapping\"},e)}},lt=function(t){return function(e,r,n){return d(t.transporter.write({method:x,path:h(\"1/indexes/%s/operation\",e),data:{operation:\"move\",destination:r}},n),(function(r,n){return ut(t)(e,{methods:{waitTask:de}}).waitTask(r.taskID,n)}))}},pt=function(t){return function(e,r){return d(t.transporter.write({method:x,path:\"1/indexes/*/batch\",data:{requests:e}},r),(function(e,r){return Promise.all(Object.keys(e.taskID).map((function(n){return ut(t)(n,{methods:{waitTask:de}}).waitTask(e.taskID[n],r)})))}))}},ht=function(t){return function(e,r){return t.transporter.read({method:x,path:\"1/indexes/*/objects\",data:{requests:e}},r)}},mt=function(t){return function(e,n){var a=e.map((function(t){return r(r({},t),{},{params:E(t.params||{})})}));return t.transporter.read({method:x,path:\"1/indexes/*/queries\",data:{requests:a},cacheable:!0},n)}},yt=function(t){return function(e,a){return Promise.all(e.map((function(e){var o=e.params,i=o.facetName,u=o.facetQuery,s=n(o,[\"facetName\",\"facetQuery\"]);return ut(t)(e.indexName,{methods:{searchForFacetValues:ue}}).searchForFacetValues(i,u,r(r({},a),s))})))}},gt=function(t){return function(e,r){var n=y(r);return n.queryParameters[\"X-Algolia-User-ID\"]=e,t.transporter.write({method:I,path:\"1/clusters/mapping\"},n)}},vt=function(t){return function(e,r,n){var a=r.map((function(t){return{action:\"addEntry\",body:t}}));return d(t.transporter.write({method:x,path:h(\"/1/dictionaries/%s/batch\",e),data:{clearExistingDictionaryEntries:!0,requests:a}},n),(function(e,r){return xt(t)(e.taskID,r)}))}},bt=function(t){return function(e,r){return d(t.transporter.write({method:x,path:h(\"1/keys/%s/restore\",e)},r),(function(r,n){return f((function(r){return tt(t)(e,n).catch((function(t){if(404!==t.status)throw t;return r()}))}))}))}},Ot=function(t){return function(e,r,n){var a=r.map((function(t){return{action:\"addEntry\",body:t}}));return d(t.transporter.write({method:x,path:h(\"/1/dictionaries/%s/batch\",e),data:{clearExistingDictionaryEntries:!1,requests:a}},n),(function(e,r){return xt(t)(e.taskID,r)}))}},Pt=function(t){return function(e,r,n){return t.transporter.read({method:x,path:h(\"/1/dictionaries/%s/search\",e),data:{query:r},cacheable:!0},n)}},wt=function(t){return function(e,r){return t.transporter.read({method:x,path:\"1/clusters/mapping/search\",data:{query:e}},r)}},It=function(t){return function(e,r){return d(t.transporter.write({method:D,path:\"/1/dictionaries/*/settings\",data:e},r),(function(e,r){return xt(t)(e.taskID,r)}))}},jt=function(t){return function(e,r){var a=Object.assign({},r),o=r||{},i=o.queryParameters,u=n(o,[\"queryParameters\"]),s=i?{queryParameters:i}:{},c=[\"acl\",\"indexes\",\"referers\",\"restrictSources\",\"queryParameters\",\"description\",\"maxQueriesPerIPPerHour\",\"maxHitsPerQuery\"];return d(t.transporter.write({method:D,path:h(\"1/keys/%s\",e),data:s},u),(function(r,n){return f((function(r){return tt(t)(e,n).then((function(t){return function(t){return Object.keys(a).filter((function(t){return-1!==c.indexOf(t)})).every((function(e){if(Array.isArray(t[e])&&Array.isArray(a[e])){var r=t[e];return r.length===a[e].length&&r.every((function(t,r){return t===a[e][r]}))}return t[e]===a[e]}))}(t)?Promise.resolve():r()}))}))}))}},xt=function(t){return function(e,r){return f((function(n){return et(t)(e,r).then((function(t){return\"published\"!==t.status?n():void 0}))}))}},Dt=function(t){return function(e,r){return d(t.transporter.write({method:x,path:h(\"1/indexes/%s/batch\",t.indexName),data:{requests:e}},r),(function(e,r){return de(t)(e.taskID,r)}))}},qt=function(t){return function(e){return K(r(r({shouldStop:function(t){return void 0===t.cursor}},e),{},{request:function(r){return t.transporter.read({method:x,path:h(\"1/indexes/%s/browse\",t.indexName),data:r},e)}}))}},St=function(t){return function(e){var n=r({hitsPerPage:1e3},e);return K(r(r({shouldStop:function(t){return t.hits.length<n.hitsPerPage}},n),{},{request:function(e){return se(t)(\"\",r(r({},n),e)).then((function(t){return r(r({},t),{},{hits:t.hits.map((function(t){return delete t._highlightResult,t}))})}))}}))}},kt=function(t){return function(e){var n=r({hitsPerPage:1e3},e);return K(r(r({shouldStop:function(t){return t.hits.length<n.hitsPerPage}},n),{},{request:function(e){return ce(t)(\"\",r(r({},n),e)).then((function(t){return r(r({},t),{},{hits:t.hits.map((function(t){return delete t._highlightResult,t}))})}))}}))}},Tt=function(t){return function(e,r,a){var o=a||{},i=o.batchSize,u=n(o,[\"batchSize\"]),s={taskIDs:[],objectIDs:[]};return d(function n(){var a,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,c=[];for(a=o;a<e.length&&(c.push(e[a]),c.length!==(i||1e3));a++);return 0===c.length?Promise.resolve(s):Dt(t)(c.map((function(t){return{action:r,body:t}})),u).then((function(t){return s.objectIDs=s.objectIDs.concat(t.objectIDs),s.taskIDs.push(t.taskID),a++,n(a)}))}(),(function(e,r){return Promise.all(e.taskIDs.map((function(e){return de(t)(e,r)})))}))}},Nt=function(t){return function(e){return d(t.transporter.write({method:x,path:h(\"1/indexes/%s/clear\",t.indexName)},e),(function(e,r){return de(t)(e.taskID,r)}))}},Et=function(t){return function(e){var r=e||{},a=r.forwardToReplicas,o=y(n(r,[\"forwardToReplicas\"]));return a&&(o.queryParameters.forwardToReplicas=1),d(t.transporter.write({method:x,path:h(\"1/indexes/%s/rules/clear\",t.indexName)},o),(function(e,r){return de(t)(e.taskID,r)}))}},Rt=function(t){return function(e){var r=e||{},a=r.forwardToReplicas,o=y(n(r,[\"forwardToReplicas\"]));return a&&(o.queryParameters.forwardToReplicas=1),d(t.transporter.write({method:x,path:h(\"1/indexes/%s/synonyms/clear\",t.indexName)},o),(function(e,r){return de(t)(e.taskID,r)}))}},At=function(t){return function(e,r){return d(t.transporter.write({method:x,path:h(\"1/indexes/%s/deleteByQuery\",t.indexName),data:e},r),(function(e,r){return de(t)(e.taskID,r)}))}},Ct=function(t){return function(e){return d(t.transporter.write({method:I,path:h(\"1/indexes/%s\",t.indexName)},e),(function(e,r){return de(t)(e.taskID,r)}))}},Ut=function(t){return function(e,r){return d(zt(t)([e],r).then((function(t){return{taskID:t.taskIDs[0]}})),(function(e,r){return de(t)(e.taskID,r)}))}},zt=function(t){return function(e,r){var n=e.map((function(t){return{objectID:t}}));return Tt(t)(n,le.DeleteObject,r)}},Jt=function(t){return function(e,r){var a=r||{},o=a.forwardToReplicas,i=y(n(a,[\"forwardToReplicas\"]));return o&&(i.queryParameters.forwardToReplicas=1),d(t.transporter.write({method:I,path:h(\"1/indexes/%s/rules/%s\",t.indexName,e)},i),(function(e,r){return de(t)(e.taskID,r)}))}},Ft=function(t){return function(e,r){var a=r||{},o=a.forwardToReplicas,i=y(n(a,[\"forwardToReplicas\"]));return o&&(i.queryParameters.forwardToReplicas=1),d(t.transporter.write({method:I,path:h(\"1/indexes/%s/synonyms/%s\",t.indexName,e)},i),(function(e,r){return de(t)(e.taskID,r)}))}},Ht=function(t){return function(e){return Lt(t)(e).then((function(){return!0})).catch((function(t){if(404!==t.status)throw t;return!1}))}},Mt=function(t){return function(e,r,n){return t.transporter.read({method:x,path:h(\"1/answers/%s/prediction\",t.indexName),data:{query:e,queryLanguages:r},cacheable:!0},n)}},Kt=function(t){return function(e,o){var i=o||{},u=i.query,s=i.paginate,c=n(i,[\"query\",\"paginate\"]),f=0;return function n(){return ie(t)(u||\"\",r(r({},c),{},{page:f})).then((function(t){for(var r=0,o=Object.entries(t.hits);r<o.length;r++){var i=a(o[r],2),u=i[0],c=i[1];if(e(c))return{object:c,position:parseInt(u,10),page:f}}if(f++,!1===s||f>=t.nbPages)throw{name:\"ObjectNotFoundError\",message:\"Object not found.\"};return n()}))}()}},Wt=function(t){return function(e,r){return t.transporter.read({method:j,path:h(\"1/indexes/%s/%s\",t.indexName,e)},r)}},Bt=function(){return function(t,e){for(var r=0,n=Object.entries(t.hits);r<n.length;r++){var o=a(n[r],2),i=o[0];if(o[1].objectID===e)return parseInt(i,10)}return-1}},Qt=function(t){return function(e,a){var o=a||{},i=o.attributesToRetrieve,u=n(o,[\"attributesToRetrieve\"]),s=e.map((function(e){return r({indexName:t.indexName,objectID:e},i?{attributesToRetrieve:i}:{})}));return t.transporter.read({method:x,path:\"1/indexes/*/objects\",data:{requests:s}},u)}},Gt=function(t){return function(e,r){return t.transporter.read({method:j,path:h(\"1/indexes/%s/rules/%s\",t.indexName,e)},r)}},Lt=function(t){return function(e){return t.transporter.read({method:j,path:h(\"1/indexes/%s/settings\",t.indexName),data:{getVersion:2}},e)}},Vt=function(t){return function(e,r){return t.transporter.read({method:j,path:h(\"1/indexes/%s/synonyms/%s\",t.indexName,e)},r)}},_t=function(t){return function(e,r){return d(Xt(t)([e],r).then((function(t){return{objectID:t.objectIDs[0],taskID:t.taskIDs[0]}})),(function(e,r){return de(t)(e.taskID,r)}))}},Xt=function(t){return function(e,r){var a=r||{},o=a.createIfNotExists,i=n(a,[\"createIfNotExists\"]),u=o?le.PartialUpdateObject:le.PartialUpdateObjectNoCreate;return Tt(t)(e,u,i)}},Yt=function(t){return function(e,i){var u=i||{},s=u.safe,c=u.autoGenerateObjectIDIfNotExist,f=u.batchSize,l=n(u,[\"safe\",\"autoGenerateObjectIDIfNotExist\",\"batchSize\"]),p=function(e,r,n,a){return d(t.transporter.write({method:x,path:h(\"1/indexes/%s/operation\",e),data:{operation:n,destination:r}},a),(function(e,r){return de(t)(e.taskID,r)}))},m=Math.random().toString(36).substring(7),y=\"\".concat(t.indexName,\"_tmp_\").concat(m),g=ee({appId:t.appId,transporter:t.transporter,indexName:y}),v=[],b=p(t.indexName,y,\"copy\",r(r({},l),{},{scope:[\"settings\",\"synonyms\",\"rules\"]}));return v.push(b),d((s?b.wait(l):b).then((function(){var t=g(e,r(r({},l),{},{autoGenerateObjectIDIfNotExist:c,batchSize:f}));return v.push(t),s?t.wait(l):t})).then((function(){var e=p(y,t.indexName,\"move\",l);return v.push(e),s?e.wait(l):e})).then((function(){return Promise.all(v)})).then((function(t){var e=a(t,3),r=e[0],n=e[1],i=e[2];return{objectIDs:n.objectIDs,taskIDs:[r.taskID].concat(o(n.taskIDs),[i.taskID])}})),(function(t,e){return Promise.all(v.map((function(t){return t.wait(e)})))}))}},Zt=function(t){return function(e,n){return ne(t)(e,r(r({},n),{},{clearExistingRules:!0}))}},$t=function(t){return function(e,n){return oe(t)(e,r(r({},n),{},{clearExistingSynonyms:!0}))}},te=function(t){return function(e,r){return d(ee(t)([e],r).then((function(t){return{objectID:t.objectIDs[0],taskID:t.taskIDs[0]}})),(function(e,r){return de(t)(e.taskID,r)}))}},ee=function(t){return function(e,r){var a=r||{},o=a.autoGenerateObjectIDIfNotExist,i=n(a,[\"autoGenerateObjectIDIfNotExist\"]),u=o?le.AddObject:le.UpdateObject;if(u===le.UpdateObject){var s=!0,c=!1,f=void 0;try{for(var l,p=e[Symbol.iterator]();!(s=(l=p.next()).done);s=!0){if(void 0===l.value.objectID)return d(Promise.reject({name:\"MissingObjectIDError\",message:\"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option.\"}))}}catch(t){c=!0,f=t}finally{try{s||null==p.return||p.return()}finally{if(c)throw f}}}return Tt(t)(e,u,i)}},re=function(t){return function(e,r){return ne(t)([e],r)}},ne=function(t){return function(e,r){var a=r||{},o=a.forwardToReplicas,i=a.clearExistingRules,u=y(n(a,[\"forwardToReplicas\",\"clearExistingRules\"]));return o&&(u.queryParameters.forwardToReplicas=1),i&&(u.queryParameters.clearExistingRules=1),d(t.transporter.write({method:x,path:h(\"1/indexes/%s/rules/batch\",t.indexName),data:e},u),(function(e,r){return de(t)(e.taskID,r)}))}},ae=function(t){return function(e,r){return oe(t)([e],r)}},oe=function(t){return function(e,r){var a=r||{},o=a.forwardToReplicas,i=a.clearExistingSynonyms,u=a.replaceExistingSynonyms,s=y(n(a,[\"forwardToReplicas\",\"clearExistingSynonyms\",\"replaceExistingSynonyms\"]));return o&&(s.queryParameters.forwardToReplicas=1),(u||i)&&(s.queryParameters.replaceExistingSynonyms=1),d(t.transporter.write({method:x,path:h(\"1/indexes/%s/synonyms/batch\",t.indexName),data:e},s),(function(e,r){return de(t)(e.taskID,r)}))}},ie=function(t){return function(e,r){return t.transporter.read({method:x,path:h(\"1/indexes/%s/query\",t.indexName),data:{query:e},cacheable:!0},r)}},ue=function(t){return function(e,r,n){return t.transporter.read({method:x,path:h(\"1/indexes/%s/facets/%s/query\",t.indexName,e),data:{facetQuery:r},cacheable:!0},n)}},se=function(t){return function(e,r){return t.transporter.read({method:x,path:h(\"1/indexes/%s/rules/search\",t.indexName),data:{query:e}},r)}},ce=function(t){return function(e,r){return t.transporter.read({method:x,path:h(\"1/indexes/%s/synonyms/search\",t.indexName),data:{query:e}},r)}},fe=function(t){return function(e,r){var a=r||{},o=a.forwardToReplicas,i=y(n(a,[\"forwardToReplicas\"]));return o&&(i.queryParameters.forwardToReplicas=1),d(t.transporter.write({method:D,path:h(\"1/indexes/%s/settings\",t.indexName),data:e},i),(function(e,r){return de(t)(e.taskID,r)}))}},de=function(t){return function(e,r){return f((function(n){return function(t){return function(e,r){return t.transporter.read({method:j,path:h(\"1/indexes/%s/task/%s\",t.indexName,e.toString())},r)}}(t)(e,r).then((function(t){return\"published\"!==t.status?n():void 0}))}))}},le={AddObject:\"addObject\",UpdateObject:\"updateObject\",PartialUpdateObject:\"partialUpdateObject\",PartialUpdateObjectNoCreate:\"partialUpdateObjectNoCreate\",DeleteObject:\"deleteObject\",DeleteIndex:\"delete\",ClearIndex:\"clear\"},pe={Settings:\"settings\",Synonyms:\"synonyms\",Rules:\"rules\"},he=1,me=2,ye=3;function ge(t,e,n){var a,o={appId:t,apiKey:e,timeouts:{connect:1,read:2,write:30},requester:{send:function(t){return new Promise((function(e){var r=new XMLHttpRequest;r.open(t.method,t.url,!0),Object.keys(t.headers).forEach((function(e){return r.setRequestHeader(e,t.headers[e])}));var n,a=function(t,n){return setTimeout((function(){r.abort(),e({status:0,content:n,isTimedOut:!0})}),1e3*t)},o=a(t.connectTimeout,\"Connection timeout\");r.onreadystatechange=function(){r.readyState>r.OPENED&&void 0===n&&(clearTimeout(o),n=a(t.responseTimeout,\"Socket timeout\"))},r.onerror=function(){0===r.status&&(clearTimeout(o),clearTimeout(n),e({content:r.responseText||\"Network request failed\",status:r.status,isTimedOut:!1}))},r.onload=function(){clearTimeout(o),clearTimeout(n),e({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(t.data)}))}},logger:(a=ye,{debug:function(t,e){return he>=a&&console.debug(t,e),Promise.resolve()},info:function(t,e){return me>=a&&console.info(t,e),Promise.resolve()},error:function(t,e){return console.error(t,e),Promise.resolve()}}),responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:u({caches:[i({key:\"\".concat(\"4.18.0\",\"-\").concat(t)}),s()]}),userAgent:T(\"4.18.0\").add({segment:\"Browser\"})},f=r(r({},o),n),d=function(){return function(t){return function(t){var e=t.region||\"us\",n=c(m.WithinHeaders,t.appId,t.apiKey),a=k(r(r({hosts:[{url:\"personalization.\".concat(e,\".algolia.com\")}]},t),{},{headers:r(r(r({},n.headers()),{\"content-type\":\"application/json\"}),t.headers),queryParameters:r(r({},n.queryParameters()),t.queryParameters)}));return p({appId:t.appId,transporter:a},t.methods)}(r(r(r({},o),t),{},{methods:{getPersonalizationStrategy:H,setPersonalizationStrategy:M}}))}};return function(t){var e=t.appId,n=c(void 0!==t.authMode?t.authMode:m.WithinHeaders,e,t.apiKey),a=k(r(r({hosts:[{url:\"\".concat(e,\"-dsn.algolia.net\"),accept:g.Read},{url:\"\".concat(e,\".algolia.net\"),accept:g.Write}].concat(l([{url:\"\".concat(e,\"-1.algolianet.com\")},{url:\"\".concat(e,\"-2.algolianet.com\")},{url:\"\".concat(e,\"-3.algolianet.com\")}]))},t),{},{headers:r(r(r({},n.headers()),{\"content-type\":\"application/x-www-form-urlencoded\"}),t.headers),queryParameters:r(r({},n.queryParameters()),t.queryParameters)}));return p({transporter:a,appId:e,addAlgoliaAgent:function(t,e){a.userAgent.add({segment:t,version:e})},clearCache:function(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then((function(){}))}},t.methods)}(r(r({},f),{},{methods:{search:mt,searchForFacetValues:yt,multipleBatch:pt,multipleGetObjects:ht,multipleQueries:mt,copyIndex:L,copySettings:_,copySynonyms:X,copyRules:V,moveIndex:lt,listIndices:ft,getLogs:nt,listClusters:ct,multipleSearchForFacetValues:yt,getApiKey:tt,addApiKey:W,listApiKeys:st,updateApiKey:jt,deleteApiKey:Z,restoreApiKey:bt,assignUserID:B,assignUserIDs:Q,getUserID:ot,searchUserIDs:wt,listUserIDs:dt,getTopUserIDs:at,removeUserID:gt,hasPendingMappings:it,clearDictionaryEntries:G,deleteDictionaryEntries:$,getDictionarySettings:rt,getAppTask:et,replaceDictionaryEntries:vt,saveDictionaryEntries:Ot,searchDictionaryEntries:Pt,setDictionarySettings:It,waitAppTask:xt,customRequest:Y,initIndex:function(t){return function(e){return ut(t)(e,{methods:{batch:Dt,delete:Ct,findAnswers:Mt,getObject:Wt,getObjects:Qt,saveObject:te,saveObjects:ee,search:ie,searchForFacetValues:ue,waitTask:de,setSettings:fe,getSettings:Lt,partialUpdateObject:_t,partialUpdateObjects:Xt,deleteObject:Ut,deleteObjects:zt,deleteBy:At,clearObjects:Nt,browseObjects:qt,getObjectPosition:Bt,findObject:Kt,exists:Ht,saveSynonym:ae,saveSynonyms:oe,getSynonym:Vt,searchSynonyms:ce,browseSynonyms:kt,deleteSynonym:Ft,clearSynonyms:Rt,replaceAllObjects:Yt,replaceAllSynonyms:$t,searchRules:se,getRule:Gt,deleteRule:Jt,saveRule:re,saveRules:ne,replaceAllRules:Zt,browseRules:St,clearRules:Et}})}},initAnalytics:function(){return function(t){return function(t){var e=t.region||\"us\",n=c(m.WithinHeaders,t.appId,t.apiKey),a=k(r(r({hosts:[{url:\"analytics.\".concat(e,\".algolia.com\")}]},t),{},{headers:r(r(r({},n.headers()),{\"content-type\":\"application/json\"}),t.headers),queryParameters:r(r({},n.queryParameters()),t.queryParameters)}));return p({appId:t.appId,transporter:a},t.methods)}(r(r(r({},o),t),{},{methods:{addABTest:C,getABTest:z,getABTests:J,stopABTest:F,deleteABTest:U}}))}},initPersonalization:d,initRecommendation:function(){return function(t){return f.logger.info(\"The `initRecommendation` method is deprecated. Use `initPersonalization` instead.\"),d()(t)}}}}))}return ge.version=\"4.18.0\",ge}));\n"
  },
  {
    "path": "js/algoliasearch/index.d.ts",
    "content": "/* eslint-disable import/no-unresolved*/\nexport * from './dist/algoliasearch';\nexport { default } from './dist/algoliasearch';\n"
  },
  {
    "path": "js/algoliasearch/index.js",
    "content": "/* eslint-disable functional/immutable-data, import/no-commonjs */\nconst algoliasearch = require('./dist/algoliasearch.cjs.js');\n\n/**\n * The Common JS build is the default entry point for the Node environment. Keep in\n * in mind, that for the browser environment, we hint the bundler to use the UMD\n * build instead as specified on the key `browser` of our `package.json` file.\n */\nmodule.exports = algoliasearch;\n\n/**\n * In addition, we also set explicitly the default export below making\n * this Common JS module in compliance with es6 modules specification.\n */\nmodule.exports.default = algoliasearch;\n"
  },
  {
    "path": "js/algoliasearch/lite.d.ts",
    "content": "/* eslint-disable import/no-unresolved*/\nexport * from './dist/algoliasearch-lite';\nexport { default } from './dist/algoliasearch-lite';\n"
  },
  {
    "path": "js/algoliasearch/lite.js",
    "content": "// eslint-disable-next-line functional/immutable-data, import/no-commonjs\nmodule.exports = require('./index');\n"
  },
  {
    "path": "js/algoliasearch/package.json",
    "content": "{\n  \"_from\": \"algoliasearch@^4.18.0\",\n  \"_id\": \"algoliasearch@4.18.0\",\n  \"_inBundle\": false,\n  \"_integrity\": \"sha512-pCuVxC1SVcpc08ENH32T4sLKSyzoU7TkRIDBMwSLfIiW+fq4znOmWDkAygHZ6pRcO9I1UJdqlfgnV7TRj+MXrA==\",\n  \"_location\": \"/algoliasearch\",\n  \"_phantomChildren\": {},\n  \"_requested\": {\n    \"type\": \"range\",\n    \"registry\": true,\n    \"raw\": \"algoliasearch@^4.18.0\",\n    \"name\": \"algoliasearch\",\n    \"escapedName\": \"algoliasearch\",\n    \"rawSpec\": \"^4.18.0\",\n    \"saveSpec\": null,\n    \"fetchSpec\": \"^4.18.0\"\n  },\n  \"_requiredBy\": [\n    \"#USER\"\n  ],\n  \"_resolved\": \"https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.18.0.tgz\",\n  \"_shasum\": \"1183ad0384a5b2c14f381c3a361da611acc8edb3\",\n  \"_spec\": \"algoliasearch@^4.18.0\",\n  \"_where\": \"/Users/asharirfan/code/wp-algolia/app/public/wp-content/plugins/wp-search-with-algolia-dev\",\n  \"browser\": {\n    \"./index.js\": \"./dist/algoliasearch.umd.js\",\n    \"./lite.js\": \"./dist/algoliasearch-lite.umd.js\"\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/algolia/algoliasearch-client-javascript/issues\"\n  },\n  \"bundleDependencies\": false,\n  \"dependencies\": {\n    \"@algolia/cache-browser-local-storage\": \"4.18.0\",\n    \"@algolia/cache-common\": \"4.18.0\",\n    \"@algolia/cache-in-memory\": \"4.18.0\",\n    \"@algolia/client-account\": \"4.18.0\",\n    \"@algolia/client-analytics\": \"4.18.0\",\n    \"@algolia/client-common\": \"4.18.0\",\n    \"@algolia/client-personalization\": \"4.18.0\",\n    \"@algolia/client-search\": \"4.18.0\",\n    \"@algolia/logger-common\": \"4.18.0\",\n    \"@algolia/logger-console\": \"4.18.0\",\n    \"@algolia/requester-browser-xhr\": \"4.18.0\",\n    \"@algolia/requester-common\": \"4.18.0\",\n    \"@algolia/requester-node-http\": \"4.18.0\",\n    \"@algolia/transporter\": \"4.18.0\"\n  },\n  \"deprecated\": false,\n  \"description\": \"A fully-featured and blazing-fast JavaScript API client to interact with Algolia API.\",\n  \"files\": [\n    \"dist\",\n    \"index.js\",\n    \"index.d.ts\",\n    \"lite.js\",\n    \"lite.d.ts\"\n  ],\n  \"homepage\": \"https://github.com/algolia/algoliasearch-client-javascript#readme\",\n  \"jsdelivr\": \"./dist/algoliasearch.umd.js\",\n  \"license\": \"MIT\",\n  \"main\": \"index.js\",\n  \"name\": \"algoliasearch\",\n  \"private\": false,\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/algolia/algoliasearch-client-javascript.git\"\n  },\n  \"sideEffects\": false,\n  \"types\": \"index.d.ts\",\n  \"unpkg\": \"./dist/algoliasearch.umd.js\",\n  \"version\": \"4.18.0\"\n}\n"
  },
  {
    "path": "js/autocomplete-noconflict.js",
    "content": "window.algoliaAutocomplete = autocomplete.noConflict();\n"
  },
  {
    "path": "js/autocomplete.js/CHANGELOG.md",
    "content": "<a name=\"0.38.1\"></a>\n## [0.38.1](https://github.com/algolia/autocomplete.js/compare/v0.38.0...v0.38.1) (2021-12-13)\n\n\n\n<a name=\"0.38.0\"></a>\n# [0.38.0](https://github.com/algolia/autocomplete.js/compare/v0.37.1...v0.38.0) (2020-09-17)\n\n\n### Features\n\n* **hits:** support multi-index search  ([#320](https://github.com/algolia/autocomplete.js/issues/320)) ([6bb85ae](https://github.com/algolia/autocomplete.js/commit/6bb85ae))\n\n\n\n<a name=\"0.37.1\"></a>\n## [0.37.1](https://github.com/algolia/autocomplete.js/compare/v0.37.0...v0.37.1) (2020-01-27)\n\n\n### Bug Fixes\n\n* **algolia:** parse user agents with new search clients ([#302](https://github.com/algolia/autocomplete.js/issues/302)) ([2f32ffb](https://github.com/algolia/autocomplete.js/commit/2f32ffb))\n* **zepto:** catch exceptions while assigning ([#298](https://github.com/algolia/autocomplete.js/issues/298)) ([652bde4](https://github.com/algolia/autocomplete.js/commit/652bde4))\n\n\n\n<a name=\"0.37.0\"></a>\n# [0.37.0](https://github.com/algolia/autocomplete.js/compare/v0.36.0...v0.37.0) (2019-08-30)\n\n\n### Bug Fixes\n\n* **clear:** Avoid error when clear is called after destroy ([#287](https://github.com/algolia/autocomplete.js/issues/287)) ([244425d](https://github.com/algolia/autocomplete.js/commit/244425d))\n\n\n\n<a name=\"0.36.0\"></a>\n# [0.36.0](https://github.com/algolia/autocomplete.js/compare/v0.35.0...v0.36.0) (2019-02-21)\n\n\n### Bug Fixes\n\n* **standalone:** use aria label from input ([#276](https://github.com/algolia/autocomplete.js/issues/276)) ([4b94466](https://github.com/algolia/autocomplete.js/commit/4b94466))\n\n\n\n<a name=\"0.35.0\"></a>\n# [0.35.0](https://github.com/algolia/autocomplete.js/compare/v0.34.0...v0.35.0) (2018-12-17)\n\n\n### Bug Fixes\n\n* **chrome-only:** Change autocomplete from 'nope' to 'off' ([#273](https://github.com/algolia/autocomplete.js/issues/273)) ([892a8f0](https://github.com/algolia/autocomplete.js/commit/892a8f0))\n* **utils:** correct _.every method ([#274](https://github.com/algolia/autocomplete.js/issues/274)) ([55af1e3](https://github.com/algolia/autocomplete.js/commit/55af1e3))\n\n\n\n<a name=\"0.34.0\"></a>\n# [0.34.0](https://github.com/algolia/autocomplete.js/compare/v0.33.0...v0.34.0) (2018-12-04)\n\n\n### Features\n\n* change autocomplete from 'off' to 'nope' ([#250](https://github.com/algolia/autocomplete.js/issues/250)) ([fbbed04](https://github.com/algolia/autocomplete.js/commit/fbbed04))\n\n\n\n<a name=\"0.33.0\"></a>\n# [0.33.0](https://github.com/algolia/autocomplete.js/compare/v0.32.0...v0.33.0) (2018-11-19)\n\n\n### Bug Fixes\n\n* **release:** Update mversion to 1.12 ([#268](https://github.com/algolia/autocomplete.js/issues/268)) ([08b8e30](https://github.com/algolia/autocomplete.js/commit/08b8e30))\n\n\n### Features\n\n* **selected:** Adding context.selectionMethod to selected event ([#267](https://github.com/algolia/autocomplete.js/issues/267)) ([36028a6](https://github.com/algolia/autocomplete.js/commit/36028a6))\n\n\n\n<a name=\"0.32.0\"></a>\n# [0.32.0](https://github.com/algolia/autocomplete.js/compare/v0.31.0...v0.32.0) (2018-11-06)\n\n\n### Bug Fixes\n\n* **zepto:** apply patch to prevent an error ([#263](https://github.com/algolia/autocomplete.js/issues/263)) ([917d5a7](https://github.com/algolia/autocomplete.js/commit/917d5a7))\n\n\n### Features\n\n* **source:** add cache disabling for datasets ([#254](https://github.com/algolia/autocomplete.js/issues/254)) ([0e65fee](https://github.com/algolia/autocomplete.js/commit/0e65fee))\n* add flag for toggling tab autocompletion ([#260](https://github.com/algolia/autocomplete.js/issues/260)) ([4dc7c52](https://github.com/algolia/autocomplete.js/commit/4dc7c52))\n* Throw err on update if suggestions are invalid type ([#256](https://github.com/algolia/autocomplete.js/issues/256)) ([179febf](https://github.com/algolia/autocomplete.js/commit/179febf)), closes [#131](https://github.com/algolia/autocomplete.js/issues/131)\n\n\n\n<a name=\"0.31.0\"></a>\n# [0.31.0](https://github.com/algolia/autocomplete.js/compare/v0.30.0...v0.31.0) (2018-08-08)\n\n\n### Bug Fixes\n\n* **dataset:** avoid to call the source when upadte is canceled ([a47696d](https://github.com/algolia/autocomplete.js/commit/a47696d))\n* **dataset:** avoid usage of callNow for debounce ([1a0ce74](https://github.com/algolia/autocomplete.js/commit/1a0ce74))\n* Handle an odd case with the user agent ([#242](https://github.com/algolia/autocomplete.js/issues/242)) ([c194736](https://github.com/algolia/autocomplete.js/commit/c194736))\n\n\n### Features\n\n* update dist files ([9babf2e](https://github.com/algolia/autocomplete.js/commit/9babf2e))\n* **clearOnSelected:** allow users to clear the input instead of filling ([#244](https://github.com/algolia/autocomplete.js/issues/244)) ([aa2edbb](https://github.com/algolia/autocomplete.js/commit/aa2edbb)), closes [#241](https://github.com/algolia/autocomplete.js/issues/241)\n\n\n\n<a name=\"0.30.0\"></a>\n# [0.30.0](https://github.com/algolia/autocomplete.js/compare/v0.29.0...v0.30.0) (2018-04-30)\n\n\n\n<a name=\"0.29.0\"></a>\n# [0.29.0](https://github.com/algolia/autocomplete.js/compare/v0.28.3...v0.29.0) (2017-10-12)\n\n\n### Features\n\n* **a11y:** Add ariaLabel option. ([6db8e1b](https://github.com/algolia/autocomplete.js/commit/6db8e1b))\n* **a11y:** Add option to control `aria-labelledby` attribute. ([0491c43](https://github.com/algolia/autocomplete.js/commit/0491c43))\n\n\n\n<a name=\"0.28.3\"></a>\n## [0.28.3](https://github.com/algolia/autocomplete.js/compare/v0.28.2...v0.28.3) (2017-07-31)\n\n\n\n<a name=\"0.28.2\"></a>\n## [0.28.2](https://github.com/algolia/autocomplete.js/compare/v0.28.1...v0.28.2) (2017-06-22)\n\n\n### Bug Fixes\n\n* **empty template:** hide main empty template as long as we have results ([344e225](https://github.com/algolia/autocomplete.js/commit/344e225)), closes [#185](https://github.com/algolia/autocomplete.js/issues/185)\n\n\n\n<a name=\"0.28.1\"></a>\n## [0.28.1](https://github.com/algolia/autocomplete.js/compare/v0.28.0...v0.28.1) (2017-03-29)\n\n\n### Bug Fixes\n\n* **iOS:** remove double tap bug on hrefs in suggestions ([e532bd8](https://github.com/algolia/autocomplete.js/commit/e532bd8))\n\n\n\n<a name=\"0.28.0\"></a>\n# [0.28.0](https://github.com/algolia/autocomplete.js/compare/v0.27.0...v0.28.0) (2017-03-24)\n\n\n\n<a name=\"0.27.0\"></a>\n# [0.27.0](https://github.com/algolia/autocomplete.js/compare/v0.26.0...v0.27.0) (2017-03-06)\n\n\n### Bug Fixes\n\n* **UA:** add failsafe if params not provided ([30df97a](https://github.com/algolia/autocomplete.js/commit/30df97a)), closes [#166](https://github.com/algolia/autocomplete.js/issues/166)\n\n\n\n<a name=\"0.26.0\"></a>\n# [0.26.0](https://github.com/algolia/autocomplete.js/compare/v0.25.0...v0.26.0) (2017-02-28)\n\n\n### Bug Fixes\n\n* **test:** bad handling of no actual inner mechanics of client ([622aec5](https://github.com/algolia/autocomplete.js/commit/622aec5))\n\n\n### Features\n\n* **algolia agent:** provide an algolia agent when searching ([6ca7ac2](https://github.com/algolia/autocomplete.js/commit/6ca7ac2))\n* **algolia agent:** provide an algolia agent when searching ([ef604e1](https://github.com/algolia/autocomplete.js/commit/ef604e1))\n\n\n\n<a name=\"0.25.0\"></a>\n# [0.25.0](https://github.com/algolia/autocomplete.js/compare/v0.24.2...v0.25.0) (2017-02-07)\n\n\n### Bug Fixes\n\n* **zepto:** .is() only accepts selectors, reworked code to use pure DOM ([a47a4d4](https://github.com/algolia/autocomplete.js/commit/a47a4d4)), closes [#144](https://github.com/algolia/autocomplete.js/issues/144)\n\n\n\n<a name=\"0.24.2\"></a>\n## [0.24.2](https://github.com/algolia/autocomplete.js/compare/v0.24.1...v0.24.2) (2017-01-20)\n\n\n### Bug Fixes\n\n* **dep:** immediate is a dependency, not a devDependency ([22164ad](https://github.com/algolia/autocomplete.js/commit/22164ad))\n\n\n\n<a name=\"0.24.1\"></a>\n## [0.24.1](https://github.com/algolia/autocomplete.js/compare/v0.24.0...v0.24.1) (2017-01-20)\n\n\n### Bug Fixes\n\n* **postMessage:** avoid using postMessage when feasible ([a99f664](https://github.com/algolia/autocomplete.js/commit/a99f664)), closes [#142](https://github.com/algolia/autocomplete.js/issues/142)\n\n\n\n<a name=\"0.24.0\"></a>\n# [0.24.0](https://github.com/algolia/autocomplete.js/compare/0.23.0...v0.24.0) (2017-01-10)\n\n\n### Bug Fixes\n\n* **angular:** do not launch the directive if autocomplete has a value ([f96a1ba](https://github.com/algolia/autocomplete.js/commit/f96a1ba)), closes [#136](https://github.com/algolia/autocomplete.js/issues/136)\n* **typeahead:** propagate redrawn ([82293e4](https://github.com/algolia/autocomplete.js/commit/82293e4))\n\n\n### Features\n\n* **appendTo:** new parameter ([e40cbd0](https://github.com/algolia/autocomplete.js/commit/e40cbd0))\n\n\n\n\n\n\n\n\n\n### 0.23.0 Dec 14, 2016\n\n* feat(build): add noConflict() for standalone build, fixes #133\n\n### 0.22.1 Nov 07, 2016\n\n* Fixes bad behavior when `autoselectOnBlur` used, fixes #113\n\n### 0.22.0 Oct 25, 2016\n\n* Add `autocomplete:cursorremoved` event, see #105\n* Add `autoselectOnBlur` option, fixes #113\n\n### 0.21.8 Oct 3, 2016\n\n* Do not allow Zepto to leak to window. Never.\n\n### 0.21.7 Sep 21, 2016\n\n* Ensure the `empty` templates get displayed before the `footer`.\n* Ensure the dataset `empty` templates are displayed when all datasets are empty.\n\n### 0.21.6 Sep 20, 2016\n\n* Make sure we don't leak/override `window.Zepto`.\n\n### 0.21.5 Sep 15, 2016\n\n* While selecting the top suggestion (autoselect=true), do not update the input.\n\n### 0.21.4 Sep 2, 2016\n\n* Ensure the cursor selects the first suggestion when the dropdown is shown + send the `cursorchanged` event.\n\n### 0.21.3 Aug 1, 2016\n\n* Ensure empty template displays from first keystroke (#104)\n\n### 0.21.2 July 26, 2016\n\n* fix(empty): fix the empty even handling, fixes #95\n\n### 0.21.1 July 19, 2016\n\n* fix(getVal): fix getVal on standalone build\n\n### 0.21.0 July 15, 2016\n\n* Upgrade to zepto 1.2.0\n\n### 0.20.1 June 14, 2016\n\n* Ensure the dropdown menu is hidden when there is an `$empty` block and blank query.\n\n### 0.20.0 June 04, 2016\n\n* Ensure we don't update the input value on mouseenter (#76)\n* Render an `empty` template if no results (#80)\n\n### 0.19.1 May 04, 2016\n\n* Fixed the angular build (_.Event was undefined)\n\n### 0.19.0 Apr 25, 2016\n\n* Allow select handler to prevent menu from being closed (#72)\n* Do not trigger the cursorchanged event while entering/leaving nested divs (#71)\n\n### 0.18.0 Apr 07, 2016\n\n* Ability to customize the CSS classes used to render the DOM\n* Ensure the `autocomplete:cursorchanged` event is called on `mouseover` as well\n\n### 0.17.3 Apr 04, 2016\n\n* Standalone: ensure we actually use the Zepto object and not whatever is in `window.$`\n\n### 0.17.2 Mar 21, 2016\n\n* Ability to setup the autocomplete on a multi-inputs Zepto selector\n* Propagate the `shown` event to the top-level\n\n### 0.17.1 Mar 19, 2016\n\n* REVERT [Ability to setup the autocomplete on a multi-inputs Zepto selector] Fix #59\n\n### 0.17.0 Mar 18, 2016\n\n* Ability to setup the autocomplete on a multi-inputs Zepto selector\n* Add a new `shown` event triggered when the dropdown menu is opened and non-empty\n\nBREAKING CHANGE: the standalone object returned by the `autocomplete()` method is now a Zepto object.\n\n### 0.16.2 Jan 22, 2016\n\n* stop using weird zepto package. Stop using chained .data calls\n  it seems that chaining them ended up in an `undefined` return value when passing `undefined` as a value\n\n### 0.16.1 Jan 22, 2016\n\n* remove npm-zepto, use zepto original package (now on npm) fixes #48\n\n### 0.16.0 Dec 11, 2015\n\n* Emit a new `autocomplete:updated` event as soon as a dataset is rendered\n\n### 0.15.0 Dec 10, 2015\n\n* Ability to configure the dropdown menu container\n\n### 0.14.1 Dec 2, 2015\n\n* Move Zepto as a dependency (not a peer dep)\n* Really use the `query` instead of the `displayKey` (was supposed to be fixed in 0.11.0)\n\n### 0.14.0 Nov 28, 2015\n\n* Move npm-zepto & angular to peerDependencies\n* Fixed custom dropdownMenu's footer & header not being displayed properly\n* Allow dataset with name=0\n\n### 0.13.1 Nov 25, 2015\n\n* Move the bower release name to `algolia-autocomplete.js` since `autocomplete.js` is already used\n\n### 0.13.0 Nov 25, 2015\n\n* Add Bower release\n\n### 0.12.0 Oct 15, 2015\n\n* Expose the underlying `close`, `open`, ... functions in the standalone build.\n\n### 0.11.1 Oct 13, 2015\n\n* Zepto doesn't work like jQuery regarding the `data` API, it doesn't support serializing objects.\n\n### 0.11.0 Oct 07, 2015\n\n* If the `displayKey` is not specified and the `value` attribute missing, don't update the input value with `undefined`.\n* Expose the `sources` object in the Angular.js build as well.\n\n### 0.10.0 Oct 06, 2015\n\n* Add a new `includeAll` option to the `popularIn` source to add an extra suggestion.\n\n### 0.9.0 Oct 01, 2015\n\n* Full CommonJS compliance (moved from browserify to webpack)\n\n### 0.8.0 Sep 24, 2015\n\n* UMD compliance\n\n### 0.7.0 Sep 16, 2015\n\n* New standalone build (including Zepto.js)\n* Get rid of lodash-compat and use jQuery, Zepto or Angular.js's helper functions\n\n### 0.6.0 Sep 11, 2015\n\n* Add Zepto.js support.\n\n### 0.5.0 Sep 9, 2015\n\n* The wrapper span will now have a `table-cell` display if the original input was a `block` inside a `table`.\n\n### 0.4.0 Aug 12, 2015\n\n* Add a new `openOnFocus` option to open the dropdown menu when the input is focused\n\n### 0.3.0 July 27, 2015\n\n* Add Angular.js support [#7]\n\n### 0.2.0 July 16, 2015\n\n* Ability to change the layout based on the matching datasets [#11]\n\n### 0.1.0 July 13, 2015\n\n* Start using semantic versioning\n\n### 0.0.2 July 13, 2015\n\n* Ability to keep the dropdown menu opened when the input if blurred [#1]\n* Ability to use a custom dropdown menu template [#2]\n* Ability to configure a custom header/footer on the dropdown menu [#3]\n\n### 0.0.1 July 12, 2015\n\n* First release based on Twitter's typeahead.js library\n* Travis-ci.org, Coveralls.io, Saucelabs.com integration\n* CommonJS compatibility\n"
  },
  {
    "path": "js/autocomplete.js/CONTRIBUTING.md",
    "content": "# Contributing to Autocomplete.js\n\nFirst of all, thanks for taking a look at contributing here 🎉 If you have any questions while contributing, feel free to open an issue or to send an email to <support@algolia.com> mentioning the PR or issue you're working on.\n\n## Development\n\nTo start developing, you can use the following commands:\n\n```sh\nyarn\nyarn dev\nopen http://localhost:8888/test/playground.html\n```\n\nLinting is done with [eslint](http://eslint.org/) and [Algolia's configuration](https://github.com/algolia/eslint-config-algolia) and can be run with:\n\n```sh\nyarn lint\n```\n\n## Tests\n\nUnit tests are written using [Jasmine](http://jasmine.github.io/) and ran with [Karma](http://karma-runner.github.io/). Integration tests are using [Mocha](http://mochajs.org/) and [Saucelabs](https://saucelabs.com/).\n\nTo run the unit tests suite run:\n\n```sh\nyarn test\n```\n\nTo run the integration tests suite run:\n\n```sh\nyarn build\nyarn server\nngrok 8888\nTEST_HOST=http://YOUR_NGROK_ID.ngrok.com SAUCE_ACCESS_KEY=YOUR_KEY SAUCE_USERNAME=YOUR_USERNAME./node_modules/mocha/bin/mocha --harmony -R spec ./test/integration/test.js\n```\n\n### Testing accessibility\n\nAutocomplete.js is accessible to screen readers, and here's how to test how most blind users will experience it:\n\n#### Steps\n\n1. Run `yarn dev` on your development machine\n1. Start the screen reader\n1. Open a browser to http://YOUR_IP:8888/test/playground.html\n1. Tab to the field\n1. Type a search query\n1. Use the arrow keys to navigate through the results\n\n✔ SUCCESS: results are read (not necessarily in sync with the visually selected cursor)  \n𐄂 FAIL: no text is read or the screen reader keeps reading the typed query\n\n#### Recommended testing platforms\n\n- VoiceOver (CMD+F5 in macOS): Safari, Chrome\n- [JAWS](http://www.freedomscientific.com/Products/Blindness/JAWS): IE11, Chrome (Windows 7 VM available at [modern.ie](https://modern.ie))\n- [NVDA](http://www.nvaccess.org/): IE11, Chrome (Windows 8.1 VM available at [modern.ie](https://modern.ie))\n\n#### Tips\n\n- All screen readers work slightly differently - which makes making accessible pages tricky.\n- Don't worry if the usability isn't 100% perfect, but make sure the functionality is there.\n\n## Release\n\nDecide if this is a patch, minor or major release, have a look at [semver.org](http://semver.org/).\n\n```sh\nnpm run release [major|minor|patch|x.x.x]\n```\n"
  },
  {
    "path": "js/autocomplete.js/Gruntfile.js",
    "content": "'use strict';\n\nmodule.exports = function(grunt) {\n  grunt.initConfig({\n    version: grunt.file.readJSON('package.json').version,\n\n    buildDir: 'dist',\n\n    banner: [\n      '/*!',\n      ' * autocomplete.js <%= version %>',\n      ' * https://github.com/algolia/autocomplete.js',\n      ' * Copyright <%= grunt.template.today(\"yyyy\") %> Algolia, Inc. and other contributors; Licensed MIT',\n      ' */'\n    ].join('\\n'),\n\n    usebanner: {\n      all: {\n        options: {\n          position: 'top',\n          banner: '<%= banner %>',\n          linebreak: true\n        },\n        files: {\n          src: ['dist/*.js']\n        }\n      }\n    },\n\n    uglify: {\n      jquery: {\n        src: '<%= buildDir %>/autocomplete.jquery.js',\n        dest: '<%= buildDir %>/autocomplete.jquery.min.js'\n      },\n      angular: {\n        src: '<%= buildDir %>/autocomplete.angular.js',\n        dest: '<%= buildDir %>/autocomplete.angular.min.js'\n      },\n      standalone: {\n        src: '<%= buildDir %>/autocomplete.js',\n        dest: '<%= buildDir %>/autocomplete.min.js'\n      }\n    },\n\n    webpack: {\n      jquery: {\n        entry: './index_jquery.js',\n        output: {\n          path: '<%= buildDir %>',\n          filename: 'autocomplete.jquery.js'\n        },\n        externals: [{\n          jquery: 'jQuery'\n        }]\n      },\n      angular: {\n        entry: './index_angular.js',\n        output: {\n          path: '<%= buildDir %>',\n          filename: 'autocomplete.angular.js'\n        },\n        externals: ['angular']\n      },\n      standalone: {\n        entry: './index.js',\n        output: {\n          path: '<%= buildDir %>',\n          filename: 'autocomplete.js',\n          library: 'autocomplete',\n          libraryTarget: 'umd'\n        }\n      }\n    },\n\n    sed: {\n      version: {\n        pattern: '%VERSION%',\n        replacement: '<%= version %>',\n        recursive: true,\n        path: '<%= buildDir %>'\n      }\n    },\n\n    eslint: {\n      options: {\n        config: '.eslintrc'\n      },\n      src: ['src/**/*.js', 'Gruntfile.js']\n    },\n\n    watch: {\n      js: {\n        files: 'src/**/*.js',\n        tasks: 'build'\n      }\n    },\n\n    clean: {\n      dist: 'dist'\n    },\n\n    connect: {\n      server: {\n        options: {port: 8888, keepalive: true}\n      }\n    },\n\n    concurrent: {\n      options: {logConcurrentOutput: true},\n      dev: ['server', 'watch']\n    },\n\n    step: {\n      options: {\n        option: false\n      }\n    }\n  });\n\n  // aliases\n  // -------\n\n  grunt.registerTask('default', 'build');\n  grunt.registerTask('build', ['webpack', 'sed:version', 'uglify', 'usebanner']);\n  grunt.registerTask('server', 'connect:server');\n  grunt.registerTask('lint', 'eslint');\n  grunt.registerTask('dev', 'concurrent:dev');\n\n  // load tasks\n  // ----------\n\n  grunt.loadNpmTasks('grunt-sed');\n  grunt.loadNpmTasks('grunt-exec');\n  grunt.loadNpmTasks('grunt-step');\n  grunt.loadNpmTasks('grunt-banner');\n  grunt.loadNpmTasks('grunt-concurrent');\n  grunt.loadNpmTasks('grunt-contrib-watch');\n  grunt.loadNpmTasks('grunt-contrib-clean');\n  grunt.loadNpmTasks('grunt-contrib-uglify');\n  grunt.loadNpmTasks('grunt-contrib-concat');\n  grunt.loadNpmTasks('grunt-contrib-connect');\n  grunt.loadNpmTasks('grunt-eslint');\n  grunt.loadNpmTasks('grunt-webpack');\n};\n"
  },
  {
    "path": "js/autocomplete.js/LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2013 Algolia\nhttp://www.algolia.com/\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "js/autocomplete.js/README.md",
    "content": "> **⚠️ Deprecation notice**\n>\n> [Autocomplete.js (v0.x)](https://www.npmjs.com/package/autocomplete.js) is deprecated and no longer supported. Please use [Autocomplete](https://github.com/algolia/autocomplete#readme) instead.\n> To upgrade from v0.x, please follow our [upgrade guide](https://www.algolia.com/doc/ui-libraries/autocomplete/guides/upgrading/).\n\n# Autocomplete.js\n\n\nThis JavaScript library adds a fast and fully-featured auto-completion menu to your search box displaying results \"as you type\". It can easily be combined with Algolia's realtime search engine. The library is available as a jQuery plugin, an Angular.js directive or a standalone library.\n\n[![build status](https://travis-ci.org/algolia/algoliasearch-client-node.svg?branch=master)](http://travis-ci.org/algolia/autocomplete.js)\n[![NPM version](https://badge.fury.io/js/autocomplete.js.svg)](http://badge.fury.io/js/autocomplete.js)\n[![Coverage Status](https://coveralls.io/repos/algolia/autocomplete.js/badge.svg?branch=master)](https://coveralls.io/r/algolia/autocomplete.js?branch=master)\n[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/autocomplete.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/autocomplete.js)\n![jQuery](https://img.shields.io/badge/jQuery-OK-blue.svg)\n![Zepto.js](https://img.shields.io/badge/Zepto.js-OK-blue.svg)\n![Angular.js](https://img.shields.io/badge/Angular.js-OK-blue.svg)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n\n[![Browser tests](https://saucelabs.com/browser-matrix/opensauce-algolia.svg)](https://saucelabs.com/u/opensauce-algolia)\n\n## Table of Contents\n\n<!-- START doctoc generated TOC please keep comment here to allow auto update -->\n<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->\n\n\n- [Features](#features)\n- [Installation](#installation)\n  - [jsDelivr](#jsdelivr)\n  - [cdnjs](#cdnjs)\n  - [npm](#npm)\n  - [Bower](#bower)\n  - [Source dist/](#source-dist)\n  - [Browserify](#browserify)\n- [Usage](#usage)\n  - [Standalone](#standalone)\n  - [jQuery](#jquery)\n  - [Angular.JS](#angularjs)\n- [Look and Feel](#look-and-feel)\n- [Global Options](#global-options)\n- [Datasets](#datasets)\n- [Sources](#sources)\n  - [Hits](#hits)\n  - [PopularIn (aka \"xxxxx in yyyyy\")](#popularin-aka-xxxxx-in-yyyyy)\n  - [Custom source](#custom-source)\n- [Security](#security)\n  - [User-generated data: protecting against XSS](#user-generated-data-protecting-against-xss)\n- [FAQ](#faq)\n  - [How can I `Control`-click on results and have them open in a new tab?](#how-can-i-control-click-on-results-and-have-them-open-in-a-new-tab)\n- [Events](#events)\n- [API](#api)\n  - [jQuery](#jquery-1)\n  - [Standalone](#standalone-1)\n- [Contributing & releasing](#contributing--releasing)\n- [Credits](#credits)\n\n<!-- END doctoc generated TOC please keep comment here to allow auto update -->\n\n## Features\n\n* Displays suggestions to end-users as they type\n* Shows top suggestion as a hint (i.e. background text)\n* Supports custom templates to allow for UI flexibility\n* Works well with RTL languages and input method editors\n* Triggers custom events\n\n\n## Installation\n\nThe `autocomplete.js` library must be included **after** jQuery, Zepto or Angular.js (with jQuery). Else, it will use the embedded Zepto.\n\n### jsDelivr\n\n```html\n<script src=\"https://cdn.jsdelivr.net/autocomplete.js/0/autocomplete.min.js\"></script>\n<!-- OR -->\n<script src=\"https://cdn.jsdelivr.net/autocomplete.js/0/autocomplete.jquery.min.js\"></script>\n<!-- OR -->\n<script src=\"https://cdn.jsdelivr.net/autocomplete.js/0/autocomplete.angular.min.js\"></script>\n```\n\n### cdnjs\n\n```html\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/<VERSION>/autocomplete.min.js\"></script>\n<!-- OR -->\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/<VERSION>/autocomplete.jquery.min.js\"></script>\n<!-- OR -->\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/<VERSION>/autocomplete.angular.min.js\"></script>\n```\n\n### npm\n\n```sh\nnpm install --save autocomplete.js\n```\n\n### Bower\n\n```sh\nbower install algolia-autocomplete.js -S\n```\n\n### Source dist/\n\nYou can find the built version in [dist/](https://github.com/algolia/autocomplete.js/tree/master/dist).\n\n### Browserify\n\nYou can require it and use [Browserify](http://browserify.org/):\n\n```js\nvar autocomplete = require('autocomplete.js');\n```\n\n## Usage\n\n### Standalone\n\n 1. Include `autocomplete.min.js`\n 1. Initialize the auto-completion menu calling the `autocomplete` function\n\n **Warning**: `autocomplete.js` is not compatible with the latest version algoliasearch v4 out of the box, but you can create a compatibility source by yourself like this:\n\n```html\n<input type=\"text\" id=\"search-input\" placeholder=\"Search unicorns...\" />\n\n<!-- [ ... ] -->\n<script src=\"https://cdn.jsdelivr.net/npm/algoliasearch@4/dist/algoliasearch.umd.min.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/autocomplete.js/0/autocomplete.min.js\"></script>\n<script>\n  var client = algoliasearch('YourApplicationID', 'YourSearchOnlyAPIKey');\n  var index = client.initIndex('YourIndex');\n\n  function newHitsSource(index, params) {\n    return function doSearch(query, cb) {\n      index\n        .search(query, params)\n        .then(function(res) {\n          cb(res.hits, res);\n        })\n        .catch(function(err) {\n          console.error(err);\n          cb([]);\n        });\n    };\n  }\n\n  autocomplete('#search-input', { hint: false }, [\n    {\n      source: newHitsSource(index, { hitsPerPage: 5 }),\n      displayKey: 'my_attribute',\n      templates: {\n        suggestion: function(suggestion) {\n          return suggestion._highlightResult.my_attribute.value;\n        }\n      }\n    }\n  ]).on('autocomplete:selected', function(event, suggestion, dataset, context) {\n    console.log(event, suggestion, dataset, context);\n  });\n</script>\n```\n\n### jQuery\n\n 1. Include `autocomplete.jquery.min.js` after including `jQuery`\n 1. Initialize the auto-completion menu calling the `autocomplete` jQuery plugin\n \n **Warning**: `autocomplete.js` is not compatible with the latest version algoliasearch v4, therefore we highly recommend you use algoliasearch v3 as specified in the code snippet below.\n\n```html\n<input type=\"text\" id=\"search-input\" />\n\n<!-- [ ... ] -->\n<script src=\"https://cdn.jsdelivr.net/algoliasearch/3/algoliasearch.min.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/autocomplete.js/0/autocomplete.jquery.min.js\"></script>\n<script>\n  var client = algoliasearch('YourApplicationID', 'YourSearchOnlyAPIKey')\n  var index = client.initIndex('YourIndex');\n  $('#search-input').autocomplete({ hint: false }, [\n    {\n      source: $.fn.autocomplete.sources.hits(index, { hitsPerPage: 5 }),\n      displayKey: 'my_attribute',\n      templates: {\n        suggestion: function(suggestion) {\n          return suggestion._highlightResult.my_attribute.value;\n        }\n      }\n    }\n  ]).on('autocomplete:selected', function(event, suggestion, dataset, context) {\n    console.log(event, suggestion, dataset, context);\n  });\n</script>\n```\n\n### Angular.JS\n\n 1. Include `autocomplete.angular.min.js` after including `jQuery` & `Angular.js`\n 1. Inject the `algolia.autocomplete` module\n 1. Add the `autocomplete`, `aa-datasets` and the optional `aa-options` attribute to your search bar\n\n **Warning**: `autocomplete.js` is not compatible with the latest version algoliasearch v4, therefore we highly recommend you use algoliasearch v3 as specified in the code snippet below.\n\n```html\n<div ng-controller=\"yourController\">\n  <input type=\"text\" id=\"search-input\" autocomplete aa-datasets=\"getDatasets()\" />\n</div>\n\n<!-- [ include jQuery + Angular.js ] -->\n<script src=\"https://cdn.jsdelivr.net/algoliasearch/3/algoliasearch.angular.min.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/autocomplete.js/0/autocomplete.angular.min.js\"></script>\n<script>\n  angular.module('myApp', ['algoliasearch', 'algolia.autocomplete'])\n    .controller('yourController', ['$scope', 'algolia', function($scope, algolia) {\n      var client = algolia.Client('YourApplicationID', 'YourSearchOnlyAPIKey');\n      var index = client.initIndex('YourIndex');\n\n      $scope.getDatasets = function() {\n        return {\n          source: algolia.sources.hits(index, { hitsPerPage: 5 }),\n          displayKey: 'my_attribute',\n          templates: {\n            suggestion: function(suggestion) {\n              return suggestion._highlightResult.my_attribute.value;\n            }\n          }\n        };\n      };\n\n      $scope.$on('autocomplete:selected', function(event, suggestion, dataset) {\n        console.log(event, suggestion, dataset, context);\n      });\n    }]);\n</script>\n```\n\n**Note:** You need to rely on `jQuery`, the lite version embedded in Angular.js won't work.\n\n## Look and Feel\n\nBelow is a faux mustache template describing the DOM structure of an autocomplete\ndropdown menu. Keep in mind that `header`, `footer`, `suggestion`, and `empty`\ncome from the provided templates detailed [here](#datasets).\n\n```html\n<span class=\"aa-dropdown-menu{{#datasets}} aa-{{'with' or 'without'}}-{{name}}{{/datasets}}\">\n  {{#datasets}}\n    <div class=\"aa-dataset-{{name}}\">\n      {{{header}}}\n      <span class=\"aa-suggestions\">\n        {{#suggestions}}\n          <div class=\"aa-suggestion\">{{{suggestion}}}</div>\n        {{/suggestions}}\n        {{^suggestions}}\n          {{{empty}}}\n        {{/suggestions}}\n      </span>\n      {{{footer}}}\n    </div>\n  {{/datasets}}\n  {{empty}}\n</span>\n```\n\nWhen an end-user mouses or keys over a `.aa-suggestion`, the class `aa-cursor` will be added to it. You can use this class as a hook for styling the \"under cursor\" state of suggestions.\n\n\nAdd the following CSS rules to add a default style:\n\n```css\n.algolia-autocomplete {\n  width: 100%;\n}\n.algolia-autocomplete .aa-input, .algolia-autocomplete .aa-hint {\n  width: 100%;\n}\n.algolia-autocomplete .aa-hint {\n  color: #999;\n}\n.algolia-autocomplete .aa-dropdown-menu {\n  width: 100%;\n  background-color: #fff;\n  border: 1px solid #999;\n  border-top: none;\n}\n.algolia-autocomplete .aa-dropdown-menu .aa-suggestion {\n  cursor: pointer;\n  padding: 5px 4px;\n}\n.algolia-autocomplete .aa-dropdown-menu .aa-suggestion.aa-cursor {\n  background-color: #B2D7FF;\n}\n.algolia-autocomplete .aa-dropdown-menu .aa-suggestion em {\n  font-weight: bold;\n  font-style: normal;\n}\n```\n\nHere is what the [basic example](https://github.com/algolia/autocomplete.js/tree/master/examples) looks like:\n\n![Basic example](./examples/basic.gif)\n\n## Global Options\n\nWhen initializing an autocomplete, there are a number of global options you can configure.\n\n* `autoselect` – If `true`, the first rendered suggestion in the dropdown will automatically have the `cursor` class, and pressing `<ENTER>` will select it.\n\n* `autoselectOnBlur` – If `true`, when the input is blurred, the first rendered suggestion in the dropdown will automatically have the `cursor` class, and pressing `<ENTER>` will select it. This option should be used on mobile, see [#113](https://github.com/algolia/autocomplete.js/issues/113)\n\n* `tabAutocomplete` – If `true`, pressing tab will select the first rendered suggestion in the dropdown. Defaults to `true`.\n\n* `hint` – If `false`, the autocomplete will not show a hint. Defaults to `true`.\n\n* `debug` – If `true`, the autocomplete will not close on `blur`. Defaults to `false`.\n\n* `clearOnSelected` – If `true`, the autocomplete will empty the search box when a suggestion is selected. This is useful if you want to use this as a way to input tags using the `selected` event.\n\n* `openOnFocus` – If `true`, the dropdown menu will open when the input is focused. Defaults to `false`.\n\n* `appendTo` – If set with a DOM selector, doesn't wrap the input and appends the wrapper and dropdown menu to the first DOM element matching the selector. It automatically positions the wrapper under the input, and sets it to the same width as the input. Can't be used with `hint: true`, because `hint` requires the wrapper around the input.\n\n* `dropdownMenuContainer` – If set with a DOM selector, it overrides the container of the dropdown menu.\n\n* `templates` – An optional hash overriding the default templates.\n  * `dropdownMenu` – the dropdown menu template. The template should include all *dataset* placeholders.\n  * `header` – the header to prepend to the dropdown menu\n  * `footer` – the footer to append to the dropdown menu\n  * `empty` – the template to display when none of the datasets are returning results. The templating function\n    is called with a context containing the underlying `query`.\n\n* `cssClasses` – An optional hash overriding the default css classes.\n  * `root` – the root classes. Defaults to `algolia-autocomplete`.\n  * `prefix` – the CSS class prefix of all nested elements. Defaults to `aa`.\n  * `noPrefix` - set this to true if you wish to not use any prefix. Without this option, all nested elements classes will have a leading dash. Defaults to `false`.\n  * `dropdownMenu` – the dropdown menu CSS class. Defaults to `dropdown-menu`.\n  * `input` – the input CSS class. Defaults to `input`.\n  * `hint` – the hint CSS class. Defaults to `hint`.\n  * `suggestions` – the suggestions list CSS class. Defaults to `suggestions`.\n  * `suggestion` – the suggestion wrapper CSS class. Defaults to `suggestion`.\n  * `cursor` – the cursor CSS class. Defaults to `cursor`.\n  * `dataset` – the dataset CSS class. Defaults to `dataset`.\n  * `empty` – the empty CSS class. Defaults to `empty`.\n\n* `keyboardShortcuts` - Array of shortcut that will focus the input. For example if you want to bind `s` and `/`\n you can specify: `keyboardShortcuts: ['s', '/']`\n\n* `ariaLabel` - An optional string that will populate the `aria-label` attribute.\n\n```html\n<script type=\"text/template\" id=\"my-custom-menu-template\">\n  <div class=\"my-custom-menu\">\n    <div class=\"row\">\n      <div class=\"col-sm-6\">\n        <div class=\"aa-dataset-d1\"></div>\n      </div>\n      <div class=\"col-sm-6\">\n        <div class=\"aa-dataset-d2\"></div>\n        <div class=\"aa-dataset-d3\"></div>\n      </div>\n    </div>\n  </div>\n</script>\n<style>\nbody {\n\tfont-family: -apple-system, sans-serif;\n}\n.algolia-autocomplete {\n  width: 100%;\n}\n.algolia-autocomplete .aa-input, .algolia-autocomplete .aa-hint {\n  width: 100%;\n}\n.algolia-autocomplete .aa-hint {\n  color: #999;\n}\n.algolia-autocomplete .aa-dropdown-menu {\n  width: 100%;\n  background-color: #fff;\n  border: 1px solid #999;\n  border-top: none;\n}\n.algolia-autocomplete .aa-dropdown-menu .aa-suggestion {\n  cursor: pointer;\n  padding: 5px 4px;\n}\n.algolia-autocomplete .aa-dropdown-menu .aa-suggestion.aa-cursor {\n  background-color: #B2D7FF;\n}\n.algolia-autocomplete .aa-dropdown-menu .aa-suggestion em {\n  font-weight: bold;\n  font-style: normal;\n}\n\n.branding {\nfont-size: 1.3em;\nmargin: 0.5em 0.2em;\n}\n\n.branding img {\n\theight: 1.3em;\n\tmargin-bottom: - 0.3em;\n}\n</style>\n<script>\n  $('#search-input').autocomplete(\n    {\n      templates: {\n        dropdownMenu: '#my-custom-menu-template',\n        footer: '<div class=\"branding\">Powered by <img src=\"https://www.algolia.com/static_assets/images/press/downloads/algolia-logo-light.svg\" /></div>'\n      }\n    },\n    [\n      {\n        source: $.fn.autocomplete.sources.hits(index1, { hitsPerPage: 5 }),\n        name: 'd1',\n        templates: {\n          header: '<h4>List 1</h4>',\n          suggestion: function(suggestion) {\n            // FIXME\n          }\n        }\n      },\n      {\n        source: $.fn.autocomplete.sources.hits(index2, { hitsPerPage: 2 }),\n        name: 'd2',\n        templates: {\n          header: '<h4>List 2</h4>',\n          suggestion: function(suggestion) {\n            // FIXME\n          }\n        }\n      },\n      {\n        source: $.fn.autocomplete.sources.hits(index3, { hitsPerPage: 2 }),\n        name: 'd3',\n        templates: {\n          header: '<h4>List 3</h4>',\n          suggestion: function(suggestion, answer) {\n            // FIXME\n          }\n        }\n      }\n    ]\n  );\n</script>\n```\n\n* `minLength` – The minimum character length needed before suggestions start\n  getting rendered. Defaults to `1`.\n\n* `autoWidth` – This option allow you to control the width of autocomplete wrapper. When `false` the autocomplete wrapper will not have the width style attribute and you are be able to put your specific width property in your css to control the wrapper. Default value is `true`.\n\nOne scenario for use this option. e.g. You have a `max-width` css attribute in your `autocomplete-dropdown-menu` and you need to width grows until fill the `max-width`. In this scenario you put a `width: auto` in your autocomplete wrapper css class and the `max-width` in your autocomplete dropdown class and all done.\n\n## Datasets\n\nAn autocomplete is composed of one or more datasets. When an end-user modifies the\nvalue of the underlying input, each dataset will attempt to render suggestions for the\nnew value.\n\nDatasets can be configured using the following options.\n\n* `source` – The backing data source for suggestions. Expected to be a function\n  with the signature `(query, cb)`. It is expected that the function will\n  compute the suggestion set (i.e. an array of JavaScript objects) for `query`\n  and then invoke `cb` with said set. `cb` can be invoked synchronously or\n  asynchronously.\n\n* `name` – The name of the dataset. This will be appended to `tt-dataset-` to\n  form the class name of the containing DOM element.  Must only consist of\n  underscores, dashes, letters (`a-z`), and numbers. Defaults to a random\n  number.\n\n* `displayKey` – For a given suggestion object, determines the string\n  representation of it. This will be used when setting the value of the input\n  control after a suggestion is selected. Can be either a key string or a\n  function that transforms a suggestion object into a string. Defaults to\n  `value`.\n  Example function usage: `displayKey: function(suggestion) { return suggestion.nickname || suggestion.firstName }`\n\n* `templates` – A hash of templates to be used when rendering the dataset. Note\n  a precompiled template is a function that takes a JavaScript object as its\n  first argument and returns a HTML string.\n\n  * `empty` – Rendered when `0` suggestions are available for the given query.\n  Can be either a HTML string or a precompiled template. The templating function\n  is called with a context containing `query`, `isEmpty`, and any optional\n  arguments that may have been forwarded by the source:\n  `function emptyTemplate({ query, isEmpty }, [forwarded args])`.\n\n  * `footer` – Rendered at the bottom of the dataset. Can be either a HTML\n  string or a precompiled template. The templating function\n  is called with a context containing `query`, `isEmpty`, and any optional\n  arguments that may have been forwarded by the source:\n  `function footerTemplate({ query, isEmpty }, [forwarded args])`.\n\n  * `header` – Rendered at the top of the dataset. Can be either a HTML string\n  or a precompiled template. The templating function\n  is called with a context containing `query`, `isEmpty`, and any optional\n  arguments that may have been forwarded by the source:\n  `function headerTemplate({ query, isEmpty }, [forwarded args])`.\n\n  * `suggestion` – Used to render a single suggestion. The templating function\n  is called with the `suggestion`, and any optional arguments that may have\n  been forwarded by the source: `function suggestionTemplate(suggestion, [forwarded args])`.\n  Defaults to the value of `displayKey` wrapped in a `p` tag i.e. `<p>{{value}}</p>`.\n\n* `debounce` – If set, will postpone the source execution until after `debounce` milliseconds\nhave elapsed since the last time it was invoked.\n\n* `cache` - If set to `false`, subsequent identical queries will always execute the source function for suggestions. Defaults to `true`.\n\n## Sources\n\nA few helpers are provided by default to ease the creation of Algolia-based sources.\n\n### Hits\n\nTo build a source based on Algolia's `hits` array, just use:\n\n```js\n{\n  source: autocomplete.sources.hits(indexObj, { hitsPerPage: 2 }),\n  templates: {\n    suggestion: function(suggestion, answer) {\n      // FIXME\n    }\n  }\n}\n```\n\n### PopularIn (aka \"xxxxx in yyyyy\")\n\nTo build an Amazon-like autocomplete menu, suggesting popular queries and for the most popular one displaying the associated categories, you can use the `popularIn` source:\n\n```js\n{\n  source: autocomplete.sources.popularIn(popularQueriesIndexObj, { hitsPerPage: 3 }, {\n    source: 'sourceAttribute',           // attribute of the `popularQueries` index use to query the `index` index\n    index: productsIndexObj,             // targeted index\n    facets: 'facetedCategoryAttribute',  // facet used to enrich the most popular query\n    maxValuesPerFacet: 3                 // maximum number of facets returned\n  }, {\n    includeAll: true,                    // should it include an extra \"All department\" suggestion\n    allTitle: 'All departments'          // the included category label\n  }),\n  templates: {\n    suggestion: function(suggestion, answer) {\n      var value = suggestion.sourceAttribute;\n      if (suggestion.facet) {\n        // this is the first suggestion\n        // and it has been enriched with the matching facet\n        value += ' in ' + suggestion.facet.value + ' (' + suggestion.facet.count + ')';\n      }\n      return value;\n    }\n  }\n}\n```\n\n### Custom source\n\nThe `source` options can also take a function. It enables you to have more control of the results returned by Algolia search. The function `function(query, callback)` takes 2 parameters\n  * `query: String`: the text typed in the autocomplete\n  * `callback: Function`: the callback to call at the end of your processing with the array of suggestions\n\n```js\nsource: function(query, callback) {\n  var index = client.initIndex('myindex');\n  index.search(query, { hitsPerPage: 1, facetFilters: 'category:mycat' }).then(function(answer) {\n    callback(answer.hits);\n  }, function() {\n    callback([]);\n  });\n}\n```\n\nOr by reusing an existing source:\n\n```js\nvar hitsSource = autocomplete.sources.hits(index, { hitsPerPage: 5 });\n\nsource: function(query, callback) {\n  hitsSource(query, function(suggestions) {\n    // FIXME: Do stuff with the array of returned suggestions\n    callback(suggestions);\n  });\n}\n```\n\n## Security\n\n### User-generated data: protecting against XSS\n\nMalicious users may attempt to engineer XSS attacks by storing HTML/JS in their data. It is important that user-generated data be properly escaped before using it in an *autocomplete.js* template.\n\nIn order to easily do that, *autocomplete.js* provides you with a helper function escaping all HTML code but the highlighting tags:\n\n```js\n  templates: {\n    suggestion: function(suggestion) {\n      var val = suggestion._highlightResult.name.value;\n      return autocomplete.escapeHighlightedString(val);\n    }\n  }\n```\n\nIf you did specify custom highlighting pre/post tags, you can specify them as 2nd and 3rd parameter:\n\n```js\n  templates: {\n    suggestion: function(suggestion) {\n      var val = suggestion._highlightResult.name.value;\n      return autocomplete.escapeHighlightedString(val, '<span class=\"highlighted\">', '</span>');\n    }\n  }\n```\n\n## FAQ\n\n### How can I `Control`-click on results and have them open in a new tab?\n\nYou'll need to update your suggestion templates to make them as `<a href>` links\nand not simple divs. `Control`-clicking on them will trigger the default browser\nbehavior and open suggestions in a new tab.\n\nTo also support keyboard navigation, you'll need to listen to the\n`autocomplete:selected` event and change `window.location` to the destination\nURL.\n\nNote that you might need to check the value of `context.selectionMethod` in\n`autocomplete:selected` first. If it's equal to `click`, you should `return`\nearly, otherwise your main window will **also** follow the link.\n\nHere is an example of how it would look like:\n\n```javascript\nautocomplete(…).on('autocomplete:selected', function(event, suggestion, dataset, context) {\n  // Do nothing on click, as the browser will already do it\n  if (context.selectionMethod === 'click') {\n    return;\n  }\n  // Change the page, for example, on other events\n  window.location.assign(suggestion.url);\n});\n```\n\n## Events\n\nThe autocomplete component triggers the following custom events.\n\n* `autocomplete:opened` – Triggered when the dropdown menu of the autocomplete is\n  opened.\n\n* `autocomplete:shown` – Triggered when the dropdown menu of the autocomplete is\n  shown (opened and non-empty).\n\n* `autocomplete:empty` – Triggered when all datasets are empty.\n\n* `autocomplete:closed` – Triggered when the dropdown menu of the autocomplete is\n  closed.\n\n* `autocomplete:updated` – Triggered when a dataset is rendered.\n\n* `autocomplete:cursorchanged` – Triggered when the dropdown menu cursor is moved\n  to a different suggestion. The event handler will be invoked with 3\n  arguments: the jQuery event object, the suggestion object, and the name of\n  the dataset the suggestion belongs to.\n\n* `autocomplete:selected` – Triggered when a suggestion from the dropdown menu is\n  selected. The event handler will be invoked with the following arguments: the jQuery\n  event object, the suggestion object, the name of the dataset the\n  suggestion belongs to and a `context` object. The `context` contains\n  a `.selectionMethod` key that can be either `click`, `enterKey`, `tabKey` or\n  `blur`, depending how the suggestion was selected.\n\n* `autocomplete:cursorremoved` – Triggered when the cursor leaves the selections\n  or its current index is lower than 0\n\n* `autocomplete:autocompleted` – Triggered when the query is autocompleted.\n  Autocompleted means the query was changed to the hint. The event handler will\n  be invoked with 3 arguments: the jQuery event object, the suggestion object,\n  and the name of the dataset the suggestion belongs to.\n\n* `autocomplete:redrawn` – Triggered when `appendTo` is used and the wrapper is resized/repositionned.\n\nAll custom events are triggered on the element initialized as the autocomplete.\n\n## API\n\n### jQuery\n\nTurns any `input[type=\"text\"]` element into an auto-completion menu. `globalOptions` is an\noptions hash that's used to configure the autocomplete to your liking. Refer to\n[Global Options](#global-options) for more info regarding the available configs. Subsequent\narguments (`*datasets`), are individual option hashes for datasets. For more\ndetails regarding datasets, refer to [Datasets](#datasets).\n\n```\n$(selector).autocomplete(globalOptions, datasets)\n```\n\nExample:\n\n```js\n$('.search-input').autocomplete({\n  minLength: 3\n},\n{\n  name: 'my-dataset',\n  source: mySource\n});\n```\n\n#### jQuery#autocomplete('destroy')\n\nRemoves the autocomplete functionality and reverts the `input` element back to its\noriginal state.\n\n```js\n$('.search-input').autocomplete('destroy');\n```\n\n#### jQuery#autocomplete('open')\n\nOpens the dropdown menu of the autocomplete. Note that being open does not mean that\nthe menu is visible. The menu is only visible when it is open and has content.\n\n```js\n$('.search-input').autocomplete('open');\n```\n\n#### jQuery#autocomplete('close')\n\nCloses the dropdown menu of the autocomplete.\n\n```js\n$('.search-input').autocomplete('close');\n```\n\n#### jQuery#autocomplete('val')\n\nReturns the current value of the autocomplete. The value is the text the user has\nentered into the `input` element.\n\n```js\nvar myVal = $('.search-input').autocomplete('val');\n```\n\n#### jQuery#autocomplete('val', val)\n\nSets the value of the autocomplete. This should be used in place of `jQuery#val`.\n\n```js\n$('.search-input').autocomplete('val', myVal);\n```\n\n#### jQuery.fn.autocomplete.noConflict()\n\nReturns a reference to the autocomplete plugin and reverts `jQuery.fn.autocomplete`\nto its previous value. Can be used to avoid naming collisions.\n\n```js\nvar autocomplete = jQuery.fn.autocomplete.noConflict();\njQuery.fn._autocomplete = autocomplete;\n```\n\n### Standalone\n\nThe standalone version API is similiar to jQuery's:\n\n```js\nvar search = autocomplete(containerSelector, globalOptions, datasets);\n```\n\nExample:\n\n```js\nvar search = autocomplete('#search', { hint: false }, [{\n  source: autocomplete.sources.hits(index, { hitsPerPage: 5 })\n}]);\n\nsearch.autocomplete.open();\nsearch.autocomplete.close();\nsearch.autocomplete.getVal();\nsearch.autocomplete.setVal('Hey Jude');\nsearch.autocomplete.destroy();\nsearch.autocomplete.getWrapper(); // since autocomplete.js wraps your input into another div, you can access that div\n```\n\nYou can also pass a custom Typeahead instance in Autocomplete.js constructor:\n\n```js\nvar search = autocomplete('#search', { hint: false }, [{ ... }], new Typeahead({ ... }));\n```\n\n#### autocomplete.noConflict()\n\nReturns a reference to the autocomplete plugin and reverts `window.autocomplete`\nto its previous value. Can be used to avoid naming collisions.\n\n```js\nvar algoliaAutocomplete = autocomplete.noConflict();\n```\n\n## Contributing & releasing\n\nsee [CONTRIBUTING.md](./CONTRIBUTING.md)\n\n## Credits\n\nThis library has originally been forked from [Twitter's typeahead.js](https://github.com/twitter/typeahead.js) library.\n"
  },
  {
    "path": "js/autocomplete.js/bower.json",
    "content": "{\n  \"name\": \"algolia-autocomplete.js\",\n  \"main\": \"dist/autocomplete.js\",\n  \"version\": \"0.38.1\",\n  \"homepage\": \"https://github.com/algolia/autocomplete.js\",\n  \"authors\": [\n    \"Algolia Team <support@algolia.com>\"\n  ],\n  \"description\": \"Fast and fully-featured autocomplete library\",\n  \"keywords\": [\n    \"autocomplete\",\n    \"typeahead\"\n  ],\n  \"license\": \"MIT\",\n  \"ignore\": [\n    \"**/.*\",\n    \"node_modules\",\n    \"bower_components\",\n    \"test\"\n  ]\n}\n"
  },
  {
    "path": "js/autocomplete.js/dist/autocomplete.angular.js",
    "content": "/*!\n * autocomplete.js 0.38.1\n * https://github.com/algolia/autocomplete.js\n * Copyright 2021 Algolia, Inc. and other contributors; Licensed MIT\n */\n/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n\n\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tmodule.exports = __webpack_require__(1);\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar angular = __webpack_require__(2);\n\n\t// setup DOM element\n\tvar DOM = __webpack_require__(3);\n\tDOM.element = angular.element;\n\n\t// setup utils functions\n\tvar _ = __webpack_require__(4);\n\t_.isArray = angular.isArray;\n\t_.isFunction = angular.isFunction;\n\t_.isObject = angular.isObject;\n\t_.bind = angular.element.proxy;\n\t_.each = angular.forEach;\n\t_.map = angular.element.map;\n\t_.mixin = angular.extend;\n\t_.Event = angular.element.Event;\n\n\tvar EventBus = __webpack_require__(5);\n\tvar Typeahead = __webpack_require__(6);\n\n\tangular.module('algolia.autocomplete', [])\n\t  .directive('autocomplete', ['$parse', '$injector', function($parse, $injector) {\n\t    // inject the sources in the algolia namespace if available\n\t    try {\n\t      $injector.get('algolia').sources = Typeahead.sources;\n\t      $injector.get('algolia').escapeHighlightedString = _.escapeHighlightedString;\n\t    } catch (e) {\n\t      // not fatal\n\t    }\n\n\t    return {\n\t      restrict: 'AC', // Only apply on an attribute or class\n\t      scope: {\n\t        options: '&aaOptions',\n\t        datasets: '&aaDatasets'\n\t      },\n\t      link: function(scope, element, attrs) {\n\t        if (!element.hasClass('autocomplete') && attrs.autocomplete !== '') return;\n\t        attrs = attrs; // no-unused-vars\n\t        scope.options = $parse(scope.options)(scope);\n\t        if (!scope.options) {\n\t          scope.options = {};\n\t        }\n\t        scope.datasets = $parse(scope.datasets)(scope);\n\t        if (scope.datasets && !angular.isArray(scope.datasets)) {\n\t          scope.datasets = [scope.datasets];\n\t        }\n\n\t        var eventBus = new EventBus({el: element});\n\t        var autocomplete = null;\n\n\t        // reinitialization watchers\n\t        scope.$watch('options', initialize);\n\t        if (angular.isArray(scope.datasets)) {\n\t          scope.$watchCollection('datasets', initialize);\n\t        } else {\n\t          scope.$watch('datasets', initialize);\n\t        }\n\n\t        // init function\n\t        function initialize() {\n\t          if (autocomplete) {\n\t            autocomplete.destroy();\n\t          }\n\t          autocomplete = new Typeahead({\n\t            input: element,\n\t            dropdownMenuContainer: scope.options.dropdownMenuContainer,\n\t            eventBus: eventBus,\n\t            hint: scope.options.hint,\n\t            minLength: scope.options.minLength,\n\t            autoselect: scope.options.autoselect,\n\t            autoselectOnBlur: scope.options.autoselectOnBlur,\n\t            tabAutocomplete: scope.options.tabAutocomplete,\n\t            openOnFocus: scope.options.openOnFocus,\n\t            templates: scope.options.templates,\n\t            debug: scope.options.debug,\n\t            clearOnSelected: scope.options.clearOnSelected,\n\t            cssClasses: scope.options.cssClasses,\n\t            datasets: scope.datasets,\n\t            keyboardShortcuts: scope.options.keyboardShortcuts,\n\t            appendTo: scope.options.appendTo,\n\t            autoWidth: scope.options.autoWidth\n\t          });\n\t        }\n\n\t        // Propagate the selected event\n\t        element.bind('autocomplete:selected', function(object, suggestion, dataset) {\n\t          scope.$emit('autocomplete:selected', suggestion, dataset);\n\t        });\n\n\t        // Propagate the autocompleted event\n\t        element.bind('autocomplete:autocompleted', function(object, suggestion, dataset) {\n\t          scope.$emit('autocomplete:autocompleted', suggestion, dataset);\n\t        });\n\n\t        // Propagate the opened event\n\t        element.bind('autocomplete:opened', function() {\n\t          scope.$emit('autocomplete:opened');\n\t        });\n\n\t        // Propagate the closed event\n\t        element.bind('autocomplete:closed', function() {\n\t          scope.$emit('autocomplete:closed');\n\t        });\n\n\t        // Propagate the cursorchanged event\n\t        element.bind('autocomplete:cursorchanged', function(event, suggestion, dataset) {\n\t          scope.$emit('autocomplete:cursorchanged', event, suggestion, dataset);\n\t        });\n\t      }\n\t    };\n\t  }]);\n\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = angular;\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\n\tmodule.exports = {\n\t  element: null\n\t};\n\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar DOM = __webpack_require__(3);\n\n\tfunction escapeRegExp(str) {\n\t  return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n\t}\n\n\tmodule.exports = {\n\t  // those methods are implemented differently\n\t  // depending on which build it is, using\n\t  // $... or angular... or Zepto... or require(...)\n\t  isArray: null,\n\t  isFunction: null,\n\t  isObject: null,\n\t  bind: null,\n\t  each: null,\n\t  map: null,\n\t  mixin: null,\n\n\t  isMsie: function(agentString) {\n\t    if (agentString === undefined) { agentString = navigator.userAgent; }\n\t    // from https://github.com/ded/bowser/blob/master/bowser.js\n\t    if ((/(msie|trident)/i).test(agentString)) {\n\t      var match = agentString.match(/(msie |rv:)(\\d+(.\\d+)?)/i);\n\t      if (match) { return match[2]; }\n\t    }\n\t    return false;\n\t  },\n\n\t  // http://stackoverflow.com/a/6969486\n\t  escapeRegExChars: function(str) {\n\t    return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n\t  },\n\n\t  isNumber: function(obj) { return typeof obj === 'number'; },\n\n\t  toStr: function toStr(s) {\n\t    return s === undefined || s === null ? '' : s + '';\n\t  },\n\n\t  cloneDeep: function cloneDeep(obj) {\n\t    var clone = this.mixin({}, obj);\n\t    var self = this;\n\t    this.each(clone, function(value, key) {\n\t      if (value) {\n\t        if (self.isArray(value)) {\n\t          clone[key] = [].concat(value);\n\t        } else if (self.isObject(value)) {\n\t          clone[key] = self.cloneDeep(value);\n\t        }\n\t      }\n\t    });\n\t    return clone;\n\t  },\n\n\t  error: function(msg) {\n\t    throw new Error(msg);\n\t  },\n\n\t  every: function(obj, test) {\n\t    var result = true;\n\t    if (!obj) {\n\t      return result;\n\t    }\n\t    this.each(obj, function(val, key) {\n\t      if (result) {\n\t        result = test.call(null, val, key, obj) && result;\n\t      }\n\t    });\n\t    return !!result;\n\t  },\n\n\t  any: function(obj, test) {\n\t    var found = false;\n\t    if (!obj) {\n\t      return found;\n\t    }\n\t    this.each(obj, function(val, key) {\n\t      if (test.call(null, val, key, obj)) {\n\t        found = true;\n\t        return false;\n\t      }\n\t    });\n\t    return found;\n\t  },\n\n\t  getUniqueId: (function() {\n\t    var counter = 0;\n\t    return function() { return counter++; };\n\t  })(),\n\n\t  templatify: function templatify(obj) {\n\t    if (this.isFunction(obj)) {\n\t      return obj;\n\t    }\n\t    var $template = DOM.element(obj);\n\t    if ($template.prop('tagName') === 'SCRIPT') {\n\t      return function template() { return $template.text(); };\n\t    }\n\t    return function template() { return String(obj); };\n\t  },\n\n\t  defer: function(fn) { setTimeout(fn, 0); },\n\n\t  noop: function() {},\n\n\t  formatPrefix: function(prefix, noPrefix) {\n\t    return noPrefix ? '' : prefix + '-';\n\t  },\n\n\t  className: function(prefix, clazz, skipDot) {\n\t    return (skipDot ? '' : '.') + prefix + clazz;\n\t  },\n\n\t  escapeHighlightedString: function(str, highlightPreTag, highlightPostTag) {\n\t    highlightPreTag = highlightPreTag || '<em>';\n\t    var pre = document.createElement('div');\n\t    pre.appendChild(document.createTextNode(highlightPreTag));\n\n\t    highlightPostTag = highlightPostTag || '</em>';\n\t    var post = document.createElement('div');\n\t    post.appendChild(document.createTextNode(highlightPostTag));\n\n\t    var div = document.createElement('div');\n\t    div.appendChild(document.createTextNode(str));\n\t    return div.innerHTML\n\t      .replace(RegExp(escapeRegExp(pre.innerHTML), 'g'), highlightPreTag)\n\t      .replace(RegExp(escapeRegExp(post.innerHTML), 'g'), highlightPostTag);\n\t  }\n\t};\n\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar namespace = 'autocomplete:';\n\n\tvar _ = __webpack_require__(4);\n\tvar DOM = __webpack_require__(3);\n\n\t// constructor\n\t// -----------\n\n\tfunction EventBus(o) {\n\t  if (!o || !o.el) {\n\t    _.error('EventBus initialized without el');\n\t  }\n\n\t  this.$el = DOM.element(o.el);\n\t}\n\n\t// instance methods\n\t// ----------------\n\n\t_.mixin(EventBus.prototype, {\n\n\t  // ### public\n\n\t  trigger: function(type, suggestion, dataset, context) {\n\t    var event = _.Event(namespace + type);\n\t    this.$el.trigger(event, [suggestion, dataset, context]);\n\t    return event;\n\t  }\n\t});\n\n\tmodule.exports = EventBus;\n\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar attrsKey = 'aaAttrs';\n\n\tvar _ = __webpack_require__(4);\n\tvar DOM = __webpack_require__(3);\n\tvar EventBus = __webpack_require__(5);\n\tvar Input = __webpack_require__(7);\n\tvar Dropdown = __webpack_require__(16);\n\tvar html = __webpack_require__(18);\n\tvar css = __webpack_require__(19);\n\n\t// constructor\n\t// -----------\n\n\t// THOUGHT: what if datasets could dynamically be added/removed?\n\tfunction Typeahead(o) {\n\t  var $menu;\n\t  var $hint;\n\n\t  o = o || {};\n\n\t  if (!o.input) {\n\t    _.error('missing input');\n\t  }\n\n\t  this.isActivated = false;\n\t  this.debug = !!o.debug;\n\t  this.autoselect = !!o.autoselect;\n\t  this.autoselectOnBlur = !!o.autoselectOnBlur;\n\t  this.openOnFocus = !!o.openOnFocus;\n\t  this.minLength = _.isNumber(o.minLength) ? o.minLength : 1;\n\t  this.autoWidth = (o.autoWidth === undefined) ? true : !!o.autoWidth;\n\t  this.clearOnSelected = !!o.clearOnSelected;\n\t  this.tabAutocomplete = (o.tabAutocomplete === undefined) ? true : !!o.tabAutocomplete;\n\n\t  o.hint = !!o.hint;\n\n\t  if (o.hint && o.appendTo) {\n\t    throw new Error('[autocomplete.js] hint and appendTo options can\\'t be used at the same time');\n\t  }\n\n\t  this.css = o.css = _.mixin({}, css, o.appendTo ? css.appendTo : {});\n\t  this.cssClasses = o.cssClasses = _.mixin({}, css.defaultClasses, o.cssClasses || {});\n\t  this.cssClasses.prefix =\n\t    o.cssClasses.formattedPrefix = _.formatPrefix(this.cssClasses.prefix, this.cssClasses.noPrefix);\n\t  this.listboxId = o.listboxId = [this.cssClasses.root, 'listbox', _.getUniqueId()].join('-');\n\n\t  var domElts = buildDom(o);\n\n\t  this.$node = domElts.wrapper;\n\t  var $input = this.$input = domElts.input;\n\t  $menu = domElts.menu;\n\t  $hint = domElts.hint;\n\n\t  if (o.dropdownMenuContainer) {\n\t    DOM.element(o.dropdownMenuContainer)\n\t      .css('position', 'relative') // ensure the container has a relative position\n\t      .append($menu.css('top', '0')); // override the top: 100%\n\t  }\n\n\t  // #705: if there's scrollable overflow, ie doesn't support\n\t  // blur cancellations when the scrollbar is clicked\n\t  //\n\t  // #351: preventDefault won't cancel blurs in ie <= 8\n\t  $input.on('blur.aa', function($e) {\n\t    var active = document.activeElement;\n\t    if (_.isMsie() && ($menu[0] === active || $menu[0].contains(active))) {\n\t      $e.preventDefault();\n\t      // stop immediate in order to prevent Input#_onBlur from\n\t      // getting exectued\n\t      $e.stopImmediatePropagation();\n\t      _.defer(function() { $input.focus(); });\n\t    }\n\t  });\n\n\t  // #351: prevents input blur due to clicks within dropdown menu\n\t  $menu.on('mousedown.aa', function($e) { $e.preventDefault(); });\n\n\t  this.eventBus = o.eventBus || new EventBus({el: $input});\n\n\t  this.dropdown = new Typeahead.Dropdown({\n\t    appendTo: o.appendTo,\n\t    wrapper: this.$node,\n\t    menu: $menu,\n\t    datasets: o.datasets,\n\t    templates: o.templates,\n\t    cssClasses: o.cssClasses,\n\t    minLength: this.minLength\n\t  })\n\t    .onSync('suggestionClicked', this._onSuggestionClicked, this)\n\t    .onSync('cursorMoved', this._onCursorMoved, this)\n\t    .onSync('cursorRemoved', this._onCursorRemoved, this)\n\t    .onSync('opened', this._onOpened, this)\n\t    .onSync('closed', this._onClosed, this)\n\t    .onSync('shown', this._onShown, this)\n\t    .onSync('empty', this._onEmpty, this)\n\t    .onSync('redrawn', this._onRedrawn, this)\n\t    .onAsync('datasetRendered', this._onDatasetRendered, this);\n\n\t  this.input = new Typeahead.Input({input: $input, hint: $hint})\n\t    .onSync('focused', this._onFocused, this)\n\t    .onSync('blurred', this._onBlurred, this)\n\t    .onSync('enterKeyed', this._onEnterKeyed, this)\n\t    .onSync('tabKeyed', this._onTabKeyed, this)\n\t    .onSync('escKeyed', this._onEscKeyed, this)\n\t    .onSync('upKeyed', this._onUpKeyed, this)\n\t    .onSync('downKeyed', this._onDownKeyed, this)\n\t    .onSync('leftKeyed', this._onLeftKeyed, this)\n\t    .onSync('rightKeyed', this._onRightKeyed, this)\n\t    .onSync('queryChanged', this._onQueryChanged, this)\n\t    .onSync('whitespaceChanged', this._onWhitespaceChanged, this);\n\n\t  this._bindKeyboardShortcuts(o);\n\n\t  this._setLanguageDirection();\n\t}\n\n\t// instance methods\n\t// ----------------\n\n\t_.mixin(Typeahead.prototype, {\n\t  // ### private\n\n\t  _bindKeyboardShortcuts: function(options) {\n\t    if (!options.keyboardShortcuts) {\n\t      return;\n\t    }\n\t    var $input = this.$input;\n\t    var keyboardShortcuts = [];\n\t    _.each(options.keyboardShortcuts, function(key) {\n\t      if (typeof key === 'string') {\n\t        key = key.toUpperCase().charCodeAt(0);\n\t      }\n\t      keyboardShortcuts.push(key);\n\t    });\n\t    DOM.element(document).keydown(function(event) {\n\t      var elt = (event.target || event.srcElement);\n\t      var tagName = elt.tagName;\n\t      if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {\n\t        // already in an input\n\t        return;\n\t      }\n\n\t      var which = event.which || event.keyCode;\n\t      if (keyboardShortcuts.indexOf(which) === -1) {\n\t        // not the right shortcut\n\t        return;\n\t      }\n\n\t      $input.focus();\n\t      event.stopPropagation();\n\t      event.preventDefault();\n\t    });\n\t  },\n\n\t  _onSuggestionClicked: function onSuggestionClicked(type, $el) {\n\t    var datum;\n\t    var context = {selectionMethod: 'click'};\n\n\t    if (datum = this.dropdown.getDatumForSuggestion($el)) {\n\t      this._select(datum, context);\n\t    }\n\t  },\n\n\t  _onCursorMoved: function onCursorMoved(event, updateInput) {\n\t    var datum = this.dropdown.getDatumForCursor();\n\t    var currentCursorId = this.dropdown.getCurrentCursor().attr('id');\n\t    this.input.setActiveDescendant(currentCursorId);\n\n\t    if (datum) {\n\t      if (updateInput) {\n\t        this.input.setInputValue(datum.value, true);\n\t      }\n\n\t      this.eventBus.trigger('cursorchanged', datum.raw, datum.datasetName);\n\t    }\n\t  },\n\n\t  _onCursorRemoved: function onCursorRemoved() {\n\t    this.input.resetInputValue();\n\t    this._updateHint();\n\t    this.eventBus.trigger('cursorremoved');\n\t  },\n\n\t  _onDatasetRendered: function onDatasetRendered() {\n\t    this._updateHint();\n\n\t    this.eventBus.trigger('updated');\n\t  },\n\n\t  _onOpened: function onOpened() {\n\t    this._updateHint();\n\t    this.input.expand();\n\n\t    this.eventBus.trigger('opened');\n\t  },\n\n\t  _onEmpty: function onEmpty() {\n\t    this.eventBus.trigger('empty');\n\t  },\n\n\t  _onRedrawn: function onRedrawn() {\n\t    this.$node.css('top', 0 + 'px');\n\t    this.$node.css('left', 0 + 'px');\n\n\t    var inputRect = this.$input[0].getBoundingClientRect();\n\n\t    if (this.autoWidth) {\n\t      this.$node.css('width', inputRect.width + 'px');\n\t    }\n\n\t    var wrapperRect = this.$node[0].getBoundingClientRect();\n\n\t    var top = inputRect.bottom - wrapperRect.top;\n\t    this.$node.css('top', top + 'px');\n\t    var left = inputRect.left - wrapperRect.left;\n\t    this.$node.css('left', left + 'px');\n\n\t    this.eventBus.trigger('redrawn');\n\t  },\n\n\t  _onShown: function onShown() {\n\t    this.eventBus.trigger('shown');\n\t    if (this.autoselect) {\n\t      this.dropdown.cursorTopSuggestion();\n\t    }\n\t  },\n\n\t  _onClosed: function onClosed() {\n\t    this.input.clearHint();\n\t    this.input.removeActiveDescendant();\n\t    this.input.collapse();\n\n\t    this.eventBus.trigger('closed');\n\t  },\n\n\t  _onFocused: function onFocused() {\n\t    this.isActivated = true;\n\n\t    if (this.openOnFocus) {\n\t      var query = this.input.getQuery();\n\t      if (query.length >= this.minLength) {\n\t        this.dropdown.update(query);\n\t      } else {\n\t        this.dropdown.empty();\n\t      }\n\n\t      this.dropdown.open();\n\t    }\n\t  },\n\n\t  _onBlurred: function onBlurred() {\n\t    var cursorDatum;\n\t    var topSuggestionDatum;\n\n\t    cursorDatum = this.dropdown.getDatumForCursor();\n\t    topSuggestionDatum = this.dropdown.getDatumForTopSuggestion();\n\t    var context = {selectionMethod: 'blur'};\n\n\t    if (!this.debug) {\n\t      if (this.autoselectOnBlur && cursorDatum) {\n\t        this._select(cursorDatum, context);\n\t      } else if (this.autoselectOnBlur && topSuggestionDatum) {\n\t        this._select(topSuggestionDatum, context);\n\t      } else {\n\t        this.isActivated = false;\n\t        this.dropdown.empty();\n\t        this.dropdown.close();\n\t      }\n\t    }\n\t  },\n\n\t  _onEnterKeyed: function onEnterKeyed(type, $e) {\n\t    var cursorDatum;\n\t    var topSuggestionDatum;\n\n\t    cursorDatum = this.dropdown.getDatumForCursor();\n\t    topSuggestionDatum = this.dropdown.getDatumForTopSuggestion();\n\t    var context = {selectionMethod: 'enterKey'};\n\n\t    if (cursorDatum) {\n\t      this._select(cursorDatum, context);\n\t      $e.preventDefault();\n\t    } else if (this.autoselect && topSuggestionDatum) {\n\t      this._select(topSuggestionDatum, context);\n\t      $e.preventDefault();\n\t    }\n\t  },\n\n\t  _onTabKeyed: function onTabKeyed(type, $e) {\n\t    if (!this.tabAutocomplete) {\n\t      // Closing the dropdown enables further tabbing\n\t      this.dropdown.close();\n\t      return;\n\t    }\n\n\t    var datum;\n\t    var context = {selectionMethod: 'tabKey'};\n\n\t    if (datum = this.dropdown.getDatumForCursor()) {\n\t      this._select(datum, context);\n\t      $e.preventDefault();\n\t    } else {\n\t      this._autocomplete(true);\n\t    }\n\t  },\n\n\t  _onEscKeyed: function onEscKeyed() {\n\t    this.dropdown.close();\n\t    this.input.resetInputValue();\n\t  },\n\n\t  _onUpKeyed: function onUpKeyed() {\n\t    var query = this.input.getQuery();\n\n\t    if (this.dropdown.isEmpty && query.length >= this.minLength) {\n\t      this.dropdown.update(query);\n\t    } else {\n\t      this.dropdown.moveCursorUp();\n\t    }\n\n\t    this.dropdown.open();\n\t  },\n\n\t  _onDownKeyed: function onDownKeyed() {\n\t    var query = this.input.getQuery();\n\n\t    if (this.dropdown.isEmpty && query.length >= this.minLength) {\n\t      this.dropdown.update(query);\n\t    } else {\n\t      this.dropdown.moveCursorDown();\n\t    }\n\n\t    this.dropdown.open();\n\t  },\n\n\t  _onLeftKeyed: function onLeftKeyed() {\n\t    if (this.dir === 'rtl') {\n\t      this._autocomplete();\n\t    }\n\t  },\n\n\t  _onRightKeyed: function onRightKeyed() {\n\t    if (this.dir === 'ltr') {\n\t      this._autocomplete();\n\t    }\n\t  },\n\n\t  _onQueryChanged: function onQueryChanged(e, query) {\n\t    this.input.clearHintIfInvalid();\n\n\t    if (query.length >= this.minLength) {\n\t      this.dropdown.update(query);\n\t    } else {\n\t      this.dropdown.empty();\n\t    }\n\n\t    this.dropdown.open();\n\t    this._setLanguageDirection();\n\t  },\n\n\t  _onWhitespaceChanged: function onWhitespaceChanged() {\n\t    this._updateHint();\n\t    this.dropdown.open();\n\t  },\n\n\t  _setLanguageDirection: function setLanguageDirection() {\n\t    var dir = this.input.getLanguageDirection();\n\n\t    if (this.dir !== dir) {\n\t      this.dir = dir;\n\t      this.$node.css('direction', dir);\n\t      this.dropdown.setLanguageDirection(dir);\n\t    }\n\t  },\n\n\t  _updateHint: function updateHint() {\n\t    var datum;\n\t    var val;\n\t    var query;\n\t    var escapedQuery;\n\t    var frontMatchRegEx;\n\t    var match;\n\n\t    datum = this.dropdown.getDatumForTopSuggestion();\n\n\t    if (datum && this.dropdown.isVisible() && !this.input.hasOverflow()) {\n\t      val = this.input.getInputValue();\n\t      query = Input.normalizeQuery(val);\n\t      escapedQuery = _.escapeRegExChars(query);\n\n\t      // match input value, then capture trailing text\n\t      frontMatchRegEx = new RegExp('^(?:' + escapedQuery + ')(.+$)', 'i');\n\t      match = frontMatchRegEx.exec(datum.value);\n\n\t      // clear hint if there's no trailing text\n\t      if (match) {\n\t        this.input.setHint(val + match[1]);\n\t      } else {\n\t        this.input.clearHint();\n\t      }\n\t    } else {\n\t      this.input.clearHint();\n\t    }\n\t  },\n\n\t  _autocomplete: function autocomplete(laxCursor) {\n\t    var hint;\n\t    var query;\n\t    var isCursorAtEnd;\n\t    var datum;\n\n\t    hint = this.input.getHint();\n\t    query = this.input.getQuery();\n\t    isCursorAtEnd = laxCursor || this.input.isCursorAtEnd();\n\n\t    if (hint && query !== hint && isCursorAtEnd) {\n\t      datum = this.dropdown.getDatumForTopSuggestion();\n\t      if (datum) {\n\t        this.input.setInputValue(datum.value);\n\t      }\n\n\t      this.eventBus.trigger('autocompleted', datum.raw, datum.datasetName);\n\t    }\n\t  },\n\n\t  _select: function select(datum, context) {\n\t    if (typeof datum.value !== 'undefined') {\n\t      this.input.setQuery(datum.value);\n\t    }\n\t    if (this.clearOnSelected) {\n\t      this.setVal('');\n\t    } else {\n\t      this.input.setInputValue(datum.value, true);\n\t    }\n\n\t    this._setLanguageDirection();\n\n\t    var event = this.eventBus.trigger('selected', datum.raw, datum.datasetName, context);\n\t    if (event.isDefaultPrevented() === false) {\n\t      this.dropdown.close();\n\n\t      // #118: allow click event to bubble up to the body before removing\n\t      // the suggestions otherwise we break event delegation\n\t      _.defer(_.bind(this.dropdown.empty, this.dropdown));\n\t    }\n\t  },\n\n\t  // ### public\n\n\t  open: function open() {\n\t    // if the menu is not activated yet, we need to update\n\t    // the underlying dropdown menu to trigger the search\n\t    // otherwise we're not gonna see anything\n\t    if (!this.isActivated) {\n\t      var query = this.input.getInputValue();\n\t      if (query.length >= this.minLength) {\n\t        this.dropdown.update(query);\n\t      } else {\n\t        this.dropdown.empty();\n\t      }\n\t    }\n\t    this.dropdown.open();\n\t  },\n\n\t  close: function close() {\n\t    this.dropdown.close();\n\t  },\n\n\t  setVal: function setVal(val) {\n\t    // expect val to be a string, so be safe, and coerce\n\t    val = _.toStr(val);\n\n\t    if (this.isActivated) {\n\t      this.input.setInputValue(val);\n\t    } else {\n\t      this.input.setQuery(val);\n\t      this.input.setInputValue(val, true);\n\t    }\n\n\t    this._setLanguageDirection();\n\t  },\n\n\t  getVal: function getVal() {\n\t    return this.input.getQuery();\n\t  },\n\n\t  destroy: function destroy() {\n\t    this.input.destroy();\n\t    this.dropdown.destroy();\n\n\t    destroyDomStructure(this.$node, this.cssClasses);\n\n\t    this.$node = null;\n\t  },\n\n\t  getWrapper: function getWrapper() {\n\t    return this.dropdown.$container[0];\n\t  }\n\t});\n\n\tfunction buildDom(options) {\n\t  var $input;\n\t  var $wrapper;\n\t  var $dropdown;\n\t  var $hint;\n\n\t  $input = DOM.element(options.input);\n\t  $wrapper = DOM\n\t    .element(html.wrapper.replace('%ROOT%', options.cssClasses.root))\n\t    .css(options.css.wrapper);\n\n\t  // override the display property with the table-cell value\n\t  // if the parent element is a table and the original input was a block\n\t  //  -> https://github.com/algolia/autocomplete.js/issues/16\n\t  if (!options.appendTo && $input.css('display') === 'block' && $input.parent().css('display') === 'table') {\n\t    $wrapper.css('display', 'table-cell');\n\t  }\n\t  var dropdownHtml = html.dropdown.\n\t    replace('%PREFIX%', options.cssClasses.prefix).\n\t    replace('%DROPDOWN_MENU%', options.cssClasses.dropdownMenu);\n\t  $dropdown = DOM.element(dropdownHtml)\n\t    .css(options.css.dropdown)\n\t    .attr({\n\t      role: 'listbox',\n\t      id: options.listboxId\n\t    });\n\t  if (options.templates && options.templates.dropdownMenu) {\n\t    $dropdown.html(_.templatify(options.templates.dropdownMenu)());\n\t  }\n\t  $hint = $input.clone().css(options.css.hint).css(getBackgroundStyles($input));\n\n\t  $hint\n\t    .val('')\n\t    .addClass(_.className(options.cssClasses.prefix, options.cssClasses.hint, true))\n\t    .removeAttr('id name placeholder required')\n\t    .prop('readonly', true)\n\t    .attr({\n\t      'aria-hidden': 'true',\n\t      autocomplete: 'off',\n\t      spellcheck: 'false',\n\t      tabindex: -1\n\t    });\n\t  if ($hint.removeData) {\n\t    $hint.removeData();\n\t  }\n\n\t  // store the original values of the attrs that get modified\n\t  // so modifications can be reverted on destroy\n\t  $input.data(attrsKey, {\n\t    'aria-autocomplete': $input.attr('aria-autocomplete'),\n\t    'aria-expanded': $input.attr('aria-expanded'),\n\t    'aria-owns': $input.attr('aria-owns'),\n\t    autocomplete: $input.attr('autocomplete'),\n\t    dir: $input.attr('dir'),\n\t    role: $input.attr('role'),\n\t    spellcheck: $input.attr('spellcheck'),\n\t    style: $input.attr('style'),\n\t    type: $input.attr('type')\n\t  });\n\n\t  $input\n\t    .addClass(_.className(options.cssClasses.prefix, options.cssClasses.input, true))\n\t    .attr({\n\t      autocomplete: 'off',\n\t      spellcheck: false,\n\n\t      // Accessibility features\n\t      // Give the field a presentation of a \"select\".\n\t      // Combobox is the combined presentation of a single line textfield\n\t      // with a listbox popup.\n\t      // https://www.w3.org/WAI/PF/aria/roles#combobox\n\t      role: 'combobox',\n\t      // Let the screen reader know the field has an autocomplete\n\t      // feature to it.\n\t      'aria-autocomplete': (options.datasets &&\n\t        options.datasets[0] && options.datasets[0].displayKey ? 'both' : 'list'),\n\t      // Indicates whether the dropdown it controls is currently expanded or collapsed\n\t      'aria-expanded': 'false',\n\t      'aria-label': options.ariaLabel,\n\t      // Explicitly point to the listbox,\n\t      // which is a list of suggestions (aka options)\n\t      'aria-owns': options.listboxId\n\t    })\n\t    .css(options.hint ? options.css.input : options.css.inputWithNoHint);\n\n\t  // ie7 does not like it when dir is set to auto\n\t  try {\n\t    if (!$input.attr('dir')) {\n\t      $input.attr('dir', 'auto');\n\t    }\n\t  } catch (e) {\n\t    // ignore\n\t  }\n\n\t  $wrapper = options.appendTo\n\t    ? $wrapper.appendTo(DOM.element(options.appendTo).eq(0)).eq(0)\n\t    : $input.wrap($wrapper).parent();\n\n\t  $wrapper\n\t    .prepend(options.hint ? $hint : null)\n\t    .append($dropdown);\n\n\t  return {\n\t    wrapper: $wrapper,\n\t    input: $input,\n\t    hint: $hint,\n\t    menu: $dropdown\n\t  };\n\t}\n\n\tfunction getBackgroundStyles($el) {\n\t  return {\n\t    backgroundAttachment: $el.css('background-attachment'),\n\t    backgroundClip: $el.css('background-clip'),\n\t    backgroundColor: $el.css('background-color'),\n\t    backgroundImage: $el.css('background-image'),\n\t    backgroundOrigin: $el.css('background-origin'),\n\t    backgroundPosition: $el.css('background-position'),\n\t    backgroundRepeat: $el.css('background-repeat'),\n\t    backgroundSize: $el.css('background-size')\n\t  };\n\t}\n\n\tfunction destroyDomStructure($node, cssClasses) {\n\t  var $input = $node.find(_.className(cssClasses.prefix, cssClasses.input));\n\n\t  // need to remove attrs that weren't previously defined and\n\t  // revert attrs that originally had a value\n\t  _.each($input.data(attrsKey), function(val, key) {\n\t    if (val === undefined) {\n\t      $input.removeAttr(key);\n\t    } else {\n\t      $input.attr(key, val);\n\t    }\n\t  });\n\n\t  $input\n\t    .detach()\n\t    .removeClass(_.className(cssClasses.prefix, cssClasses.input, true))\n\t    .insertAfter($node);\n\t  if ($input.removeData) {\n\t    $input.removeData(attrsKey);\n\t  }\n\n\t  $node.remove();\n\t}\n\n\tTypeahead.Dropdown = Dropdown;\n\tTypeahead.Input = Input;\n\tTypeahead.sources = __webpack_require__(20);\n\n\tmodule.exports = Typeahead;\n\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar specialKeyCodeMap;\n\n\tspecialKeyCodeMap = {\n\t  9: 'tab',\n\t  27: 'esc',\n\t  37: 'left',\n\t  39: 'right',\n\t  13: 'enter',\n\t  38: 'up',\n\t  40: 'down'\n\t};\n\n\tvar _ = __webpack_require__(4);\n\tvar DOM = __webpack_require__(3);\n\tvar EventEmitter = __webpack_require__(8);\n\n\t// constructor\n\t// -----------\n\n\tfunction Input(o) {\n\t  var that = this;\n\t  var onBlur;\n\t  var onFocus;\n\t  var onKeydown;\n\t  var onInput;\n\n\t  o = o || {};\n\n\t  if (!o.input) {\n\t    _.error('input is missing');\n\t  }\n\n\t  // bound functions\n\t  onBlur = _.bind(this._onBlur, this);\n\t  onFocus = _.bind(this._onFocus, this);\n\t  onKeydown = _.bind(this._onKeydown, this);\n\t  onInput = _.bind(this._onInput, this);\n\n\t  this.$hint = DOM.element(o.hint);\n\t  this.$input = DOM.element(o.input)\n\t    .on('blur.aa', onBlur)\n\t    .on('focus.aa', onFocus)\n\t    .on('keydown.aa', onKeydown);\n\n\t  // if no hint, noop all the hint related functions\n\t  if (this.$hint.length === 0) {\n\t    this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop;\n\t  }\n\n\t  // ie7 and ie8 don't support the input event\n\t  // ie9 doesn't fire the input event when characters are removed\n\t  // not sure if ie10 is compatible\n\t  if (!_.isMsie()) {\n\t    this.$input.on('input.aa', onInput);\n\t  } else {\n\t    this.$input.on('keydown.aa keypress.aa cut.aa paste.aa', function($e) {\n\t      // if a special key triggered this, ignore it\n\t      if (specialKeyCodeMap[$e.which || $e.keyCode]) {\n\t        return;\n\t      }\n\n\t      // give the browser a chance to update the value of the input\n\t      // before checking to see if the query changed\n\t      _.defer(_.bind(that._onInput, that, $e));\n\t    });\n\t  }\n\n\t  // the query defaults to whatever the value of the input is\n\t  // on initialization, it'll most likely be an empty string\n\t  this.query = this.$input.val();\n\n\t  // helps with calculating the width of the input's value\n\t  this.$overflowHelper = buildOverflowHelper(this.$input);\n\t}\n\n\t// static methods\n\t// --------------\n\n\tInput.normalizeQuery = function(str) {\n\t  // strips leading whitespace and condenses all whitespace\n\t  return (str || '').replace(/^\\s*/g, '').replace(/\\s{2,}/g, ' ');\n\t};\n\n\t// instance methods\n\t// ----------------\n\n\t_.mixin(Input.prototype, EventEmitter, {\n\n\t  // ### private\n\n\t  _onBlur: function onBlur() {\n\t    this.resetInputValue();\n\t    this.$input.removeAttr('aria-activedescendant');\n\t    this.trigger('blurred');\n\t  },\n\n\t  _onFocus: function onFocus() {\n\t    this.trigger('focused');\n\t  },\n\n\t  _onKeydown: function onKeydown($e) {\n\t    // which is normalized and consistent (but not for ie)\n\t    var keyName = specialKeyCodeMap[$e.which || $e.keyCode];\n\n\t    this._managePreventDefault(keyName, $e);\n\t    if (keyName && this._shouldTrigger(keyName, $e)) {\n\t      this.trigger(keyName + 'Keyed', $e);\n\t    }\n\t  },\n\n\t  _onInput: function onInput() {\n\t    this._checkInputValue();\n\t  },\n\n\t  _managePreventDefault: function managePreventDefault(keyName, $e) {\n\t    var preventDefault;\n\t    var hintValue;\n\t    var inputValue;\n\n\t    switch (keyName) {\n\t    case 'tab':\n\t      hintValue = this.getHint();\n\t      inputValue = this.getInputValue();\n\n\t      preventDefault = hintValue &&\n\t        hintValue !== inputValue &&\n\t        !withModifier($e);\n\t      break;\n\n\t    case 'up':\n\t    case 'down':\n\t      preventDefault = !withModifier($e);\n\t      break;\n\n\t    default:\n\t      preventDefault = false;\n\t    }\n\n\t    if (preventDefault) {\n\t      $e.preventDefault();\n\t    }\n\t  },\n\n\t  _shouldTrigger: function shouldTrigger(keyName, $e) {\n\t    var trigger;\n\n\t    switch (keyName) {\n\t    case 'tab':\n\t      trigger = !withModifier($e);\n\t      break;\n\n\t    default:\n\t      trigger = true;\n\t    }\n\n\t    return trigger;\n\t  },\n\n\t  _checkInputValue: function checkInputValue() {\n\t    var inputValue;\n\t    var areEquivalent;\n\t    var hasDifferentWhitespace;\n\n\t    inputValue = this.getInputValue();\n\t    areEquivalent = areQueriesEquivalent(inputValue, this.query);\n\t    hasDifferentWhitespace = areEquivalent && this.query ?\n\t      this.query.length !== inputValue.length : false;\n\n\t    this.query = inputValue;\n\n\t    if (!areEquivalent) {\n\t      this.trigger('queryChanged', this.query);\n\t    } else if (hasDifferentWhitespace) {\n\t      this.trigger('whitespaceChanged', this.query);\n\t    }\n\t  },\n\n\t  // ### public\n\n\t  focus: function focus() {\n\t    this.$input.focus();\n\t  },\n\n\t  blur: function blur() {\n\t    this.$input.blur();\n\t  },\n\n\t  getQuery: function getQuery() {\n\t    return this.query;\n\t  },\n\n\t  setQuery: function setQuery(query) {\n\t    this.query = query;\n\t  },\n\n\t  getInputValue: function getInputValue() {\n\t    return this.$input.val();\n\t  },\n\n\t  setInputValue: function setInputValue(value, silent) {\n\t    if (typeof value === 'undefined') {\n\t      value = this.query;\n\t    }\n\t    this.$input.val(value);\n\n\t    // silent prevents any additional events from being triggered\n\t    if (silent) {\n\t      this.clearHint();\n\t    } else {\n\t      this._checkInputValue();\n\t    }\n\t  },\n\n\t  expand: function expand() {\n\t    this.$input.attr('aria-expanded', 'true');\n\t  },\n\n\t  collapse: function collapse() {\n\t    this.$input.attr('aria-expanded', 'false');\n\t  },\n\n\t  setActiveDescendant: function setActiveDescendant(activedescendantId) {\n\t    this.$input.attr('aria-activedescendant', activedescendantId);\n\t  },\n\n\t  removeActiveDescendant: function removeActiveDescendant() {\n\t    this.$input.removeAttr('aria-activedescendant');\n\t  },\n\n\t  resetInputValue: function resetInputValue() {\n\t    this.setInputValue(this.query, true);\n\t  },\n\n\t  getHint: function getHint() {\n\t    return this.$hint.val();\n\t  },\n\n\t  setHint: function setHint(value) {\n\t    this.$hint.val(value);\n\t  },\n\n\t  clearHint: function clearHint() {\n\t    this.setHint('');\n\t  },\n\n\t  clearHintIfInvalid: function clearHintIfInvalid() {\n\t    var val;\n\t    var hint;\n\t    var valIsPrefixOfHint;\n\t    var isValid;\n\n\t    val = this.getInputValue();\n\t    hint = this.getHint();\n\t    valIsPrefixOfHint = val !== hint && hint.indexOf(val) === 0;\n\t    isValid = val !== '' && valIsPrefixOfHint && !this.hasOverflow();\n\n\t    if (!isValid) {\n\t      this.clearHint();\n\t    }\n\t  },\n\n\t  getLanguageDirection: function getLanguageDirection() {\n\t    return (this.$input.css('direction') || 'ltr').toLowerCase();\n\t  },\n\n\t  hasOverflow: function hasOverflow() {\n\t    // 2 is arbitrary, just picking a small number to handle edge cases\n\t    var constraint = this.$input.width() - 2;\n\n\t    this.$overflowHelper.text(this.getInputValue());\n\n\t    return this.$overflowHelper.width() >= constraint;\n\t  },\n\n\t  isCursorAtEnd: function() {\n\t    var valueLength;\n\t    var selectionStart;\n\t    var range;\n\n\t    valueLength = this.$input.val().length;\n\t    selectionStart = this.$input[0].selectionStart;\n\n\t    if (_.isNumber(selectionStart)) {\n\t      return selectionStart === valueLength;\n\t    } else if (document.selection) {\n\t      // NOTE: this won't work unless the input has focus, the good news\n\t      // is this code should only get called when the input has focus\n\t      range = document.selection.createRange();\n\t      range.moveStart('character', -valueLength);\n\n\t      return valueLength === range.text.length;\n\t    }\n\n\t    return true;\n\t  },\n\n\t  destroy: function destroy() {\n\t    this.$hint.off('.aa');\n\t    this.$input.off('.aa');\n\n\t    this.$hint = this.$input = this.$overflowHelper = null;\n\t  }\n\t});\n\n\t// helper functions\n\t// ----------------\n\n\tfunction buildOverflowHelper($input) {\n\t  return DOM.element('<pre aria-hidden=\"true\"></pre>')\n\t    .css({\n\t      // position helper off-screen\n\t      position: 'absolute',\n\t      visibility: 'hidden',\n\t      // avoid line breaks and whitespace collapsing\n\t      whiteSpace: 'pre',\n\t      // use same font css as input to calculate accurate width\n\t      fontFamily: $input.css('font-family'),\n\t      fontSize: $input.css('font-size'),\n\t      fontStyle: $input.css('font-style'),\n\t      fontVariant: $input.css('font-variant'),\n\t      fontWeight: $input.css('font-weight'),\n\t      wordSpacing: $input.css('word-spacing'),\n\t      letterSpacing: $input.css('letter-spacing'),\n\t      textIndent: $input.css('text-indent'),\n\t      textRendering: $input.css('text-rendering'),\n\t      textTransform: $input.css('text-transform')\n\t    })\n\t    .insertAfter($input);\n\t}\n\n\tfunction areQueriesEquivalent(a, b) {\n\t  return Input.normalizeQuery(a) === Input.normalizeQuery(b);\n\t}\n\n\tfunction withModifier($e) {\n\t  return $e.altKey || $e.ctrlKey || $e.metaKey || $e.shiftKey;\n\t}\n\n\tmodule.exports = Input;\n\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar immediate = __webpack_require__(9);\n\tvar splitter = /\\s+/;\n\n\tmodule.exports = {\n\t  onSync: onSync,\n\t  onAsync: onAsync,\n\t  off: off,\n\t  trigger: trigger\n\t};\n\n\tfunction on(method, types, cb, context) {\n\t  var type;\n\n\t  if (!cb) {\n\t    return this;\n\t  }\n\n\t  types = types.split(splitter);\n\t  cb = context ? bindContext(cb, context) : cb;\n\n\t  this._callbacks = this._callbacks || {};\n\n\t  while (type = types.shift()) {\n\t    this._callbacks[type] = this._callbacks[type] || {sync: [], async: []};\n\t    this._callbacks[type][method].push(cb);\n\t  }\n\n\t  return this;\n\t}\n\n\tfunction onAsync(types, cb, context) {\n\t  return on.call(this, 'async', types, cb, context);\n\t}\n\n\tfunction onSync(types, cb, context) {\n\t  return on.call(this, 'sync', types, cb, context);\n\t}\n\n\tfunction off(types) {\n\t  var type;\n\n\t  if (!this._callbacks) {\n\t    return this;\n\t  }\n\n\t  types = types.split(splitter);\n\n\t  while (type = types.shift()) {\n\t    delete this._callbacks[type];\n\t  }\n\n\t  return this;\n\t}\n\n\tfunction trigger(types) {\n\t  var type;\n\t  var callbacks;\n\t  var args;\n\t  var syncFlush;\n\t  var asyncFlush;\n\n\t  if (!this._callbacks) {\n\t    return this;\n\t  }\n\n\t  types = types.split(splitter);\n\t  args = [].slice.call(arguments, 1);\n\n\t  while ((type = types.shift()) && (callbacks = this._callbacks[type])) { // eslint-disable-line\n\t    syncFlush = getFlush(callbacks.sync, this, [type].concat(args));\n\t    asyncFlush = getFlush(callbacks.async, this, [type].concat(args));\n\n\t    if (syncFlush()) {\n\t      immediate(asyncFlush);\n\t    }\n\t  }\n\n\t  return this;\n\t}\n\n\tfunction getFlush(callbacks, context, args) {\n\t  return flush;\n\n\t  function flush() {\n\t    var cancelled;\n\n\t    for (var i = 0, len = callbacks.length; !cancelled && i < len; i += 1) {\n\t      // only cancel if the callback explicitly returns false\n\t      cancelled = callbacks[i].apply(context, args) === false;\n\t    }\n\n\t    return !cancelled;\n\t  }\n\t}\n\n\tfunction bindContext(fn, context) {\n\t  return fn.bind ?\n\t    fn.bind(context) :\n\t    function() { fn.apply(context, [].slice.call(arguments, 0)); };\n\t}\n\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\tvar types = [\n\t  __webpack_require__(10),\n\t  __webpack_require__(12),\n\t  __webpack_require__(13),\n\t  __webpack_require__(14),\n\t  __webpack_require__(15)\n\t];\n\tvar draining;\n\tvar currentQueue;\n\tvar queueIndex = -1;\n\tvar queue = [];\n\tvar scheduled = false;\n\tfunction cleanUpNextTick() {\n\t  if (!draining || !currentQueue) {\n\t    return;\n\t  }\n\t  draining = false;\n\t  if (currentQueue.length) {\n\t    queue = currentQueue.concat(queue);\n\t  } else {\n\t    queueIndex = -1;\n\t  }\n\t  if (queue.length) {\n\t    nextTick();\n\t  }\n\t}\n\n\t//named nextTick for less confusing stack traces\n\tfunction nextTick() {\n\t  if (draining) {\n\t    return;\n\t  }\n\t  scheduled = false;\n\t  draining = true;\n\t  var len = queue.length;\n\t  var timeout = setTimeout(cleanUpNextTick);\n\t  while (len) {\n\t    currentQueue = queue;\n\t    queue = [];\n\t    while (currentQueue && ++queueIndex < len) {\n\t      currentQueue[queueIndex].run();\n\t    }\n\t    queueIndex = -1;\n\t    len = queue.length;\n\t  }\n\t  currentQueue = null;\n\t  queueIndex = -1;\n\t  draining = false;\n\t  clearTimeout(timeout);\n\t}\n\tvar scheduleDrain;\n\tvar i = -1;\n\tvar len = types.length;\n\twhile (++i < len) {\n\t  if (types[i] && types[i].test && types[i].test()) {\n\t    scheduleDrain = types[i].install(nextTick);\n\t    break;\n\t  }\n\t}\n\t// v8 likes predictible objects\n\tfunction Item(fun, array) {\n\t  this.fun = fun;\n\t  this.array = array;\n\t}\n\tItem.prototype.run = function () {\n\t  var fun = this.fun;\n\t  var array = this.array;\n\t  switch (array.length) {\n\t  case 0:\n\t    return fun();\n\t  case 1:\n\t    return fun(array[0]);\n\t  case 2:\n\t    return fun(array[0], array[1]);\n\t  case 3:\n\t    return fun(array[0], array[1], array[2]);\n\t  default:\n\t    return fun.apply(null, array);\n\t  }\n\n\t};\n\tmodule.exports = immediate;\n\tfunction immediate(task) {\n\t  var args = new Array(arguments.length - 1);\n\t  if (arguments.length > 1) {\n\t    for (var i = 1; i < arguments.length; i++) {\n\t      args[i - 1] = arguments[i];\n\t    }\n\t  }\n\t  queue.push(new Item(task, args));\n\t  if (!scheduled && !draining) {\n\t    scheduled = true;\n\t    scheduleDrain();\n\t  }\n\t}\n\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {'use strict';\n\texports.test = function () {\n\t  // Don't get fooled by e.g. browserify environments.\n\t  return (typeof process !== 'undefined') && !process.browser;\n\t};\n\n\texports.install = function (func) {\n\t  return function () {\n\t    process.nextTick(func);\n\t  };\n\t};\n\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))\n\n/***/ },\n/* 11 */\n/***/ function(module, exports) {\n\n\t// shim for using process in browser\n\tvar process = module.exports = {};\n\n\t// cached from whatever global is present so that test runners that stub it\n\t// don't break things.  But we need to wrap it in a try catch in case it is\n\t// wrapped in strict mode code which doesn't define any globals.  It's inside a\n\t// function because try/catches deoptimize in certain engines.\n\n\tvar cachedSetTimeout;\n\tvar cachedClearTimeout;\n\n\tfunction defaultSetTimout() {\n\t    throw new Error('setTimeout has not been defined');\n\t}\n\tfunction defaultClearTimeout () {\n\t    throw new Error('clearTimeout has not been defined');\n\t}\n\t(function () {\n\t    try {\n\t        if (typeof setTimeout === 'function') {\n\t            cachedSetTimeout = setTimeout;\n\t        } else {\n\t            cachedSetTimeout = defaultSetTimout;\n\t        }\n\t    } catch (e) {\n\t        cachedSetTimeout = defaultSetTimout;\n\t    }\n\t    try {\n\t        if (typeof clearTimeout === 'function') {\n\t            cachedClearTimeout = clearTimeout;\n\t        } else {\n\t            cachedClearTimeout = defaultClearTimeout;\n\t        }\n\t    } catch (e) {\n\t        cachedClearTimeout = defaultClearTimeout;\n\t    }\n\t} ())\n\tfunction runTimeout(fun) {\n\t    if (cachedSetTimeout === setTimeout) {\n\t        //normal enviroments in sane situations\n\t        return setTimeout(fun, 0);\n\t    }\n\t    // if setTimeout wasn't available but was latter defined\n\t    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n\t        cachedSetTimeout = setTimeout;\n\t        return setTimeout(fun, 0);\n\t    }\n\t    try {\n\t        // when when somebody has screwed with setTimeout but no I.E. maddness\n\t        return cachedSetTimeout(fun, 0);\n\t    } catch(e){\n\t        try {\n\t            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n\t            return cachedSetTimeout.call(null, fun, 0);\n\t        } catch(e){\n\t            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n\t            return cachedSetTimeout.call(this, fun, 0);\n\t        }\n\t    }\n\n\n\t}\n\tfunction runClearTimeout(marker) {\n\t    if (cachedClearTimeout === clearTimeout) {\n\t        //normal enviroments in sane situations\n\t        return clearTimeout(marker);\n\t    }\n\t    // if clearTimeout wasn't available but was latter defined\n\t    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n\t        cachedClearTimeout = clearTimeout;\n\t        return clearTimeout(marker);\n\t    }\n\t    try {\n\t        // when when somebody has screwed with setTimeout but no I.E. maddness\n\t        return cachedClearTimeout(marker);\n\t    } catch (e){\n\t        try {\n\t            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally\n\t            return cachedClearTimeout.call(null, marker);\n\t        } catch (e){\n\t            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n\t            // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n\t            return cachedClearTimeout.call(this, marker);\n\t        }\n\t    }\n\n\n\n\t}\n\tvar queue = [];\n\tvar draining = false;\n\tvar currentQueue;\n\tvar queueIndex = -1;\n\n\tfunction cleanUpNextTick() {\n\t    if (!draining || !currentQueue) {\n\t        return;\n\t    }\n\t    draining = false;\n\t    if (currentQueue.length) {\n\t        queue = currentQueue.concat(queue);\n\t    } else {\n\t        queueIndex = -1;\n\t    }\n\t    if (queue.length) {\n\t        drainQueue();\n\t    }\n\t}\n\n\tfunction drainQueue() {\n\t    if (draining) {\n\t        return;\n\t    }\n\t    var timeout = runTimeout(cleanUpNextTick);\n\t    draining = true;\n\n\t    var len = queue.length;\n\t    while(len) {\n\t        currentQueue = queue;\n\t        queue = [];\n\t        while (++queueIndex < len) {\n\t            if (currentQueue) {\n\t                currentQueue[queueIndex].run();\n\t            }\n\t        }\n\t        queueIndex = -1;\n\t        len = queue.length;\n\t    }\n\t    currentQueue = null;\n\t    draining = false;\n\t    runClearTimeout(timeout);\n\t}\n\n\tprocess.nextTick = function (fun) {\n\t    var args = new Array(arguments.length - 1);\n\t    if (arguments.length > 1) {\n\t        for (var i = 1; i < arguments.length; i++) {\n\t            args[i - 1] = arguments[i];\n\t        }\n\t    }\n\t    queue.push(new Item(fun, args));\n\t    if (queue.length === 1 && !draining) {\n\t        runTimeout(drainQueue);\n\t    }\n\t};\n\n\t// v8 likes predictible objects\n\tfunction Item(fun, array) {\n\t    this.fun = fun;\n\t    this.array = array;\n\t}\n\tItem.prototype.run = function () {\n\t    this.fun.apply(null, this.array);\n\t};\n\tprocess.title = 'browser';\n\tprocess.browser = true;\n\tprocess.env = {};\n\tprocess.argv = [];\n\tprocess.version = ''; // empty string to avoid regexp issues\n\tprocess.versions = {};\n\n\tfunction noop() {}\n\n\tprocess.on = noop;\n\tprocess.addListener = noop;\n\tprocess.once = noop;\n\tprocess.off = noop;\n\tprocess.removeListener = noop;\n\tprocess.removeAllListeners = noop;\n\tprocess.emit = noop;\n\n\tprocess.binding = function (name) {\n\t    throw new Error('process.binding is not supported');\n\t};\n\n\tprocess.cwd = function () { return '/' };\n\tprocess.chdir = function (dir) {\n\t    throw new Error('process.chdir is not supported');\n\t};\n\tprocess.umask = function() { return 0; };\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t//based off rsvp https://github.com/tildeio/rsvp.js\n\t//license https://github.com/tildeio/rsvp.js/blob/master/LICENSE\n\t//https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/asap.js\n\n\tvar Mutation = global.MutationObserver || global.WebKitMutationObserver;\n\n\texports.test = function () {\n\t  return Mutation;\n\t};\n\n\texports.install = function (handle) {\n\t  var called = 0;\n\t  var observer = new Mutation(handle);\n\t  var element = global.document.createTextNode('');\n\t  observer.observe(element, {\n\t    characterData: true\n\t  });\n\t  return function () {\n\t    element.data = (called = ++called % 2);\n\t  };\n\t};\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\n\texports.test = function () {\n\t  if (global.setImmediate) {\n\t    // we can only get here in IE10\n\t    // which doesn't handel postMessage well\n\t    return false;\n\t  }\n\t  return typeof global.MessageChannel !== 'undefined';\n\t};\n\n\texports.install = function (func) {\n\t  var channel = new global.MessageChannel();\n\t  channel.port1.onmessage = func;\n\t  return function () {\n\t    channel.port2.postMessage(0);\n\t  };\n\t};\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 14 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\n\texports.test = function () {\n\t  return 'document' in global && 'onreadystatechange' in global.document.createElement('script');\n\t};\n\n\texports.install = function (handle) {\n\t  return function () {\n\n\t    // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n\t    // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n\t    var scriptEl = global.document.createElement('script');\n\t    scriptEl.onreadystatechange = function () {\n\t      handle();\n\n\t      scriptEl.onreadystatechange = null;\n\t      scriptEl.parentNode.removeChild(scriptEl);\n\t      scriptEl = null;\n\t    };\n\t    global.document.documentElement.appendChild(scriptEl);\n\n\t    return handle;\n\t  };\n\t};\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 15 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\texports.test = function () {\n\t  return true;\n\t};\n\n\texports.install = function (t) {\n\t  return function () {\n\t    setTimeout(t, 0);\n\t  };\n\t};\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar _ = __webpack_require__(4);\n\tvar DOM = __webpack_require__(3);\n\tvar EventEmitter = __webpack_require__(8);\n\tvar Dataset = __webpack_require__(17);\n\tvar css = __webpack_require__(19);\n\n\t// constructor\n\t// -----------\n\n\tfunction Dropdown(o) {\n\t  var that = this;\n\t  var onSuggestionClick;\n\t  var onSuggestionMouseEnter;\n\t  var onSuggestionMouseLeave;\n\n\t  o = o || {};\n\n\t  if (!o.menu) {\n\t    _.error('menu is required');\n\t  }\n\n\t  if (!_.isArray(o.datasets) && !_.isObject(o.datasets)) {\n\t    _.error('1 or more datasets required');\n\t  }\n\t  if (!o.datasets) {\n\t    _.error('datasets is required');\n\t  }\n\n\t  this.isOpen = false;\n\t  this.isEmpty = true;\n\t  this.minLength = o.minLength || 0;\n\t  this.templates = {};\n\t  this.appendTo = o.appendTo || false;\n\t  this.css = _.mixin({}, css, o.appendTo ? css.appendTo : {});\n\t  this.cssClasses = o.cssClasses = _.mixin({}, css.defaultClasses, o.cssClasses || {});\n\t  this.cssClasses.prefix =\n\t    o.cssClasses.formattedPrefix || _.formatPrefix(this.cssClasses.prefix, this.cssClasses.noPrefix);\n\n\t  // bound functions\n\t  onSuggestionClick = _.bind(this._onSuggestionClick, this);\n\t  onSuggestionMouseEnter = _.bind(this._onSuggestionMouseEnter, this);\n\t  onSuggestionMouseLeave = _.bind(this._onSuggestionMouseLeave, this);\n\n\t  var cssClass = _.className(this.cssClasses.prefix, this.cssClasses.suggestion);\n\t  this.$menu = DOM.element(o.menu)\n\t    .on('mouseenter.aa', cssClass, onSuggestionMouseEnter)\n\t    .on('mouseleave.aa', cssClass, onSuggestionMouseLeave)\n\t    .on('click.aa', cssClass, onSuggestionClick);\n\n\t  this.$container = o.appendTo ? o.wrapper : this.$menu;\n\n\t  if (o.templates && o.templates.header) {\n\t    this.templates.header = _.templatify(o.templates.header);\n\t    this.$menu.prepend(this.templates.header());\n\t  }\n\n\t  if (o.templates && o.templates.empty) {\n\t    this.templates.empty = _.templatify(o.templates.empty);\n\t    this.$empty = DOM.element('<div class=\"' +\n\t      _.className(this.cssClasses.prefix, this.cssClasses.empty, true) + '\">' +\n\t      '</div>');\n\t    this.$menu.append(this.$empty);\n\t    this.$empty.hide();\n\t  }\n\n\t  this.datasets = _.map(o.datasets, function(oDataset) {\n\t    return initializeDataset(that.$menu, oDataset, o.cssClasses);\n\t  });\n\t  _.each(this.datasets, function(dataset) {\n\t    var root = dataset.getRoot();\n\t    if (root && root.parent().length === 0) {\n\t      that.$menu.append(root);\n\t    }\n\t    dataset.onSync('rendered', that._onRendered, that);\n\t  });\n\n\t  if (o.templates && o.templates.footer) {\n\t    this.templates.footer = _.templatify(o.templates.footer);\n\t    this.$menu.append(this.templates.footer());\n\t  }\n\n\t  var self = this;\n\t  DOM.element(window).resize(function() {\n\t    self._redraw();\n\t  });\n\t}\n\n\t// instance methods\n\t// ----------------\n\n\t_.mixin(Dropdown.prototype, EventEmitter, {\n\n\t  // ### private\n\n\t  _onSuggestionClick: function onSuggestionClick($e) {\n\t    this.trigger('suggestionClicked', DOM.element($e.currentTarget));\n\t  },\n\n\t  _onSuggestionMouseEnter: function onSuggestionMouseEnter($e) {\n\t    var elt = DOM.element($e.currentTarget);\n\t    if (elt.hasClass(_.className(this.cssClasses.prefix, this.cssClasses.cursor, true))) {\n\t      // we're already on the cursor\n\t      // => we're probably entering it again after leaving it for a nested div\n\t      return;\n\t    }\n\t    this._removeCursor();\n\n\t    // Fixes iOS double tap behaviour, by modifying the DOM right before the\n\t    // native href clicks happens, iOS will requires another tap to follow\n\t    // a suggestion that has an <a href> element inside\n\t    // https://www.google.com/search?q=ios+double+tap+bug+href\n\t    var suggestion = this;\n\t    setTimeout(function() {\n\t      // this exact line, when inside the main loop, will trigger a double tap bug\n\t      // on iOS devices\n\t      suggestion._setCursor(elt, false);\n\t    }, 0);\n\t  },\n\n\t  _onSuggestionMouseLeave: function onSuggestionMouseLeave($e) {\n\t    // $e.relatedTarget is the `EventTarget` the pointing device entered to\n\t    if ($e.relatedTarget) {\n\t      var elt = DOM.element($e.relatedTarget);\n\t      if (elt.closest('.' + _.className(this.cssClasses.prefix, this.cssClasses.cursor, true)).length > 0) {\n\t        // our father is a cursor\n\t        // => it means we're just leaving the suggestion for a nested div\n\t        return;\n\t      }\n\t    }\n\t    this._removeCursor();\n\t    this.trigger('cursorRemoved');\n\t  },\n\n\t  _onRendered: function onRendered(e, query) {\n\t    this.isEmpty = _.every(this.datasets, isDatasetEmpty);\n\n\t    if (this.isEmpty) {\n\t      if (query.length >= this.minLength) {\n\t        this.trigger('empty');\n\t      }\n\n\t      if (this.$empty) {\n\t        if (query.length < this.minLength) {\n\t          this._hide();\n\t        } else {\n\t          var html = this.templates.empty({\n\t            query: this.datasets[0] && this.datasets[0].query\n\t          });\n\t          this.$empty.html(html);\n\t          this.$empty.show();\n\t          this._show();\n\t        }\n\t      } else if (_.any(this.datasets, hasEmptyTemplate)) {\n\t        if (query.length < this.minLength) {\n\t          this._hide();\n\t        } else {\n\t          this._show();\n\t        }\n\t      } else {\n\t        this._hide();\n\t      }\n\t    } else if (this.isOpen) {\n\t      if (this.$empty) {\n\t        this.$empty.empty();\n\t        this.$empty.hide();\n\t      }\n\n\t      if (query.length >= this.minLength) {\n\t        this._show();\n\t      } else {\n\t        this._hide();\n\t      }\n\t    }\n\n\t    this.trigger('datasetRendered');\n\n\t    function isDatasetEmpty(dataset) {\n\t      return dataset.isEmpty();\n\t    }\n\n\t    function hasEmptyTemplate(dataset) {\n\t      return dataset.templates && dataset.templates.empty;\n\t    }\n\t  },\n\n\t  _hide: function() {\n\t    this.$container.hide();\n\t  },\n\n\t  _show: function() {\n\t    // can't use jQuery#show because $menu is a span element we want\n\t    // display: block; not dislay: inline;\n\t    this.$container.css('display', 'block');\n\n\t    this._redraw();\n\n\t    this.trigger('shown');\n\t  },\n\n\t  _redraw: function redraw() {\n\t    if (!this.isOpen || !this.appendTo) return;\n\n\t    this.trigger('redrawn');\n\t  },\n\n\t  _getSuggestions: function getSuggestions() {\n\t    return this.$menu.find(_.className(this.cssClasses.prefix, this.cssClasses.suggestion));\n\t  },\n\n\t  _getCursor: function getCursor() {\n\t    return this.$menu.find(_.className(this.cssClasses.prefix, this.cssClasses.cursor)).first();\n\t  },\n\n\t  _setCursor: function setCursor($el, updateInput) {\n\t    $el.first()\n\t      .addClass(_.className(this.cssClasses.prefix, this.cssClasses.cursor, true))\n\t      .attr('aria-selected', 'true');\n\t    this.trigger('cursorMoved', updateInput);\n\t  },\n\n\t  _removeCursor: function removeCursor() {\n\t    this._getCursor()\n\t      .removeClass(_.className(this.cssClasses.prefix, this.cssClasses.cursor, true))\n\t      .removeAttr('aria-selected');\n\t  },\n\n\t  _moveCursor: function moveCursor(increment) {\n\t    var $suggestions;\n\t    var $oldCursor;\n\t    var newCursorIndex;\n\t    var $newCursor;\n\n\t    if (!this.isOpen) {\n\t      return;\n\t    }\n\n\t    $oldCursor = this._getCursor();\n\t    $suggestions = this._getSuggestions();\n\n\t    this._removeCursor();\n\n\t    // shifting before and after modulo to deal with -1 index\n\t    newCursorIndex = $suggestions.index($oldCursor) + increment;\n\t    newCursorIndex = (newCursorIndex + 1) % ($suggestions.length + 1) - 1;\n\n\t    if (newCursorIndex === -1) {\n\t      this.trigger('cursorRemoved');\n\n\t      return;\n\t    } else if (newCursorIndex < -1) {\n\t      newCursorIndex = $suggestions.length - 1;\n\t    }\n\n\t    this._setCursor($newCursor = $suggestions.eq(newCursorIndex), true);\n\n\t    // in the case of scrollable overflow\n\t    // make sure the cursor is visible in the menu\n\t    this._ensureVisible($newCursor);\n\t  },\n\n\t  _ensureVisible: function ensureVisible($el) {\n\t    var elTop;\n\t    var elBottom;\n\t    var menuScrollTop;\n\t    var menuHeight;\n\n\t    elTop = $el.position().top;\n\t    elBottom = elTop + $el.height() +\n\t      parseInt($el.css('margin-top'), 10) +\n\t      parseInt($el.css('margin-bottom'), 10);\n\t    menuScrollTop = this.$menu.scrollTop();\n\t    menuHeight = this.$menu.height() +\n\t      parseInt(this.$menu.css('padding-top'), 10) +\n\t      parseInt(this.$menu.css('padding-bottom'), 10);\n\n\t    if (elTop < 0) {\n\t      this.$menu.scrollTop(menuScrollTop + elTop);\n\t    } else if (menuHeight < elBottom) {\n\t      this.$menu.scrollTop(menuScrollTop + (elBottom - menuHeight));\n\t    }\n\t  },\n\n\t  // ### public\n\n\t  close: function close() {\n\t    if (this.isOpen) {\n\t      this.isOpen = false;\n\n\t      this._removeCursor();\n\t      this._hide();\n\n\t      this.trigger('closed');\n\t    }\n\t  },\n\n\t  open: function open() {\n\t    if (!this.isOpen) {\n\t      this.isOpen = true;\n\n\t      if (!this.isEmpty) {\n\t        this._show();\n\t      }\n\n\t      this.trigger('opened');\n\t    }\n\t  },\n\n\t  setLanguageDirection: function setLanguageDirection(dir) {\n\t    this.$menu.css(dir === 'ltr' ? this.css.ltr : this.css.rtl);\n\t  },\n\n\t  moveCursorUp: function moveCursorUp() {\n\t    this._moveCursor(-1);\n\t  },\n\n\t  moveCursorDown: function moveCursorDown() {\n\t    this._moveCursor(+1);\n\t  },\n\n\t  getDatumForSuggestion: function getDatumForSuggestion($el) {\n\t    var datum = null;\n\n\t    if ($el.length) {\n\t      datum = {\n\t        raw: Dataset.extractDatum($el),\n\t        value: Dataset.extractValue($el),\n\t        datasetName: Dataset.extractDatasetName($el)\n\t      };\n\t    }\n\n\t    return datum;\n\t  },\n\n\t  getCurrentCursor: function getCurrentCursor() {\n\t    return this._getCursor().first();\n\t  },\n\n\t  getDatumForCursor: function getDatumForCursor() {\n\t    return this.getDatumForSuggestion(this._getCursor().first());\n\t  },\n\n\t  getDatumForTopSuggestion: function getDatumForTopSuggestion() {\n\t    return this.getDatumForSuggestion(this._getSuggestions().first());\n\t  },\n\n\t  cursorTopSuggestion: function cursorTopSuggestion() {\n\t    this._setCursor(this._getSuggestions().first(), false);\n\t  },\n\n\t  update: function update(query) {\n\t    _.each(this.datasets, updateDataset);\n\n\t    function updateDataset(dataset) {\n\t      dataset.update(query);\n\t    }\n\t  },\n\n\t  empty: function empty() {\n\t    _.each(this.datasets, clearDataset);\n\t    this.isEmpty = true;\n\n\t    function clearDataset(dataset) {\n\t      dataset.clear();\n\t    }\n\t  },\n\n\t  isVisible: function isVisible() {\n\t    return this.isOpen && !this.isEmpty;\n\t  },\n\n\t  destroy: function destroy() {\n\t    this.$menu.off('.aa');\n\n\t    this.$menu = null;\n\n\t    _.each(this.datasets, destroyDataset);\n\n\t    function destroyDataset(dataset) {\n\t      dataset.destroy();\n\t    }\n\t  }\n\t});\n\n\t// helper functions\n\t// ----------------\n\tDropdown.Dataset = Dataset;\n\n\tfunction initializeDataset($menu, oDataset, cssClasses) {\n\t  return new Dropdown.Dataset(_.mixin({$menu: $menu, cssClasses: cssClasses}, oDataset));\n\t}\n\n\tmodule.exports = Dropdown;\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar datasetKey = 'aaDataset';\n\tvar valueKey = 'aaValue';\n\tvar datumKey = 'aaDatum';\n\n\tvar _ = __webpack_require__(4);\n\tvar DOM = __webpack_require__(3);\n\tvar html = __webpack_require__(18);\n\tvar css = __webpack_require__(19);\n\tvar EventEmitter = __webpack_require__(8);\n\n\t// constructor\n\t// -----------\n\n\tfunction Dataset(o) {\n\t  o = o || {};\n\t  o.templates = o.templates || {};\n\n\t  if (!o.source) {\n\t    _.error('missing source');\n\t  }\n\n\t  if (o.name && !isValidName(o.name)) {\n\t    _.error('invalid dataset name: ' + o.name);\n\t  }\n\n\t  // tracks the last query the dataset was updated for\n\t  this.query = null;\n\t  this._isEmpty = true;\n\n\t  this.highlight = !!o.highlight;\n\t  this.name = typeof o.name === 'undefined' || o.name === null ? _.getUniqueId() : o.name;\n\n\t  this.source = o.source;\n\t  this.displayFn = getDisplayFn(o.display || o.displayKey);\n\n\t  this.debounce = o.debounce;\n\n\t  this.cache = o.cache !== false;\n\n\t  this.templates = getTemplates(o.templates, this.displayFn);\n\n\t  this.css = _.mixin({}, css, o.appendTo ? css.appendTo : {});\n\t  this.cssClasses = o.cssClasses = _.mixin({}, css.defaultClasses, o.cssClasses || {});\n\t  this.cssClasses.prefix =\n\t    o.cssClasses.formattedPrefix || _.formatPrefix(this.cssClasses.prefix, this.cssClasses.noPrefix);\n\n\t  var clazz = _.className(this.cssClasses.prefix, this.cssClasses.dataset);\n\t  this.$el = o.$menu && o.$menu.find(clazz + '-' + this.name).length > 0 ?\n\t    DOM.element(o.$menu.find(clazz + '-' + this.name)[0]) :\n\t    DOM.element(\n\t      html.dataset.replace('%CLASS%', this.name)\n\t        .replace('%PREFIX%', this.cssClasses.prefix)\n\t        .replace('%DATASET%', this.cssClasses.dataset)\n\t    );\n\n\t  this.$menu = o.$menu;\n\t  this.clearCachedSuggestions();\n\t}\n\n\t// static methods\n\t// --------------\n\n\tDataset.extractDatasetName = function extractDatasetName(el) {\n\t  return DOM.element(el).data(datasetKey);\n\t};\n\n\tDataset.extractValue = function extractValue(el) {\n\t  return DOM.element(el).data(valueKey);\n\t};\n\n\tDataset.extractDatum = function extractDatum(el) {\n\t  var datum = DOM.element(el).data(datumKey);\n\t  if (typeof datum === 'string') {\n\t    // Zepto has an automatic deserialization of the\n\t    // JSON encoded data attribute\n\t    datum = JSON.parse(datum);\n\t  }\n\t  return datum;\n\t};\n\n\t// instance methods\n\t// ----------------\n\n\t_.mixin(Dataset.prototype, EventEmitter, {\n\n\t  // ### private\n\n\t  _render: function render(query, suggestions) {\n\t    if (!this.$el) {\n\t      return;\n\t    }\n\t    var that = this;\n\n\t    var hasSuggestions;\n\t    var renderArgs = [].slice.call(arguments, 2);\n\t    this.$el.empty();\n\n\t    hasSuggestions = suggestions && suggestions.length;\n\t    this._isEmpty = !hasSuggestions;\n\n\t    if (!hasSuggestions && this.templates.empty) {\n\t      this.$el\n\t        .html(getEmptyHtml.apply(this, renderArgs))\n\t        .prepend(that.templates.header ? getHeaderHtml.apply(this, renderArgs) : null)\n\t        .append(that.templates.footer ? getFooterHtml.apply(this, renderArgs) : null);\n\t    } else if (hasSuggestions) {\n\t      this.$el\n\t        .html(getSuggestionsHtml.apply(this, renderArgs))\n\t        .prepend(that.templates.header ? getHeaderHtml.apply(this, renderArgs) : null)\n\t        .append(that.templates.footer ? getFooterHtml.apply(this, renderArgs) : null);\n\t    } else if (suggestions && !Array.isArray(suggestions)) {\n\t      throw new TypeError('suggestions must be an array');\n\t    }\n\n\t    if (this.$menu) {\n\t      this.$menu.addClass(\n\t        this.cssClasses.prefix + (hasSuggestions ? 'with' : 'without') + '-' + this.name\n\t      ).removeClass(\n\t        this.cssClasses.prefix + (hasSuggestions ? 'without' : 'with') + '-' + this.name\n\t      );\n\t    }\n\n\t    this.trigger('rendered', query);\n\n\t    function getEmptyHtml() {\n\t      var args = [].slice.call(arguments, 0);\n\t      args = [{query: query, isEmpty: true}].concat(args);\n\t      return that.templates.empty.apply(this, args);\n\t    }\n\n\t    function getSuggestionsHtml() {\n\t      var args = [].slice.call(arguments, 0);\n\t      var $suggestions;\n\t      var nodes;\n\t      var self = this;\n\n\t      var suggestionsHtml = html.suggestions.\n\t        replace('%PREFIX%', this.cssClasses.prefix).\n\t        replace('%SUGGESTIONS%', this.cssClasses.suggestions);\n\t      $suggestions = DOM\n\t        .element(suggestionsHtml)\n\t        .css(this.css.suggestions);\n\n\t      // jQuery#append doesn't support arrays as the first argument\n\t      // until version 1.8, see http://bugs.jquery.com/ticket/11231\n\t      nodes = _.map(suggestions, getSuggestionNode);\n\t      $suggestions.append.apply($suggestions, nodes);\n\n\t      return $suggestions;\n\n\t      function getSuggestionNode(suggestion) {\n\t        var $el;\n\n\t        var suggestionHtml = html.suggestion.\n\t          replace('%PREFIX%', self.cssClasses.prefix).\n\t          replace('%SUGGESTION%', self.cssClasses.suggestion);\n\t        $el = DOM.element(suggestionHtml)\n\t          .attr({\n\t            role: 'option',\n\t            id: ['option', Math.floor(Math.random() * 100000000)].join('-')\n\t          })\n\t          .append(that.templates.suggestion.apply(this, [suggestion].concat(args)));\n\n\t        $el.data(datasetKey, that.name);\n\t        $el.data(valueKey, that.displayFn(suggestion) || undefined); // this led to undefined return value\n\t        $el.data(datumKey, JSON.stringify(suggestion));\n\t        $el.children().each(function() { DOM.element(this).css(self.css.suggestionChild); });\n\n\t        return $el;\n\t      }\n\t    }\n\n\t    function getHeaderHtml() {\n\t      var args = [].slice.call(arguments, 0);\n\t      args = [{query: query, isEmpty: !hasSuggestions}].concat(args);\n\t      return that.templates.header.apply(this, args);\n\t    }\n\n\t    function getFooterHtml() {\n\t      var args = [].slice.call(arguments, 0);\n\t      args = [{query: query, isEmpty: !hasSuggestions}].concat(args);\n\t      return that.templates.footer.apply(this, args);\n\t    }\n\t  },\n\n\t  // ### public\n\n\t  getRoot: function getRoot() {\n\t    return this.$el;\n\t  },\n\n\t  update: function update(query) {\n\t    function handleSuggestions(suggestions) {\n\t      // if the update has been canceled or if the query has changed\n\t      // do not render the suggestions as they've become outdated\n\t      if (!this.canceled && query === this.query) {\n\t        // concat all the other arguments that could have been passed\n\t        // to the render function, and forward them to _render\n\t        var extraArgs = [].slice.call(arguments, 1);\n\t        this.cacheSuggestions(query, suggestions, extraArgs);\n\t        this._render.apply(this, [query, suggestions].concat(extraArgs));\n\t      }\n\t    }\n\n\t    this.query = query;\n\t    this.canceled = false;\n\n\t    if (this.shouldFetchFromCache(query)) {\n\t      handleSuggestions.apply(this, [this.cachedSuggestions].concat(this.cachedRenderExtraArgs));\n\t    } else {\n\t      var that = this;\n\t      var execSource = function() {\n\t        // When the call is debounced the condition avoid to do a useless\n\t        // request with the last character when the input has been cleared\n\t        if (!that.canceled) {\n\t          that.source(query, handleSuggestions.bind(that));\n\t        }\n\t      };\n\n\t      if (this.debounce) {\n\t        var later = function() {\n\t          that.debounceTimeout = null;\n\t          execSource();\n\t        };\n\t        clearTimeout(this.debounceTimeout);\n\t        this.debounceTimeout = setTimeout(later, this.debounce);\n\t      } else {\n\t        execSource();\n\t      }\n\t    }\n\t  },\n\n\t  cacheSuggestions: function cacheSuggestions(query, suggestions, extraArgs) {\n\t    this.cachedQuery = query;\n\t    this.cachedSuggestions = suggestions;\n\t    this.cachedRenderExtraArgs = extraArgs;\n\t  },\n\n\t  shouldFetchFromCache: function shouldFetchFromCache(query) {\n\t    return this.cache &&\n\t      this.cachedQuery === query &&\n\t      this.cachedSuggestions &&\n\t      this.cachedSuggestions.length;\n\t  },\n\n\t  clearCachedSuggestions: function clearCachedSuggestions() {\n\t    delete this.cachedQuery;\n\t    delete this.cachedSuggestions;\n\t    delete this.cachedRenderExtraArgs;\n\t  },\n\n\t  cancel: function cancel() {\n\t    this.canceled = true;\n\t  },\n\n\t  clear: function clear() {\n\t    if (this.$el) {\n\t      this.cancel();\n\t      this.$el.empty();\n\t      this.trigger('rendered', '');\n\t    }\n\t  },\n\n\t  isEmpty: function isEmpty() {\n\t    return this._isEmpty;\n\t  },\n\n\t  destroy: function destroy() {\n\t    this.clearCachedSuggestions();\n\t    this.$el = null;\n\t  }\n\t});\n\n\t// helper functions\n\t// ----------------\n\n\tfunction getDisplayFn(display) {\n\t  display = display || 'value';\n\n\t  return _.isFunction(display) ? display : displayFn;\n\n\t  function displayFn(obj) {\n\t    return obj[display];\n\t  }\n\t}\n\n\tfunction getTemplates(templates, displayFn) {\n\t  return {\n\t    empty: templates.empty && _.templatify(templates.empty),\n\t    header: templates.header && _.templatify(templates.header),\n\t    footer: templates.footer && _.templatify(templates.footer),\n\t    suggestion: templates.suggestion || suggestionTemplate\n\t  };\n\n\t  function suggestionTemplate(context) {\n\t    return '<p>' + displayFn(context) + '</p>';\n\t  }\n\t}\n\n\tfunction isValidName(str) {\n\t  // dashes, underscores, letters, and numbers\n\t  return (/^[_a-zA-Z0-9-]+$/).test(str);\n\t}\n\n\tmodule.exports = Dataset;\n\n\n/***/ },\n/* 18 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\n\tmodule.exports = {\n\t  wrapper: '<span class=\"%ROOT%\"></span>',\n\t  dropdown: '<span class=\"%PREFIX%%DROPDOWN_MENU%\"></span>',\n\t  dataset: '<div class=\"%PREFIX%%DATASET%-%CLASS%\"></div>',\n\t  suggestions: '<span class=\"%PREFIX%%SUGGESTIONS%\"></span>',\n\t  suggestion: '<div class=\"%PREFIX%%SUGGESTION%\"></div>'\n\t};\n\n\n/***/ },\n/* 19 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar _ = __webpack_require__(4);\n\n\tvar css = {\n\t  wrapper: {\n\t    position: 'relative',\n\t    display: 'inline-block'\n\t  },\n\t  hint: {\n\t    position: 'absolute',\n\t    top: '0',\n\t    left: '0',\n\t    borderColor: 'transparent',\n\t    boxShadow: 'none',\n\t    // #741: fix hint opacity issue on iOS\n\t    opacity: '1'\n\t  },\n\t  input: {\n\t    position: 'relative',\n\t    verticalAlign: 'top',\n\t    backgroundColor: 'transparent'\n\t  },\n\t  inputWithNoHint: {\n\t    position: 'relative',\n\t    verticalAlign: 'top'\n\t  },\n\t  dropdown: {\n\t    position: 'absolute',\n\t    top: '100%',\n\t    left: '0',\n\t    zIndex: '100',\n\t    display: 'none'\n\t  },\n\t  suggestions: {\n\t    display: 'block'\n\t  },\n\t  suggestion: {\n\t    whiteSpace: 'nowrap',\n\t    cursor: 'pointer'\n\t  },\n\t  suggestionChild: {\n\t    whiteSpace: 'normal'\n\t  },\n\t  ltr: {\n\t    left: '0',\n\t    right: 'auto'\n\t  },\n\t  rtl: {\n\t    left: 'auto',\n\t    right: '0'\n\t  },\n\t  defaultClasses: {\n\t    root: 'algolia-autocomplete',\n\t    prefix: 'aa',\n\t    noPrefix: false,\n\t    dropdownMenu: 'dropdown-menu',\n\t    input: 'input',\n\t    hint: 'hint',\n\t    suggestions: 'suggestions',\n\t    suggestion: 'suggestion',\n\t    cursor: 'cursor',\n\t    dataset: 'dataset',\n\t    empty: 'empty'\n\t  },\n\t  // will be merged with the default ones if appendTo is used\n\t  appendTo: {\n\t    wrapper: {\n\t      position: 'absolute',\n\t      zIndex: '100',\n\t      display: 'none'\n\t    },\n\t    input: {},\n\t    inputWithNoHint: {},\n\t    dropdown: {\n\t      display: 'block'\n\t    }\n\t  }\n\t};\n\n\t// ie specific styling\n\tif (_.isMsie()) {\n\t  // ie6-8 (and 9?) doesn't fire hover and click events for elements with\n\t  // transparent backgrounds, for a workaround, use 1x1 transparent gif\n\t  _.mixin(css.input, {\n\t    backgroundImage: 'url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)'\n\t  });\n\t}\n\n\t// ie7 and under specific styling\n\tif (_.isMsie() && _.isMsie() <= 7) {\n\t  // if someone can tell me why this is necessary to align\n\t  // the hint with the query in ie7, i'll send you $5 - @JakeHarding\n\t  _.mixin(css.input, {marginTop: '-1px'});\n\t}\n\n\tmodule.exports = css;\n\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tmodule.exports = {\n\t  hits: __webpack_require__(21),\n\t  popularIn: __webpack_require__(24)\n\t};\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar _ = __webpack_require__(4);\n\tvar version = __webpack_require__(22);\n\tvar parseAlgoliaClientVersion = __webpack_require__(23);\n\n\tfunction createMultiQuerySource() {\n\t  var queries = [];\n\t  var lastResults = [];\n\t  var lastSearch = window.Promise.resolve();\n\n\t  function requestSearch(queryClient, queryIndex) {\n\t    // Since all requests happen synchronously, this is executed once all the\n\t    // sources have been requested.\n\t    return window.Promise.resolve()\n\t      .then(function() {\n\t        if (queries.length) {\n\t          lastSearch = queryClient.search(queries);\n\t          queries = [];\n\t        }\n\n\t        return lastSearch;\n\t      })\n\t      .then(function(result) {\n\t        if (!result) {\n\t          return undefined;\n\t        }\n\n\t        lastResults = result.results;\n\t        return lastResults[queryIndex];\n\t      });\n\t  }\n\n\t  return function multiQuerySource(searchIndex, params) {\n\t    return function search(query, cb) {\n\t      var queryClient = searchIndex.as;\n\t      var queryIndex =\n\t        queries.push({\n\t          indexName: searchIndex.indexName,\n\t          query: query,\n\t          params: params\n\t        }) - 1;\n\n\t      requestSearch(queryClient, queryIndex)\n\t        .then(function(result) {\n\t          if (result) {\n\t            cb(result.hits, result);\n\t          }\n\t        })\n\t        .catch(function(error) {\n\t          _.error(error.message);\n\t        });\n\t    };\n\t  };\n\t}\n\n\tvar source = createMultiQuerySource();\n\n\tmodule.exports = function search(index, params) {\n\t  var algoliaVersion = parseAlgoliaClientVersion(index.as._ua);\n\n\t  if (algoliaVersion && algoliaVersion[0] >= 3 && algoliaVersion[1] > 20) {\n\t    var autocompleteUserAgent = 'autocomplete.js ' + version;\n\n\t    if (index.as._ua.indexOf(autocompleteUserAgent) === -1) {\n\t      index.as._ua += '; ' + autocompleteUserAgent;\n\t    }\n\t  }\n\n\t  return source(index, params);\n\t};\n\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \"0.38.1\";\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\n\tmodule.exports = function parseAlgoliaClientVersion(agent) {\n\t  var parsed =\n\t    // User agent for algoliasearch >= 3.33.0\n\t    agent.match(/Algolia for JavaScript \\((\\d+\\.)(\\d+\\.)(\\d+)\\)/) ||\n\t    // User agent for algoliasearch < 3.33.0\n\t    agent.match(/Algolia for vanilla JavaScript (\\d+\\.)(\\d+\\.)(\\d+)/);\n\n\t  if (parsed) {\n\t    return [parsed[1], parsed[2], parsed[3]];\n\t  }\n\n\t  return undefined;\n\t};\n\n\n/***/ },\n/* 24 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar _ = __webpack_require__(4);\n\tvar version = __webpack_require__(22);\n\tvar parseAlgoliaClientVersion = __webpack_require__(23);\n\n\tmodule.exports = function popularIn(index, params, details, options) {\n\t  var algoliaVersion = parseAlgoliaClientVersion(index.as._ua);\n\t  if (algoliaVersion && algoliaVersion[0] >= 3 && algoliaVersion[1] > 20) {\n\t    params = params || {};\n\t    params.additionalUA = 'autocomplete.js ' + version;\n\t  }\n\t  if (!details.source) {\n\t    return _.error(\"Missing 'source' key\");\n\t  }\n\t  var source = _.isFunction(details.source) ? details.source : function(hit) { return hit[details.source]; };\n\n\t  if (!details.index) {\n\t    return _.error(\"Missing 'index' key\");\n\t  }\n\t  var detailsIndex = details.index;\n\n\t  options = options || {};\n\n\t  return sourceFn;\n\n\t  function sourceFn(query, cb) {\n\t    index.search(query, params, function(error, content) {\n\t      if (error) {\n\t        _.error(error.message);\n\t        return;\n\t      }\n\n\t      if (content.hits.length > 0) {\n\t        var first = content.hits[0];\n\n\t        var detailsParams = _.mixin({hitsPerPage: 0}, details);\n\t        delete detailsParams.source; // not a query parameter\n\t        delete detailsParams.index; // not a query parameter\n\n\t        var detailsAlgoliaVersion = parseAlgoliaClientVersion(detailsIndex.as._ua);\n\t        if (detailsAlgoliaVersion && detailsAlgoliaVersion[0] >= 3 && detailsAlgoliaVersion[1] > 20) {\n\t          params.additionalUA = 'autocomplete.js ' + version;\n\t        }\n\n\t        detailsIndex.search(source(first), detailsParams, function(error2, content2) {\n\t          if (error2) {\n\t            _.error(error2.message);\n\t            return;\n\t          }\n\n\t          var suggestions = [];\n\n\t          // add the 'all department' entry before others\n\t          if (options.includeAll) {\n\t            var label = options.allTitle || 'All departments';\n\t            suggestions.push(_.mixin({\n\t              facet: {value: label, count: content2.nbHits}\n\t            }, _.cloneDeep(first)));\n\t          }\n\n\t          // enrich the first hit iterating over the facets\n\t          _.each(content2.facets, function(values, facet) {\n\t            _.each(values, function(count, value) {\n\t              suggestions.push(_.mixin({\n\t                facet: {facet: facet, value: value, count: count}\n\t              }, _.cloneDeep(first)));\n\t            });\n\t          });\n\n\t          // append all other hits\n\t          for (var i = 1; i < content.hits.length; ++i) {\n\t            suggestions.push(content.hits[i]);\n\t          }\n\n\t          cb(suggestions, content);\n\t        });\n\n\t        return;\n\t      }\n\n\t      cb([]);\n\t    });\n\t  }\n\t};\n\n\n/***/ }\n/******/ ]);"
  },
  {
    "path": "js/autocomplete.js/dist/autocomplete.jquery.js",
    "content": "/*!\n * autocomplete.js 0.38.1\n * https://github.com/algolia/autocomplete.js\n * Copyright 2021 Algolia, Inc. and other contributors; Licensed MIT\n */\n/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n\n\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tmodule.exports = __webpack_require__(1);\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\t// setup DOM element\n\tvar DOM = __webpack_require__(2);\n\tvar $ = __webpack_require__(3);\n\tDOM.element = $;\n\n\t// setup utils functions\n\tvar _ = __webpack_require__(4);\n\t_.isArray = $.isArray;\n\t_.isFunction = $.isFunction;\n\t_.isObject = $.isPlainObject;\n\t_.bind = $.proxy;\n\t_.each = function(collection, cb) {\n\t  // stupid argument order for jQuery.each\n\t  $.each(collection, reverseArgs);\n\t  function reverseArgs(index, value) {\n\t    return cb(value, index);\n\t  }\n\t};\n\t_.map = $.map;\n\t_.mixin = $.extend;\n\t_.Event = $.Event;\n\n\tvar Typeahead = __webpack_require__(5);\n\tvar EventBus = __webpack_require__(6);\n\n\tvar old;\n\tvar typeaheadKey;\n\tvar methods;\n\n\told = $.fn.autocomplete;\n\n\ttypeaheadKey = 'aaAutocomplete';\n\n\tmethods = {\n\t  // supported signatures:\n\t  // function(o, dataset, dataset, ...)\n\t  // function(o, [dataset, dataset, ...])\n\t  initialize: function initialize(o, datasets) {\n\t    datasets = _.isArray(datasets) ? datasets : [].slice.call(arguments, 1);\n\n\t    o = o || {};\n\n\t    return this.each(attach);\n\n\t    function attach() {\n\t      var $input = $(this);\n\t      var eventBus = new EventBus({el: $input});\n\t      var typeahead;\n\n\t      typeahead = new Typeahead({\n\t        input: $input,\n\t        eventBus: eventBus,\n\t        dropdownMenuContainer: o.dropdownMenuContainer,\n\t        hint: o.hint === undefined ? true : !!o.hint,\n\t        minLength: o.minLength,\n\t        autoselect: o.autoselect,\n\t        autoselectOnBlur: o.autoselectOnBlur,\n\t        tabAutocomplete: o.tabAutocomplete,\n\t        openOnFocus: o.openOnFocus,\n\t        templates: o.templates,\n\t        debug: o.debug,\n\t        clearOnSelected: o.clearOnSelected,\n\t        cssClasses: o.cssClasses,\n\t        datasets: datasets,\n\t        keyboardShortcuts: o.keyboardShortcuts,\n\t        appendTo: o.appendTo,\n\t        autoWidth: o.autoWidth\n\t      });\n\n\t      $input.data(typeaheadKey, typeahead);\n\t    }\n\t  },\n\n\t  open: function open() {\n\t    return this.each(openTypeahead);\n\n\t    function openTypeahead() {\n\t      var $input = $(this);\n\t      var typeahead;\n\n\t      if (typeahead = $input.data(typeaheadKey)) {\n\t        typeahead.open();\n\t      }\n\t    }\n\t  },\n\n\t  close: function close() {\n\t    return this.each(closeTypeahead);\n\n\t    function closeTypeahead() {\n\t      var $input = $(this);\n\t      var typeahead;\n\n\t      if (typeahead = $input.data(typeaheadKey)) {\n\t        typeahead.close();\n\t      }\n\t    }\n\t  },\n\n\t  val: function val(newVal) {\n\t    // mirror jQuery#val functionality: read operate on first match,\n\t    // write operates on all matches\n\t    return !arguments.length ? getVal(this.first()) : this.each(setVal);\n\n\t    function setVal() {\n\t      var $input = $(this);\n\t      var typeahead;\n\n\t      if (typeahead = $input.data(typeaheadKey)) {\n\t        typeahead.setVal(newVal);\n\t      }\n\t    }\n\n\t    function getVal($input) {\n\t      var typeahead;\n\t      var query;\n\n\t      if (typeahead = $input.data(typeaheadKey)) {\n\t        query = typeahead.getVal();\n\t      }\n\n\t      return query;\n\t    }\n\t  },\n\n\t  destroy: function destroy() {\n\t    return this.each(unattach);\n\n\t    function unattach() {\n\t      var $input = $(this);\n\t      var typeahead;\n\n\t      if (typeahead = $input.data(typeaheadKey)) {\n\t        typeahead.destroy();\n\t        $input.removeData(typeaheadKey);\n\t      }\n\t    }\n\t  }\n\t};\n\n\t$.fn.autocomplete = function(method) {\n\t  var tts;\n\n\t  // methods that should only act on intialized typeaheads\n\t  if (methods[method] && method !== 'initialize') {\n\t    // filter out non-typeahead inputs\n\t    tts = this.filter(function() { return !!$(this).data(typeaheadKey); });\n\t    return methods[method].apply(tts, [].slice.call(arguments, 1));\n\t  }\n\t  return methods.initialize.apply(this, arguments);\n\t};\n\n\t$.fn.autocomplete.noConflict = function noConflict() {\n\t  $.fn.autocomplete = old;\n\t  return this;\n\t};\n\n\t$.fn.autocomplete.sources = Typeahead.sources;\n\t$.fn.autocomplete.escapeHighlightedString = _.escapeHighlightedString;\n\n\tmodule.exports = $.fn.autocomplete;\n\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\n\tmodule.exports = {\n\t  element: null\n\t};\n\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\tmodule.exports = jQuery;\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar DOM = __webpack_require__(2);\n\n\tfunction escapeRegExp(str) {\n\t  return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n\t}\n\n\tmodule.exports = {\n\t  // those methods are implemented differently\n\t  // depending on which build it is, using\n\t  // $... or angular... or Zepto... or require(...)\n\t  isArray: null,\n\t  isFunction: null,\n\t  isObject: null,\n\t  bind: null,\n\t  each: null,\n\t  map: null,\n\t  mixin: null,\n\n\t  isMsie: function(agentString) {\n\t    if (agentString === undefined) { agentString = navigator.userAgent; }\n\t    // from https://github.com/ded/bowser/blob/master/bowser.js\n\t    if ((/(msie|trident)/i).test(agentString)) {\n\t      var match = agentString.match(/(msie |rv:)(\\d+(.\\d+)?)/i);\n\t      if (match) { return match[2]; }\n\t    }\n\t    return false;\n\t  },\n\n\t  // http://stackoverflow.com/a/6969486\n\t  escapeRegExChars: function(str) {\n\t    return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n\t  },\n\n\t  isNumber: function(obj) { return typeof obj === 'number'; },\n\n\t  toStr: function toStr(s) {\n\t    return s === undefined || s === null ? '' : s + '';\n\t  },\n\n\t  cloneDeep: function cloneDeep(obj) {\n\t    var clone = this.mixin({}, obj);\n\t    var self = this;\n\t    this.each(clone, function(value, key) {\n\t      if (value) {\n\t        if (self.isArray(value)) {\n\t          clone[key] = [].concat(value);\n\t        } else if (self.isObject(value)) {\n\t          clone[key] = self.cloneDeep(value);\n\t        }\n\t      }\n\t    });\n\t    return clone;\n\t  },\n\n\t  error: function(msg) {\n\t    throw new Error(msg);\n\t  },\n\n\t  every: function(obj, test) {\n\t    var result = true;\n\t    if (!obj) {\n\t      return result;\n\t    }\n\t    this.each(obj, function(val, key) {\n\t      if (result) {\n\t        result = test.call(null, val, key, obj) && result;\n\t      }\n\t    });\n\t    return !!result;\n\t  },\n\n\t  any: function(obj, test) {\n\t    var found = false;\n\t    if (!obj) {\n\t      return found;\n\t    }\n\t    this.each(obj, function(val, key) {\n\t      if (test.call(null, val, key, obj)) {\n\t        found = true;\n\t        return false;\n\t      }\n\t    });\n\t    return found;\n\t  },\n\n\t  getUniqueId: (function() {\n\t    var counter = 0;\n\t    return function() { return counter++; };\n\t  })(),\n\n\t  templatify: function templatify(obj) {\n\t    if (this.isFunction(obj)) {\n\t      return obj;\n\t    }\n\t    var $template = DOM.element(obj);\n\t    if ($template.prop('tagName') === 'SCRIPT') {\n\t      return function template() { return $template.text(); };\n\t    }\n\t    return function template() { return String(obj); };\n\t  },\n\n\t  defer: function(fn) { setTimeout(fn, 0); },\n\n\t  noop: function() {},\n\n\t  formatPrefix: function(prefix, noPrefix) {\n\t    return noPrefix ? '' : prefix + '-';\n\t  },\n\n\t  className: function(prefix, clazz, skipDot) {\n\t    return (skipDot ? '' : '.') + prefix + clazz;\n\t  },\n\n\t  escapeHighlightedString: function(str, highlightPreTag, highlightPostTag) {\n\t    highlightPreTag = highlightPreTag || '<em>';\n\t    var pre = document.createElement('div');\n\t    pre.appendChild(document.createTextNode(highlightPreTag));\n\n\t    highlightPostTag = highlightPostTag || '</em>';\n\t    var post = document.createElement('div');\n\t    post.appendChild(document.createTextNode(highlightPostTag));\n\n\t    var div = document.createElement('div');\n\t    div.appendChild(document.createTextNode(str));\n\t    return div.innerHTML\n\t      .replace(RegExp(escapeRegExp(pre.innerHTML), 'g'), highlightPreTag)\n\t      .replace(RegExp(escapeRegExp(post.innerHTML), 'g'), highlightPostTag);\n\t  }\n\t};\n\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar attrsKey = 'aaAttrs';\n\n\tvar _ = __webpack_require__(4);\n\tvar DOM = __webpack_require__(2);\n\tvar EventBus = __webpack_require__(6);\n\tvar Input = __webpack_require__(7);\n\tvar Dropdown = __webpack_require__(16);\n\tvar html = __webpack_require__(18);\n\tvar css = __webpack_require__(19);\n\n\t// constructor\n\t// -----------\n\n\t// THOUGHT: what if datasets could dynamically be added/removed?\n\tfunction Typeahead(o) {\n\t  var $menu;\n\t  var $hint;\n\n\t  o = o || {};\n\n\t  if (!o.input) {\n\t    _.error('missing input');\n\t  }\n\n\t  this.isActivated = false;\n\t  this.debug = !!o.debug;\n\t  this.autoselect = !!o.autoselect;\n\t  this.autoselectOnBlur = !!o.autoselectOnBlur;\n\t  this.openOnFocus = !!o.openOnFocus;\n\t  this.minLength = _.isNumber(o.minLength) ? o.minLength : 1;\n\t  this.autoWidth = (o.autoWidth === undefined) ? true : !!o.autoWidth;\n\t  this.clearOnSelected = !!o.clearOnSelected;\n\t  this.tabAutocomplete = (o.tabAutocomplete === undefined) ? true : !!o.tabAutocomplete;\n\n\t  o.hint = !!o.hint;\n\n\t  if (o.hint && o.appendTo) {\n\t    throw new Error('[autocomplete.js] hint and appendTo options can\\'t be used at the same time');\n\t  }\n\n\t  this.css = o.css = _.mixin({}, css, o.appendTo ? css.appendTo : {});\n\t  this.cssClasses = o.cssClasses = _.mixin({}, css.defaultClasses, o.cssClasses || {});\n\t  this.cssClasses.prefix =\n\t    o.cssClasses.formattedPrefix = _.formatPrefix(this.cssClasses.prefix, this.cssClasses.noPrefix);\n\t  this.listboxId = o.listboxId = [this.cssClasses.root, 'listbox', _.getUniqueId()].join('-');\n\n\t  var domElts = buildDom(o);\n\n\t  this.$node = domElts.wrapper;\n\t  var $input = this.$input = domElts.input;\n\t  $menu = domElts.menu;\n\t  $hint = domElts.hint;\n\n\t  if (o.dropdownMenuContainer) {\n\t    DOM.element(o.dropdownMenuContainer)\n\t      .css('position', 'relative') // ensure the container has a relative position\n\t      .append($menu.css('top', '0')); // override the top: 100%\n\t  }\n\n\t  // #705: if there's scrollable overflow, ie doesn't support\n\t  // blur cancellations when the scrollbar is clicked\n\t  //\n\t  // #351: preventDefault won't cancel blurs in ie <= 8\n\t  $input.on('blur.aa', function($e) {\n\t    var active = document.activeElement;\n\t    if (_.isMsie() && ($menu[0] === active || $menu[0].contains(active))) {\n\t      $e.preventDefault();\n\t      // stop immediate in order to prevent Input#_onBlur from\n\t      // getting exectued\n\t      $e.stopImmediatePropagation();\n\t      _.defer(function() { $input.focus(); });\n\t    }\n\t  });\n\n\t  // #351: prevents input blur due to clicks within dropdown menu\n\t  $menu.on('mousedown.aa', function($e) { $e.preventDefault(); });\n\n\t  this.eventBus = o.eventBus || new EventBus({el: $input});\n\n\t  this.dropdown = new Typeahead.Dropdown({\n\t    appendTo: o.appendTo,\n\t    wrapper: this.$node,\n\t    menu: $menu,\n\t    datasets: o.datasets,\n\t    templates: o.templates,\n\t    cssClasses: o.cssClasses,\n\t    minLength: this.minLength\n\t  })\n\t    .onSync('suggestionClicked', this._onSuggestionClicked, this)\n\t    .onSync('cursorMoved', this._onCursorMoved, this)\n\t    .onSync('cursorRemoved', this._onCursorRemoved, this)\n\t    .onSync('opened', this._onOpened, this)\n\t    .onSync('closed', this._onClosed, this)\n\t    .onSync('shown', this._onShown, this)\n\t    .onSync('empty', this._onEmpty, this)\n\t    .onSync('redrawn', this._onRedrawn, this)\n\t    .onAsync('datasetRendered', this._onDatasetRendered, this);\n\n\t  this.input = new Typeahead.Input({input: $input, hint: $hint})\n\t    .onSync('focused', this._onFocused, this)\n\t    .onSync('blurred', this._onBlurred, this)\n\t    .onSync('enterKeyed', this._onEnterKeyed, this)\n\t    .onSync('tabKeyed', this._onTabKeyed, this)\n\t    .onSync('escKeyed', this._onEscKeyed, this)\n\t    .onSync('upKeyed', this._onUpKeyed, this)\n\t    .onSync('downKeyed', this._onDownKeyed, this)\n\t    .onSync('leftKeyed', this._onLeftKeyed, this)\n\t    .onSync('rightKeyed', this._onRightKeyed, this)\n\t    .onSync('queryChanged', this._onQueryChanged, this)\n\t    .onSync('whitespaceChanged', this._onWhitespaceChanged, this);\n\n\t  this._bindKeyboardShortcuts(o);\n\n\t  this._setLanguageDirection();\n\t}\n\n\t// instance methods\n\t// ----------------\n\n\t_.mixin(Typeahead.prototype, {\n\t  // ### private\n\n\t  _bindKeyboardShortcuts: function(options) {\n\t    if (!options.keyboardShortcuts) {\n\t      return;\n\t    }\n\t    var $input = this.$input;\n\t    var keyboardShortcuts = [];\n\t    _.each(options.keyboardShortcuts, function(key) {\n\t      if (typeof key === 'string') {\n\t        key = key.toUpperCase().charCodeAt(0);\n\t      }\n\t      keyboardShortcuts.push(key);\n\t    });\n\t    DOM.element(document).keydown(function(event) {\n\t      var elt = (event.target || event.srcElement);\n\t      var tagName = elt.tagName;\n\t      if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {\n\t        // already in an input\n\t        return;\n\t      }\n\n\t      var which = event.which || event.keyCode;\n\t      if (keyboardShortcuts.indexOf(which) === -1) {\n\t        // not the right shortcut\n\t        return;\n\t      }\n\n\t      $input.focus();\n\t      event.stopPropagation();\n\t      event.preventDefault();\n\t    });\n\t  },\n\n\t  _onSuggestionClicked: function onSuggestionClicked(type, $el) {\n\t    var datum;\n\t    var context = {selectionMethod: 'click'};\n\n\t    if (datum = this.dropdown.getDatumForSuggestion($el)) {\n\t      this._select(datum, context);\n\t    }\n\t  },\n\n\t  _onCursorMoved: function onCursorMoved(event, updateInput) {\n\t    var datum = this.dropdown.getDatumForCursor();\n\t    var currentCursorId = this.dropdown.getCurrentCursor().attr('id');\n\t    this.input.setActiveDescendant(currentCursorId);\n\n\t    if (datum) {\n\t      if (updateInput) {\n\t        this.input.setInputValue(datum.value, true);\n\t      }\n\n\t      this.eventBus.trigger('cursorchanged', datum.raw, datum.datasetName);\n\t    }\n\t  },\n\n\t  _onCursorRemoved: function onCursorRemoved() {\n\t    this.input.resetInputValue();\n\t    this._updateHint();\n\t    this.eventBus.trigger('cursorremoved');\n\t  },\n\n\t  _onDatasetRendered: function onDatasetRendered() {\n\t    this._updateHint();\n\n\t    this.eventBus.trigger('updated');\n\t  },\n\n\t  _onOpened: function onOpened() {\n\t    this._updateHint();\n\t    this.input.expand();\n\n\t    this.eventBus.trigger('opened');\n\t  },\n\n\t  _onEmpty: function onEmpty() {\n\t    this.eventBus.trigger('empty');\n\t  },\n\n\t  _onRedrawn: function onRedrawn() {\n\t    this.$node.css('top', 0 + 'px');\n\t    this.$node.css('left', 0 + 'px');\n\n\t    var inputRect = this.$input[0].getBoundingClientRect();\n\n\t    if (this.autoWidth) {\n\t      this.$node.css('width', inputRect.width + 'px');\n\t    }\n\n\t    var wrapperRect = this.$node[0].getBoundingClientRect();\n\n\t    var top = inputRect.bottom - wrapperRect.top;\n\t    this.$node.css('top', top + 'px');\n\t    var left = inputRect.left - wrapperRect.left;\n\t    this.$node.css('left', left + 'px');\n\n\t    this.eventBus.trigger('redrawn');\n\t  },\n\n\t  _onShown: function onShown() {\n\t    this.eventBus.trigger('shown');\n\t    if (this.autoselect) {\n\t      this.dropdown.cursorTopSuggestion();\n\t    }\n\t  },\n\n\t  _onClosed: function onClosed() {\n\t    this.input.clearHint();\n\t    this.input.removeActiveDescendant();\n\t    this.input.collapse();\n\n\t    this.eventBus.trigger('closed');\n\t  },\n\n\t  _onFocused: function onFocused() {\n\t    this.isActivated = true;\n\n\t    if (this.openOnFocus) {\n\t      var query = this.input.getQuery();\n\t      if (query.length >= this.minLength) {\n\t        this.dropdown.update(query);\n\t      } else {\n\t        this.dropdown.empty();\n\t      }\n\n\t      this.dropdown.open();\n\t    }\n\t  },\n\n\t  _onBlurred: function onBlurred() {\n\t    var cursorDatum;\n\t    var topSuggestionDatum;\n\n\t    cursorDatum = this.dropdown.getDatumForCursor();\n\t    topSuggestionDatum = this.dropdown.getDatumForTopSuggestion();\n\t    var context = {selectionMethod: 'blur'};\n\n\t    if (!this.debug) {\n\t      if (this.autoselectOnBlur && cursorDatum) {\n\t        this._select(cursorDatum, context);\n\t      } else if (this.autoselectOnBlur && topSuggestionDatum) {\n\t        this._select(topSuggestionDatum, context);\n\t      } else {\n\t        this.isActivated = false;\n\t        this.dropdown.empty();\n\t        this.dropdown.close();\n\t      }\n\t    }\n\t  },\n\n\t  _onEnterKeyed: function onEnterKeyed(type, $e) {\n\t    var cursorDatum;\n\t    var topSuggestionDatum;\n\n\t    cursorDatum = this.dropdown.getDatumForCursor();\n\t    topSuggestionDatum = this.dropdown.getDatumForTopSuggestion();\n\t    var context = {selectionMethod: 'enterKey'};\n\n\t    if (cursorDatum) {\n\t      this._select(cursorDatum, context);\n\t      $e.preventDefault();\n\t    } else if (this.autoselect && topSuggestionDatum) {\n\t      this._select(topSuggestionDatum, context);\n\t      $e.preventDefault();\n\t    }\n\t  },\n\n\t  _onTabKeyed: function onTabKeyed(type, $e) {\n\t    if (!this.tabAutocomplete) {\n\t      // Closing the dropdown enables further tabbing\n\t      this.dropdown.close();\n\t      return;\n\t    }\n\n\t    var datum;\n\t    var context = {selectionMethod: 'tabKey'};\n\n\t    if (datum = this.dropdown.getDatumForCursor()) {\n\t      this._select(datum, context);\n\t      $e.preventDefault();\n\t    } else {\n\t      this._autocomplete(true);\n\t    }\n\t  },\n\n\t  _onEscKeyed: function onEscKeyed() {\n\t    this.dropdown.close();\n\t    this.input.resetInputValue();\n\t  },\n\n\t  _onUpKeyed: function onUpKeyed() {\n\t    var query = this.input.getQuery();\n\n\t    if (this.dropdown.isEmpty && query.length >= this.minLength) {\n\t      this.dropdown.update(query);\n\t    } else {\n\t      this.dropdown.moveCursorUp();\n\t    }\n\n\t    this.dropdown.open();\n\t  },\n\n\t  _onDownKeyed: function onDownKeyed() {\n\t    var query = this.input.getQuery();\n\n\t    if (this.dropdown.isEmpty && query.length >= this.minLength) {\n\t      this.dropdown.update(query);\n\t    } else {\n\t      this.dropdown.moveCursorDown();\n\t    }\n\n\t    this.dropdown.open();\n\t  },\n\n\t  _onLeftKeyed: function onLeftKeyed() {\n\t    if (this.dir === 'rtl') {\n\t      this._autocomplete();\n\t    }\n\t  },\n\n\t  _onRightKeyed: function onRightKeyed() {\n\t    if (this.dir === 'ltr') {\n\t      this._autocomplete();\n\t    }\n\t  },\n\n\t  _onQueryChanged: function onQueryChanged(e, query) {\n\t    this.input.clearHintIfInvalid();\n\n\t    if (query.length >= this.minLength) {\n\t      this.dropdown.update(query);\n\t    } else {\n\t      this.dropdown.empty();\n\t    }\n\n\t    this.dropdown.open();\n\t    this._setLanguageDirection();\n\t  },\n\n\t  _onWhitespaceChanged: function onWhitespaceChanged() {\n\t    this._updateHint();\n\t    this.dropdown.open();\n\t  },\n\n\t  _setLanguageDirection: function setLanguageDirection() {\n\t    var dir = this.input.getLanguageDirection();\n\n\t    if (this.dir !== dir) {\n\t      this.dir = dir;\n\t      this.$node.css('direction', dir);\n\t      this.dropdown.setLanguageDirection(dir);\n\t    }\n\t  },\n\n\t  _updateHint: function updateHint() {\n\t    var datum;\n\t    var val;\n\t    var query;\n\t    var escapedQuery;\n\t    var frontMatchRegEx;\n\t    var match;\n\n\t    datum = this.dropdown.getDatumForTopSuggestion();\n\n\t    if (datum && this.dropdown.isVisible() && !this.input.hasOverflow()) {\n\t      val = this.input.getInputValue();\n\t      query = Input.normalizeQuery(val);\n\t      escapedQuery = _.escapeRegExChars(query);\n\n\t      // match input value, then capture trailing text\n\t      frontMatchRegEx = new RegExp('^(?:' + escapedQuery + ')(.+$)', 'i');\n\t      match = frontMatchRegEx.exec(datum.value);\n\n\t      // clear hint if there's no trailing text\n\t      if (match) {\n\t        this.input.setHint(val + match[1]);\n\t      } else {\n\t        this.input.clearHint();\n\t      }\n\t    } else {\n\t      this.input.clearHint();\n\t    }\n\t  },\n\n\t  _autocomplete: function autocomplete(laxCursor) {\n\t    var hint;\n\t    var query;\n\t    var isCursorAtEnd;\n\t    var datum;\n\n\t    hint = this.input.getHint();\n\t    query = this.input.getQuery();\n\t    isCursorAtEnd = laxCursor || this.input.isCursorAtEnd();\n\n\t    if (hint && query !== hint && isCursorAtEnd) {\n\t      datum = this.dropdown.getDatumForTopSuggestion();\n\t      if (datum) {\n\t        this.input.setInputValue(datum.value);\n\t      }\n\n\t      this.eventBus.trigger('autocompleted', datum.raw, datum.datasetName);\n\t    }\n\t  },\n\n\t  _select: function select(datum, context) {\n\t    if (typeof datum.value !== 'undefined') {\n\t      this.input.setQuery(datum.value);\n\t    }\n\t    if (this.clearOnSelected) {\n\t      this.setVal('');\n\t    } else {\n\t      this.input.setInputValue(datum.value, true);\n\t    }\n\n\t    this._setLanguageDirection();\n\n\t    var event = this.eventBus.trigger('selected', datum.raw, datum.datasetName, context);\n\t    if (event.isDefaultPrevented() === false) {\n\t      this.dropdown.close();\n\n\t      // #118: allow click event to bubble up to the body before removing\n\t      // the suggestions otherwise we break event delegation\n\t      _.defer(_.bind(this.dropdown.empty, this.dropdown));\n\t    }\n\t  },\n\n\t  // ### public\n\n\t  open: function open() {\n\t    // if the menu is not activated yet, we need to update\n\t    // the underlying dropdown menu to trigger the search\n\t    // otherwise we're not gonna see anything\n\t    if (!this.isActivated) {\n\t      var query = this.input.getInputValue();\n\t      if (query.length >= this.minLength) {\n\t        this.dropdown.update(query);\n\t      } else {\n\t        this.dropdown.empty();\n\t      }\n\t    }\n\t    this.dropdown.open();\n\t  },\n\n\t  close: function close() {\n\t    this.dropdown.close();\n\t  },\n\n\t  setVal: function setVal(val) {\n\t    // expect val to be a string, so be safe, and coerce\n\t    val = _.toStr(val);\n\n\t    if (this.isActivated) {\n\t      this.input.setInputValue(val);\n\t    } else {\n\t      this.input.setQuery(val);\n\t      this.input.setInputValue(val, true);\n\t    }\n\n\t    this._setLanguageDirection();\n\t  },\n\n\t  getVal: function getVal() {\n\t    return this.input.getQuery();\n\t  },\n\n\t  destroy: function destroy() {\n\t    this.input.destroy();\n\t    this.dropdown.destroy();\n\n\t    destroyDomStructure(this.$node, this.cssClasses);\n\n\t    this.$node = null;\n\t  },\n\n\t  getWrapper: function getWrapper() {\n\t    return this.dropdown.$container[0];\n\t  }\n\t});\n\n\tfunction buildDom(options) {\n\t  var $input;\n\t  var $wrapper;\n\t  var $dropdown;\n\t  var $hint;\n\n\t  $input = DOM.element(options.input);\n\t  $wrapper = DOM\n\t    .element(html.wrapper.replace('%ROOT%', options.cssClasses.root))\n\t    .css(options.css.wrapper);\n\n\t  // override the display property with the table-cell value\n\t  // if the parent element is a table and the original input was a block\n\t  //  -> https://github.com/algolia/autocomplete.js/issues/16\n\t  if (!options.appendTo && $input.css('display') === 'block' && $input.parent().css('display') === 'table') {\n\t    $wrapper.css('display', 'table-cell');\n\t  }\n\t  var dropdownHtml = html.dropdown.\n\t    replace('%PREFIX%', options.cssClasses.prefix).\n\t    replace('%DROPDOWN_MENU%', options.cssClasses.dropdownMenu);\n\t  $dropdown = DOM.element(dropdownHtml)\n\t    .css(options.css.dropdown)\n\t    .attr({\n\t      role: 'listbox',\n\t      id: options.listboxId\n\t    });\n\t  if (options.templates && options.templates.dropdownMenu) {\n\t    $dropdown.html(_.templatify(options.templates.dropdownMenu)());\n\t  }\n\t  $hint = $input.clone().css(options.css.hint).css(getBackgroundStyles($input));\n\n\t  $hint\n\t    .val('')\n\t    .addClass(_.className(options.cssClasses.prefix, options.cssClasses.hint, true))\n\t    .removeAttr('id name placeholder required')\n\t    .prop('readonly', true)\n\t    .attr({\n\t      'aria-hidden': 'true',\n\t      autocomplete: 'off',\n\t      spellcheck: 'false',\n\t      tabindex: -1\n\t    });\n\t  if ($hint.removeData) {\n\t    $hint.removeData();\n\t  }\n\n\t  // store the original values of the attrs that get modified\n\t  // so modifications can be reverted on destroy\n\t  $input.data(attrsKey, {\n\t    'aria-autocomplete': $input.attr('aria-autocomplete'),\n\t    'aria-expanded': $input.attr('aria-expanded'),\n\t    'aria-owns': $input.attr('aria-owns'),\n\t    autocomplete: $input.attr('autocomplete'),\n\t    dir: $input.attr('dir'),\n\t    role: $input.attr('role'),\n\t    spellcheck: $input.attr('spellcheck'),\n\t    style: $input.attr('style'),\n\t    type: $input.attr('type')\n\t  });\n\n\t  $input\n\t    .addClass(_.className(options.cssClasses.prefix, options.cssClasses.input, true))\n\t    .attr({\n\t      autocomplete: 'off',\n\t      spellcheck: false,\n\n\t      // Accessibility features\n\t      // Give the field a presentation of a \"select\".\n\t      // Combobox is the combined presentation of a single line textfield\n\t      // with a listbox popup.\n\t      // https://www.w3.org/WAI/PF/aria/roles#combobox\n\t      role: 'combobox',\n\t      // Let the screen reader know the field has an autocomplete\n\t      // feature to it.\n\t      'aria-autocomplete': (options.datasets &&\n\t        options.datasets[0] && options.datasets[0].displayKey ? 'both' : 'list'),\n\t      // Indicates whether the dropdown it controls is currently expanded or collapsed\n\t      'aria-expanded': 'false',\n\t      'aria-label': options.ariaLabel,\n\t      // Explicitly point to the listbox,\n\t      // which is a list of suggestions (aka options)\n\t      'aria-owns': options.listboxId\n\t    })\n\t    .css(options.hint ? options.css.input : options.css.inputWithNoHint);\n\n\t  // ie7 does not like it when dir is set to auto\n\t  try {\n\t    if (!$input.attr('dir')) {\n\t      $input.attr('dir', 'auto');\n\t    }\n\t  } catch (e) {\n\t    // ignore\n\t  }\n\n\t  $wrapper = options.appendTo\n\t    ? $wrapper.appendTo(DOM.element(options.appendTo).eq(0)).eq(0)\n\t    : $input.wrap($wrapper).parent();\n\n\t  $wrapper\n\t    .prepend(options.hint ? $hint : null)\n\t    .append($dropdown);\n\n\t  return {\n\t    wrapper: $wrapper,\n\t    input: $input,\n\t    hint: $hint,\n\t    menu: $dropdown\n\t  };\n\t}\n\n\tfunction getBackgroundStyles($el) {\n\t  return {\n\t    backgroundAttachment: $el.css('background-attachment'),\n\t    backgroundClip: $el.css('background-clip'),\n\t    backgroundColor: $el.css('background-color'),\n\t    backgroundImage: $el.css('background-image'),\n\t    backgroundOrigin: $el.css('background-origin'),\n\t    backgroundPosition: $el.css('background-position'),\n\t    backgroundRepeat: $el.css('background-repeat'),\n\t    backgroundSize: $el.css('background-size')\n\t  };\n\t}\n\n\tfunction destroyDomStructure($node, cssClasses) {\n\t  var $input = $node.find(_.className(cssClasses.prefix, cssClasses.input));\n\n\t  // need to remove attrs that weren't previously defined and\n\t  // revert attrs that originally had a value\n\t  _.each($input.data(attrsKey), function(val, key) {\n\t    if (val === undefined) {\n\t      $input.removeAttr(key);\n\t    } else {\n\t      $input.attr(key, val);\n\t    }\n\t  });\n\n\t  $input\n\t    .detach()\n\t    .removeClass(_.className(cssClasses.prefix, cssClasses.input, true))\n\t    .insertAfter($node);\n\t  if ($input.removeData) {\n\t    $input.removeData(attrsKey);\n\t  }\n\n\t  $node.remove();\n\t}\n\n\tTypeahead.Dropdown = Dropdown;\n\tTypeahead.Input = Input;\n\tTypeahead.sources = __webpack_require__(20);\n\n\tmodule.exports = Typeahead;\n\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar namespace = 'autocomplete:';\n\n\tvar _ = __webpack_require__(4);\n\tvar DOM = __webpack_require__(2);\n\n\t// constructor\n\t// -----------\n\n\tfunction EventBus(o) {\n\t  if (!o || !o.el) {\n\t    _.error('EventBus initialized without el');\n\t  }\n\n\t  this.$el = DOM.element(o.el);\n\t}\n\n\t// instance methods\n\t// ----------------\n\n\t_.mixin(EventBus.prototype, {\n\n\t  // ### public\n\n\t  trigger: function(type, suggestion, dataset, context) {\n\t    var event = _.Event(namespace + type);\n\t    this.$el.trigger(event, [suggestion, dataset, context]);\n\t    return event;\n\t  }\n\t});\n\n\tmodule.exports = EventBus;\n\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar specialKeyCodeMap;\n\n\tspecialKeyCodeMap = {\n\t  9: 'tab',\n\t  27: 'esc',\n\t  37: 'left',\n\t  39: 'right',\n\t  13: 'enter',\n\t  38: 'up',\n\t  40: 'down'\n\t};\n\n\tvar _ = __webpack_require__(4);\n\tvar DOM = __webpack_require__(2);\n\tvar EventEmitter = __webpack_require__(8);\n\n\t// constructor\n\t// -----------\n\n\tfunction Input(o) {\n\t  var that = this;\n\t  var onBlur;\n\t  var onFocus;\n\t  var onKeydown;\n\t  var onInput;\n\n\t  o = o || {};\n\n\t  if (!o.input) {\n\t    _.error('input is missing');\n\t  }\n\n\t  // bound functions\n\t  onBlur = _.bind(this._onBlur, this);\n\t  onFocus = _.bind(this._onFocus, this);\n\t  onKeydown = _.bind(this._onKeydown, this);\n\t  onInput = _.bind(this._onInput, this);\n\n\t  this.$hint = DOM.element(o.hint);\n\t  this.$input = DOM.element(o.input)\n\t    .on('blur.aa', onBlur)\n\t    .on('focus.aa', onFocus)\n\t    .on('keydown.aa', onKeydown);\n\n\t  // if no hint, noop all the hint related functions\n\t  if (this.$hint.length === 0) {\n\t    this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop;\n\t  }\n\n\t  // ie7 and ie8 don't support the input event\n\t  // ie9 doesn't fire the input event when characters are removed\n\t  // not sure if ie10 is compatible\n\t  if (!_.isMsie()) {\n\t    this.$input.on('input.aa', onInput);\n\t  } else {\n\t    this.$input.on('keydown.aa keypress.aa cut.aa paste.aa', function($e) {\n\t      // if a special key triggered this, ignore it\n\t      if (specialKeyCodeMap[$e.which || $e.keyCode]) {\n\t        return;\n\t      }\n\n\t      // give the browser a chance to update the value of the input\n\t      // before checking to see if the query changed\n\t      _.defer(_.bind(that._onInput, that, $e));\n\t    });\n\t  }\n\n\t  // the query defaults to whatever the value of the input is\n\t  // on initialization, it'll most likely be an empty string\n\t  this.query = this.$input.val();\n\n\t  // helps with calculating the width of the input's value\n\t  this.$overflowHelper = buildOverflowHelper(this.$input);\n\t}\n\n\t// static methods\n\t// --------------\n\n\tInput.normalizeQuery = function(str) {\n\t  // strips leading whitespace and condenses all whitespace\n\t  return (str || '').replace(/^\\s*/g, '').replace(/\\s{2,}/g, ' ');\n\t};\n\n\t// instance methods\n\t// ----------------\n\n\t_.mixin(Input.prototype, EventEmitter, {\n\n\t  // ### private\n\n\t  _onBlur: function onBlur() {\n\t    this.resetInputValue();\n\t    this.$input.removeAttr('aria-activedescendant');\n\t    this.trigger('blurred');\n\t  },\n\n\t  _onFocus: function onFocus() {\n\t    this.trigger('focused');\n\t  },\n\n\t  _onKeydown: function onKeydown($e) {\n\t    // which is normalized and consistent (but not for ie)\n\t    var keyName = specialKeyCodeMap[$e.which || $e.keyCode];\n\n\t    this._managePreventDefault(keyName, $e);\n\t    if (keyName && this._shouldTrigger(keyName, $e)) {\n\t      this.trigger(keyName + 'Keyed', $e);\n\t    }\n\t  },\n\n\t  _onInput: function onInput() {\n\t    this._checkInputValue();\n\t  },\n\n\t  _managePreventDefault: function managePreventDefault(keyName, $e) {\n\t    var preventDefault;\n\t    var hintValue;\n\t    var inputValue;\n\n\t    switch (keyName) {\n\t    case 'tab':\n\t      hintValue = this.getHint();\n\t      inputValue = this.getInputValue();\n\n\t      preventDefault = hintValue &&\n\t        hintValue !== inputValue &&\n\t        !withModifier($e);\n\t      break;\n\n\t    case 'up':\n\t    case 'down':\n\t      preventDefault = !withModifier($e);\n\t      break;\n\n\t    default:\n\t      preventDefault = false;\n\t    }\n\n\t    if (preventDefault) {\n\t      $e.preventDefault();\n\t    }\n\t  },\n\n\t  _shouldTrigger: function shouldTrigger(keyName, $e) {\n\t    var trigger;\n\n\t    switch (keyName) {\n\t    case 'tab':\n\t      trigger = !withModifier($e);\n\t      break;\n\n\t    default:\n\t      trigger = true;\n\t    }\n\n\t    return trigger;\n\t  },\n\n\t  _checkInputValue: function checkInputValue() {\n\t    var inputValue;\n\t    var areEquivalent;\n\t    var hasDifferentWhitespace;\n\n\t    inputValue = this.getInputValue();\n\t    areEquivalent = areQueriesEquivalent(inputValue, this.query);\n\t    hasDifferentWhitespace = areEquivalent && this.query ?\n\t      this.query.length !== inputValue.length : false;\n\n\t    this.query = inputValue;\n\n\t    if (!areEquivalent) {\n\t      this.trigger('queryChanged', this.query);\n\t    } else if (hasDifferentWhitespace) {\n\t      this.trigger('whitespaceChanged', this.query);\n\t    }\n\t  },\n\n\t  // ### public\n\n\t  focus: function focus() {\n\t    this.$input.focus();\n\t  },\n\n\t  blur: function blur() {\n\t    this.$input.blur();\n\t  },\n\n\t  getQuery: function getQuery() {\n\t    return this.query;\n\t  },\n\n\t  setQuery: function setQuery(query) {\n\t    this.query = query;\n\t  },\n\n\t  getInputValue: function getInputValue() {\n\t    return this.$input.val();\n\t  },\n\n\t  setInputValue: function setInputValue(value, silent) {\n\t    if (typeof value === 'undefined') {\n\t      value = this.query;\n\t    }\n\t    this.$input.val(value);\n\n\t    // silent prevents any additional events from being triggered\n\t    if (silent) {\n\t      this.clearHint();\n\t    } else {\n\t      this._checkInputValue();\n\t    }\n\t  },\n\n\t  expand: function expand() {\n\t    this.$input.attr('aria-expanded', 'true');\n\t  },\n\n\t  collapse: function collapse() {\n\t    this.$input.attr('aria-expanded', 'false');\n\t  },\n\n\t  setActiveDescendant: function setActiveDescendant(activedescendantId) {\n\t    this.$input.attr('aria-activedescendant', activedescendantId);\n\t  },\n\n\t  removeActiveDescendant: function removeActiveDescendant() {\n\t    this.$input.removeAttr('aria-activedescendant');\n\t  },\n\n\t  resetInputValue: function resetInputValue() {\n\t    this.setInputValue(this.query, true);\n\t  },\n\n\t  getHint: function getHint() {\n\t    return this.$hint.val();\n\t  },\n\n\t  setHint: function setHint(value) {\n\t    this.$hint.val(value);\n\t  },\n\n\t  clearHint: function clearHint() {\n\t    this.setHint('');\n\t  },\n\n\t  clearHintIfInvalid: function clearHintIfInvalid() {\n\t    var val;\n\t    var hint;\n\t    var valIsPrefixOfHint;\n\t    var isValid;\n\n\t    val = this.getInputValue();\n\t    hint = this.getHint();\n\t    valIsPrefixOfHint = val !== hint && hint.indexOf(val) === 0;\n\t    isValid = val !== '' && valIsPrefixOfHint && !this.hasOverflow();\n\n\t    if (!isValid) {\n\t      this.clearHint();\n\t    }\n\t  },\n\n\t  getLanguageDirection: function getLanguageDirection() {\n\t    return (this.$input.css('direction') || 'ltr').toLowerCase();\n\t  },\n\n\t  hasOverflow: function hasOverflow() {\n\t    // 2 is arbitrary, just picking a small number to handle edge cases\n\t    var constraint = this.$input.width() - 2;\n\n\t    this.$overflowHelper.text(this.getInputValue());\n\n\t    return this.$overflowHelper.width() >= constraint;\n\t  },\n\n\t  isCursorAtEnd: function() {\n\t    var valueLength;\n\t    var selectionStart;\n\t    var range;\n\n\t    valueLength = this.$input.val().length;\n\t    selectionStart = this.$input[0].selectionStart;\n\n\t    if (_.isNumber(selectionStart)) {\n\t      return selectionStart === valueLength;\n\t    } else if (document.selection) {\n\t      // NOTE: this won't work unless the input has focus, the good news\n\t      // is this code should only get called when the input has focus\n\t      range = document.selection.createRange();\n\t      range.moveStart('character', -valueLength);\n\n\t      return valueLength === range.text.length;\n\t    }\n\n\t    return true;\n\t  },\n\n\t  destroy: function destroy() {\n\t    this.$hint.off('.aa');\n\t    this.$input.off('.aa');\n\n\t    this.$hint = this.$input = this.$overflowHelper = null;\n\t  }\n\t});\n\n\t// helper functions\n\t// ----------------\n\n\tfunction buildOverflowHelper($input) {\n\t  return DOM.element('<pre aria-hidden=\"true\"></pre>')\n\t    .css({\n\t      // position helper off-screen\n\t      position: 'absolute',\n\t      visibility: 'hidden',\n\t      // avoid line breaks and whitespace collapsing\n\t      whiteSpace: 'pre',\n\t      // use same font css as input to calculate accurate width\n\t      fontFamily: $input.css('font-family'),\n\t      fontSize: $input.css('font-size'),\n\t      fontStyle: $input.css('font-style'),\n\t      fontVariant: $input.css('font-variant'),\n\t      fontWeight: $input.css('font-weight'),\n\t      wordSpacing: $input.css('word-spacing'),\n\t      letterSpacing: $input.css('letter-spacing'),\n\t      textIndent: $input.css('text-indent'),\n\t      textRendering: $input.css('text-rendering'),\n\t      textTransform: $input.css('text-transform')\n\t    })\n\t    .insertAfter($input);\n\t}\n\n\tfunction areQueriesEquivalent(a, b) {\n\t  return Input.normalizeQuery(a) === Input.normalizeQuery(b);\n\t}\n\n\tfunction withModifier($e) {\n\t  return $e.altKey || $e.ctrlKey || $e.metaKey || $e.shiftKey;\n\t}\n\n\tmodule.exports = Input;\n\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar immediate = __webpack_require__(9);\n\tvar splitter = /\\s+/;\n\n\tmodule.exports = {\n\t  onSync: onSync,\n\t  onAsync: onAsync,\n\t  off: off,\n\t  trigger: trigger\n\t};\n\n\tfunction on(method, types, cb, context) {\n\t  var type;\n\n\t  if (!cb) {\n\t    return this;\n\t  }\n\n\t  types = types.split(splitter);\n\t  cb = context ? bindContext(cb, context) : cb;\n\n\t  this._callbacks = this._callbacks || {};\n\n\t  while (type = types.shift()) {\n\t    this._callbacks[type] = this._callbacks[type] || {sync: [], async: []};\n\t    this._callbacks[type][method].push(cb);\n\t  }\n\n\t  return this;\n\t}\n\n\tfunction onAsync(types, cb, context) {\n\t  return on.call(this, 'async', types, cb, context);\n\t}\n\n\tfunction onSync(types, cb, context) {\n\t  return on.call(this, 'sync', types, cb, context);\n\t}\n\n\tfunction off(types) {\n\t  var type;\n\n\t  if (!this._callbacks) {\n\t    return this;\n\t  }\n\n\t  types = types.split(splitter);\n\n\t  while (type = types.shift()) {\n\t    delete this._callbacks[type];\n\t  }\n\n\t  return this;\n\t}\n\n\tfunction trigger(types) {\n\t  var type;\n\t  var callbacks;\n\t  var args;\n\t  var syncFlush;\n\t  var asyncFlush;\n\n\t  if (!this._callbacks) {\n\t    return this;\n\t  }\n\n\t  types = types.split(splitter);\n\t  args = [].slice.call(arguments, 1);\n\n\t  while ((type = types.shift()) && (callbacks = this._callbacks[type])) { // eslint-disable-line\n\t    syncFlush = getFlush(callbacks.sync, this, [type].concat(args));\n\t    asyncFlush = getFlush(callbacks.async, this, [type].concat(args));\n\n\t    if (syncFlush()) {\n\t      immediate(asyncFlush);\n\t    }\n\t  }\n\n\t  return this;\n\t}\n\n\tfunction getFlush(callbacks, context, args) {\n\t  return flush;\n\n\t  function flush() {\n\t    var cancelled;\n\n\t    for (var i = 0, len = callbacks.length; !cancelled && i < len; i += 1) {\n\t      // only cancel if the callback explicitly returns false\n\t      cancelled = callbacks[i].apply(context, args) === false;\n\t    }\n\n\t    return !cancelled;\n\t  }\n\t}\n\n\tfunction bindContext(fn, context) {\n\t  return fn.bind ?\n\t    fn.bind(context) :\n\t    function() { fn.apply(context, [].slice.call(arguments, 0)); };\n\t}\n\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\tvar types = [\n\t  __webpack_require__(10),\n\t  __webpack_require__(12),\n\t  __webpack_require__(13),\n\t  __webpack_require__(14),\n\t  __webpack_require__(15)\n\t];\n\tvar draining;\n\tvar currentQueue;\n\tvar queueIndex = -1;\n\tvar queue = [];\n\tvar scheduled = false;\n\tfunction cleanUpNextTick() {\n\t  if (!draining || !currentQueue) {\n\t    return;\n\t  }\n\t  draining = false;\n\t  if (currentQueue.length) {\n\t    queue = currentQueue.concat(queue);\n\t  } else {\n\t    queueIndex = -1;\n\t  }\n\t  if (queue.length) {\n\t    nextTick();\n\t  }\n\t}\n\n\t//named nextTick for less confusing stack traces\n\tfunction nextTick() {\n\t  if (draining) {\n\t    return;\n\t  }\n\t  scheduled = false;\n\t  draining = true;\n\t  var len = queue.length;\n\t  var timeout = setTimeout(cleanUpNextTick);\n\t  while (len) {\n\t    currentQueue = queue;\n\t    queue = [];\n\t    while (currentQueue && ++queueIndex < len) {\n\t      currentQueue[queueIndex].run();\n\t    }\n\t    queueIndex = -1;\n\t    len = queue.length;\n\t  }\n\t  currentQueue = null;\n\t  queueIndex = -1;\n\t  draining = false;\n\t  clearTimeout(timeout);\n\t}\n\tvar scheduleDrain;\n\tvar i = -1;\n\tvar len = types.length;\n\twhile (++i < len) {\n\t  if (types[i] && types[i].test && types[i].test()) {\n\t    scheduleDrain = types[i].install(nextTick);\n\t    break;\n\t  }\n\t}\n\t// v8 likes predictible objects\n\tfunction Item(fun, array) {\n\t  this.fun = fun;\n\t  this.array = array;\n\t}\n\tItem.prototype.run = function () {\n\t  var fun = this.fun;\n\t  var array = this.array;\n\t  switch (array.length) {\n\t  case 0:\n\t    return fun();\n\t  case 1:\n\t    return fun(array[0]);\n\t  case 2:\n\t    return fun(array[0], array[1]);\n\t  case 3:\n\t    return fun(array[0], array[1], array[2]);\n\t  default:\n\t    return fun.apply(null, array);\n\t  }\n\n\t};\n\tmodule.exports = immediate;\n\tfunction immediate(task) {\n\t  var args = new Array(arguments.length - 1);\n\t  if (arguments.length > 1) {\n\t    for (var i = 1; i < arguments.length; i++) {\n\t      args[i - 1] = arguments[i];\n\t    }\n\t  }\n\t  queue.push(new Item(task, args));\n\t  if (!scheduled && !draining) {\n\t    scheduled = true;\n\t    scheduleDrain();\n\t  }\n\t}\n\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {'use strict';\n\texports.test = function () {\n\t  // Don't get fooled by e.g. browserify environments.\n\t  return (typeof process !== 'undefined') && !process.browser;\n\t};\n\n\texports.install = function (func) {\n\t  return function () {\n\t    process.nextTick(func);\n\t  };\n\t};\n\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))\n\n/***/ },\n/* 11 */\n/***/ function(module, exports) {\n\n\t// shim for using process in browser\n\tvar process = module.exports = {};\n\n\t// cached from whatever global is present so that test runners that stub it\n\t// don't break things.  But we need to wrap it in a try catch in case it is\n\t// wrapped in strict mode code which doesn't define any globals.  It's inside a\n\t// function because try/catches deoptimize in certain engines.\n\n\tvar cachedSetTimeout;\n\tvar cachedClearTimeout;\n\n\tfunction defaultSetTimout() {\n\t    throw new Error('setTimeout has not been defined');\n\t}\n\tfunction defaultClearTimeout () {\n\t    throw new Error('clearTimeout has not been defined');\n\t}\n\t(function () {\n\t    try {\n\t        if (typeof setTimeout === 'function') {\n\t            cachedSetTimeout = setTimeout;\n\t        } else {\n\t            cachedSetTimeout = defaultSetTimout;\n\t        }\n\t    } catch (e) {\n\t        cachedSetTimeout = defaultSetTimout;\n\t    }\n\t    try {\n\t        if (typeof clearTimeout === 'function') {\n\t            cachedClearTimeout = clearTimeout;\n\t        } else {\n\t            cachedClearTimeout = defaultClearTimeout;\n\t        }\n\t    } catch (e) {\n\t        cachedClearTimeout = defaultClearTimeout;\n\t    }\n\t} ())\n\tfunction runTimeout(fun) {\n\t    if (cachedSetTimeout === setTimeout) {\n\t        //normal enviroments in sane situations\n\t        return setTimeout(fun, 0);\n\t    }\n\t    // if setTimeout wasn't available but was latter defined\n\t    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n\t        cachedSetTimeout = setTimeout;\n\t        return setTimeout(fun, 0);\n\t    }\n\t    try {\n\t        // when when somebody has screwed with setTimeout but no I.E. maddness\n\t        return cachedSetTimeout(fun, 0);\n\t    } catch(e){\n\t        try {\n\t            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n\t            return cachedSetTimeout.call(null, fun, 0);\n\t        } catch(e){\n\t            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n\t            return cachedSetTimeout.call(this, fun, 0);\n\t        }\n\t    }\n\n\n\t}\n\tfunction runClearTimeout(marker) {\n\t    if (cachedClearTimeout === clearTimeout) {\n\t        //normal enviroments in sane situations\n\t        return clearTimeout(marker);\n\t    }\n\t    // if clearTimeout wasn't available but was latter defined\n\t    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n\t        cachedClearTimeout = clearTimeout;\n\t        return clearTimeout(marker);\n\t    }\n\t    try {\n\t        // when when somebody has screwed with setTimeout but no I.E. maddness\n\t        return cachedClearTimeout(marker);\n\t    } catch (e){\n\t        try {\n\t            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally\n\t            return cachedClearTimeout.call(null, marker);\n\t        } catch (e){\n\t            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n\t            // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n\t            return cachedClearTimeout.call(this, marker);\n\t        }\n\t    }\n\n\n\n\t}\n\tvar queue = [];\n\tvar draining = false;\n\tvar currentQueue;\n\tvar queueIndex = -1;\n\n\tfunction cleanUpNextTick() {\n\t    if (!draining || !currentQueue) {\n\t        return;\n\t    }\n\t    draining = false;\n\t    if (currentQueue.length) {\n\t        queue = currentQueue.concat(queue);\n\t    } else {\n\t        queueIndex = -1;\n\t    }\n\t    if (queue.length) {\n\t        drainQueue();\n\t    }\n\t}\n\n\tfunction drainQueue() {\n\t    if (draining) {\n\t        return;\n\t    }\n\t    var timeout = runTimeout(cleanUpNextTick);\n\t    draining = true;\n\n\t    var len = queue.length;\n\t    while(len) {\n\t        currentQueue = queue;\n\t        queue = [];\n\t        while (++queueIndex < len) {\n\t            if (currentQueue) {\n\t                currentQueue[queueIndex].run();\n\t            }\n\t        }\n\t        queueIndex = -1;\n\t        len = queue.length;\n\t    }\n\t    currentQueue = null;\n\t    draining = false;\n\t    runClearTimeout(timeout);\n\t}\n\n\tprocess.nextTick = function (fun) {\n\t    var args = new Array(arguments.length - 1);\n\t    if (arguments.length > 1) {\n\t        for (var i = 1; i < arguments.length; i++) {\n\t            args[i - 1] = arguments[i];\n\t        }\n\t    }\n\t    queue.push(new Item(fun, args));\n\t    if (queue.length === 1 && !draining) {\n\t        runTimeout(drainQueue);\n\t    }\n\t};\n\n\t// v8 likes predictible objects\n\tfunction Item(fun, array) {\n\t    this.fun = fun;\n\t    this.array = array;\n\t}\n\tItem.prototype.run = function () {\n\t    this.fun.apply(null, this.array);\n\t};\n\tprocess.title = 'browser';\n\tprocess.browser = true;\n\tprocess.env = {};\n\tprocess.argv = [];\n\tprocess.version = ''; // empty string to avoid regexp issues\n\tprocess.versions = {};\n\n\tfunction noop() {}\n\n\tprocess.on = noop;\n\tprocess.addListener = noop;\n\tprocess.once = noop;\n\tprocess.off = noop;\n\tprocess.removeListener = noop;\n\tprocess.removeAllListeners = noop;\n\tprocess.emit = noop;\n\n\tprocess.binding = function (name) {\n\t    throw new Error('process.binding is not supported');\n\t};\n\n\tprocess.cwd = function () { return '/' };\n\tprocess.chdir = function (dir) {\n\t    throw new Error('process.chdir is not supported');\n\t};\n\tprocess.umask = function() { return 0; };\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t//based off rsvp https://github.com/tildeio/rsvp.js\n\t//license https://github.com/tildeio/rsvp.js/blob/master/LICENSE\n\t//https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/asap.js\n\n\tvar Mutation = global.MutationObserver || global.WebKitMutationObserver;\n\n\texports.test = function () {\n\t  return Mutation;\n\t};\n\n\texports.install = function (handle) {\n\t  var called = 0;\n\t  var observer = new Mutation(handle);\n\t  var element = global.document.createTextNode('');\n\t  observer.observe(element, {\n\t    characterData: true\n\t  });\n\t  return function () {\n\t    element.data = (called = ++called % 2);\n\t  };\n\t};\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\n\texports.test = function () {\n\t  if (global.setImmediate) {\n\t    // we can only get here in IE10\n\t    // which doesn't handel postMessage well\n\t    return false;\n\t  }\n\t  return typeof global.MessageChannel !== 'undefined';\n\t};\n\n\texports.install = function (func) {\n\t  var channel = new global.MessageChannel();\n\t  channel.port1.onmessage = func;\n\t  return function () {\n\t    channel.port2.postMessage(0);\n\t  };\n\t};\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 14 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\n\texports.test = function () {\n\t  return 'document' in global && 'onreadystatechange' in global.document.createElement('script');\n\t};\n\n\texports.install = function (handle) {\n\t  return function () {\n\n\t    // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n\t    // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n\t    var scriptEl = global.document.createElement('script');\n\t    scriptEl.onreadystatechange = function () {\n\t      handle();\n\n\t      scriptEl.onreadystatechange = null;\n\t      scriptEl.parentNode.removeChild(scriptEl);\n\t      scriptEl = null;\n\t    };\n\t    global.document.documentElement.appendChild(scriptEl);\n\n\t    return handle;\n\t  };\n\t};\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 15 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\texports.test = function () {\n\t  return true;\n\t};\n\n\texports.install = function (t) {\n\t  return function () {\n\t    setTimeout(t, 0);\n\t  };\n\t};\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar _ = __webpack_require__(4);\n\tvar DOM = __webpack_require__(2);\n\tvar EventEmitter = __webpack_require__(8);\n\tvar Dataset = __webpack_require__(17);\n\tvar css = __webpack_require__(19);\n\n\t// constructor\n\t// -----------\n\n\tfunction Dropdown(o) {\n\t  var that = this;\n\t  var onSuggestionClick;\n\t  var onSuggestionMouseEnter;\n\t  var onSuggestionMouseLeave;\n\n\t  o = o || {};\n\n\t  if (!o.menu) {\n\t    _.error('menu is required');\n\t  }\n\n\t  if (!_.isArray(o.datasets) && !_.isObject(o.datasets)) {\n\t    _.error('1 or more datasets required');\n\t  }\n\t  if (!o.datasets) {\n\t    _.error('datasets is required');\n\t  }\n\n\t  this.isOpen = false;\n\t  this.isEmpty = true;\n\t  this.minLength = o.minLength || 0;\n\t  this.templates = {};\n\t  this.appendTo = o.appendTo || false;\n\t  this.css = _.mixin({}, css, o.appendTo ? css.appendTo : {});\n\t  this.cssClasses = o.cssClasses = _.mixin({}, css.defaultClasses, o.cssClasses || {});\n\t  this.cssClasses.prefix =\n\t    o.cssClasses.formattedPrefix || _.formatPrefix(this.cssClasses.prefix, this.cssClasses.noPrefix);\n\n\t  // bound functions\n\t  onSuggestionClick = _.bind(this._onSuggestionClick, this);\n\t  onSuggestionMouseEnter = _.bind(this._onSuggestionMouseEnter, this);\n\t  onSuggestionMouseLeave = _.bind(this._onSuggestionMouseLeave, this);\n\n\t  var cssClass = _.className(this.cssClasses.prefix, this.cssClasses.suggestion);\n\t  this.$menu = DOM.element(o.menu)\n\t    .on('mouseenter.aa', cssClass, onSuggestionMouseEnter)\n\t    .on('mouseleave.aa', cssClass, onSuggestionMouseLeave)\n\t    .on('click.aa', cssClass, onSuggestionClick);\n\n\t  this.$container = o.appendTo ? o.wrapper : this.$menu;\n\n\t  if (o.templates && o.templates.header) {\n\t    this.templates.header = _.templatify(o.templates.header);\n\t    this.$menu.prepend(this.templates.header());\n\t  }\n\n\t  if (o.templates && o.templates.empty) {\n\t    this.templates.empty = _.templatify(o.templates.empty);\n\t    this.$empty = DOM.element('<div class=\"' +\n\t      _.className(this.cssClasses.prefix, this.cssClasses.empty, true) + '\">' +\n\t      '</div>');\n\t    this.$menu.append(this.$empty);\n\t    this.$empty.hide();\n\t  }\n\n\t  this.datasets = _.map(o.datasets, function(oDataset) {\n\t    return initializeDataset(that.$menu, oDataset, o.cssClasses);\n\t  });\n\t  _.each(this.datasets, function(dataset) {\n\t    var root = dataset.getRoot();\n\t    if (root && root.parent().length === 0) {\n\t      that.$menu.append(root);\n\t    }\n\t    dataset.onSync('rendered', that._onRendered, that);\n\t  });\n\n\t  if (o.templates && o.templates.footer) {\n\t    this.templates.footer = _.templatify(o.templates.footer);\n\t    this.$menu.append(this.templates.footer());\n\t  }\n\n\t  var self = this;\n\t  DOM.element(window).resize(function() {\n\t    self._redraw();\n\t  });\n\t}\n\n\t// instance methods\n\t// ----------------\n\n\t_.mixin(Dropdown.prototype, EventEmitter, {\n\n\t  // ### private\n\n\t  _onSuggestionClick: function onSuggestionClick($e) {\n\t    this.trigger('suggestionClicked', DOM.element($e.currentTarget));\n\t  },\n\n\t  _onSuggestionMouseEnter: function onSuggestionMouseEnter($e) {\n\t    var elt = DOM.element($e.currentTarget);\n\t    if (elt.hasClass(_.className(this.cssClasses.prefix, this.cssClasses.cursor, true))) {\n\t      // we're already on the cursor\n\t      // => we're probably entering it again after leaving it for a nested div\n\t      return;\n\t    }\n\t    this._removeCursor();\n\n\t    // Fixes iOS double tap behaviour, by modifying the DOM right before the\n\t    // native href clicks happens, iOS will requires another tap to follow\n\t    // a suggestion that has an <a href> element inside\n\t    // https://www.google.com/search?q=ios+double+tap+bug+href\n\t    var suggestion = this;\n\t    setTimeout(function() {\n\t      // this exact line, when inside the main loop, will trigger a double tap bug\n\t      // on iOS devices\n\t      suggestion._setCursor(elt, false);\n\t    }, 0);\n\t  },\n\n\t  _onSuggestionMouseLeave: function onSuggestionMouseLeave($e) {\n\t    // $e.relatedTarget is the `EventTarget` the pointing device entered to\n\t    if ($e.relatedTarget) {\n\t      var elt = DOM.element($e.relatedTarget);\n\t      if (elt.closest('.' + _.className(this.cssClasses.prefix, this.cssClasses.cursor, true)).length > 0) {\n\t        // our father is a cursor\n\t        // => it means we're just leaving the suggestion for a nested div\n\t        return;\n\t      }\n\t    }\n\t    this._removeCursor();\n\t    this.trigger('cursorRemoved');\n\t  },\n\n\t  _onRendered: function onRendered(e, query) {\n\t    this.isEmpty = _.every(this.datasets, isDatasetEmpty);\n\n\t    if (this.isEmpty) {\n\t      if (query.length >= this.minLength) {\n\t        this.trigger('empty');\n\t      }\n\n\t      if (this.$empty) {\n\t        if (query.length < this.minLength) {\n\t          this._hide();\n\t        } else {\n\t          var html = this.templates.empty({\n\t            query: this.datasets[0] && this.datasets[0].query\n\t          });\n\t          this.$empty.html(html);\n\t          this.$empty.show();\n\t          this._show();\n\t        }\n\t      } else if (_.any(this.datasets, hasEmptyTemplate)) {\n\t        if (query.length < this.minLength) {\n\t          this._hide();\n\t        } else {\n\t          this._show();\n\t        }\n\t      } else {\n\t        this._hide();\n\t      }\n\t    } else if (this.isOpen) {\n\t      if (this.$empty) {\n\t        this.$empty.empty();\n\t        this.$empty.hide();\n\t      }\n\n\t      if (query.length >= this.minLength) {\n\t        this._show();\n\t      } else {\n\t        this._hide();\n\t      }\n\t    }\n\n\t    this.trigger('datasetRendered');\n\n\t    function isDatasetEmpty(dataset) {\n\t      return dataset.isEmpty();\n\t    }\n\n\t    function hasEmptyTemplate(dataset) {\n\t      return dataset.templates && dataset.templates.empty;\n\t    }\n\t  },\n\n\t  _hide: function() {\n\t    this.$container.hide();\n\t  },\n\n\t  _show: function() {\n\t    // can't use jQuery#show because $menu is a span element we want\n\t    // display: block; not dislay: inline;\n\t    this.$container.css('display', 'block');\n\n\t    this._redraw();\n\n\t    this.trigger('shown');\n\t  },\n\n\t  _redraw: function redraw() {\n\t    if (!this.isOpen || !this.appendTo) return;\n\n\t    this.trigger('redrawn');\n\t  },\n\n\t  _getSuggestions: function getSuggestions() {\n\t    return this.$menu.find(_.className(this.cssClasses.prefix, this.cssClasses.suggestion));\n\t  },\n\n\t  _getCursor: function getCursor() {\n\t    return this.$menu.find(_.className(this.cssClasses.prefix, this.cssClasses.cursor)).first();\n\t  },\n\n\t  _setCursor: function setCursor($el, updateInput) {\n\t    $el.first()\n\t      .addClass(_.className(this.cssClasses.prefix, this.cssClasses.cursor, true))\n\t      .attr('aria-selected', 'true');\n\t    this.trigger('cursorMoved', updateInput);\n\t  },\n\n\t  _removeCursor: function removeCursor() {\n\t    this._getCursor()\n\t      .removeClass(_.className(this.cssClasses.prefix, this.cssClasses.cursor, true))\n\t      .removeAttr('aria-selected');\n\t  },\n\n\t  _moveCursor: function moveCursor(increment) {\n\t    var $suggestions;\n\t    var $oldCursor;\n\t    var newCursorIndex;\n\t    var $newCursor;\n\n\t    if (!this.isOpen) {\n\t      return;\n\t    }\n\n\t    $oldCursor = this._getCursor();\n\t    $suggestions = this._getSuggestions();\n\n\t    this._removeCursor();\n\n\t    // shifting before and after modulo to deal with -1 index\n\t    newCursorIndex = $suggestions.index($oldCursor) + increment;\n\t    newCursorIndex = (newCursorIndex + 1) % ($suggestions.length + 1) - 1;\n\n\t    if (newCursorIndex === -1) {\n\t      this.trigger('cursorRemoved');\n\n\t      return;\n\t    } else if (newCursorIndex < -1) {\n\t      newCursorIndex = $suggestions.length - 1;\n\t    }\n\n\t    this._setCursor($newCursor = $suggestions.eq(newCursorIndex), true);\n\n\t    // in the case of scrollable overflow\n\t    // make sure the cursor is visible in the menu\n\t    this._ensureVisible($newCursor);\n\t  },\n\n\t  _ensureVisible: function ensureVisible($el) {\n\t    var elTop;\n\t    var elBottom;\n\t    var menuScrollTop;\n\t    var menuHeight;\n\n\t    elTop = $el.position().top;\n\t    elBottom = elTop + $el.height() +\n\t      parseInt($el.css('margin-top'), 10) +\n\t      parseInt($el.css('margin-bottom'), 10);\n\t    menuScrollTop = this.$menu.scrollTop();\n\t    menuHeight = this.$menu.height() +\n\t      parseInt(this.$menu.css('padding-top'), 10) +\n\t      parseInt(this.$menu.css('padding-bottom'), 10);\n\n\t    if (elTop < 0) {\n\t      this.$menu.scrollTop(menuScrollTop + elTop);\n\t    } else if (menuHeight < elBottom) {\n\t      this.$menu.scrollTop(menuScrollTop + (elBottom - menuHeight));\n\t    }\n\t  },\n\n\t  // ### public\n\n\t  close: function close() {\n\t    if (this.isOpen) {\n\t      this.isOpen = false;\n\n\t      this._removeCursor();\n\t      this._hide();\n\n\t      this.trigger('closed');\n\t    }\n\t  },\n\n\t  open: function open() {\n\t    if (!this.isOpen) {\n\t      this.isOpen = true;\n\n\t      if (!this.isEmpty) {\n\t        this._show();\n\t      }\n\n\t      this.trigger('opened');\n\t    }\n\t  },\n\n\t  setLanguageDirection: function setLanguageDirection(dir) {\n\t    this.$menu.css(dir === 'ltr' ? this.css.ltr : this.css.rtl);\n\t  },\n\n\t  moveCursorUp: function moveCursorUp() {\n\t    this._moveCursor(-1);\n\t  },\n\n\t  moveCursorDown: function moveCursorDown() {\n\t    this._moveCursor(+1);\n\t  },\n\n\t  getDatumForSuggestion: function getDatumForSuggestion($el) {\n\t    var datum = null;\n\n\t    if ($el.length) {\n\t      datum = {\n\t        raw: Dataset.extractDatum($el),\n\t        value: Dataset.extractValue($el),\n\t        datasetName: Dataset.extractDatasetName($el)\n\t      };\n\t    }\n\n\t    return datum;\n\t  },\n\n\t  getCurrentCursor: function getCurrentCursor() {\n\t    return this._getCursor().first();\n\t  },\n\n\t  getDatumForCursor: function getDatumForCursor() {\n\t    return this.getDatumForSuggestion(this._getCursor().first());\n\t  },\n\n\t  getDatumForTopSuggestion: function getDatumForTopSuggestion() {\n\t    return this.getDatumForSuggestion(this._getSuggestions().first());\n\t  },\n\n\t  cursorTopSuggestion: function cursorTopSuggestion() {\n\t    this._setCursor(this._getSuggestions().first(), false);\n\t  },\n\n\t  update: function update(query) {\n\t    _.each(this.datasets, updateDataset);\n\n\t    function updateDataset(dataset) {\n\t      dataset.update(query);\n\t    }\n\t  },\n\n\t  empty: function empty() {\n\t    _.each(this.datasets, clearDataset);\n\t    this.isEmpty = true;\n\n\t    function clearDataset(dataset) {\n\t      dataset.clear();\n\t    }\n\t  },\n\n\t  isVisible: function isVisible() {\n\t    return this.isOpen && !this.isEmpty;\n\t  },\n\n\t  destroy: function destroy() {\n\t    this.$menu.off('.aa');\n\n\t    this.$menu = null;\n\n\t    _.each(this.datasets, destroyDataset);\n\n\t    function destroyDataset(dataset) {\n\t      dataset.destroy();\n\t    }\n\t  }\n\t});\n\n\t// helper functions\n\t// ----------------\n\tDropdown.Dataset = Dataset;\n\n\tfunction initializeDataset($menu, oDataset, cssClasses) {\n\t  return new Dropdown.Dataset(_.mixin({$menu: $menu, cssClasses: cssClasses}, oDataset));\n\t}\n\n\tmodule.exports = Dropdown;\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar datasetKey = 'aaDataset';\n\tvar valueKey = 'aaValue';\n\tvar datumKey = 'aaDatum';\n\n\tvar _ = __webpack_require__(4);\n\tvar DOM = __webpack_require__(2);\n\tvar html = __webpack_require__(18);\n\tvar css = __webpack_require__(19);\n\tvar EventEmitter = __webpack_require__(8);\n\n\t// constructor\n\t// -----------\n\n\tfunction Dataset(o) {\n\t  o = o || {};\n\t  o.templates = o.templates || {};\n\n\t  if (!o.source) {\n\t    _.error('missing source');\n\t  }\n\n\t  if (o.name && !isValidName(o.name)) {\n\t    _.error('invalid dataset name: ' + o.name);\n\t  }\n\n\t  // tracks the last query the dataset was updated for\n\t  this.query = null;\n\t  this._isEmpty = true;\n\n\t  this.highlight = !!o.highlight;\n\t  this.name = typeof o.name === 'undefined' || o.name === null ? _.getUniqueId() : o.name;\n\n\t  this.source = o.source;\n\t  this.displayFn = getDisplayFn(o.display || o.displayKey);\n\n\t  this.debounce = o.debounce;\n\n\t  this.cache = o.cache !== false;\n\n\t  this.templates = getTemplates(o.templates, this.displayFn);\n\n\t  this.css = _.mixin({}, css, o.appendTo ? css.appendTo : {});\n\t  this.cssClasses = o.cssClasses = _.mixin({}, css.defaultClasses, o.cssClasses || {});\n\t  this.cssClasses.prefix =\n\t    o.cssClasses.formattedPrefix || _.formatPrefix(this.cssClasses.prefix, this.cssClasses.noPrefix);\n\n\t  var clazz = _.className(this.cssClasses.prefix, this.cssClasses.dataset);\n\t  this.$el = o.$menu && o.$menu.find(clazz + '-' + this.name).length > 0 ?\n\t    DOM.element(o.$menu.find(clazz + '-' + this.name)[0]) :\n\t    DOM.element(\n\t      html.dataset.replace('%CLASS%', this.name)\n\t        .replace('%PREFIX%', this.cssClasses.prefix)\n\t        .replace('%DATASET%', this.cssClasses.dataset)\n\t    );\n\n\t  this.$menu = o.$menu;\n\t  this.clearCachedSuggestions();\n\t}\n\n\t// static methods\n\t// --------------\n\n\tDataset.extractDatasetName = function extractDatasetName(el) {\n\t  return DOM.element(el).data(datasetKey);\n\t};\n\n\tDataset.extractValue = function extractValue(el) {\n\t  return DOM.element(el).data(valueKey);\n\t};\n\n\tDataset.extractDatum = function extractDatum(el) {\n\t  var datum = DOM.element(el).data(datumKey);\n\t  if (typeof datum === 'string') {\n\t    // Zepto has an automatic deserialization of the\n\t    // JSON encoded data attribute\n\t    datum = JSON.parse(datum);\n\t  }\n\t  return datum;\n\t};\n\n\t// instance methods\n\t// ----------------\n\n\t_.mixin(Dataset.prototype, EventEmitter, {\n\n\t  // ### private\n\n\t  _render: function render(query, suggestions) {\n\t    if (!this.$el) {\n\t      return;\n\t    }\n\t    var that = this;\n\n\t    var hasSuggestions;\n\t    var renderArgs = [].slice.call(arguments, 2);\n\t    this.$el.empty();\n\n\t    hasSuggestions = suggestions && suggestions.length;\n\t    this._isEmpty = !hasSuggestions;\n\n\t    if (!hasSuggestions && this.templates.empty) {\n\t      this.$el\n\t        .html(getEmptyHtml.apply(this, renderArgs))\n\t        .prepend(that.templates.header ? getHeaderHtml.apply(this, renderArgs) : null)\n\t        .append(that.templates.footer ? getFooterHtml.apply(this, renderArgs) : null);\n\t    } else if (hasSuggestions) {\n\t      this.$el\n\t        .html(getSuggestionsHtml.apply(this, renderArgs))\n\t        .prepend(that.templates.header ? getHeaderHtml.apply(this, renderArgs) : null)\n\t        .append(that.templates.footer ? getFooterHtml.apply(this, renderArgs) : null);\n\t    } else if (suggestions && !Array.isArray(suggestions)) {\n\t      throw new TypeError('suggestions must be an array');\n\t    }\n\n\t    if (this.$menu) {\n\t      this.$menu.addClass(\n\t        this.cssClasses.prefix + (hasSuggestions ? 'with' : 'without') + '-' + this.name\n\t      ).removeClass(\n\t        this.cssClasses.prefix + (hasSuggestions ? 'without' : 'with') + '-' + this.name\n\t      );\n\t    }\n\n\t    this.trigger('rendered', query);\n\n\t    function getEmptyHtml() {\n\t      var args = [].slice.call(arguments, 0);\n\t      args = [{query: query, isEmpty: true}].concat(args);\n\t      return that.templates.empty.apply(this, args);\n\t    }\n\n\t    function getSuggestionsHtml() {\n\t      var args = [].slice.call(arguments, 0);\n\t      var $suggestions;\n\t      var nodes;\n\t      var self = this;\n\n\t      var suggestionsHtml = html.suggestions.\n\t        replace('%PREFIX%', this.cssClasses.prefix).\n\t        replace('%SUGGESTIONS%', this.cssClasses.suggestions);\n\t      $suggestions = DOM\n\t        .element(suggestionsHtml)\n\t        .css(this.css.suggestions);\n\n\t      // jQuery#append doesn't support arrays as the first argument\n\t      // until version 1.8, see http://bugs.jquery.com/ticket/11231\n\t      nodes = _.map(suggestions, getSuggestionNode);\n\t      $suggestions.append.apply($suggestions, nodes);\n\n\t      return $suggestions;\n\n\t      function getSuggestionNode(suggestion) {\n\t        var $el;\n\n\t        var suggestionHtml = html.suggestion.\n\t          replace('%PREFIX%', self.cssClasses.prefix).\n\t          replace('%SUGGESTION%', self.cssClasses.suggestion);\n\t        $el = DOM.element(suggestionHtml)\n\t          .attr({\n\t            role: 'option',\n\t            id: ['option', Math.floor(Math.random() * 100000000)].join('-')\n\t          })\n\t          .append(that.templates.suggestion.apply(this, [suggestion].concat(args)));\n\n\t        $el.data(datasetKey, that.name);\n\t        $el.data(valueKey, that.displayFn(suggestion) || undefined); // this led to undefined return value\n\t        $el.data(datumKey, JSON.stringify(suggestion));\n\t        $el.children().each(function() { DOM.element(this).css(self.css.suggestionChild); });\n\n\t        return $el;\n\t      }\n\t    }\n\n\t    function getHeaderHtml() {\n\t      var args = [].slice.call(arguments, 0);\n\t      args = [{query: query, isEmpty: !hasSuggestions}].concat(args);\n\t      return that.templates.header.apply(this, args);\n\t    }\n\n\t    function getFooterHtml() {\n\t      var args = [].slice.call(arguments, 0);\n\t      args = [{query: query, isEmpty: !hasSuggestions}].concat(args);\n\t      return that.templates.footer.apply(this, args);\n\t    }\n\t  },\n\n\t  // ### public\n\n\t  getRoot: function getRoot() {\n\t    return this.$el;\n\t  },\n\n\t  update: function update(query) {\n\t    function handleSuggestions(suggestions) {\n\t      // if the update has been canceled or if the query has changed\n\t      // do not render the suggestions as they've become outdated\n\t      if (!this.canceled && query === this.query) {\n\t        // concat all the other arguments that could have been passed\n\t        // to the render function, and forward them to _render\n\t        var extraArgs = [].slice.call(arguments, 1);\n\t        this.cacheSuggestions(query, suggestions, extraArgs);\n\t        this._render.apply(this, [query, suggestions].concat(extraArgs));\n\t      }\n\t    }\n\n\t    this.query = query;\n\t    this.canceled = false;\n\n\t    if (this.shouldFetchFromCache(query)) {\n\t      handleSuggestions.apply(this, [this.cachedSuggestions].concat(this.cachedRenderExtraArgs));\n\t    } else {\n\t      var that = this;\n\t      var execSource = function() {\n\t        // When the call is debounced the condition avoid to do a useless\n\t        // request with the last character when the input has been cleared\n\t        if (!that.canceled) {\n\t          that.source(query, handleSuggestions.bind(that));\n\t        }\n\t      };\n\n\t      if (this.debounce) {\n\t        var later = function() {\n\t          that.debounceTimeout = null;\n\t          execSource();\n\t        };\n\t        clearTimeout(this.debounceTimeout);\n\t        this.debounceTimeout = setTimeout(later, this.debounce);\n\t      } else {\n\t        execSource();\n\t      }\n\t    }\n\t  },\n\n\t  cacheSuggestions: function cacheSuggestions(query, suggestions, extraArgs) {\n\t    this.cachedQuery = query;\n\t    this.cachedSuggestions = suggestions;\n\t    this.cachedRenderExtraArgs = extraArgs;\n\t  },\n\n\t  shouldFetchFromCache: function shouldFetchFromCache(query) {\n\t    return this.cache &&\n\t      this.cachedQuery === query &&\n\t      this.cachedSuggestions &&\n\t      this.cachedSuggestions.length;\n\t  },\n\n\t  clearCachedSuggestions: function clearCachedSuggestions() {\n\t    delete this.cachedQuery;\n\t    delete this.cachedSuggestions;\n\t    delete this.cachedRenderExtraArgs;\n\t  },\n\n\t  cancel: function cancel() {\n\t    this.canceled = true;\n\t  },\n\n\t  clear: function clear() {\n\t    if (this.$el) {\n\t      this.cancel();\n\t      this.$el.empty();\n\t      this.trigger('rendered', '');\n\t    }\n\t  },\n\n\t  isEmpty: function isEmpty() {\n\t    return this._isEmpty;\n\t  },\n\n\t  destroy: function destroy() {\n\t    this.clearCachedSuggestions();\n\t    this.$el = null;\n\t  }\n\t});\n\n\t// helper functions\n\t// ----------------\n\n\tfunction getDisplayFn(display) {\n\t  display = display || 'value';\n\n\t  return _.isFunction(display) ? display : displayFn;\n\n\t  function displayFn(obj) {\n\t    return obj[display];\n\t  }\n\t}\n\n\tfunction getTemplates(templates, displayFn) {\n\t  return {\n\t    empty: templates.empty && _.templatify(templates.empty),\n\t    header: templates.header && _.templatify(templates.header),\n\t    footer: templates.footer && _.templatify(templates.footer),\n\t    suggestion: templates.suggestion || suggestionTemplate\n\t  };\n\n\t  function suggestionTemplate(context) {\n\t    return '<p>' + displayFn(context) + '</p>';\n\t  }\n\t}\n\n\tfunction isValidName(str) {\n\t  // dashes, underscores, letters, and numbers\n\t  return (/^[_a-zA-Z0-9-]+$/).test(str);\n\t}\n\n\tmodule.exports = Dataset;\n\n\n/***/ },\n/* 18 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\n\tmodule.exports = {\n\t  wrapper: '<span class=\"%ROOT%\"></span>',\n\t  dropdown: '<span class=\"%PREFIX%%DROPDOWN_MENU%\"></span>',\n\t  dataset: '<div class=\"%PREFIX%%DATASET%-%CLASS%\"></div>',\n\t  suggestions: '<span class=\"%PREFIX%%SUGGESTIONS%\"></span>',\n\t  suggestion: '<div class=\"%PREFIX%%SUGGESTION%\"></div>'\n\t};\n\n\n/***/ },\n/* 19 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar _ = __webpack_require__(4);\n\n\tvar css = {\n\t  wrapper: {\n\t    position: 'relative',\n\t    display: 'inline-block'\n\t  },\n\t  hint: {\n\t    position: 'absolute',\n\t    top: '0',\n\t    left: '0',\n\t    borderColor: 'transparent',\n\t    boxShadow: 'none',\n\t    // #741: fix hint opacity issue on iOS\n\t    opacity: '1'\n\t  },\n\t  input: {\n\t    position: 'relative',\n\t    verticalAlign: 'top',\n\t    backgroundColor: 'transparent'\n\t  },\n\t  inputWithNoHint: {\n\t    position: 'relative',\n\t    verticalAlign: 'top'\n\t  },\n\t  dropdown: {\n\t    position: 'absolute',\n\t    top: '100%',\n\t    left: '0',\n\t    zIndex: '100',\n\t    display: 'none'\n\t  },\n\t  suggestions: {\n\t    display: 'block'\n\t  },\n\t  suggestion: {\n\t    whiteSpace: 'nowrap',\n\t    cursor: 'pointer'\n\t  },\n\t  suggestionChild: {\n\t    whiteSpace: 'normal'\n\t  },\n\t  ltr: {\n\t    left: '0',\n\t    right: 'auto'\n\t  },\n\t  rtl: {\n\t    left: 'auto',\n\t    right: '0'\n\t  },\n\t  defaultClasses: {\n\t    root: 'algolia-autocomplete',\n\t    prefix: 'aa',\n\t    noPrefix: false,\n\t    dropdownMenu: 'dropdown-menu',\n\t    input: 'input',\n\t    hint: 'hint',\n\t    suggestions: 'suggestions',\n\t    suggestion: 'suggestion',\n\t    cursor: 'cursor',\n\t    dataset: 'dataset',\n\t    empty: 'empty'\n\t  },\n\t  // will be merged with the default ones if appendTo is used\n\t  appendTo: {\n\t    wrapper: {\n\t      position: 'absolute',\n\t      zIndex: '100',\n\t      display: 'none'\n\t    },\n\t    input: {},\n\t    inputWithNoHint: {},\n\t    dropdown: {\n\t      display: 'block'\n\t    }\n\t  }\n\t};\n\n\t// ie specific styling\n\tif (_.isMsie()) {\n\t  // ie6-8 (and 9?) doesn't fire hover and click events for elements with\n\t  // transparent backgrounds, for a workaround, use 1x1 transparent gif\n\t  _.mixin(css.input, {\n\t    backgroundImage: 'url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)'\n\t  });\n\t}\n\n\t// ie7 and under specific styling\n\tif (_.isMsie() && _.isMsie() <= 7) {\n\t  // if someone can tell me why this is necessary to align\n\t  // the hint with the query in ie7, i'll send you $5 - @JakeHarding\n\t  _.mixin(css.input, {marginTop: '-1px'});\n\t}\n\n\tmodule.exports = css;\n\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tmodule.exports = {\n\t  hits: __webpack_require__(21),\n\t  popularIn: __webpack_require__(24)\n\t};\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar _ = __webpack_require__(4);\n\tvar version = __webpack_require__(22);\n\tvar parseAlgoliaClientVersion = __webpack_require__(23);\n\n\tfunction createMultiQuerySource() {\n\t  var queries = [];\n\t  var lastResults = [];\n\t  var lastSearch = window.Promise.resolve();\n\n\t  function requestSearch(queryClient, queryIndex) {\n\t    // Since all requests happen synchronously, this is executed once all the\n\t    // sources have been requested.\n\t    return window.Promise.resolve()\n\t      .then(function() {\n\t        if (queries.length) {\n\t          lastSearch = queryClient.search(queries);\n\t          queries = [];\n\t        }\n\n\t        return lastSearch;\n\t      })\n\t      .then(function(result) {\n\t        if (!result) {\n\t          return undefined;\n\t        }\n\n\t        lastResults = result.results;\n\t        return lastResults[queryIndex];\n\t      });\n\t  }\n\n\t  return function multiQuerySource(searchIndex, params) {\n\t    return function search(query, cb) {\n\t      var queryClient = searchIndex.as;\n\t      var queryIndex =\n\t        queries.push({\n\t          indexName: searchIndex.indexName,\n\t          query: query,\n\t          params: params\n\t        }) - 1;\n\n\t      requestSearch(queryClient, queryIndex)\n\t        .then(function(result) {\n\t          if (result) {\n\t            cb(result.hits, result);\n\t          }\n\t        })\n\t        .catch(function(error) {\n\t          _.error(error.message);\n\t        });\n\t    };\n\t  };\n\t}\n\n\tvar source = createMultiQuerySource();\n\n\tmodule.exports = function search(index, params) {\n\t  var algoliaVersion = parseAlgoliaClientVersion(index.as._ua);\n\n\t  if (algoliaVersion && algoliaVersion[0] >= 3 && algoliaVersion[1] > 20) {\n\t    var autocompleteUserAgent = 'autocomplete.js ' + version;\n\n\t    if (index.as._ua.indexOf(autocompleteUserAgent) === -1) {\n\t      index.as._ua += '; ' + autocompleteUserAgent;\n\t    }\n\t  }\n\n\t  return source(index, params);\n\t};\n\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \"0.38.1\";\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\n\tmodule.exports = function parseAlgoliaClientVersion(agent) {\n\t  var parsed =\n\t    // User agent for algoliasearch >= 3.33.0\n\t    agent.match(/Algolia for JavaScript \\((\\d+\\.)(\\d+\\.)(\\d+)\\)/) ||\n\t    // User agent for algoliasearch < 3.33.0\n\t    agent.match(/Algolia for vanilla JavaScript (\\d+\\.)(\\d+\\.)(\\d+)/);\n\n\t  if (parsed) {\n\t    return [parsed[1], parsed[2], parsed[3]];\n\t  }\n\n\t  return undefined;\n\t};\n\n\n/***/ },\n/* 24 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar _ = __webpack_require__(4);\n\tvar version = __webpack_require__(22);\n\tvar parseAlgoliaClientVersion = __webpack_require__(23);\n\n\tmodule.exports = function popularIn(index, params, details, options) {\n\t  var algoliaVersion = parseAlgoliaClientVersion(index.as._ua);\n\t  if (algoliaVersion && algoliaVersion[0] >= 3 && algoliaVersion[1] > 20) {\n\t    params = params || {};\n\t    params.additionalUA = 'autocomplete.js ' + version;\n\t  }\n\t  if (!details.source) {\n\t    return _.error(\"Missing 'source' key\");\n\t  }\n\t  var source = _.isFunction(details.source) ? details.source : function(hit) { return hit[details.source]; };\n\n\t  if (!details.index) {\n\t    return _.error(\"Missing 'index' key\");\n\t  }\n\t  var detailsIndex = details.index;\n\n\t  options = options || {};\n\n\t  return sourceFn;\n\n\t  function sourceFn(query, cb) {\n\t    index.search(query, params, function(error, content) {\n\t      if (error) {\n\t        _.error(error.message);\n\t        return;\n\t      }\n\n\t      if (content.hits.length > 0) {\n\t        var first = content.hits[0];\n\n\t        var detailsParams = _.mixin({hitsPerPage: 0}, details);\n\t        delete detailsParams.source; // not a query parameter\n\t        delete detailsParams.index; // not a query parameter\n\n\t        var detailsAlgoliaVersion = parseAlgoliaClientVersion(detailsIndex.as._ua);\n\t        if (detailsAlgoliaVersion && detailsAlgoliaVersion[0] >= 3 && detailsAlgoliaVersion[1] > 20) {\n\t          params.additionalUA = 'autocomplete.js ' + version;\n\t        }\n\n\t        detailsIndex.search(source(first), detailsParams, function(error2, content2) {\n\t          if (error2) {\n\t            _.error(error2.message);\n\t            return;\n\t          }\n\n\t          var suggestions = [];\n\n\t          // add the 'all department' entry before others\n\t          if (options.includeAll) {\n\t            var label = options.allTitle || 'All departments';\n\t            suggestions.push(_.mixin({\n\t              facet: {value: label, count: content2.nbHits}\n\t            }, _.cloneDeep(first)));\n\t          }\n\n\t          // enrich the first hit iterating over the facets\n\t          _.each(content2.facets, function(values, facet) {\n\t            _.each(values, function(count, value) {\n\t              suggestions.push(_.mixin({\n\t                facet: {facet: facet, value: value, count: count}\n\t              }, _.cloneDeep(first)));\n\t            });\n\t          });\n\n\t          // append all other hits\n\t          for (var i = 1; i < content.hits.length; ++i) {\n\t            suggestions.push(content.hits[i]);\n\t          }\n\n\t          cb(suggestions, content);\n\t        });\n\n\t        return;\n\t      }\n\n\t      cb([]);\n\t    });\n\t  }\n\t};\n\n\n/***/ }\n/******/ ]);"
  },
  {
    "path": "js/autocomplete.js/dist/autocomplete.js",
    "content": "/*!\n * autocomplete.js 0.38.1\n * https://github.com/algolia/autocomplete.js\n * Copyright 2021 Algolia, Inc. and other contributors; Licensed MIT\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"autocomplete\"] = factory();\n\telse\n\t\troot[\"autocomplete\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n\n\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tmodule.exports = __webpack_require__(1);\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\t// this will inject Zepto in window, unfortunately no easy commonJS zepto build\n\tvar zepto = __webpack_require__(2);\n\n\t// setup DOM element\n\tvar DOM = __webpack_require__(3);\n\tDOM.element = zepto;\n\n\t// setup utils functions\n\tvar _ = __webpack_require__(4);\n\t_.isArray = zepto.isArray;\n\t_.isFunction = zepto.isFunction;\n\t_.isObject = zepto.isPlainObject;\n\t_.bind = zepto.proxy;\n\t_.each = function(collection, cb) {\n\t  // stupid argument order for jQuery.each\n\t  zepto.each(collection, reverseArgs);\n\t  function reverseArgs(index, value) {\n\t    return cb(value, index);\n\t  }\n\t};\n\t_.map = zepto.map;\n\t_.mixin = zepto.extend;\n\t_.Event = zepto.Event;\n\n\tvar typeaheadKey = 'aaAutocomplete';\n\tvar Typeahead = __webpack_require__(5);\n\tvar EventBus = __webpack_require__(6);\n\n\tfunction autocomplete(selector, options, datasets, typeaheadObject) {\n\t  datasets = _.isArray(datasets) ? datasets : [].slice.call(arguments, 2);\n\n\t  var inputs = zepto(selector).each(function(i, input) {\n\t    var $input = zepto(input);\n\t    var eventBus = new EventBus({el: $input});\n\t    var typeahead = typeaheadObject || new Typeahead({\n\t      input: $input,\n\t      eventBus: eventBus,\n\t      dropdownMenuContainer: options.dropdownMenuContainer,\n\t      hint: options.hint === undefined ? true : !!options.hint,\n\t      minLength: options.minLength,\n\t      autoselect: options.autoselect,\n\t      autoselectOnBlur: options.autoselectOnBlur,\n\t      tabAutocomplete: options.tabAutocomplete,\n\t      openOnFocus: options.openOnFocus,\n\t      templates: options.templates,\n\t      debug: options.debug,\n\t      clearOnSelected: options.clearOnSelected,\n\t      cssClasses: options.cssClasses,\n\t      datasets: datasets,\n\t      keyboardShortcuts: options.keyboardShortcuts,\n\t      appendTo: options.appendTo,\n\t      autoWidth: options.autoWidth,\n\t      ariaLabel: options.ariaLabel || input.getAttribute('aria-label')\n\t    });\n\t    $input.data(typeaheadKey, typeahead);\n\t  });\n\n\t  // expose all methods in the `autocomplete` attribute\n\t  inputs.autocomplete = {};\n\t  _.each(['open', 'close', 'getVal', 'setVal', 'destroy', 'getWrapper'], function(method) {\n\t    inputs.autocomplete[method] = function() {\n\t      var methodArguments = arguments;\n\t      var result;\n\t      inputs.each(function(j, input) {\n\t        var typeahead = zepto(input).data(typeaheadKey);\n\t        result = typeahead[method].apply(typeahead, methodArguments);\n\t      });\n\t      return result;\n\t    };\n\t  });\n\n\t  return inputs;\n\t}\n\n\tautocomplete.sources = Typeahead.sources;\n\tautocomplete.escapeHighlightedString = _.escapeHighlightedString;\n\n\tvar wasAutocompleteSet = 'autocomplete' in window;\n\tvar oldAutocomplete = window.autocomplete;\n\tautocomplete.noConflict = function noConflict() {\n\t  if (wasAutocompleteSet) {\n\t    window.autocomplete = oldAutocomplete;\n\t  } else {\n\t    delete window.autocomplete;\n\t  }\n\t  return autocomplete;\n\t};\n\n\tmodule.exports = autocomplete;\n\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\t/* istanbul ignore next */\n\t/* Zepto v1.2.0 - zepto event assets data - zeptojs.com/license */\n\t(function(global, factory) {\n\t  module.exports = factory(global);\n\t}(/* this ##### UPDATED: here we want to use window/global instead of this which is the current file context ##### */ window, function(window) {\n\t  var Zepto = (function() {\n\t  var undefined, key, $, classList, emptyArray = [], concat = emptyArray.concat, filter = emptyArray.filter, slice = emptyArray.slice,\n\t    document = window.document,\n\t    elementDisplay = {}, classCache = {},\n\t    cssNumber = { 'column-count': 1, 'columns': 1, 'font-weight': 1, 'line-height': 1,'opacity': 1, 'z-index': 1, 'zoom': 1 },\n\t    fragmentRE = /^\\s*<(\\w+|!)[^>]*>/,\n\t    singleTagRE = /^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/,\n\t    tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/ig,\n\t    rootNodeRE = /^(?:body|html)$/i,\n\t    capitalRE = /([A-Z])/g,\n\n\t    // special attributes that should be get/set via method calls\n\t    methodAttributes = ['val', 'css', 'html', 'text', 'data', 'width', 'height', 'offset'],\n\n\t    adjacencyOperators = [ 'after', 'prepend', 'before', 'append' ],\n\t    table = document.createElement('table'),\n\t    tableRow = document.createElement('tr'),\n\t    containers = {\n\t      'tr': document.createElement('tbody'),\n\t      'tbody': table, 'thead': table, 'tfoot': table,\n\t      'td': tableRow, 'th': tableRow,\n\t      '*': document.createElement('div')\n\t    },\n\t    readyRE = /complete|loaded|interactive/,\n\t    simpleSelectorRE = /^[\\w-]*$/,\n\t    class2type = {},\n\t    toString = class2type.toString,\n\t    zepto = {},\n\t    camelize, uniq,\n\t    tempParent = document.createElement('div'),\n\t    propMap = {\n\t      'tabindex': 'tabIndex',\n\t      'readonly': 'readOnly',\n\t      'for': 'htmlFor',\n\t      'class': 'className',\n\t      'maxlength': 'maxLength',\n\t      'cellspacing': 'cellSpacing',\n\t      'cellpadding': 'cellPadding',\n\t      'rowspan': 'rowSpan',\n\t      'colspan': 'colSpan',\n\t      'usemap': 'useMap',\n\t      'frameborder': 'frameBorder',\n\t      'contenteditable': 'contentEditable'\n\t    },\n\t    isArray = Array.isArray ||\n\t      function(object){ return object instanceof Array }\n\n\t  zepto.matches = function(element, selector) {\n\t    if (!selector || !element || element.nodeType !== 1) return false\n\t    var matchesSelector = element.matches || element.webkitMatchesSelector ||\n\t                          element.mozMatchesSelector || element.oMatchesSelector ||\n\t                          element.matchesSelector\n\t    if (matchesSelector) return matchesSelector.call(element, selector)\n\t    // fall back to performing a selector:\n\t    var match, parent = element.parentNode, temp = !parent\n\t    if (temp) (parent = tempParent).appendChild(element)\n\t    match = ~zepto.qsa(parent, selector).indexOf(element)\n\t    temp && tempParent.removeChild(element)\n\t    return match\n\t  }\n\n\t  function type(obj) {\n\t    return obj == null ? String(obj) :\n\t      class2type[toString.call(obj)] || \"object\"\n\t  }\n\n\t  function isFunction(value) { return type(value) == \"function\" }\n\t  function isWindow(obj)     { return obj != null && obj == obj.window }\n\t  function isDocument(obj)   { return obj != null && obj.nodeType == obj.DOCUMENT_NODE }\n\t  function isObject(obj)     { return type(obj) == \"object\" }\n\t  function isPlainObject(obj) {\n\t    return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype\n\t  }\n\n\t  function likeArray(obj) {\n\t    var length = !!obj && 'length' in obj && obj.length,\n\t      type = $.type(obj)\n\n\t    return 'function' != type && !isWindow(obj) && (\n\t      'array' == type || length === 0 ||\n\t        (typeof length == 'number' && length > 0 && (length - 1) in obj)\n\t    )\n\t  }\n\n\t  function compact(array) { return filter.call(array, function(item){ return item != null }) }\n\t  function flatten(array) { return array.length > 0 ? $.fn.concat.apply([], array) : array }\n\t  camelize = function(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) }\n\t  function dasherize(str) {\n\t    return str.replace(/::/g, '/')\n\t           .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n\t           .replace(/([a-z\\d])([A-Z])/g, '$1_$2')\n\t           .replace(/_/g, '-')\n\t           .toLowerCase()\n\t  }\n\t  uniq = function(array){ return filter.call(array, function(item, idx){ return array.indexOf(item) == idx }) }\n\n\t  function classRE(name) {\n\t    return name in classCache ?\n\t      classCache[name] : (classCache[name] = new RegExp('(^|\\\\s)' + name + '(\\\\s|$)'))\n\t  }\n\n\t  function maybeAddPx(name, value) {\n\t    return (typeof value == \"number\" && !cssNumber[dasherize(name)]) ? value + \"px\" : value\n\t  }\n\n\t  function defaultDisplay(nodeName) {\n\t    var element, display\n\t    if (!elementDisplay[nodeName]) {\n\t      element = document.createElement(nodeName)\n\t      document.body.appendChild(element)\n\t      display = getComputedStyle(element, '').getPropertyValue(\"display\")\n\t      element.parentNode.removeChild(element)\n\t      display == \"none\" && (display = \"block\")\n\t      elementDisplay[nodeName] = display\n\t    }\n\t    return elementDisplay[nodeName]\n\t  }\n\n\t  function children(element) {\n\t    return 'children' in element ?\n\t      slice.call(element.children) :\n\t      $.map(element.childNodes, function(node){ if (node.nodeType == 1) return node })\n\t  }\n\n\t  function Z(dom, selector) {\n\t    var i, len = dom ? dom.length : 0\n\t    for (i = 0; i < len; i++) this[i] = dom[i]\n\t    this.length = len\n\t    this.selector = selector || ''\n\t  }\n\n\t  // `$.zepto.fragment` takes a html string and an optional tag name\n\t  // to generate DOM nodes from the given html string.\n\t  // The generated DOM nodes are returned as an array.\n\t  // This function can be overridden in plugins for example to make\n\t  // it compatible with browsers that don't support the DOM fully.\n\t  zepto.fragment = function(html, name, properties) {\n\t    var dom, nodes, container\n\n\t    // A special case optimization for a single tag\n\t    if (singleTagRE.test(html)) dom = $(document.createElement(RegExp.$1))\n\n\t    if (!dom) {\n\t      if (html.replace) html = html.replace(tagExpanderRE, \"<$1></$2>\")\n\t      if (name === undefined) name = fragmentRE.test(html) && RegExp.$1\n\t      if (!(name in containers)) name = '*'\n\n\t      container = containers[name]\n\t      container.innerHTML = '' + html\n\t      dom = $.each(slice.call(container.childNodes), function(){\n\t        container.removeChild(this)\n\t      })\n\t    }\n\n\t    if (isPlainObject(properties)) {\n\t      nodes = $(dom)\n\t      $.each(properties, function(key, value) {\n\t        if (methodAttributes.indexOf(key) > -1) nodes[key](value)\n\t        else nodes.attr(key, value)\n\t      })\n\t    }\n\n\t    return dom\n\t  }\n\n\t  // `$.zepto.Z` swaps out the prototype of the given `dom` array\n\t  // of nodes with `$.fn` and thus supplying all the Zepto functions\n\t  // to the array. This method can be overridden in plugins.\n\t  zepto.Z = function(dom, selector) {\n\t    return new Z(dom, selector)\n\t  }\n\n\t  // `$.zepto.isZ` should return `true` if the given object is a Zepto\n\t  // collection. This method can be overridden in plugins.\n\t  zepto.isZ = function(object) {\n\t    return object instanceof zepto.Z\n\t  }\n\n\t  // `$.zepto.init` is Zepto's counterpart to jQuery's `$.fn.init` and\n\t  // takes a CSS selector and an optional context (and handles various\n\t  // special cases).\n\t  // This method can be overridden in plugins.\n\t  zepto.init = function(selector, context) {\n\t    var dom\n\t    // If nothing given, return an empty Zepto collection\n\t    if (!selector) return zepto.Z()\n\t    // Optimize for string selectors\n\t    else if (typeof selector == 'string') {\n\t      selector = selector.trim()\n\t      // If it's a html fragment, create nodes from it\n\t      // Note: In both Chrome 21 and Firefox 15, DOM error 12\n\t      // is thrown if the fragment doesn't begin with <\n\t      if (selector[0] == '<' && fragmentRE.test(selector))\n\t        dom = zepto.fragment(selector, RegExp.$1, context), selector = null\n\t      // If there's a context, create a collection on that context first, and select\n\t      // nodes from there\n\t      else if (context !== undefined) return $(context).find(selector)\n\t      // If it's a CSS selector, use it to select nodes.\n\t      else dom = zepto.qsa(document, selector)\n\t    }\n\t    // If a function is given, call it when the DOM is ready\n\t    else if (isFunction(selector)) return $(document).ready(selector)\n\t    // If a Zepto collection is given, just return it\n\t    else if (zepto.isZ(selector)) return selector\n\t    else {\n\t      // normalize array if an array of nodes is given\n\t      if (isArray(selector)) dom = compact(selector)\n\t      // Wrap DOM nodes.\n\t      else if (isObject(selector))\n\t        dom = [selector], selector = null\n\t      // If it's a html fragment, create nodes from it\n\t      else if (fragmentRE.test(selector))\n\t        dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null\n\t      // If there's a context, create a collection on that context first, and select\n\t      // nodes from there\n\t      else if (context !== undefined) return $(context).find(selector)\n\t      // And last but no least, if it's a CSS selector, use it to select nodes.\n\t      else dom = zepto.qsa(document, selector)\n\t    }\n\t    // create a new Zepto collection from the nodes found\n\t    return zepto.Z(dom, selector)\n\t  }\n\n\t  // `$` will be the base `Zepto` object. When calling this\n\t  // function just call `$.zepto.init, which makes the implementation\n\t  // details of selecting nodes and creating Zepto collections\n\t  // patchable in plugins.\n\t  $ = function(selector, context){\n\t    return zepto.init(selector, context)\n\t  }\n\n\t  function extend(target, source, deep) {\n\t    for (key in source)\n\t      if (deep && (isPlainObject(source[key]) || isArray(source[key]))) {\n\t        if (isPlainObject(source[key]) && !isPlainObject(target[key]))\n\t          target[key] = {}\n\t        if (isArray(source[key]) && !isArray(target[key]))\n\t          target[key] = []\n\t        extend(target[key], source[key], deep)\n\t      }\n\t      else if (source[key] !== undefined) target[key] = source[key]\n\t  }\n\n\t  // Copy all but undefined properties from one or more\n\t  // objects to the `target` object.\n\t  $.extend = function(target){\n\t    var deep, args = slice.call(arguments, 1)\n\t    if (typeof target == 'boolean') {\n\t      deep = target\n\t      target = args.shift()\n\t    }\n\t    args.forEach(function(arg){ extend(target, arg, deep) })\n\t    return target\n\t  }\n\n\t  // `$.zepto.qsa` is Zepto's CSS selector implementation which\n\t  // uses `document.querySelectorAll` and optimizes for some special cases, like `#id`.\n\t  // This method can be overridden in plugins.\n\t  zepto.qsa = function(element, selector){\n\t    var found,\n\t        maybeID = selector[0] == '#',\n\t        maybeClass = !maybeID && selector[0] == '.',\n\t        nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, // Ensure that a 1 char tag name still gets checked\n\t        isSimple = simpleSelectorRE.test(nameOnly)\n\t    return (element.getElementById && isSimple && maybeID) ? // Safari DocumentFragment doesn't have getElementById\n\t      ( (found = element.getElementById(nameOnly)) ? [found] : [] ) :\n\t      (element.nodeType !== 1 && element.nodeType !== 9 && element.nodeType !== 11) ? [] :\n\t      slice.call(\n\t        isSimple && !maybeID && element.getElementsByClassName ? // DocumentFragment doesn't have getElementsByClassName/TagName\n\t          maybeClass ? element.getElementsByClassName(nameOnly) : // If it's simple, it could be a class\n\t          element.getElementsByTagName(selector) : // Or a tag\n\t          element.querySelectorAll(selector) // Or it's not simple, and we need to query all\n\t      )\n\t  }\n\n\t  function filtered(nodes, selector) {\n\t    return selector == null ? $(nodes) : $(nodes).filter(selector)\n\t  }\n\n\t  $.contains = document.documentElement.contains ?\n\t    function(parent, node) {\n\t      return parent !== node && parent.contains(node)\n\t    } :\n\t    function(parent, node) {\n\t      while (node && (node = node.parentNode))\n\t        if (node === parent) return true\n\t      return false\n\t    }\n\n\t  function funcArg(context, arg, idx, payload) {\n\t    return isFunction(arg) ? arg.call(context, idx, payload) : arg\n\t  }\n\n\t  function setAttribute(node, name, value) {\n\t    value == null ? node.removeAttribute(name) : node.setAttribute(name, value)\n\t  }\n\n\t  // access className property while respecting SVGAnimatedString\n\t  function className(node, value){\n\t    var klass = node.className || '',\n\t        svg   = klass && klass.baseVal !== undefined\n\n\t    if (value === undefined) return svg ? klass.baseVal : klass\n\t    svg ? (klass.baseVal = value) : (node.className = value)\n\t  }\n\n\t  // \"true\"  => true\n\t  // \"false\" => false\n\t  // \"null\"  => null\n\t  // \"42\"    => 42\n\t  // \"42.5\"  => 42.5\n\t  // \"08\"    => \"08\"\n\t  // JSON    => parse if valid\n\t  // String  => self\n\t  function deserializeValue(value) {\n\t    try {\n\t      return value ?\n\t        value == \"true\" ||\n\t        ( value == \"false\" ? false :\n\t          value == \"null\" ? null :\n\t          +value + \"\" == value ? +value :\n\t          /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n\t          value )\n\t        : value\n\t    } catch(e) {\n\t      return value\n\t    }\n\t  }\n\n\t  $.type = type\n\t  $.isFunction = isFunction\n\t  $.isWindow = isWindow\n\t  $.isArray = isArray\n\t  $.isPlainObject = isPlainObject\n\n\t  $.isEmptyObject = function(obj) {\n\t    var name\n\t    for (name in obj) return false\n\t    return true\n\t  }\n\n\t  $.isNumeric = function(val) {\n\t    var num = Number(val), type = typeof val\n\t    return val != null && type != 'boolean' &&\n\t      (type != 'string' || val.length) &&\n\t      !isNaN(num) && isFinite(num) || false\n\t  }\n\n\t  $.inArray = function(elem, array, i){\n\t    return emptyArray.indexOf.call(array, elem, i)\n\t  }\n\n\t  $.camelCase = camelize\n\t  $.trim = function(str) {\n\t    return str == null ? \"\" : String.prototype.trim.call(str)\n\t  }\n\n\t  // plugin compatibility\n\t  $.uuid = 0\n\t  $.support = { }\n\t  $.expr = { }\n\t  $.noop = function() {}\n\n\t  $.map = function(elements, callback){\n\t    var value, values = [], i, key\n\t    if (likeArray(elements))\n\t      for (i = 0; i < elements.length; i++) {\n\t        value = callback(elements[i], i)\n\t        if (value != null) values.push(value)\n\t      }\n\t    else\n\t      for (key in elements) {\n\t        value = callback(elements[key], key)\n\t        if (value != null) values.push(value)\n\t      }\n\t    return flatten(values)\n\t  }\n\n\t  $.each = function(elements, callback){\n\t    var i, key\n\t    if (likeArray(elements)) {\n\t      for (i = 0; i < elements.length; i++)\n\t        if (callback.call(elements[i], i, elements[i]) === false) return elements\n\t    } else {\n\t      for (key in elements)\n\t        if (callback.call(elements[key], key, elements[key]) === false) return elements\n\t    }\n\n\t    return elements\n\t  }\n\n\t  $.grep = function(elements, callback){\n\t    return filter.call(elements, callback)\n\t  }\n\n\t  if (window.JSON) $.parseJSON = JSON.parse\n\n\t  // Populate the class2type map\n\t  $.each(\"Boolean Number String Function Array Date RegExp Object Error\".split(\" \"), function(i, name) {\n\t    class2type[ \"[object \" + name + \"]\" ] = name.toLowerCase()\n\t  })\n\n\t  // Define methods that will be available on all\n\t  // Zepto collections\n\t  $.fn = {\n\t    constructor: zepto.Z,\n\t    length: 0,\n\n\t    // Because a collection acts like an array\n\t    // copy over these useful array functions.\n\t    forEach: emptyArray.forEach,\n\t    reduce: emptyArray.reduce,\n\t    push: emptyArray.push,\n\t    sort: emptyArray.sort,\n\t    splice: emptyArray.splice,\n\t    indexOf: emptyArray.indexOf,\n\t    concat: function(){\n\t      var i, value, args = []\n\t      for (i = 0; i < arguments.length; i++) {\n\t        value = arguments[i]\n\t        args[i] = zepto.isZ(value) ? value.toArray() : value\n\t      }\n\t      return concat.apply(zepto.isZ(this) ? this.toArray() : this, args)\n\t    },\n\n\t    // `map` and `slice` in the jQuery API work differently\n\t    // from their array counterparts\n\t    map: function(fn){\n\t      return $($.map(this, function(el, i){ return fn.call(el, i, el) }))\n\t    },\n\t    slice: function(){\n\t      return $(slice.apply(this, arguments))\n\t    },\n\n\t    ready: function(callback){\n\t      // need to check if document.body exists for IE as that browser reports\n\t      // document ready when it hasn't yet created the body element\n\t      if (readyRE.test(document.readyState) && document.body) callback($)\n\t      else document.addEventListener('DOMContentLoaded', function(){ callback($) }, false)\n\t      return this\n\t    },\n\t    get: function(idx){\n\t      return idx === undefined ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length]\n\t    },\n\t    toArray: function(){ return this.get() },\n\t    size: function(){\n\t      return this.length\n\t    },\n\t    remove: function(){\n\t      return this.each(function(){\n\t        if (this.parentNode != null)\n\t          this.parentNode.removeChild(this)\n\t      })\n\t    },\n\t    each: function(callback){\n\t      emptyArray.every.call(this, function(el, idx){\n\t        return callback.call(el, idx, el) !== false\n\t      })\n\t      return this\n\t    },\n\t    filter: function(selector){\n\t      if (isFunction(selector)) return this.not(this.not(selector))\n\t      return $(filter.call(this, function(element){\n\t        return zepto.matches(element, selector)\n\t      }))\n\t    },\n\t    add: function(selector,context){\n\t      return $(uniq(this.concat($(selector,context))))\n\t    },\n\t    is: function(selector){\n\t      return this.length > 0 && zepto.matches(this[0], selector)\n\t    },\n\t    not: function(selector){\n\t      var nodes=[]\n\t      if (isFunction(selector) && selector.call !== undefined)\n\t        this.each(function(idx){\n\t          if (!selector.call(this,idx)) nodes.push(this)\n\t        })\n\t      else {\n\t        var excludes = typeof selector == 'string' ? this.filter(selector) :\n\t          (likeArray(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector)\n\t        this.forEach(function(el){\n\t          if (excludes.indexOf(el) < 0) nodes.push(el)\n\t        })\n\t      }\n\t      return $(nodes)\n\t    },\n\t    has: function(selector){\n\t      return this.filter(function(){\n\t        return isObject(selector) ?\n\t          $.contains(this, selector) :\n\t          $(this).find(selector).size()\n\t      })\n\t    },\n\t    eq: function(idx){\n\t      return idx === -1 ? this.slice(idx) : this.slice(idx, + idx + 1)\n\t    },\n\t    first: function(){\n\t      var el = this[0]\n\t      return el && !isObject(el) ? el : $(el)\n\t    },\n\t    last: function(){\n\t      var el = this[this.length - 1]\n\t      return el && !isObject(el) ? el : $(el)\n\t    },\n\t    find: function(selector){\n\t      var result, $this = this\n\t      if (!selector) result = $()\n\t      else if (typeof selector == 'object')\n\t        result = $(selector).filter(function(){\n\t          var node = this\n\t          return emptyArray.some.call($this, function(parent){\n\t            return $.contains(parent, node)\n\t          })\n\t        })\n\t      else if (this.length == 1) result = $(zepto.qsa(this[0], selector))\n\t      else result = this.map(function(){ return zepto.qsa(this, selector) })\n\t      return result\n\t    },\n\t    closest: function(selector, context){\n\t      var nodes = [], collection = typeof selector == 'object' && $(selector)\n\t      this.each(function(_, node){\n\t        while (node && !(collection ? collection.indexOf(node) >= 0 : zepto.matches(node, selector)))\n\t          node = node !== context && !isDocument(node) && node.parentNode\n\t        if (node && nodes.indexOf(node) < 0) nodes.push(node)\n\t      })\n\t      return $(nodes)\n\t    },\n\t    parents: function(selector){\n\t      var ancestors = [], nodes = this\n\t      while (nodes.length > 0)\n\t        nodes = $.map(nodes, function(node){\n\t          if ((node = node.parentNode) && !isDocument(node) && ancestors.indexOf(node) < 0) {\n\t            ancestors.push(node)\n\t            return node\n\t          }\n\t        })\n\t      return filtered(ancestors, selector)\n\t    },\n\t    parent: function(selector){\n\t      return filtered(uniq(this.pluck('parentNode')), selector)\n\t    },\n\t    children: function(selector){\n\t      return filtered(this.map(function(){ return children(this) }), selector)\n\t    },\n\t    contents: function() {\n\t      return this.map(function() { return this.contentDocument || slice.call(this.childNodes) })\n\t    },\n\t    siblings: function(selector){\n\t      return filtered(this.map(function(i, el){\n\t        return filter.call(children(el.parentNode), function(child){ return child!==el })\n\t      }), selector)\n\t    },\n\t    empty: function(){\n\t      return this.each(function(){ this.innerHTML = '' })\n\t    },\n\t    // `pluck` is borrowed from Prototype.js\n\t    pluck: function(property){\n\t      return $.map(this, function(el){ return el[property] })\n\t    },\n\t    show: function(){\n\t      return this.each(function(){\n\t        this.style.display == \"none\" && (this.style.display = '')\n\t        if (getComputedStyle(this, '').getPropertyValue(\"display\") == \"none\")\n\t          this.style.display = defaultDisplay(this.nodeName)\n\t      })\n\t    },\n\t    replaceWith: function(newContent){\n\t      return this.before(newContent).remove()\n\t    },\n\t    wrap: function(structure){\n\t      var func = isFunction(structure)\n\t      if (this[0] && !func)\n\t        var dom   = $(structure).get(0),\n\t            clone = dom.parentNode || this.length > 1\n\n\t      return this.each(function(index){\n\t        $(this).wrapAll(\n\t          func ? structure.call(this, index) :\n\t            clone ? dom.cloneNode(true) : dom\n\t        )\n\t      })\n\t    },\n\t    wrapAll: function(structure){\n\t      if (this[0]) {\n\t        $(this[0]).before(structure = $(structure))\n\t        var children\n\t        // drill down to the inmost element\n\t        while ((children = structure.children()).length) structure = children.first()\n\t        $(structure).append(this)\n\t      }\n\t      return this\n\t    },\n\t    wrapInner: function(structure){\n\t      var func = isFunction(structure)\n\t      return this.each(function(index){\n\t        var self = $(this), contents = self.contents(),\n\t            dom  = func ? structure.call(this, index) : structure\n\t        contents.length ? contents.wrapAll(dom) : self.append(dom)\n\t      })\n\t    },\n\t    unwrap: function(){\n\t      this.parent().each(function(){\n\t        $(this).replaceWith($(this).children())\n\t      })\n\t      return this\n\t    },\n\t    clone: function(){\n\t      return this.map(function(){ return this.cloneNode(true) })\n\t    },\n\t    hide: function(){\n\t      return this.css(\"display\", \"none\")\n\t    },\n\t    toggle: function(setting){\n\t      return this.each(function(){\n\t        var el = $(this)\n\t        ;(setting === undefined ? el.css(\"display\") == \"none\" : setting) ? el.show() : el.hide()\n\t      })\n\t    },\n\t    prev: function(selector){ return $(this.pluck('previousElementSibling')).filter(selector || '*') },\n\t    next: function(selector){ return $(this.pluck('nextElementSibling')).filter(selector || '*') },\n\t    html: function(html){\n\t      return 0 in arguments ?\n\t        this.each(function(idx){\n\t          var originHtml = this.innerHTML\n\t          $(this).empty().append( funcArg(this, html, idx, originHtml) )\n\t        }) :\n\t        (0 in this ? this[0].innerHTML : null)\n\t    },\n\t    text: function(text){\n\t      return 0 in arguments ?\n\t        this.each(function(idx){\n\t          var newText = funcArg(this, text, idx, this.textContent)\n\t          this.textContent = newText == null ? '' : ''+newText\n\t        }) :\n\t        (0 in this ? this.pluck('textContent').join(\"\") : null)\n\t    },\n\t    attr: function(name, value){\n\t      var result\n\t      return (typeof name == 'string' && !(1 in arguments)) ?\n\t        (0 in this && this[0].nodeType == 1 && (result = this[0].getAttribute(name)) != null ? result : undefined) :\n\t        this.each(function(idx){\n\t          if (this.nodeType !== 1) return\n\t          if (isObject(name)) for (key in name) setAttribute(this, key, name[key])\n\t          else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name)))\n\t        })\n\t    },\n\t    removeAttr: function(name){\n\t      return this.each(function(){ this.nodeType === 1 && name.split(' ').forEach(function(attribute){\n\t        setAttribute(this, attribute)\n\t      }, this)})\n\t    },\n\t    prop: function(name, value){\n\t      name = propMap[name] || name\n\t      return (1 in arguments) ?\n\t        this.each(function(idx){\n\t          this[name] = funcArg(this, value, idx, this[name])\n\t        }) :\n\t        (this[0] && this[0][name])\n\t    },\n\t    removeProp: function(name){\n\t      name = propMap[name] || name\n\t      return this.each(function(){ delete this[name] })\n\t    },\n\t    data: function(name, value){\n\t      var attrName = 'data-' + name.replace(capitalRE, '-$1').toLowerCase()\n\n\t      var data = (1 in arguments) ?\n\t        this.attr(attrName, value) :\n\t        this.attr(attrName)\n\n\t      return data !== null ? deserializeValue(data) : undefined\n\t    },\n\t    val: function(value){\n\t      if (0 in arguments) {\n\t        if (value == null) value = \"\"\n\t        return this.each(function(idx){\n\t          this.value = funcArg(this, value, idx, this.value)\n\t        })\n\t      } else {\n\t        return this[0] && (this[0].multiple ?\n\t           $(this[0]).find('option').filter(function(){ return this.selected }).pluck('value') :\n\t           this[0].value)\n\t      }\n\t    },\n\t    offset: function(coordinates){\n\t      if (coordinates) return this.each(function(index){\n\t        var $this = $(this),\n\t            coords = funcArg(this, coordinates, index, $this.offset()),\n\t            parentOffset = $this.offsetParent().offset(),\n\t            props = {\n\t              top:  coords.top  - parentOffset.top,\n\t              left: coords.left - parentOffset.left\n\t            }\n\n\t        if ($this.css('position') == 'static') props['position'] = 'relative'\n\t        $this.css(props)\n\t      })\n\t      if (!this.length) return null\n\t      if (document.documentElement !== this[0] && !$.contains(document.documentElement, this[0]))\n\t        return {top: 0, left: 0}\n\t      var obj = this[0].getBoundingClientRect()\n\t      return {\n\t        left: obj.left + window.pageXOffset,\n\t        top: obj.top + window.pageYOffset,\n\t        width: Math.round(obj.width),\n\t        height: Math.round(obj.height)\n\t      }\n\t    },\n\t    css: function(property, value){\n\t      if (arguments.length < 2) {\n\t        var element = this[0]\n\t        if (typeof property == 'string') {\n\t          if (!element) return\n\t          return element.style[camelize(property)] || getComputedStyle(element, '').getPropertyValue(property)\n\t        } else if (isArray(property)) {\n\t          if (!element) return\n\t          var props = {}\n\t          var computedStyle = getComputedStyle(element, '')\n\t          $.each(property, function(_, prop){\n\t            props[prop] = (element.style[camelize(prop)] || computedStyle.getPropertyValue(prop))\n\t          })\n\t          return props\n\t        }\n\t      }\n\n\t      var css = ''\n\t      if (type(property) == 'string') {\n\t        if (!value && value !== 0)\n\t          this.each(function(){ this.style.removeProperty(dasherize(property)) })\n\t        else\n\t          css = dasherize(property) + \":\" + maybeAddPx(property, value)\n\t      } else {\n\t        for (key in property)\n\t          if (!property[key] && property[key] !== 0)\n\t            this.each(function(){ this.style.removeProperty(dasherize(key)) })\n\t          else\n\t            css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';'\n\t      }\n\n\t      return this.each(function(){ this.style.cssText += ';' + css })\n\t    },\n\t    index: function(element){\n\t      return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0])\n\t    },\n\t    hasClass: function(name){\n\t      if (!name) return false\n\t      return emptyArray.some.call(this, function(el){\n\t        return this.test(className(el))\n\t      }, classRE(name))\n\t    },\n\t    addClass: function(name){\n\t      if (!name) return this\n\t      return this.each(function(idx){\n\t        if (!('className' in this)) return\n\t        classList = []\n\t        var cls = className(this), newName = funcArg(this, name, idx, cls)\n\t        newName.split(/\\s+/g).forEach(function(klass){\n\t          if (!$(this).hasClass(klass)) classList.push(klass)\n\t        }, this)\n\t        classList.length && className(this, cls + (cls ? \" \" : \"\") + classList.join(\" \"))\n\t      })\n\t    },\n\t    removeClass: function(name){\n\t      return this.each(function(idx){\n\t        if (!('className' in this)) return\n\t        if (name === undefined) return className(this, '')\n\t        classList = className(this)\n\t        funcArg(this, name, idx, classList).split(/\\s+/g).forEach(function(klass){\n\t          classList = classList.replace(classRE(klass), \" \")\n\t        })\n\t        className(this, classList.trim())\n\t      })\n\t    },\n\t    toggleClass: function(name, when){\n\t      if (!name) return this\n\t      return this.each(function(idx){\n\t        var $this = $(this), names = funcArg(this, name, idx, className(this))\n\t        names.split(/\\s+/g).forEach(function(klass){\n\t          (when === undefined ? !$this.hasClass(klass) : when) ?\n\t            $this.addClass(klass) : $this.removeClass(klass)\n\t        })\n\t      })\n\t    },\n\t    scrollTop: function(value){\n\t      if (!this.length) return\n\t      var hasScrollTop = 'scrollTop' in this[0]\n\t      if (value === undefined) return hasScrollTop ? this[0].scrollTop : this[0].pageYOffset\n\t      return this.each(hasScrollTop ?\n\t        function(){ this.scrollTop = value } :\n\t        function(){ this.scrollTo(this.scrollX, value) })\n\t    },\n\t    scrollLeft: function(value){\n\t      if (!this.length) return\n\t      var hasScrollLeft = 'scrollLeft' in this[0]\n\t      if (value === undefined) return hasScrollLeft ? this[0].scrollLeft : this[0].pageXOffset\n\t      return this.each(hasScrollLeft ?\n\t        function(){ this.scrollLeft = value } :\n\t        function(){ this.scrollTo(value, this.scrollY) })\n\t    },\n\t    position: function() {\n\t      if (!this.length) return\n\n\t      var elem = this[0],\n\t        // Get *real* offsetParent\n\t        offsetParent = this.offsetParent(),\n\t        // Get correct offsets\n\t        offset       = this.offset(),\n\t        parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset()\n\n\t      // Subtract element margins\n\t      // note: when an element has margin: auto the offsetLeft and marginLeft\n\t      // are the same in Safari causing offset.left to incorrectly be 0\n\t      offset.top  -= parseFloat( $(elem).css('margin-top') ) || 0\n\t      offset.left -= parseFloat( $(elem).css('margin-left') ) || 0\n\n\t      // Add offsetParent borders\n\t      parentOffset.top  += parseFloat( $(offsetParent[0]).css('border-top-width') ) || 0\n\t      parentOffset.left += parseFloat( $(offsetParent[0]).css('border-left-width') ) || 0\n\n\t      // Subtract the two offsets\n\t      return {\n\t        top:  offset.top  - parentOffset.top,\n\t        left: offset.left - parentOffset.left\n\t      }\n\t    },\n\t    offsetParent: function() {\n\t      return this.map(function(){\n\t        var parent = this.offsetParent || document.body\n\t        while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css(\"position\") == \"static\")\n\t          parent = parent.offsetParent\n\t        return parent\n\t      })\n\t    }\n\t  }\n\n\t  // for now\n\t  $.fn.detach = $.fn.remove\n\n\t  // Generate the `width` and `height` functions\n\t  ;['width', 'height'].forEach(function(dimension){\n\t    var dimensionProperty =\n\t      dimension.replace(/./, function(m){ return m[0].toUpperCase() })\n\n\t    $.fn[dimension] = function(value){\n\t      var offset, el = this[0]\n\t      if (value === undefined) return isWindow(el) ? el['inner' + dimensionProperty] :\n\t        isDocument(el) ? el.documentElement['scroll' + dimensionProperty] :\n\t        (offset = this.offset()) && offset[dimension]\n\t      else return this.each(function(idx){\n\t        el = $(this)\n\t        el.css(dimension, funcArg(this, value, idx, el[dimension]()))\n\t      })\n\t    }\n\t  })\n\n\t  function traverseNode(node, fun) {\n\t    fun(node)\n\t    for (var i = 0, len = node.childNodes.length; i < len; i++)\n\t      traverseNode(node.childNodes[i], fun)\n\t  }\n\n\t  // Generate the `after`, `prepend`, `before`, `append`,\n\t  // `insertAfter`, `insertBefore`, `appendTo`, and `prependTo` methods.\n\t  adjacencyOperators.forEach(function(operator, operatorIndex) {\n\t    var inside = operatorIndex % 2 //=> prepend, append\n\n\t    $.fn[operator] = function(){\n\t      // arguments can be nodes, arrays of nodes, Zepto objects and HTML strings\n\t      var argType, nodes = $.map(arguments, function(arg) {\n\t            var arr = []\n\t            argType = type(arg)\n\t            if (argType == \"array\") {\n\t              arg.forEach(function(el) {\n\t                if (el.nodeType !== undefined) return arr.push(el)\n\t                else if ($.zepto.isZ(el)) return arr = arr.concat(el.get())\n\t                arr = arr.concat(zepto.fragment(el))\n\t              })\n\t              return arr\n\t            }\n\t            return argType == \"object\" || arg == null ?\n\t              arg : zepto.fragment(arg)\n\t          }),\n\t          parent, copyByClone = this.length > 1\n\t      if (nodes.length < 1) return this\n\n\t      return this.each(function(_, target){\n\t        parent = inside ? target : target.parentNode\n\n\t        // convert all methods to a \"before\" operation\n\t        target = operatorIndex == 0 ? target.nextSibling :\n\t                 operatorIndex == 1 ? target.firstChild :\n\t                 operatorIndex == 2 ? target :\n\t                 null\n\n\t        var parentInDocument = $.contains(document.documentElement, parent)\n\n\t        nodes.forEach(function(node){\n\t          if (copyByClone) node = node.cloneNode(true)\n\t          else if (!parent) return $(node).remove()\n\n\t          parent.insertBefore(node, target)\n\t          if (parentInDocument) traverseNode(node, function(el){\n\t            if (el.nodeName != null && el.nodeName.toUpperCase() === 'SCRIPT' &&\n\t               (!el.type || el.type === 'text/javascript') && !el.src){\n\t              var target = el.ownerDocument ? el.ownerDocument.defaultView : window\n\t              target['eval'].call(target, el.innerHTML)\n\t            }\n\t          })\n\t        })\n\t      })\n\t    }\n\n\t    // after    => insertAfter\n\t    // prepend  => prependTo\n\t    // before   => insertBefore\n\t    // append   => appendTo\n\t    $.fn[inside ? operator+'To' : 'insert'+(operatorIndex ? 'Before' : 'After')] = function(html){\n\t      $(html)[operator](this)\n\t      return this\n\t    }\n\t  })\n\n\t  zepto.Z.prototype = Z.prototype = $.fn\n\n\t  // Export internal API functions in the `$.zepto` namespace\n\t  zepto.uniq = uniq\n\t  zepto.deserializeValue = deserializeValue\n\t  $.zepto = zepto\n\n\t  return $\n\t})()\n\n\t;(function($){\n\t  var _zid = 1, undefined,\n\t      slice = Array.prototype.slice,\n\t      isFunction = $.isFunction,\n\t      isString = function(obj){ return typeof obj == 'string' },\n\t      handlers = {},\n\t      specialEvents={},\n\t      focusinSupported = 'onfocusin' in window,\n\t      focus = { focus: 'focusin', blur: 'focusout' },\n\t      hover = { mouseenter: 'mouseover', mouseleave: 'mouseout' }\n\n\t  specialEvents.click = specialEvents.mousedown = specialEvents.mouseup = specialEvents.mousemove = 'MouseEvents'\n\n\t  function zid(element) {\n\t    return element._zid || (element._zid = _zid++)\n\t  }\n\t  function findHandlers(element, event, fn, selector) {\n\t    event = parse(event)\n\t    if (event.ns) var matcher = matcherFor(event.ns)\n\t    return (handlers[zid(element)] || []).filter(function(handler) {\n\t      return handler\n\t        && (!event.e  || handler.e == event.e)\n\t        && (!event.ns || matcher.test(handler.ns))\n\t        && (!fn       || zid(handler.fn) === zid(fn))\n\t        && (!selector || handler.sel == selector)\n\t    })\n\t  }\n\t  function parse(event) {\n\t    var parts = ('' + event).split('.')\n\t    return {e: parts[0], ns: parts.slice(1).sort().join(' ')}\n\t  }\n\t  function matcherFor(ns) {\n\t    return new RegExp('(?:^| )' + ns.replace(' ', ' .* ?') + '(?: |$)')\n\t  }\n\n\t  function eventCapture(handler, captureSetting) {\n\t    return handler.del &&\n\t      (!focusinSupported && (handler.e in focus)) ||\n\t      !!captureSetting\n\t  }\n\n\t  function realEvent(type) {\n\t    return hover[type] || (focusinSupported && focus[type]) || type\n\t  }\n\n\t  function add(element, events, fn, data, selector, delegator, capture){\n\t    var id = zid(element), set = (handlers[id] || (handlers[id] = []))\n\t    events.split(/\\s/).forEach(function(event){\n\t      if (event == 'ready') return $(document).ready(fn)\n\t      var handler   = parse(event)\n\t      handler.fn    = fn\n\t      handler.sel   = selector\n\t      // emulate mouseenter, mouseleave\n\t      if (handler.e in hover) fn = function(e){\n\t        var related = e.relatedTarget\n\t        if (!related || (related !== this && !$.contains(this, related)))\n\t          return handler.fn.apply(this, arguments)\n\t      }\n\t      handler.del   = delegator\n\t      var callback  = delegator || fn\n\t      handler.proxy = function(e){\n\t        e = compatible(e)\n\t        if (e.isImmediatePropagationStopped()) return\n\t        try {\n\t          var dataPropDescriptor = Object.getOwnPropertyDescriptor(e, 'data')\n\t          if (!dataPropDescriptor || dataPropDescriptor.writable)\n\t            e.data = data\n\t        } catch (e) {} // when using strict mode dataPropDescriptor will be undefined when e is InputEvent (even though data property exists). So we surround with try/catch\n\t        var result = callback.apply(element, e._args == undefined ? [e] : [e].concat(e._args))\n\t        if (result === false) e.preventDefault(), e.stopPropagation()\n\t        return result\n\t      }\n\t      handler.i = set.length\n\t      set.push(handler)\n\t      if ('addEventListener' in element)\n\t        element.addEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture))\n\t    })\n\t  }\n\t  function remove(element, events, fn, selector, capture){\n\t    var id = zid(element)\n\t    ;(events || '').split(/\\s/).forEach(function(event){\n\t      findHandlers(element, event, fn, selector).forEach(function(handler){\n\t        delete handlers[id][handler.i]\n\t      if ('removeEventListener' in element)\n\t        element.removeEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture))\n\t      })\n\t    })\n\t  }\n\n\t  $.event = { add: add, remove: remove }\n\n\t  $.proxy = function(fn, context) {\n\t    var args = (2 in arguments) && slice.call(arguments, 2)\n\t    if (isFunction(fn)) {\n\t      var proxyFn = function(){ return fn.apply(context, args ? args.concat(slice.call(arguments)) : arguments) }\n\t      proxyFn._zid = zid(fn)\n\t      return proxyFn\n\t    } else if (isString(context)) {\n\t      if (args) {\n\t        args.unshift(fn[context], fn)\n\t        return $.proxy.apply(null, args)\n\t      } else {\n\t        return $.proxy(fn[context], fn)\n\t      }\n\t    } else {\n\t      throw new TypeError(\"expected function\")\n\t    }\n\t  }\n\n\t  $.fn.bind = function(event, data, callback){\n\t    return this.on(event, data, callback)\n\t  }\n\t  $.fn.unbind = function(event, callback){\n\t    return this.off(event, callback)\n\t  }\n\t  $.fn.one = function(event, selector, data, callback){\n\t    return this.on(event, selector, data, callback, 1)\n\t  }\n\n\t  var returnTrue = function(){return true},\n\t      returnFalse = function(){return false},\n\t      ignoreProperties = /^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,\n\t      eventMethods = {\n\t        preventDefault: 'isDefaultPrevented',\n\t        stopImmediatePropagation: 'isImmediatePropagationStopped',\n\t        stopPropagation: 'isPropagationStopped'\n\t      }\n\n\t  function compatible(event, source) {\n\t    if (source || !event.isDefaultPrevented) {\n\t      source || (source = event)\n\n\t      $.each(eventMethods, function(name, predicate) {\n\t        var sourceMethod = source[name]\n\t        event[name] = function(){\n\t          this[predicate] = returnTrue\n\t          return sourceMethod && sourceMethod.apply(source, arguments)\n\t        }\n\t        event[predicate] = returnFalse\n\t      })\n\n\t      try {\n\t        event.timeStamp || (event.timeStamp = Date.now())\n\t      } catch (ignored) { }\n\n\t      if (source.defaultPrevented !== undefined ? source.defaultPrevented :\n\t          'returnValue' in source ? source.returnValue === false :\n\t          source.getPreventDefault && source.getPreventDefault())\n\t        event.isDefaultPrevented = returnTrue\n\t    }\n\t    return event\n\t  }\n\n\t  function createProxy(event) {\n\t    var key, proxy = { originalEvent: event }\n\t    for (key in event)\n\t      if (!ignoreProperties.test(key) && event[key] !== undefined) proxy[key] = event[key]\n\n\t    return compatible(proxy, event)\n\t  }\n\n\t  $.fn.delegate = function(selector, event, callback){\n\t    return this.on(event, selector, callback)\n\t  }\n\t  $.fn.undelegate = function(selector, event, callback){\n\t    return this.off(event, selector, callback)\n\t  }\n\n\t  $.fn.live = function(event, callback){\n\t    $(document.body).delegate(this.selector, event, callback)\n\t    return this\n\t  }\n\t  $.fn.die = function(event, callback){\n\t    $(document.body).undelegate(this.selector, event, callback)\n\t    return this\n\t  }\n\n\t  $.fn.on = function(event, selector, data, callback, one){\n\t    var autoRemove, delegator, $this = this\n\t    if (event && !isString(event)) {\n\t      $.each(event, function(type, fn){\n\t        $this.on(type, selector, data, fn, one)\n\t      })\n\t      return $this\n\t    }\n\n\t    if (!isString(selector) && !isFunction(callback) && callback !== false)\n\t      callback = data, data = selector, selector = undefined\n\t    if (callback === undefined || data === false)\n\t      callback = data, data = undefined\n\n\t    if (callback === false) callback = returnFalse\n\n\t    return $this.each(function(_, element){\n\t      if (one) autoRemove = function(e){\n\t        remove(element, e.type, callback)\n\t        return callback.apply(this, arguments)\n\t      }\n\n\t      if (selector) delegator = function(e){\n\t        var evt, match = $(e.target).closest(selector, element).get(0)\n\t        if (match && match !== element) {\n\t          evt = $.extend(createProxy(e), {currentTarget: match, liveFired: element})\n\t          return (autoRemove || callback).apply(match, [evt].concat(slice.call(arguments, 1)))\n\t        }\n\t      }\n\n\t      add(element, event, callback, data, selector, delegator || autoRemove)\n\t    })\n\t  }\n\t  $.fn.off = function(event, selector, callback){\n\t    var $this = this\n\t    if (event && !isString(event)) {\n\t      $.each(event, function(type, fn){\n\t        $this.off(type, selector, fn)\n\t      })\n\t      return $this\n\t    }\n\n\t    if (!isString(selector) && !isFunction(callback) && callback !== false)\n\t      callback = selector, selector = undefined\n\n\t    if (callback === false) callback = returnFalse\n\n\t    return $this.each(function(){\n\t      remove(this, event, callback, selector)\n\t    })\n\t  }\n\n\t  $.fn.trigger = function(event, args){\n\t    event = (isString(event) || $.isPlainObject(event)) ? $.Event(event) : compatible(event)\n\t    event._args = args\n\t    return this.each(function(){\n\t      // handle focus(), blur() by calling them directly\n\t      if (event.type in focus && typeof this[event.type] == \"function\") this[event.type]()\n\t      // items in the collection might not be DOM elements\n\t      else if ('dispatchEvent' in this) this.dispatchEvent(event)\n\t      else $(this).triggerHandler(event, args)\n\t    })\n\t  }\n\n\t  // triggers event handlers on current element just as if an event occurred,\n\t  // doesn't trigger an actual event, doesn't bubble\n\t  $.fn.triggerHandler = function(event, args){\n\t    var e, result\n\t    this.each(function(i, element){\n\t      e = createProxy(isString(event) ? $.Event(event) : event)\n\t      e._args = args\n\t      e.target = element\n\t      $.each(findHandlers(element, event.type || event), function(i, handler){\n\t        result = handler.proxy(e)\n\t        if (e.isImmediatePropagationStopped()) return false\n\t      })\n\t    })\n\t    return result\n\t  }\n\n\t  // shortcut methods for `.bind(event, fn)` for each event type\n\t  ;('focusin focusout focus blur load resize scroll unload click dblclick '+\n\t  'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave '+\n\t  'change select keydown keypress keyup error').split(' ').forEach(function(event) {\n\t    $.fn[event] = function(callback) {\n\t      return (0 in arguments) ?\n\t        this.bind(event, callback) :\n\t        this.trigger(event)\n\t    }\n\t  })\n\n\t  $.Event = function(type, props) {\n\t    if (!isString(type)) props = type, type = props.type\n\t    var event = document.createEvent(specialEvents[type] || 'Events'), bubbles = true\n\t    if (props) for (var name in props) (name == 'bubbles') ? (bubbles = !!props[name]) : (event[name] = props[name])\n\t    event.initEvent(type, bubbles, true)\n\t    return compatible(event)\n\t  }\n\n\t})(Zepto)\n\n\t;(function($){\n\t  var cache = [], timeout\n\n\t  $.fn.remove = function(){\n\t    return this.each(function(){\n\t      if(this.parentNode){\n\t        if(this.tagName === 'IMG'){\n\t          cache.push(this)\n\t          this.src = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='\n\t          if (timeout) clearTimeout(timeout)\n\t          timeout = setTimeout(function(){ cache = [] }, 60000)\n\t        }\n\t        this.parentNode.removeChild(this)\n\t      }\n\t    })\n\t  }\n\t})(Zepto)\n\n\t;(function($){\n\t  var data = {}, dataAttr = $.fn.data, camelize = $.camelCase,\n\t    exp = $.expando = 'Zepto' + (+new Date()), emptyArray = []\n\n\t  // Get value from node:\n\t  // 1. first try key as given,\n\t  // 2. then try camelized key,\n\t  // 3. fall back to reading \"data-*\" attribute.\n\t  function getData(node, name) {\n\t    var id = node[exp], store = id && data[id]\n\t    if (name === undefined) return store || setData(node)\n\t    else {\n\t      if (store) {\n\t        if (name in store) return store[name]\n\t        var camelName = camelize(name)\n\t        if (camelName in store) return store[camelName]\n\t      }\n\t      return dataAttr.call($(node), name)\n\t    }\n\t  }\n\n\t  // Store value under camelized key on node\n\t  function setData(node, name, value) {\n\t    var id = node[exp] || (node[exp] = ++$.uuid),\n\t      store = data[id] || (data[id] = attributeData(node))\n\t    if (name !== undefined) store[camelize(name)] = value\n\t    return store\n\t  }\n\n\t  // Read all \"data-*\" attributes from a node\n\t  function attributeData(node) {\n\t    var store = {}\n\t    $.each(node.attributes || emptyArray, function(i, attr){\n\t      if (attr.name.indexOf('data-') == 0)\n\t        store[camelize(attr.name.replace('data-', ''))] =\n\t          $.zepto.deserializeValue(attr.value)\n\t    })\n\t    return store\n\t  }\n\n\t  $.fn.data = function(name, value) {\n\t    return value === undefined ?\n\t      // set multiple values via object\n\t      $.isPlainObject(name) ?\n\t        this.each(function(i, node){\n\t          $.each(name, function(key, value){ setData(node, key, value) })\n\t        }) :\n\t        // get value from first element\n\t        (0 in this ? getData(this[0], name) : undefined) :\n\t      // set value on all elements\n\t      this.each(function(){ setData(this, name, value) })\n\t  }\n\n\t  $.data = function(elem, name, value) {\n\t    return $(elem).data(name, value)\n\t  }\n\n\t  $.hasData = function(elem) {\n\t    var id = elem[exp], store = id && data[id]\n\t    return store ? !$.isEmptyObject(store) : false\n\t  }\n\n\t  $.fn.removeData = function(names) {\n\t    if (typeof names == 'string') names = names.split(/\\s+/)\n\t    return this.each(function(){\n\t      var id = this[exp], store = id && data[id]\n\t      if (store) $.each(names || store, function(key){\n\t        delete store[names ? camelize(this) : key]\n\t      })\n\t    })\n\t  }\n\n\t  // Generate extended `remove` and `empty` functions\n\t  ;['remove', 'empty'].forEach(function(methodName){\n\t    var origFn = $.fn[methodName]\n\t    $.fn[methodName] = function() {\n\t      var elements = this.find('*')\n\t      if (methodName === 'remove') elements = elements.add(this)\n\t      elements.removeData()\n\t      return origFn.call(this)\n\t    }\n\t  })\n\t})(Zepto)\n\t  return Zepto\n\t}))\n\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\n\tmodule.exports = {\n\t  element: null\n\t};\n\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar DOM = __webpack_require__(3);\n\n\tfunction escapeRegExp(str) {\n\t  return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n\t}\n\n\tmodule.exports = {\n\t  // those methods are implemented differently\n\t  // depending on which build it is, using\n\t  // $... or angular... or Zepto... or require(...)\n\t  isArray: null,\n\t  isFunction: null,\n\t  isObject: null,\n\t  bind: null,\n\t  each: null,\n\t  map: null,\n\t  mixin: null,\n\n\t  isMsie: function(agentString) {\n\t    if (agentString === undefined) { agentString = navigator.userAgent; }\n\t    // from https://github.com/ded/bowser/blob/master/bowser.js\n\t    if ((/(msie|trident)/i).test(agentString)) {\n\t      var match = agentString.match(/(msie |rv:)(\\d+(.\\d+)?)/i);\n\t      if (match) { return match[2]; }\n\t    }\n\t    return false;\n\t  },\n\n\t  // http://stackoverflow.com/a/6969486\n\t  escapeRegExChars: function(str) {\n\t    return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n\t  },\n\n\t  isNumber: function(obj) { return typeof obj === 'number'; },\n\n\t  toStr: function toStr(s) {\n\t    return s === undefined || s === null ? '' : s + '';\n\t  },\n\n\t  cloneDeep: function cloneDeep(obj) {\n\t    var clone = this.mixin({}, obj);\n\t    var self = this;\n\t    this.each(clone, function(value, key) {\n\t      if (value) {\n\t        if (self.isArray(value)) {\n\t          clone[key] = [].concat(value);\n\t        } else if (self.isObject(value)) {\n\t          clone[key] = self.cloneDeep(value);\n\t        }\n\t      }\n\t    });\n\t    return clone;\n\t  },\n\n\t  error: function(msg) {\n\t    throw new Error(msg);\n\t  },\n\n\t  every: function(obj, test) {\n\t    var result = true;\n\t    if (!obj) {\n\t      return result;\n\t    }\n\t    this.each(obj, function(val, key) {\n\t      if (result) {\n\t        result = test.call(null, val, key, obj) && result;\n\t      }\n\t    });\n\t    return !!result;\n\t  },\n\n\t  any: function(obj, test) {\n\t    var found = false;\n\t    if (!obj) {\n\t      return found;\n\t    }\n\t    this.each(obj, function(val, key) {\n\t      if (test.call(null, val, key, obj)) {\n\t        found = true;\n\t        return false;\n\t      }\n\t    });\n\t    return found;\n\t  },\n\n\t  getUniqueId: (function() {\n\t    var counter = 0;\n\t    return function() { return counter++; };\n\t  })(),\n\n\t  templatify: function templatify(obj) {\n\t    if (this.isFunction(obj)) {\n\t      return obj;\n\t    }\n\t    var $template = DOM.element(obj);\n\t    if ($template.prop('tagName') === 'SCRIPT') {\n\t      return function template() { return $template.text(); };\n\t    }\n\t    return function template() { return String(obj); };\n\t  },\n\n\t  defer: function(fn) { setTimeout(fn, 0); },\n\n\t  noop: function() {},\n\n\t  formatPrefix: function(prefix, noPrefix) {\n\t    return noPrefix ? '' : prefix + '-';\n\t  },\n\n\t  className: function(prefix, clazz, skipDot) {\n\t    return (skipDot ? '' : '.') + prefix + clazz;\n\t  },\n\n\t  escapeHighlightedString: function(str, highlightPreTag, highlightPostTag) {\n\t    highlightPreTag = highlightPreTag || '<em>';\n\t    var pre = document.createElement('div');\n\t    pre.appendChild(document.createTextNode(highlightPreTag));\n\n\t    highlightPostTag = highlightPostTag || '</em>';\n\t    var post = document.createElement('div');\n\t    post.appendChild(document.createTextNode(highlightPostTag));\n\n\t    var div = document.createElement('div');\n\t    div.appendChild(document.createTextNode(str));\n\t    return div.innerHTML\n\t      .replace(RegExp(escapeRegExp(pre.innerHTML), 'g'), highlightPreTag)\n\t      .replace(RegExp(escapeRegExp(post.innerHTML), 'g'), highlightPostTag);\n\t  }\n\t};\n\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar attrsKey = 'aaAttrs';\n\n\tvar _ = __webpack_require__(4);\n\tvar DOM = __webpack_require__(3);\n\tvar EventBus = __webpack_require__(6);\n\tvar Input = __webpack_require__(7);\n\tvar Dropdown = __webpack_require__(16);\n\tvar html = __webpack_require__(18);\n\tvar css = __webpack_require__(19);\n\n\t// constructor\n\t// -----------\n\n\t// THOUGHT: what if datasets could dynamically be added/removed?\n\tfunction Typeahead(o) {\n\t  var $menu;\n\t  var $hint;\n\n\t  o = o || {};\n\n\t  if (!o.input) {\n\t    _.error('missing input');\n\t  }\n\n\t  this.isActivated = false;\n\t  this.debug = !!o.debug;\n\t  this.autoselect = !!o.autoselect;\n\t  this.autoselectOnBlur = !!o.autoselectOnBlur;\n\t  this.openOnFocus = !!o.openOnFocus;\n\t  this.minLength = _.isNumber(o.minLength) ? o.minLength : 1;\n\t  this.autoWidth = (o.autoWidth === undefined) ? true : !!o.autoWidth;\n\t  this.clearOnSelected = !!o.clearOnSelected;\n\t  this.tabAutocomplete = (o.tabAutocomplete === undefined) ? true : !!o.tabAutocomplete;\n\n\t  o.hint = !!o.hint;\n\n\t  if (o.hint && o.appendTo) {\n\t    throw new Error('[autocomplete.js] hint and appendTo options can\\'t be used at the same time');\n\t  }\n\n\t  this.css = o.css = _.mixin({}, css, o.appendTo ? css.appendTo : {});\n\t  this.cssClasses = o.cssClasses = _.mixin({}, css.defaultClasses, o.cssClasses || {});\n\t  this.cssClasses.prefix =\n\t    o.cssClasses.formattedPrefix = _.formatPrefix(this.cssClasses.prefix, this.cssClasses.noPrefix);\n\t  this.listboxId = o.listboxId = [this.cssClasses.root, 'listbox', _.getUniqueId()].join('-');\n\n\t  var domElts = buildDom(o);\n\n\t  this.$node = domElts.wrapper;\n\t  var $input = this.$input = domElts.input;\n\t  $menu = domElts.menu;\n\t  $hint = domElts.hint;\n\n\t  if (o.dropdownMenuContainer) {\n\t    DOM.element(o.dropdownMenuContainer)\n\t      .css('position', 'relative') // ensure the container has a relative position\n\t      .append($menu.css('top', '0')); // override the top: 100%\n\t  }\n\n\t  // #705: if there's scrollable overflow, ie doesn't support\n\t  // blur cancellations when the scrollbar is clicked\n\t  //\n\t  // #351: preventDefault won't cancel blurs in ie <= 8\n\t  $input.on('blur.aa', function($e) {\n\t    var active = document.activeElement;\n\t    if (_.isMsie() && ($menu[0] === active || $menu[0].contains(active))) {\n\t      $e.preventDefault();\n\t      // stop immediate in order to prevent Input#_onBlur from\n\t      // getting exectued\n\t      $e.stopImmediatePropagation();\n\t      _.defer(function() { $input.focus(); });\n\t    }\n\t  });\n\n\t  // #351: prevents input blur due to clicks within dropdown menu\n\t  $menu.on('mousedown.aa', function($e) { $e.preventDefault(); });\n\n\t  this.eventBus = o.eventBus || new EventBus({el: $input});\n\n\t  this.dropdown = new Typeahead.Dropdown({\n\t    appendTo: o.appendTo,\n\t    wrapper: this.$node,\n\t    menu: $menu,\n\t    datasets: o.datasets,\n\t    templates: o.templates,\n\t    cssClasses: o.cssClasses,\n\t    minLength: this.minLength\n\t  })\n\t    .onSync('suggestionClicked', this._onSuggestionClicked, this)\n\t    .onSync('cursorMoved', this._onCursorMoved, this)\n\t    .onSync('cursorRemoved', this._onCursorRemoved, this)\n\t    .onSync('opened', this._onOpened, this)\n\t    .onSync('closed', this._onClosed, this)\n\t    .onSync('shown', this._onShown, this)\n\t    .onSync('empty', this._onEmpty, this)\n\t    .onSync('redrawn', this._onRedrawn, this)\n\t    .onAsync('datasetRendered', this._onDatasetRendered, this);\n\n\t  this.input = new Typeahead.Input({input: $input, hint: $hint})\n\t    .onSync('focused', this._onFocused, this)\n\t    .onSync('blurred', this._onBlurred, this)\n\t    .onSync('enterKeyed', this._onEnterKeyed, this)\n\t    .onSync('tabKeyed', this._onTabKeyed, this)\n\t    .onSync('escKeyed', this._onEscKeyed, this)\n\t    .onSync('upKeyed', this._onUpKeyed, this)\n\t    .onSync('downKeyed', this._onDownKeyed, this)\n\t    .onSync('leftKeyed', this._onLeftKeyed, this)\n\t    .onSync('rightKeyed', this._onRightKeyed, this)\n\t    .onSync('queryChanged', this._onQueryChanged, this)\n\t    .onSync('whitespaceChanged', this._onWhitespaceChanged, this);\n\n\t  this._bindKeyboardShortcuts(o);\n\n\t  this._setLanguageDirection();\n\t}\n\n\t// instance methods\n\t// ----------------\n\n\t_.mixin(Typeahead.prototype, {\n\t  // ### private\n\n\t  _bindKeyboardShortcuts: function(options) {\n\t    if (!options.keyboardShortcuts) {\n\t      return;\n\t    }\n\t    var $input = this.$input;\n\t    var keyboardShortcuts = [];\n\t    _.each(options.keyboardShortcuts, function(key) {\n\t      if (typeof key === 'string') {\n\t        key = key.toUpperCase().charCodeAt(0);\n\t      }\n\t      keyboardShortcuts.push(key);\n\t    });\n\t    DOM.element(document).keydown(function(event) {\n\t      var elt = (event.target || event.srcElement);\n\t      var tagName = elt.tagName;\n\t      if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {\n\t        // already in an input\n\t        return;\n\t      }\n\n\t      var which = event.which || event.keyCode;\n\t      if (keyboardShortcuts.indexOf(which) === -1) {\n\t        // not the right shortcut\n\t        return;\n\t      }\n\n\t      $input.focus();\n\t      event.stopPropagation();\n\t      event.preventDefault();\n\t    });\n\t  },\n\n\t  _onSuggestionClicked: function onSuggestionClicked(type, $el) {\n\t    var datum;\n\t    var context = {selectionMethod: 'click'};\n\n\t    if (datum = this.dropdown.getDatumForSuggestion($el)) {\n\t      this._select(datum, context);\n\t    }\n\t  },\n\n\t  _onCursorMoved: function onCursorMoved(event, updateInput) {\n\t    var datum = this.dropdown.getDatumForCursor();\n\t    var currentCursorId = this.dropdown.getCurrentCursor().attr('id');\n\t    this.input.setActiveDescendant(currentCursorId);\n\n\t    if (datum) {\n\t      if (updateInput) {\n\t        this.input.setInputValue(datum.value, true);\n\t      }\n\n\t      this.eventBus.trigger('cursorchanged', datum.raw, datum.datasetName);\n\t    }\n\t  },\n\n\t  _onCursorRemoved: function onCursorRemoved() {\n\t    this.input.resetInputValue();\n\t    this._updateHint();\n\t    this.eventBus.trigger('cursorremoved');\n\t  },\n\n\t  _onDatasetRendered: function onDatasetRendered() {\n\t    this._updateHint();\n\n\t    this.eventBus.trigger('updated');\n\t  },\n\n\t  _onOpened: function onOpened() {\n\t    this._updateHint();\n\t    this.input.expand();\n\n\t    this.eventBus.trigger('opened');\n\t  },\n\n\t  _onEmpty: function onEmpty() {\n\t    this.eventBus.trigger('empty');\n\t  },\n\n\t  _onRedrawn: function onRedrawn() {\n\t    this.$node.css('top', 0 + 'px');\n\t    this.$node.css('left', 0 + 'px');\n\n\t    var inputRect = this.$input[0].getBoundingClientRect();\n\n\t    if (this.autoWidth) {\n\t      this.$node.css('width', inputRect.width + 'px');\n\t    }\n\n\t    var wrapperRect = this.$node[0].getBoundingClientRect();\n\n\t    var top = inputRect.bottom - wrapperRect.top;\n\t    this.$node.css('top', top + 'px');\n\t    var left = inputRect.left - wrapperRect.left;\n\t    this.$node.css('left', left + 'px');\n\n\t    this.eventBus.trigger('redrawn');\n\t  },\n\n\t  _onShown: function onShown() {\n\t    this.eventBus.trigger('shown');\n\t    if (this.autoselect) {\n\t      this.dropdown.cursorTopSuggestion();\n\t    }\n\t  },\n\n\t  _onClosed: function onClosed() {\n\t    this.input.clearHint();\n\t    this.input.removeActiveDescendant();\n\t    this.input.collapse();\n\n\t    this.eventBus.trigger('closed');\n\t  },\n\n\t  _onFocused: function onFocused() {\n\t    this.isActivated = true;\n\n\t    if (this.openOnFocus) {\n\t      var query = this.input.getQuery();\n\t      if (query.length >= this.minLength) {\n\t        this.dropdown.update(query);\n\t      } else {\n\t        this.dropdown.empty();\n\t      }\n\n\t      this.dropdown.open();\n\t    }\n\t  },\n\n\t  _onBlurred: function onBlurred() {\n\t    var cursorDatum;\n\t    var topSuggestionDatum;\n\n\t    cursorDatum = this.dropdown.getDatumForCursor();\n\t    topSuggestionDatum = this.dropdown.getDatumForTopSuggestion();\n\t    var context = {selectionMethod: 'blur'};\n\n\t    if (!this.debug) {\n\t      if (this.autoselectOnBlur && cursorDatum) {\n\t        this._select(cursorDatum, context);\n\t      } else if (this.autoselectOnBlur && topSuggestionDatum) {\n\t        this._select(topSuggestionDatum, context);\n\t      } else {\n\t        this.isActivated = false;\n\t        this.dropdown.empty();\n\t        this.dropdown.close();\n\t      }\n\t    }\n\t  },\n\n\t  _onEnterKeyed: function onEnterKeyed(type, $e) {\n\t    var cursorDatum;\n\t    var topSuggestionDatum;\n\n\t    cursorDatum = this.dropdown.getDatumForCursor();\n\t    topSuggestionDatum = this.dropdown.getDatumForTopSuggestion();\n\t    var context = {selectionMethod: 'enterKey'};\n\n\t    if (cursorDatum) {\n\t      this._select(cursorDatum, context);\n\t      $e.preventDefault();\n\t    } else if (this.autoselect && topSuggestionDatum) {\n\t      this._select(topSuggestionDatum, context);\n\t      $e.preventDefault();\n\t    }\n\t  },\n\n\t  _onTabKeyed: function onTabKeyed(type, $e) {\n\t    if (!this.tabAutocomplete) {\n\t      // Closing the dropdown enables further tabbing\n\t      this.dropdown.close();\n\t      return;\n\t    }\n\n\t    var datum;\n\t    var context = {selectionMethod: 'tabKey'};\n\n\t    if (datum = this.dropdown.getDatumForCursor()) {\n\t      this._select(datum, context);\n\t      $e.preventDefault();\n\t    } else {\n\t      this._autocomplete(true);\n\t    }\n\t  },\n\n\t  _onEscKeyed: function onEscKeyed() {\n\t    this.dropdown.close();\n\t    this.input.resetInputValue();\n\t  },\n\n\t  _onUpKeyed: function onUpKeyed() {\n\t    var query = this.input.getQuery();\n\n\t    if (this.dropdown.isEmpty && query.length >= this.minLength) {\n\t      this.dropdown.update(query);\n\t    } else {\n\t      this.dropdown.moveCursorUp();\n\t    }\n\n\t    this.dropdown.open();\n\t  },\n\n\t  _onDownKeyed: function onDownKeyed() {\n\t    var query = this.input.getQuery();\n\n\t    if (this.dropdown.isEmpty && query.length >= this.minLength) {\n\t      this.dropdown.update(query);\n\t    } else {\n\t      this.dropdown.moveCursorDown();\n\t    }\n\n\t    this.dropdown.open();\n\t  },\n\n\t  _onLeftKeyed: function onLeftKeyed() {\n\t    if (this.dir === 'rtl') {\n\t      this._autocomplete();\n\t    }\n\t  },\n\n\t  _onRightKeyed: function onRightKeyed() {\n\t    if (this.dir === 'ltr') {\n\t      this._autocomplete();\n\t    }\n\t  },\n\n\t  _onQueryChanged: function onQueryChanged(e, query) {\n\t    this.input.clearHintIfInvalid();\n\n\t    if (query.length >= this.minLength) {\n\t      this.dropdown.update(query);\n\t    } else {\n\t      this.dropdown.empty();\n\t    }\n\n\t    this.dropdown.open();\n\t    this._setLanguageDirection();\n\t  },\n\n\t  _onWhitespaceChanged: function onWhitespaceChanged() {\n\t    this._updateHint();\n\t    this.dropdown.open();\n\t  },\n\n\t  _setLanguageDirection: function setLanguageDirection() {\n\t    var dir = this.input.getLanguageDirection();\n\n\t    if (this.dir !== dir) {\n\t      this.dir = dir;\n\t      this.$node.css('direction', dir);\n\t      this.dropdown.setLanguageDirection(dir);\n\t    }\n\t  },\n\n\t  _updateHint: function updateHint() {\n\t    var datum;\n\t    var val;\n\t    var query;\n\t    var escapedQuery;\n\t    var frontMatchRegEx;\n\t    var match;\n\n\t    datum = this.dropdown.getDatumForTopSuggestion();\n\n\t    if (datum && this.dropdown.isVisible() && !this.input.hasOverflow()) {\n\t      val = this.input.getInputValue();\n\t      query = Input.normalizeQuery(val);\n\t      escapedQuery = _.escapeRegExChars(query);\n\n\t      // match input value, then capture trailing text\n\t      frontMatchRegEx = new RegExp('^(?:' + escapedQuery + ')(.+$)', 'i');\n\t      match = frontMatchRegEx.exec(datum.value);\n\n\t      // clear hint if there's no trailing text\n\t      if (match) {\n\t        this.input.setHint(val + match[1]);\n\t      } else {\n\t        this.input.clearHint();\n\t      }\n\t    } else {\n\t      this.input.clearHint();\n\t    }\n\t  },\n\n\t  _autocomplete: function autocomplete(laxCursor) {\n\t    var hint;\n\t    var query;\n\t    var isCursorAtEnd;\n\t    var datum;\n\n\t    hint = this.input.getHint();\n\t    query = this.input.getQuery();\n\t    isCursorAtEnd = laxCursor || this.input.isCursorAtEnd();\n\n\t    if (hint && query !== hint && isCursorAtEnd) {\n\t      datum = this.dropdown.getDatumForTopSuggestion();\n\t      if (datum) {\n\t        this.input.setInputValue(datum.value);\n\t      }\n\n\t      this.eventBus.trigger('autocompleted', datum.raw, datum.datasetName);\n\t    }\n\t  },\n\n\t  _select: function select(datum, context) {\n\t    if (typeof datum.value !== 'undefined') {\n\t      this.input.setQuery(datum.value);\n\t    }\n\t    if (this.clearOnSelected) {\n\t      this.setVal('');\n\t    } else {\n\t      this.input.setInputValue(datum.value, true);\n\t    }\n\n\t    this._setLanguageDirection();\n\n\t    var event = this.eventBus.trigger('selected', datum.raw, datum.datasetName, context);\n\t    if (event.isDefaultPrevented() === false) {\n\t      this.dropdown.close();\n\n\t      // #118: allow click event to bubble up to the body before removing\n\t      // the suggestions otherwise we break event delegation\n\t      _.defer(_.bind(this.dropdown.empty, this.dropdown));\n\t    }\n\t  },\n\n\t  // ### public\n\n\t  open: function open() {\n\t    // if the menu is not activated yet, we need to update\n\t    // the underlying dropdown menu to trigger the search\n\t    // otherwise we're not gonna see anything\n\t    if (!this.isActivated) {\n\t      var query = this.input.getInputValue();\n\t      if (query.length >= this.minLength) {\n\t        this.dropdown.update(query);\n\t      } else {\n\t        this.dropdown.empty();\n\t      }\n\t    }\n\t    this.dropdown.open();\n\t  },\n\n\t  close: function close() {\n\t    this.dropdown.close();\n\t  },\n\n\t  setVal: function setVal(val) {\n\t    // expect val to be a string, so be safe, and coerce\n\t    val = _.toStr(val);\n\n\t    if (this.isActivated) {\n\t      this.input.setInputValue(val);\n\t    } else {\n\t      this.input.setQuery(val);\n\t      this.input.setInputValue(val, true);\n\t    }\n\n\t    this._setLanguageDirection();\n\t  },\n\n\t  getVal: function getVal() {\n\t    return this.input.getQuery();\n\t  },\n\n\t  destroy: function destroy() {\n\t    this.input.destroy();\n\t    this.dropdown.destroy();\n\n\t    destroyDomStructure(this.$node, this.cssClasses);\n\n\t    this.$node = null;\n\t  },\n\n\t  getWrapper: function getWrapper() {\n\t    return this.dropdown.$container[0];\n\t  }\n\t});\n\n\tfunction buildDom(options) {\n\t  var $input;\n\t  var $wrapper;\n\t  var $dropdown;\n\t  var $hint;\n\n\t  $input = DOM.element(options.input);\n\t  $wrapper = DOM\n\t    .element(html.wrapper.replace('%ROOT%', options.cssClasses.root))\n\t    .css(options.css.wrapper);\n\n\t  // override the display property with the table-cell value\n\t  // if the parent element is a table and the original input was a block\n\t  //  -> https://github.com/algolia/autocomplete.js/issues/16\n\t  if (!options.appendTo && $input.css('display') === 'block' && $input.parent().css('display') === 'table') {\n\t    $wrapper.css('display', 'table-cell');\n\t  }\n\t  var dropdownHtml = html.dropdown.\n\t    replace('%PREFIX%', options.cssClasses.prefix).\n\t    replace('%DROPDOWN_MENU%', options.cssClasses.dropdownMenu);\n\t  $dropdown = DOM.element(dropdownHtml)\n\t    .css(options.css.dropdown)\n\t    .attr({\n\t      role: 'listbox',\n\t      id: options.listboxId\n\t    });\n\t  if (options.templates && options.templates.dropdownMenu) {\n\t    $dropdown.html(_.templatify(options.templates.dropdownMenu)());\n\t  }\n\t  $hint = $input.clone().css(options.css.hint).css(getBackgroundStyles($input));\n\n\t  $hint\n\t    .val('')\n\t    .addClass(_.className(options.cssClasses.prefix, options.cssClasses.hint, true))\n\t    .removeAttr('id name placeholder required')\n\t    .prop('readonly', true)\n\t    .attr({\n\t      'aria-hidden': 'true',\n\t      autocomplete: 'off',\n\t      spellcheck: 'false',\n\t      tabindex: -1\n\t    });\n\t  if ($hint.removeData) {\n\t    $hint.removeData();\n\t  }\n\n\t  // store the original values of the attrs that get modified\n\t  // so modifications can be reverted on destroy\n\t  $input.data(attrsKey, {\n\t    'aria-autocomplete': $input.attr('aria-autocomplete'),\n\t    'aria-expanded': $input.attr('aria-expanded'),\n\t    'aria-owns': $input.attr('aria-owns'),\n\t    autocomplete: $input.attr('autocomplete'),\n\t    dir: $input.attr('dir'),\n\t    role: $input.attr('role'),\n\t    spellcheck: $input.attr('spellcheck'),\n\t    style: $input.attr('style'),\n\t    type: $input.attr('type')\n\t  });\n\n\t  $input\n\t    .addClass(_.className(options.cssClasses.prefix, options.cssClasses.input, true))\n\t    .attr({\n\t      autocomplete: 'off',\n\t      spellcheck: false,\n\n\t      // Accessibility features\n\t      // Give the field a presentation of a \"select\".\n\t      // Combobox is the combined presentation of a single line textfield\n\t      // with a listbox popup.\n\t      // https://www.w3.org/WAI/PF/aria/roles#combobox\n\t      role: 'combobox',\n\t      // Let the screen reader know the field has an autocomplete\n\t      // feature to it.\n\t      'aria-autocomplete': (options.datasets &&\n\t        options.datasets[0] && options.datasets[0].displayKey ? 'both' : 'list'),\n\t      // Indicates whether the dropdown it controls is currently expanded or collapsed\n\t      'aria-expanded': 'false',\n\t      'aria-label': options.ariaLabel,\n\t      // Explicitly point to the listbox,\n\t      // which is a list of suggestions (aka options)\n\t      'aria-owns': options.listboxId\n\t    })\n\t    .css(options.hint ? options.css.input : options.css.inputWithNoHint);\n\n\t  // ie7 does not like it when dir is set to auto\n\t  try {\n\t    if (!$input.attr('dir')) {\n\t      $input.attr('dir', 'auto');\n\t    }\n\t  } catch (e) {\n\t    // ignore\n\t  }\n\n\t  $wrapper = options.appendTo\n\t    ? $wrapper.appendTo(DOM.element(options.appendTo).eq(0)).eq(0)\n\t    : $input.wrap($wrapper).parent();\n\n\t  $wrapper\n\t    .prepend(options.hint ? $hint : null)\n\t    .append($dropdown);\n\n\t  return {\n\t    wrapper: $wrapper,\n\t    input: $input,\n\t    hint: $hint,\n\t    menu: $dropdown\n\t  };\n\t}\n\n\tfunction getBackgroundStyles($el) {\n\t  return {\n\t    backgroundAttachment: $el.css('background-attachment'),\n\t    backgroundClip: $el.css('background-clip'),\n\t    backgroundColor: $el.css('background-color'),\n\t    backgroundImage: $el.css('background-image'),\n\t    backgroundOrigin: $el.css('background-origin'),\n\t    backgroundPosition: $el.css('background-position'),\n\t    backgroundRepeat: $el.css('background-repeat'),\n\t    backgroundSize: $el.css('background-size')\n\t  };\n\t}\n\n\tfunction destroyDomStructure($node, cssClasses) {\n\t  var $input = $node.find(_.className(cssClasses.prefix, cssClasses.input));\n\n\t  // need to remove attrs that weren't previously defined and\n\t  // revert attrs that originally had a value\n\t  _.each($input.data(attrsKey), function(val, key) {\n\t    if (val === undefined) {\n\t      $input.removeAttr(key);\n\t    } else {\n\t      $input.attr(key, val);\n\t    }\n\t  });\n\n\t  $input\n\t    .detach()\n\t    .removeClass(_.className(cssClasses.prefix, cssClasses.input, true))\n\t    .insertAfter($node);\n\t  if ($input.removeData) {\n\t    $input.removeData(attrsKey);\n\t  }\n\n\t  $node.remove();\n\t}\n\n\tTypeahead.Dropdown = Dropdown;\n\tTypeahead.Input = Input;\n\tTypeahead.sources = __webpack_require__(20);\n\n\tmodule.exports = Typeahead;\n\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar namespace = 'autocomplete:';\n\n\tvar _ = __webpack_require__(4);\n\tvar DOM = __webpack_require__(3);\n\n\t// constructor\n\t// -----------\n\n\tfunction EventBus(o) {\n\t  if (!o || !o.el) {\n\t    _.error('EventBus initialized without el');\n\t  }\n\n\t  this.$el = DOM.element(o.el);\n\t}\n\n\t// instance methods\n\t// ----------------\n\n\t_.mixin(EventBus.prototype, {\n\n\t  // ### public\n\n\t  trigger: function(type, suggestion, dataset, context) {\n\t    var event = _.Event(namespace + type);\n\t    this.$el.trigger(event, [suggestion, dataset, context]);\n\t    return event;\n\t  }\n\t});\n\n\tmodule.exports = EventBus;\n\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar specialKeyCodeMap;\n\n\tspecialKeyCodeMap = {\n\t  9: 'tab',\n\t  27: 'esc',\n\t  37: 'left',\n\t  39: 'right',\n\t  13: 'enter',\n\t  38: 'up',\n\t  40: 'down'\n\t};\n\n\tvar _ = __webpack_require__(4);\n\tvar DOM = __webpack_require__(3);\n\tvar EventEmitter = __webpack_require__(8);\n\n\t// constructor\n\t// -----------\n\n\tfunction Input(o) {\n\t  var that = this;\n\t  var onBlur;\n\t  var onFocus;\n\t  var onKeydown;\n\t  var onInput;\n\n\t  o = o || {};\n\n\t  if (!o.input) {\n\t    _.error('input is missing');\n\t  }\n\n\t  // bound functions\n\t  onBlur = _.bind(this._onBlur, this);\n\t  onFocus = _.bind(this._onFocus, this);\n\t  onKeydown = _.bind(this._onKeydown, this);\n\t  onInput = _.bind(this._onInput, this);\n\n\t  this.$hint = DOM.element(o.hint);\n\t  this.$input = DOM.element(o.input)\n\t    .on('blur.aa', onBlur)\n\t    .on('focus.aa', onFocus)\n\t    .on('keydown.aa', onKeydown);\n\n\t  // if no hint, noop all the hint related functions\n\t  if (this.$hint.length === 0) {\n\t    this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop;\n\t  }\n\n\t  // ie7 and ie8 don't support the input event\n\t  // ie9 doesn't fire the input event when characters are removed\n\t  // not sure if ie10 is compatible\n\t  if (!_.isMsie()) {\n\t    this.$input.on('input.aa', onInput);\n\t  } else {\n\t    this.$input.on('keydown.aa keypress.aa cut.aa paste.aa', function($e) {\n\t      // if a special key triggered this, ignore it\n\t      if (specialKeyCodeMap[$e.which || $e.keyCode]) {\n\t        return;\n\t      }\n\n\t      // give the browser a chance to update the value of the input\n\t      // before checking to see if the query changed\n\t      _.defer(_.bind(that._onInput, that, $e));\n\t    });\n\t  }\n\n\t  // the query defaults to whatever the value of the input is\n\t  // on initialization, it'll most likely be an empty string\n\t  this.query = this.$input.val();\n\n\t  // helps with calculating the width of the input's value\n\t  this.$overflowHelper = buildOverflowHelper(this.$input);\n\t}\n\n\t// static methods\n\t// --------------\n\n\tInput.normalizeQuery = function(str) {\n\t  // strips leading whitespace and condenses all whitespace\n\t  return (str || '').replace(/^\\s*/g, '').replace(/\\s{2,}/g, ' ');\n\t};\n\n\t// instance methods\n\t// ----------------\n\n\t_.mixin(Input.prototype, EventEmitter, {\n\n\t  // ### private\n\n\t  _onBlur: function onBlur() {\n\t    this.resetInputValue();\n\t    this.$input.removeAttr('aria-activedescendant');\n\t    this.trigger('blurred');\n\t  },\n\n\t  _onFocus: function onFocus() {\n\t    this.trigger('focused');\n\t  },\n\n\t  _onKeydown: function onKeydown($e) {\n\t    // which is normalized and consistent (but not for ie)\n\t    var keyName = specialKeyCodeMap[$e.which || $e.keyCode];\n\n\t    this._managePreventDefault(keyName, $e);\n\t    if (keyName && this._shouldTrigger(keyName, $e)) {\n\t      this.trigger(keyName + 'Keyed', $e);\n\t    }\n\t  },\n\n\t  _onInput: function onInput() {\n\t    this._checkInputValue();\n\t  },\n\n\t  _managePreventDefault: function managePreventDefault(keyName, $e) {\n\t    var preventDefault;\n\t    var hintValue;\n\t    var inputValue;\n\n\t    switch (keyName) {\n\t    case 'tab':\n\t      hintValue = this.getHint();\n\t      inputValue = this.getInputValue();\n\n\t      preventDefault = hintValue &&\n\t        hintValue !== inputValue &&\n\t        !withModifier($e);\n\t      break;\n\n\t    case 'up':\n\t    case 'down':\n\t      preventDefault = !withModifier($e);\n\t      break;\n\n\t    default:\n\t      preventDefault = false;\n\t    }\n\n\t    if (preventDefault) {\n\t      $e.preventDefault();\n\t    }\n\t  },\n\n\t  _shouldTrigger: function shouldTrigger(keyName, $e) {\n\t    var trigger;\n\n\t    switch (keyName) {\n\t    case 'tab':\n\t      trigger = !withModifier($e);\n\t      break;\n\n\t    default:\n\t      trigger = true;\n\t    }\n\n\t    return trigger;\n\t  },\n\n\t  _checkInputValue: function checkInputValue() {\n\t    var inputValue;\n\t    var areEquivalent;\n\t    var hasDifferentWhitespace;\n\n\t    inputValue = this.getInputValue();\n\t    areEquivalent = areQueriesEquivalent(inputValue, this.query);\n\t    hasDifferentWhitespace = areEquivalent && this.query ?\n\t      this.query.length !== inputValue.length : false;\n\n\t    this.query = inputValue;\n\n\t    if (!areEquivalent) {\n\t      this.trigger('queryChanged', this.query);\n\t    } else if (hasDifferentWhitespace) {\n\t      this.trigger('whitespaceChanged', this.query);\n\t    }\n\t  },\n\n\t  // ### public\n\n\t  focus: function focus() {\n\t    this.$input.focus();\n\t  },\n\n\t  blur: function blur() {\n\t    this.$input.blur();\n\t  },\n\n\t  getQuery: function getQuery() {\n\t    return this.query;\n\t  },\n\n\t  setQuery: function setQuery(query) {\n\t    this.query = query;\n\t  },\n\n\t  getInputValue: function getInputValue() {\n\t    return this.$input.val();\n\t  },\n\n\t  setInputValue: function setInputValue(value, silent) {\n\t    if (typeof value === 'undefined') {\n\t      value = this.query;\n\t    }\n\t    this.$input.val(value);\n\n\t    // silent prevents any additional events from being triggered\n\t    if (silent) {\n\t      this.clearHint();\n\t    } else {\n\t      this._checkInputValue();\n\t    }\n\t  },\n\n\t  expand: function expand() {\n\t    this.$input.attr('aria-expanded', 'true');\n\t  },\n\n\t  collapse: function collapse() {\n\t    this.$input.attr('aria-expanded', 'false');\n\t  },\n\n\t  setActiveDescendant: function setActiveDescendant(activedescendantId) {\n\t    this.$input.attr('aria-activedescendant', activedescendantId);\n\t  },\n\n\t  removeActiveDescendant: function removeActiveDescendant() {\n\t    this.$input.removeAttr('aria-activedescendant');\n\t  },\n\n\t  resetInputValue: function resetInputValue() {\n\t    this.setInputValue(this.query, true);\n\t  },\n\n\t  getHint: function getHint() {\n\t    return this.$hint.val();\n\t  },\n\n\t  setHint: function setHint(value) {\n\t    this.$hint.val(value);\n\t  },\n\n\t  clearHint: function clearHint() {\n\t    this.setHint('');\n\t  },\n\n\t  clearHintIfInvalid: function clearHintIfInvalid() {\n\t    var val;\n\t    var hint;\n\t    var valIsPrefixOfHint;\n\t    var isValid;\n\n\t    val = this.getInputValue();\n\t    hint = this.getHint();\n\t    valIsPrefixOfHint = val !== hint && hint.indexOf(val) === 0;\n\t    isValid = val !== '' && valIsPrefixOfHint && !this.hasOverflow();\n\n\t    if (!isValid) {\n\t      this.clearHint();\n\t    }\n\t  },\n\n\t  getLanguageDirection: function getLanguageDirection() {\n\t    return (this.$input.css('direction') || 'ltr').toLowerCase();\n\t  },\n\n\t  hasOverflow: function hasOverflow() {\n\t    // 2 is arbitrary, just picking a small number to handle edge cases\n\t    var constraint = this.$input.width() - 2;\n\n\t    this.$overflowHelper.text(this.getInputValue());\n\n\t    return this.$overflowHelper.width() >= constraint;\n\t  },\n\n\t  isCursorAtEnd: function() {\n\t    var valueLength;\n\t    var selectionStart;\n\t    var range;\n\n\t    valueLength = this.$input.val().length;\n\t    selectionStart = this.$input[0].selectionStart;\n\n\t    if (_.isNumber(selectionStart)) {\n\t      return selectionStart === valueLength;\n\t    } else if (document.selection) {\n\t      // NOTE: this won't work unless the input has focus, the good news\n\t      // is this code should only get called when the input has focus\n\t      range = document.selection.createRange();\n\t      range.moveStart('character', -valueLength);\n\n\t      return valueLength === range.text.length;\n\t    }\n\n\t    return true;\n\t  },\n\n\t  destroy: function destroy() {\n\t    this.$hint.off('.aa');\n\t    this.$input.off('.aa');\n\n\t    this.$hint = this.$input = this.$overflowHelper = null;\n\t  }\n\t});\n\n\t// helper functions\n\t// ----------------\n\n\tfunction buildOverflowHelper($input) {\n\t  return DOM.element('<pre aria-hidden=\"true\"></pre>')\n\t    .css({\n\t      // position helper off-screen\n\t      position: 'absolute',\n\t      visibility: 'hidden',\n\t      // avoid line breaks and whitespace collapsing\n\t      whiteSpace: 'pre',\n\t      // use same font css as input to calculate accurate width\n\t      fontFamily: $input.css('font-family'),\n\t      fontSize: $input.css('font-size'),\n\t      fontStyle: $input.css('font-style'),\n\t      fontVariant: $input.css('font-variant'),\n\t      fontWeight: $input.css('font-weight'),\n\t      wordSpacing: $input.css('word-spacing'),\n\t      letterSpacing: $input.css('letter-spacing'),\n\t      textIndent: $input.css('text-indent'),\n\t      textRendering: $input.css('text-rendering'),\n\t      textTransform: $input.css('text-transform')\n\t    })\n\t    .insertAfter($input);\n\t}\n\n\tfunction areQueriesEquivalent(a, b) {\n\t  return Input.normalizeQuery(a) === Input.normalizeQuery(b);\n\t}\n\n\tfunction withModifier($e) {\n\t  return $e.altKey || $e.ctrlKey || $e.metaKey || $e.shiftKey;\n\t}\n\n\tmodule.exports = Input;\n\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar immediate = __webpack_require__(9);\n\tvar splitter = /\\s+/;\n\n\tmodule.exports = {\n\t  onSync: onSync,\n\t  onAsync: onAsync,\n\t  off: off,\n\t  trigger: trigger\n\t};\n\n\tfunction on(method, types, cb, context) {\n\t  var type;\n\n\t  if (!cb) {\n\t    return this;\n\t  }\n\n\t  types = types.split(splitter);\n\t  cb = context ? bindContext(cb, context) : cb;\n\n\t  this._callbacks = this._callbacks || {};\n\n\t  while (type = types.shift()) {\n\t    this._callbacks[type] = this._callbacks[type] || {sync: [], async: []};\n\t    this._callbacks[type][method].push(cb);\n\t  }\n\n\t  return this;\n\t}\n\n\tfunction onAsync(types, cb, context) {\n\t  return on.call(this, 'async', types, cb, context);\n\t}\n\n\tfunction onSync(types, cb, context) {\n\t  return on.call(this, 'sync', types, cb, context);\n\t}\n\n\tfunction off(types) {\n\t  var type;\n\n\t  if (!this._callbacks) {\n\t    return this;\n\t  }\n\n\t  types = types.split(splitter);\n\n\t  while (type = types.shift()) {\n\t    delete this._callbacks[type];\n\t  }\n\n\t  return this;\n\t}\n\n\tfunction trigger(types) {\n\t  var type;\n\t  var callbacks;\n\t  var args;\n\t  var syncFlush;\n\t  var asyncFlush;\n\n\t  if (!this._callbacks) {\n\t    return this;\n\t  }\n\n\t  types = types.split(splitter);\n\t  args = [].slice.call(arguments, 1);\n\n\t  while ((type = types.shift()) && (callbacks = this._callbacks[type])) { // eslint-disable-line\n\t    syncFlush = getFlush(callbacks.sync, this, [type].concat(args));\n\t    asyncFlush = getFlush(callbacks.async, this, [type].concat(args));\n\n\t    if (syncFlush()) {\n\t      immediate(asyncFlush);\n\t    }\n\t  }\n\n\t  return this;\n\t}\n\n\tfunction getFlush(callbacks, context, args) {\n\t  return flush;\n\n\t  function flush() {\n\t    var cancelled;\n\n\t    for (var i = 0, len = callbacks.length; !cancelled && i < len; i += 1) {\n\t      // only cancel if the callback explicitly returns false\n\t      cancelled = callbacks[i].apply(context, args) === false;\n\t    }\n\n\t    return !cancelled;\n\t  }\n\t}\n\n\tfunction bindContext(fn, context) {\n\t  return fn.bind ?\n\t    fn.bind(context) :\n\t    function() { fn.apply(context, [].slice.call(arguments, 0)); };\n\t}\n\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\tvar types = [\n\t  __webpack_require__(10),\n\t  __webpack_require__(12),\n\t  __webpack_require__(13),\n\t  __webpack_require__(14),\n\t  __webpack_require__(15)\n\t];\n\tvar draining;\n\tvar currentQueue;\n\tvar queueIndex = -1;\n\tvar queue = [];\n\tvar scheduled = false;\n\tfunction cleanUpNextTick() {\n\t  if (!draining || !currentQueue) {\n\t    return;\n\t  }\n\t  draining = false;\n\t  if (currentQueue.length) {\n\t    queue = currentQueue.concat(queue);\n\t  } else {\n\t    queueIndex = -1;\n\t  }\n\t  if (queue.length) {\n\t    nextTick();\n\t  }\n\t}\n\n\t//named nextTick for less confusing stack traces\n\tfunction nextTick() {\n\t  if (draining) {\n\t    return;\n\t  }\n\t  scheduled = false;\n\t  draining = true;\n\t  var len = queue.length;\n\t  var timeout = setTimeout(cleanUpNextTick);\n\t  while (len) {\n\t    currentQueue = queue;\n\t    queue = [];\n\t    while (currentQueue && ++queueIndex < len) {\n\t      currentQueue[queueIndex].run();\n\t    }\n\t    queueIndex = -1;\n\t    len = queue.length;\n\t  }\n\t  currentQueue = null;\n\t  queueIndex = -1;\n\t  draining = false;\n\t  clearTimeout(timeout);\n\t}\n\tvar scheduleDrain;\n\tvar i = -1;\n\tvar len = types.length;\n\twhile (++i < len) {\n\t  if (types[i] && types[i].test && types[i].test()) {\n\t    scheduleDrain = types[i].install(nextTick);\n\t    break;\n\t  }\n\t}\n\t// v8 likes predictible objects\n\tfunction Item(fun, array) {\n\t  this.fun = fun;\n\t  this.array = array;\n\t}\n\tItem.prototype.run = function () {\n\t  var fun = this.fun;\n\t  var array = this.array;\n\t  switch (array.length) {\n\t  case 0:\n\t    return fun();\n\t  case 1:\n\t    return fun(array[0]);\n\t  case 2:\n\t    return fun(array[0], array[1]);\n\t  case 3:\n\t    return fun(array[0], array[1], array[2]);\n\t  default:\n\t    return fun.apply(null, array);\n\t  }\n\n\t};\n\tmodule.exports = immediate;\n\tfunction immediate(task) {\n\t  var args = new Array(arguments.length - 1);\n\t  if (arguments.length > 1) {\n\t    for (var i = 1; i < arguments.length; i++) {\n\t      args[i - 1] = arguments[i];\n\t    }\n\t  }\n\t  queue.push(new Item(task, args));\n\t  if (!scheduled && !draining) {\n\t    scheduled = true;\n\t    scheduleDrain();\n\t  }\n\t}\n\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {'use strict';\n\texports.test = function () {\n\t  // Don't get fooled by e.g. browserify environments.\n\t  return (typeof process !== 'undefined') && !process.browser;\n\t};\n\n\texports.install = function (func) {\n\t  return function () {\n\t    process.nextTick(func);\n\t  };\n\t};\n\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))\n\n/***/ },\n/* 11 */\n/***/ function(module, exports) {\n\n\t// shim for using process in browser\n\tvar process = module.exports = {};\n\n\t// cached from whatever global is present so that test runners that stub it\n\t// don't break things.  But we need to wrap it in a try catch in case it is\n\t// wrapped in strict mode code which doesn't define any globals.  It's inside a\n\t// function because try/catches deoptimize in certain engines.\n\n\tvar cachedSetTimeout;\n\tvar cachedClearTimeout;\n\n\tfunction defaultSetTimout() {\n\t    throw new Error('setTimeout has not been defined');\n\t}\n\tfunction defaultClearTimeout () {\n\t    throw new Error('clearTimeout has not been defined');\n\t}\n\t(function () {\n\t    try {\n\t        if (typeof setTimeout === 'function') {\n\t            cachedSetTimeout = setTimeout;\n\t        } else {\n\t            cachedSetTimeout = defaultSetTimout;\n\t        }\n\t    } catch (e) {\n\t        cachedSetTimeout = defaultSetTimout;\n\t    }\n\t    try {\n\t        if (typeof clearTimeout === 'function') {\n\t            cachedClearTimeout = clearTimeout;\n\t        } else {\n\t            cachedClearTimeout = defaultClearTimeout;\n\t        }\n\t    } catch (e) {\n\t        cachedClearTimeout = defaultClearTimeout;\n\t    }\n\t} ())\n\tfunction runTimeout(fun) {\n\t    if (cachedSetTimeout === setTimeout) {\n\t        //normal enviroments in sane situations\n\t        return setTimeout(fun, 0);\n\t    }\n\t    // if setTimeout wasn't available but was latter defined\n\t    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n\t        cachedSetTimeout = setTimeout;\n\t        return setTimeout(fun, 0);\n\t    }\n\t    try {\n\t        // when when somebody has screwed with setTimeout but no I.E. maddness\n\t        return cachedSetTimeout(fun, 0);\n\t    } catch(e){\n\t        try {\n\t            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n\t            return cachedSetTimeout.call(null, fun, 0);\n\t        } catch(e){\n\t            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n\t            return cachedSetTimeout.call(this, fun, 0);\n\t        }\n\t    }\n\n\n\t}\n\tfunction runClearTimeout(marker) {\n\t    if (cachedClearTimeout === clearTimeout) {\n\t        //normal enviroments in sane situations\n\t        return clearTimeout(marker);\n\t    }\n\t    // if clearTimeout wasn't available but was latter defined\n\t    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n\t        cachedClearTimeout = clearTimeout;\n\t        return clearTimeout(marker);\n\t    }\n\t    try {\n\t        // when when somebody has screwed with setTimeout but no I.E. maddness\n\t        return cachedClearTimeout(marker);\n\t    } catch (e){\n\t        try {\n\t            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally\n\t            return cachedClearTimeout.call(null, marker);\n\t        } catch (e){\n\t            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n\t            // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n\t            return cachedClearTimeout.call(this, marker);\n\t        }\n\t    }\n\n\n\n\t}\n\tvar queue = [];\n\tvar draining = false;\n\tvar currentQueue;\n\tvar queueIndex = -1;\n\n\tfunction cleanUpNextTick() {\n\t    if (!draining || !currentQueue) {\n\t        return;\n\t    }\n\t    draining = false;\n\t    if (currentQueue.length) {\n\t        queue = currentQueue.concat(queue);\n\t    } else {\n\t        queueIndex = -1;\n\t    }\n\t    if (queue.length) {\n\t        drainQueue();\n\t    }\n\t}\n\n\tfunction drainQueue() {\n\t    if (draining) {\n\t        return;\n\t    }\n\t    var timeout = runTimeout(cleanUpNextTick);\n\t    draining = true;\n\n\t    var len = queue.length;\n\t    while(len) {\n\t        currentQueue = queue;\n\t        queue = [];\n\t        while (++queueIndex < len) {\n\t            if (currentQueue) {\n\t                currentQueue[queueIndex].run();\n\t            }\n\t        }\n\t        queueIndex = -1;\n\t        len = queue.length;\n\t    }\n\t    currentQueue = null;\n\t    draining = false;\n\t    runClearTimeout(timeout);\n\t}\n\n\tprocess.nextTick = function (fun) {\n\t    var args = new Array(arguments.length - 1);\n\t    if (arguments.length > 1) {\n\t        for (var i = 1; i < arguments.length; i++) {\n\t            args[i - 1] = arguments[i];\n\t        }\n\t    }\n\t    queue.push(new Item(fun, args));\n\t    if (queue.length === 1 && !draining) {\n\t        runTimeout(drainQueue);\n\t    }\n\t};\n\n\t// v8 likes predictible objects\n\tfunction Item(fun, array) {\n\t    this.fun = fun;\n\t    this.array = array;\n\t}\n\tItem.prototype.run = function () {\n\t    this.fun.apply(null, this.array);\n\t};\n\tprocess.title = 'browser';\n\tprocess.browser = true;\n\tprocess.env = {};\n\tprocess.argv = [];\n\tprocess.version = ''; // empty string to avoid regexp issues\n\tprocess.versions = {};\n\n\tfunction noop() {}\n\n\tprocess.on = noop;\n\tprocess.addListener = noop;\n\tprocess.once = noop;\n\tprocess.off = noop;\n\tprocess.removeListener = noop;\n\tprocess.removeAllListeners = noop;\n\tprocess.emit = noop;\n\n\tprocess.binding = function (name) {\n\t    throw new Error('process.binding is not supported');\n\t};\n\n\tprocess.cwd = function () { return '/' };\n\tprocess.chdir = function (dir) {\n\t    throw new Error('process.chdir is not supported');\n\t};\n\tprocess.umask = function() { return 0; };\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t//based off rsvp https://github.com/tildeio/rsvp.js\n\t//license https://github.com/tildeio/rsvp.js/blob/master/LICENSE\n\t//https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/asap.js\n\n\tvar Mutation = global.MutationObserver || global.WebKitMutationObserver;\n\n\texports.test = function () {\n\t  return Mutation;\n\t};\n\n\texports.install = function (handle) {\n\t  var called = 0;\n\t  var observer = new Mutation(handle);\n\t  var element = global.document.createTextNode('');\n\t  observer.observe(element, {\n\t    characterData: true\n\t  });\n\t  return function () {\n\t    element.data = (called = ++called % 2);\n\t  };\n\t};\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\n\texports.test = function () {\n\t  if (global.setImmediate) {\n\t    // we can only get here in IE10\n\t    // which doesn't handel postMessage well\n\t    return false;\n\t  }\n\t  return typeof global.MessageChannel !== 'undefined';\n\t};\n\n\texports.install = function (func) {\n\t  var channel = new global.MessageChannel();\n\t  channel.port1.onmessage = func;\n\t  return function () {\n\t    channel.port2.postMessage(0);\n\t  };\n\t};\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 14 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\n\texports.test = function () {\n\t  return 'document' in global && 'onreadystatechange' in global.document.createElement('script');\n\t};\n\n\texports.install = function (handle) {\n\t  return function () {\n\n\t    // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n\t    // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n\t    var scriptEl = global.document.createElement('script');\n\t    scriptEl.onreadystatechange = function () {\n\t      handle();\n\n\t      scriptEl.onreadystatechange = null;\n\t      scriptEl.parentNode.removeChild(scriptEl);\n\t      scriptEl = null;\n\t    };\n\t    global.document.documentElement.appendChild(scriptEl);\n\n\t    return handle;\n\t  };\n\t};\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 15 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\texports.test = function () {\n\t  return true;\n\t};\n\n\texports.install = function (t) {\n\t  return function () {\n\t    setTimeout(t, 0);\n\t  };\n\t};\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar _ = __webpack_require__(4);\n\tvar DOM = __webpack_require__(3);\n\tvar EventEmitter = __webpack_require__(8);\n\tvar Dataset = __webpack_require__(17);\n\tvar css = __webpack_require__(19);\n\n\t// constructor\n\t// -----------\n\n\tfunction Dropdown(o) {\n\t  var that = this;\n\t  var onSuggestionClick;\n\t  var onSuggestionMouseEnter;\n\t  var onSuggestionMouseLeave;\n\n\t  o = o || {};\n\n\t  if (!o.menu) {\n\t    _.error('menu is required');\n\t  }\n\n\t  if (!_.isArray(o.datasets) && !_.isObject(o.datasets)) {\n\t    _.error('1 or more datasets required');\n\t  }\n\t  if (!o.datasets) {\n\t    _.error('datasets is required');\n\t  }\n\n\t  this.isOpen = false;\n\t  this.isEmpty = true;\n\t  this.minLength = o.minLength || 0;\n\t  this.templates = {};\n\t  this.appendTo = o.appendTo || false;\n\t  this.css = _.mixin({}, css, o.appendTo ? css.appendTo : {});\n\t  this.cssClasses = o.cssClasses = _.mixin({}, css.defaultClasses, o.cssClasses || {});\n\t  this.cssClasses.prefix =\n\t    o.cssClasses.formattedPrefix || _.formatPrefix(this.cssClasses.prefix, this.cssClasses.noPrefix);\n\n\t  // bound functions\n\t  onSuggestionClick = _.bind(this._onSuggestionClick, this);\n\t  onSuggestionMouseEnter = _.bind(this._onSuggestionMouseEnter, this);\n\t  onSuggestionMouseLeave = _.bind(this._onSuggestionMouseLeave, this);\n\n\t  var cssClass = _.className(this.cssClasses.prefix, this.cssClasses.suggestion);\n\t  this.$menu = DOM.element(o.menu)\n\t    .on('mouseenter.aa', cssClass, onSuggestionMouseEnter)\n\t    .on('mouseleave.aa', cssClass, onSuggestionMouseLeave)\n\t    .on('click.aa', cssClass, onSuggestionClick);\n\n\t  this.$container = o.appendTo ? o.wrapper : this.$menu;\n\n\t  if (o.templates && o.templates.header) {\n\t    this.templates.header = _.templatify(o.templates.header);\n\t    this.$menu.prepend(this.templates.header());\n\t  }\n\n\t  if (o.templates && o.templates.empty) {\n\t    this.templates.empty = _.templatify(o.templates.empty);\n\t    this.$empty = DOM.element('<div class=\"' +\n\t      _.className(this.cssClasses.prefix, this.cssClasses.empty, true) + '\">' +\n\t      '</div>');\n\t    this.$menu.append(this.$empty);\n\t    this.$empty.hide();\n\t  }\n\n\t  this.datasets = _.map(o.datasets, function(oDataset) {\n\t    return initializeDataset(that.$menu, oDataset, o.cssClasses);\n\t  });\n\t  _.each(this.datasets, function(dataset) {\n\t    var root = dataset.getRoot();\n\t    if (root && root.parent().length === 0) {\n\t      that.$menu.append(root);\n\t    }\n\t    dataset.onSync('rendered', that._onRendered, that);\n\t  });\n\n\t  if (o.templates && o.templates.footer) {\n\t    this.templates.footer = _.templatify(o.templates.footer);\n\t    this.$menu.append(this.templates.footer());\n\t  }\n\n\t  var self = this;\n\t  DOM.element(window).resize(function() {\n\t    self._redraw();\n\t  });\n\t}\n\n\t// instance methods\n\t// ----------------\n\n\t_.mixin(Dropdown.prototype, EventEmitter, {\n\n\t  // ### private\n\n\t  _onSuggestionClick: function onSuggestionClick($e) {\n\t    this.trigger('suggestionClicked', DOM.element($e.currentTarget));\n\t  },\n\n\t  _onSuggestionMouseEnter: function onSuggestionMouseEnter($e) {\n\t    var elt = DOM.element($e.currentTarget);\n\t    if (elt.hasClass(_.className(this.cssClasses.prefix, this.cssClasses.cursor, true))) {\n\t      // we're already on the cursor\n\t      // => we're probably entering it again after leaving it for a nested div\n\t      return;\n\t    }\n\t    this._removeCursor();\n\n\t    // Fixes iOS double tap behaviour, by modifying the DOM right before the\n\t    // native href clicks happens, iOS will requires another tap to follow\n\t    // a suggestion that has an <a href> element inside\n\t    // https://www.google.com/search?q=ios+double+tap+bug+href\n\t    var suggestion = this;\n\t    setTimeout(function() {\n\t      // this exact line, when inside the main loop, will trigger a double tap bug\n\t      // on iOS devices\n\t      suggestion._setCursor(elt, false);\n\t    }, 0);\n\t  },\n\n\t  _onSuggestionMouseLeave: function onSuggestionMouseLeave($e) {\n\t    // $e.relatedTarget is the `EventTarget` the pointing device entered to\n\t    if ($e.relatedTarget) {\n\t      var elt = DOM.element($e.relatedTarget);\n\t      if (elt.closest('.' + _.className(this.cssClasses.prefix, this.cssClasses.cursor, true)).length > 0) {\n\t        // our father is a cursor\n\t        // => it means we're just leaving the suggestion for a nested div\n\t        return;\n\t      }\n\t    }\n\t    this._removeCursor();\n\t    this.trigger('cursorRemoved');\n\t  },\n\n\t  _onRendered: function onRendered(e, query) {\n\t    this.isEmpty = _.every(this.datasets, isDatasetEmpty);\n\n\t    if (this.isEmpty) {\n\t      if (query.length >= this.minLength) {\n\t        this.trigger('empty');\n\t      }\n\n\t      if (this.$empty) {\n\t        if (query.length < this.minLength) {\n\t          this._hide();\n\t        } else {\n\t          var html = this.templates.empty({\n\t            query: this.datasets[0] && this.datasets[0].query\n\t          });\n\t          this.$empty.html(html);\n\t          this.$empty.show();\n\t          this._show();\n\t        }\n\t      } else if (_.any(this.datasets, hasEmptyTemplate)) {\n\t        if (query.length < this.minLength) {\n\t          this._hide();\n\t        } else {\n\t          this._show();\n\t        }\n\t      } else {\n\t        this._hide();\n\t      }\n\t    } else if (this.isOpen) {\n\t      if (this.$empty) {\n\t        this.$empty.empty();\n\t        this.$empty.hide();\n\t      }\n\n\t      if (query.length >= this.minLength) {\n\t        this._show();\n\t      } else {\n\t        this._hide();\n\t      }\n\t    }\n\n\t    this.trigger('datasetRendered');\n\n\t    function isDatasetEmpty(dataset) {\n\t      return dataset.isEmpty();\n\t    }\n\n\t    function hasEmptyTemplate(dataset) {\n\t      return dataset.templates && dataset.templates.empty;\n\t    }\n\t  },\n\n\t  _hide: function() {\n\t    this.$container.hide();\n\t  },\n\n\t  _show: function() {\n\t    // can't use jQuery#show because $menu is a span element we want\n\t    // display: block; not dislay: inline;\n\t    this.$container.css('display', 'block');\n\n\t    this._redraw();\n\n\t    this.trigger('shown');\n\t  },\n\n\t  _redraw: function redraw() {\n\t    if (!this.isOpen || !this.appendTo) return;\n\n\t    this.trigger('redrawn');\n\t  },\n\n\t  _getSuggestions: function getSuggestions() {\n\t    return this.$menu.find(_.className(this.cssClasses.prefix, this.cssClasses.suggestion));\n\t  },\n\n\t  _getCursor: function getCursor() {\n\t    return this.$menu.find(_.className(this.cssClasses.prefix, this.cssClasses.cursor)).first();\n\t  },\n\n\t  _setCursor: function setCursor($el, updateInput) {\n\t    $el.first()\n\t      .addClass(_.className(this.cssClasses.prefix, this.cssClasses.cursor, true))\n\t      .attr('aria-selected', 'true');\n\t    this.trigger('cursorMoved', updateInput);\n\t  },\n\n\t  _removeCursor: function removeCursor() {\n\t    this._getCursor()\n\t      .removeClass(_.className(this.cssClasses.prefix, this.cssClasses.cursor, true))\n\t      .removeAttr('aria-selected');\n\t  },\n\n\t  _moveCursor: function moveCursor(increment) {\n\t    var $suggestions;\n\t    var $oldCursor;\n\t    var newCursorIndex;\n\t    var $newCursor;\n\n\t    if (!this.isOpen) {\n\t      return;\n\t    }\n\n\t    $oldCursor = this._getCursor();\n\t    $suggestions = this._getSuggestions();\n\n\t    this._removeCursor();\n\n\t    // shifting before and after modulo to deal with -1 index\n\t    newCursorIndex = $suggestions.index($oldCursor) + increment;\n\t    newCursorIndex = (newCursorIndex + 1) % ($suggestions.length + 1) - 1;\n\n\t    if (newCursorIndex === -1) {\n\t      this.trigger('cursorRemoved');\n\n\t      return;\n\t    } else if (newCursorIndex < -1) {\n\t      newCursorIndex = $suggestions.length - 1;\n\t    }\n\n\t    this._setCursor($newCursor = $suggestions.eq(newCursorIndex), true);\n\n\t    // in the case of scrollable overflow\n\t    // make sure the cursor is visible in the menu\n\t    this._ensureVisible($newCursor);\n\t  },\n\n\t  _ensureVisible: function ensureVisible($el) {\n\t    var elTop;\n\t    var elBottom;\n\t    var menuScrollTop;\n\t    var menuHeight;\n\n\t    elTop = $el.position().top;\n\t    elBottom = elTop + $el.height() +\n\t      parseInt($el.css('margin-top'), 10) +\n\t      parseInt($el.css('margin-bottom'), 10);\n\t    menuScrollTop = this.$menu.scrollTop();\n\t    menuHeight = this.$menu.height() +\n\t      parseInt(this.$menu.css('padding-top'), 10) +\n\t      parseInt(this.$menu.css('padding-bottom'), 10);\n\n\t    if (elTop < 0) {\n\t      this.$menu.scrollTop(menuScrollTop + elTop);\n\t    } else if (menuHeight < elBottom) {\n\t      this.$menu.scrollTop(menuScrollTop + (elBottom - menuHeight));\n\t    }\n\t  },\n\n\t  // ### public\n\n\t  close: function close() {\n\t    if (this.isOpen) {\n\t      this.isOpen = false;\n\n\t      this._removeCursor();\n\t      this._hide();\n\n\t      this.trigger('closed');\n\t    }\n\t  },\n\n\t  open: function open() {\n\t    if (!this.isOpen) {\n\t      this.isOpen = true;\n\n\t      if (!this.isEmpty) {\n\t        this._show();\n\t      }\n\n\t      this.trigger('opened');\n\t    }\n\t  },\n\n\t  setLanguageDirection: function setLanguageDirection(dir) {\n\t    this.$menu.css(dir === 'ltr' ? this.css.ltr : this.css.rtl);\n\t  },\n\n\t  moveCursorUp: function moveCursorUp() {\n\t    this._moveCursor(-1);\n\t  },\n\n\t  moveCursorDown: function moveCursorDown() {\n\t    this._moveCursor(+1);\n\t  },\n\n\t  getDatumForSuggestion: function getDatumForSuggestion($el) {\n\t    var datum = null;\n\n\t    if ($el.length) {\n\t      datum = {\n\t        raw: Dataset.extractDatum($el),\n\t        value: Dataset.extractValue($el),\n\t        datasetName: Dataset.extractDatasetName($el)\n\t      };\n\t    }\n\n\t    return datum;\n\t  },\n\n\t  getCurrentCursor: function getCurrentCursor() {\n\t    return this._getCursor().first();\n\t  },\n\n\t  getDatumForCursor: function getDatumForCursor() {\n\t    return this.getDatumForSuggestion(this._getCursor().first());\n\t  },\n\n\t  getDatumForTopSuggestion: function getDatumForTopSuggestion() {\n\t    return this.getDatumForSuggestion(this._getSuggestions().first());\n\t  },\n\n\t  cursorTopSuggestion: function cursorTopSuggestion() {\n\t    this._setCursor(this._getSuggestions().first(), false);\n\t  },\n\n\t  update: function update(query) {\n\t    _.each(this.datasets, updateDataset);\n\n\t    function updateDataset(dataset) {\n\t      dataset.update(query);\n\t    }\n\t  },\n\n\t  empty: function empty() {\n\t    _.each(this.datasets, clearDataset);\n\t    this.isEmpty = true;\n\n\t    function clearDataset(dataset) {\n\t      dataset.clear();\n\t    }\n\t  },\n\n\t  isVisible: function isVisible() {\n\t    return this.isOpen && !this.isEmpty;\n\t  },\n\n\t  destroy: function destroy() {\n\t    this.$menu.off('.aa');\n\n\t    this.$menu = null;\n\n\t    _.each(this.datasets, destroyDataset);\n\n\t    function destroyDataset(dataset) {\n\t      dataset.destroy();\n\t    }\n\t  }\n\t});\n\n\t// helper functions\n\t// ----------------\n\tDropdown.Dataset = Dataset;\n\n\tfunction initializeDataset($menu, oDataset, cssClasses) {\n\t  return new Dropdown.Dataset(_.mixin({$menu: $menu, cssClasses: cssClasses}, oDataset));\n\t}\n\n\tmodule.exports = Dropdown;\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar datasetKey = 'aaDataset';\n\tvar valueKey = 'aaValue';\n\tvar datumKey = 'aaDatum';\n\n\tvar _ = __webpack_require__(4);\n\tvar DOM = __webpack_require__(3);\n\tvar html = __webpack_require__(18);\n\tvar css = __webpack_require__(19);\n\tvar EventEmitter = __webpack_require__(8);\n\n\t// constructor\n\t// -----------\n\n\tfunction Dataset(o) {\n\t  o = o || {};\n\t  o.templates = o.templates || {};\n\n\t  if (!o.source) {\n\t    _.error('missing source');\n\t  }\n\n\t  if (o.name && !isValidName(o.name)) {\n\t    _.error('invalid dataset name: ' + o.name);\n\t  }\n\n\t  // tracks the last query the dataset was updated for\n\t  this.query = null;\n\t  this._isEmpty = true;\n\n\t  this.highlight = !!o.highlight;\n\t  this.name = typeof o.name === 'undefined' || o.name === null ? _.getUniqueId() : o.name;\n\n\t  this.source = o.source;\n\t  this.displayFn = getDisplayFn(o.display || o.displayKey);\n\n\t  this.debounce = o.debounce;\n\n\t  this.cache = o.cache !== false;\n\n\t  this.templates = getTemplates(o.templates, this.displayFn);\n\n\t  this.css = _.mixin({}, css, o.appendTo ? css.appendTo : {});\n\t  this.cssClasses = o.cssClasses = _.mixin({}, css.defaultClasses, o.cssClasses || {});\n\t  this.cssClasses.prefix =\n\t    o.cssClasses.formattedPrefix || _.formatPrefix(this.cssClasses.prefix, this.cssClasses.noPrefix);\n\n\t  var clazz = _.className(this.cssClasses.prefix, this.cssClasses.dataset);\n\t  this.$el = o.$menu && o.$menu.find(clazz + '-' + this.name).length > 0 ?\n\t    DOM.element(o.$menu.find(clazz + '-' + this.name)[0]) :\n\t    DOM.element(\n\t      html.dataset.replace('%CLASS%', this.name)\n\t        .replace('%PREFIX%', this.cssClasses.prefix)\n\t        .replace('%DATASET%', this.cssClasses.dataset)\n\t    );\n\n\t  this.$menu = o.$menu;\n\t  this.clearCachedSuggestions();\n\t}\n\n\t// static methods\n\t// --------------\n\n\tDataset.extractDatasetName = function extractDatasetName(el) {\n\t  return DOM.element(el).data(datasetKey);\n\t};\n\n\tDataset.extractValue = function extractValue(el) {\n\t  return DOM.element(el).data(valueKey);\n\t};\n\n\tDataset.extractDatum = function extractDatum(el) {\n\t  var datum = DOM.element(el).data(datumKey);\n\t  if (typeof datum === 'string') {\n\t    // Zepto has an automatic deserialization of the\n\t    // JSON encoded data attribute\n\t    datum = JSON.parse(datum);\n\t  }\n\t  return datum;\n\t};\n\n\t// instance methods\n\t// ----------------\n\n\t_.mixin(Dataset.prototype, EventEmitter, {\n\n\t  // ### private\n\n\t  _render: function render(query, suggestions) {\n\t    if (!this.$el) {\n\t      return;\n\t    }\n\t    var that = this;\n\n\t    var hasSuggestions;\n\t    var renderArgs = [].slice.call(arguments, 2);\n\t    this.$el.empty();\n\n\t    hasSuggestions = suggestions && suggestions.length;\n\t    this._isEmpty = !hasSuggestions;\n\n\t    if (!hasSuggestions && this.templates.empty) {\n\t      this.$el\n\t        .html(getEmptyHtml.apply(this, renderArgs))\n\t        .prepend(that.templates.header ? getHeaderHtml.apply(this, renderArgs) : null)\n\t        .append(that.templates.footer ? getFooterHtml.apply(this, renderArgs) : null);\n\t    } else if (hasSuggestions) {\n\t      this.$el\n\t        .html(getSuggestionsHtml.apply(this, renderArgs))\n\t        .prepend(that.templates.header ? getHeaderHtml.apply(this, renderArgs) : null)\n\t        .append(that.templates.footer ? getFooterHtml.apply(this, renderArgs) : null);\n\t    } else if (suggestions && !Array.isArray(suggestions)) {\n\t      throw new TypeError('suggestions must be an array');\n\t    }\n\n\t    if (this.$menu) {\n\t      this.$menu.addClass(\n\t        this.cssClasses.prefix + (hasSuggestions ? 'with' : 'without') + '-' + this.name\n\t      ).removeClass(\n\t        this.cssClasses.prefix + (hasSuggestions ? 'without' : 'with') + '-' + this.name\n\t      );\n\t    }\n\n\t    this.trigger('rendered', query);\n\n\t    function getEmptyHtml() {\n\t      var args = [].slice.call(arguments, 0);\n\t      args = [{query: query, isEmpty: true}].concat(args);\n\t      return that.templates.empty.apply(this, args);\n\t    }\n\n\t    function getSuggestionsHtml() {\n\t      var args = [].slice.call(arguments, 0);\n\t      var $suggestions;\n\t      var nodes;\n\t      var self = this;\n\n\t      var suggestionsHtml = html.suggestions.\n\t        replace('%PREFIX%', this.cssClasses.prefix).\n\t        replace('%SUGGESTIONS%', this.cssClasses.suggestions);\n\t      $suggestions = DOM\n\t        .element(suggestionsHtml)\n\t        .css(this.css.suggestions);\n\n\t      // jQuery#append doesn't support arrays as the first argument\n\t      // until version 1.8, see http://bugs.jquery.com/ticket/11231\n\t      nodes = _.map(suggestions, getSuggestionNode);\n\t      $suggestions.append.apply($suggestions, nodes);\n\n\t      return $suggestions;\n\n\t      function getSuggestionNode(suggestion) {\n\t        var $el;\n\n\t        var suggestionHtml = html.suggestion.\n\t          replace('%PREFIX%', self.cssClasses.prefix).\n\t          replace('%SUGGESTION%', self.cssClasses.suggestion);\n\t        $el = DOM.element(suggestionHtml)\n\t          .attr({\n\t            role: 'option',\n\t            id: ['option', Math.floor(Math.random() * 100000000)].join('-')\n\t          })\n\t          .append(that.templates.suggestion.apply(this, [suggestion].concat(args)));\n\n\t        $el.data(datasetKey, that.name);\n\t        $el.data(valueKey, that.displayFn(suggestion) || undefined); // this led to undefined return value\n\t        $el.data(datumKey, JSON.stringify(suggestion));\n\t        $el.children().each(function() { DOM.element(this).css(self.css.suggestionChild); });\n\n\t        return $el;\n\t      }\n\t    }\n\n\t    function getHeaderHtml() {\n\t      var args = [].slice.call(arguments, 0);\n\t      args = [{query: query, isEmpty: !hasSuggestions}].concat(args);\n\t      return that.templates.header.apply(this, args);\n\t    }\n\n\t    function getFooterHtml() {\n\t      var args = [].slice.call(arguments, 0);\n\t      args = [{query: query, isEmpty: !hasSuggestions}].concat(args);\n\t      return that.templates.footer.apply(this, args);\n\t    }\n\t  },\n\n\t  // ### public\n\n\t  getRoot: function getRoot() {\n\t    return this.$el;\n\t  },\n\n\t  update: function update(query) {\n\t    function handleSuggestions(suggestions) {\n\t      // if the update has been canceled or if the query has changed\n\t      // do not render the suggestions as they've become outdated\n\t      if (!this.canceled && query === this.query) {\n\t        // concat all the other arguments that could have been passed\n\t        // to the render function, and forward them to _render\n\t        var extraArgs = [].slice.call(arguments, 1);\n\t        this.cacheSuggestions(query, suggestions, extraArgs);\n\t        this._render.apply(this, [query, suggestions].concat(extraArgs));\n\t      }\n\t    }\n\n\t    this.query = query;\n\t    this.canceled = false;\n\n\t    if (this.shouldFetchFromCache(query)) {\n\t      handleSuggestions.apply(this, [this.cachedSuggestions].concat(this.cachedRenderExtraArgs));\n\t    } else {\n\t      var that = this;\n\t      var execSource = function() {\n\t        // When the call is debounced the condition avoid to do a useless\n\t        // request with the last character when the input has been cleared\n\t        if (!that.canceled) {\n\t          that.source(query, handleSuggestions.bind(that));\n\t        }\n\t      };\n\n\t      if (this.debounce) {\n\t        var later = function() {\n\t          that.debounceTimeout = null;\n\t          execSource();\n\t        };\n\t        clearTimeout(this.debounceTimeout);\n\t        this.debounceTimeout = setTimeout(later, this.debounce);\n\t      } else {\n\t        execSource();\n\t      }\n\t    }\n\t  },\n\n\t  cacheSuggestions: function cacheSuggestions(query, suggestions, extraArgs) {\n\t    this.cachedQuery = query;\n\t    this.cachedSuggestions = suggestions;\n\t    this.cachedRenderExtraArgs = extraArgs;\n\t  },\n\n\t  shouldFetchFromCache: function shouldFetchFromCache(query) {\n\t    return this.cache &&\n\t      this.cachedQuery === query &&\n\t      this.cachedSuggestions &&\n\t      this.cachedSuggestions.length;\n\t  },\n\n\t  clearCachedSuggestions: function clearCachedSuggestions() {\n\t    delete this.cachedQuery;\n\t    delete this.cachedSuggestions;\n\t    delete this.cachedRenderExtraArgs;\n\t  },\n\n\t  cancel: function cancel() {\n\t    this.canceled = true;\n\t  },\n\n\t  clear: function clear() {\n\t    if (this.$el) {\n\t      this.cancel();\n\t      this.$el.empty();\n\t      this.trigger('rendered', '');\n\t    }\n\t  },\n\n\t  isEmpty: function isEmpty() {\n\t    return this._isEmpty;\n\t  },\n\n\t  destroy: function destroy() {\n\t    this.clearCachedSuggestions();\n\t    this.$el = null;\n\t  }\n\t});\n\n\t// helper functions\n\t// ----------------\n\n\tfunction getDisplayFn(display) {\n\t  display = display || 'value';\n\n\t  return _.isFunction(display) ? display : displayFn;\n\n\t  function displayFn(obj) {\n\t    return obj[display];\n\t  }\n\t}\n\n\tfunction getTemplates(templates, displayFn) {\n\t  return {\n\t    empty: templates.empty && _.templatify(templates.empty),\n\t    header: templates.header && _.templatify(templates.header),\n\t    footer: templates.footer && _.templatify(templates.footer),\n\t    suggestion: templates.suggestion || suggestionTemplate\n\t  };\n\n\t  function suggestionTemplate(context) {\n\t    return '<p>' + displayFn(context) + '</p>';\n\t  }\n\t}\n\n\tfunction isValidName(str) {\n\t  // dashes, underscores, letters, and numbers\n\t  return (/^[_a-zA-Z0-9-]+$/).test(str);\n\t}\n\n\tmodule.exports = Dataset;\n\n\n/***/ },\n/* 18 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\n\tmodule.exports = {\n\t  wrapper: '<span class=\"%ROOT%\"></span>',\n\t  dropdown: '<span class=\"%PREFIX%%DROPDOWN_MENU%\"></span>',\n\t  dataset: '<div class=\"%PREFIX%%DATASET%-%CLASS%\"></div>',\n\t  suggestions: '<span class=\"%PREFIX%%SUGGESTIONS%\"></span>',\n\t  suggestion: '<div class=\"%PREFIX%%SUGGESTION%\"></div>'\n\t};\n\n\n/***/ },\n/* 19 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar _ = __webpack_require__(4);\n\n\tvar css = {\n\t  wrapper: {\n\t    position: 'relative',\n\t    display: 'inline-block'\n\t  },\n\t  hint: {\n\t    position: 'absolute',\n\t    top: '0',\n\t    left: '0',\n\t    borderColor: 'transparent',\n\t    boxShadow: 'none',\n\t    // #741: fix hint opacity issue on iOS\n\t    opacity: '1'\n\t  },\n\t  input: {\n\t    position: 'relative',\n\t    verticalAlign: 'top',\n\t    backgroundColor: 'transparent'\n\t  },\n\t  inputWithNoHint: {\n\t    position: 'relative',\n\t    verticalAlign: 'top'\n\t  },\n\t  dropdown: {\n\t    position: 'absolute',\n\t    top: '100%',\n\t    left: '0',\n\t    zIndex: '100',\n\t    display: 'none'\n\t  },\n\t  suggestions: {\n\t    display: 'block'\n\t  },\n\t  suggestion: {\n\t    whiteSpace: 'nowrap',\n\t    cursor: 'pointer'\n\t  },\n\t  suggestionChild: {\n\t    whiteSpace: 'normal'\n\t  },\n\t  ltr: {\n\t    left: '0',\n\t    right: 'auto'\n\t  },\n\t  rtl: {\n\t    left: 'auto',\n\t    right: '0'\n\t  },\n\t  defaultClasses: {\n\t    root: 'algolia-autocomplete',\n\t    prefix: 'aa',\n\t    noPrefix: false,\n\t    dropdownMenu: 'dropdown-menu',\n\t    input: 'input',\n\t    hint: 'hint',\n\t    suggestions: 'suggestions',\n\t    suggestion: 'suggestion',\n\t    cursor: 'cursor',\n\t    dataset: 'dataset',\n\t    empty: 'empty'\n\t  },\n\t  // will be merged with the default ones if appendTo is used\n\t  appendTo: {\n\t    wrapper: {\n\t      position: 'absolute',\n\t      zIndex: '100',\n\t      display: 'none'\n\t    },\n\t    input: {},\n\t    inputWithNoHint: {},\n\t    dropdown: {\n\t      display: 'block'\n\t    }\n\t  }\n\t};\n\n\t// ie specific styling\n\tif (_.isMsie()) {\n\t  // ie6-8 (and 9?) doesn't fire hover and click events for elements with\n\t  // transparent backgrounds, for a workaround, use 1x1 transparent gif\n\t  _.mixin(css.input, {\n\t    backgroundImage: 'url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)'\n\t  });\n\t}\n\n\t// ie7 and under specific styling\n\tif (_.isMsie() && _.isMsie() <= 7) {\n\t  // if someone can tell me why this is necessary to align\n\t  // the hint with the query in ie7, i'll send you $5 - @JakeHarding\n\t  _.mixin(css.input, {marginTop: '-1px'});\n\t}\n\n\tmodule.exports = css;\n\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tmodule.exports = {\n\t  hits: __webpack_require__(21),\n\t  popularIn: __webpack_require__(24)\n\t};\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar _ = __webpack_require__(4);\n\tvar version = __webpack_require__(22);\n\tvar parseAlgoliaClientVersion = __webpack_require__(23);\n\n\tfunction createMultiQuerySource() {\n\t  var queries = [];\n\t  var lastResults = [];\n\t  var lastSearch = window.Promise.resolve();\n\n\t  function requestSearch(queryClient, queryIndex) {\n\t    // Since all requests happen synchronously, this is executed once all the\n\t    // sources have been requested.\n\t    return window.Promise.resolve()\n\t      .then(function() {\n\t        if (queries.length) {\n\t          lastSearch = queryClient.search(queries);\n\t          queries = [];\n\t        }\n\n\t        return lastSearch;\n\t      })\n\t      .then(function(result) {\n\t        if (!result) {\n\t          return undefined;\n\t        }\n\n\t        lastResults = result.results;\n\t        return lastResults[queryIndex];\n\t      });\n\t  }\n\n\t  return function multiQuerySource(searchIndex, params) {\n\t    return function search(query, cb) {\n\t      var queryClient = searchIndex.as;\n\t      var queryIndex =\n\t        queries.push({\n\t          indexName: searchIndex.indexName,\n\t          query: query,\n\t          params: params\n\t        }) - 1;\n\n\t      requestSearch(queryClient, queryIndex)\n\t        .then(function(result) {\n\t          if (result) {\n\t            cb(result.hits, result);\n\t          }\n\t        })\n\t        .catch(function(error) {\n\t          _.error(error.message);\n\t        });\n\t    };\n\t  };\n\t}\n\n\tvar source = createMultiQuerySource();\n\n\tmodule.exports = function search(index, params) {\n\t  var algoliaVersion = parseAlgoliaClientVersion(index.as._ua);\n\n\t  if (algoliaVersion && algoliaVersion[0] >= 3 && algoliaVersion[1] > 20) {\n\t    var autocompleteUserAgent = 'autocomplete.js ' + version;\n\n\t    if (index.as._ua.indexOf(autocompleteUserAgent) === -1) {\n\t      index.as._ua += '; ' + autocompleteUserAgent;\n\t    }\n\t  }\n\n\t  return source(index, params);\n\t};\n\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \"0.38.1\";\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\n\tmodule.exports = function parseAlgoliaClientVersion(agent) {\n\t  var parsed =\n\t    // User agent for algoliasearch >= 3.33.0\n\t    agent.match(/Algolia for JavaScript \\((\\d+\\.)(\\d+\\.)(\\d+)\\)/) ||\n\t    // User agent for algoliasearch < 3.33.0\n\t    agent.match(/Algolia for vanilla JavaScript (\\d+\\.)(\\d+\\.)(\\d+)/);\n\n\t  if (parsed) {\n\t    return [parsed[1], parsed[2], parsed[3]];\n\t  }\n\n\t  return undefined;\n\t};\n\n\n/***/ },\n/* 24 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar _ = __webpack_require__(4);\n\tvar version = __webpack_require__(22);\n\tvar parseAlgoliaClientVersion = __webpack_require__(23);\n\n\tmodule.exports = function popularIn(index, params, details, options) {\n\t  var algoliaVersion = parseAlgoliaClientVersion(index.as._ua);\n\t  if (algoliaVersion && algoliaVersion[0] >= 3 && algoliaVersion[1] > 20) {\n\t    params = params || {};\n\t    params.additionalUA = 'autocomplete.js ' + version;\n\t  }\n\t  if (!details.source) {\n\t    return _.error(\"Missing 'source' key\");\n\t  }\n\t  var source = _.isFunction(details.source) ? details.source : function(hit) { return hit[details.source]; };\n\n\t  if (!details.index) {\n\t    return _.error(\"Missing 'index' key\");\n\t  }\n\t  var detailsIndex = details.index;\n\n\t  options = options || {};\n\n\t  return sourceFn;\n\n\t  function sourceFn(query, cb) {\n\t    index.search(query, params, function(error, content) {\n\t      if (error) {\n\t        _.error(error.message);\n\t        return;\n\t      }\n\n\t      if (content.hits.length > 0) {\n\t        var first = content.hits[0];\n\n\t        var detailsParams = _.mixin({hitsPerPage: 0}, details);\n\t        delete detailsParams.source; // not a query parameter\n\t        delete detailsParams.index; // not a query parameter\n\n\t        var detailsAlgoliaVersion = parseAlgoliaClientVersion(detailsIndex.as._ua);\n\t        if (detailsAlgoliaVersion && detailsAlgoliaVersion[0] >= 3 && detailsAlgoliaVersion[1] > 20) {\n\t          params.additionalUA = 'autocomplete.js ' + version;\n\t        }\n\n\t        detailsIndex.search(source(first), detailsParams, function(error2, content2) {\n\t          if (error2) {\n\t            _.error(error2.message);\n\t            return;\n\t          }\n\n\t          var suggestions = [];\n\n\t          // add the 'all department' entry before others\n\t          if (options.includeAll) {\n\t            var label = options.allTitle || 'All departments';\n\t            suggestions.push(_.mixin({\n\t              facet: {value: label, count: content2.nbHits}\n\t            }, _.cloneDeep(first)));\n\t          }\n\n\t          // enrich the first hit iterating over the facets\n\t          _.each(content2.facets, function(values, facet) {\n\t            _.each(values, function(count, value) {\n\t              suggestions.push(_.mixin({\n\t                facet: {facet: facet, value: value, count: count}\n\t              }, _.cloneDeep(first)));\n\t            });\n\t          });\n\n\t          // append all other hits\n\t          for (var i = 1; i < content.hits.length; ++i) {\n\t            suggestions.push(content.hits[i]);\n\t          }\n\n\t          cb(suggestions, content);\n\t        });\n\n\t        return;\n\t      }\n\n\t      cb([]);\n\t    });\n\t  }\n\t};\n\n\n/***/ }\n/******/ ])\n});\n;"
  },
  {
    "path": "js/autocomplete.js/examples/basic.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css\">\n    <style>\n      .algolia-autocomplete {\n        width: 100%;\n      }\n      .algolia-autocomplete .aa-input, .algolia-autocomplete .aa-hint {\n        width: 100%;\n      }\n      .algolia-autocomplete .aa-hint {\n        color: #999;\n      }\n      .algolia-autocomplete .aa-dropdown-menu {\n        width: 100%;\n        background-color: #fff;\n        border: 1px solid #999;\n        border-top: none;\n      }\n      .algolia-autocomplete .aa-dropdown-menu .aa-suggestion {\n        cursor: pointer;\n        padding: 5px 4px;\n      }\n      .algolia-autocomplete .aa-dropdown-menu .aa-suggestion.aa-cursor {\n        background-color: #B2D7FF;\n      }\n      .algolia-autocomplete .aa-dropdown-menu .aa-suggestion em {\n        font-weight: bold;\n        font-style: normal;\n      }\n    </style>\n  </head>\n  <body>\n    <div class=\"container\">\n      <div class=\"row\">\n        <div class=\"col-sm-6 col-sm-offset-3\">\n          <form action=\"#\" class=\"form\">\n            <h3>Basic example</h3>\n            <input class=\"form-control\" id=\"search-input\" name=\"contacts\" type=\"text\" placeholder='Search by name' />\n          </form>\n        </div>\n      </div>\n    </div>\n\n    <script src=\"https://cdn.jsdelivr.net/algoliasearch/3/algoliasearch.min.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/autocomplete.js/0/autocomplete.min.js\"></script>\n    <script>\n      var client = algoliasearch('latency', '6be0576ff61c053d5f9a3225e2a90f76');\n      var index = client.initIndex('contacts');\n      autocomplete('#search-input', { hint: false }, [\n        {\n          source: autocomplete.sources.hits(index, { hitsPerPage: 5 }),\n          displayKey: 'name',\n          templates: {\n            suggestion: function(suggestion) {\n              return suggestion._highlightResult.name.value;\n            }\n          }\n        }\n      ]).on('autocomplete:selected', function(event, suggestion, dataset) {\n        console.log(suggestion, dataset);\n        alert('dataset: ' + dataset + ', ' + suggestion.name);\n      });\n    </script>\n  </body>\n</html>\n"
  },
  {
    "path": "js/autocomplete.js/examples/basic_angular.html",
    "content": "<!DOCTYPE html>\n<html ng-app=\"myApp\">\n  <head>\n    <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css\">\n    <style>\n      .algolia-autocomplete {\n        width: 100%;\n      }\n      .algolia-autocomplete .aa-input, .algolia-autocomplete .aa-hint {\n        width: 100%;\n      }\n      .algolia-autocomplete .aa-hint {\n        color: #999;\n      }\n      .algolia-autocomplete .aa-dropdown-menu {\n        width: 100%;\n        background-color: #fff;\n        border: 1px solid #999;\n        border-top: none;\n      }\n      .algolia-autocomplete .aa-dropdown-menu .aa-suggestion {\n        cursor: pointer;\n        padding: 5px 4px;\n      }\n      .algolia-autocomplete .aa-dropdown-menu .aa-suggestion.aa-cursor {\n        background-color: #B2D7FF;\n      }\n      .algolia-autocomplete .aa-dropdown-menu .aa-suggestion em {\n        font-weight: bold;\n        font-style: normal;\n      }\n    </style>\n  </head>\n  <body ng-controller=\"searchController\">\n    <div class=\"container\">\n      <form action=\"#\">\n        <div class=\"autocomplete-wrapper\">\n          <input id=\"contacts\" name=\"contacts\" type=\"text\" ng-model=\"q\" autocomplete aa-datasets=\"getDatasets()\" />\n        </div>\n      </form>\n    </div>\n\n    <script src=\"https://cdn.jsdelivr.net/jquery/2.1.4/jquery.min.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.2/angular.min.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/autocomplete.js/0/autocomplete.angular.min.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/algoliasearch/3/algoliasearch.angular.min.js\"></script>\n    <script>\n    angular.module('myApp', ['algoliasearch', 'algolia.autocomplete']).controller('searchController', ['$scope', 'algolia', function($scope, algolia) {\n      $scope.q = '';\n      var client = algolia.Client('latency', '6be0576ff61c053d5f9a3225e2a90f76');\n      var index = client.initIndex('contacts');\n\n      $scope.getDatasets = function() {\n        return {\n          source: function(q, cb) {\n            index.search(q, { hitsPerPage: 5 }, function(error, content) {\n              if (error) {\n                cb([]);\n                return;\n              }\n              cb(content.hits);\n            });\n          },\n          templates: {\n            suggestion: function(suggestion) {\n              return suggestion._highlightResult.name.value;\n            }\n          }\n        };\n      };\n\n      $scope.$watch('q', function(v) {\n        console.log(v);\n      });\n\n      $scope.$on('autocomplete:selected', function(event, suggestion, dataset) {\n        console.log(suggestion, dataset);\n      });\n    }]);\n    </script>\n  </body>\n</html>\n"
  },
  {
    "path": "js/autocomplete.js/examples/basic_jquery.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css\">\n    <style>\n      .algolia-autocomplete {\n        width: 100%;\n      }\n      .algolia-autocomplete .aa-input, .algolia-autocomplete .aa-hint {\n        width: 100%;\n      }\n      .algolia-autocomplete .aa-hint {\n        color: #999;\n      }\n      .algolia-autocomplete .aa-dropdown-menu {\n        width: 100%;\n        background-color: #fff;\n        border: 1px solid #999;\n        border-top: none;\n      }\n      .algolia-autocomplete .aa-dropdown-menu .aa-suggestion {\n        cursor: pointer;\n        padding: 5px 4px;\n      }\n      .algolia-autocomplete .aa-dropdown-menu .aa-suggestion.aa-cursor {\n        background-color: #B2D7FF;\n      }\n      .algolia-autocomplete .aa-dropdown-menu .aa-suggestion em {\n        font-weight: bold;\n        font-style: normal;\n      }\n    </style>\n  </head>\n  <body>\n    <div class=\"container\">\n      <div class=\"row\">\n        <div class=\"col-sm-6 col-sm-offset-3\">\n          <form action=\"#\" class=\"form\">\n            <h3>Basic example</h3>\n            <input class=\"form-control\" id=\"contacts\" name=\"contacts\" type=\"text\" placeholder='Search by name' />\n          </form>\n        </div>\n      </div>\n    </div>\n\n    <script src=\"https://cdn.jsdelivr.net/jquery/3.2.1/jquery.min.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/autocomplete.js/0/autocomplete.jquery.min.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/algoliasearch/3/algoliasearch.min.js\"></script>\n    <script>\n      var client = algoliasearch('latency', '6be0576ff61c053d5f9a3225e2a90f76');\n      var index = client.initIndex('contacts');\n\n      $('#contacts').autocomplete({ hint: false }, [\n        {\n          source: $.fn.autocomplete.sources.hits(index, { hitsPerPage: 5 }),\n          displayKey: 'name',\n          templates: {\n            suggestion: function(suggestion) {\n              return suggestion._highlightResult.name.value;\n            }\n          }\n        }\n      ]);\n    </script>\n  </body>\n</html>\n"
  },
  {
    "path": "js/autocomplete.js/examples/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n  <title>Autocomplete.js example</title>\n  <style>\n    html {\n      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n    }\n  </style>\n</head>\n<body>\n  Welcome to the Autocomplete.js examples:\n  <ol>\n    <li><a href=\"../examples/basic.html\">Basic example</a></li>\n    <li><a href=\"../examples/basic_angular.html\">Basic Angular.js example</a></li>\n    <li><a href=\"../examples/basic_jquery.html\">Basic jQuery example</a></li>\n    <li><small><a href=\"../test/playground.html\">Test playground</a></small></li>\n    <li><small><a href=\"../test/playground_angular.html\">Test playground (Angular.js)</a></small></li>\n    <li><small><a href=\"../test/playground_jquery.html\">Test playground (jQuery)</a></small></li>  </ol>\n</body>\n</html>\n"
  },
  {
    "path": "js/autocomplete.js/index.js",
    "content": "'use strict';\n\nmodule.exports = require('./src/standalone/');\n"
  },
  {
    "path": "js/autocomplete.js/index_angular.js",
    "content": "'use strict';\n\nmodule.exports = require('./src/angular/directive.js');\n"
  },
  {
    "path": "js/autocomplete.js/index_jquery.js",
    "content": "'use strict';\n\nmodule.exports = require('./src/jquery/plugin.js');\n"
  },
  {
    "path": "js/autocomplete.js/karma.conf.js",
    "content": "'use strict';\n\nmodule.exports = function(config) {\n  config.set({\n    basePath: '',\n\n    frameworks: ['jasmine', 'sinon'],\n\n    reporters: ['progress', 'coverage', 'coveralls'],\n\n    browsers: ['PhantomJS'],\n\n    coverageReporter: {\n      type: 'lcov',\n      dir: 'coverage/'\n    },\n\n    webpack: {\n      devtool: 'inline-source-map',\n      module: {\n        postLoaders: [{\n          test: /\\.js$/,\n          exclude: /(test|node_modules)\\//,\n          loader: 'istanbul-instrumenter'\n        }]\n      }\n    },\n\n    preprocessors: {\n      'test/unit/**/*.js': ['webpack', 'sourcemap']\n    },\n\n    webpackMiddleware: {\n      noInfo: true\n    },\n\n    plugins: [\n      'karma-jasmine',\n      'karma-sinon',\n      'karma-phantomjs-launcher',\n      'karma-chrome-launcher',\n      'karma-opera-launcher',\n      'karma-safari-launcher',\n      'karma-firefox-launcher',\n      'karma-coverage',\n      'karma-coveralls',\n      'karma-sourcemap-loader',\n      'karma-webpack'\n    ],\n\n    files: [\n      './node_modules/es6-promise/dist/es6-promise.auto.js',\n      'test/unit/**/*.js'\n    ]\n  });\n};\n"
  },
  {
    "path": "js/autocomplete.js/package.json",
    "content": "{\n  \"_from\": \"autocomplete.js@^0.38.0\",\n  \"_id\": \"autocomplete.js@0.38.1\",\n  \"_inBundle\": false,\n  \"_integrity\": \"sha512-6pSJzuRMY3pqpozt+SXThl2DmJfma8Bi3SVFbZHS0PW/N72bOUv+Db0jAh2cWOhTsA4X+GNmKvIl8wExJTnN9w==\",\n  \"_location\": \"/autocomplete.js\",\n  \"_phantomChildren\": {},\n  \"_requested\": {\n    \"type\": \"range\",\n    \"registry\": true,\n    \"raw\": \"autocomplete.js@^0.38.0\",\n    \"name\": \"autocomplete.js\",\n    \"escapedName\": \"autocomplete.js\",\n    \"rawSpec\": \"^0.38.0\",\n    \"saveSpec\": null,\n    \"fetchSpec\": \"^0.38.0\"\n  },\n  \"_requiredBy\": [\n    \"#USER\"\n  ],\n  \"_resolved\": \"https://registry.npmjs.org/autocomplete.js/-/autocomplete.js-0.38.1.tgz\",\n  \"_shasum\": \"9b006c985d996165ebbc62af33f5b4c32d209cc2\",\n  \"_spec\": \"autocomplete.js@^0.38.0\",\n  \"_where\": \"/Users/asharirfan/code/wp-algolia/app/public/wp-content/plugins/wp-search-with-algolia-dev\",\n  \"bugs\": {\n    \"url\": \"https://github.com/algolia/autocomplete.js/issues\"\n  },\n  \"bundleDependencies\": false,\n  \"dependencies\": {\n    \"immediate\": \"^3.2.3\"\n  },\n  \"deprecated\": false,\n  \"description\": \"Fast and fully-featured autocomplete library\",\n  \"devDependencies\": {\n    \"angular\": \"^1.6.4\",\n    \"angular-mocks\": \"^1.6.4\",\n    \"babel-eslint\": \"^7.2.3\",\n    \"chai\": \"^3.5.0\",\n    \"colors\": \"^1.1.2\",\n    \"conventional-changelog-cli\": \"^1.3.1\",\n    \"doctoc\": \"^1.3.0\",\n    \"es6-promise\": \"^4.2.8\",\n    \"eslint\": \"1.5.1\",\n    \"eslint-config-airbnb\": \"0.1.0\",\n    \"eslint-config-algolia\": \"3.0.0\",\n    \"execa\": \"^1.0.0\",\n    \"grunt\": \"^1.0.1\",\n    \"grunt-banner\": \"^0.6.0\",\n    \"grunt-cli\": \"1.2.0\",\n    \"grunt-concurrent\": \"^2.3.1\",\n    \"grunt-contrib-clean\": \"^1.1.0\",\n    \"grunt-contrib-concat\": \"^1.0.1\",\n    \"grunt-contrib-connect\": \"^1.0.2\",\n    \"grunt-contrib-uglify\": \"^2.2.0\",\n    \"grunt-contrib-watch\": \"^1.0.0\",\n    \"grunt-eslint\": \"^17.2.0\",\n    \"grunt-exec\": \"^1.0.1\",\n    \"grunt-sed\": \"^0.1.1\",\n    \"grunt-step\": \"^1.0.0\",\n    \"grunt-umd\": \"^2.3.6\",\n    \"grunt-webpack\": \"^1.0.14\",\n    \"istanbul-instrumenter-loader\": \"^1.0.0\",\n    \"jasmine-core\": \"^2.6.2\",\n    \"jasmine-jquery\": \"^2.1.1\",\n    \"jquery\": \"^3.2.1\",\n    \"json\": \"^9.0.6\",\n    \"karma\": \"^1.7.0\",\n    \"karma-chrome-launcher\": \"^2.1.1\",\n    \"karma-coverage\": \"^1.1.1\",\n    \"karma-coveralls\": \"^1.1.2\",\n    \"karma-firefox-launcher\": \"^1.0.1\",\n    \"karma-jasmine\": \"^1.0.2\",\n    \"karma-opera-launcher\": \"^1.0.0\",\n    \"karma-phantomjs-launcher\": \"^1.0.4\",\n    \"karma-safari-launcher\": \"^1.0.0\",\n    \"karma-sinon\": \"^1.0.5\",\n    \"karma-sourcemap-loader\": \"^0.3.7\",\n    \"karma-webpack\": \"^2.0.3\",\n    \"mocha\": \"^3.4.1\",\n    \"mversion\": \"^1.12.0\",\n    \"netlify\": \"^2.0.1\",\n    \"node-static\": \"^0.7.8\",\n    \"phantomjs-prebuilt\": \"^2.1.12\",\n    \"replace-in-file\": \"^3.4.2\",\n    \"semver\": \"^5.3.0\",\n    \"sinon\": \"^1.17.6\",\n    \"webpack\": \"^1.13.2\",\n    \"webpack-dev-server\": \"^1.16.1\",\n    \"yiewd\": \"^0.6.0\"\n  },\n  \"homepage\": \"https://github.com/algolia/autocomplete.js\",\n  \"keywords\": [\n    \"autocomplete\",\n    \"typeahead\"\n  ],\n  \"license\": \"MIT\",\n  \"main\": \"index.js\",\n  \"name\": \"autocomplete.js\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/algolia/autocomplete.js.git\"\n  },\n  \"scripts\": {\n    \"build\": \"grunt\",\n    \"dev\": \"grunt dev\",\n    \"docs:netlify\": \"./scripts/netlify-deploy.js\",\n    \"lint\": \"grunt lint\",\n    \"release\": \"./scripts/release.sh\",\n    \"server\": \"grunt server\",\n    \"test\": \"karma start --single-run && grunt lint\",\n    \"test:ci\": \"./test/ci.sh\",\n    \"test:watch\": \"karma start\"\n  },\n  \"version\": \"0.38.1\"\n}\n"
  },
  {
    "path": "js/autocomplete.js/scripts/netlify-deploy.js",
    "content": "#!/usr/bin/env node\n'use strict';\n/* eslint-disable no-console */\nconst execa = require('execa');\nconst replace = require('replace-in-file');\nconst NetlifyAPI = require('netlify');\n\nconst client = new NetlifyAPI(process.env.NETLIFY_API_KEY);\n\nfunction logStdOut(opts) {\n  console.log(opts.stdout);\n}\n\nif (!process.env.NETLIFY_API_KEY || !process.env.NETLIFY_SITE_ID) {\n  console.warn(\n    'Both NETLIFY_API_KEY and NETLIFY_SITE_ID are required. ' +\n      'They can be found on ' +\n      'https://app.netlify.com/sites/autocompletejs-playgrounds/settings/general' +\n      ' and https://app.netlify.com/account/applications'\n  );\n  process.exit(0);\n}\n\nexeca('yarn', ['build'])\n  .then(logStdOut)\n  .then(() => execa('rm', ['-rf', 'netlify-dist']))\n  .then(() => execa('mkdir', ['-p', 'netlify-dist/examples']))\n  .then(() => execa('cp', ['-r', 'examples', 'netlify-dist']))\n  .then(() => execa('mv', ['netlify-dist/examples/index.html', 'netlify-dist']))\n  .then(() =>\n    replace({\n      files: 'netlify-dist/index.html',\n      from: /href=\"\\.\\./g,\n      to: 'href=\".'\n    })\n  )\n  .then(() => execa('mkdir', ['-p', 'netlify-dist/test']))\n  .then(() =>\n    execa('cp', [\n      'test/playground.css',\n      'test/playground.html',\n      'test/playground_angular.html',\n      'test/playground_jquery.html',\n      'netlify-dist/test'\n    ])\n  )\n  .then(() => execa('cp', ['-r', 'dist', 'netlify-dist']))\n  .then(() =>\n    replace({\n      files: [\n        'netlify-dist/examples/basic.html',\n        'netlify-dist/examples/basic_angular.html',\n        'netlify-dist/examples/basic_jquery.html'\n      ],\n      from: /https:\\/\\/cdn.jsdelivr.net\\/autocomplete.js\\/0/g,\n      to: '../dist'\n    })\n  )\n  .then(() =>\n    client.deploy(process.env.NETLIFY_SITE_ID, 'netlify-dist', {\n      draft: true,\n      message: process.env.TRAVIS_COMMIT_MESSAGE || ''\n    })\n  )\n  .then(({deploy: {id, name, deploy_ssl_url: url}}) =>\n    console.log(\n      '🕸　site is available at ' +\n        url +\n        '\\n\\n' +\n        'Deploy details available at https://app.netlify.com/sites/' +\n        name +\n        '/deploys/' +\n        id\n    )\n  );\n\n"
  },
  {
    "path": "js/autocomplete.js/scripts/release.sh",
    "content": "#!/usr/bin/env bash\n\nfunction error_exit\n{\n\techo \"release: $1\" 1>&2\n\texit 1\n}\n\nif [[ $# -eq 0 ]] ; then\n  error_exit \"use ``npm run release [major|minor|patch|x.x.x]``\"\nfi\n\ncurrentVersion=$(json -f package.json version)\n\nif [[ $1 != 'patch' && $1 != 'minor' && $1 != 'major' ]]\nthen\n  nextVersion=$1\nelse\n  nextVersion=$(semver $currentVersion -i $1)\nfi\n\nsemver $nextVersion -r \">$currentVersion\" ||\nerror_exit \"Cannot bump from $currentVersion to $nextVersion\"\n\nif ! npm owner ls | grep -q \"$(npm whoami)\"\nthen\n  error_exit \"Not an owner of the npm repo, ask for it\"\nfi\n\ncurrentBranch=$(git rev-parse --abbrev-ref HEAD)\nif [[ $currentBranch != 'master' ]]; then\n  error_exit \"You must be on master branch\"\nfi\n\nif [[ -n $(git status --porcelain) ]]; then\n  error_exit \"Release: Working tree is not clean (git status)\"\nfi\n\necho \"module.exports = \\\"${nextVersion}\\\";\" > version.js\n\nyarn &&\nmversion $nextVersion &&\nyarn build &&\nconventional-changelog --infile CHANGELOG.md --same-file --preset angular &&\ndoctoc --notitle --maxlevel 3 README.md &&\ngit add README.md CHANGELOG.md package.json bower.json version.js dist/ &&\ngit commit -m $nextVersion &&\ngit tag v$nextVersion &&\ngit push &&\ngit push --tags &&\nnpm publish || error_exit \"Something went wrong, check log, be careful and start over\"\n"
  },
  {
    "path": "js/autocomplete.js/src/angular/directive.js",
    "content": "'use strict';\n\nvar angular = require('angular');\n\n// setup DOM element\nvar DOM = require('../common/dom.js');\nDOM.element = angular.element;\n\n// setup utils functions\nvar _ = require('../common/utils.js');\n_.isArray = angular.isArray;\n_.isFunction = angular.isFunction;\n_.isObject = angular.isObject;\n_.bind = angular.element.proxy;\n_.each = angular.forEach;\n_.map = angular.element.map;\n_.mixin = angular.extend;\n_.Event = angular.element.Event;\n\nvar EventBus = require('../autocomplete/event_bus.js');\nvar Typeahead = require('../autocomplete/typeahead.js');\n\nangular.module('algolia.autocomplete', [])\n  .directive('autocomplete', ['$parse', '$injector', function($parse, $injector) {\n    // inject the sources in the algolia namespace if available\n    try {\n      $injector.get('algolia').sources = Typeahead.sources;\n      $injector.get('algolia').escapeHighlightedString = _.escapeHighlightedString;\n    } catch (e) {\n      // not fatal\n    }\n\n    return {\n      restrict: 'AC', // Only apply on an attribute or class\n      scope: {\n        options: '&aaOptions',\n        datasets: '&aaDatasets'\n      },\n      link: function(scope, element, attrs) {\n        if (!element.hasClass('autocomplete') && attrs.autocomplete !== '') return;\n        attrs = attrs; // no-unused-vars\n        scope.options = $parse(scope.options)(scope);\n        if (!scope.options) {\n          scope.options = {};\n        }\n        scope.datasets = $parse(scope.datasets)(scope);\n        if (scope.datasets && !angular.isArray(scope.datasets)) {\n          scope.datasets = [scope.datasets];\n        }\n\n        var eventBus = new EventBus({el: element});\n        var autocomplete = null;\n\n        // reinitialization watchers\n        scope.$watch('options', initialize);\n        if (angular.isArray(scope.datasets)) {\n          scope.$watchCollection('datasets', initialize);\n        } else {\n          scope.$watch('datasets', initialize);\n        }\n\n        // init function\n        function initialize() {\n          if (autocomplete) {\n            autocomplete.destroy();\n          }\n          autocomplete = new Typeahead({\n            input: element,\n            dropdownMenuContainer: scope.options.dropdownMenuContainer,\n            eventBus: eventBus,\n            hint: scope.options.hint,\n            minLength: scope.options.minLength,\n            autoselect: scope.options.autoselect,\n            autoselectOnBlur: scope.options.autoselectOnBlur,\n            tabAutocomplete: scope.options.tabAutocomplete,\n            openOnFocus: scope.options.openOnFocus,\n            templates: scope.options.templates,\n            debug: scope.options.debug,\n            clearOnSelected: scope.options.clearOnSelected,\n            cssClasses: scope.options.cssClasses,\n            datasets: scope.datasets,\n            keyboardShortcuts: scope.options.keyboardShortcuts,\n            appendTo: scope.options.appendTo,\n            autoWidth: scope.options.autoWidth\n          });\n        }\n\n        // Propagate the selected event\n        element.bind('autocomplete:selected', function(object, suggestion, dataset) {\n          scope.$emit('autocomplete:selected', suggestion, dataset);\n        });\n\n        // Propagate the autocompleted event\n        element.bind('autocomplete:autocompleted', function(object, suggestion, dataset) {\n          scope.$emit('autocomplete:autocompleted', suggestion, dataset);\n        });\n\n        // Propagate the opened event\n        element.bind('autocomplete:opened', function() {\n          scope.$emit('autocomplete:opened');\n        });\n\n        // Propagate the closed event\n        element.bind('autocomplete:closed', function() {\n          scope.$emit('autocomplete:closed');\n        });\n\n        // Propagate the cursorchanged event\n        element.bind('autocomplete:cursorchanged', function(event, suggestion, dataset) {\n          scope.$emit('autocomplete:cursorchanged', event, suggestion, dataset);\n        });\n      }\n    };\n  }]);\n"
  },
  {
    "path": "js/autocomplete.js/src/autocomplete/css.js",
    "content": "'use strict';\n\nvar _ = require('../common/utils.js');\n\nvar css = {\n  wrapper: {\n    position: 'relative',\n    display: 'inline-block'\n  },\n  hint: {\n    position: 'absolute',\n    top: '0',\n    left: '0',\n    borderColor: 'transparent',\n    boxShadow: 'none',\n    // #741: fix hint opacity issue on iOS\n    opacity: '1'\n  },\n  input: {\n    position: 'relative',\n    verticalAlign: 'top',\n    backgroundColor: 'transparent'\n  },\n  inputWithNoHint: {\n    position: 'relative',\n    verticalAlign: 'top'\n  },\n  dropdown: {\n    position: 'absolute',\n    top: '100%',\n    left: '0',\n    zIndex: '100',\n    display: 'none'\n  },\n  suggestions: {\n    display: 'block'\n  },\n  suggestion: {\n    whiteSpace: 'nowrap',\n    cursor: 'pointer'\n  },\n  suggestionChild: {\n    whiteSpace: 'normal'\n  },\n  ltr: {\n    left: '0',\n    right: 'auto'\n  },\n  rtl: {\n    left: 'auto',\n    right: '0'\n  },\n  defaultClasses: {\n    root: 'algolia-autocomplete',\n    prefix: 'aa',\n    noPrefix: false,\n    dropdownMenu: 'dropdown-menu',\n    input: 'input',\n    hint: 'hint',\n    suggestions: 'suggestions',\n    suggestion: 'suggestion',\n    cursor: 'cursor',\n    dataset: 'dataset',\n    empty: 'empty'\n  },\n  // will be merged with the default ones if appendTo is used\n  appendTo: {\n    wrapper: {\n      position: 'absolute',\n      zIndex: '100',\n      display: 'none'\n    },\n    input: {},\n    inputWithNoHint: {},\n    dropdown: {\n      display: 'block'\n    }\n  }\n};\n\n// ie specific styling\nif (_.isMsie()) {\n  // ie6-8 (and 9?) doesn't fire hover and click events for elements with\n  // transparent backgrounds, for a workaround, use 1x1 transparent gif\n  _.mixin(css.input, {\n    backgroundImage: 'url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)'\n  });\n}\n\n// ie7 and under specific styling\nif (_.isMsie() && _.isMsie() <= 7) {\n  // if someone can tell me why this is necessary to align\n  // the hint with the query in ie7, i'll send you $5 - @JakeHarding\n  _.mixin(css.input, {marginTop: '-1px'});\n}\n\nmodule.exports = css;\n"
  },
  {
    "path": "js/autocomplete.js/src/autocomplete/dataset.js",
    "content": "'use strict';\n\nvar datasetKey = 'aaDataset';\nvar valueKey = 'aaValue';\nvar datumKey = 'aaDatum';\n\nvar _ = require('../common/utils.js');\nvar DOM = require('../common/dom.js');\nvar html = require('./html.js');\nvar css = require('./css.js');\nvar EventEmitter = require('./event_emitter.js');\n\n// constructor\n// -----------\n\nfunction Dataset(o) {\n  o = o || {};\n  o.templates = o.templates || {};\n\n  if (!o.source) {\n    _.error('missing source');\n  }\n\n  if (o.name && !isValidName(o.name)) {\n    _.error('invalid dataset name: ' + o.name);\n  }\n\n  // tracks the last query the dataset was updated for\n  this.query = null;\n  this._isEmpty = true;\n\n  this.highlight = !!o.highlight;\n  this.name = typeof o.name === 'undefined' || o.name === null ? _.getUniqueId() : o.name;\n\n  this.source = o.source;\n  this.displayFn = getDisplayFn(o.display || o.displayKey);\n\n  this.debounce = o.debounce;\n\n  this.cache = o.cache !== false;\n\n  this.templates = getTemplates(o.templates, this.displayFn);\n\n  this.css = _.mixin({}, css, o.appendTo ? css.appendTo : {});\n  this.cssClasses = o.cssClasses = _.mixin({}, css.defaultClasses, o.cssClasses || {});\n  this.cssClasses.prefix =\n    o.cssClasses.formattedPrefix || _.formatPrefix(this.cssClasses.prefix, this.cssClasses.noPrefix);\n\n  var clazz = _.className(this.cssClasses.prefix, this.cssClasses.dataset);\n  this.$el = o.$menu && o.$menu.find(clazz + '-' + this.name).length > 0 ?\n    DOM.element(o.$menu.find(clazz + '-' + this.name)[0]) :\n    DOM.element(\n      html.dataset.replace('%CLASS%', this.name)\n        .replace('%PREFIX%', this.cssClasses.prefix)\n        .replace('%DATASET%', this.cssClasses.dataset)\n    );\n\n  this.$menu = o.$menu;\n  this.clearCachedSuggestions();\n}\n\n// static methods\n// --------------\n\nDataset.extractDatasetName = function extractDatasetName(el) {\n  return DOM.element(el).data(datasetKey);\n};\n\nDataset.extractValue = function extractValue(el) {\n  return DOM.element(el).data(valueKey);\n};\n\nDataset.extractDatum = function extractDatum(el) {\n  var datum = DOM.element(el).data(datumKey);\n  if (typeof datum === 'string') {\n    // Zepto has an automatic deserialization of the\n    // JSON encoded data attribute\n    datum = JSON.parse(datum);\n  }\n  return datum;\n};\n\n// instance methods\n// ----------------\n\n_.mixin(Dataset.prototype, EventEmitter, {\n\n  // ### private\n\n  _render: function render(query, suggestions) {\n    if (!this.$el) {\n      return;\n    }\n    var that = this;\n\n    var hasSuggestions;\n    var renderArgs = [].slice.call(arguments, 2);\n    this.$el.empty();\n\n    hasSuggestions = suggestions && suggestions.length;\n    this._isEmpty = !hasSuggestions;\n\n    if (!hasSuggestions && this.templates.empty) {\n      this.$el\n        .html(getEmptyHtml.apply(this, renderArgs))\n        .prepend(that.templates.header ? getHeaderHtml.apply(this, renderArgs) : null)\n        .append(that.templates.footer ? getFooterHtml.apply(this, renderArgs) : null);\n    } else if (hasSuggestions) {\n      this.$el\n        .html(getSuggestionsHtml.apply(this, renderArgs))\n        .prepend(that.templates.header ? getHeaderHtml.apply(this, renderArgs) : null)\n        .append(that.templates.footer ? getFooterHtml.apply(this, renderArgs) : null);\n    } else if (suggestions && !Array.isArray(suggestions)) {\n      throw new TypeError('suggestions must be an array');\n    }\n\n    if (this.$menu) {\n      this.$menu.addClass(\n        this.cssClasses.prefix + (hasSuggestions ? 'with' : 'without') + '-' + this.name\n      ).removeClass(\n        this.cssClasses.prefix + (hasSuggestions ? 'without' : 'with') + '-' + this.name\n      );\n    }\n\n    this.trigger('rendered', query);\n\n    function getEmptyHtml() {\n      var args = [].slice.call(arguments, 0);\n      args = [{query: query, isEmpty: true}].concat(args);\n      return that.templates.empty.apply(this, args);\n    }\n\n    function getSuggestionsHtml() {\n      var args = [].slice.call(arguments, 0);\n      var $suggestions;\n      var nodes;\n      var self = this;\n\n      var suggestionsHtml = html.suggestions.\n        replace('%PREFIX%', this.cssClasses.prefix).\n        replace('%SUGGESTIONS%', this.cssClasses.suggestions);\n      $suggestions = DOM\n        .element(suggestionsHtml)\n        .css(this.css.suggestions);\n\n      // jQuery#append doesn't support arrays as the first argument\n      // until version 1.8, see http://bugs.jquery.com/ticket/11231\n      nodes = _.map(suggestions, getSuggestionNode);\n      $suggestions.append.apply($suggestions, nodes);\n\n      return $suggestions;\n\n      function getSuggestionNode(suggestion) {\n        var $el;\n\n        var suggestionHtml = html.suggestion.\n          replace('%PREFIX%', self.cssClasses.prefix).\n          replace('%SUGGESTION%', self.cssClasses.suggestion);\n        $el = DOM.element(suggestionHtml)\n          .attr({\n            role: 'option',\n            id: ['option', Math.floor(Math.random() * 100000000)].join('-')\n          })\n          .append(that.templates.suggestion.apply(this, [suggestion].concat(args)));\n\n        $el.data(datasetKey, that.name);\n        $el.data(valueKey, that.displayFn(suggestion) || undefined); // this led to undefined return value\n        $el.data(datumKey, JSON.stringify(suggestion));\n        $el.children().each(function() { DOM.element(this).css(self.css.suggestionChild); });\n\n        return $el;\n      }\n    }\n\n    function getHeaderHtml() {\n      var args = [].slice.call(arguments, 0);\n      args = [{query: query, isEmpty: !hasSuggestions}].concat(args);\n      return that.templates.header.apply(this, args);\n    }\n\n    function getFooterHtml() {\n      var args = [].slice.call(arguments, 0);\n      args = [{query: query, isEmpty: !hasSuggestions}].concat(args);\n      return that.templates.footer.apply(this, args);\n    }\n  },\n\n  // ### public\n\n  getRoot: function getRoot() {\n    return this.$el;\n  },\n\n  update: function update(query) {\n    function handleSuggestions(suggestions) {\n      // if the update has been canceled or if the query has changed\n      // do not render the suggestions as they've become outdated\n      if (!this.canceled && query === this.query) {\n        // concat all the other arguments that could have been passed\n        // to the render function, and forward them to _render\n        var extraArgs = [].slice.call(arguments, 1);\n        this.cacheSuggestions(query, suggestions, extraArgs);\n        this._render.apply(this, [query, suggestions].concat(extraArgs));\n      }\n    }\n\n    this.query = query;\n    this.canceled = false;\n\n    if (this.shouldFetchFromCache(query)) {\n      handleSuggestions.apply(this, [this.cachedSuggestions].concat(this.cachedRenderExtraArgs));\n    } else {\n      var that = this;\n      var execSource = function() {\n        // When the call is debounced the condition avoid to do a useless\n        // request with the last character when the input has been cleared\n        if (!that.canceled) {\n          that.source(query, handleSuggestions.bind(that));\n        }\n      };\n\n      if (this.debounce) {\n        var later = function() {\n          that.debounceTimeout = null;\n          execSource();\n        };\n        clearTimeout(this.debounceTimeout);\n        this.debounceTimeout = setTimeout(later, this.debounce);\n      } else {\n        execSource();\n      }\n    }\n  },\n\n  cacheSuggestions: function cacheSuggestions(query, suggestions, extraArgs) {\n    this.cachedQuery = query;\n    this.cachedSuggestions = suggestions;\n    this.cachedRenderExtraArgs = extraArgs;\n  },\n\n  shouldFetchFromCache: function shouldFetchFromCache(query) {\n    return this.cache &&\n      this.cachedQuery === query &&\n      this.cachedSuggestions &&\n      this.cachedSuggestions.length;\n  },\n\n  clearCachedSuggestions: function clearCachedSuggestions() {\n    delete this.cachedQuery;\n    delete this.cachedSuggestions;\n    delete this.cachedRenderExtraArgs;\n  },\n\n  cancel: function cancel() {\n    this.canceled = true;\n  },\n\n  clear: function clear() {\n    if (this.$el) {\n      this.cancel();\n      this.$el.empty();\n      this.trigger('rendered', '');\n    }\n  },\n\n  isEmpty: function isEmpty() {\n    return this._isEmpty;\n  },\n\n  destroy: function destroy() {\n    this.clearCachedSuggestions();\n    this.$el = null;\n  }\n});\n\n// helper functions\n// ----------------\n\nfunction getDisplayFn(display) {\n  display = display || 'value';\n\n  return _.isFunction(display) ? display : displayFn;\n\n  function displayFn(obj) {\n    return obj[display];\n  }\n}\n\nfunction getTemplates(templates, displayFn) {\n  return {\n    empty: templates.empty && _.templatify(templates.empty),\n    header: templates.header && _.templatify(templates.header),\n    footer: templates.footer && _.templatify(templates.footer),\n    suggestion: templates.suggestion || suggestionTemplate\n  };\n\n  function suggestionTemplate(context) {\n    return '<p>' + displayFn(context) + '</p>';\n  }\n}\n\nfunction isValidName(str) {\n  // dashes, underscores, letters, and numbers\n  return (/^[_a-zA-Z0-9-]+$/).test(str);\n}\n\nmodule.exports = Dataset;\n"
  },
  {
    "path": "js/autocomplete.js/src/autocomplete/dropdown.js",
    "content": "'use strict';\n\nvar _ = require('../common/utils.js');\nvar DOM = require('../common/dom.js');\nvar EventEmitter = require('./event_emitter.js');\nvar Dataset = require('./dataset.js');\nvar css = require('./css.js');\n\n// constructor\n// -----------\n\nfunction Dropdown(o) {\n  var that = this;\n  var onSuggestionClick;\n  var onSuggestionMouseEnter;\n  var onSuggestionMouseLeave;\n\n  o = o || {};\n\n  if (!o.menu) {\n    _.error('menu is required');\n  }\n\n  if (!_.isArray(o.datasets) && !_.isObject(o.datasets)) {\n    _.error('1 or more datasets required');\n  }\n  if (!o.datasets) {\n    _.error('datasets is required');\n  }\n\n  this.isOpen = false;\n  this.isEmpty = true;\n  this.minLength = o.minLength || 0;\n  this.templates = {};\n  this.appendTo = o.appendTo || false;\n  this.css = _.mixin({}, css, o.appendTo ? css.appendTo : {});\n  this.cssClasses = o.cssClasses = _.mixin({}, css.defaultClasses, o.cssClasses || {});\n  this.cssClasses.prefix =\n    o.cssClasses.formattedPrefix || _.formatPrefix(this.cssClasses.prefix, this.cssClasses.noPrefix);\n\n  // bound functions\n  onSuggestionClick = _.bind(this._onSuggestionClick, this);\n  onSuggestionMouseEnter = _.bind(this._onSuggestionMouseEnter, this);\n  onSuggestionMouseLeave = _.bind(this._onSuggestionMouseLeave, this);\n\n  var cssClass = _.className(this.cssClasses.prefix, this.cssClasses.suggestion);\n  this.$menu = DOM.element(o.menu)\n    .on('mouseenter.aa', cssClass, onSuggestionMouseEnter)\n    .on('mouseleave.aa', cssClass, onSuggestionMouseLeave)\n    .on('click.aa', cssClass, onSuggestionClick);\n\n  this.$container = o.appendTo ? o.wrapper : this.$menu;\n\n  if (o.templates && o.templates.header) {\n    this.templates.header = _.templatify(o.templates.header);\n    this.$menu.prepend(this.templates.header());\n  }\n\n  if (o.templates && o.templates.empty) {\n    this.templates.empty = _.templatify(o.templates.empty);\n    this.$empty = DOM.element('<div class=\"' +\n      _.className(this.cssClasses.prefix, this.cssClasses.empty, true) + '\">' +\n      '</div>');\n    this.$menu.append(this.$empty);\n    this.$empty.hide();\n  }\n\n  this.datasets = _.map(o.datasets, function(oDataset) {\n    return initializeDataset(that.$menu, oDataset, o.cssClasses);\n  });\n  _.each(this.datasets, function(dataset) {\n    var root = dataset.getRoot();\n    if (root && root.parent().length === 0) {\n      that.$menu.append(root);\n    }\n    dataset.onSync('rendered', that._onRendered, that);\n  });\n\n  if (o.templates && o.templates.footer) {\n    this.templates.footer = _.templatify(o.templates.footer);\n    this.$menu.append(this.templates.footer());\n  }\n\n  var self = this;\n  DOM.element(window).resize(function() {\n    self._redraw();\n  });\n}\n\n// instance methods\n// ----------------\n\n_.mixin(Dropdown.prototype, EventEmitter, {\n\n  // ### private\n\n  _onSuggestionClick: function onSuggestionClick($e) {\n    this.trigger('suggestionClicked', DOM.element($e.currentTarget));\n  },\n\n  _onSuggestionMouseEnter: function onSuggestionMouseEnter($e) {\n    var elt = DOM.element($e.currentTarget);\n    if (elt.hasClass(_.className(this.cssClasses.prefix, this.cssClasses.cursor, true))) {\n      // we're already on the cursor\n      // => we're probably entering it again after leaving it for a nested div\n      return;\n    }\n    this._removeCursor();\n\n    // Fixes iOS double tap behaviour, by modifying the DOM right before the\n    // native href clicks happens, iOS will requires another tap to follow\n    // a suggestion that has an <a href> element inside\n    // https://www.google.com/search?q=ios+double+tap+bug+href\n    var suggestion = this;\n    setTimeout(function() {\n      // this exact line, when inside the main loop, will trigger a double tap bug\n      // on iOS devices\n      suggestion._setCursor(elt, false);\n    }, 0);\n  },\n\n  _onSuggestionMouseLeave: function onSuggestionMouseLeave($e) {\n    // $e.relatedTarget is the `EventTarget` the pointing device entered to\n    if ($e.relatedTarget) {\n      var elt = DOM.element($e.relatedTarget);\n      if (elt.closest('.' + _.className(this.cssClasses.prefix, this.cssClasses.cursor, true)).length > 0) {\n        // our father is a cursor\n        // => it means we're just leaving the suggestion for a nested div\n        return;\n      }\n    }\n    this._removeCursor();\n    this.trigger('cursorRemoved');\n  },\n\n  _onRendered: function onRendered(e, query) {\n    this.isEmpty = _.every(this.datasets, isDatasetEmpty);\n\n    if (this.isEmpty) {\n      if (query.length >= this.minLength) {\n        this.trigger('empty');\n      }\n\n      if (this.$empty) {\n        if (query.length < this.minLength) {\n          this._hide();\n        } else {\n          var html = this.templates.empty({\n            query: this.datasets[0] && this.datasets[0].query\n          });\n          this.$empty.html(html);\n          this.$empty.show();\n          this._show();\n        }\n      } else if (_.any(this.datasets, hasEmptyTemplate)) {\n        if (query.length < this.minLength) {\n          this._hide();\n        } else {\n          this._show();\n        }\n      } else {\n        this._hide();\n      }\n    } else if (this.isOpen) {\n      if (this.$empty) {\n        this.$empty.empty();\n        this.$empty.hide();\n      }\n\n      if (query.length >= this.minLength) {\n        this._show();\n      } else {\n        this._hide();\n      }\n    }\n\n    this.trigger('datasetRendered');\n\n    function isDatasetEmpty(dataset) {\n      return dataset.isEmpty();\n    }\n\n    function hasEmptyTemplate(dataset) {\n      return dataset.templates && dataset.templates.empty;\n    }\n  },\n\n  _hide: function() {\n    this.$container.hide();\n  },\n\n  _show: function() {\n    // can't use jQuery#show because $menu is a span element we want\n    // display: block; not dislay: inline;\n    this.$container.css('display', 'block');\n\n    this._redraw();\n\n    this.trigger('shown');\n  },\n\n  _redraw: function redraw() {\n    if (!this.isOpen || !this.appendTo) return;\n\n    this.trigger('redrawn');\n  },\n\n  _getSuggestions: function getSuggestions() {\n    return this.$menu.find(_.className(this.cssClasses.prefix, this.cssClasses.suggestion));\n  },\n\n  _getCursor: function getCursor() {\n    return this.$menu.find(_.className(this.cssClasses.prefix, this.cssClasses.cursor)).first();\n  },\n\n  _setCursor: function setCursor($el, updateInput) {\n    $el.first()\n      .addClass(_.className(this.cssClasses.prefix, this.cssClasses.cursor, true))\n      .attr('aria-selected', 'true');\n    this.trigger('cursorMoved', updateInput);\n  },\n\n  _removeCursor: function removeCursor() {\n    this._getCursor()\n      .removeClass(_.className(this.cssClasses.prefix, this.cssClasses.cursor, true))\n      .removeAttr('aria-selected');\n  },\n\n  _moveCursor: function moveCursor(increment) {\n    var $suggestions;\n    var $oldCursor;\n    var newCursorIndex;\n    var $newCursor;\n\n    if (!this.isOpen) {\n      return;\n    }\n\n    $oldCursor = this._getCursor();\n    $suggestions = this._getSuggestions();\n\n    this._removeCursor();\n\n    // shifting before and after modulo to deal with -1 index\n    newCursorIndex = $suggestions.index($oldCursor) + increment;\n    newCursorIndex = (newCursorIndex + 1) % ($suggestions.length + 1) - 1;\n\n    if (newCursorIndex === -1) {\n      this.trigger('cursorRemoved');\n\n      return;\n    } else if (newCursorIndex < -1) {\n      newCursorIndex = $suggestions.length - 1;\n    }\n\n    this._setCursor($newCursor = $suggestions.eq(newCursorIndex), true);\n\n    // in the case of scrollable overflow\n    // make sure the cursor is visible in the menu\n    this._ensureVisible($newCursor);\n  },\n\n  _ensureVisible: function ensureVisible($el) {\n    var elTop;\n    var elBottom;\n    var menuScrollTop;\n    var menuHeight;\n\n    elTop = $el.position().top;\n    elBottom = elTop + $el.height() +\n      parseInt($el.css('margin-top'), 10) +\n      parseInt($el.css('margin-bottom'), 10);\n    menuScrollTop = this.$menu.scrollTop();\n    menuHeight = this.$menu.height() +\n      parseInt(this.$menu.css('padding-top'), 10) +\n      parseInt(this.$menu.css('padding-bottom'), 10);\n\n    if (elTop < 0) {\n      this.$menu.scrollTop(menuScrollTop + elTop);\n    } else if (menuHeight < elBottom) {\n      this.$menu.scrollTop(menuScrollTop + (elBottom - menuHeight));\n    }\n  },\n\n  // ### public\n\n  close: function close() {\n    if (this.isOpen) {\n      this.isOpen = false;\n\n      this._removeCursor();\n      this._hide();\n\n      this.trigger('closed');\n    }\n  },\n\n  open: function open() {\n    if (!this.isOpen) {\n      this.isOpen = true;\n\n      if (!this.isEmpty) {\n        this._show();\n      }\n\n      this.trigger('opened');\n    }\n  },\n\n  setLanguageDirection: function setLanguageDirection(dir) {\n    this.$menu.css(dir === 'ltr' ? this.css.ltr : this.css.rtl);\n  },\n\n  moveCursorUp: function moveCursorUp() {\n    this._moveCursor(-1);\n  },\n\n  moveCursorDown: function moveCursorDown() {\n    this._moveCursor(+1);\n  },\n\n  getDatumForSuggestion: function getDatumForSuggestion($el) {\n    var datum = null;\n\n    if ($el.length) {\n      datum = {\n        raw: Dataset.extractDatum($el),\n        value: Dataset.extractValue($el),\n        datasetName: Dataset.extractDatasetName($el)\n      };\n    }\n\n    return datum;\n  },\n\n  getCurrentCursor: function getCurrentCursor() {\n    return this._getCursor().first();\n  },\n\n  getDatumForCursor: function getDatumForCursor() {\n    return this.getDatumForSuggestion(this._getCursor().first());\n  },\n\n  getDatumForTopSuggestion: function getDatumForTopSuggestion() {\n    return this.getDatumForSuggestion(this._getSuggestions().first());\n  },\n\n  cursorTopSuggestion: function cursorTopSuggestion() {\n    this._setCursor(this._getSuggestions().first(), false);\n  },\n\n  update: function update(query) {\n    _.each(this.datasets, updateDataset);\n\n    function updateDataset(dataset) {\n      dataset.update(query);\n    }\n  },\n\n  empty: function empty() {\n    _.each(this.datasets, clearDataset);\n    this.isEmpty = true;\n\n    function clearDataset(dataset) {\n      dataset.clear();\n    }\n  },\n\n  isVisible: function isVisible() {\n    return this.isOpen && !this.isEmpty;\n  },\n\n  destroy: function destroy() {\n    this.$menu.off('.aa');\n\n    this.$menu = null;\n\n    _.each(this.datasets, destroyDataset);\n\n    function destroyDataset(dataset) {\n      dataset.destroy();\n    }\n  }\n});\n\n// helper functions\n// ----------------\nDropdown.Dataset = Dataset;\n\nfunction initializeDataset($menu, oDataset, cssClasses) {\n  return new Dropdown.Dataset(_.mixin({$menu: $menu, cssClasses: cssClasses}, oDataset));\n}\n\nmodule.exports = Dropdown;\n"
  },
  {
    "path": "js/autocomplete.js/src/autocomplete/event_bus.js",
    "content": "'use strict';\n\nvar namespace = 'autocomplete:';\n\nvar _ = require('../common/utils.js');\nvar DOM = require('../common/dom.js');\n\n// constructor\n// -----------\n\nfunction EventBus(o) {\n  if (!o || !o.el) {\n    _.error('EventBus initialized without el');\n  }\n\n  this.$el = DOM.element(o.el);\n}\n\n// instance methods\n// ----------------\n\n_.mixin(EventBus.prototype, {\n\n  // ### public\n\n  trigger: function(type, suggestion, dataset, context) {\n    var event = _.Event(namespace + type);\n    this.$el.trigger(event, [suggestion, dataset, context]);\n    return event;\n  }\n});\n\nmodule.exports = EventBus;\n"
  },
  {
    "path": "js/autocomplete.js/src/autocomplete/event_emitter.js",
    "content": "'use strict';\n\nvar immediate = require('immediate');\nvar splitter = /\\s+/;\n\nmodule.exports = {\n  onSync: onSync,\n  onAsync: onAsync,\n  off: off,\n  trigger: trigger\n};\n\nfunction on(method, types, cb, context) {\n  var type;\n\n  if (!cb) {\n    return this;\n  }\n\n  types = types.split(splitter);\n  cb = context ? bindContext(cb, context) : cb;\n\n  this._callbacks = this._callbacks || {};\n\n  while (type = types.shift()) {\n    this._callbacks[type] = this._callbacks[type] || {sync: [], async: []};\n    this._callbacks[type][method].push(cb);\n  }\n\n  return this;\n}\n\nfunction onAsync(types, cb, context) {\n  return on.call(this, 'async', types, cb, context);\n}\n\nfunction onSync(types, cb, context) {\n  return on.call(this, 'sync', types, cb, context);\n}\n\nfunction off(types) {\n  var type;\n\n  if (!this._callbacks) {\n    return this;\n  }\n\n  types = types.split(splitter);\n\n  while (type = types.shift()) {\n    delete this._callbacks[type];\n  }\n\n  return this;\n}\n\nfunction trigger(types) {\n  var type;\n  var callbacks;\n  var args;\n  var syncFlush;\n  var asyncFlush;\n\n  if (!this._callbacks) {\n    return this;\n  }\n\n  types = types.split(splitter);\n  args = [].slice.call(arguments, 1);\n\n  while ((type = types.shift()) && (callbacks = this._callbacks[type])) { // eslint-disable-line\n    syncFlush = getFlush(callbacks.sync, this, [type].concat(args));\n    asyncFlush = getFlush(callbacks.async, this, [type].concat(args));\n\n    if (syncFlush()) {\n      immediate(asyncFlush);\n    }\n  }\n\n  return this;\n}\n\nfunction getFlush(callbacks, context, args) {\n  return flush;\n\n  function flush() {\n    var cancelled;\n\n    for (var i = 0, len = callbacks.length; !cancelled && i < len; i += 1) {\n      // only cancel if the callback explicitly returns false\n      cancelled = callbacks[i].apply(context, args) === false;\n    }\n\n    return !cancelled;\n  }\n}\n\nfunction bindContext(fn, context) {\n  return fn.bind ?\n    fn.bind(context) :\n    function() { fn.apply(context, [].slice.call(arguments, 0)); };\n}\n"
  },
  {
    "path": "js/autocomplete.js/src/autocomplete/html.js",
    "content": "'use strict';\n\nmodule.exports = {\n  wrapper: '<span class=\"%ROOT%\"></span>',\n  dropdown: '<span class=\"%PREFIX%%DROPDOWN_MENU%\"></span>',\n  dataset: '<div class=\"%PREFIX%%DATASET%-%CLASS%\"></div>',\n  suggestions: '<span class=\"%PREFIX%%SUGGESTIONS%\"></span>',\n  suggestion: '<div class=\"%PREFIX%%SUGGESTION%\"></div>'\n};\n"
  },
  {
    "path": "js/autocomplete.js/src/autocomplete/input.js",
    "content": "'use strict';\n\nvar specialKeyCodeMap;\n\nspecialKeyCodeMap = {\n  9: 'tab',\n  27: 'esc',\n  37: 'left',\n  39: 'right',\n  13: 'enter',\n  38: 'up',\n  40: 'down'\n};\n\nvar _ = require('../common/utils.js');\nvar DOM = require('../common/dom.js');\nvar EventEmitter = require('./event_emitter.js');\n\n// constructor\n// -----------\n\nfunction Input(o) {\n  var that = this;\n  var onBlur;\n  var onFocus;\n  var onKeydown;\n  var onInput;\n\n  o = o || {};\n\n  if (!o.input) {\n    _.error('input is missing');\n  }\n\n  // bound functions\n  onBlur = _.bind(this._onBlur, this);\n  onFocus = _.bind(this._onFocus, this);\n  onKeydown = _.bind(this._onKeydown, this);\n  onInput = _.bind(this._onInput, this);\n\n  this.$hint = DOM.element(o.hint);\n  this.$input = DOM.element(o.input)\n    .on('blur.aa', onBlur)\n    .on('focus.aa', onFocus)\n    .on('keydown.aa', onKeydown);\n\n  // if no hint, noop all the hint related functions\n  if (this.$hint.length === 0) {\n    this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop;\n  }\n\n  // ie7 and ie8 don't support the input event\n  // ie9 doesn't fire the input event when characters are removed\n  // not sure if ie10 is compatible\n  if (!_.isMsie()) {\n    this.$input.on('input.aa', onInput);\n  } else {\n    this.$input.on('keydown.aa keypress.aa cut.aa paste.aa', function($e) {\n      // if a special key triggered this, ignore it\n      if (specialKeyCodeMap[$e.which || $e.keyCode]) {\n        return;\n      }\n\n      // give the browser a chance to update the value of the input\n      // before checking to see if the query changed\n      _.defer(_.bind(that._onInput, that, $e));\n    });\n  }\n\n  // the query defaults to whatever the value of the input is\n  // on initialization, it'll most likely be an empty string\n  this.query = this.$input.val();\n\n  // helps with calculating the width of the input's value\n  this.$overflowHelper = buildOverflowHelper(this.$input);\n}\n\n// static methods\n// --------------\n\nInput.normalizeQuery = function(str) {\n  // strips leading whitespace and condenses all whitespace\n  return (str || '').replace(/^\\s*/g, '').replace(/\\s{2,}/g, ' ');\n};\n\n// instance methods\n// ----------------\n\n_.mixin(Input.prototype, EventEmitter, {\n\n  // ### private\n\n  _onBlur: function onBlur() {\n    this.resetInputValue();\n    this.$input.removeAttr('aria-activedescendant');\n    this.trigger('blurred');\n  },\n\n  _onFocus: function onFocus() {\n    this.trigger('focused');\n  },\n\n  _onKeydown: function onKeydown($e) {\n    // which is normalized and consistent (but not for ie)\n    var keyName = specialKeyCodeMap[$e.which || $e.keyCode];\n\n    this._managePreventDefault(keyName, $e);\n    if (keyName && this._shouldTrigger(keyName, $e)) {\n      this.trigger(keyName + 'Keyed', $e);\n    }\n  },\n\n  _onInput: function onInput() {\n    this._checkInputValue();\n  },\n\n  _managePreventDefault: function managePreventDefault(keyName, $e) {\n    var preventDefault;\n    var hintValue;\n    var inputValue;\n\n    switch (keyName) {\n    case 'tab':\n      hintValue = this.getHint();\n      inputValue = this.getInputValue();\n\n      preventDefault = hintValue &&\n        hintValue !== inputValue &&\n        !withModifier($e);\n      break;\n\n    case 'up':\n    case 'down':\n      preventDefault = !withModifier($e);\n      break;\n\n    default:\n      preventDefault = false;\n    }\n\n    if (preventDefault) {\n      $e.preventDefault();\n    }\n  },\n\n  _shouldTrigger: function shouldTrigger(keyName, $e) {\n    var trigger;\n\n    switch (keyName) {\n    case 'tab':\n      trigger = !withModifier($e);\n      break;\n\n    default:\n      trigger = true;\n    }\n\n    return trigger;\n  },\n\n  _checkInputValue: function checkInputValue() {\n    var inputValue;\n    var areEquivalent;\n    var hasDifferentWhitespace;\n\n    inputValue = this.getInputValue();\n    areEquivalent = areQueriesEquivalent(inputValue, this.query);\n    hasDifferentWhitespace = areEquivalent && this.query ?\n      this.query.length !== inputValue.length : false;\n\n    this.query = inputValue;\n\n    if (!areEquivalent) {\n      this.trigger('queryChanged', this.query);\n    } else if (hasDifferentWhitespace) {\n      this.trigger('whitespaceChanged', this.query);\n    }\n  },\n\n  // ### public\n\n  focus: function focus() {\n    this.$input.focus();\n  },\n\n  blur: function blur() {\n    this.$input.blur();\n  },\n\n  getQuery: function getQuery() {\n    return this.query;\n  },\n\n  setQuery: function setQuery(query) {\n    this.query = query;\n  },\n\n  getInputValue: function getInputValue() {\n    return this.$input.val();\n  },\n\n  setInputValue: function setInputValue(value, silent) {\n    if (typeof value === 'undefined') {\n      value = this.query;\n    }\n    this.$input.val(value);\n\n    // silent prevents any additional events from being triggered\n    if (silent) {\n      this.clearHint();\n    } else {\n      this._checkInputValue();\n    }\n  },\n\n  expand: function expand() {\n    this.$input.attr('aria-expanded', 'true');\n  },\n\n  collapse: function collapse() {\n    this.$input.attr('aria-expanded', 'false');\n  },\n\n  setActiveDescendant: function setActiveDescendant(activedescendantId) {\n    this.$input.attr('aria-activedescendant', activedescendantId);\n  },\n\n  removeActiveDescendant: function removeActiveDescendant() {\n    this.$input.removeAttr('aria-activedescendant');\n  },\n\n  resetInputValue: function resetInputValue() {\n    this.setInputValue(this.query, true);\n  },\n\n  getHint: function getHint() {\n    return this.$hint.val();\n  },\n\n  setHint: function setHint(value) {\n    this.$hint.val(value);\n  },\n\n  clearHint: function clearHint() {\n    this.setHint('');\n  },\n\n  clearHintIfInvalid: function clearHintIfInvalid() {\n    var val;\n    var hint;\n    var valIsPrefixOfHint;\n    var isValid;\n\n    val = this.getInputValue();\n    hint = this.getHint();\n    valIsPrefixOfHint = val !== hint && hint.indexOf(val) === 0;\n    isValid = val !== '' && valIsPrefixOfHint && !this.hasOverflow();\n\n    if (!isValid) {\n      this.clearHint();\n    }\n  },\n\n  getLanguageDirection: function getLanguageDirection() {\n    return (this.$input.css('direction') || 'ltr').toLowerCase();\n  },\n\n  hasOverflow: function hasOverflow() {\n    // 2 is arbitrary, just picking a small number to handle edge cases\n    var constraint = this.$input.width() - 2;\n\n    this.$overflowHelper.text(this.getInputValue());\n\n    return this.$overflowHelper.width() >= constraint;\n  },\n\n  isCursorAtEnd: function() {\n    var valueLength;\n    var selectionStart;\n    var range;\n\n    valueLength = this.$input.val().length;\n    selectionStart = this.$input[0].selectionStart;\n\n    if (_.isNumber(selectionStart)) {\n      return selectionStart === valueLength;\n    } else if (document.selection) {\n      // NOTE: this won't work unless the input has focus, the good news\n      // is this code should only get called when the input has focus\n      range = document.selection.createRange();\n      range.moveStart('character', -valueLength);\n\n      return valueLength === range.text.length;\n    }\n\n    return true;\n  },\n\n  destroy: function destroy() {\n    this.$hint.off('.aa');\n    this.$input.off('.aa');\n\n    this.$hint = this.$input = this.$overflowHelper = null;\n  }\n});\n\n// helper functions\n// ----------------\n\nfunction buildOverflowHelper($input) {\n  return DOM.element('<pre aria-hidden=\"true\"></pre>')\n    .css({\n      // position helper off-screen\n      position: 'absolute',\n      visibility: 'hidden',\n      // avoid line breaks and whitespace collapsing\n      whiteSpace: 'pre',\n      // use same font css as input to calculate accurate width\n      fontFamily: $input.css('font-family'),\n      fontSize: $input.css('font-size'),\n      fontStyle: $input.css('font-style'),\n      fontVariant: $input.css('font-variant'),\n      fontWeight: $input.css('font-weight'),\n      wordSpacing: $input.css('word-spacing'),\n      letterSpacing: $input.css('letter-spacing'),\n      textIndent: $input.css('text-indent'),\n      textRendering: $input.css('text-rendering'),\n      textTransform: $input.css('text-transform')\n    })\n    .insertAfter($input);\n}\n\nfunction areQueriesEquivalent(a, b) {\n  return Input.normalizeQuery(a) === Input.normalizeQuery(b);\n}\n\nfunction withModifier($e) {\n  return $e.altKey || $e.ctrlKey || $e.metaKey || $e.shiftKey;\n}\n\nmodule.exports = Input;\n"
  },
  {
    "path": "js/autocomplete.js/src/autocomplete/typeahead.js",
    "content": "'use strict';\n\nvar attrsKey = 'aaAttrs';\n\nvar _ = require('../common/utils.js');\nvar DOM = require('../common/dom.js');\nvar EventBus = require('./event_bus.js');\nvar Input = require('./input.js');\nvar Dropdown = require('./dropdown.js');\nvar html = require('./html.js');\nvar css = require('./css.js');\n\n// constructor\n// -----------\n\n// THOUGHT: what if datasets could dynamically be added/removed?\nfunction Typeahead(o) {\n  var $menu;\n  var $hint;\n\n  o = o || {};\n\n  if (!o.input) {\n    _.error('missing input');\n  }\n\n  this.isActivated = false;\n  this.debug = !!o.debug;\n  this.autoselect = !!o.autoselect;\n  this.autoselectOnBlur = !!o.autoselectOnBlur;\n  this.openOnFocus = !!o.openOnFocus;\n  this.minLength = _.isNumber(o.minLength) ? o.minLength : 1;\n  this.autoWidth = (o.autoWidth === undefined) ? true : !!o.autoWidth;\n  this.clearOnSelected = !!o.clearOnSelected;\n  this.tabAutocomplete = (o.tabAutocomplete === undefined) ? true : !!o.tabAutocomplete;\n\n  o.hint = !!o.hint;\n\n  if (o.hint && o.appendTo) {\n    throw new Error('[autocomplete.js] hint and appendTo options can\\'t be used at the same time');\n  }\n\n  this.css = o.css = _.mixin({}, css, o.appendTo ? css.appendTo : {});\n  this.cssClasses = o.cssClasses = _.mixin({}, css.defaultClasses, o.cssClasses || {});\n  this.cssClasses.prefix =\n    o.cssClasses.formattedPrefix = _.formatPrefix(this.cssClasses.prefix, this.cssClasses.noPrefix);\n  this.listboxId = o.listboxId = [this.cssClasses.root, 'listbox', _.getUniqueId()].join('-');\n\n  var domElts = buildDom(o);\n\n  this.$node = domElts.wrapper;\n  var $input = this.$input = domElts.input;\n  $menu = domElts.menu;\n  $hint = domElts.hint;\n\n  if (o.dropdownMenuContainer) {\n    DOM.element(o.dropdownMenuContainer)\n      .css('position', 'relative') // ensure the container has a relative position\n      .append($menu.css('top', '0')); // override the top: 100%\n  }\n\n  // #705: if there's scrollable overflow, ie doesn't support\n  // blur cancellations when the scrollbar is clicked\n  //\n  // #351: preventDefault won't cancel blurs in ie <= 8\n  $input.on('blur.aa', function($e) {\n    var active = document.activeElement;\n    if (_.isMsie() && ($menu[0] === active || $menu[0].contains(active))) {\n      $e.preventDefault();\n      // stop immediate in order to prevent Input#_onBlur from\n      // getting exectued\n      $e.stopImmediatePropagation();\n      _.defer(function() { $input.focus(); });\n    }\n  });\n\n  // #351: prevents input blur due to clicks within dropdown menu\n  $menu.on('mousedown.aa', function($e) { $e.preventDefault(); });\n\n  this.eventBus = o.eventBus || new EventBus({el: $input});\n\n  this.dropdown = new Typeahead.Dropdown({\n    appendTo: o.appendTo,\n    wrapper: this.$node,\n    menu: $menu,\n    datasets: o.datasets,\n    templates: o.templates,\n    cssClasses: o.cssClasses,\n    minLength: this.minLength\n  })\n    .onSync('suggestionClicked', this._onSuggestionClicked, this)\n    .onSync('cursorMoved', this._onCursorMoved, this)\n    .onSync('cursorRemoved', this._onCursorRemoved, this)\n    .onSync('opened', this._onOpened, this)\n    .onSync('closed', this._onClosed, this)\n    .onSync('shown', this._onShown, this)\n    .onSync('empty', this._onEmpty, this)\n    .onSync('redrawn', this._onRedrawn, this)\n    .onAsync('datasetRendered', this._onDatasetRendered, this);\n\n  this.input = new Typeahead.Input({input: $input, hint: $hint})\n    .onSync('focused', this._onFocused, this)\n    .onSync('blurred', this._onBlurred, this)\n    .onSync('enterKeyed', this._onEnterKeyed, this)\n    .onSync('tabKeyed', this._onTabKeyed, this)\n    .onSync('escKeyed', this._onEscKeyed, this)\n    .onSync('upKeyed', this._onUpKeyed, this)\n    .onSync('downKeyed', this._onDownKeyed, this)\n    .onSync('leftKeyed', this._onLeftKeyed, this)\n    .onSync('rightKeyed', this._onRightKeyed, this)\n    .onSync('queryChanged', this._onQueryChanged, this)\n    .onSync('whitespaceChanged', this._onWhitespaceChanged, this);\n\n  this._bindKeyboardShortcuts(o);\n\n  this._setLanguageDirection();\n}\n\n// instance methods\n// ----------------\n\n_.mixin(Typeahead.prototype, {\n  // ### private\n\n  _bindKeyboardShortcuts: function(options) {\n    if (!options.keyboardShortcuts) {\n      return;\n    }\n    var $input = this.$input;\n    var keyboardShortcuts = [];\n    _.each(options.keyboardShortcuts, function(key) {\n      if (typeof key === 'string') {\n        key = key.toUpperCase().charCodeAt(0);\n      }\n      keyboardShortcuts.push(key);\n    });\n    DOM.element(document).keydown(function(event) {\n      var elt = (event.target || event.srcElement);\n      var tagName = elt.tagName;\n      if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {\n        // already in an input\n        return;\n      }\n\n      var which = event.which || event.keyCode;\n      if (keyboardShortcuts.indexOf(which) === -1) {\n        // not the right shortcut\n        return;\n      }\n\n      $input.focus();\n      event.stopPropagation();\n      event.preventDefault();\n    });\n  },\n\n  _onSuggestionClicked: function onSuggestionClicked(type, $el) {\n    var datum;\n    var context = {selectionMethod: 'click'};\n\n    if (datum = this.dropdown.getDatumForSuggestion($el)) {\n      this._select(datum, context);\n    }\n  },\n\n  _onCursorMoved: function onCursorMoved(event, updateInput) {\n    var datum = this.dropdown.getDatumForCursor();\n    var currentCursorId = this.dropdown.getCurrentCursor().attr('id');\n    this.input.setActiveDescendant(currentCursorId);\n\n    if (datum) {\n      if (updateInput) {\n        this.input.setInputValue(datum.value, true);\n      }\n\n      this.eventBus.trigger('cursorchanged', datum.raw, datum.datasetName);\n    }\n  },\n\n  _onCursorRemoved: function onCursorRemoved() {\n    this.input.resetInputValue();\n    this._updateHint();\n    this.eventBus.trigger('cursorremoved');\n  },\n\n  _onDatasetRendered: function onDatasetRendered() {\n    this._updateHint();\n\n    this.eventBus.trigger('updated');\n  },\n\n  _onOpened: function onOpened() {\n    this._updateHint();\n    this.input.expand();\n\n    this.eventBus.trigger('opened');\n  },\n\n  _onEmpty: function onEmpty() {\n    this.eventBus.trigger('empty');\n  },\n\n  _onRedrawn: function onRedrawn() {\n    this.$node.css('top', 0 + 'px');\n    this.$node.css('left', 0 + 'px');\n\n    var inputRect = this.$input[0].getBoundingClientRect();\n\n    if (this.autoWidth) {\n      this.$node.css('width', inputRect.width + 'px');\n    }\n\n    var wrapperRect = this.$node[0].getBoundingClientRect();\n\n    var top = inputRect.bottom - wrapperRect.top;\n    this.$node.css('top', top + 'px');\n    var left = inputRect.left - wrapperRect.left;\n    this.$node.css('left', left + 'px');\n\n    this.eventBus.trigger('redrawn');\n  },\n\n  _onShown: function onShown() {\n    this.eventBus.trigger('shown');\n    if (this.autoselect) {\n      this.dropdown.cursorTopSuggestion();\n    }\n  },\n\n  _onClosed: function onClosed() {\n    this.input.clearHint();\n    this.input.removeActiveDescendant();\n    this.input.collapse();\n\n    this.eventBus.trigger('closed');\n  },\n\n  _onFocused: function onFocused() {\n    this.isActivated = true;\n\n    if (this.openOnFocus) {\n      var query = this.input.getQuery();\n      if (query.length >= this.minLength) {\n        this.dropdown.update(query);\n      } else {\n        this.dropdown.empty();\n      }\n\n      this.dropdown.open();\n    }\n  },\n\n  _onBlurred: function onBlurred() {\n    var cursorDatum;\n    var topSuggestionDatum;\n\n    cursorDatum = this.dropdown.getDatumForCursor();\n    topSuggestionDatum = this.dropdown.getDatumForTopSuggestion();\n    var context = {selectionMethod: 'blur'};\n\n    if (!this.debug) {\n      if (this.autoselectOnBlur && cursorDatum) {\n        this._select(cursorDatum, context);\n      } else if (this.autoselectOnBlur && topSuggestionDatum) {\n        this._select(topSuggestionDatum, context);\n      } else {\n        this.isActivated = false;\n        this.dropdown.empty();\n        this.dropdown.close();\n      }\n    }\n  },\n\n  _onEnterKeyed: function onEnterKeyed(type, $e) {\n    var cursorDatum;\n    var topSuggestionDatum;\n\n    cursorDatum = this.dropdown.getDatumForCursor();\n    topSuggestionDatum = this.dropdown.getDatumForTopSuggestion();\n    var context = {selectionMethod: 'enterKey'};\n\n    if (cursorDatum) {\n      this._select(cursorDatum, context);\n      $e.preventDefault();\n    } else if (this.autoselect && topSuggestionDatum) {\n      this._select(topSuggestionDatum, context);\n      $e.preventDefault();\n    }\n  },\n\n  _onTabKeyed: function onTabKeyed(type, $e) {\n    if (!this.tabAutocomplete) {\n      // Closing the dropdown enables further tabbing\n      this.dropdown.close();\n      return;\n    }\n\n    var datum;\n    var context = {selectionMethod: 'tabKey'};\n\n    if (datum = this.dropdown.getDatumForCursor()) {\n      this._select(datum, context);\n      $e.preventDefault();\n    } else {\n      this._autocomplete(true);\n    }\n  },\n\n  _onEscKeyed: function onEscKeyed() {\n    this.dropdown.close();\n    this.input.resetInputValue();\n  },\n\n  _onUpKeyed: function onUpKeyed() {\n    var query = this.input.getQuery();\n\n    if (this.dropdown.isEmpty && query.length >= this.minLength) {\n      this.dropdown.update(query);\n    } else {\n      this.dropdown.moveCursorUp();\n    }\n\n    this.dropdown.open();\n  },\n\n  _onDownKeyed: function onDownKeyed() {\n    var query = this.input.getQuery();\n\n    if (this.dropdown.isEmpty && query.length >= this.minLength) {\n      this.dropdown.update(query);\n    } else {\n      this.dropdown.moveCursorDown();\n    }\n\n    this.dropdown.open();\n  },\n\n  _onLeftKeyed: function onLeftKeyed() {\n    if (this.dir === 'rtl') {\n      this._autocomplete();\n    }\n  },\n\n  _onRightKeyed: function onRightKeyed() {\n    if (this.dir === 'ltr') {\n      this._autocomplete();\n    }\n  },\n\n  _onQueryChanged: function onQueryChanged(e, query) {\n    this.input.clearHintIfInvalid();\n\n    if (query.length >= this.minLength) {\n      this.dropdown.update(query);\n    } else {\n      this.dropdown.empty();\n    }\n\n    this.dropdown.open();\n    this._setLanguageDirection();\n  },\n\n  _onWhitespaceChanged: function onWhitespaceChanged() {\n    this._updateHint();\n    this.dropdown.open();\n  },\n\n  _setLanguageDirection: function setLanguageDirection() {\n    var dir = this.input.getLanguageDirection();\n\n    if (this.dir !== dir) {\n      this.dir = dir;\n      this.$node.css('direction', dir);\n      this.dropdown.setLanguageDirection(dir);\n    }\n  },\n\n  _updateHint: function updateHint() {\n    var datum;\n    var val;\n    var query;\n    var escapedQuery;\n    var frontMatchRegEx;\n    var match;\n\n    datum = this.dropdown.getDatumForTopSuggestion();\n\n    if (datum && this.dropdown.isVisible() && !this.input.hasOverflow()) {\n      val = this.input.getInputValue();\n      query = Input.normalizeQuery(val);\n      escapedQuery = _.escapeRegExChars(query);\n\n      // match input value, then capture trailing text\n      frontMatchRegEx = new RegExp('^(?:' + escapedQuery + ')(.+$)', 'i');\n      match = frontMatchRegEx.exec(datum.value);\n\n      // clear hint if there's no trailing text\n      if (match) {\n        this.input.setHint(val + match[1]);\n      } else {\n        this.input.clearHint();\n      }\n    } else {\n      this.input.clearHint();\n    }\n  },\n\n  _autocomplete: function autocomplete(laxCursor) {\n    var hint;\n    var query;\n    var isCursorAtEnd;\n    var datum;\n\n    hint = this.input.getHint();\n    query = this.input.getQuery();\n    isCursorAtEnd = laxCursor || this.input.isCursorAtEnd();\n\n    if (hint && query !== hint && isCursorAtEnd) {\n      datum = this.dropdown.getDatumForTopSuggestion();\n      if (datum) {\n        this.input.setInputValue(datum.value);\n      }\n\n      this.eventBus.trigger('autocompleted', datum.raw, datum.datasetName);\n    }\n  },\n\n  _select: function select(datum, context) {\n    if (typeof datum.value !== 'undefined') {\n      this.input.setQuery(datum.value);\n    }\n    if (this.clearOnSelected) {\n      this.setVal('');\n    } else {\n      this.input.setInputValue(datum.value, true);\n    }\n\n    this._setLanguageDirection();\n\n    var event = this.eventBus.trigger('selected', datum.raw, datum.datasetName, context);\n    if (event.isDefaultPrevented() === false) {\n      this.dropdown.close();\n\n      // #118: allow click event to bubble up to the body before removing\n      // the suggestions otherwise we break event delegation\n      _.defer(_.bind(this.dropdown.empty, this.dropdown));\n    }\n  },\n\n  // ### public\n\n  open: function open() {\n    // if the menu is not activated yet, we need to update\n    // the underlying dropdown menu to trigger the search\n    // otherwise we're not gonna see anything\n    if (!this.isActivated) {\n      var query = this.input.getInputValue();\n      if (query.length >= this.minLength) {\n        this.dropdown.update(query);\n      } else {\n        this.dropdown.empty();\n      }\n    }\n    this.dropdown.open();\n  },\n\n  close: function close() {\n    this.dropdown.close();\n  },\n\n  setVal: function setVal(val) {\n    // expect val to be a string, so be safe, and coerce\n    val = _.toStr(val);\n\n    if (this.isActivated) {\n      this.input.setInputValue(val);\n    } else {\n      this.input.setQuery(val);\n      this.input.setInputValue(val, true);\n    }\n\n    this._setLanguageDirection();\n  },\n\n  getVal: function getVal() {\n    return this.input.getQuery();\n  },\n\n  destroy: function destroy() {\n    this.input.destroy();\n    this.dropdown.destroy();\n\n    destroyDomStructure(this.$node, this.cssClasses);\n\n    this.$node = null;\n  },\n\n  getWrapper: function getWrapper() {\n    return this.dropdown.$container[0];\n  }\n});\n\nfunction buildDom(options) {\n  var $input;\n  var $wrapper;\n  var $dropdown;\n  var $hint;\n\n  $input = DOM.element(options.input);\n  $wrapper = DOM\n    .element(html.wrapper.replace('%ROOT%', options.cssClasses.root))\n    .css(options.css.wrapper);\n\n  // override the display property with the table-cell value\n  // if the parent element is a table and the original input was a block\n  //  -> https://github.com/algolia/autocomplete.js/issues/16\n  if (!options.appendTo && $input.css('display') === 'block' && $input.parent().css('display') === 'table') {\n    $wrapper.css('display', 'table-cell');\n  }\n  var dropdownHtml = html.dropdown.\n    replace('%PREFIX%', options.cssClasses.prefix).\n    replace('%DROPDOWN_MENU%', options.cssClasses.dropdownMenu);\n  $dropdown = DOM.element(dropdownHtml)\n    .css(options.css.dropdown)\n    .attr({\n      role: 'listbox',\n      id: options.listboxId\n    });\n  if (options.templates && options.templates.dropdownMenu) {\n    $dropdown.html(_.templatify(options.templates.dropdownMenu)());\n  }\n  $hint = $input.clone().css(options.css.hint).css(getBackgroundStyles($input));\n\n  $hint\n    .val('')\n    .addClass(_.className(options.cssClasses.prefix, options.cssClasses.hint, true))\n    .removeAttr('id name placeholder required')\n    .prop('readonly', true)\n    .attr({\n      'aria-hidden': 'true',\n      autocomplete: 'off',\n      spellcheck: 'false',\n      tabindex: -1\n    });\n  if ($hint.removeData) {\n    $hint.removeData();\n  }\n\n  // store the original values of the attrs that get modified\n  // so modifications can be reverted on destroy\n  $input.data(attrsKey, {\n    'aria-autocomplete': $input.attr('aria-autocomplete'),\n    'aria-expanded': $input.attr('aria-expanded'),\n    'aria-owns': $input.attr('aria-owns'),\n    autocomplete: $input.attr('autocomplete'),\n    dir: $input.attr('dir'),\n    role: $input.attr('role'),\n    spellcheck: $input.attr('spellcheck'),\n    style: $input.attr('style'),\n    type: $input.attr('type')\n  });\n\n  $input\n    .addClass(_.className(options.cssClasses.prefix, options.cssClasses.input, true))\n    .attr({\n      autocomplete: 'off',\n      spellcheck: false,\n\n      // Accessibility features\n      // Give the field a presentation of a \"select\".\n      // Combobox is the combined presentation of a single line textfield\n      // with a listbox popup.\n      // https://www.w3.org/WAI/PF/aria/roles#combobox\n      role: 'combobox',\n      // Let the screen reader know the field has an autocomplete\n      // feature to it.\n      'aria-autocomplete': (options.datasets &&\n        options.datasets[0] && options.datasets[0].displayKey ? 'both' : 'list'),\n      // Indicates whether the dropdown it controls is currently expanded or collapsed\n      'aria-expanded': 'false',\n      'aria-label': options.ariaLabel,\n      // Explicitly point to the listbox,\n      // which is a list of suggestions (aka options)\n      'aria-owns': options.listboxId\n    })\n    .css(options.hint ? options.css.input : options.css.inputWithNoHint);\n\n  // ie7 does not like it when dir is set to auto\n  try {\n    if (!$input.attr('dir')) {\n      $input.attr('dir', 'auto');\n    }\n  } catch (e) {\n    // ignore\n  }\n\n  $wrapper = options.appendTo\n    ? $wrapper.appendTo(DOM.element(options.appendTo).eq(0)).eq(0)\n    : $input.wrap($wrapper).parent();\n\n  $wrapper\n    .prepend(options.hint ? $hint : null)\n    .append($dropdown);\n\n  return {\n    wrapper: $wrapper,\n    input: $input,\n    hint: $hint,\n    menu: $dropdown\n  };\n}\n\nfunction getBackgroundStyles($el) {\n  return {\n    backgroundAttachment: $el.css('background-attachment'),\n    backgroundClip: $el.css('background-clip'),\n    backgroundColor: $el.css('background-color'),\n    backgroundImage: $el.css('background-image'),\n    backgroundOrigin: $el.css('background-origin'),\n    backgroundPosition: $el.css('background-position'),\n    backgroundRepeat: $el.css('background-repeat'),\n    backgroundSize: $el.css('background-size')\n  };\n}\n\nfunction destroyDomStructure($node, cssClasses) {\n  var $input = $node.find(_.className(cssClasses.prefix, cssClasses.input));\n\n  // need to remove attrs that weren't previously defined and\n  // revert attrs that originally had a value\n  _.each($input.data(attrsKey), function(val, key) {\n    if (val === undefined) {\n      $input.removeAttr(key);\n    } else {\n      $input.attr(key, val);\n    }\n  });\n\n  $input\n    .detach()\n    .removeClass(_.className(cssClasses.prefix, cssClasses.input, true))\n    .insertAfter($node);\n  if ($input.removeData) {\n    $input.removeData(attrsKey);\n  }\n\n  $node.remove();\n}\n\nTypeahead.Dropdown = Dropdown;\nTypeahead.Input = Input;\nTypeahead.sources = require('../sources/index.js');\n\nmodule.exports = Typeahead;\n"
  },
  {
    "path": "js/autocomplete.js/src/common/dom.js",
    "content": "'use strict';\n\nmodule.exports = {\n  element: null\n};\n"
  },
  {
    "path": "js/autocomplete.js/src/common/parseAlgoliaClientVersion.js",
    "content": "'use strict';\n\nmodule.exports = function parseAlgoliaClientVersion(agent) {\n  var parsed =\n    // User agent for algoliasearch >= 3.33.0\n    agent.match(/Algolia for JavaScript \\((\\d+\\.)(\\d+\\.)(\\d+)\\)/) ||\n    // User agent for algoliasearch < 3.33.0\n    agent.match(/Algolia for vanilla JavaScript (\\d+\\.)(\\d+\\.)(\\d+)/);\n\n  if (parsed) {\n    return [parsed[1], parsed[2], parsed[3]];\n  }\n\n  return undefined;\n};\n"
  },
  {
    "path": "js/autocomplete.js/src/common/utils.js",
    "content": "'use strict';\n\nvar DOM = require('./dom.js');\n\nfunction escapeRegExp(str) {\n  return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\nmodule.exports = {\n  // those methods are implemented differently\n  // depending on which build it is, using\n  // $... or angular... or Zepto... or require(...)\n  isArray: null,\n  isFunction: null,\n  isObject: null,\n  bind: null,\n  each: null,\n  map: null,\n  mixin: null,\n\n  isMsie: function(agentString) {\n    if (agentString === undefined) { agentString = navigator.userAgent; }\n    // from https://github.com/ded/bowser/blob/master/bowser.js\n    if ((/(msie|trident)/i).test(agentString)) {\n      var match = agentString.match(/(msie |rv:)(\\d+(.\\d+)?)/i);\n      if (match) { return match[2]; }\n    }\n    return false;\n  },\n\n  // http://stackoverflow.com/a/6969486\n  escapeRegExChars: function(str) {\n    return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n  },\n\n  isNumber: function(obj) { return typeof obj === 'number'; },\n\n  toStr: function toStr(s) {\n    return s === undefined || s === null ? '' : s + '';\n  },\n\n  cloneDeep: function cloneDeep(obj) {\n    var clone = this.mixin({}, obj);\n    var self = this;\n    this.each(clone, function(value, key) {\n      if (value) {\n        if (self.isArray(value)) {\n          clone[key] = [].concat(value);\n        } else if (self.isObject(value)) {\n          clone[key] = self.cloneDeep(value);\n        }\n      }\n    });\n    return clone;\n  },\n\n  error: function(msg) {\n    throw new Error(msg);\n  },\n\n  every: function(obj, test) {\n    var result = true;\n    if (!obj) {\n      return result;\n    }\n    this.each(obj, function(val, key) {\n      if (result) {\n        result = test.call(null, val, key, obj) && result;\n      }\n    });\n    return !!result;\n  },\n\n  any: function(obj, test) {\n    var found = false;\n    if (!obj) {\n      return found;\n    }\n    this.each(obj, function(val, key) {\n      if (test.call(null, val, key, obj)) {\n        found = true;\n        return false;\n      }\n    });\n    return found;\n  },\n\n  getUniqueId: (function() {\n    var counter = 0;\n    return function() { return counter++; };\n  })(),\n\n  templatify: function templatify(obj) {\n    if (this.isFunction(obj)) {\n      return obj;\n    }\n    var $template = DOM.element(obj);\n    if ($template.prop('tagName') === 'SCRIPT') {\n      return function template() { return $template.text(); };\n    }\n    return function template() { return String(obj); };\n  },\n\n  defer: function(fn) { setTimeout(fn, 0); },\n\n  noop: function() {},\n\n  formatPrefix: function(prefix, noPrefix) {\n    return noPrefix ? '' : prefix + '-';\n  },\n\n  className: function(prefix, clazz, skipDot) {\n    return (skipDot ? '' : '.') + prefix + clazz;\n  },\n\n  escapeHighlightedString: function(str, highlightPreTag, highlightPostTag) {\n    highlightPreTag = highlightPreTag || '<em>';\n    var pre = document.createElement('div');\n    pre.appendChild(document.createTextNode(highlightPreTag));\n\n    highlightPostTag = highlightPostTag || '</em>';\n    var post = document.createElement('div');\n    post.appendChild(document.createTextNode(highlightPostTag));\n\n    var div = document.createElement('div');\n    div.appendChild(document.createTextNode(str));\n    return div.innerHTML\n      .replace(RegExp(escapeRegExp(pre.innerHTML), 'g'), highlightPreTag)\n      .replace(RegExp(escapeRegExp(post.innerHTML), 'g'), highlightPostTag);\n  }\n};\n"
  },
  {
    "path": "js/autocomplete.js/src/jquery/plugin.js",
    "content": "'use strict';\n\n// setup DOM element\nvar DOM = require('../common/dom.js');\nvar $ = require('jquery');\nDOM.element = $;\n\n// setup utils functions\nvar _ = require('../common/utils.js');\n_.isArray = $.isArray;\n_.isFunction = $.isFunction;\n_.isObject = $.isPlainObject;\n_.bind = $.proxy;\n_.each = function(collection, cb) {\n  // stupid argument order for jQuery.each\n  $.each(collection, reverseArgs);\n  function reverseArgs(index, value) {\n    return cb(value, index);\n  }\n};\n_.map = $.map;\n_.mixin = $.extend;\n_.Event = $.Event;\n\nvar Typeahead = require('../autocomplete/typeahead.js');\nvar EventBus = require('../autocomplete/event_bus.js');\n\nvar old;\nvar typeaheadKey;\nvar methods;\n\nold = $.fn.autocomplete;\n\ntypeaheadKey = 'aaAutocomplete';\n\nmethods = {\n  // supported signatures:\n  // function(o, dataset, dataset, ...)\n  // function(o, [dataset, dataset, ...])\n  initialize: function initialize(o, datasets) {\n    datasets = _.isArray(datasets) ? datasets : [].slice.call(arguments, 1);\n\n    o = o || {};\n\n    return this.each(attach);\n\n    function attach() {\n      var $input = $(this);\n      var eventBus = new EventBus({el: $input});\n      var typeahead;\n\n      typeahead = new Typeahead({\n        input: $input,\n        eventBus: eventBus,\n        dropdownMenuContainer: o.dropdownMenuContainer,\n        hint: o.hint === undefined ? true : !!o.hint,\n        minLength: o.minLength,\n        autoselect: o.autoselect,\n        autoselectOnBlur: o.autoselectOnBlur,\n        tabAutocomplete: o.tabAutocomplete,\n        openOnFocus: o.openOnFocus,\n        templates: o.templates,\n        debug: o.debug,\n        clearOnSelected: o.clearOnSelected,\n        cssClasses: o.cssClasses,\n        datasets: datasets,\n        keyboardShortcuts: o.keyboardShortcuts,\n        appendTo: o.appendTo,\n        autoWidth: o.autoWidth\n      });\n\n      $input.data(typeaheadKey, typeahead);\n    }\n  },\n\n  open: function open() {\n    return this.each(openTypeahead);\n\n    function openTypeahead() {\n      var $input = $(this);\n      var typeahead;\n\n      if (typeahead = $input.data(typeaheadKey)) {\n        typeahead.open();\n      }\n    }\n  },\n\n  close: function close() {\n    return this.each(closeTypeahead);\n\n    function closeTypeahead() {\n      var $input = $(this);\n      var typeahead;\n\n      if (typeahead = $input.data(typeaheadKey)) {\n        typeahead.close();\n      }\n    }\n  },\n\n  val: function val(newVal) {\n    // mirror jQuery#val functionality: read operate on first match,\n    // write operates on all matches\n    return !arguments.length ? getVal(this.first()) : this.each(setVal);\n\n    function setVal() {\n      var $input = $(this);\n      var typeahead;\n\n      if (typeahead = $input.data(typeaheadKey)) {\n        typeahead.setVal(newVal);\n      }\n    }\n\n    function getVal($input) {\n      var typeahead;\n      var query;\n\n      if (typeahead = $input.data(typeaheadKey)) {\n        query = typeahead.getVal();\n      }\n\n      return query;\n    }\n  },\n\n  destroy: function destroy() {\n    return this.each(unattach);\n\n    function unattach() {\n      var $input = $(this);\n      var typeahead;\n\n      if (typeahead = $input.data(typeaheadKey)) {\n        typeahead.destroy();\n        $input.removeData(typeaheadKey);\n      }\n    }\n  }\n};\n\n$.fn.autocomplete = function(method) {\n  var tts;\n\n  // methods that should only act on intialized typeaheads\n  if (methods[method] && method !== 'initialize') {\n    // filter out non-typeahead inputs\n    tts = this.filter(function() { return !!$(this).data(typeaheadKey); });\n    return methods[method].apply(tts, [].slice.call(arguments, 1));\n  }\n  return methods.initialize.apply(this, arguments);\n};\n\n$.fn.autocomplete.noConflict = function noConflict() {\n  $.fn.autocomplete = old;\n  return this;\n};\n\n$.fn.autocomplete.sources = Typeahead.sources;\n$.fn.autocomplete.escapeHighlightedString = _.escapeHighlightedString;\n\nmodule.exports = $.fn.autocomplete;\n"
  },
  {
    "path": "js/autocomplete.js/src/sources/hits.js",
    "content": "'use strict';\n\nvar _ = require('../common/utils.js');\nvar version = require('../../version.js');\nvar parseAlgoliaClientVersion = require('../common/parseAlgoliaClientVersion.js');\n\nfunction createMultiQuerySource() {\n  var queries = [];\n  var lastResults = [];\n  var lastSearch = window.Promise.resolve();\n\n  function requestSearch(queryClient, queryIndex) {\n    // Since all requests happen synchronously, this is executed once all the\n    // sources have been requested.\n    return window.Promise.resolve()\n      .then(function() {\n        if (queries.length) {\n          lastSearch = queryClient.search(queries);\n          queries = [];\n        }\n\n        return lastSearch;\n      })\n      .then(function(result) {\n        if (!result) {\n          return undefined;\n        }\n\n        lastResults = result.results;\n        return lastResults[queryIndex];\n      });\n  }\n\n  return function multiQuerySource(searchIndex, params) {\n    return function search(query, cb) {\n      var queryClient = searchIndex.as;\n      var queryIndex =\n        queries.push({\n          indexName: searchIndex.indexName,\n          query: query,\n          params: params\n        }) - 1;\n\n      requestSearch(queryClient, queryIndex)\n        .then(function(result) {\n          if (result) {\n            cb(result.hits, result);\n          }\n        })\n        .catch(function(error) {\n          _.error(error.message);\n        });\n    };\n  };\n}\n\nvar source = createMultiQuerySource();\n\nmodule.exports = function search(index, params) {\n  var algoliaVersion = parseAlgoliaClientVersion(index.as._ua);\n\n  if (algoliaVersion && algoliaVersion[0] >= 3 && algoliaVersion[1] > 20) {\n    var autocompleteUserAgent = 'autocomplete.js ' + version;\n\n    if (index.as._ua.indexOf(autocompleteUserAgent) === -1) {\n      index.as._ua += '; ' + autocompleteUserAgent;\n    }\n  }\n\n  return source(index, params);\n};\n"
  },
  {
    "path": "js/autocomplete.js/src/sources/index.js",
    "content": "'use strict';\n\nmodule.exports = {\n  hits: require('./hits.js'),\n  popularIn: require('./popularIn.js')\n};\n"
  },
  {
    "path": "js/autocomplete.js/src/sources/popularIn.js",
    "content": "'use strict';\n\nvar _ = require('../common/utils.js');\nvar version = require('../../version.js');\nvar parseAlgoliaClientVersion = require('../common/parseAlgoliaClientVersion.js');\n\nmodule.exports = function popularIn(index, params, details, options) {\n  var algoliaVersion = parseAlgoliaClientVersion(index.as._ua);\n  if (algoliaVersion && algoliaVersion[0] >= 3 && algoliaVersion[1] > 20) {\n    params = params || {};\n    params.additionalUA = 'autocomplete.js ' + version;\n  }\n  if (!details.source) {\n    return _.error(\"Missing 'source' key\");\n  }\n  var source = _.isFunction(details.source) ? details.source : function(hit) { return hit[details.source]; };\n\n  if (!details.index) {\n    return _.error(\"Missing 'index' key\");\n  }\n  var detailsIndex = details.index;\n\n  options = options || {};\n\n  return sourceFn;\n\n  function sourceFn(query, cb) {\n    index.search(query, params, function(error, content) {\n      if (error) {\n        _.error(error.message);\n        return;\n      }\n\n      if (content.hits.length > 0) {\n        var first = content.hits[0];\n\n        var detailsParams = _.mixin({hitsPerPage: 0}, details);\n        delete detailsParams.source; // not a query parameter\n        delete detailsParams.index; // not a query parameter\n\n        var detailsAlgoliaVersion = parseAlgoliaClientVersion(detailsIndex.as._ua);\n        if (detailsAlgoliaVersion && detailsAlgoliaVersion[0] >= 3 && detailsAlgoliaVersion[1] > 20) {\n          params.additionalUA = 'autocomplete.js ' + version;\n        }\n\n        detailsIndex.search(source(first), detailsParams, function(error2, content2) {\n          if (error2) {\n            _.error(error2.message);\n            return;\n          }\n\n          var suggestions = [];\n\n          // add the 'all department' entry before others\n          if (options.includeAll) {\n            var label = options.allTitle || 'All departments';\n            suggestions.push(_.mixin({\n              facet: {value: label, count: content2.nbHits}\n            }, _.cloneDeep(first)));\n          }\n\n          // enrich the first hit iterating over the facets\n          _.each(content2.facets, function(values, facet) {\n            _.each(values, function(count, value) {\n              suggestions.push(_.mixin({\n                facet: {facet: facet, value: value, count: count}\n              }, _.cloneDeep(first)));\n            });\n          });\n\n          // append all other hits\n          for (var i = 1; i < content.hits.length; ++i) {\n            suggestions.push(content.hits[i]);\n          }\n\n          cb(suggestions, content);\n        });\n\n        return;\n      }\n\n      cb([]);\n    });\n  }\n};\n"
  },
  {
    "path": "js/autocomplete.js/src/standalone/index.js",
    "content": "'use strict';\n\n// this will inject Zepto in window, unfortunately no easy commonJS zepto build\nvar zepto = require('../../zepto.js');\n\n// setup DOM element\nvar DOM = require('../common/dom.js');\nDOM.element = zepto;\n\n// setup utils functions\nvar _ = require('../common/utils.js');\n_.isArray = zepto.isArray;\n_.isFunction = zepto.isFunction;\n_.isObject = zepto.isPlainObject;\n_.bind = zepto.proxy;\n_.each = function(collection, cb) {\n  // stupid argument order for jQuery.each\n  zepto.each(collection, reverseArgs);\n  function reverseArgs(index, value) {\n    return cb(value, index);\n  }\n};\n_.map = zepto.map;\n_.mixin = zepto.extend;\n_.Event = zepto.Event;\n\nvar typeaheadKey = 'aaAutocomplete';\nvar Typeahead = require('../autocomplete/typeahead.js');\nvar EventBus = require('../autocomplete/event_bus.js');\n\nfunction autocomplete(selector, options, datasets, typeaheadObject) {\n  datasets = _.isArray(datasets) ? datasets : [].slice.call(arguments, 2);\n\n  var inputs = zepto(selector).each(function(i, input) {\n    var $input = zepto(input);\n    var eventBus = new EventBus({el: $input});\n    var typeahead = typeaheadObject || new Typeahead({\n      input: $input,\n      eventBus: eventBus,\n      dropdownMenuContainer: options.dropdownMenuContainer,\n      hint: options.hint === undefined ? true : !!options.hint,\n      minLength: options.minLength,\n      autoselect: options.autoselect,\n      autoselectOnBlur: options.autoselectOnBlur,\n      tabAutocomplete: options.tabAutocomplete,\n      openOnFocus: options.openOnFocus,\n      templates: options.templates,\n      debug: options.debug,\n      clearOnSelected: options.clearOnSelected,\n      cssClasses: options.cssClasses,\n      datasets: datasets,\n      keyboardShortcuts: options.keyboardShortcuts,\n      appendTo: options.appendTo,\n      autoWidth: options.autoWidth,\n      ariaLabel: options.ariaLabel || input.getAttribute('aria-label')\n    });\n    $input.data(typeaheadKey, typeahead);\n  });\n\n  // expose all methods in the `autocomplete` attribute\n  inputs.autocomplete = {};\n  _.each(['open', 'close', 'getVal', 'setVal', 'destroy', 'getWrapper'], function(method) {\n    inputs.autocomplete[method] = function() {\n      var methodArguments = arguments;\n      var result;\n      inputs.each(function(j, input) {\n        var typeahead = zepto(input).data(typeaheadKey);\n        result = typeahead[method].apply(typeahead, methodArguments);\n      });\n      return result;\n    };\n  });\n\n  return inputs;\n}\n\nautocomplete.sources = Typeahead.sources;\nautocomplete.escapeHighlightedString = _.escapeHighlightedString;\n\nvar wasAutocompleteSet = 'autocomplete' in window;\nvar oldAutocomplete = window.autocomplete;\nautocomplete.noConflict = function noConflict() {\n  if (wasAutocompleteSet) {\n    window.autocomplete = oldAutocomplete;\n  } else {\n    delete window.autocomplete;\n  }\n  return autocomplete;\n};\n\nmodule.exports = autocomplete;\n"
  },
  {
    "path": "js/autocomplete.js/test/ci.sh",
    "content": "#!/usr/bin/env bash\n\nset -e # exit when error, no verbose\n\nif [ \"$TEST_SUITE\" == \"unit\" ]; then\n  ./node_modules/karma/bin/karma start --single-run\nelif [ \"$TRAVIS_SECURE_ENV_VARS\" == \"true\" -a \"$TEST_SUITE\" == \"integration\" ]; then\n  static -p 8080 &\n  sleep 3 &&\n  ./node_modules/mocha/bin/mocha --harmony -R spec ./test/integration/test.js\nelif [ \"$TEST_SUITE\" == \"examples\" ]; then\n  yarn docs:netlify\nelse\n  echo \"Not running any tests\"\nfi\n"
  },
  {
    "path": "js/autocomplete.js/test/fixtures.js",
    "content": "'use strict';\n\nvar fixtures = {};\n\nfixtures.data = {\n  simple: [\n    {value: 'big'},\n    {value: 'bigger'},\n    {value: 'biggest'},\n    {value: 'small'},\n    {value: 'smaller'},\n    {value: 'smallest'}\n  ],\n  animals: [\n    {value: 'dog'},\n    {value: 'cat'},\n    {value: 'moose'}\n  ]\n};\n\nfixtures.html = {\n  textInput: '<input type=\"text\">',\n  angularTextInput: '<input type=\"text\" ng-model=\"q\" autocomplete aa-datasets=\"getDatasets()\">',\n  input: '<input class=\"aa-input\" type=\"text\" autocomplete=\"false\" spellcheck=\"false\">',\n  hint: '<input class=\"aa-hint\" type=\"text\" autocomplete=\"false\" spellcheck=\"false\" disabled>',\n  menu: '<span class=\"aa-dropdown-menu\"></span>',\n  customMenu: [\n    '<script type=\"text/template\" id=\"my-custom-menu-template\">',\n    '<div class=\"my-custom-menu\">',\n    '<div class=\"row\">',\n    '<div class=\"col-sm-6\">',\n    '<div class=\"aa-dataset-contacts1\"></div>',\n    '</div>',\n    '<div class=\"col-sm-6\">',\n    '<div class=\"aa-dataset-contacts2\"></div>',\n    '<div class=\"aa-dataset-contacts3\"></div>',\n    '</div>',\n    '</div>',\n    '</div>',\n    '</script>'\n  ].join(''),\n  customMenuContainer: '<div id=\"custom-menu-container\"></div>',\n  dataset: [\n    '<div class=\"aa-dataset-test\">',\n    '<span class=\"aa-suggestions\">',\n    '<div class=\"aa-suggestion\"><p>one</p></div>',\n    '<div class=\"aa-suggestion\"><p>two</p></div>',\n    '<div class=\"aa-suggestion\"><p>three</p></div>',\n    '</span>',\n    '</div>'\n  ].join('')\n};\n\nmodule.exports = fixtures;\n"
  },
  {
    "path": "js/autocomplete.js/test/helpers/mocks.js",
    "content": "'use strict';\n\nvar _ = require('../../src/common/utils.js');\nvar $ = require('jquery');\nmodule.exports = function mock(Constructor) {\n  var constructorSpy;\n\n  Mock.prototype = Constructor.prototype;\n  constructorSpy = jasmine.createSpy('mock constructor').and.callFake(Mock);\n\n  // copy instance methods\n  for (var key in Constructor) {\n    if (typeof Constructor[key] === 'function') {\n      constructorSpy[key] = Constructor[key];\n    }\n  }\n\n  return constructorSpy;\n\n  function Mock() {\n    var instance = _.mixin({}, Constructor.prototype);\n\n    for (var key in instance) {\n      if (typeof instance[key] === 'function') {\n        spyOn(instance, key);\n\n        // special case for some components\n        if (key === 'bind') {\n          instance[key].and.callFake(function() { return this; });\n        }\n      }\n    }\n\n    // have the event emitter methods call through\n    instance.onSync && instance.onSync.and.callThrough();\n    instance.onAsync && instance.onAsync.and.callThrough();\n    instance.off && instance.off.and.callThrough();\n    instance.trigger && instance.trigger.and.callThrough();\n\n    // have some datasets methods call through\n    instance.getRoot && instance.getRoot.and.callFake(function() { return $('<span class=\"aa-dataset-fake\" />'); });\n\n    instance.constructor = Constructor;\n\n    return instance;\n  }\n};\n"
  },
  {
    "path": "js/autocomplete.js/test/helpers/waits_for.js",
    "content": "'use strict';\n\nvar waitsForAndRuns = function(escapeFunction, runFunction, escapeTime) {\n  // check the escapeFunction every millisecond so as soon as it is met we can escape the function\n  var interval = setInterval(function() {\n    if (escapeFunction()) {\n      clearMe();\n      runFunction();\n    }\n  }, 1);\n  // in case we never reach the escapeFunction, we will time out\n  // at the escapeTime\n  var timeOut = setTimeout(function() {\n    clearMe();\n    runFunction();\n  }, escapeTime);\n  // clear the interval and the timeout\n  function clearMe() {\n    clearInterval(interval);\n    clearTimeout(timeOut);\n  }\n};\n\nmodule.exports = waitsForAndRuns;\n"
  },
  {
    "path": "js/autocomplete.js/test/integration/test.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <title></title>\n    <script src=\"../../node_modules/jquery/dist/jquery.js\"></script>\n    <!--[if lte IE 8]>\n    <script src=\"https://code.jquery.com/jquery-1.11.3.js\"></script>\n    <![endif]-->\n    <script src=\"../../dist/autocomplete.jquery.js\"></script>\n\n    <style>\n      .container {\n        width: 800px;\n        margin: 50px auto;\n      }\n\n      .autocomplete-wrapper {\n        display: block;\n        margin: 50px 0;\n      }\n\n      .aa-dropdown-menu {\n        background-color: #fff;\n        border: 1px solid #000;\n      }\n\n      .aa-suggestion.aa-cursor {\n        background-color: #ccc;\n      }\n    </style>\n  </head>\n\n  <body>\n    <div class=\"container\">\n      <form action=\"/where\" method=\"GET\">\n        <div class=\"autocomplete-wrapper\">\n          <input id=\"states\" name=\"states\" type=\"text\">\n          <input type=\"submit\">\n        </div>\n      </form>\n    </div>\n\n    <script>\n      var states = [\n        'Alabama',\n        'Alaska',\n        'Arizona',\n        'Arkansas',\n        'California',\n        'Colorado',\n        'Connecticut',\n        'Delaware',\n        'Florida',\n        'Georgia',\n        'Hawaii',\n        'Idaho',\n        'Illinois',\n        'Indiana',\n        'Iowa',\n        'Kansas',\n        'Kentucky',\n        'Louisiana',\n        'Maine',\n        'Maryland',\n        'Massachusetts',\n        'Michigan',\n        'Minnesota',\n        'Mississippi',\n        'Missouri',\n        'Montana',\n        'Nebraska',\n        'Nevada',\n        'New Hampshire',\n        'New Jersey',\n        'New Mexico',\n        'New York',\n        'North Carolina',\n        'North Dakota',\n        'Ohio',\n        'Oklahoma',\n        'Oregon',\n        'Pennsylvania',\n        'Rhode Island',\n        'South Carolina',\n        'South Dakota',\n        'Tennessee',\n        'Texas',\n        'Utah',\n        'Vermont',\n        'Virginia',\n        'Washington',\n        'West Virginia',\n        'Wisconsin',\n        'Wyoming',\n        'this is a very long value so deal with it otherwise you gonna have a hard time'\n      ];\n\n      function buildAutocomplete (options) {\n        if (options === undefined) options = { };\n        if (window.autocomplete) {\n          window.autocomplete.autocomplete.destroy();\n          window.autocomplete = null;\n        }\n        window.autocomplete = $('#states').autocomplete(options, [\n          {\n            displayKey: 'name',\n            source: function(q, cb) {\n              var res = [];\n              if (!q) {\n                cb([]);\n                return;\n              }\n              for (var i = 0; i < states.length; ++i) {\n                if (states[i].toLowerCase().indexOf(q.toLowerCase()) === 0) {\n                  res.push({ name: states[i] });\n                }\n              }\n              cb(res);\n            }\n          }\n        ]);\n      }\n\n      buildAutocomplete();\n    </script>\n  </body>\n</html>\n"
  },
  {
    "path": "js/autocomplete.js/test/integration/test.js",
    "content": "'use strict';\n\n/* eslint-env jasmine */\n\nvar wd = require('yiewd');\nvar colors = require('colors');\nvar expect = require('chai').expect;\nvar f = require('util').format;\nvar env = process.env;\n\nvar browser;\nvar caps;\n\nbrowser = (process.env.BROWSER || 'chrome').split(':');\n\ncaps = {\n  name: f('[%s] typeahead.js ui', browser.join(' , ')),\n  browserName: browser[0]\n};\n\nsetIf(caps, 'version', browser[1]);\nsetIf(caps, 'platform', browser[2]);\nsetIf(caps, 'tunnel-identifier', env['TRAVIS_JOB_NUMBER']);\nsetIf(caps, 'build', env['TRAVIS_BUILD_NUMBER']);\nsetIf(caps, 'tags', env['CI'] ? ['CI'] : ['local']);\n\nfunction setIf(obj, key, val) {\n  val && (obj[key] = val);\n}\n\ndescribe('jquery-typeahead.js', function() {\n  var driver;\n  var body;\n  var input;\n  var hint;\n  var dropdown;\n  var allPassed = true;\n\n  this.timeout(300000);\n\n  before(function(done) {\n    var host = 'ondemand.saucelabs.com';\n    var port = 80;\n    var username;\n    var password;\n\n    if (env['CI']) {\n      host = 'localhost';\n      port = 4445;\n      username = env['SAUCE_USERNAME'];\n      password = env['SAUCE_ACCESS_KEY'];\n    }\n\n    driver = wd.remote(host, port, username, password);\n    driver.configureHttp({\n      timeout: 30000,\n      retries: 5,\n      retryDelay: 200\n    });\n\n    driver.on('status', function(info) {\n      console.log(info.cyan);\n    });\n\n    driver.on('command', function(meth, path, data) {\n      console.log(' > ' + meth.yellow, path.grey, data || '');\n    });\n\n    driver.run(function*() {\n      yield this.init(caps);\n      yield this.get((env['TEST_HOST'] || 'http://localhost:8080') + '/test/integration/test.html');\n\n      body = this.elementByTagName('body');\n      input = yield this.elementById('states');\n      hint = yield this.elementByClassName('aa-hint');\n      dropdown = yield this.elementByClassName('aa-dropdown-menu');\n\n      done();\n    });\n  });\n\n  beforeEach(function(done) {\n    driver.run(function*() {\n      yield body.click();\n      yield this.execute('$(\"#states\").autocomplete(\"val\", \"\")');\n      done();\n    });\n  });\n\n  afterEach(function() {\n    allPassed = allPassed && (this.currentTest.state === 'passed');\n  });\n\n  after(function(done) {\n    driver.run(function*() {\n      yield this.quit();\n      yield driver.sauceJobStatus(allPassed);\n      done();\n    });\n  });\n\n  function testSuite () {\n    describe('on blur', function() {\n      it('should close dropdown', function(done) {\n        driver.run(function*() {\n          yield input.click();\n          yield input.type('mi');\n          expect(yield dropdown.isDisplayed()).to.equal(true);\n\n          yield body.click();\n          expect(yield dropdown.isDisplayed()).to.equal(false);\n\n          done();\n        });\n      });\n\n      it('should clear hint', function(done) {\n        driver.run(function*() {\n          yield input.click();\n          yield input.type('mi');\n          expect(yield hint.getValue()).to.equal('michigan');\n\n          yield body.click();\n          expect(yield hint.getValue()).to.equal('');\n\n          done();\n        });\n      });\n    });\n\n    describe('on query change', function() {\n      it('should open dropdown if suggestions', function(done) {\n        driver.run(function*() {\n          yield input.click();\n          yield input.type('mi');\n\n          expect(yield dropdown.isDisplayed()).to.equal(true);\n\n          done();\n        });\n      });\n\n      it('should position the dropdown correctly', function(done) {\n        driver.run(function*() {\n          yield input.click();\n          yield input.type('mi');\n\n          var inputPos = yield input.getLocation();\n          var dropdownPos = yield dropdown.getLocation();\n\n          expect(inputPos.x >= dropdownPos.x - 2 && inputPos.x <= dropdownPos.x + 2).to.equal(true);\n          expect(dropdownPos.y > inputPos.y).to.equal(true);\n\n          done();\n        });\n      });\n\n      it('should close dropdown if no suggestions', function(done) {\n        driver.run(function*() {\n          yield input.click();\n          yield input.type('huh?');\n\n          expect(yield dropdown.isDisplayed()).to.equal(false);\n\n          done();\n        });\n      });\n\n      it('should render suggestions if suggestions', function(done) {\n        driver.run(function*() {\n          var suggestions;\n\n          yield input.click();\n          yield input.type('mi');\n\n          suggestions = yield dropdown.elementsByClassName('aa-suggestion');\n\n          expect(suggestions).to.have.length('4');\n          expect(yield suggestions[0].text()).to.equal('Michigan');\n          expect(yield suggestions[1].text()).to.equal('Minnesota');\n          expect(yield suggestions[2].text()).to.equal('Mississippi');\n          expect(yield suggestions[3].text()).to.equal('Missouri');\n\n          done();\n        });\n      });\n\n      it('should show hint if top suggestion is a match', function(done) {\n        driver.run(function*() {\n          yield input.click();\n          yield input.type('mi');\n\n          expect(yield hint.getValue()).to.equal('michigan');\n\n          done();\n        });\n      });\n\n      it('should not show hint if top suggestion is not a match', function(done) {\n        driver.run(function*() {\n          yield input.click();\n          yield input.type('ham');\n\n          expect(yield hint.getValue()).to.equal('');\n\n          done();\n        });\n      });\n\n      it('should not show hint if there is query overflow', function(done) {\n        driver.run(function*() {\n          yield input.click();\n          yield input.type('this is a very long value so deal with it otherwise');\n\n          expect(yield hint.getValue()).to.equal('');\n\n          done();\n        });\n      });\n    });\n\n    describe('on up arrow', function() {\n      it('should cycle through suggestions', function(done) {\n        driver.run(function*() {\n          var suggestions;\n\n          yield input.click();\n          yield input.type('mi');\n\n          suggestions = yield dropdown.elementsByClassName('aa-suggestion');\n\n          yield input.type(wd.SPECIAL_KEYS['Up arrow']);\n          expect(yield input.getValue()).to.equal('Missouri');\n          expect(yield suggestions[3].getAttribute('class')).to.equal('aa-suggestion aa-cursor');\n\n          yield input.type(wd.SPECIAL_KEYS['Up arrow']);\n          expect(yield input.getValue()).to.equal('Mississippi');\n          expect(yield suggestions[2].getAttribute('class')).to.equal('aa-suggestion aa-cursor');\n\n          yield input.type(wd.SPECIAL_KEYS['Up arrow']);\n          expect(yield input.getValue()).to.equal('Minnesota');\n          expect(yield suggestions[1].getAttribute('class')).to.equal('aa-suggestion aa-cursor');\n\n          yield input.type(wd.SPECIAL_KEYS['Up arrow']);\n          expect(yield input.getValue()).to.equal('Michigan');\n          expect(yield suggestions[0].getAttribute('class')).to.equal('aa-suggestion aa-cursor');\n\n          yield input.type(wd.SPECIAL_KEYS['Up arrow']);\n          expect(yield input.getValue()).to.equal('mi');\n          expect(yield suggestions[0].getAttribute('class')).to.equal('aa-suggestion');\n          expect(yield suggestions[1].getAttribute('class')).to.equal('aa-suggestion');\n          expect(yield suggestions[2].getAttribute('class')).to.equal('aa-suggestion');\n          expect(yield suggestions[3].getAttribute('class')).to.equal('aa-suggestion');\n\n          done();\n        });\n      });\n    });\n\n    describe('on down arrow', function() {\n      it('should cycle through suggestions', function(done) {\n        driver.run(function*() {\n          var suggestions;\n\n          yield input.click();\n          yield input.type('mi');\n\n          suggestions = yield dropdown.elementsByClassName('aa-suggestion');\n\n          yield input.type(wd.SPECIAL_KEYS['Down arrow']);\n          expect(yield input.getValue()).to.equal('Michigan');\n          expect(yield suggestions[0].getAttribute('class')).to.equal('aa-suggestion aa-cursor');\n\n          yield input.type(wd.SPECIAL_KEYS['Down arrow']);\n          expect(yield input.getValue()).to.equal('Minnesota');\n          expect(yield suggestions[1].getAttribute('class')).to.equal('aa-suggestion aa-cursor');\n\n          yield input.type(wd.SPECIAL_KEYS['Down arrow']);\n          expect(yield input.getValue()).to.equal('Mississippi');\n          expect(yield suggestions[2].getAttribute('class')).to.equal('aa-suggestion aa-cursor');\n\n          yield input.type(wd.SPECIAL_KEYS['Down arrow']);\n          expect(yield input.getValue()).to.equal('Missouri');\n          expect(yield suggestions[3].getAttribute('class')).to.equal('aa-suggestion aa-cursor');\n\n          yield input.type(wd.SPECIAL_KEYS['Down arrow']);\n          expect(yield input.getValue()).to.equal('mi');\n          expect(yield suggestions[0].getAttribute('class')).to.equal('aa-suggestion');\n          expect(yield suggestions[1].getAttribute('class')).to.equal('aa-suggestion');\n          expect(yield suggestions[2].getAttribute('class')).to.equal('aa-suggestion');\n          expect(yield suggestions[3].getAttribute('class')).to.equal('aa-suggestion');\n\n          done();\n        });\n      });\n    });\n\n    describe('on escape', function() {\n      it('should close dropdown', function(done) {\n        driver.run(function*() {\n          yield input.click();\n          yield input.type('mi');\n          expect(yield dropdown.isDisplayed()).to.equal(true);\n\n          yield input.type(wd.SPECIAL_KEYS['Escape']);\n          expect(yield dropdown.isDisplayed()).to.equal(false);\n\n          done();\n        });\n      });\n\n      it('should clear hint', function(done) {\n        driver.run(function*() {\n          yield input.click();\n          yield input.type('mi');\n          expect(yield hint.getValue()).to.equal('michigan');\n\n          yield input.type(wd.SPECIAL_KEYS['Escape']);\n          expect(yield hint.getValue()).to.equal('');\n\n          done();\n        });\n      });\n    });\n\n    describe('on tab', function() {\n      it('should autocomplete if hint is present', function(done) {\n        driver.run(function*() {\n          yield input.click();\n          yield input.type('mi');\n\n          yield input.type(wd.SPECIAL_KEYS['Tab']);\n          expect(yield input.getValue()).to.equal('Michigan');\n\n          done();\n        });\n      });\n\n      it('should select if cursor is on suggestion', function(done) {\n        driver.run(function*() {\n          var suggestions;\n\n          yield input.click();\n          yield input.type('mi');\n\n          suggestions = yield dropdown.elementsByClassName('aa-suggestion');\n          yield input.type(wd.SPECIAL_KEYS['Down arrow']);\n          yield input.type(wd.SPECIAL_KEYS['Down arrow']);\n          yield input.type(wd.SPECIAL_KEYS['Tab']);\n\n          expect(yield dropdown.isDisplayed()).to.equal(false);\n          expect(yield input.getValue()).to.equal('Minnesota');\n\n          done();\n        });\n      });\n    });\n\n    describe('on right arrow', function() {\n      it('should autocomplete if hint is present', function(done) {\n        driver.run(function*() {\n          yield input.click();\n          yield input.type('mi');\n\n          yield input.type(wd.SPECIAL_KEYS['Right arrow']);\n          expect(yield input.getValue()).to.equal('Michigan');\n\n          done();\n        });\n      });\n    });\n\n    describe('on suggestion click', function() {\n      it('should select suggestion', function(done) {\n        if (browser[0] === 'firefox') {\n          // crazy Firefox issue, skip it\n          done();\n          return;\n        }\n        driver.run(function*() {\n          var suggestions;\n\n          yield input.click();\n          yield input.type('mi');\n\n          suggestions = yield dropdown.elementsByClassName('aa-suggestion');\n          yield suggestions[1].click();\n\n          expect(yield dropdown.isDisplayed()).to.equal(false);\n          expect(yield input.getValue()).to.equal('Minnesota');\n\n          done();\n        });\n      });\n    });\n\n    describe('on enter', function() {\n      it('should select if cursor is on suggestion', function(done) {\n        driver.run(function*() {\n          var suggestions;\n\n          yield input.click();\n          yield input.type('mi');\n\n          suggestions = yield dropdown.elementsByClassName('aa-suggestion');\n          yield input.type(wd.SPECIAL_KEYS['Down arrow']);\n          yield input.type(wd.SPECIAL_KEYS['Down arrow']);\n          yield input.type(wd.SPECIAL_KEYS['Return']);\n\n          expect(yield dropdown.isDisplayed()).to.equal(false);\n          expect(yield input.getValue()).to.equal('Minnesota');\n\n          done();\n        });\n      });\n    });\n  }\n\n  testSuite();\n  describe('appendTo', function () {\n    before('all', function*() {\n      yield this.execute(\"buildAutocomplete({hint: false, appendTo: 'body'})\");\n    });\n\n    testSuite();\n  });\n});\n"
  },
  {
    "path": "js/autocomplete.js/test/playground.css",
    "content": ".my-custom-menu {\n  width: 400px;\n}\n\n.aa-cursor {\n  background: #F6624E;\n  color: white;\n}\n\n.autocomplete-wrapper {\n  display: block;\n  margin: 50px 0;\n}\n\n.aa-dropdown-menu {\n  min-width: 100%;\n  border: 1px solid #ccc;\n  background-color: white;\n  padding: 4px;\n}\n.aa-suggestion {\n  padding: 5px 10px;\n}\n.aa-suggestion em{\n  font-style: normal;\n  font-weight: bold;\n}\n.aa-info-results {\n  padding: 4px;\n  color: #aaa;\n  font-style: italic;\n  text-align: right;\n}\n.aa-category-title{\n  display: block;\n  width: 100%;\n  padding: 8px 4px 4px;\n  border-bottom: solid 1px #eee;\n  font-size: .8em;\n  color: #F6624E;\n  font-weight: bold;\n  text-transform: uppercase;\n}\n.aa-dropdown-footer{\n  padding: 10px 12px 6px 12px;\n  margin-top: 12px;\n  border-top: solid 1px #eee;\n  text-align: right;\n  color: #aaa;\n  font-size: 12px;\n  letter-spacing: 1px;\n}\n"
  },
  {
    "path": "js/autocomplete.js/test/playground.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css\">\n    <link rel=\"stylesheet\" href=\"playground.css\">\n  </head>\n  <body>\n    <div class=\"container\">\n      <form action=\"#\">\n        <div class=\"autocomplete-wrapper\">\n          <div class=\"form-group\">\n            <div class=\"col-sm-3\">\n              <h4>Simple auto-complete</h4>\n              <div class=\"input-group\">\n                <input id=\"contacts\" name=\"contacts\" class=\"form-control\" type=\"text\">\n                <input id=\"contacts1\" name=\"contacts1\" class=\"form-control\" type=\"text\">\n                <span class=\"input-group-addon\">Go</span>\n              </div>\n            </div>\n            <div class=\"col-sm-3\">\n              <h4>Multi-sections auto-complete</h4>\n              <div class=\"input-group\">\n                <input id=\"contacts2\" name=\"contacts2\" class=\"form-control\" type=\"text\" placeholder=\"Search actors in movie types\">\n                <span class=\"input-group-addon\">Go</span>\n              </div>\n            </div>\n            <div class=\"col-sm-3\">\n              <h4>Simple auto-complete with debounce</h4>\n              <div class=\"input-group\">\n                <input id=\"contacts3\" name=\"contacts3\" class=\"form-control\" type=\"text\" placeholder=\"Search actors\">\n                <span class=\"input-group-addon\">Go</span>\n              </div>\n            </div>\n            <div class=\"col-sm-3\">\n              <h4>Multi-indexes auto-complete</h4>\n              <div class=\"input-group\">\n                <input id=\"contacts4\" name=\"contacts4\" class=\"form-control\" type=\"text\" placeholder=\"Search actors in movie types\">\n                <span class=\"input-group-addon\">Go</span>\n              </div>\n            </div>\n          </div>\n        </div>\n      </form>\n    </div>\n\n    <script src=\"../dist/autocomplete.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/algoliasearch/3/algoliasearch.min.js\"></script>\n    <script type=\"text/template\" id=\"my-custom-menu-template\">\n      <div class=\"my-custom-menu\">\n        <div class=\"row\">\n          <div class=\"col-sm-6\">\n            <div class=\"aa-dataset-contacts1\"></div>\n          </div>\n          <div class=\"col-sm-6\">\n            <div class=\"aa-dataset-contacts2\"></div>\n            <div class=\"aa-dataset-contacts3\"></div>\n          </div>\n        </div>\n      </div>\n    </script>\n    <script>\n      var client = algoliasearch('latency', '6be0576ff61c053d5f9a3225e2a90f76');\n      var index = client.initIndex('contacts');\n      var actors = client.initIndex('actors');\n      var movies = client.initIndex('movies');\n\n      autocomplete('#contacts, #contacts1', { debug: true, hint: false, templates: { empty: 'empty' }, autoselect: true, appendTo: 'body' }, [\n        {\n          source: autocomplete.sources.hits(index),\n          displayKey: 'name',\n          templates: {\n            footer: function(o, content) {\n              return '<div class=\"aa-info-results\">' + content.nbHits + ' results</div>';\n            },\n            suggestion: function(suggestion) {\n              return '<div>' + suggestion._highlightResult.name.value + '</div>';\n            }\n          }\n        }\n      ]).on('autocomplete:selected', function(event, suggestion, dataset, context) {\n        console.log('selected', suggestion, dataset, context);\n      }).on('autocomplete:cursorchanged', function(event, suggestion, dataset) {\n        console.log('cursorchanged', suggestion, dataset);\n      });\n\n      autocomplete('#contacts2', {\n        debug: true,\n        keyboardShortcuts: [191, 's'],\n        hint: false,\n        appendTo: 'h4',\n        templates: {\n          empty: function(data) {\n            return 'No results for \"<strong>' + data.query.replace(/[^-_'a-zA-Z0-9 ]/, ' ') + '</strong>\"';\n          }\n        }\n      }, [\n        {\n          source: autocomplete.sources.popularIn(\n            actors,\n            { hitsPerPage: 3 },\n            {\n              index: movies,\n              source: 'name',\n              facets: 'genre',\n              maxValuesPerFacet: 3\n            }\n          ),\n          templates: {\n            header: '<span class=\"aa-category-title\">Actors</span>',\n            suggestion: function(suggestion) {\n              var v = suggestion._highlightResult.name.value;\n              if (suggestion.facet) {\n                v += ' in <b>' + suggestion.facet.value + '</b>';\n              }\n              return v;\n            }\n          }\n        },\n        {\n          source: autocomplete.sources.hits(index, { hitsPerPage: 5 }),\n          displayKey: 'name',\n          templates: {\n            header: '<span class=\"aa-category-title\">Contacts</span>',\n            footer: function(o, content) {\n              return '<div class=\"aa-info-results\">' + content.nbHits + ' results</div>';\n            },\n            suggestion: function(suggestion) {\n              return '<div>' + suggestion._highlightResult.firstname.value + '</div>';\n            }\n          }\n        }\n      ]).on('autocomplete:selected', function(even, suggestion, dataset) {\n        console.log('selected', suggestion, dataset);\n      }).on('autocomplete:shown', function() {\n        console.log('shown');\n      });\n\n      autocomplete('#contacts3', { debug: true, hint: false, templates: { empty: 'empty' }, autoselect: true, appendTo: 'body' }, [\n        {\n          debounce: 1000,\n          source: autocomplete.sources.hits(actors),\n          displayKey: 'name',\n          templates: {\n            footer: function(o, content) {\n              return '<div class=\"aa-info-results\">' + content.nbHits + ' results</div>';\n            },\n            suggestion: function(suggestion) {\n              return '<div>' + suggestion._highlightResult.name.value + '</div>';\n            }\n          }\n        }\n      ]).on('autocomplete:selected', function(even, suggestion, dataset) {\n        console.log('selected', suggestion, dataset);\n      }).on('autocomplete:cursorchanged', function(even, suggestion, dataset) {\n        console.log('cursorchanged', suggestion, dataset);\n      });\n\n\n      autocomplete('#contacts4', {\n        debug: true,\n        keyboardShortcuts: [191, 's'],\n        hint: false,\n        appendTo: 'h4',\n        templates: {\n          empty: function(data) {\n            return 'No results for \"<strong>' + data.query.replace(/[^-_'a-zA-Z0-9 ]/, ' ') + '</strong>\"';\n          }\n        }\n      }, [\n        {\n          source: autocomplete.sources.hits(actors, { hitsPerPage: 5 }),\n          templates: {\n            header: '<span class=\"aa-category-title\">Actors</span>',\n            suggestion: function(suggestion) {\n              var v = suggestion._highlightResult.name.value;\n              if (suggestion.facet) {\n                v += ' in <b>' + suggestion.facet.value + '</b>';\n              }\n              return v;\n            }\n          }\n        },\n        {\n          source: autocomplete.sources.hits(index, { hitsPerPage: 5 }),\n          templates: {\n            header: '<span class=\"aa-category-title\">Contacts</span>',\n            footer: function(o, content) {\n              return '<div class=\"aa-info-results\">' + content.nbHits + ' results</div>';\n            },\n            suggestion: function(suggestion) {\n              return '<div>' + suggestion._highlightResult.firstname.value + '</div>';\n            }\n          }\n        }\n      ]).on('autocomplete:selected', function(even, suggestion, dataset) {\n        console.log('selected', suggestion, dataset);\n      }).on('autocomplete:shown', function() {\n        console.log('shown');\n      });\n\n    </script>\n  </body>\n</html>\n"
  },
  {
    "path": "js/autocomplete.js/test/playground_angular.html",
    "content": "<!DOCTYPE html>\n<html ng-app=\"myApp\">\n  <head>\n    <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css\">\n    <link rel=\"stylesheet\" href=\"playground.css\">\n  </head>\n  <body ng-controller=\"searchController\">\n    <div class=\"container\">\n      <form action=\"#\">\n        <div class=\"autocomplete-wrapper\">\n          <div class=\"form-group\">\n            <div class=\"col-sm-4\">\n              <h4>Simple auto-complete</h4>\n              <div class=\"input-group\">\n                <input id=\"contacts\" name=\"contacts\" class=\"form-control\" type=\"text\" ng-model=\"q\" autocomplete aa-datasets=\"getDatasets()\" aa-options=\"{ appendTo: 'body', debug: true, hint: false }\" />\n                <span class=\"input-group-addon\">Go</span>\n              </div>\n            </div>\n          </div>\n        </div>\n      </form>\n    </div>\n\n    <script src=\"../node_modules/jquery/dist/jquery.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.2/angular.min.js\"></script>\n    <script src=\"../dist/autocomplete.angular.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/algoliasearch/3/algoliasearch.angular.min.js\"></script>\n    <script>\n    angular.module('myApp', ['algoliasearch', 'algolia.autocomplete']).controller('searchController', ['$scope', 'algolia', function($scope, algolia) {\n      $scope.q = '';\n      var client = algolia.Client('latency', '6be0576ff61c053d5f9a3225e2a90f76');\n      var index = client.initIndex('contacts');\n\n      $scope.getDatasets = function() {\n        return {\n          source: algolia.sources.hits(index, { hitsPerPage: 5 }),\n          templates: {\n            suggestion: function(suggestion) {\n              return suggestion._highlightResult.name.value;\n            }\n          }\n        };\n      };\n\n      $scope.$watch('q', function(v) {\n        console.log(v);\n      });\n\n      $scope.$on('autocomplete:selected', function(event, suggestion, dataset) {\n        console.log(suggestion, dataset);\n      });\n    }]);\n    </script>\n  </body>\n</html>\n"
  },
  {
    "path": "js/autocomplete.js/test/playground_jquery.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css\">\n    <link rel=\"stylesheet\" href=\"playground.css\">\n  </head>\n  <body>\n    <div class=\"container\">\n      <form action=\"#\">\n        <div class=\"autocomplete-wrapper\">\n          <div class=\"form-group\">\n            <div class=\"col-sm-4\">\n              <h4>Simple auto-complete</h4>\n              <div class=\"input-group\">\n                <input id=\"contacts\" name=\"contacts\" class=\"form-control\" type=\"text\">\n                <span class=\"input-group-addon\">Go</span>\n              </div>\n            </div>\n            <div class=\"col-sm-4\">\n              <h4>Multi-sections auto-complete</h4>\n              <input id=\"contacts2\" name=\"contacts2\"  class=\"form-control\" type=\"text\">\n            </div>\n            <div class=\"col-sm-4\">\n              <h4>Tabbed auto-complete</h4>\n              <div class=\"input-group\">\n                <input id=\"q3\" name=\"q3\" class=\"form-control\" type=\"text\">\n                <span class=\"input-group-addon\">Go</span>\n              </div>\n            </div>\n          </div>\n        </div>\n      </form>\n    </div>\n\n    <script src=\"../node_modules/jquery/dist/jquery.js\"></script>\n    <script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js\"></script>\n    <script src=\"../dist/autocomplete.jquery.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/algoliasearch/3/algoliasearch.min.js\"></script>\n\n    <script type=\"text/template\" id=\"my-custom-menu-template\">\n      <div class=\"my-custom-menu\">\n        <div class=\"row\">\n          <div class=\"col-sm-6\">\n            <div class=\"aa-dataset-contacts1\"></div>\n          </div>\n          <div class=\"col-sm-6\">\n            <div class=\"aa-dataset-contacts2\"></div>\n            <div class=\"aa-dataset-contacts3\"></div>\n          </div>\n        </div>\n      </div>\n    </script>\n\n    <script type=\"text/template\" id=\"menu3\">\n      <ul class=\"nav nav-tabs\">\n        <li class=\"active\"><a href=\"#all\" role=\"tab\" data-toggle=\"tab\">All</a></li>\n        <li><a href=\"#actors\" role=\"tab\" data-toggle=\"tab\">Actors</a></li>\n        <li><a href=\"#shows\" role=\"tab\" data-toggle=\"tab\">Shows</a></li>\n        <li><a href=\"#episodes\" role=\"tab\" data-toggle=\"tab\">Episodes</a></li>\n      </ul>\n      <div class=\"tab-content\">\n        <div class=\"tab-pane active aa-dataset-all\" id=\"all\"></div>\n        <div class=\"tab-pane aa-dataset-actors\" id=\"actors\"></div>\n        <div class=\"tab-pane aa-dataset-shows\" id=\"shows\"></div>\n        <div class=\"tab-pane aa-dataset-episodes\" id=\"episodes\"></div>\n      </div>\n    </script>\n\n    <script>\n      var client = algoliasearch('latency', '6be0576ff61c053d5f9a3225e2a90f76');\n      var index = client.initIndex('contacts');\n      var tvshows = client.initIndex('tvshows_tae_followers');\n\n      $('#contacts').autocomplete({ hint: true }, [\n        {\n          source: function(q, cb) {\n            index.search(q, { hitsPerPage: 5 }, function(error, content) {\n              if (error) {\n                cb([]);\n                return;\n              }\n              cb(content.hits, content);\n            });\n          },\n          displayKey: 'name',\n          templates: {\n            footer: function(o, content) {\n              return '<div class=\"aa-info-results\">' + content.nbHits + ' results</div>';\n            },\n            suggestion: function(suggestion) {\n              return suggestion._highlightResult.name.value;\n            }\n          }\n        }\n      ]);\n\n      //////////////////////////////\n\n      $('#contacts2').autocomplete({\n        debug: true,\n        hint: false,\n        appendTo: 'body',\n        templates: {\n          dropdownMenu: '#my-custom-menu-template',\n          footer: '<div class=\"aa-dropdown-footer\">Search by<img class=\"aa-logo\" src=\"https://www.algolia.com/assets/algolia128x40.png\" width=80/></div>'\n        }\n      }, [\n        {\n          source: index.ttAdapter({ hitsPerPage: 5 }),\n          name: 'contacts1',\n          templates: {\n            header: '<span class=\"aa-category-title\">List 1</span>',\n            suggestion: function(suggestion) {\n              return suggestion._highlightResult.name.value;\n            }\n          }\n        },\n        {\n          source: index.ttAdapter({ hitsPerPage: 2 }),\n          name: 'contacts2',\n          templates: {\n            header: '<span class=\"aa-category-title\">List 2</span>',\n            suggestion: function(suggestion) {\n              return suggestion._highlightResult.name.value;\n            }\n          }\n        },\n        {\n          source: index.ttAdapter({ hitsPerPage: 2 }),\n          name: 'contacts3',\n          templates: {\n            header: '<span class=\"aa-category-title\">List 3</span>',\n            suggestion: function(suggestion, answer) {\n              return suggestion._highlightResult.name.value;\n            }\n          }\n        }\n      ]);\n\n      //////////////////////////////\n\n      function render3(suggestion) {\n        var name;\n        if (suggestion._tags[0] === 'actor') {\n          name = suggestion._highlightResult.actor_name.value;\n        } else if (suggestion._tags[0] === 'show') {\n          name = suggestion._highlightResult.show_name.value;\n        } else if (suggestion._tags[0] === 'episode') {\n          name = suggestion._highlightResult.episode_of.value + ' » ' + suggestion._highlightResult.episode_name.value;\n        }\n        return '<div class=\"media\">' +\n            '<div class=\"media-left\">' +\n              '<img src=\"' + suggestion.image + '\" class=\"media-object\" style=\"height: 3em\" />' +\n            '</div>' +\n            '<div class=\"media-body\">' +\n              name +\n            '</div>' +\n          '</div>';\n      }\n\n      function source3(tagFilters) {\n        return function(q, cb) {\n          tvshows.search(q, { hitsPerPage: 5, tagFilters: tagFilters }, function(error, content) {\n            if (error) {\n              cb([]);\n              return;\n            }\n            cb(content.hits);\n          });\n        }\n      }\n\n      $('#q3').autocomplete({ debug: true, templates: { dropdownMenu: $('#menu3').text() } }, [\n        {\n          source: source3(),\n          name: 'all',\n          templates: {\n            suggestion: render3\n          }\n        },\n        {\n          source: source3(['actor']),\n          name: 'actors',\n          templates: {\n            suggestion: render3\n          }\n        },\n        {\n          source: source3(['show']),\n          name: 'shows',\n          templates: {\n            suggestion: render3\n          }\n        },\n        {\n          source: source3(['episode']),\n          name: 'episodes',\n          templates: {\n            suggestion: render3\n          }\n        }\n      ]).on('autocomplete:selected', function(even, suggestion, dataset) {\n        console.log(suggestion, dataset);\n      });\n    </script>\n  </body>\n</html>\n"
  },
  {
    "path": "js/autocomplete.js/test/test.bundle.js",
    "content": "'use strict';\n\nvar context = require.context('.', true, /.+_spec\\.js$/);\ncontext.keys().forEach(context);\nmodule.exports = context;\n"
  },
  {
    "path": "js/autocomplete.js/test/unit/angular_spec.js",
    "content": "'use strict';\n\n/* eslint-env mocha, jasmine */\n\nif (typeof Function.prototype.bind != 'function') {\n  Function.prototype.bind = function bind(obj) {\n    var args = Array.prototype.slice.call(arguments, 1),\n      self = this,\n      nop = function() {\n      },\n      bound = function() {\n        return self.apply(\n          this instanceof nop ? this : (obj || {}), args.concat(\n            Array.prototype.slice.call(arguments)\n          )\n        );\n      };\n    nop.prototype = this.prototype || {};\n    bound.prototype = new nop();\n    return bound;\n  };\n}\n\ndescribe('autocomplete directive', function() {\n  global.jQuery = require('jquery');\n  var fixtures = require('../fixtures.js');\n\n  var angular = require('angular');\n  require('../../src/angular/directive.js');\n  require('angular-mocks');\n\n  var scope;\n\n  beforeEach(angular.mock.module('algolia.autocomplete'));\n\n  describe('with scope', function() {\n    beforeEach(angular.mock.inject(function($rootScope, $compile) {\n      scope = $rootScope.$new();\n      scope.q = '';\n      scope.getDatasets = function() {\n        return [];\n      };\n    }));\n\n    describe('when initialized', function() {\n      var form;\n\n      beforeEach(function() {\n        inject(function($compile) {\n          form = $compile(fixtures.html.angularTextInput)(scope);\n        });\n        scope.$digest();\n      });\n\n      it('should have a parent', function() {\n        expect(form.parent().length).toEqual(1);\n      });\n    });\n  });\n\n  afterAll(function() {\n    global.jQuery = undefined;\n  });\n});\n"
  },
  {
    "path": "js/autocomplete.js/test/unit/dataset_spec.js",
    "content": "'use strict';\n\n/* eslint-env mocha, jasmine */\n\n\ndescribe('Dataset', function() {\n  require('../../src/common/dom.js').element = require('jquery');\n  require('../../src/jquery/plugin.js');\n\n  var $ = require('jquery');\n  require('jasmine-jquery');\n\n  var Dataset = require('../../src/autocomplete/dataset.js');\n\n  beforeEach(function() {\n    this.dataset = new Dataset({\n      name: 'test',\n      source: this.source = jasmine.createSpy('source')\n    });\n  });\n\n  it('should throw an error if source is missing', function() {\n    expect(noSource).toThrow();\n\n    function noSource() {\n      new Dataset();\n    }\n  });\n\n  it('should throw an error if the name is not a valid class name', function() {\n    expect(fn).toThrow();\n\n    function fn() {\n      var d = new Dataset({name: 'a space', source: $.noop});\n    }\n  });\n\n  describe('#getRoot', function() {\n    it('should return the root element', function() {\n      expect(this.dataset.getRoot()).toBeMatchedBy('div.aa-dataset-test');\n    });\n  });\n\n  describe('#update', function() {\n    it('should render suggestions', function() {\n      this.source.and.callFake(fakeGetWithSyncResults);\n      this.dataset.update('woah');\n\n      expect(this.dataset.getRoot()).toContainText('one');\n      expect(this.dataset.getRoot()).toContainText('two');\n      expect(this.dataset.getRoot()).toContainText('three');\n    });\n\n    it('should allow custom display functions', function() {\n      this.dataset = new Dataset({\n        name: 'test',\n        display: function(o) { return o.display; },\n        source: this.source = jasmine.createSpy('source')\n      });\n\n      this.source.and.callFake(fakeGetForDisplayFn);\n      this.dataset.update('woah');\n\n      expect(this.dataset.getRoot()).toContainText('4');\n      expect(this.dataset.getRoot()).toContainText('5');\n      expect(this.dataset.getRoot()).toContainText('6');\n    });\n\n    it('should render empty when no suggestions are available', function() {\n      this.dataset = new Dataset({\n        source: this.source,\n        templates: {\n          empty: '<h2>empty</h2>'\n        }\n      });\n\n      this.source.and.callFake(fakeGetWithSyncEmptyResults);\n      this.dataset.update('woah');\n\n      expect(this.dataset.getRoot()).toContainText('empty');\n    });\n\n    it('should throw an error if suggestions is not an array', function() {\n      this.source.and.callFake(fakeGetWithSyncNonArrayResults);\n      expect(this.dataset.update.bind(this.dataset, 'woah'))\n        .toThrowError(TypeError, 'suggestions must be an array');\n    });\n\n    it('should set the aa-without class when no suggestions are available', function() {\n      var $menu = $('<div />');\n      this.dataset = new Dataset({\n        $menu: $menu,\n        source: this.source,\n        templates: {\n          empty: '<h2>empty</h2>'\n        }\n      });\n\n      this.source.and.callFake(fakeGetWithSyncEmptyResults);\n      this.dataset.update('woah');\n\n      expect($menu).toHaveClass('aa-without-1');\n      expect($menu).not.toHaveClass('aa-with-1');\n    });\n\n    it('should set the aa-with class when suggestions are available', function() {\n      var $menu = $('<div />');\n      this.dataset = new Dataset({\n        $menu: $menu,\n        name: 'fake',\n        source: this.source,\n        templates: {\n          empty: '<h2>empty</h2>'\n        }\n      });\n\n      this.source.and.callFake(fakeGetWithSyncResults);\n      this.dataset.update('woah');\n\n      expect($menu).not.toHaveClass('aa-without-fake');\n      expect($menu).toHaveClass('aa-with-fake');\n    });\n\n    it('should allow dataset name=0 and use the provided div', function() {\n      var $menu = $('<div><div class=\"predefined aa-dataset-0\"></div></div>');\n      this.dataset = new Dataset({\n        $menu: $menu,\n        name: 0,\n        source: this.source\n      });\n      expect(this.dataset.$el).toHaveClass('predefined');\n    });\n\n    it('should render isEmpty with extra params', function() {\n      var spy = jasmine.createSpy('empty with extra params');\n      this.dataset = new Dataset({\n        source: this.source,\n        templates: {\n          empty: spy\n        }\n      });\n\n      this.source.and.callFake(fakeGetWithSyncEmptyResultsAndExtraParams);\n      this.dataset.update('woah');\n\n      expect(spy).toHaveBeenCalled();\n      expect(spy.calls.argsFor(0).length).toEqual(4);\n      expect(spy.calls.argsFor(0)[0]).toEqual({query: 'woah', isEmpty: true});\n      expect(spy.calls.argsFor(0)[1]).toEqual(42);\n      expect(spy.calls.argsFor(0)[2]).toEqual(true);\n      expect(spy.calls.argsFor(0)[3]).toEqual(false);\n    });\n\n    it('should render with extra params', function() {\n      var headerSpy = jasmine.createSpy('header with extra params');\n      var footerSpy = jasmine.createSpy('footer with extra params');\n      var suggestionSpy = jasmine.createSpy('suggestion with extra params');\n      this.dataset = new Dataset({\n        source: this.source,\n        templates: {\n          header: headerSpy,\n          footer: footerSpy,\n          suggestion: suggestionSpy\n        }\n      });\n\n      var suggestions;\n      fakeGetWithSyncResultsAndExtraParams('woah', function(all) {\n        suggestions = all;\n      });\n\n      this.source.and.callFake(fakeGetWithSyncResultsAndExtraParams);\n      this.dataset.update('woah');\n\n      expect(headerSpy).toHaveBeenCalled();\n      expect(headerSpy.calls.argsFor(0).length).toEqual(4);\n      expect(headerSpy.calls.argsFor(0)[0]).toEqual({query: 'woah', isEmpty: false});\n      expect(headerSpy.calls.argsFor(0)[1]).toEqual(42);\n      expect(headerSpy.calls.argsFor(0)[2]).toEqual(true);\n      expect(headerSpy.calls.argsFor(0)[3]).toEqual(false);\n\n      expect(footerSpy).toHaveBeenCalled();\n      expect(footerSpy.calls.argsFor(0).length).toEqual(4);\n      expect(footerSpy.calls.argsFor(0)[0]).toEqual({query: 'woah', isEmpty: false});\n      expect(footerSpy.calls.argsFor(0)[1]).toEqual(42);\n      expect(footerSpy.calls.argsFor(0)[2]).toEqual(true);\n      expect(footerSpy.calls.argsFor(0)[3]).toEqual(false);\n\n      expect(suggestionSpy).toHaveBeenCalled();\n      for (var i = 0; i < 2; ++i) {\n        expect(suggestionSpy.calls.argsFor(i).length).toEqual(4);\n        expect(suggestionSpy.calls.argsFor(i)[0]).toEqual(suggestions[i]);\n        expect(suggestionSpy.calls.argsFor(i)[1]).toEqual(42);\n        expect(suggestionSpy.calls.argsFor(i)[2]).toEqual(true);\n        expect(suggestionSpy.calls.argsFor(i)[3]).toEqual(false);\n      }\n    });\n\n    it('should render header', function() {\n      this.dataset = new Dataset({\n        source: this.source,\n        templates: {\n          header: '<h2>header</h2>'\n        }\n      });\n\n      this.source.and.callFake(fakeGetWithSyncResults);\n      this.dataset.update('woah');\n\n      expect(this.dataset.getRoot()).toContainText('header');\n    });\n\n    it('should render footer', function() {\n      this.dataset = new Dataset({\n        source: this.source,\n        templates: {\n          footer: function(c) { return '<p>' + c.query + '</p>'; }\n        }\n      });\n\n      this.source.and.callFake(fakeGetWithSyncResults);\n      this.dataset.update('woah');\n\n      expect(this.dataset.getRoot()).toContainText('woah');\n    });\n\n    it('should not render header/footer if there is no content', function() {\n      this.dataset = new Dataset({\n        source: this.source,\n        templates: {\n          header: '<h2>header</h2>',\n          footer: '<h2>footer</h2>'\n        }\n      });\n\n      this.source.and.callFake(fakeGetWithSyncEmptyResults);\n      this.dataset.update('woah');\n\n      expect(this.dataset.getRoot()).not.toContainText('header');\n      expect(this.dataset.getRoot()).not.toContainText('footer');\n    });\n\n    it('should not render stale suggestions', function(done) {\n      this.source.and.callFake(fakeGetWithAsyncResults);\n      this.dataset.update('woah');\n\n      this.source.and.callFake(fakeGetWithSyncResults);\n      this.dataset.update('nelly');\n\n      var that = this;\n      setTimeout(function() {\n        expect(that.dataset.getRoot()).toContainText('one');\n        expect(that.dataset.getRoot()).toContainText('two');\n        expect(that.dataset.getRoot()).toContainText('three');\n        expect(that.dataset.getRoot()).not.toContainText('four');\n        expect(that.dataset.getRoot()).not.toContainText('five');\n        done();\n      }, 100);\n    });\n\n    it('should not render suggestions if update was canceled', function(done) {\n      this.source.and.callFake(fakeGetWithAsyncResults);\n      this.dataset.update('woah');\n      this.dataset.cancel();\n\n      var that = this;\n      setTimeout(function() {\n        expect(that.dataset.getRoot()).toBeEmpty();\n        done();\n      }, 100);\n    });\n\n    it('should trigger rendered after suggestions are rendered', function(done) {\n      var spy;\n\n      this.dataset.onSync('rendered', spy = jasmine.createSpy());\n\n      this.source.and.callFake(fakeGetWithSyncResults);\n      this.dataset.update('woah');\n\n      setTimeout(function() {\n        expect(spy.calls.count()).toBe(1);\n        done();\n      }, 100);\n    });\n\n    it('should cache latest query, suggestions and extra render arguments', function() {\n      this.source.and.callFake(fakeGetWithSyncResultsAndExtraParams);\n      this.dataset.update('woah');\n\n      expect(this.dataset.cachedQuery).toEqual('woah');\n      expect(this.dataset.cachedSuggestions).toEqual([\n        {value: 'one', raw: {value: 'one'}},\n        {value: 'two', raw: {value: 'two'}},\n        {value: 'three', raw: {value: 'three'}}\n      ]);\n      expect(this.dataset.cachedRenderExtraArgs).toEqual([42, true, false]);\n    });\n\n    it('should retrieve cached results for subsequent identical queries', function() {\n      this.source.and.callFake(fakeGetWithSyncResults);\n\n      this.dataset.update('woah');\n      expect(this.source.calls.count()).toBe(1);\n      expect(this.dataset.getRoot()).toContainText('one');\n      expect(this.dataset.getRoot()).toContainText('two');\n      expect(this.dataset.getRoot()).toContainText('three');\n\n      this.dataset.clear();\n      this.dataset.update('woah');\n      expect(this.source.calls.count()).toBe(1);\n      expect(this.dataset.getRoot()).toContainText('one');\n      expect(this.dataset.getRoot()).toContainText('two');\n      expect(this.dataset.getRoot()).toContainText('three');\n    });\n\n    it('should not retrieve cached results for subsequent identical queries if cache is disabled', function() {\n      this.dataset = new Dataset({\n        name: 'test',\n        source: this.source = jasmine.createSpy('source'),\n        cache: false,\n      });\n\n      this.source.and.callFake(fakeGetWithSyncResultsAndExtraParams);\n\n      this.dataset.update('woah');\n      expect(this.source.calls.count()).toBe(1);\n      expect(this.dataset.getRoot()).toContainText('one');\n      expect(this.dataset.getRoot()).toContainText('two');\n      expect(this.dataset.getRoot()).toContainText('three');\n\n      this.dataset.clear();\n      this.dataset.update('woah');\n      expect(this.source.calls.count()).toBe(2);\n      expect(this.dataset.getRoot()).toContainText('one');\n      expect(this.dataset.getRoot()).toContainText('two');\n      expect(this.dataset.getRoot()).toContainText('three');\n    });\n\n    it('should reuse render function extra params for subsequent identical queries', function() {\n      var spy = spyOn(this.dataset, '_render');\n      this.source.and.callFake(fakeGetWithSyncResultsAndExtraParams);\n\n      this.dataset.update('woah');\n      expect(this.source.calls.count()).toBe(1);\n      expect(spy.calls.argsFor(0)).toEqual([\n        'woah', [\n        {value: 'one', raw: {value: 'one'}},\n        {value: 'two', raw: {value: 'two'}},\n        {value: 'three', raw: {value: 'three'}}\n      ], 42, true, false]);\n\n      this.dataset.clear();\n      this.dataset.update('woah');\n      expect(this.source.calls.count()).toBe(1);\n      expect(spy.calls.argsFor(1)).toEqual([\n        'woah', [\n        {value: 'one', raw: {value: 'one'}},\n        {value: 'two', raw: {value: 'two'}},\n        {value: 'three', raw: {value: 'three'}}\n      ], 42, true, false]);\n    });\n\n    it('should not retrieved cached results for subsequent different queries', function() {\n      this.source.and.callFake(fakeGetWithSyncResultsAndExtraParams);\n\n      this.dataset.update('woah');\n      expect(this.source.calls.count()).toBe(1);\n\n      this.dataset.clear();\n      this.dataset.update('woah 2');\n      expect(this.source.calls.count()).toBe(2);\n    });\n\n    it('should wait before calling the source if debounce is provided', function(done) {\n      var that = this;\n\n      this.dataset = new Dataset({\n        source: this.source,\n        debounce: 250\n      });\n\n      this.source.and.callFake(fakeGetWithSyncResultsAndExtraParams);\n\n      this.dataset.update('woah');\n      expect(this.source.calls.count()).toBe(0);\n\n      this.dataset.update('woah 2');\n      expect(this.source.calls.count()).toBe(0);\n\n      setTimeout(function() {\n        expect(that.source.calls.count()).toBe(1);\n        done();\n      }, 500);\n    });\n\n    it('should not call the source if update was canceled', function(done) {\n      var that = this;\n\n      this.dataset = new Dataset({\n        source: this.source,\n        debounce: 250\n      });\n\n      this.source.and.callFake(fakeGetWithSyncResultsAndExtraParams);\n\n      this.dataset.update('woah');\n      expect(this.source.calls.count()).toBe(0);\n\n      this.dataset.update('woah 2');\n      expect(this.source.calls.count()).toBe(0);\n\n      this.dataset.clear();\n      expect(this.source.calls.count()).toBe(0);\n\n      setTimeout(function() {\n        expect(that.source.calls.count()).toBe(0);\n        done();\n      }, 500);\n    });\n  });\n\n  describe('#cacheSuggestions', function() {\n    it('should assign cachedQuery, cachedSuggestions and cachedRenderArgs properties', function() {\n      this.dataset.cacheSuggestions('woah', ['one', 'two'], 42);\n      expect(this.dataset.cachedQuery).toEqual('woah');\n      expect(this.dataset.cachedSuggestions).toEqual(['one', 'two']);\n      expect(this.dataset.cachedRenderExtraArgs).toEqual(42);\n    });\n  });\n\n  describe('#clearCachedSuggestions', function() {\n    it('should delete cachedQuery and cachedSuggestions properties', function() {\n      this.dataset.cachedQuery = 'one';\n      this.dataset.cachedSuggestions = ['one', 'two'];\n      this.dataset.cachedRenderExtraArgs = 42;\n\n      this.dataset.clearCachedSuggestions();\n\n      expect(this.dataset.cachedQuery).toBeUndefined();\n      expect(this.dataset.cachedSuggestions).toBeUndefined();\n      expect(this.dataset.cachedRenderExtraArgs).toBeUndefined();\n    });\n  });\n\n  describe('#clear', function() {\n    it('should clear suggestions', function() {\n      this.source.and.callFake(fakeGetWithSyncResults);\n      this.dataset.update('woah');\n\n      this.dataset.clear();\n      expect(this.dataset.getRoot()).toBeEmpty();\n    });\n\n    it('should cancel pending updates', function() {\n      var spy = spyOn(this.dataset, 'cancel');\n\n      this.source.and.callFake(fakeGetWithSyncResults);\n      this.dataset.update('woah');\n      expect(this.dataset.canceled).toBe(false);\n\n      this.dataset.clear();\n      expect(spy).toHaveBeenCalled();\n    });\n\n    it('should not throw if called right after destroy()', function() {\n      this.source.and.callFake(fakeGetWithSyncResults);\n      this.dataset.update('woah');\n      this.dataset.destroy();\n      this.dataset.clear();\n      expect(this.dataset.getRoot()).toBeNull();\n    });\n  });\n\n  describe('#isEmpty', function() {\n    it('should return true when empty', function() {\n      expect(this.dataset.isEmpty()).toBe(true);\n    });\n\n    it('should return false when not empty', function() {\n      this.source.and.callFake(fakeGetWithSyncResults);\n      this.dataset.update('woah');\n\n      expect(this.dataset.isEmpty()).toBe(false);\n    });\n  });\n\n  describe('#destroy', function() {\n    it('should null out the reference to the dataset element', function() {\n      this.dataset.destroy();\n\n      expect(this.dataset.$el).toBeNull();\n    });\n\n    it('should clear suggestion cache', function() {\n      var spy = spyOn(this.dataset, 'clearCachedSuggestions');\n      this.dataset.destroy();\n      expect(spy).toHaveBeenCalled();\n    });\n  });\n\n  // helper functions\n  // ----------------\n\n  function fakeGetWithSyncResults(query, cb) {\n    cb([\n      {value: 'one', raw: {value: 'one'}},\n      {value: 'two', raw: {value: 'two'}},\n      {value: 'three', raw: {value: 'three'}}\n    ]);\n  }\n\n  function fakeGetForDisplayFn(query, cb) {\n    cb([{display: '4'}, {display: '5'}, {display: '6'}]);\n  }\n\n  function fakeGetWithSyncNonArrayResults(query, cb) {\n    cb({});\n  }\n\n  function fakeGetWithSyncEmptyResults(query, cb) {\n    cb();\n  }\n\n  function fakeGetWithSyncEmptyResultsAndExtraParams(query, cb) {\n    cb([], 42, true, false);\n  }\n\n  function fakeGetWithSyncResultsAndExtraParams(query, cb) {\n    cb([\n      {value: 'one', raw: {value: 'one'}},\n      {value: 'two', raw: {value: 'two'}},\n      {value: 'three', raw: {value: 'three'}}\n    ], 42, true, false);\n  }\n\n  function fakeGetWithAsyncResults(query, cb) {\n    setTimeout(function() {\n      cb([\n        {value: 'four', raw: {value: 'four'}},\n        {value: 'five', raw: {value: 'five'}}\n      ]);\n    }, 0);\n  }\n});\n"
  },
  {
    "path": "js/autocomplete.js/test/unit/dropdown_spec.js",
    "content": "'use strict';\n\n/* eslint-env mocha, jasmine */\n\ndescribe('Dropdown', function() {\n  require('../../src/common/dom.js').element = require('jquery');\n  require('../../src/jquery/plugin.js');\n\n  var $ = require('jquery');\n  require('jasmine-jquery');\n  var Dropdown = require('../../src/autocomplete/dropdown.js');\n  var fixtures = require('../fixtures.js');\n  var mocks = require('../helpers/mocks.js');\n\n  Dropdown.Dataset = mocks(Dropdown.Dataset);\n\n\n  beforeEach(function() {\n    var $fixture;\n\n    setFixtures(fixtures.html.menu);\n\n    $fixture = $('#jasmine-fixtures');\n    this.$menu = $fixture.find('.aa-dropdown-menu');\n    this.$menu.html(fixtures.html.dataset);\n\n    this.view = new Dropdown({menu: this.$menu, datasets: [{}]});\n    this.dataset = this.view.datasets[0];\n  });\n\n  it('should throw an error if menu and/or datasets is missing', function() {\n    expect(noMenu).toThrow();\n    expect(noDatasets).toThrow();\n\n    function noMenu() {\n      new Dropdown({menu: '.menu'});\n    }\n\n    function noDatasets() {\n      new Dropdown({datasets: true});\n    }\n  });\n\n  describe('when click event is triggered on a suggestion', function() {\n    it('should trigger suggestionClicked', function() {\n      var spy;\n\n      this.view.onSync('suggestionClicked', spy = jasmine.createSpy());\n\n      this.$menu.find('.aa-suggestion').first().click();\n\n      expect(spy).toHaveBeenCalled();\n    });\n  });\n\n  describe('when instantiated with a custom header or footer', function() {\n    beforeEach(function() {\n      this.view.destroy();\n      this.view = new Dropdown({\n        menu: this.$menu,\n        datasets: [{}],\n        templates: {\n          header: function() { return '<h2 class=\"header\">Header</h2>'; },\n          footer: '<h2 class=\"footer\">Footer</h2>'\n        }\n      });\n    });\n\n    it('should include the header', function() {\n      expect(this.$menu.find('h2.header').length).toEqual(1);\n    });\n\n    it('should include the footer', function() {\n      expect(this.$menu.find('h2.footer').length).toEqual(1);\n    });\n  });\n\n  describe('when instantiated with a custom empty template', function() {\n    beforeEach(function() {\n      this.view.destroy();\n      this.view = new Dropdown({\n        menu: this.$menu,\n        datasets: [{}],\n        templates: {\n          empty: '<h3 class=\"empty\">this is empty</h3>'\n        },\n        minLength: 4\n      });\n    });\n\n    it('should include the empty', function() {\n      expect(this.$menu.find('.aa-empty').length).toEqual(1);\n      expect(this.$menu.find('.aa-empty').children().length).toEqual(0);\n      expect(this.$menu.find('.aa-empty').css('display')).toEqual('none');\n    });\n\n    it('should not hide the dropdown if empty', function() {\n      this.view.datasets[0].isEmpty.and.returnValue(true);\n\n      this.view.open();\n      this.view._onRendered('rendered', 'a query');\n\n      expect(this.$menu.find('.aa-empty').length).toEqual(1);\n      expect(this.$menu.find('.aa-empty').children().length).toEqual(1);\n      expect(this.$menu.find('.aa-empty').find('h3.empty').length).toEqual(1);\n      expect(this.$menu.find('.aa-empty').css('display')).not.toEqual('none');\n    });\n\n    it('should trigger empty', function() {\n      var spy;\n\n      this.view.datasets[0].isEmpty.and.returnValue(true);\n      this.view.onSync('empty', spy = jasmine.createSpy());\n\n      this.view.open();\n      this.view._onRendered('rendered', 'a query');\n\n      expect(spy).toHaveBeenCalled();\n    });\n\n    it('should not trigger empty if minLength is no satisfied', function() {\n      var spy;\n\n      this.view.datasets[0].isEmpty.and.returnValue(true);\n      this.view.onSync('empty', spy = jasmine.createSpy());\n\n      this.view.open();\n      this.view._onRendered('rendered', 'te');\n\n      expect(spy).not.toHaveBeenCalled();\n      expect(this.$menu.find('.aa-empty').css('display')).toEqual('none');\n    });\n  });\n\n  describe('when mouseenter is triggered on a suggestion', function() {\n    it('should remove pre-existing cursor', function(done) {\n      var $first;\n      var $last;\n\n      $first = this.$menu.find('.aa-suggestion').first();\n      $last = this.$menu.find('.aa-suggestion').last();\n\n      $first.addClass('aa-cursor');\n      $last.mouseenter();\n\n      // see implementation on why we need this setTimeout\n      setTimeout(function() {\n        expect($first).not.toHaveClass('aa-cursor');\n        expect($last).toHaveClass('aa-cursor');\n        done();\n      }, 0);\n    });\n\n    it('should set the cursor', function(done) {\n      var $suggestion;\n\n      $suggestion = this.$menu.find('.aa-suggestion').first();\n      $suggestion.mouseenter();\n\n      // see implementation on why we need this setTimeout\n      setTimeout(function() {\n        expect($suggestion).toHaveClass('aa-cursor');\n        done();\n      }, 0);\n    });\n\n    it('should trigger cursorMoved', function(done) {\n      var spy;\n      var $suggestion;\n\n      this.view.onSync('cursorMoved', spy = jasmine.createSpy());\n\n      $suggestion = this.$menu.find('.aa-suggestion').first();\n      $suggestion.mouseenter();\n\n      setTimeout(function() {\n        expect(spy).toHaveBeenCalled();\n        done();\n      }, 0);\n    });\n  });\n\n  describe('when mouseleave is triggered on a suggestion', function() {\n    it('should remove the cursor', function() {\n      var $suggestion;\n\n      $suggestion = this.$menu.find('.aa-suggestion').first();\n      $suggestion.mouseenter().mouseleave();\n\n      expect($suggestion).not.toHaveClass('aa-cursor');\n    });\n  });\n\n  describe('when rendered is triggered on a dataset', function() {\n    it('should hide the dropdown if empty', function() {\n      this.dataset.isEmpty.and.returnValue(true);\n\n      this.view.open();\n      this.view._show();\n      this.dataset.trigger('rendered', 'the query');\n\n      expect(this.$menu).not.toBeVisible();\n    });\n\n    it('should show the dropdown if not empty', function() {\n      this.dataset.isEmpty.and.returnValue(false);\n\n      this.view.open();\n      this.dataset.trigger('rendered', 'the query');\n\n      expect(this.$menu).toBeVisible();\n    });\n\n    it('should trigger datasetRendered', function() {\n      var spy;\n\n      this.view.onSync('datasetRendered', spy = jasmine.createSpy());\n      this.dataset.trigger('rendered');\n\n      expect(spy).toHaveBeenCalled();\n    });\n  });\n\n  describe('#open', function() {\n    it('should display the menu if not empty', function() {\n      this.view.isOpen = true;\n      this.view.close();\n      expect(this.$menu).not.toBeVisible();\n\n      this.view.isEmpty = false;\n      this.view.open();\n\n      expect(this.$menu).toBeVisible();\n    });\n\n    it('should not display the menu if empty', function() {\n      this.view.isOpen = true;\n      this.view.close();\n      expect(this.$menu).not.toBeVisible();\n\n      this.view.isEmpty = true;\n      this.view.open();\n\n      expect(this.$menu).not.toBeVisible();\n    });\n\n    it('should trigger opened', function() {\n      var spy;\n\n      this.view.onSync('opened', spy = jasmine.createSpy());\n\n      this.view.close();\n      this.view.open();\n\n      expect(spy).toHaveBeenCalled();\n    });\n\n    it('should trigger shown', function() {\n      var spy;\n\n      this.view.onSync('shown', spy = jasmine.createSpy());\n\n      this.view.close();\n      this.view.isEmpty = false;\n      this.view.open();\n\n      expect(spy).toHaveBeenCalled();\n    });\n\n\n    it('should trigger redrawn', function() {\n      var spy;\n\n      this.view.onSync('redrawn', spy = jasmine.createSpy());\n\n      this.view.close();\n      this.view.isEmpty = false;\n      this.view.appendTo = 'body';\n      this.view.open();\n\n      expect(spy).toHaveBeenCalled();\n    });\n  });\n\n  describe('#close', function() {\n    it('should hide the menu', function() {\n      this.view.open();\n      this.view.close();\n\n      expect(this.$menu).not.toBeVisible();\n    });\n\n    it('should trigger closed', function() {\n      var spy;\n\n      this.view.onSync('closed', spy = jasmine.createSpy());\n\n      this.view.open();\n      this.view.close();\n\n      expect(spy).toHaveBeenCalled();\n    });\n  });\n\n  describe('#setLanguageDirection', function() {\n    it('should update css for given language direction', function() {\n      // TODO: eh, the toHaveCss matcher doesn't seem to work very well\n      /*\n      this.view.setLanguageDirection('rtl');\n      expect(this.$menu).toHaveCss({ left: 'auto', right: '0px' });\n\n      this.view.setLanguageDirection('ltr');\n      expect(this.$menu).toHaveCss({ left: '0px', right: 'auto' });\n      */\n    });\n  });\n\n  describe('#moveCursorUp', function() {\n    beforeEach(function() {\n      this.view.open();\n    });\n\n    it('should move the cursor up', function() {\n      var $first;\n      var $second;\n\n      $first = this.view._getSuggestions().eq(0);\n      $second = this.view._getSuggestions().eq(1);\n\n      this.view._setCursor($second);\n      this.view.moveCursorUp();\n      expect(this.view._getCursor()).toContainText($first.text());\n    });\n\n    it('should move cursor to bottom if cursor is not present', function() {\n      var $bottom;\n\n      $bottom = this.view._getSuggestions().eq(-1);\n\n      this.view.moveCursorUp();\n      expect(this.view._getCursor()).toContainText($bottom.text());\n    });\n\n    it('should remove cursor if already at top', function() {\n      var $first;\n\n      $first = this.view._getSuggestions().eq(0);\n\n      this.view._setCursor($first);\n      this.view.moveCursorUp();\n      expect(this.view._getCursor().length).toBe(0);\n    });\n  });\n\n  describe('#moveCursorDown', function() {\n    beforeEach(function() {\n      this.view.open();\n    });\n\n    it('should move the cursor down', function() {\n      var $first;\n      var $second;\n\n      $first = this.view._getSuggestions().eq(0);\n      $second = this.view._getSuggestions().eq(1);\n\n      this.view._setCursor($first);\n      this.view.moveCursorDown();\n      expect(this.view._getCursor()).toContainText($second.text());\n    });\n\n    it('should move cursor to top if cursor is not present', function() {\n      var $first;\n\n      $first = this.view._getSuggestions().eq(0);\n\n      this.view.moveCursorDown();\n      expect(this.view._getCursor()).toContainText($first.text());\n    });\n\n    it('should remove cursor if already at bottom', function() {\n      var $bottom;\n\n      $bottom = this.view._getSuggestions().eq(-1);\n\n      this.view._setCursor($bottom);\n      this.view.moveCursorDown();\n      expect(this.view._getCursor().length).toBe(0);\n    });\n  });\n\n  describe('#getDatumForSuggestion', function() {\n    it('should extract the datum from the suggestion element', function() {\n      var $suggestion;\n      var datum;\n\n      $suggestion = $('<div>').data({aaValue: 'one', aaDatum: JSON.stringify('two')});\n      datum = this.view.getDatumForSuggestion($suggestion);\n\n      expect(datum).toEqual({value: 'one', raw: 'two', datasetName: undefined});\n    });\n\n    it('should return null if no element is given', function() {\n      expect(this.view.getDatumForSuggestion($('notreal'))).toBeNull();\n    });\n  });\n\n  describe('#getDatumForCursor', function() {\n    it('should return the datum for the cursor', function() {\n      var $first;\n\n      $first = this.view._getSuggestions().eq(0);\n      $first.data({aaValue: 'one', aaDatum: JSON.stringify('two')});\n\n      this.view._setCursor($first);\n      expect(this.view.getDatumForCursor())\n        .toEqual({value: 'one', raw: 'two', datasetName: undefined});\n    });\n  });\n\n  describe('#getDatumForTopSuggestion', function() {\n    it('should return the datum for top suggestion', function() {\n      var $first;\n\n      $first = this.view._getSuggestions().eq(0);\n      $first.data({aaValue: 'one', aaDatum: JSON.stringify('two')});\n\n      expect(this.view.getDatumForTopSuggestion())\n        .toEqual({value: 'one', raw: 'two', datasetName: undefined});\n    });\n  });\n\n  describe('#update', function() {\n    it('should invoke update on each dataset', function() {\n      this.view.update();\n      expect(this.dataset.update).toHaveBeenCalled();\n    });\n  });\n\n  describe('#empty', function() {\n    it('should invoke clear on each dataset', function() {\n      this.view.empty();\n      expect(this.dataset.clear).toHaveBeenCalled();\n    });\n  });\n\n  describe('#isVisible', function() {\n    it('should return true if open and not empty', function() {\n      this.view.isOpen = true;\n      this.view.isEmpty = false;\n\n      expect(this.view.isVisible()).toBe(true);\n\n      this.view.isOpen = false;\n      this.view.isEmpty = false;\n\n      expect(this.view.isVisible()).toBe(false);\n\n      this.view.isOpen = true;\n      this.view.isEmpty = true;\n\n      expect(this.view.isVisible()).toBe(false);\n\n      this.view.isOpen = false;\n      this.view.isEmpty = false;\n\n      expect(this.view.isVisible()).toBe(false);\n    });\n  });\n\n  describe('#destroy', function() {\n    it('should remove event handlers', function() {\n      var $menu = this.view.$menu;\n\n      spyOn($menu, 'off');\n\n      this.view.destroy();\n\n      expect($menu.off).toHaveBeenCalledWith('.aa');\n    });\n\n    it('should destroy its datasets', function() {\n      this.view.destroy();\n\n      expect(this.dataset.destroy).toHaveBeenCalled();\n    });\n\n    it('should null out its reference to the menu element', function() {\n      this.view.destroy();\n\n      expect(this.view.$menu).toBeNull();\n    });\n  });\n});\n"
  },
  {
    "path": "js/autocomplete.js/test/unit/event_emitter_spec.js",
    "content": "'use strict';\n\n/* eslint-env mocha, jasmine */\n\ndescribe('EventEmitter', function() {\n  require('../../src/common/dom.js').element = require('jquery');\n  require('../../src/jquery/plugin.js');\n\n  var EventEmitter = require('../../src/autocomplete/event_emitter.js');\n  var _ = require('../../src/common/utils.js');\n  var waitsForAndRuns = require('../helpers/waits_for.js');\n\n  beforeEach(function() {\n    this.spy = jasmine.createSpy();\n    this.target = _.mixin({}, EventEmitter);\n  });\n\n  it('methods should be chainable', function() {\n    expect(this.target.onSync()).toEqual(this.target);\n    expect(this.target.onAsync()).toEqual(this.target);\n    expect(this.target.off()).toEqual(this.target);\n    expect(this.target.trigger()).toEqual(this.target);\n  });\n\n  it('#on should take the context a callback should be called in', function(done) {\n    var context = {val: 3};\n    var cbContext;\n\n    this.target.onSync('xevent', setCbContext, context).trigger('xevent');\n\n    waitsForAndRuns(assertCbContext, done, 100);\n\n    function setCbContext() {\n      cbContext = this;\n    }\n\n    function assertCbContext() {\n      return cbContext === context;\n    }\n  });\n\n  it('#onAsync callbacks should be invoked asynchronously', function(done) {\n    this.target.onAsync('event', this.spy).trigger('event');\n\n    expect(this.spy.calls.count()).toBe(0);\n    waitsForAndRuns(assertCallCount(this.spy, 1), done, 100);\n  });\n\n  it('#onSync callbacks should be invoked synchronously', function() {\n    this.target.onSync('event', this.spy).trigger('event');\n\n    expect(this.spy.calls.count()).toBe(1);\n  });\n\n  it('#off should remove callbacks', function(done) {\n    this.target\n      .onSync('event1 event2', this.spy)\n      .onAsync('event1 event2', this.spy)\n      .off('event1 event2')\n      .trigger('event1 event2');\n\n    setTimeout(assertCallCount(this.spy, 0, done), 100);\n  });\n\n  it('methods should accept multiple event types', function(done) {\n    this.target\n      .onSync('event1 event2', this.spy)\n      .onAsync('event1 event2', this.spy)\n      .trigger('event1 event2');\n\n    expect(this.spy.calls.count()).toBe(2);\n    setTimeout(assertCallCount(this.spy, 4, done), 100);\n  });\n\n  it('the event type should be passed to the callback', function(done) {\n    this.target\n      .onSync('sync', this.spy)\n      .onAsync('async', this.spy)\n      .trigger('sync async');\n\n    var that = this;\n    waitsForAndRuns(assertArgs(this.spy, 0, ['sync']), function() {\n      waitsForAndRuns(assertArgs(that.spy, 1, ['async']), done, 100);\n    }, 100);\n  });\n\n  it('arbitrary args should be passed to the callback', function(done) {\n    this.target\n      .onSync('event', this.spy)\n      .onAsync('event', this.spy)\n      .trigger('event', 1, 2);\n\n    var that = this;\n    waitsForAndRuns(assertArgs(this.spy, 0, ['event', 1, 2]), function() {\n      waitsForAndRuns(assertArgs(that.spy, 1, ['event', 1, 2]), done, 100);\n    }, 100);\n  });\n\n  it('callback execution should be cancellable', function(done) {\n    var cancelSpy = jasmine.createSpy().and.callFake(cancel);\n\n    this.target\n      .onSync('one', cancelSpy)\n      .onSync('one', this.spy)\n      .onAsync('two', cancelSpy)\n      .onAsync('two', this.spy)\n      .onSync('three', cancelSpy)\n      .onAsync('three', this.spy)\n      .trigger('one two three');\n\n    var that = this;\n    setTimeout(assertCallCount(cancelSpy, 3, function() {\n      setTimeout(assertCallCount(that.spy, 0, done), 100);\n    }), 100);\n\n    function cancel() {\n      return false;\n    }\n  });\n\n  function assertCallCount(spy, expected, done) {\n    return function() {\n      expect(spy.calls.count()).toBe(expected);\n      done && done();\n    };\n  }\n\n  function assertArgs(spy, call, expected) {\n    return function() {\n      var actual = spy.calls.argsFor(call);\n      return expect(actual).toEqual(expected);\n    };\n  }\n});\n"
  },
  {
    "path": "js/autocomplete.js/test/unit/hits_spec.js",
    "content": "'use strict';\n\n/* eslint-env mocha, jasmine */\n\ndescribe('hits', function () {\n  var hitsSource = require('../../src/sources/hits.js');\n  var version = require('../../version.js');\n\n  var client = {\n    _ua: 'javascript wrong agent',\n    search: function search(requests) {\n      return window.Promise.resolve({\n        results: requests.map(function (request) {\n          return {\n            index: request.indexName,\n            hits: [\n              {value: 'Q1-' + request.indexName},\n              {value: 'Q2-' + request.indexName},\n              {value: 'Q3-' + request.indexName}\n            ]\n          };\n        })\n      });\n    }\n  };\n\n  it('returns results from one index', function () {\n    var suggestions = [];\n\n    var f = hitsSource(\n      {\n        as: client,\n        indexName: 'products'\n      },\n      {hitsPerPage: 3}\n    );\n\n    // wait only on one promise, this asserts that our \"promise.resolve\" trick works\n    f('q', function cb1(hits) {\n      suggestions = suggestions.concat(hits);\n    });\n\n    // force the rest of our test to be more than a microtask behind\n    return new Promise(function (res) {\n      setTimeout(res, 0);\n    }).then(function () {\n      expect(suggestions.length).toEqual(3);\n      expect(suggestions[0].value).toEqual('Q1-products');\n      expect(suggestions[1].value).toEqual('Q2-products');\n      expect(suggestions[2].value).toEqual('Q3-products');\n    });\n  });\n\n  it('returns results from multiple indices', function () {\n    var suggestions1 = [];\n    var suggestions2 = [];\n\n    var f1 = hitsSource(\n      {\n        as: client,\n        indexName: 'products'\n      },\n      {hitsPerPage: 3}\n    );\n    var f2 = hitsSource(\n      {\n        as: client,\n        indexName: 'other'\n      },\n      {hitsPerPage: 3}\n    );\n\n    f1('q', function cb1(hits) {\n      suggestions1 = suggestions1.concat(hits);\n    });\n    f2('q', function cb2(hits) {\n      suggestions2 = suggestions2.concat(hits);\n    });\n\n    // force the rest of our test to be more than a microtask behind\n    return new Promise(function (res) {\n      setTimeout(res, 0);\n    }).then(function () {\n      expect(suggestions1.length).toEqual(3);\n      expect(suggestions1[0].value).toEqual('Q1-products');\n      expect(suggestions1[1].value).toEqual('Q2-products');\n      expect(suggestions1[2].value).toEqual('Q3-products');\n\n      expect(suggestions2.length).toEqual(3);\n      expect(suggestions2[0].value).toEqual('Q1-other');\n      expect(suggestions2[1].value).toEqual('Q2-other');\n      expect(suggestions2[2].value).toEqual('Q3-other');\n    });\n  });\n\n  it('calls client.search only once', function () {\n    var suggestions1 = [];\n    var suggestions2 = [];\n\n    var searchSpy = spyOn(client, 'search').and.callThrough();\n\n    var f1 = hitsSource(\n      {\n        as: client,\n        indexName: 'products'\n      },\n      {hitsPerPage: 3}\n    );\n    var f2 = hitsSource(\n      {\n        as: client,\n        indexName: 'other'\n      },\n      {hitsPerPage: 3}\n    );\n\n    // wait only on one promise, this asserts that our \"promise.resolve\" trick works\n    f1('q', function cb1(hits) {\n      suggestions1 = suggestions1.concat(hits);\n    });\n    f2('q', function cb2(hits) {\n      suggestions2 = suggestions2.concat(hits);\n    });\n\n    // force the rest of our test to be more than a microtask behind\n    return new Promise(function (res) {\n      setTimeout(res, 0);\n    }).then(function () {\n      expect(searchSpy).toHaveBeenCalledTimes(1);\n    });\n  });\n\n  it('does not augment the _ua if not JS client v3', function () {\n    expect(client._ua).toEqual('javascript wrong agent');\n\n    hitsSource(\n      {\n        as: client,\n        indexName: 'products'\n      },\n      {hitsPerPage: 3}\n    );\n\n    expect(client._ua).toEqual('javascript wrong agent');\n  });\n\n  it('augments the _ua once', function () {\n    client._ua = 'Algolia for JavaScript (3.35.0)';\n\n    expect(client._ua).toEqual('Algolia for JavaScript (3.35.0)');\n\n    hitsSource(\n      {\n        as: client,\n        indexName: 'products'\n      },\n      {hitsPerPage: 3}\n    );\n\n    expect(client._ua).toEqual(\n      'Algolia for JavaScript (3.35.0); autocomplete.js ' + version\n    );\n\n    hitsSource(\n      {\n        as: client,\n        indexName: 'something'\n      },\n      {hitsPerPage: 70}\n    );\n\n    expect(client._ua).toEqual(\n      'Algolia for JavaScript (3.35.0); autocomplete.js ' + version\n    );\n  });\n});\n"
  },
  {
    "path": "js/autocomplete.js/test/unit/input_spec.js",
    "content": "'use strict';\n\n/* eslint-env mocha, jasmine */\n\ndescribe('Input', function() {\n  var $ = require('jquery');\n  require('jasmine-jquery');\n  require('../../src/common/dom.js').element = $;\n  require('../../src/jquery/plugin.js');\n  var Input = require('../../src/autocomplete/input.js');\n  var _ = require('../../src/common/utils.js');\n  var fixtures = require('../fixtures.js');\n  var waitsForAndRuns = require('../helpers/waits_for.js');\n\n  var KEYS;\n\n  KEYS = {\n    enter: 13,\n    esc: 27,\n    tab: 9,\n    left: 37,\n    right: 39,\n    up: 38,\n    down: 40,\n    normal: 65 // \"A\" key\n  };\n\n  beforeEach(function() {\n    var $fixture;\n\n    setFixtures(fixtures.html.input + fixtures.html.hint);\n\n    $fixture = $('#jasmine-fixtures');\n    this.$input = $fixture.find('.aa-input');\n    this.$hint = $fixture.find('.aa-hint');\n\n    this.view = new Input({input: this.$input, hint: this.$hint});\n  });\n\n  it('should throw an error if no hint and/or input is provided', function() {\n    expect(noInput).toThrow();\n\n    function noInput() {\n      new Input({hint: '.hint'});\n    }\n  });\n\n  describe('when the blur DOM event is triggered', function() {\n    it('should reset the input value', function() {\n      this.view.setQuery('wine');\n      this.view.setInputValue('cheese', true);\n\n      this.$input.blur();\n\n      expect(this.$input.val()).toBe('wine');\n    });\n\n    it('should trigger blurred', function() {\n      var spy;\n\n      this.view.onSync('blurred', spy = jasmine.createSpy());\n      this.$input.blur();\n\n      expect(spy).toHaveBeenCalled();\n    });\n  });\n\n  describe('when the focus DOM event is triggered', function() {\n    it('should trigger focused', function() {\n      var spy;\n\n      this.view.onSync('focused', spy = jasmine.createSpy());\n      this.$input.focus();\n\n      expect(spy).toHaveBeenCalled();\n    });\n  });\n\n  describe('when the keydown DOM event is triggered by tab', function() {\n    it('should trigger tabKeyed if no modifiers were pressed', function() {\n      var spy;\n\n      this.view.onSync('tabKeyed', spy = jasmine.createSpy());\n      simulateKeyEvent(this.$input, 'keydown', KEYS.tab);\n\n      expect(spy).toHaveBeenCalled();\n    });\n\n    it('should not trigger tabKeyed if modifiers were pressed', function() {\n      var spy;\n\n      this.view.onSync('tabKeyed', spy = jasmine.createSpy());\n      simulateKeyEvent(this.$input, 'keydown', KEYS.tab, true);\n\n      expect(spy).not.toHaveBeenCalled();\n    });\n\n    it('should prevent default behavior if there is a hint', function() {\n      var $e;\n\n      this.view.setHint('good');\n      this.view.setInputValue('goo');\n\n      $e = simulateKeyEvent(this.$input, 'keydown', KEYS.tab);\n\n      expect($e.preventDefault).toHaveBeenCalled();\n    });\n  });\n\n  describe('when the keydown DOM event is triggered by esc', function() {\n    it('should trigger escKeyed', function() {\n      var spy;\n\n      this.view.onSync('escKeyed', spy = jasmine.createSpy());\n      simulateKeyEvent(this.$input, 'keydown', KEYS.esc);\n\n      expect(spy).toHaveBeenCalled();\n    });\n  });\n\n  describe('when the keydown DOM event is triggered by left', function() {\n    it('should trigger leftKeyed', function() {\n      var spy;\n\n      this.view.onSync('leftKeyed', spy = jasmine.createSpy());\n      simulateKeyEvent(this.$input, 'keydown', KEYS.left);\n\n      expect(spy).toHaveBeenCalled();\n    });\n  });\n\n  describe('when the keydown DOM event is triggered by right', function() {\n    it('should trigger rightKeyed', function() {\n      var spy;\n\n      this.view.onSync('rightKeyed', spy = jasmine.createSpy());\n      simulateKeyEvent(this.$input, 'keydown', KEYS.right);\n\n      expect(spy).toHaveBeenCalled();\n    });\n  });\n\n  describe('when the keydown DOM event is triggered by enter', function() {\n    it('should trigger enterKeyed', function() {\n      var spy;\n\n      this.view.onSync('enterKeyed', spy = jasmine.createSpy());\n      simulateKeyEvent(this.$input, 'keydown', KEYS.enter);\n\n      expect(spy).toHaveBeenCalled();\n    });\n  });\n\n  describe('when the keydown DOM event is triggered by up', function() {\n    it('should trigger upKeyed', function() {\n      var spy;\n\n      this.view.onSync('upKeyed', spy = jasmine.createSpy());\n      simulateKeyEvent(this.$input, 'keydown', KEYS.up);\n\n      expect(spy).toHaveBeenCalled();\n    });\n\n    it('should prevent default if no modifers were pressed', function() {\n      var $e = simulateKeyEvent(this.$input, 'keydown', KEYS.up);\n\n      expect($e.preventDefault).toHaveBeenCalled();\n    });\n\n    it('should not prevent default if modifers were pressed', function() {\n      var $e = simulateKeyEvent(this.$input, 'keydown', KEYS.up, true);\n\n      expect($e.preventDefault).not.toHaveBeenCalled();\n    });\n  });\n\n  describe('when the keydown DOM event is triggered by down', function() {\n    it('should trigger downKeyed', function() {\n      var spy;\n\n      this.view.onSync('downKeyed', spy = jasmine.createSpy());\n      simulateKeyEvent(this.$input, 'keydown', KEYS.down);\n\n      expect(spy).toHaveBeenCalled();\n    });\n\n    it('should prevent default if no modifers were pressed', function() {\n      var $e = simulateKeyEvent(this.$input, 'keydown', KEYS.down);\n\n      expect($e.preventDefault).toHaveBeenCalled();\n    });\n\n    it('should not prevent default if modifers were pressed', function() {\n      var $e = simulateKeyEvent(this.$input, 'keydown', KEYS.down, true);\n\n      expect($e.preventDefault).not.toHaveBeenCalled();\n    });\n  });\n\n  // NOTE: have to treat these as async because the ie polyfill acts\n  // in a async manner\n  describe('when the input DOM event is triggered', function() {\n    it('should update query', function(done) {\n      this.view.setQuery('wine');\n      this.view.setInputValue('cheese', true);\n\n      simulateInputEvent(this.$input);\n\n      var that = this;\n      waitsForAndRuns(function() { return that.view.getQuery() === 'cheese'; }, done, 100);\n    });\n\n    it('should trigger queryChanged if the query changed', function() {\n      var spy;\n\n      this.view.setQuery('wine');\n      this.view.setInputValue('cheese', true);\n      this.view.onSync('queryChanged', spy = jasmine.createSpy());\n\n      simulateInputEvent(this.$input);\n\n      expect(spy).toHaveBeenCalled();\n    });\n\n    it('should trigger whitespaceChagned if whitespace changed', function() {\n      var spy;\n\n      this.view.setQuery('wine  bar');\n      this.view.setInputValue('wine bar', true);\n      this.view.onSync('whitespaceChanged', spy = jasmine.createSpy());\n\n      simulateInputEvent(this.$input);\n\n      expect(spy).toHaveBeenCalled();\n    });\n  });\n\n  describe('#focus', function() {\n    it('should focus the input', function() {\n      this.$input.blur();\n      this.view.focus();\n\n      expect(this.$input).toBeFocused();\n    });\n  });\n\n  describe('#blur', function() {\n    it('should blur the input', function() {\n      this.$input.focus();\n      this.view.blur();\n\n      expect(this.$input).not.toBeFocused();\n    });\n  });\n\n  describe('#getQuery/#setQuery', function() {\n    it('should act as getter/setter to the query property', function() {\n      this.view.setQuery('mouse');\n      expect(this.view.getQuery()).toBe('mouse');\n    });\n  });\n\n  describe('#getInputValue', function() {\n    it('should act as getter to the input value', function() {\n      this.$input.val('cheese');\n      expect(this.view.getInputValue()).toBe('cheese');\n    });\n  });\n\n  describe('#setInputValue', function() {\n    it('should act as setter to the input value', function() {\n      this.view.setInputValue('cheese');\n      expect(this.view.getInputValue()).toBe('cheese');\n    });\n\n    it('should not set the current query if null', function() {\n      this.view.setQuery('cheese');\n      this.view.setInputValue(null);\n      expect(this.view.getInputValue()).toBe('');\n    });\n\n    it('should set the current query if undefined', function() {\n      this.view.setQuery('cheese');\n      this.view.setInputValue(undefined);\n      expect(this.view.getInputValue()).toBe('cheese');\n    });\n\n    it('should trigger {query|whitespace}Changed when applicable', function() {\n      var spy1;\n      var spy2;\n\n      this.view.onSync('queryChanged', spy1 = jasmine.createSpy());\n      this.view.onSync('whitespaceChanged', spy2 = jasmine.createSpy());\n\n      this.view.setInputValue('cheese head');\n      expect(spy1).toHaveBeenCalled();\n      expect(spy2).not.toHaveBeenCalled();\n\n      this.view.setInputValue('cheese  head');\n      expect(spy1.calls.count()).toBe(1);\n      expect(spy2).toHaveBeenCalled();\n    });\n  });\n\n  describe('#setActiveDescendant', function() {\n    it('should set the aria-activedescendant attribute', function() {\n      this.view.setActiveDescendant('abc');\n      expect(this.$input.attr('aria-activedescendant')).toBe('abc');\n    });\n  });\n\n  describe('#removeActiveDescendant', function() {\n    it('should remove the aria-activedescendant attribute', function() {\n      this.view.setActiveDescendant('foo');\n      expect(this.$input.attr('aria-activedescendant')).toBe('foo');\n      this.view.removeActiveDescendant('bar');\n      expect(this.$input.attr('aria-activedescendant')).toBeUndefined();\n    });\n  });\n\n  describe('#getHint/#setHint', function() {\n    it('should act as getter/setter to value of hint', function() {\n      this.view.setHint('mountain');\n      expect(this.view.getHint()).toBe('mountain');\n    });\n  });\n\n  describe('#resetInputValue', function() {\n    it('should reset input value to last query', function() {\n      this.view.setQuery('cheese');\n      this.view.setInputValue('wine', true);\n\n      this.view.resetInputValue();\n      expect(this.view.getInputValue()).toBe('cheese');\n    });\n  });\n\n  describe('#clearHint', function() {\n    it('should set the hint value to the empty string', function() {\n      this.view.setHint('cheese');\n      this.view.clearHint();\n\n      expect(this.view.getHint()).toBe('');\n    });\n  });\n\n  describe('#clearHintIfInvalid', function() {\n    it('should clear hint if input value is empty string', function() {\n      this.view.setInputValue('', true);\n      this.view.setHint('cheese');\n      this.view.clearHintIfInvalid();\n\n      expect(this.view.getHint()).toBe('');\n    });\n\n    it('should clear hint if input value is not prefix of input', function() {\n      this.view.setInputValue('milk', true);\n      this.view.setHint('cheese');\n      this.view.clearHintIfInvalid();\n\n      expect(this.view.getHint()).toBe('');\n    });\n\n    it('should clear hint if overflow exists', function() {\n      spyOn(this.view, 'hasOverflow').and.returnValue(true);\n      this.view.setInputValue('che', true);\n      this.view.setHint('cheese');\n      this.view.clearHintIfInvalid();\n\n      expect(this.view.getHint()).toBe('');\n    });\n\n    it('should not clear hint if input value is prefix of input', function() {\n      this.view.setInputValue('che', true);\n      this.view.setHint('cheese');\n      this.view.clearHintIfInvalid();\n\n      expect(this.view.getHint()).toBe('cheese');\n    });\n  });\n\n  describe('#getLanguageDirection', function() {\n    it('should return the language direction of the input', function() {\n      this.$input.css('direction', 'ltr');\n      expect(this.view.getLanguageDirection()).toBe('ltr');\n\n      this.$input.css('direction', 'rtl');\n      expect(this.view.getLanguageDirection()).toBe('rtl');\n    });\n  });\n\n  describe('#hasOverflow', function() {\n    it('should return true if the input has overflow text', function() {\n      var longStr = new Array(1000).join('a');\n\n      this.view.setInputValue(longStr);\n      expect(this.view.hasOverflow()).toBe(true);\n    });\n\n    it('should return false if the input has no overflow text', function() {\n      var shortStr = 'aah';\n\n      this.view.setInputValue(shortStr);\n      expect(this.view.hasOverflow()).toBe(false);\n    });\n  });\n\n  describe('#isCursorAtEnd', function() {\n    it('should return true if the text cursor is at the end', function() {\n      this.view.setInputValue('boo');\n\n      setCursorPosition(this.$input, 3);\n      expect(this.view.isCursorAtEnd()).toBe(true);\n    });\n\n    it('should return false if the text cursor is not at the end', function() {\n      this.view.setInputValue('boo');\n\n      setCursorPosition(this.$input, 1);\n      expect(this.view.isCursorAtEnd()).toBe(false);\n    });\n  });\n\n  describe('#destroy', function() {\n    it('should remove event handlers', function() {\n      var $input;\n      var $hint;\n\n      $hint = this.view.$hint;\n      $input = this.view.$input;\n\n      spyOn($hint, 'off');\n      spyOn($input, 'off');\n\n      this.view.destroy();\n\n      expect($hint.off).toHaveBeenCalledWith('.aa');\n      expect($input.off).toHaveBeenCalledWith('.aa');\n    });\n\n    it('should null out its reference to DOM elements', function() {\n      this.view.destroy();\n\n      expect(this.view.$hint).toBeNull();\n      expect(this.view.$input).toBeNull();\n      expect(this.view.$overflowHelper).toBeNull();\n    });\n  });\n\n  // helper functions\n  // ----------------\n\n  function simulateInputEvent($node) {\n    var $e;\n    var type;\n\n    type = _.isMsie() ? 'keypress' : 'input';\n    $e = $.Event(type);\n\n    $node.trigger($e);\n  }\n\n  function simulateKeyEvent($node, type, key, withModifier) {\n    var $e;\n\n    $e = $.Event(type, {\n      keyCode: key,\n      altKey: !!withModifier,\n      ctrlKey: !!withModifier,\n      metaKey: !!withModifier,\n      shiftKey: !!withModifier\n    });\n\n    spyOn($e, 'preventDefault');\n    $node.trigger($e);\n\n    return $e;\n  }\n\n  function setCursorPosition($input, pos) {\n    var input = $input[0];\n    var range;\n\n    if (input.setSelectionRange) {\n      input.focus();\n      input.setSelectionRange(pos, pos);\n    } else if (input.createTextRange) {\n      range = input.createTextRange();\n      range.collapse(true);\n      range.moveEnd('character', pos);\n      range.moveStart('character', pos);\n      range.select();\n    }\n  }\n});\n"
  },
  {
    "path": "js/autocomplete.js/test/unit/jquery_spec.js",
    "content": "'use strict';\n\n/* eslint-env mocha, jasmine */\n\ndescribe('Typeahead', function() {\n  var $ = require('jquery');\n  require('jasmine-jquery');\n\n  var fixtures = require('../fixtures.js');\n  var $autocomplete = require('../../src/jquery/plugin.js');\n\n  describe('when instantiated from jquery', function() {\n    beforeEach(function() {\n      this.$fixture = $(setFixtures(fixtures.html.textInput));\n\n      this.view = this.$fixture.find('input').autocomplete({}, [{\n        name: 'test',\n        source: function(q, cb) {\n          cb([{name: 'test'}]);\n        },\n        templates: {\n          suggestion: function(sugg) {\n            return sugg.name;\n          }\n        }\n      }]).data('aaAutocomplete');\n    });\n\n    it('should initialize', function() {\n      expect(this.$fixture.find('.aa-dropdown-menu').length).toEqual(1);\n    });\n\n    it('should open the dropdown', function() {\n      this.$fixture.find('input').val('test');\n      expect(this.view.input.getInputValue()).toEqual('test');\n      $autocomplete.call($('input'), 'val', 'test');\n      $autocomplete.call($('input'), 'open');\n      $autocomplete.call($('input'), 'close');\n    });\n  });\n});\n"
  },
  {
    "path": "js/autocomplete.js/test/unit/parseAlgoliaClientVersion_spec.js",
    "content": "'use strict';\n\n/* eslint-env mocha, jasmine */\n\ndescribe('parseAlgoliaClientVersion', function() {\n  var parseAlgoliaClientVersion = require('../../src/common/parseAlgoliaClientVersion.js');\n\n  it('should return undefined for unknown user agents', function() {\n    expect(parseAlgoliaClientVersion('random user agent 1.2.3')).toEqual(\n      undefined\n    );\n  });\n\n  it('should parse user agents with algoliasearch < 3.33.0 format', function() {\n    expect(\n      parseAlgoliaClientVersion('Algolia for vanilla JavaScript 3.1.0')\n    ).toEqual(['3.', '1.', '0']);\n  });\n\n  it('should parse user agents with algoliasearch >= 3.33.0 format', function() {\n    expect(parseAlgoliaClientVersion('Algolia for JavaScript (3.5.0)')).toEqual([\n      '3.',\n      '5.',\n      '0'\n    ]);\n  });\n});\n"
  },
  {
    "path": "js/autocomplete.js/test/unit/popularIn_spec.js",
    "content": "'use strict';\n\n/* eslint-env mocha, jasmine */\n\ndescribe('popularIn', function() {\n  require('../../src/common/dom.js').element = require('jquery');\n  require('../../src/jquery/plugin.js');\n\n  var popularIn = require('../../src/sources/popularIn.js');\n\n  beforeEach(function() {\n  });\n\n  function build(options) {\n    var queries = {\n      as: {\n        _ua: 'javascript wrong agent',\n      },\n      search: function(q, params, cb) {\n        cb(false, {\n          hits: [\n            { value: 'q1' },\n            { value: 'q2' },\n            { value: 'q3' }\n          ]\n        });\n      }\n    };\n    var products = {\n      as: {\n        _ua: 'javascript wrong agent',\n      },\n      search: function(q, params, cb) {\n        cb(false, {\n          facets: {\n            category: {\n              c1: 42,\n              c2: 21,\n              c3: 2\n            }\n          }\n        })\n      }\n    };\n    var f = popularIn(queries, { hitsPerPage: 3 }, {\n      source: 'value',\n      index: products,\n      facets: 'category',\n      maxValuesPerFacet: 3\n    }, options);\n\n    var suggestions = [];\n    function cb(hits) {\n      suggestions = suggestions.concat(hits);\n    }\n    f('q', cb);\n    return suggestions;\n  }\n\n  it('should query 2 indices and build the combinatory', function() {\n    var suggestions = build();\n    expect(suggestions.length).toEqual(5);\n    expect(suggestions[0].value).toEqual('q1');\n    expect(suggestions[0].facet.value).toEqual('c1');\n    expect(suggestions[1].value).toEqual('q1');\n    expect(suggestions[1].facet.value).toEqual('c2');\n    expect(suggestions[2].value).toEqual('q1');\n    expect(suggestions[2].facet.value).toEqual('c3');\n    expect(suggestions[3].value).toEqual('q2');\n    expect(suggestions[3].facet).toBe(undefined);\n    expect(suggestions[4].value).toEqual('q3');\n    expect(suggestions[4].facet).toBe(undefined);\n  });\n\n  it('should include the all department entry', function() {\n    var suggestions = build({includeAll: true});\n    expect(suggestions.length).toEqual(6);\n    expect(suggestions[0].value).toEqual('q1');\n    expect(suggestions[0].facet.value).toEqual('All departments');\n    expect(suggestions[1].value).toEqual('q1');\n    expect(suggestions[1].facet.value).toEqual('c1');\n    expect(suggestions[2].value).toEqual('q1');\n    expect(suggestions[2].facet.value).toEqual('c2');\n    expect(suggestions[3].value).toEqual('q1');\n    expect(suggestions[3].facet.value).toEqual('c3');\n    expect(suggestions[4].value).toEqual('q2');\n    expect(suggestions[4].facet).toBe(undefined);\n    expect(suggestions[5].value).toEqual('q3');\n    expect(suggestions[5].facet).toBe(undefined);\n  });\n\n  it('should include the all department entry with a custom title', function() {\n    var suggestions = build({includeAll: true, allTitle: 'ALL'});\n    expect(suggestions.length).toEqual(6);\n    expect(suggestions[0].value).toEqual('q1');\n    expect(suggestions[0].facet.value).toEqual('ALL');\n  });\n\n  it('should not include the all department entry when no results', function() {\n    var queries = {\n      as: {\n        _ua: 'Algolia for vanilla JavaScript 4.3.6'\n      },\n      search: function(q, params, cb) {\n        cb(false, {\n          hits: []\n        });\n      }\n    };\n    var products = {\n      as: {\n        _ua: 'javascript wrong agent',\n      },\n      search: function(q, params, cb) {\n        throw new Error('Never reached');\n      }\n    };\n    var f = popularIn(queries, { hitsPerPage: 3 }, {\n      source: 'value',\n      index: products\n    }, {\n      includeAll: true\n    });\n\n    var suggestions = [];\n    function cb(hits) {\n      suggestions = suggestions.concat(hits);\n    }\n    f('q', cb);\n    expect(suggestions.length).toEqual(0);\n  });\n\n});\n"
  },
  {
    "path": "js/autocomplete.js/test/unit/standalone_spec.js",
    "content": "'use strict';\n\n/* eslint-env mocha, jasmine */\n\ndescribe('Typeahead', function() {\n\n  var fixtures = require('../fixtures.js');\n  var autocomplete = require('../../src/standalone/index.js');\n\n  beforeEach(function() {\n    this.$fixture = setFixtures(fixtures.html.textInput);\n\n    this.ac = autocomplete('input', {}, {\n      name: 'test',\n      source: function(q, cb) {\n        cb([{name: 'test'}]);\n      },\n      templates: {\n        suggestion: function(sugg) {\n          return sugg.name;\n        }\n      }\n    });\n  });\n\n  describe('when instantiated from standalone', function() {\n\n    it('should initialize', function() {\n      expect(this.$fixture.find('.aa-dropdown-menu').length).toEqual(1);\n    });\n\n    it('has an .autocomplete property', function() {\n      expect(this.ac.autocomplete).toBeDefined();\n    });\n\n  });\n\n  describe('when accessing autocomplete function', function() {\n\n    it('should have an open, close, getVal, setVal and destroy methods', function() {\n      var methodsToAssert = ['open', 'close', 'getVal', 'setVal', 'destroy', 'getWrapper'];\n\n      for (var i = 0; i < methodsToAssert.length; i++) {\n        expect(this.ac.autocomplete[methodsToAssert[i]]).toBeDefined();\n        expect(typeof this.ac.autocomplete[methodsToAssert[i]]).toEqual('function');\n      }\n    });\n\n    describe('when executing the methods', function() {\n      beforeEach(function() {\n        this.$fixture = setFixtures(fixtures.html.textInput);\n\n        this.typeaheadSpy = {\n          input: {\n            $input: {}\n          },\n          open: sinon.stub().returns('hello'),\n          close: sinon.stub().returns('hello'),\n          getVal: sinon.stub().returns('hello'),\n          setVal: sinon.stub().returns('hello'),\n          destroy: sinon.stub().returns('hello'),\n          getWrapper: sinon.stub().returns('hello')\n        };\n\n        this.ac = autocomplete('input', {}, {\n          name: 'test',\n          source: function(q, cb) {\n            cb([{name: 'test'}]);\n          },\n          templates: {\n            suggestion: function(sugg) {\n              return sugg.name;\n            }\n          }\n        }, this.typeaheadSpy);\n      });\n\n      it('should proxy the method call on typeahead object', function() {\n        expect(this.ac.autocomplete.open()).toEqual('hello');\n        expect(this.typeaheadSpy.open.calledOnce).toBe(true);\n        expect(this.ac.autocomplete.close()).toEqual('hello');\n        expect(this.typeaheadSpy.close.calledOnce).toBe(true);\n        expect(this.ac.autocomplete.getVal()).toEqual('hello');\n        expect(this.typeaheadSpy.getVal.calledOnce).toBe(true);\n        expect(this.ac.autocomplete.setVal('Hey')).toEqual('hello');\n        expect(this.typeaheadSpy.setVal.withArgs('Hey').calledOnce).toBe(true);\n        expect(this.ac.autocomplete.destroy()).toEqual('hello');\n        expect(this.typeaheadSpy.destroy.calledOnce).toBe(true);\n        expect(this.ac.autocomplete.getWrapper()).toEqual('hello');\n        expect(this.typeaheadSpy.getWrapper.calledOnce).toBe(true);\n      });\n\n    });\n  });\n\n});\n\ndescribe('noConflict()', function() {\n  it('should restore the previous value of autocomplete', function() {\n    window.autocomplete = 'test';\n\n    // Rerequire autocomplete\n    delete require.cache[require.resolve('../../src/standalone/index.js')];\n    var autocomplete = require('../../src/standalone/index.js');\n\n    expect(window.autocomplete).toBe('test');\n    window.autocomplete = autocomplete;\n\n    var aa = autocomplete.noConflict();\n    expect(aa).toBe(autocomplete);\n    expect(window.autocomplete).toBe('test');\n  });\n\n  it('should delete window.autocomplete if it wasn\\'t set', function() {\n    if ('autocomplete' in window) {\n      delete window.autocomplete;\n    }\n\n    // Rerequire autocomplete\n    delete require.cache[require.resolve('../../src/standalone/index.js')];\n    var autocomplete = require('../../src/standalone/index.js');\n\n    expect('autocomplete' in window).toBe(false);\n    window.autocomplete = autocomplete;\n\n    var aa = autocomplete.noConflict();\n    expect(aa).toBe(autocomplete);\n    expect('autocomplete' in window).toBe(false);\n  });\n});\n"
  },
  {
    "path": "js/autocomplete.js/test/unit/typeahead_spec.js",
    "content": "'use strict';\n\n/* eslint-env mocha, jasmine */\n\ndescribe('Typeahead', function() {\n  require('../../src/common/dom.js').element = require('jquery');\n  require('../../src/jquery/plugin.js');\n\n  var $ = require('jquery');\n  require('jasmine-jquery');\n  var Typeahead = require('../../src/autocomplete/typeahead.js');\n  var fixtures = require('../fixtures.js');\n\n  var mocks = require('../helpers/mocks.js');\n  var waitsForAndRuns = require('../helpers/waits_for.js');\n\n  Typeahead.Dropdown = mocks(Typeahead.Dropdown);\n  Typeahead.Input = mocks(Typeahead.Input);\n\n  var testDatum;\n\n  beforeEach(function() {\n    var $fixture;\n    var $input;\n\n    setFixtures(fixtures.html.textInput);\n\n    $fixture = $('#jasmine-fixtures');\n    this.$input = $fixture.find('input');\n\n    testDatum = fixtures.data.simple[0];\n\n    this.view = new Typeahead({\n      input: this.$input,\n      hint: true,\n      datasets: {}\n    });\n\n    this.input = this.view.input;\n    this.dropdown = this.view.dropdown;\n  });\n\n  describe('appendTo', function() {\n    it('should throw if used with hint', function(done) {\n      expect(function() {\n        return new Typeahead({\n          input: this.$input,\n          hint: true,\n          appendTo: 'body'\n        });\n      }).toThrow();\n      done();\n    });\n\n    it('should be appended to the target of appendTo', function(done) {\n      var node = document.createElement('div');\n      document.querySelector('body').appendChild(node);\n\n      expect(node.children.length).toEqual(0);\n\n      this.view.destroy();\n\n      this.view = new Typeahead({\n        input: this.$input,\n        hint: false,\n        appendTo: node\n      });\n\n      expect(document.querySelectorAll('.algolia-autocomplete').length).toEqual(1);\n      expect(node.children.length).toEqual(1);\n\n      this.view.destroy();\n\n      done();\n    });\n  });\n\n  describe('when dropdown triggers suggestionClicked', function() {\n    beforeEach(function() {\n      this.dropdown.getDatumForSuggestion.and.returnValue(testDatum);\n    });\n\n    it('should select the datum', function(done) {\n      var spy;\n\n      this.$input.on('autocomplete:selected', spy = jasmine.createSpy());\n      this.dropdown.trigger('suggestionClicked');\n\n      expect(spy).toHaveBeenCalled();\n      expect(this.input.setQuery).toHaveBeenCalledWith(testDatum.value);\n      expect(this.input.setInputValue)\n        .toHaveBeenCalledWith(testDatum.value, true);\n\n      var that = this;\n      waitsForAndRuns(function() { return that.dropdown.close.calls.count(); }, done, 100);\n    });\n\n    it('should pass the selection method as part of the context ', function(done) {\n      var spy;\n\n      this.$input.on('autocomplete:selected', spy = jasmine.createSpy());\n      this.dropdown.trigger('suggestionClicked');\n\n      expect(spy).toHaveBeenCalledWith(\n        jasmine.any(Object),\n        undefined,\n        undefined,\n        { selectionMethod: 'click' }\n      );\n\n      var that = this;\n      waitsForAndRuns(function() { return that.dropdown.close.calls.count(); }, done, 100);\n    });\n  });\n\n  describe('when dropdown triggers suggestionClicked with undefined displayKey', function() {\n    beforeEach(function() {\n      this.dropdown.getDatumForSuggestion.and.returnValue({});\n    });\n\n    it('should not set input to undefined', function(done) {\n      var spy;\n\n      this.$input.on('autocomplete:selected', spy = jasmine.createSpy());\n      this.dropdown.trigger('suggestionClicked');\n\n      expect(spy).toHaveBeenCalled();\n      expect(this.input.setQuery).not.toHaveBeenCalled();\n      expect(this.input.setInputValue).toHaveBeenCalledWith(undefined, true);\n\n      var that = this;\n      waitsForAndRuns(function() { return that.dropdown.close.calls.count(); }, done, 100);\n    });\n  });\n\n  describe('when dropdown triggers cursorMoved', function() {\n    beforeEach(function() {\n      this.dropdown.getDatumForCursor.and.returnValue(testDatum);\n      this.dropdown.getCurrentCursor.and.returnValue($('<div id=\"option-id\"></div>'));\n    });\n\n    it('should update the input value', function() {\n      this.dropdown.trigger('cursorMoved', true);\n\n      expect(this.input.setInputValue)\n        .toHaveBeenCalledWith(testDatum.value, true);\n    });\n\n    it('should update the active descendant', function() {\n      this.dropdown.trigger('cursorMoved', false);\n\n      expect(this.input.setActiveDescendant)\n        .toHaveBeenCalledWith('option-id');\n    });\n\n    it('should not update the input', function() {\n      this.dropdown.trigger('cursorMoved', false);\n\n      expect(this.input.setInputValue)\n        .not.toHaveBeenCalled();\n    });\n\n    it('should trigger cursorchanged', function() {\n      var spy;\n\n      this.$input.on('autocomplete:cursorchanged', spy = jasmine.createSpy());\n\n      this.dropdown.trigger('cursorMoved');\n\n      expect(spy).toHaveBeenCalled();\n    });\n  });\n\n  describe('when dropdown triggers cursorRemoved', function() {\n    it('should reset the input value', function() {\n      this.dropdown.trigger('cursorRemoved');\n\n      expect(this.input.resetInputValue).toHaveBeenCalled();\n    });\n\n    it('should update the hint', function() {\n      this.dropdown.getDatumForTopSuggestion.and.returnValue(testDatum);\n      this.dropdown.isVisible.and.returnValue(true);\n      this.input.hasOverflow.and.returnValue(false);\n      this.input.getInputValue.and.returnValue(testDatum.value.slice(0, 2));\n\n      this.dropdown.trigger('cursorRemoved');\n\n      expect(this.input.setHint).toHaveBeenCalledWith(testDatum.value);\n    });\n  });\n\n  describe('when dropdown triggers datasetRendered', function() {\n    it('should update the hint asynchronously', function(done) {\n      this.dropdown.getDatumForTopSuggestion.and.returnValue(testDatum);\n      this.dropdown.isVisible.and.returnValue(true);\n      this.input.hasOverflow.and.returnValue(false);\n      this.input.getInputValue.and.returnValue(testDatum.value.slice(0, 2));\n\n      this.dropdown.trigger('datasetRendered');\n\n      // ensure it wasn't called synchronously\n      expect(this.input.setHint).not.toHaveBeenCalled();\n\n      var that = this;\n      waitsForAndRuns(function() { return !!that.input.setHint.calls.count(); }, function() {\n        expect(that.input.setHint).toHaveBeenCalledWith(testDatum.value);\n        done();\n      }, 100);\n    });\n\n    it('should trigger autocomplete:updated', function(done) {\n      var spy;\n      this.$input.on('autocomplete:updated', spy = jasmine.createSpy());\n\n      this.dropdown.trigger('datasetRendered');\n\n      var that = this;\n      waitsForAndRuns(function() { return !!that.input.setHint.calls.count(); }, function() {\n        expect(spy).toHaveBeenCalled();\n        done();\n      }, 100);\n    });\n  });\n\n  describe('when dropdown triggers opened', function() {\n    it('should update the hint', function() {\n      this.dropdown.getDatumForTopSuggestion.and.returnValue(testDatum);\n      this.dropdown.isVisible.and.returnValue(true);\n      this.input.hasOverflow.and.returnValue(false);\n      this.input.getInputValue.and.returnValue(testDatum.value.slice(0, 2));\n\n      this.dropdown.trigger('opened');\n\n      expect(this.input.setHint).toHaveBeenCalledWith(testDatum.value);\n    });\n\n    it('should trigger autocomplete:opened', function() {\n      var spy;\n\n      this.$input.on('autocomplete:opened', spy = jasmine.createSpy());\n\n      this.dropdown.trigger('opened');\n\n      expect(spy).toHaveBeenCalled();\n    });\n\n    it('should trigger autocomplete:shown', function() {\n      var spy;\n\n      this.$input.on('autocomplete:shown', spy = jasmine.createSpy());\n\n      this.dropdown.trigger('shown');\n\n      expect(spy).toHaveBeenCalled();\n    });\n\n    it('should trigger autocomplete:redrawn', function() {\n      var spy;\n\n      this.$input.on('autocomplete:redrawn', spy = jasmine.createSpy());\n\n      this.dropdown.trigger('redrawn');\n\n      expect(spy).toHaveBeenCalled();\n    });\n\n    it('should set the input\\'s aria-expanded to true', function() {\n      this.dropdown.trigger('opened');\n      expect(this.input.expand).toHaveBeenCalled();\n    });\n  });\n\n  describe('when dropdown triggers closed', function() {\n    it('should clear the hint', function() {\n      this.dropdown.trigger('closed');\n\n      expect(this.input.clearHint).toHaveBeenCalled();\n    });\n\n    it('should trigger autocomplete:closed', function() {\n      var spy;\n\n      this.$input.on('autocomplete:closed', spy = jasmine.createSpy());\n\n      this.dropdown.trigger('closed');\n\n      expect(spy).toHaveBeenCalled();\n    });\n\n    it('should set the input\\'s aria-expanded to false', function() {\n      this.dropdown.trigger('closed');\n      expect(this.input.collapse).toHaveBeenCalled();\n    });\n  });\n\n  describe('when input triggers focused', function() {\n    it('should activate the typeahead', function() {\n      this.input.trigger('focused');\n\n      expect(this.view.isActivated).toBe(true);\n    });\n\n    it('should not open the dropdown', function() {\n      this.input.trigger('focused');\n\n      expect(this.dropdown.open).not.toHaveBeenCalled();\n    });\n  });\n\n  describe('when input triggers blurred', function() {\n    it('should deactivate the typeahead', function() {\n      this.input.trigger('blurred');\n\n      expect(this.view.isActivated).toBe(false);\n    });\n\n    it('should empty the dropdown', function() {\n      this.input.trigger('blurred');\n\n      expect(this.dropdown.empty).toHaveBeenCalled();\n    });\n\n    it('should close the dropdown', function() {\n      this.input.trigger('blurred');\n\n      expect(this.dropdown.close).toHaveBeenCalled();\n    });\n\n    it('should select the suggestion if autoselectOnBlur is true', function() {\n      this.view.autoselectOnBlur = true;\n      this.dropdown.getDatumForTopSuggestion.and.returnValue(testDatum);\n\n      var spy;\n\n      this.$input.on('autocomplete:selected', spy = jasmine.createSpy());\n      this.input.trigger('blurred');\n\n      expect(spy).toHaveBeenCalled();\n      expect(this.input.setQuery).toHaveBeenCalledWith(testDatum.value);\n      expect(this.input.setInputValue)\n        .toHaveBeenCalledWith(testDatum.value, true);\n    });\n\n    it('should select the cursor suggestion if autoselectOnBlur is true', function() {\n      this.view.autoselectOnBlur = true;\n      this.dropdown.getDatumForTopSuggestion.and.returnValue(fixtures.data.simple[0]);\n      this.dropdown.getDatumForCursor.and.returnValue(fixtures.data.simple[1]);\n\n      var spy;\n\n      this.$input.on('autocomplete:selected', spy = jasmine.createSpy());\n      this.input.trigger('blurred');\n\n      expect(spy).toHaveBeenCalled();\n      expect(this.input.setQuery).toHaveBeenCalledWith(fixtures.data.simple[1].value);\n      expect(this.input.setInputValue).toHaveBeenCalledWith(fixtures.data.simple[1].value, true);\n    });\n\n    it('should pass the selectionMethod as part of the context', function() {\n      this.view.autoselectOnBlur = true;\n      this.dropdown.getDatumForTopSuggestion.and.returnValue(testDatum);\n\n      var spy;\n\n      this.$input.on('autocomplete:selected', spy = jasmine.createSpy());\n      this.input.trigger('blurred');\n\n      expect(spy).toHaveBeenCalledWith(\n        jasmine.any(Object),\n        undefined,\n        undefined,\n        { selectionMethod: 'blur' }\n      );\n    });\n  });\n\n  describe('when debug flag is set', function() {\n    beforeEach(function() {\n      this.view = new Typeahead({\n        input: this.$input,\n        debug: true,\n        hint: true,\n        datasets: {}\n      });\n      this.input = this.view.input;\n    });\n\n    describe('when input triggers blurred', function() {\n      it('should not empty the dropdown', function() {\n        this.input.trigger('blurred');\n\n        expect(this.dropdown.empty).not.toHaveBeenCalled();\n      });\n\n      it('should not close the dropdown', function() {\n        this.input.trigger('blurred');\n\n        expect(this.dropdown.close).not.toHaveBeenCalled();\n      });\n    });\n  });\n\n  describe('when clearOnSelected flag is set to true', function() {\n    it('clears input when selected', function() {\n      var spy = jasmine.createSpy();\n      var view = new Typeahead({\n        input: this.$input,\n        clearOnSelected: true,\n        hint: true,\n        datasets: {}\n      });\n      view.dropdown.getDatumForCursor.and.returnValue(testDatum);\n\n      // select something, and clear\n      var $e = jasmine.createSpyObj('event', ['preventDefault']);\n      view.$input.on('autocomplete:selected', spy);\n      view.input.trigger('enterKeyed', $e);\n\n      expect(spy).toHaveBeenCalledTimes(1);\n      expect(spy).toHaveBeenCalledWith(jasmine.objectContaining({\n        type: 'autocomplete:selected',\n        target: jasmine.any(Object),\n        delegateTarget: jasmine.any(Object),\n        currentTarget: jasmine.any(Object),\n        handleObj: jasmine.objectContaining({\n          type: 'autocomplete:selected'\n        })\n      }), undefined, undefined, jasmine.any(Object));\n      expect(view.input.setQuery).toHaveBeenCalledWith('');\n      expect(view.input.setInputValue).toHaveBeenCalledWith('', true);\n    });\n  });\n\n  describe('when input triggers enterKeyed', function() {\n    beforeEach(function() {\n      this.dropdown.getDatumForCursor.and.returnValue(testDatum);\n    });\n\n    it('should select the datum', function(done) {\n      var $e;\n      var spy;\n\n      $e = jasmine.createSpyObj('event', ['preventDefault']);\n      this.$input.on('autocomplete:selected', spy = jasmine.createSpy());\n      this.input.trigger('enterKeyed', $e);\n\n      expect(spy).toHaveBeenCalled();\n      expect(this.input.setQuery).toHaveBeenCalledWith(testDatum.value);\n      expect(this.input.setInputValue)\n        .toHaveBeenCalledWith(testDatum.value, true);\n\n      var that = this;\n      waitsForAndRuns(function() { return that.dropdown.close.calls.count(); }, done, 100);\n    });\n\n    it('should prevent the default behavior of the event', function() {\n      var $e;\n\n      $e = jasmine.createSpyObj('event', ['preventDefault']);\n      this.input.trigger('enterKeyed', $e);\n      expect($e.preventDefault).toHaveBeenCalled();\n    });\n\n    it('should pass the selection method as part of the context ', function(done) {\n      var $e;\n      var spy;\n      var anything = jasmine.any(Object);\n\n      $e = jasmine.createSpyObj('event', ['preventDefault']);\n      this.$input.on('autocomplete:selected', spy = jasmine.createSpy());\n      this.input.trigger('enterKeyed', $e);\n\n      expect(spy).toHaveBeenCalledWith(\n        anything,\n        undefined,\n        undefined,\n        {selectionMethod: 'enterKey'}\n      );\n\n      var that = this;\n      waitsForAndRuns(function() { return that.dropdown.close.calls.count(); }, done, 100);\n    });\n  });\n\n  describe('when input triggers tabKeyed', function() {\n    describe('when cursor is in use', function() {\n      beforeEach(function() {\n        this.dropdown.getDatumForCursor.and.returnValue(testDatum);\n      });\n\n      it('should select the datum', function(done) {\n        var $e;\n        var spy;\n\n        $e = jasmine.createSpyObj('event', ['preventDefault']);\n        this.$input.on('autocomplete:selected', spy = jasmine.createSpy());\n        this.input.trigger('tabKeyed', $e);\n\n        expect(spy).toHaveBeenCalled();\n        expect(this.input.setQuery).toHaveBeenCalledWith(testDatum.value);\n        expect(this.input.setInputValue)\n          .toHaveBeenCalledWith(testDatum.value, true);\n\n        var that = this;\n        waitsForAndRuns(function() { return that.dropdown.close.calls.count(); }, done, 100);\n      });\n\n      it('should prevent the default behavior of the event', function() {\n        var $e;\n\n        $e = jasmine.createSpyObj('event', ['preventDefault']);\n        this.input.trigger('tabKeyed', $e);\n\n        expect($e.preventDefault).toHaveBeenCalled();\n      });\n\n      it('should pass the selectionMethod as part of the context', function(done) {\n        var $e;\n        var spy;\n\n        $e = jasmine.createSpyObj('event', ['preventDefault']);\n        this.$input.on('autocomplete:selected', spy = jasmine.createSpy());\n        this.input.trigger('tabKeyed', $e);\n\n        expect(spy).toHaveBeenCalledWith(\n          jasmine.any(Object),\n          undefined,\n          undefined,\n          {selectionMethod: 'tabKey'}\n        );\n\n        var that = this;\n        waitsForAndRuns(function() { return that.dropdown.close.calls.count(); }, done, 100);\n      });\n    });\n\n    describe('when cursor is not in use', function() {\n      it('should autocomplete if tabAutocomplete is true', function() {\n        var spy;\n\n        this.input.getQuery.and.returnValue('bi');\n        this.input.getHint.and.returnValue(testDatum.value);\n        this.input.isCursorAtEnd.and.returnValue(true);\n        this.dropdown.getDatumForTopSuggestion.and.returnValue(testDatum);\n        this.$input.on('autocomplete:autocompleted', spy = jasmine.createSpy());\n\n        this.input.trigger('tabKeyed');\n\n        expect(this.input.setInputValue).toHaveBeenCalledWith(testDatum.value);\n        expect(spy).toHaveBeenCalled();\n      });\n\n      it('should not autocomplete if tabAutocomplete is false', function() {\n        this.view.tabAutocomplete = false;\n        var spy;\n\n        this.input.getQuery.and.returnValue('bi');\n        this.input.getHint.and.returnValue(testDatum.value);\n        this.input.isCursorAtEnd.and.returnValue(true);\n        this.dropdown.getDatumForTopSuggestion.and.returnValue(testDatum);\n        this.$input.on('autocomplete:autocompleted', spy = jasmine.createSpy());\n\n        this.input.trigger('tabKeyed');\n\n        expect(this.input.setInputValue).not.toHaveBeenCalledWith(testDatum.value);\n        expect(spy).not.toHaveBeenCalled();\n      });\n\n      it('should close the dropdown if tabAutocomplete is false', function() {\n        this.view.tabAutocomplete = false;\n\n        this.input.getQuery.and.returnValue('bi');\n        this.input.getHint.and.returnValue(testDatum.value);\n        this.input.isCursorAtEnd.and.returnValue(true);\n\n        this.input.trigger('tabKeyed');\n\n        expect(this.dropdown.close).toHaveBeenCalled();\n      });\n    });\n  });\n\n  describe('when input triggers escKeyed', function() {\n    it('should close the dropdown', function() {\n      this.input.trigger('escKeyed');\n\n      expect(this.dropdown.close).toHaveBeenCalled();\n    });\n\n    it('should reset the input value', function() {\n      this.input.trigger('escKeyed');\n\n      expect(this.input.resetInputValue).toHaveBeenCalled();\n    });\n  });\n\n  describe('when input triggers upKeyed', function() {\n    beforeEach(function() {\n      this.input.getQuery.and.returnValue('ghost');\n    });\n\n    describe('when dropdown is empty and minLength is satisfied', function() {\n      beforeEach(function() {\n        this.dropdown.isEmpty = true;\n        this.view.minLength = 2;\n        this.input.trigger('upKeyed');\n      });\n\n      it('should update dropdown', function() {\n        expect(this.dropdown.update).toHaveBeenCalledWith('ghost');\n      });\n\n      it('should not move cursor up', function() {\n        expect(this.dropdown.moveCursorUp).not.toHaveBeenCalled();\n      });\n    });\n\n    describe('when dropdown is not empty', function() {\n      beforeEach(function() {\n        this.dropdown.isEmpty = false;\n        this.view.minLength = 2;\n\n        this.input.trigger('upKeyed');\n      });\n\n      it('should not update dropdown', function() {\n        expect(this.dropdown.update).not.toHaveBeenCalled();\n      });\n\n      it('should move cursor up', function() {\n        expect(this.dropdown.moveCursorUp).toHaveBeenCalled();\n      });\n    });\n\n    describe('when minLength is not satisfied', function() {\n      beforeEach(function() {\n        this.dropdown.isEmpty = true;\n        this.view.minLength = 10;\n\n        this.input.trigger('upKeyed');\n      });\n\n      it('should not update dropdown', function() {\n        expect(this.dropdown.update).not.toHaveBeenCalled();\n      });\n\n      it('should move cursor up', function() {\n        expect(this.dropdown.moveCursorUp).toHaveBeenCalled();\n      });\n    });\n\n    it('should open the dropdown', function() {\n      this.input.trigger('upKeyed');\n\n      expect(this.dropdown.open).toHaveBeenCalled();\n    });\n  });\n\n  describe('when input triggers downKeyed', function() {\n    beforeEach(function() {\n      this.input.getQuery.and.returnValue('ghost');\n    });\n\n    describe('when dropdown is empty and minLength is satisfied', function() {\n      beforeEach(function() {\n        this.dropdown.isEmpty = true;\n        this.view.minLength = 2;\n\n        this.input.trigger('downKeyed');\n      });\n\n      it('should update dropdown', function() {\n        expect(this.dropdown.update).toHaveBeenCalledWith('ghost');\n      });\n\n      it('should not move cursor down', function() {\n        expect(this.dropdown.moveCursorDown).not.toHaveBeenCalled();\n      });\n    });\n\n    describe('when dropdown is not empty', function() {\n      beforeEach(function() {\n        this.dropdown.isEmpty = false;\n        this.view.minLength = 2;\n\n        this.input.trigger('downKeyed');\n      });\n\n      it('should not update dropdown', function() {\n        expect(this.dropdown.update).not.toHaveBeenCalled();\n      });\n\n      it('should move cursor down', function() {\n        expect(this.dropdown.moveCursorDown).toHaveBeenCalled();\n      });\n    });\n\n    describe('when minLength is not satisfied', function() {\n      beforeEach(function() {\n        this.dropdown.isEmpty = true;\n        this.view.minLength = 10;\n\n        this.input.trigger('downKeyed');\n      });\n\n      it('should not update dropdown', function() {\n        expect(this.dropdown.update).not.toHaveBeenCalled();\n      });\n\n      it('should move cursor down', function() {\n        expect(this.dropdown.moveCursorDown).toHaveBeenCalled();\n      });\n    });\n\n    it('should open the dropdown', function() {\n      this.input.trigger('downKeyed');\n\n      expect(this.dropdown.open).toHaveBeenCalled();\n    });\n  });\n\n  describe('when dropdown is empty', function() {\n    it('should trigger autocomplete:empty', function() {\n      var spy;\n\n      this.$input.on('autocomplete:empty', spy = jasmine.createSpy());\n\n      this.dropdown.trigger('empty');\n\n      expect(spy).toHaveBeenCalled();\n    });\n  });\n\n  describe('when input triggers leftKeyed', function() {\n    it('should autocomplete if language is rtl', function() {\n      var spy;\n\n      this.view.dir = 'rtl';\n      this.input.getQuery.and.returnValue('bi');\n      this.input.getHint.and.returnValue(testDatum.value);\n      this.input.isCursorAtEnd.and.returnValue(true);\n      this.dropdown.getDatumForTopSuggestion.and.returnValue(testDatum);\n      this.$input.on('autocomplete:autocompleted', spy = jasmine.createSpy());\n\n      this.input.trigger('leftKeyed');\n\n      expect(this.input.setInputValue).toHaveBeenCalledWith(testDatum.value);\n      expect(spy).toHaveBeenCalled();\n    });\n  });\n\n  describe('when input triggers rightKeyed', function() {\n    it('should autocomplete if language is ltr', function() {\n      var spy;\n\n      this.view.dir = 'ltr';\n      this.input.getQuery.and.returnValue('bi');\n      this.input.getHint.and.returnValue(testDatum.value);\n      this.input.isCursorAtEnd.and.returnValue(true);\n      this.dropdown.getDatumForTopSuggestion.and.returnValue(testDatum);\n      this.$input.on('autocomplete:autocompleted', spy = jasmine.createSpy());\n\n      this.input.trigger('rightKeyed');\n\n      expect(this.input.setInputValue).toHaveBeenCalledWith(testDatum.value);\n      expect(spy).toHaveBeenCalled();\n    });\n  });\n\n  describe('when input triggers queryChanged', function() {\n    it('should clear the hint if it has become invalid', function() {\n      this.input.trigger('queryChanged', testDatum.value);\n\n      expect(this.input.clearHintIfInvalid).toHaveBeenCalled();\n    });\n\n    it('should empty dropdown if the query is empty', function() {\n      this.input.trigger('queryChanged', '');\n\n      expect(this.dropdown.empty).toHaveBeenCalled();\n    });\n\n    it('should not empty dropdown if the query is non-empty', function() {\n      this.input.trigger('queryChanged', testDatum.value);\n\n      expect(this.dropdown.empty).not.toHaveBeenCalled();\n    });\n\n    it('should update dropdown', function() {\n      this.input.trigger('queryChanged', testDatum.value);\n\n      expect(this.dropdown.update).toHaveBeenCalledWith(testDatum.value);\n    });\n\n    it('should open the dropdown', function() {\n      this.input.trigger('queryChanged', testDatum.value);\n\n      expect(this.dropdown.open).toHaveBeenCalled();\n    });\n\n    it('should set the language direction', function() {\n      this.input.getLanguageDirection.and.returnValue('rtl');\n\n      this.input.trigger('queryChanged', testDatum.value);\n\n      expect(this.view.dir).toBe('rtl');\n      expect(this.view.$node).toHaveCss({direction: 'rtl'});\n      expect(this.dropdown.setLanguageDirection).toHaveBeenCalledWith('rtl');\n    });\n  });\n\n  describe('when input triggers whitespaceChanged', function() {\n    it('should update the hint', function() {\n      this.dropdown.getDatumForTopSuggestion.and.returnValue(testDatum);\n      this.dropdown.isVisible.and.returnValue(true);\n      this.input.hasOverflow.and.returnValue(false);\n      this.input.getInputValue.and.returnValue(testDatum.value.slice(0, 2));\n\n      this.input.trigger('whitespaceChanged');\n\n      expect(this.input.setHint).toHaveBeenCalledWith(testDatum.value);\n    });\n\n    it('should open the dropdown', function() {\n      this.input.trigger('whitespaceChanged');\n\n      expect(this.dropdown.open).toHaveBeenCalled();\n    });\n  });\n\n  describe('#open', function() {\n    it('should open the dropdown', function() {\n      this.input.getInputValue.and.returnValue('');\n      this.view.open();\n\n      expect(this.dropdown.open).toHaveBeenCalled();\n    });\n\n    it('should update & open the dropdown if there is a query', function() {\n      this.input.getInputValue.and.returnValue('test');\n      this.view.open();\n\n      expect(this.dropdown.update).toHaveBeenCalled();\n      expect(this.dropdown.open).toHaveBeenCalled();\n    });\n  });\n\n  describe('#close', function() {\n    it('should close the dropdown', function() {\n      this.view.close();\n\n      expect(this.dropdown.close).toHaveBeenCalled();\n    });\n  });\n\n  describe('#getVal', function() {\n    it('should return the current query', function() {\n      this.input.getQuery.and.returnValue('woah');\n      this.view.close();\n\n      expect(this.view.getVal()).toBe('woah');\n    });\n  });\n\n  describe('#setVal', function() {\n    it('should update query', function() {\n      this.view.isActivated = true;\n      this.view.setVal('woah');\n\n      expect(this.input.setInputValue).toHaveBeenCalledWith('woah');\n    });\n\n    it('should update query silently if not activated', function() {\n      this.view.setVal('woah');\n\n      expect(this.input.setQuery).toHaveBeenCalledWith('woah');\n      expect(this.input.setInputValue).toHaveBeenCalledWith('woah', true);\n    });\n  });\n\n  describe('#destroy', function() {\n    it('should destroy input', function() {\n      this.view.destroy();\n\n      expect(this.input.destroy).toHaveBeenCalled();\n    });\n\n    it('should destroy dropdown', function() {\n      this.view.destroy();\n\n      expect(this.dropdown.destroy).toHaveBeenCalled();\n    });\n\n    it('should null out its reference to the wrapper element', function() {\n      this.view.destroy();\n\n      expect(this.view.$node).toBeNull();\n    });\n\n    it('should revert DOM changes', function() {\n      this.view.destroy();\n\n      // TODO: bad test\n      expect(this.$input).not.toHaveClass('aa-input');\n    });\n  });\n\n  describe('when instantiated with a custom menu template', function() {\n    beforeEach(function() {\n      appendSetFixtures(fixtures.html.customMenu);\n\n      this.view.destroy();\n      this.view = new Typeahead({\n        input: this.$input,\n        templates: {\n          dropdownMenu: '#my-custom-menu-template'\n        },\n        datasets: {}\n      });\n    });\n\n    it('should include the template in the menu', function() {\n      var $fixture = $('#jasmine-fixtures');\n      expect($fixture.find('.aa-dropdown-menu .my-custom-menu').length).toEqual(1);\n    });\n  });\n\n  describe('when instantiated with a custom CSS classes', function() {\n    beforeEach(function() {\n      appendSetFixtures(fixtures.html.customMenu);\n\n      this.view.destroy();\n      this.view = new Typeahead({\n        input: this.$input,\n        hint: true,\n        cssClasses: {\n          root: 'my-root',\n          prefix: 'pp',\n          dropdownMenu: 'my-menu',\n          input: 'my-bar',\n          hint: 'my-clue',\n          suggestions: 'list',\n          suggestion: 'item',\n          cursor: 'pointer',\n          dataset: 'resultset'\n        },\n        datasets: {}\n      });\n    });\n\n    it('should include the template in the menu', function() {\n      var $fixture = $('#jasmine-fixtures');\n      expect($fixture.find('.my-root').length).toEqual(1);\n      expect($fixture.find('.my-root .pp-my-menu').length).toEqual(1);\n      expect($fixture.find('.my-root .pp-my-bar').length).toEqual(1);\n      expect($fixture.find('.my-root .pp-my-clue').length).toEqual(1);\n    });\n  });\n\n  describe('when instantiated with a custom menu container', function() {\n    beforeEach(function() {\n      appendSetFixtures(fixtures.html.customMenuContainer);\n\n      this.view.destroy();\n      this.view = new Typeahead({\n        input: this.$input,\n        dropdownMenuContainer: '#custom-menu-container',\n        datasets: {}\n      });\n    });\n\n    it('should include the template in the menu', function() {\n      var $fixture = $('#custom-menu-container');\n      expect($fixture.find('.aa-dropdown-menu').length).toEqual(1);\n    });\n  });\n\n  describe('when openOnFocus is set', function() {\n\n    beforeEach(function() {\n      appendSetFixtures(fixtures.html.customMenu);\n\n      this.view.destroy();\n      this.view = new Typeahead({\n        input: this.$input,\n        openOnFocus: true,\n        minLength: 0,\n        datasets: {}\n      });\n\n      this.input = this.view.input;\n    });\n\n    it('should open the dropdown', function() {\n      this.input.getQuery.and.returnValue('');\n      this.input.trigger('focused');\n      expect(this.view.dropdown.open).toHaveBeenCalled();\n    });\n  });\n\n  describe('when set autoWidth option', function() {\n    it('should set default to true', function() {\n      this.dropdown.trigger('redrawn');\n      expect(this.view.autoWidth).toBeTruthy();\n      expect(/\\d{3}px/.test(this.view.$node[0].style.width)).toBeTruthy();\n    });\n\n    it('should not put width style when autoWidth is false', function() {\n      this.view.autoWidth = false;\n      this.dropdown.trigger('redrawn');\n      expect(this.view.autoWidth).toBeFalsy();\n      expect(this.view.$node[0].style.width).toBeFalsy();\n    });\n  });\n\n  describe('when aria-label is set', function() {\n    beforeEach(function() {\n      this.view.destroy();\n    });\n\n    it('should set aria-label to the specified string', function() {\n      this.view = new Typeahead({\n        input: this.$input,\n        ariaLabel: 'custom-aria-label'\n      });\n\n      expect(this.$input.attr('aria-label')).toBe('custom-aria-label');\n    });\n\n    it('should not set an aria-label if no value is specified', function() {\n      this.view = new Typeahead({\n        input: this.$input\n      });\n\n      expect(this.$input.attr('aria-label')).toBeUndefined();\n    });\n  });\n});\n"
  },
  {
    "path": "js/autocomplete.js/test/unit/utils_spec.js",
    "content": "'use strict';\n\n/* eslint-env mocha, jasmine */\n\nvar _ = require('../../src/common/utils.js');\n\ndescribe('escapeHTML', function() {\n  it('should escape HTML but preserve the default tags', function() {\n    var test = '<em><img src=VALUE1 onerror=alert(1) /></em>' +\n    'OTHER CONTENT<em>VALUE2</em>OTHER CONTENT$';\n    var actual = _.escapeHighlightedString(test);\n    expect(actual).toEqual('<em>&lt;img src=VALUE1 onerror=alert(1) /&gt;</em>OTHER CONTENT<em>VALUE2</em>OTHER CONTENT$');\n  });\n\n  it('should escape HTML but preserve the default tags when using custom tags', function() {\n    var test = '<span class=\"highlighted\"><img src=VALUE1 onerror=alert(1) /></span>' +\n    'OTHER CONTENT<span class=\"highlighted\">VALUE2</span>OTHER CONTENT$';\n    var actual = _.escapeHighlightedString(test, '<span class=\"highlighted\">', '</span>');\n    expect(actual).toEqual('<span class=\"highlighted\">&lt;img src=VALUE1 onerror=alert(1) /&gt;</span>OTHER CONTENT<span class=\"highlighted\">VALUE2</span>OTHER CONTENT$');\n  });\n\n  it('should report the isMsie state correctly', function() {\n    var actual = _.isMsie();\n    expect(actual).toEqual(false);\n  });\n\n  it('should report the isMsie state correctly under a non-IE browser', function() {\n    var ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36';\n    var actual = _.isMsie(ua);\n    expect(actual).toEqual(false);\n  });\n\n  it('should report the isMsie state correctly under an IE browser', function() {\n    var ua = 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko';\n    var actual = _.isMsie(ua);\n    expect(actual).toEqual('11.0');\n  });\n\n  it('should report the isMsie state correctly under a browser that includes Trident but is not IE', function() {\n    var ua = 'Mozilla/5.0 (iPad; CPU OS 11_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15G77 KurogoVersion/2.7.7 (Kurogo iOS Tablet) KurogoOSVersion/11.4.1 KurogoAppVersion/2.0.1 (com.telerik.TridentUniversity)';\n    var actual = _.isMsie(ua);\n    expect(actual).toEqual(false);\n  });\n});\n\ndescribe('every', function() {\n  // simulating an implementation of Array.prototype.each\n  _.each = function(obj, callback) {\n    for (var i = 0; i < obj.length; i++) {\n      callback(obj[i], i, _);\n      // note that we do not return here to break for loop, angular does not do this\n    }\n  };\n\n  it('_.every should return false when at least one result is false', function() {\n    expect(\n      _.every([\n        {isEmpty: true},\n        {isEmpty: false}\n      ], function(dataset) {\n        return dataset.isEmpty;\n      })).toEqual(false);\n  });\n\n  it('_.every should return false when each result is false', function() {\n    expect(\n      _.every([\n        {isEmpty: false},\n        {isEmpty: false}\n      ], function(dataset) {\n        return dataset.isEmpty;\n      })).toEqual(false);\n  });\n\n  it('_.every should return true when all results are true', function() {\n    expect(\n      _.every([\n        {isEmpty: true},\n        {isEmpty: true}\n      ], function(dataset) {\n        return dataset.isEmpty;\n      })).toEqual(true);\n  });\n});\n"
  },
  {
    "path": "js/autocomplete.js/version.js",
    "content": "module.exports = \"0.38.1\";\n"
  },
  {
    "path": "js/autocomplete.js/zepto.js",
    "content": "/* istanbul ignore next */\n/* Zepto v1.2.0 - zepto event assets data - zeptojs.com/license */\n(function(global, factory) {\n  module.exports = factory(global);\n}(/* this ##### UPDATED: here we want to use window/global instead of this which is the current file context ##### */ window, function(window) {\n  var Zepto = (function() {\n  var undefined, key, $, classList, emptyArray = [], concat = emptyArray.concat, filter = emptyArray.filter, slice = emptyArray.slice,\n    document = window.document,\n    elementDisplay = {}, classCache = {},\n    cssNumber = { 'column-count': 1, 'columns': 1, 'font-weight': 1, 'line-height': 1,'opacity': 1, 'z-index': 1, 'zoom': 1 },\n    fragmentRE = /^\\s*<(\\w+|!)[^>]*>/,\n    singleTagRE = /^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/,\n    tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/ig,\n    rootNodeRE = /^(?:body|html)$/i,\n    capitalRE = /([A-Z])/g,\n\n    // special attributes that should be get/set via method calls\n    methodAttributes = ['val', 'css', 'html', 'text', 'data', 'width', 'height', 'offset'],\n\n    adjacencyOperators = [ 'after', 'prepend', 'before', 'append' ],\n    table = document.createElement('table'),\n    tableRow = document.createElement('tr'),\n    containers = {\n      'tr': document.createElement('tbody'),\n      'tbody': table, 'thead': table, 'tfoot': table,\n      'td': tableRow, 'th': tableRow,\n      '*': document.createElement('div')\n    },\n    readyRE = /complete|loaded|interactive/,\n    simpleSelectorRE = /^[\\w-]*$/,\n    class2type = {},\n    toString = class2type.toString,\n    zepto = {},\n    camelize, uniq,\n    tempParent = document.createElement('div'),\n    propMap = {\n      'tabindex': 'tabIndex',\n      'readonly': 'readOnly',\n      'for': 'htmlFor',\n      'class': 'className',\n      'maxlength': 'maxLength',\n      'cellspacing': 'cellSpacing',\n      'cellpadding': 'cellPadding',\n      'rowspan': 'rowSpan',\n      'colspan': 'colSpan',\n      'usemap': 'useMap',\n      'frameborder': 'frameBorder',\n      'contenteditable': 'contentEditable'\n    },\n    isArray = Array.isArray ||\n      function(object){ return object instanceof Array }\n\n  zepto.matches = function(element, selector) {\n    if (!selector || !element || element.nodeType !== 1) return false\n    var matchesSelector = element.matches || element.webkitMatchesSelector ||\n                          element.mozMatchesSelector || element.oMatchesSelector ||\n                          element.matchesSelector\n    if (matchesSelector) return matchesSelector.call(element, selector)\n    // fall back to performing a selector:\n    var match, parent = element.parentNode, temp = !parent\n    if (temp) (parent = tempParent).appendChild(element)\n    match = ~zepto.qsa(parent, selector).indexOf(element)\n    temp && tempParent.removeChild(element)\n    return match\n  }\n\n  function type(obj) {\n    return obj == null ? String(obj) :\n      class2type[toString.call(obj)] || \"object\"\n  }\n\n  function isFunction(value) { return type(value) == \"function\" }\n  function isWindow(obj)     { return obj != null && obj == obj.window }\n  function isDocument(obj)   { return obj != null && obj.nodeType == obj.DOCUMENT_NODE }\n  function isObject(obj)     { return type(obj) == \"object\" }\n  function isPlainObject(obj) {\n    return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype\n  }\n\n  function likeArray(obj) {\n    var length = !!obj && 'length' in obj && obj.length,\n      type = $.type(obj)\n\n    return 'function' != type && !isWindow(obj) && (\n      'array' == type || length === 0 ||\n        (typeof length == 'number' && length > 0 && (length - 1) in obj)\n    )\n  }\n\n  function compact(array) { return filter.call(array, function(item){ return item != null }) }\n  function flatten(array) { return array.length > 0 ? $.fn.concat.apply([], array) : array }\n  camelize = function(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) }\n  function dasherize(str) {\n    return str.replace(/::/g, '/')\n           .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n           .replace(/([a-z\\d])([A-Z])/g, '$1_$2')\n           .replace(/_/g, '-')\n           .toLowerCase()\n  }\n  uniq = function(array){ return filter.call(array, function(item, idx){ return array.indexOf(item) == idx }) }\n\n  function classRE(name) {\n    return name in classCache ?\n      classCache[name] : (classCache[name] = new RegExp('(^|\\\\s)' + name + '(\\\\s|$)'))\n  }\n\n  function maybeAddPx(name, value) {\n    return (typeof value == \"number\" && !cssNumber[dasherize(name)]) ? value + \"px\" : value\n  }\n\n  function defaultDisplay(nodeName) {\n    var element, display\n    if (!elementDisplay[nodeName]) {\n      element = document.createElement(nodeName)\n      document.body.appendChild(element)\n      display = getComputedStyle(element, '').getPropertyValue(\"display\")\n      element.parentNode.removeChild(element)\n      display == \"none\" && (display = \"block\")\n      elementDisplay[nodeName] = display\n    }\n    return elementDisplay[nodeName]\n  }\n\n  function children(element) {\n    return 'children' in element ?\n      slice.call(element.children) :\n      $.map(element.childNodes, function(node){ if (node.nodeType == 1) return node })\n  }\n\n  function Z(dom, selector) {\n    var i, len = dom ? dom.length : 0\n    for (i = 0; i < len; i++) this[i] = dom[i]\n    this.length = len\n    this.selector = selector || ''\n  }\n\n  // `$.zepto.fragment` takes a html string and an optional tag name\n  // to generate DOM nodes from the given html string.\n  // The generated DOM nodes are returned as an array.\n  // This function can be overridden in plugins for example to make\n  // it compatible with browsers that don't support the DOM fully.\n  zepto.fragment = function(html, name, properties) {\n    var dom, nodes, container\n\n    // A special case optimization for a single tag\n    if (singleTagRE.test(html)) dom = $(document.createElement(RegExp.$1))\n\n    if (!dom) {\n      if (html.replace) html = html.replace(tagExpanderRE, \"<$1></$2>\")\n      if (name === undefined) name = fragmentRE.test(html) && RegExp.$1\n      if (!(name in containers)) name = '*'\n\n      container = containers[name]\n      container.innerHTML = '' + html\n      dom = $.each(slice.call(container.childNodes), function(){\n        container.removeChild(this)\n      })\n    }\n\n    if (isPlainObject(properties)) {\n      nodes = $(dom)\n      $.each(properties, function(key, value) {\n        if (methodAttributes.indexOf(key) > -1) nodes[key](value)\n        else nodes.attr(key, value)\n      })\n    }\n\n    return dom\n  }\n\n  // `$.zepto.Z` swaps out the prototype of the given `dom` array\n  // of nodes with `$.fn` and thus supplying all the Zepto functions\n  // to the array. This method can be overridden in plugins.\n  zepto.Z = function(dom, selector) {\n    return new Z(dom, selector)\n  }\n\n  // `$.zepto.isZ` should return `true` if the given object is a Zepto\n  // collection. This method can be overridden in plugins.\n  zepto.isZ = function(object) {\n    return object instanceof zepto.Z\n  }\n\n  // `$.zepto.init` is Zepto's counterpart to jQuery's `$.fn.init` and\n  // takes a CSS selector and an optional context (and handles various\n  // special cases).\n  // This method can be overridden in plugins.\n  zepto.init = function(selector, context) {\n    var dom\n    // If nothing given, return an empty Zepto collection\n    if (!selector) return zepto.Z()\n    // Optimize for string selectors\n    else if (typeof selector == 'string') {\n      selector = selector.trim()\n      // If it's a html fragment, create nodes from it\n      // Note: In both Chrome 21 and Firefox 15, DOM error 12\n      // is thrown if the fragment doesn't begin with <\n      if (selector[0] == '<' && fragmentRE.test(selector))\n        dom = zepto.fragment(selector, RegExp.$1, context), selector = null\n      // If there's a context, create a collection on that context first, and select\n      // nodes from there\n      else if (context !== undefined) return $(context).find(selector)\n      // If it's a CSS selector, use it to select nodes.\n      else dom = zepto.qsa(document, selector)\n    }\n    // If a function is given, call it when the DOM is ready\n    else if (isFunction(selector)) return $(document).ready(selector)\n    // If a Zepto collection is given, just return it\n    else if (zepto.isZ(selector)) return selector\n    else {\n      // normalize array if an array of nodes is given\n      if (isArray(selector)) dom = compact(selector)\n      // Wrap DOM nodes.\n      else if (isObject(selector))\n        dom = [selector], selector = null\n      // If it's a html fragment, create nodes from it\n      else if (fragmentRE.test(selector))\n        dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null\n      // If there's a context, create a collection on that context first, and select\n      // nodes from there\n      else if (context !== undefined) return $(context).find(selector)\n      // And last but no least, if it's a CSS selector, use it to select nodes.\n      else dom = zepto.qsa(document, selector)\n    }\n    // create a new Zepto collection from the nodes found\n    return zepto.Z(dom, selector)\n  }\n\n  // `$` will be the base `Zepto` object. When calling this\n  // function just call `$.zepto.init, which makes the implementation\n  // details of selecting nodes and creating Zepto collections\n  // patchable in plugins.\n  $ = function(selector, context){\n    return zepto.init(selector, context)\n  }\n\n  function extend(target, source, deep) {\n    for (key in source)\n      if (deep && (isPlainObject(source[key]) || isArray(source[key]))) {\n        if (isPlainObject(source[key]) && !isPlainObject(target[key]))\n          target[key] = {}\n        if (isArray(source[key]) && !isArray(target[key]))\n          target[key] = []\n        extend(target[key], source[key], deep)\n      }\n      else if (source[key] !== undefined) target[key] = source[key]\n  }\n\n  // Copy all but undefined properties from one or more\n  // objects to the `target` object.\n  $.extend = function(target){\n    var deep, args = slice.call(arguments, 1)\n    if (typeof target == 'boolean') {\n      deep = target\n      target = args.shift()\n    }\n    args.forEach(function(arg){ extend(target, arg, deep) })\n    return target\n  }\n\n  // `$.zepto.qsa` is Zepto's CSS selector implementation which\n  // uses `document.querySelectorAll` and optimizes for some special cases, like `#id`.\n  // This method can be overridden in plugins.\n  zepto.qsa = function(element, selector){\n    var found,\n        maybeID = selector[0] == '#',\n        maybeClass = !maybeID && selector[0] == '.',\n        nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, // Ensure that a 1 char tag name still gets checked\n        isSimple = simpleSelectorRE.test(nameOnly)\n    return (element.getElementById && isSimple && maybeID) ? // Safari DocumentFragment doesn't have getElementById\n      ( (found = element.getElementById(nameOnly)) ? [found] : [] ) :\n      (element.nodeType !== 1 && element.nodeType !== 9 && element.nodeType !== 11) ? [] :\n      slice.call(\n        isSimple && !maybeID && element.getElementsByClassName ? // DocumentFragment doesn't have getElementsByClassName/TagName\n          maybeClass ? element.getElementsByClassName(nameOnly) : // If it's simple, it could be a class\n          element.getElementsByTagName(selector) : // Or a tag\n          element.querySelectorAll(selector) // Or it's not simple, and we need to query all\n      )\n  }\n\n  function filtered(nodes, selector) {\n    return selector == null ? $(nodes) : $(nodes).filter(selector)\n  }\n\n  $.contains = document.documentElement.contains ?\n    function(parent, node) {\n      return parent !== node && parent.contains(node)\n    } :\n    function(parent, node) {\n      while (node && (node = node.parentNode))\n        if (node === parent) return true\n      return false\n    }\n\n  function funcArg(context, arg, idx, payload) {\n    return isFunction(arg) ? arg.call(context, idx, payload) : arg\n  }\n\n  function setAttribute(node, name, value) {\n    value == null ? node.removeAttribute(name) : node.setAttribute(name, value)\n  }\n\n  // access className property while respecting SVGAnimatedString\n  function className(node, value){\n    var klass = node.className || '',\n        svg   = klass && klass.baseVal !== undefined\n\n    if (value === undefined) return svg ? klass.baseVal : klass\n    svg ? (klass.baseVal = value) : (node.className = value)\n  }\n\n  // \"true\"  => true\n  // \"false\" => false\n  // \"null\"  => null\n  // \"42\"    => 42\n  // \"42.5\"  => 42.5\n  // \"08\"    => \"08\"\n  // JSON    => parse if valid\n  // String  => self\n  function deserializeValue(value) {\n    try {\n      return value ?\n        value == \"true\" ||\n        ( value == \"false\" ? false :\n          value == \"null\" ? null :\n          +value + \"\" == value ? +value :\n          /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n          value )\n        : value\n    } catch(e) {\n      return value\n    }\n  }\n\n  $.type = type\n  $.isFunction = isFunction\n  $.isWindow = isWindow\n  $.isArray = isArray\n  $.isPlainObject = isPlainObject\n\n  $.isEmptyObject = function(obj) {\n    var name\n    for (name in obj) return false\n    return true\n  }\n\n  $.isNumeric = function(val) {\n    var num = Number(val), type = typeof val\n    return val != null && type != 'boolean' &&\n      (type != 'string' || val.length) &&\n      !isNaN(num) && isFinite(num) || false\n  }\n\n  $.inArray = function(elem, array, i){\n    return emptyArray.indexOf.call(array, elem, i)\n  }\n\n  $.camelCase = camelize\n  $.trim = function(str) {\n    return str == null ? \"\" : String.prototype.trim.call(str)\n  }\n\n  // plugin compatibility\n  $.uuid = 0\n  $.support = { }\n  $.expr = { }\n  $.noop = function() {}\n\n  $.map = function(elements, callback){\n    var value, values = [], i, key\n    if (likeArray(elements))\n      for (i = 0; i < elements.length; i++) {\n        value = callback(elements[i], i)\n        if (value != null) values.push(value)\n      }\n    else\n      for (key in elements) {\n        value = callback(elements[key], key)\n        if (value != null) values.push(value)\n      }\n    return flatten(values)\n  }\n\n  $.each = function(elements, callback){\n    var i, key\n    if (likeArray(elements)) {\n      for (i = 0; i < elements.length; i++)\n        if (callback.call(elements[i], i, elements[i]) === false) return elements\n    } else {\n      for (key in elements)\n        if (callback.call(elements[key], key, elements[key]) === false) return elements\n    }\n\n    return elements\n  }\n\n  $.grep = function(elements, callback){\n    return filter.call(elements, callback)\n  }\n\n  if (window.JSON) $.parseJSON = JSON.parse\n\n  // Populate the class2type map\n  $.each(\"Boolean Number String Function Array Date RegExp Object Error\".split(\" \"), function(i, name) {\n    class2type[ \"[object \" + name + \"]\" ] = name.toLowerCase()\n  })\n\n  // Define methods that will be available on all\n  // Zepto collections\n  $.fn = {\n    constructor: zepto.Z,\n    length: 0,\n\n    // Because a collection acts like an array\n    // copy over these useful array functions.\n    forEach: emptyArray.forEach,\n    reduce: emptyArray.reduce,\n    push: emptyArray.push,\n    sort: emptyArray.sort,\n    splice: emptyArray.splice,\n    indexOf: emptyArray.indexOf,\n    concat: function(){\n      var i, value, args = []\n      for (i = 0; i < arguments.length; i++) {\n        value = arguments[i]\n        args[i] = zepto.isZ(value) ? value.toArray() : value\n      }\n      return concat.apply(zepto.isZ(this) ? this.toArray() : this, args)\n    },\n\n    // `map` and `slice` in the jQuery API work differently\n    // from their array counterparts\n    map: function(fn){\n      return $($.map(this, function(el, i){ return fn.call(el, i, el) }))\n    },\n    slice: function(){\n      return $(slice.apply(this, arguments))\n    },\n\n    ready: function(callback){\n      // need to check if document.body exists for IE as that browser reports\n      // document ready when it hasn't yet created the body element\n      if (readyRE.test(document.readyState) && document.body) callback($)\n      else document.addEventListener('DOMContentLoaded', function(){ callback($) }, false)\n      return this\n    },\n    get: function(idx){\n      return idx === undefined ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length]\n    },\n    toArray: function(){ return this.get() },\n    size: function(){\n      return this.length\n    },\n    remove: function(){\n      return this.each(function(){\n        if (this.parentNode != null)\n          this.parentNode.removeChild(this)\n      })\n    },\n    each: function(callback){\n      emptyArray.every.call(this, function(el, idx){\n        return callback.call(el, idx, el) !== false\n      })\n      return this\n    },\n    filter: function(selector){\n      if (isFunction(selector)) return this.not(this.not(selector))\n      return $(filter.call(this, function(element){\n        return zepto.matches(element, selector)\n      }))\n    },\n    add: function(selector,context){\n      return $(uniq(this.concat($(selector,context))))\n    },\n    is: function(selector){\n      return this.length > 0 && zepto.matches(this[0], selector)\n    },\n    not: function(selector){\n      var nodes=[]\n      if (isFunction(selector) && selector.call !== undefined)\n        this.each(function(idx){\n          if (!selector.call(this,idx)) nodes.push(this)\n        })\n      else {\n        var excludes = typeof selector == 'string' ? this.filter(selector) :\n          (likeArray(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector)\n        this.forEach(function(el){\n          if (excludes.indexOf(el) < 0) nodes.push(el)\n        })\n      }\n      return $(nodes)\n    },\n    has: function(selector){\n      return this.filter(function(){\n        return isObject(selector) ?\n          $.contains(this, selector) :\n          $(this).find(selector).size()\n      })\n    },\n    eq: function(idx){\n      return idx === -1 ? this.slice(idx) : this.slice(idx, + idx + 1)\n    },\n    first: function(){\n      var el = this[0]\n      return el && !isObject(el) ? el : $(el)\n    },\n    last: function(){\n      var el = this[this.length - 1]\n      return el && !isObject(el) ? el : $(el)\n    },\n    find: function(selector){\n      var result, $this = this\n      if (!selector) result = $()\n      else if (typeof selector == 'object')\n        result = $(selector).filter(function(){\n          var node = this\n          return emptyArray.some.call($this, function(parent){\n            return $.contains(parent, node)\n          })\n        })\n      else if (this.length == 1) result = $(zepto.qsa(this[0], selector))\n      else result = this.map(function(){ return zepto.qsa(this, selector) })\n      return result\n    },\n    closest: function(selector, context){\n      var nodes = [], collection = typeof selector == 'object' && $(selector)\n      this.each(function(_, node){\n        while (node && !(collection ? collection.indexOf(node) >= 0 : zepto.matches(node, selector)))\n          node = node !== context && !isDocument(node) && node.parentNode\n        if (node && nodes.indexOf(node) < 0) nodes.push(node)\n      })\n      return $(nodes)\n    },\n    parents: function(selector){\n      var ancestors = [], nodes = this\n      while (nodes.length > 0)\n        nodes = $.map(nodes, function(node){\n          if ((node = node.parentNode) && !isDocument(node) && ancestors.indexOf(node) < 0) {\n            ancestors.push(node)\n            return node\n          }\n        })\n      return filtered(ancestors, selector)\n    },\n    parent: function(selector){\n      return filtered(uniq(this.pluck('parentNode')), selector)\n    },\n    children: function(selector){\n      return filtered(this.map(function(){ return children(this) }), selector)\n    },\n    contents: function() {\n      return this.map(function() { return this.contentDocument || slice.call(this.childNodes) })\n    },\n    siblings: function(selector){\n      return filtered(this.map(function(i, el){\n        return filter.call(children(el.parentNode), function(child){ return child!==el })\n      }), selector)\n    },\n    empty: function(){\n      return this.each(function(){ this.innerHTML = '' })\n    },\n    // `pluck` is borrowed from Prototype.js\n    pluck: function(property){\n      return $.map(this, function(el){ return el[property] })\n    },\n    show: function(){\n      return this.each(function(){\n        this.style.display == \"none\" && (this.style.display = '')\n        if (getComputedStyle(this, '').getPropertyValue(\"display\") == \"none\")\n          this.style.display = defaultDisplay(this.nodeName)\n      })\n    },\n    replaceWith: function(newContent){\n      return this.before(newContent).remove()\n    },\n    wrap: function(structure){\n      var func = isFunction(structure)\n      if (this[0] && !func)\n        var dom   = $(structure).get(0),\n            clone = dom.parentNode || this.length > 1\n\n      return this.each(function(index){\n        $(this).wrapAll(\n          func ? structure.call(this, index) :\n            clone ? dom.cloneNode(true) : dom\n        )\n      })\n    },\n    wrapAll: function(structure){\n      if (this[0]) {\n        $(this[0]).before(structure = $(structure))\n        var children\n        // drill down to the inmost element\n        while ((children = structure.children()).length) structure = children.first()\n        $(structure).append(this)\n      }\n      return this\n    },\n    wrapInner: function(structure){\n      var func = isFunction(structure)\n      return this.each(function(index){\n        var self = $(this), contents = self.contents(),\n            dom  = func ? structure.call(this, index) : structure\n        contents.length ? contents.wrapAll(dom) : self.append(dom)\n      })\n    },\n    unwrap: function(){\n      this.parent().each(function(){\n        $(this).replaceWith($(this).children())\n      })\n      return this\n    },\n    clone: function(){\n      return this.map(function(){ return this.cloneNode(true) })\n    },\n    hide: function(){\n      return this.css(\"display\", \"none\")\n    },\n    toggle: function(setting){\n      return this.each(function(){\n        var el = $(this)\n        ;(setting === undefined ? el.css(\"display\") == \"none\" : setting) ? el.show() : el.hide()\n      })\n    },\n    prev: function(selector){ return $(this.pluck('previousElementSibling')).filter(selector || '*') },\n    next: function(selector){ return $(this.pluck('nextElementSibling')).filter(selector || '*') },\n    html: function(html){\n      return 0 in arguments ?\n        this.each(function(idx){\n          var originHtml = this.innerHTML\n          $(this).empty().append( funcArg(this, html, idx, originHtml) )\n        }) :\n        (0 in this ? this[0].innerHTML : null)\n    },\n    text: function(text){\n      return 0 in arguments ?\n        this.each(function(idx){\n          var newText = funcArg(this, text, idx, this.textContent)\n          this.textContent = newText == null ? '' : ''+newText\n        }) :\n        (0 in this ? this.pluck('textContent').join(\"\") : null)\n    },\n    attr: function(name, value){\n      var result\n      return (typeof name == 'string' && !(1 in arguments)) ?\n        (0 in this && this[0].nodeType == 1 && (result = this[0].getAttribute(name)) != null ? result : undefined) :\n        this.each(function(idx){\n          if (this.nodeType !== 1) return\n          if (isObject(name)) for (key in name) setAttribute(this, key, name[key])\n          else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name)))\n        })\n    },\n    removeAttr: function(name){\n      return this.each(function(){ this.nodeType === 1 && name.split(' ').forEach(function(attribute){\n        setAttribute(this, attribute)\n      }, this)})\n    },\n    prop: function(name, value){\n      name = propMap[name] || name\n      return (1 in arguments) ?\n        this.each(function(idx){\n          this[name] = funcArg(this, value, idx, this[name])\n        }) :\n        (this[0] && this[0][name])\n    },\n    removeProp: function(name){\n      name = propMap[name] || name\n      return this.each(function(){ delete this[name] })\n    },\n    data: function(name, value){\n      var attrName = 'data-' + name.replace(capitalRE, '-$1').toLowerCase()\n\n      var data = (1 in arguments) ?\n        this.attr(attrName, value) :\n        this.attr(attrName)\n\n      return data !== null ? deserializeValue(data) : undefined\n    },\n    val: function(value){\n      if (0 in arguments) {\n        if (value == null) value = \"\"\n        return this.each(function(idx){\n          this.value = funcArg(this, value, idx, this.value)\n        })\n      } else {\n        return this[0] && (this[0].multiple ?\n           $(this[0]).find('option').filter(function(){ return this.selected }).pluck('value') :\n           this[0].value)\n      }\n    },\n    offset: function(coordinates){\n      if (coordinates) return this.each(function(index){\n        var $this = $(this),\n            coords = funcArg(this, coordinates, index, $this.offset()),\n            parentOffset = $this.offsetParent().offset(),\n            props = {\n              top:  coords.top  - parentOffset.top,\n              left: coords.left - parentOffset.left\n            }\n\n        if ($this.css('position') == 'static') props['position'] = 'relative'\n        $this.css(props)\n      })\n      if (!this.length) return null\n      if (document.documentElement !== this[0] && !$.contains(document.documentElement, this[0]))\n        return {top: 0, left: 0}\n      var obj = this[0].getBoundingClientRect()\n      return {\n        left: obj.left + window.pageXOffset,\n        top: obj.top + window.pageYOffset,\n        width: Math.round(obj.width),\n        height: Math.round(obj.height)\n      }\n    },\n    css: function(property, value){\n      if (arguments.length < 2) {\n        var element = this[0]\n        if (typeof property == 'string') {\n          if (!element) return\n          return element.style[camelize(property)] || getComputedStyle(element, '').getPropertyValue(property)\n        } else if (isArray(property)) {\n          if (!element) return\n          var props = {}\n          var computedStyle = getComputedStyle(element, '')\n          $.each(property, function(_, prop){\n            props[prop] = (element.style[camelize(prop)] || computedStyle.getPropertyValue(prop))\n          })\n          return props\n        }\n      }\n\n      var css = ''\n      if (type(property) == 'string') {\n        if (!value && value !== 0)\n          this.each(function(){ this.style.removeProperty(dasherize(property)) })\n        else\n          css = dasherize(property) + \":\" + maybeAddPx(property, value)\n      } else {\n        for (key in property)\n          if (!property[key] && property[key] !== 0)\n            this.each(function(){ this.style.removeProperty(dasherize(key)) })\n          else\n            css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';'\n      }\n\n      return this.each(function(){ this.style.cssText += ';' + css })\n    },\n    index: function(element){\n      return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0])\n    },\n    hasClass: function(name){\n      if (!name) return false\n      return emptyArray.some.call(this, function(el){\n        return this.test(className(el))\n      }, classRE(name))\n    },\n    addClass: function(name){\n      if (!name) return this\n      return this.each(function(idx){\n        if (!('className' in this)) return\n        classList = []\n        var cls = className(this), newName = funcArg(this, name, idx, cls)\n        newName.split(/\\s+/g).forEach(function(klass){\n          if (!$(this).hasClass(klass)) classList.push(klass)\n        }, this)\n        classList.length && className(this, cls + (cls ? \" \" : \"\") + classList.join(\" \"))\n      })\n    },\n    removeClass: function(name){\n      return this.each(function(idx){\n        if (!('className' in this)) return\n        if (name === undefined) return className(this, '')\n        classList = className(this)\n        funcArg(this, name, idx, classList).split(/\\s+/g).forEach(function(klass){\n          classList = classList.replace(classRE(klass), \" \")\n        })\n        className(this, classList.trim())\n      })\n    },\n    toggleClass: function(name, when){\n      if (!name) return this\n      return this.each(function(idx){\n        var $this = $(this), names = funcArg(this, name, idx, className(this))\n        names.split(/\\s+/g).forEach(function(klass){\n          (when === undefined ? !$this.hasClass(klass) : when) ?\n            $this.addClass(klass) : $this.removeClass(klass)\n        })\n      })\n    },\n    scrollTop: function(value){\n      if (!this.length) return\n      var hasScrollTop = 'scrollTop' in this[0]\n      if (value === undefined) return hasScrollTop ? this[0].scrollTop : this[0].pageYOffset\n      return this.each(hasScrollTop ?\n        function(){ this.scrollTop = value } :\n        function(){ this.scrollTo(this.scrollX, value) })\n    },\n    scrollLeft: function(value){\n      if (!this.length) return\n      var hasScrollLeft = 'scrollLeft' in this[0]\n      if (value === undefined) return hasScrollLeft ? this[0].scrollLeft : this[0].pageXOffset\n      return this.each(hasScrollLeft ?\n        function(){ this.scrollLeft = value } :\n        function(){ this.scrollTo(value, this.scrollY) })\n    },\n    position: function() {\n      if (!this.length) return\n\n      var elem = this[0],\n        // Get *real* offsetParent\n        offsetParent = this.offsetParent(),\n        // Get correct offsets\n        offset       = this.offset(),\n        parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset()\n\n      // Subtract element margins\n      // note: when an element has margin: auto the offsetLeft and marginLeft\n      // are the same in Safari causing offset.left to incorrectly be 0\n      offset.top  -= parseFloat( $(elem).css('margin-top') ) || 0\n      offset.left -= parseFloat( $(elem).css('margin-left') ) || 0\n\n      // Add offsetParent borders\n      parentOffset.top  += parseFloat( $(offsetParent[0]).css('border-top-width') ) || 0\n      parentOffset.left += parseFloat( $(offsetParent[0]).css('border-left-width') ) || 0\n\n      // Subtract the two offsets\n      return {\n        top:  offset.top  - parentOffset.top,\n        left: offset.left - parentOffset.left\n      }\n    },\n    offsetParent: function() {\n      return this.map(function(){\n        var parent = this.offsetParent || document.body\n        while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css(\"position\") == \"static\")\n          parent = parent.offsetParent\n        return parent\n      })\n    }\n  }\n\n  // for now\n  $.fn.detach = $.fn.remove\n\n  // Generate the `width` and `height` functions\n  ;['width', 'height'].forEach(function(dimension){\n    var dimensionProperty =\n      dimension.replace(/./, function(m){ return m[0].toUpperCase() })\n\n    $.fn[dimension] = function(value){\n      var offset, el = this[0]\n      if (value === undefined) return isWindow(el) ? el['inner' + dimensionProperty] :\n        isDocument(el) ? el.documentElement['scroll' + dimensionProperty] :\n        (offset = this.offset()) && offset[dimension]\n      else return this.each(function(idx){\n        el = $(this)\n        el.css(dimension, funcArg(this, value, idx, el[dimension]()))\n      })\n    }\n  })\n\n  function traverseNode(node, fun) {\n    fun(node)\n    for (var i = 0, len = node.childNodes.length; i < len; i++)\n      traverseNode(node.childNodes[i], fun)\n  }\n\n  // Generate the `after`, `prepend`, `before`, `append`,\n  // `insertAfter`, `insertBefore`, `appendTo`, and `prependTo` methods.\n  adjacencyOperators.forEach(function(operator, operatorIndex) {\n    var inside = operatorIndex % 2 //=> prepend, append\n\n    $.fn[operator] = function(){\n      // arguments can be nodes, arrays of nodes, Zepto objects and HTML strings\n      var argType, nodes = $.map(arguments, function(arg) {\n            var arr = []\n            argType = type(arg)\n            if (argType == \"array\") {\n              arg.forEach(function(el) {\n                if (el.nodeType !== undefined) return arr.push(el)\n                else if ($.zepto.isZ(el)) return arr = arr.concat(el.get())\n                arr = arr.concat(zepto.fragment(el))\n              })\n              return arr\n            }\n            return argType == \"object\" || arg == null ?\n              arg : zepto.fragment(arg)\n          }),\n          parent, copyByClone = this.length > 1\n      if (nodes.length < 1) return this\n\n      return this.each(function(_, target){\n        parent = inside ? target : target.parentNode\n\n        // convert all methods to a \"before\" operation\n        target = operatorIndex == 0 ? target.nextSibling :\n                 operatorIndex == 1 ? target.firstChild :\n                 operatorIndex == 2 ? target :\n                 null\n\n        var parentInDocument = $.contains(document.documentElement, parent)\n\n        nodes.forEach(function(node){\n          if (copyByClone) node = node.cloneNode(true)\n          else if (!parent) return $(node).remove()\n\n          parent.insertBefore(node, target)\n          if (parentInDocument) traverseNode(node, function(el){\n            if (el.nodeName != null && el.nodeName.toUpperCase() === 'SCRIPT' &&\n               (!el.type || el.type === 'text/javascript') && !el.src){\n              var target = el.ownerDocument ? el.ownerDocument.defaultView : window\n              target['eval'].call(target, el.innerHTML)\n            }\n          })\n        })\n      })\n    }\n\n    // after    => insertAfter\n    // prepend  => prependTo\n    // before   => insertBefore\n    // append   => appendTo\n    $.fn[inside ? operator+'To' : 'insert'+(operatorIndex ? 'Before' : 'After')] = function(html){\n      $(html)[operator](this)\n      return this\n    }\n  })\n\n  zepto.Z.prototype = Z.prototype = $.fn\n\n  // Export internal API functions in the `$.zepto` namespace\n  zepto.uniq = uniq\n  zepto.deserializeValue = deserializeValue\n  $.zepto = zepto\n\n  return $\n})()\n\n;(function($){\n  var _zid = 1, undefined,\n      slice = Array.prototype.slice,\n      isFunction = $.isFunction,\n      isString = function(obj){ return typeof obj == 'string' },\n      handlers = {},\n      specialEvents={},\n      focusinSupported = 'onfocusin' in window,\n      focus = { focus: 'focusin', blur: 'focusout' },\n      hover = { mouseenter: 'mouseover', mouseleave: 'mouseout' }\n\n  specialEvents.click = specialEvents.mousedown = specialEvents.mouseup = specialEvents.mousemove = 'MouseEvents'\n\n  function zid(element) {\n    return element._zid || (element._zid = _zid++)\n  }\n  function findHandlers(element, event, fn, selector) {\n    event = parse(event)\n    if (event.ns) var matcher = matcherFor(event.ns)\n    return (handlers[zid(element)] || []).filter(function(handler) {\n      return handler\n        && (!event.e  || handler.e == event.e)\n        && (!event.ns || matcher.test(handler.ns))\n        && (!fn       || zid(handler.fn) === zid(fn))\n        && (!selector || handler.sel == selector)\n    })\n  }\n  function parse(event) {\n    var parts = ('' + event).split('.')\n    return {e: parts[0], ns: parts.slice(1).sort().join(' ')}\n  }\n  function matcherFor(ns) {\n    return new RegExp('(?:^| )' + ns.replace(' ', ' .* ?') + '(?: |$)')\n  }\n\n  function eventCapture(handler, captureSetting) {\n    return handler.del &&\n      (!focusinSupported && (handler.e in focus)) ||\n      !!captureSetting\n  }\n\n  function realEvent(type) {\n    return hover[type] || (focusinSupported && focus[type]) || type\n  }\n\n  function add(element, events, fn, data, selector, delegator, capture){\n    var id = zid(element), set = (handlers[id] || (handlers[id] = []))\n    events.split(/\\s/).forEach(function(event){\n      if (event == 'ready') return $(document).ready(fn)\n      var handler   = parse(event)\n      handler.fn    = fn\n      handler.sel   = selector\n      // emulate mouseenter, mouseleave\n      if (handler.e in hover) fn = function(e){\n        var related = e.relatedTarget\n        if (!related || (related !== this && !$.contains(this, related)))\n          return handler.fn.apply(this, arguments)\n      }\n      handler.del   = delegator\n      var callback  = delegator || fn\n      handler.proxy = function(e){\n        e = compatible(e)\n        if (e.isImmediatePropagationStopped()) return\n        try {\n          var dataPropDescriptor = Object.getOwnPropertyDescriptor(e, 'data')\n          if (!dataPropDescriptor || dataPropDescriptor.writable)\n            e.data = data\n        } catch (e) {} // when using strict mode dataPropDescriptor will be undefined when e is InputEvent (even though data property exists). So we surround with try/catch\n        var result = callback.apply(element, e._args == undefined ? [e] : [e].concat(e._args))\n        if (result === false) e.preventDefault(), e.stopPropagation()\n        return result\n      }\n      handler.i = set.length\n      set.push(handler)\n      if ('addEventListener' in element)\n        element.addEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture))\n    })\n  }\n  function remove(element, events, fn, selector, capture){\n    var id = zid(element)\n    ;(events || '').split(/\\s/).forEach(function(event){\n      findHandlers(element, event, fn, selector).forEach(function(handler){\n        delete handlers[id][handler.i]\n      if ('removeEventListener' in element)\n        element.removeEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture))\n      })\n    })\n  }\n\n  $.event = { add: add, remove: remove }\n\n  $.proxy = function(fn, context) {\n    var args = (2 in arguments) && slice.call(arguments, 2)\n    if (isFunction(fn)) {\n      var proxyFn = function(){ return fn.apply(context, args ? args.concat(slice.call(arguments)) : arguments) }\n      proxyFn._zid = zid(fn)\n      return proxyFn\n    } else if (isString(context)) {\n      if (args) {\n        args.unshift(fn[context], fn)\n        return $.proxy.apply(null, args)\n      } else {\n        return $.proxy(fn[context], fn)\n      }\n    } else {\n      throw new TypeError(\"expected function\")\n    }\n  }\n\n  $.fn.bind = function(event, data, callback){\n    return this.on(event, data, callback)\n  }\n  $.fn.unbind = function(event, callback){\n    return this.off(event, callback)\n  }\n  $.fn.one = function(event, selector, data, callback){\n    return this.on(event, selector, data, callback, 1)\n  }\n\n  var returnTrue = function(){return true},\n      returnFalse = function(){return false},\n      ignoreProperties = /^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,\n      eventMethods = {\n        preventDefault: 'isDefaultPrevented',\n        stopImmediatePropagation: 'isImmediatePropagationStopped',\n        stopPropagation: 'isPropagationStopped'\n      }\n\n  function compatible(event, source) {\n    if (source || !event.isDefaultPrevented) {\n      source || (source = event)\n\n      $.each(eventMethods, function(name, predicate) {\n        var sourceMethod = source[name]\n        event[name] = function(){\n          this[predicate] = returnTrue\n          return sourceMethod && sourceMethod.apply(source, arguments)\n        }\n        event[predicate] = returnFalse\n      })\n\n      try {\n        event.timeStamp || (event.timeStamp = Date.now())\n      } catch (ignored) { }\n\n      if (source.defaultPrevented !== undefined ? source.defaultPrevented :\n          'returnValue' in source ? source.returnValue === false :\n          source.getPreventDefault && source.getPreventDefault())\n        event.isDefaultPrevented = returnTrue\n    }\n    return event\n  }\n\n  function createProxy(event) {\n    var key, proxy = { originalEvent: event }\n    for (key in event)\n      if (!ignoreProperties.test(key) && event[key] !== undefined) proxy[key] = event[key]\n\n    return compatible(proxy, event)\n  }\n\n  $.fn.delegate = function(selector, event, callback){\n    return this.on(event, selector, callback)\n  }\n  $.fn.undelegate = function(selector, event, callback){\n    return this.off(event, selector, callback)\n  }\n\n  $.fn.live = function(event, callback){\n    $(document.body).delegate(this.selector, event, callback)\n    return this\n  }\n  $.fn.die = function(event, callback){\n    $(document.body).undelegate(this.selector, event, callback)\n    return this\n  }\n\n  $.fn.on = function(event, selector, data, callback, one){\n    var autoRemove, delegator, $this = this\n    if (event && !isString(event)) {\n      $.each(event, function(type, fn){\n        $this.on(type, selector, data, fn, one)\n      })\n      return $this\n    }\n\n    if (!isString(selector) && !isFunction(callback) && callback !== false)\n      callback = data, data = selector, selector = undefined\n    if (callback === undefined || data === false)\n      callback = data, data = undefined\n\n    if (callback === false) callback = returnFalse\n\n    return $this.each(function(_, element){\n      if (one) autoRemove = function(e){\n        remove(element, e.type, callback)\n        return callback.apply(this, arguments)\n      }\n\n      if (selector) delegator = function(e){\n        var evt, match = $(e.target).closest(selector, element).get(0)\n        if (match && match !== element) {\n          evt = $.extend(createProxy(e), {currentTarget: match, liveFired: element})\n          return (autoRemove || callback).apply(match, [evt].concat(slice.call(arguments, 1)))\n        }\n      }\n\n      add(element, event, callback, data, selector, delegator || autoRemove)\n    })\n  }\n  $.fn.off = function(event, selector, callback){\n    var $this = this\n    if (event && !isString(event)) {\n      $.each(event, function(type, fn){\n        $this.off(type, selector, fn)\n      })\n      return $this\n    }\n\n    if (!isString(selector) && !isFunction(callback) && callback !== false)\n      callback = selector, selector = undefined\n\n    if (callback === false) callback = returnFalse\n\n    return $this.each(function(){\n      remove(this, event, callback, selector)\n    })\n  }\n\n  $.fn.trigger = function(event, args){\n    event = (isString(event) || $.isPlainObject(event)) ? $.Event(event) : compatible(event)\n    event._args = args\n    return this.each(function(){\n      // handle focus(), blur() by calling them directly\n      if (event.type in focus && typeof this[event.type] == \"function\") this[event.type]()\n      // items in the collection might not be DOM elements\n      else if ('dispatchEvent' in this) this.dispatchEvent(event)\n      else $(this).triggerHandler(event, args)\n    })\n  }\n\n  // triggers event handlers on current element just as if an event occurred,\n  // doesn't trigger an actual event, doesn't bubble\n  $.fn.triggerHandler = function(event, args){\n    var e, result\n    this.each(function(i, element){\n      e = createProxy(isString(event) ? $.Event(event) : event)\n      e._args = args\n      e.target = element\n      $.each(findHandlers(element, event.type || event), function(i, handler){\n        result = handler.proxy(e)\n        if (e.isImmediatePropagationStopped()) return false\n      })\n    })\n    return result\n  }\n\n  // shortcut methods for `.bind(event, fn)` for each event type\n  ;('focusin focusout focus blur load resize scroll unload click dblclick '+\n  'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave '+\n  'change select keydown keypress keyup error').split(' ').forEach(function(event) {\n    $.fn[event] = function(callback) {\n      return (0 in arguments) ?\n        this.bind(event, callback) :\n        this.trigger(event)\n    }\n  })\n\n  $.Event = function(type, props) {\n    if (!isString(type)) props = type, type = props.type\n    var event = document.createEvent(specialEvents[type] || 'Events'), bubbles = true\n    if (props) for (var name in props) (name == 'bubbles') ? (bubbles = !!props[name]) : (event[name] = props[name])\n    event.initEvent(type, bubbles, true)\n    return compatible(event)\n  }\n\n})(Zepto)\n\n;(function($){\n  var cache = [], timeout\n\n  $.fn.remove = function(){\n    return this.each(function(){\n      if(this.parentNode){\n        if(this.tagName === 'IMG'){\n          cache.push(this)\n          this.src = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='\n          if (timeout) clearTimeout(timeout)\n          timeout = setTimeout(function(){ cache = [] }, 60000)\n        }\n        this.parentNode.removeChild(this)\n      }\n    })\n  }\n})(Zepto)\n\n;(function($){\n  var data = {}, dataAttr = $.fn.data, camelize = $.camelCase,\n    exp = $.expando = 'Zepto' + (+new Date()), emptyArray = []\n\n  // Get value from node:\n  // 1. first try key as given,\n  // 2. then try camelized key,\n  // 3. fall back to reading \"data-*\" attribute.\n  function getData(node, name) {\n    var id = node[exp], store = id && data[id]\n    if (name === undefined) return store || setData(node)\n    else {\n      if (store) {\n        if (name in store) return store[name]\n        var camelName = camelize(name)\n        if (camelName in store) return store[camelName]\n      }\n      return dataAttr.call($(node), name)\n    }\n  }\n\n  // Store value under camelized key on node\n  function setData(node, name, value) {\n    var id = node[exp] || (node[exp] = ++$.uuid),\n      store = data[id] || (data[id] = attributeData(node))\n    if (name !== undefined) store[camelize(name)] = value\n    return store\n  }\n\n  // Read all \"data-*\" attributes from a node\n  function attributeData(node) {\n    var store = {}\n    $.each(node.attributes || emptyArray, function(i, attr){\n      if (attr.name.indexOf('data-') == 0)\n        store[camelize(attr.name.replace('data-', ''))] =\n          $.zepto.deserializeValue(attr.value)\n    })\n    return store\n  }\n\n  $.fn.data = function(name, value) {\n    return value === undefined ?\n      // set multiple values via object\n      $.isPlainObject(name) ?\n        this.each(function(i, node){\n          $.each(name, function(key, value){ setData(node, key, value) })\n        }) :\n        // get value from first element\n        (0 in this ? getData(this[0], name) : undefined) :\n      // set value on all elements\n      this.each(function(){ setData(this, name, value) })\n  }\n\n  $.data = function(elem, name, value) {\n    return $(elem).data(name, value)\n  }\n\n  $.hasData = function(elem) {\n    var id = elem[exp], store = id && data[id]\n    return store ? !$.isEmptyObject(store) : false\n  }\n\n  $.fn.removeData = function(names) {\n    if (typeof names == 'string') names = names.split(/\\s+/)\n    return this.each(function(){\n      var id = this[exp], store = id && data[id]\n      if (store) $.each(names || store, function(key){\n        delete store[names ? camelize(this) : key]\n      })\n    })\n  }\n\n  // Generate extended `remove` and `empty` functions\n  ;['remove', 'empty'].forEach(function(methodName){\n    var origFn = $.fn[methodName]\n    $.fn[methodName] = function() {\n      var elements = this.find('*')\n      if (methodName === 'remove') elements = elements.add(this)\n      elements.removeData()\n      return origFn.call(this)\n    }\n  })\n})(Zepto)\n  return Zepto\n}))\n"
  },
  {
    "path": "js/instantsearch.js/CHANGELOG.md",
    "content": "## [4.49.1](https://github.com/algolia/instantsearch.js/compare/v4.49.0...v4.49.1) (2022-11-01)\n\n\n### Bug Fixes\n\n* **insights:** check before usage of `document` ([#5149](https://github.com/algolia/instantsearch.js/issues/5149)) ([6733dea](https://github.com/algolia/instantsearch.js/commit/6733dea1091a3a6c8ec9049eba652a7f06e9c501))\n\n\n\n# [4.49.0](https://github.com/algolia/instantsearch.js/compare/v4.48.1...v4.49.0) (2022-10-25)\n\n\n### Features\n\n* **poweredBy:** update component logo ([#5145](https://github.com/algolia/instantsearch.js/issues/5145)) ([7df7816](https://github.com/algolia/instantsearch.js/commit/7df7816eac1bb3d2eafee5da7b6f4f59611468b2))\n\n\n\n## [4.48.1](https://github.com/algolia/instantsearch.js/compare/v4.48.0...v4.48.1) (2022-10-18)\n\n\n### Bug Fixes\n\n* **bundlesize:** consolidate usage of \"classnames\" helper ([#5138](https://github.com/algolia/instantsearch.js/issues/5138)) ([f1ec288](https://github.com/algolia/instantsearch.js/commit/f1ec28889be5c2f906dd398f37d072587e29cf3a))\n* **currentRefinements:** reset page number on refine ([#5136](https://github.com/algolia/instantsearch.js/issues/5136)) ([407b576](https://github.com/algolia/instantsearch.js/commit/407b5767b51c26d5f471071a92f2e32762898f24))\n* **events:** prevent warning on low number of listeners ([#5143](https://github.com/algolia/instantsearch.js/issues/5143)) ([432aa70](https://github.com/algolia/instantsearch.js/commit/432aa7006e7d8eefd1c8c382f59ea2d2974a19da))\n\n\n\n# [4.48.0](https://github.com/algolia/instantsearch.js/compare/v4.47.0...v4.48.0) (2022-10-10)\n\n\n### Bug Fixes\n\n* **insightsMiddleware:** infer type of insightsClient for onEvent ([#5130](https://github.com/algolia/instantsearch.js/issues/5130)) ([dd5fca4](https://github.com/algolia/instantsearch.js/commit/dd5fca4c185c66f1e31ebe9c0568bcad48e062f3)), closes [#5129](https://github.com/algolia/instantsearch.js/issues/5129)\n\n\n### Features\n\n* **routing:** include repeated indexId in URL correctly ([#5134](https://github.com/algolia/instantsearch.js/issues/5134)) ([679f5da](https://github.com/algolia/instantsearch.js/commit/679f5dad839536def6ae9c3a18416296d40ed49a))\n\n\n\n# [4.47.0](https://github.com/algolia/instantsearch.js/compare/v4.46.3...v4.47.0) (2022-10-03)\n\n\n### Bug Fixes\n\n* **hierarchicalMenu:** pass correct attribute name to Insights ([#5124](https://github.com/algolia/instantsearch.js/issues/5124)) ([fe18a16](https://github.com/algolia/instantsearch.js/commit/fe18a168b1b195d067298770b55fd29a7fdb6edb))\n\n\n### Features\n\n* **status:** introduce status in InstantSearch class ([#5115](https://github.com/algolia/instantsearch.js/issues/5115)) ([21f3147](https://github.com/algolia/instantsearch.js/commit/21f31476e75e162b38b002d5439f231f3990e785))\n* **hierarchicalMenu**: introduce `ais-HierarchicalMenu-item--selected` class ([#5125](https://github.com/algolia/instantsearch.js/issues/5125)) ([4ebb828](https://github.com/algolia/instantsearch.js/commit/4ebb828c93afabfd8083246dfe7edfd33932d5fd))\n\n\n## [4.46.3](https://github.com/algolia/instantsearch.js/compare/v4.46.2...v4.46.3) (2022-09-27)\n\n\n### Bug Fixes\n\n* **currentRefinements:** implement noRefinementRoot modifier class ([#5114](https://github.com/algolia/instantsearch.js/issues/5114)) ([cb66830](https://github.com/algolia/instantsearch.js/commit/cb668305af26bf919841c25bd4cc8493fcdf8cf9))\n\n\n\n## [4.46.2](https://github.com/algolia/instantsearch.js/compare/v4.46.1...v4.46.2) (2022-09-22)\n\n\n### Bug Fixes\n\n* **build:** remove jsx pragma comments from build output ([#5112](https://github.com/algolia/instantsearch.js/issues/5112)) ([6582083](https://github.com/algolia/instantsearch.js/commit/65820831b7d7e14867f13a2947795491730b8442))\n* **imports:** split out templating from ./utils ([#5111](https://github.com/algolia/instantsearch.js/issues/5111)) ([fc765f3](https://github.com/algolia/instantsearch.js/commit/fc765f35ddd85068237edc81c66932b098e3b55a)), closes [#5109](https://github.com/algolia/instantsearch.js/issues/5109)\n\n\n\n## [4.46.1](https://github.com/algolia/instantsearch.js/compare/v4.46.0...v4.46.1) (2022-09-15)\n\n\n### Bug Fixes\n\n* **hierarchicalMenu:** use existing facet filters in multi queries for parent facet values ([#5105](https://github.com/algolia/instantsearch.js/issues/5105)) ([10a83f1](https://github.com/algolia/instantsearch.js/commit/10a83f146f714d9f97bb8edca2499f16df4ca22d))\n* **insights:** make sure change in userToken can't reset the search parameters ([#5101](https://github.com/algolia/instantsearch.js/issues/5101)) ([b20c8dc](https://github.com/algolia/instantsearch.js/commit/b20c8dc70e34c1f234dc10eb7fc69296f30986a4))\n* **setUiState**: call onStateChange handler ([#5104](https://github.com/algolia/instantsearch.js/issues/5104)) ([231853d](https://github.com/algolia/instantsearch.js/commit/231853dab731189a33ee480cdb196789c7336fda)))\n\n\n\n## [4.46.0](https://github.com/algolia/instantsearch.js/compare/v4.45.1...v4.46.0) (2022-09-12)\n\n\n### Features\n\n* **html:** deprecate Hogan.js and string-based templates ([#5095](https://github.com/algolia/instantsearch.js/issues/5095)) ([a06ddf5](https://github.com/algolia/instantsearch.js/commit/a06ddf55f1ffd1a93cddab2fcf95d2be3220a423))\n* **html:** introduce `html` templating ([#5081](https://github.com/algolia/instantsearch.js/issues/5081)) ([e55e224](https://github.com/algolia/instantsearch.js/commit/e55e2245256193d27f2c85f24b8aab7c9048c554))\n\n\n\n## [4.45.1](https://github.com/algolia/instantsearch.js/compare/v4.45.0...v4.45.1) (2022-09-06)\n\n\n### Bug Fixes\n\n* **ratingMenu:** fix `undefined` facet values error when `disjunctiveFacets` is empty ([#5096](https://github.com/algolia/instantsearch.js/issues/5096)) ([dd870d5](https://github.com/algolia/instantsearch.js/commit/dd870d5a658ce42b068eadf34f9b69772291aa20))\n\n\n\n# [4.45.0](https://github.com/algolia/instantsearch.js/compare/v4.44.1...v4.45.0) (2022-08-29)\n\n\n### Features\n\n* **connectors:** deprecate `hasNoResults` in favor of `canRefine` ([#5091](https://github.com/algolia/instantsearch.js/issues/5091)) ([1749a4e](https://github.com/algolia/instantsearch.js/commit/1749a4eb9a2f28fa4a8d442163e3b10acbde7c22))\n\n\n\n## [4.44.1](https://github.com/algolia/instantsearch.js/compare/v4.44.0...v4.44.1) (2022-08-25)\n\n\n### Bug Fixes\n\n* **connectNumericMenu + connectRange:** stop sending invalid clickedFilters event ([#5085](https://github.com/algolia/instantsearch.js/issues/5085)) ([20996c7](https://github.com/algolia/instantsearch.js/commit/20996c7a159988c58e00ff24d2d2dc98af8b980f))\n\n\n\n# [4.44.0](https://github.com/algolia/instantsearch.js/compare/v4.43.1...v4.44.0) (2022-08-08)\n\n\n### Features\n\n* **geo-search:** make `GeoHit` type generic ([#5083](https://github.com/algolia/instantsearch.js/issues/5083)) ([3d3c7b2](https://github.com/algolia/instantsearch.js/commit/3d3c7b298b74effe9bb722a04fbb47dc39a4bd95))\n\n\n\n## [4.43.1](https://github.com/algolia/instantsearch.js/compare/v4.43.0...v4.43.1) (2022-07-11)\n\n\n### Bug Fixes\n\n* **errors:** rethrow error as error if it's an object ([#5075](https://github.com/algolia/instantsearch.js/issues/5075)) ([34132bb](https://github.com/algolia/instantsearch.js/commit/34132bba38c05fa2f5e4e54c6889e9335e62e4f4))\n* **ratingMenu:** don't warn if results are artificial ([#5073](https://github.com/algolia/instantsearch.js/issues/5073)) ([d747d23](https://github.com/algolia/instantsearch.js/commit/d747d23b28c380fe82a40eeab06c57359af8004a))\n* **types:** use correct case for _geoloc property ([#5074](https://github.com/algolia/instantsearch.js/issues/5074)) ([6fed7d8](https://github.com/algolia/instantsearch.js/commit/6fed7d870c3607980776d33a3697f8e2789aa08b))\n\n\n\n# [4.43.0](https://github.com/algolia/instantsearch.js/compare/v4.42.0...v4.43.0) (2022-06-28)\n\n\n### Features\n\n* **types:** support algoliasearch v5 ([#5066](https://github.com/algolia/instantsearch.js/issues/5066)) ([3eb4dc7](https://github.com/algolia/instantsearch.js/commit/3eb4dc75a5935f2ee4fead8787f39af0150b24c4))\n\n\n\n# [4.42.0](https://github.com/algolia/instantsearch.js/compare/v4.41.2...v4.42.0) (2022-06-21)\n\n\n### Bug Fixes\n\n* **es:** update import path for `infiniteHitsCache` in depreciation message ([#5068](https://github.com/algolia/instantsearch.js/issues/5068)) ([545cbaf](https://github.com/algolia/instantsearch.js/commit/545cbafd748bb8be32bff66ac60b5f3f9133a5b4))\n\n\n### Features\n\n* **core:** sort parameters & support client.search for sffv ([#5069](https://github.com/algolia/instantsearch.js/issues/5069)) ([34e2b00](https://github.com/algolia/instantsearch.js/commit/34e2b00cbc93f1bc86ee0abaec6b6e132bd18354))\n\n\n\n## [4.41.2](https://github.com/algolia/instantsearch.js/compare/v4.41.1...v4.41.2) (2022-06-15)\n\n\n### Bug Fixes\n\n* **hierarchicalMenu:** show full hierarchical parent values ([#5063](https://github.com/algolia/instantsearch.js/issues/5063)) ([cd1db34](https://github.com/algolia/instantsearch.js/commit/cd1db34815f92acb3d2d0cec6c1ae7865d14fb13))\n\n\n\n## [4.41.1](https://github.com/algolia/instantsearch.js/compare/v4.41.0...v4.41.1) (2022-06-14)\n\n\n### Bug Fixes\n\n* **insights:** don't send view event if search is stalled ([#5058](https://github.com/algolia/instantsearch.js/issues/5058)) ([1686dfb](https://github.com/algolia/instantsearch.js/commit/1686dfb096cfce062e268feda7956e3b160bf2da)), closes [/github.com/algolia/instantsearch.js/blob/99f6fe1dc51e4815e5b9efcfb30e3e2f3127e763/src/lib/utils/createSendEventForHits.ts#L168](https://github.com//github.com/algolia/instantsearch.js/blob/99f6fe1dc51e4815e5b9efcfb30e3e2f3127e763/src/lib/utils/createSendEventForHits.ts/issues/L168) [/github.com/algolia/instantsearch.js/blob/55313e4ea4105b777f3f102e9f48a7e440496d25/src/middlewares/createInsightsMiddleware.ts#L144](https://github.com//github.com/algolia/instantsearch.js/blob/55313e4ea4105b777f3f102e9f48a7e440496d25/src/middlewares/createInsightsMiddleware.ts/issues/L144)\n* **types:** avoid inferring UiState type from initialUiState ([#5061](https://github.com/algolia/instantsearch.js/issues/5061)) ([80ca07e](https://github.com/algolia/instantsearch.js/commit/80ca07e29064357343ee997be94ef10beadba637)), closes [/github.com/Microsoft/TypeScript/issues/14829#issuecomment-504042546](https://github.com//github.com/Microsoft/TypeScript/issues/14829/issues/issuecomment-504042546) [#5060](https://github.com/algolia/instantsearch.js/issues/5060)\n* **types:** make all usages of UiState in InstantSearch generic ([#5060](https://github.com/algolia/instantsearch.js/issues/5060)) ([2b9e76b](https://github.com/algolia/instantsearch.js/commit/2b9e76b568fb4d4cc5bd49c384ee583d84d6f39a))\n\n\n\n# [4.41.0](https://github.com/algolia/instantsearch.js/compare/v4.40.6...v4.41.0) (2022-06-01)\n\n\n### Features\n\n* **core:** don't schedule search without widgets ([#5056](https://github.com/algolia/instantsearch.js/issues/5056)) ([ea3d6d9](https://github.com/algolia/instantsearch.js/commit/ea3d6d9c6ae1fe2f90bf5643d4bdcbb89507e9bc))\n\n\n\n## [4.40.6](https://github.com/algolia/instantsearch.js/compare/v4.40.5...v4.40.6) (2022-05-24)\n\n\n### Bug Fixes\n\n* **types:** only allow `null` for parent in `getWidgetRenderState` if widget is an index ([#5052](https://github.com/algolia/instantsearch.js/issues/5052)) ([fe0fce0](https://github.com/algolia/instantsearch.js/commit/fe0fce0641ffff9af1d1303b7ee71d77ba08f8bd))\n\n\n\n## [4.40.5](https://github.com/algolia/instantsearch.js/compare/v4.40.4...v4.40.5) (2022-04-26)\n\n\n### Bug Fixes\n\n* **routing:** prevent writing the same URL twice ([#5045](https://github.com/algolia/instantsearch.js/issues/5045)) ([5d79d92](https://github.com/algolia/instantsearch.js/commit/5d79d92b30e188e5206dcb5fe86fcac058c3f09b))\n\n\n\n## [4.40.4](https://github.com/algolia/instantsearch.js/compare/v4.40.3...v4.40.4) (2022-04-13)\n\n\n### Bug Fixes\n\n* **currentRefinements:** correctly show and allow for refining escaped values ([#5041](https://github.com/algolia/instantsearch.js/issues/5041)) ([277f4df](https://github.com/algolia/instantsearch.js/commit/277f4dff21fb7eeaeb41a8c49aaaf707f880ee58))\n\n\n\n## [4.40.3](https://github.com/algolia/instantsearch.js/compare/v4.40.2...v4.40.3) (2022-04-04)\n\n\n### Bug Fixes\n\n* **refinements:** escape facet values starting with \"-\" ([#5039](https://github.com/algolia/instantsearch.js/issues/5039)) ([6b6f4e8](https://github.com/algolia/instantsearch.js/commit/6b6f4e86550a3c9dd02f3a8400d832cef64cb45d))\n\n\n\n## [4.40.2](https://github.com/algolia/instantsearch.js/compare/v4.40.1...v4.40.2) (2022-03-29)\n\n\n### Bug Fixes\n\n* **currentRefinements:** more detailed type for item.type ([#5034](https://github.com/algolia/instantsearch.js/issues/5034)) ([773e2c6](https://github.com/algolia/instantsearch.js/commit/773e2c65840f86881eb3dd8825c8c4ad9c73aec9))\n\n\n\n## [4.40.1](https://github.com/algolia/instantsearch.js/compare/v4.40.0...v4.40.1) (2022-03-21)\n\n\n### Bug Fixes\n\n* **types:** update to latest algoliasearch-helper ([6bbe790](https://github.com/algolia/instantsearch.js/commit/6bbe790a99320b4237b81614472c048ffe4426d8))\n\n\n\n# [4.40.0](https://github.com/algolia/instantsearch.js/compare/v4.39.2...v4.40.0) (2022-03-21)\n\n\n### Features\n\n* **infiniteHits:** avoid caching artificial results ([#5023](https://github.com/algolia/instantsearch.js/issues/5023)) ([e8c0145](https://github.com/algolia/instantsearch.js/commit/e8c01452ebe77b82b8a107c5d4fc026abf5645d8))\n\n\n\n## [4.39.2](https://github.com/algolia/instantsearch.js/compare/v4.39.1...v4.39.2) (2022-03-14)\n\n\n### Bug Fixes\n\n* fix types of `sortBy` option ([#5024](https://github.com/algolia/instantsearch.js/issues/5024)) ([3f7ea32](https://github.com/algolia/instantsearch.js/commit/3f7ea32374e0e409ebf27b07d28cf3871a5b33b3))\n\n\n\n## [4.39.1](https://github.com/algolia/instantsearch.js/compare/v4.39.0...v4.39.1) (2022-03-01)\n\n\n### Bug Fixes\n\n* **insights:** send view events after rendering ([#5014](https://github.com/algolia/instantsearch.js/issues/5014)) ([e952abc](https://github.com/algolia/instantsearch.js/commit/e952abc64043a55e06c9c46a656bc98ad45d1502))\n\n\n\n# [4.39.0](https://github.com/algolia/instantsearch.js/compare/v4.38.1...v4.39.0) (2022-02-23)\n\n\n### Features\n\n* **ts:** allow Hits related connectors to be generic ([#5019](https://github.com/algolia/instantsearch.js/issues/5019)) ([e986f7e](https://github.com/algolia/instantsearch.js/commit/e986f7e46d57173da4d3d6c3c23fbdf3f9c0f78c))\n\n\n\n## [4.38.1](https://github.com/algolia/instantsearch.js/compare/v4.38.0...v4.38.1) (2022-02-08)\n\n\n### Bug Fixes\n\n* **routing:** fix history router based on history length ([#5004](https://github.com/algolia/instantsearch.js/issues/5004)) ([40541af](https://github.com/algolia/instantsearch.js/commit/40541af5c8face0e32a1ec3a4665a8387d89c626))\n* **metadata:** ensure safe user agent detection ([#5009](https://github.com/algolia/instantsearch.js/pull/5009) [15a6a9d](https://github.com/algolia/instantsearch.js/commit/15a6a9d10ee512fab6884696bc59bedea13bd1b3))\n\n\n# [4.38.0](https://github.com/algolia/instantsearch.js/compare/v4.37.3...v4.38.0) (2022-01-28)\n\n\n### Bug Fixes\n\n* **typescript:** remove non-existing UMD type definition ([#5001](https://github.com/algolia/instantsearch.js/issues/5001)) ([c234374](https://github.com/algolia/instantsearch.js/commit/c234374a1f5333f6625980c45fa0833a8c130257))\n\n\n### Features\n\n* **connectors:** expose search results to `transformItems` when available ([#5000](https://github.com/algolia/instantsearch.js/issues/5000)) ([58c2651](https://github.com/algolia/instantsearch.js/commit/58c26517aad916ce49b474458e3411ff7ef5497a))\n\n\n\n## [4.37.3](https://github.com/algolia/instantsearch.js/compare/v4.37.2...v4.37.3) (2022-01-25)\n\n\n### Bug Fixes\n\n* **helpers:** display warning if attribute cannot be highlighted/snippeted ([#4996](https://github.com/algolia/instantsearch.js/issues/4996)) ([e81bf59](https://github.com/algolia/instantsearch.js/commit/e81bf59f0f28eb7b9f54f7d4424c60546b9a4d8c))\n\n\n\n## [4.37.2](https://github.com/algolia/instantsearch.js/compare/v4.37.1...v4.37.2) (2022-01-10)\n\n\n### Bug Fixes\n\n* **searchbox:** make sure setting query to the initial doesn't cause a stale state ([#4990](https://github.com/algolia/instantsearch.js/issues/4990)) ([3faca01](https://github.com/algolia/instantsearch.js/commit/3faca014aad08145c3b4cc66a5e841da3a0f64b8))\n\n\n\n## [4.37.1](https://github.com/algolia/instantsearch.js/compare/v4.37.0...v4.37.1) (2022-01-05)\n\n\n### Bug Fixes\n\n* **connectBreadcrumb:** returns an empty array if no hierarchicalFacets exist ([#4980](https://github.com/algolia/instantsearch.js/issues/4980)) ([3ea9b91](https://github.com/algolia/instantsearch.js/commit/3ea9b918f85c686a07b06cfc12b8c59b80181f28))\n* **es:** mark inner package.json as side-effect free ([#4984](https://github.com/algolia/instantsearch.js/issues/4984)) ([74f56f3](https://github.com/algolia/instantsearch.js/commit/74f56f35b7ccc78904592edfc40e782e40847986)), closes [#4971](https://github.com/algolia/instantsearch.js/issues/4971)\n* **events:** emit error as typeof Error ([#4983](https://github.com/algolia/instantsearch.js/issues/4983)) ([4adfaf2](https://github.com/algolia/instantsearch.js/commit/4adfaf2eba40fffa7f4800664dc89e0edf2d819e))\n\n\n\n# [4.37.0](https://github.com/algolia/instantsearch.js/compare/v4.36.0...v4.37.0) (2022-01-04)\n\n\n### Features\n\n* **build:** expose `/es` as a real ES module ([#4971](https://github.com/algolia/instantsearch.js/issues/4971)) ([e5b3434](https://github.com/algolia/instantsearch.js/commit/e5b343490921f70736e11a7758bdc7a3aeed6d69))\n\n\n\n# [4.36.0](https://github.com/algolia/instantsearch.js/compare/v4.35.0...v4.36.0) (2021-12-16)\n\n\n### Features\n\n* **dynamicWidgets:** send facets * and maxValuesPerFacet by default ([#4968](https://github.com/algolia/instantsearch.js/issues/4968)) ([969ae89](https://github.com/algolia/instantsearch.js/commit/969ae8980f7c8a055bb4c6c5967d04744644f555))\n* **DynamicWidgets:** throw when transformItems returns anything that isn't an array ([#4975](https://github.com/algolia/instantsearch.js/issues/4975)) ([5c328c8](https://github.com/algolia/instantsearch.js/commit/5c328c85428eb9a5c1450fd01154751f4e0ea2fa))\n\n\n\n# [4.35.0](https://github.com/algolia/instantsearch.js/compare/v4.34.0...v4.35.0) (2021-12-13)\n\n\n### Features\n\n* **events:** move to @algolia/events ([#4961](https://github.com/algolia/instantsearch.js/issues/4961)) ([1c56726](https://github.com/algolia/instantsearch.js/commit/1c5672640c65d7ed6f6e381a3162e508bdda44f3))\n\n### Bug Fixes\n\n* **deps:** Add missing peer dependency ([#4950](https://github.com/algolia/instantsearch.js/issues/4950)) ([468578da9](https://github.com/algolia/instantsearch.js/commit/468578da948a12224c892fd12cba4c880aa7b25f))\n\n\n\n# [4.34.0](https://github.com/algolia/instantsearch.js/compare/v4.33.2...v4.34.0) (2021-12-07)\n\n\n### Features\n\n* rely on `state` in `getWidgetRenderState` ([#4960](https://github.com/algolia/instantsearch.js/issues/4960)) ([5006841](https://github.com/algolia/instantsearch.js/commit/50068417e5e7211802bc717b582946f6e630d7ac))\n* support initial results (experimental) ([#4967](https://github.com/algolia/instantsearch.js/issues/4967)) ([db11c13](https://github.com/algolia/instantsearch.js/commit/db11c13ea55433491f5e924633bff12a303c1bc6))\n\n\n\n## [4.33.2](https://github.com/algolia/instantsearch.js/compare/v4.33.1...v4.33.2) (2021-11-16)\n\n\n### Bug Fixes\n\n* **connectNumericMenu:** allow option for same start/end values ([#4951](https://github.com/algolia/instantsearch.js/issues/4951)) ([18da714](https://github.com/algolia/instantsearch.js/commit/18da714574fa98957d29014add3123e9c377551f))\n\n\n\n## [4.33.1](https://github.com/algolia/instantsearch.js/compare/v4.33.0...v4.33.1) (2021-11-02)\n\n\n### Bug Fixes\n\n* **getUiState:** support `initialUiState` ([#4948](https://github.com/algolia/instantsearch.js/issues/4948)) ([532474d](https://github.com/algolia/instantsearch.js/commit/532474dfaf49446ab59a2a27424ca220947dd5bd))\n\n\n\n# [4.33.0](https://github.com/algolia/instantsearch.js/compare/v4.32.0...v4.33.0) (2021-10-26)\n\n\n### Bug Fixes\n\n* **router:** skip history push on browser back and forward actions ([#4933](https://github.com/algolia/instantsearch.js/issues/4933)) ([7909da4](https://github.com/algolia/instantsearch.js/commit/7909da4903eb1aee885811e280b909a3bda488be))\n* **setUiState:** reset UI state with empty object ([#4944](https://github.com/algolia/instantsearch.js/issues/4944)) ([5faae4a](https://github.com/algolia/instantsearch.js/commit/5faae4ac44ac5ad2f8086ad2a306bcfaa14bc754))\n\n\n### Features\n\n* **router:** support server environments ([#4940](https://github.com/algolia/instantsearch.js/issues/4940)) ([a002962](https://github.com/algolia/instantsearch.js/commit/a002962df0e7683b29bef8bfaaddb494fa551a14))\n\n\n\n# [4.32.0](https://github.com/algolia/instantsearch.js/compare/v4.31.1...v4.32.0) (2021-10-20)\n\n\n### Features\n\n* **dependencies:** update algoliasearch-helper ([#4936](https://github.com/algolia/instantsearch.js/issues/4936)) ([014a413](https://github.com/algolia/instantsearch.js/commit/014a413f14dded3861a9c288ea618f1602bcd66d))\n\n\n\n## [4.31.1](https://github.com/algolia/instantsearch.js/compare/v4.31.0...v4.31.1) (2021-10-19)\n\n\n### Bug Fixes\n\n* **types:** export correct types from search-insights ([#4930](https://github.com/algolia/instantsearch.js/issues/4930)) ([5ae7a5b](https://github.com/algolia/instantsearch.js/commit/5ae7a5b86ad9c042bfbdc60e505c159eebdb404f))\n\n\n\n# [4.31.0](https://github.com/algolia/instantsearch.js/compare/v4.30.3...v4.31.0) (2021-10-14)\n\n\n### Features\n\n* **InstantSearch:** defer initial search ([#4925](https://github.com/algolia/instantsearch.js/issues/4925)) ([9a88115](https://github.com/algolia/instantsearch.js/commit/9a8811534af1288e316cdfb6f6fc49df1597290e))\n\n\n\n## [4.30.3](https://github.com/algolia/instantsearch.js/compare/v4.30.2...v4.30.3) (2021-10-12)\n\n\n### Bug Fixes\n\n* **toggleRefinement:** don't set off value in getWidgetRenderState ([#4912](https://github.com/algolia/instantsearch.js/issues/4912)) ([69525bf](https://github.com/algolia/instantsearch.js/commit/69525bf2a3087aeb75c4f1e5ab8452012436f61f))\n\n\n\n## [4.30.2](https://github.com/algolia/instantsearch.js/compare/v4.30.1...v4.30.2) (2021-09-21)\n\n\n### Bug Fixes\n\n* **es:** add warning to typescript declaration of keys to be imported from helpers ([#4908](https://github.com/algolia/instantsearch.js/issues/4908)) ([8cbd5fb](https://github.com/algolia/instantsearch.js/commit/8cbd5fb3f02427f2c7de6e818f1ff4c81485b3e1))\n* **infinite/hits:** stop saving the transformed results in cache ([#4907](https://github.com/algolia/instantsearch.js/issues/4907)) ([82dc0ae](https://github.com/algolia/instantsearch.js/commit/82dc0ae966fda37582d5324ea6ca3e0f33ef56d5)), closes [#4819](https://github.com/algolia/instantsearch.js/issues/4819)\n\n\n\n## [4.30.1](https://github.com/algolia/instantsearch.js/compare/v4.30.0...v4.30.1) (2021-09-14)\n\n\n### Bug Fixes\n\n* **insightsMiddleware:** throw an error when credentials can't be extracted ([#4901](https://github.com/algolia/instantsearch.js/issues/4901)) ([55313e4](https://github.com/algolia/instantsearch.js/commit/55313e4ea4105b777f3f102e9f48a7e440496d25))\n\n\n\n# [4.30.0](https://github.com/algolia/instantsearch.js/compare/v4.29.1...v4.30.0) (2021-09-07)\n\n\n### Bug Fixes\n\n* **insights:** handle multiple setUserToken call before search.start() ([#4897](https://github.com/algolia/instantsearch.js/issues/4897)) ([51a6f2b](https://github.com/algolia/instantsearch.js/commit/51a6f2bcd2ea312e7038e6f3208a2e9b3fed494a))\n\n\n### Features\n\n* **dynamicWidgets:** add fallbackWidget ([#4847](https://github.com/algolia/instantsearch.js/issues/4847)) ([7d99ab9](https://github.com/algolia/instantsearch.js/commit/7d99ab95972d5886cdc82abb5794a41d38381a50))\n* **dynamicWidgets:** mark as stable ([#4899](https://github.com/algolia/instantsearch.js/issues/4899)) ([f97468f](https://github.com/algolia/instantsearch.js/commit/f97468f134d92c198433a7dad16a3b19b3779a94))\n\n\n\n## [4.29.1](https://github.com/algolia/instantsearch.js/compare/v4.29.0...v4.29.1) (2021-09-02)\n\n\n### Bug Fixes\n\n* **middleware:** subscribe middleware before initializing main index ([#4849](https://github.com/algolia/instantsearch.js/issues/4849)) ([0fc8f73](https://github.com/algolia/instantsearch.js/commit/0fc8f7322f8521f934ed871e8125707ba2ec0bfd))\n\n\n\n# [4.29.0](https://github.com/algolia/instantsearch.js/compare/v4.28.0...v4.29.0) (2021-08-31)\n\n\n### Features\n\n* **panel:** render templates on init with render state ([#4845](https://github.com/algolia/instantsearch.js/issues/4845)) ([0e151a9](https://github.com/algolia/instantsearch.js/commit/0e151a9552092807ecbc6993f3f6193fef621f44))\n\n\n\n# [4.28.0](https://github.com/algolia/instantsearch.js/compare/v4.27.2...v4.28.0) (2021-08-24)\n\n\n### Bug Fixes\n\n* **sendEvent:** split > 20 objects in multiple calls ([#4841](https://github.com/algolia/instantsearch.js/issues/4841)) ([44574bc](https://github.com/algolia/instantsearch.js/commit/44574bcf03ac05e22274099622e6a1839599ca7e))\n* **svg:** remove xmlns ([#4839](https://github.com/algolia/instantsearch.js/issues/4839)) ([932ae3a](https://github.com/algolia/instantsearch.js/commit/932ae3a868340a32ccaacb276c862921fee41a93))\n\n\n### Features\n\n* **ts:** expose built files in umd ([#4844](https://github.com/algolia/instantsearch.js/issues/4844)) ([8578ae3](https://github.com/algolia/instantsearch.js/commit/8578ae30a915db49acaa0292faba2ec6ccd52b73))\n\n\n\n## [4.27.2](https://github.com/algolia/instantsearch.js/compare/v4.27.1...v4.27.2) (2021-08-18)\n\n\n### Bug Fixes\n\n* **types:** export all types as \"type\" to avoid exporting in .js ([#4837](https://github.com/algolia/instantsearch.js/issues/4837)) ([dcbbd88](https://github.com/algolia/instantsearch.js/commit/dcbbd8804b4b6471d24820b42826b57388974c27))\n\n\n\n## [4.27.1](https://github.com/algolia/instantsearch.js/compare/v4.27.0...v4.27.1) (2021-08-17)\n\n\n### Bug Fixes\n\n* **ts:** export types from entry point ([#4834](https://github.com/algolia/instantsearch.js/issues/4834)) ([3014e84](https://github.com/algolia/instantsearch.js/commit/3014e8481e401db62fff41d6867580c04adeaf6b))\n\n\n\n# [4.27.0](https://github.com/algolia/instantsearch.js/compare/v4.26.0...v4.27.0) (2021-08-17)\n\n\n### Bug Fixes\n\n* **ts:** correct entry point ([#4829](https://github.com/algolia/instantsearch.js/issues/4829)) ([24a45f9](https://github.com/algolia/instantsearch.js/commit/24a45f9a9fb3c8f62003d2aa37b3456c11af2985))\n* **ts:** export PaginationConnector ([d201322](https://github.com/algolia/instantsearch.js/commit/d201322de0d09a664b762422fdc0a51e2bd566bc))\n\n\n### Features\n\n* **typescript:** expose types at regular build ([#4832](https://github.com/algolia/instantsearch.js/issues/4832)) ([4bea07b](https://github.com/algolia/instantsearch.js/commit/4bea07b99f492441eb94e483378e0778f90c5b43))\n\nIf you were using typescript via the `experimental-typescript` tag, you can now use regular InstantSearch.js.\n\n# [4.26.0](https://github.com/algolia/instantsearch.js/compare/v4.25.3...v4.26.0) (2021-08-10)\n\n\n### Features\n\n* **ts:** allow custom ui state and route state in routing ([#4816](https://github.com/algolia/instantsearch.js/issues/4816)) ([5f8ba5d](https://github.com/algolia/instantsearch.js/commit/5f8ba5ddcf5e32fd3cecf39ea667d8266dab35f8))\n* **types:** allow typed access to properties added to entry ([#4814](https://github.com/algolia/instantsearch.js/issues/4814)) ([9000f16](https://github.com/algolia/instantsearch.js/commit/9000f16c3e0ff53eda4ca21281a87d8ff9b9154d))\n\n\n\n## [4.25.3](https://github.com/algolia/instantsearch.js/compare/v4.25.2...v4.25.3) (2021-08-03)\n\n\n### Bug Fixes\n\n* **types:** fix hits and results types in connectHits and connectInfiniteHits ([#4820](https://github.com/algolia/instantsearch.js/issues/4820)) ([2bf987e](https://github.com/algolia/instantsearch.js/commit/2bf987e8b2728a8e65a88a49d46eadf6c0172660))\n\n\n\n## [4.25.2](https://github.com/algolia/instantsearch.js/compare/v4.25.1...v4.25.2) (2021-07-20)\n\n\n### Bug Fixes\n\n* **build:** ensure build fails when types building fails ([#4812](https://github.com/algolia/instantsearch.js/issues/4812)) ([b37e23b](https://github.com/algolia/instantsearch.js/commit/b37e23b5819abbc03049124bc3a29120f91aeb8c))\n* **types:** export widget's types ([#4813](https://github.com/algolia/instantsearch.js/issues/4813)) ([e9764e9](https://github.com/algolia/instantsearch.js/commit/e9764e9273e5b7bacd86f8d1cb751e87bd75eb75))\n\n\n\n## [4.25.1](https://github.com/algolia/instantsearch.js/compare/v4.25.0...v4.25.1) (2021-07-13)\n\n\n### Bug Fixes\n\n* **deps:** force a lower version of qs ([#4805](https://github.com/algolia/instantsearch.js/issues/4805)) ([07b7e08](https://github.com/algolia/instantsearch.js/commit/07b7e086282f8cc6a17aee822902d97204c1d2da))\n\n\n\n# [4.25.0](https://github.com/algolia/instantsearch.js/compare/v4.24.3...v4.25.0) (2021-07-06)\n\n\n### Features\n\n* **facets:** apply result from facet ordering ([#4784](https://github.com/algolia/instantsearch.js/issues/4784)) ([9e9d839](https://github.com/algolia/instantsearch.js/commit/9e9d8394067bec35425b7d66f94fcce504faee7f))\n\n\n\n## [4.24.3](https://github.com/algolia/instantsearch.js/compare/v4.24.2...v4.24.3) (2021-07-05)\n\n\n### Bug Fixes\n\n* **dynamicWidgets:** read from facetOrdering.facets ([42d6c6c](https://github.com/algolia/instantsearch.js/commit/42d6c6cefc5f009a3cfc63ab3d628ed2811f1700))\n* **ts:** make template types consistent ([#4785](https://github.com/algolia/instantsearch.js/issues/4785)) ([e0fbd55](https://github.com/algolia/instantsearch.js/commit/e0fbd55b6b98dd64301f113fd394dce57552d94c))\n\n\n\n## [4.24.2](https://github.com/algolia/instantsearch.js/compare/v4.24.1...v4.24.2) (2021-06-29)\n\n\n### Bug Fixes\n\n* **index:** export `IndexWidgetParams` type ([#4793](https://github.com/algolia/instantsearch.js/issues/4793)) ([91bdea1](https://github.com/algolia/instantsearch.js/commit/91bdea18f3768265937e2d3aca4acaa05c24e426))\n* **onStateChange:** propagate change to middleware ([#4796](https://github.com/algolia/instantsearch.js/issues/4796)) ([57c32c0](https://github.com/algolia/instantsearch.js/commit/57c32c0a43bd2c6cbdd3f8ea7eac8109e3024f2a))\n* **relevantSort:** export `RelevantSortWidgetParams` type ([#4794](https://github.com/algolia/instantsearch.js/issues/4794)) ([1a10b59](https://github.com/algolia/instantsearch.js/commit/1a10b59938c6121f58510726b67ee6dfa1aa1b7c))\n* **sortBy:** do not write the default state ([#4798](https://github.com/algolia/instantsearch.js/issues/4798)) ([1d8a40e](https://github.com/algolia/instantsearch.js/commit/1d8a40ecc8e6e48746113ec3ec0d975e14bec1ea))\n\n\n\n## [4.24.1](https://github.com/algolia/instantsearch.js/compare/v4.24.0...v4.24.1) (2021-06-23)\n\n\n### Bug Fixes\n\n* **mainHelper:** allow a mainHelper to be set before start ([#4790](https://github.com/algolia/instantsearch.js/issues/4790)) ([e8329ae](https://github.com/algolia/instantsearch.js/commit/e8329aecb386755a039cf10850e394d0d71f29f4))\n\n\n\n# [4.24.0](https://github.com/algolia/instantsearch.js/compare/v4.23.0...v4.24.0) (2021-06-15)\n\n\n### Bug Fixes\n\n* **clearRefinements:** do not throw when widgetParams is not given ([#4778](https://github.com/algolia/instantsearch.js/issues/4778)) ([6b1a375](https://github.com/algolia/instantsearch.js/commit/6b1a375ed7139c0b98993c0cb7ab40838e1f2288))\n* **ts:** make `CSSClasses` types consistent ([#4774](https://github.com/algolia/instantsearch.js/issues/4774)) ([99008a9](https://github.com/algolia/instantsearch.js/commit/99008a985ddc61ce197200df51fdcf385914064d))\n\n\n### Features\n\n* **dynamicWidgets:** add default attributesToRender & transformItems ([#4776](https://github.com/algolia/instantsearch.js/issues/4776)) ([44dab44](https://github.com/algolia/instantsearch.js/commit/44dab44282da58b36a707ad80aff4c18477abccd))\n* **ts:** convert pagination widget and component ([#4765](https://github.com/algolia/instantsearch.js/issues/4765)) ([34eb950](https://github.com/algolia/instantsearch.js/commit/34eb9500a2d7072814fd715e1c2217ed22de30d1))\n* **ts:** convert rangeInput widget and component ([#4766](https://github.com/algolia/instantsearch.js/issues/4766)) ([40b1a82](https://github.com/algolia/instantsearch.js/commit/40b1a82f9df4b16708fceefbba77a8fb49c7dc41))\n\n\n\n# [4.23.0](https://github.com/algolia/instantsearch.js/compare/v4.22.0...v4.23.0) (2021-05-25)\n\n\n### Bug Fixes\n\n* **range:** reset the page on refine ([#4760](https://github.com/algolia/instantsearch.js/issues/4760)) ([24e3b34](https://github.com/algolia/instantsearch.js/commit/24e3b34c944ec32b414e845550e9c6c02b39cb92)), closes [#4759](https://github.com/algolia/instantsearch.js/issues/4759)\n\n\n### Features\n\n* **ts:** convert poweredBy widget ([#4756](https://github.com/algolia/instantsearch.js/issues/4756)) ([142660a](https://github.com/algolia/instantsearch.js/commit/142660a2bc0ab7212265a9ff6dadf7a7f1081c69))\n\n\n\n# [4.22.0](https://github.com/algolia/instantsearch.js/compare/v4.21.0...v4.22.0) (2021-05-05)\n\n\n### Bug Fixes\n\n* **insights:** do not throw when userToken is not given ([#4724](https://github.com/algolia/instantsearch.js/issues/4724)) ([8241b29](https://github.com/algolia/instantsearch.js/commit/8241b2909c981a6bb52e9f4f9b6bacb7bc60263b))\n* **insights:** use getUserToken method instead of _get ([#4744](https://github.com/algolia/instantsearch.js/issues/4744)) ([05d05a9](https://github.com/algolia/instantsearch.js/commit/05d05a9a8ad79e4ec8b183a3d17c2360430c302e))\n* **relevantSort:** remove \"relevantSort\" nesting, since there's only one property ([#4735](https://github.com/algolia/instantsearch.js/issues/4735)) ([f742083](https://github.com/algolia/instantsearch.js/commit/f74208396159524086341be4acf84d2af2b44135))\n* **connectToggleRefinement:** nest getRenderState per attribute ([#4743](https://github.com/algolia/instantsearch.js/issues/4743)) ([b9c884d](https://github.com/algolia/instantsearch.js/commit/b9c884daa406e1be63482ed198674b2ba22e66f2))\n* **connectToggleRefinement:** remove search parameters from render state ([#4743](https://github.com/algolia/instantsearch.js/issues/4743)) ([b9c884d](https://github.com/algolia/instantsearch.js/commit/b9c884daa406e1be63482ed198674b2ba22e66f2))\n\n\n### Features\n\n* **core:** add getUiState function ([#4750](https://github.com/algolia/instantsearch.js/issues/4750)) ([adce212](https://github.com/algolia/instantsearch.js/commit/adce2127de6c652ee6364e889a525d9d0ff6efdd))\n* **dynamicWidgets:** implementation ([#4687](https://github.com/algolia/instantsearch.js/issues/4687)) ([2e7ccc9](https://github.com/algolia/instantsearch.js/commit/2e7ccc91c8d2e4aa50c82a186cce057907042ed4))\n* **ts:** migrate toggleRefinement & connectToggleRefinement ([#4743](https://github.com/algolia/instantsearch.js/issues/4743)) ([b9c884d](https://github.com/algolia/instantsearch.js/commit/b9c884daa406e1be63482ed198674b2ba22e66f2))\n* **widget:** add access to \"parent\" in dispose ([#4745](https://github.com/algolia/instantsearch.js/issues/4745)) ([3fca986](https://github.com/algolia/instantsearch.js/commit/3fca986542e8b18312a6c6be810bf5fb986804a4))\n\n\n\n# [4.21.0](https://github.com/algolia/instantsearch.js/compare/v4.20.0...v4.21.0) (2021-04-12)\n\n\n### Bug Fixes\n\n* **infiniteHits:** fix wrong behavior of showPrevious regarding cachedHits ([#4725](https://github.com/algolia/instantsearch.js/issues/4725)) ([40b27b6](https://github.com/algolia/instantsearch.js/commit/40b27b668ec1dcb8608b299c941e0003b43911d3))\n* **ratingMenu:** use url in default template ([#4728](https://github.com/algolia/instantsearch.js/issues/4728)) ([31d9c50](https://github.com/algolia/instantsearch.js/commit/31d9c50344818cd4f4e62993a981ec3616d8b88e))\n\n\n### Features\n\n* **middleware:** accept partial methods ([#4673](https://github.com/algolia/instantsearch.js/issues/4673)) ([8f2aad2](https://github.com/algolia/instantsearch.js/commit/8f2aad2f0465cc883681143f350a11c24ce694e2))\n* **ts:** convert hierarchical-menu to TypeScript ([#4711](https://github.com/algolia/instantsearch.js/issues/4711)) ([870e2f7](https://github.com/algolia/instantsearch.js/commit/870e2f7285d58c48196356cd88fb4aca66feb7aa))\n* **ts:** convert RefinementList component to TypeScript ([#4702](https://github.com/algolia/instantsearch.js/issues/4702)) ([fd562de](https://github.com/algolia/instantsearch.js/commit/fd562de5e50e3889abaa9ef8151faa1b5179d7f6))\n* **ts:** convert search-box to TypeScript ([#4710](https://github.com/algolia/instantsearch.js/issues/4710)) ([e73257a](https://github.com/algolia/instantsearch.js/commit/e73257a466082207c0289f22bad523334d101aae))\n\n\n\n# [4.20.0](https://github.com/algolia/instantsearch.js/compare/v4.19.0...v4.20.0) (2021-04-06)\n\n\n### Features\n\n* **clearRefinements:** implement canRefine ([#4684](https://github.com/algolia/instantsearch.js/issues/4684)) ([a898f09](https://github.com/algolia/instantsearch.js/commit/a898f09bddca5db1f6782104375df3873d49c688))\n* **currentRefinements:** implement canRefine ([#4697](https://github.com/algolia/instantsearch.js/issues/4697)) ([4db75ba](https://github.com/algolia/instantsearch.js/commit/4db75baa9ff2e18f871547511d8f1234eea9d41b))\n* **hierarchicalMenu:** implement canRefine ([#4685](https://github.com/algolia/instantsearch.js/issues/4685)) ([0d2e450](https://github.com/algolia/instantsearch.js/commit/0d2e450aed2aaac72ae7ff7f1bb322ce6992c8ba))\n* **middleware:** add unuse method ([#4708](https://github.com/algolia/instantsearch.js/issues/4708)) ([8e3c406](https://github.com/algolia/instantsearch.js/commit/8e3c406c8f29bcae56d2f82f07cbd087043346fe))\n* **pagination:** implement canRefine ([#4683](https://github.com/algolia/instantsearch.js/issues/4683)) ([3ae51e6](https://github.com/algolia/instantsearch.js/commit/3ae51e60543984463a13b25e64aa2f879c91313e))\n* **range:** implement canRefine ([#4686](https://github.com/algolia/instantsearch.js/issues/4686)) ([a99ab6f](https://github.com/algolia/instantsearch.js/commit/a99ab6f968b791ffa31cd17dda598c293e73b88e))\n* **ratingMenu:** implement canRefine ([#4691](https://github.com/algolia/instantsearch.js/issues/4691)) ([42191a0](https://github.com/algolia/instantsearch.js/commit/42191a097a048a325234dd3f40f7799145628cd6))\n* **toggleRefinement:** implement canRefine ([#4689](https://github.com/algolia/instantsearch.js/issues/4689)) ([48dc7f8](https://github.com/algolia/instantsearch.js/commit/48dc7f8423c92b21bcd59856bf2fc685ae4aba69))\n* **ts:** convert rating-menu to TypeScript ([#4701](https://github.com/algolia/instantsearch.js/issues/4701)) ([f14ca08](https://github.com/algolia/instantsearch.js/commit/f14ca0891237a7a49b09d881cddedb93efc3a266))\n* **ts:** convert Template component to TypeScript ([#4703](https://github.com/algolia/instantsearch.js/issues/4703)) ([0688571](https://github.com/algolia/instantsearch.js/commit/068857137b85d1065bc5997514461d72fe595130))\n\n\n\n# [4.19.0](https://github.com/algolia/instantsearch.js/compare/v4.18.0...v4.19.0) (2021-03-30)\n\n\n### Bug Fixes\n\n* **setUiState:** make sure previous ui state is stored ([#4699](https://github.com/algolia/instantsearch.js/issues/4699)) ([0f5d688](https://github.com/algolia/instantsearch.js/commit/0f5d6888c5e77c750d264ed19be3418d920266af))\n\n\n### Features\n\n* **relevantSort:** implement canRefine ([#4693](https://github.com/algolia/instantsearch.js/issues/4693)) ([24d9ded](https://github.com/algolia/instantsearch.js/commit/24d9ded0c0e3246b91fe16ab1d1d579c17d68731))\n* **currentRefinements:** implement canRefine ([#4690](https://github.com/algolia/instantsearch.js/issues/4690)) ([f02416c](https://github.com/algolia/instantsearch.js/commit/f02416cf226ec3f7c2238b3e0902ec6f78381515))\n* **ts:** convert sortBy, connectSortBy ([#4700](https://github.com/algolia/instantsearch.js/issues/4700)) ([86de1e0](https://github.com/algolia/instantsearch.js/commit/86de1e0a675c91b75e72463e6b11df62739d69b5))\n\n\n\n# [4.18.0](https://github.com/algolia/instantsearch.js/compare/v4.17.0...v4.18.0) (2021-03-24)\n\n\n### Bug Fixes\n\n* **createURL:** correctly remove page in state ([#4679](https://github.com/algolia/instantsearch.js/issues/4679)) ([48c080e](https://github.com/algolia/instantsearch.js/commit/48c080ef85b974e68e1c80ceffea7a0138407a1e))\n* **utils:** circular dependency in createSendEventForHits ([#4680](https://github.com/algolia/instantsearch.js/issues/4680)) ([045f33b](https://github.com/algolia/instantsearch.js/commit/045f33bc6184fb04501e39a5a97e1e969095389a))\n\n\n### Features\n\n* **metadata:** expose client's algolia agent ([#4694](https://github.com/algolia/instantsearch.js/issues/4694)) ([3d0cb5b](https://github.com/algolia/instantsearch.js/commit/3d0cb5b69056674246efb1acf33e143ac7ae4915))\n* **ts:** convert connectRefinementList, refinementList ([#4658](https://github.com/algolia/instantsearch.js/issues/4658)) ([794b2d3](https://github.com/algolia/instantsearch.js/commit/794b2d3316ae7ee79cfa0643565b65e5bec5c7c1))\n* **ts:** convert stats, connectStats ([#4681](https://github.com/algolia/instantsearch.js/issues/4681)) ([37bbd01](https://github.com/algolia/instantsearch.js/commit/37bbd016a83d5cb66d1f78c0865f7677fa7098fb))\n* **ts:** update to typescript 4 ([#4654](https://github.com/algolia/instantsearch.js/issues/4654)) ([638e437](https://github.com/algolia/instantsearch.js/commit/638e437fdd80af0cfd38818f9da37a50f8f4343f))\n\n\n\n# [4.17.0](https://github.com/algolia/instantsearch.js/compare/v4.16.1...v4.17.0) (2021-03-09)\n\n\n### Bug Fixes\n\n* **bindEvent:** escape payload correctly ([#4670](https://github.com/algolia/instantsearch.js/issues/4670)) ([c1cbaf4](https://github.com/algolia/instantsearch.js/commit/c1cbaf49f6af9784535df80d024cdad56f3ddb84))\n\n\n### Features\n\n* **insights:** add hits and attributes to InsightsEvent ([#4667](https://github.com/algolia/instantsearch.js/issues/4667)) ([17ef71c](https://github.com/algolia/instantsearch.js/commit/17ef71c32586d0a93bb3905696b6ff7c7be1f3f9))\n\n\n\n## [4.16.1](https://github.com/algolia/instantsearch.js/compare/v4.16.0...v4.16.1) (2021-03-03)\n\n\n### Bug Fixes\n\n* **relevantSort:** rename smartSort to relevantSort ([#4668](https://github.com/algolia/instantsearch.js/issues/4668)) ([579eee8](https://github.com/algolia/instantsearch.js/commit/579eee8d38effe067407a269e493400c460eb842))\n\n\n\n# [4.16.0](https://github.com/algolia/instantsearch.js/compare/v4.15.0...v4.16.0) (2021-03-01)\n\n\n### Bug Fixes\n\n* **relevantSort:** export the widget and the connector ([#4663](https://github.com/algolia/instantsearch.js/issues/4663)) ([e7aaa8c](https://github.com/algolia/instantsearch.js/commit/e7aaa8ceb47b8cafc3a3a323ebe47f45f3841ba4))\n\n\n### Features\n\n* **answers:** add `EXPERIMENTAL_answers` widget ([#4581](https://github.com/algolia/instantsearch.js/issues/4581)) ([e4c9070](https://github.com/algolia/instantsearch.js/commit/e4c9070250779d7d3afabe7f9a19644717bc12c8)), closes [#4635](https://github.com/algolia/instantsearch.js/issues/4635)\n\n\n\n# [4.15.0](https://github.com/algolia/instantsearch.js/compare/v4.14.2...v4.15.0) (2021-02-23)\n\n\n### Features\n\n* **relevantSort:** add widget ([#4648](https://github.com/algolia/instantsearch.js/issues/4648)) ([89c6e86](https://github.com/algolia/instantsearch.js/commit/89c6e868f490e9b6e507dd70c215e962f4c69ccb))\n* **stats:** apply nbSortedHits ([#4649](https://github.com/algolia/instantsearch.js/issues/4649)) ([34478c1](https://github.com/algolia/instantsearch.js/commit/34478c198dcafbd45fd101db0cd2fbe6328272b8))\n* **ts:** convert menu ([#4652](https://github.com/algolia/instantsearch.js/issues/4652)) ([2271b43](https://github.com/algolia/instantsearch.js/commit/2271b4379918e865a1b0cea09c139e517df97bc5))\n\n\n\n## [4.14.2](https://github.com/algolia/instantsearch.js/compare/v4.14.1...v4.14.2) (2021-02-17)\n\n\n### Bug Fixes\n\n* **insights:** don't reset page ([#4655](https://github.com/algolia/instantsearch.js/issues/4655)) ([2b31250](https://github.com/algolia/instantsearch.js/commit/2b312508e8be59284180e7f490ce0aac80f9c2b6))\n\n\n\n## [4.14.1](https://github.com/algolia/instantsearch.js/compare/v4.14.0...v4.14.1) (2021-02-16)\n\n\n### Bug Fixes\n\n* **compat:** remove references to window ([#4651](https://github.com/algolia/instantsearch.js/issues/4651)) ([1ede1ae](https://github.com/algolia/instantsearch.js/commit/1ede1ae392d3a12f5b0fe29075ffeb05e572a874)), closes [#4650](https://github.com/algolia/instantsearch.js/issues/4650)\n\n\n\n# [4.14.0](https://github.com/algolia/instantsearch.js/compare/v4.13.2...v4.14.0) (2021-02-09)\n\n\n### Features\n\n* **queryRuleContext:** allow to make refinements based on query ([#4638](https://github.com/algolia/instantsearch.js/issues/4638)) ([dd033fc](https://github.com/algolia/instantsearch.js/commit/dd033fc58ff11027e4f4b6157aedf0aea0326af3))\n\n\n\n## [4.13.2](https://github.com/algolia/instantsearch.js/compare/v4.13.1...v4.13.2) (2021-02-03)\n\n\n### Bug Fixes\n\n* **range:** don't go out of bounds with min or max given ([#4627](https://github.com/algolia/instantsearch.js/issues/4627)) ([8327ec0](https://github.com/algolia/instantsearch.js/commit/8327ec01c3940dfc20f5f1c8e3e0fc85f29af690))\n\n\n\n## [4.13.1](https://github.com/algolia/instantsearch.js/compare/v4.13.0...v4.13.1) (2021-01-26)\n\n\n### Bug Fixes\n\n* **index:** only set listeners on init once ([#4634](https://github.com/algolia/instantsearch.js/issues/4634)) ([730b49d](https://github.com/algolia/instantsearch.js/commit/730b49d43782b98c5119a5d3dbfec09073bde1d0))\n\n\n\n# [4.13.0](https://github.com/algolia/instantsearch.js/compare/v4.12.0...v4.13.0) (2021-01-26)\n\n\n### Features\n\n* **ratingMenu:** Add support for floats in values ([#4611](https://github.com/algolia/instantsearch.js/issues/4611)) ([3f52784](https://github.com/algolia/instantsearch.js/commit/3f52784862b72ef59acfc0735fe482cbfa6ad1f5))\n\n\n\n# [4.12.0](https://github.com/algolia/instantsearch.js/compare/v4.11.0...v4.12.0) (2021-01-20)\n\n\n### Code Refactoring\n\n* rename all references to widgetOptions as widgetParams ([#4612](https://github.com/algolia/instantsearch.js/issues/4612)) ([ff9a18d](https://github.com/algolia/instantsearch.js/commit/ff9a18d31635013ee4bc242291f121c8e5827f38))\n\n\n### Features\n\n* **core:** expose metadata of widgets ([#4604](https://github.com/algolia/instantsearch.js/issues/4604)) ([1fcf716](https://github.com/algolia/instantsearch.js/commit/1fcf71657b176b14067df36765a38e32d2a6dd9b))\n* **widgets:** annotate widget instances with $$widgetType ([#4624](https://github.com/algolia/instantsearch.js/issues/4624)) ([df3f478](https://github.com/algolia/instantsearch.js/commit/df3f47867e65a2e56c6da968d7a154471172adce))\n\n\n### BREAKING CHANGES\n\n* if you're using experimental-typescript and importing a type of the form `...WidgetOptions`, this now becomes `...WidgetParams` (eg. replace `HitsWidgetOptions` with `HitsWidgetParams`)\n\n\n\n# [4.11.0](https://github.com/algolia/instantsearch.js/compare/v4.10.0...v4.11.0) (2021-01-14)\n\n\n### Bug Fixes\n\n* **index:** do not warn for nested index widget ([#4620](https://github.com/algolia/instantsearch.js/issues/4620)) ([7502744](https://github.com/algolia/instantsearch.js/commit/7502744cd546181ec4429cd6b8144200ba2a8f82))\n* **insights:** don't quote values ([#4619](https://github.com/algolia/instantsearch.js/issues/4619)) ([ac2444c](https://github.com/algolia/instantsearch.js/commit/ac2444c36c6f41e35ed6d1a6d045479b35416576))\n\n\n### Features\n\n* **insights:** accept initParams for insightsClient ([#4608](https://github.com/algolia/instantsearch.js/issues/4608)) ([0a0ae2b](https://github.com/algolia/instantsearch.js/commit/0a0ae2bf10a4e210373b8fde635949a56c86e52e))\n\n\n\n# [4.10.0](https://github.com/algolia/instantsearch.js/compare/v4.9.2...v4.10.0) (2021-01-05)\n\n\n### Features\n\n* **index:** expose createURL ([#4603](https://github.com/algolia/instantsearch.js/issues/4603)) ([f57e9c5](https://github.com/algolia/instantsearch.js/commit/f57e9c5a46e927b8dd38f167ee5c467151334a08))\n* **index:** expose scoped results getter ([#4609](https://github.com/algolia/instantsearch.js/issues/4609)) ([a41b1e4](https://github.com/algolia/instantsearch.js/commit/a41b1e46bb195e6ef1f9bdbdde64d9300246c22f))\n* **reverseHighlight/reverseSnippet:** Implements reverseHighlight and reverseSnippet ([#4592](https://github.com/algolia/instantsearch.js/issues/4592)) ([718bf45](https://github.com/algolia/instantsearch.js/commit/718bf458152bb55bab1efb542adb8e31298c0c3c))\n\n\n\n## [4.9.2](https://github.com/algolia/instantsearch.js/compare/v4.9.1...v4.9.2) (2020-12-15)\n\n\n### Bug Fixes\n\n* warn about invalid userToken ([#4605](https://github.com/algolia/instantsearch.js/issues/4605)) ([5fce769](https://github.com/algolia/instantsearch.js/commit/5fce769f42fe5b44f73eb68f3858a6ea1ec2d854))\n* **types:** correct type for queryHook return ([#4602](https://github.com/algolia/instantsearch.js/issues/4602)) ([acff8db](https://github.com/algolia/instantsearch.js/commit/acff8db3a2238edf40da1ee6b44e93a94e090698))\n\n\n\n## [4.9.1](https://github.com/algolia/instantsearch.js/compare/v4.9.0...v4.9.1) (2020-12-08)\n\n\n### Bug Fixes\n\n* **range:** consistently convert min & max to numbers ([#4587](https://github.com/algolia/instantsearch.js/issues/4587)) ([ccf159e](https://github.com/algolia/instantsearch.js/commit/ccf159efcb94e9c8c04c558fcb69e2e3d8d79729))\n\n\n\n# [4.9.0](https://github.com/algolia/instantsearch.js/compare/v4.8.7...v4.9.0) (2020-12-01)\n\n\n### Bug Fixes\n\n* remove a warning about insights that is not relevant anymore ([#4593](https://github.com/algolia/instantsearch.js/issues/4593)) ([b5f6a47](https://github.com/algolia/instantsearch.js/commit/b5f6a479ff1b9b692c733f51e39eade724ff3413))\n\n\n### Features\n\n* **autocomplete:** implement `getWidgetRenderState` ([#4466](https://github.com/algolia/instantsearch.js/issues/4466)) ([c215836](https://github.com/algolia/instantsearch.js/commit/c2158364a63d0f05bb820f802871a2f093e041ec))\n* **breadcrumb:** implement `getWidgetRenderState` ([#4467](https://github.com/algolia/instantsearch.js/issues/4467)) ([80b348e](https://github.com/algolia/instantsearch.js/commit/80b348ef1a6a29b1897f5ee1d680dcbaba5fa4fe))\n* **clearRefinements:** implement `getWidgetRenderState` ([#4468](https://github.com/algolia/instantsearch.js/issues/4468)) ([2b3117c](https://github.com/algolia/instantsearch.js/commit/2b3117c34207514967ff453b6f5d8275a6b0b0ec))\n* **configure:** getRenderState for multiple configure widgets ([#4582](https://github.com/algolia/instantsearch.js/issues/4582)) ([5432af1](https://github.com/algolia/instantsearch.js/commit/5432af1df3c1ee4e62b87ede76acda7b749f38dd))\n* **configure:** implement `getWidgetRenderState` ([#4469](https://github.com/algolia/instantsearch.js/issues/4469)) ([3a1b325](https://github.com/algolia/instantsearch.js/commit/3a1b32556f3d5a6a3330b404688e06d5815a2390))\n* **connectPagination:** add getWidgetRenderState & refactor to TS ([#4574](https://github.com/algolia/instantsearch.js/issues/4574)) ([1553aa3](https://github.com/algolia/instantsearch.js/commit/1553aa36c8bb8664b5e74fd2378ea2ef45a52acf))\n* **core:** introduce `getWidgetRenderState` (2/n) ([#4457](https://github.com/algolia/instantsearch.js/issues/4457)) ([4839bb6](https://github.com/algolia/instantsearch.js/commit/4839bb61e4c8ee6083710195d5db5684c7b0889f))\n* **core:** introduce `getWidgetUiState` lifecycle hook (1/n) ([#4454](https://github.com/algolia/instantsearch.js/issues/4454)) ([cf21ea4](https://github.com/algolia/instantsearch.js/commit/cf21ea4cb580ed523828c926b7ba724c46eed8a4))\n* **currentRefinements:** implement `getWidgetRenderState` ([#4470](https://github.com/algolia/instantsearch.js/issues/4470)) ([b8df824](https://github.com/algolia/instantsearch.js/commit/b8df824e26a164280d9da9b3c3ce41ad56962439))\n* **connectQueryRules:** getWidgetRenderState ([#4572](https://github.com/algolia/instantsearch.js/issues/4572)) ([edcc4a4](https://github.com/algolia/instantsearch.js/commit/edcc4a463d32af21bb73acbca879d4982ae9006f))\n* **connectGeoSearch:** support getWidgetRenderState ([#4564](https://github.com/algolia/instantsearch.js/issues/4564)) ([8d06fba](https://github.com/algolia/instantsearch.js/commit/8d06fba40be0392daa1b48f235d93d92bb6b5e93))\n* **hierarchicalMenu:** implement `getWidgetRenderState` ([#4471](https://github.com/algolia/instantsearch.js/issues/4471)) ([9fd3cd0](https://github.com/algolia/instantsearch.js/commit/9fd3cd06dfc3b5302c00ee1820ff58be2a37c3b7))\n* **highlight:** accept array for attribute ([#4588](https://github.com/algolia/instantsearch.js/issues/4588)) ([b0c3a3a](https://github.com/algolia/instantsearch.js/commit/b0c3a3a960646bff22b2d28e21aa2675484a354b))\n* **hits:** implement `getWidgetRenderState` ([#4525](https://github.com/algolia/instantsearch.js/issues/4525)) ([3391ff7](https://github.com/algolia/instantsearch.js/commit/3391ff7bac8b406ab474e712408bda2be69934c9))\n* **hitsPerPage:** implement `getRenderState` and `getWidgetRenderState` ([#4532](https://github.com/algolia/instantsearch.js/issues/4532)) ([7ad10ea](https://github.com/algolia/instantsearch.js/commit/7ad10ea648f48766061153994da90920a5194103))\n* **infinite-hits:** implement `getRenderState` and `getWidgetRenderState` ([#4535](https://github.com/algolia/instantsearch.js/issues/4535)) ([98c70d9](https://github.com/algolia/instantsearch.js/commit/98c70d980bc1036057a2dd99dc6aeee8343e4472))\n* **menu:** implement `getRenderState` and `getWidgetRenderState` ([#4540](https://github.com/algolia/instantsearch.js/issues/4540)) ([239906c](https://github.com/algolia/instantsearch.js/commit/239906c7fdb36c691b9a9aca343802a8ccc616c8))\n* **panel:** spread widgetRenderState in the options in panel ([#4527](https://github.com/algolia/instantsearch.js/issues/4527)) ([8f82eaa](https://github.com/algolia/instantsearch.js/commit/8f82eaa34e7abe9070e404a5a45d352af61d940a)), closes [#4558](https://github.com/algolia/instantsearch.js/issues/4558)\n* **poweredBy:** getWidgetRenderState ([#4551](https://github.com/algolia/instantsearch.js/issues/4551)) ([cd816a4](https://github.com/algolia/instantsearch.js/commit/cd816a41afe0704eab3cbd1f019fc660ca5d255e))\n* **range:** implement `getRenderState` and `getWidgetRenderState` ([#4536](https://github.com/algolia/instantsearch.js/issues/4536)) ([d67bfcd](https://github.com/algolia/instantsearch.js/commit/d67bfcdb828cc8b35a5c959e54823b6d3c37b087))\n* **rating-menu:** implement `getRenderState` and `getWidgetRenderState` ([#4548](https://github.com/algolia/instantsearch.js/issues/4548)) ([166a96c](https://github.com/algolia/instantsearch.js/commit/166a96c170c137e78b3fe3b9f69f73744f4fcb8b))\n* **refinement-list:** implement `getRenderState` and `getWidgetRenderState` ([#4549](https://github.com/algolia/instantsearch.js/issues/4549)) ([c824bd0](https://github.com/algolia/instantsearch.js/commit/c824bd074d388e44e99b53592167cffcacae3377))\n* **numeric-menu:** add `getRenderState` ([#4550](https://github.com/algolia/instantsearch.js/issues/4550)) ([5385edf](https://github.com/algolia/instantsearch.js/commit/5385edf39d3ac1515845b5e20ce179a2869ab86d))\n* **sortBy:** implement `getRenderState` and `getWidgetRenderState` ([#4568](https://github.com/algolia/instantsearch.js/issues/4568)) ([fd249f7](https://github.com/algolia/instantsearch.js/commit/fd249f700854d1f11e97cb5dac2c1b3964c59e29))\n* **stats:** implement `getRenderState` and `getWidgetRenderState` ([#4565](https://github.com/algolia/instantsearch.js/issues/4565)) ([b8dfd6d](https://github.com/algolia/instantsearch.js/commit/b8dfd6dbb8c462b0d0571e9f0499df6e4dda7745))\n* **toggleRefinement:** implement `getRenderState` and `getWidgetRenderState` ([#4569](https://github.com/algolia/instantsearch.js/issues/4569)) ([f2c9a10](https://github.com/algolia/instantsearch.js/commit/f2c9a102cba9abe21ed08b18e979713156e10901))\n* **voice-search:** implement `getRenderState` and `getWidgetRenderState` ([#4557](https://github.com/algolia/instantsearch.js/issues/4557)) ([d308da1](https://github.com/algolia/instantsearch.js/commit/d308da1ab892cc5185616cd5b8a4a3f488e708c4))\n\n\n\n## [4.8.7](https://github.com/algolia/instantsearch.js/compare/v4.8.6...v4.8.7) (2020-11-19)\n\n\n### Bug Fixes\n\n* **insights:** use internal `find` util method ([#4580](https://github.com/algolia/instantsearch.js/issues/4580)) ([61b855b](https://github.com/algolia/instantsearch.js/commit/61b855b28282992a55795db88f8bfef2e5825cb3))\n\n\n\n## [4.8.6](https://github.com/algolia/instantsearch.js/compare/v4.8.5...v4.8.6) (2020-11-17)\n\n\n### Bug Fixes\n\n* **insights:** do not throw when sending event right after creating insights middleware ([#4575](https://github.com/algolia/instantsearch.js/issues/4575)) ([d963f8d](https://github.com/algolia/instantsearch.js/commit/d963f8d6155e6bb56f852e00528ed10dc9bcc461))\n\n\n\n## [4.8.5](https://github.com/algolia/instantsearch.js/compare/v4.8.4...v4.8.5) (2020-11-10)\n\n\n### Bug Fixes\n\n* **configure:** pass the latest state to onStateChange ([#4555](https://github.com/algolia/instantsearch.js/issues/4555)) ([6ab76e8](https://github.com/algolia/instantsearch.js/commit/6ab76e82f93e8c7bb2bfdde267b6d7f4f9b333ff))\n\n\n\n## [4.8.4](https://github.com/algolia/instantsearch.js/compare/v4.8.3...v4.8.4) (2020-10-27)\n\n\n### Bug Fixes\n\n* **infiniteHits:** do not cache the cached hits inside the connector ([#4534](https://github.com/algolia/instantsearch.js/issues/4534)) ([c97395e](https://github.com/algolia/instantsearch.js/commit/c97395e2d3443651e628617f0974703a100a988e))\n* **insights:** show deprecation warnings for old insights related properties and functions ([#4524](https://github.com/algolia/instantsearch.js/issues/4524)) ([c93e1cf](https://github.com/algolia/instantsearch.js/commit/c93e1cfcad06b327066078088410eb7d51972790))\n\n\n\n## [4.8.3](https://github.com/algolia/instantsearch.js/compare/v4.8.2...v4.8.3) (2020-09-29)\n\n\n### Bug Fixes\n\n* **middleware:** rename EXPERIMENTAL_use to use ([#4450](https://github.com/algolia/instantsearch.js/issues/4450)) ([87ecb99](https://github.com/algolia/instantsearch.js/commit/87ecb99f33ab4930d8ec1996ddba9db0a9d07da4))\n* **refinementList:** cap `maxFacetHits` to 100 for SFFV ([#4523](https://github.com/algolia/instantsearch.js/issues/4523)) ([baf1f02](https://github.com/algolia/instantsearch.js/commit/baf1f027fc2436e86536fffbee11a595cfd7dac0))\n\n\n\n## [4.8.2](https://github.com/algolia/instantsearch.js/compare/v4.8.1...v4.8.2) (2020-09-22)\n\n\n### Bug Fixes\n\n* **insights:** fix the regression that it didn't send events with instantsearch.insights() ([#4519](https://github.com/algolia/instantsearch.js/issues/4519)) ([10e38df](https://github.com/algolia/instantsearch.js/commit/10e38df02608071cd7272e829b6748be41b9c2c0))\n\n\n\n## [4.8.1](https://github.com/algolia/instantsearch.js/compare/v4.8.0...v4.8.1) (2020-09-15)\n\n\n### Bug Fixes\n\n* **hitsPerPage:** update link to hitsPerPage widget ([#4513](https://github.com/algolia/instantsearch.js/issues/4513)) ([daa4bb9](https://github.com/algolia/instantsearch.js/commit/daa4bb944065dede46d716308325039c3602d9dc))\n* **infiniteHits:** compute `isLastPage` based on cached pages ([#4509](https://github.com/algolia/instantsearch.js/issues/4509)) ([b6fb1ab](https://github.com/algolia/instantsearch.js/commit/b6fb1abcf5ac456dc39adaeb97945665cad8fa11))\n\n\n\n# [4.8.0](https://github.com/algolia/instantsearch.js/compare/v4.7.2...v4.8.0) (2020-09-08)\n\n\n### Features\n\n* **insights:** introduce `insights` middleware ([#4446](https://github.com/algolia/instantsearch.js/issues/4446)) ([9bc6359](https://github.com/algolia/instantsearch.js/commit/9bc635986097736272aac8c5d3380a255488fdb7))\n\n\n\n## [4.7.2](https://github.com/algolia/instantsearch.js/compare/v4.7.1...v4.7.2) (2020-08-31)\n\n\n### Bug Fixes\n\n* **bundlesize:** remove prop-type imports ([#4491](https://github.com/algolia/instantsearch.js/issues/4491)) ([8361cd6](https://github.com/algolia/instantsearch.js/commit/8361cd63b3bac15eb6250e9f509fb15c1fc57f48))\n* **router:** skip router write on duplicate entries ([#4487](https://github.com/algolia/instantsearch.js/issues/4487)) ([9296022](https://github.com/algolia/instantsearch.js/commit/9296022fecadfbf82f15e837c215a1356eac4bc5))\n* **searchBox:** pass \"spellcheck\" property correctly to input ([#4483](https://github.com/algolia/instantsearch.js/issues/4483)) ([3cf43c7](https://github.com/algolia/instantsearch.js/commit/3cf43c7187841cf961a0280307af1a5f7a4e8da7))\n\n\n\n# [4.7.1](https://github.com/algolia/instantsearch.js/compare/v4.7.0...v4.7.1) (2020-08-19)\n\n\n### Bug Fixes\n\n* **configureRelatedItems:** support nested attributes ([#4480](https://github.com/algolia/instantsearch.js/issues/4480)) ([2266004](https://github.com/algolia/instantsearch.js/commit/2266004f274138b45640f000a5da8aa14e419e6c))\n* **connectToggleRefinement:** fix onFacetValue/offFacetValue on render when using arrays for on/off ([#4449](https://github.com/algolia/instantsearch.js/issues/4449)) ([fd3e83f](https://github.com/algolia/instantsearch.js/commit/fd3e83f2cf2e5b44b7d29eb4c67526e55c18d708))\n* **index:** don't show a development warning for inconsistent UI state in `connectRange` ([#4440](https://github.com/algolia/instantsearch.js/issues/4440)) ([eb8c8b3](https://github.com/algolia/instantsearch.js/commit/eb8c8b3494cb66dbef1d03e7d74374dc49059345)), closes [#4437](https://github.com/algolia/instantsearch.js/issues/4437)\n* **infiniteHits:** work with controlled mode ([#4435](https://github.com/algolia/instantsearch.js/issues/4435)) ([68b20f4](https://github.com/algolia/instantsearch.js/commit/68b20f487fcd54fd7dec11b4c494b6aa94a18516))\n* **typescript:** correct dummy v4 client ([#4459](https://github.com/algolia/instantsearch.js/issues/4459)) ([ca0c394](https://github.com/algolia/instantsearch.js/commit/ca0c3946608bb8ec5dcf5378d8d382d809a4d86f))\n* **typescript:** jsDoc comments which conform to Connector definition ([#4458](https://github.com/algolia/instantsearch.js/issues/4458)) ([5209bdb](https://github.com/algolia/instantsearch.js/commit/5209bdb9189e7cbbf9514b62fde55f923b2b3273))\n* **typescript:** export correct types ([#4476](https://github.com/algolia/instantsearch.js/issues/4476)) ([5fb4c5b](https://github.com/algolia/instantsearch.js/commit/5fb4c5b9d6ac75636e94514598ef5d5a86affafd))\n\n\n\n# [4.7.0](https://github.com/algolia/instantsearch.js/compare/v4.6.0...v4.7.0) (2020-06-15)\n\n\n### Bug Fixes\n\n* **rangeInput:** clear input when refinement is cleared ([#4429](https://github.com/algolia/instantsearch.js/issues/4429)) ([a2c7663](https://github.com/algolia/instantsearch.js/commit/a2c7663424c5cd59e17ed841e12abaa19e524b14))\n\n\n### Features\n\n* **infiniteHits:** support cache ([#4431](https://github.com/algolia/instantsearch.js/issues/4431)) ([008c01c](https://github.com/algolia/instantsearch.js/commit/008c01c7cd09e4fcecdf53a4b299960de2b7a026))\n\n\n\n# [4.6.0](https://github.com/algolia/instantsearch.js/compare/v4.5.0...v4.6.0) (2020-06-08)\n\n\n### Bug Fixes\n\n* **connectPagination:** set `isLastPage` to `true` when no results ([#4422](https://github.com/algolia/instantsearch.js/issues/4422)) ([92bcc02](https://github.com/algolia/instantsearch.js/commit/92bcc0271927f0239083366fff920530977e32cd))\n* **rangeInput:** support typing float numbers ([#4418](https://github.com/algolia/instantsearch.js/issues/4418)) ([61b19b8](https://github.com/algolia/instantsearch.js/commit/61b19b87ae3afdabde8ef355e3b727059ae59911))\n\n\n### Features\n\n* **connectToggleRefinement:** add support for array values ([#4420](https://github.com/algolia/instantsearch.js/issues/4420)) ([fe1fbee](https://github.com/algolia/instantsearch.js/commit/fe1fbee4ad59c5f24831ed38a419906bbd7d2c15))\n\n\n\n# [4.5.0](https://github.com/algolia/instantsearch.js/compare/v4.4.1...v4.5.0) (2020-05-13)\n\n\n### Bug Fixes\n\n* **middleware:** subscribe middleware after `init` ([#4322](https://github.com/algolia/instantsearch.js/issues/4322)) ([f61fc4d](https://github.com/algolia/instantsearch.js/commit/f61fc4d133c118cfe8f2a2ba2e02d037a21cf8e0))\n\n\n### Features\n\n* **index:** support adding index widget with initial UI state ([#4359](https://github.com/algolia/instantsearch.js/issues/4359)) ([5ff4c83](https://github.com/algolia/instantsearch.js/commit/5ff4c8307c2be7bde7fb53aa9935a243e6532fe2))\n* **voice:** allow custom voice helper ([#4363](https://github.com/algolia/instantsearch.js/issues/4363)) ([4a00fa6](https://github.com/algolia/instantsearch.js/commit/4a00fa607354aefaae468735b590e237a2d46f9b))\n\n\n\n## [4.4.1](https://github.com/algolia/instantsearch.js/compare/v4.4.0...v4.4.1) (2020-04-29)\n\n\n### Bug Fixes\n\n* **range:** fix range calculation when step is set ([#4398](https://github.com/algolia/instantsearch.js/issues/4398)) ([a36b4e0](https://github.com/algolia/instantsearch.js/commit/a36b4e0a64afaa9dfa3048c802d010d569c821a9))\n* **router:** don't write an existing URL ([#4392](https://github.com/algolia/instantsearch.js/issues/4392)) ([ee6a9c6](https://github.com/algolia/instantsearch.js/commit/ee6a9c657c97adebba9fb9404eae454c3996b86d))\n\n\n\n# [4.4.0](https://github.com/algolia/instantsearch.js/compare/v4.3.1...v4.4.0) (2020-04-08)\n\n\n### Features\n\n* introduce controlled mode APIs with `onStateChange` and `setUiState` ([#4362](https://github.com/algolia/instantsearch.js/issues/4362)) ([4953324](https://github.com/algolia/instantsearch.js/commit/4953324ac8a3af4c6a8be411ca9e7cc673ee6561))\n\n\n\n## [4.3.1](https://github.com/algolia/instantsearch.js/compare/v4.3.0...v4.3.1) (2020-03-06)\n\nThis versions fixes a [Cross-Site Scripting](https://en.wikipedia.org/wiki/Cross-site_scripting) (XSS) vulnerability ([#4344](https://github.com/algolia/instantsearch.js/issues/4344)) when using the [`refinementList`](https://www.algolia.com/doc/api-reference/widgets/refinement-list/js/) widget when relying on its default [`item`](https://www.algolia.com/doc/api-reference/widgets/refinement-list/js/#widget-param-item) template and [routing](https://www.algolia.com/doc/api-reference/widgets/instantsearch/js/#widget-param-routing). **We recommend all users to upgrade to this version**. We now escape the `refinementList` `item` template by default, which avoids HTML to be injected. If ever you were relying on this behavior, **which we do not recommend**, you can copy the [previous `item` template](https://github.com/algolia/instantsearch.js/blob/933d9ffb3c0a396a047eeb4b44733b17aa31d081/src/widgets/refinement-list/defaultTemplates.js#L2-L9) into your widget.\n\nYou were not vulnerable to this XSS if:\n\n- You didn't use [routing](https://www.algolia.com/doc/api-reference/widgets/instantsearch/js/#widget-param-routing)\n- You didn't use use the [`refinementList`](https://www.algolia.com/doc/api-reference/widgets/refinement-list/js/) widget ([`connectRefinementList`](https://www.algolia.com/doc/api-reference/widgets/refinement-list/js/#connector) is not subject to this issue)\n- You used a custom `item` template for your [`refinementList`](https://www.algolia.com/doc/api-reference/widgets/refinement-list/js/) widget that does not rely on the triple-brace Hogan.js syntax (e.g., `{{{highlighted}}}`)\n\n\n### Bug Fixes\n\n* **refinementList:** prevent XSS via routing ([#4344](https://github.com/algolia/instantsearch.js/issues/4344)) ([8552221](https://github.com/algolia/instantsearch.js/commit/8552221eff17a4ae5ba9c454054b0eb6e002934d))\n\n\n\n# [4.3.0](https://github.com/algolia/instantsearch.js/compare/v4.2.0...v4.3.0) (2020-02-25)\n\n\n### Bug Fixes\n\n* **deps:** update dependency algoliasearch-helper to v3.1.1 that fixes a case where refinements for a facet with a name that matches a substring of another facet could be cleared by mistake ([algolia/algoliasearch-helper-js/pull/760](https://github.com/algolia/algoliasearch-helper-js/pull/760)) ([#4335](https://github.com/algolia/instantsearch.js/issues/4335)) ([9bc66cf](https://github.com/algolia/instantsearch.js/commit/381cda05c9c51dc9d3245a6d926e3c919245b723))\n\n\n### Features\n\n* **highlight:** add cssClasses to snippet & highlight helper ([#4306](https://github.com/algolia/instantsearch.js/issues/4306)) ([ece0aa6](https://github.com/algolia/instantsearch.js/commit/ece0aa60f05c2c687a23f9219d62ace0d5b866f9))\n\n\n# [4.2.0](https://github.com/algolia/instantsearch.js/compare/v4.1.1...v4.2.0) (2020-01-23)\n\n\n### Features\n\n* **algoliasearch:** add support for algoliasearch v4 ([#4294](https://github.com/algolia/instantsearch.js/issues/4294)) ([73f1584](https://github.com/algolia/instantsearch.js/commit/73f158428c7d4de1e3d1bc40bf4342362f275829))\n* **insights:** add getInsightsAnonymousUserToken helper ([#4279](https://github.com/algolia/instantsearch.js/issues/4279)) ([4653f95](https://github.com/algolia/instantsearch.js/commit/4653f95b436a0715ce1489e0b83c00a87e4a02f0))\n\n\n\n## [4.1.1](https://github.com/algolia/instantsearch.js/compare/v4.1.0...v4.1.1) (2019-12-20)\n\n\n### Bug Fixes\n\n* **configureRelatedItems:** use `facetFilters` to exclude `obje… ([#4264](https://github.com/algolia/instantsearch.js/issues/4264)) ([9bc66cf](https://github.com/algolia/instantsearch.js/commit/9bc66cfb8b13a44840c687a1631696c85e45845f))\n* **index:** fix warning for widgets sharing connectors ([#4260](https://github.com/algolia/instantsearch.js/issues/4260)) ([ec97b4a](https://github.com/algolia/instantsearch.js/commit/ec97b4a07e5d1f9a967f5ee5925ebd3b447e1b02))\n* **insights:** export Insights helper in the ESM build ([#4261](https://github.com/algolia/instantsearch.js/issues/4261)) ([20649af](https://github.com/algolia/instantsearch.js/commit/20649aff54a3150050866038cd3718d6010c353b))\n* **insights:** move 'insightsClient not provided error' to wrapper level ([#4254](https://github.com/algolia/instantsearch.js/issues/4254)) ([15d38dd](https://github.com/algolia/instantsearch.js/commit/15d38ddb87fbd6323f350d42f791c4d7a1505eeb))\n\n\n### Features\n\n* **insights:** add hogan helper ([#4253](https://github.com/algolia/instantsearch.js/issues/4253)) ([85739d7](https://github.com/algolia/instantsearch.js/commit/85739d782ae1fad3b87612e4a410eada0ca4fe54))\n\n\n\n# [4.1.0](https://github.com/algolia/instantsearch.js/compare/v4.0.1...v4.1.0) (2019-12-10)\n\nThe [4.0.1](#4.0.1) release contained experimental TypeScript definitions in the ESM build by accident. We rolled this back in 4.1.0 because types will first be released on an experimental tag: `experimental-typescript`.\n\n\n### Bug Fixes\n\n* **core:** display correct object types in messages ([#4249](https://github.com/algolia/instantsearch.js/issues/4249)) ([fb2c3c9](https://github.com/algolia/instantsearch.js/commit/fb2c3c9c37fd8d28cd4712486c5c637e237fe83b))\n* **insights:** detect clicks on children of `[data-insights]` HTML elements ([#4197](https://github.com/algolia/instantsearch.js/issues/4197)) ([9cac5a3](https://github.com/algolia/instantsearch.js/commit/9cac5a3aa4af616ec7913c17ed7388134c5e7f0a))\n* **insights:** display docs URL when missing ([#4231](https://github.com/algolia/instantsearch.js/issues/4231)) ([9df1e7f](https://github.com/algolia/instantsearch.js/commit/9df1e7f762333bd31b5840b35378d56605fe4844))\n* **widgets:** override connectors' `$$type` ([#4227](https://github.com/algolia/instantsearch.js/issues/4227)) ([50f4af3](https://github.com/algolia/instantsearch.js/commit/50f4af3006a44cd08dd99b3a72bd410340c2e48a))\n\n\n### Features\n\n* **middleware:** introduce `EXPERIMENTAL_use` to plug middleware into InstantSearch ([#4224](https://github.com/algolia/instantsearch.js/issues/4224)) ([9d1f7be](https://github.com/algolia/instantsearch.js/commit/9d1f7be9df304a4bc2d07dbd253a73580a0593c3))\n* **router:** plug router as a middleware ([#4224](https://github.com/algolia/instantsearch.js/issues/4224)) ([9d1f7be](https://github.com/algolia/instantsearch.js/commit/9d1f7be9df304a4bc2d07dbd253a73580a0593c3))\n* **insights:** detect window.aa when available on global scope and a function ([#4191](https://github.com/algolia/instantsearch.js/issues/4191)) ([d6df5af](https://github.com/algolia/instantsearch.js/commit/d6df5affc4111aaf2c82f847ffe877793faac86c))\n* **typescript:** add declaration files (experimental) ([#4220](https://github.com/algolia/instantsearch.js/issues/4220)) ([ebacfe5](https://github.com/algolia/instantsearch.js/commit/ebacfe55bc0fddf9ca217eca8c8a207b220ab93d))\n* **widgets:** introduce Related Items widgets as experimental (`EXPERIMENTAL_configureRelatedItems` and `EXPERIMENTAL_connectConfigureRelatedItems`) ([#4233](https://github.com/algolia/instantsearch.js/issues/4233)) ([f811f4e](https://github.com/algolia/instantsearch.js/commit/f811f4efa3e58a2b868d11ec338248715a7596c9))\n\n\n\n## [4.0.1](https://github.com/algolia/instantsearch.js/compare/v4.0.0...v4.0.1) (2019-11-28)\n\n\n### Bug Fixes\n\n* widget name in documentation link for index ([#4172](https://github.com/algolia/instantsearch.js/issues/4172)) ([fe7e588](https://github.com/algolia/instantsearch.js/commit/fe7e588d252ad6bd7de2f49d52ca022099f3e959))\n* **helper:** rely on stable version of algoliasearch-helper ([#4200](https://github.com/algolia/instantsearch.js/issues/4200)) ([ff11731](https://github.com/algolia/instantsearch.js/commit/ff117314d786c4509edabcb1ddbac73f55930511))\n* **infiniteHits:** correct widget options types ([#4222](https://github.com/algolia/instantsearch.js/issues/4222)) ([bb1b327](https://github.com/algolia/instantsearch.js/commit/bb1b327e26b5faad3358a00d174dc48fd4b73356))\n* **queryHook:** restore behaviour of queryHook ([#4202](https://github.com/algolia/instantsearch.js/issues/4202)) ([7bf96cb](https://github.com/algolia/instantsearch.js/commit/7bf96cb6eafd5349cdf2f32114d5e6ef5dde1328)), closes [/github.com/algolia/instantsearch.js/commit/c073a9acb51fff3c15278fcd563e47fec55c8365#diff-530222e0c4597f2110dc6ba173a306b0L98](https://github.com//github.com/algolia/instantsearch.js/commit/c073a9acb51fff3c15278fcd563e47fec55c8365/issues/diff-530222e0c4597f2110dc6ba173a306b0L98)\n\n\n### Features\n\n* **transformers:** add tests ([#4153](https://github.com/algolia/instantsearch.js/issues/4153)) ([5a28415](https://github.com/algolia/instantsearch.js/commit/5a28415c39bf5a3a65c61d8f0d444ea6f4e0e17a))\n\n\n\n# [4.0.0](https://github.com/algolia/instantsearch.js/compare/v3.7.0...v4.0.0) (2019-10-23)\n\nThis release is focused on two main features: Federated search, and bundle size reduction.\n\nFederated search, is the feature where you search through multiple types of content with the same experience, but with separate result lists. In the past we have also called this feature \"multi-index search\". This feature helps you make more efficient UIs with multiple result lists, autocomplete, nested interfaces and query suggestions. You can read more about the new index widget [in the documentation](https://www.algolia.com/doc/api-reference/widgets/index-widget/js/).\n\nThe second main feature is bundle size reduction. This is a bottom-up process where we started by removing Lodash from our bundle. While the library has many useful features, it was a major part of our compiled code. We have also updated to Preact X, the latest version of Preact internally. This allows us to use more modern (p)react features in the future, which have a more efficient bundling pattern.\n\nYou can read more details on our choices by following [the original posts](https://discourse.algolia.com/t/instantsearch-js-v4-beta-0-is-released/8461) about the beta releases.\n\nEven though all this internally were major refactors, this should not have a big impact on how you are using InstantSearch. For the few things which did change, a migration guide can be found in [the documentation](https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/#upgrade-from-v3-to-v4). Don't hesitate to reach out if anything is unclear from that guide, so we can fix it for everyone.\n\nNote, if you are using the [places.js](https://github.com/algolia/places) InstantSearch widget, it is not compatible with InstantSearch v4. However, we took this opportunity to make it a real part of InstantSearch.js, and is now accessible as a widget of InstantSearch. You can use it with a `placesReference`.\n\n### Bug Fixes\n\n* **configure:** merge with the previous parameters ([#4085](https://github.com/algolia/instantsearch.js/issues/4085)) ([a215d0c](https://github.com/algolia/instantsearch.js/commit/a215d0c))\n* **configure:** update lifecycle state ([#3994](https://github.com/algolia/instantsearch.js/issues/3994)) ([3d8d967](https://github.com/algolia/instantsearch.js/commit/3d8d967))\n* **connectInfiniteHits:** fix page state when adding or removing widgets ([#4104](https://github.com/algolia/instantsearch.js/issues/4104)) ([1077340](https://github.com/algolia/instantsearch.js/commit/1077340))\n* **connectInfiniteHits:** fix state when navigating or adding/removing widgets ([#4123](https://github.com/algolia/instantsearch.js/issues/4123)) ([9cbd24a](https://github.com/algolia/instantsearch.js/commit/9cbd24a))\n* **createURL:** support multi-index ([#4082](https://github.com/algolia/instantsearch.js/issues/4082)) ([179a6e5](https://github.com/algolia/instantsearch.js/commit/179a6e5))\n* **defer:** recover from error ([#3933](https://github.com/algolia/instantsearch.js/issues/3933)) ([f22b9e2](https://github.com/algolia/instantsearch.js/commit/f22b9e2))\n* **helper:** expose .lastResults to .helper ([#4170](https://github.com/algolia/instantsearch.js/issues/4170)) ([236eb7b](https://github.com/algolia/instantsearch.js/commit/236eb7b))\n* **history:** avoid empty query string ([#4130](https://github.com/algolia/instantsearch.js/issues/4130)) ([18fee7c](https://github.com/algolia/instantsearch.js/commit/18fee7c))\n* **hits:** update lifecycle state ([#3977](https://github.com/algolia/instantsearch.js/issues/3977)) ([6e55ba6](https://github.com/algolia/instantsearch.js/commit/6e55ba6))\n* **hitsPerPage:** avoid sync default value ([#4086](https://github.com/algolia/instantsearch.js/issues/4086)) ([3f8b958](https://github.com/algolia/instantsearch.js/commit/3f8b958))\n* **hitsPerPage:** update lifecycle state ([#3978](https://github.com/algolia/instantsearch.js/issues/3978)) ([d21d620](https://github.com/algolia/instantsearch.js/commit/d21d620))\n* **index:** ensure that we always use the index set by widgets ([#4125](https://github.com/algolia/instantsearch.js/issues/4125)) ([952dc70](https://github.com/algolia/instantsearch.js/commit/952dc70)), closes [/github.com/algolia/algoliasearch-helper-js/blob/5a0352aa233c5ea932df6b054a16989c8d302404/src/algoliasearch.helper.js#L124](https://github.com//github.com/algolia/algoliasearch-helper-js/blob/5a0352aa233c5ea932df6b054a16989c8d302404/src/algoliasearch.helper.js/issues/L124)\n* **index:** prevent render without results ([#3932](https://github.com/algolia/instantsearch.js/issues/3932)) ([1b9b5f4](https://github.com/algolia/instantsearch.js/commit/1b9b5f4))\n* **index:** subscribe to state change only after init for uiState ([#4003](https://github.com/algolia/instantsearch.js/issues/4003)) ([9490ca9](https://github.com/algolia/instantsearch.js/commit/9490ca9))\n* **index:** support custom UI params in UI state warning ([#4165](https://github.com/algolia/instantsearch.js/issues/4165)) ([80d32fc](https://github.com/algolia/instantsearch.js/commit/80d32fc))\n* **index:** warn for inconsistent UI state in development mode ([#4140](https://github.com/algolia/instantsearch.js/issues/4140)) ([7e277dc](https://github.com/algolia/instantsearch.js/commit/7e277dc))\n* **infiniteHits:** update lifecycle state ([#3983](https://github.com/algolia/instantsearch.js/issues/3983)) ([4b8bee5](https://github.com/algolia/instantsearch.js/commit/4b8bee5))\n* **instantsearch:** return instance in widgets methods ([#4143](https://github.com/algolia/instantsearch.js/issues/4143)) ([77ffb93](https://github.com/algolia/instantsearch.js/commit/77ffb93))\n* **InstantSearch:** cancel scheduled operations ([#3930](https://github.com/algolia/instantsearch.js/issues/3930)) ([3aafbad](https://github.com/algolia/instantsearch.js/commit/3aafbad))\n* **InstantSearch:** fix initialUIState when refinements are already present in the route ([#4103](https://github.com/algolia/instantsearch.js/issues/4103)) ([079db57](https://github.com/algolia/instantsearch.js/commit/079db57))\n* **InstantSearch:** remove useless walk/duplicate request ([#4127](https://github.com/algolia/instantsearch.js/issues/4127)) ([70163a8](https://github.com/algolia/instantsearch.js/commit/70163a8))\n* **menu:** apply & remove refinement ([#4027](https://github.com/algolia/instantsearch.js/issues/4027)) ([85de2cf](https://github.com/algolia/instantsearch.js/commit/85de2cf))\n* **menu:** prevent error on stale search ([#3934](https://github.com/algolia/instantsearch.js/issues/3934)) ([5f9e138](https://github.com/algolia/instantsearch.js/commit/5f9e138))\n* **numericMenu:** take array into account for empty state ([#4084](https://github.com/algolia/instantsearch.js/issues/4084)) ([2c05a01](https://github.com/algolia/instantsearch.js/commit/2c05a01))\n* **pagination:** update lifecycle state ([#3979](https://github.com/algolia/instantsearch.js/issues/3979)) ([2b08344](https://github.com/algolia/instantsearch.js/commit/2b08344))\n* **pagination:** update no refinement behavior ([#4124](https://github.com/algolia/instantsearch.js/issues/4124)) ([8d222ad](https://github.com/algolia/instantsearch.js/commit/8d222ad))\n* **range:** clear widget state on empty refinements ([#4157](https://github.com/algolia/instantsearch.js/issues/4157)) ([23cd112](https://github.com/algolia/instantsearch.js/commit/23cd112))\n* **ratingMenu:** update lifecycle state ([#3987](https://github.com/algolia/instantsearch.js/issues/3987)) ([ffadf64](https://github.com/algolia/instantsearch.js/commit/ffadf64))\n* **RefinementList:** remove root css class on sublists ([#4117](https://github.com/algolia/instantsearch.js/issues/4117)) ([ceddd42](https://github.com/algolia/instantsearch.js/commit/ceddd42)), closes [/github.com/algolia/instantsearch.js/blob/v2/src/decorators/headerFooter.js#L22](https://github.com//github.com/algolia/instantsearch.js/blob/v2/src/decorators/headerFooter.js/issues/L22)\n* **searchBox:** update lifecycle state ([#3981](https://github.com/algolia/instantsearch.js/issues/3981)) ([0ea4950](https://github.com/algolia/instantsearch.js/commit/0ea4950))\n* **sortBy:** ensure a return value for getWidgetSearchParameters ([#4126](https://github.com/algolia/instantsearch.js/issues/4126)) ([569d573](https://github.com/algolia/instantsearch.js/commit/569d573))\n* **sortBy:** read initial index name from parent index ([#4079](https://github.com/algolia/instantsearch.js/issues/4079)) ([fe23c55](https://github.com/algolia/instantsearch.js/commit/fe23c55))\n* display warnings only in development ([#4150](https://github.com/algolia/instantsearch.js/issues/4150)) ([44f69a0](https://github.com/algolia/instantsearch.js/commit/44f69a0))\n* remove useless types  ([#3958](https://github.com/algolia/instantsearch.js/issues/3958)) ([ddebf53](https://github.com/algolia/instantsearch.js/commit/ddebf53))\n* **stories:** hide Places ([#4152](https://github.com/algolia/instantsearch.js/issues/4152)) ([7ff843f](https://github.com/algolia/instantsearch.js/commit/7ff843f))\n* **toggleRefinement:** update lifecycle state ([#3993](https://github.com/algolia/instantsearch.js/issues/3993)) ([f1beff6](https://github.com/algolia/instantsearch.js/commit/f1beff6))\n* **voiceSearch:** update lifecycle state ([#3982](https://github.com/algolia/instantsearch.js/issues/3982)) ([798e3c1](https://github.com/algolia/instantsearch.js/commit/798e3c1))\n* **warnings:** remove v3 warnings ([#4134](https://github.com/algolia/instantsearch.js/issues/4134)) ([7eb6810](https://github.com/algolia/instantsearch.js/commit/7eb6810))\n\n\n### Features\n\n* **autocomplete:** leverage scoped results ([#3975](https://github.com/algolia/instantsearch.js/issues/3975)) ([8f05968](https://github.com/algolia/instantsearch.js/commit/8f05968))\n* **autocomplete:** participate in routing ([#4029](https://github.com/algolia/instantsearch.js/issues/4029)) ([a9ca0c5](https://github.com/algolia/instantsearch.js/commit/a9ca0c5))\n* **autocomplete:** provide indexId ([#4142](https://github.com/algolia/instantsearch.js/issues/4142)) ([b641e23](https://github.com/algolia/instantsearch.js/commit/b641e23))\n* **clearRefinements:** support multiple indices ([#4036](https://github.com/algolia/instantsearch.js/issues/4036)) ([3611b11](https://github.com/algolia/instantsearch.js/commit/3611b11))\n* **connectAutocomplete:** add default value on getConfiguration ([#3836](https://github.com/algolia/instantsearch.js/issues/3836)) ([724b83f](https://github.com/algolia/instantsearch.js/commit/724b83f))\n* **connectAutocomplete:** clear the state on dispose ([#3815](https://github.com/algolia/instantsearch.js/issues/3815)) ([8ae87d8](https://github.com/algolia/instantsearch.js/commit/8ae87d8))\n* **connectHierarchicalMenu:** update getWidgetSearchParameters ([#4053](https://github.com/algolia/instantsearch.js/issues/4053)) ([c99f822](https://github.com/algolia/instantsearch.js/commit/c99f822))\n* **connectHits:** clear the state on dispose ([#3816](https://github.com/algolia/instantsearch.js/issues/3816)) ([c4de730](https://github.com/algolia/instantsearch.js/commit/c4de730))\n* **connectHits:** implement getWidgetSearchParameters ([#4001](https://github.com/algolia/instantsearch.js/issues/4001)) ([c77cf66](https://github.com/algolia/instantsearch.js/commit/c77cf66))\n* **connectHitsPerPage:** clear the state on dispose ([#3818](https://github.com/algolia/instantsearch.js/issues/3818)) ([d7a5c89](https://github.com/algolia/instantsearch.js/commit/d7a5c89))\n* **connectInfiniteHits:** add default value on getConfiguration ([#3837](https://github.com/algolia/instantsearch.js/issues/3837)) ([8c65249](https://github.com/algolia/instantsearch.js/commit/8c65249))\n* **connectInfiniteHits:** clear the state on dispose ([#3819](https://github.com/algolia/instantsearch.js/issues/3819)) ([60ce151](https://github.com/algolia/instantsearch.js/commit/60ce151))\n* **connectMenu:** update getWidgetSearchParameters ([#4054](https://github.com/algolia/instantsearch.js/issues/4054)) ([7d001e7](https://github.com/algolia/instantsearch.js/commit/7d001e7))\n* **connectNumericMenu:** update state lifecycle  ([#4013](https://github.com/algolia/instantsearch.js/issues/4013)) ([2620c90](https://github.com/algolia/instantsearch.js/commit/2620c90))\n* **connectPagination:** add default value on getConfiguration ([#3838](https://github.com/algolia/instantsearch.js/issues/3838)) ([aa4602c](https://github.com/algolia/instantsearch.js/commit/aa4602c))\n* **connectPagination:** clear the state on dispose ([#3821](https://github.com/algolia/instantsearch.js/issues/3821)) ([5b8ef49](https://github.com/algolia/instantsearch.js/commit/5b8ef49))\n* **connectPagination:** update getWidgetSearchParameters ([#4004](https://github.com/algolia/instantsearch.js/issues/4004)) ([eed7e77](https://github.com/algolia/instantsearch.js/commit/eed7e77))\n* **connectRange:** default `precision` to 0 ([#3953](https://github.com/algolia/instantsearch.js/issues/3953)) ([632e06b](https://github.com/algolia/instantsearch.js/commit/632e06b))\n* **connectRatingMenu:** update getWidgetSearchParameters  ([#4008](https://github.com/algolia/instantsearch.js/issues/4008)) ([d3c96bf](https://github.com/algolia/instantsearch.js/commit/d3c96bf))\n* **connectRefinementList:** update getWidgetSearchParameters  ([#4010](https://github.com/algolia/instantsearch.js/issues/4010)) ([ddc8fc4](https://github.com/algolia/instantsearch.js/commit/ddc8fc4))\n* **connectSearchBox:** clear the state on dispose ([#3822](https://github.com/algolia/instantsearch.js/issues/3822)) ([940522c](https://github.com/algolia/instantsearch.js/commit/940522c))\n* **connectSearchBox:** mount with a default query ([#3840](https://github.com/algolia/instantsearch.js/issues/3840)) ([c3a7d69](https://github.com/algolia/instantsearch.js/commit/c3a7d69))\n* **connectSearchBox:** update getWidgetSearchParameters ([#4002](https://github.com/algolia/instantsearch.js/issues/4002)) ([5c6fcd8](https://github.com/algolia/instantsearch.js/commit/5c6fcd8))\n* **connectVoiceSearch:** add default value on getConfiguration ([#3841](https://github.com/algolia/instantsearch.js/issues/3841)) ([fb70363](https://github.com/algolia/instantsearch.js/commit/fb70363))\n* **connectVoiceSearch:** clear the state on dispose ([#3823](https://github.com/algolia/instantsearch.js/issues/3823)) ([705b3e6](https://github.com/algolia/instantsearch.js/commit/705b3e6))\n* **connectVoiceSearch:** update getWidgetSearchParameters ([#4055](https://github.com/algolia/instantsearch.js/issues/4055)) ([b8c669f](https://github.com/algolia/instantsearch.js/commit/b8c669f))\n* **core:** deprecate addWidget & removeWidget ([#4131](https://github.com/algolia/instantsearch.js/issues/4131)) ([e5dafef](https://github.com/algolia/instantsearch.js/commit/e5dafef))\n* **currentRefinements:** support multiple indices ([#4012](https://github.com/algolia/instantsearch.js/issues/4012)) ([e997728](https://github.com/algolia/instantsearch.js/commit/e997728))\n* **defer:** implement cancellable callback ([#3916](https://github.com/algolia/instantsearch.js/issues/3916)) ([43a0bf8](https://github.com/algolia/instantsearch.js/commit/43a0bf8))\n* **federated:** keep a consistent state in the RefinementList life cycle ([#3976](https://github.com/algolia/instantsearch.js/issues/3976)) ([31d0fd6](https://github.com/algolia/instantsearch.js/commit/31d0fd6))\n* **hitsPerPage:** support new routing system ([#4038](https://github.com/algolia/instantsearch.js/issues/4038)) ([02502cb](https://github.com/algolia/instantsearch.js/commit/02502cb)), closes [#4069](https://github.com/algolia/instantsearch.js/issues/4069)\n* **index:** accept indexId ([#4070](https://github.com/algolia/instantsearch.js/issues/4070)) ([b74f8e3](https://github.com/algolia/instantsearch.js/commit/b74f8e3))\n* **index:** add mergeSearchParameters function ([#3917](https://github.com/algolia/instantsearch.js/issues/3917)) ([c0fe7bb](https://github.com/algolia/instantsearch.js/commit/c0fe7bb))\n* **index:** add widget ([dbbda0f](https://github.com/algolia/instantsearch.js/commit/dbbda0f)), closes [#3892](https://github.com/algolia/instantsearch.js/issues/3892) [#3893](https://github.com/algolia/instantsearch.js/issues/3893) [#3914](https://github.com/algolia/instantsearch.js/issues/3914)\n* **index:** compute local uiState ([#3997](https://github.com/algolia/instantsearch.js/issues/3997)) ([997c0f4](https://github.com/algolia/instantsearch.js/commit/997c0f4))\n* **index:** merge `ruleContexts` search parameter ([#3944](https://github.com/algolia/instantsearch.js/issues/3944)) ([e94752d](https://github.com/algolia/instantsearch.js/commit/e94752d))\n* **index:** provide scoped results to render hook ([#3964](https://github.com/algolia/instantsearch.js/issues/3964)) ([37c6aad](https://github.com/algolia/instantsearch.js/commit/37c6aad))\n* **index:** replicate searchFunction hack ([#4078](https://github.com/algolia/instantsearch.js/issues/4078)) ([1d2a816](https://github.com/algolia/instantsearch.js/commit/1d2a816)), closes [/github.com/algolia/instantsearch.js/blob/509513c0feafaad522f6f18d87a441559f4aa050/src/lib/RoutingManager.ts#L113-L130](https://github.com//github.com/algolia/instantsearch.js/blob/509513c0feafaad522f6f18d87a441559f4aa050/src/lib/RoutingManager.ts/issues/L113-L130)\n* **index:** reset page of child indexes ([#3962](https://github.com/algolia/instantsearch.js/issues/3962)) ([131b1ce](https://github.com/algolia/instantsearch.js/commit/131b1ce))\n* **index:** resolve parent SearchParameters ([#3937](https://github.com/algolia/instantsearch.js/issues/3937)) ([2611da5](https://github.com/algolia/instantsearch.js/commit/2611da5))\n* **index:** use uiState driven SearchParameters ([#4059](https://github.com/algolia/instantsearch.js/issues/4059)) ([b12bb9f](https://github.com/algolia/instantsearch.js/commit/b12bb9f))\n* **infiniteHits:** support new routing system ([#4040](https://github.com/algolia/instantsearch.js/issues/4040)) ([49315cf](https://github.com/algolia/instantsearch.js/commit/49315cf))\n* **instantsearch:** add onStateChange method ([#4080](https://github.com/algolia/instantsearch.js/issues/4080)) ([9f68da5](https://github.com/algolia/instantsearch.js/commit/9f68da5))\n* **InstantSearch:** switch to DerivedHelper only ([#3885](https://github.com/algolia/instantsearch.js/issues/3885)) ([d6fc317](https://github.com/algolia/instantsearch.js/commit/d6fc317))\n* **places:** add Places widget ([#4167](https://github.com/algolia/instantsearch.js/issues/4167)) ([1d754d1](https://github.com/algolia/instantsearch.js/commit/1d754d1))\n* drop support of searchParameters for initialUiState ([#4081](https://github.com/algolia/instantsearch.js/issues/4081)) ([571efeb](https://github.com/algolia/instantsearch.js/commit/571efeb))\n* **range:** support new routing system ([#4039](https://github.com/algolia/instantsearch.js/issues/4039)) ([8cba05a](https://github.com/algolia/instantsearch.js/commit/8cba05a))\n* **routing:** add a \"single index\" compatibility mode ([#4087](https://github.com/algolia/instantsearch.js/issues/4087)) ([842eb0f](https://github.com/algolia/instantsearch.js/commit/842eb0f))\n* **RoutingManager:** update state on route update ([#4100](https://github.com/algolia/instantsearch.js/issues/4100)) ([88f2615](https://github.com/algolia/instantsearch.js/commit/88f2615))\n* **toggleRefinement:** support new routing system ([#4037](https://github.com/algolia/instantsearch.js/issues/4037)) ([6a9d99f](https://github.com/algolia/instantsearch.js/commit/6a9d99f))\n* **types:** DerivedHelper ([#3887](https://github.com/algolia/instantsearch.js/issues/3887)) ([0f38b4a](https://github.com/algolia/instantsearch.js/commit/0f38b4a))\n* **types:** rename RenderOptions -> RendererOptions ([#3867](https://github.com/algolia/instantsearch.js/issues/3867)) ([05c6f72](https://github.com/algolia/instantsearch.js/commit/05c6f72))\n* **utils:** implement defer ([#3882](https://github.com/algolia/instantsearch.js/issues/3882)) ([8af470e](https://github.com/algolia/instantsearch.js/commit/8af470e))\n* **voice:** add additional query parameters ([#3738](https://github.com/algolia/instantsearch.js/issues/3738)) ([c555255](https://github.com/algolia/instantsearch.js/commit/c555255))\n* drop suppot for onHistoryChange ([#3941](https://github.com/algolia/instantsearch.js/issues/3941)) ([697f609](https://github.com/algolia/instantsearch.js/commit/697f609))\n* introduce initialUiState option ([#4074](https://github.com/algolia/instantsearch.js/issues/4074)) ([de00707](https://github.com/algolia/instantsearch.js/commit/de00707))\n* update UiState definition ([#4075](https://github.com/algolia/instantsearch.js/issues/4075)) ([9e7d3d8](https://github.com/algolia/instantsearch.js/commit/9e7d3d8))\n* **widgets:** add `$$type` to widgets definition ([#3960](https://github.com/algolia/instantsearch.js/issues/3960)) ([344d1b7](https://github.com/algolia/instantsearch.js/commit/344d1b7))\n\n\n\n# [3.7.0](https://github.com/algolia/instantsearch.js/compare/v3.5.4...v3.7.0) (2019-10-08)\n\n\n### Bug Fixes\n\n* **clearRefinements:** reset page to 0 ([#3936](https://github.com/algolia/instantsearch.js/issues/3936)) ([7378a0a](https://github.com/algolia/instantsearch.js/commit/7378a0a))\n* **connectSortBy:** never update the initial index ([#4015](https://github.com/algolia/instantsearch.js/issues/4015)) ([bc0f9e2](https://github.com/algolia/instantsearch.js/commit/bc0f9e2))\n* **deps:** update dependency instantsearch.js to v3.5.4 ([#3929](https://github.com/algolia/instantsearch.js/issues/3929)) ([eff84c5](https://github.com/algolia/instantsearch.js/commit/eff84c5))\n* **deps:** update dependency instantsearch.js to v3.6.0 ([#4021](https://github.com/algolia/instantsearch.js/issues/4021)) ([7719bba](https://github.com/algolia/instantsearch.js/commit/7719bba))\n* **enhanceConfiguration:** deduplicate the hierarchicalFacets ([#3966](https://github.com/algolia/instantsearch.js/issues/3966)) ([baf8a35](https://github.com/algolia/instantsearch.js/commit/baf8a35))\n* **examples:** fix IE11 compatibility for e-commerce demo ([#4049](https://github.com/algolia/instantsearch.js/issues/4049)) ([dc6f350](https://github.com/algolia/instantsearch.js/commit/dc6f350))\n* **examples:** fix missing polyfill in e-commerce demo ([#4076](https://github.com/algolia/instantsearch.js/issues/4076)) ([4bf3ab3](https://github.com/algolia/instantsearch.js/commit/4bf3ab3))\n* **hierarchicalFacets:** prevent different rootPath on same attribute ([#3965](https://github.com/algolia/instantsearch.js/issues/3965)) ([5ee79fa](https://github.com/algolia/instantsearch.js/commit/5ee79fa))\n* **instantsearch:** warn deprecated usage of `searchParameters` ([#4151](https://github.com/algolia/instantsearch.js/issues/4151)) ([18e1c36](https://github.com/algolia/instantsearch.js/commit/18e1c36))\n* **menuSelect:** unmount component ([#3911](https://github.com/algolia/instantsearch.js/issues/3911)) ([f6debce](https://github.com/algolia/instantsearch.js/commit/f6debce))\n* **rangeInput:** unmount component ([#3910](https://github.com/algolia/instantsearch.js/issues/3910)) ([f6c29e8](https://github.com/algolia/instantsearch.js/commit/f6c29e8))\n* **refinementList:** fix showMore button to work after search ([#3082](https://github.com/algolia/instantsearch.js/issues/3082)) ([23e46b6](https://github.com/algolia/instantsearch.js/commit/23e46b6))\n* pass noop as default value to unmountFn at connectors ([#3955](https://github.com/algolia/instantsearch.js/issues/3955)) ([7c38744](https://github.com/algolia/instantsearch.js/commit/7c38744))\n\n\n\n# [3.6.0](https://github.com/algolia/instantsearch.js/compare/v3.5.4...v3.6.0) (2019-07-30)\n\n\n### Bug Fixes\n\n* **clearRefinements:** reset page to 0 ([#3936](https://github.com/algolia/instantsearch.js/issues/3936)) ([7378a0a](https://github.com/algolia/instantsearch.js/commit/7378a0a))\n* pass noop as default value to unmountFn at connectors ([#3955](https://github.com/algolia/instantsearch.js/issues/3955)) ([7c38744](https://github.com/algolia/instantsearch.js/commit/7c38744))\n* **enhanceConfiguration:** deduplicate the hierarchicalFacets ([#3966](https://github.com/algolia/instantsearch.js/issues/3966)) ([baf8a35](https://github.com/algolia/instantsearch.js/commit/baf8a35))\n* **hierarchicalFacets:** prevent different rootPath on same attribute ([#3965](https://github.com/algolia/instantsearch.js/issues/3965)) ([5ee79fa](https://github.com/algolia/instantsearch.js/commit/5ee79fa))\n* **menuSelect:** unmount component ([#3911](https://github.com/algolia/instantsearch.js/issues/3911)) ([f6debce](https://github.com/algolia/instantsearch.js/commit/f6debce))\n* **rangeInput:** unmount component ([#3910](https://github.com/algolia/instantsearch.js/issues/3910)) ([f6c29e8](https://github.com/algolia/instantsearch.js/commit/f6c29e8))\n* **refinementList:** fix showMore button to work after search ([#3082](https://github.com/algolia/instantsearch.js/issues/3082)) ([23e46b6](https://github.com/algolia/instantsearch.js/commit/23e46b6))\n\n\n\n## [3.5.4](https://github.com/algolia/instantsearch.js/compare/v3.5.3...v3.5.4) (2019-07-01)\n\n\n### Bug Fixes\n\n* **connectSortBy:** do not throw with wrong indexes ([#3824](https://github.com/algolia/instantsearch.js/issues/3824)) ([2a84ee2](https://github.com/algolia/instantsearch.js/commit/2a84ee2))\n* **deps:** update dependency instantsearch.js to v3.5.3 ([#3877](https://github.com/algolia/instantsearch.js/issues/3877)) ([463f3bb](https://github.com/algolia/instantsearch.js/commit/463f3bb))\n* **escape:** make sure that __escaped does not get removed ([#3830](https://github.com/algolia/instantsearch.js/issues/3830)) ([fbafd22](https://github.com/algolia/instantsearch.js/commit/fbafd22))\n* **getRefinements:** check for facet before accessing its data ([#3842](https://github.com/algolia/instantsearch.js/issues/3842)) ([aadc769](https://github.com/algolia/instantsearch.js/commit/aadc769))\n* **panel:** return value from dispose ([#3895](https://github.com/algolia/instantsearch.js/issues/3895)) ([bceb78f](https://github.com/algolia/instantsearch.js/commit/bceb78f))\n* **voiceSearch:** remove event listeners on stop ([#3845](https://github.com/algolia/instantsearch.js/issues/3845)) ([688e36a](https://github.com/algolia/instantsearch.js/commit/688e36a))\n\n\n\n## [3.5.3](https://github.com/algolia/instantsearch.js/compare/v3.5.1...v3.5.3) (2019-05-28)\n\n\n### Bug Fixes\n\n* **voiceSearch:** let the connector handle the default value of searchAsYouSpeak when it's not given ([#3817](https://github.com/algolia/instantsearch.js/issues/3817)) ([9d3e91b](https://github.com/algolia/instantsearch.js/commit/9d3e91b))\n* **getTag:** use object version of toString ([#3820](https://github.com/algolia/instantsearch.js/issues/3820)) ([a7348ea](https://github.com/algolia/instantsearch.js/commit/a7348ea))\n* **types:** fix cssClasses of voiceSearch ([#3783](https://github.com/algolia/instantsearch.js/issues/3783)) ([f016326](https://github.com/algolia/instantsearch.js/commit/f016326))\n\n\n\n# [3.5.1](https://github.com/algolia/instantsearch.js/compare/v3.4.0...v3.5.1) (2019-05-20)\n\n\n### Bug Fixes\n\n* **types:** improve types for voiceSearch ([#3778](https://github.com/algolia/instantsearch.js/issues/3778)) ([ed2d61a](https://github.com/algolia/instantsearch.js/commit/ed2d61a))\n* **types:** update UiState type ([#3777](https://github.com/algolia/instantsearch.js/issues/3777)) ([36e3a3d](https://github.com/algolia/instantsearch.js/commit/36e3a3d))\n* **voiceSearch:** remove event listeners on dispose ([#3779](https://github.com/algolia/instantsearch.js/issues/3779)) ([0e988cc](https://github.com/algolia/instantsearch.js/commit/0e988cc))\n* **hitsPerPage:** improve warning for missing state value ([#3707](https://github.com/algolia/instantsearch.js/issues/3707)) ([93d8432](https://github.com/algolia/instantsearch.js/commit/93d8432))\n* **numericMenu:** prevent refinement reset on checked radio click ([#3749](https://github.com/algolia/instantsearch.js/issues/3749)) ([e4a6e75](https://github.com/algolia/instantsearch.js/commit/e4a6e75))\n* **rangeSlider:** round the slider pit value ([#3758](https://github.com/algolia/instantsearch.js/issues/3758)) ([6edee3e](https://github.com/algolia/instantsearch.js/commit/6edee3e)), closes [#2904](https://github.com/algolia/instantsearch.js/issues/2904)\n* **types:** improve UiState types ([#3763](https://github.com/algolia/instantsearch.js/issues/3763)) ([e8ea57b](https://github.com/algolia/instantsearch.js/commit/e8ea57b))\n* **voice:** import correct noop ([#3766](https://github.com/algolia/instantsearch.js/issues/3766)) ([6a80422](https://github.com/algolia/instantsearch.js/commit/6a80422))\n\n\n### Features\n\n* **voiceSearch:** add connector and widget ([#3601](https://github.com/algolia/instantsearch.js/issues/3601)) ([21e4d81](https://github.com/algolia/instantsearch.js/commit/21e4d81))\n\n\n### Reverts\n\n* chore(build): remove PropTypes from builds ([#3697](https://github.com/algolia/instantsearch.js/issues/3697)) ([#3776](https://github.com/algolia/instantsearch.js/issues/3776)) ([1e6be79](https://github.com/algolia/instantsearch.js/commit/1e6be79))\n\n\n# [3.4.0](https://github.com/algolia/instantsearch.js/compare/v3.3.0...v3.4.0) (2019-04-17)\n\n\n### Bug Fixes\n\n* **storybook:** fix Hierarchical menu separator in Breadcrumb story ([#3695](https://github.com/algolia/instantsearch.js/issues/3695)) ([b3bf8ac](https://github.com/algolia/instantsearch.js/commit/b3bf8ac))\n* **tools:** use commonjs in bump-package-version.js ([#3699](https://github.com/algolia/instantsearch.js/issues/3699)) ([6a6dbe1](https://github.com/algolia/instantsearch.js/commit/6a6dbe1))\n* **types:** fix wrong typing in getWidgetState ([#3693](https://github.com/algolia/instantsearch.js/issues/3693)) ([b3c2154](https://github.com/algolia/instantsearch.js/commit/b3c2154))\n* **types:** remove unused Without type ([#3694](https://github.com/algolia/instantsearch.js/issues/3694)) ([656d000](https://github.com/algolia/instantsearch.js/commit/656d000))\n\n\n### Features\n\n* **infiniteHits:** add previous button ([#3675](https://github.com/algolia/instantsearch.js/issues/3675)) ([2e6137b](https://github.com/algolia/instantsearch.js/commit/2e6137b))\n* **Insights:** Insights inside Instantsearch ([#3598](https://github.com/algolia/instantsearch.js/issues/3598)) ([387f41f](https://github.com/algolia/instantsearch.js/commit/387f41f))\n\n\n\n# [3.3.0](https://github.com/algolia/instantsearch.js/compare/v3.2.1...v3.3.0) (2019-04-11)\n\n\n### Bug Fixes\n\n* **connectQueryRules:** improve tracked refinement type ([#3648](https://github.com/algolia/instantsearch.js/issues/3648)) ([e16ad57](https://github.com/algolia/instantsearch.js/commit/e16ad57))\n* **currentRefinements:** don't rely on `_objectSpread` ([#3672](https://github.com/algolia/instantsearch.js/issues/3672)) ([cd64bcf](https://github.com/algolia/instantsearch.js/commit/cd64bcf))\n* **queryRuleCustomData:** add default template ([#3650](https://github.com/algolia/instantsearch.js/issues/3650)) ([83e9eaa](https://github.com/algolia/instantsearch.js/commit/83e9eaa))\n* **QueryRuleCustomData:** pass data as object to templates ([#3647](https://github.com/algolia/instantsearch.js/issues/3647)) ([b8f8b4e](https://github.com/algolia/instantsearch.js/commit/b8f8b4e))\n* **queryRules:** fix types and stories ([#3670](https://github.com/algolia/instantsearch.js/issues/3670)) ([ba6e2e6](https://github.com/algolia/instantsearch.js/commit/ba6e2e6))\n* **routing:** apply windowTitle on first load ([#3669](https://github.com/algolia/instantsearch.js/issues/3669)) ([d553502](https://github.com/algolia/instantsearch.js/commit/d553502)), closes [#3667](https://github.com/algolia/instantsearch.js/issues/3667)\n* **routing:** support parsing URLs with up to 100 refinements ([#3671](https://github.com/algolia/instantsearch.js/issues/3671)) ([6ddcfb6](https://github.com/algolia/instantsearch.js/commit/6ddcfb6))\n* **RoutingManager:** avoid stale uiState ([#3630](https://github.com/algolia/instantsearch.js/issues/3630)) ([e1588aa](https://github.com/algolia/instantsearch.js/commit/e1588aa))\n* **types:** improve InstantSearch types ([#3651](https://github.com/algolia/instantsearch.js/issues/3651)) ([db9b91e](https://github.com/algolia/instantsearch.js/commit/db9b91e))\n* **ua:** Update the User-Agent to use the new format ([#3616](https://github.com/algolia/instantsearch.js/issues/3616)) ([ab84c57](https://github.com/algolia/instantsearch.js/commit/ab84c57))\n\n\n### Features\n\n* **infiniteHits:** add previous button ([#3645](https://github.com/algolia/instantsearch.js/issues/3645)) ([2c9e38d](https://github.com/algolia/instantsearch.js/commit/2c9e38d))\n* **queryRules:** add connectQueryRules connector ([#3597](https://github.com/algolia/instantsearch.js/issues/3597)) ([924cd99](https://github.com/algolia/instantsearch.js/commit/924cd99)), closes [#3599](https://github.com/algolia/instantsearch.js/issues/3599) [#3600](https://github.com/algolia/instantsearch.js/issues/3600)\n* **queryRules:** add context features to Query Rules ([#3617](https://github.com/algolia/instantsearch.js/issues/3617)) ([922879e](https://github.com/algolia/instantsearch.js/commit/922879e)), closes [#3602](https://github.com/algolia/instantsearch.js/issues/3602)\n\n\n### Reverts\n\n* feat(infiniteHits): add previous button ([214c0fc](https://github.com/algolia/instantsearch.js/commit/214c0fc))\n\n\n\n## [3.2.1](https://github.com/algolia/instantsearch.js/compare/v3.1.0...v3.2.1) (2019-03-18)\n\n\n### Bug Fixes\n\n* **connectToggleRefinement:** keep user provided, but falsy values ([#3526](https://github.com/algolia/instantsearch.js/issues/3526)) ([958a151](https://github.com/algolia/instantsearch.js/commit/958a151))\n* **instantsearch:** update usage errors ([#3543](https://github.com/algolia/instantsearch.js/issues/3543)) ([a2a800b](https://github.com/algolia/instantsearch.js/commit/a2a800b))\n* **panel:** append panel body as a child element ([#3561](https://github.com/algolia/instantsearch.js/issues/3561)) ([3de59a3](https://github.com/algolia/instantsearch.js/commit/3de59a3))\n* **poweredBy:** remove TypeScript extension in import ([#3530](https://github.com/algolia/instantsearch.js/issues/3530)) ([99ecc0b](https://github.com/algolia/instantsearch.js/commit/99ecc0b)), closes [#3528](https://github.com/algolia/instantsearch.js/issues/3528)\n* **release:** update doctoc script ([e07c654](https://github.com/algolia/instantsearch.js/commit/e07c654))\n* **searchbox:** unmount component on dispose ([#3563](https://github.com/algolia/instantsearch.js/issues/3563)) ([c3f0435](https://github.com/algolia/instantsearch.js/commit/c3f0435))\n* **searchBox:** add reusable SearchBox component ([#3489](https://github.com/algolia/instantsearch.js/issues/3489)) ([c073a9a](https://github.com/algolia/instantsearch.js/commit/c073a9a))\n\n\n### Features\n\n* **panel:** implement collapsed feature ([#3575](https://github.com/algolia/instantsearch.js/issues/3575)) ([e84b02b](https://github.com/algolia/instantsearch.js/commit/e84b02b))\n\n\n\n# [3.2.0](https://github.com/algolia/instantsearch.js/compare/v3.1.0...v3.2.0) (2019-03-14)\n\n\n### Bug Fixes\n\n* **instantsearch:** update usage errors ([#3543](https://github.com/algolia/instantsearch.js/issues/3543)) ([a2a800b](https://github.com/algolia/instantsearch.js/commit/a2a800b))\n* **searchBox:** add reusable SearchBox component ([#3489](https://github.com/algolia/instantsearch.js/issues/3489)) ([c073a9a](https://github.com/algolia/instantsearch.js/commit/c073a9a))\n\n\n### Features\n\n* **panel:** implement collapsed feature ([#3575](https://github.com/algolia/instantsearch.js/issues/3575)) ([e84b02b](https://github.com/algolia/instantsearch.js/commit/e84b02b))\n\n\n\n<a name=\"3.1.1\"></a>\n## [3.1.1](https://github.com/algolia/instantsearch.js/compare/v3.1.0...v3.1.1) (2019-02-14)\n\n\n### Bug Fixes\n\n* **connectToggleRefinement:** keep user provided, but falsy values ([#3526](https://github.com/algolia/instantsearch.js/issues/3526)) ([958a151](https://github.com/algolia/instantsearch.js/commit/958a151))\n* **poweredBy:** remove TypeScript extension in import ([#3530](https://github.com/algolia/instantsearch.js/issues/3530)) ([99ecc0b](https://github.com/algolia/instantsearch.js/commit/99ecc0b)), closes [#3528](https://github.com/algolia/instantsearch.js/issues/3528)\n* **release:** update doctoc script ([e07c654](https://github.com/algolia/instantsearch.js/commit/e07c654))\n\n\n\n<a name=\"3.1.0\"></a>\n## [3.1.0](https://github.com/algolia/instantsearch.js/compare/v3.0.0...v3.1.0) (2019-02-13)\n\n### Features\n\n* **connectCurrentRefinements**: add a root label ([#3515](https://github.com/algolia/instantsearch.js/pull/3515)) ([b8f774f](https://github.com/algolia/instantsearch.js/commit/b8f774f))\n* Update error messages ([#3516](https://github.com/algolia/instantsearch.js/pull/3516))\n* **InstantSearch**: remove event listeners on dispose ([#3420](https://github.com/algolia/instantsearch.js/pull/3420))\n* **InstantSearch**: set helper to `null` on dispose ([#3415](https://github.com/algolia/instantsearch.js/pull/3415))\n* **utils**: warn only in development ([#3367](https://github.com/algolia/instantsearch.js/pull/3367))\n\n### Bug Fixes\n\n* **InstantSearch**: set helper to `null` on dispose ([#3415](https://github.com/algolia/instantsearch.js/pull/3415))\n* **utils**: warn only in development ([#3367](https://github.com/algolia/instantsearch.js/pull/3367))\n\n<a name=\"3.0.0\"></a>\n## [3.0.0](https://github.com/algolia/instantsearch.js/compare/v2.10.3...v3.0.0) (2018-12-20)\n\nCheck the [migration guide](https://github.com/algolia/instantsearch.js/blob/879aa20d3c1e2fe906bc526b05c57f6847c433be/docgen/src/guides/v3-migration.md).\n\n<a name=\"2.10.4\"></a>\n## [2.10.4](https://github.com/algolia/instantsearch.js/compare/v2.10.3...v2.10.4) (2018-10-30)\n\n\n### Bug Fixes\n\n* **getRefinements:** provide attributeName for type: query ([6a58b99](https://github.com/algolia/instantsearch.js/commit/6a58b99)), closes [#3205](https://github.com/algolia/instantsearch.js/issues/3205)\n\n\n<a name=\"2.10.3\"></a>\n## [2.10.3](https://github.com/algolia/instantsearch.js/compare/v2.10.2...v2.10.3) (2018-10-29)\n\n\n### Bug Fixes\n\n* **deps:** unpin production dependencies ([257ecb7](https://github.com/algolia/instantsearch.js/commit/257ecb7))\n* **InstantSearch:** avoid useless search on addWidgets ([#3178](https://github.com/algolia/instantsearch.js/issues/3178)) ([961626d](https://github.com/algolia/instantsearch.js/commit/961626d))\n* **numericselector:** default value can be undefined ([#3139](https://github.com/algolia/instantsearch.js/issues/3139)) ([39d22f5](https://github.com/algolia/instantsearch.js/commit/39d22f5))\n\n\n### Features\n\n* **utils:** add warn function ([#3147](https://github.com/algolia/instantsearch.js/issues/3147)) ([9de87bb](https://github.com/algolia/instantsearch.js/commit/9de87bb))\n\n\n\n<a name=\"2.10.2\"></a>\n## [2.10.2](https://github.com/algolia/instantsearch.js/compare/v2.10.1...v2.10.2) (2018-09-10)\n\n\n### Bug Fixes\n\n* **searchbox:** Add missing color to searchbox input field ([#3086](https://github.com/algolia/instantsearch.js/issues/3086)) ([62b852a](https://github.com/algolia/instantsearch.js/commit/62b852a)), closes [#3075](https://github.com/algolia/instantsearch.js/issues/3075)\n* **Stats:** let the widget render on all values ([#3070](https://github.com/algolia/instantsearch.js/issues/3070)) ([cd8f17e](https://github.com/algolia/instantsearch.js/commit/cd8f17e)), closes [#3056](https://github.com/algolia/instantsearch.js/issues/3056)\n\n\n\n<a name=\"2.10.1\"></a>\n## [2.10.1](https://github.com/algolia/instantsearch.js/compare/v2.10.0...v2.10.1) (2018-08-17)\n\n\n### Bug Fixes\n\n* **connectBreadcrumb:** ensure that data is an array ([#3067](https://github.com/algolia/instantsearch.js/issues/3067)) ([759f709](https://github.com/algolia/instantsearch.js/commit/759f709))\n\n\n\n<a name=\"2.10.0\"></a>\n# [2.10.0](https://github.com/algolia/instantsearch.js/compare/v2.9.0...v2.10.0) (2018-08-08)\n\n\n### Bug Fixes\n\n* **release:** provide interactive TTY for npm publish ([#3053](https://github.com/algolia/instantsearch.js/issues/3053)) ([ede9460](https://github.com/algolia/instantsearch.js/commit/ede9460))\n\n\n### Features\n\n* Implement `transformItems` API ([#3042](https://github.com/algolia/instantsearch.js/issues/3042)) ([1510a94](https://github.com/algolia/instantsearch.js/commit/1510a94))\n\n\n\n<a name=\"2.9.0\"></a>\n# [2.9.0](https://github.com/algolia/instantsearch.js/compare/v2.8.1...v2.9.0) (2018-07-18)\n\n\n### Features\n\n* **infiniteHits:** add showmoreButton to cssClasses ([#3026](https://github.com/algolia/instantsearch.js/issues/3026)) ([8287de0](https://github.com/algolia/instantsearch.js/commit/8287de0))\n\n\n\n<a name=\"2.8.1\"></a>\n## [2.8.1](https://github.com/algolia/instantsearch.js/compare/v2.8.0...v2.8.1) (2018-07-03)\n\n\n### Bug Fixes\n\n* **connectHitsPerPage:** default value should not break the API  ([#3006](https://github.com/algolia/instantsearch.js/issues/3006)) ([6635304](https://github.com/algolia/instantsearch.js/commit/6635304)), closes [#2732](https://github.com/algolia/instantsearch.js/issues/2732)\n* **connectRefinementList:** throw error with usage ([#2962](https://github.com/algolia/instantsearch.js/issues/2962)) ([f60222d](https://github.com/algolia/instantsearch.js/commit/f60222d))\n* **sourcemap:** provide good url ([#3011](https://github.com/algolia/instantsearch.js/issues/3011)) ([9632ade](https://github.com/algolia/instantsearch.js/commit/9632ade))\n* **warning:** make sure suggested import is possible ([#3014](https://github.com/algolia/instantsearch.js/issues/3014)) ([eb27152](https://github.com/algolia/instantsearch.js/commit/eb27152))\n\n\n\n<a name=\"2.8.0\"></a>\n# [2.8.0](https://github.com/algolia/instantsearch.js/compare/v2.7.6...v2.8.0) (2018-05-30)\n\n\n### Features\n\n* **connectors:** add connectAutocomplete ([#2841](https://github.com/algolia/instantsearch.js/issues/2841)) ([4bec81e](https://github.com/algolia/instantsearch.js/commit/4bec81e)), closes [/github.com/algolia/instantsearch.js/pull/2841#discussion_r188383882](https://github.com//github.com/algolia/instantsearch.js/pull/2841/issues/discussion_r188383882) [#2313](https://github.com/algolia/instantsearch.js/issues/2313)\n* **search-client:** Add support for Universal Search Clients ([#2894](https://github.com/algolia/instantsearch.js/issues/2894)) ([5df3c74](https://github.com/algolia/instantsearch.js/commit/5df3c74)), closes [#2905](https://github.com/algolia/instantsearch.js/issues/2905)\n\n\n\n<a name=\"2.7.6\"></a>\n## [2.7.6](https://github.com/algolia/instantsearch.js/compare/v2.7.5...v2.7.6) (2018-05-29)\n\n\n### Bug Fixes\n\n* **connectConfigure:** ensure we do not extend `SearchParameters` ([#2945](https://github.com/algolia/instantsearch.js/issues/2945)) ([fdb4a7a](https://github.com/algolia/instantsearch.js/commit/fdb4a7a))\n* **infinite-hits:** fix [#2543](https://github.com/algolia/instantsearch.js/issues/2543) ([#2948](https://github.com/algolia/instantsearch.js/issues/2948)) ([bbf9f8f](https://github.com/algolia/instantsearch.js/commit/bbf9f8f))\n\n\n\n<a name=\"2.7.5\"></a>\n## [2.7.5](https://github.com/algolia/instantsearch.js/compare/v2.7.4...v2.7.5) (2018-05-28)\n\n\n### Bug Fixes\n\n* **clear-all:** apply excludeAttribute correctly with clearsQuery ([#2935](https://github.com/algolia/instantsearch.js/issues/2935)) ([e782ab8](https://github.com/algolia/instantsearch.js/commit/e782ab8))\n* **connectInfiniteHits:** fix [#2928](https://github.com/algolia/instantsearch.js/issues/2928)  ([#2939](https://github.com/algolia/instantsearch.js/issues/2939)) ([0293a31](https://github.com/algolia/instantsearch.js/commit/0293a31))\n\n\n\n<a name=\"2.7.4\"></a>\n## [2.7.4](https://github.com/algolia/instantsearch.js/compare/v2.7.3...v2.7.4) (2018-05-03)\n\n\n### Bug Fixes\n\n* **searchFunction:** Fix unresolved returned Promise ([#2913](https://github.com/algolia/instantsearch.js/issues/2913)) ([5286c7c](https://github.com/algolia/instantsearch.js/commit/5286c7c))\n\n\n\n<a name=\"2.7.3\"></a>\n## [2.7.3](https://github.com/algolia/instantsearch.js/compare/v2.7.2...v2.7.3) (2018-04-26)\n\n\n### Bug Fixes\n\n* **index.es6:** avoid use of Object.assign for IE ([#2908](https://github.com/algolia/instantsearch.js/issues/2908)) ([228b02e](https://github.com/algolia/instantsearch.js/commit/228b02e))\n\n\n\n<a name=\"2.7.2\"></a>\n## [2.7.2](https://github.com/algolia/instantsearch.js/compare/v2.7.1...v2.7.2) (2018-04-18)\n\n### Bug Fixes\n\n* **routing:** should apply stateMapping when doing initial write ([#2892](https://github.com/algolia/instantsearch.js/issues/2892)) ([7f62e6dc](https://github.com/algolia/instantsearch.js/commit/7f62e6dc))\n* **ie:** do not rely on Object.assign ([#2885](https://github.com/algolia/instantsearch.js/issues/2885)) ([88497e56](https://github.com/algolia/instantsearch.js/commit/88497e56))\n\n\n\n<a name=\"2.7.1\"></a>\n## [2.7.1](https://github.com/algolia/instantsearch.js/compare/v2.7.0...v2.7.1) (2018-04-11)\n\n\n### Bug Fixes\n\n* **history:** provide location and use named parameters ([#2877](https://github.com/algolia/instantsearch.js/issues/2877)) ([761ffa4](https://github.com/algolia/instantsearch.js/commit/761ffa4))\n\n\n\n<a name=\"2.7.0\"></a>\n# [2.7.0](https://github.com/algolia/instantsearch.js/compare/v2.6.3...v2.7.0) (2018-04-09)\n\n\n### Bug Fixes\n\n* pagination padding ([#2866](https://github.com/algolia/instantsearch.js/issues/2866)) ([e8c58cc](https://github.com/algolia/instantsearch.js/commit/e8c58cc))\n* **geosearch:** avoid reset map when it already moved ([#2870](https://github.com/algolia/instantsearch.js/issues/2870)) ([f171b8a](https://github.com/algolia/instantsearch.js/commit/f171b8a))\n* **removeWidget:** check for widgets.length on next tick ([#2831](https://github.com/algolia/instantsearch.js/issues/2831)) ([7e639d6](https://github.com/algolia/instantsearch.js/commit/7e639d6))\n\n\n### Features\n\n* **connetConfigure:** add a connector to create a connector widget ([8fdf752](https://github.com/algolia/instantsearch.js/commit/8fdf752))\n* **routing:** provide a mechanism to synchronize the search ([#2829](https://github.com/algolia/instantsearch.js/issues/2829)) ([75b2ca3](https://github.com/algolia/instantsearch.js/commit/75b2ca3)), closes [#2849](https://github.com/algolia/instantsearch.js/issues/2849) [#2849](https://github.com/algolia/instantsearch.js/issues/2849)\n* **size:** add sideEffects false to package.json ([#2861](https://github.com/algolia/instantsearch.js/issues/2861)) ([f5d1ab1](https://github.com/algolia/instantsearch.js/commit/f5d1ab1)), closes [#2859](https://github.com/algolia/instantsearch.js/issues/2859)\n\n\n\n<a name=\"2.6.3\"></a>\n## [2.6.3](https://github.com/algolia/instantsearch.js/compare/v2.6.2...v2.6.3) (2018-03-30)\n\n\n### Bug Fixes\n\n* **rangeSlider:** handles were blocked ([#2849](https://github.com/algolia/instantsearch.js/issues/2849)) ([a2af4f0](https://github.com/algolia/instantsearch.js/commit/a2af4f0))\n\n\n\n<a name=\"2.6.2\"></a>\n## [2.6.2](https://github.com/algolia/instantsearch.js/compare/v2.6.1...v2.6.2) (2018-03-29)\n\n\n### Bug Fixes\n\n* **connectGeoSearch:** correctly dispose the connector ([#2845](https://github.com/algolia/instantsearch.js/issues/2845)) ([a4eafd2](https://github.com/algolia/instantsearch.js/commit/a4eafd2))\n* **GeoSearch:** correctly unmount the widget ([#2846](https://github.com/algolia/instantsearch.js/issues/2846)) ([f31ef3c](https://github.com/algolia/instantsearch.js/commit/f31ef3c))\n\n\n\n<a name=\"2.6.1\"></a>\n## [2.6.1](https://github.com/algolia/instantsearch.js/compare/v2.6.0...v2.6.1) (2018-03-28)\n\n\n### Bug Fixes\n\n* **connectBreadcrumb:** allow unmounting ([#2815](https://github.com/algolia/instantsearch.js/issues/2815)) ([c6c353a](https://github.com/algolia/instantsearch.js/commit/c6c353a))\n* **connectBreadcrumb:** update typo in property type items ([#2782](https://github.com/algolia/instantsearch.js/issues/2782)) ([79ebd66](https://github.com/algolia/instantsearch.js/commit/79ebd66))\n* **docgen:** pass the relatedTypes to the struct mixin in connectors layout ([#2780](https://github.com/algolia/instantsearch.js/issues/2780)) ([f7f8b05](https://github.com/algolia/instantsearch.js/commit/f7f8b05))\n* **GeoSearch:** update typo in property type cssClasses ([#2781](https://github.com/algolia/instantsearch.js/issues/2781)) ([419c2ab](https://github.com/algolia/instantsearch.js/commit/419c2ab))\n* **main:** correctly import EventEmitter ([#2814](https://github.com/algolia/instantsearch.js/issues/2814)) ([8fa3649](https://github.com/algolia/instantsearch.js/commit/8fa3649)), closes [#2730](https://github.com/algolia/instantsearch.js/issues/2730)\n\n\n\n<a name=\"2.6.0\"></a>\n# [2.6.0](https://github.com/algolia/instantsearch.js/compare/v2.5.2...v2.6.0) (2018-03-06)\n\n\n### Bug Fixes\n\n* **GeoSearch:** add apiKey for Google Maps ([#2773](https://github.com/algolia/instantsearch.js/issues/2773)) ([6c1846f](https://github.com/algolia/instantsearch.js/commit/6c1846f))\n* **GeoSearch:** override button style ([#2772](https://github.com/algolia/instantsearch.js/issues/2772)) ([4d69b50](https://github.com/algolia/instantsearch.js/commit/4d69b50))\n\n\n### Features\n\n* **configure:** add the Configure widget ([#2698](https://github.com/algolia/instantsearch.js/issues/2698)) ([94daabc](https://github.com/algolia/instantsearch.js/commit/94daabc))\n* add GeoSearch widget & connector ([#2743](https://github.com/algolia/instantsearch.js/issues/2743)) ([7fa17ff](https://github.com/algolia/instantsearch.js/commit/7fa17ff))\n\n\n\n<a name=\"2.5.2\"></a>\n## [2.5.2](https://github.com/algolia/instantsearch.js/compare/v2.5.1...v2.5.2) (2018-02-26)\n\n\n### Bug Fixes\n\n* **Template:** harden Symbol checks ([#2749](https://github.com/algolia/instantsearch.js/issues/2749)) ([fab66bc](https://github.com/algolia/instantsearch.js/commit/fab66bc))\n* **yarnrc:** use empty string for save-prefix ([#2739](https://github.com/algolia/instantsearch.js/issues/2739)) ([979e0cd](https://github.com/algolia/instantsearch.js/commit/979e0cd))\n\n\n\n<a name=\"2.5.1\"></a>\n## [2.5.1](https://github.com/algolia/instantsearch.js/compare/v2.5.0...v2.5.1) (2018-02-13)\n\n\n### Bug Fixes\n\n* **perf:** only compute snappoints when step is provided ([#2699](https://github.com/algolia/instantsearch.js/issues/2699)) ([ce9ca19](https://github.com/algolia/instantsearch.js/commit/ce9ca19)), closes [#2662](https://github.com/algolia/instantsearch.js/issues/2662)\n\n\n\n<a name=\"2.5.0\"></a>\n# [2.5.0](https://github.com/algolia/instantsearch.js/compare/v2.4.1...v2.5.0) (2018-02-06)\n\n\n### Bug Fixes\n\n* **doc:** add maximum width to images (fix [#2685](https://github.com/algolia/instantsearch.js/issues/2685)) ([#2686](https://github.com/algolia/instantsearch.js/issues/2686)) ([f4b5377](https://github.com/algolia/instantsearch.js/commit/f4b5377))\n\n\n### Features\n\n* support for algolia insights ([#2689](https://github.com/algolia/instantsearch.js/issues/2689)) ([96b8d61](https://github.com/algolia/instantsearch.js/commit/96b8d61))\n\n\n\n<a name=\"2.4.1\"></a>\n## [2.4.1](https://github.com/algolia/instantsearch.js/compare/v2.4.0...v2.4.1) (2018-01-04)\n\n\n### Bug Fixes\n\n* **core:** correct escape highlight for arrays and nested objects ([#2646](https://github.com/algolia/instantsearch.js/issues/2646)) ([ed0ee73](https://github.com/algolia/instantsearch.js/commit/ed0ee73))\n\n\n\n<a name=\"2.4.0\"></a>\n# [2.4.0](https://github.com/algolia/instantsearch.js/compare/v2.3.3...v2.4.0) (2018-01-02)\n\n\n### Bug Fixes\n\n* **pagination:** disable buttons if not results ([#2643](https://github.com/algolia/instantsearch.js/issues/2643)) ([9017b72](https://github.com/algolia/instantsearch.js/commit/9017b72)), closes [#2014](https://github.com/algolia/instantsearch.js/issues/2014)\n* **theme:** fix height of pagination ([#2641](https://github.com/algolia/instantsearch.js/issues/2641)) ([b3185e5](https://github.com/algolia/instantsearch.js/commit/b3185e5))\n\n\n### Features\n\n* **core:** add a reload method on the InstantSearch component ([#2637](https://github.com/algolia/instantsearch.js/issues/2637)) ([e73ff13](https://github.com/algolia/instantsearch.js/commit/e73ff13))\n* **core:** add an error event to monitor error from Algolia ([#2642](https://github.com/algolia/instantsearch.js/issues/2642)) ([71c2d68](https://github.com/algolia/instantsearch.js/commit/71c2d68)), closes [#1585](https://github.com/algolia/instantsearch.js/issues/1585)\n* **core:** rename `reload` to `refresh` ([#2645](https://github.com/algolia/instantsearch.js/issues/2645)) ([9b8ac65](https://github.com/algolia/instantsearch.js/commit/9b8ac65))\n* **wrapWithHits:** enable async init ([#2635](https://github.com/algolia/instantsearch.js/issues/2635)) ([08a8747](https://github.com/algolia/instantsearch.js/commit/08a8747))\n\n\n\n<a name=\"2.3.3\"></a>\n## [2.3.3](https://github.com/algolia/instantsearch.js/compare/v2.3.2...v2.3.3) (2017-12-11)\n\n\n### Bug Fixes\n\n* **core:** search is stalled at init ([#2623](https://github.com/algolia/instantsearch.js/issues/2623)) ([e3dd577](https://github.com/algolia/instantsearch.js/commit/e3dd577)), closes [#2616](https://github.com/algolia/instantsearch.js/issues/2616)\n\n\n\n<a name=\"2.3.2\"></a>\n## [2.3.2](https://github.com/algolia/instantsearch.js/compare/v2.3.1...v2.3.2) (2017-12-06)\n\n\n### Bug Fixes\n\n* React reference: Breadcrumb & RangeInput components ([#2618](https://github.com/algolia/instantsearch.js/issues/2618)) ([7f32161](https://github.com/algolia/instantsearch.js/commit/7f32161))\n\n\n\n<a name=\"2.3.1\"></a>\n## [2.3.1](https://github.com/algolia/instantsearch.js/compare/v2.3.0...v2.3.1) (2017-12-04)\n\n\n### Bug Fixes\n\n* **connectors:** check facet is refined before removing it. hierarchicalMenu / menu ([67ae035](https://github.com/algolia/instantsearch.js/commit/67ae035))\n* **poweredBy:** minify slightly and make into correct URL ([#2615](https://github.com/algolia/instantsearch.js/issues/2615)) ([2b7d747](https://github.com/algolia/instantsearch.js/commit/2b7d747)), closes [#2613](https://github.com/algolia/instantsearch.js/issues/2613)\n\n\n\n<a name=\"2.3.0\"></a>\n# [2.3.0](https://github.com/algolia/instantsearch.js/compare/v2.3.0-beta.7...v2.3.0) (2017-11-30)\n\n\n### Bug Fixes\n\n* **InstantSearch.dispose:** dont call `getConfiguration` of URLSync widget ([#2604](https://github.com/algolia/instantsearch.js/issues/2604)) ([3234b12](https://github.com/algolia/instantsearch.js/commit/3234b12))\n* **connectors:** prefer wrappers over bind ([#2575](https://github.com/algolia/instantsearch.js/issues/2575)) ([f8e0e00](https://github.com/algolia/instantsearch.js/commit/f8e0e00))\n* **connectHierarchicalMenu:** do not return if facet not set ([#2521](https://github.com/algolia/instantsearch.js/issues/2521)) ([26e99fb](https://github.com/algolia/instantsearch.js/commit/26e99fb))\n\n\n\n### Features\n\n* **core:** provide information about stalled search to widgets ([#2569](https://github.com/algolia/instantsearch.js/issues/2569)) ([d104be1](https://github.com/algolia/instantsearch.js/commit/d104be1))\n* **core:** InstantSearch hot remove/add widgets ([#2384](https://github.com/algolia/instantsearch.js/issues/2384)) ([cfc1710](https://github.com/algolia/instantsearch.js/commit/cfc1710))\n* **refinementList:** add escapeFacetHits parameter ([#2507](https://github.com/algolia/instantsearch.js/issues/2507)) ([9b1b7ee](https://github.com/algolia/instantsearch.js/commit/9b1b7ee))\n* **breadcrumb:** Add the breadcrumb widget ([#2451](https://github.com/algolia/instantsearch.js/issues/2451)) ([11d78f0](https://github.com/algolia/instantsearch.js/commit/11d78f0)), closes [#2299](https://github.com/algolia/instantsearch.js/issues/2299)\n* **connectRange:** round the range based on precision ([#2498](https://github.com/algolia/instantsearch.js/issues/2498)) ([d4df45d](https://github.com/algolia/instantsearch.js/commit/d4df45d))\n* **rangeInput:** add rangeInput widget ([#2440](https://github.com/algolia/instantsearch.js/issues/2440)) ([7916d16](https://github.com/algolia/instantsearch.js/commit/7916d16))\n\n\n\n<a name=\"2.2.5\"></a>\n## [2.2.5](https://github.com/algolia/instantsearch.js/compare/v2.2.4...v2.2.5) (2017-11-20)\n\n\n### Bug Fixes\n\n* **searchbox:** fix usage of custom reset template ([#2585](https://github.com/algolia/instantsearch.js/issues/2585)) ([aad92b9](https://github.com/algolia/instantsearch.js/commit/aad92b9)), closes [#2528](https://github.com/algolia/instantsearch.js/issues/2528)\n\n\n\n<a name=\"2.2.4\"></a>\n## [2.2.4](https://github.com/algolia/instantsearch.js/compare/v2.2.3...v2.2.4) (2017-11-13)\n\n\n### Bug Fixes\n\n* **numericSelector:** make default value possible ([#2565](https://github.com/algolia/instantsearch.js/issues/2565)) ([5664f98](https://github.com/algolia/instantsearch.js/commit/5664f98))\n\n\n\n<a name=\"2.2.3\"></a>\n## [2.2.3](https://github.com/algolia/instantsearch.js/compare/v2.2.2...v2.2.3) (2017-11-07)\n\n\n### Bug Fixes\n\n* **connectRefinementList:** add label to searched items ([#2553](https://github.com/algolia/instantsearch.js/issues/2553)) ([ec810fa](https://github.com/algolia/instantsearch.js/commit/ec810fa))\n* **refinementList:** fix facet exhaustivity check ([#2554](https://github.com/algolia/instantsearch.js/issues/2554)) ([0f1bf08](https://github.com/algolia/instantsearch.js/commit/0f1bf08)), closes [#2552](https://github.com/algolia/instantsearch.js/issues/2552)\n* **theme:** searchbar should have normal size input ([#2545](https://github.com/algolia/instantsearch.js/issues/2545)) ([50d99f0](https://github.com/algolia/instantsearch.js/commit/50d99f0))\n\n\n\n<a name=\"2.2.2\"></a>\n## [2.2.2](https://github.com/algolia/instantsearch.js/compare/v2.2.1...v2.2.2) (2017-10-30)\n\n\n### Bug Fixes\n\n* **connectRefinementList:** set default value for limit ([#2517](https://github.com/algolia/instantsearch.js/issues/2517)) ([32918c9](https://github.com/algolia/instantsearch.js/commit/32918c9))\n* **MenuSelect:** switch from react to preact-compat ([#2513](https://github.com/algolia/instantsearch.js/issues/2513)) ([06aa626](https://github.com/algolia/instantsearch.js/commit/06aa626))\n* **range-slider:** add option `collapsible` ([#2502](https://github.com/algolia/instantsearch.js/issues/2502)) ([e78399d](https://github.com/algolia/instantsearch.js/commit/e78399d)), closes [#2501](https://github.com/algolia/instantsearch.js/issues/2501)\n* **url-sync:** make URLSync consistent even if search is tampered ([392927e](https://github.com/algolia/instantsearch.js/commit/392927e)), closes [#2523](https://github.com/algolia/instantsearch.js/issues/2523)\n\n\n\n<a name=\"2.2.1\"></a>\n## [2.2.1](https://github.com/algolia/instantsearch.js/compare/v2.2.0...v2.2.1) (2017-10-16)\n\n\n### Bug Fixes\n\n* **connectRangeSlider:** only clear the refinement on the current attribute ([#2459](https://github.com/algolia/instantsearch.js/issues/2459)) ([7cebf58](https://github.com/algolia/instantsearch.js/commit/7cebf58))\n* **menuSelect:** select in userCssClasses ([#2455](https://github.com/algolia/instantsearch.js/issues/2455)) ([0eb3dc8](https://github.com/algolia/instantsearch.js/commit/0eb3dc8))\n* **menuSelect:** use preact instead of React ([#2460](https://github.com/algolia/instantsearch.js/issues/2460)) ([35ccae8](https://github.com/algolia/instantsearch.js/commit/35ccae8))\n* **test:** correctly reset the wired dependency ([#2461](https://github.com/algolia/instantsearch.js/issues/2461)) ([1f7f4ed](https://github.com/algolia/instantsearch.js/commit/1f7f4ed))\n\n\n\n<a name=\"2.2.0\"></a>\n# [2.2.0](https://github.com/algolia/instantsearch.js/compare/v2.1.6...v2.2.0) (2017-10-03)\n\n\n### Bug Fixes\n\n* **build:** minify css with `csso` instead of unminify css ([#2419](https://github.com/algolia/instantsearch.js/issues/2419)) ([12f96b8](https://github.com/algolia/instantsearch.js/commit/12f96b8)), closes [#2375](https://github.com/algolia/instantsearch.js/issues/2375)\n* **clear-all:** display the query when clearsQuery is true ([#2414](https://github.com/algolia/instantsearch.js/issues/2414)) ([6921895](https://github.com/algolia/instantsearch.js/commit/6921895))\n* **range-slider:** Fix slider boundaries ([#2408](https://github.com/algolia/instantsearch.js/issues/2408)) ([bea43db](https://github.com/algolia/instantsearch.js/commit/bea43db)), closes [#2386](https://github.com/algolia/instantsearch.js/issues/2386)\n* **selector:** root classname is applied twice ([#2423](https://github.com/algolia/instantsearch.js/issues/2423)) ([44dca11](https://github.com/algolia/instantsearch.js/commit/44dca11)), closes [#2396](https://github.com/algolia/instantsearch.js/issues/2396) [#2397](https://github.com/algolia/instantsearch.js/issues/2397)\n* **webpack.dev:** sourcemaps in dev ([#2422](https://github.com/algolia/instantsearch.js/issues/2422)) ([ba6ca0a](https://github.com/algolia/instantsearch.js/commit/ba6ca0a))\n\n\n### Features\n\n* **menu-select:** add menu select widget ([#2316](https://github.com/algolia/instantsearch.js/issues/2316)) ([680f9bd](https://github.com/algolia/instantsearch.js/commit/680f9bd))\n\n\n\n<a name=\"2.2.0-beta.1\"></a>\n# [2.2.0-beta.1](https://github.com/algolia/instantsearch.js/compare/v2.1.4...v2.2.0-beta.1) (2017-09-18)\n\n\n### Features\n\n* **analytics:** Push pagination ([#2337](https://github.com/algolia/instantsearch.js/issues/2337)) ([94ce086](https://github.com/algolia/instantsearch.js/commit/94ce086))\n* **hitsPerPageSelector:** default hits per page setting ([4efd43e](https://github.com/algolia/instantsearch.js/commit/4efd43e))\n* **hitsPerPageSelector:** default hits per page setting ([355f080](https://github.com/algolia/instantsearch.js/commit/355f080))\n\n\n\n<a name=\"2.1.6\"></a>\n## [2.1.6](https://github.com/algolia/instantsearch.js/compare/v2.1.5...v2.1.6) (2017-09-26)\n\n\n### Bug Fixes\n\n* **deps:** update dependency documentation to v^5.0.0 ([#2355](https://github.com/algolia/instantsearch.js/issues/2355)) ([489647a](https://github.com/algolia/instantsearch.js/commit/489647a))\n* **searchbox:** use initial input value if provided in the dom ([#2342](https://github.com/algolia/instantsearch.js/issues/2342)) ([180902a](https://github.com/algolia/instantsearch.js/commit/180902a)), closes [#2289](https://github.com/algolia/instantsearch.js/issues/2289)\n\n\n\n<a name=\"2.1.5\"></a>\n## [2.1.5](https://github.com/algolia/instantsearch.js/compare/v2.1.4...v2.1.5) (2017-09-25)\n\n\n### Bug Fixes\n\n* **deps:** update dependency algolia-frontend-components to v^0.0.33 ([#2341](https://github.com/algolia/instantsearch.js/issues/2341)) ([16994d8](https://github.com/algolia/instantsearch.js/commit/16994d8))\n* **price-ranges:** update call to refine ([#2377](https://github.com/algolia/instantsearch.js/issues/2377)) ([34915d7](https://github.com/algolia/instantsearch.js/commit/34915d7))\n* **slider:** Fix range slider pips and value 0 ([#2350](https://github.com/algolia/instantsearch.js/issues/2350)) ([fa0dc09](https://github.com/algolia/instantsearch.js/commit/fa0dc09)), closes [#2343](https://github.com/algolia/instantsearch.js/issues/2343)\n\n\n\n<a name=\"2.1.4\"></a>\n## [2.1.4](https://github.com/algolia/instantsearch.js/compare/v2.1.3...v2.1.4) (2017-09-14)\n\n\n### Bug Fixes\n\n* **release-script:** Add the generation of changelog for the release ([#2333](https://github.com/algolia/instantsearch.js/issues/2333)) ([9a2f70b](https://github.com/algolia/instantsearch.js/commit/9a2f70b))\n* **slider:** edge case when min > max ([#2336](https://github.com/algolia/instantsearch.js/issues/2336)) ([8830ab0](https://github.com/algolia/instantsearch.js/commit/8830ab0))\n* **slider:** Fix range slider dev env ([#2320](https://github.com/algolia/instantsearch.js/issues/2320)) ([e78de70](https://github.com/algolia/instantsearch.js/commit/e78de70))\n* **slider:** use algolia fork of rheostat ([#2335](https://github.com/algolia/instantsearch.js/issues/2335)) ([9eae009](https://github.com/algolia/instantsearch.js/commit/9eae009))\n\n\n\n<a name=\"2.1.3\"></a>\n## [2.1.3](https://github.com/algolia/instantsearch.js/compare/v2.1.2...v2.1.3) (2017-09-05)\n\n\n### Bug Fixes\n\n* **Pagination:** add `autohideContainerHOC` to <Pagination /> ([#2296](https://github.com/algolia/instantsearch.js/issues/2296)) ([545f076](https://github.com/algolia/instantsearch.js/commit/545f076))\n* **sffv:** no error when not providing noResults and no results ([#2310](https://github.com/algolia/instantsearch.js/issues/2310)) ([cc02b71](https://github.com/algolia/instantsearch.js/commit/cc02b71)), closes [#2087](https://github.com/algolia/instantsearch.js/issues/2087)\n\n\n\n<a name=\"2.1.2\"></a>\n## [2.1.2](https://github.com/algolia/instantsearch.js/compare/v2.1.1...v2.1.2) (2017-08-24)\n\n\n### Bug Fixes\n\n* **es:** wrong path to files ([#2295](https://github.com/algolia/instantsearch.js/issues/2295)) ([a437e19](https://github.com/algolia/instantsearch.js/commit/a437e19))\n\n\n\n<a name=\"2.1.1\"></a>\n## [2.1.1](https://github.com/algolia/instantsearch.js/compare/v2.1.0...v2.1.1) (2017-08-23)\n\n\n### Bug Fixes\n\n* **build:** provide unminified css as well ([#2292](https://github.com/algolia/instantsearch.js/issues/2292)) ([a79e067](https://github.com/algolia/instantsearch.js/commit/a79e067))\n\n\n\n<a name=\"2.1.0\"></a>\n# [2.1.0](https://github.com/algolia/instantsearch.js/compare/v2.1.0-beta.4...v2.1.0) (2017-08-21)\n\n\n### Bug Fixes\n\n* **nvmrc:** upgrade nodejs version ([#2291](https://github.com/algolia/instantsearch.js/issues/2291)) ([94529d4](https://github.com/algolia/instantsearch.js/commit/94529d4))\n\n\n\n<a name=\"2.0.2\"></a>\n## [2.0.2](https://github.com/algolia/instantsearch.js/compare/v2.0.1...v2.0.2) (2017-07-24)\n\n\n### Bug Fixes\n\n* **doc:** Cosmetic change ([48bb128](https://github.com/algolia/instantsearch.js/commit/48bb128))\n* **search-box:** fix magnifier and reset customization ([4adfade](https://github.com/algolia/instantsearch.js/commit/4adfade))\n* **theme:** enforce box-sizing: border-box ([e26e50d](https://github.com/algolia/instantsearch.js/commit/e26e50d))\n* **url-sync:** remove is_v from url ([f19a1d5](https://github.com/algolia/instantsearch.js/commit/f19a1d5)), closes [#2233](https://github.com/algolia/instantsearch.js/issues/2233)\n\n\n\n<a name=\"2.0.1\"></a>\n## [2.0.1](https://github.com/algolia/instantsearch.js/compare/v2.0.0...v2.0.1) (2017-07-12)\n\n\n\n<a name=\"2.0.0\"></a>\n# [2.0.0](https://github.com/algolia/instantsearch.js/compare/v1.11.15...v2.0.0) (2017-07-01)\n\n\n### Bug Fixes\n\n* **argos-ci:** blur the active element ([66d0551](https://github.com/algolia/instantsearch.js/commit/66d0551))\n* **connectNumericRefinementList:** reset page on refine ([22ec08d](https://github.com/algolia/instantsearch.js/commit/22ec08d))\n* **doc.build:** watch & rebuild `.pug` ([16d8542](https://github.com/algolia/instantsearch.js/commit/16d8542))\n* **doc.build/autoprefixer:** update mtime for onlyChanged plugin ([3b83e58](https://github.com/algolia/instantsearch.js/commit/3b83e58))\n* **escapeHits:** dont apply configuration if not requested ([c89f99d](https://github.com/algolia/instantsearch.js/commit/c89f99d))\n\n\n### Features\n\n* **searchFunction:** make search function provide a better API ([8fc0831](https://github.com/algolia/instantsearch.js/commit/8fc0831))\n\n\n\n<a name=\"2.0.0-beta.5\"></a>\n# [2.0.0-beta.5](https://github.com/algolia/instantsearch.js/compare/v1.11.12...v2.0.0-beta.5) (2017-06-01)\n\n\n### Bug Fixes\n\n* **Slider:** dont call `refine()` when it's disabled ([f1eabc9](https://github.com/algolia/instantsearch.js/commit/f1eabc9))\n\n\n### Features\n\n* **hits:** opt-in xss filtering for hits and infinite hits. FIX #2138 ([4f67b48](https://github.com/algolia/instantsearch.js/commit/4f67b48)), closes [#2138](https://github.com/algolia/instantsearch.js/issues/2138)\n\n\n\n<a name=\"2.0.0-beta.4\"></a>\n# [2.0.0-beta.4](https://github.com/algolia/instantsearch.js/compare/v1.11.11...v2.0.0-beta.4) (2017-05-24)\n\n\n### Bug Fixes\n\n* **misc:** IE 11 support ([072edfe](https://github.com/algolia/instantsearch.js/commit/072edfe))\n* **misc:** IE11 support without using transpiler ([324f062](https://github.com/algolia/instantsearch.js/commit/324f062))\n* **show-more:** should hide button when show more is not available (#2161) ([fbca3e6](https://github.com/algolia/instantsearch.js/commit/fbca3e6)), closes [#2160](https://github.com/algolia/instantsearch.js/issues/2160)\n* **Slider:** handle edge case where `min === max` ([22a5614](https://github.com/algolia/instantsearch.js/commit/22a5614))\n* **Slider:** restore `slider--handle-lower` && `slider--handle-upper` ([64d7ad2](https://github.com/algolia/instantsearch.js/commit/64d7ad2))\n\n\n\n<a name=\"2.0.0-beta.2\"></a>\n# [2.0.0-beta.2](https://github.com/algolia/instantsearch.js/compare/v1.11.9...v2.0.0-beta.2) (2017-05-17)\n\n\n### Bug Fixes\n\n* **autoHideContainer:** dont prevent render with `shouldComponentUpdate` ([8c4b13f](https://github.com/algolia/instantsearch.js/commit/8c4b13f))\n* **clearsQuery:** not applied when only the query was not empty ([e7976ad](https://github.com/algolia/instantsearch.js/commit/e7976ad))\n* **connectors:** ensure `widgetParams` is at least an `{}` ([0c0e98f](https://github.com/algolia/instantsearch.js/commit/0c0e98f))\n* **connectRefinementList:** currentRefinements: return an array instead of first item ([a53223a](https://github.com/algolia/instantsearch.js/commit/a53223a)), closes [#2102](https://github.com/algolia/instantsearch.js/issues/2102)\n* **dev:docs:** dont watch `/docgen/rootFiles` ([ab1a7f5](https://github.com/algolia/instantsearch.js/commit/ab1a7f5))\n* **doc:** add doc for isFirstRendering ([cea6739](https://github.com/algolia/instantsearch.js/commit/cea6739))\n* **docs:** dont filter out `p.type.type` ([881659a](https://github.com/algolia/instantsearch.js/commit/881659a))\n* **documentation.js:** Support for record types ([219ecd9](https://github.com/algolia/instantsearch.js/commit/219ecd9))\n* **documentationjs:** add support litteral string types in type format ([2a08e7d](https://github.com/algolia/instantsearch.js/commit/2a08e7d))\n* **documentationjs:** deeper related types ([6e3121e](https://github.com/algolia/instantsearch.js/commit/6e3121e))\n* **documentationjs:** find related type in TypeApplication ([e0487ee](https://github.com/algolia/instantsearch.js/commit/e0487ee))\n* **documentationjs:** fix 2+ depth structs ([4c8b7ec](https://github.com/algolia/instantsearch.js/commit/4c8b7ec))\n* **documentationjs:** fixed default value parameter ([b62cbc7](https://github.com/algolia/instantsearch.js/commit/b62cbc7))\n* **documentationjs:** records display with , ([8a968f2](https://github.com/algolia/instantsearch.js/commit/8a968f2))\n* **documentationjs:** Updgrade to RC + fixes ([e9f0361](https://github.com/algolia/instantsearch.js/commit/e9f0361))\n* **infinite-hits:** Remove hitsPerPage option (#2128) ([c13e377](https://github.com/algolia/instantsearch.js/commit/c13e377))\n* **live-example:** adapt regex for matching connectors ([774254c](https://github.com/algolia/instantsearch.js/commit/774254c))\n* **pagination:** fix zealous find/replace ([e269d87](https://github.com/algolia/instantsearch.js/commit/e269d87))\n* **price-ranges:** fix test ([fd65cb3](https://github.com/algolia/instantsearch.js/commit/fd65cb3))\n* **price-ranges:** New API uses ranges ([a5a6916](https://github.com/algolia/instantsearch.js/commit/a5a6916))\n* **refinementList:** reimplement show more on refinement list ([72655ab](https://github.com/algolia/instantsearch.js/commit/72655ab))\n* **refinementList:** sffv fix thanks [@julienpa](https://github.com/julienpa) ([30e0e9a](https://github.com/algolia/instantsearch.js/commit/30e0e9a))\n* **sffv:** Fix exhaustive facets ([0cadcc3](https://github.com/algolia/instantsearch.js/commit/0cadcc3))\n* **sortby:** Consistent across widget / connectors + migration ([8e366cc](https://github.com/algolia/instantsearch.js/commit/8e366cc))\n* **widgets/price-ranges:** wrong compute of `templateProps` ([be5e063](https://github.com/algolia/instantsearch.js/commit/be5e063))\n\n\n### Features\n\n* **connectHierarchicalMenu:** remove `currentRefinement` ([3912aaf](https://github.com/algolia/instantsearch.js/commit/3912aaf))\n* **connectHits:** typo `widgetOptions` -> `widgetParams` ([4420231](https://github.com/algolia/instantsearch.js/commit/4420231))\n* **connector:** Add hierarchical menu connector ([f727949](https://github.com/algolia/instantsearch.js/commit/f727949))\n* **connector:** add infinite hits connector ([cdf8675](https://github.com/algolia/instantsearch.js/commit/cdf8675))\n* **connector:** add instantsearchInstance to pagination render ([4fa96dc](https://github.com/algolia/instantsearch.js/commit/4fa96dc))\n* **connector:** add missing jsDoc descriptions ([e26e8e2](https://github.com/algolia/instantsearch.js/commit/e26e8e2))\n* **connector:** add range-slider ([1a02798](https://github.com/algolia/instantsearch.js/commit/1a02798))\n* **connector:** add tests for connectClearAll and connectHierarchicalMenu ([0eb29ec](https://github.com/algolia/instantsearch.js/commit/0eb29ec))\n* **connector:** Adds hits and menu connectors ([77083b7](https://github.com/algolia/instantsearch.js/commit/77083b7))\n* **connector:** Clear and CurrentRefinedValues ([02f7d3e](https://github.com/algolia/instantsearch.js/commit/02f7d3e))\n* **connector:** clearAll connector (iteration 2) ([90aa02e](https://github.com/algolia/instantsearch.js/commit/90aa02e))\n* **connector:** clearAll jsDoc + eslint fixes ([430a420](https://github.com/algolia/instantsearch.js/commit/430a420))\n* **connector:** complete jsdoc + pass instantsearch to view ([e125931](https://github.com/algolia/instantsearch.js/commit/e125931))\n* **connector:** connectClearAll documentation ([9b153aa](https://github.com/algolia/instantsearch.js/commit/9b153aa))\n* **connector:** connectClearAll iteration 2 (fix) ([03653f1](https://github.com/algolia/instantsearch.js/commit/03653f1))\n* **connector:** connectClearAll test ([5409157](https://github.com/algolia/instantsearch.js/commit/5409157))\n* **connector:** connectCurrentRefinedValues (iteration 2) ([68408de](https://github.com/algolia/instantsearch.js/commit/68408de))\n* **connector:** connectHierarchicalMenu (iteration 2) ([589454c](https://github.com/algolia/instantsearch.js/commit/589454c))\n* **connector:** connectHierarchicalMenu jsDoc ([e166090](https://github.com/algolia/instantsearch.js/commit/e166090))\n* **connector:** connectHits (iteration 2) ([bca09af](https://github.com/algolia/instantsearch.js/commit/bca09af))\n* **connector:** connectHitsPerPageSelector (iteration 2) ([26bb273](https://github.com/algolia/instantsearch.js/commit/26bb273))\n* **connector:** connectInfiniteHits (iteration 2) ([410459c](https://github.com/algolia/instantsearch.js/commit/410459c))\n* **connector:** connectNumericRefinementList (iteration 2) ([bfcf860](https://github.com/algolia/instantsearch.js/commit/bfcf860))\n* **connector:** connectNumericSelector (iteration 2) ([1eda8a2](https://github.com/algolia/instantsearch.js/commit/1eda8a2))\n* **connector:** connectNumericSelector jsDoc ([760fcea](https://github.com/algolia/instantsearch.js/commit/760fcea))\n* **connector:** connectRefinementList jsdoc + start document bool isFirstRendering ([52d13de](https://github.com/algolia/instantsearch.js/commit/52d13de))\n* **connector:** connectStats second iteration ([82b1cb3](https://github.com/algolia/instantsearch.js/commit/82b1cb3))\n* **connector:** connectToggle second iteration ([73b0878](https://github.com/algolia/instantsearch.js/commit/73b0878))\n* **connector:** fix createURL usage to generate correct urls ([fdf59d7](https://github.com/algolia/instantsearch.js/commit/fdf59d7))\n* **connector:** fix no param usage on custom infiniteHits ([961348a](https://github.com/algolia/instantsearch.js/commit/961348a))\n* **connector:** fix parameter consistency in connectClearAll ([9ddffd8](https://github.com/algolia/instantsearch.js/commit/9ddffd8))\n* **connector:** Fix parameters for toggle connector ([f96671c](https://github.com/algolia/instantsearch.js/commit/f96671c))\n* **connector:** hits-per-page-selector connector refactoring ([dd794e0](https://github.com/algolia/instantsearch.js/commit/dd794e0))\n* **connector:** jsDoc + check rendering function ([86f9739](https://github.com/algolia/instantsearch.js/commit/86f9739))\n* **connector:** jsDoc connectPagination ([3b284de](https://github.com/algolia/instantsearch.js/commit/3b284de))\n* **connector:** jsDoc for connectMenu ([626d5f1](https://github.com/algolia/instantsearch.js/commit/626d5f1))\n* **connector:** jsDoc updates ([c924043](https://github.com/algolia/instantsearch.js/commit/c924043))\n* **connector:** move clearAll as a rendering option ([ce41cde](https://github.com/algolia/instantsearch.js/commit/ce41cde))\n* **connector:** Numeric selector ([0dc42d2](https://github.com/algolia/instantsearch.js/commit/0dc42d2))\n* **connector:** numericRefinementList connector ([918d971](https://github.com/algolia/instantsearch.js/commit/918d971))\n* **connector:** pagination connector ([7a876f3](https://github.com/algolia/instantsearch.js/commit/7a876f3))\n* **connector:** price ranges connector ([d8bed96](https://github.com/algolia/instantsearch.js/commit/d8bed96))\n* **connector:** provide consistent interface for searchbox renderer ([17d8301](https://github.com/algolia/instantsearch.js/commit/17d8301))\n* **connector:** provide instantsearch instance at render ([12a7935](https://github.com/algolia/instantsearch.js/commit/12a7935))\n* **connector:** refactor search function ([618dca2](https://github.com/algolia/instantsearch.js/commit/618dca2))\n* **connector:** refinement list connector ([c8fcf4e](https://github.com/algolia/instantsearch.js/commit/c8fcf4e))\n* **connector:** remove legacy implementation of toggle ([04437b0](https://github.com/algolia/instantsearch.js/commit/04437b0))\n* **connector:** remove non relevant instantsearch API from test ([c5dce5c](https://github.com/algolia/instantsearch.js/commit/c5dce5c))\n* **connector:** remove unused parameter to searchbox connector ([e639f65](https://github.com/algolia/instantsearch.js/commit/e639f65))\n* **connector:** searchbox connector ([70f8e1f](https://github.com/algolia/instantsearch.js/commit/70f8e1f))\n* **connector:** small internal refactoring for SFFV ([cb5c1fa](https://github.com/algolia/instantsearch.js/commit/cb5c1fa))\n* **connector:** sort by selector connector ([b9847cf](https://github.com/algolia/instantsearch.js/commit/b9847cf))\n* **connector:** star rating connector ([9996b4d](https://github.com/algolia/instantsearch.js/commit/9996b4d))\n* **connector:** stats connector ([680743b](https://github.com/algolia/instantsearch.js/commit/680743b))\n* **connector:** test connectHits ([89c86a5](https://github.com/algolia/instantsearch.js/commit/89c86a5))\n* **connector:** test connectHitsPerPageSelector ([9caab02](https://github.com/algolia/instantsearch.js/commit/9caab02))\n* **connector:** test connectInfiniteHits ([e67e75e](https://github.com/algolia/instantsearch.js/commit/e67e75e))\n* **connector:** test connectMenu ([03c6f11](https://github.com/algolia/instantsearch.js/commit/03c6f11))\n* **connector:** test connectNumericRefinementList ([2f26251](https://github.com/algolia/instantsearch.js/commit/2f26251))\n* **connector:** test connectNumericSelector ([182779b](https://github.com/algolia/instantsearch.js/commit/182779b))\n* **connector:** test connectPagination ([6f125b7](https://github.com/algolia/instantsearch.js/commit/6f125b7))\n* **connector:** test connectPriceRanges ([f5dfba7](https://github.com/algolia/instantsearch.js/commit/f5dfba7))\n* **connector:** test connectRangeSlider ([4f6c180](https://github.com/algolia/instantsearch.js/commit/4f6c180))\n* **connector:** test connectSearchBox ([b4d7e1b](https://github.com/algolia/instantsearch.js/commit/b4d7e1b))\n* **connector:** test connectSortBySelector ([e8825df](https://github.com/algolia/instantsearch.js/commit/e8825df))\n* **connector:** test connectStarRating ([0c16f15](https://github.com/algolia/instantsearch.js/commit/0c16f15)), closes [#2002](https://github.com/algolia/instantsearch.js/issues/2002)\n* **connector:** test connectStats ([c992288](https://github.com/algolia/instantsearch.js/commit/c992288))\n* **connector:** test connectToggle ([441293d](https://github.com/algolia/instantsearch.js/commit/441293d))\n* **connector:** toggle connector ([bf9a9c0](https://github.com/algolia/instantsearch.js/commit/bf9a9c0))\n* **connector:** update doc, move setValue to refine in SortBySelector ([2486f36](https://github.com/algolia/instantsearch.js/commit/2486f36))\n* **connector:** update jsDoc descriptions ([f83022a](https://github.com/algolia/instantsearch.js/commit/f83022a))\n* **connectors:** `refinement-list` widget (iteration2) ([1c6c3a5](https://github.com/algolia/instantsearch.js/commit/1c6c3a5))\n* **connectors:** `setValue()` -> `refine()` / `currentValue` -> `currentRefinement` ([ec7806c](https://github.com/algolia/instantsearch.js/commit/ec7806c))\n* **connectors:** `sortBy` to `['isRefined', 'count:desc']` ([01219f1](https://github.com/algolia/instantsearch.js/commit/01219f1))\n* **connectors:** add `currentRefinement` on `hierarchical-menu` ([154cdb5](https://github.com/algolia/instantsearch.js/commit/154cdb5))\n* **connectors:** connectPagination (iteration2) ([8a615f6](https://github.com/algolia/instantsearch.js/commit/8a615f6))\n* **connectors:** connectPriceRanges (iteration2) ([e34968e](https://github.com/algolia/instantsearch.js/commit/e34968e))\n* **connectors:** connectRangeSlider (iteration2) ([6073d94](https://github.com/algolia/instantsearch.js/commit/6073d94))\n* **connectors:** connectSearchBox (iteration2) ([3161c9b](https://github.com/algolia/instantsearch.js/commit/3161c9b))\n* **connectors:** connectSortBySelector (iteration 2) ([dec2d31](https://github.com/algolia/instantsearch.js/commit/dec2d31))\n* **connectors:** connectStarRating (iteration2) ([7ef7b6b](https://github.com/algolia/instantsearch.js/commit/7ef7b6b))\n* **connectors:** connectToggle, forward initial options to render ([704a455](https://github.com/algolia/instantsearch.js/commit/704a455))\n* **connectors:** dissociate logic & view for `menu` widget ([5a02c88](https://github.com/algolia/instantsearch.js/commit/5a02c88))\n* **connectors:** expose connectors on `instantsearch` instance ([ff799d0](https://github.com/algolia/instantsearch.js/commit/ff799d0))\n* **connectors:** forward `widgetParams` to `renderFn` ([54222a3](https://github.com/algolia/instantsearch.js/commit/54222a3))\n* **connectors:** jsDoc connectHitsPerPageSelector ([75243b0](https://github.com/algolia/instantsearch.js/commit/75243b0))\n* **connectors:** provide `currentRefinement` on menu ([fb7bc5e](https://github.com/algolia/instantsearch.js/commit/fb7bc5e))\n* **connectors:** provide `currentRefinement` on numeric refinement list ([91f7928](https://github.com/algolia/instantsearch.js/commit/91f7928))\n* **connectors.numeric-selector:** `currentValue` -> `currentRefinement` / `setValue()` -> `refine()` ([998faf1](https://github.com/algolia/instantsearch.js/commit/998faf1))\n* **connectors.price-ranges:** provides `currentRefiment` value ([39af437](https://github.com/algolia/instantsearch.js/commit/39af437))\n* **connectors.refinement-list:** provide `currentRefinement` to `renderFn` ([7e86be3](https://github.com/algolia/instantsearch.js/commit/7e86be3))\n* **connectors.star-rating:** provide `currentRefinement` value ([c08b3e4](https://github.com/algolia/instantsearch.js/commit/c08b3e4))\n* **connectRefinementList:** first good iteration ([88fd6d5](https://github.com/algolia/instantsearch.js/commit/88fd6d5))\n* **doc:** re-bootstrap doc based on instantsearch-android ([e4e816e](https://github.com/algolia/instantsearch.js/commit/e4e816e))\n* **docs:** bootstrap v2 docs ([0db6caf](https://github.com/algolia/instantsearch.js/commit/0db6caf))\n* **docs:** pages structure ([fe89dcf](https://github.com/algolia/instantsearch.js/commit/fe89dcf))\n* **getting-started:** add `.zip` boilerplate ([7d3769c](https://github.com/algolia/instantsearch.js/commit/7d3769c))\n* **getting-started:** add result example of guide ([78d9017](https://github.com/algolia/instantsearch.js/commit/78d9017))\n* **live-example:** add support of connectors ([e4f3158](https://github.com/algolia/instantsearch.js/commit/e4f3158))\n* **live-example:** include jquery on connectors example pages ([f32936f](https://github.com/algolia/instantsearch.js/commit/f32936f))\n* **main:** export all the widgets at once ([4bc2d21](https://github.com/algolia/instantsearch.js/commit/4bc2d21))\n* **numeric-refinement-list:** `facetValues` -> `items` / `toggleRefinement` -> `refine` ([eb2c993](https://github.com/algolia/instantsearch.js/commit/eb2c993))\n* **pagination:** `setPage()` -> `refine()` / `currentPage` -> `currentRefinement` ([f783fea](https://github.com/algolia/instantsearch.js/commit/f783fea))\n* **range-slider:** use `rheostat` as slider component (#2142) ([910a0a0](https://github.com/algolia/instantsearch.js/commit/910a0a0))\n* **searchFunction:** Update API, fix #1924 ([c7beb1d](https://github.com/algolia/instantsearch.js/commit/c7beb1d)), closes [#1924](https://github.com/algolia/instantsearch.js/issues/1924)\n* **sort-by-selector:** `currentValue` -> `currentRefinement` ([e94c8c7](https://github.com/algolia/instantsearch.js/commit/e94c8c7))\n* **Template:** remove support for react element ([ca2ab44](https://github.com/algolia/instantsearch.js/commit/ca2ab44))\n\n\n\n<a name=\"1.11.15\"></a>\n## [1.11.15](https://github.com/algolia/instantsearch.js/compare/v1.11.14...v1.11.15) (2017-06-20)\n\n\n### Bug Fixes\n\n* **numeric-refinement-list:** reset page on refine ([ee55ccb](https://github.com/algolia/instantsearch.js/commit/ee55ccb))\n\n\n\n<a name=\"1.11.14\"></a>\n## [1.11.14](https://github.com/algolia/instantsearch.js/compare/v1.11.13...v1.11.14) (2017-06-19)\n\n\n### Bug Fixes\n\n* **powered-by:** update logo ([7e68b51](https://github.com/algolia/instantsearch.js/commit/7e68b51)), closes [#2126](https://github.com/algolia/instantsearch.js/issues/2126)\n\n\n\n<a name=\"1.11.13\"></a>\n## [1.11.13](https://github.com/algolia/instantsearch.js/compare/v1.11.12...v1.11.13) (2017-06-07)\n\n\n### Bug Fixes\n\n* **url-sync:** reverting back to using `change` event (#2183) ([07f4be0](https://github.com/algolia/instantsearch.js/commit/07f4be0)), closes [#2173](https://github.com/algolia/instantsearch.js/issues/2173) [#2171](https://github.com/algolia/instantsearch.js/issues/2171)\n\n\n\n<a name=\"1.11.12\"></a>\n## [1.11.12](https://github.com/algolia/instantsearch.js/compare/v1.11.11...v1.11.12) (2017-05-30)\n\n\n### Bug Fixes\n\n* **sffv:** when using a large limit, retain the search (#2163) ([3d95d4c](https://github.com/algolia/instantsearch.js/commit/3d95d4c)), closes [#2156](https://github.com/algolia/instantsearch.js/issues/2156)\n\n\n\n<a name=\"1.11.10\"></a>\n## [1.11.10](https://github.com/algolia/instantsearch.js/compare/v1.11.9...v1.11.10) (2017-05-17)\n\n\n\n<a name=\"1.11.9\"></a>\n## [1.11.9](https://github.com/algolia/instantsearch.js/compare/v1.11.8...v1.11.9) (2017-05-17)\n\n\n\n<a name=\"1.11.8\"></a>\n## [1.11.8](https://github.com/algolia/instantsearch.js/compare/v1.11.7...v1.11.8) (2017-05-16)\n\n\n### Bug Fixes\n\n* **url-sync:** set firstRender to be class attribute ([22dbaeb](https://github.com/algolia/instantsearch.js/commit/22dbaeb))\n\n\n\n<a name=\"1.11.7\"></a>\n## [1.11.7](https://github.com/algolia/instantsearch.js/compare/v1.11.6...v1.11.7) (2017-04-24)\n\n\n### Bug Fixes\n\n* **sffv:** add class for disabled state at the form level (#2122) ([029fa5f](https://github.com/algolia/instantsearch.js/commit/029fa5f))\n* **sffv:** fixes typo (: was left) ([26d2845](https://github.com/algolia/instantsearch.js/commit/26d2845))\n\n\n\n<a name=\"1.11.6\"></a>\n## [1.11.6](https://github.com/algolia/instantsearch.js/compare/v1.11.5...v1.11.6) (2017-04-20)\n\n\n### Bug Fixes\n\n* **CONTRIBUTING:** remove section about beta releases (#2109) ([5640131](https://github.com/algolia/instantsearch.js/commit/5640131))\n* **sffv:** disable sffv input when few facet values FIX #2111 ([1e33c10](https://github.com/algolia/instantsearch.js/commit/1e33c10)), closes [#2111](https://github.com/algolia/instantsearch.js/issues/2111)\n\n\n\n<a name=\"1.11.5\"></a>\n## [1.11.5](https://github.com/algolia/instantsearch.js/compare/v1.11.4...v1.11.5) (2017-04-12)\n\n\n### Bug Fixes\n\n* **url-sync:** sync url on search (#2108) ([7f33ffb](https://github.com/algolia/instantsearch.js/commit/7f33ffb))\n\n\n\n<a name=\"1.11.4\"></a>\n## [1.11.4](https://github.com/algolia/instantsearch.js/compare/v1.11.3...v1.11.4) (2017-03-29)\n\n\n### Bug Fixes\n\n* **autoHideContainer:** dont prevent render with `shouldComponentUpdate` (#2076) ([b520400](https://github.com/algolia/instantsearch.js/commit/b520400))\n* **star-rating:** make max value inclusive ([f5fc41c](https://github.com/algolia/instantsearch.js/commit/f5fc41c)), closes [#2002](https://github.com/algolia/instantsearch.js/issues/2002)\n\n\n\n<a name=\"1.11.3\"></a>\n## [1.11.3](https://github.com/algolia/instantsearch.js/compare/v1.11.2...v1.11.3) (2017-03-22)\n\n\n### Bug Fixes\n\n* **Slider:** display disabled slider when `min === max` (#2041) ([511fdfd](https://github.com/algolia/instantsearch.js/commit/511fdfd)), closes [#2037](https://github.com/algolia/instantsearch.js/issues/2037)\n\n\n\n<a name=\"1.11.2\"></a>\n## [1.11.2](https://github.com/algolia/instantsearch.js/compare/v1.11.1...v1.11.2) (2017-02-28)\n\n\n### Bug Fixes\n\n* **searchBox:** avoid unwanted cursor jumps on hashchange (#2013) ([d0103db](https://github.com/algolia/instantsearch.js/commit/d0103db)), closes [#2012](https://github.com/algolia/instantsearch.js/issues/2012)\n\n\n\n<a name=\"1.11.1\"></a>\n## [1.11.1](https://github.com/algolia/instantsearch.js/compare/v1.11.0...v1.11.1) (2017-02-14)\n\n\n### Bug Fixes\n\n* **infinite-hits:** disable load more button when no more pages (#1973) ([745ed89](https://github.com/algolia/instantsearch.js/commit/745ed89)), closes [#1971](https://github.com/algolia/instantsearch.js/issues/1971)\n\n\n\n<a name=\"1.11.0\"></a>\n# [1.11.0](https://github.com/algolia/instantsearch.js/compare/v1.10.5...v1.11.0) (2017-02-12)\n\n\n### Features\n\n* **analytics-widget:** add a new parameter pushInitialSearch (#1963) ([d777997](https://github.com/algolia/instantsearch.js/commit/d777997))\n* **custom client:** allows to provide a custom JS client instance (#1948) ([cce4f2e](https://github.com/algolia/instantsearch.js/commit/cce4f2e))\n* **InfiniteHits:** add new widget ([2d77e4b](https://github.com/algolia/instantsearch.js/commit/2d77e4b))\n\n\n\n<a name=\"1.10.5\"></a>\n## [1.10.5](https://github.com/algolia/instantsearch.js/compare/v1.10.4...v1.10.5) (2017-02-06)\n\n\n### Bug Fixes\n\n* **urlSync:** update url only after threshold (#1917) ([b0f0cf1](https://github.com/algolia/instantsearch.js/commit/b0f0cf1)), closes [#1856](https://github.com/algolia/instantsearch.js/issues/1856)\n\n\n\n<a name=\"1.10.4\"></a>\n## [1.10.4](https://github.com/algolia/instantsearch.js/compare/v1.10.3...v1.10.4) (2017-01-25)\n\n\n\n<a name=\"1.10.3\"></a>\n## [1.10.3](https://github.com/algolia/instantsearch.js/compare/v1.10.2...v1.10.3) (2016-12-26)\n\n\n### Bug Fixes\n\n* **sffv-searchbox:** update classnames to avoid conflicts (#1781) ([f53e8fd](https://github.com/algolia/instantsearch.js/commit/f53e8fd))\n\n\n\n<a name=\"1.10.2\"></a>\n## [1.10.2](https://github.com/algolia/instantsearch.js/compare/v1.10.1...v1.10.2) (2016-12-23)\n\n\n### Bug Fixes\n\n* **url:** clear timeout on pop ([41ad9af](https://github.com/algolia/instantsearch.js/commit/41ad9af))\n\n\n\n<a name=\"1.10.1\"></a>\n## [1.10.1](https://github.com/algolia/instantsearch.js/compare/v1.10.0...v1.10.1) (2016-12-23)\n\n\n### Bug Fixes\n\n* **url:** default param ([7a18e1c](https://github.com/algolia/instantsearch.js/commit/7a18e1c))\n\n\n### Features\n\n* **url:** add a beta updateOnEveryKeystroke option (#1779) ([63f73fe](https://github.com/algolia/instantsearch.js/commit/63f73fe))\n\n\n\n<a name=\"1.10.0\"></a>\n# [1.10.0](https://github.com/algolia/instantsearch.js/compare/v1.9.0...v1.10.0) (2016-12-22)\n\n\n### Features\n\n* **widget:** Search for facet values - refinement list (#1753) ([b9e20f3](https://github.com/algolia/instantsearch.js/commit/b9e20f3))\n\n\n\n<a name=\"1.9.0\"></a>\n# [1.9.0](https://github.com/algolia/instantsearch.js/compare/v1.8.16...v1.9.0) (2016-12-14)\n\n\n### Bug Fixes\n\n* **currentRefinedValues:** unescape disjunctive facet refinement names (#1574) ([9ab65c4](https://github.com/algolia/instantsearch.js/commit/9ab65c4)), closes [#1569](https://github.com/algolia/instantsearch.js/issues/1569)\n* **transformData:** default data is an object when not provided (#1570) ([8eeeeba](https://github.com/algolia/instantsearch.js/commit/8eeeeba)), closes [#1538](https://github.com/algolia/instantsearch.js/issues/1538)\n\n\n### Features\n\n* **analytics:** new analytics widget to easily plug search to any analytics service ([09d8fda](https://github.com/algolia/instantsearch.js/commit/09d8fda))\n* **retry strategy:** new retry strategy ([afdcc3c](https://github.com/algolia/instantsearch.js/commit/afdcc3c))\n\n\n\n<a name=\"1.8.16\"></a>\n## [1.8.16](https://github.com/algolia/instantsearch.js/compare/v1.8.15...v1.8.16) (2016-11-16)\n\n\n\n<a name=\"1.8.15\"></a>\n## [1.8.15](https://github.com/algolia/instantsearch.js/compare/v1.8.14...v1.8.15) (2016-11-16)\n\n\n### Bug Fixes\n\n* **priceRanges:** avoid displaying solo ranges (#1544) ([ff396f0](https://github.com/algolia/instantsearch.js/commit/ff396f0)), closes [#1536](https://github.com/algolia/instantsearch.js/issues/1536)\n* **priceRanges:** use formatNumber in defaultTemplate (#1559) ([557a501](https://github.com/algolia/instantsearch.js/commit/557a501)), closes [#1230](https://github.com/algolia/instantsearch.js/issues/1230)\n* **toggle:** support negative numeric values for on/off (#1551) ([e4d88e0](https://github.com/algolia/instantsearch.js/commit/e4d88e0)), closes [#1537](https://github.com/algolia/instantsearch.js/issues/1537)\n* **transformData:** always call transformData (#1555) ([49bfeca](https://github.com/algolia/instantsearch.js/commit/49bfeca)), closes [#1538](https://github.com/algolia/instantsearch.js/issues/1538)\n\n\n\n<a name=\"1.8.14\"></a>\n## [1.8.14](https://github.com/algolia/instantsearch.js/compare/v1.8.13...v1.8.14) (2016-11-03)\n\n\n### Bug Fixes\n\n* **slider:** avoid multi touch issues (#1501) ([0b8a242](https://github.com/algolia/instantsearch.js/commit/0b8a242)), closes [#1186](https://github.com/algolia/instantsearch.js/issues/1186)\n\n\n\n<a name=\"1.8.13\"></a>\n## [1.8.13](https://github.com/algolia/instantsearch.js/compare/v1.8.12...v1.8.13) (2016-10-21)\n\n\n### Bug Fixes\n\n* **searchbox:** poweredBy Algolia logo weren't visible in firefox ([39701f8](https://github.com/algolia/instantsearch.js/commit/39701f8))\n\n\n\n<a name=\"1.8.12\"></a>\n## [1.8.12](https://github.com/algolia/instantsearch.js/compare/v1.8.11...v1.8.12) (2016-10-19)\n\n\n### Bug Fixes\n\n* **numericRefinementList:** classes on radio buttons (#1358) (#1432) ([fec6495](https://github.com/algolia/instantsearch.js/commit/fec6495))\n\n\n\n<a name=\"1.8.11\"></a>\n## [1.8.11](https://github.com/algolia/instantsearch.js/compare/v1.8.10...v1.8.11) (2016-10-07)\n\n\n### Bug Fixes\n\n* **merge:** merge only plain object from searchParameters ([aab1c87](https://github.com/algolia/instantsearch.js/commit/aab1c87))\n\n\n\n<a name=\"1.8.10\"></a>\n## [1.8.10](https://github.com/algolia/instantsearch.js/compare/v1.8.9...v1.8.10) (2016-10-07)\n\n\n### Bug Fixes\n\n* **lodash:** set lodash back to 4.15.0, fixes build, unknown issue for now ([ba4247e](https://github.com/algolia/instantsearch.js/commit/ba4247e))\n\n\n\n<a name=\"1.8.9\"></a>\n## [1.8.9](https://github.com/algolia/instantsearch.js/compare/v1.8.8...v1.8.9) (2016-10-07)\n\n\n### Bug Fixes\n\n* **react:** avoid duplicating React ([59010f6](https://github.com/algolia/instantsearch.js/commit/59010f6)), closes [#1386](https://github.com/algolia/instantsearch.js/issues/1386)\n\n\n\n<a name=\"1.8.8\"></a>\n## [1.8.8](https://github.com/algolia/instantsearch.js/compare/v1.8.6...v1.8.8) (2016-09-14)\n\n\n### Bug Fixes\n\n* **numericSelector:** do not change state on init (#1280) ([cf27db3](https://github.com/algolia/instantsearch.js/commit/cf27db3)), closes [#1253](https://github.com/algolia/instantsearch.js/issues/1253)\n* **Slider:** default precision to 2 (#1279) ([552b9ea](https://github.com/algolia/instantsearch.js/commit/552b9ea))\n\n\n\n<a name=\"1.8.6\"></a>\n## [1.8.6](https://github.com/algolia/instantsearch.js/compare/v1.8.5...v1.8.6) (2016-09-12)\n\n\n\n<a name=\"1.8.5\"></a>\n## [1.8.5](https://github.com/algolia/instantsearch.js/compare/v1.8.4...v1.8.5) (2016-09-06)\n\n\n### Bug Fixes\n\n* **deps:** upgrade all deps 2016-09-05 (#1261) ([408d597](https://github.com/algolia/instantsearch.js/commit/408d597))\n* **rangeSlider:** round pips numbers when step is integer (#1255) ([b993033](https://github.com/algolia/instantsearch.js/commit/b993033)), closes [#1254](https://github.com/algolia/instantsearch.js/issues/1254)\n\n\n\n<a name=\"1.8.4\"></a>\n## [1.8.4](https://github.com/algolia/instantsearch.js/compare/v1.8.3...v1.8.4) (2016-08-29)\n\n\n### Bug Fixes\n\n* **bundle:** switch back to React by default, create a preact build (#1228) ([4845868](https://github.com/algolia/instantsearch.js/commit/4845868))\n\n\n\n<a name=\"1.8.3\"></a>\n## [1.8.3](https://github.com/algolia/instantsearch.js/compare/v1.8.2...v1.8.3) (2016-08-29)\n\n\n### Bug Fixes\n\n* **numericSelector:** if no currentValue found, use the first option ([ef56dfa](https://github.com/algolia/instantsearch.js/commit/ef56dfa))\n* **poweredBy:** fixed Algolia logo version (#1223) ([aab3fc3](https://github.com/algolia/instantsearch.js/commit/aab3fc3)), closes [#1223](https://github.com/algolia/instantsearch.js/issues/1223) [#1222](https://github.com/algolia/instantsearch.js/issues/1222)\n* **Selector:** render a controlled component ([e9f6ff7](https://github.com/algolia/instantsearch.js/commit/e9f6ff7))\n\n\n### Performance Improvements\n\n* **filesize:** use preact in production build (#1224) ([5bb38f2](https://github.com/algolia/instantsearch.js/commit/5bb38f2)), closes [#1030](https://github.com/algolia/instantsearch.js/issues/1030)\n\n\n\n<a name=\"1.8.2\"></a>\n## [1.8.2](https://github.com/algolia/instantsearch.js/compare/v1.8.1...v1.8.2) (2016-08-25)\n\n\n### Bug Fixes\n\n* **lodash:** use lodash v4, reduce build size ([216d1e0](https://github.com/algolia/instantsearch.js/commit/216d1e0))\n\n\n\n<a name=\"1.8.1\"></a>\n## [1.8.1](https://github.com/algolia/instantsearch.js/compare/v1.8.0...v1.8.1) (2016-08-24)\n\n\n### Bug Fixes\n\n* **searchBox:** handle BFCache browsers (#1212) ([7deb9c3](https://github.com/algolia/instantsearch.js/commit/7deb9c3))\n* **toggle:** make autoHide check facetValue.count (#1213) ([86872eb](https://github.com/algolia/instantsearch.js/commit/86872eb))\n\n\n\n<a name=\"1.8.0\"></a>\n# [1.8.0](https://github.com/algolia/instantsearch.js/compare/v1.7.1...v1.8.0) (2016-08-18)\n\n\n### Bug Fixes\n\n* **documentation:** Change instantsearch.widgets.stats typo data.processingTimMS to data.processingTimeMS ([034703e](https://github.com/algolia/instantsearch.js/commit/034703e))\n* **documentation:** Change responsiveNavigation.js & header.html to fix #1090 ([bf3a808](https://github.com/algolia/instantsearch.js/commit/bf3a808)), closes [#1090](https://github.com/algolia/instantsearch.js/issues/1090)\n* **nouislider:** fix the slider for nouislider 8.5.1 ([af8f56b](https://github.com/algolia/instantsearch.js/commit/af8f56b))\n\n\n### Features\n\n* **clearAll:** Add optional excludeAttributes to list protected filters ([fe6d19c](https://github.com/algolia/instantsearch.js/commit/fe6d19c))\n\n\n\n<a name=\"1.7.1\"></a>\n## [1.7.1](https://github.com/algolia/instantsearch.js/compare/v1.7.0...v1.7.1) (2016-07-28)\n\n\n### Bug Fixes\n\n* **toggle:** add backward compatibility for previous toggle implem (#1154) ([a1973a0](https://github.com/algolia/instantsearch.js/commit/a1973a0))\n\n\n\n<a name=\"1.7.0\"></a>\n# [1.7.0](https://github.com/algolia/instantsearch.js/compare/v1.6.4...v1.7.0) (2016-07-26)\n\n\n### Bug Fixes\n\n* **searchParameters:** avoid mutating provided objects (#1148) ([0ea3bef](https://github.com/algolia/instantsearch.js/commit/0ea3bef)), closes [#1130](https://github.com/algolia/instantsearch.js/issues/1130)\n\n\n### Features\n\n* **toggle:** Provide a better default widget (#1146) ([d54107e](https://github.com/algolia/instantsearch.js/commit/d54107e)), closes [#1096](https://github.com/algolia/instantsearch.js/issues/1096) [#919](https://github.com/algolia/instantsearch.js/issues/919)\n\n\n\n<a name=\"1.6.4\"></a>\n## [1.6.4](https://github.com/algolia/instantsearch.js/compare/v1.6.3...v1.6.4) (2016-07-12)\n\n\n\n<a name=\"1.6.3\"></a>\n## [1.6.3](https://github.com/algolia/instantsearch.js/compare/v1.6.2...v1.6.3) (2016-07-11)\n\n\n### Bug Fixes\n\n* **Hits:** always render hits ([2e7bf8a](https://github.com/algolia/instantsearch.js/commit/2e7bf8a)), closes [#1100](https://github.com/algolia/instantsearch.js/issues/1100)\n\n\n\n<a name=\"1.6.2\"></a>\n## [1.6.2](https://github.com/algolia/instantsearch.js/compare/v1.6.1...v1.6.2) (2016-07-11)\n\n\n### Bug Fixes\n\n* **paginationLink:** it's aria-label not ariaLabel (#1125) ([70a190c](https://github.com/algolia/instantsearch.js/commit/70a190c))\n* **pricesRange:** fill the form according to the current refinement (#1126) ([12ebde7](https://github.com/algolia/instantsearch.js/commit/12ebde7)), closes [#1009](https://github.com/algolia/instantsearch.js/issues/1009)\n* **rangeSlider:** handles now support stacking (#1129) ([ad394d3](https://github.com/algolia/instantsearch.js/commit/ad394d3))\n* **rangeSlider:** use stats min/max when only user min or max is provided (#1124) ([4348463](https://github.com/algolia/instantsearch.js/commit/4348463)), closes [#1004](https://github.com/algolia/instantsearch.js/issues/1004)\n* **searchBox:** force cursor position to be at the end of the query (#1123) ([8a27769](https://github.com/algolia/instantsearch.js/commit/8a27769)), closes [#946](https://github.com/algolia/instantsearch.js/issues/946)\n* **searchBox:** IE8, IE9 needs to listen for setQuery ([97c166a](https://github.com/algolia/instantsearch.js/commit/97c166a))\n* **searchBox:** update helper query on every keystroke (#1127) ([997c0c2](https://github.com/algolia/instantsearch.js/commit/997c0c2)), closes [#1015](https://github.com/algolia/instantsearch.js/issues/1015)\n* **urlSync:** urls should be safe by default (#1104) ([db833c6](https://github.com/algolia/instantsearch.js/commit/db833c6)), closes [#982](https://github.com/algolia/instantsearch.js/issues/982)\n\n\n\n<a name=\"1.6.1\"></a>\n## [1.6.1](https://github.com/algolia/instantsearch.js/compare/v1.6.0...v1.6.1) (2016-06-20)\n\n\n### Bug Fixes\n\n* **meteorjs:** lite build must point to the browser lite (#1097) ([265ace3](https://github.com/algolia/instantsearch.js/commit/265ace3))\n* **toggle:** read numerical facet results stats for toggle count (#1098) ([1feb539](https://github.com/algolia/instantsearch.js/commit/1feb539)), closes [#1096](https://github.com/algolia/instantsearch.js/issues/1096)\n* **website:** footer wording ([8355460](https://github.com/algolia/instantsearch.js/commit/8355460))\n\n\n\n<a name=\"1.6.0\"></a>\n# [1.6.0](https://github.com/algolia/instantsearch.js/compare/v1.5.2...v1.6.0) (2016-06-13)\n\n\n### Bug Fixes\n\n* **hits:** rename __position to hitIndex ([d051a54](https://github.com/algolia/instantsearch.js/commit/d051a54))\n* **refinementList/header:** rename count to refinedFacetCount ([89ad602](https://github.com/algolia/instantsearch.js/commit/89ad602))\n\n### Features\n\n* **header:** Pass count of current refined filters in header ([d9e8582](https://github.com/algolia/instantsearch.js/commit/d9e8582)), closes [#1013](https://github.com/algolia/instantsearch.js/issues/1013) [#1041](https://github.com/algolia/instantsearch.js/issues/1041)\n* **hits:** Add a `__position` attribute to data passed to items ([43ce1c7](https://github.com/algolia/instantsearch.js/commit/43ce1c7)), closes [#903](https://github.com/algolia/instantsearch.js/issues/903)\n\n\n\n<a name=\"1.5.2\"></a>\n## [1.5.2](https://github.com/algolia/instantsearch.js/compare/v1.5.1...v1.5.2) (2016-06-10)\n\n\n### Bug Fixes\n\n* **lite:** use lite algoliasearch build (js client) ([219fa9f](https://github.com/algolia/instantsearch.js/commit/219fa9f)), closes [#1024](https://github.com/algolia/instantsearch.js/issues/1024)\n* **poweredBy:** Let users define their own poweredBy template ([f1a96d8](https://github.com/algolia/instantsearch.js/commit/f1a96d8))\n\n\n\n<a name=\"1.5.1\"></a>\n## [1.5.1](https://github.com/algolia/instantsearch.js/compare/v1.5.0...v1.5.1) (2016-05-17)\n\n\n### Bug Fixes\n\n* **numericRefinementList:** Correctly apply active class ([7cca9a4](https://github.com/algolia/instantsearch.js/commit/7cca9a4)), closes [#1010](https://github.com/algolia/instantsearch.js/issues/1010)\n\n\n\n<a name=\"1.5.0\"></a>\n# [1.5.0](https://github.com/algolia/instantsearch.js/compare/v1.4.5...v1.5.0) (2016-04-29)\n\n\n### Bug Fixes\n\n* **base href:** always create absolute URLS in widgets ([ae6dbf6](https://github.com/algolia/instantsearch.js/commit/ae6dbf6)), closes [#970](https://github.com/algolia/instantsearch.js/issues/970)\n* **IE11:** classList do not supports .add(class, class) ([ab10347](https://github.com/algolia/instantsearch.js/commit/ab10347)), closes [#989](https://github.com/algolia/instantsearch.js/issues/989)\n* **lifecycle:** save configuration done in widget.init ([07d1fea](https://github.com/algolia/instantsearch.js/commit/07d1fea))\n* **RefinementList:** use attributeNameKey when calling createURL ([253ec28](https://github.com/algolia/instantsearch.js/commit/253ec28))\n* **rootpath:** remember rootpath option on 'back' button ([01ecdaa](https://github.com/algolia/instantsearch.js/commit/01ecdaa))\n* **searchBox:** do not trigger a search when input value is the same ([81c2e80](https://github.com/algolia/instantsearch.js/commit/81c2e80))\n* **urlSync:** only start watching for changes at first render ([4a672ae](https://github.com/algolia/instantsearch.js/commit/4a672ae))\n\n### Features\n\n* **urlSync:** allow overriding replaceState(state)/pushState(state) ([989856c](https://github.com/algolia/instantsearch.js/commit/989856c))\n\n\n\n<a name=\"1.4.5\"></a>\n## [1.4.5](https://github.com/algolia/instantsearch.js/compare/v1.4.4...v1.4.5) (2016-04-18)\n\n\n### Bug Fixes\n\n* **showMore:** hide \"show less\" when nothing to hide ([5ac2bb6](https://github.com/algolia/instantsearch.js/commit/5ac2bb6))\n\n\n\n<a name=\"1.4.4\"></a>\n## [1.4.4](https://github.com/algolia/instantsearch.js/compare/v1.4.3...v1.4.4) (2016-04-15)\n\n\n### Bug Fixes\n\n* **pagination:** Disabled pagination link can no longer be clicked ([88b567f](https://github.com/algolia/instantsearch.js/commit/88b567f)), closes [#974](https://github.com/algolia/instantsearch.js/issues/974)\n* **showMore:** hide showMore when no more facet values to show ([cc31b1a](https://github.com/algolia/instantsearch.js/commit/cc31b1a))\n\n\n\n<a name=\"1.4.3\"></a>\n## [1.4.3](https://github.com/algolia/instantsearch.js/compare/v1.4.2...v1.4.3) (2016-04-01)\n\n\n### Bug Fixes\n\n* **rangeSlider:** step accepts a float value ([6ecc925](https://github.com/algolia/instantsearch.js/commit/6ecc925))\n\n\n\n<a name=\"1.4.2\"></a>\n## [1.4.2](https://github.com/algolia/instantsearch.js/compare/v1.4.1...v1.4.2) (2016-03-24)\n\n\n### Performance Improvements\n\n* **refinementList:** Stop creating URL for hidden refinements. ([2cdd17d](https://github.com/algolia/instantsearch.js/commit/2cdd17d))\n\n\n\n<a name=\"1.4.1\"></a>\n## [1.4.1](https://github.com/algolia/instantsearch.js/compare/v1.4.0...v1.4.1) (2016-03-22)\n\n\n### Bug Fixes\n\n* **searchBox:** do not update the input when focused ([61cf9be](https://github.com/algolia/instantsearch.js/commit/61cf9be)), closes [#944](https://github.com/algolia/instantsearch.js/issues/944)\n\n\n\n<a name=\"1.4.0\"></a>\n# [1.4.0](https://github.com/algolia/instantsearch.js/compare/v1.3.3...v1.4.0) (2016-03-16)\n\n\n### Bug Fixes\n\n* **url:** allow hierarchical facets in trackedParameters ([36b4011](https://github.com/algolia/instantsearch.js/commit/36b4011))\n\n### Features\n\n* **url-sync:** use the new mapping option ([f869885](https://github.com/algolia/instantsearch.js/commit/f869885)), closes [#838](https://github.com/algolia/instantsearch.js/issues/838)\n\n\n\n<a name=\"1.3.3\"></a>\n## [1.3.3](https://github.com/algolia/instantsearch.js/compare/v1.3.2...v1.3.3) (2016-03-07)\n\n\n### Bug Fixes\n\n* **headerFooter:** make collapsible click handler work ([add0d50](https://github.com/algolia/instantsearch.js/commit/add0d50))\n\n### Performance Improvements\n\n* **linters:** Greatly improve the `npm run lint` task speed ([1ba53b0](https://github.com/algolia/instantsearch.js/commit/1ba53b0))\n\n\n\n<a name=\"1.3.2\"></a>\n## [1.3.2](https://github.com/algolia/instantsearch.js/compare/v1.3.1...v1.3.2) (2016-03-07)\n\n\n### Bug Fixes\n\n* **Template:** stop leaking `data=\"[object Object]\"` attributes in production builds ([7ec0431](https://github.com/algolia/instantsearch.js/commit/7ec0431)), closes [#899](https://github.com/algolia/instantsearch.js/issues/899)\n\n### Features\n\n* **validate-pr:** Allow `docs()` commits to be merged in master ([0abc689](https://github.com/algolia/instantsearch.js/commit/0abc689))\n\n\n\n<a name=\"1.3.1\"></a>\n## [1.3.1](https://github.com/algolia/instantsearch.js/compare/v1.3.0...v1.3.1) (2016-03-07)\n\n\n### Bug Fixes\n\n* **collapsible:** stop duplicating collapsible styling ([7362901](https://github.com/algolia/instantsearch.js/commit/7362901))\n* **lodash:** stop leaking lodash in the global scope ([91f71dc](https://github.com/algolia/instantsearch.js/commit/91f71dc)), closes [#900](https://github.com/algolia/instantsearch.js/issues/900)\n\n\n\n<a name=\"1.3.0\"></a>\n# [1.3.0](https://github.com/algolia/instantsearch.js/compare/v1.2.5...v1.3.0) (2016-03-04)\n\n\n### Bug Fixes\n\n* **browser support:** make IE lte 10 work by fixing Object.getPrototypeOf ([bbb264b](https://github.com/algolia/instantsearch.js/commit/bbb264b))\n* **menu,refinementList:** sort by count AND name to avoid reorders on refine ([02fe7bf](https://github.com/algolia/instantsearch.js/commit/02fe7bf)), closes [#65](https://github.com/algolia/instantsearch.js/issues/65)\n* **priceRanges:** pass the bound refine to the form ([ce2b956](https://github.com/algolia/instantsearch.js/commit/ce2b956))\n* **searchBox:** handle external updates of the query ([6a0af14](https://github.com/algolia/instantsearch.js/commit/6a0af14)), closes [#803](https://github.com/algolia/instantsearch.js/issues/803)\n* **searchBox:** stop setting the query twice ([91270b2](https://github.com/algolia/instantsearch.js/commit/91270b2))\n* **searchBox:** stop updating query at eachkeystroke with searchOnEnterKeyPressOnly ([28dc4d2](https://github.com/algolia/instantsearch.js/commit/28dc4d2)), closes [#875](https://github.com/algolia/instantsearch.js/issues/875)\n* **Slider:** do not render Slider when range.min === range.max ([f20274e](https://github.com/algolia/instantsearch.js/commit/f20274e))\n* **Template:** now render() when templateKey changes ([8906224](https://github.com/algolia/instantsearch.js/commit/8906224))\n* **toggle:** pass isRefined to toggleRefinement ([8ac494e](https://github.com/algolia/instantsearch.js/commit/8ac494e))\n* **url-sync:** always decode incoming query string ([bea38e3](https://github.com/algolia/instantsearch.js/commit/bea38e3)), closes [#848](https://github.com/algolia/instantsearch.js/issues/848)\n* **url-sync:** handle <base> href pages ([e58aadc](https://github.com/algolia/instantsearch.js/commit/e58aadc)), closes [#790](https://github.com/algolia/instantsearch.js/issues/790)\n\n### Features\n\n* **collapsable widgets:** add collapsable and collapsed option ([c4df7c5](https://github.com/algolia/instantsearch.js/commit/c4df7c5))\n* **instantsearch:** allow overriding the helper.search function ([9a930e7](https://github.com/algolia/instantsearch.js/commit/9a930e7))\n* **rangeSlider:** allow passing min and max values ([409295c](https://github.com/algolia/instantsearch.js/commit/409295c)), closes [#858](https://github.com/algolia/instantsearch.js/issues/858)\n* **searchBox:** allow to pass a queryHook ([5786a64](https://github.com/algolia/instantsearch.js/commit/5786a64))\n* **Template:** allow template functions to return a React element ([748077d](https://github.com/algolia/instantsearch.js/commit/748077d))\n* **Template:** allow template functions to return a React element ([0f9296d](https://github.com/algolia/instantsearch.js/commit/0f9296d))\n\n### Performance Improvements\n\n* **autoHideContainer:** stop re-creating React components ([8c89862](https://github.com/algolia/instantsearch.js/commit/8c89862))\n* **formatting numbers:** stop using a default locale, use the system one ([b056554](https://github.com/algolia/instantsearch.js/commit/b056554))\n* **nouislider:** upgrade nouislider, shaves some more ms ([fefbe65](https://github.com/algolia/instantsearch.js/commit/fefbe65))\n* **React:** use babel `optimisation` option for React ([95f940c](https://github.com/algolia/instantsearch.js/commit/95f940c))\n* **React, widgets:** implement shouldComponentUpdate, reduce bind ([5efaac1](https://github.com/algolia/instantsearch.js/commit/5efaac1))\n\n\n\n<a name=\"1.2.5\"></a>\n## [1.2.5](https://github.com/algolia/instantsearch.js/compare/v1.2.4...v1.2.5) (2016-03-02)\n\n\n### Bug Fixes\n\n* **hierarchicalMenu:** configure maxValuesPerFacet using the limit option ([4868717](https://github.com/algolia/instantsearch.js/commit/4868717)), closes [#66](https://github.com/algolia/instantsearch.js/issues/66)\n\n\n\n<a name=\"1.2.4\"></a>\n## [1.2.4](https://github.com/algolia/instantsearch.js/compare/v1.2.3...v1.2.4) (2016-02-29)\n\nUpgraded the helper to 2.9.0 to support undocumented parameters from the API.\n\n\n<a name=\"1.2.3\"></a>\n## [1.2.3](https://github.com/algolia/instantsearch.js/compare/v1.2.2...v1.2.3) (2016-02-18)\n\n\n### Bug Fixes\n\n* **currentRefinedValues:** clear numeric refinements using original value ([9a0ad45](https://github.com/algolia/instantsearch.js/commit/9a0ad45)), closes [#844](https://github.com/algolia/instantsearch.js/issues/844)\n\n\n\n<a name=\"1.2.2\"></a>\n## [1.2.2](https://github.com/algolia/instantsearch.js/compare/v1.2.1...v1.2.2) (2016-02-03)\n\n\n### Features\n\n* **menu:** add showMore option ([e7e7677](https://github.com/algolia/instantsearch.js/commit/e7e7677)), closes [#815](https://github.com/algolia/instantsearch.js/issues/815)\n\n\n\n<a name=\"1.2.1\"></a>\n## [1.2.1](https://github.com/algolia/instantsearch.js/compare/v1.2.0...v1.2.1) (2016-02-02)\n\n\n### Bug Fixes\n\n* **showmore:** now showMore in doc and also show-more BEM ([a020439](https://github.com/algolia/instantsearch.js/commit/a020439))\n\n\n\n<a name=\"1.2.0\"></a>\n# [1.2.0](https://github.com/algolia/instantsearch.js/compare/v1.1.3...v1.2.0) (2016-02-02)\n\n\n### Bug Fixes\n\n* **all:** typos ([fa8ba09](https://github.com/algolia/instantsearch.js/commit/fa8ba09))\n* **currentRefinedValues:** allow array of strings for cssClasses.* ([55b3a3f](https://github.com/algolia/instantsearch.js/commit/55b3a3f))\n* **docs:** fixed bad link to scss in custom themes section ([823a859](https://github.com/algolia/instantsearch.js/commit/823a859))\n* **getRefinements:** a name should be a string ([7efd1fd](https://github.com/algolia/instantsearch.js/commit/7efd1fd))\n* **getRefinements:** hierarchical facets ([fe0fc5d](https://github.com/algolia/instantsearch.js/commit/fe0fc5d))\n* **index:** Use module.exports instead of export on index ([81e7eee](https://github.com/algolia/instantsearch.js/commit/81e7eee))\n* **pagination:** remove default value of maxPages. Fixes #761 ([607fe9a](https://github.com/algolia/instantsearch.js/commit/607fe9a)), closes [#761](https://github.com/algolia/instantsearch.js/issues/761)\n* **prepareTemplates:** uses templates with keys that are not in defaults ([c4bf8ec](https://github.com/algolia/instantsearch.js/commit/c4bf8ec))\n* **rangeSlider:**     prevent slider from extending farther than the last pip ([6e534f5](https://github.com/algolia/instantsearch.js/commit/6e534f5))\n* **search-box:** update value when state changes from the outside ([4550f99](https://github.com/algolia/instantsearch.js/commit/4550f99))\n* **url-sync:** adds indexName in the helper configuration ([e50bafd](https://github.com/algolia/instantsearch.js/commit/e50bafd))\n* **url-sync:** Makes url sync more reliable ([3157abc](https://github.com/algolia/instantsearch.js/commit/3157abc)), closes [#730](https://github.com/algolia/instantsearch.js/issues/730) [#729](https://github.com/algolia/instantsearch.js/issues/729)\n\n### Features\n\n* **currentRefinedValues:** new widget ([6c926d0](https://github.com/algolia/instantsearch.js/commit/6c926d0)), closes [#404](https://github.com/algolia/instantsearch.js/issues/404)\n* **hits:** adds allItems template as an alternative to item ([1f3f889](https://github.com/algolia/instantsearch.js/commit/1f3f889))\n* **poweredBy:** automatically add utm link to poweredBy ([05d1425](https://github.com/algolia/instantsearch.js/commit/05d1425)), closes [#711](https://github.com/algolia/instantsearch.js/issues/711)\n* **priceRanges:** add currency option ([f41484a](https://github.com/algolia/instantsearch.js/commit/f41484a))\n* **refinementlist:** lets configure showmore feature ([3b8688a](https://github.com/algolia/instantsearch.js/commit/3b8688a))\n* **Template:** accepts any parameters and forwards them ([5170f53](https://github.com/algolia/instantsearch.js/commit/5170f53))\n\n\n\n<a name=\"1.1.3\"></a>\n## [1.1.3](https://github.com/algolia/instantsearch.js/compare/v1.1.2...v1.1.3) (2016-01-12)\n\n\n### Bug Fixes\n\n* **searchBox:** fixes cssClasses option ([660ee2f](https://github.com/algolia/instantsearch.js/commit/660ee2f)), closes [#775](https://github.com/algolia/instantsearch.js/issues/775)\n\n\n\n<a name=\"1.1.2\"></a>\n## [1.1.2](https://github.com/algolia/instantsearch.js/compare/v1.1.1...v1.1.2) (2016-01-08)\n\n\n\n\n<a name=\"1.1.1\"></a>\n## [1.1.1](https://github.com/algolia/instantsearch.js/compare/v1.1.0...v1.1.1) (2016-01-07)\n\n\n### Bug Fixes\n\n* **style:** keyframes ([40eb0a5](https://github.com/algolia/instantsearch.js/commit/40eb0a5))\n* **url-sync:** adds indexName in the helper configuration ([c2c0bc7](https://github.com/algolia/instantsearch.js/commit/c2c0bc7))\n\n### Features\n\n* **clearRefinements:** Added two utils methods ([49564e1](https://github.com/algolia/instantsearch.js/commit/49564e1))\n\n\n\n<a name=\"1.1.0\"></a>\n# [1.1.0](https://github.com/algolia/instantsearch.js/compare/v1.0.0...v1.1.0) (2015-11-26)\n\n\n### Bug Fixes\n\n* **pagination:** fix #668 edge case ([d8f1196](https://github.com/algolia/instantsearch.js/commit/d8f1196)), closes [#668](https://github.com/algolia/instantsearch.js/issues/668)\n* **priceRanges:** Remove round from first range ([bf82395](https://github.com/algolia/instantsearch.js/commit/bf82395))\n* **slider:** hide the slider when stats.min=stats.max ([42e4b64](https://github.com/algolia/instantsearch.js/commit/42e4b64))\n* **starRating:** Retrieve the correct count and use numericRefinement ([f00ce38](https://github.com/algolia/instantsearch.js/commit/f00ce38)), closes [#615](https://github.com/algolia/instantsearch.js/issues/615)\n\n### Features\n\n* **hierarchical:** expose rootPath and showParentLevel ([6e9bb7c](https://github.com/algolia/instantsearch.js/commit/6e9bb7c))\n\n\n\n<a name=\"1.0.0\"></a>\n# [1.0.0](https://github.com/algolia/instantsearch.js/compare/v0.14.9...v1.0.0) (2015-11-18)\n\n\n\n\n<a name=\"0.14.9\"></a>\n## [0.14.9](https://github.com/algolia/instantsearch.js/compare/v0.14.8...v0.14.9) (2015-11-18)\n\n\n\n\n<a name=\"0.14.8\"></a>\n## [0.14.8](https://github.com/algolia/instantsearch.js/compare/v0.14.7...v0.14.8) (2015-11-18)\n\n\n\n\n<a name=\"0.14.7\"></a>\n## [0.14.7](https://github.com/algolia/instantsearch.js/compare/v0.14.6...v0.14.7) (2015-11-18)\n\n\n\n\n<a name=\"0.14.6\"></a>\n## [0.14.6](https://github.com/algolia/instantsearch.js/compare/v0.14.5...v0.14.6) (2015-11-17)\n\n\n\n\n<a name=\"0.14.5\"></a>\n## [0.14.5](https://github.com/algolia/instantsearch.js/compare/v0.14.4...v0.14.5) (2015-11-17)\n\n\n\n\n<a name=\"0.14.4\"></a>\n## [0.14.4](https://github.com/algolia/instantsearch.js/compare/v0.14.3...v0.14.4) (2015-11-17)\n\n\n### Bug Fixes\n\n* **doc:** Expand input on documentation page ([6814a14](https://github.com/algolia/instantsearch.js/commit/6814a14))\n\n\n\n<a name=\"0.14.3\"></a>\n## [0.14.3](https://github.com/algolia/instantsearch.js/compare/v0.14.2...v0.14.3) (2015-11-17)\n\n\n### Bug Fixes\n\n* **examples:** media logo ([64f850e](https://github.com/algolia/instantsearch.js/commit/64f850e))\n* **website:** demos link to https ([b69c0f5](https://github.com/algolia/instantsearch.js/commit/b69c0f5))\n\n\n\n<a name=\"0.14.2\"></a>\n## [0.14.2](https://github.com/algolia/instantsearch.js/compare/v0.14.1...v0.14.2) (2015-11-17)\n\n\n### Bug Fixes\n\n* **numericSelector:** pass currentValue as the refined value, not the full obj ([9286b4b](https://github.com/algolia/instantsearch.js/commit/9286b4b))\n* **website:** search icon ([623f071](https://github.com/algolia/instantsearch.js/commit/623f071))\n\n\n\n<a name=\"0.14.1\"></a>\n## [0.14.1](https://github.com/algolia/instantsearch.js/compare/v0.14.0...v0.14.1) (2015-11-16)\n\n\n### Bug Fixes\n\n* **docs:** minor CSS fixes ([94fa868](https://github.com/algolia/instantsearch.js/commit/94fa868)), closes [#573](https://github.com/algolia/instantsearch.js/issues/573)\n\n\n\n<a name=\"0.14.0\"></a>\n# [0.14.0](https://github.com/algolia/instantsearch.js/compare/v0.13.0...v0.14.0) (2015-11-13)\n\n\n### Bug Fixes\n\n* **hierarchicalMenu:** handle limit option ([968cf58](https://github.com/algolia/instantsearch.js/commit/968cf58)), closes [#585](https://github.com/algolia/instantsearch.js/issues/585) [#235](https://github.com/algolia/instantsearch.js/issues/235)\n* **numeric-selector:** makes init comply with the new API ([068e8d3](https://github.com/algolia/instantsearch.js/commit/068e8d3))\n\n### Features\n\n* **core:** sends a custom User Agent ([2561154](https://github.com/algolia/instantsearch.js/commit/2561154))\n* **lifecycle:** makes init API consistent with the rest ([e7ed81f](https://github.com/algolia/instantsearch.js/commit/e7ed81f))\n\n### BREAKING CHANGES\n\n* all widgets using \"facetName\" are now using \"attributeName\"\n\n<a name=\"0.13.0\"></a>\n# [0.13.0](https://github.com/algolia/instantsearch.js/compare/v0.12.3...v0.13.0) (2015-11-12)\n\n\n### Features\n\n* **clearAll:** New widget ([9e61a14](https://github.com/algolia/instantsearch.js/commit/9e61a14))\n\n\n\n<a name=\"0.12.3\"></a>\n## [0.12.3](https://github.com/algolia/instantsearch.js/compare/v0.12.2...v0.12.3) (2015-11-12)\n\n\n\n\n<a name=\"0.12.2\"></a>\n## [0.12.2](https://github.com/algolia/instantsearch.js/compare/v0.12.1...v0.12.2) (2015-11-12)\n\n\n### Bug Fixes\n\n* **layout:** missing div (did we lost that fix?) ([9a515e4](https://github.com/algolia/instantsearch.js/commit/9a515e4))\n\n\n\n<a name=\"0.12.1\"></a>\n## [0.12.1](https://github.com/algolia/instantsearch.js/compare/v0.12.0...v0.12.1) (2015-11-12)\n\n\n### Bug Fixes\n\n* **counts:** missing formatNumber calls ([65e5ba0](https://github.com/algolia/instantsearch.js/commit/65e5ba0)), closes [#560](https://github.com/algolia/instantsearch.js/issues/560)\n* **doc:** ensure selector is not conflicting ([6528f2c](https://github.com/algolia/instantsearch.js/commit/6528f2c)), closes [#505](https://github.com/algolia/instantsearch.js/issues/505)\n* **docs:** improved label/input hover debug ([58573db](https://github.com/algolia/instantsearch.js/commit/58573db)), closes [#503](https://github.com/algolia/instantsearch.js/issues/503)\n* **examples/airbnb:** Use default theme from CDN ([f379c0a](https://github.com/algolia/instantsearch.js/commit/f379c0a)), closes [#522](https://github.com/algolia/instantsearch.js/issues/522)\n* **examples/youtube:** use the default theme ([cf9a4b6](https://github.com/algolia/instantsearch.js/commit/cf9a4b6))\n* **rangeSlider:** fixed tooltip CSS & outdated default theme. ([c4be2ef](https://github.com/algolia/instantsearch.js/commit/c4be2ef))\n\n\n\n<a name=\"0.12.0\"></a>\n# [0.12.0](https://github.com/algolia/instantsearch.js/compare/v0.11.1...v0.12.0) (2015-11-10)\n\n\n### Bug Fixes\n\n* **pagination:** Fix double BEM classes on elements ([2ede317](https://github.com/algolia/instantsearch.js/commit/2ede317)), closes [#500](https://github.com/algolia/instantsearch.js/issues/500)\n* **price-ranges:** fix usage + add test ([89601d7](https://github.com/algolia/instantsearch.js/commit/89601d7))\n* **range-slider:** check usage + display (fixes #395) ([301643a](https://github.com/algolia/instantsearch.js/commit/301643a)), closes [#395](https://github.com/algolia/instantsearch.js/issues/395)\n* **rangeSlider:** error when no result ([70e8554](https://github.com/algolia/instantsearch.js/commit/70e8554))\n* **theme:** Revert default spacing into pagination ([d755fd5](https://github.com/algolia/instantsearch.js/commit/d755fd5))\n\n\n### BREAKING CHANGES\n\n* pagination: Removes all `__disabled`, `__first`, `__last`,\n`__next`, `__previous`, `__active` and `__page` classes added on the links in the\npagination. It only ads them to the parent `li`. Links instead now\nhave a `.ais-pagination--link` class\n\nPreviously, the same CSS classes where added to both the `item` (`li`) and the\nlink inside it. I've split them in `--item` and `--link`.\n\nI've also made the various active/first/disabled/etc modifiers as\nactual `__modifier` classes.\n\nI've updated the tests, the CSS skeleton, the examples and the docs\naccordingly.\n\n\n\n<a name=\"0.11.1\"></a>\n## [0.11.1](https://github.com/algolia/instantsearch.js/compare/v0.11.0...v0.11.1) (2015-11-10)\n\n\n\n\n<a name=\"0.11.0\"></a>\n# [0.11.0](https://github.com/algolia/instantsearch.js/compare/v0.10.0...v0.11.0) (2015-11-06)\n\n### Bug Fixes\n\n* **bem:** Make scss mixins actually follow BEM ([fcfb408](https://github.com/algolia/instantsearch.js/commit/fcfb408))\n* **doc:** bolder font for the navigation ([64f6d56](https://github.com/algolia/instantsearch.js/commit/64f6d56))\n* **InstantSearch:** throw error when init and render are not defined. Fixes #499 ([2830cd3](https://github.com/algolia/instantsearch.js/commit/2830cd3)), closes [#499](https://github.com/algolia/instantsearch.js/issues/499)\n* **live-doc:** adds a start at a responsive display ([c83967e](https://github.com/algolia/instantsearch.js/commit/c83967e))\n* **live-doc:** adds navigation menu for smaller screens ([a6bb71e](https://github.com/algolia/instantsearch.js/commit/a6bb71e))\n* **live-doc:** fixes flow for texts ([3855071](https://github.com/algolia/instantsearch.js/commit/3855071))\n* **live-doc:** Momentum scroll for iPhone ([60a36ff](https://github.com/algolia/instantsearch.js/commit/60a36ff))\n* **live-doc:** uses only h4 and fixes style of h4 (mobile) ([0fdd2d0](https://github.com/algolia/instantsearch.js/commit/0fdd2d0))\n* **middle-click:** Allow middle click on links ([a7601c0](https://github.com/algolia/instantsearch.js/commit/a7601c0))\n* **range-slider:** Use lodash find instead of Array.prototype.find ([056153c](https://github.com/algolia/instantsearch.js/commit/056153c))\n* **searchBox:** handling pasting event with contextual menu. ([a172458](https://github.com/algolia/instantsearch.js/commit/a172458)), closes [#467](https://github.com/algolia/instantsearch.js/issues/467)\n* **website:** defered doc scripts ([0c1324f](https://github.com/algolia/instantsearch.js/commit/0c1324f))\n* **website:** doc layout responsive ([a4dc894](https://github.com/algolia/instantsearch.js/commit/a4dc894))\n* **website:** fixed space overlay color animation ([200b8a7](https://github.com/algolia/instantsearch.js/commit/200b8a7))\n* **website:** Fixes & responsive stuff for doc ([7a8f920](https://github.com/algolia/instantsearch.js/commit/7a8f920))\n* **website:** footer markup ([95364a1](https://github.com/algolia/instantsearch.js/commit/95364a1))\n* **website:** home.js lint ([b70e06e](https://github.com/algolia/instantsearch.js/commit/b70e06e))\n* **website:** icon-theme didn't like svgo (to fix) ([38d84af](https://github.com/algolia/instantsearch.js/commit/38d84af))\n* **website:** image alt ([30cca29](https://github.com/algolia/instantsearch.js/commit/30cca29))\n* **website:** jsdelivr for every scripts ([06591d4](https://github.com/algolia/instantsearch.js/commit/06591d4))\n* **website:** Nav Icon + logo ([c1f419c](https://github.com/algolia/instantsearch.js/commit/c1f419c))\n* **website:** only load what's needed in bootstrap ([4843474](https://github.com/algolia/instantsearch.js/commit/4843474))\n* **website:** removed animation debug ([01ac079](https://github.com/algolia/instantsearch.js/commit/01ac079))\n* **website:** space bg fadeIn ([5e09844](https://github.com/algolia/instantsearch.js/commit/5e09844))\n* **website:** unclosed content block ([d42dc3e](https://github.com/algolia/instantsearch.js/commit/d42dc3e))\n\n### Features\n\n* **hierarchicalMenu:** Adding indentation with default theme ([34885d2](https://github.com/algolia/instantsearch.js/commit/34885d2))\n\n\n### BREAKING CHANGES\n\n* hierarchicalMenu: Hierarchical menu levels 1 and 2 now have\na margin-left added in the default theme.\n\n\n<a name=\"0.10.0\"></a>\n# [0.10.0](https://github.com/algolia/instantsearch.js/compare/v0.9.0...v0.10.0) (2015-11-06)\n\n\n### Bug Fixes\n\n* **api:** rename hideContainerWhenNoResults to autoHideContainer ([3f64bef](https://github.com/algolia/instantsearch.js/commit/3f64bef)), closes [#407](https://github.com/algolia/instantsearch.js/issues/407)\n* **doc:** ensure the documentation content doesn't overflow ([1e28a4e](https://github.com/algolia/instantsearch.js/commit/1e28a4e)), closes [#444](https://github.com/algolia/instantsearch.js/issues/444)\n* **hitsPerPageSelector:** Be more tolerant in options ([e14a344](https://github.com/algolia/instantsearch.js/commit/e14a344))\n* **numeric widgets:** synchronizes rounded value between widgets ([b314160](https://github.com/algolia/instantsearch.js/commit/b314160))\n* **numeric-refinement:** Replace Array.find with lodash find/includes ([b3e815c](https://github.com/algolia/instantsearch.js/commit/b3e815c))\n* **price-ranges:** makes it uses same operator as the slider ([ad6f5c2](https://github.com/algolia/instantsearch.js/commit/ad6f5c2))\n* **range-slider:** fixes bound definition ([e15c9b7](https://github.com/algolia/instantsearch.js/commit/e15c9b7))\n* **selector:** makes component as uncontrolled component ([1dda12a](https://github.com/algolia/instantsearch.js/commit/1dda12a))\n* **slider:** fixed `pip` propTypes constraint ([c77b7f4](https://github.com/algolia/instantsearch.js/commit/c77b7f4))\n* **website:** fix images path ([a3f62eb](https://github.com/algolia/instantsearch.js/commit/a3f62eb))\n\n### Features\n\n* **searchBox:** ability to be non-instant ([b3ef871](https://github.com/algolia/instantsearch.js/commit/b3ef871)), closes [#458](https://github.com/algolia/instantsearch.js/issues/458)\n* **toggle:** Allow custom on/off values ([9b6c2bf](https://github.com/algolia/instantsearch.js/commit/9b6c2bf)), closes [#409](https://github.com/algolia/instantsearch.js/issues/409)\n\n### Performance Improvements\n\n* **hitsPerPageSelector:** Use the correct lodash function ([be9aea7](https://github.com/algolia/instantsearch.js/commit/be9aea7))\n\n\n### BREAKING CHANGES\n\n* api: use autoHideContainer instead of\nhideContainerWhenNoResults\n\n\n\n<a name=\"0.9.0\"></a>\n# [0.9.0](https://github.com/algolia/instantsearch.js/compare/v0.8.2...v0.9.0) (2015-11-04)\n\n\n### Features\n\n* **numericRefinementList:** create numericRefinementList widget using refinementList component ([a29e9c7](https://github.com/algolia/instantsearch.js/commit/a29e9c7))\n\n\n\n<a name=\"0.8.2\"></a>\n## [0.8.2](https://github.com/algolia/instantsearch.js/compare/v0.8.1...v0.8.2) (2015-11-04)\n\n\n### Bug Fixes\n\n* **doc:** All wigdets in docs are not anymore linked together #fix #446 ([4361320](https://github.com/algolia/instantsearch.js/commit/4361320)), closes [#446](https://github.com/algolia/instantsearch.js/issues/446)\n* **hitsPerPageSelector:** Issue when state did not have a `hitsPerPage` ([dc9371c](https://github.com/algolia/instantsearch.js/commit/dc9371c))\n\n\n\n<a name=\"0.8.1\"></a>\n## [0.8.1](https://github.com/algolia/instantsearch.js/compare/v0.8.0...v0.8.1) (2015-11-04)\n\n\n### Bug Fixes\n\n* **hierarchicalMenu:** handle cases where no results after a search ([0a1d0ac](https://github.com/algolia/instantsearch.js/commit/0a1d0ac)), closes [#385](https://github.com/algolia/instantsearch.js/issues/385)\n\n### Features\n\n* **build:** allow building React based custom widgets ([cfbbfe4](https://github.com/algolia/instantsearch.js/commit/cfbbfe4)), closes [#373](https://github.com/algolia/instantsearch.js/issues/373)\n\n\n\n<a name=\"0.8.0\"></a>\n# [0.8.0](https://github.com/algolia/instantsearch.js/compare/v0.7.0...v0.8.0) (2015-11-03)\n\n\n### Bug Fixes\n\n* **cssClasses:** Fixed duplication of classNames ([e193f45](https://github.com/algolia/instantsearch.js/commit/e193f45)), closes [#388](https://github.com/algolia/instantsearch.js/issues/388)\n* **doc:** add doctype were missing ([86a18aa](https://github.com/algolia/instantsearch.js/commit/86a18aa))\n* **doc:** new color scheme ([deccc17](https://github.com/algolia/instantsearch.js/commit/deccc17))\n* **doc:** only show a scrollbar when needed ([f2d955b](https://github.com/algolia/instantsearch.js/commit/f2d955b))\n* **hierarchical:** setPage 0 when toggling ([a976539](https://github.com/algolia/instantsearch.js/commit/a976539)), closes [#371](https://github.com/algolia/instantsearch.js/issues/371)\n* **jsdoc:** use babel-node ([453dc21](https://github.com/algolia/instantsearch.js/commit/453dc21))\n* **live-doc:** generates missing ul ([b43e6e2](https://github.com/algolia/instantsearch.js/commit/b43e6e2))\n* **live-doc:** move scrollbars, removes useless ones ([548ae5f](https://github.com/algolia/instantsearch.js/commit/548ae5f))\n* **live-doc:** moves octocat link to top. Removes stackOverflow ([8ff6a79](https://github.com/algolia/instantsearch.js/commit/8ff6a79))\n* **live-doc:** Moves version in the main content ([27731c3](https://github.com/algolia/instantsearch.js/commit/27731c3))\n* **live-reload:** integrates the links into the menu flow ([c118051](https://github.com/algolia/instantsearch.js/commit/c118051))\n* **numerical widgets:** s/facetName/attributeName ([f209f5d](https://github.com/algolia/instantsearch.js/commit/f209f5d)), closes [#431](https://github.com/algolia/instantsearch.js/issues/431)\n* **refinementList:** ensure the key reflects the underlying state ([b048f0b](https://github.com/algolia/instantsearch.js/commit/b048f0b)), closes [#398](https://github.com/algolia/instantsearch.js/issues/398)\n\n### Features\n\n* **examples:** try examples instead of themes ([bedffce](https://github.com/algolia/instantsearch.js/commit/bedffce))\n* **headerFooter:** Only add markup if a template is defined ([7a2d22d](https://github.com/algolia/instantsearch.js/commit/7a2d22d)), closes [#370](https://github.com/algolia/instantsearch.js/issues/370)\n* **priceRanges:** Add BEM classes and tests ([ad58d7a](https://github.com/algolia/instantsearch.js/commit/ad58d7a)), closes [#387](https://github.com/algolia/instantsearch.js/issues/387)\n\n\n### BREAKING CHANGES\n\n* numerical widgets: the priceRanges and rangeSlider widgets are now using `attributeName` instead of `facetName`.\n* priceRanges: `ais-price-ranges--range` are now named\n`ais-price-ranges--item` and are wrapped in\na `ais-price-ranges--list`.\n\nI've moved the bottom form into it's own PriceRangesForm component,\nalong with its own tests. I've fixed a minor typo where the component\nwas internally named PriceRange (without the final __s__).\n\nI factorize some logic form the render in individual methods and\nmanage to individually test them. This was not an easy task. I had to\nmock the default `render` (so it does nothing) before instantiating\nthe component. Then, I was able to call each inner method\nindividually. This requires to stub prototype methods in beforeEach,\nthen restore them in afterEach. I've added a few helper methods, this\ncan surely be simplified again but this gives nice granularity in\ntesting.\n\nI've renamed the `range` items to `item` and wrapped them in a `list`.\nI've also added classes to all elements we add (`label`, `separator`,\netc). I've removed the empty `span`s.\n* headerFooter: The `<div class=\"ais-header\">` and `<div\nclass=\"ais-footer\">` markup is only added when\na `templates.{header,footer}` is passed.\n\n\n\n<a name=\"0.7.0\"></a>\n# [0.7.0](https://github.com/algolia/instantsearch.js/compare/v0.6.5...v0.7.0) (2015-10-28)\n\n\n### Features\n\n* **searchBox:** Add `wrapInput` option ([b327dbc](https://github.com/algolia/instantsearch.js/commit/b327dbc))\n* **urls:** ability to create an URL from a set of params ([9ca8369](https://github.com/algolia/instantsearch.js/commit/9ca8369)), closes [#372](https://github.com/algolia/instantsearch.js/issues/372)\n\n\n### BREAKING CHANGES\n\n* urls: the instantsearch.createURL method is now taking a\nsimple JS object and not a SearchParameter instance anymore.\n* searchBox: The `input` used by the search-box widget is now\nwrapped in a `<div class=\"ais-search-box\">` by default. This can be\nturned off with `wrapInput: false`.\n\nThis PR is a bit long, I had to do some minor refactoring to keep the\nnew code understandable. I simply split the large `init` method into\ncalls to smaller methods.\n\nThere is some vanilla JS DOM manipulation involved to handle all the\npossible cases: targeting an `input` or a `div`, adding or not the\n`poweredBy`, adding or not the wrapping div.\n\nNote that there is no `targetNode.insertAfter(newNode)` method, so\nI had to resort to the old trick of `parentNode.insertBefore(newNode,\ntargetNode.nextSibling)`.\n\n\n\n<a name=\"0.6.5\"></a>\n## [0.6.5](https://github.com/algolia/instantsearch.js/compare/v0.6.4...v0.6.5) (2015-10-27)\n\n\n\n\n<a name=\"0.6.4\"></a>\n## [0.6.4](https://github.com/algolia/instantsearch.js/compare/v0.6.3...v0.6.4) (2015-10-27)\n\n\n\n\n<a name=\"0.6.3\"></a>\n## [0.6.3](https://github.com/algolia/instantsearch.js/compare/v0.6.2...v0.6.3) (2015-10-27)\n\n\n\n\n<a name=\"0.6.2\"></a>\n## [0.6.2](https://github.com/algolia/instantsearch.js/compare/v0.6.1...v0.6.2) (2015-10-27)\n\n\n\n\n<a name=\"0.6.1\"></a>\n## [0.6.1](https://github.com/algolia/instantsearch.js/compare/v0.6.0...v0.6.1) (2015-10-27)\n\n\n\n\n<a name=\"0.6.0\"></a>\n# [0.6.0](https://github.com/algolia/instantsearch.js/compare/v0.5.1...v0.6.0) (2015-10-27)\n\n\n### Bug Fixes\n\n* **generateRanges:** avoid any infinite loop. Fix #351 ([4965222](https://github.com/algolia/instantsearch.js/commit/4965222)), closes [#351](https://github.com/algolia/instantsearch.js/issues/351)\n* **index-selector:** Fix tests passing with incorrect parameters ([8fc31b9](https://github.com/algolia/instantsearch.js/commit/8fc31b9))\n* **index-selector:** Update usage and error ([a7e4c10](https://github.com/algolia/instantsearch.js/commit/a7e4c10))\n* **priceRanges:** fixed 'active' CSS class not using BEM ([ec0d1b1](https://github.com/algolia/instantsearch.js/commit/ec0d1b1))\n* **priceRanges:** plug the URL computation. Fix #354 ([fbf4022](https://github.com/algolia/instantsearch.js/commit/fbf4022)), closes [#354](https://github.com/algolia/instantsearch.js/issues/354)\n* **template:** transformData checks too strict ([609f123](https://github.com/algolia/instantsearch.js/commit/609f123)), closes [#347](https://github.com/algolia/instantsearch.js/issues/347)\n\n### Features\n\n* **hits-per-page-selector:** New widget to change hitsPerPage ([a3e0f78](https://github.com/algolia/instantsearch.js/commit/a3e0f78)), closes [#331](https://github.com/algolia/instantsearch.js/issues/331)\n\n\n### BREAKING CHANGES\n\n* priceRanges: the `input-group` modifier has been renamed to `form`\n\n\n\n<a name=\"0.5.1\"></a>\n## [0.5.1](https://github.com/algolia/instantsearch.js/compare/v0.5.0...v0.5.1) (2015-10-22)\n\n\n### Bug Fixes\n\n* **autohide:** Rename attribute to `hideContainerWhenNoResults` ([ecb6756](https://github.com/algolia/instantsearch.js/commit/ecb6756)), closes [#325](https://github.com/algolia/instantsearch.js/issues/325)\n\n\n### BREAKING CHANGES\n\n* autohide: Widget attribute is now named\n`hideContainerWhenNoResults` instead of `hideWhenNoResults` to be more\nexplicit on what it is really doing.\n\nAlso internally renamed the `autoHide` decorator to\n`autoHideContainer`\n\n\n\n<a name=\"0.5.0\"></a>\n# [0.5.0](https://github.com/algolia/instantsearch.js/compare/v0.4.1...v0.5.0) (2015-10-22)\n\n\n### Bug Fixes\n\n* **example:** Example searchbox ([cdad6c7](https://github.com/algolia/instantsearch.js/commit/cdad6c7)), closes [#157](https://github.com/algolia/instantsearch.js/issues/157)\n* **hierarchicalFacets:** use a real attribute name for the hierarchicalFacet name ([0d2a455](https://github.com/algolia/instantsearch.js/commit/0d2a455))\n* **hits:** Fix warning about unique key in iterator ([0c9468c](https://github.com/algolia/instantsearch.js/commit/0c9468c))\n* **onClick:** do not replace the browser's behavior on special clicks ([8562d49](https://github.com/algolia/instantsearch.js/commit/8562d49)), closes [#278](https://github.com/algolia/instantsearch.js/issues/278)\n* **package.json:** typo in repository ([33cf196](https://github.com/algolia/instantsearch.js/commit/33cf196))\n* **pagination:** do not generate the URL for disabled pages. ([e5d78ab](https://github.com/algolia/instantsearch.js/commit/e5d78ab)), closes [#282](https://github.com/algolia/instantsearch.js/issues/282)\n* **poweredBy:** Extract its hiding capabilities ([f5fa9ee](https://github.com/algolia/instantsearch.js/commit/f5fa9ee)), closes [#189](https://github.com/algolia/instantsearch.js/issues/189)\n* **rangeSlider:** refinements cleanuo ([16c132c](https://github.com/algolia/instantsearch.js/commit/16c132c)), closes [#147](https://github.com/algolia/instantsearch.js/issues/147)\n* **rangeSlider:** restore wrongly removed state nesting ([3ed3d39](https://github.com/algolia/instantsearch.js/commit/3ed3d39))\n* **React:** require React in order for JSX to work in widgets ([64d6011](https://github.com/algolia/instantsearch.js/commit/64d6011))\n* **react-nouislider:** upgrade react-nouislider to avoid mutating props ([1b7cd1d](https://github.com/algolia/instantsearch.js/commit/1b7cd1d))\n* **refinementList:** Remove `singleRefine` attribute ([db73e38](https://github.com/algolia/instantsearch.js/commit/db73e38)), closes [#220](https://github.com/algolia/instantsearch.js/issues/220)\n* **refinementList:** singleRefine is not dependant from operator ([d29dff6](https://github.com/algolia/instantsearch.js/commit/d29dff6))\n* **RefinementList:** click on child should not click on parent ([d476da2](https://github.com/algolia/instantsearch.js/commit/d476da2)), closes [#191](https://github.com/algolia/instantsearch.js/issues/191)\n* **Slider:** cssClasses.body handled by headerFooter HOC ([d8d20b2](https://github.com/algolia/instantsearch.js/commit/d8d20b2))\n* **stats:** Move CSS classes definition to widget from component ([99073cd](https://github.com/algolia/instantsearch.js/commit/99073cd))\n* **transformData:** add an explicit error message ([94c53d3](https://github.com/algolia/instantsearch.js/commit/94c53d3)), closes [#212](https://github.com/algolia/instantsearch.js/issues/212)\n* **transformData:** this test is not needed, already covered by Template ([36e5b9c](https://github.com/algolia/instantsearch.js/commit/36e5b9c))\n* **validate-commit:** Update the regexp ([96b93ba](https://github.com/algolia/instantsearch.js/commit/96b93ba))\n\n### Features\n\n* **bem:** Add BEM to the index-selector widget ([564da51](https://github.com/algolia/instantsearch.js/commit/564da51))\n* **bem:** Add BEM-styling to the Stats widget ([92cebeb](https://github.com/algolia/instantsearch.js/commit/92cebeb))\n* **build:** Add minified CSS theme version to build ([77f0640](https://github.com/algolia/instantsearch.js/commit/77f0640))\n* **core/lifecycle-event:** emits `render` when render ([7f03ae9](https://github.com/algolia/instantsearch.js/commit/7f03ae9))\n* **es7:** Enable `es7.objectRestSpread` ([fc2fbc4](https://github.com/algolia/instantsearch.js/commit/fc2fbc4))\n* **headerFooter:** Add BEM classes to header and footer ([9e9d438](https://github.com/algolia/instantsearch.js/commit/9e9d438)), closes [#259](https://github.com/algolia/instantsearch.js/issues/259)\n* **hierarchical-menu:** Add BEM classes ([58ec191](https://github.com/algolia/instantsearch.js/commit/58ec191))\n* **hierarchical-menu:** Add CSS classes dependent on the depth ([1256ea8](https://github.com/algolia/instantsearch.js/commit/1256ea8))\n* **hits:** Add BEM styling to the `hits` widget ([6681960](https://github.com/algolia/instantsearch.js/commit/6681960))\n* **menu:** Add BEM classes ([467f49e](https://github.com/algolia/instantsearch.js/commit/467f49e))\n* **pagination:** add `scrollTo` option ([e6cd621](https://github.com/algolia/instantsearch.js/commit/e6cd621)), closes [#73](https://github.com/algolia/instantsearch.js/issues/73)\n* **priceRanges:** new Amazon-style price ranges widget ([e5fe344](https://github.com/algolia/instantsearch.js/commit/e5fe344))\n* **priceRanges:** polish priceRanges widget ([0994e6f](https://github.com/algolia/instantsearch.js/commit/0994e6f))\n* **refinement-list:** Add BEM naming ([b09b830](https://github.com/algolia/instantsearch.js/commit/b09b830))\n* **refinementlist:** Move default templates to its own file ([cb6fa16](https://github.com/algolia/instantsearch.js/commit/cb6fa16))\n* **refinementList:** Limits improvement ([ebcc8a9](https://github.com/algolia/instantsearch.js/commit/ebcc8a9))\n* **searchbox:** Make the searchBox BEMish ([db8bd60](https://github.com/algolia/instantsearch.js/commit/db8bd60))\n* **theme:** Add `searchBox` widget to default theme ([def831f](https://github.com/algolia/instantsearch.js/commit/def831f))\n* **theme:** Add debug.css file ([ff8f2dc](https://github.com/algolia/instantsearch.js/commit/ff8f2dc)), closes [#249](https://github.com/algolia/instantsearch.js/issues/249)\n* **theme:** Move `indexSelector` styling to default.css ([1841ef1](https://github.com/algolia/instantsearch.js/commit/1841ef1))\n* **theme:** Move all default css rules to `default.css` ([57c8c65](https://github.com/algolia/instantsearch.js/commit/57c8c65))\n* **toggle:** Adding BEM class naming ([8730c97](https://github.com/algolia/instantsearch.js/commit/8730c97))\n* **urlSync:** url generation for widget links. Fix #29 ([23dd505](https://github.com/algolia/instantsearch.js/commit/23dd505)), closes [#29](https://github.com/algolia/instantsearch.js/issues/29)\n\n\n### BREAKING CHANGES\n\n* build: You should now include the `default.css` file in your\npage to get the default styling.\n\n- Added `clean-css` as minifier\n- Updated build script\n- Updated documentation about loading it from jsdeliver\n- `npm shrinkwrap` madness\n* hits: The hit template and transform data key is renamed\nfrom `hit` to `item` to stay consistent with the other widgets\n* menu: The default template now has the count element inside\nthe link, not outside.\n* stats: `cssClasses.root` now applies to the main root\nelement (above header and footer) and no longer to the template\nwrapper. To style the template wrapper, use `cssClasses.body`\n* theme: Classes are now named `ais-index-selector` and\n`ais-index-selector--item` to stay consistent with other widgets.\n\nUpdated tests as well. Widget is responsible for adding default\nclasses + user-defined ones. Then component simply add them to the\nmarkup.\n* theme: \"Powered by\" styles are now\n`ais-search-box--powered-by` and `ais-search-box--powered-by-link`.\n* urlSync: urlSync is not a widget anymore. It's now an option of\ninstantsearch(appID, apiKey, opts);. See the README.md for more info.\n* searchbox: The `searchBox` widget now expect\na `cssClasses.{input, poweredBy}`\n* bem: We now use a `span.ais-stats--time` instead of\na `small` tag in the stats widget.\n* bem: We now use `cssClasses.select` and\n`cssClasses.option` instead of `cssClass` for the index-selector\nwidget.\n\n\n\n<a name=\"0.4.1\"></a>\n## [0.4.1](https://github.com/algolia/instantsearch.js/compare/v0.4.0...v0.4.1) (2015-10-05)\n\n\n### Bug Fixes\n\n* allow passing only one key of transformData as an object ([e0ce89f](https://github.com/algolia/instantsearch.js/commit/e0ce89f))\n* **search-box:** Fix #137 autofocus must be configurable ([51f01be](https://github.com/algolia/instantsearch.js/commit/51f01be)), closes [#137](https://github.com/algolia/instantsearch.js/issues/137)\n* **searchBox:** do not update input's value if focused ([0e85f0d](https://github.com/algolia/instantsearch.js/commit/0e85f0d)), closes [#163](https://github.com/algolia/instantsearch.js/issues/163)\n* **templatesConfig:** helpers are now following Mustache spec ([8f3502f](https://github.com/algolia/instantsearch.js/commit/8f3502f))\n* **url-sync:** handle both hash and query parameter fix #165 ([8d84de6](https://github.com/algolia/instantsearch.js/commit/8d84de6)), closes [#165](https://github.com/algolia/instantsearch.js/issues/165)\n\n\n\n<a name=\"0.4.0\"></a>\n# [0.4.0](https://github.com/algolia/instantsearch.js/compare/v0.3.0...v0.4.0) (2015-09-30)\n\n\n### Bug Fixes\n\n* **pagination:** handle cases where maxPages is low ([d3c9959](https://github.com/algolia/instantsearch.js/commit/d3c9959)), closes [#100](https://github.com/algolia/instantsearch.js/issues/100)\n* **searchBox:** allow searchBox to reuse an `<input>` ([e820cc3](https://github.com/algolia/instantsearch.js/commit/e820cc3))\n* **searchBox:** Use `hasAttribute` instead of `getAttribute` ([a122af9](https://github.com/algolia/instantsearch.js/commit/a122af9))\n* **slider:** allow handles to reach the real start and end of the slider ([03ed3f5](https://github.com/algolia/instantsearch.js/commit/03ed3f5))\n* **slider:** fix tap event throwing ([d906d3e](https://github.com/algolia/instantsearch.js/commit/d906d3e)), closes [#120](https://github.com/algolia/instantsearch.js/issues/120)\n* **Template:** add default value for template ([4291014](https://github.com/algolia/instantsearch.js/commit/4291014))\n* **url-sync:** make input not to lose focus ([63488d3](https://github.com/algolia/instantsearch.js/commit/63488d3))\n\n### Features\n\n* **rangeSlider:** add headerFooter decorator ([19090c3](https://github.com/algolia/instantsearch.js/commit/19090c3))\n* **searchBox:** add headerFooter decorator to the Component ([5974a88](https://github.com/algolia/instantsearch.js/commit/5974a88))\n* **templatesConfig:** helpers and options transferred to Template ([456d781](https://github.com/algolia/instantsearch.js/commit/456d781)), closes [#99](https://github.com/algolia/instantsearch.js/issues/99)\n* **toggle:** add headerFooter decorator ([8a70c7d](https://github.com/algolia/instantsearch.js/commit/8a70c7d))\n* **url-sync:** Add `is_v` version to url ([9f597a0](https://github.com/algolia/instantsearch.js/commit/9f597a0)), closes [#70](https://github.com/algolia/instantsearch.js/issues/70)\n* hierarchicalWidget ([1facd9d](https://github.com/algolia/instantsearch.js/commit/1facd9d))\n\n\n### BREAKING CHANGES\n\n* S:\n- toggle: removed template\n* - removed: inputClass\n\n\n\n<a name=\"0.3.0\"></a>\n# [0.3.0](https://github.com/algolia/instantsearch.js/compare/v0.2.2...v0.3.0) (2015-09-24)\n\n\n### Bug Fixes\n\n* Allow not specifying `cssClass` on index selector ([4e9324f](https://github.com/algolia/instantsearch.js/commit/4e9324f))\n* More explicit error message when DOM selector is invalid ([d36a2ad](https://github.com/algolia/instantsearch.js/commit/d36a2ad)), closes [#105](https://github.com/algolia/instantsearch.js/issues/105)\n* Pass nbHits, hitsPerPage, nbPages and page to Stats widget ([deefd23](https://github.com/algolia/instantsearch.js/commit/deefd23)), closes [#106](https://github.com/algolia/instantsearch.js/issues/106)\n* **hideIfEmpty:** should be hideWhenNoResults ([21877a0](https://github.com/algolia/instantsearch.js/commit/21877a0))\n* **Hits:** handle the display when there is no result ([544ff5c](https://github.com/algolia/instantsearch.js/commit/544ff5c))\n* **menu:** send an empty array values when no values ([12cd7dc](https://github.com/algolia/instantsearch.js/commit/12cd7dc)), closes [#107](https://github.com/algolia/instantsearch.js/issues/107)\n* **pagination:** missing showFirstLast attribute when instantiating ([28fa0ae](https://github.com/algolia/instantsearch.js/commit/28fa0ae))\n* **SearchBox:** Missing poweredBy in the not focused SearchBox ([ef695ff](https://github.com/algolia/instantsearch.js/commit/ef695ff))\n* **slider:** hide slider if when no hits/matches ([31e4a80](https://github.com/algolia/instantsearch.js/commit/31e4a80)), closes [#107](https://github.com/algolia/instantsearch.js/issues/107)\n\n### Features\n\n* **menu,refinementList:** add header/item/footer templating solution ([58275dc](https://github.com/algolia/instantsearch.js/commit/58275dc)), closes [#101](https://github.com/algolia/instantsearch.js/issues/101)\n* **searchBox:** add poweredBy option, disabled by default ([c9da165](https://github.com/algolia/instantsearch.js/commit/c9da165))\n* **stats:** add query variable to the template ([75f457d](https://github.com/algolia/instantsearch.js/commit/75f457d))\n* **transformData:** add to every widget using the Template component ([d080a03](https://github.com/algolia/instantsearch.js/commit/d080a03)), closes [#116](https://github.com/algolia/instantsearch.js/issues/116)\n* **transformData:** refinementList + menu implementation ([0a0e36e](https://github.com/algolia/instantsearch.js/commit/0a0e36e))\n* **urlSync:** add urlSync widget ([50fc4ce](https://github.com/algolia/instantsearch.js/commit/50fc4ce))\n* **widgets:** auto hide some widgets ([187b4bd](https://github.com/algolia/instantsearch.js/commit/187b4bd))\n\n\n### BREAKING CHANGES\n\n* Removed from menu and refinementList:\n- rootClass => cssClasses.root\n- itemCLass => cssClasses.item\n- template => templates.item\n\nAdded to menu and refinementList:\n- cssClasses{root,list,item}\n- templates{header,item,footer}\n- widget (container) is automatically hidden by default\n- hideWhenNoResults=true\n\nThis was done to allow more templating solutions like discussed in #101.\n\n\n\n<a name=\"0.2.2\"></a>\n## [0.2.2](https://github.com/algolia/instantsearch.js/compare/v0.1.0...v0.2.2) (2015-09-17)\n\n\n\n\n<a name=\"0.2.1\"></a>\n## [0.2.1](https://github.com/algolia/instantsearch.js/compare/v0.1.0...v0.2.1) (2015-09-17)\n\n\n\n\n<a name=\"0.1.0\"></a>\n# 0.1.0 (2015-09-17)\n\nFirst release\n\n<a name=\"0.0.0\"></a>\n## [0.0.0](https://github.com/algolia/instantsearch.js/compare/v0.0.0...v0.0.0) (2015-09-17)\n\nFirst commit\n"
  },
  {
    "path": "js/instantsearch.js/LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2015-present Algolia, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "js/instantsearch.js/README.md",
    "content": "<p align=\"center\">\n  <a href=\"https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/\">\n    <img alt=\"InstantSearch.js\" src=\"https://github.com/algolia/instantsearch/blob/master/.github/banner.png?raw=true\">\n  </a>\n\n  <p align=\"center\">\n    InstantSearch.js is a JavaScript library for building performant and instant search experiences with <a href=\"https://www.algolia.com/?utm_source=instantsearch.js&utm_campaign=repository\">Algolia</a>.\n  </p>\n</p>\n\n---\n\nInstantSearch.js is a vanilla JavaScript library that lets you create an instant-search result experience using [Algolia][algolia-website]’s search API. It is part of the InstantSearch family:\n\n**InstantSearch.js** | [React InstantSearch][instantsearch-github] | [Vue InstantSearch][instantsearch-github] | [React InstantSearch Native][instantsearch-github] | [InstantSearch Android][instantsearch-android-github] | [InstantSearch iOS][instantsearch-ios-github]\n\n<details>\n  <summary><strong>Table of contents</strong></summary>\n\n<!-- START doctoc generated TOC please keep comment here to allow auto update -->\n<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->\n\n- [Why](#why)\n- [Getting started](#getting-started)\n- [Installation](#installation)\n  - [TypeScript users](#typescript-users)\n- [Documentation](#documentation)\n- [Demos](#demos)\n- [Playground](#playground)\n- [Browser support](#browser-support)\n- [Troubleshooting](#troubleshooting)\n- [Contributing](#contributing)\n- [License](#license)\n\n<!-- END doctoc generated TOC please keep comment here to allow auto update -->\n\n</details>\n\n## Why\n\nYou should be using InstantSearch if you want to:\n\n- Design search experiences with best practices\n- Customize your components at will\n- Remain independent from external frameworks\n\n## Getting started\n\nUsing InstantSearch.js is as simple as adding this JavaScript code to your page:\n\n```javascript\n// 1. Instantiate the search\nconst search = instantsearch({\n  indexName: 'instant_search',\n  searchClient: algoliasearch('latency', '6be0576ff61c053d5f9a3225e2a90f76'),\n});\n\nsearch.addWidgets([\n  // 2. Create an interactive search box\n  instantsearch.widgets.searchBox({\n    container: '#searchbox',\n    placeholder: 'Search for products',\n  }),\n\n  // 3. Plug the search results into the product container\n  instantsearch.widgets.hits({\n    container: '#products',\n    templates: {\n      item: (hit, { html, components }) =>\n        html`\n          <h3>${components.Highlight({ attribute: 'name', hit })}</h3>\n          <p>${components.Snippet({ attribute: 'description', hit })}</p>\n        `,\n    },\n  }),\n\n  // 4. Make the brands refinable\n  instantsearch.widgets.refinementList({\n    container: '#brand',\n    attribute: 'brand',\n  }),\n]);\n\n// 5. Start the search!\nsearch.start();\n```\n\n<p align=\"center\">\n  <a href=\"https://codesandbox.io/s/github/algolia/doc-code-samples/tree/master/InstantSearch.js/getting-started\" title=\"Edit on CodeSandbox\">\n    <img alt=\"Edit on CodeSandbox\" src=\"https://codesandbox.io/static/img/play-codesandbox.svg\">\n  </a>\n</p>\n\nTo learn more about the library, follow the [getting started](https://www.algolia.com/doc/guides/building-search-ui/getting-started/js/) guide or check how to [add it to your own project](https://www.algolia.com/doc/guides/building-search-ui/installation/js/).\n\n## Installation\n\n```sh\nnpm install instantsearch.js algoliasearch\n# or\nyarn add instantsearch.js algoliasearch\n```\n\n### TypeScript users\n\nTo use InstantSearch.js in a TypeScript environment, depending on your [`algoliasearch`](https://github.com/algolia/algoliasearch-client-javascript) version, you need to import different types.\n\n> You still need to import these types even if you don't use InstantSearch.js with [`algoliasearch`](https://github.com/algolia/algoliasearch-client-javascript).\n\n#### `algoliasearch` v4.x\n\nThis version uses types provided by both `algoliasearch` and `@algolia/client-search`.\n\n```bash\nyarn add algoliasearch@4 @algolia/client-search\n```\n\n#### `algoliasearch` v3.x\n\n```bash\nyarn add @types/algoliasearch@3\n```\n\n> v3.x is deprecated and will soon no longer be supported.\n\n## Documentation\n\nThe documentation is available on the [Algolia website](https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/).\n\n## Demos\n\n| E-commerce | Media | Travel |\n| --- | --- | --- |\n| <a href=\"https://instantsearchjs.netlify.app/examples/e-commerce/\"><img src=\"https://www.algolia.com/doc/assets/images/build-search-ui/demos/e-commerce-2c7ed6b6.png\" width=\"250\" alt=\"E-commerce demo preview\"></a> | <a href=\"https://instantsearchjs.netlify.app/examples/media/\"><img src=\"https://www.algolia.com/doc/assets/images/build-search-ui/demos/media-articles-abc153ab.png\" width=\"250\" alt=\"Media demo preview\"></a> | <a href=\"https://instantsearchjs.netlify.app/examples/tourism/\"><img src=\"https://instantsearchjs.netlify.app/examples/tourism/capture.png\" width=\"250\" alt=\"Tourism demo preview\"></a> |\n\nSee more demos [on the website](https://www.algolia.com/doc/guides/building-search-ui/resources/demos/js/).\n\n## Playground\n\nYou can get to know InstantSearch.js on [this playground](https://codesandbox.io/s/github/algolia/create-instantsearch-app/tree/templates/instantsearch.js).\n\nStart by [adding widgets](https://www.algolia.com/doc/guides/building-search-ui/widgets/showcase/js/) and tweaking the display. Once you feel familiar with the library, we recommend following the [getting started guide](https://www.algolia.com/doc/guides/building-search-ui/getting-started/js/).\n\n## Browser support\n\nWe support the **last two versions of major browsers** (Chrome, Edge, Firefox, Safari).\n\nPlease refer to the [browser support](https://www.algolia.com/doc/guides/building-search-ui/installation/js/#browser-support) section in the documentation to use InstantSearch.js on other browsers.\n\n## Troubleshooting\n\nEncountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://www.algolia.com/doc/guides/building-search-ui/troubleshooting/faq/js/) where you will find answers for the most common issues and gotchas with the library.\n\n## Contributing\n\nWe welcome all contributors, from casual to regular 💙\n\n- **Bug report**. Is something not working as expected? [Send a bug report][contributing-bugreport].\n- **Feature request**. Would you like to add something to the library? [Send a feature request][contributing-featurerequest].\n- **Documentation**. Did you find a typo in the doc? [Open an issue][contributing-newissue] and we'll take care of it.\n- **Development**. If you don't know where to start, you can check the open issues that are [tagged easy][contributing-label-easy], the [bugs][contributing-label-bug] or [chores][contributing-label-chore].\n\nTo start contributing to code, you need to:\n\n1.  [Fork the project](https://help.github.com/articles/fork-a-repo/)\n1.  [Clone the repository](https://help.github.com/articles/cloning-a-repository/)\n1.  Install the dependencies: `yarn`\n1.  Run the development mode: `yarn storybook`\n1.  [Open the stories](http://localhost:6006)\n\nPlease read [our contribution process](https://github.com/algolia/instantsearch/blob/master/CONTRIBUTING.md) to learn more.\n\n## License\n\nInstantSearch.js is [MIT licensed][license-url].\n\n<!-- Links -->\n\n[license-url]: LICENSE\n[algolia-website]: https://www.algolia.com/?utm_source=instantsearch.js&utm_campaign=repository\n[instantsearch-github]: https://github.com/algolia/instantsearch/\n[instantsearch-android-github]: https://github.com/algolia/instantsearch-android\n[instantsearch-ios-github]: https://github.com/algolia/instantsearch-ios\n[contributing-bugreport]: https://github.com/algolia/instantsearch/issues/new?template=BUG_REPORT.yml&labels=triage,Library%3A%20InstantSearch.js\n[contributing-featurerequest]: https://github.com/algolia/instantsearch/discussions/new?category=ideas&labels=triage,Library%3A%20InstantSearch.js&title=Feature%20request%3A%20\n[contributing-newissue]: https://github.com/algolia/instantsearch/issues/new?labels=triage,Library%3A%20InstantSearch.js\n[contributing-label-easy]: https://github.com/algolia/instantsearch/issues?q=is%3Aopen+is%3Aissue+label%3A%22Difficulty%3A+Easy%22+label%3A%22Library%3A%20InstantSearch.js%22\n[contributing-label-bug]: https://github.com/algolia/instantsearch/issues?q=is%3Aissue+is%3Aopen+label%3A%22Type%3A+Bug%22+label%3A%22Library%3A%20InstantSearch.js%22\n[contributing-label-chore]: https://github.com/algolia/instantsearch/issues?q=is%3Aissue+is%3Aopen+label%3A%22Type%3A+Chore%22+label%3A%22Library%3A%20InstantSearch.js%22\n"
  },
  {
    "path": "js/instantsearch.js/cjs/components/Answers/Answers.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _utils = require(\"../../lib/utils\");\nvar _Template = _interopRequireDefault(require(\"../Template/Template\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nvar Answers = function Answers(_ref) {\n  var hits = _ref.hits,\n    isLoading = _ref.isLoading,\n    cssClasses = _ref.cssClasses,\n    templateProps = _ref.templateProps;\n  return (0, _preact.h)(\"div\", {\n    className: (0, _instantsearchUiComponents.cx)(cssClasses.root, hits.length === 0 && cssClasses.emptyRoot)\n  }, (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n    templateKey: \"header\",\n    rootProps: {\n      className: cssClasses.header\n    },\n    data: {\n      hits: hits,\n      isLoading: isLoading\n    }\n  })), isLoading ? (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n    templateKey: \"loader\",\n    rootProps: {\n      className: cssClasses.loader\n    }\n  })) : (0, _preact.h)(\"ul\", {\n    className: cssClasses.list\n  }, hits.map(function (hit, index) {\n    return (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n      templateKey: \"item\",\n      rootTagName: \"li\",\n      rootProps: {\n        className: cssClasses.item\n      },\n      key: hit.objectID,\n      data: _objectSpread(_objectSpread({}, hit), {}, {\n        get __hitIndex() {\n          process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, 'The `__hitIndex` property is deprecated. Use the absolute `__position` instead.') : void 0;\n          return index;\n        }\n      })\n    }));\n  })));\n};\nvar _default = exports.default = Answers;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/Breadcrumb/Breadcrumb.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _utils = require(\"../../lib/utils\");\nvar _Template = _interopRequireDefault(require(\"../Template/Template\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nvar Breadcrumb = function Breadcrumb(_ref) {\n  var items = _ref.items,\n    cssClasses = _ref.cssClasses,\n    templateProps = _ref.templateProps,\n    createURL = _ref.createURL,\n    refine = _ref.refine;\n  return (0, _preact.h)(\"div\", {\n    className: (0, _instantsearchUiComponents.cx)(cssClasses.root, items.length === 0 && cssClasses.noRefinementRoot)\n  }, (0, _preact.h)(\"ul\", {\n    className: cssClasses.list\n  }, (0, _preact.h)(\"li\", {\n    className: (0, _instantsearchUiComponents.cx)(cssClasses.item, items.length === 0 && cssClasses.selectedItem)\n  }, (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n    templateKey: \"home\",\n    rootTagName: \"a\",\n    rootProps: {\n      className: cssClasses.link,\n      href: createURL(null),\n      onClick: function onClick(event) {\n        if ((0, _utils.isSpecialClick)(event)) {\n          return;\n        }\n        event.preventDefault();\n        refine(null);\n      }\n    }\n  }))), items.map(function (item, idx) {\n    var isLast = idx === items.length - 1;\n    return (0, _preact.h)(\"li\", {\n      key: item.label + idx,\n      className: (0, _instantsearchUiComponents.cx)(cssClasses.item, isLast && cssClasses.selectedItem)\n    }, (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n      templateKey: \"separator\",\n      rootTagName: \"span\",\n      rootProps: {\n        className: cssClasses.separator,\n        'aria-hidden': true\n      }\n    })), isLast ? item.label : (0, _preact.h)(\"a\", {\n      className: cssClasses.link,\n      href: createURL(item.value),\n      onClick: function onClick(event) {\n        if ((0, _utils.isSpecialClick)(event)) {\n          return;\n        }\n        event.preventDefault();\n        refine(item.value);\n      }\n    }, item.label));\n  })));\n};\nvar _default = exports.default = Breadcrumb;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/ClearRefinements/ClearRefinements.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _Template = _interopRequireDefault(require(\"../Template/Template\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nvar ClearRefinements = function ClearRefinements(_ref) {\n  var hasRefinements = _ref.hasRefinements,\n    refine = _ref.refine,\n    cssClasses = _ref.cssClasses,\n    templateProps = _ref.templateProps;\n  return (0, _preact.h)(\"div\", {\n    className: cssClasses.root\n  }, (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n    templateKey: \"resetLabel\",\n    rootTagName: \"button\",\n    rootProps: {\n      className: (0, _instantsearchUiComponents.cx)(cssClasses.button, !hasRefinements && cssClasses.disabledButton),\n      onClick: refine,\n      disabled: !hasRefinements\n    },\n    data: {\n      hasRefinements: hasRefinements\n    }\n  })));\n};\nvar _default = exports.default = ClearRefinements;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/CurrentRefinements/CurrentRefinements.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _utils = require(\"../../lib/utils\");\nvar createItemKey = function createItemKey(_ref) {\n  var attribute = _ref.attribute,\n    value = _ref.value,\n    type = _ref.type,\n    operator = _ref.operator;\n  return [attribute, type, value, operator].map(function (key) {\n    return key;\n  }).filter(Boolean).join(':');\n};\nvar handleClick = function handleClick(callback) {\n  return function (event) {\n    if ((0, _utils.isSpecialClick)(event)) {\n      return;\n    }\n    event.preventDefault();\n    callback();\n  };\n};\nvar CurrentRefinements = function CurrentRefinements(_ref2) {\n  var items = _ref2.items,\n    cssClasses = _ref2.cssClasses,\n    canRefine = _ref2.canRefine;\n  return (0, _preact.h)(\"div\", {\n    className: (0, _instantsearchUiComponents.cx)(cssClasses.root, !canRefine && cssClasses.noRefinementRoot)\n  }, (0, _preact.h)(\"ul\", {\n    className: cssClasses.list\n  }, items.map(function (item, index) {\n    return (0, _preact.h)(\"li\", {\n      key: \"\".concat(item.indexName, \"-\").concat(item.attribute, \"-\").concat(index),\n      className: cssClasses.item\n    }, (0, _preact.h)(\"span\", {\n      className: cssClasses.label\n    }, (0, _utils.capitalize)(item.label), \": \"), item.refinements.map(function (refinement) {\n      return (0, _preact.h)(\"span\", {\n        key: createItemKey(refinement),\n        className: cssClasses.category\n      }, (0, _preact.h)(\"span\", {\n        className: cssClasses.categoryLabel\n      }, refinement.attribute === 'query' ? (0, _preact.h)(\"q\", null, refinement.label) : refinement.label), (0, _preact.h)(\"button\", {\n        className: cssClasses.delete,\n        type: \"button\",\n        onClick: handleClick(item.refine.bind(null, refinement))\n      }, \"\\u2715\"));\n    }));\n  })));\n};\nvar _default = exports.default = CurrentRefinements;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/GeoSearchControls/GeoSearchButton.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _preact = require(\"preact\");\nvar GeoSearchButton = function GeoSearchButton(_ref) {\n  var className = _ref.className,\n    _ref$disabled = _ref.disabled,\n    disabled = _ref$disabled === void 0 ? false : _ref$disabled,\n    onClick = _ref.onClick,\n    children = _ref.children;\n  return (0, _preact.h)(\"button\", {\n    className: className,\n    onClick: onClick,\n    disabled: disabled\n  }, children);\n};\nvar _default = exports.default = GeoSearchButton;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/GeoSearchControls/GeoSearchControls.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _Template = _interopRequireDefault(require(\"../Template/Template\"));\nvar _GeoSearchButton = _interopRequireDefault(require(\"./GeoSearchButton\"));\nvar _GeoSearchToggle = _interopRequireDefault(require(\"./GeoSearchToggle\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nvar GeoSearchControls = function GeoSearchControls(_ref) {\n  var cssClasses = _ref.cssClasses,\n    enableRefine = _ref.enableRefine,\n    enableRefineControl = _ref.enableRefineControl,\n    enableClearMapRefinement = _ref.enableClearMapRefinement,\n    isRefineOnMapMove = _ref.isRefineOnMapMove,\n    isRefinedWithMap = _ref.isRefinedWithMap,\n    hasMapMoveSinceLastRefine = _ref.hasMapMoveSinceLastRefine,\n    onRefineToggle = _ref.onRefineToggle,\n    onRefineClick = _ref.onRefineClick,\n    onClearClick = _ref.onClearClick,\n    templateProps = _ref.templateProps;\n  return (0, _preact.h)(_preact.Fragment, null, enableRefine && (0, _preact.h)(\"div\", null, enableRefineControl && (0, _preact.h)(\"div\", {\n    className: cssClasses.control\n  }, isRefineOnMapMove || !hasMapMoveSinceLastRefine ? (0, _preact.h)(_GeoSearchToggle.default, {\n    classNameLabel: (0, _instantsearchUiComponents.cx)(cssClasses.label, isRefineOnMapMove && cssClasses.selectedLabel),\n    classNameInput: cssClasses.input,\n    checked: isRefineOnMapMove,\n    onToggle: onRefineToggle\n  }, (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n    templateKey: \"toggle\",\n    rootTagName: \"span\"\n  }))) : (0, _preact.h)(_GeoSearchButton.default, {\n    className: cssClasses.redo,\n    disabled: !hasMapMoveSinceLastRefine,\n    onClick: onRefineClick\n  }, (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n    templateKey: \"redo\",\n    rootTagName: \"span\"\n  })))), !enableRefineControl && !isRefineOnMapMove && (0, _preact.h)(\"div\", {\n    className: cssClasses.control\n  }, (0, _preact.h)(_GeoSearchButton.default, {\n    className: (0, _instantsearchUiComponents.cx)(cssClasses.redo, !hasMapMoveSinceLastRefine && cssClasses.disabledRedo),\n    disabled: !hasMapMoveSinceLastRefine,\n    onClick: onRefineClick\n  }, (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n    templateKey: \"redo\",\n    rootTagName: \"span\"\n  })))), enableClearMapRefinement && isRefinedWithMap && (0, _preact.h)(_GeoSearchButton.default, {\n    className: cssClasses.reset,\n    onClick: onClearClick\n  }, (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n    templateKey: \"reset\",\n    rootTagName: \"span\"\n  })))));\n};\nvar _default = exports.default = GeoSearchControls;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/GeoSearchControls/GeoSearchToggle.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _preact = require(\"preact\");\nvar GeoSearchToggle = function GeoSearchToggle(_ref) {\n  var classNameLabel = _ref.classNameLabel,\n    classNameInput = _ref.classNameInput,\n    checked = _ref.checked,\n    onToggle = _ref.onToggle,\n    children = _ref.children;\n  return (0, _preact.h)(\"label\", {\n    className: classNameLabel\n  }, (0, _preact.h)(\"input\", {\n    className: classNameInput,\n    type: \"checkbox\",\n    checked: checked,\n    onChange: onToggle\n  }), children);\n};\nvar _default = exports.default = GeoSearchToggle;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/Highlight/Highlight.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Highlight = Highlight;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _InternalHighlight = require(\"../InternalHighlight/InternalHighlight\");\nvar _excluded = [\"classNames\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction Highlight(_ref) {\n  var _ref$classNames = _ref.classNames,\n    classNames = _ref$classNames === void 0 ? {} : _ref$classNames,\n    props = _objectWithoutProperties(_ref, _excluded);\n  return (0, _preact.h)(_InternalHighlight.InternalHighlight, _extends({\n    classNames: {\n      root: (0, _instantsearchUiComponents.cx)('ais-Highlight', classNames.root),\n      highlighted: (0, _instantsearchUiComponents.cx)('ais-Highlight-highlighted', classNames.highlighted),\n      nonHighlighted: (0, _instantsearchUiComponents.cx)('ais-Highlight-nonHighlighted', classNames.nonHighlighted),\n      separator: (0, _instantsearchUiComponents.cx)('ais-Highlight-separator', classNames.separator)\n    }\n  }, props));\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/components/Hits/Hits.js",
    "content": "\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = Hits;\nvar _uiComponentsShared = require(\"@algolia/ui-components-shared\");\nvar _preact = require(\"preact\");\nvar _listener = require(\"../../lib/insights/listener\");\nvar _utils = require(\"../../lib/utils\");\nvar _Template = _interopRequireDefault(require(\"../Template/Template\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction Hits(_ref) {\n  var results = _ref.results,\n    hits = _ref.hits,\n    insights = _ref.insights,\n    bindEvent = _ref.bindEvent,\n    sendEvent = _ref.sendEvent,\n    cssClasses = _ref.cssClasses,\n    templateProps = _ref.templateProps;\n  var handleInsightsClick = (0, _listener.createInsightsEventHandler)({\n    insights: insights,\n    sendEvent: sendEvent\n  });\n  if (results.hits.length === 0) {\n    return (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n      templateKey: \"empty\",\n      rootProps: {\n        className: (0, _uiComponentsShared.cx)(cssClasses.root, cssClasses.emptyRoot),\n        onClick: handleInsightsClick\n      },\n      data: results\n    }));\n  }\n  return (0, _preact.h)(\"div\", {\n    className: cssClasses.root\n  }, (0, _preact.h)(\"ol\", {\n    className: cssClasses.list\n  }, hits.map(function (hit, index) {\n    return (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n      templateKey: \"item\",\n      rootTagName: \"li\",\n      rootProps: {\n        className: cssClasses.item,\n        onClick: function onClick(event) {\n          handleInsightsClick(event);\n          sendEvent('click:internal', hit, 'Hit Clicked');\n        },\n        onAuxClick: function onAuxClick(event) {\n          handleInsightsClick(event);\n          sendEvent('click:internal', hit, 'Hit Clicked');\n        }\n      },\n      key: hit.objectID,\n      data: _objectSpread(_objectSpread({}, hit), {}, {\n        get __hitIndex() {\n          process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, 'The `__hitIndex` property is deprecated. Use the absolute `__position` instead.') : void 0;\n          return index;\n        }\n      }),\n      bindEvent: bindEvent,\n      sendEvent: sendEvent\n    }));\n  })));\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/components/InfiniteHits/InfiniteHits.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _listener = require(\"../../lib/insights/listener\");\nvar _utils = require(\"../../lib/utils\");\nvar _Template = _interopRequireDefault(require(\"../Template/Template\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nvar DefaultBanner = function DefaultBanner(_ref) {\n  var banner = _ref.banner,\n    classNames = _ref.classNames;\n  if (!banner.image.urls[0].url) {\n    return null;\n  }\n  return (0, _preact.h)(\"aside\", {\n    className: (0, _instantsearchUiComponents.cx)(classNames.bannerRoot)\n  }, banner.link ? (0, _preact.h)(\"a\", {\n    className: (0, _instantsearchUiComponents.cx)(classNames.bannerLink),\n    href: banner.link.url,\n    target: banner.link.target\n  }, (0, _preact.h)(\"img\", {\n    className: (0, _instantsearchUiComponents.cx)(classNames.bannerImage),\n    src: banner.image.urls[0].url,\n    alt: banner.image.title\n  })) : (0, _preact.h)(\"img\", {\n    className: (0, _instantsearchUiComponents.cx)(classNames.bannerImage),\n    src: banner.image.urls[0].url,\n    alt: banner.image.title\n  }));\n};\nvar InfiniteHits = function InfiniteHits(_ref2) {\n  var results = _ref2.results,\n    hits = _ref2.hits,\n    insights = _ref2.insights,\n    bindEvent = _ref2.bindEvent,\n    sendEvent = _ref2.sendEvent,\n    hasShowPrevious = _ref2.hasShowPrevious,\n    showPrevious = _ref2.showPrevious,\n    showMore = _ref2.showMore,\n    isFirstPage = _ref2.isFirstPage,\n    isLastPage = _ref2.isLastPage,\n    cssClasses = _ref2.cssClasses,\n    templateProps = _ref2.templateProps,\n    banner = _ref2.banner;\n  var handleInsightsClick = (0, _listener.createInsightsEventHandler)({\n    insights: insights,\n    sendEvent: sendEvent\n  });\n  if (results.hits.length === 0) {\n    return (0, _preact.h)(\"div\", {\n      className: (0, _instantsearchUiComponents.cx)(cssClasses.root, cssClasses.emptyRoot),\n      onClick: handleInsightsClick\n    }, banner && (templateProps.templates.banner ? (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n      templateKey: \"banner\",\n      rootTagName: \"fragment\",\n      data: {\n        banner: banner,\n        className: cssClasses.bannerRoot\n      }\n    })) : (0, _preact.h)(DefaultBanner, {\n      banner: banner,\n      classNames: cssClasses\n    })), (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n      templateKey: \"empty\",\n      rootTagName: \"fragment\",\n      data: results\n    })));\n  }\n  return (0, _preact.h)(\"div\", {\n    className: cssClasses.root\n  }, hasShowPrevious && (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n    templateKey: \"showPreviousText\",\n    rootTagName: \"button\",\n    rootProps: {\n      className: (0, _instantsearchUiComponents.cx)(cssClasses.loadPrevious, isFirstPage && cssClasses.disabledLoadPrevious),\n      disabled: isFirstPage,\n      onClick: showPrevious\n    }\n  })), banner && (templateProps.templates.banner ? (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n    templateKey: \"banner\",\n    rootTagName: \"fragment\",\n    data: {\n      banner: banner,\n      className: cssClasses.bannerRoot\n    }\n  })) : (0, _preact.h)(DefaultBanner, {\n    banner: banner,\n    classNames: cssClasses\n  })), (0, _preact.h)(\"ol\", {\n    className: cssClasses.list\n  }, hits.map(function (hit, index) {\n    return (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n      templateKey: \"item\",\n      rootTagName: \"li\",\n      rootProps: {\n        className: cssClasses.item,\n        onClick: function onClick(event) {\n          handleInsightsClick(event);\n          sendEvent('click:internal', hit, 'Hit Clicked');\n        },\n        onAuxClick: function onAuxClick(event) {\n          handleInsightsClick(event);\n          sendEvent('click:internal', hit, 'Hit Clicked');\n        }\n      },\n      key: hit.objectID,\n      data: _objectSpread(_objectSpread({}, hit), {}, {\n        get __hitIndex() {\n          process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, 'The `__hitIndex` property is deprecated. Use the absolute `__position` instead.') : void 0;\n          return index;\n        }\n      }),\n      bindEvent: bindEvent,\n      sendEvent: sendEvent\n    }));\n  })), (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n    templateKey: \"showMoreText\",\n    rootTagName: \"button\",\n    rootProps: {\n      className: (0, _instantsearchUiComponents.cx)(cssClasses.loadMore, isLastPage && cssClasses.disabledLoadMore),\n      disabled: isLastPage,\n      onClick: showMore\n    }\n  })));\n};\nvar _default = exports.default = InfiniteHits;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/InternalHighlight/InternalHighlight.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.InternalHighlight = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar InternalHighlight = exports.InternalHighlight = (0, _instantsearchUiComponents.createHighlightComponent)({\n  createElement: _preact.createElement,\n  Fragment: _preact.Fragment\n});"
  },
  {
    "path": "js/instantsearch.js/cjs/components/MenuSelect/MenuSelect.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _utils = require(\"../../lib/utils\");\nvar _Template = _interopRequireDefault(require(\"../Template/Template\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction MenuSelect(_ref) {\n  var cssClasses = _ref.cssClasses,\n    templateProps = _ref.templateProps,\n    items = _ref.items,\n    refine = _ref.refine;\n  var _ref2 = (0, _utils.find)(items, function (item) {\n      return item.isRefined;\n    }) || {\n      value: ''\n    },\n    selectedValue = _ref2.value;\n  return (0, _preact.h)(\"div\", {\n    className: (0, _instantsearchUiComponents.cx)(cssClasses.root, items.length === 0 && cssClasses.noRefinementRoot)\n  }, (0, _preact.h)(\"select\", {\n    className: cssClasses.select,\n    value: selectedValue,\n    onChange: function onChange(event) {\n      refine(event.target.value);\n    }\n  }, (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n    templateKey: \"defaultOption\",\n    rootTagName: \"option\",\n    rootProps: {\n      value: '',\n      className: cssClasses.option\n    }\n  })), items.map(function (item) {\n    return (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n      templateKey: \"item\",\n      rootTagName: \"option\",\n      rootProps: {\n        value: item.value,\n        className: cssClasses.option\n      },\n      key: item.value,\n      data: item\n    }));\n  })));\n}\nvar _default = exports.default = MenuSelect;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/Pagination/Pagination.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _utils = require(\"../../lib/utils\");\nvar _Template = _interopRequireDefault(require(\"../Template/Template\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction Pagination(props) {\n  function createClickHandler(pageNumber) {\n    return function (event) {\n      if ((0, _utils.isSpecialClick)(event)) {\n        // do not alter the default browser behavior\n        // if one special key is down\n        return;\n      }\n      event.preventDefault();\n      props.setCurrentPage(pageNumber);\n    };\n  }\n  return (0, _preact.h)(\"div\", {\n    className: (0, _instantsearchUiComponents.cx)(props.cssClasses.root, props.nbPages <= 1 && props.cssClasses.noRefinementRoot)\n  }, (0, _preact.h)(\"ul\", {\n    className: props.cssClasses.list\n  }, props.showFirst && (0, _preact.h)(PaginationLink, {\n    ariaLabel: \"First Page\",\n    className: props.cssClasses.firstPageItem,\n    isDisabled: props.isFirstPage,\n    templates: props.templates,\n    templateKey: \"first\",\n    pageNumber: 0,\n    createURL: props.createURL,\n    cssClasses: props.cssClasses,\n    createClickHandler: createClickHandler\n  }), props.showPrevious && (0, _preact.h)(PaginationLink, {\n    ariaLabel: \"Previous Page\",\n    className: props.cssClasses.previousPageItem,\n    isDisabled: props.isFirstPage,\n    templates: props.templates,\n    templateKey: \"previous\",\n    pageNumber: props.currentPage - 1,\n    createURL: props.createURL,\n    cssClasses: props.cssClasses,\n    createClickHandler: createClickHandler\n  }), props.pages.map(function (pageNumber) {\n    return (0, _preact.h)(PaginationLink, {\n      key: pageNumber,\n      ariaLabel: \"Page \".concat(pageNumber + 1),\n      className: props.cssClasses.pageItem,\n      isSelected: pageNumber === props.currentPage,\n      templates: props.templates,\n      templateKey: \"page\",\n      pageNumber: pageNumber,\n      createURL: props.createURL,\n      cssClasses: props.cssClasses,\n      createClickHandler: createClickHandler\n    });\n  }), props.showNext && (0, _preact.h)(PaginationLink, {\n    ariaLabel: \"Next Page\",\n    className: props.cssClasses.nextPageItem,\n    isDisabled: props.isLastPage,\n    templates: props.templates,\n    templateKey: \"next\",\n    pageNumber: props.currentPage + 1,\n    createURL: props.createURL,\n    cssClasses: props.cssClasses,\n    createClickHandler: createClickHandler\n  }), props.showLast && (0, _preact.h)(PaginationLink, {\n    ariaLabel: \"Last Page, Page \".concat(props.nbPages),\n    className: props.cssClasses.lastPageItem,\n    isDisabled: props.isLastPage,\n    templates: props.templates,\n    templateKey: \"last\",\n    pageNumber: props.nbPages - 1,\n    createURL: props.createURL,\n    cssClasses: props.cssClasses,\n    createClickHandler: createClickHandler\n  })));\n}\nfunction PaginationLink(_ref) {\n  var templates = _ref.templates,\n    templateKey = _ref.templateKey,\n    ariaLabel = _ref.ariaLabel,\n    pageNumber = _ref.pageNumber,\n    className = _ref.className,\n    _ref$isDisabled = _ref.isDisabled,\n    isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,\n    _ref$isSelected = _ref.isSelected,\n    isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,\n    cssClasses = _ref.cssClasses,\n    createURL = _ref.createURL,\n    createClickHandler = _ref.createClickHandler;\n  return (0, _preact.h)(\"li\", {\n    className: (0, _instantsearchUiComponents.cx)(cssClasses.item, isDisabled && cssClasses.disabledItem, className, isSelected && cssClasses.selectedItem)\n  }, isDisabled ? (0, _preact.h)(_Template.default, {\n    rootTagName: \"span\",\n    rootProps: {\n      className: cssClasses.link,\n      'aria-label': ariaLabel\n    },\n    templateKey: templateKey,\n    templates: templates,\n    data: {\n      page: pageNumber + 1\n    }\n  }) : (0, _preact.h)(_Template.default, {\n    rootTagName: \"a\",\n    rootProps: {\n      className: cssClasses.link,\n      'aria-label': ariaLabel,\n      href: createURL(pageNumber),\n      onClick: createClickHandler(pageNumber)\n    },\n    templateKey: templateKey,\n    templates: templates,\n    data: {\n      page: pageNumber + 1\n    }\n  }));\n}\nvar _default = exports.default = Pagination;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/Pagination/PaginationLink.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _preact = require(\"preact\");\n\n/** @jsx h */\nvar PaginationLink = function PaginationLink(_ref) {\n  var cssClasses = _ref.cssClasses,\n      label = _ref.label,\n      ariaLabel = _ref.ariaLabel,\n      url = _ref.url,\n      isDisabled = _ref.isDisabled,\n      handleClick = _ref.handleClick,\n      pageNumber = _ref.pageNumber;\n\n  if (isDisabled) {\n    return (0, _preact.h)(\"li\", {\n      className: cssClasses.item\n    }, (0, _preact.h)(\"span\", {\n      className: cssClasses.link,\n      dangerouslySetInnerHTML: {\n        __html: label\n      }\n    }));\n  }\n\n  return (0, _preact.h)(\"li\", {\n    className: cssClasses.item\n  }, (0, _preact.h)(\"a\", {\n    className: cssClasses.link,\n    \"aria-label\": ariaLabel,\n    href: url,\n    onClick: function onClick(event) {\n      return handleClick(pageNumber, event);\n    },\n    dangerouslySetInnerHTML: {\n      __html: label\n    }\n  }));\n};\n\nvar _default = PaginationLink;\nexports.default = _default;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/Panel/Panel.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _hooks = require(\"preact/hooks\");\nvar _Template = _interopRequireDefault(require(\"../Template/Template\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction Panel(props) {\n  var _useState = (0, _hooks.useState)(props.isCollapsed),\n    _useState2 = _slicedToArray(_useState, 2),\n    isCollapsed = _useState2[0],\n    setIsCollapsed = _useState2[1];\n  var _useState3 = (0, _hooks.useState)(false),\n    _useState4 = _slicedToArray(_useState3, 2),\n    isControlled = _useState4[0],\n    setIsControlled = _useState4[1];\n  var bodyRef = (0, _hooks.useRef)(null);\n  (0, _hooks.useEffect)(function () {\n    var node = bodyRef.current;\n    if (!node) {\n      return undefined;\n    }\n    node.appendChild(props.bodyElement);\n    return function () {\n      node.removeChild(props.bodyElement);\n    };\n  }, [bodyRef, props.bodyElement]);\n  if (!isControlled && props.isCollapsed !== isCollapsed) {\n    setIsCollapsed(props.isCollapsed);\n  }\n  return (0, _preact.h)(\"div\", {\n    className: (0, _instantsearchUiComponents.cx)(props.cssClasses.root, props.hidden && props.cssClasses.noRefinementRoot, props.collapsible && props.cssClasses.collapsibleRoot, isCollapsed && props.cssClasses.collapsedRoot),\n    hidden: props.hidden\n  }, props.templates.header && (0, _preact.h)(\"div\", {\n    className: props.cssClasses.header\n  }, (0, _preact.h)(_Template.default, {\n    templates: props.templates,\n    templateKey: \"header\",\n    rootTagName: \"span\",\n    data: props.data\n  }), props.collapsible && (0, _preact.h)(\"button\", {\n    className: props.cssClasses.collapseButton,\n    \"aria-expanded\": !isCollapsed,\n    onClick: function onClick(event) {\n      event.preventDefault();\n      setIsControlled(true);\n      setIsCollapsed(function (prevIsCollapsed) {\n        return !prevIsCollapsed;\n      });\n    }\n  }, (0, _preact.h)(_Template.default, {\n    templates: props.templates,\n    templateKey: \"collapseButtonText\",\n    rootTagName: \"span\",\n    data: {\n      collapsed: isCollapsed\n    }\n  }))), (0, _preact.h)(\"div\", {\n    className: props.cssClasses.body,\n    ref: bodyRef\n  }), props.templates.footer && (0, _preact.h)(_Template.default, {\n    templates: props.templates,\n    templateKey: \"footer\",\n    rootProps: {\n      className: props.cssClasses.footer\n    },\n    data: props.data\n  }));\n}\nvar _default = exports.default = Panel;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/PoweredBy/PoweredBy.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _preact = require(\"preact\");\nvar PoweredBy = function PoweredBy(_ref) {\n  var url = _ref.url,\n    theme = _ref.theme,\n    cssClasses = _ref.cssClasses;\n  return (0, _preact.h)(\"div\", {\n    className: cssClasses.root\n  }, (0, _preact.h)(\"a\", {\n    href: url,\n    target: \"_blank\",\n    className: cssClasses.link,\n    \"aria-label\": \"Search by Algolia\",\n    rel: \"noopener noreferrer\"\n  }, (0, _preact.h)(\"svg\", {\n    height: \"1.2em\",\n    className: cssClasses.logo,\n    viewBox: \"0 0 572 64\"\n    // This style is necessary as long as it's not included in InstantSearch.css.\n    // For now, InstantSearch.css sets a maximum width of 70px.\n    ,\n    style: {\n      width: 'auto'\n    }\n  }, (0, _preact.h)(\"path\", {\n    fill: theme === 'dark' ? '#FFF' : '#36395A',\n    d: \"M16 48.3c-3.4 0-6.3-.6-8.7-1.7A12.4 12.4 0 0 1 1.9 42C.6 40 0 38 0 35.4h6.5a6.7 6.7 0 0 0 3.9 6c1.4.7 3.3 1.1 5.6 1.1 2.2 0 4-.3 5.4-1a7 7 0 0 0 3-2.4 6 6 0 0 0 1-3.4c0-1.5-.6-2.8-1.9-3.7-1.3-1-3.3-1.6-5.9-1.8l-4-.4c-3.7-.3-6.6-1.4-8.8-3.4a10 10 0 0 1-3.3-7.9c0-2.4.6-4.6 1.8-6.4a12 12 0 0 1 5-4.3c2.2-1 4.7-1.6 7.5-1.6s5.5.5 7.6 1.6a12 12 0 0 1 5 4.4c1.2 1.8 1.8 4 1.8 6.7h-6.5a6.4 6.4 0 0 0-3.5-5.9c-1-.6-2.6-1-4.4-1s-3.2.3-4.4 1c-1.1.6-2 1.4-2.6 2.4-.5 1-.8 2-.8 3.1a5 5 0 0 0 1.5 3.6c1 1 2.6 1.7 4.7 1.9l4 .3c2.8.2 5.2.8 7.2 1.8 2.1 1 3.7 2.2 4.9 3.8a9.7 9.7 0 0 1 1.7 5.8c0 2.5-.7 4.7-2 6.6a13 13 0 0 1-5.6 4.4c-2.4 1-5.2 1.6-8.4 1.6Zm35.6 0c-2.6 0-4.8-.4-6.7-1.3a13 13 0 0 1-4.7-3.5 17.1 17.1 0 0 1-3.6-10.4v-1c0-2 .3-3.8 1-5.6a13 13 0 0 1 7.3-8.3 15 15 0 0 1 6.3-1.4A13.2 13.2 0 0 1 64 24.3c1 2.2 1.6 4.6 1.6 7.2V34H39.4v-4.3h21.8l-1.8 2.2c0-2-.3-3.7-.9-5.1a7.3 7.3 0 0 0-2.7-3.4c-1.2-.7-2.7-1.1-4.6-1.1s-3.4.4-4.7 1.3a8 8 0 0 0-2.9 3.6c-.6 1.5-.9 3.3-.9 5.4 0 2 .3 3.7 1 5.3a7.9 7.9 0 0 0 2.8 3.7c1.3.8 3 1.3 5 1.3s3.8-.5 5.1-1.3c1.3-1 2.1-2 2.4-3.2h6a11.8 11.8 0 0 1-7 8.7 16 16 0 0 1-6.4 1.2ZM80 48c-2.2 0-4-.3-5.7-1a8.4 8.4 0 0 1-3.7-3.3 9.7 9.7 0 0 1-1.3-5.2c0-2 .5-3.8 1.5-5.2a9 9 0 0 1 4.3-3.1c1.8-.7 4-1 6.7-1H89v4.1h-7.5c-2 0-3.4.5-4.4 1.4-1 1-1.6 2.1-1.6 3.6s.5 2.7 1.6 3.6c1 1 2.5 1.4 4.4 1.4 1.1 0 2.2-.2 3.2-.7 1-.4 1.9-1 2.6-2 .6-1 1-2.4 1-4.2l1.7 2.1c-.2 2-.7 3.8-1.5 5.2a9 9 0 0 1-3.4 3.3 12 12 0 0 1-5.3 1Zm9.5-.7v-8.8h-1v-10c0-1.8-.5-3.2-1.4-4.1-1-1-2.4-1.4-4.2-1.4a142.9 142.9 0 0 0-10.2.4v-5.6a74.8 74.8 0 0 1 8.6-.4c3 0 5.5.4 7.5 1.2s3.4 2 4.4 3.6c1 1.7 1.4 4 1.4 6.7v18.4h-5Zm12.9 0V17.8h5v12.3h-.2c0-4.2 1-7.4 2.8-9.5a11 11 0 0 1 8.3-3.1h1v5.6h-2a9 9 0 0 0-6.3 2.2c-1.5 1.5-2.2 3.6-2.2 6.4v15.6h-6.4Zm34.4 1a15 15 0 0 1-6.6-1.3c-1.9-.9-3.4-2-4.7-3.5a15.5 15.5 0 0 1-2.7-5c-.6-1.7-1-3.6-1-5.4v-1c0-2 .4-3.8 1-5.6a15 15 0 0 1 2.8-4.9c1.3-1.5 2.8-2.6 4.6-3.5a16.4 16.4 0 0 1 13.3.2c2 1 3.5 2.3 4.8 4a12 12 0 0 1 2 6H144c-.2-1.6-1-3-2.2-4.1a7.5 7.5 0 0 0-5.2-1.7 8 8 0 0 0-4.7 1.3 8 8 0 0 0-2.8 3.6 13.8 13.8 0 0 0 0 10.3c.6 1.5 1.5 2.7 2.8 3.6s2.8 1.3 4.8 1.3c1.5 0 2.7-.2 3.8-.8a7 7 0 0 0 2.6-2c.7-1 1-2 1.2-3.2h6.2a11 11 0 0 1-2 6.2 15.1 15.1 0 0 1-11.8 5.5Zm19.7-1v-40h6.4V31h-1.3c0-3 .4-5.5 1.1-7.6a9.7 9.7 0 0 1 3.5-4.8A9.9 9.9 0 0 1 172 17h.3c3.5 0 6 1.1 7.9 3.5 1.7 2.3 2.6 5.7 2.6 10v16.8h-6.4V29.6c0-2.1-.6-3.8-1.8-5a6.4 6.4 0 0 0-4.8-1.8c-2 0-3.7.7-5 2a7.8 7.8 0 0 0-1.9 5.5v17h-6.4Zm63.8 1a12.2 12.2 0 0 1-10.9-6.2 19 19 0 0 1-1.8-7.3h1.4v12.5h-5.1v-40h6.4v19.8l-2 3.5c.2-3.1.8-5.7 1.9-7.7a11 11 0 0 1 4.4-4.5c1.8-1 3.9-1.5 6.1-1.5a13.4 13.4 0 0 1 12.8 9.1c.7 1.9 1 3.8 1 6v1c0 2.2-.3 4.1-1 6a13.6 13.6 0 0 1-13.2 9.4Zm-1.2-5.5a8.4 8.4 0 0 0 7.9-5c.7-1.5 1.1-3.3 1.1-5.3s-.4-3.8-1.1-5.3a8.7 8.7 0 0 0-3.2-3.6 9.6 9.6 0 0 0-9.2-.2 8.5 8.5 0 0 0-3.3 3.2c-.8 1.4-1.3 3-1.3 5v2.3a9 9 0 0 0 1.3 4.8 9 9 0 0 0 3.4 3c1.4.7 2.8 1 4.4 1Zm27.3 3.9-10-28.9h6.5l9.5 28.9h-6Zm-7.5 12.2v-5.7h4.9c1 0 2-.1 2.9-.4a4 4 0 0 0 2-1.4c.4-.7.9-1.6 1.2-2.7l8.6-30.9h6.2l-9.3 32.4a14 14 0 0 1-2.5 5 8.9 8.9 0 0 1-4 2.8c-1.5.6-3.4.9-5.6.9h-4.4Zm9-12.2v-5.2h6.4v5.2H248Z\"\n  }), (0, _preact.h)(\"path\", {\n    fill: theme === 'dark' ? '#FFF' : '#003DFF',\n    d: \"M534.4 9.1H528a.8.8 0 0 1-.7-.7V1.8c0-.4.2-.7.6-.8l6.5-1c.4 0 .8.2.9.6v7.8c0 .4-.4.7-.8.7zM428 35.2V.8c0-.5-.3-.8-.7-.8h-.2l-6.4 1c-.4 0-.7.4-.7.8v35c0 1.6 0 11.8 12.3 12.2.5 0 .8-.4.8-.8V43c0-.4-.3-.7-.6-.8-4.5-.5-4.5-6-4.5-7zm106.5-21.8H528c-.4 0-.7.4-.7.8v34c0 .4.3.8.7.8h6.5c.4 0 .8-.4.8-.8v-34c0-.5-.4-.8-.8-.8zm-17.7 21.8V.8c0-.5-.3-.8-.8-.8l-6.5 1c-.4 0-.7.4-.7.8v35c0 1.6 0 11.8 12.3 12.2.4 0 .8-.4.8-.8V43c0-.4-.3-.7-.7-.8-4.4-.5-4.4-6-4.4-7zm-22.2-20.6a16.5 16.5 0 0 1 8.6 9.3c.8 2.2 1.3 4.8 1.3 7.5a19.4 19.4 0 0 1-4.6 12.6 14.8 14.8 0 0 1-5.2 3.6c-2 .9-5.2 1.4-6.8 1.4a21 21 0 0 1-6.7-1.4 15.4 15.4 0 0 1-8.6-9.3 21.3 21.3 0 0 1 0-14.4 15.2 15.2 0 0 1 8.6-9.3c2-.8 4.3-1.2 6.7-1.2s4.6.4 6.7 1.2zm-6.7 27.6c2.7 0 4.7-1 6.2-3s2.2-4.3 2.2-7.8-.7-6.3-2.2-8.3-3.5-3-6.2-3-4.7 1-6.1 3c-1.5 2-2.2 4.8-2.2 8.3s.7 5.8 2.2 7.8 3.5 3 6.2 3zm-88.8-28.8c-6.2 0-11.7 3.3-14.8 8.2a18.6 18.6 0 0 0 4.8 25.2c1.8 1.2 4 1.8 6.2 1.7s.1 0 .1 0h.9c4.2-.7 8-4 9.1-8.1v7.4c0 .4.3.7.8.7h6.4a.7.7 0 0 0 .7-.7V14.2c0-.5-.3-.8-.7-.8h-13.5zm6.3 26.5a9.8 9.8 0 0 1-5.7 2h-.5a10 10 0 0 1-9.2-14c1.4-3.7 5-6.3 9-6.3h6.4v18.3zm152.3-26.5h13.5c.5 0 .8.3.8.7v33.7c0 .4-.3.7-.8.7h-6.4a.7.7 0 0 1-.8-.7v-7.4c-1.2 4-4.8 7.4-9 8h-.1a4.2 4.2 0 0 1-.5.1h-.9a10.3 10.3 0 0 1-7-2.6c-4-3.3-6.5-8.4-6.5-14.2 0-3.7 1-7.2 3-10 3-5 8.5-8.3 14.7-8.3zm.6 28.4c2.2-.1 4.2-.6 5.7-2V21.7h-6.3a9.8 9.8 0 0 0-9 6.4 10.2 10.2 0 0 0 9.1 13.9h.5zM452.8 13.4c-6.2 0-11.7 3.3-14.8 8.2a18.5 18.5 0 0 0 3.6 24.3 10.4 10.4 0 0 0 13 .6c2.2-1.5 3.8-3.7 4.5-6.1v7.8c0 2.8-.8 5-2.2 6.3-1.5 1.5-4 2.2-7.5 2.2l-6-.3c-.3 0-.7.2-.8.5l-1.6 5.5c-.1.4.1.8.5 1h.1c2.8.4 5.5.6 7 .6 6.3 0 11-1.4 14-4.1 2.7-2.5 4.2-6.3 4.5-11.4V14.2c0-.5-.4-.8-.8-.8h-13.5zm6.3 8.2v18.3a9.6 9.6 0 0 1-5.6 2h-1a10.3 10.3 0 0 1-8.8-14c1.4-3.7 5-6.3 9-6.3h6.4zM291 31.5A32 32 0 0 1 322.8 0h30.8c.6 0 1.2.5 1.2 1.2v61.5c0 1.1-1.3 1.7-2.2 1l-19.2-17a18 18 0 0 1-11 3.4 18.1 18.1 0 1 1 18.2-14.8c-.1.4-.5.7-.9.6-.1 0-.3 0-.4-.2l-3.8-3.4c-.4-.3-.6-.8-.7-1.4a12 12 0 1 0-2.4 8.3c.4-.4 1-.5 1.6-.2l14.7 13.1v-46H323a26 26 0 1 0 10 49.7c.8-.4 1.6-.2 2.3.3l3 2.7c.3.2.3.7 0 1l-.2.2a32 32 0 0 1-47.2-28.6z\"\n  }))));\n};\nvar _default = exports.default = PoweredBy;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/QueryRuleCustomData/QueryRuleCustomData.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _preact = require(\"preact\");\nvar _Template = _interopRequireDefault(require(\"../Template/Template\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nvar QueryRuleCustomData = function QueryRuleCustomData(_ref) {\n  var cssClasses = _ref.cssClasses,\n    templates = _ref.templates,\n    items = _ref.items;\n  return (0, _preact.h)(_Template.default, {\n    templateKey: \"default\",\n    templates: templates,\n    rootProps: {\n      className: cssClasses.root\n    },\n    data: {\n      items: items\n    }\n  });\n};\nvar _default = exports.default = QueryRuleCustomData;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/RangeInput/RangeInput.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _Template = _interopRequireDefault(require(\"../Template/Template\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n// Strips leading `0` from a positive number value\nfunction stripLeadingZeroFromInput(value) {\n  return value.replace(/^(0+)\\d/, function (part) {\n    return Number(part).toString();\n  });\n}\nvar RangeInput = /*#__PURE__*/function (_Component) {\n  _inherits(RangeInput, _Component);\n  var _super = _createSuper(RangeInput);\n  function RangeInput() {\n    var _this$props$values$mi, _this$props$values$ma;\n    var _this;\n    _classCallCheck(this, RangeInput);\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    _this = _super.call.apply(_super, [this].concat(args));\n    _defineProperty(_assertThisInitialized(_this), \"state\", {\n      min: (_this$props$values$mi = _this.props.values.min) === null || _this$props$values$mi === void 0 ? void 0 : _this$props$values$mi.toString(),\n      max: (_this$props$values$ma = _this.props.values.max) === null || _this$props$values$ma === void 0 ? void 0 : _this$props$values$ma.toString()\n    });\n    _defineProperty(_assertThisInitialized(_this), \"onInput\", function (key) {\n      return function (event) {\n        var _ref = event.currentTarget,\n          value = _ref.value;\n        _this.setState(_defineProperty({}, key, value));\n      };\n    });\n    _defineProperty(_assertThisInitialized(_this), \"onSubmit\", function (event) {\n      event.preventDefault();\n      var _this$state = _this.state,\n        min = _this$state.min,\n        max = _this$state.max;\n      _this.props.refine([min ? Number(min) : undefined, max ? Number(max) : undefined]);\n    });\n    return _this;\n  }\n  _createClass(RangeInput, [{\n    key: \"componentWillReceiveProps\",\n    value: function componentWillReceiveProps(nextProps) {\n      var _nextProps$values$min, _nextProps$values$max;\n      this.setState({\n        min: (_nextProps$values$min = nextProps.values.min) === null || _nextProps$values$min === void 0 ? void 0 : _nextProps$values$min.toString(),\n        max: (_nextProps$values$max = nextProps.values.max) === null || _nextProps$values$max === void 0 ? void 0 : _nextProps$values$max.toString()\n      });\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      var _this$state2 = this.state,\n        minValue = _this$state2.min,\n        maxValue = _this$state2.max;\n      var _this$props = this.props,\n        min = _this$props.min,\n        max = _this$props.max,\n        step = _this$props.step,\n        cssClasses = _this$props.cssClasses,\n        templateProps = _this$props.templateProps;\n      var isDisabled = min && max ? min >= max : false;\n      var hasRefinements = Boolean(minValue || maxValue);\n      var rootClassNames = (0, _instantsearchUiComponents.cx)(cssClasses.root, !hasRefinements && cssClasses.noRefinement);\n      return (0, _preact.h)(\"div\", {\n        className: rootClassNames\n      }, (0, _preact.h)(\"form\", {\n        className: cssClasses.form,\n        onSubmit: this.onSubmit\n      }, (0, _preact.h)(\"label\", {\n        className: cssClasses.label\n      }, (0, _preact.h)(\"input\", {\n        className: (0, _instantsearchUiComponents.cx)(cssClasses.input, cssClasses.inputMin),\n        type: \"number\",\n        min: min,\n        max: max,\n        step: step,\n        value: stripLeadingZeroFromInput(minValue !== null && minValue !== void 0 ? minValue : ''),\n        onInput: this.onInput('min'),\n        placeholder: min === null || min === void 0 ? void 0 : min.toString(),\n        disabled: isDisabled\n      })), (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n        templateKey: \"separatorText\",\n        rootTagName: \"span\",\n        rootProps: {\n          className: cssClasses.separator\n        }\n      })), (0, _preact.h)(\"label\", {\n        className: cssClasses.label\n      }, (0, _preact.h)(\"input\", {\n        className: (0, _instantsearchUiComponents.cx)(cssClasses.input, cssClasses.inputMax),\n        type: \"number\",\n        min: min,\n        max: max,\n        step: step,\n        value: stripLeadingZeroFromInput(maxValue !== null && maxValue !== void 0 ? maxValue : ''),\n        onInput: this.onInput('max'),\n        placeholder: max === null || max === void 0 ? void 0 : max.toString(),\n        disabled: isDisabled\n      })), (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n        templateKey: \"submitText\",\n        rootTagName: \"button\",\n        rootProps: {\n          type: 'submit',\n          className: cssClasses.submit,\n          disabled: isDisabled\n        }\n      }))));\n    }\n  }]);\n  return RangeInput;\n}(_preact.Component);\nvar _default = exports.default = RangeInput;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/RefinementList/RefinementList.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _utils = require(\"../../lib/utils\");\nvar _SearchBox = _interopRequireDefault(require(\"../SearchBox/SearchBox\"));\nvar _Template = _interopRequireDefault(require(\"../Template/Template\"));\nvar _RefinementListItem = _interopRequireDefault(require(\"./RefinementListItem\"));\nvar _excluded = [\"root\"];\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n// CSS types\n\nvar defaultProps = {\n  cssClasses: {},\n  depth: 0\n};\nfunction isHierarchicalMenuItem(facetValue) {\n  return facetValue.data !== undefined;\n}\nvar RefinementList = /*#__PURE__*/function (_Component) {\n  _inherits(RefinementList, _Component);\n  var _super = _createSuper(RefinementList);\n  function RefinementList() {\n    var _this;\n    _classCallCheck(this, RefinementList);\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    _this = _super.call.apply(_super, [this].concat(args));\n    _defineProperty(_assertThisInitialized(_this), \"listRef\", (0, _preact.createRef)());\n    _defineProperty(_assertThisInitialized(_this), \"searchBox\", (0, _preact.createRef)());\n    _defineProperty(_assertThisInitialized(_this), \"lastRefinedValue\", undefined);\n    _defineProperty(_assertThisInitialized(_this), \"_generateFacetItem\", function (facetValue) {\n      var subItems;\n      if (isHierarchicalMenuItem(facetValue) && Array.isArray(facetValue.data) && facetValue.data.length > 0) {\n        var _this$props$cssClasse = _this.props.cssClasses,\n          root = _this$props$cssClasse.root,\n          cssClasses = _objectWithoutProperties(_this$props$cssClasse, _excluded);\n        subItems = (0, _preact.h)(RefinementList, _extends({}, _this.props, {\n          // We want to keep `root` required for external usage but not for the\n          // sub items.\n          cssClasses: cssClasses,\n          depth: _this.props.depth + 1,\n          facetValues: facetValue.data,\n          showMore: false,\n          className: _this.props.cssClasses.childList\n        }));\n      }\n      var url = _this.props.createURL(facetValue.value);\n      var templateData = _objectSpread(_objectSpread({}, facetValue), {}, {\n        url: url,\n        attribute: _this.props.attribute,\n        cssClasses: _this.props.cssClasses,\n        isFromSearch: _this.props.isFromSearch\n      });\n      var key = facetValue.value;\n      if (facetValue.isRefined !== undefined) {\n        key += \"/\".concat(facetValue.isRefined);\n      }\n      if (facetValue.count !== undefined) {\n        key += \"/\".concat(facetValue.count);\n      }\n      var refinementListItemClassName = (0, _instantsearchUiComponents.cx)(_this.props.cssClasses.item, facetValue.isRefined && _this.props.cssClasses.selectedItem, !facetValue.count && _this.props.cssClasses.disabledItem, Boolean(isHierarchicalMenuItem(facetValue) && Array.isArray(facetValue.data) && facetValue.data.length > 0) && _this.props.cssClasses.parentItem);\n      return (0, _preact.h)(_RefinementListItem.default, {\n        templateKey: \"item\",\n        key: key,\n        facetValueToRefine: facetValue.value,\n        handleClick: _this.handleItemClick,\n        isRefined: facetValue.isRefined,\n        className: refinementListItemClassName,\n        subItems: subItems,\n        templateData: templateData,\n        templateProps: _this.props.templateProps\n      });\n    });\n    // Click events on DOM tree like LABEL > INPUT will result in two click events\n    // instead of one.\n    // No matter the framework, see https://www.google.com/search?q=click+label+twice\n    //\n    // Thus making it hard to distinguish activation from deactivation because both click events\n    // are very close. Debounce is a solution but hacky.\n    //\n    // So the code here checks if the click was done on or in a LABEL. If this LABEL\n    // has a checkbox inside, we ignore the first click event because we will get another one.\n    //\n    // We also check if the click was done inside a link and then e.preventDefault() because we already\n    // handle the url\n    //\n    // Finally, we always stop propagation of the event to avoid multiple levels RefinementLists to fail: click\n    // on child would click on parent also\n    _defineProperty(_assertThisInitialized(_this), \"handleItemClick\", function (_ref) {\n      var facetValueToRefine = _ref.facetValueToRefine,\n        isRefined = _ref.isRefined,\n        originalEvent = _ref.originalEvent;\n      if ((0, _utils.isSpecialClick)(originalEvent)) {\n        // do not alter the default browser behavior\n        // if one special key is down\n        return;\n      }\n      var parent = originalEvent.target;\n      if (parent === null || parent.parentNode === null) {\n        return;\n      }\n      if (isRefined && parent.parentNode.querySelector('input[type=\"radio\"]:checked')) {\n        // Prevent refinement for being reset if the user clicks on an already checked radio button\n        return;\n      }\n      if (parent.tagName === 'INPUT') {\n        _this.refine(facetValueToRefine);\n        return;\n      }\n      while (parent !== originalEvent.currentTarget) {\n        if (parent.tagName === 'LABEL' && (parent.querySelector('input[type=\"checkbox\"]') || parent.querySelector('input[type=\"radio\"]'))) {\n          return;\n        }\n        if (parent.tagName === 'A' && parent.href) {\n          originalEvent.preventDefault();\n        }\n        parent = parent.parentNode;\n      }\n      originalEvent.stopPropagation();\n      _this.refine(facetValueToRefine);\n    });\n    return _this;\n  }\n  _createClass(RefinementList, [{\n    key: \"shouldComponentUpdate\",\n    value: function shouldComponentUpdate(nextProps) {\n      var areFacetValuesDifferent = !(0, _utils.isEqual)(this.props.facetValues, nextProps.facetValues);\n      return areFacetValuesDifferent;\n    }\n  }, {\n    key: \"refine\",\n    value: function refine(facetValueToRefine) {\n      this.lastRefinedValue = facetValueToRefine;\n      this.props.toggleRefinement(facetValueToRefine);\n    }\n  }, {\n    key: \"componentWillReceiveProps\",\n    value: function componentWillReceiveProps(nextProps) {\n      if (this.searchBox.current && !nextProps.isFromSearch) {\n        this.searchBox.current.resetInput();\n      }\n    }\n\n    /**\n     * This sets focus on the last refined input element after a render\n     * because Preact does not perform it automatically.\n     * @see https://github.com/preactjs/preact/issues/3242\n     */\n  }, {\n    key: \"componentDidUpdate\",\n    value: function componentDidUpdate() {\n      var _this$listRef$current, _this$listRef$current2, _this$lastRefinedValu;\n      (_this$listRef$current = this.listRef.current) === null || _this$listRef$current === void 0 ? void 0 : (_this$listRef$current2 = _this$listRef$current.querySelector(\"input[value=\\\"\".concat((_this$lastRefinedValu = this.lastRefinedValue) === null || _this$lastRefinedValu === void 0 ? void 0 : _this$lastRefinedValu.replace('\"', '\\\\\"'), \"\\\"]\"))) === null || _this$listRef$current2 === void 0 ? void 0 : _this$listRef$current2.focus();\n      this.lastRefinedValue = undefined;\n    }\n  }, {\n    key: \"refineFirstValue\",\n    value: function refineFirstValue() {\n      var firstValue = this.props.facetValues && this.props.facetValues[0];\n      if (firstValue) {\n        var actualValue = firstValue.value;\n        this.props.toggleRefinement(actualValue);\n      }\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      var _this2 = this;\n      var showMoreButtonClassName = (0, _instantsearchUiComponents.cx)(this.props.cssClasses.showMore, !(this.props.showMore === true && this.props.canToggleShowMore) && this.props.cssClasses.disabledShowMore);\n      var showMoreButton = this.props.showMore === true && (0, _preact.h)(_Template.default, _extends({}, this.props.templateProps, {\n        templateKey: \"showMoreText\",\n        rootTagName: \"button\",\n        rootProps: {\n          className: showMoreButtonClassName,\n          disabled: !this.props.canToggleShowMore,\n          onClick: this.props.toggleShowMore\n        },\n        data: {\n          isShowingMore: this.props.isShowingMore\n        }\n      }));\n      var shouldDisableSearchBox = this.props.searchIsAlwaysActive !== true && !(this.props.isFromSearch || !this.props.hasExhaustiveItems);\n      var searchBox = this.props.searchFacetValues && (0, _preact.h)(\"div\", {\n        className: this.props.cssClasses.searchBox\n      }, (0, _preact.h)(_SearchBox.default, {\n        ref: this.searchBox,\n        placeholder: this.props.searchPlaceholder,\n        disabled: shouldDisableSearchBox,\n        cssClasses: this.props.cssClasses.searchable,\n        templates: this.props.searchBoxTemplateProps.templates,\n        onChange: function onChange(event) {\n          return _this2.props.searchFacetValues(event.target.value);\n        },\n        onReset: function onReset() {\n          return _this2.props.searchFacetValues('');\n        },\n        onSubmit: function onSubmit() {\n          return _this2.refineFirstValue();\n        }\n        // This sets the search box to a controlled state because\n        // we don't rely on the `refine` prop but on `onChange`.\n        ,\n        searchAsYouType: false,\n        ariaLabel: \"Search for filters\"\n      }));\n      var facetValues = this.props.facetValues && this.props.facetValues.length > 0 && (0, _preact.h)(\"ul\", {\n        ref: this.listRef,\n        className: this.props.cssClasses.list\n      }, this.props.facetValues.map(this._generateFacetItem, this));\n      var noResults = this.props.searchFacetValues && this.props.isFromSearch && (!this.props.facetValues || this.props.facetValues.length === 0) && (0, _preact.h)(_Template.default, _extends({}, this.props.templateProps, {\n        templateKey: \"searchableNoResults\",\n        rootProps: {\n          className: this.props.cssClasses.noResults\n        }\n      }));\n      var rootClassName = (0, _instantsearchUiComponents.cx)(this.props.cssClasses.root, (!this.props.facetValues || this.props.facetValues.length === 0) && this.props.cssClasses.noRefinementRoot, this.props.className);\n      return (0, _preact.h)(\"div\", {\n        className: rootClassName\n      }, this.props.children, searchBox, facetValues, noResults, showMoreButton);\n    }\n  }]);\n  return RefinementList;\n}(_preact.Component);\n_defineProperty(RefinementList, \"defaultProps\", defaultProps);\nvar _default = exports.default = RefinementList;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/RefinementList/RefinementListItem.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _preact = require(\"preact\");\nvar _Template = _interopRequireDefault(require(\"../Template/Template\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction RefinementListItem(_ref) {\n  var className = _ref.className,\n    handleClick = _ref.handleClick,\n    facetValueToRefine = _ref.facetValueToRefine,\n    isRefined = _ref.isRefined,\n    templateProps = _ref.templateProps,\n    templateKey = _ref.templateKey,\n    templateData = _ref.templateData,\n    subItems = _ref.subItems;\n  return (0, _preact.h)(\"li\", {\n    className: className,\n    onClick: function onClick(originalEvent) {\n      handleClick({\n        facetValueToRefine: facetValueToRefine,\n        isRefined: isRefined,\n        originalEvent: originalEvent\n      });\n    }\n  }, (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n    templateKey: templateKey,\n    data: templateData\n  })), subItems);\n}\nvar _default = exports.default = RefinementListItem;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/RelevantSort/RelevantSort.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _preact = require(\"preact\");\nvar _Template = _interopRequireDefault(require(\"../Template/Template\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nvar RelevantSort = function RelevantSort(_ref) {\n  var cssClasses = _ref.cssClasses,\n    templates = _ref.templates,\n    isRelevantSorted = _ref.isRelevantSorted,\n    isVirtualReplica = _ref.isVirtualReplica,\n    refine = _ref.refine;\n  return isVirtualReplica ? (0, _preact.h)(\"div\", {\n    className: cssClasses.root\n  }, (0, _preact.h)(_Template.default, {\n    templateKey: \"text\",\n    templates: templates,\n    rootProps: {\n      className: cssClasses.text\n    },\n    data: {\n      isRelevantSorted: isRelevantSorted\n    }\n  }), (0, _preact.h)(\"button\", {\n    type: \"button\",\n    className: cssClasses.button,\n    onClick: function onClick() {\n      if (isRelevantSorted) {\n        refine(0);\n      } else {\n        refine(undefined);\n      }\n    }\n  }, (0, _preact.h)(_Template.default, {\n    rootTagName: \"span\",\n    templateKey: \"button\",\n    templates: templates,\n    data: {\n      isRelevantSorted: isRelevantSorted\n    }\n  }))) : null;\n};\nvar _default = exports.default = RelevantSort;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/ReverseHighlight/ReverseHighlight.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ReverseHighlight = ReverseHighlight;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _InternalHighlight = require(\"../InternalHighlight/InternalHighlight\");\nvar _excluded = [\"classNames\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction ReverseHighlight(_ref) {\n  var _ref$classNames = _ref.classNames,\n    classNames = _ref$classNames === void 0 ? {} : _ref$classNames,\n    props = _objectWithoutProperties(_ref, _excluded);\n  return (0, _preact.h)(_InternalHighlight.InternalHighlight, _extends({\n    classNames: {\n      root: (0, _instantsearchUiComponents.cx)('ais-ReverseHighlight', classNames.root),\n      highlighted: (0, _instantsearchUiComponents.cx)('ais-ReverseHighlight-highlighted', classNames.highlighted),\n      nonHighlighted: (0, _instantsearchUiComponents.cx)('ais-ReverseHighlight-nonHighlighted', classNames.nonHighlighted),\n      separator: (0, _instantsearchUiComponents.cx)('ais-ReverseHighlight-separator', classNames.separator)\n    }\n  }, props));\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/components/ReverseSnippet/ReverseSnippet.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ReverseSnippet = ReverseSnippet;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _InternalHighlight = require(\"../InternalHighlight/InternalHighlight\");\nvar _excluded = [\"classNames\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction ReverseSnippet(_ref) {\n  var _ref$classNames = _ref.classNames,\n    classNames = _ref$classNames === void 0 ? {} : _ref$classNames,\n    props = _objectWithoutProperties(_ref, _excluded);\n  return (0, _preact.h)(_InternalHighlight.InternalHighlight, _extends({\n    classNames: {\n      root: (0, _instantsearchUiComponents.cx)('ais-ReverseSnippet', classNames.root),\n      highlighted: (0, _instantsearchUiComponents.cx)('ais-ReverseSnippet-highlighted', classNames.highlighted),\n      nonHighlighted: (0, _instantsearchUiComponents.cx)('ais-ReverseSnippet-nonHighlighted', classNames.nonHighlighted),\n      separator: (0, _instantsearchUiComponents.cx)('ais-ReverseSnippet-separator', classNames.separator)\n    }\n  }, props));\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/components/SearchBox/SearchBox.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _preact = require(\"preact\");\nvar _utils = require(\"../../lib/utils\");\nvar _Template = _interopRequireDefault(require(\"../Template/Template\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar defaultProps = {\n  query: '',\n  showSubmit: true,\n  showReset: true,\n  showLoadingIndicator: true,\n  autofocus: false,\n  searchAsYouType: true,\n  ignoreCompositionEvents: false,\n  isSearchStalled: false,\n  disabled: false,\n  ariaLabel: 'Search',\n  onChange: _utils.noop,\n  onSubmit: _utils.noop,\n  onReset: _utils.noop,\n  refine: _utils.noop\n};\nvar SearchBox = /*#__PURE__*/function (_Component) {\n  _inherits(SearchBox, _Component);\n  var _super = _createSuper(SearchBox);\n  function SearchBox() {\n    var _this;\n    _classCallCheck(this, SearchBox);\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    _this = _super.call.apply(_super, [this].concat(args));\n    _defineProperty(_assertThisInitialized(_this), \"state\", {\n      query: _this.props.query,\n      focused: false\n    });\n    _defineProperty(_assertThisInitialized(_this), \"input\", (0, _preact.createRef)());\n    _defineProperty(_assertThisInitialized(_this), \"onInput\", function (event) {\n      var _this$props = _this.props,\n        searchAsYouType = _this$props.searchAsYouType,\n        refine = _this$props.refine,\n        onChange = _this$props.onChange;\n      var query = event.target.value;\n      if (!(_this.props.ignoreCompositionEvents && event.isComposing)) {\n        if (searchAsYouType) {\n          refine(query);\n        }\n        _this.setState({\n          query: query\n        });\n        onChange(event);\n      }\n    });\n    _defineProperty(_assertThisInitialized(_this), \"onSubmit\", function (event) {\n      var _this$props2 = _this.props,\n        searchAsYouType = _this$props2.searchAsYouType,\n        refine = _this$props2.refine,\n        onSubmit = _this$props2.onSubmit;\n      event.preventDefault();\n      event.stopPropagation();\n      if (_this.input.current) {\n        _this.input.current.blur();\n      }\n      if (!searchAsYouType) {\n        refine(_this.state.query);\n      }\n      onSubmit(event);\n      return false;\n    });\n    _defineProperty(_assertThisInitialized(_this), \"onReset\", function (event) {\n      var _this$props3 = _this.props,\n        refine = _this$props3.refine,\n        onReset = _this$props3.onReset;\n      var query = '';\n      if (_this.input.current) {\n        _this.input.current.focus();\n      }\n      refine(query);\n      _this.setState({\n        query: query\n      });\n      onReset(event);\n    });\n    _defineProperty(_assertThisInitialized(_this), \"onBlur\", function () {\n      _this.setState({\n        focused: false\n      });\n    });\n    _defineProperty(_assertThisInitialized(_this), \"onFocus\", function () {\n      _this.setState({\n        focused: true\n      });\n    });\n    return _this;\n  }\n  _createClass(SearchBox, [{\n    key: \"resetInput\",\n    value:\n    /**\n     * This public method is used in the RefinementList SFFV search box\n     * to reset the input state when an item is selected.\n     *\n     * @see RefinementList#componentWillReceiveProps\n     * @return {undefined}\n     */\n    function resetInput() {\n      this.setState({\n        query: ''\n      });\n    }\n  }, {\n    key: \"componentWillReceiveProps\",\n    value: function componentWillReceiveProps(nextProps) {\n      /**\n       * when the user is typing, we don't want to replace the query typed\n       * by the user (state.query) with the query exposed by the connector (props.query)\n       * see: https://github.com/algolia/instantsearch/issues/4141\n       */\n      if (!this.state.focused && nextProps.query !== this.state.query) {\n        this.setState({\n          query: nextProps.query\n        });\n      }\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      var _this$props4 = this.props,\n        cssClasses = _this$props4.cssClasses,\n        placeholder = _this$props4.placeholder,\n        autofocus = _this$props4.autofocus,\n        showSubmit = _this$props4.showSubmit,\n        showReset = _this$props4.showReset,\n        showLoadingIndicator = _this$props4.showLoadingIndicator,\n        templates = _this$props4.templates,\n        isSearchStalled = _this$props4.isSearchStalled,\n        ariaLabel = _this$props4.ariaLabel;\n      return (0, _preact.h)(\"div\", {\n        className: cssClasses.root\n      }, (0, _preact.h)(\"form\", {\n        action: \"\",\n        role: \"search\",\n        className: cssClasses.form,\n        noValidate: true,\n        onSubmit: this.onSubmit,\n        onReset: this.onReset\n      }, (0, _preact.h)(\"input\", {\n        ref: this.input,\n        value: this.state.query,\n        disabled: this.props.disabled,\n        className: cssClasses.input,\n        type: \"search\",\n        placeholder: placeholder,\n        autoFocus: autofocus,\n        autoComplete: \"off\",\n        autoCorrect: \"off\",\n        autoCapitalize: \"off\"\n        // @ts-expect-error `spellCheck` attribute is missing in preact JSX types\n        ,\n        spellCheck: \"false\",\n        maxLength: 512,\n        onInput: this.onInput\n        // see: https://github.com/preactjs/preact/issues/1978\n        // eslint-disable-next-line react/no-unknown-property\n        ,\n        oncompositionend: this.onInput,\n        onBlur: this.onBlur,\n        onFocus: this.onFocus,\n        \"aria-label\": ariaLabel\n      }), (0, _preact.h)(_Template.default, {\n        templateKey: \"submit\",\n        rootTagName: \"button\",\n        rootProps: {\n          className: cssClasses.submit,\n          type: 'submit',\n          title: 'Submit the search query',\n          hidden: !showSubmit\n        },\n        templates: templates,\n        data: {\n          cssClasses: cssClasses\n        }\n      }), (0, _preact.h)(_Template.default, {\n        templateKey: \"reset\",\n        rootTagName: \"button\",\n        rootProps: {\n          className: cssClasses.reset,\n          type: 'reset',\n          title: 'Clear the search query',\n          hidden: !(showReset && this.state.query.trim() && !isSearchStalled)\n        },\n        templates: templates,\n        data: {\n          cssClasses: cssClasses\n        }\n      }), showLoadingIndicator && (0, _preact.h)(_Template.default, {\n        templateKey: \"loadingIndicator\",\n        rootTagName: \"span\",\n        rootProps: {\n          className: cssClasses.loadingIndicator,\n          hidden: !isSearchStalled\n        },\n        templates: templates,\n        data: {\n          cssClasses: cssClasses\n        }\n      })));\n    }\n  }]);\n  return SearchBox;\n}(_preact.Component);\n_defineProperty(SearchBox, \"defaultProps\", defaultProps);\nvar _default = exports.default = SearchBox;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/Selector/Selector.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nfunction Selector(_ref) {\n  var currentValue = _ref.currentValue,\n    options = _ref.options,\n    cssClasses = _ref.cssClasses,\n    setValue = _ref.setValue,\n    ariaLabel = _ref.ariaLabel;\n  return (0, _preact.h)(\"select\", {\n    className: (0, _instantsearchUiComponents.cx)(cssClasses.select),\n    onChange: function onChange(event) {\n      return setValue(event.target.value);\n    },\n    value: \"\".concat(currentValue),\n    \"aria-label\": ariaLabel\n  }, options.map(function (option) {\n    return (0, _preact.h)(\"option\", {\n      className: (0, _instantsearchUiComponents.cx)(cssClasses.option),\n      key: option.label + option.value,\n      value: \"\".concat(option.value)\n    }, option.label);\n  }));\n}\nvar _default = exports.default = Selector;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/Slider/Pit.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar Pit = function Pit(_ref) {\n  var style = _ref.style,\n    children = _ref.children;\n  // first, end & middle\n  var positionValue = Math.round(parseFloat(style.left));\n  var shouldDisplayValue = [0, 50, 100].includes(positionValue);\n  var value = children;\n  var pitValue = Math.round(parseInt(value, 10) * 100) / 100;\n  return (0, _preact.h)(\"div\", {\n    style: _objectSpread(_objectSpread({}, style), {}, {\n      marginLeft: positionValue === 100 ? '-2px' : 0\n    }),\n    className: (0, _instantsearchUiComponents.cx)('rheostat-marker', 'rheostat-marker-horizontal', shouldDisplayValue && 'rheostat-marker-large')\n  }, shouldDisplayValue && (0, _preact.h)(\"div\", {\n    className: 'rheostat-value'\n  }, pitValue));\n};\nvar _default = exports.default = Pit;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/Slider/Rheostat.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _preact = require(\"preact\");\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /**\n * This is a fork of Rheostat for Preact X.\n *\n * @see https://github.com/airbnb/rheostat\n */\nvar KEYS = {\n  DOWN: 40,\n  END: 35,\n  ESC: 27,\n  HOME: 36,\n  LEFT: 37,\n  PAGE_DOWN: 34,\n  PAGE_UP: 33,\n  RIGHT: 39,\n  UP: 38\n};\nvar PERCENT_EMPTY = 0;\nvar PERCENT_FULL = 100;\nfunction getPosition(value, min, max) {\n  return (value - min) / (max - min) * 100;\n}\nfunction getValue(pos, min, max) {\n  var decimal = pos / 100;\n  if (pos === 0) {\n    return min;\n  } else if (pos === 100) {\n    return max;\n  }\n  return Math.round((max - min) * decimal + min);\n}\nfunction getClassName(props) {\n  var orientation = props.orientation === 'vertical' ? 'rheostat-vertical' : 'rheostat-horizontal';\n  return ['rheostat', orientation].concat(props.className.split(' ')).join(' ');\n}\nfunction getHandleFor(ev) {\n  return Number(ev.currentTarget.getAttribute('data-handle-key'));\n}\nfunction killEvent(ev) {\n  ev.stopPropagation();\n  ev.preventDefault();\n}\nfunction Button(props) {\n  return (0, _preact.h)(\"button\", _extends({}, props, {\n    type: \"button\"\n  }));\n}\n\n// Preact doesn't have builtin types for Style, JSX.HTMLAttributes['style'] is just object\n// maybe migrate to csstype later?\nvar _ref6 = (0, _preact.h)(\"div\", {\n  className: \"rheostat-background\"\n});\nvar Rheostat = /*#__PURE__*/function (_Component) {\n  _inherits(Rheostat, _Component);\n  var _super = _createSuper(Rheostat);\n  function Rheostat() {\n    var _this;\n    _classCallCheck(this, Rheostat);\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    _this = _super.call.apply(_super, [this].concat(args));\n    _defineProperty(_assertThisInitialized(_this), \"x\", [0, 0].map(function (y) {\n      return y;\n    }));\n    _defineProperty(_assertThisInitialized(_this), \"state\", {\n      className: getClassName(_this.props),\n      // non-null thanks to defaultProps\n      handlePos: _this.props.values.map(function (value) {\n        return getPosition(value, _this.props.min, _this.props.max);\n      }),\n      handleDimensions: 0,\n      mousePos: null,\n      sliderBox: {},\n      slidingIndex: null,\n      // non-null thanks to defaultProps\n      values: _this.props.values\n    });\n    _defineProperty(_assertThisInitialized(_this), \"rheostat\", (0, _preact.createRef)());\n    _defineProperty(_assertThisInitialized(_this), \"componentWillReceiveProps\", function (nextProps) {\n      var _this$props = _this.props,\n        className = _this$props.className,\n        disabled = _this$props.disabled,\n        min = _this$props.min,\n        max = _this$props.max,\n        orientation = _this$props.orientation;\n      var _this$state = _this.state,\n        values = _this$state.values,\n        slidingIndex = _this$state.slidingIndex;\n      var minMaxChanged = nextProps.min !== min || nextProps.max !== max;\n      var valuesChanged = values.length !== nextProps.values.length || values.some(function (value, idx) {\n        return nextProps.values[idx] !== value;\n      });\n      var orientationChanged = nextProps.className !== className || nextProps.orientation !== orientation;\n      var willBeDisabled = nextProps.disabled && !disabled;\n      if (orientationChanged) {\n        _this.setState({\n          className: getClassName(nextProps)\n        });\n      }\n      if (minMaxChanged || valuesChanged) _this.updateNewValues(nextProps);\n      if (willBeDisabled && slidingIndex !== null) {\n        _this.endSlide();\n      }\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getPublicState\", function () {\n      var _this$props2 = _this.props,\n        min = _this$props2.min,\n        max = _this$props2.max;\n      var values = _this.state.values;\n      return {\n        max: max,\n        min: min,\n        values: values\n      };\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getSliderBoundingBox\", function () {\n      // only gets called after render, so it will always be defined\n      var node = _this.rheostat.current;\n      var rect = node.getBoundingClientRect();\n      return {\n        height: rect.height || node.clientHeight,\n        left: rect.left,\n        top: rect.top,\n        width: rect.width || node.clientWidth\n      };\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getProgressStyle\", function (idx) {\n      var handlePos = _this.state.handlePos;\n      var value = handlePos[idx];\n      if (idx === 0) {\n        return _this.props.orientation === 'vertical' ? {\n          height: \"\".concat(value, \"%\"),\n          top: 0\n        } : {\n          left: 0,\n          width: \"\".concat(value, \"%\")\n        };\n      }\n      var prevValue = handlePos[idx - 1];\n      var diffValue = value - prevValue;\n      return _this.props.orientation === 'vertical' ? {\n        height: \"\".concat(diffValue, \"%\"),\n        top: \"\".concat(prevValue, \"%\")\n      } : {\n        left: \"\".concat(prevValue, \"%\"),\n        width: \"\".concat(diffValue, \"%\")\n      };\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getMinValue\", function (idx) {\n      return _this.state.values[idx - 1] ? Math.max(_this.props.min, _this.state.values[idx - 1]) : _this.props.min;\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getMaxValue\", function (idx) {\n      return _this.state.values[idx + 1] ? Math.min(_this.props.max, _this.state.values[idx + 1]) : _this.props.max;\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getHandleDimensions\", function (ev, sliderBox) {\n      var handleNode = ev.currentTarget || null;\n      if (!handleNode) return 0;\n      return _this.props.orientation === 'vertical' ? handleNode.clientHeight / sliderBox.height * PERCENT_FULL / 2 : handleNode.clientWidth / sliderBox.width * PERCENT_FULL / 2;\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getClosestSnapPoint\", function (value) {\n      // non-null thanks to defaultProps\n      if (!_this.props.snapPoints.length) return value;\n      return _this.props.snapPoints.reduce(function (snapTo, snap) {\n        return Math.abs(snapTo - value) < Math.abs(snap - value) ? snapTo : snap;\n      });\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getSnapPosition\", function (positionPercent) {\n      if (!_this.props.snap) return positionPercent;\n      var _ref = _this.props,\n        max = _ref.max,\n        min = _ref.min;\n      var value = getValue(positionPercent, min, max);\n      var snapValue = _this.getClosestSnapPoint(value);\n      return getPosition(snapValue, min, max);\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getNextPositionForKey\", function (idx, keyCode) {\n      var _stepMultiplier;\n      var _this$state2 = _this.state,\n        handlePos = _this$state2.handlePos,\n        values = _this$state2.values;\n      var _ref2 = _this.props,\n        max = _ref2.max,\n        min = _ref2.min,\n        snapPoints = _ref2.snapPoints;\n      var shouldSnap = _this.props.snap;\n      var proposedValue = values[idx];\n      var proposedPercentage = handlePos[idx];\n      var originalPercentage = proposedPercentage;\n      var stepValue = 1;\n      if (max >= 100) {\n        proposedPercentage = Math.round(proposedPercentage);\n      } else {\n        stepValue = 100 / (max - min);\n      }\n      var currentIndex = null;\n      if (shouldSnap) {\n        currentIndex = snapPoints.indexOf(_this.getClosestSnapPoint(values[idx]));\n      }\n      var stepMultiplier = (_stepMultiplier = {}, _defineProperty(_stepMultiplier, KEYS.LEFT, function (v) {\n        return v * -1;\n      }), _defineProperty(_stepMultiplier, KEYS.RIGHT, function (v) {\n        return v;\n      }), _defineProperty(_stepMultiplier, KEYS.UP, function (v) {\n        return v;\n      }), _defineProperty(_stepMultiplier, KEYS.DOWN, function (v) {\n        return v * -1;\n      }), _defineProperty(_stepMultiplier, KEYS.PAGE_DOWN, function (v) {\n        return v > 1 ? -v : v * -10;\n      }), _defineProperty(_stepMultiplier, KEYS.PAGE_UP, function (v) {\n        return v > 1 ? v : v * 10;\n      }), _stepMultiplier);\n      if (Object.prototype.hasOwnProperty.call(stepMultiplier, keyCode)) {\n        proposedPercentage += stepMultiplier[keyCode](stepValue);\n        if (shouldSnap) {\n          if (!currentIndex) {\n            // nothing happens\n          } else if (proposedPercentage > originalPercentage) {\n            // move cursor right unless overflow\n            if (currentIndex < snapPoints.length - 1) {\n              proposedValue = snapPoints[currentIndex + 1];\n            }\n            // move cursor left unless there is overflow\n          } else if (currentIndex > 0) {\n            proposedValue = snapPoints[currentIndex - 1];\n          }\n        }\n      } else if (keyCode === KEYS.HOME) {\n        proposedPercentage = PERCENT_EMPTY;\n        if (shouldSnap) {\n          proposedValue = snapPoints[0];\n        }\n      } else if (keyCode === KEYS.END) {\n        proposedPercentage = PERCENT_FULL;\n        if (shouldSnap) {\n          proposedValue = snapPoints[snapPoints.length - 1];\n        }\n      } else {\n        return null;\n      }\n      return shouldSnap ? getPosition(proposedValue, min, max) : proposedPercentage;\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getNextState\", function (idx, proposedPosition) {\n      var handlePos = _this.state.handlePos;\n      var _ref3 = _this.props,\n        max = _ref3.max,\n        min = _ref3.min;\n      var actualPosition = _this.validatePosition(idx, proposedPosition);\n      var nextHandlePos = handlePos.map(function (pos, index) {\n        return index === idx ? actualPosition : pos;\n      });\n      return {\n        handlePos: nextHandlePos,\n        values: nextHandlePos.map(function (pos) {\n          return getValue(pos, min, max);\n        })\n      };\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getClosestHandle\", function (positionPercent) {\n      var handlePos = _this.state.handlePos;\n      return handlePos.reduce(function (closestIdx, _node, idx) {\n        var challenger = Math.abs(handlePos[idx] - positionPercent);\n        var current = Math.abs(handlePos[closestIdx] - positionPercent);\n        return challenger < current ? idx : closestIdx;\n      }, 0);\n    });\n    _defineProperty(_assertThisInitialized(_this), \"setStartSlide\", function (ev, x, y) {\n      var sliderBox = _this.getSliderBoundingBox();\n      _this.setState({\n        handleDimensions: _this.getHandleDimensions(ev, sliderBox),\n        mousePos: {\n          x: x,\n          y: y\n        },\n        sliderBox: sliderBox,\n        slidingIndex: getHandleFor(ev)\n      });\n    });\n    _defineProperty(_assertThisInitialized(_this), \"startMouseSlide\", function (ev) {\n      _this.setStartSlide(ev, ev.clientX, ev.clientY);\n      document.addEventListener('mousemove', _this.handleMouseSlide, false);\n      document.addEventListener('mouseup', _this.endSlide, false);\n      killEvent(ev);\n    });\n    _defineProperty(_assertThisInitialized(_this), \"startTouchSlide\", function (ev) {\n      if (ev.changedTouches.length > 1) return;\n      var touch = ev.changedTouches[0];\n      _this.setStartSlide(ev, touch.clientX, touch.clientY);\n      document.addEventListener('touchmove', _this.handleTouchSlide, false);\n      document.addEventListener('touchend', _this.endSlide, false);\n      if (_this.props.onSliderDragStart) _this.props.onSliderDragStart();\n      killEvent(ev);\n    });\n    _defineProperty(_assertThisInitialized(_this), \"handleMouseSlide\", function (ev) {\n      if (_this.state.slidingIndex === null) return;\n      _this.handleSlide(ev.clientX, ev.clientY);\n      killEvent(ev);\n    });\n    _defineProperty(_assertThisInitialized(_this), \"handleTouchSlide\", function (ev) {\n      if (_this.state.slidingIndex === null) return;\n      if (ev.changedTouches.length > 1) {\n        _this.endSlide();\n        return;\n      }\n      var touch = ev.changedTouches[0];\n      _this.handleSlide(touch.clientX, touch.clientY);\n      killEvent(ev);\n    });\n    _defineProperty(_assertThisInitialized(_this), \"handleSlide\", function (x, y) {\n      var _this$state3 = _this.state,\n        idx = _this$state3.slidingIndex,\n        sliderBox = _this$state3.sliderBox;\n      var positionPercent = _this.props.orientation === 'vertical' ? (y - sliderBox.top) / sliderBox.height * PERCENT_FULL : (x - sliderBox.left) / sliderBox.width * PERCENT_FULL;\n      _this.slideTo(idx, positionPercent);\n      if (_this.canMove(idx, positionPercent)) {\n        // update mouse positions\n        _this.setState({\n          mousePos: {\n            x: x,\n            y: y\n          }\n        });\n        if (_this.props.onSliderDragMove) _this.props.onSliderDragMove();\n      }\n    });\n    _defineProperty(_assertThisInitialized(_this), \"endSlide\", function () {\n      var idx = _this.state.slidingIndex;\n      _this.setState({\n        slidingIndex: null\n      });\n      document.removeEventListener('mouseup', _this.endSlide, false);\n      document.removeEventListener('touchend', _this.endSlide, false);\n      document.removeEventListener('touchmove', _this.handleTouchSlide, false);\n      document.removeEventListener('mousemove', _this.handleMouseSlide, false);\n      if (_this.props.onSliderDragEnd) _this.props.onSliderDragEnd();\n      if (_this.props.snap) {\n        var positionPercent = _this.getSnapPosition(_this.state.handlePos[idx]);\n        _this.slideTo(idx, positionPercent, function () {\n          return _this.fireChangeEvent();\n        });\n      } else {\n        _this.fireChangeEvent();\n      }\n    });\n    _defineProperty(_assertThisInitialized(_this), \"handleClick\", function (ev) {\n      if (ev.target.getAttribute('data-handle-key')) {\n        return;\n      }\n\n      // Calculate the position of the slider on the page so we can determine\n      // the position where you click in relativity.\n      var sliderBox = _this.getSliderBoundingBox();\n      var positionDecimal = _this.props.orientation === 'vertical' ? (ev.clientY - sliderBox.top) / sliderBox.height : (ev.clientX - sliderBox.left) / sliderBox.width;\n      var positionPercent = positionDecimal * PERCENT_FULL;\n      var handleId = _this.getClosestHandle(positionPercent);\n      var validPositionPercent = _this.getSnapPosition(positionPercent);\n\n      // Move the handle there\n      _this.slideTo(handleId, validPositionPercent, function () {\n        return _this.fireChangeEvent();\n      });\n      if (_this.props.onClick) _this.props.onClick();\n    });\n    _defineProperty(_assertThisInitialized(_this), \"handleKeydown\", function (ev) {\n      var idx = getHandleFor(ev);\n      if (ev.keyCode === KEYS.ESC) {\n        ev.currentTarget.blur();\n        return;\n      }\n      var proposedPercentage = _this.getNextPositionForKey(idx, ev.keyCode);\n      if (proposedPercentage === null) return;\n      if (_this.canMove(idx, proposedPercentage)) {\n        _this.slideTo(idx, proposedPercentage, function () {\n          return _this.fireChangeEvent();\n        });\n        if (_this.props.onKeyPress) _this.props.onKeyPress();\n      }\n      killEvent(ev);\n    });\n    // Make sure the proposed position respects the bounds and\n    // does not collide with other handles too much.\n    _defineProperty(_assertThisInitialized(_this), \"validatePosition\", function (idx, proposedPosition) {\n      var _this$state4 = _this.state,\n        handlePos = _this$state4.handlePos,\n        handleDimensions = _this$state4.handleDimensions;\n      return Math.max(Math.min(proposedPosition, handlePos[idx + 1] !== undefined ? handlePos[idx + 1] - handleDimensions : PERCENT_FULL // 100% is the highest value\n      ), handlePos[idx - 1] !== undefined ? handlePos[idx - 1] + handleDimensions : PERCENT_EMPTY // 0% is the lowest value\n      );\n    });\n    _defineProperty(_assertThisInitialized(_this), \"validateValues\", function (proposedValues, props) {\n      var _ref4 = props || _this.props,\n        max = _ref4.max,\n        min = _ref4.min;\n      return proposedValues.map(function (value, idx, values) {\n        var realValue = Math.max(Math.min(value, max), min);\n        if (values.length && realValue < values[idx - 1]) {\n          return values[idx - 1];\n        }\n        return realValue;\n      });\n    });\n    _defineProperty(_assertThisInitialized(_this), \"canMove\", function (idx, proposedPosition) {\n      var _this$state5 = _this.state,\n        handlePos = _this$state5.handlePos,\n        handleDimensions = _this$state5.handleDimensions;\n      if (proposedPosition < PERCENT_EMPTY) return false;\n      if (proposedPosition > PERCENT_FULL) return false;\n      var nextHandlePosition = handlePos[idx + 1] !== undefined ? handlePos[idx + 1] - handleDimensions : Infinity;\n      if (proposedPosition > nextHandlePosition) return false;\n      var prevHandlePosition = handlePos[idx - 1] !== undefined ? handlePos[idx - 1] + handleDimensions : -Infinity;\n      if (proposedPosition < prevHandlePosition) return false;\n      return true;\n    });\n    _defineProperty(_assertThisInitialized(_this), \"fireChangeEvent\", function () {\n      var onChange = _this.props.onChange;\n      if (onChange) onChange(_this.getPublicState());\n    });\n    _defineProperty(_assertThisInitialized(_this), \"slideTo\", function (idx, proposedPosition, onAfterSet) {\n      var nextState = _this.getNextState(idx, proposedPosition);\n      _this.setState(nextState, function () {\n        var onValuesUpdated = _this.props.onValuesUpdated;\n        if (onValuesUpdated) onValuesUpdated(_this.getPublicState());\n        if (onAfterSet) onAfterSet();\n      });\n    });\n    _defineProperty(_assertThisInitialized(_this), \"updateNewValues\", function (nextProps) {\n      var slidingIndex = _this.state.slidingIndex;\n\n      // Don't update while the slider is sliding\n      if (slidingIndex !== null) {\n        return;\n      }\n      var max = nextProps.max,\n        min = nextProps.min,\n        values = nextProps.values;\n      var nextValues = _this.validateValues(values, nextProps);\n      _this.setState({\n        handlePos: nextValues.map(function (value) {\n          return getPosition(value, min, max);\n        }),\n        values: nextValues\n      }, function () {\n        return _this.fireChangeEvent();\n      });\n    });\n    _defineProperty(_assertThisInitialized(_this), \"render\", function () {\n      var _ref5 = _this.props,\n        children = _ref5.children,\n        disabled = _ref5.disabled,\n        Handle = _ref5.handle,\n        max = _ref5.max,\n        min = _ref5.min,\n        orientation = _ref5.orientation,\n        PitComponent = _ref5.pitComponent,\n        pitPoints = _ref5.pitPoints,\n        ProgressBar = _ref5.progressBar; // all required thanks to defaultProps\n      var _this$state6 = _this.state,\n        className = _this$state6.className,\n        handlePos = _this$state6.handlePos,\n        values = _this$state6.values;\n      return (0, _preact.h)(\"div\", {\n        className: className,\n        ref: _this.rheostat,\n        onClick: disabled ? undefined : _this.handleClick,\n        style: {\n          position: 'relative'\n        }\n      }, _ref6, handlePos.map(function (pos, idx) {\n        var handleStyle = orientation === 'vertical' ? {\n          top: \"\".concat(pos, \"%\"),\n          position: 'absolute'\n        } : {\n          left: \"\".concat(pos, \"%\"),\n          position: 'absolute'\n        };\n        return (0, _preact.h)(Handle, {\n          \"aria-valuemax\": _this.getMaxValue(idx),\n          \"aria-valuemin\": _this.getMinValue(idx),\n          \"aria-valuenow\": values[idx],\n          \"aria-disabled\": disabled,\n          \"data-handle-key\": idx,\n          className: \"rheostat-handle\",\n          key: \"handle-\".concat(idx),\n          onClick: killEvent,\n          onKeyDown: disabled ? undefined : _this.handleKeydown,\n          onMouseDown: disabled ? undefined : _this.startMouseSlide,\n          onTouchStart: disabled ? undefined : _this.startTouchSlide,\n          role: \"slider\",\n          style: handleStyle,\n          tabIndex: 0\n        });\n      }), handlePos.map(function (_node, idx, arr) {\n        if (idx === 0 && arr.length > 1) {\n          return null;\n        }\n        return (0, _preact.h)(ProgressBar, {\n          className: \"rheostat-progress\",\n          key: \"progress-bar-\".concat(idx),\n          style: _this.getProgressStyle(idx)\n        });\n      }), PitComponent && pitPoints.map(function (n) {\n        var pos = getPosition(n, min, max);\n        var pitStyle = orientation === 'vertical' ? {\n          top: \"\".concat(pos, \"%\"),\n          position: 'absolute'\n        } : {\n          left: \"\".concat(pos, \"%\"),\n          position: 'absolute'\n        };\n        return (0, _preact.h)(PitComponent, {\n          key: \"pit-\".concat(n),\n          style: pitStyle\n        }, n);\n      }), children);\n    });\n    return _this;\n  }\n  return _createClass(Rheostat);\n}(_preact.Component);\n_defineProperty(Rheostat, \"defaultProps\", {\n  className: '',\n  children: null,\n  disabled: false,\n  handle: Button,\n  max: PERCENT_FULL,\n  min: PERCENT_EMPTY,\n  onClick: null,\n  onChange: null,\n  onKeyPress: null,\n  onSliderDragEnd: null,\n  onSliderDragMove: null,\n  onSliderDragStart: null,\n  onValuesUpdated: null,\n  orientation: 'horizontal',\n  pitComponent: null,\n  pitPoints: [],\n  progressBar: 'div',\n  snap: false,\n  snapPoints: [],\n  values: [PERCENT_EMPTY]\n});\nvar _default = exports.default = Rheostat;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/Slider/Slider.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _utils = require(\"../../lib/utils\");\nvar _Pit = _interopRequireDefault(require(\"./Pit\"));\nvar _Rheostat = _interopRequireDefault(require(\"./Rheostat\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar Slider = /*#__PURE__*/function (_Component) {\n  _inherits(Slider, _Component);\n  var _super = _createSuper(Slider);\n  function Slider() {\n    var _this;\n    _classCallCheck(this, Slider);\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    _this = _super.call.apply(_super, [this].concat(args));\n    _defineProperty(_assertThisInitialized(_this), \"handleChange\", function (_ref) {\n      var values = _ref.values;\n      if (!_this.isDisabled) {\n        _this.props.refine(values);\n      }\n    });\n    _defineProperty(_assertThisInitialized(_this), \"createHandleComponent\", function (tooltips) {\n      return function (props) {\n        // display only two decimals after comma,\n        // and apply `tooltips.format()` if any\n        var roundedValue = Math.round(\n        // have to cast as a string, as the value given to the prop is a number, but becomes a string when read\n        parseFloat(props['aria-valuenow']) * 100) / 100;\n        var value = _typeof(tooltips) === 'object' && tooltips.format ? tooltips.format(roundedValue) : roundedValue;\n        var className = (0, _instantsearchUiComponents.cx)(props.className, props['data-handle-key'] === 0 && 'rheostat-handle-lower', props['data-handle-key'] === 1 && 'rheostat-handle-upper');\n        var ariaLabel = props['data-handle-key'] === 0 ? 'Minimum Filter Handle' : 'Maximum Filter Handle';\n        return (0, _preact.h)(\"div\", _extends({}, props, {\n          className: className,\n          \"aria-label\": ariaLabel\n        }), tooltips && (0, _preact.h)(\"div\", {\n          className: \"rheostat-tooltip\"\n        }, value));\n      };\n    });\n    return _this;\n  }\n  _createClass(Slider, [{\n    key: \"isDisabled\",\n    get: function get() {\n      return this.props.min >= this.props.max;\n    }\n  }, {\n    key: \"computeDefaultPitPoints\",\n    value:\n    // creates an array number where to display a pit point on the slider\n    function computeDefaultPitPoints(_ref2) {\n      var min = _ref2.min,\n        max = _ref2.max;\n      var totalLength = max - min;\n      var steps = 34;\n      var stepsLength = totalLength / steps;\n      var pitPoints = [min].concat(_toConsumableArray((0, _utils.range)({\n        end: steps - 1\n      }).map(function (step) {\n        return min + stepsLength * (step + 1);\n      })), [max]);\n      return pitPoints;\n    }\n\n    // creates an array of values where the slider should snap to\n  }, {\n    key: \"computeSnapPoints\",\n    value: function computeSnapPoints(_ref3) {\n      var min = _ref3.min,\n        max = _ref3.max,\n        step = _ref3.step;\n      if (!step) return undefined;\n      return [].concat(_toConsumableArray((0, _utils.range)({\n        start: min,\n        end: max,\n        step: step\n      })), [max]);\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      var _this$props = this.props,\n        tooltips = _this$props.tooltips,\n        step = _this$props.step,\n        pips = _this$props.pips,\n        values = _this$props.values,\n        cssClasses = _this$props.cssClasses;\n\n      // @TODO: figure out why this.props needs to be non-null asserted\n      var _ref4 = this.isDisabled ? {\n          min: this.props.min,\n          max: this.props.max + 0.001\n        } : this.props,\n        min = _ref4.min,\n        max = _ref4.max;\n      var snapPoints = this.computeSnapPoints({\n        min: min,\n        max: max,\n        step: step\n      });\n      var pitPoints = pips === false ? [] : this.computeDefaultPitPoints({\n        min: min,\n        max: max\n      });\n      return (0, _preact.h)(\"div\", {\n        className: (0, _instantsearchUiComponents.cx)(cssClasses.root, this.isDisabled && cssClasses.disabledRoot)\n      }, (0, _preact.h)(_Rheostat.default, {\n        handle: this.createHandleComponent(tooltips),\n        onChange: this.handleChange,\n        min: min,\n        max: max,\n        pitComponent: _Pit.default,\n        pitPoints: pitPoints,\n        snap: true,\n        snapPoints: snapPoints,\n        values: this.isDisabled ? [min, max] : values,\n        disabled: this.isDisabled\n      }));\n    }\n  }]);\n  return Slider;\n}(_preact.Component);\nvar _default = exports.default = Slider;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/Snippet/Snippet.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Snippet = Snippet;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _InternalHighlight = require(\"../InternalHighlight/InternalHighlight\");\nvar _excluded = [\"classNames\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction Snippet(_ref) {\n  var _ref$classNames = _ref.classNames,\n    classNames = _ref$classNames === void 0 ? {} : _ref$classNames,\n    props = _objectWithoutProperties(_ref, _excluded);\n  return (0, _preact.h)(_InternalHighlight.InternalHighlight, _extends({\n    classNames: {\n      root: (0, _instantsearchUiComponents.cx)('ais-Snippet', classNames.root),\n      highlighted: (0, _instantsearchUiComponents.cx)('ais-Snippet-highlighted', classNames.highlighted),\n      nonHighlighted: (0, _instantsearchUiComponents.cx)('ais-Snippet-nonHighlighted', classNames.nonHighlighted),\n      separator: (0, _instantsearchUiComponents.cx)('ais-Snippet-separator', classNames.separator)\n    }\n  }, props));\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/components/Stats/Stats.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _Template = _interopRequireDefault(require(\"../Template/Template\"));\nvar _excluded = [\"nbHits\", \"nbSortedHits\", \"cssClasses\", \"templateProps\"];\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nvar Stats = function Stats(_ref) {\n  var nbHits = _ref.nbHits,\n    nbSortedHits = _ref.nbSortedHits,\n    cssClasses = _ref.cssClasses,\n    templateProps = _ref.templateProps,\n    rest = _objectWithoutProperties(_ref, _excluded);\n  return (0, _preact.h)(\"div\", {\n    className: (0, _instantsearchUiComponents.cx)(cssClasses.root)\n  }, (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n    templateKey: \"text\",\n    rootTagName: \"span\",\n    rootProps: {\n      className: cssClasses.text\n    },\n    data: _objectSpread({\n      hasManySortedResults: nbSortedHits && nbSortedHits > 1,\n      hasNoSortedResults: nbSortedHits === 0,\n      hasOneSortedResults: nbSortedHits === 1,\n      hasManyResults: nbHits > 1,\n      hasNoResults: nbHits === 0,\n      hasOneResult: nbHits === 1,\n      nbHits: nbHits,\n      nbSortedHits: nbSortedHits,\n      cssClasses: cssClasses\n    }, rest)\n  })));\n};\nvar _default = exports.default = Stats;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/Template/Template.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _preact = require(\"preact\");\nvar _templating = require(\"../../lib/templating\");\nvar _utils = require(\"../../lib/utils\");\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar RawHtml = /*#__PURE__*/function (_Component) {\n  _inherits(RawHtml, _Component);\n  var _super = _createSuper(RawHtml);\n  function RawHtml() {\n    var _this;\n    _classCallCheck(this, RawHtml);\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    _this = _super.call.apply(_super, [this].concat(args));\n    _defineProperty(_assertThisInitialized(_this), \"ref\", (0, _preact.createRef)());\n    _defineProperty(_assertThisInitialized(_this), \"nodes\", []);\n    return _this;\n  }\n  _createClass(RawHtml, [{\n    key: \"componentDidMount\",\n    value: function componentDidMount() {\n      var fragment = new DocumentFragment();\n      var root = document.createElement('div');\n      root.innerHTML = this.props.content;\n      this.nodes = _toConsumableArray(root.childNodes);\n      this.nodes.forEach(function (node) {\n        return fragment.appendChild(node);\n      });\n      this.ref.current.replaceWith(fragment);\n    }\n  }, {\n    key: \"componentWillUnmount\",\n    value: function componentWillUnmount() {\n      this.nodes.forEach(function (node) {\n        if (node instanceof Element) {\n          node.outerHTML = '';\n          return;\n        }\n        node.nodeValue = '';\n      });\n      // if there is one TextNode first and one TextNode last, the\n      // last one's nodeValue will be assigned to the first.\n      if (this.nodes[0].nodeValue) {\n        this.nodes[0].nodeValue = '';\n      }\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      return (0, _preact.h)(\"div\", {\n        ref: this.ref\n      });\n    }\n  }]);\n  return RawHtml;\n}(_preact.Component);\nvar defaultProps = {\n  data: {},\n  rootTagName: 'div',\n  useCustomCompileOptions: {},\n  templates: {},\n  templatesConfig: {}\n};\n// @TODO: Template should be a generic and receive TData to pass to Templates (to avoid TTemplateData to be set as `any`)\nvar Template = /*#__PURE__*/function (_Component2) {\n  _inherits(Template, _Component2);\n  var _super2 = _createSuper(Template);\n  function Template() {\n    _classCallCheck(this, Template);\n    return _super2.apply(this, arguments);\n  }\n  _createClass(Template, [{\n    key: \"shouldComponentUpdate\",\n    value: function shouldComponentUpdate(nextProps) {\n      return !(0, _utils.isEqual)(this.props.data, nextProps.data) || this.props.templateKey !== nextProps.templateKey || !(0, _utils.isEqual)(this.props.rootProps, nextProps.rootProps);\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      var _this2 = this;\n      if (process.env.NODE_ENV === 'development') {\n        var nonFunctionTemplates = Object.keys(this.props.templates).filter(function (key) {\n          return typeof _this2.props.templates[key] !== 'function';\n        });\n        process.env.NODE_ENV === 'development' ? (0, _utils.warning)(nonFunctionTemplates.length === 0, \"Hogan.js and string-based templates are deprecated and will not be supported in InstantSearch.js 5.x.\\n\\nYou can replace them with function-form templates and use either the provided `html` function or JSX templates.\\n\\nString-based templates: \".concat(nonFunctionTemplates.join(', '), \".\\n\\nSee: https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/#upgrade-templates\")) : void 0;\n      }\n      var RootTagName = this.props.rootTagName === 'fragment' ? _preact.Fragment : this.props.rootTagName;\n      var useCustomCompileOptions = this.props.useCustomCompileOptions[this.props.templateKey];\n      var compileOptions = useCustomCompileOptions ? this.props.templatesConfig.compileOptions : {};\n      var content = (0, _templating.renderTemplate)({\n        templates: this.props.templates,\n        templateKey: this.props.templateKey,\n        compileOptions: compileOptions,\n        helpers: this.props.templatesConfig.helpers,\n        data: this.props.data,\n        bindEvent: this.props.bindEvent,\n        sendEvent: this.props.sendEvent\n      });\n      if (content === null) {\n        // Adds a noscript to the DOM but virtual DOM is null\n        // See http://facebook.github.io/react/docs/component-specs.html#render\n        return null;\n      }\n      if (_typeof(content) === 'object') {\n        return (0, _preact.h)(RootTagName, this.props.rootProps, content);\n      }\n\n      // This is to handle Hogan templates with Fragment as rootTagName\n      if (RootTagName === _preact.Fragment) {\n        return (0, _preact.h)(RawHtml, {\n          content: content,\n          key: Math.random()\n        });\n      }\n      return (0, _preact.h)(RootTagName, _extends({}, this.props.rootProps, {\n        dangerouslySetInnerHTML: {\n          __html: content\n        }\n      }));\n    }\n  }]);\n  return Template;\n}(_preact.Component);\n_defineProperty(Template, \"defaultProps\", defaultProps);\nvar _default = exports.default = Template;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/ToggleRefinement/ToggleRefinement.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _preact = require(\"preact\");\nvar _Template = _interopRequireDefault(require(\"../Template/Template\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nvar ToggleRefinement = function ToggleRefinement(_ref) {\n  var currentRefinement = _ref.currentRefinement,\n    refine = _ref.refine,\n    cssClasses = _ref.cssClasses,\n    templateProps = _ref.templateProps;\n  return (0, _preact.h)(\"div\", {\n    className: cssClasses.root\n  }, (0, _preact.h)(\"label\", {\n    className: cssClasses.label\n  }, (0, _preact.h)(\"input\", {\n    className: cssClasses.checkbox,\n    type: \"checkbox\",\n    checked: currentRefinement.isRefined,\n    onChange: function onChange(event) {\n      return refine({\n        isRefined: !event.target.checked\n      });\n    }\n  }), (0, _preact.h)(_Template.default, _extends({}, templateProps, {\n    rootTagName: \"span\",\n    rootProps: {\n      className: cssClasses.labelText\n    },\n    templateKey: \"labelText\",\n    data: currentRefinement\n  }))));\n};\nvar _default = exports.default = ToggleRefinement;"
  },
  {
    "path": "js/instantsearch.js/cjs/components/VoiceSearch/VoiceSearch.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _preact = require(\"preact\");\nvar _Template = _interopRequireDefault(require(\"../Template/Template\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nvar VoiceSearch = function VoiceSearch(_ref) {\n  var cssClasses = _ref.cssClasses,\n    isBrowserSupported = _ref.isBrowserSupported,\n    isListening = _ref.isListening,\n    toggleListening = _ref.toggleListening,\n    voiceListeningState = _ref.voiceListeningState,\n    templates = _ref.templates;\n  var handleClick = function handleClick(event) {\n    if (event.currentTarget instanceof HTMLElement) {\n      event.currentTarget.blur();\n    }\n    toggleListening();\n  };\n  var status = voiceListeningState.status,\n    transcript = voiceListeningState.transcript,\n    isSpeechFinal = voiceListeningState.isSpeechFinal,\n    errorCode = voiceListeningState.errorCode;\n  return (0, _preact.h)(\"div\", {\n    className: cssClasses.root\n  }, (0, _preact.h)(_Template.default, {\n    templateKey: \"buttonText\",\n    rootTagName: \"button\",\n    rootProps: {\n      className: cssClasses.button,\n      type: 'button',\n      title: \"Search by voice\".concat(isBrowserSupported ? '' : ' (not supported on this browser)'),\n      onClick: handleClick,\n      disabled: !isBrowserSupported\n    },\n    data: {\n      status: status,\n      errorCode: errorCode,\n      isListening: isListening,\n      transcript: transcript,\n      isSpeechFinal: isSpeechFinal,\n      isBrowserSupported: isBrowserSupported\n    },\n    templates: templates\n  }), (0, _preact.h)(_Template.default, {\n    templateKey: \"status\",\n    rootProps: {\n      className: cssClasses.status\n    },\n    data: {\n      status: status,\n      errorCode: errorCode,\n      isListening: isListening,\n      transcript: transcript,\n      isSpeechFinal: isSpeechFinal,\n      isBrowserSupported: isBrowserSupported\n    },\n    templates: templates\n  }));\n};\nvar _default = exports.default = VoiceSearch;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/answers/connectAnswers.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction hasFindAnswersMethod(answersIndex) {\n  return typeof answersIndex.findAnswers === 'function';\n}\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'answers',\n  connector: true\n});\n/**\n * @deprecated the answers service is no longer offered, and this widget will be removed in InstantSearch.js v5\n */\nvar connectAnswers = function connectAnswers(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      queryLanguages = _ref.queryLanguages,\n      attributesForPrediction = _ref.attributesForPrediction,\n      _ref$nbHits = _ref.nbHits,\n      nbHits = _ref$nbHits === void 0 ? 1 : _ref$nbHits,\n      _ref$renderDebounceTi = _ref.renderDebounceTime,\n      renderDebounceTime = _ref$renderDebounceTi === void 0 ? 100 : _ref$renderDebounceTi,\n      _ref$searchDebounceTi = _ref.searchDebounceTime,\n      searchDebounceTime = _ref$searchDebounceTi === void 0 ? 100 : _ref$searchDebounceTi,\n      _ref$escapeHTML = _ref.escapeHTML,\n      escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,\n      _ref$extraParameters = _ref.extraParameters,\n      extraParameters = _ref$extraParameters === void 0 ? {} : _ref$extraParameters;\n\n    // @ts-expect-error checking for the wrong value\n    if (!queryLanguages || queryLanguages.length === 0) {\n      throw new Error(withUsage('The `queryLanguages` expects an array of strings.'));\n    }\n    var runConcurrentSafePromise = (0, _utils.createConcurrentSafePromise)();\n    var lastHits = [];\n    var isLoading = false;\n    var debouncedRender = (0, _utils.debounce)(renderFn, renderDebounceTime);\n    var debouncedRefine;\n    return {\n      $$type: 'ais.answers',\n      init: function init(initOptions) {\n        var state = initOptions.state,\n          instantSearchInstance = initOptions.instantSearchInstance;\n        if (typeof instantSearchInstance.client.initIndex !== 'function') {\n          throw new Error(withUsage('`algoliasearch` <5 required.'));\n        }\n        var answersIndex = instantSearchInstance.client.initIndex(state.index);\n        if (!hasFindAnswersMethod(answersIndex)) {\n          throw new Error(withUsage('`algoliasearch` >= 4.8.0 required.'));\n        }\n        debouncedRefine = (0, _utils.debounce)(answersIndex.findAnswers, searchDebounceTime);\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var _this = this;\n        var query = renderOptions.state.query;\n        if (!query) {\n          // renders nothing with empty query\n          lastHits = [];\n          isLoading = false;\n          renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: renderOptions.instantSearchInstance\n          }), false);\n          return;\n        }\n\n        // render the loader\n        lastHits = [];\n        isLoading = true;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: renderOptions.instantSearchInstance\n        }), false);\n\n        // call /answers API\n        runConcurrentSafePromise(debouncedRefine(query, queryLanguages, _objectSpread(_objectSpread({}, extraParameters), {}, {\n          nbHits: nbHits,\n          attributesForPrediction: attributesForPrediction\n        }))).then(function (result) {\n          if (!result) {\n            // It's undefined when it's debounced.\n            return;\n          }\n          if (escapeHTML && result.hits.length > 0) {\n            result.hits = (0, _utils.escapeHits)(result.hits);\n          }\n          var hitsWithAbsolutePosition = (0, _utils.addAbsolutePosition)(result.hits, 0, nbHits);\n          var hitsWithAbsolutePositionAndQueryID = (0, _utils.addQueryID)(hitsWithAbsolutePosition, result.queryID);\n          lastHits = hitsWithAbsolutePositionAndQueryID;\n          isLoading = false;\n          debouncedRender(_objectSpread(_objectSpread({}, _this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: renderOptions.instantSearchInstance\n          }), false);\n        });\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          answers: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState() {\n        return {\n          hits: lastHits,\n          isLoading: isLoading,\n          widgetParams: widgetParams\n        };\n      },\n      dispose: function dispose(_ref2) {\n        var state = _ref2.state;\n        unmountFn();\n        return state;\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(state) {\n        return state;\n      }\n    };\n  };\n};\nvar _default = exports.default = connectAnswers;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/autocomplete/connectAutocomplete.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'autocomplete',\n  connector: true\n});\nvar connectAutocomplete = function connectAutocomplete(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      _ref$escapeHTML = _ref.escapeHTML,\n      escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML;\n    process.env.NODE_ENV === 'development' ? (0, _utils.warning)(!widgetParams.indices, \"\\nThe option `indices` has been removed from the Autocomplete connector.\\n\\nThe indices to target are now inferred from the widgets tree.\\n\".concat(Array.isArray(widgetParams.indices) ? \"\\nAn alternative would be:\\n\\nconst autocomplete = connectAutocomplete(renderer);\\n\\nsearch.addWidgets([\\n  \".concat(widgetParams.indices.map(function (_ref2) {\n      var value = _ref2.value;\n      return \"index({ indexName: '\".concat(value, \"' }),\");\n    }).join('\\n  '), \"\\n  autocomplete()\\n]);\\n\") : '', \"\\n      \")) : void 0;\n    var connectorState = {};\n    return {\n      $$type: 'ais.autocomplete',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        var renderState = this.getWidgetRenderState(renderOptions);\n        renderState.indices.forEach(function (_ref3) {\n          var sendEvent = _ref3.sendEvent,\n            hits = _ref3.hits;\n          sendEvent('view:internal', hits);\n        });\n        renderFn(_objectSpread(_objectSpread({}, renderState), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          autocomplete: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref4) {\n        var _this = this;\n        var helper = _ref4.helper,\n          state = _ref4.state,\n          scopedResults = _ref4.scopedResults,\n          instantSearchInstance = _ref4.instantSearchInstance;\n        if (!connectorState.refine) {\n          connectorState.refine = function (query) {\n            helper.setQuery(query).search();\n          };\n        }\n        var indices = scopedResults.map(function (scopedResult) {\n          var _scopedResult$results, _scopedResult$results2;\n          // We need to escape the hits because highlighting\n          // exposes HTML tags to the end-user.\n          if (scopedResult.results) {\n            scopedResult.results.hits = escapeHTML ? (0, _utils.escapeHits)(scopedResult.results.hits) : scopedResult.results.hits;\n          }\n          var sendEvent = (0, _utils.createSendEventForHits)({\n            instantSearchInstance: instantSearchInstance,\n            helper: scopedResult.helper,\n            widgetType: _this.$$type\n          });\n          return {\n            indexId: scopedResult.indexId,\n            indexName: ((_scopedResult$results = scopedResult.results) === null || _scopedResult$results === void 0 ? void 0 : _scopedResult$results.index) || '',\n            hits: ((_scopedResult$results2 = scopedResult.results) === null || _scopedResult$results2 === void 0 ? void 0 : _scopedResult$results2.hits) || [],\n            results: scopedResult.results || {},\n            sendEvent: sendEvent\n          };\n        });\n        return {\n          currentRefinement: state.query || '',\n          indices: indices,\n          refine: connectorState.refine,\n          widgetParams: widgetParams\n        };\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref5) {\n        var searchParameters = _ref5.searchParameters;\n        var query = searchParameters.query || '';\n        if (query === '' || uiState && uiState.query === query) {\n          return uiState;\n        }\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          query: query\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref6) {\n        var uiState = _ref6.uiState;\n        var parameters = {\n          query: uiState.query || ''\n        };\n        if (!escapeHTML) {\n          return searchParameters.setQueryParameters(parameters);\n        }\n        return searchParameters.setQueryParameters(_objectSpread(_objectSpread({}, parameters), _utils.TAG_PLACEHOLDER));\n      },\n      dispose: function dispose(_ref7) {\n        var state = _ref7.state;\n        unmountFn();\n        var stateWithoutQuery = state.setQueryParameter('query', undefined);\n        if (!escapeHTML) {\n          return stateWithoutQuery;\n        }\n        return stateWithoutQuery.setQueryParameters(Object.keys(_utils.TAG_PLACEHOLDER).reduce(function (acc, key) {\n          return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, undefined));\n        }, {}));\n      }\n    };\n  };\n};\nvar _default = exports.default = connectAutocomplete;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/breadcrumb/connectBreadcrumb.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'breadcrumb',\n  connector: true\n});\nvar connectBreadcrumb = function connectBreadcrumb(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  var connectorState = {};\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      attributes = _ref.attributes,\n      _ref$separator = _ref.separator,\n      separator = _ref$separator === void 0 ? ' > ' : _ref$separator,\n      _ref$rootPath = _ref.rootPath,\n      rootPath = _ref$rootPath === void 0 ? null : _ref$rootPath,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    if (!attributes || !Array.isArray(attributes) || attributes.length === 0) {\n      throw new Error(withUsage('The `attributes` option expects an array of strings.'));\n    }\n    var _attributes = _slicedToArray(attributes, 1),\n      hierarchicalFacetName = _attributes[0];\n    function getRefinedState(state, facetValue) {\n      if (!facetValue) {\n        var breadcrumb = state.getHierarchicalFacetBreadcrumb(hierarchicalFacetName);\n        if (breadcrumb.length === 0) {\n          return state;\n        } else {\n          return state.resetPage().toggleFacetRefinement(hierarchicalFacetName, breadcrumb[0]);\n        }\n      }\n      return state.resetPage().toggleFacetRefinement(hierarchicalFacetName, facetValue);\n    }\n    return {\n      $$type: 'ais.breadcrumb',\n      init: function init(initOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: renderOptions.instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose() {\n        unmountFn();\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          breadcrumb: _objectSpread(_objectSpread({}, renderState.breadcrumb), {}, _defineProperty({}, hierarchicalFacetName, this.getWidgetRenderState(renderOptions)))\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref2) {\n        var _this = this;\n        var helper = _ref2.helper,\n          createURL = _ref2.createURL,\n          results = _ref2.results,\n          state = _ref2.state;\n        function getItems() {\n          // The hierarchicalFacets condition is required for flavors\n          // that render immediately with empty results, without relying\n          // on init() (like React InstantSearch).\n          if (!results || state.hierarchicalFacets.length === 0) {\n            return [];\n          }\n          var _state$hierarchicalFa = _slicedToArray(state.hierarchicalFacets, 1),\n            facetName = _state$hierarchicalFa[0].name;\n          var facetValues = results.getFacetValues(facetName, {});\n          var facetItems = facetValues && !Array.isArray(facetValues) && facetValues.data ? facetValues.data : [];\n          var items = transformItems(shiftItemsValues(prepareItems(facetItems)), {\n            results: results\n          });\n          return items;\n        }\n        var items = getItems();\n        if (!connectorState.createURL) {\n          connectorState.createURL = function (facetValue) {\n            return createURL(function (uiState) {\n              return _this.getWidgetUiState(uiState, {\n                searchParameters: getRefinedState(helper.state, facetValue),\n                helper: helper\n              });\n            });\n          };\n        }\n        if (!connectorState.refine) {\n          connectorState.refine = function (facetValue) {\n            helper.setState(getRefinedState(helper.state, facetValue)).search();\n          };\n        }\n        return {\n          canRefine: items.length > 0,\n          createURL: connectorState.createURL,\n          items: items,\n          refine: connectorState.refine,\n          widgetParams: widgetParams\n        };\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref3) {\n        var searchParameters = _ref3.searchParameters;\n        var path = searchParameters.getHierarchicalFacetBreadcrumb(hierarchicalFacetName);\n        return removeEmptyRefinementsFromUiState(_objectSpread(_objectSpread({}, uiState), {}, {\n          hierarchicalMenu: _objectSpread(_objectSpread({}, uiState.hierarchicalMenu), {}, _defineProperty({}, hierarchicalFacetName, path))\n        }), hierarchicalFacetName);\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref4) {\n        var uiState = _ref4.uiState;\n        var values = uiState.hierarchicalMenu && uiState.hierarchicalMenu[hierarchicalFacetName];\n        if (searchParameters.isConjunctiveFacet(hierarchicalFacetName) || searchParameters.isDisjunctiveFacet(hierarchicalFacetName)) {\n          process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, \"HierarchicalMenu: Attribute \\\"\".concat(hierarchicalFacetName, \"\\\" is already used by another widget applying conjunctive or disjunctive faceting.\\nAs this is not supported, please make sure to remove this other widget or this HierarchicalMenu widget will not work at all.\")) : void 0;\n          return searchParameters;\n        }\n        if (searchParameters.isHierarchicalFacet(hierarchicalFacetName)) {\n          var facet = searchParameters.getHierarchicalFacetByName(hierarchicalFacetName);\n          process.env.NODE_ENV === 'development' ? (0, _utils.warning)((0, _utils.isEqual)(facet.attributes, attributes) && facet.separator === separator && facet.rootPath === rootPath, 'Using Breadcrumb and HierarchicalMenu on the same facet with different options overrides the configuration of the HierarchicalMenu.') : void 0;\n        }\n        var withFacetConfiguration = searchParameters.removeHierarchicalFacet(hierarchicalFacetName).addHierarchicalFacet({\n          name: hierarchicalFacetName,\n          attributes: attributes,\n          separator: separator,\n          rootPath: rootPath\n        });\n        if (!values) {\n          return withFacetConfiguration.setQueryParameters({\n            hierarchicalFacetsRefinements: _objectSpread(_objectSpread({}, withFacetConfiguration.hierarchicalFacetsRefinements), {}, _defineProperty({}, hierarchicalFacetName, []))\n          });\n        }\n        return withFacetConfiguration.addHierarchicalFacetRefinement(hierarchicalFacetName, values.join(separator));\n      }\n    };\n  };\n};\nfunction prepareItems(data) {\n  return data.reduce(function (result, currentItem) {\n    if (currentItem.isRefined) {\n      result.push({\n        label: currentItem.name,\n        value: currentItem.escapedValue\n      });\n      if (Array.isArray(currentItem.data)) {\n        result = result.concat(prepareItems(currentItem.data));\n      }\n    }\n    return result;\n  }, []);\n}\nfunction shiftItemsValues(array) {\n  return array.map(function (x, idx) {\n    return {\n      label: x.label,\n      value: idx + 1 === array.length ? null : array[idx + 1].value\n    };\n  });\n}\nfunction removeEmptyRefinementsFromUiState(indexUiState, attribute) {\n  if (!indexUiState.hierarchicalMenu) {\n    return indexUiState;\n  }\n  if (!indexUiState.hierarchicalMenu[attribute] || !indexUiState.hierarchicalMenu[attribute].length) {\n    delete indexUiState.hierarchicalMenu[attribute];\n  }\n  if (Object.keys(indexUiState.hierarchicalMenu).length === 0) {\n    delete indexUiState.hierarchicalMenu;\n  }\n  return indexUiState;\n}\nvar _default = exports.default = connectBreadcrumb;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/clear-refinements/connectClearRefinements.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'clear-refinements',\n  connector: true\n});\nvar connectClearRefinements = function connectClearRefinements(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      _ref$includedAttribut = _ref.includedAttributes,\n      includedAttributes = _ref$includedAttribut === void 0 ? [] : _ref$includedAttribut,\n      _ref$excludedAttribut = _ref.excludedAttributes,\n      excludedAttributes = _ref$excludedAttribut === void 0 ? ['query'] : _ref$excludedAttribut,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    if (widgetParams && widgetParams.includedAttributes && widgetParams.excludedAttributes) {\n      throw new Error(withUsage('The options `includedAttributes` and `excludedAttributes` cannot be used together.'));\n    }\n    var connectorState = {\n      refine: _utils.noop,\n      createURL: function createURL() {\n        return '';\n      },\n      attributesToClear: []\n    };\n    var cachedRefine = function cachedRefine() {\n      return connectorState.refine();\n    };\n    var cachedCreateURL = function cachedCreateURL() {\n      return connectorState.createURL();\n    };\n    return {\n      $$type: 'ais.clearRefinements',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose() {\n        unmountFn();\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          clearRefinements: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref2) {\n        var createURL = _ref2.createURL,\n          scopedResults = _ref2.scopedResults,\n          results = _ref2.results;\n        connectorState.attributesToClear = scopedResults.reduce(function (attributesToClear, scopedResult) {\n          return attributesToClear.concat(getAttributesToClear({\n            scopedResult: scopedResult,\n            includedAttributes: includedAttributes,\n            excludedAttributes: excludedAttributes,\n            transformItems: transformItems,\n            results: results\n          }));\n        }, []);\n        connectorState.refine = function () {\n          connectorState.attributesToClear.forEach(function (_ref3) {\n            var indexHelper = _ref3.helper,\n              items = _ref3.items;\n            indexHelper.setState((0, _utils.clearRefinements)({\n              helper: indexHelper,\n              attributesToClear: items\n            })).search();\n          });\n        };\n        connectorState.createURL = function () {\n          return createURL(_utils.mergeSearchParameters.apply(void 0, _toConsumableArray(connectorState.attributesToClear.map(function (_ref4) {\n            var indexHelper = _ref4.helper,\n              items = _ref4.items;\n            return (0, _utils.clearRefinements)({\n              helper: indexHelper,\n              attributesToClear: items\n            });\n          }))));\n        };\n        var canRefine = connectorState.attributesToClear.some(function (attributeToClear) {\n          return attributeToClear.items.length > 0;\n        });\n        return {\n          canRefine: canRefine,\n          hasRefinements: canRefine,\n          refine: cachedRefine,\n          createURL: cachedCreateURL,\n          widgetParams: widgetParams\n        };\n      }\n    };\n  };\n};\nfunction getAttributesToClear(_ref5) {\n  var scopedResult = _ref5.scopedResult,\n    includedAttributes = _ref5.includedAttributes,\n    excludedAttributes = _ref5.excludedAttributes,\n    transformItems = _ref5.transformItems,\n    results = _ref5.results;\n  var includesQuery = includedAttributes.indexOf('query') !== -1 || excludedAttributes.indexOf('query') === -1;\n  return {\n    helper: scopedResult.helper,\n    items: transformItems((0, _utils.uniq)((0, _utils.getRefinements)(scopedResult.results, scopedResult.helper.state, includesQuery).map(function (refinement) {\n      return refinement.attribute;\n    }).filter(function (attribute) {\n      return (\n        // If the array is empty (default case), we keep all the attributes\n        includedAttributes.length === 0 ||\n        // Otherwise, only add the specified attributes\n        includedAttributes.indexOf(attribute) !== -1\n      );\n    }).filter(function (attribute) {\n      return (\n        // If the query is included, we ignore the default `excludedAttributes = ['query']`\n        attribute === 'query' && includesQuery ||\n        // Otherwise, ignore the excluded attributes\n        excludedAttributes.indexOf(attribute) === -1\n      );\n    })), {\n      results: results\n    })\n  };\n}\nvar _default = exports.default = connectClearRefinements;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/configure/connectConfigure.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _algoliasearchHelper = _interopRequireDefault(require(\"algoliasearch-helper\"));\nvar _utils = require(\"../../lib/utils\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n/**\n * Refine the given search parameters.\n */\n\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'configure',\n  connector: true\n});\nfunction getInitialSearchParameters(state, widgetParams) {\n  // We leverage the helper internals to remove the `widgetParams` from\n  // the state. The function `setQueryParameters` omits the values that\n  // are `undefined` on the next state.\n  return state.setQueryParameters(Object.keys(widgetParams.searchParameters).reduce(function (acc, key) {\n    return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, undefined));\n  }, {}));\n}\nvar connectConfigure = function connectConfigure() {\n  var renderFn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _utils.noop;\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  return function (widgetParams) {\n    if (!widgetParams || !(0, _utils.isPlainObject)(widgetParams.searchParameters)) {\n      throw new Error(withUsage('The `searchParameters` option expects an object.'));\n    }\n    var connectorState = {};\n    function refine(helper) {\n      return function (searchParameters) {\n        // Merge new `searchParameters` with the ones set from other widgets\n        var actualState = getInitialSearchParameters(helper.state, widgetParams);\n        var nextSearchParameters = (0, _utils.mergeSearchParameters)(actualState, new _algoliasearchHelper.default.SearchParameters(searchParameters));\n\n        // Update original `widgetParams.searchParameters` to the new refined one\n        widgetParams.searchParameters = searchParameters;\n\n        // Trigger a search with the resolved search parameters\n        helper.setState(nextSearchParameters).search();\n      };\n    }\n    return {\n      $$type: 'ais.configure',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref) {\n        var state = _ref.state;\n        unmountFn();\n        return getInitialSearchParameters(state, widgetParams);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        var _renderState$configur;\n        var widgetRenderState = this.getWidgetRenderState(renderOptions);\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          configure: _objectSpread(_objectSpread({}, widgetRenderState), {}, {\n            widgetParams: _objectSpread(_objectSpread({}, widgetRenderState.widgetParams), {}, {\n              searchParameters: (0, _utils.mergeSearchParameters)(new _algoliasearchHelper.default.SearchParameters((_renderState$configur = renderState.configure) === null || _renderState$configur === void 0 ? void 0 : _renderState$configur.widgetParams.searchParameters), new _algoliasearchHelper.default.SearchParameters(widgetRenderState.widgetParams.searchParameters)).getQueryParams()\n            })\n          })\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref2) {\n        var helper = _ref2.helper;\n        if (!connectorState.refine) {\n          connectorState.refine = refine(helper);\n        }\n        return {\n          refine: connectorState.refine,\n          widgetParams: widgetParams\n        };\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(state, _ref3) {\n        var uiState = _ref3.uiState;\n        return (0, _utils.mergeSearchParameters)(state, new _algoliasearchHelper.default.SearchParameters(_objectSpread(_objectSpread({}, uiState.configure), widgetParams.searchParameters)));\n      },\n      getWidgetUiState: function getWidgetUiState(uiState) {\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          configure: _objectSpread(_objectSpread({}, uiState.configure), widgetParams.searchParameters)\n        });\n      }\n    };\n  };\n};\nvar _default = exports.default = connectConfigure;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/configure-related-items/connectConfigureRelatedItems.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _algoliasearchHelper = _interopRequireDefault(require(\"algoliasearch-helper\"));\nvar _utils = require(\"../../lib/utils\");\nvar _connectConfigure = _interopRequireDefault(require(\"../configure/connectConfigure\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'configure-related-items',\n  connector: true\n});\nfunction createOptionalFilter(_ref) {\n  var attributeName = _ref.attributeName,\n    attributeValue = _ref.attributeValue,\n    attributeScore = _ref.attributeScore;\n  return \"\".concat(attributeName, \":\").concat(attributeValue, \"<score=\").concat(attributeScore || 1, \">\");\n}\nvar connectConfigureRelatedItems = function connectConfigureRelatedItems(renderFn, unmountFn) {\n  return function (widgetParams) {\n    var _ref2 = widgetParams || {},\n      hit = _ref2.hit,\n      matchingPatterns = _ref2.matchingPatterns,\n      _ref2$transformSearch = _ref2.transformSearchParameters,\n      transformSearchParameters = _ref2$transformSearch === void 0 ? function (x) {\n        return x;\n      } : _ref2$transformSearch;\n    if (!hit) {\n      throw new Error(withUsage('The `hit` option is required.'));\n    }\n    if (!matchingPatterns) {\n      throw new Error(withUsage('The `matchingPatterns` option is required.'));\n    }\n    var optionalFilters = Object.keys(matchingPatterns).reduce(function (acc, attributeName) {\n      var attribute = matchingPatterns[attributeName];\n      var attributeValue = (0, _utils.getPropertyByPath)(hit, attributeName);\n      var attributeScore = attribute.score;\n      if (Array.isArray(attributeValue)) {\n        return [].concat(_toConsumableArray(acc), [attributeValue.map(function (attributeSubValue) {\n          return createOptionalFilter({\n            attributeName: attributeName,\n            attributeValue: attributeSubValue,\n            attributeScore: attributeScore\n          });\n        })]);\n      }\n      if (typeof attributeValue === 'string') {\n        return [].concat(_toConsumableArray(acc), [createOptionalFilter({\n          attributeName: attributeName,\n          attributeValue: attributeValue,\n          attributeScore: attributeScore\n        })]);\n      }\n      process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, \"\\nThe `matchingPatterns` option returned a value of type \".concat((0, _utils.getObjectType)(attributeValue), \" for the \\\"\").concat(attributeName, \"\\\" key. This value was not sent to Algolia because `optionalFilters` only supports strings and array of strings.\\n\\nYou can remove the \\\"\").concat(attributeName, \"\\\" key from the `matchingPatterns` option.\\n\\nSee https://www.algolia.com/doc/api-reference/api-parameters/optionalFilters/\\n            \")) : void 0;\n      return acc;\n    }, []);\n    var searchParameters = _objectSpread({}, transformSearchParameters(new _algoliasearchHelper.default.SearchParameters({\n      sumOrFiltersScores: true,\n      facetFilters: [\"objectID:-\".concat(hit.objectID)],\n      optionalFilters: optionalFilters\n    })));\n    var makeWidget = (0, _connectConfigure.default)(renderFn, unmountFn);\n    return _objectSpread(_objectSpread({}, makeWidget({\n      searchParameters: searchParameters\n    })), {}, {\n      $$type: 'ais.configureRelatedItems'\n    });\n  };\n};\n\n/** @deprecated use connectRelatedItems instead */\nvar _default = exports.default = connectConfigureRelatedItems;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/current-refinements/connectCurrentRefinements.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'current-refinements',\n  connector: true\n});\nvar connectCurrentRefinements = function connectCurrentRefinements(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    if ((widgetParams || {}).includedAttributes && (widgetParams || {}).excludedAttributes) {\n      throw new Error(withUsage('The options `includedAttributes` and `excludedAttributes` cannot be used together.'));\n    }\n    var _ref = widgetParams || {},\n      includedAttributes = _ref.includedAttributes,\n      _ref$excludedAttribut = _ref.excludedAttributes,\n      excludedAttributes = _ref$excludedAttribut === void 0 ? ['query'] : _ref$excludedAttribut,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    return {\n      $$type: 'ais.currentRefinements',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose() {\n        unmountFn();\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          currentRefinements: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref2) {\n        var results = _ref2.results,\n          scopedResults = _ref2.scopedResults,\n          _createURL = _ref2.createURL,\n          helper = _ref2.helper;\n        function getItems() {\n          if (!results) {\n            return transformItems(getRefinementsItems({\n              results: null,\n              helper: helper,\n              indexId: helper.state.index,\n              includedAttributes: includedAttributes,\n              excludedAttributes: excludedAttributes\n            }), {\n              results: results\n            });\n          }\n          return scopedResults.reduce(function (accResults, scopedResult) {\n            return accResults.concat(transformItems(getRefinementsItems({\n              results: scopedResult.results,\n              helper: scopedResult.helper,\n              indexId: scopedResult.indexId,\n              includedAttributes: includedAttributes,\n              excludedAttributes: excludedAttributes\n            }), {\n              results: results\n            }));\n          }, []);\n        }\n        var items = getItems();\n        return {\n          items: items,\n          canRefine: items.length > 0,\n          refine: function refine(refinement) {\n            return clearRefinement(helper, refinement);\n          },\n          createURL: function createURL(refinement) {\n            return _createURL(clearRefinementFromState(helper.state, refinement));\n          },\n          widgetParams: widgetParams\n        };\n      }\n    };\n  };\n};\nfunction getRefinementsItems(_ref3) {\n  var results = _ref3.results,\n    helper = _ref3.helper,\n    indexId = _ref3.indexId,\n    includedAttributes = _ref3.includedAttributes,\n    excludedAttributes = _ref3.excludedAttributes;\n  var includesQuery = (includedAttributes || []).indexOf('query') !== -1 || (excludedAttributes || []).indexOf('query') === -1;\n  var filterFunction = includedAttributes ? function (item) {\n    return includedAttributes.indexOf(item.attribute) !== -1;\n  } : function (item) {\n    return excludedAttributes.indexOf(item.attribute) === -1;\n  };\n  var items = (0, _utils.getRefinements)(results, helper.state, includesQuery).map(normalizeRefinement).filter(filterFunction);\n  return items.reduce(function (allItems, currentItem) {\n    return [].concat(_toConsumableArray(allItems.filter(function (item) {\n      return item.attribute !== currentItem.attribute;\n    })), [{\n      indexName: helper.state.index,\n      indexId: indexId,\n      attribute: currentItem.attribute,\n      label: currentItem.attribute,\n      refinements: items.filter(function (result) {\n        return result.attribute === currentItem.attribute;\n      })\n      // We want to keep the order of refinements except the numeric ones.\n      .sort(function (a, b) {\n        return a.type === 'numeric' ? a.value - b.value : 0;\n      }),\n      refine: function refine(refinement) {\n        return clearRefinement(helper, refinement);\n      }\n    }]);\n  }, []);\n}\nfunction clearRefinementFromState(state, refinement) {\n  state = state.resetPage();\n  switch (refinement.type) {\n    case 'facet':\n      return state.removeFacetRefinement(refinement.attribute, String(refinement.value));\n    case 'disjunctive':\n      return state.removeDisjunctiveFacetRefinement(refinement.attribute, String(refinement.value));\n    case 'hierarchical':\n      return state.removeHierarchicalFacetRefinement(refinement.attribute);\n    case 'exclude':\n      return state.removeExcludeRefinement(refinement.attribute, String(refinement.value));\n    case 'numeric':\n      return state.removeNumericRefinement(refinement.attribute, refinement.operator, String(refinement.value));\n    case 'tag':\n      return state.removeTagRefinement(String(refinement.value));\n    case 'query':\n      return state.setQueryParameter('query', '');\n    default:\n      process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, \"The refinement type \\\"\".concat(refinement.type, \"\\\" does not exist and cannot be cleared from the current refinements.\")) : void 0;\n      return state;\n  }\n}\nfunction clearRefinement(helper, refinement) {\n  helper.setState(clearRefinementFromState(helper.state, refinement)).search();\n}\nfunction getOperatorSymbol(operator) {\n  switch (operator) {\n    case '>=':\n      return '≥';\n    case '<=':\n      return '≤';\n    default:\n      return operator;\n  }\n}\nfunction normalizeRefinement(refinement) {\n  var value = getValue(refinement);\n  var label = refinement.operator ? \"\".concat(getOperatorSymbol(refinement.operator), \" \").concat(refinement.name) : refinement.name;\n  var normalizedRefinement = {\n    attribute: refinement.attribute,\n    type: refinement.type,\n    value: value,\n    label: label\n  };\n  if (refinement.operator !== undefined) {\n    normalizedRefinement.operator = refinement.operator;\n  }\n  if (refinement.count !== undefined) {\n    normalizedRefinement.count = refinement.count;\n  }\n  if (refinement.exhaustive !== undefined) {\n    normalizedRefinement.exhaustive = refinement.exhaustive;\n  }\n  return normalizedRefinement;\n}\nfunction getValue(refinement) {\n  if (refinement.type === 'numeric') {\n    return Number(refinement.name);\n  }\n  if ('escapedValue' in refinement) {\n    return refinement.escapedValue;\n  }\n  return refinement.name;\n}\nvar _default = exports.default = connectCurrentRefinements;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/dynamic-widgets/connectDynamicWidgets.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'dynamic-widgets',\n  connector: true\n});\nvar MAX_WILDCARD_FACETS = 20;\nvar connectDynamicWidgets = function connectDynamicWidgets(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var widgets = widgetParams.widgets,\n      _widgetParams$maxValu = widgetParams.maxValuesPerFacet,\n      maxValuesPerFacet = _widgetParams$maxValu === void 0 ? 20 : _widgetParams$maxValu,\n      _widgetParams$facets = widgetParams.facets,\n      facets = _widgetParams$facets === void 0 ? ['*'] : _widgetParams$facets,\n      _widgetParams$transfo = widgetParams.transformItems,\n      transformItems = _widgetParams$transfo === void 0 ? function (items) {\n        return items;\n      } : _widgetParams$transfo,\n      fallbackWidget = widgetParams.fallbackWidget;\n    if (!(widgets && Array.isArray(widgets) && widgets.every(function (widget) {\n      return _typeof(widget) === 'object';\n    }))) {\n      throw new Error(withUsage('The `widgets` option expects an array of widgets.'));\n    }\n    if (!Array.isArray(facets)) {\n      throw new Error(withUsage(\"The `facets` option only accepts an array of facets, you passed \".concat(JSON.stringify(facets))));\n    }\n    var localWidgets = new Map();\n    return {\n      $$type: 'ais.dynamicWidgets',\n      init: function init(initOptions) {\n        widgets.forEach(function (widget) {\n          var attribute = (0, _utils.getWidgetAttribute)(widget, initOptions);\n          localWidgets.set(attribute, {\n            widget: widget,\n            isMounted: false\n          });\n        });\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var parent = renderOptions.parent;\n        var renderState = this.getWidgetRenderState(renderOptions);\n        var widgetsToUnmount = [];\n        var widgetsToMount = [];\n        if (fallbackWidget) {\n          renderState.attributesToRender.forEach(function (attribute) {\n            if (!localWidgets.has(attribute)) {\n              var widget = fallbackWidget({\n                attribute: attribute\n              });\n              localWidgets.set(attribute, {\n                widget: widget,\n                isMounted: false\n              });\n            }\n          });\n        }\n        localWidgets.forEach(function (_ref, attribute) {\n          var widget = _ref.widget,\n            isMounted = _ref.isMounted;\n          var shouldMount = renderState.attributesToRender.indexOf(attribute) > -1;\n          if (!isMounted && shouldMount) {\n            widgetsToMount.push(widget);\n            localWidgets.set(attribute, {\n              widget: widget,\n              isMounted: true\n            });\n          } else if (isMounted && !shouldMount) {\n            widgetsToUnmount.push(widget);\n            localWidgets.set(attribute, {\n              widget: widget,\n              isMounted: false\n            });\n          }\n        });\n        parent.addWidgets(widgetsToMount);\n        // make sure this only happens after the regular render, otherwise it\n        // happens too quick, since render is \"deferred\" for the next microtask,\n        // so this needs to be a whole task later\n        setTimeout(function () {\n          return parent.removeWidgets(widgetsToUnmount);\n        }, 0);\n        renderFn(_objectSpread(_objectSpread({}, renderState), {}, {\n          instantSearchInstance: renderOptions.instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref2) {\n        var parent = _ref2.parent;\n        var toRemove = [];\n        localWidgets.forEach(function (_ref3) {\n          var widget = _ref3.widget,\n            isMounted = _ref3.isMounted;\n          if (isMounted) {\n            toRemove.push(widget);\n          }\n        });\n        parent.removeWidgets(toRemove);\n        unmountFn();\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(state) {\n        return facets.reduce(function (acc, curr) {\n          return acc.addFacet(curr);\n        }, state.setQueryParameters({\n          maxValuesPerFacet: Math.max(maxValuesPerFacet || 0, state.maxValuesPerFacet || 0)\n        }));\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          dynamicWidgets: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref4) {\n        var _results$renderingCon, _results$renderingCon2, _results$renderingCon3, _results$renderingCon4;\n        var results = _ref4.results,\n          state = _ref4.state;\n        if (!results) {\n          return {\n            attributesToRender: [],\n            widgetParams: widgetParams\n          };\n        }\n        var attributesToRender = transformItems((_results$renderingCon = (_results$renderingCon2 = results.renderingContent) === null || _results$renderingCon2 === void 0 ? void 0 : (_results$renderingCon3 = _results$renderingCon2.facetOrdering) === null || _results$renderingCon3 === void 0 ? void 0 : (_results$renderingCon4 = _results$renderingCon3.facets) === null || _results$renderingCon4 === void 0 ? void 0 : _results$renderingCon4.order) !== null && _results$renderingCon !== void 0 ? _results$renderingCon : [], {\n          results: results\n        });\n        if (!Array.isArray(attributesToRender)) {\n          throw new Error(withUsage('The `transformItems` option expects a function that returns an Array.'));\n        }\n        process.env.NODE_ENV === 'development' ? (0, _utils.warning)(maxValuesPerFacet >= (state.maxValuesPerFacet || 0), \"The maxValuesPerFacet set by dynamic widgets (\".concat(maxValuesPerFacet, \") is smaller than one of the limits set by a widget (\").concat(state.maxValuesPerFacet, \"). This causes a mismatch in query parameters and thus an extra network request when that widget is mounted.\")) : void 0;\n        process.env.NODE_ENV === 'development' ? (0, _utils.warning)(attributesToRender.length <= MAX_WILDCARD_FACETS || widgetParams.facets !== undefined, \"More than \".concat(MAX_WILDCARD_FACETS, \" facets are requested to be displayed without explicitly setting which facets to retrieve. This could have a performance impact. Set \\\"facets\\\" to [] to do two smaller network requests, or explicitly to ['*'] to avoid this warning.\")) : void 0;\n        return {\n          attributesToRender: attributesToRender,\n          widgetParams: widgetParams\n        };\n      }\n    };\n  };\n};\nvar _default = exports.default = connectDynamicWidgets;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/frequently-bought-together/connectFrequentlyBoughtTogether.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'frequently-bought-together',\n  connector: true\n});\nvar connectFrequentlyBoughtTogether = exports.default = function connectFrequentlyBoughtTogether(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      _ref$escapeHTML = _ref.escapeHTML,\n      escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems,\n      objectIDs = _ref.objectIDs,\n      limit = _ref.limit,\n      threshold = _ref.threshold,\n      queryParameters = _ref.queryParameters;\n    if (!objectIDs || objectIDs.length === 0) {\n      throw new Error(withUsage('The `objectIDs` option is required.'));\n    }\n    var sendEvent;\n    return {\n      dependsOn: 'recommend',\n      $$type: 'ais.frequentlyBoughtTogether',\n      init: function init(initOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var renderState = this.getWidgetRenderState(renderOptions);\n        renderFn(_objectSpread(_objectSpread({}, renderState), {}, {\n          instantSearchInstance: renderOptions.instantSearchInstance\n        }), false);\n      },\n      getRenderState: function getRenderState(renderState) {\n        return renderState;\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref2) {\n        var results = _ref2.results,\n          helper = _ref2.helper,\n          instantSearchInstance = _ref2.instantSearchInstance;\n        if (!sendEvent) {\n          sendEvent = (0, _utils.createSendEventForHits)({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            widgetType: this.$$type\n          });\n        }\n        if (results === null || results === undefined) {\n          return {\n            items: [],\n            widgetParams: widgetParams,\n            sendEvent: sendEvent\n          };\n        }\n        if (escapeHTML && results.hits.length > 0) {\n          results.hits = (0, _utils.escapeHits)(results.hits);\n        }\n        var itemsWithAbsolutePosition = (0, _utils.addAbsolutePosition)(results.hits, 0, 1);\n        var itemsWithAbsolutePositionAndQueryID = (0, _utils.addQueryID)(itemsWithAbsolutePosition, results.queryID);\n        var transformedItems = transformItems(itemsWithAbsolutePositionAndQueryID, {\n          results: results\n        });\n        return {\n          items: transformedItems,\n          widgetParams: widgetParams,\n          sendEvent: sendEvent\n        };\n      },\n      dispose: function dispose(_ref3) {\n        var recommendState = _ref3.recommendState;\n        unmountFn();\n        return recommendState.removeParams(this.$$id);\n      },\n      getWidgetParameters: function getWidgetParameters(state) {\n        var _this = this;\n        return objectIDs.reduce(function (acc, objectID) {\n          return acc.addFrequentlyBoughtTogether({\n            objectID: objectID,\n            threshold: threshold,\n            maxRecommendations: limit,\n            queryParameters: _objectSpread(_objectSpread({}, queryParameters), escapeHTML ? _utils.TAG_PLACEHOLDER : {}),\n            $$id: _this.$$id\n          });\n        }, state.removeParams(this.$$id));\n      }\n    };\n  };\n};"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/geo-search/connectGeoSearch.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'geo-search',\n  connector: true\n});\n\n// in this connector, we assume insideBoundingBox is only a string,\n// even though in the helper it's defined as number[][] alone.\n// This can be done, since the connector assumes \"control\" of the parameter\nfunction getBoundingBoxAsString(state) {\n  return state.insideBoundingBox || '';\n}\nfunction setBoundingBoxAsString(state, value) {\n  return state.setQueryParameter('insideBoundingBox', value);\n}\nvar $$type = 'ais.geoSearch';\n/**\n * The **GeoSearch** connector provides the logic to build a widget that will display the results on a map. It also provides a way to search for results based on their position. The connector provides functions to manage the search experience (search on map interaction or control the interaction for example).\n *\n * @requirements\n *\n * Note that the GeoSearch connector uses the [geosearch](https://www.algolia.com/doc/guides/searching/geo-search) capabilities of Algolia. Your hits **must** have a `_geoloc` attribute in order to be passed to the rendering function.\n *\n * Currently, the feature is not compatible with multiple values in the _geoloc attribute.\n */\nvar connectGeoSearch = exports.default = function connectGeoSearch(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      _ref$enableRefineOnMa = _ref.enableRefineOnMapMove,\n      enableRefineOnMapMove = _ref$enableRefineOnMa === void 0 ? true : _ref$enableRefineOnMa,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    var widgetState = {\n      isRefineOnMapMove: enableRefineOnMapMove,\n      // @MAJOR hasMapMoveSinceLastRefine -> hasMapMovedSinceLastRefine\n      hasMapMoveSinceLastRefine: false,\n      lastRefinePosition: '',\n      lastRefineBoundingBox: '',\n      internalToggleRefineOnMapMove: _utils.noop,\n      internalSetMapMoveSinceLastRefine: _utils.noop\n    };\n    var getPositionFromState = function getPositionFromState(state) {\n      return state.aroundLatLng ? (0, _utils.aroundLatLngToPosition)(state.aroundLatLng) : undefined;\n    };\n    var getCurrentRefinementFromState = function getCurrentRefinementFromState(state) {\n      return state.insideBoundingBox && (0, _utils.insideBoundingBoxToBoundingBox)(state.insideBoundingBox);\n    };\n    var refine = function refine(helper) {\n      return function (_ref2) {\n        var ne = _ref2.northEast,\n          sw = _ref2.southWest;\n        var boundingBox = [ne.lat, ne.lng, sw.lat, sw.lng].join();\n        helper.setState(setBoundingBoxAsString(helper.state, boundingBox).resetPage()).search();\n        widgetState.hasMapMoveSinceLastRefine = false;\n        widgetState.lastRefineBoundingBox = boundingBox;\n      };\n    };\n    var clearMapRefinement = function clearMapRefinement(helper) {\n      return function () {\n        helper.setQueryParameter('insideBoundingBox', undefined).search();\n      };\n    };\n    var isRefinedWithMap = function isRefinedWithMap(state) {\n      return function () {\n        return Boolean(state.insideBoundingBox);\n      };\n    };\n    var toggleRefineOnMapMove = function toggleRefineOnMapMove() {\n      return widgetState.internalToggleRefineOnMapMove();\n    };\n    var createInternalToggleRefinementOnMapMove = function createInternalToggleRefinementOnMapMove(renderOptions, render) {\n      return function () {\n        widgetState.isRefineOnMapMove = !widgetState.isRefineOnMapMove;\n        render(renderOptions);\n      };\n    };\n    var isRefineOnMapMove = function isRefineOnMapMove() {\n      return widgetState.isRefineOnMapMove;\n    };\n    var setMapMoveSinceLastRefine = function setMapMoveSinceLastRefine() {\n      return widgetState.internalSetMapMoveSinceLastRefine();\n    };\n    var createInternalSetMapMoveSinceLastRefine = function createInternalSetMapMoveSinceLastRefine(renderOptions, render) {\n      return function () {\n        var shouldTriggerRender = widgetState.hasMapMoveSinceLastRefine !== true;\n        widgetState.hasMapMoveSinceLastRefine = true;\n        if (shouldTriggerRender) {\n          render(renderOptions);\n        }\n      };\n    };\n    var hasMapMoveSinceLastRefine = function hasMapMoveSinceLastRefine() {\n      return widgetState.hasMapMoveSinceLastRefine;\n    };\n    var sendEvent;\n    return {\n      $$type: $$type,\n      init: function init(initArgs) {\n        var instantSearchInstance = initArgs.instantSearchInstance;\n        var isFirstRendering = true;\n        widgetState.internalToggleRefineOnMapMove = createInternalToggleRefinementOnMapMove(initArgs, _utils.noop);\n        widgetState.internalSetMapMoveSinceLastRefine = createInternalSetMapMoveSinceLastRefine(initArgs, _utils.noop);\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initArgs)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), isFirstRendering);\n      },\n      render: function render(renderArgs) {\n        var helper = renderArgs.helper,\n          instantSearchInstance = renderArgs.instantSearchInstance;\n        var isFirstRendering = false;\n        // We don't use the state provided by the render function because we need\n        // to be sure that the state is the latest one for the following condition\n        var state = helper.state;\n        var positionChangedSinceLastRefine = Boolean(state.aroundLatLng) && Boolean(widgetState.lastRefinePosition) && state.aroundLatLng !== widgetState.lastRefinePosition;\n        var boundingBoxChangedSinceLastRefine = !state.insideBoundingBox && Boolean(widgetState.lastRefineBoundingBox) && state.insideBoundingBox !== widgetState.lastRefineBoundingBox;\n        if (positionChangedSinceLastRefine || boundingBoxChangedSinceLastRefine) {\n          widgetState.hasMapMoveSinceLastRefine = false;\n        }\n        widgetState.lastRefinePosition = state.aroundLatLng || '';\n        widgetState.lastRefineBoundingBox = getBoundingBoxAsString(state);\n        widgetState.internalToggleRefineOnMapMove = createInternalToggleRefinementOnMapMove(renderArgs, this.render.bind(this));\n        widgetState.internalSetMapMoveSinceLastRefine = createInternalSetMapMoveSinceLastRefine(renderArgs, this.render.bind(this));\n        var widgetRenderState = this.getWidgetRenderState(renderArgs);\n        sendEvent('view:internal', widgetRenderState.items);\n        renderFn(_objectSpread(_objectSpread({}, widgetRenderState), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), isFirstRendering);\n      },\n      getWidgetRenderState: function getWidgetRenderState(renderOptions) {\n        var helper = renderOptions.helper,\n          results = renderOptions.results,\n          instantSearchInstance = renderOptions.instantSearchInstance;\n        var state = helper.state;\n        var items = results ? transformItems(results.hits.filter(function (hit) {\n          return hit._geoloc;\n        }), {\n          results: results\n        }) : [];\n        if (!sendEvent) {\n          sendEvent = (0, _utils.createSendEventForHits)({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            widgetType: $$type\n          });\n        }\n        return {\n          items: items,\n          position: getPositionFromState(state),\n          currentRefinement: getCurrentRefinementFromState(state),\n          refine: refine(helper),\n          sendEvent: sendEvent,\n          clearMapRefinement: clearMapRefinement(helper),\n          isRefinedWithMap: isRefinedWithMap(state),\n          toggleRefineOnMapMove: toggleRefineOnMapMove,\n          isRefineOnMapMove: isRefineOnMapMove,\n          setMapMoveSinceLastRefine: setMapMoveSinceLastRefine,\n          hasMapMoveSinceLastRefine: hasMapMoveSinceLastRefine,\n          widgetParams: widgetParams\n        };\n      },\n      getRenderState: function getRenderState(renderState, renderOptions\n      // Type is explicitly redefined, to avoid having the TWidgetParams type in the definition\n      ) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          geoSearch: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      dispose: function dispose(_ref3) {\n        var state = _ref3.state;\n        unmountFn();\n        return state.setQueryParameter('insideBoundingBox', undefined);\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref4) {\n        var searchParameters = _ref4.searchParameters;\n        var boundingBox = getBoundingBoxAsString(searchParameters);\n        if (!boundingBox || uiState && uiState.geoSearch && uiState.geoSearch.boundingBox === boundingBox) {\n          return uiState;\n        }\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          geoSearch: {\n            boundingBox: boundingBox\n          }\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref5) {\n        var uiState = _ref5.uiState;\n        if (!uiState || !uiState.geoSearch) {\n          return searchParameters.setQueryParameter('insideBoundingBox', undefined);\n        }\n        return setBoundingBoxAsString(searchParameters, uiState.geoSearch.boundingBox);\n      }\n    };\n  };\n};"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/hierarchical-menu/connectHierarchicalMenu.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nvar _excluded = [\"name\", \"escapedValue\", \"data\", \"path\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'hierarchical-menu',\n  connector: true\n});\nvar DEFAULT_SORT = ['name:asc'];\n/**\n * **HierarchicalMenu** connector provides the logic to build a custom widget\n * that will give the user the ability to explore facets in a tree-like structure.\n *\n * This is commonly used for multi-level categorization of products on e-commerce\n * websites. From a UX point of view, we suggest not displaying more than two\n * levels deep.\n *\n * @type {Connector}\n * @param {function(HierarchicalMenuRenderingOptions, boolean)} renderFn Rendering function for the custom **HierarchicalMenu** widget.\n * @param {function} unmountFn Unmount function called when the widget is disposed.\n * @return {function(CustomHierarchicalMenuWidgetParams)} Re-usable widget factory for a custom **HierarchicalMenu** widget.\n */\nvar connectHierarchicalMenu = function connectHierarchicalMenu(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      attributes = _ref.attributes,\n      _ref$separator = _ref.separator,\n      separator = _ref$separator === void 0 ? ' > ' : _ref$separator,\n      _ref$rootPath = _ref.rootPath,\n      rootPath = _ref$rootPath === void 0 ? null : _ref$rootPath,\n      _ref$showParentLevel = _ref.showParentLevel,\n      showParentLevel = _ref$showParentLevel === void 0 ? true : _ref$showParentLevel,\n      _ref$limit = _ref.limit,\n      limit = _ref$limit === void 0 ? 10 : _ref$limit,\n      _ref$showMore = _ref.showMore,\n      showMore = _ref$showMore === void 0 ? false : _ref$showMore,\n      _ref$showMoreLimit = _ref.showMoreLimit,\n      showMoreLimit = _ref$showMoreLimit === void 0 ? 20 : _ref$showMoreLimit,\n      _ref$sortBy = _ref.sortBy,\n      sortBy = _ref$sortBy === void 0 ? DEFAULT_SORT : _ref$sortBy,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    if (!attributes || !Array.isArray(attributes) || attributes.length === 0) {\n      throw new Error(withUsage('The `attributes` option expects an array of strings.'));\n    }\n    if (showMore === true && showMoreLimit <= limit) {\n      throw new Error(withUsage('The `showMoreLimit` option must be greater than `limit`.'));\n    }\n    // we need to provide a hierarchicalFacet name for the search state\n    // so that we can always map $hierarchicalFacetName => real attributes\n    // we use the first attribute name\n    var _attributes = _slicedToArray(attributes, 1),\n      hierarchicalFacetName = _attributes[0];\n    var sendEvent;\n\n    // Provide the same function to the `renderFn` so that way the user\n    // has to only bind it once when `isFirstRendering` for instance\n    var toggleShowMore = function toggleShowMore() {};\n    function cachedToggleShowMore() {\n      toggleShowMore();\n    }\n    var _refine;\n    var isShowingMore = false;\n    function createToggleShowMore(renderOptions, widget) {\n      return function () {\n        isShowingMore = !isShowingMore;\n        widget.render(renderOptions);\n      };\n    }\n    function getLimit() {\n      return isShowingMore ? showMoreLimit : limit;\n    }\n    function _prepareFacetValues(facetValues) {\n      return facetValues.slice(0, getLimit()).map(function (_ref2) {\n        var label = _ref2.name,\n          value = _ref2.escapedValue,\n          data = _ref2.data,\n          path = _ref2.path,\n          subValue = _objectWithoutProperties(_ref2, _excluded);\n        var item = _objectSpread(_objectSpread({}, subValue), {}, {\n          value: value,\n          label: label,\n          data: null\n        });\n        if (Array.isArray(data)) {\n          item.data = _prepareFacetValues(data);\n        }\n        return item;\n      });\n    }\n    return {\n      $$type: 'ais.hierarchicalMenu',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        toggleShowMore = createToggleShowMore(renderOptions, this);\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref3) {\n        var state = _ref3.state;\n        unmountFn();\n        return state.removeHierarchicalFacet(hierarchicalFacetName).setQueryParameter('maxValuesPerFacet', undefined);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          hierarchicalMenu: _objectSpread(_objectSpread({}, renderState.hierarchicalMenu), {}, _defineProperty({}, hierarchicalFacetName, this.getWidgetRenderState(renderOptions)))\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref4) {\n        var _this = this;\n        var results = _ref4.results,\n          state = _ref4.state,\n          createURL = _ref4.createURL,\n          instantSearchInstance = _ref4.instantSearchInstance,\n          helper = _ref4.helper;\n        var items = [];\n        var canToggleShowMore = false;\n\n        // Bind createURL to this specific attribute\n        var _createURL = function _createURL(facetValue) {\n          return createURL(function (uiState) {\n            return _this.getWidgetUiState(uiState, {\n              searchParameters: state.resetPage().toggleFacetRefinement(hierarchicalFacetName, facetValue),\n              helper: helper\n            });\n          });\n        };\n        if (!sendEvent) {\n          sendEvent = (0, _utils.createSendEventForFacet)({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            attribute: function attribute(facetValue) {\n              var index = facetValue.split(separator).length - 1;\n              return attributes[index];\n            },\n            widgetType: this.$$type\n          });\n        }\n        if (!_refine) {\n          _refine = function _refine(facetValue) {\n            sendEvent('click:internal', facetValue);\n            helper.toggleFacetRefinement(hierarchicalFacetName, facetValue).search();\n          };\n        }\n        if (results) {\n          var facetValues = results.getFacetValues(hierarchicalFacetName, {\n            sortBy: sortBy,\n            facetOrdering: sortBy === DEFAULT_SORT\n          });\n          var facetItems = facetValues && !Array.isArray(facetValues) && facetValues.data ? facetValues.data : [];\n\n          // If the limit is the max number of facet retrieved it is impossible to know\n          // if the facets are exhaustive. The only moment we are sure it is exhaustive\n          // is when it is strictly under the number requested unless we know that another\n          // widget has requested more values (maxValuesPerFacet > getLimit()).\n          // Because this is used for making the search of facets unable or not, it is important\n          // to be conservative here.\n          var hasExhaustiveItems = (state.maxValuesPerFacet || 0) > getLimit() ? facetItems.length <= getLimit() : facetItems.length < getLimit();\n          canToggleShowMore = showMore && (isShowingMore || !hasExhaustiveItems);\n          items = transformItems(_prepareFacetValues(facetItems), {\n            results: results\n          });\n        }\n        return {\n          items: items,\n          refine: _refine,\n          canRefine: items.length > 0,\n          createURL: _createURL,\n          sendEvent: sendEvent,\n          widgetParams: widgetParams,\n          isShowingMore: isShowingMore,\n          toggleShowMore: cachedToggleShowMore,\n          canToggleShowMore: canToggleShowMore\n        };\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref5) {\n        var searchParameters = _ref5.searchParameters;\n        var path = searchParameters.getHierarchicalFacetBreadcrumb(hierarchicalFacetName);\n        return removeEmptyRefinementsFromUiState(_objectSpread(_objectSpread({}, uiState), {}, {\n          hierarchicalMenu: _objectSpread(_objectSpread({}, uiState.hierarchicalMenu), {}, _defineProperty({}, hierarchicalFacetName, path))\n        }), hierarchicalFacetName);\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref6) {\n        var uiState = _ref6.uiState;\n        var values = uiState.hierarchicalMenu && uiState.hierarchicalMenu[hierarchicalFacetName];\n        if (searchParameters.isConjunctiveFacet(hierarchicalFacetName) || searchParameters.isDisjunctiveFacet(hierarchicalFacetName)) {\n          process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, \"HierarchicalMenu: Attribute \\\"\".concat(hierarchicalFacetName, \"\\\" is already used by another widget applying conjunctive or disjunctive faceting.\\nAs this is not supported, please make sure to remove this other widget or this HierarchicalMenu widget will not work at all.\")) : void 0;\n          return searchParameters;\n        }\n        if (searchParameters.isHierarchicalFacet(hierarchicalFacetName)) {\n          var facet = searchParameters.getHierarchicalFacetByName(hierarchicalFacetName);\n          process.env.NODE_ENV === 'development' ? (0, _utils.warning)((0, _utils.isEqual)(facet.attributes, attributes) && facet.separator === separator && facet.rootPath === rootPath, 'Using Breadcrumb and HierarchicalMenu on the same facet with different options overrides the configuration of the HierarchicalMenu.') : void 0;\n        }\n        var withFacetConfiguration = searchParameters.removeHierarchicalFacet(hierarchicalFacetName).addHierarchicalFacet({\n          name: hierarchicalFacetName,\n          attributes: attributes,\n          separator: separator,\n          rootPath: rootPath,\n          showParentLevel: showParentLevel\n        });\n        var currentMaxValuesPerFacet = withFacetConfiguration.maxValuesPerFacet || 0;\n        var nextMaxValuesPerFacet = Math.max(currentMaxValuesPerFacet, showMore ? showMoreLimit : limit);\n        var withMaxValuesPerFacet = withFacetConfiguration.setQueryParameter('maxValuesPerFacet', nextMaxValuesPerFacet);\n        if (!values) {\n          return withMaxValuesPerFacet.setQueryParameters({\n            hierarchicalFacetsRefinements: _objectSpread(_objectSpread({}, withMaxValuesPerFacet.hierarchicalFacetsRefinements), {}, _defineProperty({}, hierarchicalFacetName, []))\n          });\n        }\n        return withMaxValuesPerFacet.addHierarchicalFacetRefinement(hierarchicalFacetName, values.join(separator));\n      }\n    };\n  };\n};\nfunction removeEmptyRefinementsFromUiState(indexUiState, attribute) {\n  if (!indexUiState.hierarchicalMenu) {\n    return indexUiState;\n  }\n  if (!indexUiState.hierarchicalMenu[attribute] || indexUiState.hierarchicalMenu[attribute].length === 0) {\n    delete indexUiState.hierarchicalMenu[attribute];\n  }\n  if (Object.keys(indexUiState.hierarchicalMenu).length === 0) {\n    delete indexUiState.hierarchicalMenu;\n  }\n  return indexUiState;\n}\nvar _default = exports.default = connectHierarchicalMenu;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/hits/connectHits.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'hits',\n  connector: true\n});\nvar connectHits = exports.default = function connectHits(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      _ref$escapeHTML = _ref.escapeHTML,\n      escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    var sendEvent;\n    var bindEvent;\n    return {\n      $$type: 'ais.hits',\n      init: function init(initOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var renderState = this.getWidgetRenderState(renderOptions);\n        renderFn(_objectSpread(_objectSpread({}, renderState), {}, {\n          instantSearchInstance: renderOptions.instantSearchInstance\n        }), false);\n        renderState.sendEvent('view:internal', renderState.items);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions\n      // Type is explicitly redefined, to avoid having the TWidgetParams type in the definition\n      ) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          hits: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref2) {\n        var _results$renderingCon, _results$renderingCon2, _results$renderingCon3;\n        var results = _ref2.results,\n          helper = _ref2.helper,\n          instantSearchInstance = _ref2.instantSearchInstance;\n        if (!sendEvent) {\n          sendEvent = (0, _utils.createSendEventForHits)({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            widgetType: this.$$type\n          });\n        }\n        if (!bindEvent) {\n          bindEvent = (0, _utils.createBindEventForHits)({\n            helper: helper,\n            widgetType: this.$$type,\n            instantSearchInstance: instantSearchInstance\n          });\n        }\n        if (!results) {\n          return {\n            hits: [],\n            items: [],\n            results: undefined,\n            banner: undefined,\n            sendEvent: sendEvent,\n            bindEvent: bindEvent,\n            widgetParams: widgetParams\n          };\n        }\n        if (escapeHTML && results.hits.length > 0) {\n          results.hits = (0, _utils.escapeHits)(results.hits);\n        }\n        var hitsWithAbsolutePosition = (0, _utils.addAbsolutePosition)(results.hits, results.page, results.hitsPerPage);\n        var hitsWithAbsolutePositionAndQueryID = (0, _utils.addQueryID)(hitsWithAbsolutePosition, results.queryID);\n        var items = transformItems(hitsWithAbsolutePositionAndQueryID, {\n          results: results\n        });\n        var banner = (_results$renderingCon = results.renderingContent) === null || _results$renderingCon === void 0 ? void 0 : (_results$renderingCon2 = _results$renderingCon.widgets) === null || _results$renderingCon2 === void 0 ? void 0 : (_results$renderingCon3 = _results$renderingCon2.banners) === null || _results$renderingCon3 === void 0 ? void 0 : _results$renderingCon3[0];\n        return {\n          hits: items,\n          items: items,\n          results: results,\n          banner: banner,\n          sendEvent: sendEvent,\n          bindEvent: bindEvent,\n          widgetParams: widgetParams\n        };\n      },\n      dispose: function dispose(_ref3) {\n        var state = _ref3.state;\n        unmountFn();\n        if (!escapeHTML) {\n          return state;\n        }\n        return state.setQueryParameters(Object.keys(_utils.TAG_PLACEHOLDER).reduce(function (acc, key) {\n          return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, undefined));\n        }, {}));\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(state, _uiState) {\n        if (!escapeHTML) {\n          return state;\n        }\n\n        // @MAJOR: set this globally, not in the Hits widget to allow Hits to be conditionally used\n        return state.setQueryParameters(_utils.TAG_PLACEHOLDER);\n      }\n    };\n  };\n};"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/hits/connectHitsWithInsights.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _insights = require(\"../../lib/insights\");\nvar _connectHits = _interopRequireDefault(require(\"./connectHits\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n/**\n * Due to https://github.com/microsoft/web-build-tools/issues/1050, we need\n * Connector<...> imported in this file, even though it is only used implicitly.\n * This _uses_ Connector<...> so it is not accidentally removed by someone.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\nvar connectHitsWithInsights = (0, _insights.withInsights)(_connectHits.default);\nvar _default = exports.default = connectHitsWithInsights;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/hits-per-page/connectHitsPerPage.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'hits-per-page',\n  connector: true\n});\nvar connectHitsPerPage = function connectHitsPerPage(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      userItems = _ref.items,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    if (!Array.isArray(userItems)) {\n      throw new Error(withUsage('The `items` option expects an array of objects.'));\n    }\n    var items = userItems;\n    var defaultItems = items.filter(function (item) {\n      return item.default === true;\n    });\n    if (defaultItems.length === 0) {\n      throw new Error(withUsage(\"A default value must be specified in `items`.\"));\n    }\n    if (defaultItems.length > 1) {\n      throw new Error(withUsage('More than one default value is specified in `items`.'));\n    }\n    var defaultItem = defaultItems[0];\n    var normalizeItems = function normalizeItems(_ref2) {\n      var hitsPerPage = _ref2.hitsPerPage;\n      return items.map(function (item) {\n        return _objectSpread(_objectSpread({}, item), {}, {\n          isRefined: Number(item.value) === Number(hitsPerPage)\n        });\n      });\n    };\n    var connectorState = {\n      getRefine: function getRefine(helper) {\n        return function (value) {\n          return !value && value !== 0 ? helper.setQueryParameter('hitsPerPage', undefined).search() : helper.setQueryParameter('hitsPerPage', value).search();\n        };\n      },\n      createURLFactory: function createURLFactory(_ref3) {\n        var state = _ref3.state,\n          createURL = _ref3.createURL,\n          getWidgetUiState = _ref3.getWidgetUiState,\n          helper = _ref3.helper;\n        return function (value) {\n          return createURL(function (uiState) {\n            return getWidgetUiState(uiState, {\n              searchParameters: state.resetPage().setQueryParameter('hitsPerPage', !value && value !== 0 ? undefined : value),\n              helper: helper\n            });\n          });\n        };\n      }\n    };\n    return {\n      $$type: 'ais.hitsPerPage',\n      init: function init(initOptions) {\n        var state = initOptions.state,\n          instantSearchInstance = initOptions.instantSearchInstance;\n        var isCurrentInOptions = items.some(function (item) {\n          return Number(state.hitsPerPage) === Number(item.value);\n        });\n        if (!isCurrentInOptions) {\n          process.env.NODE_ENV === 'development' ? (0, _utils.warning)(state.hitsPerPage !== undefined, \"\\n`hitsPerPage` is not defined.\\nThe option `hitsPerPage` needs to be set using the `configure` widget.\\n\\nLearn more: https://www.algolia.com/doc/api-reference/widgets/hits-per-page/js/\\n            \") : void 0;\n          process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, \"\\nThe `items` option of `hitsPerPage` does not contain the \\\"hits per page\\\" value coming from the state: \".concat(state.hitsPerPage, \".\\n\\nYou may want to add another entry to the `items` option with this value.\")) : void 0;\n          items = [\n          // The helper will convert the empty string to `undefined`.\n          {\n            value: '',\n            label: ''\n          }].concat(_toConsumableArray(items));\n        }\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref4) {\n        var state = _ref4.state;\n        unmountFn();\n        return state.setQueryParameter('hitsPerPage', undefined);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          hitsPerPage: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref5) {\n        var state = _ref5.state,\n          results = _ref5.results,\n          createURL = _ref5.createURL,\n          helper = _ref5.helper;\n        var canRefine = results ? results.nbHits > 0 : false;\n        return {\n          items: transformItems(normalizeItems(state), {\n            results: results\n          }),\n          refine: connectorState.getRefine(helper),\n          createURL: connectorState.createURLFactory({\n            state: state,\n            createURL: createURL,\n            getWidgetUiState: this.getWidgetUiState,\n            helper: helper\n          }),\n          hasNoResults: !canRefine,\n          canRefine: canRefine,\n          widgetParams: widgetParams\n        };\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref6) {\n        var searchParameters = _ref6.searchParameters;\n        var hitsPerPage = searchParameters.hitsPerPage;\n        if (hitsPerPage === undefined || hitsPerPage === defaultItem.value) {\n          return uiState;\n        }\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          hitsPerPage: hitsPerPage\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref7) {\n        var uiState = _ref7.uiState;\n        return searchParameters.setQueryParameters({\n          hitsPerPage: uiState.hitsPerPage || defaultItem.value\n        });\n      }\n    };\n  };\n};\nvar _default = exports.default = connectHitsPerPage;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/index.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.EXPERIMENTAL_connectDynamicWidgets = exports.EXPERIMENTAL_connectConfigureRelatedItems = exports.EXPERIMENTAL_connectAnswers = void 0;\nObject.defineProperty(exports, \"connectAutocomplete\", {\n  enumerable: true,\n  get: function get() {\n    return _connectAutocomplete.default;\n  }\n});\nObject.defineProperty(exports, \"connectBreadcrumb\", {\n  enumerable: true,\n  get: function get() {\n    return _connectBreadcrumb.default;\n  }\n});\nObject.defineProperty(exports, \"connectClearRefinements\", {\n  enumerable: true,\n  get: function get() {\n    return _connectClearRefinements.default;\n  }\n});\nObject.defineProperty(exports, \"connectConfigure\", {\n  enumerable: true,\n  get: function get() {\n    return _connectConfigure.default;\n  }\n});\nObject.defineProperty(exports, \"connectCurrentRefinements\", {\n  enumerable: true,\n  get: function get() {\n    return _connectCurrentRefinements.default;\n  }\n});\nObject.defineProperty(exports, \"connectDynamicWidgets\", {\n  enumerable: true,\n  get: function get() {\n    return _connectDynamicWidgets.default;\n  }\n});\nObject.defineProperty(exports, \"connectFrequentlyBoughtTogether\", {\n  enumerable: true,\n  get: function get() {\n    return _connectFrequentlyBoughtTogether.default;\n  }\n});\nObject.defineProperty(exports, \"connectGeoSearch\", {\n  enumerable: true,\n  get: function get() {\n    return _connectGeoSearch.default;\n  }\n});\nObject.defineProperty(exports, \"connectHierarchicalMenu\", {\n  enumerable: true,\n  get: function get() {\n    return _connectHierarchicalMenu.default;\n  }\n});\nObject.defineProperty(exports, \"connectHits\", {\n  enumerable: true,\n  get: function get() {\n    return _connectHits.default;\n  }\n});\nObject.defineProperty(exports, \"connectHitsPerPage\", {\n  enumerable: true,\n  get: function get() {\n    return _connectHitsPerPage.default;\n  }\n});\nObject.defineProperty(exports, \"connectHitsWithInsights\", {\n  enumerable: true,\n  get: function get() {\n    return _connectHitsWithInsights.default;\n  }\n});\nObject.defineProperty(exports, \"connectInfiniteHits\", {\n  enumerable: true,\n  get: function get() {\n    return _connectInfiniteHits.default;\n  }\n});\nObject.defineProperty(exports, \"connectInfiniteHitsWithInsights\", {\n  enumerable: true,\n  get: function get() {\n    return _connectInfiniteHitsWithInsights.default;\n  }\n});\nObject.defineProperty(exports, \"connectLookingSimilar\", {\n  enumerable: true,\n  get: function get() {\n    return _connectLookingSimilar.default;\n  }\n});\nObject.defineProperty(exports, \"connectMenu\", {\n  enumerable: true,\n  get: function get() {\n    return _connectMenu.default;\n  }\n});\nObject.defineProperty(exports, \"connectNumericMenu\", {\n  enumerable: true,\n  get: function get() {\n    return _connectNumericMenu.default;\n  }\n});\nObject.defineProperty(exports, \"connectPagination\", {\n  enumerable: true,\n  get: function get() {\n    return _connectPagination.default;\n  }\n});\nObject.defineProperty(exports, \"connectPoweredBy\", {\n  enumerable: true,\n  get: function get() {\n    return _connectPoweredBy.default;\n  }\n});\nObject.defineProperty(exports, \"connectQueryRules\", {\n  enumerable: true,\n  get: function get() {\n    return _connectQueryRules.default;\n  }\n});\nObject.defineProperty(exports, \"connectRange\", {\n  enumerable: true,\n  get: function get() {\n    return _connectRange.default;\n  }\n});\nObject.defineProperty(exports, \"connectRatingMenu\", {\n  enumerable: true,\n  get: function get() {\n    return _connectRatingMenu.default;\n  }\n});\nObject.defineProperty(exports, \"connectRefinementList\", {\n  enumerable: true,\n  get: function get() {\n    return _connectRefinementList.default;\n  }\n});\nObject.defineProperty(exports, \"connectRelatedProducts\", {\n  enumerable: true,\n  get: function get() {\n    return _connectRelatedProducts.default;\n  }\n});\nObject.defineProperty(exports, \"connectRelevantSort\", {\n  enumerable: true,\n  get: function get() {\n    return _connectRelevantSort.default;\n  }\n});\nObject.defineProperty(exports, \"connectSearchBox\", {\n  enumerable: true,\n  get: function get() {\n    return _connectSearchBox.default;\n  }\n});\nObject.defineProperty(exports, \"connectSortBy\", {\n  enumerable: true,\n  get: function get() {\n    return _connectSortBy.default;\n  }\n});\nObject.defineProperty(exports, \"connectStats\", {\n  enumerable: true,\n  get: function get() {\n    return _connectStats.default;\n  }\n});\nObject.defineProperty(exports, \"connectToggleRefinement\", {\n  enumerable: true,\n  get: function get() {\n    return _connectToggleRefinement.default;\n  }\n});\nObject.defineProperty(exports, \"connectTrendingItems\", {\n  enumerable: true,\n  get: function get() {\n    return _connectTrendingItems.default;\n  }\n});\nObject.defineProperty(exports, \"connectVoiceSearch\", {\n  enumerable: true,\n  get: function get() {\n    return _connectVoiceSearch.default;\n  }\n});\nvar _utils = require(\"../lib/utils\");\nvar _connectAnswers = _interopRequireDefault(require(\"./answers/connectAnswers\"));\nvar _connectConfigureRelatedItems = _interopRequireDefault(require(\"./configure-related-items/connectConfigureRelatedItems\"));\nvar _connectDynamicWidgets = _interopRequireDefault(require(\"./dynamic-widgets/connectDynamicWidgets\"));\nvar _connectClearRefinements = _interopRequireDefault(require(\"./clear-refinements/connectClearRefinements\"));\nvar _connectCurrentRefinements = _interopRequireDefault(require(\"./current-refinements/connectCurrentRefinements\"));\nvar _connectHierarchicalMenu = _interopRequireDefault(require(\"./hierarchical-menu/connectHierarchicalMenu\"));\nvar _connectHits = _interopRequireDefault(require(\"./hits/connectHits\"));\nvar _connectHitsWithInsights = _interopRequireDefault(require(\"./hits/connectHitsWithInsights\"));\nvar _connectHitsPerPage = _interopRequireDefault(require(\"./hits-per-page/connectHitsPerPage\"));\nvar _connectInfiniteHits = _interopRequireDefault(require(\"./infinite-hits/connectInfiniteHits\"));\nvar _connectInfiniteHitsWithInsights = _interopRequireDefault(require(\"./infinite-hits/connectInfiniteHitsWithInsights\"));\nvar _connectMenu = _interopRequireDefault(require(\"./menu/connectMenu\"));\nvar _connectNumericMenu = _interopRequireDefault(require(\"./numeric-menu/connectNumericMenu\"));\nvar _connectPagination = _interopRequireDefault(require(\"./pagination/connectPagination\"));\nvar _connectRange = _interopRequireDefault(require(\"./range/connectRange\"));\nvar _connectRefinementList = _interopRequireDefault(require(\"./refinement-list/connectRefinementList\"));\nvar _connectRelatedProducts = _interopRequireDefault(require(\"./related-products/connectRelatedProducts\"));\nvar _connectSearchBox = _interopRequireDefault(require(\"./search-box/connectSearchBox\"));\nvar _connectSortBy = _interopRequireDefault(require(\"./sort-by/connectSortBy\"));\nvar _connectRatingMenu = _interopRequireDefault(require(\"./rating-menu/connectRatingMenu\"));\nvar _connectStats = _interopRequireDefault(require(\"./stats/connectStats\"));\nvar _connectToggleRefinement = _interopRequireDefault(require(\"./toggle-refinement/connectToggleRefinement\"));\nvar _connectTrendingItems = _interopRequireDefault(require(\"./trending-items/connectTrendingItems\"));\nvar _connectBreadcrumb = _interopRequireDefault(require(\"./breadcrumb/connectBreadcrumb\"));\nvar _connectGeoSearch = _interopRequireDefault(require(\"./geo-search/connectGeoSearch\"));\nvar _connectPoweredBy = _interopRequireDefault(require(\"./powered-by/connectPoweredBy\"));\nvar _connectConfigure = _interopRequireDefault(require(\"./configure/connectConfigure\"));\nvar _connectAutocomplete = _interopRequireDefault(require(\"./autocomplete/connectAutocomplete\"));\nvar _connectQueryRules = _interopRequireDefault(require(\"./query-rules/connectQueryRules\"));\nvar _connectVoiceSearch = _interopRequireDefault(require(\"./voice-search/connectVoiceSearch\"));\nvar _connectRelevantSort = _interopRequireDefault(require(\"./relevant-sort/connectRelevantSort\"));\nvar _connectFrequentlyBoughtTogether = _interopRequireDefault(require(\"./frequently-bought-together/connectFrequentlyBoughtTogether\"));\nvar _connectLookingSimilar = _interopRequireDefault(require(\"./looking-similar/connectLookingSimilar\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n/** @deprecated answers is no longer supported */\nvar EXPERIMENTAL_connectAnswers = exports.EXPERIMENTAL_connectAnswers = (0, _utils.deprecate)(_connectAnswers.default, 'answers is no longer supported');\n\n/** @deprecated use connectRelatedItems instead */\nvar EXPERIMENTAL_connectConfigureRelatedItems = exports.EXPERIMENTAL_connectConfigureRelatedItems = (0, _utils.deprecate)(_connectConfigureRelatedItems.default, 'EXPERIMENTAL_connectConfigureRelatedItems is deprecated and will be removed in a next minor version of InstantSearch. Please use connectRelatedItems instead.');\n\n/** @deprecated use connectDynamicWidgets */\nvar EXPERIMENTAL_connectDynamicWidgets = exports.EXPERIMENTAL_connectDynamicWidgets = (0, _utils.deprecate)(_connectDynamicWidgets.default, 'use connectDynamicWidgets');"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/infinite-hits/connectInfiniteHits.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nvar _excluded = [\"page\"],\n  _excluded2 = [\"clickAnalytics\", \"userToken\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'infinite-hits',\n  connector: true\n});\nfunction getStateWithoutPage(state) {\n  var _ref = state || {},\n    page = _ref.page,\n    rest = _objectWithoutProperties(_ref, _excluded);\n  return rest;\n}\nfunction normalizeState(state) {\n  var _ref2 = state || {},\n    clickAnalytics = _ref2.clickAnalytics,\n    userToken = _ref2.userToken,\n    rest = _objectWithoutProperties(_ref2, _excluded2);\n  return rest;\n}\nfunction getInMemoryCache() {\n  var cachedHits = null;\n  var cachedState = null;\n  return {\n    read: function read(_ref3) {\n      var state = _ref3.state;\n      return (0, _utils.isEqual)(cachedState, getStateWithoutPage(state)) ? cachedHits : null;\n    },\n    write: function write(_ref4) {\n      var state = _ref4.state,\n        hits = _ref4.hits;\n      cachedState = getStateWithoutPage(state);\n      cachedHits = hits;\n    }\n  };\n}\nfunction extractHitsFromCachedHits(cachedHits) {\n  return Object.keys(cachedHits).map(Number).sort(function (a, b) {\n    return a - b;\n  }).reduce(function (acc, page) {\n    return acc.concat(cachedHits[page]);\n  }, []);\n}\nvar connectInfiniteHits = exports.default = function connectInfiniteHits(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref5 = widgetParams || {},\n      _ref5$escapeHTML = _ref5.escapeHTML,\n      escapeHTML = _ref5$escapeHTML === void 0 ? true : _ref5$escapeHTML,\n      _ref5$transformItems = _ref5.transformItems,\n      transformItems = _ref5$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref5$transformItems,\n      _ref5$cache = _ref5.cache,\n      cache = _ref5$cache === void 0 ? getInMemoryCache() : _ref5$cache;\n    var showPrevious;\n    var showMore;\n    var sendEvent;\n    var bindEvent;\n    var getFirstReceivedPage = function getFirstReceivedPage(state, cachedHits) {\n      var _state$page = state.page,\n        page = _state$page === void 0 ? 0 : _state$page;\n      var pages = Object.keys(cachedHits).map(Number);\n      if (pages.length === 0) {\n        return page;\n      } else {\n        return Math.min.apply(Math, [page].concat(_toConsumableArray(pages)));\n      }\n    };\n    var getLastReceivedPage = function getLastReceivedPage(state, cachedHits) {\n      var _state$page2 = state.page,\n        page = _state$page2 === void 0 ? 0 : _state$page2;\n      var pages = Object.keys(cachedHits).map(Number);\n      if (pages.length === 0) {\n        return page;\n      } else {\n        return Math.max.apply(Math, [page].concat(_toConsumableArray(pages)));\n      }\n    };\n    var getShowPrevious = function getShowPrevious(helper) {\n      return function () {\n        // Using the helper's `overrideStateWithoutTriggeringChangeEvent` method\n        // avoid updating the browser URL when the user displays the previous page.\n        helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread(_objectSpread({}, helper.state), {}, {\n          page: getFirstReceivedPage(helper.state, cache.read({\n            state: normalizeState(helper.state)\n          }) || {}) - 1\n        })).searchWithoutTriggeringOnStateChange();\n      };\n    };\n    var getShowMore = function getShowMore(helper) {\n      return function () {\n        helper.setPage(getLastReceivedPage(helper.state, cache.read({\n          state: normalizeState(helper.state)\n        }) || {}) + 1).search();\n      };\n    };\n    return {\n      $$type: 'ais.infiniteHits',\n      init: function init(initOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        var widgetRenderState = this.getWidgetRenderState(renderOptions);\n        renderFn(_objectSpread(_objectSpread({}, widgetRenderState), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n        sendEvent('view:internal', widgetRenderState.currentPageHits);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions\n      // Type is explicitly redefined, to avoid having the TWidgetParams type in the definition\n      ) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          infiniteHits: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref6) {\n        var _results$renderingCon, _results$renderingCon2, _results$renderingCon3;\n        var results = _ref6.results,\n          helper = _ref6.helper,\n          parent = _ref6.parent,\n          existingState = _ref6.state,\n          instantSearchInstance = _ref6.instantSearchInstance;\n        var isFirstPage;\n        var currentPageHits = [];\n        /**\n         * We bail out of optimistic UI here, as the cache is based on search\n         * parameters, and we don't want to invalidate the cache when the search\n         * is loading.\n         */\n        var state = parent.getPreviousState() || existingState;\n        var cachedHits = cache.read({\n          state: normalizeState(state)\n        }) || {};\n        var banner = results === null || results === void 0 ? void 0 : (_results$renderingCon = results.renderingContent) === null || _results$renderingCon === void 0 ? void 0 : (_results$renderingCon2 = _results$renderingCon.widgets) === null || _results$renderingCon2 === void 0 ? void 0 : (_results$renderingCon3 = _results$renderingCon2.banners) === null || _results$renderingCon3 === void 0 ? void 0 : _results$renderingCon3[0];\n        if (!results) {\n          showPrevious = getShowPrevious(helper);\n          showMore = getShowMore(helper);\n          sendEvent = (0, _utils.createSendEventForHits)({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            widgetType: this.$$type\n          });\n          bindEvent = (0, _utils.createBindEventForHits)({\n            helper: helper,\n            widgetType: this.$$type,\n            instantSearchInstance: instantSearchInstance\n          });\n          isFirstPage = state.page === undefined || getFirstReceivedPage(state, cachedHits) === 0;\n        } else {\n          var _state$disjunctiveFac, _state$hierarchicalFa;\n          var _state$page3 = state.page,\n            _page = _state$page3 === void 0 ? 0 : _state$page3;\n          if (escapeHTML && results.hits.length > 0) {\n            results.hits = (0, _utils.escapeHits)(results.hits);\n          }\n          var hitsWithAbsolutePosition = (0, _utils.addAbsolutePosition)(results.hits, results.page, results.hitsPerPage);\n          var hitsWithAbsolutePositionAndQueryID = (0, _utils.addQueryID)(hitsWithAbsolutePosition, results.queryID);\n          var transformedHits = transformItems(hitsWithAbsolutePositionAndQueryID, {\n            results: results\n          });\n\n          /*\n            With dynamic widgets, facets are not included in the state before their relevant widgets are mounted. Until then, we need to bail out of writing this incomplete state representation in cache.\n          */\n          var hasDynamicWidgets = false;\n          (0, _utils.walkIndex)(instantSearchInstance.mainIndex, function (indexWidget) {\n            if (!hasDynamicWidgets && indexWidget.getWidgets().some(function (_ref7) {\n              var $$type = _ref7.$$type;\n              return $$type === 'ais.dynamicWidgets';\n            })) {\n              hasDynamicWidgets = true;\n            }\n          });\n          var hasNoFacets = !((_state$disjunctiveFac = state.disjunctiveFacets) !== null && _state$disjunctiveFac !== void 0 && _state$disjunctiveFac.length) && !(state.facets || []).filter(function (f) {\n            return f !== '*';\n          }).length && !((_state$hierarchicalFa = state.hierarchicalFacets) !== null && _state$hierarchicalFa !== void 0 && _state$hierarchicalFa.length);\n          if (cachedHits[_page] === undefined && !results.__isArtificial && instantSearchInstance.status === 'idle' && !(hasDynamicWidgets && hasNoFacets)) {\n            cachedHits[_page] = transformedHits;\n            cache.write({\n              state: normalizeState(state),\n              hits: cachedHits\n            });\n          }\n          currentPageHits = transformedHits;\n          isFirstPage = getFirstReceivedPage(state, cachedHits) === 0;\n        }\n        var items = extractHitsFromCachedHits(cachedHits);\n        var isLastPage = results ? results.nbPages <= getLastReceivedPage(state, cachedHits) + 1 : true;\n        return {\n          hits: items,\n          items: items,\n          currentPageHits: currentPageHits,\n          sendEvent: sendEvent,\n          bindEvent: bindEvent,\n          banner: banner,\n          results: results || undefined,\n          showPrevious: showPrevious,\n          showMore: showMore,\n          isFirstPage: isFirstPage,\n          isLastPage: isLastPage,\n          widgetParams: widgetParams\n        };\n      },\n      dispose: function dispose(_ref8) {\n        var state = _ref8.state;\n        unmountFn();\n        var stateWithoutPage = state.setQueryParameter('page', undefined);\n        if (!escapeHTML) {\n          return stateWithoutPage;\n        }\n        return stateWithoutPage.setQueryParameters(Object.keys(_utils.TAG_PLACEHOLDER).reduce(function (acc, key) {\n          return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, undefined));\n        }, {}));\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref9) {\n        var searchParameters = _ref9.searchParameters;\n        var page = searchParameters.page || 0;\n        if (!page) {\n          // return without adding `page` to uiState\n          // because we don't want `page=1` in the URL\n          return uiState;\n        }\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          // The page in the UI state is incremented by one\n          // to expose the user value (not `0`).\n          page: page + 1\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref10) {\n        var uiState = _ref10.uiState;\n        var widgetSearchParameters = searchParameters;\n        if (escapeHTML) {\n          // @MAJOR: set this globally, not in the InfiniteHits widget to allow InfiniteHits to be conditionally used\n          widgetSearchParameters = searchParameters.setQueryParameters(_utils.TAG_PLACEHOLDER);\n        }\n\n        // The page in the search parameters is decremented by one\n        // to get to the actual parameter value from the UI state.\n        var page = uiState.page ? uiState.page - 1 : 0;\n        return widgetSearchParameters.setQueryParameter('page', page);\n      }\n    };\n  };\n};"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/infinite-hits/connectInfiniteHitsWithInsights.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _insights = require(\"../../lib/insights\");\nvar _connectInfiniteHits = _interopRequireDefault(require(\"./connectInfiniteHits\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n/**\n * Due to https://github.com/microsoft/web-build-tools/issues/1050, we need\n * Connector<...> imported in this file, even though it is only used implicitly.\n * This _uses_ Connector<...> so it is not accidentally removed by someone.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\nvar connectInfiniteHitsWithInsights = (0, _insights.withInsights)(_connectInfiniteHits.default);\nvar _default = exports.default = connectInfiniteHitsWithInsights;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/looking-similar/connectLookingSimilar.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'looking-similar',\n  connector: true\n});\nvar connectLookingSimilar = exports.default = function connectLookingSimilar(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      _ref$escapeHTML = _ref.escapeHTML,\n      escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,\n      objectIDs = _ref.objectIDs,\n      limit = _ref.limit,\n      threshold = _ref.threshold,\n      fallbackParameters = _ref.fallbackParameters,\n      queryParameters = _ref.queryParameters,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    if (!objectIDs || objectIDs.length === 0) {\n      throw new Error(withUsage('The `objectIDs` option is required.'));\n    }\n    var sendEvent;\n    return {\n      dependsOn: 'recommend',\n      $$type: 'ais.lookingSimilar',\n      init: function init(initOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var renderState = this.getWidgetRenderState(renderOptions);\n        renderFn(_objectSpread(_objectSpread({}, renderState), {}, {\n          instantSearchInstance: renderOptions.instantSearchInstance\n        }), false);\n      },\n      getRenderState: function getRenderState(renderState) {\n        return renderState;\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref2) {\n        var results = _ref2.results,\n          helper = _ref2.helper,\n          instantSearchInstance = _ref2.instantSearchInstance;\n        if (!sendEvent) {\n          sendEvent = (0, _utils.createSendEventForHits)({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            widgetType: this.$$type\n          });\n        }\n        if (results === null || results === undefined) {\n          return {\n            items: [],\n            widgetParams: widgetParams,\n            sendEvent: sendEvent\n          };\n        }\n        if (escapeHTML && results.hits.length > 0) {\n          results.hits = (0, _utils.escapeHits)(results.hits);\n        }\n        var itemsWithAbsolutePosition = (0, _utils.addAbsolutePosition)(results.hits, 0, 1);\n        var itemsWithAbsolutePositionAndQueryID = (0, _utils.addQueryID)(itemsWithAbsolutePosition, results.queryID);\n        var transformedItems = transformItems(itemsWithAbsolutePositionAndQueryID, {\n          results: results\n        });\n        return {\n          items: transformedItems,\n          widgetParams: widgetParams,\n          sendEvent: sendEvent\n        };\n      },\n      dispose: function dispose(_ref3) {\n        var recommendState = _ref3.recommendState;\n        unmountFn();\n        return recommendState.removeParams(this.$$id);\n      },\n      getWidgetParameters: function getWidgetParameters(state) {\n        var _this = this;\n        return objectIDs.reduce(function (acc, objectID) {\n          return acc.addLookingSimilar({\n            objectID: objectID,\n            maxRecommendations: limit,\n            threshold: threshold,\n            fallbackParameters: _objectSpread(_objectSpread({}, fallbackParameters), escapeHTML ? _utils.TAG_PLACEHOLDER : {}),\n            queryParameters: _objectSpread(_objectSpread({}, queryParameters), escapeHTML ? _utils.TAG_PLACEHOLDER : {}),\n            $$id: _this.$$id\n          });\n        }, state.removeParams(this.$$id));\n      }\n    };\n  };\n};"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/menu/connectMenu.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nvar _excluded = [\"name\", \"escapedValue\", \"path\"];\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'menu',\n  connector: true\n});\nvar DEFAULT_SORT = ['isRefined', 'name:asc'];\n/**\n * **Menu** connector provides the logic to build a widget that will give the user the ability to choose a single value for a specific facet. The typical usage of menu is for navigation in categories.\n *\n * This connector provides a `toggleShowMore()` function to display more or less items and a `refine()`\n * function to select an item. While selecting a new element, the `refine` will also unselect the\n * one that is currently selected.\n *\n * **Requirement:** the attribute passed as `attribute` must be present in \"attributes for faceting\" on the Algolia dashboard or configured as attributesForFaceting via a set settings call to the Algolia API.\n */\nvar connectMenu = function connectMenu(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      attribute = _ref.attribute,\n      _ref$limit = _ref.limit,\n      limit = _ref$limit === void 0 ? 10 : _ref$limit,\n      _ref$showMore = _ref.showMore,\n      showMore = _ref$showMore === void 0 ? false : _ref$showMore,\n      _ref$showMoreLimit = _ref.showMoreLimit,\n      showMoreLimit = _ref$showMoreLimit === void 0 ? 20 : _ref$showMoreLimit,\n      _ref$sortBy = _ref.sortBy,\n      sortBy = _ref$sortBy === void 0 ? DEFAULT_SORT : _ref$sortBy,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    if (!attribute) {\n      throw new Error(withUsage('The `attribute` option is required.'));\n    }\n    if (showMore === true && showMoreLimit <= limit) {\n      throw new Error(withUsage('The `showMoreLimit` option must be greater than `limit`.'));\n    }\n    var sendEvent;\n    var _createURL;\n    var _refine;\n\n    // Provide the same function to the `renderFn` so that way the user\n    // has to only bind it once when `isFirstRendering` for instance\n    var isShowingMore = false;\n    var toggleShowMore = function toggleShowMore() {};\n    function createToggleShowMore(renderOptions, widget) {\n      return function () {\n        isShowingMore = !isShowingMore;\n        widget.render(renderOptions);\n      };\n    }\n    function cachedToggleShowMore() {\n      toggleShowMore();\n    }\n    function getLimit() {\n      return isShowingMore ? showMoreLimit : limit;\n    }\n    return {\n      $$type: 'ais.menu',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref2) {\n        var state = _ref2.state;\n        unmountFn();\n        return state.removeHierarchicalFacet(attribute).setQueryParameter('maxValuesPerFacet', undefined);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          menu: _objectSpread(_objectSpread({}, renderState.menu), {}, _defineProperty({}, attribute, this.getWidgetRenderState(renderOptions)))\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(renderOptions) {\n        var _this = this;\n        var results = renderOptions.results,\n          createURL = renderOptions.createURL,\n          instantSearchInstance = renderOptions.instantSearchInstance,\n          helper = renderOptions.helper;\n        var items = [];\n        var canToggleShowMore = false;\n        if (!sendEvent) {\n          sendEvent = (0, _utils.createSendEventForFacet)({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            attribute: attribute,\n            widgetType: this.$$type\n          });\n        }\n        if (!_createURL) {\n          _createURL = function _createURL(facetValue) {\n            return createURL(function (uiState) {\n              return _this.getWidgetUiState(uiState, {\n                searchParameters: helper.state.resetPage().toggleFacetRefinement(attribute, facetValue),\n                helper: helper\n              });\n            });\n          };\n        }\n        if (!_refine) {\n          _refine = function _refine(facetValue) {\n            var _helper$getHierarchic = helper.getHierarchicalFacetBreadcrumb(attribute),\n              _helper$getHierarchic2 = _slicedToArray(_helper$getHierarchic, 1),\n              refinedItem = _helper$getHierarchic2[0];\n            sendEvent('click:internal', facetValue ? facetValue : refinedItem);\n            helper.toggleFacetRefinement(attribute, facetValue ? facetValue : refinedItem).search();\n          };\n        }\n        if (renderOptions.results) {\n          toggleShowMore = createToggleShowMore(renderOptions, this);\n        }\n        if (results) {\n          var facetValues = results.getFacetValues(attribute, {\n            sortBy: sortBy,\n            facetOrdering: sortBy === DEFAULT_SORT\n          });\n          var facetItems = facetValues && !Array.isArray(facetValues) && facetValues.data ? facetValues.data : [];\n          canToggleShowMore = showMore && (isShowingMore || facetItems.length > getLimit());\n          items = transformItems(facetItems.slice(0, getLimit()).map(function (_ref3) {\n            var label = _ref3.name,\n              value = _ref3.escapedValue,\n              path = _ref3.path,\n              item = _objectWithoutProperties(_ref3, _excluded);\n            return _objectSpread(_objectSpread({}, item), {}, {\n              label: label,\n              value: value\n            });\n          }), {\n            results: results\n          });\n        }\n        return {\n          items: items,\n          createURL: _createURL,\n          refine: _refine,\n          sendEvent: sendEvent,\n          canRefine: items.length > 0,\n          widgetParams: widgetParams,\n          isShowingMore: isShowingMore,\n          toggleShowMore: cachedToggleShowMore,\n          canToggleShowMore: canToggleShowMore\n        };\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref4) {\n        var searchParameters = _ref4.searchParameters;\n        var _searchParameters$get = searchParameters.getHierarchicalFacetBreadcrumb(attribute),\n          _searchParameters$get2 = _slicedToArray(_searchParameters$get, 1),\n          value = _searchParameters$get2[0];\n        return removeEmptyRefinementsFromUiState(_objectSpread(_objectSpread({}, uiState), {}, {\n          menu: _objectSpread(_objectSpread({}, uiState.menu), {}, _defineProperty({}, attribute, value))\n        }), attribute);\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref5) {\n        var uiState = _ref5.uiState;\n        var value = uiState.menu && uiState.menu[attribute];\n        if (searchParameters.isConjunctiveFacet(attribute) || searchParameters.isDisjunctiveFacet(attribute)) {\n          process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, \"Menu: Attribute \\\"\".concat(attribute, \"\\\" is already used by another widget applying conjunctive or disjunctive faceting.\\nAs this is not supported, please make sure to remove this other widget or this Menu widget will not work at all.\")) : void 0;\n          return searchParameters;\n        }\n        var withFacetConfiguration = searchParameters.removeHierarchicalFacet(attribute).addHierarchicalFacet({\n          name: attribute,\n          attributes: [attribute]\n        });\n        var currentMaxValuesPerFacet = withFacetConfiguration.maxValuesPerFacet || 0;\n        var nextMaxValuesPerFacet = Math.max(currentMaxValuesPerFacet, showMore ? showMoreLimit : limit);\n        var withMaxValuesPerFacet = withFacetConfiguration.setQueryParameter('maxValuesPerFacet', nextMaxValuesPerFacet);\n        if (!value) {\n          return withMaxValuesPerFacet.setQueryParameters({\n            hierarchicalFacetsRefinements: _objectSpread(_objectSpread({}, withMaxValuesPerFacet.hierarchicalFacetsRefinements), {}, _defineProperty({}, attribute, []))\n          });\n        }\n        return withMaxValuesPerFacet.addHierarchicalFacetRefinement(attribute, value);\n      }\n    };\n  };\n};\nfunction removeEmptyRefinementsFromUiState(indexUiState, attribute) {\n  if (!indexUiState.menu) {\n    return indexUiState;\n  }\n  if (indexUiState.menu[attribute] === undefined) {\n    delete indexUiState.menu[attribute];\n  }\n  if (Object.keys(indexUiState.menu).length === 0) {\n    delete indexUiState.menu;\n  }\n  return indexUiState;\n}\nvar _default = exports.default = connectMenu;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/numeric-menu/connectNumericMenu.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'numeric-menu',\n  connector: true\n});\nvar $$type = 'ais.numericMenu';\nvar createSendEvent = function createSendEvent(_ref) {\n  var instantSearchInstance = _ref.instantSearchInstance;\n  return function () {\n    if (arguments.length === 1) {\n      instantSearchInstance.sendEventToInsights(arguments.length <= 0 ? undefined : arguments[0]);\n      return;\n    }\n  };\n};\nvar connectNumericMenu = function connectNumericMenu(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref2 = widgetParams || {},\n      _ref2$attribute = _ref2.attribute,\n      attribute = _ref2$attribute === void 0 ? '' : _ref2$attribute,\n      _ref2$items = _ref2.items,\n      items = _ref2$items === void 0 ? [] : _ref2$items,\n      _ref2$transformItems = _ref2.transformItems,\n      transformItems = _ref2$transformItems === void 0 ? function (item) {\n        return item;\n      } : _ref2$transformItems;\n    if (attribute === '') {\n      throw new Error(withUsage('The `attribute` option is required.'));\n    }\n    if (!items || items.length === 0) {\n      throw new Error(withUsage('The `items` option expects an array of objects.'));\n    }\n    var prepareItems = function prepareItems(state) {\n      return items.map(function (_ref3) {\n        var start = _ref3.start,\n          end = _ref3.end,\n          label = _ref3.label;\n        return {\n          label: label,\n          value: encodeURI(JSON.stringify({\n            start: start,\n            end: end\n          })),\n          isRefined: isRefined(state, attribute, {\n            start: start,\n            end: end,\n            label: label\n          })\n        };\n      });\n    };\n    var connectorState = {};\n    return {\n      $$type: $$type,\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref4) {\n        var state = _ref4.state;\n        unmountFn();\n        return state.removeNumericRefinement(attribute);\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref5) {\n        var searchParameters = _ref5.searchParameters;\n        var values = searchParameters.getNumericRefinements(attribute);\n        var equal = values['='] && values['='][0];\n        if (equal || equal === 0) {\n          return _objectSpread(_objectSpread({}, uiState), {}, {\n            numericMenu: _objectSpread(_objectSpread({}, uiState.numericMenu), {}, _defineProperty({}, attribute, \"\".concat(values['='])))\n          });\n        }\n        var min = values['>='] && values['>='][0] || '';\n        var max = values['<='] && values['<='][0] || '';\n        return removeEmptyRefinementsFromUiState(_objectSpread(_objectSpread({}, uiState), {}, {\n          numericMenu: _objectSpread(_objectSpread({}, uiState.numericMenu), {}, _defineProperty({}, attribute, \"\".concat(min, \":\").concat(max)))\n        }), attribute);\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref6) {\n        var uiState = _ref6.uiState;\n        var value = uiState.numericMenu && uiState.numericMenu[attribute];\n        var withoutRefinements = searchParameters.setQueryParameters({\n          numericRefinements: _objectSpread(_objectSpread({}, searchParameters.numericRefinements), {}, _defineProperty({}, attribute, {}))\n        });\n        if (!value) {\n          return withoutRefinements;\n        }\n        var isExact = value.indexOf(':') === -1;\n        if (isExact) {\n          return withoutRefinements.addNumericRefinement(attribute, '=', Number(value));\n        }\n        var _value$split$map = value.split(':').map(parseFloat),\n          _value$split$map2 = _slicedToArray(_value$split$map, 2),\n          min = _value$split$map2[0],\n          max = _value$split$map2[1];\n        var withMinRefinement = (0, _utils.isFiniteNumber)(min) ? withoutRefinements.addNumericRefinement(attribute, '>=', min) : withoutRefinements;\n        var withMaxRefinement = (0, _utils.isFiniteNumber)(max) ? withMinRefinement.addNumericRefinement(attribute, '<=', max) : withMinRefinement;\n        return withMaxRefinement;\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          numericMenu: _objectSpread(_objectSpread({}, renderState.numericMenu), {}, _defineProperty({}, attribute, this.getWidgetRenderState(renderOptions)))\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref7) {\n        var _this = this;\n        var results = _ref7.results,\n          state = _ref7.state,\n          instantSearchInstance = _ref7.instantSearchInstance,\n          helper = _ref7.helper,\n          createURL = _ref7.createURL;\n        if (!connectorState.refine) {\n          connectorState.refine = function (facetValue) {\n            var refinedState = getRefinedState(helper.state, attribute, facetValue);\n            connectorState.sendEvent('click:internal', facetValue);\n            helper.setState(refinedState).search();\n          };\n        }\n        if (!connectorState.createURL) {\n          connectorState.createURL = function (newState) {\n            return function (facetValue) {\n              return createURL(function (uiState) {\n                return _this.getWidgetUiState(uiState, {\n                  searchParameters: getRefinedState(newState, attribute, facetValue),\n                  helper: helper\n                });\n              });\n            };\n          };\n        }\n        if (!connectorState.sendEvent) {\n          connectorState.sendEvent = createSendEvent({\n            instantSearchInstance: instantSearchInstance\n          });\n        }\n        var hasNoResults = results ? results.nbHits === 0 : true;\n        var preparedItems = prepareItems(state);\n        var allIsSelected = true;\n        // @TODO avoid for..of for polyfill reasons\n        // eslint-disable-next-line no-restricted-syntax\n        var _iterator = _createForOfIteratorHelper(preparedItems),\n          _step;\n        try {\n          for (_iterator.s(); !(_step = _iterator.n()).done;) {\n            var item = _step.value;\n            if (item.isRefined && decodeURI(item.value) !== '{}') {\n              allIsSelected = false;\n              break;\n            }\n          }\n        } catch (err) {\n          _iterator.e(err);\n        } finally {\n          _iterator.f();\n        }\n        return {\n          createURL: connectorState.createURL(state),\n          items: transformItems(preparedItems, {\n            results: results\n          }),\n          hasNoResults: hasNoResults,\n          canRefine: !(hasNoResults && allIsSelected),\n          refine: connectorState.refine,\n          sendEvent: connectorState.sendEvent,\n          widgetParams: widgetParams\n        };\n      }\n    };\n  };\n};\nfunction isRefined(state, attribute, option) {\n  // @TODO: same as another spot, why is this mixing arrays & elements?\n  var currentRefinements = state.getNumericRefinements(attribute);\n  if (option.start !== undefined && option.end !== undefined) {\n    if (option.start === option.end) {\n      return hasNumericRefinement(currentRefinements, '=', option.start);\n    } else {\n      return hasNumericRefinement(currentRefinements, '>=', option.start) && hasNumericRefinement(currentRefinements, '<=', option.end);\n    }\n  }\n  if (option.start !== undefined) {\n    return hasNumericRefinement(currentRefinements, '>=', option.start);\n  }\n  if (option.end !== undefined) {\n    return hasNumericRefinement(currentRefinements, '<=', option.end);\n  }\n  if (option.start === undefined && option.end === undefined) {\n    return Object.keys(currentRefinements).every(function (operator) {\n      return (currentRefinements[operator] || []).length === 0;\n    });\n  }\n  return false;\n}\nfunction getRefinedState(state, attribute, facetValue) {\n  var resolvedState = state;\n  var refinedOption = JSON.parse(decodeURI(facetValue));\n\n  // @TODO: why is array / element mixed here & hasRefinements; seems wrong?\n  var currentRefinements = resolvedState.getNumericRefinements(attribute);\n  if (refinedOption.start === undefined && refinedOption.end === undefined) {\n    return resolvedState.removeNumericRefinement(attribute);\n  }\n  if (!isRefined(resolvedState, attribute, refinedOption)) {\n    resolvedState = resolvedState.removeNumericRefinement(attribute);\n  }\n  if (refinedOption.start !== undefined && refinedOption.end !== undefined) {\n    if (refinedOption.start > refinedOption.end) {\n      throw new Error('option.start should be > to option.end');\n    }\n    if (refinedOption.start === refinedOption.end) {\n      if (hasNumericRefinement(currentRefinements, '=', refinedOption.start)) {\n        resolvedState = resolvedState.removeNumericRefinement(attribute, '=', refinedOption.start);\n      } else {\n        resolvedState = resolvedState.addNumericRefinement(attribute, '=', refinedOption.start);\n      }\n      return resolvedState;\n    }\n  }\n  if (refinedOption.start !== undefined) {\n    if (hasNumericRefinement(currentRefinements, '>=', refinedOption.start)) {\n      resolvedState = resolvedState.removeNumericRefinement(attribute, '>=', refinedOption.start);\n    }\n    resolvedState = resolvedState.addNumericRefinement(attribute, '>=', refinedOption.start);\n  }\n  if (refinedOption.end !== undefined) {\n    if (hasNumericRefinement(currentRefinements, '<=', refinedOption.end)) {\n      resolvedState = resolvedState.removeNumericRefinement(attribute, '<=', refinedOption.end);\n    }\n    resolvedState = resolvedState.addNumericRefinement(attribute, '<=', refinedOption.end);\n  }\n  if (typeof resolvedState.page === 'number') {\n    resolvedState.page = 0;\n  }\n  return resolvedState;\n}\nfunction hasNumericRefinement(currentRefinements, operator, value) {\n  return currentRefinements[operator] !== undefined && currentRefinements[operator].includes(value);\n}\nfunction removeEmptyRefinementsFromUiState(indexUiState, attribute) {\n  if (!indexUiState.numericMenu) {\n    return indexUiState;\n  }\n  if (indexUiState.numericMenu[attribute] === ':') {\n    delete indexUiState.numericMenu[attribute];\n  }\n  if (Object.keys(indexUiState.numericMenu).length === 0) {\n    delete indexUiState.numericMenu;\n  }\n  return indexUiState;\n}\nvar _default = exports.default = connectNumericMenu;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/pagination/Paginator.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar Paginator = /*#__PURE__*/function () {\n  function Paginator(params) {\n    _classCallCheck(this, Paginator);\n    _defineProperty(this, \"currentPage\", void 0);\n    _defineProperty(this, \"total\", void 0);\n    _defineProperty(this, \"padding\", void 0);\n    this.currentPage = params.currentPage;\n    this.total = params.total;\n    this.padding = params.padding;\n  }\n  _createClass(Paginator, [{\n    key: \"pages\",\n    value: function pages() {\n      var total = this.total,\n        currentPage = this.currentPage,\n        padding = this.padding;\n      if (total === 0) return [0];\n      var totalDisplayedPages = this.nbPagesDisplayed(padding, total);\n      if (totalDisplayedPages === total) {\n        return (0, _utils.range)({\n          end: total\n        });\n      }\n      var paddingLeft = this.calculatePaddingLeft(currentPage, padding, total, totalDisplayedPages);\n      var paddingRight = totalDisplayedPages - paddingLeft;\n      var first = currentPage - paddingLeft;\n      var last = currentPage + paddingRight;\n      return (0, _utils.range)({\n        start: first,\n        end: last\n      });\n    }\n  }, {\n    key: \"nbPagesDisplayed\",\n    value: function nbPagesDisplayed(padding, total) {\n      return Math.min(2 * padding + 1, total);\n    }\n  }, {\n    key: \"calculatePaddingLeft\",\n    value: function calculatePaddingLeft(current, padding, total, totalDisplayedPages) {\n      if (current <= padding) {\n        return current;\n      }\n      if (current >= total - padding) {\n        return totalDisplayedPages - (total - current);\n      }\n      return padding;\n    }\n  }, {\n    key: \"isLastPage\",\n    value: function isLastPage() {\n      return this.currentPage >= this.total - 1;\n    }\n  }, {\n    key: \"isFirstPage\",\n    value: function isFirstPage() {\n      return this.currentPage <= 0;\n    }\n  }]);\n  return Paginator;\n}();\nvar _default = exports.default = Paginator;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/pagination/connectPagination.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nvar _Paginator = _interopRequireDefault(require(\"./Paginator\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'pagination',\n  connector: true\n});\n/**\n * **Pagination** connector provides the logic to build a widget that will let the user\n * choose the current page of the results.\n *\n * When using the pagination with Algolia, you should be aware that the engine won't provide you pages\n * beyond the 1000th hits by default. You can find more information on the [Algolia documentation](https://www.algolia.com/doc/guides/searching/pagination/#pagination-limitations).\n */\nvar connectPagination = function connectPagination(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      totalPages = _ref.totalPages,\n      _ref$padding = _ref.padding,\n      padding = _ref$padding === void 0 ? 3 : _ref$padding;\n    var pager = new _Paginator.default({\n      currentPage: 0,\n      total: 0,\n      padding: padding\n    });\n    var connectorState = {};\n    function getMaxPage(_ref2) {\n      var nbPages = _ref2.nbPages;\n      return totalPages !== undefined ? Math.min(totalPages, nbPages) : nbPages;\n    }\n    return {\n      $$type: 'ais.pagination',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref3) {\n        var state = _ref3.state;\n        unmountFn();\n        return state.setQueryParameter('page', undefined);\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref4) {\n        var searchParameters = _ref4.searchParameters;\n        var page = searchParameters.page || 0;\n        if (!page) {\n          return uiState;\n        }\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          page: page + 1\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref5) {\n        var uiState = _ref5.uiState;\n        var page = uiState.page ? uiState.page - 1 : 0;\n        return searchParameters.setQueryParameter('page', page);\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref6) {\n        var results = _ref6.results,\n          helper = _ref6.helper,\n          state = _ref6.state,\n          createURL = _ref6.createURL;\n        if (!connectorState.refine) {\n          connectorState.refine = function (page) {\n            helper.setPage(page);\n            helper.search();\n          };\n        }\n        if (!connectorState.createURL) {\n          connectorState.createURL = function (page) {\n            return createURL(function (uiState) {\n              return _objectSpread(_objectSpread({}, uiState), {}, {\n                page: page + 1\n              });\n            });\n          };\n        }\n        var page = state.page || 0;\n        var nbPages = getMaxPage(results || {\n          nbPages: 0\n        });\n        pager.currentPage = page;\n        pager.total = nbPages;\n        return {\n          createURL: connectorState.createURL,\n          refine: connectorState.refine,\n          canRefine: nbPages > 1,\n          currentRefinement: page,\n          nbHits: (results === null || results === void 0 ? void 0 : results.nbHits) || 0,\n          nbPages: nbPages,\n          pages: results ? pager.pages() : [],\n          isFirstPage: pager.isFirstPage(),\n          isLastPage: pager.isLastPage(),\n          widgetParams: widgetParams\n        };\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          pagination: this.getWidgetRenderState(renderOptions)\n        });\n      }\n    };\n  };\n};\nvar _default = exports.default = connectPagination;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/powered-by/connectPoweredBy.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'powered-by',\n  connector: true\n});\n/**\n * **PoweredBy** connector provides the logic to build a custom widget that will displays\n * the logo to redirect to Algolia.\n */\nvar connectPoweredBy = function connectPoweredBy(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  var defaultUrl = 'https://www.algolia.com/?' + 'utm_source=instantsearch.js&' + 'utm_medium=website&' + \"utm_content=\".concat((0, _utils.safelyRunOnBrowser)(function (_ref) {\n    var _window$location;\n    var window = _ref.window;\n    return ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location.hostname) || '';\n  }, {\n    fallback: function fallback() {\n      return '';\n    }\n  }), \"&\") + 'utm_campaign=poweredby';\n  return function (widgetParams) {\n    var _ref2 = widgetParams || {},\n      _ref2$url = _ref2.url,\n      url = _ref2$url === void 0 ? defaultUrl : _ref2$url;\n    return {\n      $$type: 'ais.poweredBy',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          poweredBy: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState() {\n        return {\n          url: url,\n          widgetParams: widgetParams\n        };\n      },\n      dispose: function dispose() {\n        unmountFn();\n      }\n    };\n  };\n};\nvar _default = exports.default = connectPoweredBy;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/query-rules/connectQueryRules.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'query-rules',\n  connector: true\n});\nfunction hasStateRefinements(state) {\n  return [state.disjunctiveFacetsRefinements, state.facetsRefinements, state.hierarchicalFacetsRefinements, state.numericRefinements].some(function (refinement) {\n    return Boolean(refinement && Object.keys(refinement).length > 0);\n  });\n}\n\n// A context rule must consist only of alphanumeric characters, hyphens, and underscores.\n// See https://www.algolia.com/doc/guides/managing-results/refine-results/merchandising-and-promoting/in-depth/implementing-query-rules/#context\nfunction escapeRuleContext(ruleName) {\n  return ruleName.replace(/[^a-z0-9-_]+/gi, '_');\n}\nfunction getRuleContextsFromTrackedFilters(_ref) {\n  var helper = _ref.helper,\n    sharedHelperState = _ref.sharedHelperState,\n    trackedFilters = _ref.trackedFilters;\n  var ruleContexts = Object.keys(trackedFilters).reduce(function (facets, facetName) {\n    var facetRefinements = (0, _utils.getRefinements)(helper.lastResults || {}, sharedHelperState, true).filter(function (refinement) {\n      return refinement.attribute === facetName;\n    }).map(function (refinement) {\n      return refinement.numericValue || refinement.name;\n    });\n    var getTrackedFacetValues = trackedFilters[facetName];\n    var trackedFacetValues = getTrackedFacetValues(facetRefinements);\n    return [].concat(_toConsumableArray(facets), _toConsumableArray(facetRefinements.filter(function (facetRefinement) {\n      return trackedFacetValues.includes(facetRefinement);\n    }).map(function (facetValue) {\n      return escapeRuleContext(\"ais-\".concat(facetName, \"-\").concat(facetValue));\n    })));\n  }, []);\n  return ruleContexts;\n}\nfunction applyRuleContexts(event) {\n  var helper = this.helper,\n    initialRuleContexts = this.initialRuleContexts,\n    trackedFilters = this.trackedFilters,\n    transformRuleContexts = this.transformRuleContexts;\n  var sharedHelperState = event.state;\n  var previousRuleContexts = sharedHelperState.ruleContexts || [];\n  var newRuleContexts = getRuleContextsFromTrackedFilters({\n    helper: helper,\n    sharedHelperState: sharedHelperState,\n    trackedFilters: trackedFilters\n  });\n  var nextRuleContexts = [].concat(_toConsumableArray(initialRuleContexts), _toConsumableArray(newRuleContexts));\n  process.env.NODE_ENV === 'development' ? (0, _utils.warning)(nextRuleContexts.length <= 10, \"\\nThe maximum number of `ruleContexts` is 10. They have been sliced to that limit.\\nConsider using `transformRuleContexts` to minimize the number of rules sent to Algolia.\\n\") : void 0;\n  var ruleContexts = transformRuleContexts(nextRuleContexts).slice(0, 10);\n  if (!(0, _utils.isEqual)(previousRuleContexts, ruleContexts)) {\n    helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread(_objectSpread({}, sharedHelperState), {}, {\n      ruleContexts: ruleContexts\n    }));\n  }\n}\nvar connectQueryRules = function connectQueryRules(_render) {\n  var unmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(_render, withUsage());\n  return function (widgetParams) {\n    var _ref2 = widgetParams || {},\n      _ref2$trackedFilters = _ref2.trackedFilters,\n      trackedFilters = _ref2$trackedFilters === void 0 ? {} : _ref2$trackedFilters,\n      _ref2$transformRuleCo = _ref2.transformRuleContexts,\n      transformRuleContexts = _ref2$transformRuleCo === void 0 ? function (rules) {\n        return rules;\n      } : _ref2$transformRuleCo,\n      _ref2$transformItems = _ref2.transformItems,\n      transformItems = _ref2$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref2$transformItems;\n    Object.keys(trackedFilters).forEach(function (facetName) {\n      if (typeof trackedFilters[facetName] !== 'function') {\n        throw new Error(withUsage(\"'The \\\"\".concat(facetName, \"\\\" filter value in the `trackedFilters` option expects a function.\")));\n      }\n    });\n    var hasTrackedFilters = Object.keys(trackedFilters).length > 0;\n\n    // We store the initial rule contexts applied before creating the widget\n    // so that we do not override them with the rules created from `trackedFilters`.\n    var initialRuleContexts = [];\n    var onHelperChange;\n    return {\n      $$type: 'ais.queryRules',\n      init: function init(initOptions) {\n        var helper = initOptions.helper,\n          state = initOptions.state,\n          instantSearchInstance = initOptions.instantSearchInstance;\n        initialRuleContexts = state.ruleContexts || [];\n        onHelperChange = applyRuleContexts.bind({\n          helper: helper,\n          initialRuleContexts: initialRuleContexts,\n          trackedFilters: trackedFilters,\n          transformRuleContexts: transformRuleContexts\n        });\n        if (hasTrackedFilters) {\n          // We need to apply the `ruleContexts` based on the `trackedFilters`\n          // before the helper changes state in some cases:\n          //   - Some filters are applied on the first load (e.g. using `configure`)\n          //   - The `transformRuleContexts` option sets initial `ruleContexts`.\n          if (hasStateRefinements(state) || Boolean(widgetParams.transformRuleContexts)) {\n            onHelperChange({\n              state: state\n            });\n          }\n\n          // We track every change in the helper to override its state and add\n          // any `ruleContexts` needed based on the `trackedFilters`.\n          helper.on('change', onHelperChange);\n        }\n        _render(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        _render(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref3) {\n        var results = _ref3.results;\n        var _ref4 = results || {},\n          _ref4$userData = _ref4.userData,\n          userData = _ref4$userData === void 0 ? [] : _ref4$userData;\n        var items = transformItems(userData, {\n          results: results\n        });\n        return {\n          items: items,\n          widgetParams: widgetParams\n        };\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          queryRules: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      dispose: function dispose(_ref5) {\n        var helper = _ref5.helper,\n          state = _ref5.state;\n        unmount();\n        if (hasTrackedFilters) {\n          helper.removeListener('change', onHelperChange);\n          return state.setQueryParameter('ruleContexts', initialRuleContexts);\n        }\n        return state;\n      }\n    };\n  };\n};\nvar _default = exports.default = connectQueryRules;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/range/connectRange.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'range-input',\n  connector: true\n}, {\n  name: 'range-slider',\n  connector: true\n});\nvar $$type = 'ais.range';\n\n// @MAJOR: potentially we should consolidate these types\n\nfunction toPrecision(_ref) {\n  var min = _ref.min,\n    max = _ref.max,\n    precision = _ref.precision;\n  var pow = Math.pow(10, precision);\n  return {\n    min: min ? Math.floor(min * pow) / pow : min,\n    max: max ? Math.ceil(max * pow) / pow : max\n  };\n}\n\n/**\n * **Range** connector provides the logic to create custom widget that will let\n * the user refine results using a numeric range.\n *\n * This connectors provides a `refine()` function that accepts bounds. It will also provide\n * information about the min and max bounds for the current result set.\n */\nvar connectRange = function connectRange(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref2 = widgetParams || {},\n      _ref2$attribute = _ref2.attribute,\n      attribute = _ref2$attribute === void 0 ? '' : _ref2$attribute,\n      minBound = _ref2.min,\n      maxBound = _ref2.max,\n      _ref2$precision = _ref2.precision,\n      precision = _ref2$precision === void 0 ? 0 : _ref2$precision;\n    if (!attribute) {\n      throw new Error(withUsage('The `attribute` option is required.'));\n    }\n    if ((0, _utils.isFiniteNumber)(minBound) && (0, _utils.isFiniteNumber)(maxBound) && minBound > maxBound) {\n      throw new Error(withUsage(\"The `max` option can't be lower than `min`.\"));\n    }\n    var formatToNumber = function formatToNumber(v) {\n      return Number(Number(v).toFixed(precision));\n    };\n    var rangeFormatter = {\n      from: function from(v) {\n        return v.toLocaleString();\n      },\n      to: function to(v) {\n        return formatToNumber(v).toLocaleString();\n      }\n    };\n\n    // eslint-disable-next-line complexity\n    var getRefinedState = function getRefinedState(helper, currentRange, nextMin, nextMax) {\n      var resolvedState = helper.state;\n      var currentRangeMin = currentRange.min,\n        currentRangeMax = currentRange.max;\n      var _ref3 = resolvedState.getNumericRefinement(attribute, '>=') || [],\n        _ref4 = _slicedToArray(_ref3, 1),\n        min = _ref4[0];\n      var _ref5 = resolvedState.getNumericRefinement(attribute, '<=') || [],\n        _ref6 = _slicedToArray(_ref5, 1),\n        max = _ref6[0];\n      var isResetMin = nextMin === undefined || nextMin === '';\n      var isResetMax = nextMax === undefined || nextMax === '';\n      var _toPrecision = toPrecision({\n          min: !isResetMin ? parseFloat(nextMin) : undefined,\n          max: !isResetMax ? parseFloat(nextMax) : undefined,\n          precision: precision\n        }),\n        nextMinAsNumber = _toPrecision.min,\n        nextMaxAsNumber = _toPrecision.max;\n      var newNextMin;\n      if (!(0, _utils.isFiniteNumber)(minBound) && currentRangeMin === nextMinAsNumber) {\n        newNextMin = undefined;\n      } else if ((0, _utils.isFiniteNumber)(minBound) && isResetMin) {\n        newNextMin = minBound;\n      } else {\n        newNextMin = nextMinAsNumber;\n      }\n      var newNextMax;\n      if (!(0, _utils.isFiniteNumber)(maxBound) && currentRangeMax === nextMaxAsNumber) {\n        newNextMax = undefined;\n      } else if ((0, _utils.isFiniteNumber)(maxBound) && isResetMax) {\n        newNextMax = maxBound;\n      } else {\n        newNextMax = nextMaxAsNumber;\n      }\n      var isResetNewNextMin = newNextMin === undefined;\n      var isGreaterThanCurrentRange = (0, _utils.isFiniteNumber)(currentRangeMin) && currentRangeMin <= newNextMin;\n      var isMinValid = isResetNewNextMin || (0, _utils.isFiniteNumber)(newNextMin) && (!(0, _utils.isFiniteNumber)(currentRangeMin) || isGreaterThanCurrentRange);\n      var isResetNewNextMax = newNextMax === undefined;\n      var isLowerThanRange = (0, _utils.isFiniteNumber)(newNextMax) && currentRangeMax >= newNextMax;\n      var isMaxValid = isResetNewNextMax || (0, _utils.isFiniteNumber)(newNextMax) && (!(0, _utils.isFiniteNumber)(currentRangeMax) || isLowerThanRange);\n      var hasMinChange = min !== newNextMin;\n      var hasMaxChange = max !== newNextMax;\n      if ((hasMinChange || hasMaxChange) && isMinValid && isMaxValid) {\n        resolvedState = resolvedState.removeNumericRefinement(attribute);\n        if ((0, _utils.isFiniteNumber)(newNextMin)) {\n          resolvedState = resolvedState.addNumericRefinement(attribute, '>=', newNextMin);\n        }\n        if ((0, _utils.isFiniteNumber)(newNextMax)) {\n          resolvedState = resolvedState.addNumericRefinement(attribute, '<=', newNextMax);\n        }\n        return resolvedState.resetPage();\n      }\n      return null;\n    };\n    var createSendEvent = function createSendEvent(instantSearchInstance) {\n      return function () {\n        if (arguments.length === 1) {\n          instantSearchInstance.sendEventToInsights(arguments.length <= 0 ? undefined : arguments[0]);\n          return;\n        }\n      };\n    };\n    function _getCurrentRange(stats) {\n      var min;\n      if ((0, _utils.isFiniteNumber)(minBound)) {\n        min = minBound;\n      } else if ((0, _utils.isFiniteNumber)(stats.min)) {\n        min = stats.min;\n      } else {\n        min = 0;\n      }\n      var max;\n      if ((0, _utils.isFiniteNumber)(maxBound)) {\n        max = maxBound;\n      } else if ((0, _utils.isFiniteNumber)(stats.max)) {\n        max = stats.max;\n      } else {\n        max = 0;\n      }\n      return toPrecision({\n        min: min,\n        max: max,\n        precision: precision\n      });\n    }\n    function _getCurrentRefinement(helper) {\n      var _ref7 = helper.getNumericRefinement(attribute, '>=') || [],\n        _ref8 = _slicedToArray(_ref7, 1),\n        minValue = _ref8[0];\n      var _ref9 = helper.getNumericRefinement(attribute, '<=') || [],\n        _ref10 = _slicedToArray(_ref9, 1),\n        maxValue = _ref10[0];\n      var min = (0, _utils.isFiniteNumber)(minValue) ? minValue : -Infinity;\n      var max = (0, _utils.isFiniteNumber)(maxValue) ? maxValue : Infinity;\n      return [min, max];\n    }\n    function _refine(helper, currentRange) {\n      return function () {\n        var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [undefined, undefined],\n          _ref12 = _slicedToArray(_ref11, 2),\n          nextMin = _ref12[0],\n          nextMax = _ref12[1];\n        var refinedState = getRefinedState(helper, currentRange, nextMin, nextMax);\n        if (refinedState) {\n          helper.setState(refinedState).search();\n        }\n      };\n    }\n    return {\n      $$type: $$type,\n      init: function init(initOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: renderOptions.instantSearchInstance\n        }), false);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          range: _objectSpread(_objectSpread({}, renderState.range), {}, _defineProperty({}, attribute, this.getWidgetRenderState(renderOptions)))\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref13) {\n        var results = _ref13.results,\n          helper = _ref13.helper,\n          instantSearchInstance = _ref13.instantSearchInstance;\n        var facetsFromResults = results && results.disjunctiveFacets || [];\n        var facet = (0, _utils.find)(facetsFromResults, function (facetResult) {\n          return facetResult.name === attribute;\n        });\n        var stats = facet && facet.stats || {\n          min: undefined,\n          max: undefined\n        };\n        var currentRange = _getCurrentRange(stats);\n        var start = _getCurrentRefinement(helper);\n        var refine;\n        if (!results) {\n          // On first render pass an empty range\n          // to be able to bypass the validation\n          // related to it\n          refine = _refine(helper, {\n            min: undefined,\n            max: undefined\n          });\n        } else {\n          refine = _refine(helper, currentRange);\n        }\n        return {\n          refine: refine,\n          canRefine: currentRange.min !== currentRange.max,\n          format: rangeFormatter,\n          range: currentRange,\n          sendEvent: createSendEvent(instantSearchInstance),\n          widgetParams: _objectSpread(_objectSpread({}, widgetParams), {}, {\n            precision: precision\n          }),\n          start: start\n        };\n      },\n      dispose: function dispose(_ref14) {\n        var state = _ref14.state;\n        unmountFn();\n        return state.removeDisjunctiveFacet(attribute).removeNumericRefinement(attribute);\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref15) {\n        var searchParameters = _ref15.searchParameters;\n        var _searchParameters$get = searchParameters.getNumericRefinements(attribute),\n          _searchParameters$get2 = _searchParameters$get['>='],\n          min = _searchParameters$get2 === void 0 ? [] : _searchParameters$get2,\n          _searchParameters$get3 = _searchParameters$get['<='],\n          max = _searchParameters$get3 === void 0 ? [] : _searchParameters$get3;\n        if (min.length === 0 && max.length === 0) {\n          return uiState;\n        }\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          range: _objectSpread(_objectSpread({}, uiState.range), {}, _defineProperty({}, attribute, \"\".concat(min, \":\").concat(max)))\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref16) {\n        var uiState = _ref16.uiState;\n        var widgetSearchParameters = searchParameters.addDisjunctiveFacet(attribute).setQueryParameters({\n          numericRefinements: _objectSpread(_objectSpread({}, searchParameters.numericRefinements), {}, _defineProperty({}, attribute, {}))\n        });\n        if ((0, _utils.isFiniteNumber)(minBound)) {\n          widgetSearchParameters = widgetSearchParameters.addNumericRefinement(attribute, '>=', minBound);\n        }\n        if ((0, _utils.isFiniteNumber)(maxBound)) {\n          widgetSearchParameters = widgetSearchParameters.addNumericRefinement(attribute, '<=', maxBound);\n        }\n        var value = uiState.range && uiState.range[attribute];\n        if (!value || value.indexOf(':') === -1) {\n          return widgetSearchParameters;\n        }\n        var _value$split$map = value.split(':').map(parseFloat),\n          _value$split$map2 = _slicedToArray(_value$split$map, 2),\n          lowerBound = _value$split$map2[0],\n          upperBound = _value$split$map2[1];\n        if ((0, _utils.isFiniteNumber)(lowerBound) && (!(0, _utils.isFiniteNumber)(minBound) || minBound < lowerBound)) {\n          widgetSearchParameters = widgetSearchParameters.removeNumericRefinement(attribute, '>=');\n          widgetSearchParameters = widgetSearchParameters.addNumericRefinement(attribute, '>=', lowerBound);\n        }\n        if ((0, _utils.isFiniteNumber)(upperBound) && (!(0, _utils.isFiniteNumber)(maxBound) || upperBound < maxBound)) {\n          widgetSearchParameters = widgetSearchParameters.removeNumericRefinement(attribute, '<=');\n          widgetSearchParameters = widgetSearchParameters.addNumericRefinement(attribute, '<=', upperBound);\n        }\n        return widgetSearchParameters;\n      }\n    };\n  };\n};\nvar _default = exports.default = connectRange;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/rating-menu/connectRatingMenu.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'rating-menu',\n  connector: true\n});\nvar $$type = 'ais.ratingMenu';\nvar MAX_VALUES_PER_FACET_API_LIMIT = 1000;\nvar STEP = 1;\nvar createSendEvent = function createSendEvent(_ref) {\n  var instantSearchInstance = _ref.instantSearchInstance,\n    helper = _ref.helper,\n    getRefinedStar = _ref.getRefinedStar,\n    attribute = _ref.attribute;\n  return function () {\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    if (args.length === 1) {\n      instantSearchInstance.sendEventToInsights(args[0]);\n      return;\n    }\n    var facetValue = args[1],\n      _args$ = args[2],\n      eventName = _args$ === void 0 ? 'Filter Applied' : _args$;\n    var _args$0$split = args[0].split(':'),\n      _args$0$split2 = _slicedToArray(_args$0$split, 2),\n      eventType = _args$0$split2[0],\n      eventModifier = _args$0$split2[1];\n    if (eventType !== 'click') {\n      return;\n    }\n    var isRefined = getRefinedStar() === Number(facetValue);\n    if (!isRefined) {\n      var _helper$lastResults;\n      instantSearchInstance.sendEventToInsights({\n        insightsMethod: 'clickedFilters',\n        widgetType: $$type,\n        eventType: eventType,\n        eventModifier: eventModifier,\n        payload: {\n          eventName: eventName,\n          index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,\n          filters: [\"\".concat(attribute, \">=\").concat(facetValue)]\n        },\n        attribute: attribute\n      });\n    }\n  };\n};\n/**\n * **StarRating** connector provides the logic to build a custom widget that will let\n * the user refine search results based on ratings.\n *\n * The connector provides to the rendering: `refine()` to select a value and\n * `items` that are the values that can be selected. `refine` should be used\n * with `items.value`.\n */\nvar connectRatingMenu = function connectRatingMenu(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref2 = widgetParams || {},\n      attribute = _ref2.attribute,\n      _ref2$max = _ref2.max,\n      max = _ref2$max === void 0 ? 5 : _ref2$max;\n    var sendEvent;\n    if (!attribute) {\n      throw new Error(withUsage('The `attribute` option is required.'));\n    }\n    var _getRefinedStar = function getRefinedStar(state) {\n      var _values$;\n      var values = state.getNumericRefinements(attribute);\n      if (!((_values$ = values['>=']) !== null && _values$ !== void 0 && _values$.length)) {\n        return undefined;\n      }\n      return values['>='][0];\n    };\n    var getFacetsMaxDecimalPlaces = function getFacetsMaxDecimalPlaces(facetResults) {\n      var maxDecimalPlaces = 0;\n      facetResults.forEach(function (facetResult) {\n        var _facetResult$name$spl = facetResult.name.split('.'),\n          _facetResult$name$spl2 = _slicedToArray(_facetResult$name$spl, 2),\n          _facetResult$name$spl3 = _facetResult$name$spl2[1],\n          decimal = _facetResult$name$spl3 === void 0 ? '' : _facetResult$name$spl3;\n        maxDecimalPlaces = Math.max(maxDecimalPlaces, decimal.length);\n      });\n      return maxDecimalPlaces;\n    };\n    var getFacetValuesWarningMessage = function getFacetValuesWarningMessage(_ref3) {\n      var maxDecimalPlaces = _ref3.maxDecimalPlaces,\n        maxFacets = _ref3.maxFacets,\n        maxValuesPerFacet = _ref3.maxValuesPerFacet;\n      var maxDecimalPlacesInRange = Math.max(0, Math.floor(Math.log10(MAX_VALUES_PER_FACET_API_LIMIT / max)));\n      var maxFacetsInRange = Math.min(MAX_VALUES_PER_FACET_API_LIMIT, Math.pow(10, maxDecimalPlacesInRange) * max);\n      var solutions = [];\n      if (maxFacets > MAX_VALUES_PER_FACET_API_LIMIT) {\n        solutions.push(\"- Update your records to lower the precision of the values in the \\\"\".concat(attribute, \"\\\" attribute (for example: \").concat(5.123456789.toPrecision(maxDecimalPlaces + 1), \" to \").concat(5.123456789.toPrecision(maxDecimalPlacesInRange + 1), \")\"));\n      }\n      if (maxValuesPerFacet < maxFacetsInRange) {\n        solutions.push(\"- Increase the maximum number of facet values to \".concat(maxFacetsInRange, \" using the \\\"configure\\\" widget \").concat((0, _utils.createDocumentationLink)({\n          name: 'configure'\n        }), \" and the \\\"maxValuesPerFacet\\\" parameter https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/\"));\n      }\n      return \"The \".concat(attribute, \" attribute can have \").concat(maxFacets, \" different values (0 to \").concat(max, \" with a maximum of \").concat(maxDecimalPlaces, \" decimals = \").concat(maxFacets, \") but you retrieved only \").concat(maxValuesPerFacet, \" facet values. Therefore the number of results that match the refinements can be incorrect.\\n    \").concat(solutions.length ? \"To resolve this problem you can:\\n\".concat(solutions.join('\\n')) : \"\");\n    };\n    function getRefinedState(state, facetValue) {\n      var isRefined = _getRefinedStar(state) === Number(facetValue);\n      var emptyState = state.resetPage().removeNumericRefinement(attribute);\n      if (!isRefined) {\n        return emptyState.addNumericRefinement(attribute, '<=', max).addNumericRefinement(attribute, '>=', Number(facetValue));\n      }\n      return emptyState;\n    }\n    var toggleRefinement = function toggleRefinement(helper, facetValue) {\n      sendEvent('click:internal', facetValue);\n      helper.setState(getRefinedState(helper.state, facetValue)).search();\n    };\n    var connectorState = {\n      toggleRefinementFactory: function toggleRefinementFactory(helper) {\n        return toggleRefinement.bind(null, helper);\n      },\n      createURLFactory: function createURLFactory(_ref4) {\n        var state = _ref4.state,\n          createURL = _ref4.createURL,\n          getWidgetUiState = _ref4.getWidgetUiState,\n          helper = _ref4.helper;\n        return function (value) {\n          return createURL(function (uiState) {\n            return getWidgetUiState(uiState, {\n              searchParameters: getRefinedState(state, value),\n              helper: helper\n            });\n          });\n        };\n      }\n    };\n    return {\n      $$type: $$type,\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          ratingMenu: _objectSpread(_objectSpread({}, renderState.ratingMenu), {}, _defineProperty({}, attribute, this.getWidgetRenderState(renderOptions)))\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref5) {\n        var helper = _ref5.helper,\n          results = _ref5.results,\n          state = _ref5.state,\n          instantSearchInstance = _ref5.instantSearchInstance,\n          createURL = _ref5.createURL;\n        var facetValues = [];\n        if (!sendEvent) {\n          sendEvent = createSendEvent({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            getRefinedStar: function getRefinedStar() {\n              return _getRefinedStar(helper.state);\n            },\n            attribute: attribute\n          });\n        }\n        var refinementIsApplied = false;\n        var totalCount = 0;\n        var facetResults = results === null || results === void 0 ? void 0 : results.getFacetValues(attribute, {});\n        if (results && facetResults) {\n          var maxValuesPerFacet = facetResults.length;\n          var maxDecimalPlaces = getFacetsMaxDecimalPlaces(facetResults);\n          var maxFacets = Math.pow(10, maxDecimalPlaces) * max;\n          process.env.NODE_ENV === 'development' ? (0, _utils.warning)(maxFacets <= maxValuesPerFacet || Boolean(results.__isArtificial), getFacetValuesWarningMessage({\n            maxDecimalPlaces: maxDecimalPlaces,\n            maxFacets: maxFacets,\n            maxValuesPerFacet: maxValuesPerFacet\n          })) : void 0;\n          var refinedStar = _getRefinedStar(state);\n          var _loop = function _loop(star) {\n            var isRefined = refinedStar === star;\n            refinementIsApplied = refinementIsApplied || isRefined;\n            var count = facetResults.filter(function (f) {\n              return Number(f.name) >= star && Number(f.name) <= max;\n            }).map(function (f) {\n              return f.count;\n            }).reduce(function (sum, current) {\n              return sum + current;\n            }, 0);\n            totalCount += count;\n            if (refinedStar && !isRefined && count === 0) {\n              // skip count==0 when at least 1 refinement is enabled\n              // eslint-disable-next-line no-continue\n              return \"continue\";\n            }\n            var stars = _toConsumableArray(new Array(Math.floor(max / STEP))).map(function (_v, i) {\n              return i * STEP < star;\n            });\n            facetValues.push({\n              stars: stars,\n              name: String(star),\n              label: String(star),\n              value: String(star),\n              count: count,\n              isRefined: isRefined\n            });\n          };\n          for (var star = STEP; star < max; star += STEP) {\n            var _ret = _loop(star);\n            if (_ret === \"continue\") continue;\n          }\n        }\n        facetValues = facetValues.reverse();\n        var hasNoResults = results ? results.nbHits === 0 : true;\n        return {\n          items: facetValues,\n          hasNoResults: hasNoResults,\n          canRefine: (!hasNoResults || refinementIsApplied) && totalCount > 0,\n          refine: connectorState.toggleRefinementFactory(helper),\n          sendEvent: sendEvent,\n          createURL: connectorState.createURLFactory({\n            state: state,\n            createURL: createURL,\n            helper: helper,\n            getWidgetUiState: this.getWidgetUiState\n          }),\n          widgetParams: widgetParams\n        };\n      },\n      dispose: function dispose(_ref6) {\n        var state = _ref6.state;\n        unmountFn();\n        return state.removeNumericRefinement(attribute);\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref7) {\n        var searchParameters = _ref7.searchParameters;\n        var value = _getRefinedStar(searchParameters);\n        return removeEmptyRefinementsFromUiState(_objectSpread(_objectSpread({}, uiState), {}, {\n          ratingMenu: _objectSpread(_objectSpread({}, uiState.ratingMenu), {}, _defineProperty({}, attribute, typeof value === 'number' ? value : undefined))\n        }), attribute);\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref8) {\n        var uiState = _ref8.uiState;\n        var value = uiState.ratingMenu && uiState.ratingMenu[attribute];\n        var withDisjunctiveFacet = searchParameters.addDisjunctiveFacet(attribute).removeNumericRefinement(attribute).removeDisjunctiveFacetRefinement(attribute);\n        if (!value) {\n          return withDisjunctiveFacet.setQueryParameters({\n            numericRefinements: _objectSpread(_objectSpread({}, withDisjunctiveFacet.numericRefinements), {}, _defineProperty({}, attribute, {}))\n          });\n        }\n        return withDisjunctiveFacet.addNumericRefinement(attribute, '<=', max).addNumericRefinement(attribute, '>=', value);\n      }\n    };\n  };\n};\nfunction removeEmptyRefinementsFromUiState(indexUiState, attribute) {\n  if (!indexUiState.ratingMenu) {\n    return indexUiState;\n  }\n  if (typeof indexUiState.ratingMenu[attribute] !== 'number') {\n    delete indexUiState.ratingMenu[attribute];\n  }\n  if (Object.keys(indexUiState.ratingMenu).length === 0) {\n    delete indexUiState.ratingMenu;\n  }\n  return indexUiState;\n}\nvar _default = exports.default = connectRatingMenu;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/refinement-list/connectRefinementList.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nvar _excluded = [\"name\", \"escapedValue\"],\n  _excluded2 = [\"escapedValue\", \"value\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'refinement-list',\n  connector: true\n});\nvar DEFAULT_SORT = ['isRefined', 'count:desc', 'name:asc'];\n/**\n * **RefinementList** connector provides the logic to build a custom widget that\n * will let the user filter the results based on the values of a specific facet.\n *\n * **Requirement:** the attribute passed as `attribute` must be present in\n * attributesForFaceting of the searched index.\n *\n * This connector provides:\n * - a `refine()` function to select an item.\n * - a `toggleShowMore()` function to display more or less items\n * - a `searchForItems()` function to search within the items.\n */\nvar connectRefinementList = function connectRefinementList(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      attribute = _ref.attribute,\n      _ref$operator = _ref.operator,\n      operator = _ref$operator === void 0 ? 'or' : _ref$operator,\n      _ref$limit = _ref.limit,\n      limit = _ref$limit === void 0 ? 10 : _ref$limit,\n      _ref$showMore = _ref.showMore,\n      showMore = _ref$showMore === void 0 ? false : _ref$showMore,\n      _ref$showMoreLimit = _ref.showMoreLimit,\n      showMoreLimit = _ref$showMoreLimit === void 0 ? 20 : _ref$showMoreLimit,\n      _ref$sortBy = _ref.sortBy,\n      sortBy = _ref$sortBy === void 0 ? DEFAULT_SORT : _ref$sortBy,\n      _ref$escapeFacetValue = _ref.escapeFacetValues,\n      escapeFacetValues = _ref$escapeFacetValue === void 0 ? true : _ref$escapeFacetValue,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    if (!attribute) {\n      throw new Error(withUsage('The `attribute` option is required.'));\n    }\n    if (!/^(and|or)$/.test(operator)) {\n      throw new Error(withUsage(\"The `operator` must one of: `\\\"and\\\"`, `\\\"or\\\"` (got \\\"\".concat(operator, \"\\\").\")));\n    }\n    if (showMore === true && showMoreLimit <= limit) {\n      throw new Error(withUsage('`showMoreLimit` should be greater than `limit`.'));\n    }\n    var formatItems = function formatItems(_ref2) {\n      var label = _ref2.name,\n        value = _ref2.escapedValue,\n        item = _objectWithoutProperties(_ref2, _excluded);\n      return _objectSpread(_objectSpread({}, item), {}, {\n        value: value,\n        label: label,\n        highlighted: label\n      });\n    };\n    var lastResultsFromMainSearch;\n    var lastItemsFromMainSearch = [];\n    var hasExhaustiveItems = true;\n    var triggerRefine;\n    var sendEvent;\n    var isShowingMore = false;\n    // Provide the same function to the `renderFn` so that way the user\n    // has to only bind it once when `isFirstRendering` for instance\n    var toggleShowMore = function toggleShowMore() {};\n    function cachedToggleShowMore() {\n      toggleShowMore();\n    }\n    function createToggleShowMore(renderOptions, widget) {\n      return function () {\n        isShowingMore = !isShowingMore;\n        widget.render(renderOptions);\n      };\n    }\n    function getLimit() {\n      return isShowingMore ? showMoreLimit : limit;\n    }\n    var searchForFacetValues = function searchForFacetValues() {\n      return function () {};\n    };\n    var createSearchForFacetValues = function createSearchForFacetValues(helper, widget) {\n      return function (renderOptions) {\n        return function (query) {\n          var instantSearchInstance = renderOptions.instantSearchInstance,\n            searchResults = renderOptions.results;\n          if (query === '' && lastItemsFromMainSearch) {\n            // render with previous data from the helper.\n            renderFn(_objectSpread(_objectSpread({}, widget.getWidgetRenderState(_objectSpread(_objectSpread({}, renderOptions), {}, {\n              results: lastResultsFromMainSearch\n            }))), {}, {\n              instantSearchInstance: instantSearchInstance\n            }), false);\n          } else {\n            var tags = {\n              highlightPreTag: escapeFacetValues ? _utils.TAG_PLACEHOLDER.highlightPreTag : _utils.TAG_REPLACEMENT.highlightPreTag,\n              highlightPostTag: escapeFacetValues ? _utils.TAG_PLACEHOLDER.highlightPostTag : _utils.TAG_REPLACEMENT.highlightPostTag\n            };\n            helper.searchForFacetValues(attribute, query,\n            // We cap the `maxFacetHits` value to 100 because the Algolia API\n            // doesn't support a greater number.\n            // See https://www.algolia.com/doc/api-reference/api-parameters/maxFacetHits/\n            Math.min(getLimit(), 100), tags).then(function (results) {\n              var facetValues = escapeFacetValues ? (0, _utils.escapeFacets)(results.facetHits) : results.facetHits;\n              var normalizedFacetValues = transformItems(facetValues.map(function (_ref3) {\n                var escapedValue = _ref3.escapedValue,\n                  value = _ref3.value,\n                  item = _objectWithoutProperties(_ref3, _excluded2);\n                return _objectSpread(_objectSpread({}, item), {}, {\n                  value: escapedValue,\n                  label: value\n                });\n              }), {\n                results: searchResults\n              });\n              renderFn(_objectSpread(_objectSpread({}, widget.getWidgetRenderState(_objectSpread(_objectSpread({}, renderOptions), {}, {\n                results: lastResultsFromMainSearch\n              }))), {}, {\n                items: normalizedFacetValues,\n                canToggleShowMore: false,\n                canRefine: true,\n                isFromSearch: true,\n                instantSearchInstance: instantSearchInstance\n              }), false);\n            });\n          }\n        };\n      };\n    };\n    return {\n      $$type: 'ais.refinementList',\n      init: function init(initOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: renderOptions.instantSearchInstance\n        }), false);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          refinementList: _objectSpread(_objectSpread({}, renderState.refinementList), {}, _defineProperty({}, attribute, this.getWidgetRenderState(renderOptions)))\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(renderOptions) {\n        var _this = this;\n        var results = renderOptions.results,\n          state = renderOptions.state,\n          _createURL = renderOptions.createURL,\n          instantSearchInstance = renderOptions.instantSearchInstance,\n          helper = renderOptions.helper;\n        var items = [];\n        var facetValues = [];\n        if (!sendEvent || !triggerRefine || !searchForFacetValues) {\n          sendEvent = (0, _utils.createSendEventForFacet)({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            attribute: attribute,\n            widgetType: this.$$type\n          });\n          triggerRefine = function triggerRefine(facetValue) {\n            sendEvent('click:internal', facetValue);\n            helper.toggleFacetRefinement(attribute, facetValue).search();\n          };\n          searchForFacetValues = createSearchForFacetValues(helper, this);\n        }\n        if (results) {\n          var values = results.getFacetValues(attribute, {\n            sortBy: sortBy,\n            facetOrdering: sortBy === DEFAULT_SORT\n          });\n          facetValues = values && Array.isArray(values) ? values : [];\n          items = transformItems(facetValues.slice(0, getLimit()).map(formatItems), {\n            results: results\n          });\n          var maxValuesPerFacetConfig = state.maxValuesPerFacet;\n          var currentLimit = getLimit();\n          // If the limit is the max number of facet retrieved it is impossible to know\n          // if the facets are exhaustive. The only moment we are sure it is exhaustive\n          // is when it is strictly under the number requested unless we know that another\n          // widget has requested more values (maxValuesPerFacet > getLimit()).\n          // Because this is used for making the search of facets unable or not, it is important\n          // to be conservative here.\n          hasExhaustiveItems = maxValuesPerFacetConfig > currentLimit ? facetValues.length <= currentLimit : facetValues.length < currentLimit;\n          lastResultsFromMainSearch = results;\n          lastItemsFromMainSearch = items;\n          if (renderOptions.results) {\n            toggleShowMore = createToggleShowMore(renderOptions, this);\n          }\n        }\n\n        // Do not mistake searchForFacetValues and searchFacetValues which is the actual search\n        // function\n        var searchFacetValues = searchForFacetValues && searchForFacetValues(renderOptions);\n        var canShowLess = isShowingMore && lastItemsFromMainSearch.length > limit;\n        var canShowMore = showMore && !hasExhaustiveItems;\n        var canToggleShowMore = canShowLess || canShowMore;\n        return {\n          createURL: function createURL(facetValue) {\n            return _createURL(function (uiState) {\n              return _this.getWidgetUiState(uiState, {\n                searchParameters: state.resetPage().toggleFacetRefinement(attribute, facetValue),\n                helper: helper\n              });\n            });\n          },\n          items: items,\n          refine: triggerRefine,\n          searchForItems: searchFacetValues,\n          isFromSearch: false,\n          canRefine: items.length > 0,\n          widgetParams: widgetParams,\n          isShowingMore: isShowingMore,\n          canToggleShowMore: canToggleShowMore,\n          toggleShowMore: cachedToggleShowMore,\n          sendEvent: sendEvent,\n          hasExhaustiveItems: hasExhaustiveItems\n        };\n      },\n      dispose: function dispose(_ref4) {\n        var state = _ref4.state;\n        unmountFn();\n        var withoutMaxValuesPerFacet = state.setQueryParameter('maxValuesPerFacet', undefined);\n        if (operator === 'and') {\n          return withoutMaxValuesPerFacet.removeFacet(attribute);\n        }\n        return withoutMaxValuesPerFacet.removeDisjunctiveFacet(attribute);\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref5) {\n        var searchParameters = _ref5.searchParameters;\n        var values = operator === 'or' ? searchParameters.getDisjunctiveRefinements(attribute) : searchParameters.getConjunctiveRefinements(attribute);\n        return removeEmptyRefinementsFromUiState(_objectSpread(_objectSpread({}, uiState), {}, {\n          refinementList: _objectSpread(_objectSpread({}, uiState.refinementList), {}, _defineProperty({}, attribute, values))\n        }), attribute);\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref6) {\n        var uiState = _ref6.uiState;\n        var isDisjunctive = operator === 'or';\n        if (searchParameters.isHierarchicalFacet(attribute)) {\n          process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, \"RefinementList: Attribute \\\"\".concat(attribute, \"\\\" is already used by another widget applying hierarchical faceting.\\nAs this is not supported, please make sure to remove this other widget or this RefinementList widget will not work at all.\")) : void 0;\n          return searchParameters;\n        }\n        if (isDisjunctive && searchParameters.isConjunctiveFacet(attribute) || !isDisjunctive && searchParameters.isDisjunctiveFacet(attribute)) {\n          process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, \"RefinementList: Attribute \\\"\".concat(attribute, \"\\\" is used by another refinement list with a different operator.\\nAs this is not supported, please make sure to only use this attribute with one of the two operators.\")) : void 0;\n          return searchParameters;\n        }\n        var values = uiState.refinementList && uiState.refinementList[attribute];\n        var withFacetConfiguration = isDisjunctive ? searchParameters.addDisjunctiveFacet(attribute).removeDisjunctiveFacetRefinement(attribute) : searchParameters.addFacet(attribute).removeFacetRefinement(attribute);\n        var currentMaxValuesPerFacet = withFacetConfiguration.maxValuesPerFacet || 0;\n        var nextMaxValuesPerFacet = Math.max(currentMaxValuesPerFacet, showMore ? showMoreLimit : limit);\n        var withMaxValuesPerFacet = withFacetConfiguration.setQueryParameter('maxValuesPerFacet', nextMaxValuesPerFacet);\n        if (!values) {\n          var key = isDisjunctive ? 'disjunctiveFacetsRefinements' : 'facetsRefinements';\n          return withMaxValuesPerFacet.setQueryParameters(_defineProperty({}, key, _objectSpread(_objectSpread({}, withMaxValuesPerFacet[key]), {}, _defineProperty({}, attribute, []))));\n        }\n        return values.reduce(function (parameters, value) {\n          return isDisjunctive ? parameters.addDisjunctiveFacetRefinement(attribute, value) : parameters.addFacetRefinement(attribute, value);\n        }, withMaxValuesPerFacet);\n      }\n    };\n  };\n};\nfunction removeEmptyRefinementsFromUiState(indexUiState, attribute) {\n  if (!indexUiState.refinementList) {\n    return indexUiState;\n  }\n  if (!indexUiState.refinementList[attribute] || indexUiState.refinementList[attribute].length === 0) {\n    delete indexUiState.refinementList[attribute];\n  }\n  if (Object.keys(indexUiState.refinementList).length === 0) {\n    delete indexUiState.refinementList;\n  }\n  return indexUiState;\n}\nvar _default = exports.default = connectRefinementList;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/related-products/connectRelatedProducts.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'related-products',\n  connector: true\n});\nvar connectRelatedProducts = exports.default = function connectRelatedProducts(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      _ref$escapeHTML = _ref.escapeHTML,\n      escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,\n      objectIDs = _ref.objectIDs,\n      limit = _ref.limit,\n      threshold = _ref.threshold,\n      fallbackParameters = _ref.fallbackParameters,\n      queryParameters = _ref.queryParameters,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    if (!objectIDs || objectIDs.length === 0) {\n      throw new Error(withUsage('The `objectIDs` option is required.'));\n    }\n    var sendEvent;\n    return {\n      dependsOn: 'recommend',\n      $$type: 'ais.relatedProducts',\n      init: function init(initOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var renderState = this.getWidgetRenderState(renderOptions);\n        renderFn(_objectSpread(_objectSpread({}, renderState), {}, {\n          instantSearchInstance: renderOptions.instantSearchInstance\n        }), false);\n      },\n      getRenderState: function getRenderState(renderState) {\n        return renderState;\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref2) {\n        var results = _ref2.results,\n          helper = _ref2.helper,\n          instantSearchInstance = _ref2.instantSearchInstance;\n        if (!sendEvent) {\n          sendEvent = (0, _utils.createSendEventForHits)({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            widgetType: this.$$type\n          });\n        }\n        if (results === null || results === undefined) {\n          return {\n            items: [],\n            widgetParams: widgetParams,\n            sendEvent: sendEvent\n          };\n        }\n        if (escapeHTML && results.hits.length > 0) {\n          results.hits = (0, _utils.escapeHits)(results.hits);\n        }\n        var itemsWithAbsolutePosition = (0, _utils.addAbsolutePosition)(results.hits, 0, 1);\n        var itemsWithAbsolutePositionAndQueryID = (0, _utils.addQueryID)(itemsWithAbsolutePosition, results.queryID);\n        var transformedItems = transformItems(itemsWithAbsolutePositionAndQueryID, {\n          results: results\n        });\n        return {\n          items: transformedItems,\n          widgetParams: widgetParams,\n          sendEvent: sendEvent\n        };\n      },\n      dispose: function dispose(_ref3) {\n        var recommendState = _ref3.recommendState;\n        unmountFn();\n        return recommendState.removeParams(this.$$id);\n      },\n      getWidgetParameters: function getWidgetParameters(state) {\n        var _this = this;\n        return objectIDs.reduce(function (acc, objectID) {\n          return acc.addRelatedProducts({\n            objectID: objectID,\n            maxRecommendations: limit,\n            threshold: threshold,\n            fallbackParameters: _objectSpread(_objectSpread({}, fallbackParameters), escapeHTML ? _utils.TAG_PLACEHOLDER : {}),\n            queryParameters: _objectSpread(_objectSpread({}, queryParameters), escapeHTML ? _utils.TAG_PLACEHOLDER : {}),\n            $$id: _this.$$id\n          });\n        }, state.removeParams(this.$$id));\n      }\n    };\n  };\n};"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/relevant-sort/connectRelevantSort.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar connectRelevantSort = function connectRelevantSort() {\n  var renderFn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _utils.noop;\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  return function (widgetParams) {\n    var connectorState = {};\n    return {\n      $$type: 'ais.relevantSort',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref) {\n        var state = _ref.state;\n        unmountFn();\n        return state.setQueryParameter('relevancyStrictness', undefined);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          relevantSort: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref2) {\n        var results = _ref2.results,\n          helper = _ref2.helper;\n        if (!connectorState.refine) {\n          connectorState.refine = function (relevancyStrictness) {\n            helper.setQueryParameter('relevancyStrictness', relevancyStrictness).search();\n          };\n        }\n        var _ref3 = results || {},\n          appliedRelevancyStrictness = _ref3.appliedRelevancyStrictness;\n        var isVirtualReplica = appliedRelevancyStrictness !== undefined;\n        return {\n          isRelevantSorted: typeof appliedRelevancyStrictness !== 'undefined' && appliedRelevancyStrictness > 0,\n          isVirtualReplica: isVirtualReplica,\n          canRefine: isVirtualReplica,\n          refine: connectorState.refine,\n          widgetParams: widgetParams\n        };\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(state, _ref4) {\n        var _uiState$relevantSort;\n        var uiState = _ref4.uiState;\n        return state.setQueryParameter('relevancyStrictness', (_uiState$relevantSort = uiState.relevantSort) !== null && _uiState$relevantSort !== void 0 ? _uiState$relevantSort : state.relevancyStrictness);\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref5) {\n        var searchParameters = _ref5.searchParameters;\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          relevantSort: searchParameters.relevancyStrictness || uiState.relevantSort\n        });\n      }\n    };\n  };\n};\nvar _default = exports.default = connectRelevantSort;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/search-box/connectSearchBox.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'search-box',\n  connector: true\n});\n\n/**\n * @typedef {Object} CustomSearchBoxWidgetParams\n * @property {function(string, function(string))} [queryHook = undefined] A function that will be called every time\n * a new value for the query is set. The first parameter is the query and the second is a\n * function to actually trigger the search. The function takes the query as the parameter.\n *\n * This queryHook can be used to debounce the number of searches done from the searchBox.\n */\n\nvar defaultQueryHook = function defaultQueryHook(query, hook) {\n  return hook(query);\n};\n\n/**\n * **SearchBox** connector provides the logic to build a widget that will let the user search for a query.\n *\n * The connector provides to the rendering: `refine()` to set the query. The behaviour of this function\n * may be impacted by the `queryHook` widget parameter.\n */\nvar connectSearchBox = function connectSearchBox(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      _ref$queryHook = _ref.queryHook,\n      queryHook = _ref$queryHook === void 0 ? defaultQueryHook : _ref$queryHook;\n    var _refine;\n    var _clear;\n    return {\n      $$type: 'ais.searchBox',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref2) {\n        var state = _ref2.state;\n        unmountFn();\n        return state.setQueryParameter('query', undefined);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          searchBox: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref3) {\n        var helper = _ref3.helper,\n          instantSearchInstance = _ref3.instantSearchInstance,\n          state = _ref3.state;\n        if (!_refine) {\n          _refine = function _refine(query) {\n            queryHook(query, function (q) {\n              return helper.setQuery(q).search();\n            });\n          };\n          _clear = function _clear() {\n            helper.setQuery('').search();\n          };\n        }\n        return {\n          query: state.query || '',\n          refine: _refine,\n          clear: _clear,\n          widgetParams: widgetParams,\n          isSearchStalled: instantSearchInstance.status === 'stalled'\n        };\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref4) {\n        var searchParameters = _ref4.searchParameters;\n        var query = searchParameters.query || '';\n        if (query === '' || uiState && uiState.query === query) {\n          return uiState;\n        }\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          query: query\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref5) {\n        var uiState = _ref5.uiState;\n        return searchParameters.setQueryParameter('query', uiState.query || '');\n      }\n    };\n  };\n};\nvar _default = exports.default = connectSearchBox;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/sort-by/connectSortBy.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'sort-by',\n  connector: true\n});\n\n/**\n * The **SortBy** connector provides the logic to build a custom widget that will display a\n * list of indices. With Algolia, this is most commonly used for changing ranking strategy. This allows\n * a user to change how the hits are being sorted.\n */\n\nvar connectSortBy = function connectSortBy(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  var connectorState = {};\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      items = _ref.items,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (x) {\n        return x;\n      } : _ref$transformItems;\n    if (!Array.isArray(items)) {\n      throw new Error(withUsage('The `items` option expects an array of objects.'));\n    }\n    return {\n      $$type: 'ais.sortBy',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        var widgetRenderState = this.getWidgetRenderState(initOptions);\n        var currentIndex = widgetRenderState.currentRefinement;\n        var isCurrentIndexInItems = (0, _utils.find)(items, function (item) {\n          return item.value === currentIndex;\n        });\n        process.env.NODE_ENV === 'development' ? (0, _utils.warning)(isCurrentIndexInItems !== undefined, \"The index named \\\"\".concat(currentIndex, \"\\\" is not listed in the `items` of `sortBy`.\")) : void 0;\n        renderFn(_objectSpread(_objectSpread({}, widgetRenderState), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref2) {\n        var state = _ref2.state;\n        unmountFn();\n        return connectorState.initialIndex ? state.setIndex(connectorState.initialIndex) : state;\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          sortBy: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref3) {\n        var results = _ref3.results,\n          helper = _ref3.helper,\n          state = _ref3.state,\n          parent = _ref3.parent;\n        if (!connectorState.initialIndex && parent) {\n          connectorState.initialIndex = parent.getIndexName();\n        }\n        if (!connectorState.setIndex) {\n          connectorState.setIndex = function (indexName) {\n            helper.setIndex(indexName).search();\n          };\n        }\n        var hasNoResults = results ? results.nbHits === 0 : true;\n        return {\n          currentRefinement: state.index,\n          options: transformItems(items, {\n            results: results\n          }),\n          refine: connectorState.setIndex,\n          hasNoResults: hasNoResults,\n          canRefine: !hasNoResults && items.length > 0,\n          widgetParams: widgetParams\n        };\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref4) {\n        var searchParameters = _ref4.searchParameters;\n        var currentIndex = searchParameters.index;\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          sortBy: currentIndex !== connectorState.initialIndex ? currentIndex : undefined\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref5) {\n        var uiState = _ref5.uiState;\n        return searchParameters.setQueryParameter('index', uiState.sortBy || connectorState.initialIndex || searchParameters.index);\n      }\n    };\n  };\n};\nvar _default = exports.default = connectSortBy;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/stats/connectStats.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'stats',\n  connector: true\n});\n\n/**\n * **Stats** connector provides the logic to build a custom widget that will displays\n * search statistics (hits number and processing time).\n */\n\nvar connectStats = function connectStats(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    return {\n      $$type: 'ais.stats',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose() {\n        unmountFn();\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          stats: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref) {\n        var results = _ref.results,\n          state = _ref.state;\n        if (!results) {\n          return {\n            hitsPerPage: state.hitsPerPage,\n            nbHits: 0,\n            nbSortedHits: undefined,\n            areHitsSorted: false,\n            nbPages: 0,\n            page: state.page || 0,\n            processingTimeMS: -1,\n            query: state.query || '',\n            widgetParams: widgetParams\n          };\n        }\n        return {\n          hitsPerPage: results.hitsPerPage,\n          nbHits: results.nbHits,\n          nbSortedHits: results.nbSortedHits,\n          areHitsSorted: typeof results.appliedRelevancyStrictness !== 'undefined' && results.appliedRelevancyStrictness > 0 && results.nbSortedHits !== results.nbHits,\n          nbPages: results.nbPages,\n          page: results.page,\n          processingTimeMS: results.processingTimeMS,\n          query: results.query,\n          widgetParams: widgetParams\n        };\n      }\n    };\n  };\n};\nvar _default = exports.default = connectStats;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/toggle-refinement/connectToggleRefinement.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'toggle-refinement',\n  connector: true\n});\nvar $$type = 'ais.toggleRefinement';\nvar createSendEvent = function createSendEvent(_ref) {\n  var instantSearchInstance = _ref.instantSearchInstance,\n    helper = _ref.helper,\n    attribute = _ref.attribute,\n    on = _ref.on;\n  var sendEventForToggle = function sendEventForToggle() {\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    if (args.length === 1) {\n      instantSearchInstance.sendEventToInsights(args[0]);\n      return;\n    }\n    var isRefined = args[1],\n      _args$ = args[2],\n      eventName = _args$ === void 0 ? 'Filter Applied' : _args$;\n    var _args$0$split = args[0].split(':'),\n      _args$0$split2 = _slicedToArray(_args$0$split, 2),\n      eventType = _args$0$split2[0],\n      eventModifier = _args$0$split2[1];\n    if (eventType !== 'click' || on === undefined) {\n      return;\n    }\n\n    // only send an event when the refinement gets applied,\n    // not when it gets removed\n    if (!isRefined) {\n      var _helper$lastResults;\n      instantSearchInstance.sendEventToInsights({\n        insightsMethod: 'clickedFilters',\n        widgetType: $$type,\n        eventType: eventType,\n        eventModifier: eventModifier,\n        payload: {\n          eventName: eventName,\n          index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,\n          filters: on.map(function (value) {\n            return \"\".concat(attribute, \":\").concat(value);\n          })\n        },\n        attribute: attribute\n      });\n    }\n  };\n  return sendEventForToggle;\n};\n/**\n * **Toggle** connector provides the logic to build a custom widget that will provide\n * an on/off filtering feature based on an attribute value or values.\n *\n * Two modes are implemented in the custom widget:\n *  - with or without the value filtered\n *  - switch between two values.\n */\nvar connectToggleRefinement = function connectToggleRefinement(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref2 = widgetParams || {},\n      attribute = _ref2.attribute,\n      _ref2$on = _ref2.on,\n      userOn = _ref2$on === void 0 ? true : _ref2$on,\n      userOff = _ref2.off;\n    if (!attribute) {\n      throw new Error(withUsage('The `attribute` option is required.'));\n    }\n    var hasAnOffValue = userOff !== undefined;\n    // even though facet values can be numbers and boolean,\n    // the helper methods only accept string in the type\n    var on = (0, _utils.toArray)(userOn).map(_utils.escapeFacetValue);\n    var off = hasAnOffValue ? (0, _utils.toArray)(userOff).map(_utils.escapeFacetValue) : undefined;\n    var sendEvent;\n    var toggleRefinementFactory = function toggleRefinementFactory(helper) {\n      return function () {\n        var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n            isRefined: false\n          },\n          isRefined = _ref3.isRefined;\n        if (!isRefined) {\n          sendEvent('click:internal', isRefined);\n          if (hasAnOffValue) {\n            off.forEach(function (v) {\n              return helper.removeDisjunctiveFacetRefinement(attribute, v);\n            });\n          }\n          on.forEach(function (v) {\n            return helper.addDisjunctiveFacetRefinement(attribute, v);\n          });\n        } else {\n          on.forEach(function (v) {\n            return helper.removeDisjunctiveFacetRefinement(attribute, v);\n          });\n          if (hasAnOffValue) {\n            off.forEach(function (v) {\n              return helper.addDisjunctiveFacetRefinement(attribute, v);\n            });\n          }\n        }\n        helper.search();\n      };\n    };\n    var connectorState = {\n      createURLFactory: function createURLFactory(isRefined, _ref4) {\n        var state = _ref4.state,\n          createURL = _ref4.createURL,\n          getWidgetUiState = _ref4.getWidgetUiState,\n          helper = _ref4.helper;\n        return function () {\n          state = state.resetPage();\n          var valuesToRemove = isRefined ? on : off;\n          if (valuesToRemove) {\n            valuesToRemove.forEach(function (v) {\n              state = state.removeDisjunctiveFacetRefinement(attribute, v);\n            });\n          }\n          var valuesToAdd = isRefined ? off : on;\n          if (valuesToAdd) {\n            valuesToAdd.forEach(function (v) {\n              state = state.addDisjunctiveFacetRefinement(attribute, v);\n            });\n          }\n          return createURL(function (uiState) {\n            return getWidgetUiState(uiState, {\n              searchParameters: state,\n              helper: helper\n            });\n          });\n        };\n      }\n    };\n    return {\n      $$type: $$type,\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref5) {\n        var state = _ref5.state;\n        unmountFn();\n        return state.removeDisjunctiveFacet(attribute);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          toggleRefinement: _objectSpread(_objectSpread({}, renderState.toggleRefinement), {}, _defineProperty({}, attribute, this.getWidgetRenderState(renderOptions)))\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref6) {\n        var state = _ref6.state,\n          helper = _ref6.helper,\n          results = _ref6.results,\n          createURL = _ref6.createURL,\n          instantSearchInstance = _ref6.instantSearchInstance;\n        var isRefined = results ? on.every(function (v) {\n          return state.isDisjunctiveFacetRefined(attribute, v);\n        }) : on.every(function (v) {\n          return state.isDisjunctiveFacetRefined(attribute, v);\n        });\n        var onFacetValue = {\n          isRefined: isRefined,\n          count: 0\n        };\n        var offFacetValue = {\n          isRefined: hasAnOffValue && !isRefined,\n          count: 0\n        };\n        if (results) {\n          var offValue = (0, _utils.toArray)(off || false);\n          var allFacetValues = results.getFacetValues(attribute, {}) || [];\n          var onData = on.map(function (v) {\n            return (0, _utils.find)(allFacetValues, function (_ref7) {\n              var escapedValue = _ref7.escapedValue;\n              return escapedValue === (0, _utils.escapeFacetValue)(String(v));\n            });\n          }).filter(function (v) {\n            return v !== undefined;\n          });\n          var offData = hasAnOffValue ? offValue.map(function (v) {\n            return (0, _utils.find)(allFacetValues, function (_ref8) {\n              var escapedValue = _ref8.escapedValue;\n              return escapedValue === (0, _utils.escapeFacetValue)(String(v));\n            });\n          }).filter(function (v) {\n            return v !== undefined;\n          }) : [];\n          onFacetValue = {\n            isRefined: onData.length ? onData.every(function (v) {\n              return v.isRefined;\n            }) : false,\n            count: onData.reduce(function (acc, v) {\n              return acc + v.count;\n            }, 0) || null\n          };\n          offFacetValue = {\n            isRefined: offData.length ? offData.every(function (v) {\n              return v.isRefined;\n            }) : false,\n            count: offData.reduce(function (acc, v) {\n              return acc + v.count;\n            }, 0) || allFacetValues.reduce(function (total, _ref9) {\n              var count = _ref9.count;\n              return total + count;\n            }, 0)\n          };\n        }\n        if (!sendEvent) {\n          sendEvent = createSendEvent({\n            instantSearchInstance: instantSearchInstance,\n            attribute: attribute,\n            on: on,\n            helper: helper\n          });\n        }\n        var nextRefinement = isRefined ? offFacetValue : onFacetValue;\n        return {\n          value: {\n            name: attribute,\n            isRefined: isRefined,\n            count: results ? nextRefinement.count : null,\n            onFacetValue: onFacetValue,\n            offFacetValue: offFacetValue\n          },\n          createURL: connectorState.createURLFactory(isRefined, {\n            state: state,\n            createURL: createURL,\n            helper: helper,\n            getWidgetUiState: this.getWidgetUiState\n          }),\n          sendEvent: sendEvent,\n          canRefine: Boolean(results ? nextRefinement.count : null),\n          refine: toggleRefinementFactory(helper),\n          widgetParams: widgetParams\n        };\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref10) {\n        var searchParameters = _ref10.searchParameters;\n        var isRefined = on && on.every(function (v) {\n          return searchParameters.isDisjunctiveFacetRefined(attribute, v);\n        });\n        if (!isRefined) {\n          var _uiState$toggle;\n          // This needs to be done in the case `uiState` comes from `createURL`\n          (_uiState$toggle = uiState.toggle) === null || _uiState$toggle === void 0 ? true : delete _uiState$toggle[attribute];\n          return uiState;\n        }\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          toggle: _objectSpread(_objectSpread({}, uiState.toggle), {}, _defineProperty({}, attribute, isRefined))\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref11) {\n        var uiState = _ref11.uiState;\n        if (searchParameters.isHierarchicalFacet(attribute) || searchParameters.isConjunctiveFacet(attribute)) {\n          process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, \"ToggleRefinement: Attribute \\\"\".concat(attribute, \"\\\" is already used by another widget of a different type.\\nAs this is not supported, please make sure to remove this other widget or this ToggleRefinement widget will not work at all.\")) : void 0;\n          return searchParameters;\n        }\n        var withFacetConfiguration = searchParameters.addDisjunctiveFacet(attribute).removeDisjunctiveFacetRefinement(attribute);\n        var isRefined = Boolean(uiState.toggle && uiState.toggle[attribute]);\n        if (isRefined) {\n          if (on) {\n            on.forEach(function (v) {\n              withFacetConfiguration = withFacetConfiguration.addDisjunctiveFacetRefinement(attribute, v);\n            });\n          }\n          return withFacetConfiguration;\n        }\n\n        // It's not refined with an `off` value\n        if (hasAnOffValue) {\n          if (off) {\n            off.forEach(function (v) {\n              withFacetConfiguration = withFacetConfiguration.addDisjunctiveFacetRefinement(attribute, v);\n            });\n          }\n          return withFacetConfiguration;\n        }\n\n        // It's not refined without an `off` value\n        return withFacetConfiguration.setQueryParameters({\n          disjunctiveFacetsRefinements: _objectSpread(_objectSpread({}, searchParameters.disjunctiveFacetsRefinements), {}, _defineProperty({}, attribute, []))\n        });\n      }\n    };\n  };\n};\nvar _default = exports.default = connectToggleRefinement;"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/toggle-refinement/types.js",
    "content": "\"use strict\";"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/trending-items/connectTrendingItems.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'trending-items',\n  connector: true\n});\nvar connectTrendingItems = exports.default = function connectTrendingItems(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      facetName = _ref.facetName,\n      facetValue = _ref.facetValue,\n      limit = _ref.limit,\n      threshold = _ref.threshold,\n      fallbackParameters = _ref.fallbackParameters,\n      queryParameters = _ref.queryParameters,\n      _ref$escapeHTML = _ref.escapeHTML,\n      escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    if (facetName && !facetValue || !facetName && facetValue) {\n      throw new Error(withUsage(\"When you provide facetName (received type \".concat((0, _utils.getObjectType)(facetName), \"), you must also provide facetValue (received type \").concat((0, _utils.getObjectType)(facetValue), \").\")));\n    }\n    var sendEvent;\n    return {\n      dependsOn: 'recommend',\n      $$type: 'ais.trendingItems',\n      init: function init(initOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var renderState = this.getWidgetRenderState(renderOptions);\n        renderFn(_objectSpread(_objectSpread({}, renderState), {}, {\n          instantSearchInstance: renderOptions.instantSearchInstance\n        }), false);\n      },\n      getRenderState: function getRenderState(renderState) {\n        return renderState;\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref2) {\n        var results = _ref2.results,\n          helper = _ref2.helper,\n          instantSearchInstance = _ref2.instantSearchInstance;\n        if (!sendEvent) {\n          sendEvent = (0, _utils.createSendEventForHits)({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            widgetType: this.$$type\n          });\n        }\n        if (results === null || results === undefined) {\n          return {\n            items: [],\n            widgetParams: widgetParams,\n            sendEvent: sendEvent\n          };\n        }\n        if (escapeHTML && results.hits.length > 0) {\n          results.hits = (0, _utils.escapeHits)(results.hits);\n        }\n        var itemsWithAbsolutePosition = (0, _utils.addAbsolutePosition)(results.hits, 0, 1);\n        var itemsWithAbsolutePositionAndQueryID = (0, _utils.addQueryID)(itemsWithAbsolutePosition, results.queryID);\n        var transformedItems = transformItems(itemsWithAbsolutePositionAndQueryID, {\n          results: results\n        });\n        return {\n          items: transformedItems,\n          widgetParams: widgetParams,\n          sendEvent: sendEvent\n        };\n      },\n      dispose: function dispose(_ref3) {\n        var recommendState = _ref3.recommendState;\n        unmountFn();\n        return recommendState.removeParams(this.$$id);\n      },\n      getWidgetParameters: function getWidgetParameters(state) {\n        return state.removeParams(this.$$id).addTrendingItems({\n          facetName: facetName,\n          facetValue: facetValue,\n          maxRecommendations: limit,\n          threshold: threshold,\n          fallbackParameters: _objectSpread(_objectSpread({}, fallbackParameters), escapeHTML ? _utils.TAG_PLACEHOLDER : {}),\n          queryParameters: _objectSpread(_objectSpread({}, queryParameters), escapeHTML ? _utils.TAG_PLACEHOLDER : {}),\n          $$id: this.$$id\n        });\n      }\n    };\n  };\n};"
  },
  {
    "path": "js/instantsearch.js/cjs/connectors/voice-search/connectVoiceSearch.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nvar _voiceSearchHelper2 = _interopRequireDefault(require(\"../../lib/voiceSearchHelper\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'voice-search',\n  connector: true\n});\nvar connectVoiceSearch = function connectVoiceSearch(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noop;\n  (0, _utils.checkRendering)(renderFn, withUsage());\n  return function (widgetParams) {\n    var _widgetParams$searchA = widgetParams.searchAsYouSpeak,\n      searchAsYouSpeak = _widgetParams$searchA === void 0 ? false : _widgetParams$searchA,\n      language = widgetParams.language,\n      additionalQueryParameters = widgetParams.additionalQueryParameters,\n      _widgetParams$createV = widgetParams.createVoiceSearchHelper,\n      createVoiceSearchHelper = _widgetParams$createV === void 0 ? _voiceSearchHelper2.default : _widgetParams$createV;\n    return {\n      $$type: 'ais.voiceSearch',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          voiceSearch: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(renderOptions) {\n        var _this = this;\n        var helper = renderOptions.helper,\n          instantSearchInstance = renderOptions.instantSearchInstance;\n        if (!this._refine) {\n          this._refine = function (query) {\n            if (query !== helper.state.query) {\n              var queryLanguages = language ? [language.split('-')[0]] : undefined;\n              // @ts-ignore queryLanguages is allowed to be a string, not just an array\n              helper.setQueryParameter('queryLanguages', queryLanguages);\n              if (typeof additionalQueryParameters === 'function') {\n                helper.setState(helper.state.setQueryParameters(_objectSpread({\n                  ignorePlurals: true,\n                  removeStopWords: true,\n                  // @ts-ignore optionalWords is allowed to be a string too\n                  optionalWords: query\n                }, additionalQueryParameters({\n                  query: query\n                }))));\n              }\n              helper.setQuery(query).search();\n            }\n          };\n        }\n        if (!this._voiceSearchHelper) {\n          this._voiceSearchHelper = createVoiceSearchHelper({\n            searchAsYouSpeak: searchAsYouSpeak,\n            language: language,\n            onQueryChange: function onQueryChange(query) {\n              return _this._refine(query);\n            },\n            onStateChange: function onStateChange() {\n              renderFn(_objectSpread(_objectSpread({}, _this.getWidgetRenderState(renderOptions)), {}, {\n                instantSearchInstance: instantSearchInstance\n              }), false);\n            }\n          });\n        }\n        var _voiceSearchHelper = this._voiceSearchHelper,\n          isBrowserSupported = _voiceSearchHelper.isBrowserSupported,\n          isListening = _voiceSearchHelper.isListening,\n          startListening = _voiceSearchHelper.startListening,\n          stopListening = _voiceSearchHelper.stopListening,\n          getState = _voiceSearchHelper.getState;\n        return {\n          isBrowserSupported: isBrowserSupported(),\n          isListening: isListening(),\n          toggleListening: function toggleListening() {\n            if (!isBrowserSupported()) {\n              return;\n            }\n            if (isListening()) {\n              stopListening();\n            } else {\n              startListening();\n            }\n          },\n          voiceListeningState: getState(),\n          widgetParams: widgetParams\n        };\n      },\n      dispose: function dispose(_ref) {\n        var state = _ref.state;\n        this._voiceSearchHelper.dispose();\n        unmountFn();\n        var newState = state;\n        if (typeof additionalQueryParameters === 'function') {\n          var additional = additionalQueryParameters({\n            query: ''\n          });\n          var toReset = additional ? Object.keys(additional).reduce(function (acc, current) {\n            // @ts-ignore search parameters is typed as readonly in v4\n            acc[current] = undefined;\n            return acc;\n          }, {}) : {};\n          newState = state.setQueryParameters(_objectSpread({\n            // @ts-ignore (queryLanguages is not added to algoliasearch v3)\n            queryLanguages: undefined,\n            ignorePlurals: undefined,\n            removeStopWords: undefined,\n            optionalWords: undefined\n          }, toReset));\n        }\n        return newState.setQueryParameter('query', undefined);\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref2) {\n        var searchParameters = _ref2.searchParameters;\n        var query = searchParameters.query || '';\n        if (!query) {\n          return uiState;\n        }\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          query: query\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref3) {\n        var uiState = _ref3.uiState;\n        return searchParameters.setQueryParameter('query', uiState.query || '');\n      }\n    };\n  };\n};\nvar _default = exports.default = connectVoiceSearch;"
  },
  {
    "path": "js/instantsearch.js/cjs/helpers/components/Highlight.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Highlight = Highlight;\nvar _preact = require(\"preact\");\nvar _Highlight = require(\"../../components/Highlight/Highlight\");\nvar _utils = require(\"../../lib/utils\");\nvar _excluded = [\"hit\", \"attribute\", \"cssClasses\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction Highlight(_ref) {\n  var hit = _ref.hit,\n    attribute = _ref.attribute,\n    cssClasses = _ref.cssClasses,\n    props = _objectWithoutProperties(_ref, _excluded);\n  var property = (0, _utils.getPropertyByPath)(hit._highlightResult, attribute) || [];\n  var properties = (0, _utils.toArray)(property);\n  process.env.NODE_ENV === 'development' ? (0, _utils.warning)(Boolean(properties.length), \"Could not enable highlight for \\\"\".concat(attribute.toString(), \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\\n\\nSee: https://alg.li/highlighting\\n\")) : void 0;\n  var parts = properties.map(function (_ref2) {\n    var value = _ref2.value;\n    return (0, _utils.getHighlightedParts)((0, _utils.unescape)(value || ''));\n  });\n  return (0, _preact.h)(_Highlight.Highlight, _extends({}, props, {\n    parts: parts,\n    classNames: cssClasses\n  }));\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/helpers/components/ReverseHighlight.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ReverseHighlight = ReverseHighlight;\nvar _preact = require(\"preact\");\nvar _ReverseHighlight = require(\"../../components/ReverseHighlight/ReverseHighlight\");\nvar _utils = require(\"../../lib/utils\");\nvar _excluded = [\"hit\", \"attribute\", \"cssClasses\"],\n  _excluded2 = [\"isHighlighted\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction ReverseHighlight(_ref) {\n  var hit = _ref.hit,\n    attribute = _ref.attribute,\n    cssClasses = _ref.cssClasses,\n    props = _objectWithoutProperties(_ref, _excluded);\n  var property = (0, _utils.getPropertyByPath)(hit._highlightResult, attribute) || [];\n  var properties = (0, _utils.toArray)(property);\n  process.env.NODE_ENV === 'development' ? (0, _utils.warning)(Boolean(properties.length), \"Could not enable highlight for \\\"\".concat(attribute.toString(), \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\\n\\nSee: https://alg.li/highlighting\\n\")) : void 0;\n  var parts = properties.map(function (_ref2) {\n    var value = _ref2.value;\n    return (0, _utils.getHighlightedParts)((0, _utils.unescape)(value || '')).map(function (_ref3) {\n      var isHighlighted = _ref3.isHighlighted,\n        rest = _objectWithoutProperties(_ref3, _excluded2);\n      return _objectSpread(_objectSpread({}, rest), {}, {\n        isHighlighted: !isHighlighted\n      });\n    });\n  });\n  return (0, _preact.h)(_ReverseHighlight.ReverseHighlight, _extends({}, props, {\n    parts: parts,\n    classNames: cssClasses\n  }));\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/helpers/components/ReverseSnippet.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ReverseSnippet = ReverseSnippet;\nvar _preact = require(\"preact\");\nvar _ReverseSnippet = require(\"../../components/ReverseSnippet/ReverseSnippet\");\nvar _utils = require(\"../../lib/utils\");\nvar _excluded = [\"hit\", \"attribute\", \"cssClasses\"],\n  _excluded2 = [\"isHighlighted\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction ReverseSnippet(_ref) {\n  var hit = _ref.hit,\n    attribute = _ref.attribute,\n    cssClasses = _ref.cssClasses,\n    props = _objectWithoutProperties(_ref, _excluded);\n  var property = (0, _utils.getPropertyByPath)(hit._snippetResult, attribute) || [];\n  var properties = (0, _utils.toArray)(property);\n  process.env.NODE_ENV === 'development' ? (0, _utils.warning)(Boolean(properties.length), \"Could not enable snippet for \\\"\".concat(attribute.toString(), \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\\n\\nSee: https://alg.li/highlighting\\n\")) : void 0;\n  var parts = properties.map(function (_ref2) {\n    var value = _ref2.value;\n    return (0, _utils.getHighlightedParts)((0, _utils.unescape)(value || '')).map(function (_ref3) {\n      var isHighlighted = _ref3.isHighlighted,\n        rest = _objectWithoutProperties(_ref3, _excluded2);\n      return _objectSpread(_objectSpread({}, rest), {}, {\n        isHighlighted: !isHighlighted\n      });\n    });\n  });\n  return (0, _preact.h)(_ReverseSnippet.ReverseSnippet, _extends({}, props, {\n    parts: parts,\n    classNames: cssClasses\n  }));\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/helpers/components/Snippet.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Snippet = Snippet;\nvar _preact = require(\"preact\");\nvar _Snippet = require(\"../../components/Snippet/Snippet\");\nvar _utils = require(\"../../lib/utils\");\nvar _excluded = [\"hit\", \"attribute\", \"cssClasses\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction Snippet(_ref) {\n  var hit = _ref.hit,\n    attribute = _ref.attribute,\n    cssClasses = _ref.cssClasses,\n    props = _objectWithoutProperties(_ref, _excluded);\n  var property = (0, _utils.getPropertyByPath)(hit._snippetResult, attribute) || [];\n  var properties = (0, _utils.toArray)(property);\n  process.env.NODE_ENV === 'development' ? (0, _utils.warning)(Boolean(properties.length), \"Could not enable snippet for \\\"\".concat(attribute.toString(), \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\\n\\nSee: https://alg.li/highlighting\\n\")) : void 0;\n  var parts = properties.map(function (_ref2) {\n    var value = _ref2.value;\n    return (0, _utils.getHighlightedParts)((0, _utils.unescape)(value || ''));\n  });\n  return (0, _preact.h)(_Snippet.Snippet, _extends({}, props, {\n    parts: parts,\n    classNames: cssClasses\n  }));\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/helpers/components/index.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nvar _Highlight = require(\"./Highlight\");\nObject.keys(_Highlight).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _Highlight[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _Highlight[key];\n    }\n  });\n});\nvar _ReverseHighlight = require(\"./ReverseHighlight\");\nObject.keys(_ReverseHighlight).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _ReverseHighlight[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _ReverseHighlight[key];\n    }\n  });\n});\nvar _ReverseSnippet = require(\"./ReverseSnippet\");\nObject.keys(_ReverseSnippet).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _ReverseSnippet[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _ReverseSnippet[key];\n    }\n  });\n});\nvar _Snippet = require(\"./Snippet\");\nObject.keys(_Snippet).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _Snippet[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _Snippet[key];\n    }\n  });\n});"
  },
  {
    "path": "js/instantsearch.js/cjs/helpers/get-insights-anonymous-user-token.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ANONYMOUS_TOKEN_COOKIE_KEY = void 0;\nexports.default = getInsightsAnonymousUserToken;\nexports.getInsightsAnonymousUserTokenInternal = getInsightsAnonymousUserTokenInternal;\nvar _utils = require(\"../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar ANONYMOUS_TOKEN_COOKIE_KEY = exports.ANONYMOUS_TOKEN_COOKIE_KEY = '_ALGOLIA';\nfunction getCookie(name) {\n  if ((typeof document === \"undefined\" ? \"undefined\" : _typeof(document)) !== 'object' || typeof document.cookie !== 'string') {\n    return undefined;\n  }\n  var prefix = \"\".concat(name, \"=\");\n  var cookies = document.cookie.split(';');\n  for (var i = 0; i < cookies.length; i++) {\n    var cookie = cookies[i];\n    while (cookie.charAt(0) === ' ') {\n      cookie = cookie.substring(1);\n    }\n    if (cookie.indexOf(prefix) === 0) {\n      return cookie.substring(prefix.length, cookie.length);\n    }\n  }\n  return undefined;\n}\nfunction getInsightsAnonymousUserTokenInternal() {\n  return getCookie(ANONYMOUS_TOKEN_COOKIE_KEY);\n}\n\n/**\n * @deprecated This function will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\n */\nfunction getInsightsAnonymousUserToken() {\n  process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, \"`getInsightsAnonymousUserToken` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `insights` middleware.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\") : void 0;\n  return getInsightsAnonymousUserTokenInternal();\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/helpers/highlight.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = highlight;\nvar _suit = require(\"../lib/suit\");\nvar _utils = require(\"../lib/utils\");\nvar suit = (0, _suit.component)('Highlight');\n\n/**\n * @deprecated use html tagged templates and the Highlight component instead\n */\nfunction highlight(_ref) {\n  var attribute = _ref.attribute,\n    _ref$highlightedTagNa = _ref.highlightedTagName,\n    highlightedTagName = _ref$highlightedTagNa === void 0 ? 'mark' : _ref$highlightedTagNa,\n    hit = _ref.hit,\n    _ref$cssClasses = _ref.cssClasses,\n    cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;\n  process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, \"`instantsearch.highlight` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `Highlight` component.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/?client=html+tagged+templates#upgrade-templates\") : void 0;\n  var highlightAttributeResult = (0, _utils.getPropertyByPath)(hit._highlightResult, attribute);\n\n  // @MAJOR fallback to attribute value if highlight is not found\n  process.env.NODE_ENV === 'development' ? (0, _utils.warning)(highlightAttributeResult, \"Could not enable highlight for \\\"\".concat(attribute, \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\\n\\nSee: https://alg.li/highlighting\\n\")) : void 0;\n  var _ref2 = highlightAttributeResult || {},\n    _ref2$value = _ref2.value,\n    attributeValue = _ref2$value === void 0 ? '' : _ref2$value;\n\n  // cx is not used, since it would be bundled as a dependency for Vue\n  var className = suit({\n    descendantName: 'highlighted'\n  }) + (cssClasses.highlighted ? \" \".concat(cssClasses.highlighted) : '');\n  return attributeValue.replace(new RegExp(_utils.TAG_REPLACEMENT.highlightPreTag, 'g'), \"<\".concat(highlightedTagName, \" class=\\\"\").concat(className, \"\\\">\")).replace(new RegExp(_utils.TAG_REPLACEMENT.highlightPostTag, 'g'), \"</\".concat(highlightedTagName, \">\"));\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/helpers/index.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nvar _exportNames = {\n  highlight: true,\n  reverseHighlight: true,\n  snippet: true,\n  reverseSnippet: true,\n  insights: true,\n  getInsightsAnonymousUserToken: true,\n  getInsightsAnonymousUserTokenInternal: true\n};\nObject.defineProperty(exports, \"getInsightsAnonymousUserToken\", {\n  enumerable: true,\n  get: function get() {\n    return _getInsightsAnonymousUserToken.default;\n  }\n});\nObject.defineProperty(exports, \"getInsightsAnonymousUserTokenInternal\", {\n  enumerable: true,\n  get: function get() {\n    return _getInsightsAnonymousUserToken.getInsightsAnonymousUserTokenInternal;\n  }\n});\nObject.defineProperty(exports, \"highlight\", {\n  enumerable: true,\n  get: function get() {\n    return _highlight.default;\n  }\n});\nObject.defineProperty(exports, \"insights\", {\n  enumerable: true,\n  get: function get() {\n    return _insights.default;\n  }\n});\nObject.defineProperty(exports, \"reverseHighlight\", {\n  enumerable: true,\n  get: function get() {\n    return _reverseHighlight.default;\n  }\n});\nObject.defineProperty(exports, \"reverseSnippet\", {\n  enumerable: true,\n  get: function get() {\n    return _reverseSnippet.default;\n  }\n});\nObject.defineProperty(exports, \"snippet\", {\n  enumerable: true,\n  get: function get() {\n    return _snippet.default;\n  }\n});\nvar _highlight = _interopRequireWildcard(require(\"./highlight\"));\nObject.keys(_highlight).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n  if (key in exports && exports[key] === _highlight[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _highlight[key];\n    }\n  });\n});\nvar _reverseHighlight = _interopRequireWildcard(require(\"./reverseHighlight\"));\nObject.keys(_reverseHighlight).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n  if (key in exports && exports[key] === _reverseHighlight[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _reverseHighlight[key];\n    }\n  });\n});\nvar _snippet = _interopRequireWildcard(require(\"./snippet\"));\nObject.keys(_snippet).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n  if (key in exports && exports[key] === _snippet[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _snippet[key];\n    }\n  });\n});\nvar _reverseSnippet = _interopRequireWildcard(require(\"./reverseSnippet\"));\nObject.keys(_reverseSnippet).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n  if (key in exports && exports[key] === _reverseSnippet[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _reverseSnippet[key];\n    }\n  });\n});\nvar _insights = _interopRequireDefault(require(\"./insights\"));\nvar _getInsightsAnonymousUserToken = _interopRequireWildcard(require(\"./get-insights-anonymous-user-token\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }"
  },
  {
    "path": "js/instantsearch.js/cjs/helpers/insights.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = insights;\nexports.readDataAttributes = readDataAttributes;\nexports.writeDataAttributes = writeDataAttributes;\nvar _utils = require(\"../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n/** @deprecated use bindEvent instead */\nfunction readDataAttributes(domElement) {\n  var method = domElement.getAttribute('data-insights-method');\n  var serializedPayload = domElement.getAttribute('data-insights-payload');\n  if (typeof serializedPayload !== 'string') {\n    throw new Error('The insights helper expects `data-insights-payload` to be a base64-encoded JSON string.');\n  }\n  try {\n    var payload = (0, _utils.deserializePayload)(serializedPayload);\n    return {\n      method: method,\n      payload: payload\n    };\n  } catch (error) {\n    throw new Error('The insights helper was unable to parse `data-insights-payload`.');\n  }\n}\n\n/** @deprecated use bindEvent instead */\nfunction writeDataAttributes(_ref) {\n  var method = _ref.method,\n    payload = _ref.payload;\n  if (_typeof(payload) !== 'object') {\n    throw new Error(\"The insights helper expects the payload to be an object.\");\n  }\n  var serializedPayload;\n  try {\n    serializedPayload = (0, _utils.serializePayload)(payload);\n  } catch (error) {\n    throw new Error(\"Could not JSON serialize the payload object.\");\n  }\n  return \"data-insights-method=\\\"\".concat(method, \"\\\" data-insights-payload=\\\"\").concat(serializedPayload, \"\\\"\");\n}\n\n/**\n * @deprecated This function will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\n */\nfunction insights(method, payload) {\n  process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, \"`insights` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `insights` middleware.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\") : void 0;\n  return writeDataAttributes({\n    method: method,\n    payload: payload\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/helpers/reverseHighlight.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = reverseHighlight;\nvar _suit = require(\"../lib/suit\");\nvar _utils = require(\"../lib/utils\");\nvar suit = (0, _suit.component)('ReverseHighlight');\n\n/**\n * @deprecated use html tagged templates and the ReverseHighlight component instead\n */\nfunction reverseHighlight(_ref) {\n  var attribute = _ref.attribute,\n    _ref$highlightedTagNa = _ref.highlightedTagName,\n    highlightedTagName = _ref$highlightedTagNa === void 0 ? 'mark' : _ref$highlightedTagNa,\n    hit = _ref.hit,\n    _ref$cssClasses = _ref.cssClasses,\n    cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;\n  process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, \"`instantsearch.reverseHighlight` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `ReverseHighlight` component.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/?client=html+tagged+templates#upgrade-templates\") : void 0;\n  var highlightAttributeResult = (0, _utils.getPropertyByPath)(hit._highlightResult, attribute);\n\n  // @MAJOR fallback to attribute value if highlight is not found\n  process.env.NODE_ENV === 'development' ? (0, _utils.warning)(highlightAttributeResult, \"Could not enable reverse highlight for \\\"\".concat(attribute, \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\\n\\nSee: https://alg.li/highlighting\\n\")) : void 0;\n  var _ref2 = highlightAttributeResult || {},\n    _ref2$value = _ref2.value,\n    attributeValue = _ref2$value === void 0 ? '' : _ref2$value;\n\n  // cx is not used, since it would be bundled as a dependency for Vue\n  var className = suit({\n    descendantName: 'highlighted'\n  }) + (cssClasses.highlighted ? \" \".concat(cssClasses.highlighted) : '');\n  var reverseHighlightedValue = (0, _utils.concatHighlightedParts)((0, _utils.reverseHighlightedParts)((0, _utils.getHighlightedParts)(attributeValue)));\n  return reverseHighlightedValue.replace(new RegExp(_utils.TAG_REPLACEMENT.highlightPreTag, 'g'), \"<\".concat(highlightedTagName, \" class=\\\"\").concat(className, \"\\\">\")).replace(new RegExp(_utils.TAG_REPLACEMENT.highlightPostTag, 'g'), \"</\".concat(highlightedTagName, \">\"));\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/helpers/reverseSnippet.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = reverseSnippet;\nvar _suit = require(\"../lib/suit\");\nvar _utils = require(\"../lib/utils\");\nvar suit = (0, _suit.component)('ReverseSnippet');\n\n/**\n * @deprecated use html tagged templates and the ReverseSnippet component instead\n */\nfunction reverseSnippet(_ref) {\n  var attribute = _ref.attribute,\n    _ref$highlightedTagNa = _ref.highlightedTagName,\n    highlightedTagName = _ref$highlightedTagNa === void 0 ? 'mark' : _ref$highlightedTagNa,\n    hit = _ref.hit,\n    _ref$cssClasses = _ref.cssClasses,\n    cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;\n  process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, \"`instantsearch.reverseSnippet` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `ReverseSnippet` component.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/?client=html+tagged+templates#upgrade-templates\") : void 0;\n  var snippetAttributeResult = (0, _utils.getPropertyByPath)(hit._snippetResult, attribute);\n\n  // @MAJOR fallback to attribute value if snippet is not found\n  process.env.NODE_ENV === 'development' ? (0, _utils.warning)(snippetAttributeResult, \"Could not enable reverse snippet for \\\"\".concat(attribute, \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\\n\\nSee: https://alg.li/highlighting\\n\")) : void 0;\n  var _ref2 = snippetAttributeResult || {},\n    _ref2$value = _ref2.value,\n    attributeValue = _ref2$value === void 0 ? '' : _ref2$value;\n\n  // cx is not used, since it would be bundled as a dependency for Vue\n  var className = suit({\n    descendantName: 'highlighted'\n  }) + (cssClasses.highlighted ? \" \".concat(cssClasses.highlighted) : '');\n  var reverseHighlightedValue = (0, _utils.concatHighlightedParts)((0, _utils.reverseHighlightedParts)((0, _utils.getHighlightedParts)(attributeValue)));\n  return reverseHighlightedValue.replace(new RegExp(_utils.TAG_REPLACEMENT.highlightPreTag, 'g'), \"<\".concat(highlightedTagName, \" class=\\\"\").concat(className, \"\\\">\")).replace(new RegExp(_utils.TAG_REPLACEMENT.highlightPostTag, 'g'), \"</\".concat(highlightedTagName, \">\"));\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/helpers/snippet.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = snippet;\nvar _suit = require(\"../lib/suit\");\nvar _utils = require(\"../lib/utils\");\nvar suit = (0, _suit.component)('Snippet');\n\n/**\n * @deprecated use html tagged templates and the Snippet component instead\n */\nfunction snippet(_ref) {\n  var attribute = _ref.attribute,\n    _ref$highlightedTagNa = _ref.highlightedTagName,\n    highlightedTagName = _ref$highlightedTagNa === void 0 ? 'mark' : _ref$highlightedTagNa,\n    hit = _ref.hit,\n    _ref$cssClasses = _ref.cssClasses,\n    cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;\n  process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, \"`instantsearch.snippet` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `Snippet` component.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/?client=html+tagged+templates#upgrade-templates\") : void 0;\n  var snippetAttributeResult = (0, _utils.getPropertyByPath)(hit._snippetResult, attribute);\n\n  // @MAJOR fallback to attribute value if snippet is not found\n  process.env.NODE_ENV === 'development' ? (0, _utils.warning)(snippetAttributeResult, \"Could not enable snippet for \\\"\".concat(attribute, \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\\n\\nSee: https://alg.li/highlighting\\n\")) : void 0;\n  var _ref2 = snippetAttributeResult || {},\n    _ref2$value = _ref2.value,\n    attributeValue = _ref2$value === void 0 ? '' : _ref2$value;\n\n  // cx is not used, since it would be bundled as a dependency for Vue\n  var className = suit({\n    descendantName: 'highlighted'\n  }) + (cssClasses.highlighted ? \" \".concat(cssClasses.highlighted) : '');\n  return attributeValue.replace(new RegExp(_utils.TAG_REPLACEMENT.highlightPreTag, 'g'), \"<\".concat(highlightedTagName, \" class=\\\"\").concat(className, \"\\\">\")).replace(new RegExp(_utils.TAG_REPLACEMENT.highlightPostTag, 'g'), \"</\".concat(highlightedTagName, \">\"));\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/index.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar connectors = _interopRequireWildcard(require(\"./connectors/index\"));\nvar helpers = _interopRequireWildcard(require(\"./helpers/index\"));\nvar _index3 = require(\"./lib/infiniteHitsCache/index\");\nvar _InstantSearch = _interopRequireDefault(require(\"./lib/InstantSearch\"));\nvar routers = _interopRequireWildcard(require(\"./lib/routers/index\"));\nvar stateMappings = _interopRequireWildcard(require(\"./lib/stateMappings/index\"));\nvar _version = _interopRequireDefault(require(\"./lib/version\"));\nvar middlewares = _interopRequireWildcard(require(\"./middlewares/index\"));\nvar templates = _interopRequireWildcard(require(\"./templates/index\"));\nvar widgets = _interopRequireWildcard(require(\"./widgets/index\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n/**\n * InstantSearch is the main component of InstantSearch.js. This object\n * manages the widget and lets you add new ones.\n *\n * Two parameters are required to get you started with InstantSearch.js:\n *  - `indexName`: the main index that you will use for your new search UI\n *  - `searchClient`: the search client to plug to InstantSearch.js\n *\n * The [search client provided by Algolia](algolia.com/doc/api-client/getting-started/what-is-the-api-client/javascript/)\n * needs an `appId` and an `apiKey`. Those parameters can be found in your\n * [Algolia dashboard](https://www.algolia.com/api-keys).\n *\n * If you want to get up and running quickly with InstantSearch.js, have a\n * look at the [getting started](https://www.algolia.com/doc/guides/building-search-ui/getting-started/js/).\n */\nvar instantsearch = function instantsearch(options) {\n  return new _InstantSearch.default(options);\n};\ninstantsearch.version = _version.default;\ninstantsearch.connectors = connectors;\ninstantsearch.widgets = widgets;\ninstantsearch.middlewares = middlewares;\ninstantsearch.routers = routers;\ninstantsearch.stateMappings = stateMappings;\ninstantsearch.templates = templates;\ninstantsearch.createInfiniteHitsSessionStorageCache = _index3.createInfiniteHitsSessionStorageCache;\ninstantsearch.highlight = helpers.highlight;\ninstantsearch.reverseHighlight = helpers.reverseHighlight;\ninstantsearch.snippet = helpers.snippet;\ninstantsearch.reverseSnippet = helpers.reverseSnippet;\ninstantsearch.insights = helpers.insights;\nvar _default = exports.default = instantsearch;"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/InstantSearch.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = exports.INSTANTSEARCH_FUTURE_DEFAULTS = void 0;\nvar _events = _interopRequireDefault(require(\"@algolia/events\"));\nvar _algoliasearchHelper = _interopRequireDefault(require(\"algoliasearch-helper\"));\nvar _createInsightsMiddleware = require(\"../middlewares/createInsightsMiddleware\");\nvar _createMetadataMiddleware = require(\"../middlewares/createMetadataMiddleware\");\nvar _createRouterMiddleware = require(\"../middlewares/createRouterMiddleware\");\nvar _index = _interopRequireDefault(require(\"../widgets/index/index\"));\nvar _createHelpers = _interopRequireDefault(require(\"./createHelpers\"));\nvar _utils = require(\"./utils\");\nvar _version = _interopRequireDefault(require(\"./version\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'instantsearch'\n});\nfunction defaultCreateURL() {\n  return '#';\n}\n\n// this purposely breaks typescript's type inference to ensure it's not used\n// as it's used for a default parameter for example\n// source: https://github.com/Microsoft/TypeScript/issues/14829#issuecomment-504042546\n\n/**\n * Global options for an InstantSearch instance.\n */\n\nvar INSTANTSEARCH_FUTURE_DEFAULTS = exports.INSTANTSEARCH_FUTURE_DEFAULTS = {\n  preserveSharedStateOnUnmount: false,\n  persistHierarchicalRootCount: false\n};\n\n/**\n * The actual implementation of the InstantSearch. This is\n * created using the `instantsearch` factory function.\n * It emits the 'render' event every time a search is done\n */\nvar InstantSearch = /*#__PURE__*/function (_EventEmitter) {\n  _inherits(InstantSearch, _EventEmitter);\n  var _super = _createSuper(InstantSearch);\n  function InstantSearch(options) {\n    var _options$future2;\n    var _this;\n    _classCallCheck(this, InstantSearch);\n    _this = _super.call(this);\n\n    // prevent `render` event listening from causing a warning\n    _defineProperty(_assertThisInitialized(_this), \"client\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"indexName\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"compositionID\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"insightsClient\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"onStateChange\", null);\n    _defineProperty(_assertThisInitialized(_this), \"future\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"helper\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"mainHelper\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"mainIndex\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"started\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"templatesConfig\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"renderState\", {});\n    _defineProperty(_assertThisInitialized(_this), \"_stalledSearchDelay\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"_searchStalledTimer\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"_initialUiState\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"_initialResults\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"_createURL\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"_searchFunction\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"_mainHelperSearch\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"_hasSearchWidget\", false);\n    _defineProperty(_assertThisInitialized(_this), \"_hasRecommendWidget\", false);\n    _defineProperty(_assertThisInitialized(_this), \"_insights\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"middleware\", []);\n    _defineProperty(_assertThisInitialized(_this), \"sendEventToInsights\", void 0);\n    /**\n     * The status of the search. Can be \"idle\", \"loading\", \"stalled\", or \"error\".\n     */\n    _defineProperty(_assertThisInitialized(_this), \"status\", 'idle');\n    /**\n     * The last returned error from the Search API.\n     * The error gets cleared when the next valid search response is rendered.\n     */\n    _defineProperty(_assertThisInitialized(_this), \"error\", undefined);\n    _defineProperty(_assertThisInitialized(_this), \"scheduleSearch\", (0, _utils.defer)(function () {\n      if (_this.started) {\n        _this.mainHelper.search();\n      }\n    }));\n    _defineProperty(_assertThisInitialized(_this), \"scheduleRender\", (0, _utils.defer)(function () {\n      var _this$mainHelper;\n      var shouldResetStatus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n      if (!((_this$mainHelper = _this.mainHelper) !== null && _this$mainHelper !== void 0 && _this$mainHelper.hasPendingRequests())) {\n        clearTimeout(_this._searchStalledTimer);\n        _this._searchStalledTimer = null;\n        if (shouldResetStatus) {\n          _this.status = 'idle';\n          _this.error = undefined;\n        }\n      }\n      _this.mainIndex.render({\n        instantSearchInstance: _assertThisInitialized(_this)\n      });\n      _this.emit('render');\n    }));\n    _defineProperty(_assertThisInitialized(_this), \"onInternalStateChange\", (0, _utils.defer)(function () {\n      var nextUiState = _this.mainIndex.getWidgetUiState({});\n      _this.middleware.forEach(function (_ref) {\n        var instance = _ref.instance;\n        instance.onStateChange({\n          uiState: nextUiState\n        });\n      });\n    }));\n    _this.setMaxListeners(100);\n    var _options$indexName = options.indexName,\n      indexName = _options$indexName === void 0 ? '' : _options$indexName,\n      compositionID = options.compositionID,\n      numberLocale = options.numberLocale,\n      _options$initialUiSta = options.initialUiState,\n      initialUiState = _options$initialUiSta === void 0 ? {} : _options$initialUiSta,\n      _options$routing = options.routing,\n      routing = _options$routing === void 0 ? null : _options$routing,\n      _options$insights = options.insights,\n      insights = _options$insights === void 0 ? undefined : _options$insights,\n      searchFunction = options.searchFunction,\n      _options$stalledSearc = options.stalledSearchDelay,\n      stalledSearchDelay = _options$stalledSearc === void 0 ? 200 : _options$stalledSearc,\n      _options$searchClient = options.searchClient,\n      searchClient = _options$searchClient === void 0 ? null : _options$searchClient,\n      _options$insightsClie = options.insightsClient,\n      insightsClient = _options$insightsClie === void 0 ? null : _options$insightsClie,\n      _options$onStateChang = options.onStateChange,\n      onStateChange = _options$onStateChang === void 0 ? null : _options$onStateChang,\n      _options$future = options.future,\n      future = _options$future === void 0 ? _objectSpread(_objectSpread({}, INSTANTSEARCH_FUTURE_DEFAULTS), options.future || {}) : _options$future;\n    if (searchClient === null) {\n      throw new Error(withUsage('The `searchClient` option is required.'));\n    }\n    if (typeof searchClient.search !== 'function') {\n      throw new Error(\"The `searchClient` must implement a `search` method.\\n\\nSee: https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/backend-instantsearch/js/\");\n    }\n    if (typeof searchClient.addAlgoliaAgent === 'function') {\n      searchClient.addAlgoliaAgent(\"instantsearch.js (\".concat(_version.default, \")\"));\n    }\n    process.env.NODE_ENV === 'development' ? (0, _utils.warning)(insightsClient === null, \"`insightsClient` property has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `insights` middleware.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\") : void 0;\n    if (insightsClient && typeof insightsClient !== 'function') {\n      throw new Error(withUsage('The `insightsClient` option should be a function.'));\n    }\n    process.env.NODE_ENV === 'development' ? (0, _utils.warning)(!options.searchParameters, \"The `searchParameters` option is deprecated and will not be supported in InstantSearch.js 4.x.\\n\\nYou can replace it with the `configure` widget:\\n\\n```\\nsearch.addWidgets([\\n  configure(\".concat(JSON.stringify(options.searchParameters, null, 2), \")\\n]);\\n```\\n\\nSee \").concat((0, _utils.createDocumentationLink)({\n      name: 'configure'\n    }))) : void 0;\n    if (process.env.NODE_ENV === 'development' && ((_options$future2 = options.future) === null || _options$future2 === void 0 ? void 0 : _options$future2.preserveSharedStateOnUnmount) === undefined) {\n      // eslint-disable-next-line no-console\n      console.info(\"Starting from the next major version, InstantSearch will change how widgets state is preserved when they are removed. InstantSearch will keep the state of unmounted widgets to be usable by other widgets with the same attribute.\\n\\nWe recommend setting `future.preserveSharedStateOnUnmount` to true to adopt this change today.\\nTo stay with the current behaviour and remove this warning, set the option to false.\\n\\nSee documentation: \".concat((0, _utils.createDocumentationLink)({\n        name: 'instantsearch'\n      }), \"#widget-param-future\\n          \"));\n    }\n    _this.client = searchClient;\n    _this.future = future;\n    _this.insightsClient = insightsClient;\n    _this.indexName = indexName;\n    _this.compositionID = compositionID;\n    _this.helper = null;\n    _this.mainHelper = null;\n    _this.mainIndex = (0, _index.default)({\n      // we use an index widget to render compositions\n      // this only works because there's only one composition index allow for now\n      indexName: _this.compositionID || _this.indexName\n    });\n    _this.onStateChange = onStateChange;\n    _this.started = false;\n    _this.templatesConfig = {\n      helpers: (0, _createHelpers.default)({\n        numberLocale: numberLocale\n      }),\n      compileOptions: {}\n    };\n    _this._stalledSearchDelay = stalledSearchDelay;\n    _this._searchStalledTimer = null;\n    _this._createURL = defaultCreateURL;\n    _this._initialUiState = initialUiState;\n    _this._initialResults = null;\n    _this._insights = insights;\n    if (searchFunction) {\n      process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, \"The `searchFunction` option is deprecated. Use `onStateChange` instead.\") : void 0;\n      _this._searchFunction = searchFunction;\n    }\n    _this.sendEventToInsights = _utils.noop;\n    if (routing) {\n      var routerOptions = typeof routing === 'boolean' ? {} : routing;\n      routerOptions.$$internal = true;\n      _this.use((0, _createRouterMiddleware.createRouterMiddleware)(routerOptions));\n    }\n\n    // This is the default Insights middleware,\n    // added when `insights` is set to true by the user.\n    // Any user-provided middleware will be added later and override this one.\n    if (insights) {\n      var insightsOptions = typeof insights === 'boolean' ? {} : insights;\n      insightsOptions.$$internal = true;\n      _this.use((0, _createInsightsMiddleware.createInsightsMiddleware)(insightsOptions));\n    }\n    if ((0, _createMetadataMiddleware.isMetadataEnabled)()) {\n      _this.use((0, _createMetadataMiddleware.createMetadataMiddleware)({\n        $$internal: true\n      }));\n    }\n    return _this;\n  }\n\n  /**\n   * Hooks a middleware into the InstantSearch lifecycle.\n   */\n  _createClass(InstantSearch, [{\n    key: \"_isSearchStalled\",\n    get:\n    /**\n     * @deprecated use `status === 'stalled'` instead\n     */\n    function get() {\n      process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, \"`InstantSearch._isSearchStalled` is deprecated and will be removed in InstantSearch.js 5.0.\\n\\nUse `InstantSearch.status === \\\"stalled\\\"` instead.\") : void 0;\n      return this.status === 'stalled';\n    }\n  }, {\n    key: \"use\",\n    value: function use() {\n      var _this2 = this;\n      for (var _len = arguments.length, middleware = new Array(_len), _key = 0; _key < _len; _key++) {\n        middleware[_key] = arguments[_key];\n      }\n      var newMiddlewareList = middleware.map(function (fn) {\n        var newMiddleware = _objectSpread({\n          $$type: '__unknown__',\n          $$internal: false,\n          subscribe: _utils.noop,\n          started: _utils.noop,\n          unsubscribe: _utils.noop,\n          onStateChange: _utils.noop\n        }, fn({\n          instantSearchInstance: _this2\n        }));\n        _this2.middleware.push({\n          creator: fn,\n          instance: newMiddleware\n        });\n        return newMiddleware;\n      });\n\n      // If the instance has already started, we directly subscribe the\n      // middleware so they're notified of changes.\n      if (this.started) {\n        newMiddlewareList.forEach(function (m) {\n          m.subscribe();\n          m.started();\n        });\n      }\n      return this;\n    }\n\n    /**\n     * Removes a middleware from the InstantSearch lifecycle.\n     */\n  }, {\n    key: \"unuse\",\n    value: function unuse() {\n      for (var _len2 = arguments.length, middlewareToUnuse = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n        middlewareToUnuse[_key2] = arguments[_key2];\n      }\n      this.middleware.filter(function (m) {\n        return middlewareToUnuse.includes(m.creator);\n      }).forEach(function (m) {\n        return m.instance.unsubscribe();\n      });\n      this.middleware = this.middleware.filter(function (m) {\n        return !middlewareToUnuse.includes(m.creator);\n      });\n      return this;\n    }\n\n    // @major we shipped with EXPERIMENTAL_use, but have changed that to just `use` now\n  }, {\n    key: \"EXPERIMENTAL_use\",\n    value: function EXPERIMENTAL_use() {\n      process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, 'The middleware API is now considered stable, so we recommend replacing `EXPERIMENTAL_use` with `use` before upgrading to the next major version.') : void 0;\n      return this.use.apply(this, arguments);\n    }\n\n    /**\n     * Adds a widget to the search instance.\n     * A widget can be added either before or after InstantSearch has started.\n     * @param widget The widget to add to InstantSearch.\n     *\n     * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `addWidgets([widget])`.\n     */\n  }, {\n    key: \"addWidget\",\n    value: function addWidget(widget) {\n      process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, 'addWidget will still be supported in 4.x releases, but not further. It is replaced by `addWidgets([widget])`') : void 0;\n      return this.addWidgets([widget]);\n    }\n\n    /**\n     * Adds multiple widgets to the search instance.\n     * Widgets can be added either before or after InstantSearch has started.\n     * @param widgets The array of widgets to add to InstantSearch.\n     */\n  }, {\n    key: \"addWidgets\",\n    value: function addWidgets(widgets) {\n      if (!Array.isArray(widgets)) {\n        throw new Error(withUsage('The `addWidgets` method expects an array of widgets. Please use `addWidget`.'));\n      }\n      if (widgets.some(function (widget) {\n        return typeof widget.init !== 'function' && typeof widget.render !== 'function';\n      })) {\n        throw new Error(withUsage('The widget definition expects a `render` and/or an `init` method.'));\n      }\n      if (this.compositionID && widgets.some(_utils.isIndexWidget)) {\n        throw new Error(withUsage('The `index` widget cannot be used with a composition-based InstantSearch implementation.'));\n      }\n      this.mainIndex.addWidgets(widgets);\n      return this;\n    }\n\n    /**\n     * Removes a widget from the search instance.\n     * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `removeWidgets([widget])`\n     * @param widget The widget instance to remove from InstantSearch.\n     *\n     * The widget must implement a `dispose()` method to clear its state.\n     */\n  }, {\n    key: \"removeWidget\",\n    value: function removeWidget(widget) {\n      process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, 'removeWidget will still be supported in 4.x releases, but not further. It is replaced by `removeWidgets([widget])`') : void 0;\n      return this.removeWidgets([widget]);\n    }\n\n    /**\n     * Removes multiple widgets from the search instance.\n     * @param widgets Array of widgets instances to remove from InstantSearch.\n     *\n     * The widgets must implement a `dispose()` method to clear their states.\n     */\n  }, {\n    key: \"removeWidgets\",\n    value: function removeWidgets(widgets) {\n      if (!Array.isArray(widgets)) {\n        throw new Error(withUsage('The `removeWidgets` method expects an array of widgets. Please use `removeWidget`.'));\n      }\n      if (widgets.some(function (widget) {\n        return typeof widget.dispose !== 'function';\n      })) {\n        throw new Error(withUsage('The widget definition expects a `dispose` method.'));\n      }\n      this.mainIndex.removeWidgets(widgets);\n      return this;\n    }\n\n    /**\n     * Ends the initialization of InstantSearch.js and triggers the\n     * first search.\n     */\n  }, {\n    key: \"start\",\n    value: function start() {\n      var _this3 = this;\n      if (this.started) {\n        throw new Error(withUsage('The `start` method has already been called once.'));\n      }\n\n      // This Helper is used for the queries, we don't care about its state. The\n      // states are managed at the `index` level. We use this Helper to create\n      // DerivedHelper scoped into the `index` widgets.\n      // In Vue InstantSearch' hydrate, a main helper gets set before start, so\n      // we need to respect this helper as a way to keep all listeners correct.\n      var mainHelper = this.mainHelper || (0, _algoliasearchHelper.default)(this.client, this.indexName, undefined, {\n        persistHierarchicalRootCount: this.future.persistHierarchicalRootCount\n      });\n      if (this.compositionID) {\n        mainHelper.searchForFacetValues = mainHelper.searchForCompositionFacetValues.bind(mainHelper);\n      }\n      mainHelper.search = function () {\n        _this3.status = 'loading';\n        _this3.scheduleRender(false);\n        process.env.NODE_ENV === 'development' ? (0, _utils.warning)(Boolean(_this3.indexName) || Boolean(_this3.compositionID) || _this3.mainIndex.getWidgets().some(_utils.isIndexWidget), 'No indexName provided, nor an explicit index widget in the widgets tree. This is required to be able to display results.') : void 0;\n\n        // This solution allows us to keep the exact same API for the users but\n        // under the hood, we have a different implementation. It should be\n        // completely transparent for the rest of the codebase. Only this module\n        // is impacted.\n        if (_this3._hasSearchWidget) {\n          if (_this3.compositionID) {\n            mainHelper.searchWithComposition();\n          } else {\n            mainHelper.searchOnlyWithDerivedHelpers();\n          }\n        }\n        if (_this3._hasRecommendWidget) {\n          mainHelper.recommend();\n        }\n        return mainHelper;\n      };\n      if (this._searchFunction) {\n        // this client isn't used to actually search, but required for the helper\n        // to not throw errors\n        var fakeClient = {\n          search: function search() {\n            return new Promise(_utils.noop);\n          }\n        };\n        this._mainHelperSearch = mainHelper.search.bind(mainHelper);\n        mainHelper.search = function () {\n          var mainIndexHelper = _this3.mainIndex.getHelper();\n          var searchFunctionHelper = (0, _algoliasearchHelper.default)(fakeClient, mainIndexHelper.state.index, mainIndexHelper.state);\n          searchFunctionHelper.once('search', function (_ref2) {\n            var state = _ref2.state;\n            mainIndexHelper.overrideStateWithoutTriggeringChangeEvent(state);\n            _this3._mainHelperSearch();\n          });\n          // Forward state changes from `searchFunctionHelper` to `mainIndexHelper`\n          searchFunctionHelper.on('change', function (_ref3) {\n            var state = _ref3.state;\n            mainIndexHelper.setState(state);\n          });\n          _this3._searchFunction(searchFunctionHelper);\n          return mainHelper;\n        };\n      }\n\n      // Only the \"main\" Helper emits the `error` event vs the one for `search`\n      // and `results` that are also emitted on the derived one.\n      mainHelper.on('error', function (_ref4) {\n        var error = _ref4.error;\n        if (!(error instanceof Error)) {\n          // typescript lies here, error is in some cases { name: string, message: string }\n          var err = error;\n          error = Object.keys(err).reduce(function (acc, key) {\n            acc[key] = err[key];\n            return acc;\n          }, new Error(err.message));\n        }\n        // If an error is emitted, it is re-thrown by events. In previous versions\n        // we emitted {error}, which is thrown as:\n        // \"Uncaught, unspecified \\\"error\\\" event. ([object Object])\"\n        // To avoid breaking changes, we make the error available in both\n        // `error` and `error.error`\n        // @MAJOR emit only error\n        error.error = error;\n        _this3.error = error;\n        _this3.status = 'error';\n        _this3.scheduleRender(false);\n\n        // This needs to execute last because it throws the error.\n        _this3.emit('error', error);\n      });\n      this.mainHelper = mainHelper;\n      this.middleware.forEach(function (_ref5) {\n        var instance = _ref5.instance;\n        instance.subscribe();\n      });\n      this.mainIndex.init({\n        instantSearchInstance: this,\n        parent: null,\n        uiState: this._initialUiState\n      });\n      if (this._initialResults) {\n        (0, _utils.hydrateSearchClient)(this.client, this._initialResults);\n        (0, _utils.hydrateRecommendCache)(this.mainHelper, this._initialResults);\n        var originalScheduleSearch = this.scheduleSearch;\n        // We don't schedule a first search when initial results are provided\n        // because we already have the results to render. This skips the initial\n        // network request on the browser on `start`.\n        this.scheduleSearch = (0, _utils.defer)(_utils.noop);\n        // We also skip the initial network request when widgets are dynamically\n        // added in the first tick (that's the case in all the framework-based flavors).\n        // When we add a widget to `index`, it calls `scheduleSearch`. We can rely\n        // on our `defer` util to restore the original `scheduleSearch` value once\n        // widgets are added to hook back to the regular lifecycle.\n        (0, _utils.defer)(function () {\n          _this3.scheduleSearch = originalScheduleSearch;\n        })();\n      }\n      // We only schedule a search when widgets have been added before `start()`\n      // because there are listeners that can use these results.\n      // This is especially useful in framework-based flavors that wait for\n      // dynamically-added widgets to trigger a network request. It avoids\n      // having to batch this initial network request with the one coming from\n      // `addWidgets()`.\n      // Later, we could also skip `index()` widgets and widgets that don't read\n      // the results, but this is an optimization that has a very low impact for now.\n      else if (this.mainIndex.getWidgets().length > 0) {\n        this.scheduleSearch();\n      }\n\n      // Keep the previous reference for legacy purpose, some pattern use\n      // the direct Helper access `search.helper` (e.g multi-index).\n      this.helper = this.mainIndex.getHelper();\n\n      // track we started the search if we add more widgets,\n      // to init them directly after add\n      this.started = true;\n      this.middleware.forEach(function (_ref6) {\n        var instance = _ref6.instance;\n        instance.started();\n      });\n\n      // This is the automatic Insights middleware,\n      // added when `insights` is unset and the initial results possess `queryID`.\n      // Any user-provided middleware will be added later and override this one.\n      if (typeof this._insights === 'undefined') {\n        mainHelper.derivedHelpers[0].once('result', function () {\n          var hasAutomaticInsights = _this3.mainIndex.getScopedResults().some(function (_ref7) {\n            var results = _ref7.results;\n            return results === null || results === void 0 ? void 0 : results._automaticInsights;\n          });\n          if (hasAutomaticInsights) {\n            _this3.use((0, _createInsightsMiddleware.createInsightsMiddleware)({\n              $$internal: true,\n              $$automatic: true\n            }));\n          }\n        });\n      }\n    }\n\n    /**\n     * Removes all widgets without triggering a search afterwards.\n     * @return {undefined} This method does not return anything\n     */\n  }, {\n    key: \"dispose\",\n    value: function dispose() {\n      var _this$mainHelper2;\n      this.scheduleSearch.cancel();\n      this.scheduleRender.cancel();\n      clearTimeout(this._searchStalledTimer);\n      this.removeWidgets(this.mainIndex.getWidgets());\n      this.mainIndex.dispose();\n\n      // You can not start an instance two times, therefore a disposed instance\n      // needs to set started as false otherwise this can not be restarted at a\n      // later point.\n      this.started = false;\n\n      // The helper needs to be reset to perform the next search from a fresh state.\n      // If not reset, it would use the state stored before calling `dispose()`.\n      this.removeAllListeners();\n      (_this$mainHelper2 = this.mainHelper) === null || _this$mainHelper2 === void 0 ? void 0 : _this$mainHelper2.removeAllListeners();\n      this.mainHelper = null;\n      this.helper = null;\n      this.middleware.forEach(function (_ref8) {\n        var instance = _ref8.instance;\n        instance.unsubscribe();\n      });\n    }\n  }, {\n    key: \"scheduleStalledRender\",\n    value: function scheduleStalledRender() {\n      var _this4 = this;\n      if (!this._searchStalledTimer) {\n        this._searchStalledTimer = setTimeout(function () {\n          _this4.status = 'stalled';\n          _this4.scheduleRender();\n        }, this._stalledSearchDelay);\n      }\n    }\n\n    /**\n     * Set the UI state and trigger a search.\n     * @param uiState The next UI state or a function computing it from the current state\n     * @param callOnStateChange private parameter used to know if the method is called from a state change\n     */\n  }, {\n    key: \"setUiState\",\n    value: function setUiState(uiState) {\n      var _this5 = this;\n      var callOnStateChange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n      if (!this.mainHelper) {\n        throw new Error(withUsage('The `start` method needs to be called before `setUiState`.'));\n      }\n\n      // We refresh the index UI state to update the local UI state that the\n      // main index passes to the function form of `setUiState`.\n      this.mainIndex.refreshUiState();\n      var nextUiState = typeof uiState === 'function' ? uiState(this.mainIndex.getWidgetUiState({})) : uiState;\n      if (this.onStateChange && callOnStateChange) {\n        this.onStateChange({\n          uiState: nextUiState,\n          setUiState: function setUiState(finalUiState) {\n            (0, _utils.setIndexHelperState)(typeof finalUiState === 'function' ? finalUiState(nextUiState) : finalUiState, _this5.mainIndex);\n            _this5.scheduleSearch();\n            _this5.onInternalStateChange();\n          }\n        });\n      } else {\n        (0, _utils.setIndexHelperState)(nextUiState, this.mainIndex);\n        this.scheduleSearch();\n        this.onInternalStateChange();\n      }\n    }\n  }, {\n    key: \"getUiState\",\n    value: function getUiState() {\n      if (this.started) {\n        // We refresh the index UI state to make sure changes from `refine` are taken in account\n        this.mainIndex.refreshUiState();\n      }\n      return this.mainIndex.getWidgetUiState({});\n    }\n  }, {\n    key: \"createURL\",\n    value: function createURL() {\n      var nextState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n      if (!this.started) {\n        throw new Error(withUsage('The `start` method needs to be called before `createURL`.'));\n      }\n      return this._createURL(nextState);\n    }\n  }, {\n    key: \"refresh\",\n    value: function refresh() {\n      if (!this.mainHelper) {\n        throw new Error(withUsage('The `start` method needs to be called before `refresh`.'));\n      }\n      this.mainHelper.clearCache().search();\n    }\n  }]);\n  return InstantSearch;\n}(_events.default);\nvar _default = exports.default = InstantSearch;"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/createHelpers.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = hoganHelpers;\nvar _helpers = require(\"../helpers\");\nvar _formatNumber2 = require(\"./formatNumber\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction hoganHelpers(_ref) {\n  var numberLocale = _ref.numberLocale;\n  return {\n    formatNumber: function formatNumber(value, render) {\n      return (0, _formatNumber2.formatNumber)(Number(render(value)), numberLocale);\n    },\n    highlight: function highlight(options, render) {\n      try {\n        var highlightOptions = JSON.parse(options);\n        return render((0, _helpers.highlight)(_objectSpread(_objectSpread({}, highlightOptions), {}, {\n          hit: this\n        })));\n      } catch (error) {\n        throw new Error(\"\\nThe highlight helper expects a JSON object of the format:\\n{ \\\"attribute\\\": \\\"name\\\", \\\"highlightedTagName\\\": \\\"mark\\\" }\");\n      }\n    },\n    reverseHighlight: function reverseHighlight(options, render) {\n      try {\n        var reverseHighlightOptions = JSON.parse(options);\n        return render((0, _helpers.reverseHighlight)(_objectSpread(_objectSpread({}, reverseHighlightOptions), {}, {\n          hit: this\n        })));\n      } catch (error) {\n        throw new Error(\"\\n  The reverseHighlight helper expects a JSON object of the format:\\n  { \\\"attribute\\\": \\\"name\\\", \\\"highlightedTagName\\\": \\\"mark\\\" }\");\n      }\n    },\n    snippet: function snippet(options, render) {\n      try {\n        var snippetOptions = JSON.parse(options);\n        return render((0, _helpers.snippet)(_objectSpread(_objectSpread({}, snippetOptions), {}, {\n          hit: this\n        })));\n      } catch (error) {\n        throw new Error(\"\\nThe snippet helper expects a JSON object of the format:\\n{ \\\"attribute\\\": \\\"name\\\", \\\"highlightedTagName\\\": \\\"mark\\\" }\");\n      }\n    },\n    reverseSnippet: function reverseSnippet(options, render) {\n      try {\n        var reverseSnippetOptions = JSON.parse(options);\n        return render((0, _helpers.reverseSnippet)(_objectSpread(_objectSpread({}, reverseSnippetOptions), {}, {\n          hit: this\n        })));\n      } catch (error) {\n        throw new Error(\"\\n  The reverseSnippet helper expects a JSON object of the format:\\n  { \\\"attribute\\\": \\\"name\\\", \\\"highlightedTagName\\\": \\\"mark\\\" }\");\n      }\n    },\n    insights: function insights(options, render) {\n      try {\n        var _JSON$parse = JSON.parse(options),\n          method = _JSON$parse.method,\n          payload = _JSON$parse.payload;\n        return render((0, _helpers.insights)(method, _objectSpread({\n          objectIDs: [this.objectID]\n        }, payload)));\n      } catch (error) {\n        throw new Error(\"\\nThe insights helper expects a JSON object of the format:\\n{ \\\"method\\\": \\\"method-name\\\", \\\"payload\\\": { \\\"eventName\\\": \\\"name of the event\\\" } }\");\n      }\n    }\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/formatNumber.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.formatNumber = formatNumber;\nfunction formatNumber(value, numberLocale) {\n  return value.toLocaleString(numberLocale);\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/infiniteHitsCache/index.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nObject.defineProperty(exports, \"createInfiniteHitsSessionStorageCache\", {\n  enumerable: true,\n  get: function get() {\n    return _sessionStorage.default;\n  }\n});\nvar _sessionStorage = _interopRequireDefault(require(\"./sessionStorage\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/infiniteHitsCache/sessionStorage.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = createInfiniteHitsSessionStorageCache;\nvar _utils = require(\"../utils\");\nvar _excluded = [\"page\"];\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction getStateWithoutPage(state) {\n  var _ref = state || {},\n    page = _ref.page,\n    rest = _objectWithoutProperties(_ref, _excluded);\n  return rest;\n}\nfunction createInfiniteHitsSessionStorageCache() {\n  var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n    key = _ref2.key;\n  var KEY = ['ais.infiniteHits', key].filter(Boolean).join(':');\n  return {\n    read: function read(_ref3) {\n      var state = _ref3.state;\n      var sessionStorage = (0, _utils.safelyRunOnBrowser)(function (_ref4) {\n        var window = _ref4.window;\n        return window.sessionStorage;\n      });\n      if (!sessionStorage) {\n        return null;\n      }\n      try {\n        var cache = JSON.parse(\n        // @ts-expect-error JSON.parse() requires a string, but it actually accepts null, too.\n        sessionStorage.getItem(KEY));\n        return cache && (0, _utils.isEqual)(cache.state, getStateWithoutPage(state)) ? cache.hits : null;\n      } catch (error) {\n        if (error instanceof SyntaxError) {\n          try {\n            sessionStorage.removeItem(KEY);\n          } catch (err) {\n            // do nothing\n          }\n        }\n        return null;\n      }\n    },\n    write: function write(_ref5) {\n      var state = _ref5.state,\n        hits = _ref5.hits;\n      var sessionStorage = (0, _utils.safelyRunOnBrowser)(function (_ref6) {\n        var window = _ref6.window;\n        return window.sessionStorage;\n      });\n      if (!sessionStorage) {\n        return;\n      }\n      try {\n        sessionStorage.setItem(KEY, JSON.stringify({\n          state: getStateWithoutPage(state),\n          hits: hits\n        }));\n      } catch (error) {\n        // do nothing\n      }\n    }\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/insights/client.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = withInsights;\nexports.inferPayload = void 0;\nvar _utils = require(\"../utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar getSelectedHits = function getSelectedHits(hits, selectedObjectIDs) {\n  return selectedObjectIDs.map(function (objectID) {\n    var hit = (0, _utils.find)(hits, function (h) {\n      return h.objectID === objectID;\n    });\n    if (typeof hit === 'undefined') {\n      throw new Error(\"Could not find objectID \\\"\".concat(objectID, \"\\\" passed to `clickedObjectIDsAfterSearch` in the returned hits. This is necessary to infer the absolute position and the query ID.\"));\n    }\n    return hit;\n  });\n};\nvar getQueryID = function getQueryID(selectedHits) {\n  var queryIDs = (0, _utils.uniq)(selectedHits.map(function (hit) {\n    return hit.__queryID;\n  }));\n  if (queryIDs.length > 1) {\n    throw new Error('Insights currently allows a single `queryID`. The `objectIDs` provided map to multiple `queryID`s.');\n  }\n  var queryID = queryIDs[0];\n  if (typeof queryID !== 'string') {\n    throw new Error(\"Could not infer `queryID`. Ensure InstantSearch `clickAnalytics: true` was added with the Configure widget.\\n\\nSee: https://alg.li/lNiZZ7\");\n  }\n  return queryID;\n};\nvar getPositions = function getPositions(selectedHits) {\n  return selectedHits.map(function (hit) {\n    return hit.__position;\n  });\n};\nvar inferPayload = exports.inferPayload = function inferPayload(_ref) {\n  var method = _ref.method,\n    results = _ref.results,\n    hits = _ref.hits,\n    objectIDs = _ref.objectIDs;\n  var index = results.index;\n  var selectedHits = getSelectedHits(hits, objectIDs);\n  var queryID = getQueryID(selectedHits);\n  switch (method) {\n    case 'clickedObjectIDsAfterSearch':\n      {\n        var positions = getPositions(selectedHits);\n        return {\n          index: index,\n          queryID: queryID,\n          objectIDs: objectIDs,\n          positions: positions\n        };\n      }\n    case 'convertedObjectIDsAfterSearch':\n      return {\n        index: index,\n        queryID: queryID,\n        objectIDs: objectIDs\n      };\n    default:\n      throw new Error(\"Unsupported method passed to insights: \\\"\".concat(method, \"\\\".\"));\n  }\n};\nvar wrapInsightsClient = function wrapInsightsClient(aa, results, hits) {\n  return function (method) {\n    for (var _len = arguments.length, payloads = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n      payloads[_key - 1] = arguments[_key];\n    }\n    var payload = payloads[0];\n    process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, \"`insights` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `insights` middleware.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\") : void 0;\n    if (!aa) {\n      var withInstantSearchUsage = (0, _utils.createDocumentationMessageGenerator)({\n        name: 'instantsearch'\n      });\n      throw new Error(withInstantSearchUsage('The `insightsClient` option has not been provided to `instantsearch`.'));\n    }\n    if (!Array.isArray(payload.objectIDs)) {\n      throw new TypeError('Expected `objectIDs` to be an array.');\n    }\n    var inferredPayload = inferPayload({\n      method: method,\n      results: results,\n      hits: hits,\n      objectIDs: payload.objectIDs\n    });\n    aa(method, _objectSpread(_objectSpread({}, inferredPayload), payload));\n  };\n};\n\n/**\n * @deprecated This function will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\n * It passes `insights` to `HitsWithInsightsListener` and `InfiniteHitsWithInsightsListener`.\n */\nfunction withInsights(connector) {\n  return function (renderFn, unmountFn) {\n    return connector(function (renderOptions, isFirstRender) {\n      var results = renderOptions.results,\n        hits = renderOptions.hits,\n        instantSearchInstance = renderOptions.instantSearchInstance;\n      if (results && hits && instantSearchInstance) {\n        var insights = wrapInsightsClient(instantSearchInstance.insightsClient, results, hits);\n        return renderFn(_objectSpread(_objectSpread({}, renderOptions), {}, {\n          insights: insights\n        }), isFirstRender);\n      }\n      return renderFn(renderOptions, isFirstRender);\n    }, unmountFn);\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/insights/index.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nObject.defineProperty(exports, \"inferInsightsPayload\", {\n  enumerable: true,\n  get: function get() {\n    return _client.inferPayload;\n  }\n});\nObject.defineProperty(exports, \"withInsights\", {\n  enumerable: true,\n  get: function get() {\n    return _client.default;\n  }\n});\nObject.defineProperty(exports, \"withInsightsListener\", {\n  enumerable: true,\n  get: function get() {\n    return _listener.default;\n  }\n});\nvar _client = _interopRequireWildcard(require(\"./client\"));\nvar _listener = _interopRequireDefault(require(\"./listener\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/insights/listener.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.createInsightsEventHandler = void 0;\nexports.default = withInsightsListener;\nvar _preact = require(\"preact\");\nvar _insights = require(\"../../helpers/insights\");\nvar _utils = require(\"../utils\");\nvar createInsightsEventHandler = exports.createInsightsEventHandler = function createInsightsEventHandler(_ref) {\n  var insights = _ref.insights,\n    sendEvent = _ref.sendEvent;\n  return function (event) {\n    // new way, e.g. bindEvent(\"click\", hit, \"Hit clicked\")\n    var insightsThroughSendEvent = findInsightsTarget(event.target, event.currentTarget, function (element) {\n      return element.hasAttribute('data-insights-event');\n    });\n    if (insightsThroughSendEvent) {\n      var payload = parseInsightsEvent(insightsThroughSendEvent);\n      payload.forEach(function (single) {\n        return sendEvent(single);\n      });\n    }\n\n    // old way, e.g. instantsearch.insights(\"clickedObjectIDsAfterSearch\", { .. })\n    var insightsThroughFunction = findInsightsTarget(event.target, event.currentTarget, function (element) {\n      return element.hasAttribute('data-insights-method') && element.hasAttribute('data-insights-payload');\n    });\n    if (insightsThroughFunction) {\n      var _readDataAttributes = (0, _insights.readDataAttributes)(insightsThroughFunction),\n        method = _readDataAttributes.method,\n        _payload = _readDataAttributes.payload;\n      insights(method, _payload);\n    }\n  };\n};\nfunction findInsightsTarget(startElement, endElement, validator) {\n  var element = startElement;\n  while (element && !validator(element)) {\n    if (element === endElement) {\n      return null;\n    }\n    element = element.parentElement;\n  }\n  return element;\n}\nfunction parseInsightsEvent(element) {\n  var serializedPayload = element.getAttribute('data-insights-event');\n  if (typeof serializedPayload !== 'string') {\n    throw new Error('The insights middleware expects `data-insights-event` to be a base64-encoded JSON string.');\n  }\n  try {\n    return (0, _utils.deserializePayload)(serializedPayload);\n  } catch (error) {\n    throw new Error('The insights middleware was unable to parse `data-insights-event`.');\n  }\n}\n\n/**\n * @deprecated use `sendEvent` directly instead\n */\nfunction withInsightsListener(BaseComponent) {\n  process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, 'The `withInsightsListener` function is deprecated and will be removed in the next major version. Please use `sendEvent` directly instead.') : void 0;\n  return function WithInsightsListener(props) {\n    var handleClick = createInsightsEventHandler(props);\n    return (0, _preact.h)(\"div\", {\n      onClick: handleClick\n    }, (0, _preact.h)(BaseComponent, props));\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/main.js",
    "content": "\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _InstantSearch = _interopRequireDefault(require(\"./InstantSearch\"));\n\nvar _version = _interopRequireDefault(require(\"./version\"));\n\nvar connectors = _interopRequireWildcard(require(\"../connectors/index\"));\n\nvar widgets = _interopRequireWildcard(require(\"../widgets/index\"));\n\nvar helpers = _interopRequireWildcard(require(\"../helpers/index\"));\n\nvar middlewares = _interopRequireWildcard(require(\"../middlewares/index\"));\n\nvar routers = _interopRequireWildcard(require(\"./routers/index\"));\n\nvar stateMappings = _interopRequireWildcard(require(\"./stateMappings/index\"));\n\nvar _index7 = require(\"./infiniteHitsCache/index\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * InstantSearch is the main component of InstantSearch.js. This object\n * manages the widget and lets you add new ones.\n *\n * Two parameters are required to get you started with InstantSearch.js:\n *  - `indexName`: the main index that you will use for your new search UI\n *  - `searchClient`: the search client to plug to InstantSearch.js\n *\n * The [search client provided by Algolia](https://github.com/algolia/algoliasearch-client-javascript)\n * needs an `appId` and an `apiKey`. Those parameters can be found in your\n * [Algolia dashboard](https://www.algolia.com/api-keys).\n *\n * If you want to get up and running quickly with InstantSearch.js, have a\n * look at the [getting started](getting-started.html).\n * @function instantsearch\n * @param {InstantSearchOptions} options The options\n */\nvar instantsearch = function instantsearch(options) {\n  return new _InstantSearch.default(options);\n};\n\ninstantsearch.routers = routers;\ninstantsearch.stateMappings = stateMappings;\ninstantsearch.connectors = connectors;\ninstantsearch.widgets = widgets;\ninstantsearch.version = _version.default;\ninstantsearch.createInfiniteHitsSessionStorageCache = _index7.createInfiniteHitsSessionStorageCache;\ninstantsearch.highlight = helpers.highlight;\ninstantsearch.reverseHighlight = helpers.reverseHighlight;\ninstantsearch.snippet = helpers.snippet;\ninstantsearch.reverseSnippet = helpers.reverseSnippet;\ninstantsearch.insights = helpers.insights;\ninstantsearch.middlewares = middlewares;\nvar _default = instantsearch;\nexports.default = _default;"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/routers/history.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = historyRouter;\nvar _qs = _interopRequireDefault(require(\"qs\"));\nvar _utils = require(\"../utils\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar setWindowTitle = function setWindowTitle(title) {\n  if (title) {\n    // This function is only executed on browsers so we can disable this check.\n    // eslint-disable-next-line no-restricted-globals\n    window.document.title = title;\n  }\n};\nvar BrowserHistory = /*#__PURE__*/function () {\n  /**\n   * Initializes a new storage provider that syncs the search state to the URL\n   * using web APIs (`window.location.pushState` and `onpopstate` event).\n   */\n  function BrowserHistory(_ref) {\n    var _this = this;\n    var windowTitle = _ref.windowTitle,\n      _ref$writeDelay = _ref.writeDelay,\n      writeDelay = _ref$writeDelay === void 0 ? 400 : _ref$writeDelay,\n      createURL = _ref.createURL,\n      parseURL = _ref.parseURL,\n      getLocation = _ref.getLocation,\n      start = _ref.start,\n      dispose = _ref.dispose,\n      push = _ref.push,\n      cleanUrlOnDispose = _ref.cleanUrlOnDispose;\n    _classCallCheck(this, BrowserHistory);\n    _defineProperty(this, \"$$type\", 'ais.browser');\n    /**\n     * Transforms a UI state into a title for the page.\n     */\n    _defineProperty(this, \"windowTitle\", void 0);\n    /**\n     * Time in milliseconds before performing a write in the history.\n     * It prevents from adding too many entries in the history and\n     * makes the back button more usable.\n     *\n     * @default 400\n     */\n    _defineProperty(this, \"writeDelay\", void 0);\n    /**\n     * Creates a full URL based on the route state.\n     * The storage adaptor maps all syncable keys to the query string of the URL.\n     */\n    _defineProperty(this, \"_createURL\", void 0);\n    /**\n     * Parses the URL into a route state.\n     * It should be symmetrical to `createURL`.\n     */\n    _defineProperty(this, \"parseURL\", void 0);\n    /**\n     * Returns the location to store in the history.\n     * @default () => window.location\n     */\n    _defineProperty(this, \"getLocation\", void 0);\n    _defineProperty(this, \"writeTimer\", void 0);\n    _defineProperty(this, \"_onPopState\", void 0);\n    /**\n     * Indicates if last action was back/forward in the browser.\n     */\n    _defineProperty(this, \"inPopState\", false);\n    /**\n     * Indicates whether the history router is disposed or not.\n     */\n    _defineProperty(this, \"isDisposed\", false);\n    /**\n     * Indicates the window.history.length before the last call to\n     * window.history.pushState (called in `write`).\n     * It allows to determine if a `pushState` has been triggered elsewhere,\n     * and thus to prevent the `write` method from calling `pushState`.\n     */\n    _defineProperty(this, \"latestAcknowledgedHistory\", 0);\n    _defineProperty(this, \"_start\", void 0);\n    _defineProperty(this, \"_dispose\", void 0);\n    _defineProperty(this, \"_push\", void 0);\n    _defineProperty(this, \"_cleanUrlOnDispose\", void 0);\n    this.windowTitle = windowTitle;\n    this.writeTimer = undefined;\n    this.writeDelay = writeDelay;\n    this._createURL = createURL;\n    this.parseURL = parseURL;\n    this.getLocation = getLocation;\n    this._start = start;\n    this._dispose = dispose;\n    this._push = push;\n    this._cleanUrlOnDispose = typeof cleanUrlOnDispose === 'undefined' ? true : cleanUrlOnDispose;\n    if (process.env.NODE_ENV === 'development' && typeof cleanUrlOnDispose === 'undefined') {\n      // eslint-disable-next-line no-console\n      console.info(\"Starting from the next major version, InstantSearch will not clean up the URL from active refinements when it is disposed.\\n\\nWe recommend setting `cleanUrlOnDispose` to false to adopt this change today.\\nTo stay with the current behaviour and remove this warning, set the option to true.\\n\\nSee documentation: \".concat((0, _utils.createDocumentationLink)({\n        name: 'history-router'\n      }), \"#widget-param-cleanurlondispose\"));\n    }\n    (0, _utils.safelyRunOnBrowser)(function (_ref2) {\n      var window = _ref2.window;\n      var title = _this.windowTitle && _this.windowTitle(_this.read());\n      setWindowTitle(title);\n      _this.latestAcknowledgedHistory = window.history.length;\n    });\n  }\n\n  /**\n   * Reads the URL and returns a syncable UI search state.\n   */\n  _createClass(BrowserHistory, [{\n    key: \"read\",\n    value: function read() {\n      return this.parseURL({\n        qsModule: _qs.default,\n        location: this.getLocation()\n      });\n    }\n\n    /**\n     * Pushes a search state into the URL.\n     */\n  }, {\n    key: \"write\",\n    value: function write(routeState) {\n      var _this2 = this;\n      (0, _utils.safelyRunOnBrowser)(function (_ref3) {\n        var window = _ref3.window;\n        var url = _this2.createURL(routeState);\n        var title = _this2.windowTitle && _this2.windowTitle(routeState);\n        if (_this2.writeTimer) {\n          clearTimeout(_this2.writeTimer);\n        }\n        _this2.writeTimer = setTimeout(function () {\n          setWindowTitle(title);\n          if (_this2.shouldWrite(url)) {\n            if (_this2._push) {\n              _this2._push(url);\n            } else {\n              window.history.pushState(routeState, title || '', url);\n            }\n            _this2.latestAcknowledgedHistory = window.history.length;\n          }\n          _this2.inPopState = false;\n          _this2.writeTimer = undefined;\n        }, _this2.writeDelay);\n      });\n    }\n\n    /**\n     * Sets a callback on the `onpopstate` event of the history API of the current page.\n     * It enables the URL sync to keep track of the changes.\n     */\n  }, {\n    key: \"onUpdate\",\n    value: function onUpdate(callback) {\n      var _this3 = this;\n      if (this._start) {\n        this._start(function () {\n          callback(_this3.read());\n        });\n      }\n      this._onPopState = function () {\n        if (_this3.writeTimer) {\n          clearTimeout(_this3.writeTimer);\n          _this3.writeTimer = undefined;\n        }\n        _this3.inPopState = true;\n\n        // We always read the state from the URL because the state of the history\n        // can be incorect in some cases (e.g. using React Router).\n        callback(_this3.read());\n      };\n      (0, _utils.safelyRunOnBrowser)(function (_ref4) {\n        var window = _ref4.window;\n        window.addEventListener('popstate', _this3._onPopState);\n      });\n    }\n\n    /**\n     * Creates a complete URL from a given syncable UI state.\n     *\n     * It always generates the full URL, not a relative one.\n     * This allows to handle cases like using a <base href>.\n     * See: https://github.com/algolia/instantsearch/issues/790\n     */\n  }, {\n    key: \"createURL\",\n    value: function createURL(routeState) {\n      var url = this._createURL({\n        qsModule: _qs.default,\n        routeState: routeState,\n        location: this.getLocation()\n      });\n      if (process.env.NODE_ENV === 'development') {\n        try {\n          // We just want to check if the URL is valid.\n          // eslint-disable-next-line no-new\n          new URL(url);\n        } catch (e) {\n          process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, \"The URL returned by the `createURL` function is invalid.\\nPlease make sure it returns an absolute URL to avoid issues, e.g: `https://algolia.com/search?query=iphone`.\") : void 0;\n        }\n      }\n      return url;\n    }\n\n    /**\n     * Removes the event listener and cleans up the URL.\n     */\n  }, {\n    key: \"dispose\",\n    value: function dispose() {\n      var _this4 = this;\n      if (this._dispose) {\n        this._dispose();\n      }\n      this.isDisposed = true;\n      (0, _utils.safelyRunOnBrowser)(function (_ref5) {\n        var window = _ref5.window;\n        if (_this4._onPopState) {\n          window.removeEventListener('popstate', _this4._onPopState);\n        }\n      });\n      if (this.writeTimer) {\n        clearTimeout(this.writeTimer);\n      }\n      if (this._cleanUrlOnDispose) {\n        this.write({});\n      }\n    }\n  }, {\n    key: \"start\",\n    value: function start() {\n      this.isDisposed = false;\n    }\n  }, {\n    key: \"shouldWrite\",\n    value: function shouldWrite(url) {\n      var _this5 = this;\n      return (0, _utils.safelyRunOnBrowser)(function (_ref6) {\n        var window = _ref6.window;\n        // When disposed and the cleanUrlOnDispose is set to false, we do not want to write the URL.\n        if (_this5.isDisposed && !_this5._cleanUrlOnDispose) {\n          return false;\n        }\n\n        // We do want to `pushState` if:\n        // - the router is not disposed, IS.js needs to update the URL\n        // OR\n        // - the last write was from InstantSearch.js\n        // (unlike a SPA, where it would have last written)\n        var lastPushWasByISAfterDispose = !(_this5.isDisposed && _this5.latestAcknowledgedHistory !== window.history.length);\n        return (\n          // When the last state change was through popstate, the IS.js state changes,\n          // but that should not write the URL.\n          !_this5.inPopState &&\n          // When the previous pushState after dispose was by IS.js, we want to write the URL.\n          lastPushWasByISAfterDispose &&\n          // When the URL is the same as the current one, we do not want to write it.\n          url !== window.location.href\n        );\n      });\n    }\n  }]);\n  return BrowserHistory;\n}();\nfunction historyRouter() {\n  var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n    _ref7$createURL = _ref7.createURL,\n    createURL = _ref7$createURL === void 0 ? function (_ref8) {\n      var qsModule = _ref8.qsModule,\n        routeState = _ref8.routeState,\n        location = _ref8.location;\n      var protocol = location.protocol,\n        hostname = location.hostname,\n        _location$port = location.port,\n        port = _location$port === void 0 ? '' : _location$port,\n        pathname = location.pathname,\n        hash = location.hash;\n      var queryString = qsModule.stringify(routeState);\n      var portWithPrefix = port === '' ? '' : \":\".concat(port);\n\n      // IE <= 11 has no proper `location.origin` so we cannot rely on it.\n      if (!queryString) {\n        return \"\".concat(protocol, \"//\").concat(hostname).concat(portWithPrefix).concat(pathname).concat(hash);\n      }\n      return \"\".concat(protocol, \"//\").concat(hostname).concat(portWithPrefix).concat(pathname, \"?\").concat(queryString).concat(hash);\n    } : _ref7$createURL,\n    _ref7$parseURL = _ref7.parseURL,\n    parseURL = _ref7$parseURL === void 0 ? function (_ref9) {\n      var qsModule = _ref9.qsModule,\n        location = _ref9.location;\n      // `qs` by default converts arrays with more than 20 items to an object.\n      // We want to avoid this because the data structure manipulated can therefore vary.\n      // Setting the limit to `100` seems a good number because the engine's default is 100\n      // (it can go up to 1000 but it is very unlikely to select more than 100 items in the UI).\n      //\n      // Using an `arrayLimit` of `n` allows `n + 1` items.\n      //\n      // See:\n      //   - https://github.com/ljharb/qs#parsing-arrays\n      //   - https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/\n      return qsModule.parse(location.search.slice(1), {\n        arrayLimit: 99\n      });\n    } : _ref7$parseURL,\n    _ref7$writeDelay = _ref7.writeDelay,\n    writeDelay = _ref7$writeDelay === void 0 ? 400 : _ref7$writeDelay,\n    windowTitle = _ref7.windowTitle,\n    _ref7$getLocation = _ref7.getLocation,\n    getLocation = _ref7$getLocation === void 0 ? function () {\n      return (0, _utils.safelyRunOnBrowser)(function (_ref10) {\n        var window = _ref10.window;\n        return window.location;\n      }, {\n        fallback: function fallback() {\n          throw new Error('You need to provide `getLocation` to the `history` router in environments where `window` does not exist.');\n        }\n      });\n    } : _ref7$getLocation,\n    start = _ref7.start,\n    dispose = _ref7.dispose,\n    push = _ref7.push,\n    cleanUrlOnDispose = _ref7.cleanUrlOnDispose;\n  return new BrowserHistory({\n    createURL: createURL,\n    parseURL: parseURL,\n    writeDelay: writeDelay,\n    windowTitle: windowTitle,\n    getLocation: getLocation,\n    start: start,\n    dispose: dispose,\n    push: push,\n    cleanUrlOnDispose: cleanUrlOnDispose\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/routers/index.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nObject.defineProperty(exports, \"history\", {\n  enumerable: true,\n  get: function get() {\n    return _history.default;\n  }\n});\nvar _history = _interopRequireDefault(require(\"./history\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/server.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.getInitialResults = getInitialResults;\nexports.waitForResults = waitForResults;\nvar _utils = require(\"./utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n/**\n * Waits for the results from the search instance to coordinate the next steps\n * in `getServerState()`.\n */\nfunction waitForResults(search) {\n  var skipRecommend = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n  var helper = search.mainHelper;\n\n  // Extract search parameters from the search client to use them\n  // later during hydration.\n  var requestParamsList;\n  var client = helper.getClient();\n  if (search.compositionID) {\n    helper.setClient(_objectSpread(_objectSpread({}, client), {}, {\n      search: function search(query) {\n        requestParamsList = [query.requestBody.params];\n        return client.search(query);\n      }\n    }));\n  } else {\n    helper.setClient(_objectSpread(_objectSpread({}, client), {}, {\n      search: function search(queries) {\n        requestParamsList = queries.map(function (_ref) {\n          var params = _ref.params;\n          return params;\n        });\n        return client.search(queries);\n      }\n    }));\n  }\n  if (search._hasSearchWidget) {\n    if (search.compositionID) {\n      helper.searchWithComposition();\n    } else {\n      helper.searchOnlyWithDerivedHelpers();\n    }\n  }\n  !skipRecommend && search._hasRecommendWidget && helper.recommend();\n  return new Promise(function (resolve, reject) {\n    var searchResultsReceived = !search._hasSearchWidget;\n    var recommendResultsReceived = !search._hasRecommendWidget || skipRecommend;\n    // All derived helpers resolve in the same tick so we're safe only relying\n    // on the first one.\n    helper.derivedHelpers[0].on('result', function () {\n      searchResultsReceived = true;\n      if (recommendResultsReceived) {\n        resolve(requestParamsList);\n      }\n    });\n    helper.derivedHelpers[0].on('recommend:result', function () {\n      recommendResultsReceived = true;\n      if (searchResultsReceived) {\n        resolve(requestParamsList);\n      }\n    });\n\n    // However, we listen to errors that can happen on any derived helper because\n    // any error is critical.\n    helper.on('error', function (error) {\n      reject(error);\n    });\n    search.on('error', function (error) {\n      reject(error);\n    });\n    helper.derivedHelpers.forEach(function (derivedHelper) {\n      return derivedHelper.on('error', function (error) {\n        reject(error);\n      });\n    });\n  });\n}\n\n/**\n * Walks the InstantSearch root index to construct the initial results.\n */\nfunction getInitialResults(rootIndex,\n/**\n * Search parameters sent to the search client,\n * returned by `waitForResults()`.\n */\nrequestParamsList) {\n  var initialResults = {};\n  var requestParamsIndex = 0;\n  (0, _utils.walkIndex)(rootIndex, function (widget) {\n    var _widget$getHelper;\n    var searchResults = widget.getResults();\n    var recommendResults = (_widget$getHelper = widget.getHelper()) === null || _widget$getHelper === void 0 ? void 0 : _widget$getHelper.lastRecommendResults;\n    if (searchResults || recommendResults) {\n      var _searchResults$_rawRe, _requestParams$, _requestParams$2;\n      var resultsCount = (searchResults === null || searchResults === void 0 ? void 0 : (_searchResults$_rawRe = searchResults._rawResults) === null || _searchResults$_rawRe === void 0 ? void 0 : _searchResults$_rawRe.length) || 0;\n      var requestParams = resultsCount ? requestParamsList === null || requestParamsList === void 0 ? void 0 : requestParamsList.slice(requestParamsIndex, requestParamsIndex + resultsCount) : [];\n      requestParamsIndex += resultsCount;\n      initialResults[widget.getIndexId()] = _objectSpread(_objectSpread(_objectSpread({}, searchResults && {\n        state: _objectSpread(_objectSpread({}, searchResults._state), {}, {\n          clickAnalytics: requestParams === null || requestParams === void 0 ? void 0 : (_requestParams$ = requestParams[0]) === null || _requestParams$ === void 0 ? void 0 : _requestParams$.clickAnalytics,\n          userToken: requestParams === null || requestParams === void 0 ? void 0 : (_requestParams$2 = requestParams[0]) === null || _requestParams$2 === void 0 ? void 0 : _requestParams$2.userToken\n        }),\n        results: searchResults._rawResults\n      }), recommendResults && {\n        recommendResults: {\n          // We have to stringify + parse because of some explicitly undefined values.\n          params: JSON.parse(JSON.stringify(recommendResults._state.params)),\n          results: recommendResults._rawResults\n        }\n      }), requestParams && {\n        requestParams: requestParams\n      });\n    }\n  });\n  if (Object.keys(initialResults).length === 0) {\n    throw new Error('The root index does not have any results. Make sure you have at least one widget that provides results.');\n  }\n  return initialResults;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/stateMappings/index.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nObject.defineProperty(exports, \"simple\", {\n  enumerable: true,\n  get: function get() {\n    return _simple.default;\n  }\n});\nObject.defineProperty(exports, \"singleIndex\", {\n  enumerable: true,\n  get: function get() {\n    return _singleIndex.default;\n  }\n});\nvar _simple = _interopRequireDefault(require(\"./simple\"));\nvar _singleIndex = _interopRequireDefault(require(\"./singleIndex\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/stateMappings/simple.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = simpleStateMapping;\nvar _excluded = [\"configure\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction getIndexStateWithoutConfigure(uiState) {\n  var configure = uiState.configure,\n    trackedUiState = _objectWithoutProperties(uiState, _excluded);\n  return trackedUiState;\n}\n\n// technically a URL could contain any key, since users provide it,\n// which is why the input to this function is UiState, not something\n// which excludes \"configure\" as this function does.\nfunction simpleStateMapping() {\n  return {\n    $$type: 'ais.simple',\n    stateToRoute: function stateToRoute(uiState) {\n      return Object.keys(uiState).reduce(function (state, indexId) {\n        return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, indexId, getIndexStateWithoutConfigure(uiState[indexId])));\n      }, {});\n    },\n    routeToState: function routeToState() {\n      var routeState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n      return Object.keys(routeState).reduce(function (state, indexId) {\n        return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, indexId, getIndexStateWithoutConfigure(routeState[indexId])));\n      }, {});\n    }\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/stateMappings/singleIndex.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = singleIndexStateMapping;\nvar _excluded = [\"configure\"];\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction getIndexStateWithoutConfigure(uiState) {\n  var configure = uiState.configure,\n    trackedUiState = _objectWithoutProperties(uiState, _excluded);\n  return trackedUiState;\n}\nfunction singleIndexStateMapping(indexName) {\n  return {\n    $$type: 'ais.singleIndex',\n    stateToRoute: function stateToRoute(uiState) {\n      return getIndexStateWithoutConfigure(uiState[indexName] || {});\n    },\n    routeToState: function routeToState() {\n      var routeState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n      return _defineProperty({}, indexName, getIndexStateWithoutConfigure(routeState));\n    }\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/suit.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.component = void 0;\nvar NAMESPACE = 'ais';\nvar component = exports.component = function component(componentName) {\n  return function () {\n    var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n      descendantName = _ref.descendantName,\n      modifierName = _ref.modifierName;\n    var descendent = descendantName ? \"-\".concat(descendantName) : '';\n    var modifier = modifierName ? \"--\".concat(modifierName) : '';\n    return \"\".concat(NAMESPACE, \"-\").concat(componentName).concat(descendent).concat(modifier);\n  };\n};"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/templating/index.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nvar _prepareTemplateProps = require(\"./prepareTemplateProps\");\nObject.keys(_prepareTemplateProps).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _prepareTemplateProps[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _prepareTemplateProps[key];\n    }\n  });\n});\nvar _renderTemplate = require(\"./renderTemplate\");\nObject.keys(_renderTemplate).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _renderTemplate[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _renderTemplate[key];\n    }\n  });\n});"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/templating/prepareTemplateProps.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.prepareTemplateProps = prepareTemplateProps;\nvar _uniq = require(\"../utils/uniq\");\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction prepareTemplates(\n// can not use = {} here, since the template could have different constraints\ndefaultTemplates) {\n  var templates = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  var allKeys = (0, _uniq.uniq)([].concat(_toConsumableArray(Object.keys(defaultTemplates || {})), _toConsumableArray(Object.keys(templates))));\n  return allKeys.reduce(function (config, key) {\n    var defaultTemplate = defaultTemplates ? defaultTemplates[key] : undefined;\n    var customTemplate = templates[key];\n    var isCustomTemplate = customTemplate !== undefined && customTemplate !== defaultTemplate;\n    config.templates[key] = isCustomTemplate ? customTemplate : defaultTemplate;\n    config.useCustomCompileOptions[key] = isCustomTemplate;\n    return config;\n  }, {\n    // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n    templates: {},\n    // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n    useCustomCompileOptions: {}\n  });\n}\n\n/**\n * Prepares an object to be passed to the Template widget\n */\nfunction prepareTemplateProps(_ref) {\n  var defaultTemplates = _ref.defaultTemplates,\n    templates = _ref.templates,\n    templatesConfig = _ref.templatesConfig;\n  var preparedTemplates = prepareTemplates(defaultTemplates, templates);\n  return _objectSpread({\n    templatesConfig: templatesConfig\n  }, preparedTemplates);\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/templating/renderTemplate.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.renderTemplate = renderTemplate;\nvar _hogan = _interopRequireDefault(require(\"hogan.js\"));\nvar _preact = require(\"htm/preact\");\nvar _components = require(\"../../helpers/components\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n// We add all our template helper methods to the template as lambdas. Note\n// that lambdas in Mustache are supposed to accept a second argument of\n// `render` to get the rendered value, not the literal `{{value}}`. But\n// this is currently broken (see https://github.com/twitter/hogan.js/issues/222).\nfunction transformHelpersToHogan() {\n  var helpers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var compileOptions = arguments.length > 1 ? arguments[1] : undefined;\n  var data = arguments.length > 2 ? arguments[2] : undefined;\n  return Object.keys(helpers).reduce(function (acc, helperKey) {\n    return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, helperKey, function () {\n      var _this = this;\n      return function (text) {\n        var render = function render(value) {\n          return _hogan.default.compile(value, compileOptions).render(_this);\n        };\n        return helpers[helperKey].call(data, text, render);\n      };\n    }));\n  }, {});\n}\nfunction renderTemplate(_ref) {\n  var templates = _ref.templates,\n    templateKey = _ref.templateKey,\n    compileOptions = _ref.compileOptions,\n    helpers = _ref.helpers,\n    data = _ref.data,\n    bindEvent = _ref.bindEvent,\n    sendEvent = _ref.sendEvent;\n  var template = templates[templateKey];\n  if (typeof template !== 'string' && typeof template !== 'function') {\n    throw new Error(\"Template must be 'string' or 'function', was '\".concat(_typeof(template), \"' (key: \").concat(templateKey, \")\"));\n  }\n  if (typeof template === 'function') {\n    // @MAJOR no longer pass bindEvent when string templates are removed\n    var params = bindEvent || {};\n    params.html = _preact.html;\n    params.sendEvent = sendEvent;\n    params.components = {\n      Highlight: _components.Highlight,\n      ReverseHighlight: _components.ReverseHighlight,\n      Snippet: _components.Snippet,\n      ReverseSnippet: _components.ReverseSnippet\n    };\n\n    // @MAJOR remove the `as any` when string templates are removed\n    // needed because not every template receives sendEvent\n    return template(data, params);\n  }\n  var transformedHelpers = transformHelpersToHogan(helpers, compileOptions, data);\n  return _hogan.default.compile(template, compileOptions).render(_objectSpread(_objectSpread({}, data), {}, {\n    helpers: transformedHelpers\n  })).replace(/[ \\n\\r\\t\\f\\xA0]+/g, function (spaces) {\n    return spaces.replace(/(^|\\xA0+)[^\\xA0]+/g, '$1 ');\n  }).trim();\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/addWidgetId.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.addWidgetId = addWidgetId;\nexports.resetWidgetId = resetWidgetId;\nvar id = 0;\nfunction addWidgetId(widget) {\n  if (widget.dependsOn !== 'recommend') {\n    return;\n  }\n  widget.$$id = id++;\n}\nfunction resetWidgetId() {\n  id = 0;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/capitalize.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.capitalize = capitalize;\nfunction capitalize(text) {\n  return text.toString().charAt(0).toUpperCase() + text.toString().slice(1);\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/checkIndexUiState.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.checkIndexUiState = checkIndexUiState;\nvar _capitalize = require(\"./capitalize\");\nvar _logger = require(\"./logger\");\nvar _typedObject = require(\"./typedObject\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n// Some connectors are responsible for multiple widgets so we need\n// to map them.\nfunction getWidgetNames(connectorName) {\n  switch (connectorName) {\n    case 'range':\n      return [];\n    case 'menu':\n      return ['menu', 'menuSelect'];\n    default:\n      return [connectorName];\n  }\n}\nvar stateToWidgetsMap = {\n  query: {\n    connectors: ['connectSearchBox'],\n    widgets: ['ais.searchBox', 'ais.autocomplete', 'ais.voiceSearch']\n  },\n  refinementList: {\n    connectors: ['connectRefinementList'],\n    widgets: ['ais.refinementList']\n  },\n  menu: {\n    connectors: ['connectMenu'],\n    widgets: ['ais.menu']\n  },\n  hierarchicalMenu: {\n    connectors: ['connectHierarchicalMenu'],\n    widgets: ['ais.hierarchicalMenu']\n  },\n  numericMenu: {\n    connectors: ['connectNumericMenu'],\n    widgets: ['ais.numericMenu']\n  },\n  ratingMenu: {\n    connectors: ['connectRatingMenu'],\n    widgets: ['ais.ratingMenu']\n  },\n  range: {\n    connectors: ['connectRange'],\n    widgets: ['ais.rangeInput', 'ais.rangeSlider', 'ais.range']\n  },\n  toggle: {\n    connectors: ['connectToggleRefinement'],\n    widgets: ['ais.toggleRefinement']\n  },\n  geoSearch: {\n    connectors: ['connectGeoSearch'],\n    widgets: ['ais.geoSearch']\n  },\n  sortBy: {\n    connectors: ['connectSortBy'],\n    widgets: ['ais.sortBy']\n  },\n  page: {\n    connectors: ['connectPagination'],\n    widgets: ['ais.pagination', 'ais.infiniteHits']\n  },\n  hitsPerPage: {\n    connectors: ['connectHitsPerPage'],\n    widgets: ['ais.hitsPerPage']\n  },\n  configure: {\n    connectors: ['connectConfigure'],\n    widgets: ['ais.configure']\n  },\n  places: {\n    connectors: [],\n    widgets: ['ais.places']\n  }\n};\nfunction checkIndexUiState(_ref) {\n  var index = _ref.index,\n    indexUiState = _ref.indexUiState;\n  var mountedWidgets = index.getWidgets().map(function (widget) {\n    return widget.$$type;\n  }).filter(Boolean);\n  var missingWidgets = (0, _typedObject.keys)(indexUiState).reduce(function (acc, parameter) {\n    var widgetUiState = stateToWidgetsMap[parameter];\n    if (!widgetUiState) {\n      return acc;\n    }\n    var requiredWidgets = widgetUiState.widgets;\n    if (requiredWidgets && !requiredWidgets.some(function (requiredWidget) {\n      return mountedWidgets.includes(requiredWidget);\n    })) {\n      acc.push([parameter, {\n        connectors: widgetUiState.connectors,\n        widgets: widgetUiState.widgets.map(function (widgetIdentifier) {\n          return widgetIdentifier.split('ais.')[1];\n        })\n      }]);\n    }\n    return acc;\n  }, []);\n  process.env.NODE_ENV === 'development' ? (0, _logger.warning)(missingWidgets.length === 0, \"The UI state for the index \\\"\".concat(index.getIndexId(), \"\\\" is not consistent with the widgets mounted.\\n\\nThis can happen when the UI state is specified via `initialUiState`, `routing` or `setUiState` but that the widgets responsible for this state were not added. This results in those query parameters not being sent to the API.\\n\\nTo fully reflect the state, some widgets need to be added to the index \\\"\").concat(index.getIndexId(), \"\\\":\\n\\n\").concat(missingWidgets.map(function (_ref2) {\n    var _ref4;\n    var _ref3 = _slicedToArray(_ref2, 2),\n      stateParameter = _ref3[0],\n      widgets = _ref3[1].widgets;\n    return \"- `\".concat(stateParameter, \"` needs one of these widgets: \").concat((_ref4 = []).concat.apply(_ref4, _toConsumableArray(widgets.map(function (name) {\n      return getWidgetNames(name);\n    }))).map(function (name) {\n      return \"\\\"\".concat(name, \"\\\"\");\n    }).join(', '));\n  }).join('\\n'), \"\\n\\nIf you do not wish to display widgets but still want to support their search parameters, you can mount \\\"virtual widgets\\\" that don't render anything:\\n\\n```\\n\").concat(missingWidgets.filter(function (_ref5) {\n    var _ref6 = _slicedToArray(_ref5, 2),\n      _stateParameter = _ref6[0],\n      connectors = _ref6[1].connectors;\n    return connectors.length > 0;\n  }).map(function (_ref7) {\n    var _ref8 = _slicedToArray(_ref7, 2),\n      _stateParameter = _ref8[0],\n      _ref8$ = _ref8[1],\n      connectors = _ref8$.connectors,\n      widgets = _ref8$.widgets;\n    var capitalizedWidget = (0, _capitalize.capitalize)(widgets[0]);\n    var connectorName = connectors[0];\n    return \"const virtual\".concat(capitalizedWidget, \" = \").concat(connectorName, \"(() => null);\");\n  }).join('\\n'), \"\\n\\nsearch.addWidgets([\\n  \").concat(missingWidgets.filter(function (_ref9) {\n    var _ref10 = _slicedToArray(_ref9, 2),\n      _stateParameter = _ref10[0],\n      connectors = _ref10[1].connectors;\n    return connectors.length > 0;\n  }).map(function (_ref11) {\n    var _ref12 = _slicedToArray(_ref11, 2),\n      _stateParameter = _ref12[0],\n      widgets = _ref12[1].widgets;\n    var capitalizedWidget = (0, _capitalize.capitalize)(widgets[0]);\n    return \"virtual\".concat(capitalizedWidget, \"({ /* ... */ })\");\n  }).join(',\\n  '), \"\\n]);\\n```\\n\\nIf you're using custom widgets that do set these query parameters, we recommend using connectors instead.\\n\\nSee https://www.algolia.com/doc/guides/building-search-ui/widgets/customize-an-existing-widget/js/#customize-the-complete-ui-of-the-widgets\")) : void 0;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/checkRendering.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.checkRendering = checkRendering;\nvar _getObjectType = require(\"./getObjectType\");\nfunction checkRendering(rendering, usage) {\n  if (rendering === undefined || typeof rendering !== 'function') {\n    throw new Error(\"The render function is not valid (received type \".concat((0, _getObjectType.getObjectType)(rendering), \").\\n\\n\").concat(usage));\n  }\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/clearRefinements.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.clearRefinements = clearRefinements;\n/**\n * Clears the refinements of a SearchParameters object based on rules provided.\n * The included attributes list is applied before the excluded attributes list. If the list\n * is not provided, this list of all the currently refined attributes is used as included attributes.\n * @returns search parameters with refinements cleared\n */\nfunction clearRefinements(_ref) {\n  var helper = _ref.helper,\n    _ref$attributesToClea = _ref.attributesToClear,\n    attributesToClear = _ref$attributesToClea === void 0 ? [] : _ref$attributesToClea;\n  var finalState = helper.state.setPage(0);\n  finalState = attributesToClear.reduce(function (state, attribute) {\n    if (finalState.isNumericRefined(attribute)) {\n      return state.removeNumericRefinement(attribute);\n    }\n    if (finalState.isHierarchicalFacet(attribute)) {\n      return state.removeHierarchicalFacetRefinement(attribute);\n    }\n    if (finalState.isDisjunctiveFacet(attribute)) {\n      return state.removeDisjunctiveFacetRefinement(attribute);\n    }\n    if (finalState.isConjunctiveFacet(attribute)) {\n      return state.removeFacetRefinement(attribute);\n    }\n    return state;\n  }, finalState);\n  if (attributesToClear.indexOf('query') !== -1) {\n    finalState = finalState.setQuery('');\n  }\n  return finalState;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/concatHighlightedParts.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.concatHighlightedParts = concatHighlightedParts;\nvar _escapeHighlight = require(\"./escape-highlight\");\nfunction concatHighlightedParts(parts) {\n  var highlightPreTag = _escapeHighlight.TAG_REPLACEMENT.highlightPreTag,\n    highlightPostTag = _escapeHighlight.TAG_REPLACEMENT.highlightPostTag;\n  return parts.map(function (part) {\n    return part.isHighlighted ? highlightPreTag + part.value + highlightPostTag : part.value;\n  }).join('');\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/convertNumericRefinementsToFilters.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.convertNumericRefinementsToFilters = convertNumericRefinementsToFilters;\n\nfunction convertNumericRefinementsToFilters(state, attribute) {\n  if (!state) {\n    return null;\n  }\n\n  var filtersObj = state.numericRefinements[attribute];\n  /*\n    filtersObj === {\n      \"<=\": [10],\n      \"=\": [],\n      \">=\": [5]\n    }\n  */\n\n  var filters = [];\n  Object.keys(filtersObj).filter(function (operator) {\n    return Array.isArray(filtersObj[operator]) && filtersObj[operator].length > 0;\n  }).forEach(function (operator) {\n    filtersObj[operator].forEach(function (value) {\n      filters.push(\"\".concat(attribute).concat(operator).concat(value));\n    });\n  });\n  return filters;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/createConcurrentSafePromise.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.createConcurrentSafePromise = createConcurrentSafePromise;\n// copied from\n// https://github.com/algolia/autocomplete.js/blob/307a7acc4283e10a19cb7d067f04f1bea79dc56f/packages/autocomplete-core/src/utils/createConcurrentSafePromise.ts#L1:L1\n/**\n * Creates a runner that executes promises in a concurrent-safe way.\n *\n * This is useful to prevent older promises to resolve after a newer promise,\n * otherwise resulting in stale resolved values.\n */\nfunction createConcurrentSafePromise() {\n  var basePromiseId = -1;\n  var latestResolvedId = -1;\n  var latestResolvedValue = undefined;\n  return function runConcurrentSafePromise(promise) {\n    var currentPromiseId = ++basePromiseId;\n    return Promise.resolve(promise).then(function (x) {\n      // The promise might take too long to resolve and get outdated. This would\n      // result in resolving stale values.\n      // When this happens, we ignore the promise value and return the one\n      // coming from the latest resolved value.\n      //\n      // +----------------------------------+\n      // |        100ms                     |\n      // | run(1) +--->  R1                 |\n      // |        300ms                     |\n      // | run(2) +-------------> R2 (SKIP) |\n      // |        200ms                     |\n      // | run(3) +--------> R3             |\n      // +----------------------------------+\n      if (latestResolvedValue && currentPromiseId < latestResolvedId) {\n        return latestResolvedValue;\n      }\n      latestResolvedId = currentPromiseId;\n      latestResolvedValue = x;\n      return x;\n    });\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/createSendEventForFacet.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.createSendEventForFacet = createSendEventForFacet;\nvar _isFacetRefined = require(\"./isFacetRefined\");\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction createSendEventForFacet(_ref) {\n  var instantSearchInstance = _ref.instantSearchInstance,\n    helper = _ref.helper,\n    attr = _ref.attribute,\n    widgetType = _ref.widgetType;\n  var sendEventForFacet = function sendEventForFacet() {\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    var facetValue = args[1],\n      _args$ = args[2],\n      eventName = _args$ === void 0 ? 'Filter Applied' : _args$,\n      _args$2 = args[3],\n      additionalData = _args$2 === void 0 ? {} : _args$2;\n    var _args$0$split = args[0].split(':'),\n      _args$0$split2 = _slicedToArray(_args$0$split, 2),\n      eventType = _args$0$split2[0],\n      eventModifier = _args$0$split2[1];\n    var attribute = typeof attr === 'string' ? attr : attr(facetValue);\n    if (args.length === 1 && _typeof(args[0]) === 'object') {\n      instantSearchInstance.sendEventToInsights(args[0]);\n    } else if (eventType === 'click' && args.length >= 2 && args.length <= 4) {\n      if (!(0, _isFacetRefined.isFacetRefined)(helper, attribute, facetValue)) {\n        var _helper$lastResults;\n        // send event only when the facet is being checked \"ON\"\n        instantSearchInstance.sendEventToInsights({\n          insightsMethod: 'clickedFilters',\n          widgetType: widgetType,\n          eventType: eventType,\n          eventModifier: eventModifier,\n          payload: _objectSpread({\n            eventName: eventName,\n            index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,\n            filters: [\"\".concat(attribute, \":\").concat(facetValue)]\n          }, additionalData),\n          attribute: attribute\n        });\n      }\n    } else if (process.env.NODE_ENV === 'development') {\n      throw new Error(\"You need to pass between two and four arguments like:\\n  sendEvent('click', facetValue, eventName?, additionalData?);\\n\\nIf you want to send a custom payload, you can pass one object: sendEvent(customPayload);\\n\");\n    }\n  };\n  return sendEventForFacet;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/createSendEventForHits.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports._buildEventPayloadsForHits = _buildEventPayloadsForHits;\nexports.createBindEventForHits = createBindEventForHits;\nexports.createSendEventForHits = createSendEventForHits;\nvar _serializer = require(\"./serializer\");\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction chunk(arr) {\n  var chunkSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 20;\n  var chunks = [];\n  for (var i = 0; i < Math.ceil(arr.length / chunkSize); i++) {\n    chunks.push(arr.slice(i * chunkSize, (i + 1) * chunkSize));\n  }\n  return chunks;\n}\nfunction _buildEventPayloadsForHits(_ref) {\n  var helper = _ref.helper,\n    widgetType = _ref.widgetType,\n    methodName = _ref.methodName,\n    args = _ref.args,\n    instantSearchInstance = _ref.instantSearchInstance;\n  // when there's only one argument, that means it's custom\n  if (args.length === 1 && _typeof(args[0]) === 'object') {\n    return [args[0]];\n  }\n  var _args$0$split = args[0].split(':'),\n    _args$0$split2 = _slicedToArray(_args$0$split, 2),\n    eventType = _args$0$split2[0],\n    eventModifier = _args$0$split2[1];\n  var hits = args[1];\n  var eventName = args[2];\n  var additionalData = args[3] || {};\n  if (!hits) {\n    if (process.env.NODE_ENV === 'development') {\n      throw new Error(\"You need to pass hit or hits as the second argument like:\\n  \".concat(methodName, \"(eventType, hit);\\n  \"));\n    } else {\n      return [];\n    }\n  }\n  if ((eventType === 'click' || eventType === 'conversion') && !eventName) {\n    if (process.env.NODE_ENV === 'development') {\n      throw new Error(\"You need to pass eventName as the third argument for 'click' or 'conversion' events like:\\n  \".concat(methodName, \"('click', hit, 'Product Purchased');\\n\\n  To learn more about event naming: https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/in-depth/clicks-conversions-best-practices/\\n  \"));\n    } else {\n      return [];\n    }\n  }\n  var hitsArray = Array.isArray(hits) ? hits : [hits];\n  if (hitsArray.length === 0) {\n    return [];\n  }\n  var queryID = hitsArray[0].__queryID;\n  var hitsChunks = chunk(hitsArray);\n  var objectIDsByChunk = hitsChunks.map(function (batch) {\n    return batch.map(function (hit) {\n      return hit.objectID;\n    });\n  });\n  var positionsByChunk = hitsChunks.map(function (batch) {\n    return batch.map(function (hit) {\n      return hit.__position;\n    });\n  });\n  if (eventType === 'view') {\n    if (instantSearchInstance.status !== 'idle') {\n      return [];\n    }\n    return hitsChunks.map(function (batch, i) {\n      var _helper$lastResults;\n      return {\n        insightsMethod: 'viewedObjectIDs',\n        widgetType: widgetType,\n        eventType: eventType,\n        payload: _objectSpread({\n          eventName: eventName || 'Hits Viewed',\n          index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,\n          objectIDs: objectIDsByChunk[i]\n        }, additionalData),\n        hits: batch,\n        eventModifier: eventModifier\n      };\n    });\n  } else if (eventType === 'click') {\n    return hitsChunks.map(function (batch, i) {\n      var _helper$lastResults2;\n      return {\n        insightsMethod: 'clickedObjectIDsAfterSearch',\n        widgetType: widgetType,\n        eventType: eventType,\n        payload: _objectSpread({\n          eventName: eventName || 'Hit Clicked',\n          index: ((_helper$lastResults2 = helper.lastResults) === null || _helper$lastResults2 === void 0 ? void 0 : _helper$lastResults2.index) || helper.state.index,\n          queryID: queryID,\n          objectIDs: objectIDsByChunk[i],\n          positions: positionsByChunk[i]\n        }, additionalData),\n        hits: batch,\n        eventModifier: eventModifier\n      };\n    });\n  } else if (eventType === 'conversion') {\n    return hitsChunks.map(function (batch, i) {\n      var _helper$lastResults3;\n      return {\n        insightsMethod: 'convertedObjectIDsAfterSearch',\n        widgetType: widgetType,\n        eventType: eventType,\n        payload: _objectSpread({\n          eventName: eventName || 'Hit Converted',\n          index: ((_helper$lastResults3 = helper.lastResults) === null || _helper$lastResults3 === void 0 ? void 0 : _helper$lastResults3.index) || helper.state.index,\n          queryID: queryID,\n          objectIDs: objectIDsByChunk[i]\n        }, additionalData),\n        hits: batch,\n        eventModifier: eventModifier\n      };\n    });\n  } else if (process.env.NODE_ENV === 'development') {\n    throw new Error(\"eventType(\\\"\".concat(eventType, \"\\\") is not supported.\\n    If you want to send a custom payload, you can pass one object: \").concat(methodName, \"(customPayload);\\n    \"));\n  } else {\n    return [];\n  }\n}\nfunction createSendEventForHits(_ref2) {\n  var instantSearchInstance = _ref2.instantSearchInstance,\n    helper = _ref2.helper,\n    widgetType = _ref2.widgetType;\n  var sentEvents = {};\n  var timer = undefined;\n  var sendEventForHits = function sendEventForHits() {\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    var payloads = _buildEventPayloadsForHits({\n      widgetType: widgetType,\n      helper: helper,\n      methodName: 'sendEvent',\n      args: args,\n      instantSearchInstance: instantSearchInstance\n    });\n    payloads.forEach(function (payload) {\n      if (payload.eventType === 'click' && payload.eventModifier === 'internal' && sentEvents[payload.eventType]) {\n        return;\n      }\n      sentEvents[payload.eventType] = true;\n      instantSearchInstance.sendEventToInsights(payload);\n    });\n    clearTimeout(timer);\n    timer = setTimeout(function () {\n      sentEvents = {};\n    }, 0);\n  };\n  return sendEventForHits;\n}\nfunction createBindEventForHits(_ref3) {\n  var helper = _ref3.helper,\n    widgetType = _ref3.widgetType,\n    instantSearchInstance = _ref3.instantSearchInstance;\n  var bindEventForHits = function bindEventForHits() {\n    for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n      args[_key2] = arguments[_key2];\n    }\n    var payloads = _buildEventPayloadsForHits({\n      widgetType: widgetType,\n      helper: helper,\n      methodName: 'bindEvent',\n      args: args,\n      instantSearchInstance: instantSearchInstance\n    });\n    return payloads.length ? \"data-insights-event=\".concat((0, _serializer.serializePayload)(payloads)) : '';\n  };\n  return bindEventForHits;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/cx.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.cx = cx;\n\nfunction cx(cssClasses) {\n  return Array.isArray(cssClasses) ? cssClasses.filter(Boolean).join(' ') : cssClasses || '';\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/debounce.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.debounce = debounce;\n// Debounce a function call to the trailing edge.\n// The debounced function returns a promise.\nfunction debounce(func, wait) {\n  var lastTimeout = null;\n  return function () {\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    return new Promise(function (resolve, reject) {\n      if (lastTimeout) {\n        clearTimeout(lastTimeout);\n      }\n      lastTimeout = setTimeout(function () {\n        lastTimeout = null;\n        Promise.resolve(func.apply(void 0, args)).then(resolve).catch(reject);\n      }, wait);\n    });\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/defer.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.defer = defer;\nvar nextMicroTask = Promise.resolve();\nfunction defer(callback) {\n  var progress = null;\n  var cancelled = false;\n  var fn = function fn() {\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    if (progress !== null) {\n      return;\n    }\n    progress = nextMicroTask.then(function () {\n      progress = null;\n      if (cancelled) {\n        cancelled = false;\n        return;\n      }\n      callback.apply(void 0, args);\n    });\n  };\n  fn.wait = function () {\n    if (progress === null) {\n      throw new Error('The deferred function should be called before calling `wait()`');\n    }\n    return progress;\n  };\n  fn.cancel = function () {\n    if (progress === null) {\n      return;\n    }\n    cancelled = true;\n  };\n  return fn;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/detect-insights-client.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.hasDetectedInsightsClient = hasDetectedInsightsClient;\n\nvar _safelyRunOnBrowser = require(\"./safelyRunOnBrowser.js\");\n\nfunction hasDetectedInsightsClient() {\n  return (0, _safelyRunOnBrowser.safelyRunOnBrowser)(function (_ref) {\n    var window = _ref.window;\n    return Boolean(window.AlgoliaAnalyticsObject);\n  }, {\n    fallback: function fallback() {\n      return false;\n    }\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/documentation.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.createDocumentationLink = createDocumentationLink;\nexports.createDocumentationMessageGenerator = createDocumentationMessageGenerator;\nfunction createDocumentationLink(_ref) {\n  var name = _ref.name,\n    _ref$connector = _ref.connector,\n    connector = _ref$connector === void 0 ? false : _ref$connector;\n  return ['https://www.algolia.com/doc/api-reference/widgets/', name, '/js/', connector ? '#connector' : ''].join('');\n}\nfunction createDocumentationMessageGenerator() {\n  for (var _len = arguments.length, widgets = new Array(_len), _key = 0; _key < _len; _key++) {\n    widgets[_key] = arguments[_key];\n  }\n  var links = widgets.map(function (widget) {\n    return createDocumentationLink(widget);\n  }).join(', ');\n  return function (message) {\n    return [message, \"See documentation: \".concat(links)].filter(Boolean).join('\\n\\n');\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/escape-highlight.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.TAG_REPLACEMENT = exports.TAG_PLACEHOLDER = void 0;\nexports.escapeFacets = escapeFacets;\nexports.escapeHits = escapeHits;\nvar _escapeHtml = require(\"./escape-html\");\nvar _isPlainObject = require(\"./isPlainObject\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError(\"Cannot destructure \" + obj); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar TAG_PLACEHOLDER = exports.TAG_PLACEHOLDER = {\n  highlightPreTag: '__ais-highlight__',\n  highlightPostTag: '__/ais-highlight__'\n};\nvar TAG_REPLACEMENT = exports.TAG_REPLACEMENT = {\n  highlightPreTag: '<mark>',\n  highlightPostTag: '</mark>'\n};\n\n// @MAJOR: in the future, this should only escape, not replace\nfunction replaceTagsAndEscape(value) {\n  return (0, _escapeHtml.escape)(value).replace(new RegExp(TAG_PLACEHOLDER.highlightPreTag, 'g'), TAG_REPLACEMENT.highlightPreTag).replace(new RegExp(TAG_PLACEHOLDER.highlightPostTag, 'g'), TAG_REPLACEMENT.highlightPostTag);\n}\nfunction recursiveEscape(input) {\n  if ((0, _isPlainObject.isPlainObject)(input) && typeof input.value !== 'string') {\n    return Object.keys(input).reduce(function (acc, key) {\n      return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, recursiveEscape(input[key])));\n    }, {});\n  }\n  if (Array.isArray(input)) {\n    return input.map(recursiveEscape);\n  }\n  return _objectSpread(_objectSpread({}, input), {}, {\n    value: replaceTagsAndEscape(input.value)\n  });\n}\nfunction escapeHits(hits) {\n  if (hits.__escaped === undefined) {\n    // We don't override the value on hit because it will mutate the raw results\n    // instead we make a shallow copy and we assign the escaped values on it.\n    hits = hits.map(function (_ref) {\n      var hit = _extends({}, (_objectDestructuringEmpty(_ref), _ref));\n      if (hit._highlightResult) {\n        hit._highlightResult = recursiveEscape(hit._highlightResult);\n      }\n      if (hit._snippetResult) {\n        hit._snippetResult = recursiveEscape(hit._snippetResult);\n      }\n      return hit;\n    });\n    hits.__escaped = true;\n  }\n  return hits;\n}\nfunction escapeFacets(facetHits) {\n  return facetHits.map(function (h) {\n    return _objectSpread(_objectSpread({}, h), {}, {\n      highlighted: replaceTagsAndEscape(h.highlighted)\n    });\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/escape-html.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.escape = escape;\nexports.unescape = unescape;\n/**\n * This implementation is taken from Lodash implementation.\n * See: https://github.com/lodash/lodash/blob/4.17.11-npm/escape.js\n */\n\n// Used to map characters to HTML entities.\nvar htmlEntities = {\n  '&': '&amp;',\n  '<': '&lt;',\n  '>': '&gt;',\n  '\"': '&quot;',\n  \"'\": '&#39;'\n};\n\n// Used to match HTML entities and HTML characters.\nvar regexUnescapedHtml = /[&<>\"']/g;\nvar regexHasUnescapedHtml = RegExp(regexUnescapedHtml.source);\n\n/**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n */\nfunction escape(value) {\n  return value && regexHasUnescapedHtml.test(value) ? value.replace(regexUnescapedHtml, function (character) {\n    return htmlEntities[character];\n  }) : value;\n}\n\n/**\n * This implementation is taken from Lodash implementation.\n * See: https://github.com/lodash/lodash/blob/4.17.11-npm/unescape.js\n */\n\n// Used to map HTML entities to characters.\nvar htmlCharacters = {\n  '&amp;': '&',\n  '&lt;': '<',\n  '&gt;': '>',\n  '&quot;': '\"',\n  '&#39;': \"'\"\n};\n\n// Used to match HTML entities and HTML characters.\nvar regexEscapedHtml = /&(amp|quot|lt|gt|#39);/g;\nvar regexHasEscapedHtml = RegExp(regexEscapedHtml.source);\n\n/**\n * Converts the HTML entities \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * characters.\n */\nfunction unescape(value) {\n  return value && regexHasEscapedHtml.test(value) ? value.replace(regexEscapedHtml, function (character) {\n    return htmlCharacters[character];\n  }) : value;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/escape.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\n/**\n * This implementation is taken from Lodash implementation.\n * See: https://github.com/lodash/lodash/blob/4.17.11-npm/escape.js\n */\n// Used to map characters to HTML entities.\nvar htmlEscapes = {\n  '&': '&amp;',\n  '<': '&lt;',\n  '>': '&gt;',\n  '\"': '&quot;',\n  \"'\": '&#39;'\n}; // Used to match HTML entities and HTML characters.\n\nvar regexUnescapedHtml = /[&<>\"']/g;\nvar regexHasUnescapedHtml = RegExp(regexUnescapedHtml.source);\n/**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n */\n\nfunction escape(value) {\n  return value && regexHasUnescapedHtml.test(value) ? value.replace(regexUnescapedHtml, function (character) {\n    return htmlEscapes[character];\n  }) : value;\n}\n\nvar _default = escape;\nexports.default = _default;"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/escapeFacetValue.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.escapeFacetValue = escapeFacetValue;\nexports.unescapeFacetValue = unescapeFacetValue;\nfunction unescapeFacetValue(value) {\n  if (typeof value === 'string') {\n    return value.replace(/^\\\\-/, '-');\n  }\n  return value;\n}\nfunction escapeFacetValue(value) {\n  if (typeof value === 'number' && value < 0 || typeof value === 'string') {\n    return String(value).replace(/^-/, '\\\\-');\n  }\n  return value;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/escapeRefinement.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nfunction escapeRefinement(value) {\n  if (typeof value === 'number' && value < 0) {\n    value = String(value).replace(/^-/, '\\\\-');\n  }\n\n  return value;\n}\n\nvar _default = escapeRefinement;\nexports.default = _default;"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/find.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.find = find;\n// We aren't using the native `Array.prototype.find` because the refactor away from Lodash is not\n// published as a major version.\n// Relying on the `find` polyfill on user-land, which before was only required for niche use-cases,\n// was decided as too risky.\n// @MAJOR Replace with the native `Array.prototype.find` method\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\nfunction find(items, predicate) {\n  var value;\n  for (var i = 0; i < items.length; i++) {\n    value = items[i];\n    // inlined for performance: if (Call(predicate, thisArg, [value, i, list])) {\n    if (predicate(value, i, items)) {\n      return value;\n    }\n  }\n  return undefined;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/findIndex.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.findIndex = findIndex;\n// We aren't using the native `Array.prototype.findIndex` because the refactor away from Lodash is not\n// published as a major version.\n// Relying on the `findIndex` polyfill on user-land, which before was only required for niche use-cases,\n// was decided as too risky.\n// @MAJOR Replace with the native `Array.prototype.findIndex` method\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex\nfunction findIndex(array, comparator) {\n  if (!Array.isArray(array)) {\n    return -1;\n  }\n  for (var i = 0; i < array.length; i++) {\n    if (comparator(array[i])) {\n      return i;\n    }\n  }\n  return -1;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/geo-search.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.aroundLatLngToPosition = aroundLatLngToPosition;\nexports.insideBoundingBoxToBoundingBox = insideBoundingBoxToBoundingBox;\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nvar latLngRegExp = /^(-?\\d+(?:\\.\\d+)?),\\s*(-?\\d+(?:\\.\\d+)?)$/;\nfunction aroundLatLngToPosition(value) {\n  var pattern = value.match(latLngRegExp);\n\n  // Since the value provided is the one send with the request, the API should\n  // throw an error due to the wrong format. So throw an error should be safe.\n  if (!pattern) {\n    throw new Error(\"Invalid value for \\\"aroundLatLng\\\" parameter: \\\"\".concat(value, \"\\\"\"));\n  }\n  return {\n    lat: parseFloat(pattern[1]),\n    lng: parseFloat(pattern[2])\n  };\n}\nfunction insideBoundingBoxArrayToBoundingBox(value) {\n  var _value = _slicedToArray(value, 1),\n    _value$ = _value[0],\n    _value$2 = _value$ === void 0 ? [undefined, undefined, undefined, undefined] : _value$,\n    _value$3 = _slicedToArray(_value$2, 4),\n    neLat = _value$3[0],\n    neLng = _value$3[1],\n    swLat = _value$3[2],\n    swLng = _value$3[3];\n\n  // Since the value provided is the one send with the request, the API should\n  // throw an error due to the wrong format. So throw an error should be safe.\n  if (!neLat || !neLng || !swLat || !swLng) {\n    throw new Error(\"Invalid value for \\\"insideBoundingBox\\\" parameter: [\".concat(value, \"]\"));\n  }\n  return {\n    northEast: {\n      lat: neLat,\n      lng: neLng\n    },\n    southWest: {\n      lat: swLat,\n      lng: swLng\n    }\n  };\n}\nfunction insideBoundingBoxStringToBoundingBox(value) {\n  var _value$split$map = value.split(',').map(parseFloat),\n    _value$split$map2 = _slicedToArray(_value$split$map, 4),\n    neLat = _value$split$map2[0],\n    neLng = _value$split$map2[1],\n    swLat = _value$split$map2[2],\n    swLng = _value$split$map2[3];\n\n  // Since the value provided is the one send with the request, the API should\n  // throw an error due to the wrong format. So throw an error should be safe.\n  if (!neLat || !neLng || !swLat || !swLng) {\n    throw new Error(\"Invalid value for \\\"insideBoundingBox\\\" parameter: \\\"\".concat(value, \"\\\"\"));\n  }\n  return {\n    northEast: {\n      lat: neLat,\n      lng: neLng\n    },\n    southWest: {\n      lat: swLat,\n      lng: swLng\n    }\n  };\n}\nfunction insideBoundingBoxToBoundingBox(value) {\n  if (Array.isArray(value)) {\n    return insideBoundingBoxArrayToBoundingBox(value);\n  }\n  return insideBoundingBoxStringToBoundingBox(value);\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/getAppIdAndApiKey.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.getAppIdAndApiKey = getAppIdAndApiKey;\n// typed as any, since it accepts the _real_ js clients, not the interface we otherwise expect\nfunction getAppIdAndApiKey(searchClient) {\n  if (searchClient.appId && searchClient.apiKey) {\n    // searchClient v5\n    return [searchClient.appId, searchClient.apiKey];\n  } else if (searchClient.transporter) {\n    // searchClient v4 or v5\n    var transporter = searchClient.transporter;\n    var headers = transporter.headers || transporter.baseHeaders;\n    var queryParameters = transporter.queryParameters || transporter.baseQueryParameters;\n    var APP_ID = 'x-algolia-application-id';\n    var API_KEY = 'x-algolia-api-key';\n    var appId = headers[APP_ID] || queryParameters[APP_ID];\n    var apiKey = headers[API_KEY] || queryParameters[API_KEY];\n    return [appId, apiKey];\n  } else {\n    // searchClient v3\n    return [searchClient.applicationID, searchClient.apiKey];\n  }\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/getContainerNode.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.getContainerNode = getContainerNode;\nvar _isDomElement = require(\"./isDomElement\");\n/**\n * Return the container. If it's a string, it is considered a\n * css selector and retrieves the first matching element. Otherwise\n * test if it validates that it's a correct DOMElement.\n *\n * @param {string|HTMLElement} selectorOrHTMLElement CSS Selector or container node.\n * @return {HTMLElement} Container node\n * @throws Error when the type is not correct\n */\nfunction getContainerNode(selectorOrHTMLElement) {\n  var isSelectorString = typeof selectorOrHTMLElement === 'string';\n  var domElement = isSelectorString ? document.querySelector(selectorOrHTMLElement) : selectorOrHTMLElement;\n  if (!(0, _isDomElement.isDomElement)(domElement)) {\n    var errorMessage = 'Container must be `string` or `HTMLElement`.';\n    if (isSelectorString) {\n      errorMessage += \" Unable to find \".concat(selectorOrHTMLElement);\n    }\n    throw new Error(errorMessage);\n  }\n  return domElement;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/getHighlightFromSiblings.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.getHighlightFromSiblings = getHighlightFromSiblings;\nvar _escapeHtml = require(\"./escape-html\");\nvar hasAlphanumeric = new RegExp(/\\w/i);\nfunction getHighlightFromSiblings(parts, i) {\n  var _parts, _parts2;\n  var current = parts[i];\n  var isNextHighlighted = ((_parts = parts[i + 1]) === null || _parts === void 0 ? void 0 : _parts.isHighlighted) || true;\n  var isPreviousHighlighted = ((_parts2 = parts[i - 1]) === null || _parts2 === void 0 ? void 0 : _parts2.isHighlighted) || true;\n  if (!hasAlphanumeric.test((0, _escapeHtml.unescape)(current.value)) && isPreviousHighlighted === isNextHighlighted) {\n    return isPreviousHighlighted;\n  }\n  return current.isHighlighted;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/getHighlightedParts.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.getHighlightedParts = getHighlightedParts;\nvar _escapeHighlight = require(\"./escape-highlight\");\nfunction getHighlightedParts(highlightedValue) {\n  // @MAJOR: this should use TAG_PLACEHOLDER\n  var highlightPostTag = _escapeHighlight.TAG_REPLACEMENT.highlightPostTag,\n    highlightPreTag = _escapeHighlight.TAG_REPLACEMENT.highlightPreTag;\n  var splitByPreTag = highlightedValue.split(highlightPreTag);\n  var firstValue = splitByPreTag.shift();\n  var elements = !firstValue ? [] : [{\n    value: firstValue,\n    isHighlighted: false\n  }];\n  splitByPreTag.forEach(function (split) {\n    var splitByPostTag = split.split(highlightPostTag);\n    elements.push({\n      value: splitByPostTag[0],\n      isHighlighted: true\n    });\n    if (splitByPostTag[1] !== '') {\n      elements.push({\n        value: splitByPostTag[1],\n        isHighlighted: false\n      });\n    }\n  });\n  return elements;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/getObjectType.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.getObjectType = getObjectType;\nfunction getObjectType(object) {\n  return Object.prototype.toString.call(object).slice(8, -1);\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/getPropertyByPath.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.getPropertyByPath = getPropertyByPath;\nfunction getPropertyByPath(object, path) {\n  var parts = Array.isArray(path) ? path : path.split('.');\n  return parts.reduce(function (current, key) {\n    return current && current[key];\n  }, object);\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/getRefinements.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.getRefinements = getRefinements;\nvar _escapeFacetValue = require(\"./escapeFacetValue\");\nvar _find = require(\"./find\");\nfunction getRefinement(state, type, attribute, name) {\n  var resultsFacets = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];\n  var res = {\n    type: type,\n    attribute: attribute,\n    name: name,\n    escapedValue: (0, _escapeFacetValue.escapeFacetValue)(name)\n  };\n  var facet = (0, _find.find)(resultsFacets, function (resultsFacet) {\n    return resultsFacet.name === attribute;\n  });\n  var count;\n  if (type === 'hierarchical') {\n    var facetDeclaration = state.getHierarchicalFacetByName(attribute);\n    var nameParts = name.split(facetDeclaration.separator);\n    var getFacetRefinement = function getFacetRefinement(facetData) {\n      return function (refinementKey) {\n        return facetData[refinementKey];\n      };\n    };\n    var _loop = function _loop(i) {\n      facet = facet && facet.data && (0, _find.find)(Object.keys(facet.data).map(getFacetRefinement(facet.data)), function (refinement) {\n        return refinement.name === nameParts[i];\n      });\n    };\n    for (var i = 0; facet !== undefined && i < nameParts.length; ++i) {\n      _loop(i);\n    }\n    count = facet && facet.count;\n  } else {\n    count = facet && facet.data && facet.data[res.name];\n  }\n  if (count !== undefined) {\n    res.count = count;\n  }\n  if (facet && facet.exhaustive !== undefined) {\n    res.exhaustive = facet.exhaustive;\n  }\n  return res;\n}\nfunction getRefinements(_results, state) {\n  var includesQuery = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n  var results = _results || {};\n  var refinements = [];\n  var _state$facetsRefineme = state.facetsRefinements,\n    facetsRefinements = _state$facetsRefineme === void 0 ? {} : _state$facetsRefineme,\n    _state$facetsExcludes = state.facetsExcludes,\n    facetsExcludes = _state$facetsExcludes === void 0 ? {} : _state$facetsExcludes,\n    _state$disjunctiveFac = state.disjunctiveFacetsRefinements,\n    disjunctiveFacetsRefinements = _state$disjunctiveFac === void 0 ? {} : _state$disjunctiveFac,\n    _state$hierarchicalFa = state.hierarchicalFacetsRefinements,\n    hierarchicalFacetsRefinements = _state$hierarchicalFa === void 0 ? {} : _state$hierarchicalFa,\n    _state$numericRefinem = state.numericRefinements,\n    numericRefinements = _state$numericRefinem === void 0 ? {} : _state$numericRefinem,\n    _state$tagRefinements = state.tagRefinements,\n    tagRefinements = _state$tagRefinements === void 0 ? [] : _state$tagRefinements;\n  Object.keys(facetsRefinements).forEach(function (attribute) {\n    var refinementNames = facetsRefinements[attribute];\n    refinementNames.forEach(function (refinementName) {\n      refinements.push(getRefinement(state, 'facet', attribute, refinementName, results.facets));\n    });\n  });\n  Object.keys(facetsExcludes).forEach(function (attribute) {\n    var refinementNames = facetsExcludes[attribute];\n    refinementNames.forEach(function (refinementName) {\n      refinements.push({\n        type: 'exclude',\n        attribute: attribute,\n        name: refinementName,\n        exclude: true\n      });\n    });\n  });\n  Object.keys(disjunctiveFacetsRefinements).forEach(function (attribute) {\n    var refinementNames = disjunctiveFacetsRefinements[attribute];\n    refinementNames.forEach(function (refinementName) {\n      refinements.push(getRefinement(state, 'disjunctive', attribute,\n      // We unescape any disjunctive refined values with `unescapeFacetValue` because\n      // they can be escaped on negative numeric values with `escapeFacetValue`.\n      (0, _escapeFacetValue.unescapeFacetValue)(refinementName), results.disjunctiveFacets));\n    });\n  });\n  Object.keys(hierarchicalFacetsRefinements).forEach(function (attribute) {\n    var refinementNames = hierarchicalFacetsRefinements[attribute];\n    refinementNames.forEach(function (refinement) {\n      refinements.push(getRefinement(state, 'hierarchical', attribute, refinement, results.hierarchicalFacets));\n    });\n  });\n  Object.keys(numericRefinements).forEach(function (attribute) {\n    var operators = numericRefinements[attribute];\n    Object.keys(operators).forEach(function (operatorOriginal) {\n      var operator = operatorOriginal;\n      var valueOrValues = operators[operator];\n      var refinementNames = Array.isArray(valueOrValues) ? valueOrValues : [valueOrValues];\n      refinementNames.forEach(function (refinementName) {\n        refinements.push({\n          type: 'numeric',\n          attribute: attribute,\n          name: \"\".concat(refinementName),\n          numericValue: refinementName,\n          operator: operator\n        });\n      });\n    });\n  });\n  tagRefinements.forEach(function (refinementName) {\n    refinements.push({\n      type: 'tag',\n      attribute: '_tags',\n      name: refinementName\n    });\n  });\n  if (includesQuery && state.query && state.query.trim()) {\n    refinements.push({\n      attribute: 'query',\n      type: 'query',\n      name: state.query,\n      query: state.query\n    });\n  }\n  return refinements;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/getWidgetAttribute.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.getWidgetAttribute = getWidgetAttribute;\nfunction getWidgetAttribute(widget, initOptions) {\n  var _widget$getWidgetRend;\n  var renderState = (_widget$getWidgetRend = widget.getWidgetRenderState) === null || _widget$getWidgetRend === void 0 ? void 0 : _widget$getWidgetRend.call(widget, initOptions);\n  var attribute = null;\n  if (renderState && renderState.widgetParams) {\n    // casting as widgetParams is checked just before\n    var widgetParams = renderState.widgetParams;\n    if (widgetParams.attribute) {\n      attribute = widgetParams.attribute;\n    } else if (Array.isArray(widgetParams.attributes)) {\n      attribute = widgetParams.attributes[0];\n    }\n  }\n  if (typeof attribute !== 'string') {\n    throw new Error(\"Could not find the attribute of the widget:\\n\\n\".concat(JSON.stringify(widget), \"\\n\\nPlease check whether the widget's getWidgetRenderState returns widgetParams.attribute correctly.\"));\n  }\n  return attribute;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/hits-absolute-position.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.addAbsolutePosition = addAbsolutePosition;\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction addAbsolutePosition(hits, page, hitsPerPage) {\n  return hits.map(function (hit, idx) {\n    return _objectSpread(_objectSpread({}, hit), {}, {\n      __position: hitsPerPage * page + idx + 1\n    });\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/hits-query-id.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.addQueryID = addQueryID;\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction addQueryID(hits, queryID) {\n  if (!queryID) {\n    return hits;\n  }\n  return hits.map(function (hit) {\n    return _objectSpread(_objectSpread({}, hit), {}, {\n      __queryID: queryID\n    });\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/hydrateRecommendCache.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.hydrateRecommendCache = hydrateRecommendCache;\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction hydrateRecommendCache(helper, initialResults) {\n  var recommendCache = Object.keys(initialResults).reduce(function (acc, indexName) {\n    var initialResult = initialResults[indexName];\n    if (initialResult.recommendResults) {\n      // @MAJOR: Use `Object.assign` instead of spread operator\n      return _objectSpread(_objectSpread({}, acc), initialResult.recommendResults.results);\n    }\n    return acc;\n  }, {});\n  helper._recommendCache = recommendCache;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/hydrateSearchClient.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.hydrateSearchClient = hydrateSearchClient;\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction hydrateSearchClient(client, results) {\n  if (!results) {\n    return;\n  }\n\n  // Disable cache hydration on:\n  // - Algoliasearch API Client < v4 with cache disabled\n  // - Third party clients (detected by the `addAlgoliaAgent` function missing)\n\n  if ((!('transporter' in client) || client._cacheHydrated) && (!client._useCache || typeof client.addAlgoliaAgent !== 'function')) {\n    return;\n  }\n  var cachedRequest = [Object.keys(results).reduce(function (acc, key) {\n    var _results$key = results[key],\n      state = _results$key.state,\n      requestParams = _results$key.requestParams,\n      serverResults = _results$key.results;\n    var mappedResults = serverResults && state ? serverResults.map(function (result, idx) {\n      return _objectSpread({\n        indexName: state.index || result.index\n      }, requestParams !== null && requestParams !== void 0 && requestParams[idx] || result.params ? {\n        params: serializeQueryParameters((requestParams === null || requestParams === void 0 ? void 0 : requestParams[idx]) || deserializeQueryParameters(result.params))\n      } : {});\n    }) : [];\n    return acc.concat(mappedResults);\n  }, [])];\n  var cachedResults = Object.keys(results).reduce(function (acc, key) {\n    var res = results[key].results;\n    if (!res) {\n      return acc;\n    }\n    return acc.concat(res);\n  }, []);\n\n  // Algoliasearch API Client >= v4\n  // To hydrate the client we need to populate the cache with the data from\n  // the server (done in `hydrateSearchClientWithMultiIndexRequest` or\n  // `hydrateSearchClientWithSingleIndexRequest`). But since there is no way\n  // for us to compute the key the same way as `algoliasearch-client` we need\n  // to populate it on a custom key and override the `search` method to\n  // search on it first.\n  if ('transporter' in client && !client._cacheHydrated) {\n    client._cacheHydrated = true;\n    var baseMethod = client.search.bind(client);\n    client.search = function (requests) {\n      for (var _len = arguments.length, methodArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n        methodArgs[_key - 1] = arguments[_key];\n      }\n      var requestsWithSerializedParams = Array.isArray(requests) ?\n      // search client\n      requests.map(function (request) {\n        return _objectSpread(_objectSpread({}, request), {}, {\n          params: serializeQueryParameters(request.params)\n        });\n      }) :\n      // composition client\n      serializeQueryParameters(requests.requestBody.params);\n      return client.transporter.responsesCache.get({\n        method: 'search',\n        args: [requestsWithSerializedParams].concat(methodArgs)\n      }, function () {\n        return baseMethod.apply(void 0, [requests].concat(methodArgs));\n      });\n    };\n    client.transporter.responsesCache.set({\n      method: 'search',\n      args: cachedRequest\n    }, {\n      results: cachedResults\n    });\n  }\n\n  // Algoliasearch API Client < v4\n  // Prior to client v4 we didn't have a proper API to hydrate the client\n  // cache from the outside. The following code populates the cache with\n  // a single-index result. You can find more information about the\n  // computation of the key inside the client (see link below).\n  // https://github.com/algolia/algoliasearch-client-javascript/blob/c27e89ff92b2a854ae6f40dc524bffe0f0cbc169/src/AlgoliaSearchCore.js#L232-L240\n  if (!('transporter' in client)) {\n    var cacheKey = \"/1/indexes/*/queries_body_\".concat(JSON.stringify({\n      requests: cachedRequest\n    }));\n    client.cache = _objectSpread(_objectSpread({}, client.cache), {}, _defineProperty({}, cacheKey, JSON.stringify({\n      results: Object.keys(results).map(function (key) {\n        return results[key].results;\n      })\n    })));\n  }\n}\nfunction deserializeQueryParameters(parameters) {\n  return parameters.split('&').reduce(function (acc, parameter) {\n    var _parameter$split = parameter.split('='),\n      _parameter$split2 = _slicedToArray(_parameter$split, 2),\n      key = _parameter$split2[0],\n      value = _parameter$split2[1];\n    acc[key] = value ? decodeURIComponent(value) : '';\n    return acc;\n  }, {});\n}\n\n// This function is copied from the algoliasearch v4 API Client. If modified,\n// consider updating it also in `serializeQueryParameters` from `@algolia/transporter`.\nfunction serializeQueryParameters(parameters) {\n  var isObjectOrArray = function isObjectOrArray(value) {\n    return Object.prototype.toString.call(value) === '[object Object]' || Object.prototype.toString.call(value) === '[object Array]';\n  };\n  var encode = function encode(format) {\n    for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n      args[_key2 - 1] = arguments[_key2];\n    }\n    var i = 0;\n    return format.replace(/%s/g, function () {\n      return encodeURIComponent(args[i++]);\n    });\n  };\n  return Object.keys(parameters).map(function (key) {\n    return encode('%s=%s', key, isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key]);\n  }).join('&');\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/index.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nvar _addWidgetId = require(\"./addWidgetId\");\nObject.keys(_addWidgetId).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _addWidgetId[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _addWidgetId[key];\n    }\n  });\n});\nvar _capitalize = require(\"./capitalize\");\nObject.keys(_capitalize).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _capitalize[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _capitalize[key];\n    }\n  });\n});\nvar _checkIndexUiState = require(\"./checkIndexUiState\");\nObject.keys(_checkIndexUiState).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _checkIndexUiState[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _checkIndexUiState[key];\n    }\n  });\n});\nvar _checkRendering = require(\"./checkRendering\");\nObject.keys(_checkRendering).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _checkRendering[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _checkRendering[key];\n    }\n  });\n});\nvar _clearRefinements = require(\"./clearRefinements\");\nObject.keys(_clearRefinements).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _clearRefinements[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _clearRefinements[key];\n    }\n  });\n});\nvar _concatHighlightedParts = require(\"./concatHighlightedParts\");\nObject.keys(_concatHighlightedParts).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _concatHighlightedParts[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _concatHighlightedParts[key];\n    }\n  });\n});\nvar _createConcurrentSafePromise = require(\"./createConcurrentSafePromise\");\nObject.keys(_createConcurrentSafePromise).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _createConcurrentSafePromise[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _createConcurrentSafePromise[key];\n    }\n  });\n});\nvar _createSendEventForFacet = require(\"./createSendEventForFacet\");\nObject.keys(_createSendEventForFacet).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _createSendEventForFacet[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _createSendEventForFacet[key];\n    }\n  });\n});\nvar _createSendEventForHits = require(\"./createSendEventForHits\");\nObject.keys(_createSendEventForHits).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _createSendEventForHits[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _createSendEventForHits[key];\n    }\n  });\n});\nvar _setIndexHelperState = require(\"./setIndexHelperState\");\nObject.keys(_setIndexHelperState).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _setIndexHelperState[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _setIndexHelperState[key];\n    }\n  });\n});\nvar _isIndexWidget = require(\"./isIndexWidget\");\nObject.keys(_isIndexWidget).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _isIndexWidget[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _isIndexWidget[key];\n    }\n  });\n});\nvar _debounce = require(\"./debounce\");\nObject.keys(_debounce).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _debounce[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _debounce[key];\n    }\n  });\n});\nvar _defer = require(\"./defer\");\nObject.keys(_defer).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _defer[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _defer[key];\n    }\n  });\n});\nvar _documentation = require(\"./documentation\");\nObject.keys(_documentation).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _documentation[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _documentation[key];\n    }\n  });\n});\nvar _escapeHighlight = require(\"./escape-highlight\");\nObject.keys(_escapeHighlight).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _escapeHighlight[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _escapeHighlight[key];\n    }\n  });\n});\nvar _escapeHtml = require(\"./escape-html\");\nObject.keys(_escapeHtml).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _escapeHtml[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _escapeHtml[key];\n    }\n  });\n});\nvar _escapeFacetValue = require(\"./escapeFacetValue\");\nObject.keys(_escapeFacetValue).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _escapeFacetValue[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _escapeFacetValue[key];\n    }\n  });\n});\nvar _find = require(\"./find\");\nObject.keys(_find).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _find[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _find[key];\n    }\n  });\n});\nvar _findIndex = require(\"./findIndex\");\nObject.keys(_findIndex).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _findIndex[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _findIndex[key];\n    }\n  });\n});\nvar _geoSearch = require(\"./geo-search\");\nObject.keys(_geoSearch).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _geoSearch[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _geoSearch[key];\n    }\n  });\n});\nvar _getAppIdAndApiKey = require(\"./getAppIdAndApiKey\");\nObject.keys(_getAppIdAndApiKey).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _getAppIdAndApiKey[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _getAppIdAndApiKey[key];\n    }\n  });\n});\nvar _getContainerNode = require(\"./getContainerNode\");\nObject.keys(_getContainerNode).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _getContainerNode[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _getContainerNode[key];\n    }\n  });\n});\nvar _getHighlightedParts = require(\"./getHighlightedParts\");\nObject.keys(_getHighlightedParts).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _getHighlightedParts[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _getHighlightedParts[key];\n    }\n  });\n});\nvar _getHighlightFromSiblings = require(\"./getHighlightFromSiblings\");\nObject.keys(_getHighlightFromSiblings).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _getHighlightFromSiblings[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _getHighlightFromSiblings[key];\n    }\n  });\n});\nvar _getObjectType = require(\"./getObjectType\");\nObject.keys(_getObjectType).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _getObjectType[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _getObjectType[key];\n    }\n  });\n});\nvar _getPropertyByPath = require(\"./getPropertyByPath\");\nObject.keys(_getPropertyByPath).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _getPropertyByPath[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _getPropertyByPath[key];\n    }\n  });\n});\nvar _getRefinements = require(\"./getRefinements\");\nObject.keys(_getRefinements).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _getRefinements[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _getRefinements[key];\n    }\n  });\n});\nvar _getWidgetAttribute = require(\"./getWidgetAttribute\");\nObject.keys(_getWidgetAttribute).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _getWidgetAttribute[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _getWidgetAttribute[key];\n    }\n  });\n});\nvar _hitsAbsolutePosition = require(\"./hits-absolute-position\");\nObject.keys(_hitsAbsolutePosition).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _hitsAbsolutePosition[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _hitsAbsolutePosition[key];\n    }\n  });\n});\nvar _hitsQueryId = require(\"./hits-query-id\");\nObject.keys(_hitsQueryId).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _hitsQueryId[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _hitsQueryId[key];\n    }\n  });\n});\nvar _hydrateRecommendCache = require(\"./hydrateRecommendCache\");\nObject.keys(_hydrateRecommendCache).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _hydrateRecommendCache[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _hydrateRecommendCache[key];\n    }\n  });\n});\nvar _hydrateSearchClient = require(\"./hydrateSearchClient\");\nObject.keys(_hydrateSearchClient).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _hydrateSearchClient[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _hydrateSearchClient[key];\n    }\n  });\n});\nvar _isDomElement = require(\"./isDomElement\");\nObject.keys(_isDomElement).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _isDomElement[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _isDomElement[key];\n    }\n  });\n});\nvar _isEqual = require(\"./isEqual\");\nObject.keys(_isEqual).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _isEqual[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _isEqual[key];\n    }\n  });\n});\nvar _isFacetRefined = require(\"./isFacetRefined\");\nObject.keys(_isFacetRefined).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _isFacetRefined[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _isFacetRefined[key];\n    }\n  });\n});\nvar _isFiniteNumber = require(\"./isFiniteNumber\");\nObject.keys(_isFiniteNumber).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _isFiniteNumber[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _isFiniteNumber[key];\n    }\n  });\n});\nvar _isPlainObject = require(\"./isPlainObject\");\nObject.keys(_isPlainObject).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _isPlainObject[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _isPlainObject[key];\n    }\n  });\n});\nvar _isSpecialClick = require(\"./isSpecialClick\");\nObject.keys(_isSpecialClick).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _isSpecialClick[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _isSpecialClick[key];\n    }\n  });\n});\nvar _walkIndex = require(\"./walkIndex\");\nObject.keys(_walkIndex).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _walkIndex[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _walkIndex[key];\n    }\n  });\n});\nvar _logger = require(\"./logger\");\nObject.keys(_logger).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _logger[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _logger[key];\n    }\n  });\n});\nvar _mergeSearchParameters = require(\"./mergeSearchParameters\");\nObject.keys(_mergeSearchParameters).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _mergeSearchParameters[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _mergeSearchParameters[key];\n    }\n  });\n});\nvar _omit = require(\"./omit\");\nObject.keys(_omit).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _omit[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _omit[key];\n    }\n  });\n});\nvar _noop = require(\"./noop\");\nObject.keys(_noop).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _noop[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _noop[key];\n    }\n  });\n});\nvar _range = require(\"./range\");\nObject.keys(_range).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _range[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _range[key];\n    }\n  });\n});\nvar _renderArgs = require(\"./render-args\");\nObject.keys(_renderArgs).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _renderArgs[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _renderArgs[key];\n    }\n  });\n});\nvar _resolveSearchParameters = require(\"./resolveSearchParameters\");\nObject.keys(_resolveSearchParameters).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _resolveSearchParameters[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _resolveSearchParameters[key];\n    }\n  });\n});\nvar _reverseHighlightedParts = require(\"./reverseHighlightedParts\");\nObject.keys(_reverseHighlightedParts).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _reverseHighlightedParts[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _reverseHighlightedParts[key];\n    }\n  });\n});\nvar _safelyRunOnBrowser = require(\"./safelyRunOnBrowser\");\nObject.keys(_safelyRunOnBrowser).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _safelyRunOnBrowser[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _safelyRunOnBrowser[key];\n    }\n  });\n});\nvar _serializer = require(\"./serializer\");\nObject.keys(_serializer).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _serializer[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _serializer[key];\n    }\n  });\n});\nvar _toArray = require(\"./toArray\");\nObject.keys(_toArray).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _toArray[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _toArray[key];\n    }\n  });\n});\nvar _uniq = require(\"./uniq\");\nObject.keys(_uniq).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _uniq[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _uniq[key];\n    }\n  });\n});"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/isDomElement.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.isDomElement = isDomElement;\nfunction isDomElement(object) {\n  return object instanceof HTMLElement || Boolean(object) && object.nodeType > 0;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/isEqual.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.isEqual = isEqual;\nfunction isPrimitive(obj) {\n  return obj !== Object(obj);\n}\nfunction isEqual(first, second) {\n  if (first === second) {\n    return true;\n  }\n  if (isPrimitive(first) || isPrimitive(second) || typeof first === 'function' || typeof second === 'function') {\n    return first === second;\n  }\n  if (Object.keys(first).length !== Object.keys(second).length) {\n    return false;\n  }\n\n  // @TODO avoid for..of because of the large polyfill\n  // eslint-disable-next-line no-restricted-syntax\n  for (var _i = 0, _Object$keys = Object.keys(first); _i < _Object$keys.length; _i++) {\n    var key = _Object$keys[_i];\n    if (!(key in second)) {\n      return false;\n    }\n    if (!isEqual(first[key], second[key])) {\n      return false;\n    }\n  }\n  return true;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/isFacetRefined.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.isFacetRefined = isFacetRefined;\nfunction isFacetRefined(helper, facet, value) {\n  if (helper.state.isHierarchicalFacet(facet)) {\n    return helper.state.isHierarchicalFacetRefined(facet, value);\n  } else if (helper.state.isConjunctiveFacet(facet)) {\n    return helper.state.isFacetRefined(facet, value);\n  } else {\n    return helper.state.isDisjunctiveFacetRefined(facet, value);\n  }\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/isFiniteNumber.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.isFiniteNumber = isFiniteNumber;\n// This is the `Number.isFinite()` polyfill recommended by MDN.\n// We do not provide any tests for this function.\n// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#Polyfill\n// @MAJOR Replace with the native `Number.isFinite` method\nfunction isFiniteNumber(value) {\n  return typeof value === 'number' && isFinite(value);\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/isIndexWidget.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.isIndexWidget = isIndexWidget;\nfunction isIndexWidget(widget) {\n  return widget.$$type === 'ais.index';\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/isPlainObject.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.isPlainObject = isPlainObject;\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n/**\n * This implementation is taken from Lodash implementation.\n * See: https://github.com/lodash/lodash/blob/master/isPlainObject.js\n */\n\nfunction getTag(value) {\n  if (value === null) {\n    return value === undefined ? '[object Undefined]' : '[object Null]';\n  }\n  return Object.prototype.toString.call(value);\n}\nfunction isObjectLike(value) {\n  return _typeof(value) === 'object' && value !== null;\n}\n\n/**\n * Checks if `value` is a plain object.\n *\n * A plain object is an object created by the `Object`\n * constructor or with a `[[Prototype]]` of `null`.\n */\nfunction isPlainObject(value) {\n  if (!isObjectLike(value) || getTag(value) !== '[object Object]') {\n    return false;\n  }\n  if (Object.getPrototypeOf(value) === null) {\n    return true;\n  }\n  var proto = value;\n  while (Object.getPrototypeOf(proto) !== null) {\n    proto = Object.getPrototypeOf(proto);\n  }\n  return Object.getPrototypeOf(value) === proto;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/isSpecialClick.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.isSpecialClick = isSpecialClick;\nfunction isSpecialClick(event) {\n  var isMiddleClick = event.button === 1;\n  return isMiddleClick || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/logger.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.warning = exports.warn = exports.deprecate = void 0;\nvar _noop = require(\"./noop\");\n/**\n * Logs a warning when this function is called, in development environment only.\n */\nvar deprecate = exports.deprecate = function deprecate(fn, message) {\n  return fn;\n};\n\n/**\n * Logs a warning\n * This is used to log issues in development environment only.\n */\nvar warn = exports.warn = _noop.noop;\n\n/**\n * Logs a warning if the condition is not met.\n * This is used to log issues in development environment only.\n */\nvar _warning = exports.warning = _noop.noop;\nif (process.env.NODE_ENV === 'development') {\n  exports.warn = warn = function warn(message) {\n    // eslint-disable-next-line no-console\n    console.warn(\"[InstantSearch.js]: \".concat(message.trim()));\n  };\n  exports.deprecate = deprecate = function deprecate(fn, message) {\n    var hasAlreadyPrinted = false;\n    return function () {\n      if (!hasAlreadyPrinted) {\n        hasAlreadyPrinted = true;\n        process.env.NODE_ENV === 'development' ? warn(message) : void 0;\n      }\n      return fn.apply(void 0, arguments);\n    };\n  };\n  exports.warning = _warning = function warning(condition, message) {\n    if (condition) {\n      return;\n    }\n    var hasAlreadyPrinted = _warning.cache[message];\n    if (!hasAlreadyPrinted) {\n      _warning.cache[message] = true;\n      process.env.NODE_ENV === 'development' ? warn(message) : void 0;\n    }\n  };\n  _warning.cache = {};\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/mergeSearchParameters.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.mergeSearchParameters = void 0;\nvar _findIndex = require(\"./findIndex\");\nvar _uniq = require(\"./uniq\");\nvar _excluded = [\"facets\", \"disjunctiveFacets\", \"facetsRefinements\", \"facetsExcludes\", \"disjunctiveFacetsRefinements\", \"numericRefinements\", \"tagRefinements\", \"hierarchicalFacets\", \"hierarchicalFacetsRefinements\", \"ruleContexts\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nvar mergeWithRest = function mergeWithRest(left, right) {\n  var facets = right.facets,\n    disjunctiveFacets = right.disjunctiveFacets,\n    facetsRefinements = right.facetsRefinements,\n    facetsExcludes = right.facetsExcludes,\n    disjunctiveFacetsRefinements = right.disjunctiveFacetsRefinements,\n    numericRefinements = right.numericRefinements,\n    tagRefinements = right.tagRefinements,\n    hierarchicalFacets = right.hierarchicalFacets,\n    hierarchicalFacetsRefinements = right.hierarchicalFacetsRefinements,\n    ruleContexts = right.ruleContexts,\n    rest = _objectWithoutProperties(right, _excluded);\n  return left.setQueryParameters(rest);\n};\n\n// Merge facets\nvar mergeFacets = function mergeFacets(left, right) {\n  return right.facets.reduce(function (_, name) {\n    return _.addFacet(name);\n  }, left);\n};\nvar mergeDisjunctiveFacets = function mergeDisjunctiveFacets(left, right) {\n  return right.disjunctiveFacets.reduce(function (_, name) {\n    return _.addDisjunctiveFacet(name);\n  }, left);\n};\nvar mergeHierarchicalFacets = function mergeHierarchicalFacets(left, right) {\n  return left.setQueryParameters({\n    hierarchicalFacets: right.hierarchicalFacets.reduce(function (facets, facet) {\n      var index = (0, _findIndex.findIndex)(facets, function (_) {\n        return _.name === facet.name;\n      });\n      if (index === -1) {\n        return facets.concat(facet);\n      }\n      var nextFacets = facets.slice();\n      nextFacets.splice(index, 1, facet);\n      return nextFacets;\n    }, left.hierarchicalFacets)\n  });\n};\n\n// Merge facet refinements\nvar mergeTagRefinements = function mergeTagRefinements(left, right) {\n  return right.tagRefinements.reduce(function (_, value) {\n    return _.addTagRefinement(value);\n  }, left);\n};\nvar mergeFacetRefinements = function mergeFacetRefinements(left, right) {\n  return left.setQueryParameters({\n    facetsRefinements: _objectSpread(_objectSpread({}, left.facetsRefinements), right.facetsRefinements)\n  });\n};\nvar mergeFacetsExcludes = function mergeFacetsExcludes(left, right) {\n  return left.setQueryParameters({\n    facetsExcludes: _objectSpread(_objectSpread({}, left.facetsExcludes), right.facetsExcludes)\n  });\n};\nvar mergeDisjunctiveFacetsRefinements = function mergeDisjunctiveFacetsRefinements(left, right) {\n  return left.setQueryParameters({\n    disjunctiveFacetsRefinements: _objectSpread(_objectSpread({}, left.disjunctiveFacetsRefinements), right.disjunctiveFacetsRefinements)\n  });\n};\nvar mergeNumericRefinements = function mergeNumericRefinements(left, right) {\n  return left.setQueryParameters({\n    numericRefinements: _objectSpread(_objectSpread({}, left.numericRefinements), right.numericRefinements)\n  });\n};\nvar mergeHierarchicalFacetsRefinements = function mergeHierarchicalFacetsRefinements(left, right) {\n  return left.setQueryParameters({\n    hierarchicalFacetsRefinements: _objectSpread(_objectSpread({}, left.hierarchicalFacetsRefinements), right.hierarchicalFacetsRefinements)\n  });\n};\nvar mergeRuleContexts = function mergeRuleContexts(left, right) {\n  var ruleContexts = (0, _uniq.uniq)([].concat(left.ruleContexts).concat(right.ruleContexts).filter(Boolean));\n  if (ruleContexts.length > 0) {\n    return left.setQueryParameters({\n      ruleContexts: ruleContexts\n    });\n  }\n  return left;\n};\nvar mergeSearchParameters = exports.mergeSearchParameters = function mergeSearchParameters() {\n  for (var _len = arguments.length, parameters = new Array(_len), _key = 0; _key < _len; _key++) {\n    parameters[_key] = arguments[_key];\n  }\n  return parameters.reduce(function (left, right) {\n    var hierarchicalFacetsRefinementsMerged = mergeHierarchicalFacetsRefinements(left, right);\n    var hierarchicalFacetsMerged = mergeHierarchicalFacets(hierarchicalFacetsRefinementsMerged, right);\n    var tagRefinementsMerged = mergeTagRefinements(hierarchicalFacetsMerged, right);\n    var numericRefinementsMerged = mergeNumericRefinements(tagRefinementsMerged, right);\n    var disjunctiveFacetsRefinementsMerged = mergeDisjunctiveFacetsRefinements(numericRefinementsMerged, right);\n    var facetsExcludesMerged = mergeFacetsExcludes(disjunctiveFacetsRefinementsMerged, right);\n    var facetRefinementsMerged = mergeFacetRefinements(facetsExcludesMerged, right);\n    var disjunctiveFacetsMerged = mergeDisjunctiveFacets(facetRefinementsMerged, right);\n    var ruleContextsMerged = mergeRuleContexts(disjunctiveFacetsMerged, right);\n    var facetsMerged = mergeFacets(ruleContextsMerged, right);\n    return mergeWithRest(facetsMerged, right);\n  });\n};"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/noop.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.noop = noop;\nfunction noop() {}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/omit.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.omit = omit;\n/**\n * Creates a new object with the same keys as the original object, but without the excluded keys.\n * @param source original object\n * @param excluded keys to remove from the original object\n * @returns the new object\n */\nfunction omit(source, excluded) {\n  if (source === null || source === undefined) {\n    return source;\n  }\n  return Object.keys(source).reduce(function (target, key) {\n    if (excluded.indexOf(key) >= 0) {\n      return target;\n    }\n    var validKey = key;\n    target[validKey] = source[validKey];\n    return target;\n  }, {});\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/prepareTemplateProps.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _uniq = _interopRequireDefault(require(\"./uniq.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction prepareTemplates( // can not use = {} here, since the template could have different constraints\ndefaultTemplates) {\n  var templates = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  var allKeys = (0, _uniq.default)([].concat(_toConsumableArray(Object.keys(defaultTemplates || {})), _toConsumableArray(Object.keys(templates))));\n  return allKeys.reduce(function (config, key) {\n    var defaultTemplate = defaultTemplates ? defaultTemplates[key] : undefined;\n    var customTemplate = templates[key];\n    var isCustomTemplate = customTemplate !== undefined && customTemplate !== defaultTemplate;\n    config.templates[key] = isCustomTemplate ? customTemplate // typescript doesn't recognize that this condition asserts customTemplate is defined\n    : defaultTemplate;\n    config.useCustomCompileOptions[key] = isCustomTemplate;\n    return config;\n  }, {\n    // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n    templates: {},\n    // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n    useCustomCompileOptions: {}\n  });\n}\n/**\n * Prepares an object to be passed to the Template widget\n */\n\n\nfunction prepareTemplateProps(_ref) {\n  var defaultTemplates = _ref.defaultTemplates,\n      templates = _ref.templates,\n      templatesConfig = _ref.templatesConfig;\n  var preparedTemplates = prepareTemplates(defaultTemplates, templates);\n  return _objectSpread({\n    templatesConfig: templatesConfig\n  }, preparedTemplates);\n}\n\nvar _default = prepareTemplateProps;\nexports.default = _default;"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/range.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.range = range;\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction range(_ref) {\n  var _ref$start = _ref.start,\n    start = _ref$start === void 0 ? 0 : _ref$start,\n    end = _ref.end,\n    _ref$step = _ref.step,\n    step = _ref$step === void 0 ? 1 : _ref$step;\n  // We can't divide by 0 so we re-assign the step to 1 if it happens.\n  var limitStep = step === 0 ? 1 : step;\n\n  // In some cases the array to create has a decimal length.\n  // We therefore need to round the value.\n  // Example:\n  //   { start: 1, end: 5000, step: 500 }\n  //   => Array length = (5000 - 1) / 500 = 9.998\n  var arrayLength = Math.round((end - start) / limitStep);\n  return _toConsumableArray(Array(arrayLength)).map(function (_, current) {\n    return start + current * limitStep;\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/render-args.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.createInitArgs = createInitArgs;\nexports.createRenderArgs = createRenderArgs;\nfunction createInitArgs(instantSearchInstance, parent, uiState) {\n  var helper = parent.getHelper();\n  return {\n    uiState: uiState,\n    helper: helper,\n    parent: parent,\n    instantSearchInstance: instantSearchInstance,\n    state: helper.state,\n    renderState: instantSearchInstance.renderState,\n    templatesConfig: instantSearchInstance.templatesConfig,\n    createURL: parent.createURL,\n    scopedResults: [],\n    searchMetadata: {\n      isSearchStalled: instantSearchInstance.status === 'stalled'\n    },\n    status: instantSearchInstance.status,\n    error: instantSearchInstance.error\n  };\n}\nfunction createRenderArgs(instantSearchInstance, parent, widget) {\n  var results = parent.getResultsForWidget(widget);\n  var helper = parent.getHelper();\n  return {\n    helper: helper,\n    parent: parent,\n    instantSearchInstance: instantSearchInstance,\n    results: results,\n    scopedResults: parent.getScopedResults(),\n    state: results && '_state' in results ? results._state : helper.state,\n    renderState: instantSearchInstance.renderState,\n    templatesConfig: instantSearchInstance.templatesConfig,\n    createURL: parent.createURL,\n    searchMetadata: {\n      isSearchStalled: instantSearchInstance.status === 'stalled'\n    },\n    status: instantSearchInstance.status,\n    error: instantSearchInstance.error\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/renderTemplate.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _hogan = _interopRequireDefault(require(\"hogan.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n// We add all our template helper methods to the template as lambdas. Note\n// that lambdas in Mustache are supposed to accept a second argument of\n// `render` to get the rendered value, not the literal `{{value}}`. But\n// this is currently broken (see https://github.com/twitter/hogan.js/issues/222).\nfunction transformHelpersToHogan() {\n  var helpers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var compileOptions = arguments.length > 1 ? arguments[1] : undefined;\n  var data = arguments.length > 2 ? arguments[2] : undefined;\n  return Object.keys(helpers).reduce(function (acc, helperKey) {\n    return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, helperKey, function () {\n      var _this = this;\n\n      return function (text) {\n        var render = function render(value) {\n          return _hogan.default.compile(value, compileOptions).render(_this);\n        };\n\n        return helpers[helperKey].call(data, text, render);\n      };\n    }));\n  }, {});\n}\n\nfunction renderTemplate(_ref) {\n  var templates = _ref.templates,\n      templateKey = _ref.templateKey,\n      compileOptions = _ref.compileOptions,\n      helpers = _ref.helpers,\n      data = _ref.data,\n      bindEvent = _ref.bindEvent;\n  var template = templates[templateKey];\n\n  if (typeof template !== 'string' && typeof template !== 'function') {\n    throw new Error(\"Template must be 'string' or 'function', was '\".concat(_typeof(template), \"' (key: \").concat(templateKey, \")\"));\n  }\n\n  if (typeof template === 'function') {\n    return template(data, bindEvent);\n  }\n\n  var transformedHelpers = transformHelpersToHogan(helpers, compileOptions, data);\n  return _hogan.default.compile(template, compileOptions).render(_objectSpread(_objectSpread({}, data), {}, {\n    helpers: transformedHelpers\n  })).replace(/[ \\n\\r\\t\\f\\xA0]+/g, function (spaces) {\n    return spaces.replace(/(^|\\xA0+)[^\\xA0]+/g, '$1 ');\n  }).trim();\n}\n\nvar _default = renderTemplate;\nexports.default = _default;"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/resolveSearchParameters.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.resolveSearchParameters = resolveSearchParameters;\nfunction resolveSearchParameters(current) {\n  var parent = current.getParent();\n  var states = [current.getHelper().state];\n  while (parent !== null) {\n    states = [parent.getHelper().state].concat(states);\n    parent = parent.getParent();\n  }\n  return states;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/reverseHighlightedParts.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.reverseHighlightedParts = reverseHighlightedParts;\nvar _getHighlightFromSiblings = require(\"./getHighlightFromSiblings\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction reverseHighlightedParts(parts) {\n  if (!parts.some(function (part) {\n    return part.isHighlighted;\n  })) {\n    return parts.map(function (part) {\n      return _objectSpread(_objectSpread({}, part), {}, {\n        isHighlighted: false\n      });\n    });\n  }\n  return parts.map(function (part, i) {\n    return _objectSpread(_objectSpread({}, part), {}, {\n      isHighlighted: !(0, _getHighlightFromSiblings.getHighlightFromSiblings)(parts, i)\n    });\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/safelyRunOnBrowser.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.safelyRunOnBrowser = safelyRunOnBrowser;\n// eslint-disable-next-line no-restricted-globals\n\n/**\n * Runs code on browser environments safely.\n */\nfunction safelyRunOnBrowser(callback) {\n  var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n      fallback: function fallback() {\n        return undefined;\n      }\n    },\n    fallback = _ref.fallback;\n  // eslint-disable-next-line no-restricted-globals\n  if (typeof window === 'undefined') {\n    return fallback();\n  }\n\n  // eslint-disable-next-line no-restricted-globals\n  return callback({\n    window: window\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/serializer.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.deserializePayload = deserializePayload;\nexports.serializePayload = serializePayload;\nfunction serializePayload(payload) {\n  return btoa(encodeURIComponent(JSON.stringify(payload)));\n}\nfunction deserializePayload(serialized) {\n  return JSON.parse(decodeURIComponent(atob(serialized)));\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/setIndexHelperState.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.setIndexHelperState = setIndexHelperState;\nvar _checkIndexUiState = require(\"./checkIndexUiState\");\nvar _isIndexWidget = require(\"./isIndexWidget\");\nfunction setIndexHelperState(finalUiState, indexWidget) {\n  var nextIndexUiState = finalUiState[indexWidget.getIndexId()] || {};\n  if (process.env.NODE_ENV === 'development') {\n    (0, _checkIndexUiState.checkIndexUiState)({\n      index: indexWidget,\n      indexUiState: nextIndexUiState\n    });\n  }\n  indexWidget.getHelper().setState(indexWidget.getWidgetSearchParameters(indexWidget.getHelper().state, {\n    uiState: nextIndexUiState\n  }));\n  indexWidget.getWidgets().filter(_isIndexWidget.isIndexWidget).forEach(function (widget) {\n    return setIndexHelperState(finalUiState, widget);\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/toArray.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.toArray = toArray;\nfunction toArray(value) {\n  return Array.isArray(value) ? value : [value];\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/typedObject.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.keys = void 0;\n/**\n * A typed version of Object.keys, to use when looping over a static object\n * inspired from https://stackoverflow.com/a/65117465/3185307\n */\nvar keys = exports.keys = Object.keys;"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/unescape.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = unescape;\n\n/**\n * This implementation is taken from Lodash implementation.\n * See: https://github.com/lodash/lodash/blob/4.17.11-npm/unescape.js\n */\n// Used to map HTML entities to characters.\nvar htmlEscapes = {\n  '&amp;': '&',\n  '&lt;': '<',\n  '&gt;': '>',\n  '&quot;': '\"',\n  '&#39;': \"'\"\n}; // Used to match HTML entities and HTML characters.\n\nvar regexEscapedHtml = /&(amp|quot|lt|gt|#39);/g;\nvar regexHasEscapedHtml = RegExp(regexEscapedHtml.source);\n/**\n * Converts the HTML entities \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * characters.\n */\n\nfunction unescape(value) {\n  return value && regexHasEscapedHtml.test(value) ? value.replace(regexEscapedHtml, function (character) {\n    return htmlEscapes[character];\n  }) : value;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/unescapeRefinement.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nfunction unescapeRefinement(value) {\n  return String(value).replace(/^\\\\-/, '-');\n}\n\nvar _default = unescapeRefinement;\nexports.default = _default;"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/uniq.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.uniq = uniq;\nfunction uniq(array) {\n  return array.filter(function (value, index, self) {\n    return self.indexOf(value) === index;\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/uuid.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.createUUID = createUUID;\n/**\n * Create UUID according to\n * https://www.ietf.org/rfc/rfc4122.txt.\n *\n * @returns Generated UUID.\n */\nfunction createUUID() {\n  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n    /* eslint-disable no-bitwise */\n    var r = Math.random() * 16 | 0;\n    var v = c === 'x' ? r : r & 0x3 | 0x8;\n    /* eslint-enable */\n    return v.toString(16);\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/utils/walkIndex.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.walkIndex = walkIndex;\nvar _isIndexWidget = require(\"./isIndexWidget\");\n/**\n * Recurse over all child indices\n */\nfunction walkIndex(indexWidget, callback) {\n  callback(indexWidget);\n  indexWidget.getWidgets().forEach(function (widget) {\n    if ((0, _isIndexWidget.isIndexWidget)(widget)) {\n      walkIndex(widget, callback);\n    }\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/version.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _default = exports.default = '4.78.3';"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/voiceSearchHelper/index.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n// `SpeechRecognition` is an API used on the browser so we can safely disable\n// the `window` check.\n/* eslint-disable no-restricted-globals */\n/* global SpeechRecognition SpeechRecognitionEvent */\n\nvar createVoiceSearchHelper = function createVoiceSearchHelper(_ref) {\n  var searchAsYouSpeak = _ref.searchAsYouSpeak,\n    language = _ref.language,\n    onQueryChange = _ref.onQueryChange,\n    onStateChange = _ref.onStateChange;\n  var SpeechRecognitionAPI = window.webkitSpeechRecognition || window.SpeechRecognition;\n  var getDefaultState = function getDefaultState(status) {\n    return {\n      status: status,\n      transcript: '',\n      isSpeechFinal: false,\n      errorCode: undefined\n    };\n  };\n  var state = getDefaultState('initial');\n  var recognition;\n  var isBrowserSupported = function isBrowserSupported() {\n    return Boolean(SpeechRecognitionAPI);\n  };\n  var isListening = function isListening() {\n    return state.status === 'askingPermission' || state.status === 'waiting' || state.status === 'recognizing';\n  };\n  var setState = function setState() {\n    var newState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    state = _objectSpread(_objectSpread({}, state), newState);\n    onStateChange();\n  };\n  var getState = function getState() {\n    return state;\n  };\n  var resetState = function resetState() {\n    var status = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'initial';\n    setState(getDefaultState(status));\n  };\n  var onStart = function onStart() {\n    setState({\n      status: 'waiting'\n    });\n  };\n  var onError = function onError(event) {\n    setState({\n      status: 'error',\n      errorCode: event.error\n    });\n  };\n  var onResult = function onResult(event) {\n    setState({\n      status: 'recognizing',\n      transcript: event.results[0] && event.results[0][0] && event.results[0][0].transcript || '',\n      isSpeechFinal: event.results[0] && event.results[0].isFinal\n    });\n    if (searchAsYouSpeak && state.transcript) {\n      onQueryChange(state.transcript);\n    }\n  };\n  var onEnd = function onEnd() {\n    if (!state.errorCode && state.transcript && !searchAsYouSpeak) {\n      onQueryChange(state.transcript);\n    }\n    if (state.status !== 'error') {\n      setState({\n        status: 'finished'\n      });\n    }\n  };\n  var startListening = function startListening() {\n    recognition = new SpeechRecognitionAPI();\n    if (!recognition) {\n      return;\n    }\n    resetState('askingPermission');\n    recognition.interimResults = true;\n    if (language) {\n      recognition.lang = language;\n    }\n    recognition.addEventListener('start', onStart);\n    recognition.addEventListener('error', onError);\n    recognition.addEventListener('result', onResult);\n    recognition.addEventListener('end', onEnd);\n    recognition.start();\n  };\n  var dispose = function dispose() {\n    if (!recognition) {\n      return;\n    }\n    recognition.stop();\n    recognition.removeEventListener('start', onStart);\n    recognition.removeEventListener('error', onError);\n    recognition.removeEventListener('result', onResult);\n    recognition.removeEventListener('end', onEnd);\n    recognition = undefined;\n  };\n  var stopListening = function stopListening() {\n    dispose();\n    // Because `dispose` removes event listeners, `end` listener is not called.\n    // So we're setting the `status` as `finished` here.\n    // If we don't do it, it will be still `waiting` or `recognizing`.\n    resetState('finished');\n  };\n  return {\n    getState: getState,\n    isBrowserSupported: isBrowserSupported,\n    isListening: isListening,\n    startListening: startListening,\n    stopListening: stopListening,\n    dispose: dispose\n  };\n};\nvar _default = exports.default = createVoiceSearchHelper;"
  },
  {
    "path": "js/instantsearch.js/cjs/lib/voiceSearchHelper/types.js",
    "content": "\"use strict\";"
  },
  {
    "path": "js/instantsearch.js/cjs/middlewares/createInsightsMiddleware.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.createInsightsMiddleware = createInsightsMiddleware;\nvar _helpers = require(\"../helpers\");\nvar _utils = require(\"../lib/utils\");\nvar _uuid = require(\"../lib/utils/uuid\");\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nvar ALGOLIA_INSIGHTS_VERSION = '2.17.2';\nvar ALGOLIA_INSIGHTS_SRC = \"https://cdn.jsdelivr.net/npm/search-insights@\".concat(ALGOLIA_INSIGHTS_VERSION, \"/dist/search-insights.min.js\");\nfunction createInsightsMiddleware() {\n  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var _insightsClient = props.insightsClient,\n    insightsInitParams = props.insightsInitParams,\n    onEvent = props.onEvent,\n    _props$$$internal = props.$$internal,\n    $$internal = _props$$$internal === void 0 ? false : _props$$$internal,\n    _props$$$automatic = props.$$automatic,\n    $$automatic = _props$$$automatic === void 0 ? false : _props$$$automatic;\n  var potentialInsightsClient = _insightsClient;\n  if (!_insightsClient && _insightsClient !== null) {\n    (0, _utils.safelyRunOnBrowser)(function (_ref) {\n      var window = _ref.window;\n      var pointer = window.AlgoliaAnalyticsObject || 'aa';\n      if (typeof pointer === 'string') {\n        potentialInsightsClient = window[pointer];\n      }\n      if (!potentialInsightsClient) {\n        window.AlgoliaAnalyticsObject = pointer;\n        if (!window[pointer]) {\n          window[pointer] = function () {\n            if (!window[pointer].queue) {\n              window[pointer].queue = [];\n            }\n            for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n              args[_key] = arguments[_key];\n            }\n            window[pointer].queue.push(args);\n          };\n          window[pointer].version = ALGOLIA_INSIGHTS_VERSION;\n          window[pointer].shouldAddScript = true;\n        }\n        potentialInsightsClient = window[pointer];\n      }\n    });\n  }\n  // if still no insightsClient was found, we use a noop\n  var insightsClient = potentialInsightsClient || _utils.noop;\n  return function (_ref2) {\n    var instantSearchInstance = _ref2.instantSearchInstance;\n    // remove existing default insights middleware\n    // user-provided insights middleware takes precedence\n    var existingInsightsMiddlewares = instantSearchInstance.middleware.filter(function (m) {\n      return m.instance.$$type === 'ais.insights' && m.instance.$$internal;\n    }).map(function (m) {\n      return m.creator;\n    });\n    instantSearchInstance.unuse.apply(instantSearchInstance, _toConsumableArray(existingInsightsMiddlewares));\n    var _getAppIdAndApiKey = (0, _utils.getAppIdAndApiKey)(instantSearchInstance.client),\n      _getAppIdAndApiKey2 = _slicedToArray(_getAppIdAndApiKey, 2),\n      appId = _getAppIdAndApiKey2[0],\n      apiKey = _getAppIdAndApiKey2[1];\n\n    // search-insights.js also throws an error so dev-only clarification is sufficient\n    process.env.NODE_ENV === 'development' ? (0, _utils.warning)(Boolean(appId && apiKey), 'could not extract Algolia credentials from searchClient in insights middleware.') : void 0;\n    var queuedInitParams = undefined;\n    var queuedUserToken = undefined;\n    var userTokenBeforeInit = undefined;\n    var queue = insightsClient.queue;\n    if (Array.isArray(queue)) {\n      // Context: The umd build of search-insights is asynchronously loaded by the snippet.\n      //\n      // When user calls `aa('setUserToken', 'my-user-token')` before `search-insights` is loaded,\n      // ['setUserToken', 'my-user-token'] gets stored in `aa.queue`.\n      // Whenever `search-insights` is finally loaded, it will process the queue.\n      //\n      // But here's the reason why we handle it here:\n      // At this point, even though `search-insights` is not loaded yet,\n      // we still want to read the token from the queue.\n      // Otherwise, the first search call will be fired without the token.\n      var _map = ['setUserToken', 'init'].map(function (key) {\n        var _ref3 = (0, _utils.find)(queue.slice().reverse(), function (_ref5) {\n            var _ref6 = _slicedToArray(_ref5, 1),\n              method = _ref6[0];\n            return method === key;\n          }) || [],\n          _ref4 = _slicedToArray(_ref3, 2),\n          value = _ref4[1];\n        return value;\n      });\n      var _map2 = _slicedToArray(_map, 2);\n      queuedUserToken = _map2[0];\n      queuedInitParams = _map2[1];\n    }\n\n    // If user called `aa('setUserToken')` before creating the Insights middleware,\n    // we temporarily store the token and set it later on.\n    //\n    // Otherwise, the `init` call might override them with anonymous user token.\n    insightsClient('getUserToken', null, function (_error, userToken) {\n      userTokenBeforeInit = normalizeUserToken(userToken);\n    });\n\n    // Only `init` if the `insightsInitParams` option is passed or\n    // if the `insightsClient` version doesn't supports optional `init` calling.\n    if (insightsInitParams || !isModernInsightsClient(insightsClient)) {\n      insightsClient('init', _objectSpread({\n        appId: appId,\n        apiKey: apiKey,\n        partial: true\n      }, insightsInitParams));\n    }\n    var initialParameters;\n    var helper;\n    return {\n      $$type: 'ais.insights',\n      $$internal: $$internal,\n      $$automatic: $$automatic,\n      onStateChange: function onStateChange() {},\n      subscribe: function subscribe() {\n        if (!insightsClient.shouldAddScript) return;\n        var errorMessage = '[insights middleware]: could not load search-insights.js. Please load it manually following https://alg.li/insights-init';\n        try {\n          var script = document.createElement('script');\n          script.async = true;\n          script.src = ALGOLIA_INSIGHTS_SRC;\n          script.onerror = function () {\n            instantSearchInstance.emit('error', new Error(errorMessage));\n          };\n          document.body.appendChild(script);\n          insightsClient.shouldAddScript = false;\n        } catch (cause) {\n          insightsClient.shouldAddScript = false;\n          instantSearchInstance.emit('error', new Error(errorMessage));\n        }\n      },\n      started: function started() {\n        insightsClient('addAlgoliaAgent', 'insights-middleware');\n        helper = instantSearchInstance.mainHelper;\n        var queueAtStart = insightsClient.queue;\n        if (Array.isArray(queueAtStart)) {\n          var _map3 = ['setUserToken', 'init'].map(function (key) {\n            var _ref7 = (0, _utils.find)(queueAtStart.slice().reverse(), function (_ref9) {\n                var _ref10 = _slicedToArray(_ref9, 1),\n                  method = _ref10[0];\n                return method === key;\n              }) || [],\n              _ref8 = _slicedToArray(_ref7, 2),\n              value = _ref8[1];\n            return value;\n          });\n          var _map4 = _slicedToArray(_map3, 2);\n          queuedUserToken = _map4[0];\n          queuedInitParams = _map4[1];\n        }\n        initialParameters = getInitialParameters(instantSearchInstance);\n\n        // We don't want to force clickAnalytics when the insights is enabled from the search response.\n        // This means we don't enable insights for indices that don't opt in\n        if (!$$automatic) {\n          helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread(_objectSpread({}, helper.state), {}, {\n            clickAnalytics: true\n          }));\n        }\n        if (!$$internal) {\n          instantSearchInstance.scheduleSearch();\n        }\n        var setUserTokenToSearch = function setUserTokenToSearch(userToken) {\n          var immediate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n          var normalizedUserToken = normalizeUserToken(userToken);\n          if (!normalizedUserToken) {\n            return;\n          }\n          var existingToken = helper.state.userToken;\n          function applyToken() {\n            helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread(_objectSpread({}, helper.state), {}, {\n              userToken: normalizedUserToken\n            }));\n            if (existingToken && existingToken !== userToken) {\n              instantSearchInstance.scheduleSearch();\n            }\n          }\n\n          // Delay the token application to the next render cycle\n          if (!immediate) {\n            setTimeout(applyToken, 0);\n          } else {\n            applyToken();\n          }\n        };\n        function setUserToken(token) {\n          setUserTokenToSearch(token, true);\n          insightsClient('setUserToken', token);\n        }\n        var anonymousUserToken = undefined;\n        var anonymousTokenFromInsights = (0, _helpers.getInsightsAnonymousUserTokenInternal)();\n        if (anonymousTokenFromInsights) {\n          // When `aa('init', { ... })` is called, it creates an anonymous user token in cookie.\n          // We can set it as userToken on instantsearch and insights. If it's not set as an insights\n          // userToken before a sendEvent, insights automatically generates a new anonymous token,\n          // causing a state change and an unnecessary query on instantsearch.\n          anonymousUserToken = anonymousTokenFromInsights;\n        } else {\n          var token = \"anonymous-\".concat((0, _uuid.createUUID)());\n          anonymousUserToken = token;\n        }\n        var userTokenFromInit;\n\n        // With SSR, the token could be be set on the state. We make sure\n        // that insights is in sync with that token since, there is no\n        // insights lib on the server.\n        var tokenFromSearchParameters = initialParameters.userToken;\n\n        // When the first query is sent, the token is possibly not yet set by\n        // the insights onChange callbacks (if insights isn't yet loaded).\n        // It is explicitly being set here so that the first query has the\n        // initial tokens set and ensure a second query isn't automatically\n        // made when the onChange callback actually changes the state.\n        if (insightsInitParams !== null && insightsInitParams !== void 0 && insightsInitParams.userToken) {\n          userTokenFromInit = insightsInitParams.userToken;\n        }\n        if (userTokenFromInit) {\n          setUserToken(userTokenFromInit);\n        } else if (tokenFromSearchParameters) {\n          setUserToken(tokenFromSearchParameters);\n        } else if (userTokenBeforeInit) {\n          setUserToken(userTokenBeforeInit);\n        } else if (queuedUserToken) {\n          setUserToken(queuedUserToken);\n        } else if (anonymousUserToken) {\n          var _queuedInitParams;\n          setUserToken(anonymousUserToken);\n          if (insightsInitParams !== null && insightsInitParams !== void 0 && insightsInitParams.useCookie || (_queuedInitParams = queuedInitParams) !== null && _queuedInitParams !== void 0 && _queuedInitParams.useCookie) {\n            var _queuedInitParams2;\n            saveTokenAsCookie(anonymousUserToken, (insightsInitParams === null || insightsInitParams === void 0 ? void 0 : insightsInitParams.cookieDuration) || ((_queuedInitParams2 = queuedInitParams) === null || _queuedInitParams2 === void 0 ? void 0 : _queuedInitParams2.cookieDuration));\n          }\n        }\n\n        // This updates userToken which is set explicitly by `aa('setUserToken', userToken)`\n        insightsClient('onUserTokenChange', function (token) {\n          return setUserTokenToSearch(token, true);\n        }, {\n          immediate: true\n        });\n        var insightsClientWithLocalCredentials = insightsClient;\n        if (isModernInsightsClient(insightsClient)) {\n          insightsClientWithLocalCredentials = function insightsClientWithLocalCredentials(method, payload) {\n            var _getAppIdAndApiKey3 = (0, _utils.getAppIdAndApiKey)(instantSearchInstance.client),\n              _getAppIdAndApiKey4 = _slicedToArray(_getAppIdAndApiKey3, 2),\n              latestAppId = _getAppIdAndApiKey4[0],\n              latestApiKey = _getAppIdAndApiKey4[1];\n            var extraParams = {\n              headers: {\n                'X-Algolia-Application-Id': latestAppId,\n                'X-Algolia-API-Key': latestApiKey\n              }\n            };\n\n            // @ts-ignore we are calling this only when we know that the client actually is correct\n            return insightsClient(method, payload, extraParams);\n          };\n        }\n        var viewedObjectIDs = new Set();\n        var lastQueryId;\n        instantSearchInstance.mainHelper.derivedHelpers[0].on('result', function (_ref11) {\n          var results = _ref11.results;\n          if (results && (!results.queryID || results.queryID !== lastQueryId)) {\n            lastQueryId = results.queryID;\n            viewedObjectIDs.clear();\n          }\n        });\n        instantSearchInstance.sendEventToInsights = function (event) {\n          if (onEvent) {\n            onEvent(event, insightsClientWithLocalCredentials);\n          } else if (event.insightsMethod) {\n            if (event.insightsMethod === 'viewedObjectIDs') {\n              var _payload = event.payload;\n              var difference = _payload.objectIDs.filter(function (objectID) {\n                return !viewedObjectIDs.has(objectID);\n              });\n              if (difference.length === 0) {\n                return;\n              }\n              difference.forEach(function (objectID) {\n                return viewedObjectIDs.add(objectID);\n              });\n              _payload.objectIDs = difference;\n            }\n\n            // Source is used to differentiate events sent by instantsearch from those sent manually.\n            event.payload.algoliaSource = ['instantsearch'];\n            if ($$automatic) {\n              event.payload.algoliaSource.push('instantsearch-automatic');\n            }\n            if (event.eventModifier === 'internal') {\n              event.payload.algoliaSource.push('instantsearch-internal');\n            }\n            insightsClientWithLocalCredentials(event.insightsMethod, event.payload);\n            process.env.NODE_ENV === 'development' ? (0, _utils.warning)(Boolean(helper.state.userToken), \"\\nCannot send event to Algolia Insights because `userToken` is not set.\\n\\nSee documentation: https://www.algolia.com/doc/guides/building-search-ui/going-further/send-insights-events/js/#setting-the-usertoken\\n\") : void 0;\n          } else {\n            process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, 'Cannot send event to Algolia Insights because `insightsMethod` option is missing.') : void 0;\n          }\n        };\n      },\n      unsubscribe: function unsubscribe() {\n        insightsClient('onUserTokenChange', undefined);\n        instantSearchInstance.sendEventToInsights = _utils.noop;\n        if (helper && initialParameters) {\n          helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread(_objectSpread({}, helper.state), initialParameters));\n          instantSearchInstance.scheduleSearch();\n        }\n      }\n    };\n  };\n}\nfunction getInitialParameters(instantSearchInstance) {\n  var _instantSearchInstanc, _instantSearchInstanc2;\n  // in SSR, the initial state we use in this domain is set on the main index\n  var stateFromInitialResults = ((_instantSearchInstanc = instantSearchInstance._initialResults) === null || _instantSearchInstanc === void 0 ? void 0 : (_instantSearchInstanc2 = _instantSearchInstanc[instantSearchInstance.indexName]) === null || _instantSearchInstanc2 === void 0 ? void 0 : _instantSearchInstanc2.state) || {};\n  var stateFromHelper = instantSearchInstance.mainHelper.state;\n  return {\n    userToken: stateFromInitialResults.userToken || stateFromHelper.userToken,\n    clickAnalytics: stateFromInitialResults.clickAnalytics || stateFromHelper.clickAnalytics\n  };\n}\nfunction saveTokenAsCookie(token, cookieDuration) {\n  var MONTH = 30 * 24 * 60 * 60 * 1000;\n  var d = new Date();\n  d.setTime(d.getTime() + (cookieDuration || MONTH * 6));\n  var expires = \"expires=\".concat(d.toUTCString());\n  document.cookie = \"_ALGOLIA=\".concat(token, \";\").concat(expires, \";path=/\");\n}\n\n/**\n * Determines if a given insights `client` supports the optional call to `init`\n * and the ability to set credentials via extra parameters when sending events.\n */\nfunction isModernInsightsClient(client) {\n  var _split$map = (client.version || '').split('.').map(Number),\n    _split$map2 = _slicedToArray(_split$map, 2),\n    major = _split$map2[0],\n    minor = _split$map2[1];\n\n  /* eslint-disable @typescript-eslint/naming-convention */\n  var v3 = major >= 3;\n  var v2_6 = major === 2 && minor >= 6;\n  var v1_10 = major === 1 && minor >= 10;\n  /* eslint-enable @typescript-eslint/naming-convention */\n\n  return v3 || v2_6 || v1_10;\n}\n\n/**\n * While `search-insights` supports both string and number user tokens,\n * the Search API only accepts strings. This function normalizes the user token.\n */\nfunction normalizeUserToken(userToken) {\n  if (!userToken) {\n    return undefined;\n  }\n  return typeof userToken === 'number' ? userToken.toString() : userToken;\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/middlewares/createMetadataMiddleware.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.createMetadataMiddleware = createMetadataMiddleware;\nexports.isMetadataEnabled = isMetadataEnabled;\nvar _utils = require(\"../lib/utils\");\nfunction extractWidgetPayload(widgets, instantSearchInstance, payload) {\n  var initOptions = (0, _utils.createInitArgs)(instantSearchInstance, instantSearchInstance.mainIndex, instantSearchInstance._initialUiState);\n  widgets.forEach(function (widget) {\n    var widgetParams = {};\n    if (widget.getWidgetRenderState) {\n      var renderState = widget.getWidgetRenderState(initOptions);\n      if (renderState && renderState.widgetParams) {\n        // casting, as we just earlier checked widgetParams exists, and thus an object\n        widgetParams = renderState.widgetParams;\n      }\n    }\n\n    // since we destructure in all widgets, the parameters with defaults are set to \"undefined\"\n    var params = Object.keys(widgetParams).filter(function (key) {\n      return widgetParams[key] !== undefined;\n    });\n    payload.widgets.push({\n      type: widget.$$type,\n      widgetType: widget.$$widgetType,\n      params: params\n    });\n    if (widget.$$type === 'ais.index') {\n      extractWidgetPayload(widget.getWidgets(), instantSearchInstance, payload);\n    }\n  });\n}\nfunction isMetadataEnabled() {\n  return (0, _utils.safelyRunOnBrowser)(function (_ref) {\n    var _window$navigator, _window$navigator$use;\n    var window = _ref.window;\n    return ((_window$navigator = window.navigator) === null || _window$navigator === void 0 ? void 0 : (_window$navigator$use = _window$navigator.userAgent) === null || _window$navigator$use === void 0 ? void 0 : _window$navigator$use.indexOf('Algolia Crawler')) > -1;\n  }, {\n    fallback: function fallback() {\n      return false;\n    }\n  });\n}\n\n/**\n * Exposes the metadata of mounted widgets in a custom\n * `<meta name=\"instantsearch:widgets\" />` tag. The metadata per widget is:\n * - applied parameters\n * - widget name\n * - connector name\n */\nfunction createMetadataMiddleware() {\n  var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n    _ref2$$$internal = _ref2.$$internal,\n    $$internal = _ref2$$$internal === void 0 ? false : _ref2$$$internal;\n  return function (_ref3) {\n    var instantSearchInstance = _ref3.instantSearchInstance;\n    var payload = {\n      widgets: []\n    };\n    var payloadContainer = document.createElement('meta');\n    var refNode = document.querySelector('head');\n    payloadContainer.name = 'instantsearch:widgets';\n    return {\n      $$type: 'ais.metadata',\n      $$internal: $$internal,\n      onStateChange: function onStateChange() {},\n      subscribe: function subscribe() {\n        // using setTimeout here to delay extraction until widgets have been added in a tick (e.g. Vue)\n        setTimeout(function () {\n          var client = instantSearchInstance.client;\n          payload.ua = client.transporter && client.transporter.userAgent ? client.transporter.userAgent.value : client._ua;\n          extractWidgetPayload(instantSearchInstance.mainIndex.getWidgets(), instantSearchInstance, payload);\n          instantSearchInstance.middleware.forEach(function (middleware) {\n            return payload.widgets.push({\n              middleware: true,\n              type: middleware.instance.$$type,\n              internal: middleware.instance.$$internal\n            });\n          });\n          payloadContainer.content = JSON.stringify(payload);\n          refNode.appendChild(payloadContainer);\n        }, 0);\n      },\n      started: function started() {},\n      unsubscribe: function unsubscribe() {\n        payloadContainer.remove();\n      }\n    };\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/middlewares/createRouterMiddleware.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.createRouterMiddleware = void 0;\nvar _history = _interopRequireDefault(require(\"../lib/routers/history\"));\nvar _simple = _interopRequireDefault(require(\"../lib/stateMappings/simple\"));\nvar _utils = require(\"../lib/utils\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar createRouterMiddleware = exports.createRouterMiddleware = function createRouterMiddleware() {\n  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var _props$router = props.router,\n    router = _props$router === void 0 ? (0, _history.default)() : _props$router,\n    _props$stateMapping = props.stateMapping,\n    stateMapping = _props$stateMapping === void 0 ? (0, _simple.default)() : _props$stateMapping,\n    _props$$$internal = props.$$internal,\n    $$internal = _props$$$internal === void 0 ? false : _props$$$internal;\n  return function (_ref) {\n    var instantSearchInstance = _ref.instantSearchInstance;\n    function topLevelCreateURL(nextState) {\n      var previousUiState =\n      // If only the mainIndex is initialized, we don't yet know what other\n      // index widgets are used. Therefore we fall back to the initialUiState.\n      // We can't indiscriminately use the initialUiState because then we\n      // reintroduce state that was changed by the user.\n      // When there are no widgets, we are sure the user can't yet have made\n      // any changes.\n      instantSearchInstance.mainIndex.getWidgets().length === 0 ? instantSearchInstance._initialUiState : instantSearchInstance.mainIndex.getWidgetUiState({});\n      var uiState = Object.keys(nextState).reduce(function (acc, indexId) {\n        return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, indexId, nextState[indexId]));\n      }, previousUiState);\n      var route = stateMapping.stateToRoute(uiState);\n      return router.createURL(route);\n    }\n\n    // casting to UiState here to keep createURL unaware of custom UiState\n    // (as long as it's an object, it's ok)\n    instantSearchInstance._createURL = topLevelCreateURL;\n    var lastRouteState = undefined;\n    var initialUiState = instantSearchInstance._initialUiState;\n    return {\n      $$type: \"ais.router({router:\".concat(router.$$type || '__unknown__', \", stateMapping:\").concat(stateMapping.$$type || '__unknown__', \"})\"),\n      $$internal: $$internal,\n      onStateChange: function onStateChange(_ref2) {\n        var uiState = _ref2.uiState;\n        var routeState = stateMapping.stateToRoute(uiState);\n        if (lastRouteState === undefined || !(0, _utils.isEqual)(lastRouteState, routeState)) {\n          router.write(routeState);\n          lastRouteState = routeState;\n        }\n      },\n      subscribe: function subscribe() {\n        process.env.NODE_ENV === 'development' ? (0, _utils.warning)(Object.keys(initialUiState).length === 0, 'Using `initialUiState` together with routing is not recommended. The `initialUiState` will be overwritten by the URL parameters.') : void 0;\n        instantSearchInstance._initialUiState = _objectSpread(_objectSpread({}, initialUiState), stateMapping.routeToState(router.read()));\n        router.onUpdate(function (route) {\n          if (instantSearchInstance.mainIndex.getWidgets().length > 0) {\n            instantSearchInstance.setUiState(stateMapping.routeToState(route));\n          }\n        });\n      },\n      started: function started() {\n        var _router$start;\n        (_router$start = router.start) === null || _router$start === void 0 ? void 0 : _router$start.call(router);\n      },\n      unsubscribe: function unsubscribe() {\n        router.dispose();\n      }\n    };\n  };\n};"
  },
  {
    "path": "js/instantsearch.js/cjs/middlewares/index.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nvar _createInsightsMiddleware = require(\"./createInsightsMiddleware\");\nObject.keys(_createInsightsMiddleware).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _createInsightsMiddleware[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _createInsightsMiddleware[key];\n    }\n  });\n});\nvar _createRouterMiddleware = require(\"./createRouterMiddleware\");\nObject.keys(_createRouterMiddleware).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _createRouterMiddleware[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _createRouterMiddleware[key];\n    }\n  });\n});\nvar _createMetadataMiddleware = require(\"./createMetadataMiddleware\");\nObject.keys(_createMetadataMiddleware).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _createMetadataMiddleware[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _createMetadataMiddleware[key];\n    }\n  });\n});"
  },
  {
    "path": "js/instantsearch.js/cjs/templates/carousel/carousel.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.carousel = carousel;\nvar _preact = require(\"htm/preact\");\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact2 = require(\"preact\");\nvar _hooks = require(\"preact/hooks\");\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nvar Carousel = (0, _instantsearchUiComponents.createCarouselComponent)({\n  createElement: _preact2.h,\n  Fragment: _preact2.Fragment\n});\nfunction CarouselWithRefs(props) {\n  var carouselRefs = {\n    listRef: (0, _hooks.useRef)(null),\n    nextButtonRef: (0, _hooks.useRef)(null),\n    previousButtonRef: (0, _hooks.useRef)(null),\n    carouselIdRef: (0, _hooks.useRef)((0, _instantsearchUiComponents.generateCarouselId)())\n  };\n  return (0, _preact2.h)(Carousel, _extends({}, carouselRefs, props));\n}\nfunction carousel() {\n  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n    cssClasses = _ref.cssClasses,\n    _ref$templates = _ref.templates,\n    templates = _ref$templates === void 0 ? {} : _ref$templates;\n  return function CarouselTemplate(_ref2) {\n    var items = _ref2.items,\n      widgetTemplates = _ref2.templates,\n      _ref2$cssClasses = _ref2.cssClasses,\n      widgetCssClasses = _ref2$cssClasses === void 0 ? {} : _ref2$cssClasses,\n      _ref2$sendEvent = _ref2.sendEvent,\n      sendEvent = _ref2$sendEvent === void 0 ? function () {} : _ref2$sendEvent;\n    var previous = templates.previous,\n      next = templates.next;\n    return (0, _preact2.h)(CarouselWithRefs, {\n      items: items,\n      sendEvent: sendEvent,\n      itemComponent: widgetTemplates.item,\n      previousIconComponent: previous ? function () {\n        return previous({\n          html: _preact.html\n        });\n      } : undefined,\n      nextIconComponent: next ? function () {\n        return next({\n          html: _preact.html\n        });\n      } : undefined,\n      classNames: _objectSpread(_objectSpread({}, cssClasses), {\n        list: (0, _instantsearchUiComponents.cx)(cssClasses === null || cssClasses === void 0 ? void 0 : cssClasses.list, widgetCssClasses === null || widgetCssClasses === void 0 ? void 0 : widgetCssClasses.list),\n        item: (0, _instantsearchUiComponents.cx)(cssClasses === null || cssClasses === void 0 ? void 0 : cssClasses.item, widgetCssClasses === null || widgetCssClasses === void 0 ? void 0 : widgetCssClasses.item)\n      })\n    });\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/templates/index.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nvar _carousel = require(\"./carousel/carousel\");\nObject.keys(_carousel).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _carousel[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _carousel[key];\n    }\n  });\n});"
  },
  {
    "path": "js/instantsearch.js/cjs/types/algoliasearch.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nvar _algoliasearch = require(\"algoliasearch-helper/types/algoliasearch.js\");\nObject.keys(_algoliasearch).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _algoliasearch[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _algoliasearch[key];\n    }\n  });\n});"
  },
  {
    "path": "js/instantsearch.js/cjs/types/component.js",
    "content": "\"use strict\";"
  },
  {
    "path": "js/instantsearch.js/cjs/types/connector.js",
    "content": "\"use strict\";"
  },
  {
    "path": "js/instantsearch.js/cjs/types/index.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nvar _utils = require(\"./utils\");\nObject.keys(_utils).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _utils[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _utils[key];\n    }\n  });\n});\nvar _algoliasearch = require(\"./algoliasearch\");\nObject.keys(_algoliasearch).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _algoliasearch[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _algoliasearch[key];\n    }\n  });\n});\nvar _results = require(\"./results\");\nObject.keys(_results).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _results[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _results[key];\n    }\n  });\n});\nvar _component = require(\"./component\");\nObject.keys(_component).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _component[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _component[key];\n    }\n  });\n});\nvar _instantsearch = require(\"./instantsearch\");\nObject.keys(_instantsearch).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _instantsearch[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _instantsearch[key];\n    }\n  });\n});\nvar _middleware = require(\"./middleware\");\nObject.keys(_middleware).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _middleware[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _middleware[key];\n    }\n  });\n});\nvar _router = require(\"./router\");\nObject.keys(_router).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _router[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _router[key];\n    }\n  });\n});\nvar _insights = require(\"./insights\");\nObject.keys(_insights).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _insights[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _insights[key];\n    }\n  });\n});\nvar _connector = require(\"./connector\");\nObject.keys(_connector).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _connector[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _connector[key];\n    }\n  });\n});\nvar _widgetFactory = require(\"./widget-factory\");\nObject.keys(_widgetFactory).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _widgetFactory[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _widgetFactory[key];\n    }\n  });\n});\nvar _widget = require(\"./widget\");\nObject.keys(_widget).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _widget[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _widget[key];\n    }\n  });\n});\nvar _uiState = require(\"./ui-state\");\nObject.keys(_uiState).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _uiState[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _uiState[key];\n    }\n  });\n});\nvar _renderState = require(\"./render-state\");\nObject.keys(_renderState).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _renderState[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _renderState[key];\n    }\n  });\n});\nvar _templates = require(\"./templates\");\nObject.keys(_templates).forEach(function (key) {\n  if (key === \"default\" || key === \"__esModule\") return;\n  if (key in exports && exports[key] === _templates[key]) return;\n  Object.defineProperty(exports, key, {\n    enumerable: true,\n    get: function get() {\n      return _templates[key];\n    }\n  });\n});"
  },
  {
    "path": "js/instantsearch.js/cjs/types/insights.js",
    "content": "\"use strict\";"
  },
  {
    "path": "js/instantsearch.js/cjs/types/instantsearch.js",
    "content": "\"use strict\";"
  },
  {
    "path": "js/instantsearch.js/cjs/types/middleware.js",
    "content": "\"use strict\";"
  },
  {
    "path": "js/instantsearch.js/cjs/types/render-state.js",
    "content": "\"use strict\";"
  },
  {
    "path": "js/instantsearch.js/cjs/types/results.js",
    "content": "\"use strict\";"
  },
  {
    "path": "js/instantsearch.js/cjs/types/router.js",
    "content": "\"use strict\";"
  },
  {
    "path": "js/instantsearch.js/cjs/types/templates.js",
    "content": "\"use strict\";"
  },
  {
    "path": "js/instantsearch.js/cjs/types/ui-state.js",
    "content": "\"use strict\";"
  },
  {
    "path": "js/instantsearch.js/cjs/types/utils.js",
    "content": "\"use strict\";"
  },
  {
    "path": "js/instantsearch.js/cjs/types/widget-factory.js",
    "content": "\"use strict\";"
  },
  {
    "path": "js/instantsearch.js/cjs/types/widget.js",
    "content": "\"use strict\";"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/analytics/analytics.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'analytics'\n});\n// @major this widget will be removed from the next major version.\nvar analytics = function analytics(widgetParams) {\n  var _ref = widgetParams || {},\n    pushFunction = _ref.pushFunction,\n    _ref$delay = _ref.delay,\n    delay = _ref$delay === void 0 ? 3000 : _ref$delay,\n    _ref$triggerOnUIInter = _ref.triggerOnUIInteraction,\n    triggerOnUIInteraction = _ref$triggerOnUIInter === void 0 ? false : _ref$triggerOnUIInter,\n    _ref$pushInitialSearc = _ref.pushInitialSearch,\n    pushInitialSearch = _ref$pushInitialSearc === void 0 ? true : _ref$pushInitialSearc,\n    _ref$pushPagination = _ref.pushPagination,\n    pushPagination = _ref$pushPagination === void 0 ? false : _ref$pushPagination;\n  if (!pushFunction) {\n    throw new Error(withUsage('The `pushFunction` option is required.'));\n  }\n  process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, \"`analytics` widget has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `insights` middleware.\\n\\nFor the migration, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/#analytics-widget\") : void 0;\n  var cachedState = null;\n  var serializeRefinements = function serializeRefinements(parameters) {\n    var refinements = [];\n\n    // eslint-disable-next-line no-restricted-syntax\n    for (var parameter in parameters) {\n      if (parameters.hasOwnProperty(parameter)) {\n        var values = parameters[parameter].join('+');\n        refinements.push(\"\".concat(encodeURIComponent(parameter), \"=\").concat(encodeURIComponent(parameter), \"_\").concat(encodeURIComponent(values)));\n      }\n    }\n    return refinements.join('&');\n  };\n  var serializeNumericRefinements = function serializeNumericRefinements(numericRefinements) {\n    var refinements = [];\n\n    // eslint-disable-next-line no-restricted-syntax\n    for (var attribute in numericRefinements) {\n      if (numericRefinements.hasOwnProperty(attribute)) {\n        var filter = numericRefinements[attribute];\n        if (filter.hasOwnProperty('>=') && filter.hasOwnProperty('<=')) {\n          if (filter['>='] && filter['>='][0] === filter['<='] && filter['<='][0]) {\n            refinements.push(\"\".concat(attribute, \"=\").concat(attribute, \"_\").concat(filter['>=']));\n          } else {\n            refinements.push(\"\".concat(attribute, \"=\").concat(attribute, \"_\").concat(filter['>='], \"to\").concat(filter['<=']));\n          }\n        } else if (filter.hasOwnProperty('>=')) {\n          refinements.push(\"\".concat(attribute, \"=\").concat(attribute, \"_from\").concat(filter['>=']));\n        } else if (filter.hasOwnProperty('<=')) {\n          refinements.push(\"\".concat(attribute, \"=\").concat(attribute, \"_to\").concat(filter['<=']));\n        } else if (filter.hasOwnProperty('=')) {\n          var equals = [];\n\n          // eslint-disable-next-line no-restricted-syntax\n          for (var equal in filter['=']) {\n            // eslint-disable-next-line max-depth\n            if (filter['='].hasOwnProperty(equal)) {\n              // @ts-ignore somehow 'equal' is a string, even though it's a number?\n              equals.push(filter['='][equal]);\n            }\n          }\n          refinements.push(\"\".concat(attribute, \"=\").concat(attribute, \"_\").concat(equals.join('-')));\n        }\n      }\n    }\n    return refinements.join('&');\n  };\n  var lastSentData = '';\n  var sendAnalytics = function sendAnalytics(analyticsState) {\n    if (analyticsState === null) {\n      return;\n    }\n    var serializedParams = [];\n    var serializedRefinements = serializeRefinements(_objectSpread(_objectSpread(_objectSpread({}, analyticsState.state.disjunctiveFacetsRefinements), analyticsState.state.facetsRefinements), analyticsState.state.hierarchicalFacetsRefinements));\n    var serializedNumericRefinements = serializeNumericRefinements(analyticsState.state.numericRefinements);\n    if (serializedRefinements !== '') {\n      serializedParams.push(serializedRefinements);\n    }\n    if (serializedNumericRefinements !== '') {\n      serializedParams.push(serializedNumericRefinements);\n    }\n    var stringifiedParams = serializedParams.join('&');\n    var dataToSend = \"Query: \".concat(analyticsState.state.query || '', \", \").concat(stringifiedParams);\n    if (pushPagination === true) {\n      dataToSend += \", Page: \".concat(analyticsState.state.page || 0);\n    }\n    if (lastSentData !== dataToSend) {\n      pushFunction(stringifiedParams, analyticsState.state, analyticsState.results);\n      lastSentData = dataToSend;\n    }\n  };\n  var pushTimeout;\n  var isInitialSearch = true;\n  if (pushInitialSearch === true) {\n    isInitialSearch = false;\n  }\n  var onClick = function onClick() {\n    sendAnalytics(cachedState);\n  };\n  var onUnload = function onUnload() {\n    sendAnalytics(cachedState);\n  };\n  return {\n    $$type: 'ais.analytics',\n    $$widgetType: 'ais.analytics',\n    init: function init() {\n      if (triggerOnUIInteraction === true) {\n        document.addEventListener('click', onClick);\n        window.addEventListener('beforeunload', onUnload);\n      }\n    },\n    render: function render(_ref2) {\n      var results = _ref2.results,\n        state = _ref2.state;\n      if (!results) {\n        return;\n      }\n      if (isInitialSearch === true) {\n        isInitialSearch = false;\n        return;\n      }\n      cachedState = {\n        results: results,\n        state: state\n      };\n      if (pushTimeout) {\n        clearTimeout(pushTimeout);\n      }\n      pushTimeout = window.setTimeout(function () {\n        return sendAnalytics(cachedState);\n      }, delay);\n    },\n    dispose: function dispose() {\n      if (triggerOnUIInteraction === true) {\n        document.removeEventListener('click', onClick);\n        window.removeEventListener('beforeunload', onUnload);\n      }\n    },\n    getRenderState: function getRenderState(renderState, renderOptions) {\n      return _objectSpread(_objectSpread({}, renderState), {}, {\n        analytics: this.getWidgetRenderState(renderOptions)\n      });\n    },\n    getWidgetRenderState: function getWidgetRenderState() {\n      return {\n        widgetParams: widgetParams\n      };\n    }\n  };\n};\nvar _default = exports.default = analytics;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/answers/answers.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _Answers = _interopRequireDefault(require(\"../../components/Answers/Answers\"));\nvar _connectAnswers = _interopRequireDefault(require(\"../../connectors/answers/connectAnswers\"));\nvar _suit = require(\"../../lib/suit\");\nvar _templating = require(\"../../lib/templating\");\nvar _utils = require(\"../../lib/utils\");\nvar _defaultTemplates = _interopRequireDefault(require(\"./defaultTemplates\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'answers'\n});\nvar suit = (0, _suit.component)('Answers');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    renderState = _ref.renderState,\n    templates = _ref.templates;\n  return function (_ref2, isFirstRendering) {\n    var hits = _ref2.hits,\n      isLoading = _ref2.isLoading,\n      instantSearchInstance = _ref2.instantSearchInstance;\n    if (isFirstRendering) {\n      renderState.templateProps = (0, _templating.prepareTemplateProps)({\n        defaultTemplates: _defaultTemplates.default,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    (0, _preact.render)((0, _preact.h)(_Answers.default, {\n      cssClasses: cssClasses,\n      hits: hits,\n      isLoading: isLoading,\n      templateProps: renderState.templateProps\n    }), containerNode);\n  };\n};\n/**\n * @deprecated the answers service is no longer offered, and this widget will be removed in InstantSearch.js v5\n */\nvar answersWidget = function answersWidget(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    attributesForPrediction = _ref3.attributesForPrediction,\n    queryLanguages = _ref3.queryLanguages,\n    nbHits = _ref3.nbHits,\n    searchDebounceTime = _ref3.searchDebounceTime,\n    renderDebounceTime = _ref3.renderDebounceTime,\n    escapeHTML = _ref3.escapeHTML,\n    extraParameters = _ref3.extraParameters,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    emptyRoot: (0, _instantsearchUiComponents.cx)(suit({\n      modifierName: 'empty'\n    }), userCssClasses.emptyRoot),\n    header: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'header'\n    }), userCssClasses.header),\n    loader: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'loader'\n    }), userCssClasses.loader),\n    list: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'list'\n    }), userCssClasses.list),\n    item: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item'\n    }), userCssClasses.item)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    templates: templates,\n    renderState: {}\n  });\n  var makeWidget = (0, _connectAnswers.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attributesForPrediction: attributesForPrediction,\n    queryLanguages: queryLanguages,\n    nbHits: nbHits,\n    searchDebounceTime: searchDebounceTime,\n    renderDebounceTime: renderDebounceTime,\n    escapeHTML: escapeHTML,\n    extraParameters: extraParameters\n  })), {}, {\n    $$widgetType: 'ais.answers'\n  });\n};\nvar _default = exports.default = (0, _utils.deprecate)(answersWidget, 'The answers widget is deprecated and will be removed in InstantSearch.js 5.0');"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/answers/defaultTemplates.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar defaultTemplates = {\n  header: function header() {\n    return '';\n  },\n  loader: function loader() {\n    return '';\n  },\n  item: function item(_item) {\n    return JSON.stringify(_item);\n  }\n};\nvar _default = exports.default = defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/breadcrumb/breadcrumb.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _Breadcrumb = _interopRequireDefault(require(\"../../components/Breadcrumb/Breadcrumb\"));\nvar _connectBreadcrumb = _interopRequireDefault(require(\"../../connectors/breadcrumb/connectBreadcrumb\"));\nvar _suit = require(\"../../lib/suit\");\nvar _templating = require(\"../../lib/templating\");\nvar _utils = require(\"../../lib/utils\");\nvar _defaultTemplates = _interopRequireDefault(require(\"./defaultTemplates\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'breadcrumb'\n});\nvar suit = (0, _suit.component)('Breadcrumb');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    renderState = _ref.renderState,\n    templates = _ref.templates;\n  return function (_ref2, isFirstRendering) {\n    var canRefine = _ref2.canRefine,\n      createURL = _ref2.createURL,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      items = _ref2.items,\n      refine = _ref2.refine;\n    if (isFirstRendering) {\n      renderState.templateProps = (0, _templating.prepareTemplateProps)({\n        defaultTemplates: _defaultTemplates.default,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    (0, _preact.render)((0, _preact.h)(_Breadcrumb.default, {\n      canRefine: canRefine,\n      cssClasses: cssClasses,\n      createURL: createURL,\n      items: items,\n      refine: refine,\n      templateProps: renderState.templateProps\n    }), containerNode);\n  };\n};\nvar breadcrumb = function breadcrumb(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    attributes = _ref3.attributes,\n    separator = _ref3.separator,\n    rootPath = _ref3.rootPath,\n    transformItems = _ref3.transformItems,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    noRefinementRoot: (0, _instantsearchUiComponents.cx)(suit({\n      modifierName: 'noRefinement'\n    }), userCssClasses.noRefinementRoot),\n    list: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'list'\n    }), userCssClasses.list),\n    item: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item'\n    }), userCssClasses.item),\n    selectedItem: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item',\n      modifierName: 'selected'\n    }), userCssClasses.selectedItem),\n    separator: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'separator'\n    }), userCssClasses.separator),\n    link: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'link'\n    }), userCssClasses.link)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = (0, _connectBreadcrumb.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attributes: attributes,\n    separator: separator,\n    rootPath: rootPath,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.breadcrumb'\n  });\n};\nvar _default = exports.default = breadcrumb;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/breadcrumb/defaultTemplates.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar defaultTemplates = {\n  home: function home() {\n    return 'Home';\n  },\n  separator: function separator() {\n    return '>';\n  }\n};\nvar _default = exports.default = defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/clear-refinements/clear-refinements.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _ClearRefinements = _interopRequireDefault(require(\"../../components/ClearRefinements/ClearRefinements\"));\nvar _connectClearRefinements = _interopRequireDefault(require(\"../../connectors/clear-refinements/connectClearRefinements\"));\nvar _suit = require(\"../../lib/suit\");\nvar _templating = require(\"../../lib/templating\");\nvar _utils = require(\"../../lib/utils\");\nvar _defaultTemplates = _interopRequireDefault(require(\"./defaultTemplates\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'clear-refinements'\n});\nvar suit = (0, _suit.component)('ClearRefinements');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    renderState = _ref.renderState,\n    templates = _ref.templates;\n  return function (_ref2, isFirstRendering) {\n    var refine = _ref2.refine,\n      canRefine = _ref2.canRefine,\n      instantSearchInstance = _ref2.instantSearchInstance;\n    if (isFirstRendering) {\n      renderState.templateProps = (0, _templating.prepareTemplateProps)({\n        defaultTemplates: _defaultTemplates.default,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    (0, _preact.render)((0, _preact.h)(_ClearRefinements.default, {\n      refine: refine,\n      cssClasses: cssClasses,\n      hasRefinements: canRefine,\n      templateProps: renderState.templateProps\n    }), containerNode);\n  };\n};\nvar clearRefinements = function clearRefinements(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    includedAttributes = _ref3.includedAttributes,\n    excludedAttributes = _ref3.excludedAttributes,\n    transformItems = _ref3.transformItems,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    button: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'button'\n    }), userCssClasses.button),\n    disabledButton: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'button',\n      modifierName: 'disabled'\n    }), userCssClasses.disabledButton)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = (0, _connectClearRefinements.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    includedAttributes: includedAttributes,\n    excludedAttributes: excludedAttributes,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.clearRefinements'\n  });\n};\nvar _default = exports.default = clearRefinements;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/clear-refinements/defaultTemplates.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar defaultTemplates = {\n  resetLabel: function resetLabel() {\n    return 'Clear refinements';\n  }\n};\nvar _default = exports.default = defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/configure/configure.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _connectConfigure = _interopRequireDefault(require(\"../../connectors/configure/connectConfigure\"));\nvar _utils = require(\"../../lib/utils\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n/**\n * A list of [search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/)\n * to enable when the widget mounts.\n */\n\nvar configure = function configure(widgetParams) {\n  // This is a renderless widget that falls back to the connector's\n  // noop render and unmount functions.\n  var makeWidget = (0, _connectConfigure.default)(_utils.noop);\n  return _objectSpread(_objectSpread({}, makeWidget({\n    searchParameters: widgetParams\n  })), {}, {\n    $$widgetType: 'ais.configure'\n  });\n};\nvar _default = exports.default = configure;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/configure-related-items/configure-related-items.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _connectConfigureRelatedItems = _interopRequireDefault(require(\"../../connectors/configure-related-items/connectConfigureRelatedItems\"));\nvar _utils = require(\"../../lib/utils\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar configureRelatedItems = function configureRelatedItems(widgetParams) {\n  var makeWidget = (0, _connectConfigureRelatedItems.default)(_utils.noop);\n  return _objectSpread(_objectSpread({}, makeWidget(widgetParams)), {}, {\n    $$widgetType: 'ais.configureRelatedItems'\n  });\n};\n\n/** @deprecated use relatedItems instead */\nvar _default = exports.default = configureRelatedItems;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/current-refinements/current-refinements.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _CurrentRefinements = _interopRequireDefault(require(\"../../components/CurrentRefinements/CurrentRefinements\"));\nvar _connectCurrentRefinements = _interopRequireDefault(require(\"../../connectors/current-refinements/connectCurrentRefinements\"));\nvar _suit = require(\"../../lib/suit\");\nvar _utils = require(\"../../lib/utils\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'current-refinements'\n});\nvar suit = (0, _suit.component)('CurrentRefinements');\nvar renderer = function renderer(_ref, isFirstRender) {\n  var items = _ref.items,\n    widgetParams = _ref.widgetParams,\n    canRefine = _ref.canRefine;\n  if (isFirstRender) {\n    return;\n  }\n  var _ref2 = widgetParams,\n    container = _ref2.container,\n    cssClasses = _ref2.cssClasses;\n  (0, _preact.render)((0, _preact.h)(_CurrentRefinements.default, {\n    cssClasses: cssClasses,\n    items: items,\n    canRefine: canRefine\n  }), container);\n};\nvar currentRefinements = function currentRefinements(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    includedAttributes = _ref3.includedAttributes,\n    excludedAttributes = _ref3.excludedAttributes,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    transformItems = _ref3.transformItems;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    noRefinementRoot: (0, _instantsearchUiComponents.cx)(suit({\n      modifierName: 'noRefinement'\n    }), userCssClasses.noRefinementRoot),\n    list: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'list'\n    }), userCssClasses.list),\n    item: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item'\n    }), userCssClasses.item),\n    label: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'label'\n    }), userCssClasses.label),\n    category: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'category'\n    }), userCssClasses.category),\n    categoryLabel: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'categoryLabel'\n    }), userCssClasses.categoryLabel),\n    delete: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'delete'\n    }), userCssClasses.delete)\n  };\n  var makeWidget = (0, _connectCurrentRefinements.default)(renderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    container: containerNode,\n    cssClasses: cssClasses,\n    includedAttributes: includedAttributes,\n    excludedAttributes: excludedAttributes,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.currentRefinements'\n  });\n};\nvar _default = exports.default = currentRefinements;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/dynamic-widgets/dynamic-widgets.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _connectDynamicWidgets = _interopRequireDefault(require(\"../../connectors/dynamic-widgets/connectDynamicWidgets\"));\nvar _suit = require(\"../../lib/suit\");\nvar _utils = require(\"../../lib/utils\");\nvar _excluded = [\"container\", \"widgets\", \"fallbackWidget\"];\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'dynamic-widgets'\n});\nvar suit = (0, _suit.component)('DynamicWidgets');\nfunction createContainer(rootContainer) {\n  var container = document.createElement('div');\n  container.className = suit({\n    descendantName: 'widget'\n  });\n  rootContainer.appendChild(container);\n  return container;\n}\nvar dynamicWidgets = function dynamicWidgets(widgetParams) {\n  var _ref = widgetParams || {},\n    containerSelector = _ref.container,\n    widgets = _ref.widgets,\n    fallbackWidget = _ref.fallbackWidget,\n    otherWidgetParams = _objectWithoutProperties(_ref, _excluded);\n  if (!containerSelector) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  if (!(widgets && Array.isArray(widgets) && widgets.every(function (widget) {\n    return typeof widget === 'function';\n  }))) {\n    throw new Error(withUsage('The `widgets` option expects an array of callbacks.'));\n  }\n  var userContainer = (0, _utils.getContainerNode)(containerSelector);\n  var rootContainer = document.createElement('div');\n  rootContainer.className = suit();\n  var containers = new Map();\n  var connectorWidgets = [];\n  var makeWidget = (0, _connectDynamicWidgets.default)(function (_ref2, isFirstRender) {\n    var attributesToRender = _ref2.attributesToRender;\n    if (isFirstRender) {\n      userContainer.appendChild(rootContainer);\n    }\n    attributesToRender.forEach(function (attribute) {\n      if (!containers.has(attribute)) {\n        return;\n      }\n      var container = containers.get(attribute);\n      rootContainer.appendChild(container);\n    });\n  }, function () {\n    userContainer.removeChild(rootContainer);\n  });\n  var widget = makeWidget(_objectSpread(_objectSpread({}, otherWidgetParams), {}, {\n    widgets: connectorWidgets,\n    fallbackWidget: typeof fallbackWidget === 'function' ? function (_ref3) {\n      var attribute = _ref3.attribute;\n      var container = createContainer(rootContainer);\n      containers.set(attribute, container);\n      return fallbackWidget({\n        attribute: attribute,\n        container: container\n      });\n    } : undefined\n  }));\n  return _objectSpread(_objectSpread({}, widget), {}, {\n    init: function init(initOptions) {\n      widgets.forEach(function (cb) {\n        var container = createContainer(rootContainer);\n        var childWidget = cb(container);\n        var attribute = (0, _utils.getWidgetAttribute)(childWidget, initOptions);\n        containers.set(attribute, container);\n        connectorWidgets.push(childWidget);\n      });\n      widget.init(initOptions);\n    },\n    $$widgetType: 'ais.dynamicWidgets'\n  });\n};\nvar _default = exports.default = dynamicWidgets;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/frequently-bought-together/frequently-bought-together.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _Template = _interopRequireDefault(require(\"../../components/Template/Template\"));\nvar _connectFrequentlyBoughtTogether = _interopRequireDefault(require(\"../../connectors/frequently-bought-together/connectFrequentlyBoughtTogether\"));\nvar _templating = require(\"../../lib/templating\");\nvar _utils = require(\"../../lib/utils\");\nvar _excluded = [\"item\", \"sendEvent\"];\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'frequently-bought-together'\n});\nvar FrequentlyBoughtTogether = (0, _instantsearchUiComponents.createFrequentlyBoughtTogetherComponent)({\n  createElement: _preact.h,\n  Fragment: _preact.Fragment\n});\nvar renderer = function renderer(_ref) {\n  var renderState = _ref.renderState,\n    cssClasses = _ref.cssClasses,\n    containerNode = _ref.containerNode,\n    templates = _ref.templates;\n  return function (_ref2, isFirstRendering) {\n    var items = _ref2.items,\n      results = _ref2.results,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      sendEvent = _ref2.sendEvent;\n    if (isFirstRendering) {\n      renderState.templateProps = (0, _templating.prepareTemplateProps)({\n        defaultTemplates: {},\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    var headerComponent = templates.header ? function (data) {\n      return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n        templateKey: \"header\",\n        rootTagName: \"fragment\",\n        data: {\n          cssClasses: data.classNames,\n          items: data.items\n        }\n      }));\n    } : undefined;\n    var itemComponent = templates.item ? function (_ref3) {\n      var item = _ref3.item,\n        _sendEvent = _ref3.sendEvent,\n        rootProps = _objectWithoutProperties(_ref3, _excluded);\n      return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n        templateKey: \"item\",\n        rootTagName: \"fragment\",\n        data: item,\n        sendEvent: _sendEvent,\n        rootProps: _objectSpread({}, rootProps)\n      }));\n    } : undefined;\n    var emptyComponent = templates.empty ? function () {\n      return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n        templateKey: \"empty\",\n        rootTagName: \"fragment\",\n        data: results\n      }));\n    } : undefined;\n    var layoutComponent = templates.layout ? function (data) {\n      return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n        templateKey: \"layout\",\n        rootTagName: \"fragment\",\n        data: {\n          sendEvent: sendEvent,\n          items: data.items,\n          templates: {\n            item: templates.item ? function (_ref4) {\n              var item = _ref4.item;\n              return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n                templateKey: \"item\",\n                rootTagName: \"fragment\",\n                data: item,\n                sendEvent: sendEvent\n              }));\n            } : undefined\n          },\n          cssClasses: {\n            list: data.classNames.list,\n            item: data.classNames.item\n          }\n        },\n        sendEvent: sendEvent\n      }));\n    } : undefined;\n    (0, _preact.render)((0, _preact.h)(FrequentlyBoughtTogether, {\n      items: items,\n      headerComponent: headerComponent,\n      itemComponent: itemComponent,\n      sendEvent: sendEvent,\n      classNames: cssClasses,\n      emptyComponent: emptyComponent,\n      layout: layoutComponent,\n      status: instantSearchInstance.status\n    }), containerNode);\n  };\n};\nvar frequentlyBoughtTogether = exports.default = function frequentlyBoughtTogether(widgetParams) {\n  var _ref5 = widgetParams || {},\n    container = _ref5.container,\n    objectIDs = _ref5.objectIDs,\n    limit = _ref5.limit,\n    queryParameters = _ref5.queryParameters,\n    threshold = _ref5.threshold,\n    escapeHTML = _ref5.escapeHTML,\n    transformItems = _ref5.transformItems,\n    _ref5$templates = _ref5.templates,\n    templates = _ref5$templates === void 0 ? {} : _ref5$templates,\n    _ref5$cssClasses = _ref5.cssClasses,\n    cssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = (0, _connectFrequentlyBoughtTogether.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    objectIDs: objectIDs,\n    limit: limit,\n    queryParameters: queryParameters,\n    threshold: threshold,\n    escapeHTML: escapeHTML,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.frequentlyBoughtTogether'\n  });\n};"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/geo-search/GeoSearchRenderer.d.js",
    "content": "\"use strict\";"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/geo-search/GeoSearchRenderer.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _preact = require(\"preact\");\nvar _GeoSearchControls = _interopRequireDefault(require(\"../../components/GeoSearchControls/GeoSearchControls\"));\nvar _templating = require(\"../../lib/templating\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nvar refineWithMap = function refineWithMap(_ref) {\n  var refine = _ref.refine,\n    mapInstance = _ref.mapInstance;\n  return refine({\n    northEast: mapInstance.getBounds().getNorthEast().toJSON(),\n    southWest: mapInstance.getBounds().getSouthWest().toJSON()\n  });\n};\nvar collectMarkersForNextRender = function collectMarkersForNextRender(markers, nextIds) {\n  return markers.reduce(function (_ref2, marker) {\n    var _ref3 = _slicedToArray(_ref2, 2),\n      update = _ref3[0],\n      exit = _ref3[1];\n    var persist = nextIds.includes(marker.__id);\n    return persist ? [update.concat(marker), exit] : [update, exit.concat(marker)];\n  }, [[], []]);\n};\nvar createBoundingBoxFromMarkers = function createBoundingBoxFromMarkers(google, markers) {\n  var latLngBounds = markers.reduce(function (acc, marker) {\n    return acc.extend(marker.getPosition());\n  }, new google.maps.LatLngBounds());\n  return {\n    northEast: latLngBounds.getNorthEast().toJSON(),\n    southWest: latLngBounds.getSouthWest().toJSON()\n  };\n};\nvar lockUserInteraction = function lockUserInteraction(renderState, functionThatAltersTheMapPosition) {\n  renderState.isUserInteraction = false;\n  functionThatAltersTheMapPosition();\n  renderState.isUserInteraction = true;\n};\nvar renderer = function renderer(_ref4, isFirstRendering) {\n  var items = _ref4.items,\n    position = _ref4.position,\n    currentRefinement = _ref4.currentRefinement,\n    refine = _ref4.refine,\n    clearMapRefinement = _ref4.clearMapRefinement,\n    toggleRefineOnMapMove = _ref4.toggleRefineOnMapMove,\n    isRefineOnMapMove = _ref4.isRefineOnMapMove,\n    setMapMoveSinceLastRefine = _ref4.setMapMoveSinceLastRefine,\n    hasMapMoveSinceLastRefine = _ref4.hasMapMoveSinceLastRefine,\n    isRefinedWithMap = _ref4.isRefinedWithMap,\n    widgetParams = _ref4.widgetParams,\n    instantSearchInstance = _ref4.instantSearchInstance;\n  var container = widgetParams.container,\n    googleReference = widgetParams.googleReference,\n    cssClasses = widgetParams.cssClasses,\n    templates = widgetParams.templates,\n    initialZoom = widgetParams.initialZoom,\n    initialPosition = widgetParams.initialPosition,\n    enableRefine = widgetParams.enableRefine,\n    enableClearMapRefinement = widgetParams.enableClearMapRefinement,\n    enableRefineControl = widgetParams.enableRefineControl,\n    mapOptions = widgetParams.mapOptions,\n    createMarker = widgetParams.createMarker,\n    markerOptions = widgetParams.markerOptions,\n    renderState = widgetParams.renderState;\n  if (isFirstRendering) {\n    renderState.isUserInteraction = true;\n    renderState.isPendingRefine = false;\n    renderState.markers = [];\n    var rootElement = document.createElement('div');\n    rootElement.className = cssClasses.root;\n    container.appendChild(rootElement);\n    var mapElement = document.createElement('div');\n    mapElement.className = cssClasses.map;\n    rootElement.appendChild(mapElement);\n    var treeElement = document.createElement('div');\n    treeElement.className = cssClasses.tree;\n    rootElement.appendChild(treeElement);\n    renderState.mapInstance = new googleReference.maps.Map(mapElement, _objectSpread({\n      mapTypeControl: false,\n      fullscreenControl: false,\n      streetViewControl: false,\n      clickableIcons: false,\n      zoomControlOptions: {\n        position: googleReference.maps.ControlPosition.LEFT_TOP\n      }\n    }, mapOptions));\n    var setupListenersWhenMapIsReady = function setupListenersWhenMapIsReady() {\n      var onChange = function onChange() {\n        if (renderState.isUserInteraction && enableRefine) {\n          setMapMoveSinceLastRefine();\n          if (isRefineOnMapMove()) {\n            renderState.isPendingRefine = true;\n          }\n        }\n      };\n      renderState.mapInstance.addListener('center_changed', onChange);\n      renderState.mapInstance.addListener('zoom_changed', onChange);\n      renderState.mapInstance.addListener('dragstart', onChange);\n      renderState.mapInstance.addListener('idle', function () {\n        if (renderState.isUserInteraction && renderState.isPendingRefine) {\n          renderState.isPendingRefine = false;\n          refineWithMap({\n            mapInstance: renderState.mapInstance,\n            refine: refine\n          });\n        }\n      });\n    };\n    googleReference.maps.event.addListenerOnce(renderState.mapInstance, 'idle', setupListenersWhenMapIsReady);\n    renderState.templateProps = (0, _templating.prepareTemplateProps)({\n      templatesConfig: instantSearchInstance.templatesConfig,\n      templates: templates\n    });\n    return;\n  }\n\n  // Collect markers that need to be updated or removed\n  var nextItemsIds = items.map(function (_) {\n    return _.objectID;\n  });\n  var _collectMarkersForNex = collectMarkersForNextRender(renderState.markers, nextItemsIds),\n    _collectMarkersForNex2 = _slicedToArray(_collectMarkersForNex, 2),\n    updateMarkers = _collectMarkersForNex2[0],\n    exitMarkers = _collectMarkersForNex2[1];\n\n  // Collect items that will be added\n  var updateMarkerIds = updateMarkers.map(function (_) {\n    return _.__id;\n  });\n  var nextPendingItems = items.filter(function (item) {\n    return !updateMarkerIds.includes(item.objectID);\n  });\n\n  // Remove all markers that need to be removed\n  exitMarkers.forEach(function (marker) {\n    return marker.setMap(null);\n  });\n\n  // Create the markers from the items\n  renderState.markers = updateMarkers.concat(nextPendingItems.map(function (item) {\n    var marker = createMarker({\n      map: renderState.mapInstance,\n      item: item\n    });\n    Object.keys(markerOptions.events).forEach(function (eventName) {\n      marker.addListener(eventName, function (event) {\n        markerOptions.events[eventName]({\n          map: renderState.mapInstance,\n          event: event,\n          item: item,\n          marker: marker\n        });\n      });\n    });\n    return marker;\n  }));\n  var shouldUpdate = !hasMapMoveSinceLastRefine();\n\n  // We use this value for differentiate the padding to apply during\n  // fitBounds. When we don't have a currenRefinement (boundingBox)\n  // we let Google Maps compute the automatic padding. But when we\n  // provide the currentRefinement we explicitly set the padding\n  // to `0` otherwise the map will decrease the zoom on each refine.\n  var boundingBoxPadding = currentRefinement ? 0 : null;\n  var boundingBox = !currentRefinement && Boolean(renderState.markers.length) ? createBoundingBoxFromMarkers(googleReference, renderState.markers) : currentRefinement;\n  if (boundingBox && shouldUpdate) {\n    lockUserInteraction(renderState, function () {\n      renderState.mapInstance.fitBounds(new googleReference.maps.LatLngBounds(boundingBox.southWest, boundingBox.northEast), boundingBoxPadding);\n    });\n  } else if (shouldUpdate) {\n    lockUserInteraction(renderState, function () {\n      renderState.mapInstance.setCenter(position || initialPosition);\n      renderState.mapInstance.setZoom(initialZoom);\n    });\n  }\n  (0, _preact.render)((0, _preact.h)(_GeoSearchControls.default, {\n    cssClasses: cssClasses,\n    enableRefine: enableRefine,\n    enableRefineControl: enableRefineControl,\n    enableClearMapRefinement: enableClearMapRefinement,\n    isRefineOnMapMove: isRefineOnMapMove(),\n    isRefinedWithMap: isRefinedWithMap(),\n    hasMapMoveSinceLastRefine: hasMapMoveSinceLastRefine(),\n    onRefineToggle: toggleRefineOnMapMove,\n    onRefineClick: function onRefineClick() {\n      return refineWithMap({\n        mapInstance: renderState.mapInstance,\n        refine: refine\n      });\n    },\n    onClearClick: clearMapRefinement,\n    templateProps: renderState.templateProps\n  }), container.querySelector(\".\".concat(cssClasses.tree)));\n};\nvar _default = exports.default = renderer;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/geo-search/createHTMLMarker.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _preact = require(\"preact\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); } /* global google EventListener */\nvar createHTMLMarker = function createHTMLMarker(googleReference) {\n  var HTMLMarker = /*#__PURE__*/function (_googleReference$maps) {\n    _inherits(HTMLMarker, _googleReference$maps);\n    var _super = _createSuper(HTMLMarker);\n    function HTMLMarker(_ref) {\n      var _this;\n      var __id = _ref.__id,\n        position = _ref.position,\n        map = _ref.map,\n        template = _ref.template,\n        className = _ref.className,\n        _ref$anchor = _ref.anchor,\n        anchor = _ref$anchor === void 0 ? {\n          x: 0,\n          y: 0\n        } : _ref$anchor;\n      _classCallCheck(this, HTMLMarker);\n      _this = _super.call(this);\n      _defineProperty(_assertThisInitialized(_this), \"__id\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"anchor\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"offset\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"listeners\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"latLng\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"element\", void 0);\n      _this.__id = __id;\n      _this.anchor = anchor;\n      _this.listeners = {};\n      _this.latLng = new googleReference.maps.LatLng(position);\n      _this.element = document.createElement('div');\n      _this.element.className = className;\n      _this.element.style.position = 'absolute';\n      if (_typeof(template) === 'object') {\n        (0, _preact.render)(template, _this.element);\n      } else {\n        _this.element.innerHTML = template;\n      }\n      _this.setMap(map);\n      return _this;\n    }\n    _createClass(HTMLMarker, [{\n      key: \"onAdd\",\n      value: function onAdd() {\n        // Append the element to the map\n        this.getPanes().overlayMouseTarget.appendChild(this.element);\n\n        // Compute the offset onAdd & cache it because afterwards\n        // it won't retrieve the correct values, we also avoid\n        // to read the values on every draw\n        var bbBox = this.element.getBoundingClientRect();\n        this.offset = {\n          x: this.anchor.x + bbBox.width / 2,\n          y: this.anchor.y + bbBox.height\n        };\n\n        // Force the width of the element will avoid the\n        // content to collapse when we move the map\n        this.element.style.width = \"\".concat(bbBox.width, \"px\");\n      }\n    }, {\n      key: \"draw\",\n      value: function draw() {\n        var position = this.getProjection().fromLatLngToDivPixel(this.latLng);\n        this.element.style.left = \"\".concat(Math.round(position.x - this.offset.x), \"px\");\n        this.element.style.top = \"\".concat(Math.round(position.y - this.offset.y), \"px\");\n\n        // Markers to the south are in front of markers to the north\n        // This is the default behaviour of Google Maps\n        this.element.style.zIndex = String(parseInt(this.element.style.top, 10));\n      }\n    }, {\n      key: \"onRemove\",\n      value: function onRemove() {\n        var _this2 = this;\n        if (this.element) {\n          this.element.parentNode.removeChild(this.element);\n          Object.keys(this.listeners).forEach(function (eventName) {\n            _this2.element.removeEventListener(eventName, _this2.listeners[eventName]);\n          });\n\n          // after onRemove the class is no longer used, thus it can be deleted\n          // @ts-expect-error\n          delete this.element;\n          // @ts-expect-error\n          delete this.listeners;\n        }\n      }\n    }, {\n      key: \"addListener\",\n      value: function addListener(eventName, listener) {\n        this.listeners[eventName] = listener;\n        var element = this.element;\n        element.addEventListener(eventName, listener);\n        return {\n          remove: function remove() {\n            return element.removeEventListener(eventName, listener);\n          }\n        };\n      }\n    }, {\n      key: \"getPosition\",\n      value: function getPosition() {\n        return this.latLng;\n      }\n    }]);\n    return HTMLMarker;\n  }(googleReference.maps.OverlayView);\n  return HTMLMarker;\n};\nvar _default = exports.default = createHTMLMarker;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/geo-search/defaultTemplates.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _preact = require(\"preact\");\nvar _ref = (0, _preact.h)(\"p\", null, \"Your custom HTML Marker\");\nvar defaultTemplates = {\n  HTMLMarker: function HTMLMarker() {\n    return _ref;\n  },\n  reset: function reset() {\n    return 'Clear the map refinement';\n  },\n  toggle: function toggle() {\n    return 'Search as I move the map';\n  },\n  redo: function redo() {\n    return 'Redo search here';\n  }\n};\nvar _default = exports.default = defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/geo-search/geo-search.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _connectGeoSearch = _interopRequireDefault(require(\"../../connectors/geo-search/connectGeoSearch\"));\nvar _suit = require(\"../../lib/suit\");\nvar _templating = require(\"../../lib/templating\");\nvar _utils = require(\"../../lib/utils\");\nvar _createHTMLMarker = _interopRequireDefault(require(\"./createHTMLMarker\"));\nvar _defaultTemplates = _interopRequireDefault(require(\"./defaultTemplates\"));\nvar _GeoSearchRenderer = _interopRequireDefault(require(\"./GeoSearchRenderer\"));\nvar _excluded = [\"initialZoom\", \"initialPosition\", \"templates\", \"cssClasses\", \"builtInMarker\", \"customHTMLMarker\", \"enableRefine\", \"enableClearMapRefinement\", \"enableRefineControl\", \"container\", \"googleReference\"],\n  _excluded2 = [\"item\"],\n  _excluded3 = [\"item\"]; // global for TypeScript alone\n/* global google */\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'geo-search'\n});\nvar suit = (0, _suit.component)('GeoSearch');\n/**\n * The **GeoSearch** widget displays the list of results from the search on a Google Maps. It also provides a way to search for results based on their position. The widget also provide some of the common GeoSearch patterns like search on map interaction.\n *\n * @requirements\n *\n * Note that the GeoSearch widget uses the [geosearch](https://www.algolia.com/doc/guides/searching/geo-search) capabilities of Algolia. Your hits **must** have a `_geoloc` attribute in order to be displayed on the map.\n *\n * Currently, the feature is not compatible with multiple values in the _geoloc attribute.\n *\n * You are also responsible for loading the Google Maps library, it's not shipped with InstantSearch. You need to load the Google Maps library and pass a reference to the widget. You can find more information about how to install the library in [the Google Maps documentation](https://developers.google.com/maps/documentation/javascript/tutorial).\n *\n * Don't forget to explicitly set the `height` of the map container (default class `.ais-geo-search--map`), otherwise it won't be shown (it's a requirement of Google Maps).\n */\nvar geoSearch = exports.default = function geoSearch(widgetParams) {\n  var _ref = widgetParams || {},\n    _ref$initialZoom = _ref.initialZoom,\n    initialZoom = _ref$initialZoom === void 0 ? 1 : _ref$initialZoom,\n    _ref$initialPosition = _ref.initialPosition,\n    initialPosition = _ref$initialPosition === void 0 ? {\n      lat: 0,\n      lng: 0\n    } : _ref$initialPosition,\n    _ref$templates = _ref.templates,\n    userTemplates = _ref$templates === void 0 ? {} : _ref$templates,\n    _ref$cssClasses = _ref.cssClasses,\n    userCssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses,\n    _ref$builtInMarker = _ref.builtInMarker,\n    userBuiltInMarker = _ref$builtInMarker === void 0 ? {} : _ref$builtInMarker,\n    userCustomHTMLMarker = _ref.customHTMLMarker,\n    _ref$enableRefine = _ref.enableRefine,\n    enableRefine = _ref$enableRefine === void 0 ? true : _ref$enableRefine,\n    _ref$enableClearMapRe = _ref.enableClearMapRefinement,\n    enableClearMapRefinement = _ref$enableClearMapRe === void 0 ? true : _ref$enableClearMapRe,\n    _ref$enableRefineCont = _ref.enableRefineControl,\n    enableRefineControl = _ref$enableRefineCont === void 0 ? true : _ref$enableRefineCont,\n    container = _ref.container,\n    googleReference = _ref.googleReference,\n    otherWidgetParams = _objectWithoutProperties(_ref, _excluded);\n  var defaultBuiltInMarker = {\n    createOptions: function createOptions() {\n      return {};\n    },\n    events: {}\n  };\n  var defaultCustomHTMLMarker = {\n    createOptions: function createOptions() {\n      return {};\n    },\n    events: {}\n  };\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  if (!googleReference) {\n    throw new Error(withUsage('The `googleReference` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    // Required only to mount / unmount the Preact tree\n    tree: suit({\n      descendantName: 'tree'\n    }),\n    map: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'map'\n    }), userCssClasses.map),\n    control: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'control'\n    }), userCssClasses.control),\n    label: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'label'\n    }), userCssClasses.label),\n    selectedLabel: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'label',\n      modifierName: 'selected'\n    }), userCssClasses.selectedLabel),\n    input: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'input'\n    }), userCssClasses.input),\n    redo: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'redo'\n    }), userCssClasses.redo),\n    disabledRedo: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'redo',\n      modifierName: 'disabled'\n    }), userCssClasses.disabledRedo),\n    reset: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'reset'\n    }), userCssClasses.reset)\n  };\n  var templates = _objectSpread(_objectSpread({}, _defaultTemplates.default), userTemplates);\n  var builtInMarker = _objectSpread(_objectSpread({}, defaultBuiltInMarker), userBuiltInMarker);\n  var isCustomHTMLMarker = Boolean(userCustomHTMLMarker) || Boolean(userTemplates.HTMLMarker);\n  var customHTMLMarker = isCustomHTMLMarker && _objectSpread(_objectSpread({}, defaultCustomHTMLMarker), userCustomHTMLMarker);\n  var createBuiltInMarker = function createBuiltInMarker(_ref2) {\n    var item = _ref2.item,\n      rest = _objectWithoutProperties(_ref2, _excluded2);\n    return new googleReference.maps.Marker(_objectSpread(_objectSpread(_objectSpread({}, builtInMarker.createOptions(item)), rest), {}, {\n      // @ts-expect-error @types/googlemaps doesn't document this\n      __id: item.objectID,\n      position: item._geoloc\n    }));\n  };\n  var HTMLMarker = (0, _createHTMLMarker.default)(googleReference);\n  var createCustomHTMLMarker = function createCustomHTMLMarker(_ref3) {\n    var item = _ref3.item,\n      rest = _objectWithoutProperties(_ref3, _excluded3);\n    return new HTMLMarker(_objectSpread(_objectSpread(_objectSpread({}, customHTMLMarker.createOptions(item)), rest), {}, {\n      __id: item.objectID,\n      position: item._geoloc,\n      className: (0, _instantsearchUiComponents.cx)(suit({\n        descendantName: 'marker'\n      })),\n      template: (0, _templating.renderTemplate)({\n        templateKey: 'HTMLMarker',\n        templates: templates,\n        data: item\n      })\n    }));\n  };\n  var createMarker = !customHTMLMarker ? createBuiltInMarker : createCustomHTMLMarker;\n  var markerOptions = !customHTMLMarker ? builtInMarker : customHTMLMarker;\n  var makeWidget = (0, _connectGeoSearch.default)(_GeoSearchRenderer.default, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget(_objectSpread(_objectSpread({}, otherWidgetParams), {}, {\n    // @TODO: this type doesn't preserve the generic correctly,\n    // (but as they're internal only it's not a big problem)\n    templates: templates,\n    renderState: {},\n    container: containerNode,\n    googleReference: googleReference,\n    initialZoom: initialZoom,\n    initialPosition: initialPosition,\n    cssClasses: cssClasses,\n    createMarker: createMarker,\n    markerOptions: markerOptions,\n    enableRefine: enableRefine,\n    enableClearMapRefinement: enableClearMapRefinement,\n    enableRefineControl: enableRefineControl\n  }))), {}, {\n    $$widgetType: 'ais.geoSearch'\n  });\n};"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/hierarchical-menu/defaultTemplates.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _formatNumber = require(\"../../lib/formatNumber\");\nvar defaultTemplates = {\n  item: function item(_ref) {\n    var url = _ref.url,\n      label = _ref.label,\n      count = _ref.count,\n      cssClasses = _ref.cssClasses,\n      isRefined = _ref.isRefined;\n    return (0, _preact.h)(\"a\", {\n      className: (0, _instantsearchUiComponents.cx)((0, _instantsearchUiComponents.cx)(cssClasses.link), (0, _instantsearchUiComponents.cx)(isRefined ? cssClasses.selectedItemLink : undefined)),\n      href: url\n    }, (0, _preact.h)(\"span\", {\n      className: (0, _instantsearchUiComponents.cx)(cssClasses.label)\n    }, label), (0, _preact.h)(\"span\", {\n      className: (0, _instantsearchUiComponents.cx)(cssClasses.count)\n    }, (0, _formatNumber.formatNumber)(count)));\n  },\n  showMoreText: function showMoreText(_ref2) {\n    var isShowingMore = _ref2.isShowingMore;\n    return isShowingMore ? 'Show less' : 'Show more';\n  }\n};\nvar _default = exports.default = defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/hierarchical-menu/hierarchical-menu.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _RefinementList = _interopRequireDefault(require(\"../../components/RefinementList/RefinementList\"));\nvar _connectHierarchicalMenu = _interopRequireDefault(require(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\"));\nvar _suit = require(\"../../lib/suit\");\nvar _templating = require(\"../../lib/templating\");\nvar _utils = require(\"../../lib/utils\");\nvar _defaultTemplates = _interopRequireDefault(require(\"./defaultTemplates\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'hierarchical-menu'\n});\nvar suit = (0, _suit.component)('HierarchicalMenu');\nvar renderer = function renderer(_ref) {\n  var cssClasses = _ref.cssClasses,\n    containerNode = _ref.containerNode,\n    showMore = _ref.showMore,\n    templates = _ref.templates,\n    renderState = _ref.renderState;\n  return function (_ref2, isFirstRendering) {\n    var createURL = _ref2.createURL,\n      items = _ref2.items,\n      refine = _ref2.refine,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      isShowingMore = _ref2.isShowingMore,\n      toggleShowMore = _ref2.toggleShowMore,\n      canToggleShowMore = _ref2.canToggleShowMore;\n    if (isFirstRendering) {\n      renderState.templateProps = (0, _templating.prepareTemplateProps)({\n        defaultTemplates: _defaultTemplates.default,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    (0, _preact.render)((0, _preact.h)(_RefinementList.default, {\n      createURL: createURL,\n      cssClasses: cssClasses,\n      facetValues: items,\n      templateProps: renderState.templateProps,\n      toggleRefinement: refine,\n      showMore: showMore,\n      toggleShowMore: toggleShowMore,\n      isShowingMore: isShowingMore,\n      canToggleShowMore: canToggleShowMore\n    }), containerNode);\n  };\n};\n\n/**\n * The hierarchical menu widget is used to create a navigation based on a hierarchy of facet attributes.\n *\n * It is commonly used for categories with subcategories.\n *\n * All attributes (lvl0, lvl1 here) must be declared as [attributes for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting) in your\n * Algolia settings.\n *\n * By default, the separator we expect is ` > ` (with spaces) but you can use\n * a different one by using the `separator` option.\n * @requirements\n * Your objects must be formatted in a specific way to be\n * able to display hierarchical menus. Here's an example:\n *\n * ```javascript\n * {\n *   \"objectID\": \"123\",\n *   \"name\": \"orange\",\n *   \"categories\": {\n *     \"lvl0\": \"fruits\",\n *     \"lvl1\": \"fruits > citrus\"\n *   }\n * }\n * ```\n *\n * Every level must be specified entirely.\n * It's also possible to have multiple values per level, for example:\n *\n * ```javascript\n * {\n *   \"objectID\": \"123\",\n *   \"name\": \"orange\",\n *   \"categories\": {\n *     \"lvl0\": [\"fruits\", \"vitamins\"],\n *     \"lvl1\": [\"fruits > citrus\", \"vitamins > C\"]\n *   }\n * }\n * ```\n * @type {WidgetFactory}\n * @devNovel HierarchicalMenu\n * @category filter\n * @param {HierarchicalMenuWidgetParams} widgetParams The HierarchicalMenu widget options.\n * @return {Widget} A new HierarchicalMenu widget instance.\n * @example\n * search.addWidgets([\n *   instantsearch.widgets.hierarchicalMenu({\n *     container: '#hierarchical-categories',\n *     attributes: ['hierarchicalCategories.lvl0', 'hierarchicalCategories.lvl1', 'hierarchicalCategories.lvl2'],\n *   })\n * ]);\n */\n\nvar hierarchicalMenu = function hierarchicalMenu(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    attributes = _ref3.attributes,\n    separator = _ref3.separator,\n    rootPath = _ref3.rootPath,\n    showParentLevel = _ref3.showParentLevel,\n    limit = _ref3.limit,\n    _ref3$showMore = _ref3.showMore,\n    showMore = _ref3$showMore === void 0 ? false : _ref3$showMore,\n    showMoreLimit = _ref3.showMoreLimit,\n    sortBy = _ref3.sortBy,\n    transformItems = _ref3.transformItems,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    noRefinementRoot: (0, _instantsearchUiComponents.cx)(suit({\n      modifierName: 'noRefinement'\n    }), userCssClasses.noRefinementRoot),\n    list: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'list'\n    }), userCssClasses.list),\n    childList: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'list',\n      modifierName: 'child'\n    }), userCssClasses.childList),\n    item: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item'\n    }), userCssClasses.item),\n    selectedItem: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item',\n      modifierName: 'selected'\n    }), userCssClasses.selectedItem),\n    parentItem: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item',\n      modifierName: 'parent'\n    }), userCssClasses.parentItem),\n    link: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'link'\n    }), userCssClasses.link),\n    selectedItemLink: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'link',\n      modifierName: 'selected'\n    }), userCssClasses.selectedItemLink),\n    label: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'label'\n    }), userCssClasses.label),\n    count: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'count'\n    }), userCssClasses.count),\n    showMore: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'showMore'\n    }), userCssClasses.showMore),\n    disabledShowMore: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'showMore',\n      modifierName: 'disabled'\n    }), userCssClasses.disabledShowMore)\n  };\n  var specializedRenderer = renderer({\n    cssClasses: cssClasses,\n    containerNode: containerNode,\n    templates: templates,\n    showMore: showMore,\n    renderState: {}\n  });\n  var makeWidget = (0, _connectHierarchicalMenu.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attributes: attributes,\n    separator: separator,\n    rootPath: rootPath,\n    showParentLevel: showParentLevel,\n    limit: limit,\n    showMore: showMore,\n    showMoreLimit: showMoreLimit,\n    sortBy: sortBy,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.hierarchicalMenu'\n  });\n};\nvar _default = exports.default = hierarchicalMenu;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/hits/defaultTemplates.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\n// false positive lint error\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\n\nvar defaultTemplates = {\n  empty: function empty() {\n    return 'No results';\n  },\n  item: function item(data) {\n    return JSON.stringify((0, _utils.omit)(data, ['__hitIndex']), null, 2);\n  }\n};\nvar _default = exports.default = defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/hits/hits.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _Template = _interopRequireDefault(require(\"../../components/Template/Template\"));\nvar _connectHits = _interopRequireDefault(require(\"../../connectors/hits/connectHits\"));\nvar _insights = require(\"../../lib/insights\");\nvar _listener = require(\"../../lib/insights/listener\");\nvar _templating = require(\"../../lib/templating\");\nvar _utils = require(\"../../lib/utils\");\nvar _defaultTemplates = _interopRequireDefault(require(\"./defaultTemplates\"));\nvar _excluded = [\"hit\", \"index\"];\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError(\"Cannot destructure \" + obj); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'hits'\n});\nvar Hits = (0, _instantsearchUiComponents.createHitsComponent)({\n  createElement: _preact.h,\n  Fragment: _preact.Fragment\n});\nvar renderer = function renderer(_ref) {\n  var renderState = _ref.renderState,\n    cssClasses = _ref.cssClasses,\n    containerNode = _ref.containerNode,\n    templates = _ref.templates;\n  return function (_ref2, isFirstRendering) {\n    var items = _ref2.items,\n      results = _ref2.results,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      insights = _ref2.insights,\n      bindEvent = _ref2.bindEvent,\n      sendEvent = _ref2.sendEvent,\n      banner = _ref2.banner;\n    if (isFirstRendering) {\n      renderState.templateProps = (0, _templating.prepareTemplateProps)({\n        defaultTemplates: _defaultTemplates.default,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    var handleInsightsClick = (0, _listener.createInsightsEventHandler)({\n      insights: insights,\n      sendEvent: sendEvent\n    });\n    var emptyComponent = function emptyComponent(_ref3) {\n      var rootProps = _extends({}, (_objectDestructuringEmpty(_ref3), _ref3));\n      return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n        rootProps: rootProps,\n        templateKey: \"empty\",\n        data: results,\n        rootTagName: \"fragment\"\n      }));\n    };\n\n    // @MAJOR: Move default hit component back to the UI library\n    // once flavour specificities are erased\n    var itemComponent = function itemComponent(_ref4) {\n      var hit = _ref4.hit,\n        index = _ref4.index,\n        rootProps = _objectWithoutProperties(_ref4, _excluded);\n      return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n        templateKey: \"item\",\n        rootTagName: \"li\",\n        rootProps: _objectSpread(_objectSpread({}, rootProps), {}, {\n          onClick: function onClick(event) {\n            handleInsightsClick(event);\n            rootProps.onClick();\n          },\n          onAuxClick: function onAuxClick(event) {\n            handleInsightsClick(event);\n            rootProps.onAuxClick();\n          }\n        }),\n        data: _objectSpread(_objectSpread({}, hit), {}, {\n          get __hitIndex() {\n            process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, 'The `__hitIndex` property is deprecated. Use the absolute `__position` instead.') : void 0;\n            return index;\n          }\n        }),\n        bindEvent: bindEvent,\n        sendEvent: sendEvent\n      }));\n    };\n    var bannerComponent = function bannerComponent(props) {\n      return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n        templateKey: \"banner\",\n        data: props,\n        rootTagName: \"fragment\"\n      }));\n    };\n    (0, _preact.render)((0, _preact.h)(Hits, {\n      hits: items,\n      itemComponent: itemComponent,\n      sendEvent: sendEvent,\n      classNames: cssClasses,\n      emptyComponent: emptyComponent,\n      banner: banner,\n      bannerComponent: templates.banner ? bannerComponent : undefined\n    }), containerNode);\n  };\n};\nvar hits = exports.default = function hits(widgetParams) {\n  var _ref5 = widgetParams || {},\n    container = _ref5.container,\n    escapeHTML = _ref5.escapeHTML,\n    transformItems = _ref5.transformItems,\n    _ref5$templates = _ref5.templates,\n    templates = _ref5$templates === void 0 ? {} : _ref5$templates,\n    _ref5$cssClasses = _ref5.cssClasses,\n    cssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = (0, _insights.withInsights)(_connectHits.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    escapeHTML: escapeHTML,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.hits'\n  });\n};"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/hits-per-page/hits-per-page.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _Selector = _interopRequireDefault(require(\"../../components/Selector/Selector\"));\nvar _connectHitsPerPage = _interopRequireDefault(require(\"../../connectors/hits-per-page/connectHitsPerPage\"));\nvar _suit = require(\"../../lib/suit\");\nvar _utils = require(\"../../lib/utils\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'hits-per-page'\n});\nvar suit = (0, _suit.component)('HitsPerPage');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses;\n  return function (_ref2, isFirstRendering) {\n    var items = _ref2.items,\n      refine = _ref2.refine;\n    if (isFirstRendering) return;\n    var _ref3 = (0, _utils.find)(items, function (_ref4) {\n        var isRefined = _ref4.isRefined;\n        return isRefined;\n      }) || {},\n      currentValue = _ref3.value;\n    (0, _preact.render)((0, _preact.h)(\"div\", {\n      className: cssClasses.root\n    }, (0, _preact.h)(_Selector.default, {\n      cssClasses: cssClasses,\n      currentValue: currentValue,\n      options: items\n      // @ts-expect-error: the refine function expects a number, but setValue will call it with a string. We don't want to change the type of the refine function because it's part of the connector API.\n      ,\n      setValue: refine\n    })), containerNode);\n  };\n};\nvar hitsPerPage = function hitsPerPage(widgetParams) {\n  var _ref5 = widgetParams || {},\n    container = _ref5.container,\n    items = _ref5.items,\n    _ref5$cssClasses = _ref5.cssClasses,\n    userCssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses,\n    transformItems = _ref5.transformItems;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    select: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'select'\n    }), userCssClasses.select),\n    option: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'option'\n    }), userCssClasses.option)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses\n  });\n  var makeWidget = (0, _connectHitsPerPage.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    items: items,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.hitsPerPage'\n  });\n};\nvar _default = exports.default = hitsPerPage;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/index/index.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _algoliasearchHelper = _interopRequireDefault(require(\"algoliasearch-helper\"));\nvar _utils = require(\"../../lib/utils\");\nvar _addWidgetId = require(\"../../lib/utils/addWidgetId\");\nvar _excluded = [\"initialSearchParameters\"],\n  _excluded2 = [\"initialRecommendParameters\"];\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'index-widget'\n});\n/**\n * This is the same content as helper._change / setState, but allowing for extra\n * UiState to be synchronized.\n * see: https://github.com/algolia/algoliasearch-helper-js/blob/6b835ffd07742f2d6b314022cce6848f5cfecd4a/src/algoliasearch.helper.js#L1311-L1324\n */\nfunction privateHelperSetState(helper, _ref) {\n  var state = _ref.state,\n    recommendState = _ref.recommendState,\n    isPageReset = _ref.isPageReset,\n    _uiState = _ref._uiState;\n  if (state !== helper.state) {\n    helper.state = state;\n    helper.emit('change', {\n      state: helper.state,\n      results: helper.lastResults,\n      isPageReset: isPageReset,\n      _uiState: _uiState\n    });\n  }\n  if (recommendState !== helper.recommendState) {\n    helper.recommendState = recommendState;\n\n    // eslint-disable-next-line no-warning-comments\n    // TODO: emit \"change\" event when events for Recommend are implemented\n  }\n}\nfunction getLocalWidgetsUiState(widgets, widgetStateOptions) {\n  var initialUiState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n  return widgets.reduce(function (uiState, widget) {\n    if ((0, _utils.isIndexWidget)(widget)) {\n      return uiState;\n    }\n    if (!widget.getWidgetUiState && !widget.getWidgetState) {\n      return uiState;\n    }\n    if (widget.getWidgetUiState) {\n      return widget.getWidgetUiState(uiState, widgetStateOptions);\n    }\n    return widget.getWidgetState(uiState, widgetStateOptions);\n  }, initialUiState);\n}\nfunction getLocalWidgetsSearchParameters(widgets, widgetSearchParametersOptions) {\n  var initialSearchParameters = widgetSearchParametersOptions.initialSearchParameters,\n    rest = _objectWithoutProperties(widgetSearchParametersOptions, _excluded);\n  return widgets.reduce(function (state, widget) {\n    if (!widget.getWidgetSearchParameters || (0, _utils.isIndexWidget)(widget)) {\n      return state;\n    }\n    if (widget.dependsOn === 'search' && widget.getWidgetParameters) {\n      return widget.getWidgetParameters(state, rest);\n    }\n    return widget.getWidgetSearchParameters(state, rest);\n  }, initialSearchParameters);\n}\nfunction getLocalWidgetsRecommendParameters(widgets, widgetRecommendParametersOptions) {\n  var initialRecommendParameters = widgetRecommendParametersOptions.initialRecommendParameters,\n    rest = _objectWithoutProperties(widgetRecommendParametersOptions, _excluded2);\n  return widgets.reduce(function (state, widget) {\n    if (!(0, _utils.isIndexWidget)(widget) && widget.dependsOn === 'recommend' && widget.getWidgetParameters) {\n      return widget.getWidgetParameters(state, rest);\n    }\n    return state;\n  }, initialRecommendParameters);\n}\nfunction resetPageFromWidgets(widgets) {\n  var indexWidgets = widgets.filter(_utils.isIndexWidget);\n  if (indexWidgets.length === 0) {\n    return;\n  }\n  indexWidgets.forEach(function (widget) {\n    var widgetHelper = widget.getHelper();\n    privateHelperSetState(widgetHelper, {\n      state: widgetHelper.state.resetPage(),\n      recommendState: widgetHelper.recommendState,\n      isPageReset: true\n    });\n    resetPageFromWidgets(widget.getWidgets());\n  });\n}\nfunction resolveScopedResultsFromWidgets(widgets) {\n  var indexWidgets = widgets.filter(_utils.isIndexWidget);\n  return indexWidgets.reduce(function (scopedResults, current) {\n    return scopedResults.concat.apply(scopedResults, [{\n      indexId: current.getIndexId(),\n      results: current.getResults(),\n      helper: current.getHelper()\n    }].concat(_toConsumableArray(resolveScopedResultsFromWidgets(current.getWidgets()))));\n  }, []);\n}\nvar index = function index(widgetParams) {\n  if (widgetParams === undefined || widgetParams.indexName === undefined) {\n    throw new Error(withUsage('The `indexName` option is required.'));\n  }\n  var indexName = widgetParams.indexName,\n    _widgetParams$indexId = widgetParams.indexId,\n    indexId = _widgetParams$indexId === void 0 ? indexName : _widgetParams$indexId;\n  var localWidgets = [];\n  var localUiState = {};\n  var localInstantSearchInstance = null;\n  var localParent = null;\n  var helper = null;\n  var derivedHelper = null;\n  var lastValidSearchParameters = null;\n  var hasRecommendWidget = false;\n  var hasSearchWidget = false;\n  return {\n    $$type: 'ais.index',\n    $$widgetType: 'ais.index',\n    getIndexName: function getIndexName() {\n      return indexName;\n    },\n    getIndexId: function getIndexId() {\n      return indexId;\n    },\n    getHelper: function getHelper() {\n      return helper;\n    },\n    getResults: function getResults() {\n      var _derivedHelper;\n      if (!((_derivedHelper = derivedHelper) !== null && _derivedHelper !== void 0 && _derivedHelper.lastResults)) return null;\n\n      // To make the UI optimistic, we patch the state to display to the current\n      // one instead of the one associated with the latest results.\n      // This means user-driven UI changes (e.g., checked checkbox) are reflected\n      // immediately instead of waiting for Algolia to respond, regardless of\n      // the status of the network request.\n      derivedHelper.lastResults._state = helper.state;\n      return derivedHelper.lastResults;\n    },\n    getResultsForWidget: function getResultsForWidget(widget) {\n      var _helper;\n      if (widget.dependsOn !== 'recommend' || (0, _utils.isIndexWidget)(widget) || widget.$$id === undefined) {\n        return this.getResults();\n      }\n      if (!((_helper = helper) !== null && _helper !== void 0 && _helper.lastRecommendResults)) {\n        return null;\n      }\n      return helper.lastRecommendResults[widget.$$id];\n    },\n    getPreviousState: function getPreviousState() {\n      return lastValidSearchParameters;\n    },\n    getScopedResults: function getScopedResults() {\n      var widgetParent = this.getParent();\n      var widgetSiblings;\n      if (widgetParent) {\n        widgetSiblings = widgetParent.getWidgets();\n      } else if (indexName.length === 0) {\n        // The widget is the root but has no index name:\n        // we resolve results from its children index widgets\n        widgetSiblings = this.getWidgets();\n      } else {\n        // The widget is the root and has an index name:\n        // we consider itself as the only sibling\n        widgetSiblings = [this];\n      }\n      return resolveScopedResultsFromWidgets(widgetSiblings);\n    },\n    getParent: function getParent() {\n      return localParent;\n    },\n    createURL: function createURL(nextState) {\n      if (typeof nextState === 'function') {\n        return localInstantSearchInstance._createURL(_defineProperty({}, indexId, nextState(localUiState)));\n      }\n      return localInstantSearchInstance._createURL(_defineProperty({}, indexId, getLocalWidgetsUiState(localWidgets, {\n        searchParameters: nextState,\n        helper: helper\n      })));\n    },\n    getWidgets: function getWidgets() {\n      return localWidgets;\n    },\n    addWidgets: function addWidgets(widgets) {\n      var _this = this;\n      if (!Array.isArray(widgets)) {\n        throw new Error(withUsage('The `addWidgets` method expects an array of widgets.'));\n      }\n      if (widgets.some(function (widget) {\n        return typeof widget.init !== 'function' && typeof widget.render !== 'function';\n      })) {\n        throw new Error(withUsage('The widget definition expects a `render` and/or an `init` method.'));\n      }\n      widgets.forEach(function (widget) {\n        if ((0, _utils.isIndexWidget)(widget)) {\n          return;\n        }\n        if (localInstantSearchInstance && widget.dependsOn === 'recommend') {\n          localInstantSearchInstance._hasRecommendWidget = true;\n        } else if (localInstantSearchInstance) {\n          localInstantSearchInstance._hasSearchWidget = true;\n        } else if (widget.dependsOn === 'recommend') {\n          hasRecommendWidget = true;\n        } else {\n          hasSearchWidget = true;\n        }\n        (0, _addWidgetId.addWidgetId)(widget);\n      });\n      localWidgets = localWidgets.concat(widgets);\n      if (localInstantSearchInstance && Boolean(widgets.length)) {\n        privateHelperSetState(helper, {\n          state: getLocalWidgetsSearchParameters(localWidgets, {\n            uiState: localUiState,\n            initialSearchParameters: helper.state\n          }),\n          recommendState: getLocalWidgetsRecommendParameters(localWidgets, {\n            uiState: localUiState,\n            initialRecommendParameters: helper.recommendState\n          }),\n          _uiState: localUiState\n        });\n\n        // We compute the render state before calling `init` in a separate loop\n        // to construct the whole render state object that is then passed to\n        // `init`.\n        widgets.forEach(function (widget) {\n          if (widget.getRenderState) {\n            var renderState = widget.getRenderState(localInstantSearchInstance.renderState[_this.getIndexId()] || {}, (0, _utils.createInitArgs)(localInstantSearchInstance, _this, localInstantSearchInstance._initialUiState));\n            storeRenderState({\n              renderState: renderState,\n              instantSearchInstance: localInstantSearchInstance,\n              parent: _this\n            });\n          }\n        });\n        widgets.forEach(function (widget) {\n          if (widget.init) {\n            widget.init((0, _utils.createInitArgs)(localInstantSearchInstance, _this, localInstantSearchInstance._initialUiState));\n          }\n        });\n        localInstantSearchInstance.scheduleSearch();\n      }\n      return this;\n    },\n    removeWidgets: function removeWidgets(widgets) {\n      var _this2 = this;\n      if (!Array.isArray(widgets)) {\n        throw new Error(withUsage('The `removeWidgets` method expects an array of widgets.'));\n      }\n      if (widgets.some(function (widget) {\n        return typeof widget.dispose !== 'function';\n      })) {\n        throw new Error(withUsage('The widget definition expects a `dispose` method.'));\n      }\n      localWidgets = localWidgets.filter(function (widget) {\n        return widgets.indexOf(widget) === -1;\n      });\n      localWidgets.forEach(function (widget) {\n        if ((0, _utils.isIndexWidget)(widget)) {\n          return;\n        }\n        if (localInstantSearchInstance && widget.dependsOn === 'recommend') {\n          localInstantSearchInstance._hasRecommendWidget = true;\n        } else if (localInstantSearchInstance) {\n          localInstantSearchInstance._hasSearchWidget = true;\n        } else if (widget.dependsOn === 'recommend') {\n          hasRecommendWidget = true;\n        } else {\n          hasSearchWidget = true;\n        }\n      });\n      if (localInstantSearchInstance && Boolean(widgets.length)) {\n        var _widgets$reduce = widgets.reduce(function (states, widget) {\n            // the `dispose` method exists at this point we already assert it\n            var next = widget.dispose({\n              helper: helper,\n              state: states.cleanedSearchState,\n              recommendState: states.cleanedRecommendState,\n              parent: _this2\n            });\n            if (next instanceof _algoliasearchHelper.default.RecommendParameters) {\n              states.cleanedRecommendState = next;\n            } else if (next) {\n              states.cleanedSearchState = next;\n            }\n            return states;\n          }, {\n            cleanedSearchState: helper.state,\n            cleanedRecommendState: helper.recommendState\n          }),\n          cleanedSearchState = _widgets$reduce.cleanedSearchState,\n          cleanedRecommendState = _widgets$reduce.cleanedRecommendState;\n        var newState = localInstantSearchInstance.future.preserveSharedStateOnUnmount ? getLocalWidgetsSearchParameters(localWidgets, {\n          uiState: localUiState,\n          initialSearchParameters: new _algoliasearchHelper.default.SearchParameters({\n            index: this.getIndexName()\n          })\n        }) : getLocalWidgetsSearchParameters(localWidgets, {\n          uiState: getLocalWidgetsUiState(localWidgets, {\n            searchParameters: cleanedSearchState,\n            helper: helper\n          }),\n          initialSearchParameters: cleanedSearchState\n        });\n        localUiState = getLocalWidgetsUiState(localWidgets, {\n          searchParameters: newState,\n          helper: helper\n        });\n        helper.setState(newState);\n        helper.recommendState = cleanedRecommendState;\n        if (localWidgets.length) {\n          localInstantSearchInstance.scheduleSearch();\n        }\n      }\n      return this;\n    },\n    init: function init(_ref2) {\n      var _this3 = this,\n        _instantSearchInstanc;\n      var instantSearchInstance = _ref2.instantSearchInstance,\n        parent = _ref2.parent,\n        uiState = _ref2.uiState;\n      if (helper !== null) {\n        // helper is already initialized, therefore we do not need to set up\n        // any listeners\n        return;\n      }\n      localInstantSearchInstance = instantSearchInstance;\n      localParent = parent;\n      localUiState = uiState[indexId] || {};\n\n      // The `mainHelper` is already defined at this point. The instance is created\n      // inside InstantSearch at the `start` method, which occurs before the `init`\n      // step.\n      var mainHelper = instantSearchInstance.mainHelper;\n      var parameters = getLocalWidgetsSearchParameters(localWidgets, {\n        uiState: localUiState,\n        initialSearchParameters: new _algoliasearchHelper.default.SearchParameters({\n          index: indexName\n        })\n      });\n      var recommendParameters = getLocalWidgetsRecommendParameters(localWidgets, {\n        uiState: localUiState,\n        initialRecommendParameters: new _algoliasearchHelper.default.RecommendParameters()\n      });\n\n      // This Helper is only used for state management we do not care about the\n      // `searchClient`. Only the \"main\" Helper created at the `InstantSearch`\n      // level is aware of the client.\n      helper = (0, _algoliasearchHelper.default)({}, parameters.index, parameters);\n      helper.recommendState = recommendParameters;\n\n      // We forward the call to `search` to the \"main\" instance of the Helper\n      // which is responsible for managing the queries (it's the only one that is\n      // aware of the `searchClient`).\n      helper.search = function () {\n        if (instantSearchInstance.onStateChange) {\n          instantSearchInstance.onStateChange({\n            uiState: instantSearchInstance.mainIndex.getWidgetUiState({}),\n            setUiState: function setUiState(nextState) {\n              return instantSearchInstance.setUiState(nextState, false);\n            }\n          });\n\n          // We don't trigger a search when controlled because it becomes the\n          // responsibility of `setUiState`.\n          return mainHelper;\n        }\n        return mainHelper.search();\n      };\n      helper.searchWithoutTriggeringOnStateChange = function () {\n        return mainHelper.search();\n      };\n\n      // We use the same pattern for the `searchForFacetValues`.\n      helper.searchForFacetValues = function (facetName, facetValue, maxFacetHits, userState) {\n        var state = helper.state.setQueryParameters(userState);\n        return mainHelper.searchForFacetValues(facetName, facetValue, maxFacetHits, state);\n      };\n      derivedHelper = mainHelper.derive(function () {\n        return _utils.mergeSearchParameters.apply(void 0, [mainHelper.state].concat(_toConsumableArray((0, _utils.resolveSearchParameters)(_this3))));\n      }, function () {\n        return _this3.getHelper().recommendState;\n      });\n      var indexInitialResults = (_instantSearchInstanc = instantSearchInstance._initialResults) === null || _instantSearchInstanc === void 0 ? void 0 : _instantSearchInstanc[this.getIndexId()];\n      if (indexInitialResults !== null && indexInitialResults !== void 0 && indexInitialResults.results) {\n        // We restore the shape of the results provided to the instance to respect\n        // the helper's structure.\n        var results = new _algoliasearchHelper.default.SearchResults(new _algoliasearchHelper.default.SearchParameters(indexInitialResults.state), indexInitialResults.results);\n        derivedHelper.lastResults = results;\n        helper.lastResults = results;\n      }\n      if (indexInitialResults !== null && indexInitialResults !== void 0 && indexInitialResults.recommendResults) {\n        var recommendResults = new _algoliasearchHelper.default.RecommendResults(new _algoliasearchHelper.default.RecommendParameters({\n          params: indexInitialResults.recommendResults.params\n        }), indexInitialResults.recommendResults.results);\n        derivedHelper.lastRecommendResults = recommendResults;\n        helper.lastRecommendResults = recommendResults;\n      }\n\n      // Subscribe to the Helper state changes for the page before widgets\n      // are initialized. This behavior mimics the original one of the Helper.\n      // It makes sense to replicate it at the `init` step. We have another\n      // listener on `change` below, once `init` is done.\n      helper.on('change', function (_ref3) {\n        var isPageReset = _ref3.isPageReset;\n        if (isPageReset) {\n          resetPageFromWidgets(localWidgets);\n        }\n      });\n      derivedHelper.on('search', function () {\n        // The index does not manage the \"staleness\" of the search. This is the\n        // responsibility of the main instance. It does not make sense to manage\n        // it at the index level because it's either: all of them or none of them\n        // that are stalled. The queries are performed into a single network request.\n        instantSearchInstance.scheduleStalledRender();\n        if (process.env.NODE_ENV === 'development') {\n          (0, _utils.checkIndexUiState)({\n            index: _this3,\n            indexUiState: localUiState\n          });\n        }\n      });\n      derivedHelper.on('result', function (_ref4) {\n        var results = _ref4.results;\n        // The index does not render the results it schedules a new render\n        // to let all the other indices emit their own results. It allows us to\n        // run the render process in one pass.\n        instantSearchInstance.scheduleRender();\n\n        // the derived helper is the one which actually searches, but the helper\n        // which is exposed e.g. via instance.helper, doesn't search, and thus\n        // does not have access to lastResults, which it used to in pre-federated\n        // search behavior.\n        helper.lastResults = results;\n        lastValidSearchParameters = results === null || results === void 0 ? void 0 : results._state;\n      });\n\n      // eslint-disable-next-line no-warning-comments\n      // TODO: listen to \"result\" event when events for Recommend are implemented\n      derivedHelper.on('recommend:result', function (_ref5) {\n        var recommend = _ref5.recommend;\n        // The index does not render the results it schedules a new render\n        // to let all the other indices emit their own results. It allows us to\n        // run the render process in one pass.\n        instantSearchInstance.scheduleRender();\n\n        // the derived helper is the one which actually searches, but the helper\n        // which is exposed e.g. via instance.helper, doesn't search, and thus\n        // does not have access to lastRecommendResults.\n        helper.lastRecommendResults = recommend.results;\n      });\n\n      // We compute the render state before calling `init` in a separate loop\n      // to construct the whole render state object that is then passed to\n      // `init`.\n      localWidgets.forEach(function (widget) {\n        if (widget.getRenderState) {\n          var renderState = widget.getRenderState(instantSearchInstance.renderState[_this3.getIndexId()] || {}, (0, _utils.createInitArgs)(instantSearchInstance, _this3, uiState));\n          storeRenderState({\n            renderState: renderState,\n            instantSearchInstance: instantSearchInstance,\n            parent: _this3\n          });\n        }\n      });\n      localWidgets.forEach(function (widget) {\n        process.env.NODE_ENV === 'development' ? (0, _utils.warning)(\n        // if it has NO getWidgetState or if it has getWidgetUiState, we don't warn\n        // aka we warn if there's _only_ getWidgetState\n        !widget.getWidgetState || Boolean(widget.getWidgetUiState), 'The `getWidgetState` method is renamed `getWidgetUiState` and will no longer exist under that name in InstantSearch.js 5.x. Please use `getWidgetUiState` instead.') : void 0;\n        if (widget.init) {\n          widget.init((0, _utils.createInitArgs)(instantSearchInstance, _this3, uiState));\n        }\n      });\n\n      // Subscribe to the Helper state changes for the `uiState` once widgets\n      // are initialized. Until the first render, state changes are part of the\n      // configuration step. This is mainly for backward compatibility with custom\n      // widgets. When the subscription happens before the `init` step, the (static)\n      // configuration of the widget is pushed in the URL. That's what we want to avoid.\n      // https://github.com/algolia/instantsearch/pull/994/commits/4a672ae3fd78809e213de0368549ef12e9dc9454\n      helper.on('change', function (event) {\n        var state = event.state;\n        var _uiState = event._uiState;\n        localUiState = getLocalWidgetsUiState(localWidgets, {\n          searchParameters: state,\n          helper: helper\n        }, _uiState || {});\n\n        // We don't trigger an internal change when controlled because it\n        // becomes the responsibility of `setUiState`.\n        if (!instantSearchInstance.onStateChange) {\n          instantSearchInstance.onInternalStateChange();\n        }\n      });\n      if (indexInitialResults) {\n        // If there are initial results, we're not notified of the next results\n        // because we don't trigger an initial search. We therefore need to directly\n        // schedule a render that will render the results injected on the helper.\n        instantSearchInstance.scheduleRender();\n      }\n      if (hasRecommendWidget) {\n        instantSearchInstance._hasRecommendWidget = true;\n      }\n      if (hasSearchWidget) {\n        instantSearchInstance._hasSearchWidget = true;\n      }\n    },\n    render: function render(_ref6) {\n      var _derivedHelper2,\n        _this4 = this;\n      var instantSearchInstance = _ref6.instantSearchInstance;\n      // we can't attach a listener to the error event of search, as the error\n      // then would no longer be thrown for global handlers.\n      if (instantSearchInstance.status === 'error' && !instantSearchInstance.mainHelper.hasPendingRequests() && lastValidSearchParameters) {\n        helper.setState(lastValidSearchParameters);\n      }\n\n      // We only render index widgets if there are no results.\n      // This makes sure `render` is never called with `results` being `null`.\n      var widgetsToRender = this.getResults() || (_derivedHelper2 = derivedHelper) !== null && _derivedHelper2 !== void 0 && _derivedHelper2.lastRecommendResults ? localWidgets : localWidgets.filter(_utils.isIndexWidget);\n      widgetsToRender = widgetsToRender.filter(function (widget) {\n        if (!widget.shouldRender) {\n          return true;\n        }\n        return widget.shouldRender({\n          instantSearchInstance: instantSearchInstance\n        });\n      });\n      widgetsToRender.forEach(function (widget) {\n        if (widget.getRenderState) {\n          var renderState = widget.getRenderState(instantSearchInstance.renderState[_this4.getIndexId()] || {}, (0, _utils.createRenderArgs)(instantSearchInstance, _this4, widget));\n          storeRenderState({\n            renderState: renderState,\n            instantSearchInstance: instantSearchInstance,\n            parent: _this4\n          });\n        }\n      });\n      widgetsToRender.forEach(function (widget) {\n        // At this point, all the variables used below are set. Both `helper`\n        // and `derivedHelper` have been created at the `init` step. The attribute\n        // `lastResults` might be `null` though. It's possible that a stalled render\n        // happens before the result e.g with a dynamically added index the request might\n        // be delayed. The render is triggered for the complete tree but some parts do\n        // not have results yet.\n\n        if (widget.render) {\n          widget.render((0, _utils.createRenderArgs)(instantSearchInstance, _this4, widget));\n        }\n      });\n    },\n    dispose: function dispose() {\n      var _this5 = this,\n        _helper2,\n        _derivedHelper3;\n      localWidgets.forEach(function (widget) {\n        if (widget.dispose && helper) {\n          // The dispose function is always called once the instance is started\n          // (it's an effect of `removeWidgets`). The index is initialized and\n          // the Helper is available. We don't care about the return value of\n          // `dispose` because the index is removed. We can't call `removeWidgets`\n          // because we want to keep the widgets on the instance, to allow idempotent\n          // operations on `add` & `remove`.\n          widget.dispose({\n            helper: helper,\n            state: helper.state,\n            recommendState: helper.recommendState,\n            parent: _this5\n          });\n        }\n      });\n      localInstantSearchInstance = null;\n      localParent = null;\n      (_helper2 = helper) === null || _helper2 === void 0 ? void 0 : _helper2.removeAllListeners();\n      helper = null;\n      (_derivedHelper3 = derivedHelper) === null || _derivedHelper3 === void 0 ? void 0 : _derivedHelper3.detach();\n      derivedHelper = null;\n    },\n    getWidgetUiState: function getWidgetUiState(uiState) {\n      return localWidgets.filter(_utils.isIndexWidget).reduce(function (previousUiState, innerIndex) {\n        return innerIndex.getWidgetUiState(previousUiState);\n      }, _objectSpread(_objectSpread({}, uiState), {}, _defineProperty({}, indexId, _objectSpread(_objectSpread({}, uiState[indexId]), localUiState))));\n    },\n    getWidgetState: function getWidgetState(uiState) {\n      process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, 'The `getWidgetState` method is renamed `getWidgetUiState` and will no longer exist under that name in InstantSearch.js 5.x. Please use `getWidgetUiState` instead.') : void 0;\n      return this.getWidgetUiState(uiState);\n    },\n    getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref7) {\n      var uiState = _ref7.uiState;\n      return getLocalWidgetsSearchParameters(localWidgets, {\n        uiState: uiState,\n        initialSearchParameters: searchParameters\n      });\n    },\n    refreshUiState: function refreshUiState() {\n      localUiState = getLocalWidgetsUiState(localWidgets, {\n        searchParameters: this.getHelper().state,\n        helper: this.getHelper()\n      }, localUiState);\n    },\n    setIndexUiState: function setIndexUiState(indexUiState) {\n      var nextIndexUiState = typeof indexUiState === 'function' ? indexUiState(localUiState) : indexUiState;\n      localInstantSearchInstance.setUiState(function (state) {\n        return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, indexId, nextIndexUiState));\n      });\n    }\n  };\n};\nvar _default = exports.default = index;\nfunction storeRenderState(_ref8) {\n  var renderState = _ref8.renderState,\n    instantSearchInstance = _ref8.instantSearchInstance,\n    parent = _ref8.parent;\n  var parentIndexName = parent ? parent.getIndexId() : instantSearchInstance.mainIndex.getIndexId();\n  instantSearchInstance.renderState = _objectSpread(_objectSpread({}, instantSearchInstance.renderState), {}, _defineProperty({}, parentIndexName, _objectSpread(_objectSpread({}, instantSearchInstance.renderState[parentIndexName]), renderState)));\n}"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/index.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.EXPERIMENTAL_dynamicWidgets = exports.EXPERIMENTAL_configureRelatedItems = exports.EXPERIMENTAL_answers = void 0;\nObject.defineProperty(exports, \"analytics\", {\n  enumerable: true,\n  get: function get() {\n    return _analytics.default;\n  }\n});\nObject.defineProperty(exports, \"breadcrumb\", {\n  enumerable: true,\n  get: function get() {\n    return _breadcrumb.default;\n  }\n});\nObject.defineProperty(exports, \"clearRefinements\", {\n  enumerable: true,\n  get: function get() {\n    return _clearRefinements.default;\n  }\n});\nObject.defineProperty(exports, \"configure\", {\n  enumerable: true,\n  get: function get() {\n    return _configure.default;\n  }\n});\nObject.defineProperty(exports, \"currentRefinements\", {\n  enumerable: true,\n  get: function get() {\n    return _currentRefinements.default;\n  }\n});\nObject.defineProperty(exports, \"dynamicWidgets\", {\n  enumerable: true,\n  get: function get() {\n    return _dynamicWidgets.default;\n  }\n});\nObject.defineProperty(exports, \"frequentlyBoughtTogether\", {\n  enumerable: true,\n  get: function get() {\n    return _frequentlyBoughtTogether.default;\n  }\n});\nObject.defineProperty(exports, \"geoSearch\", {\n  enumerable: true,\n  get: function get() {\n    return _geoSearch.default;\n  }\n});\nObject.defineProperty(exports, \"hierarchicalMenu\", {\n  enumerable: true,\n  get: function get() {\n    return _hierarchicalMenu.default;\n  }\n});\nObject.defineProperty(exports, \"hits\", {\n  enumerable: true,\n  get: function get() {\n    return _hits.default;\n  }\n});\nObject.defineProperty(exports, \"hitsPerPage\", {\n  enumerable: true,\n  get: function get() {\n    return _hitsPerPage.default;\n  }\n});\nObject.defineProperty(exports, \"index\", {\n  enumerable: true,\n  get: function get() {\n    return _index.default;\n  }\n});\nObject.defineProperty(exports, \"infiniteHits\", {\n  enumerable: true,\n  get: function get() {\n    return _infiniteHits.default;\n  }\n});\nObject.defineProperty(exports, \"lookingSimilar\", {\n  enumerable: true,\n  get: function get() {\n    return _lookingSimilar.default;\n  }\n});\nObject.defineProperty(exports, \"menu\", {\n  enumerable: true,\n  get: function get() {\n    return _menu.default;\n  }\n});\nObject.defineProperty(exports, \"menuSelect\", {\n  enumerable: true,\n  get: function get() {\n    return _menuSelect.default;\n  }\n});\nObject.defineProperty(exports, \"numericMenu\", {\n  enumerable: true,\n  get: function get() {\n    return _numericMenu.default;\n  }\n});\nObject.defineProperty(exports, \"pagination\", {\n  enumerable: true,\n  get: function get() {\n    return _pagination.default;\n  }\n});\nObject.defineProperty(exports, \"panel\", {\n  enumerable: true,\n  get: function get() {\n    return _panel.default;\n  }\n});\nObject.defineProperty(exports, \"places\", {\n  enumerable: true,\n  get: function get() {\n    return _places.default;\n  }\n});\nObject.defineProperty(exports, \"poweredBy\", {\n  enumerable: true,\n  get: function get() {\n    return _poweredBy.default;\n  }\n});\nObject.defineProperty(exports, \"queryRuleContext\", {\n  enumerable: true,\n  get: function get() {\n    return _queryRuleContext.default;\n  }\n});\nObject.defineProperty(exports, \"queryRuleCustomData\", {\n  enumerable: true,\n  get: function get() {\n    return _queryRuleCustomData.default;\n  }\n});\nObject.defineProperty(exports, \"rangeInput\", {\n  enumerable: true,\n  get: function get() {\n    return _rangeInput.default;\n  }\n});\nObject.defineProperty(exports, \"rangeSlider\", {\n  enumerable: true,\n  get: function get() {\n    return _rangeSlider.default;\n  }\n});\nObject.defineProperty(exports, \"ratingMenu\", {\n  enumerable: true,\n  get: function get() {\n    return _ratingMenu.default;\n  }\n});\nObject.defineProperty(exports, \"refinementList\", {\n  enumerable: true,\n  get: function get() {\n    return _refinementList.default;\n  }\n});\nObject.defineProperty(exports, \"relatedProducts\", {\n  enumerable: true,\n  get: function get() {\n    return _relatedProducts.default;\n  }\n});\nObject.defineProperty(exports, \"relevantSort\", {\n  enumerable: true,\n  get: function get() {\n    return _relevantSort.default;\n  }\n});\nObject.defineProperty(exports, \"searchBox\", {\n  enumerable: true,\n  get: function get() {\n    return _searchBox.default;\n  }\n});\nObject.defineProperty(exports, \"sortBy\", {\n  enumerable: true,\n  get: function get() {\n    return _sortBy.default;\n  }\n});\nObject.defineProperty(exports, \"stats\", {\n  enumerable: true,\n  get: function get() {\n    return _stats.default;\n  }\n});\nObject.defineProperty(exports, \"toggleRefinement\", {\n  enumerable: true,\n  get: function get() {\n    return _toggleRefinement.default;\n  }\n});\nObject.defineProperty(exports, \"trendingItems\", {\n  enumerable: true,\n  get: function get() {\n    return _trendingItems.default;\n  }\n});\nObject.defineProperty(exports, \"voiceSearch\", {\n  enumerable: true,\n  get: function get() {\n    return _voiceSearch.default;\n  }\n});\nvar _utils = require(\"../lib/utils\");\nvar _answers = _interopRequireDefault(require(\"./answers/answers\"));\nvar _configureRelatedItems = _interopRequireDefault(require(\"./configure-related-items/configure-related-items\"));\nvar _dynamicWidgets = _interopRequireDefault(require(\"./dynamic-widgets/dynamic-widgets\"));\nvar _analytics = _interopRequireDefault(require(\"./analytics/analytics\"));\nvar _breadcrumb = _interopRequireDefault(require(\"./breadcrumb/breadcrumb\"));\nvar _clearRefinements = _interopRequireDefault(require(\"./clear-refinements/clear-refinements\"));\nvar _configure = _interopRequireDefault(require(\"./configure/configure\"));\nvar _currentRefinements = _interopRequireDefault(require(\"./current-refinements/current-refinements\"));\nvar _geoSearch = _interopRequireDefault(require(\"./geo-search/geo-search\"));\nvar _hierarchicalMenu = _interopRequireDefault(require(\"./hierarchical-menu/hierarchical-menu\"));\nvar _hits = _interopRequireDefault(require(\"./hits/hits\"));\nvar _hitsPerPage = _interopRequireDefault(require(\"./hits-per-page/hits-per-page\"));\nvar _index = _interopRequireDefault(require(\"./index/index\"));\nvar _infiniteHits = _interopRequireDefault(require(\"./infinite-hits/infinite-hits\"));\nvar _menu = _interopRequireDefault(require(\"./menu/menu\"));\nvar _menuSelect = _interopRequireDefault(require(\"./menu-select/menu-select\"));\nvar _numericMenu = _interopRequireDefault(require(\"./numeric-menu/numeric-menu\"));\nvar _pagination = _interopRequireDefault(require(\"./pagination/pagination\"));\nvar _panel = _interopRequireDefault(require(\"./panel/panel\"));\nvar _places = _interopRequireDefault(require(\"./places/places\"));\nvar _poweredBy = _interopRequireDefault(require(\"./powered-by/powered-by\"));\nvar _queryRuleContext = _interopRequireDefault(require(\"./query-rule-context/query-rule-context\"));\nvar _queryRuleCustomData = _interopRequireDefault(require(\"./query-rule-custom-data/query-rule-custom-data\"));\nvar _relatedProducts = _interopRequireDefault(require(\"./related-products/related-products\"));\nvar _rangeInput = _interopRequireDefault(require(\"./range-input/range-input\"));\nvar _rangeSlider = _interopRequireDefault(require(\"./range-slider/range-slider\"));\nvar _ratingMenu = _interopRequireDefault(require(\"./rating-menu/rating-menu\"));\nvar _refinementList = _interopRequireDefault(require(\"./refinement-list/refinement-list\"));\nvar _relevantSort = _interopRequireDefault(require(\"./relevant-sort/relevant-sort\"));\nvar _searchBox = _interopRequireDefault(require(\"./search-box/search-box\"));\nvar _sortBy = _interopRequireDefault(require(\"./sort-by/sort-by\"));\nvar _stats = _interopRequireDefault(require(\"./stats/stats\"));\nvar _toggleRefinement = _interopRequireDefault(require(\"./toggle-refinement/toggle-refinement\"));\nvar _trendingItems = _interopRequireDefault(require(\"./trending-items/trending-items\"));\nvar _voiceSearch = _interopRequireDefault(require(\"./voice-search/voice-search\"));\nvar _frequentlyBoughtTogether = _interopRequireDefault(require(\"./frequently-bought-together/frequently-bought-together\"));\nvar _lookingSimilar = _interopRequireDefault(require(\"./looking-similar/looking-similar\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n/** @deprecated answers is no longer supported */\nvar EXPERIMENTAL_answers = exports.EXPERIMENTAL_answers = (0, _utils.deprecate)(_answers.default, 'answers is no longer supported');\n\n/** @deprecated use relatedItems instead */\nvar EXPERIMENTAL_configureRelatedItems = exports.EXPERIMENTAL_configureRelatedItems = (0, _utils.deprecate)(_configureRelatedItems.default, 'EXPERIMENTAL_configureRelatedItems is deprecated and will be removed in a next minor version of InstantSearch. Please use relatedItems instead.');\n\n/** @deprecated use dynamicWidgets */\nvar EXPERIMENTAL_dynamicWidgets = exports.EXPERIMENTAL_dynamicWidgets = (0, _utils.deprecate)(_dynamicWidgets.default, 'use dynamicWidgets');"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/infinite-hits/defaultTemplates.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nvar defaultTemplates = {\n  empty: function empty() {\n    return 'No results';\n  },\n  showPreviousText: function showPreviousText() {\n    return 'Show previous results';\n  },\n  showMoreText: function showMoreText() {\n    return 'Show more results';\n  },\n  item: function item(data) {\n    return JSON.stringify((0, _utils.omit)(data, ['__hitIndex']), null, 2);\n  }\n};\nvar _default = exports.default = defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/infinite-hits/infinite-hits.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _InfiniteHits = _interopRequireDefault(require(\"../../components/InfiniteHits/InfiniteHits\"));\nvar _connectInfiniteHits = _interopRequireDefault(require(\"../../connectors/infinite-hits/connectInfiniteHits\"));\nvar _insights = require(\"../../lib/insights\");\nvar _suit = require(\"../../lib/suit\");\nvar _templating = require(\"../../lib/templating\");\nvar _utils = require(\"../../lib/utils\");\nvar _defaultTemplates = _interopRequireDefault(require(\"./defaultTemplates\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'infinite-hits'\n});\nvar suit = (0, _suit.component)('InfiniteHits');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    renderState = _ref.renderState,\n    templates = _ref.templates,\n    hasShowPrevious = _ref.showPrevious;\n  return function (_ref2, isFirstRendering) {\n    var items = _ref2.items,\n      results = _ref2.results,\n      showMore = _ref2.showMore,\n      showPrevious = _ref2.showPrevious,\n      isFirstPage = _ref2.isFirstPage,\n      isLastPage = _ref2.isLastPage,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      insights = _ref2.insights,\n      bindEvent = _ref2.bindEvent,\n      sendEvent = _ref2.sendEvent,\n      banner = _ref2.banner;\n    if (isFirstRendering) {\n      renderState.templateProps = (0, _templating.prepareTemplateProps)({\n        defaultTemplates: _defaultTemplates.default,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    (0, _preact.render)((0, _preact.h)(_InfiniteHits.default, {\n      cssClasses: cssClasses,\n      hits: items,\n      results: results,\n      hasShowPrevious: hasShowPrevious,\n      showPrevious: showPrevious,\n      showMore: showMore,\n      templateProps: renderState.templateProps,\n      isFirstPage: isFirstPage,\n      isLastPage: isLastPage,\n      insights: insights,\n      sendEvent: sendEvent,\n      bindEvent: bindEvent,\n      banner: banner\n    }), containerNode);\n  };\n};\nvar infiniteHits = exports.default = function infiniteHits(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    escapeHTML = _ref3.escapeHTML,\n    transformItems = _ref3.transformItems,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    showPrevious = _ref3.showPrevious,\n    cache = _ref3.cache;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    emptyRoot: (0, _instantsearchUiComponents.cx)(suit({\n      modifierName: 'empty'\n    }), userCssClasses.emptyRoot),\n    item: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item'\n    }), userCssClasses.item),\n    list: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'list'\n    }), userCssClasses.list),\n    loadPrevious: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'loadPrevious'\n    }), userCssClasses.loadPrevious),\n    disabledLoadPrevious: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'loadPrevious',\n      modifierName: 'disabled'\n    }), userCssClasses.disabledLoadPrevious),\n    loadMore: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'loadMore'\n    }), userCssClasses.loadMore),\n    disabledLoadMore: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'loadMore',\n      modifierName: 'disabled'\n    }), userCssClasses.disabledLoadMore),\n    bannerRoot: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'banner'\n    }), userCssClasses.bannerRoot),\n    bannerImage: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'banner-image'\n    }), userCssClasses.bannerImage),\n    bannerLink: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'banner-link'\n    }), userCssClasses.bannerLink)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    templates: templates,\n    showPrevious: showPrevious,\n    renderState: {}\n  });\n  var makeWidget = (0, _insights.withInsights)(_connectInfiniteHits.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    escapeHTML: escapeHTML,\n    transformItems: transformItems,\n    showPrevious: showPrevious,\n    cache: cache\n  })), {}, {\n    $$widgetType: 'ais.infiniteHits'\n  });\n};"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/looking-similar/looking-similar.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _Template = _interopRequireDefault(require(\"../../components/Template/Template\"));\nvar _connectLookingSimilar = _interopRequireDefault(require(\"../../connectors/looking-similar/connectLookingSimilar\"));\nvar _templating = require(\"../../lib/templating\");\nvar _utils = require(\"../../lib/utils\");\nvar _excluded = [\"item\", \"sendEvent\"];\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'looking-similar'\n});\nvar LookingSimilar = (0, _instantsearchUiComponents.createLookingSimilarComponent)({\n  createElement: _preact.h,\n  Fragment: _preact.Fragment\n});\nfunction createRenderer(_ref) {\n  var renderState = _ref.renderState,\n    cssClasses = _ref.cssClasses,\n    containerNode = _ref.containerNode,\n    templates = _ref.templates;\n  return function (_ref2, isFirstRendering) {\n    var items = _ref2.items,\n      results = _ref2.results,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      sendEvent = _ref2.sendEvent;\n    if (isFirstRendering) {\n      renderState.templateProps = (0, _templating.prepareTemplateProps)({\n        defaultTemplates: {},\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    var headerComponent = templates.header ? function (data) {\n      return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n        templateKey: \"header\",\n        rootTagName: \"fragment\",\n        data: {\n          cssClasses: data.classNames,\n          items: data.items\n        }\n      }));\n    } : undefined;\n    var itemComponent = templates.item ? function (_ref3) {\n      var item = _ref3.item,\n        _sendEvent = _ref3.sendEvent,\n        rootProps = _objectWithoutProperties(_ref3, _excluded);\n      return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n        templateKey: \"item\",\n        rootTagName: \"fragment\",\n        data: item,\n        sendEvent: _sendEvent,\n        rootProps: _objectSpread({}, rootProps)\n      }));\n    } : undefined;\n    var emptyComponent = templates.empty ? function () {\n      return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n        templateKey: \"empty\",\n        rootTagName: \"fragment\",\n        data: results\n      }));\n    } : undefined;\n    var layoutComponent = templates.layout ? function (data) {\n      return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n        templateKey: \"layout\",\n        rootTagName: \"fragment\",\n        data: {\n          sendEvent: sendEvent,\n          items: data.items,\n          templates: {\n            item: templates.item ? function (_ref4) {\n              var item = _ref4.item;\n              return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n                templateKey: \"item\",\n                rootTagName: \"fragment\",\n                data: item,\n                sendEvent: sendEvent\n              }));\n            } : undefined\n          },\n          cssClasses: {\n            list: data.classNames.list,\n            item: data.classNames.item\n          }\n        },\n        sendEvent: sendEvent\n      }));\n    } : undefined;\n    (0, _preact.render)((0, _preact.h)(LookingSimilar, {\n      items: items,\n      headerComponent: headerComponent,\n      itemComponent: itemComponent,\n      sendEvent: function sendEvent() {},\n      classNames: cssClasses,\n      emptyComponent: emptyComponent,\n      layout: layoutComponent,\n      status: instantSearchInstance.status\n    }), containerNode);\n  };\n}\nvar lookingSimilar = exports.default = function lookingSimilar(widgetParams) {\n  var _ref5 = widgetParams || {},\n    container = _ref5.container,\n    objectIDs = _ref5.objectIDs,\n    limit = _ref5.limit,\n    queryParameters = _ref5.queryParameters,\n    fallbackParameters = _ref5.fallbackParameters,\n    threshold = _ref5.threshold,\n    escapeHTML = _ref5.escapeHTML,\n    transformItems = _ref5.transformItems,\n    _ref5$templates = _ref5.templates,\n    templates = _ref5$templates === void 0 ? {} : _ref5$templates,\n    _ref5$cssClasses = _ref5.cssClasses,\n    cssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var specializedRenderer = createRenderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = (0, _connectLookingSimilar.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    objectIDs: objectIDs,\n    limit: limit,\n    queryParameters: queryParameters,\n    fallbackParameters: fallbackParameters,\n    threshold: threshold,\n    escapeHTML: escapeHTML,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.lookingSimilar'\n  });\n};"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/menu/defaultTemplates.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _formatNumber = require(\"../../lib/formatNumber\");\nvar defaultTemplates = {\n  item: function item(_ref) {\n    var cssClasses = _ref.cssClasses,\n      url = _ref.url,\n      label = _ref.label,\n      count = _ref.count;\n    return (0, _preact.h)(\"a\", {\n      className: (0, _instantsearchUiComponents.cx)(cssClasses.link),\n      href: url\n    }, (0, _preact.h)(\"span\", {\n      className: (0, _instantsearchUiComponents.cx)(cssClasses.label)\n    }, label), (0, _preact.h)(\"span\", {\n      className: (0, _instantsearchUiComponents.cx)(cssClasses.count)\n    }, (0, _formatNumber.formatNumber)(count)));\n  },\n  showMoreText: function showMoreText(_ref2) {\n    var isShowingMore = _ref2.isShowingMore;\n    return isShowingMore ? 'Show less' : 'Show more';\n  }\n};\nvar _default = exports.default = defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/menu/menu.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _RefinementList = _interopRequireDefault(require(\"../../components/RefinementList/RefinementList\"));\nvar _connectMenu = _interopRequireDefault(require(\"../../connectors/menu/connectMenu\"));\nvar _suit = require(\"../../lib/suit\");\nvar _templating = require(\"../../lib/templating\");\nvar _utils = require(\"../../lib/utils\");\nvar _defaultTemplates = _interopRequireDefault(require(\"./defaultTemplates\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'menu'\n});\nvar suit = (0, _suit.component)('Menu');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    renderState = _ref.renderState,\n    templates = _ref.templates,\n    showMore = _ref.showMore;\n  return function (_ref2, isFirstRendering) {\n    var refine = _ref2.refine,\n      items = _ref2.items,\n      createURL = _ref2.createURL,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      isShowingMore = _ref2.isShowingMore,\n      toggleShowMore = _ref2.toggleShowMore,\n      canToggleShowMore = _ref2.canToggleShowMore;\n    if (isFirstRendering) {\n      renderState.templateProps = (0, _templating.prepareTemplateProps)({\n        defaultTemplates: _defaultTemplates.default,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    var facetValues = items.map(function (facetValue) {\n      return _objectSpread(_objectSpread({}, facetValue), {}, {\n        url: createURL(facetValue.value)\n      });\n    });\n    (0, _preact.render)((0, _preact.h)(_RefinementList.default, {\n      createURL: createURL,\n      cssClasses: cssClasses,\n      facetValues: facetValues,\n      showMore: showMore,\n      templateProps: renderState.templateProps,\n      toggleRefinement: refine,\n      toggleShowMore: toggleShowMore,\n      isShowingMore: isShowingMore,\n      canToggleShowMore: canToggleShowMore\n    }), containerNode);\n  };\n};\nvar menu = function menu(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    attribute = _ref3.attribute,\n    sortBy = _ref3.sortBy,\n    limit = _ref3.limit,\n    showMore = _ref3.showMore,\n    showMoreLimit = _ref3.showMoreLimit,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    transformItems = _ref3.transformItems;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    noRefinementRoot: (0, _instantsearchUiComponents.cx)(suit({\n      modifierName: 'noRefinement'\n    }), userCssClasses.noRefinementRoot),\n    list: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'list'\n    }), userCssClasses.list),\n    item: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item'\n    }), userCssClasses.item),\n    selectedItem: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item',\n      modifierName: 'selected'\n    }), userCssClasses.selectedItem),\n    link: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'link'\n    }), userCssClasses.link),\n    label: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'label'\n    }), userCssClasses.label),\n    count: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'count'\n    }), userCssClasses.count),\n    showMore: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'showMore'\n    }), userCssClasses.showMore),\n    disabledShowMore: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'showMore',\n      modifierName: 'disabled'\n    }), userCssClasses.disabledShowMore)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates,\n    showMore: showMore\n  });\n  var makeWidget = (0, _connectMenu.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attribute: attribute,\n    limit: limit,\n    showMore: showMore,\n    showMoreLimit: showMoreLimit,\n    sortBy: sortBy,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.menu'\n  });\n};\nvar _default = exports.default = menu;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/menu-select/defaultTemplates.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _formatNumber = require(\"../../lib/formatNumber\");\nvar defaultTemplates = {\n  item: function item(_ref) {\n    var label = _ref.label,\n      count = _ref.count;\n    return \"\".concat(label, \" (\").concat((0, _formatNumber.formatNumber)(count), \")\");\n  },\n  defaultOption: function defaultOption() {\n    return 'See all';\n  }\n};\nvar _default = exports.default = defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/menu-select/menu-select.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _MenuSelect = _interopRequireDefault(require(\"../../components/MenuSelect/MenuSelect\"));\nvar _connectMenu = _interopRequireDefault(require(\"../../connectors/menu/connectMenu\"));\nvar _suit = require(\"../../lib/suit\");\nvar _templating = require(\"../../lib/templating\");\nvar _utils = require(\"../../lib/utils\");\nvar _defaultTemplates = _interopRequireDefault(require(\"./defaultTemplates\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'menu-select'\n});\nvar suit = (0, _suit.component)('MenuSelect');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    renderState = _ref.renderState,\n    templates = _ref.templates;\n  return function (_ref2, isFirstRendering) {\n    var refine = _ref2.refine,\n      items = _ref2.items,\n      instantSearchInstance = _ref2.instantSearchInstance;\n    if (isFirstRendering) {\n      renderState.templateProps = (0, _templating.prepareTemplateProps)({\n        defaultTemplates: _defaultTemplates.default,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    (0, _preact.render)((0, _preact.h)(_MenuSelect.default, {\n      cssClasses: cssClasses,\n      items: items,\n      refine: refine,\n      templateProps: renderState.templateProps\n    }), containerNode);\n  };\n};\nvar menuSelect = function menuSelect(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    attribute = _ref3.attribute,\n    _ref3$sortBy = _ref3.sortBy,\n    sortBy = _ref3$sortBy === void 0 ? ['name:asc'] : _ref3$sortBy,\n    _ref3$limit = _ref3.limit,\n    limit = _ref3$limit === void 0 ? 10 : _ref3$limit,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    transformItems = _ref3.transformItems;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    noRefinementRoot: (0, _instantsearchUiComponents.cx)(suit({\n      modifierName: 'noRefinement'\n    }), userCssClasses.noRefinementRoot),\n    select: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'select'\n    }), userCssClasses.select),\n    option: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'option'\n    }), userCssClasses.option)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = (0, _connectMenu.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attribute: attribute,\n    limit: limit,\n    sortBy: sortBy,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.menuSelect'\n  });\n};\nvar _default = exports.default = menuSelect;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/numeric-menu/defaultTemplates.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _preact = require(\"preact\");\nvar defaultTemplates = {\n  item: function item(_ref) {\n    var cssClasses = _ref.cssClasses,\n      attribute = _ref.attribute,\n      label = _ref.label,\n      isRefined = _ref.isRefined;\n    return (0, _preact.h)(\"label\", {\n      className: cssClasses.label\n    }, (0, _preact.h)(\"input\", {\n      type: \"radio\",\n      className: cssClasses.radio,\n      name: attribute,\n      defaultChecked: isRefined\n    }), (0, _preact.h)(\"span\", {\n      className: cssClasses.labelText\n    }, label));\n  }\n};\nvar _default = exports.default = defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/numeric-menu/numeric-menu.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _RefinementList = _interopRequireDefault(require(\"../../components/RefinementList/RefinementList\"));\nvar _connectNumericMenu = _interopRequireDefault(require(\"../../connectors/numeric-menu/connectNumericMenu\"));\nvar _suit = require(\"../../lib/suit\");\nvar _templating = require(\"../../lib/templating\");\nvar _utils = require(\"../../lib/utils\");\nvar _defaultTemplates = _interopRequireDefault(require(\"./defaultTemplates\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'numeric-menu'\n});\nvar suit = (0, _suit.component)('NumericMenu');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    attribute = _ref.attribute,\n    cssClasses = _ref.cssClasses,\n    renderState = _ref.renderState,\n    templates = _ref.templates;\n  return function (_ref2, isFirstRendering) {\n    var createURL = _ref2.createURL,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      refine = _ref2.refine,\n      items = _ref2.items;\n    if (isFirstRendering) {\n      renderState.templateProps = (0, _templating.prepareTemplateProps)({\n        defaultTemplates: _defaultTemplates.default,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    (0, _preact.render)((0, _preact.h)(_RefinementList.default, {\n      createURL: createURL,\n      cssClasses: cssClasses,\n      facetValues: items,\n      templateProps: renderState.templateProps,\n      toggleRefinement: refine,\n      attribute: attribute\n    }), containerNode);\n  };\n};\nvar numericMenu = function numericMenu(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    attribute = _ref3.attribute,\n    items = _ref3.items,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    transformItems = _ref3.transformItems;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    noRefinementRoot: (0, _instantsearchUiComponents.cx)(suit({\n      modifierName: 'noRefinement'\n    }), userCssClasses.noRefinementRoot),\n    list: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'list'\n    }), userCssClasses.list),\n    item: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item'\n    }), userCssClasses.item),\n    selectedItem: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item',\n      modifierName: 'selected'\n    }), userCssClasses.selectedItem),\n    label: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'label'\n    }), userCssClasses.label),\n    radio: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'radio'\n    }), userCssClasses.radio),\n    labelText: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'labelText'\n    }), userCssClasses.labelText)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    attribute: attribute,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = (0, _connectNumericMenu.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attribute: attribute,\n    items: items,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.numericMenu'\n  });\n};\nvar _default = exports.default = numericMenu;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/pagination/pagination.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _Pagination = _interopRequireDefault(require(\"../../components/Pagination/Pagination\"));\nvar _connectPagination = _interopRequireDefault(require(\"../../connectors/pagination/connectPagination\"));\nvar _suit = require(\"../../lib/suit\");\nvar _utils = require(\"../../lib/utils\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar suit = (0, _suit.component)('Pagination');\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'pagination'\n});\nvar defaultTemplates = {\n  previous: function previous() {\n    return '‹';\n  },\n  next: function next() {\n    return '›';\n  },\n  page: function page(_ref) {\n    var _page = _ref.page;\n    return \"\".concat(_page);\n  },\n  first: function first() {\n    return '«';\n  },\n  last: function last() {\n    return '»';\n  }\n};\nvar renderer = function renderer(_ref2) {\n  var containerNode = _ref2.containerNode,\n    cssClasses = _ref2.cssClasses,\n    templates = _ref2.templates,\n    showFirst = _ref2.showFirst,\n    showLast = _ref2.showLast,\n    showPrevious = _ref2.showPrevious,\n    showNext = _ref2.showNext,\n    scrollToNode = _ref2.scrollToNode;\n  return function (_ref3, isFirstRendering) {\n    var createURL = _ref3.createURL,\n      currentRefinement = _ref3.currentRefinement,\n      nbPages = _ref3.nbPages,\n      pages = _ref3.pages,\n      isFirstPage = _ref3.isFirstPage,\n      isLastPage = _ref3.isLastPage,\n      refine = _ref3.refine;\n    if (isFirstRendering) return;\n    var setCurrentPage = function setCurrentPage(pageNumber) {\n      refine(pageNumber);\n      if (scrollToNode !== false) {\n        scrollToNode.scrollIntoView();\n      }\n    };\n    (0, _preact.render)((0, _preact.h)(_Pagination.default, {\n      createURL: createURL,\n      cssClasses: cssClasses,\n      currentPage: currentRefinement,\n      templates: templates,\n      nbPages: nbPages,\n      pages: pages,\n      isFirstPage: isFirstPage,\n      isLastPage: isLastPage,\n      setCurrentPage: setCurrentPage,\n      showFirst: showFirst,\n      showLast: showLast,\n      showPrevious: showPrevious,\n      showNext: showNext\n    }), containerNode);\n  };\n};\nvar pagination = function pagination(widgetParams) {\n  var _ref4 = widgetParams || {},\n    container = _ref4.container,\n    _ref4$templates = _ref4.templates,\n    userTemplates = _ref4$templates === void 0 ? {} : _ref4$templates,\n    _ref4$cssClasses = _ref4.cssClasses,\n    userCssClasses = _ref4$cssClasses === void 0 ? {} : _ref4$cssClasses,\n    totalPages = _ref4.totalPages,\n    padding = _ref4.padding,\n    _ref4$showFirst = _ref4.showFirst,\n    showFirst = _ref4$showFirst === void 0 ? true : _ref4$showFirst,\n    _ref4$showLast = _ref4.showLast,\n    showLast = _ref4$showLast === void 0 ? true : _ref4$showLast,\n    _ref4$showPrevious = _ref4.showPrevious,\n    showPrevious = _ref4$showPrevious === void 0 ? true : _ref4$showPrevious,\n    _ref4$showNext = _ref4.showNext,\n    showNext = _ref4$showNext === void 0 ? true : _ref4$showNext,\n    _ref4$scrollTo = _ref4.scrollTo,\n    userScrollTo = _ref4$scrollTo === void 0 ? 'body' : _ref4$scrollTo;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var scrollTo = userScrollTo === true ? 'body' : userScrollTo;\n  var scrollToNode = scrollTo !== false ? (0, _utils.getContainerNode)(scrollTo) : false;\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    noRefinementRoot: (0, _instantsearchUiComponents.cx)(suit({\n      modifierName: 'noRefinement'\n    }), userCssClasses.noRefinementRoot),\n    list: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'list'\n    }), userCssClasses.list),\n    item: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item'\n    }), userCssClasses.item),\n    firstPageItem: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item',\n      modifierName: 'firstPage'\n    }), userCssClasses.firstPageItem),\n    lastPageItem: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item',\n      modifierName: 'lastPage'\n    }), userCssClasses.lastPageItem),\n    previousPageItem: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item',\n      modifierName: 'previousPage'\n    }), userCssClasses.previousPageItem),\n    nextPageItem: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item',\n      modifierName: 'nextPage'\n    }), userCssClasses.nextPageItem),\n    pageItem: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item',\n      modifierName: 'page'\n    }), userCssClasses.pageItem),\n    selectedItem: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item',\n      modifierName: 'selected'\n    }), userCssClasses.selectedItem),\n    disabledItem: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item',\n      modifierName: 'disabled'\n    }), userCssClasses.disabledItem),\n    link: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'link'\n    }), userCssClasses.link)\n  };\n  var templates = _objectSpread(_objectSpread({}, defaultTemplates), userTemplates);\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    templates: templates,\n    showFirst: showFirst,\n    showLast: showLast,\n    showPrevious: showPrevious,\n    showNext: showNext,\n    scrollToNode: scrollToNode\n  });\n  var makeWidget = (0, _connectPagination.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    totalPages: totalPages,\n    padding: padding\n  })), {}, {\n    $$widgetType: 'ais.pagination'\n  });\n};\nvar _default = exports.default = pagination;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/panel/panel.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _Panel = _interopRequireDefault(require(\"../../components/Panel/Panel\"));\nvar _suit = require(\"../../lib/suit\");\nvar _utils = require(\"../../lib/utils\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'panel'\n});\nvar suit = (0, _suit.component)('Panel');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    bodyContainerNode = _ref.bodyContainerNode,\n    cssClasses = _ref.cssClasses,\n    templates = _ref.templates;\n  return function (_ref2) {\n    var options = _ref2.options,\n      hidden = _ref2.hidden,\n      collapsible = _ref2.collapsible,\n      collapsed = _ref2.collapsed;\n    (0, _preact.render)((0, _preact.h)(_Panel.default, {\n      cssClasses: cssClasses,\n      hidden: hidden,\n      collapsible: collapsible,\n      isCollapsed: collapsed,\n      templates: templates,\n      data: options,\n      bodyElement: bodyContainerNode\n    }), containerNode);\n  };\n};\n/**\n * The panel widget wraps other widgets in a consistent panel design.\n * It also reacts, indicates and sets CSS classes when widgets are no longer relevant for refining.\n */\nvar panel = function panel(panelWidgetParams) {\n  var _ref3 = panelWidgetParams || {},\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    _ref3$hidden = _ref3.hidden,\n    hidden = _ref3$hidden === void 0 ? function () {\n      return false;\n    } : _ref3$hidden,\n    collapsed = _ref3.collapsed,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses;\n  process.env.NODE_ENV === 'development' ? (0, _utils.warning)(typeof hidden === 'function', \"The `hidden` option in the \\\"panel\\\" widget expects a function returning a boolean (received type \".concat((0, _utils.getObjectType)(hidden), \").\")) : void 0;\n  process.env.NODE_ENV === 'development' ? (0, _utils.warning)(typeof collapsed === 'undefined' || typeof collapsed === 'function', \"The `collapsed` option in the \\\"panel\\\" widget expects a function returning a boolean (received type \".concat((0, _utils.getObjectType)(collapsed), \").\")) : void 0;\n  var bodyContainerNode = document.createElement('div');\n  var collapsible = Boolean(collapsed);\n  var collapsedFn = typeof collapsed === 'function' ? collapsed : function () {\n    return false;\n  };\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    noRefinementRoot: (0, _instantsearchUiComponents.cx)(suit({\n      modifierName: 'noRefinement'\n    }), userCssClasses.noRefinementRoot),\n    collapsibleRoot: (0, _instantsearchUiComponents.cx)(suit({\n      modifierName: 'collapsible'\n    }), userCssClasses.collapsibleRoot),\n    collapsedRoot: (0, _instantsearchUiComponents.cx)(suit({\n      modifierName: 'collapsed'\n    }), userCssClasses.collapsedRoot),\n    collapseButton: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'collapseButton'\n    }), userCssClasses.collapseButton),\n    collapseIcon: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'collapseIcon'\n    }), userCssClasses.collapseIcon),\n    body: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'body'\n    }), userCssClasses.body),\n    header: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'header'\n    }), userCssClasses.header),\n    footer: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'footer'\n    }), userCssClasses.footer)\n  };\n  return function (widgetFactory) {\n    return function (widgetParams) {\n      if (!(widgetParams && widgetParams.container)) {\n        throw new Error(withUsage(\"The `container` option is required in the widget within the panel.\"));\n      }\n      var containerNode = (0, _utils.getContainerNode)(widgetParams.container);\n      var defaultTemplates = {\n        collapseButtonText: function collapseButtonText(_ref4) {\n          var isCollapsed = _ref4.collapsed;\n          return \"<svg\\n          class=\\\"\".concat(cssClasses.collapseIcon, \"\\\"\\n          style=\\\"width: 1em; height: 1em;\\\"\\n          viewBox=\\\"0 0 500 500\\\"\\n        >\\n        <path d=\\\"\").concat(isCollapsed ? 'M100 250l300-150v300z' : 'M250 400l150-300H100z', \"\\\" fill=\\\"currentColor\\\" />\\n        </svg>\");\n        }\n      };\n      var renderPanel = renderer({\n        containerNode: containerNode,\n        bodyContainerNode: bodyContainerNode,\n        cssClasses: cssClasses,\n        templates: _objectSpread(_objectSpread({}, defaultTemplates), templates)\n      });\n      var widget = widgetFactory(_objectSpread(_objectSpread({}, widgetParams), {}, {\n        container: bodyContainerNode\n      }));\n\n      // TypeScript somehow loses track of the ...widget type, since it's\n      // not directly returned. Eventually the \"as AugmentedWidget<typeof widgetFactory>\"\n      // will not be needed anymore.\n      // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n      return _objectSpread(_objectSpread({}, widget), {}, {\n        init: function init() {\n          for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n            args[_key] = arguments[_key];\n          }\n          var renderOptions = args[0];\n          var options = _objectSpread(_objectSpread({}, widget.getWidgetRenderState ? widget.getWidgetRenderState(renderOptions) : {}), renderOptions);\n          renderPanel({\n            options: options,\n            hidden: true,\n            collapsible: collapsible,\n            collapsed: false\n          });\n          if (typeof widget.init === 'function') {\n            var _widget$init;\n            (_widget$init = widget.init).call.apply(_widget$init, [this].concat(args));\n          }\n        },\n        render: function render() {\n          for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n            args[_key2] = arguments[_key2];\n          }\n          var renderOptions = args[0];\n          var options = _objectSpread(_objectSpread({}, widget.getWidgetRenderState ? widget.getWidgetRenderState(renderOptions) : {}), renderOptions);\n          renderPanel({\n            options: options,\n            hidden: Boolean(hidden(options)),\n            collapsible: collapsible,\n            collapsed: Boolean(collapsedFn(options))\n          });\n          if (typeof widget.render === 'function') {\n            var _widget$render;\n            (_widget$render = widget.render).call.apply(_widget$render, [this].concat(args));\n          }\n        },\n        dispose: function dispose() {\n          (0, _preact.render)(null, containerNode);\n          if (typeof widget.dispose === 'function') {\n            var _widget$dispose;\n            for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n              args[_key3] = arguments[_key3];\n            }\n            return (_widget$dispose = widget.dispose).call.apply(_widget$dispose, [this].concat(args));\n          }\n          return undefined;\n        }\n      });\n    };\n  };\n};\nvar _default = exports.default = panel;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/places/places.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _utils = require(\"../../lib/utils\");\nvar _excluded = [\"placesReference\", \"defaultPosition\"],\n  _excluded2 = [\"places\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n/* Places.js is an optional dependency, no error should be reported if the package is missing */\n/** @ts-ignore */\n\n// using the type like this requires only one ts-ignore\n\n/**\n * This widget sets the geolocation value for the search based on the selected\n * result in the Algolia Places autocomplete.\n * @deprecated the places service is no longer offered, and this widget will be removed in InstantSearch.js v5\n */\nvar placesWidget = function placesWidget(widgetParams) {\n  var _ref = widgetParams || {},\n    placesReference = _ref.placesReference,\n    _ref$defaultPosition = _ref.defaultPosition,\n    defaultPosition = _ref$defaultPosition === void 0 ? [] : _ref$defaultPosition,\n    placesOptions = _objectWithoutProperties(_ref, _excluded);\n  if (typeof placesReference !== 'function') {\n    throw new Error('The `placesReference` option requires a valid Places.js reference.');\n  }\n  var placesAutocomplete = placesReference(placesOptions);\n  var state = {\n    query: '',\n    initialLatLngViaIP: undefined,\n    isInitialLatLngViaIPSet: false\n  };\n  return {\n    $$type: 'ais.places',\n    $$widgetType: 'ais.places',\n    init: function init(_ref2) {\n      var helper = _ref2.helper;\n      placesAutocomplete.on('change', function (eventOptions) {\n        var _eventOptions$suggest = eventOptions.suggestion,\n          value = _eventOptions$suggest.value,\n          _eventOptions$suggest2 = _eventOptions$suggest.latlng,\n          lat = _eventOptions$suggest2.lat,\n          lng = _eventOptions$suggest2.lng;\n        state.query = value;\n        helper.setQueryParameter('insideBoundingBox', undefined).setQueryParameter('aroundLatLngViaIP', false).setQueryParameter('aroundLatLng', \"\".concat(lat, \",\").concat(lng)).search();\n      });\n      placesAutocomplete.on('clear', function () {\n        state.query = '';\n        helper.setQueryParameter('insideBoundingBox', undefined);\n        if (defaultPosition.length > 1) {\n          helper.setQueryParameter('aroundLatLngViaIP', false).setQueryParameter('aroundLatLng', defaultPosition.join(','));\n        } else {\n          helper.setQueryParameter('aroundLatLngViaIP', state.initialLatLngViaIP).setQueryParameter('aroundLatLng', undefined);\n        }\n        helper.search();\n      });\n    },\n    getWidgetUiState: function getWidgetUiState(uiState, _ref3) {\n      var searchParameters = _ref3.searchParameters;\n      var position = searchParameters.aroundLatLng || defaultPosition.join(',');\n      var hasPositionSet = position !== defaultPosition.join(',');\n      if (!hasPositionSet && !state.query) {\n        var places = uiState.places,\n          uiStateWithoutPlaces = _objectWithoutProperties(uiState, _excluded2);\n        return uiStateWithoutPlaces;\n      }\n      return _objectSpread(_objectSpread({}, uiState), {}, {\n        places: {\n          query: state.query,\n          position: position\n        }\n      });\n    },\n    getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref4) {\n      var uiState = _ref4.uiState;\n      var _ref5 = uiState.places || {},\n        _ref5$query = _ref5.query,\n        query = _ref5$query === void 0 ? '' : _ref5$query,\n        _ref5$position = _ref5.position,\n        position = _ref5$position === void 0 ? defaultPosition.join(',') : _ref5$position;\n      state.query = query;\n      if (!state.isInitialLatLngViaIPSet) {\n        state.isInitialLatLngViaIPSet = true;\n        state.initialLatLngViaIP = searchParameters.aroundLatLngViaIP;\n      }\n      placesAutocomplete.setVal(query);\n      placesAutocomplete.close();\n      return searchParameters.setQueryParameter('insideBoundingBox', undefined).setQueryParameter('aroundLatLngViaIP', false).setQueryParameter('aroundLatLng', position || undefined);\n    },\n    getRenderState: function getRenderState(renderState, renderOptions) {\n      return _objectSpread(_objectSpread({}, renderState), {}, {\n        places: this.getWidgetRenderState(renderOptions)\n      });\n    },\n    getWidgetRenderState: function getWidgetRenderState() {\n      return {\n        widgetParams: widgetParams\n      };\n    }\n  };\n};\nvar _default = exports.default = (0, _utils.deprecate)(placesWidget, 'The places widget is deprecated and will be removed in InstantSearch.js 5.0.');"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/powered-by/powered-by.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _PoweredBy = _interopRequireDefault(require(\"../../components/PoweredBy/PoweredBy\"));\nvar _connectPoweredBy = _interopRequireDefault(require(\"../../connectors/powered-by/connectPoweredBy\"));\nvar _suit = require(\"../../lib/suit\");\nvar _utils = require(\"../../lib/utils\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar suit = (0, _suit.component)('PoweredBy');\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'powered-by'\n});\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses;\n  return function (_ref2, isFirstRendering) {\n    var url = _ref2.url,\n      widgetParams = _ref2.widgetParams;\n    if (isFirstRendering) {\n      var _widgetParams$theme = widgetParams.theme,\n        theme = _widgetParams$theme === void 0 ? 'light' : _widgetParams$theme;\n      (0, _preact.render)((0, _preact.h)(_PoweredBy.default, {\n        cssClasses: cssClasses,\n        url: url,\n        theme: theme\n      }), containerNode);\n      return;\n    }\n  };\n};\nvar poweredBy = function poweredBy(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    _ref3$theme = _ref3.theme,\n    theme = _ref3$theme === void 0 ? 'light' : _ref3$theme;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), suit({\n      modifierName: theme === 'dark' ? 'dark' : 'light'\n    }), userCssClasses.root),\n    link: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'link'\n    }), userCssClasses.link),\n    logo: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'logo'\n    }), userCssClasses.logo)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses\n  });\n  var makeWidget = (0, _connectPoweredBy.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    theme: theme\n  })), {}, {\n    $$widgetType: 'ais.poweredBy'\n  });\n};\nvar _default = exports.default = poweredBy;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/query-rule-context/query-rule-context.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _connectQueryRules = _interopRequireDefault(require(\"../../connectors/query-rules/connectQueryRules\"));\nvar _utils = require(\"../../lib/utils\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'query-rule-context'\n});\nvar queryRuleContext = function queryRuleContext() {\n  var widgetParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  if (!widgetParams.trackedFilters) {\n    throw new Error(withUsage('The `trackedFilters` option is required.'));\n  }\n  return _objectSpread(_objectSpread({}, (0, _connectQueryRules.default)(_utils.noop)(widgetParams)), {}, {\n    $$widgetType: 'ais.queryRuleContext'\n  });\n};\nvar _default = exports.default = queryRuleContext;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/query-rule-custom-data/query-rule-custom-data.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.defaultTemplates = exports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _QueryRuleCustomData = _interopRequireDefault(require(\"../../components/QueryRuleCustomData/QueryRuleCustomData\"));\nvar _connectQueryRules = _interopRequireDefault(require(\"../../connectors/query-rules/connectQueryRules\"));\nvar _suit = require(\"../../lib/suit\");\nvar _utils = require(\"../../lib/utils\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar defaultTemplates = exports.defaultTemplates = {\n  default: function _default(_ref) {\n    var items = _ref.items;\n    return JSON.stringify(items, null, 2);\n  }\n};\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'query-rule-custom-data'\n});\nvar suit = (0, _suit.component)('QueryRuleCustomData');\nvar renderer = function renderer(_ref2) {\n  var containerNode = _ref2.containerNode,\n    cssClasses = _ref2.cssClasses,\n    templates = _ref2.templates;\n  return function (_ref3) {\n    var items = _ref3.items;\n    (0, _preact.render)((0, _preact.h)(_QueryRuleCustomData.default, {\n      cssClasses: cssClasses,\n      templates: templates,\n      items: items\n    }), containerNode);\n  };\n};\nvar queryRuleCustomData = function queryRuleCustomData(widgetParams) {\n  var _ref4 = widgetParams || {},\n    container = _ref4.container,\n    _ref4$cssClasses = _ref4.cssClasses,\n    userCssClasses = _ref4$cssClasses === void 0 ? {} : _ref4$cssClasses,\n    _ref4$templates = _ref4.templates,\n    userTemplates = _ref4$templates === void 0 ? {} : _ref4$templates,\n    _ref4$transformItems = _ref4.transformItems,\n    transformItems = _ref4$transformItems === void 0 ? function (items) {\n      return items;\n    } : _ref4$transformItems;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root)\n  };\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var templates = _objectSpread(_objectSpread({}, defaultTemplates), userTemplates);\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = (0, _connectQueryRules.default)(specializedRenderer, function () {\n    (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.queryRuleCustomData'\n  });\n};\nvar _default2 = exports.default = queryRuleCustomData;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/range-input/range-input.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _RangeInput = _interopRequireDefault(require(\"../../components/RangeInput/RangeInput\"));\nvar _connectRange = _interopRequireDefault(require(\"../../connectors/range/connectRange\"));\nvar _suit = require(\"../../lib/suit\");\nvar _templating = require(\"../../lib/templating\");\nvar _utils = require(\"../../lib/utils\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'range-input'\n});\nvar suit = (0, _suit.component)('RangeInput');\nvar defaultTemplates = {\n  separatorText: function separatorText() {\n    return 'to';\n  },\n  submitText: function submitText() {\n    return 'Go';\n  }\n};\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    renderState = _ref.renderState,\n    templates = _ref.templates;\n  return function (_ref2, isFirstRendering) {\n    var refine = _ref2.refine,\n      range = _ref2.range,\n      start = _ref2.start,\n      widgetParams = _ref2.widgetParams,\n      instantSearchInstance = _ref2.instantSearchInstance;\n    if (isFirstRendering) {\n      renderState.templateProps = (0, _templating.prepareTemplateProps)({\n        defaultTemplates: defaultTemplates,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    var rangeMin = range.min,\n      rangeMax = range.max;\n    var _start = _slicedToArray(start, 2),\n      minValue = _start[0],\n      maxValue = _start[1];\n    var step = 1 / Math.pow(10, widgetParams.precision || 0);\n    var values = {\n      min: minValue !== -Infinity && minValue !== rangeMin ? minValue : undefined,\n      max: maxValue !== Infinity && maxValue !== rangeMax ? maxValue : undefined\n    };\n    (0, _preact.render)((0, _preact.h)(_RangeInput.default, {\n      min: rangeMin,\n      max: rangeMax,\n      step: step,\n      values: values,\n      cssClasses: cssClasses,\n      refine: refine,\n      templateProps: renderState.templateProps\n    }), containerNode);\n  };\n};\nvar rangeInput = function rangeInput(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    attribute = _ref3.attribute,\n    min = _ref3.min,\n    max = _ref3.max,\n    _ref3$precision = _ref3.precision,\n    precision = _ref3$precision === void 0 ? 0 : _ref3$precision,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    noRefinement: (0, _instantsearchUiComponents.cx)(suit({\n      modifierName: 'noRefinement'\n    })),\n    form: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'form'\n    }), userCssClasses.form),\n    label: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'label'\n    }), userCssClasses.label),\n    input: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'input'\n    }), userCssClasses.input),\n    inputMin: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'input',\n      modifierName: 'min'\n    }), userCssClasses.inputMin),\n    inputMax: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'input',\n      modifierName: 'max'\n    }), userCssClasses.inputMax),\n    separator: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'separator'\n    }), userCssClasses.separator),\n    submit: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'submit'\n    }), userCssClasses.submit)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    templates: templates,\n    renderState: {}\n  });\n  var makeWidget = (0, _connectRange.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attribute: attribute,\n    min: min,\n    max: max,\n    precision: precision\n  })), {}, {\n    $$type: 'ais.rangeInput',\n    $$widgetType: 'ais.rangeInput'\n  });\n};\nvar _default = exports.default = rangeInput;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/range-slider/range-slider.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _Slider = _interopRequireDefault(require(\"../../components/Slider/Slider\"));\nvar _connectRange = _interopRequireDefault(require(\"../../connectors/range/connectRange\"));\nvar _suit = require(\"../../lib/suit\");\nvar _utils = require(\"../../lib/utils\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'range-slider'\n});\nvar suit = (0, _suit.component)('RangeSlider');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    pips = _ref.pips,\n    step = _ref.step,\n    tooltips = _ref.tooltips;\n  return function (_ref2, isFirstRendering) {\n    var refine = _ref2.refine,\n      range = _ref2.range,\n      start = _ref2.start;\n    if (isFirstRendering) {\n      // There's no information at this point, let's render nothing.\n      return;\n    }\n    var minRange = range.min,\n      maxRange = range.max;\n    var _start = _slicedToArray(start, 2),\n      minStart = _start[0],\n      maxStart = _start[1];\n    var minFinite = minStart === -Infinity ? minRange : minStart;\n    var maxFinite = maxStart === Infinity ? maxRange : maxStart;\n\n    // Clamp values to the range for avoid extra rendering & refinement\n    // Should probably be done on the connector side, but we need to stay\n    // backward compatible so we still need to pass [-Infinity, Infinity]\n    var values = [minFinite > maxRange ? maxRange : minFinite, maxFinite < minRange ? minRange : maxFinite];\n    (0, _preact.render)((0, _preact.h)(_Slider.default, {\n      cssClasses: cssClasses,\n      refine: refine,\n      min: minRange,\n      max: maxRange,\n      values: values,\n      tooltips: tooltips,\n      step: step,\n      pips: pips\n    }), containerNode);\n  };\n};\n/**\n * The range slider is a widget which provides a user-friendly way to filter the\n * results based on a single numeric range.\n *\n * @requirements\n * The attribute passed to `attribute` must be declared as an\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\n * in your Algolia settings.\n *\n * The values inside this attribute must be JavaScript numbers (not strings).\n */\nvar rangeSlider = function rangeSlider(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    attribute = _ref3.attribute,\n    min = _ref3.min,\n    max = _ref3.max,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    step = _ref3.step,\n    _ref3$pips = _ref3.pips,\n    pips = _ref3$pips === void 0 ? true : _ref3$pips,\n    _ref3$precision = _ref3.precision,\n    precision = _ref3$precision === void 0 ? 0 : _ref3$precision,\n    _ref3$tooltips = _ref3.tooltips,\n    tooltips = _ref3$tooltips === void 0 ? true : _ref3$tooltips;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    disabledRoot: (0, _instantsearchUiComponents.cx)(suit({\n      modifierName: 'disabled'\n    }), userCssClasses.disabledRoot)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    step: step,\n    pips: pips,\n    tooltips: tooltips,\n    cssClasses: cssClasses\n  });\n  var makeWidget = (0, _connectRange.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attribute: attribute,\n    min: min,\n    max: max,\n    precision: precision\n  })), {}, {\n    $$type: 'ais.rangeSlider',\n    $$widgetType: 'ais.rangeSlider'\n  });\n};\nvar _default = exports.default = rangeSlider;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/rating-menu/defaultTemplates.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _formatNumber = require(\"../../lib/formatNumber\");\nfunction ItemWrapper(_ref) {\n  var children = _ref.children,\n    count = _ref.count,\n    value = _ref.value,\n    url = _ref.url,\n    cssClasses = _ref.cssClasses;\n  if (count) {\n    return (0, _preact.h)(\"a\", {\n      className: (0, _instantsearchUiComponents.cx)(cssClasses.link),\n      \"aria-label\": \"\".concat(value, \" & up\"),\n      href: url\n    }, children);\n  }\n  return (0, _preact.h)(\"div\", {\n    className: (0, _instantsearchUiComponents.cx)(cssClasses.link),\n    \"aria-label\": \"\".concat(value, \" & up\"),\n    disabled: true\n  }, children);\n}\nvar defaultTemplates = {\n  item: function item(_ref2) {\n    var count = _ref2.count,\n      value = _ref2.value,\n      url = _ref2.url,\n      stars = _ref2.stars,\n      cssClasses = _ref2.cssClasses;\n    return (0, _preact.h)(ItemWrapper, {\n      count: count,\n      value: value,\n      url: url,\n      cssClasses: cssClasses\n    }, stars.map(function (isFull, index) {\n      return (0, _preact.h)(\"svg\", {\n        key: index,\n        className: (0, _instantsearchUiComponents.cx)(cssClasses.starIcon, isFull ? cssClasses.fullStarIcon : cssClasses.emptyStarIcon),\n        \"aria-hidden\": \"true\",\n        width: \"24\",\n        height: \"24\"\n      }, (0, _preact.h)(\"use\", {\n        xlinkHref: isFull ? '#ais-RatingMenu-starSymbol' : '#ais-RatingMenu-starEmptySymbol'\n      }));\n    }), (0, _preact.h)(\"span\", {\n      \"aria-hidden\": \"true\",\n      className: (0, _instantsearchUiComponents.cx)(cssClasses.label)\n    }, \"& Up\"), count && (0, _preact.h)(\"span\", {\n      className: (0, _instantsearchUiComponents.cx)(cssClasses.count)\n    }, (0, _formatNumber.formatNumber)(count)));\n  }\n};\nvar _default = exports.default = defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/rating-menu/rating-menu.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _RefinementList = _interopRequireDefault(require(\"../../components/RefinementList/RefinementList\"));\nvar _connectRatingMenu = _interopRequireDefault(require(\"../../connectors/rating-menu/connectRatingMenu\"));\nvar _suit = require(\"../../lib/suit\");\nvar _templating = require(\"../../lib/templating\");\nvar _utils = require(\"../../lib/utils\");\nvar _defaultTemplates = _interopRequireDefault(require(\"./defaultTemplates\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'rating-menu'\n});\nvar suit = (0, _suit.component)('RatingMenu');\nvar _ref3 = (0, _preact.h)(\"path\", {\n  d: \"M12 .288l2.833 8.718h9.167l-7.417 5.389 2.833 8.718-7.416-5.388-7.417 5.388 2.833-8.718-7.416-5.389h9.167z\"\n});\nvar _ref4 = (0, _preact.h)(\"path\", {\n  d: \"M12 6.76l1.379 4.246h4.465l-3.612 2.625 1.379 4.246-3.611-2.625-3.612 2.625 1.379-4.246-3.612-2.625h4.465l1.38-4.246zm0-6.472l-2.833 8.718h-9.167l7.416 5.389-2.833 8.718 7.417-5.388 7.416 5.388-2.833-8.718 7.417-5.389h-9.167l-2.833-8.718z\"\n});\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    templates = _ref.templates,\n    renderState = _ref.renderState;\n  return function (_ref2, isFirstRendering) {\n    var refine = _ref2.refine,\n      items = _ref2.items,\n      createURL = _ref2.createURL,\n      instantSearchInstance = _ref2.instantSearchInstance;\n    if (isFirstRendering) {\n      renderState.templateProps = (0, _templating.prepareTemplateProps)({\n        defaultTemplates: _defaultTemplates.default,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    (0, _preact.render)((0, _preact.h)(_RefinementList.default, {\n      createURL: createURL,\n      cssClasses: cssClasses,\n      facetValues: items,\n      templateProps: renderState.templateProps,\n      toggleRefinement: refine\n    }, (0, _preact.h)(\"svg\", {\n      style: \"display:none;\"\n    }, (0, _preact.h)(\"symbol\", {\n      id: suit({\n        descendantName: 'starSymbol'\n      }),\n      viewBox: \"0 0 24 24\"\n    }, _ref3), (0, _preact.h)(\"symbol\", {\n      id: suit({\n        descendantName: 'starEmptySymbol'\n      }),\n      viewBox: \"0 0 24 24\"\n    }, _ref4))), containerNode);\n  };\n};\n\n/**\n * Rating menu is used for displaying grade like filters. The values are normalized within boundaries.\n *\n * The maximum value can be set (with `max`), the minimum is always 0.\n *\n * @requirements\n * The attribute passed to `attribute` must be declared as an\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\n * in your Algolia settings.\n *\n * The values inside this attribute must be JavaScript numbers (not strings).\n *\n * @type {WidgetFactory}\n * @devNovel RatingMenu\n * @category filter\n * @param {RatingMenuWidgetParams} widgetParams RatingMenu widget options.\n * @return {Widget} A new RatingMenu widget instance.\n * @example\n * search.addWidgets([\n *   instantsearch.widgets.ratingMenu({\n *     container: '#stars',\n *     attribute: 'rating',\n *     max: 5,\n *   })\n * ]);\n */\n\nvar ratingMenu = function ratingMenu(widgetParams) {\n  var _ref5 = widgetParams || {},\n    container = _ref5.container,\n    attribute = _ref5.attribute,\n    _ref5$max = _ref5.max,\n    max = _ref5$max === void 0 ? 5 : _ref5$max,\n    _ref5$cssClasses = _ref5.cssClasses,\n    userCssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses,\n    _ref5$templates = _ref5.templates,\n    templates = _ref5$templates === void 0 ? {} : _ref5$templates;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    noRefinementRoot: (0, _instantsearchUiComponents.cx)(suit({\n      modifierName: 'noRefinement'\n    }), userCssClasses.noRefinementRoot),\n    list: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'list'\n    }), userCssClasses.list),\n    item: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item'\n    }), userCssClasses.item),\n    selectedItem: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item',\n      modifierName: 'selected'\n    }), userCssClasses.selectedItem),\n    disabledItem: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item',\n      modifierName: 'disabled'\n    }), userCssClasses.disabledItem),\n    link: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'link'\n    }), userCssClasses.link),\n    starIcon: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'starIcon'\n    }), userCssClasses.starIcon),\n    fullStarIcon: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'starIcon',\n      modifierName: 'full'\n    }), userCssClasses.fullStarIcon),\n    emptyStarIcon: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'starIcon',\n      modifierName: 'empty'\n    }), userCssClasses.emptyStarIcon),\n    label: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'label'\n    }), userCssClasses.label),\n    count: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'count'\n    }), userCssClasses.count)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = (0, _connectRatingMenu.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attribute: attribute,\n    max: max\n  })), {}, {\n    $$widgetType: 'ais.ratingMenu'\n  });\n};\nvar _default = exports.default = ratingMenu;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/refinement-list/defaultTemplates.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _formatNumber = require(\"../../lib/formatNumber\");\nvar defaultTemplates = {\n  item: function item(_ref) {\n    var cssClasses = _ref.cssClasses,\n      count = _ref.count,\n      value = _ref.value,\n      highlighted = _ref.highlighted,\n      isRefined = _ref.isRefined,\n      isFromSearch = _ref.isFromSearch;\n    return (0, _preact.h)(\"label\", {\n      className: (0, _instantsearchUiComponents.cx)(cssClasses.label)\n    }, (0, _preact.h)(\"input\", {\n      type: \"checkbox\",\n      className: (0, _instantsearchUiComponents.cx)(cssClasses.checkbox),\n      value: value,\n      defaultChecked: isRefined\n    }), (0, _preact.h)(\"span\", {\n      className: (0, _instantsearchUiComponents.cx)(cssClasses.labelText),\n      dangerouslySetInnerHTML: isFromSearch ? {\n        __html: highlighted\n      } : undefined\n    }, !isFromSearch && highlighted), (0, _preact.h)(\"span\", {\n      className: (0, _instantsearchUiComponents.cx)(cssClasses.count)\n    }, (0, _formatNumber.formatNumber)(count)));\n  },\n  showMoreText: function showMoreText(_ref2) {\n    var isShowingMore = _ref2.isShowingMore;\n    return isShowingMore ? 'Show less' : 'Show more';\n  },\n  searchableNoResults: function searchableNoResults() {\n    return 'No results';\n  }\n};\nvar _default = exports.default = defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/refinement-list/refinement-list.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _RefinementList = _interopRequireDefault(require(\"../../components/RefinementList/RefinementList\"));\nvar _connectRefinementList = _interopRequireDefault(require(\"../../connectors/refinement-list/connectRefinementList\"));\nvar _suit = require(\"../../lib/suit\");\nvar _templating = require(\"../../lib/templating\");\nvar _utils = require(\"../../lib/utils\");\nvar _defaultTemplates = _interopRequireDefault(require(\"../search-box/defaultTemplates\"));\nvar _defaultTemplates2 = _interopRequireDefault(require(\"./defaultTemplates\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'refinement-list'\n});\nvar suit = (0, _suit.component)('RefinementList');\nvar searchBoxSuit = (0, _suit.component)('SearchBox');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    templates = _ref.templates,\n    searchBoxTemplates = _ref.searchBoxTemplates,\n    renderState = _ref.renderState,\n    showMore = _ref.showMore,\n    searchable = _ref.searchable,\n    searchablePlaceholder = _ref.searchablePlaceholder,\n    searchableIsAlwaysActive = _ref.searchableIsAlwaysActive;\n  return function (_ref2, isFirstRendering) {\n    var refine = _ref2.refine,\n      items = _ref2.items,\n      createURL = _ref2.createURL,\n      searchForItems = _ref2.searchForItems,\n      isFromSearch = _ref2.isFromSearch,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      toggleShowMore = _ref2.toggleShowMore,\n      isShowingMore = _ref2.isShowingMore,\n      hasExhaustiveItems = _ref2.hasExhaustiveItems,\n      canToggleShowMore = _ref2.canToggleShowMore;\n    if (isFirstRendering) {\n      renderState.templateProps = (0, _templating.prepareTemplateProps)({\n        defaultTemplates: _defaultTemplates2.default,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      renderState.searchBoxTemplateProps = (0, _templating.prepareTemplateProps)({\n        defaultTemplates: _defaultTemplates.default,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: searchBoxTemplates\n      });\n      return;\n    }\n    (0, _preact.render)((0, _preact.h)(_RefinementList.default, {\n      createURL: createURL,\n      cssClasses: cssClasses,\n      facetValues: items,\n      templateProps: renderState.templateProps,\n      searchBoxTemplateProps: renderState.searchBoxTemplateProps,\n      toggleRefinement: refine,\n      searchFacetValues: searchable ? searchForItems : undefined,\n      searchPlaceholder: searchablePlaceholder,\n      searchIsAlwaysActive: searchableIsAlwaysActive,\n      isFromSearch: isFromSearch,\n      showMore: showMore && !isFromSearch && items.length > 0,\n      toggleShowMore: toggleShowMore,\n      isShowingMore: isShowingMore,\n      hasExhaustiveItems: hasExhaustiveItems,\n      canToggleShowMore: canToggleShowMore\n    }), containerNode);\n  };\n};\n/**\n * The refinement list widget is one of the most common widget that you can find\n * in a search UI. With this widget, the user can filter the dataset based on facets.\n *\n * The refinement list displays only the most relevant facets for the current search\n * context. The sort option only affects the facet that are returned by the engine,\n * not which facets are returned.\n *\n * This widget also implements search for facet values, which is a mini search inside the\n * values of the facets. This makes easy to deal with uncommon facet values.\n *\n * @requirements\n *\n * The attribute passed to `attribute` must be declared as an\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\n * in your Algolia settings.\n *\n * If you also want to use search for facet values on this attribute, you need to make it searchable using the [dashboard](https://www.algolia.com/explorer/display/) or using the [API](https://www.algolia.com/doc/guides/searching/faceting/#search-for-facet-values).\n */\nvar refinementList = function refinementList(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    attribute = _ref3.attribute,\n    operator = _ref3.operator,\n    sortBy = _ref3.sortBy,\n    limit = _ref3.limit,\n    showMore = _ref3.showMore,\n    showMoreLimit = _ref3.showMoreLimit,\n    _ref3$searchable = _ref3.searchable,\n    searchable = _ref3$searchable === void 0 ? false : _ref3$searchable,\n    _ref3$searchablePlace = _ref3.searchablePlaceholder,\n    searchablePlaceholder = _ref3$searchablePlace === void 0 ? 'Search...' : _ref3$searchablePlace,\n    _ref3$searchableEscap = _ref3.searchableEscapeFacetValues,\n    searchableEscapeFacetValues = _ref3$searchableEscap === void 0 ? true : _ref3$searchableEscap,\n    _ref3$searchableIsAlw = _ref3.searchableIsAlwaysActive,\n    searchableIsAlwaysActive = _ref3$searchableIsAlw === void 0 ? true : _ref3$searchableIsAlw,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    transformItems = _ref3.transformItems;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var escapeFacetValues = searchable ? Boolean(searchableEscapeFacetValues) : false;\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    noRefinementRoot: (0, _instantsearchUiComponents.cx)(suit({\n      modifierName: 'noRefinement'\n    }), userCssClasses.noRefinementRoot),\n    list: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'list'\n    }), userCssClasses.list),\n    item: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item'\n    }), userCssClasses.item),\n    selectedItem: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'item',\n      modifierName: 'selected'\n    }), userCssClasses.selectedItem),\n    searchBox: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'searchBox'\n    }), userCssClasses.searchBox),\n    label: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'label'\n    }), userCssClasses.label),\n    checkbox: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'checkbox'\n    }), userCssClasses.checkbox),\n    labelText: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'labelText'\n    }), userCssClasses.labelText),\n    count: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'count'\n    }), userCssClasses.count),\n    noResults: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'noResults'\n    }), userCssClasses.noResults),\n    showMore: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'showMore'\n    }), userCssClasses.showMore),\n    disabledShowMore: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'showMore',\n      modifierName: 'disabled'\n    }), userCssClasses.disabledShowMore),\n    searchable: {\n      root: (0, _instantsearchUiComponents.cx)(searchBoxSuit(), userCssClasses.searchableRoot),\n      form: (0, _instantsearchUiComponents.cx)(searchBoxSuit({\n        descendantName: 'form'\n      }), userCssClasses.searchableForm),\n      input: (0, _instantsearchUiComponents.cx)(searchBoxSuit({\n        descendantName: 'input'\n      }), userCssClasses.searchableInput),\n      submit: (0, _instantsearchUiComponents.cx)(searchBoxSuit({\n        descendantName: 'submit'\n      }), userCssClasses.searchableSubmit),\n      submitIcon: (0, _instantsearchUiComponents.cx)(searchBoxSuit({\n        descendantName: 'submitIcon'\n      }), userCssClasses.searchableSubmitIcon),\n      reset: (0, _instantsearchUiComponents.cx)(searchBoxSuit({\n        descendantName: 'reset'\n      }), userCssClasses.searchableReset),\n      resetIcon: (0, _instantsearchUiComponents.cx)(searchBoxSuit({\n        descendantName: 'resetIcon'\n      }), userCssClasses.searchableResetIcon),\n      loadingIndicator: (0, _instantsearchUiComponents.cx)(searchBoxSuit({\n        descendantName: 'loadingIndicator'\n      }), userCssClasses.searchableLoadingIndicator),\n      loadingIcon: (0, _instantsearchUiComponents.cx)(searchBoxSuit({\n        descendantName: 'loadingIcon'\n      }), userCssClasses.searchableLoadingIcon)\n    }\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    templates: templates,\n    searchBoxTemplates: {\n      submit: templates.searchableSubmit,\n      reset: templates.searchableReset,\n      loadingIndicator: templates.searchableLoadingIndicator\n    },\n    renderState: {},\n    searchable: searchable,\n    searchablePlaceholder: searchablePlaceholder,\n    searchableIsAlwaysActive: searchableIsAlwaysActive,\n    showMore: showMore\n  });\n  var makeWidget = (0, _connectRefinementList.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attribute: attribute,\n    operator: operator,\n    limit: limit,\n    showMore: showMore,\n    showMoreLimit: showMoreLimit,\n    sortBy: sortBy,\n    escapeFacetValues: escapeFacetValues,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.refinementList'\n  });\n};\nvar _default = exports.default = refinementList;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/related-products/related-products.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _Template = _interopRequireDefault(require(\"../../components/Template/Template\"));\nvar _connectRelatedProducts = _interopRequireDefault(require(\"../../connectors/related-products/connectRelatedProducts\"));\nvar _templating = require(\"../../lib/templating\");\nvar _utils = require(\"../../lib/utils\");\nvar _excluded = [\"item\", \"sendEvent\"];\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'related-products'\n});\nvar RelatedProducts = (0, _instantsearchUiComponents.createRelatedProductsComponent)({\n  createElement: _preact.h,\n  Fragment: _preact.Fragment\n});\nfunction createRenderer(_ref) {\n  var renderState = _ref.renderState,\n    cssClasses = _ref.cssClasses,\n    containerNode = _ref.containerNode,\n    templates = _ref.templates;\n  return function renderer(_ref2, isFirstRendering) {\n    var items = _ref2.items,\n      results = _ref2.results,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      sendEvent = _ref2.sendEvent;\n    if (isFirstRendering) {\n      renderState.templateProps = (0, _templating.prepareTemplateProps)({\n        defaultTemplates: {},\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    var headerComponent = templates.header ? function (data) {\n      return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n        templateKey: \"header\",\n        rootTagName: \"fragment\",\n        data: {\n          cssClasses: data.classNames,\n          items: data.items\n        }\n      }));\n    } : undefined;\n    var itemComponent = templates.item ? function (_ref3) {\n      var item = _ref3.item,\n        _sendEvent = _ref3.sendEvent,\n        rootProps = _objectWithoutProperties(_ref3, _excluded);\n      return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n        templateKey: \"item\",\n        rootTagName: \"fragment\",\n        data: item,\n        sendEvent: _sendEvent,\n        rootProps: _objectSpread({}, rootProps)\n      }));\n    } : undefined;\n    var emptyComponent = templates.empty ? function () {\n      return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n        templateKey: \"empty\",\n        rootTagName: \"fragment\",\n        data: results\n      }));\n    } : undefined;\n    var layoutComponent = templates.layout ? function (data) {\n      return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n        templateKey: \"layout\",\n        rootTagName: \"fragment\",\n        data: {\n          sendEvent: sendEvent,\n          items: data.items,\n          templates: {\n            item: templates.item ? function (_ref4) {\n              var item = _ref4.item;\n              return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n                templateKey: \"item\",\n                rootTagName: \"fragment\",\n                data: item,\n                sendEvent: sendEvent\n              }));\n            } : undefined\n          },\n          cssClasses: {\n            list: data.classNames.list,\n            item: data.classNames.item\n          }\n        },\n        sendEvent: sendEvent\n      }));\n    } : undefined;\n    (0, _preact.render)((0, _preact.h)(RelatedProducts, {\n      items: items,\n      sendEvent: sendEvent,\n      classNames: cssClasses,\n      headerComponent: headerComponent,\n      itemComponent: itemComponent,\n      emptyComponent: emptyComponent,\n      layout: layoutComponent,\n      status: instantSearchInstance.status\n    }), containerNode);\n  };\n}\nvar relatedProducts = exports.default = function relatedProducts(widgetParams) {\n  var _ref5 = widgetParams || {},\n    container = _ref5.container,\n    objectIDs = _ref5.objectIDs,\n    limit = _ref5.limit,\n    queryParameters = _ref5.queryParameters,\n    fallbackParameters = _ref5.fallbackParameters,\n    threshold = _ref5.threshold,\n    escapeHTML = _ref5.escapeHTML,\n    transformItems = _ref5.transformItems,\n    _ref5$templates = _ref5.templates,\n    templates = _ref5$templates === void 0 ? {} : _ref5$templates,\n    _ref5$cssClasses = _ref5.cssClasses,\n    cssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var specializedRenderer = createRenderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = (0, _connectRelatedProducts.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    objectIDs: objectIDs,\n    limit: limit,\n    queryParameters: queryParameters,\n    fallbackParameters: fallbackParameters,\n    threshold: threshold,\n    escapeHTML: escapeHTML,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.relatedProducts'\n  });\n};"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/relevant-sort/defaultTemplates.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar defaultTemplates = {\n  text: function text() {\n    return '';\n  },\n  button: function button(_ref) {\n    var isRelevantSorted = _ref.isRelevantSorted;\n    return isRelevantSorted ? 'See all results' : 'See relevant results';\n  }\n};\nvar _default = exports.default = defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/relevant-sort/relevant-sort.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _RelevantSort = _interopRequireDefault(require(\"../../components/RelevantSort/RelevantSort\"));\nvar _connectRelevantSort = _interopRequireDefault(require(\"../../connectors/relevant-sort/connectRelevantSort\"));\nvar _suit = require(\"../../lib/suit\");\nvar _utils = require(\"../../lib/utils\");\nvar _defaultTemplates = _interopRequireDefault(require(\"./defaultTemplates\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'relevant-sort'\n});\nvar suit = (0, _suit.component)('RelevantSort');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    templates = _ref.templates;\n  return function (_ref2) {\n    var isRelevantSorted = _ref2.isRelevantSorted,\n      isVirtualReplica = _ref2.isVirtualReplica,\n      refine = _ref2.refine;\n    (0, _preact.render)((0, _preact.h)(_RelevantSort.default, {\n      cssClasses: cssClasses,\n      templates: templates,\n      isRelevantSorted: isRelevantSorted,\n      isVirtualReplica: isVirtualReplica,\n      refine: refine\n    }), containerNode);\n  };\n};\nvar relevantSort = function relevantSort(widgetParams) {\n  var container = widgetParams.container,\n    _widgetParams$templat = widgetParams.templates,\n    userTemplates = _widgetParams$templat === void 0 ? {} : _widgetParams$templat,\n    _widgetParams$cssClas = widgetParams.cssClasses,\n    userCssClasses = _widgetParams$cssClas === void 0 ? {} : _widgetParams$cssClas;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    text: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'text'\n    }), userCssClasses.text),\n    button: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'button'\n    }), userCssClasses.button)\n  };\n  var templates = _objectSpread(_objectSpread({}, _defaultTemplates.default), userTemplates);\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = (0, _connectRelevantSort.default)(specializedRenderer, function () {\n    (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({})), {}, {\n    $$widgetType: 'ais.relevantSort'\n  });\n};\nvar _default = exports.default = relevantSort;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/search-box/defaultTemplates.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _preact = require(\"preact\");\nvar _ref2 = (0, _preact.h)(\"path\", {\n  d: \"M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z\"\n});\nvar _ref4 = (0, _preact.h)(\"path\", {\n  d: \"M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z\"\n});\nvar _ref6 = (0, _preact.h)(\"g\", {\n  fill: \"none\",\n  \"fill-rule\": \"evenodd\"\n}, (0, _preact.h)(\"g\", {\n  transform: \"translate(1 1)\",\n  \"stroke-width\": \"2\"\n}, (0, _preact.h)(\"circle\", {\n  \"stroke-opacity\": \".5\",\n  cx: \"18\",\n  cy: \"18\",\n  r: \"18\"\n}), (0, _preact.h)(\"path\", {\n  d: \"M36 18c0-9.94-8.06-18-18-18\"\n}, (0, _preact.h)(\"animateTransform\", {\n  attributeName: \"transform\",\n  type: \"rotate\",\n  from: \"0 18 18\",\n  to: \"360 18 18\",\n  dur: \"1s\",\n  repeatCount: \"indefinite\"\n}))));\nvar defaultTemplate = {\n  reset: function reset(_ref) {\n    var cssClasses = _ref.cssClasses;\n    return (0, _preact.h)(\"svg\", {\n      className: cssClasses.resetIcon,\n      viewBox: \"0 0 20 20\",\n      width: \"10\",\n      height: \"10\",\n      \"aria-hidden\": \"true\"\n    }, _ref2);\n  },\n  submit: function submit(_ref3) {\n    var cssClasses = _ref3.cssClasses;\n    return (0, _preact.h)(\"svg\", {\n      className: cssClasses.submitIcon,\n      width: \"10\",\n      height: \"10\",\n      viewBox: \"0 0 40 40\",\n      \"aria-hidden\": \"true\"\n    }, _ref4);\n  },\n  loadingIndicator: function loadingIndicator(_ref5) {\n    var cssClasses = _ref5.cssClasses;\n    /* eslint-disable react/no-unknown-property */\n    // Preact supports kebab case attributes, and using camel case would\n    // require using `preact/compat`.\n    // @TODO: reconsider using the `react` ESLint preset\n    return (0, _preact.h)(\"svg\", {\n      \"aria-label\": \"Results are loading\",\n      className: cssClasses.loadingIcon,\n      width: \"16\",\n      height: \"16\",\n      viewBox: \"0 0 38 38\",\n      stroke: \"#444\",\n      \"aria-hidden\": \"true\"\n    }, _ref6);\n    /* eslint-enable react/no-unknown-property */\n  }\n};\nvar _default = exports.default = defaultTemplate;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/search-box/search-box.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _SearchBox = _interopRequireDefault(require(\"../../components/SearchBox/SearchBox\"));\nvar _connectSearchBox = _interopRequireDefault(require(\"../../connectors/search-box/connectSearchBox\"));\nvar _suit = require(\"../../lib/suit\");\nvar _utils = require(\"../../lib/utils\");\nvar _defaultTemplates = _interopRequireDefault(require(\"./defaultTemplates\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'search-box'\n});\nvar suit = (0, _suit.component)('SearchBox');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    placeholder = _ref.placeholder,\n    templates = _ref.templates,\n    autofocus = _ref.autofocus,\n    searchAsYouType = _ref.searchAsYouType,\n    ignoreCompositionEvents = _ref.ignoreCompositionEvents,\n    showReset = _ref.showReset,\n    showSubmit = _ref.showSubmit,\n    showLoadingIndicator = _ref.showLoadingIndicator;\n  return function (_ref2) {\n    var refine = _ref2.refine,\n      query = _ref2.query,\n      isSearchStalled = _ref2.isSearchStalled;\n    (0, _preact.render)((0, _preact.h)(_SearchBox.default, {\n      query: query,\n      placeholder: placeholder,\n      autofocus: autofocus,\n      refine: refine,\n      searchAsYouType: searchAsYouType,\n      ignoreCompositionEvents: ignoreCompositionEvents,\n      templates: templates,\n      showSubmit: showSubmit,\n      showReset: showReset,\n      showLoadingIndicator: showLoadingIndicator,\n      isSearchStalled: isSearchStalled,\n      cssClasses: cssClasses\n    }), containerNode);\n  };\n};\n\n/**\n * The searchbox widget is used to let the user set a text based query.\n *\n * This is usually the  main entry point to start the search in an instantsearch context. For that\n * reason is usually placed on top, and not hidden so that the user can start searching right\n * away.\n *\n */\n\nvar searchBox = function searchBox(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    _ref3$placeholder = _ref3.placeholder,\n    placeholder = _ref3$placeholder === void 0 ? '' : _ref3$placeholder,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    _ref3$autofocus = _ref3.autofocus,\n    autofocus = _ref3$autofocus === void 0 ? false : _ref3$autofocus,\n    _ref3$searchAsYouType = _ref3.searchAsYouType,\n    searchAsYouType = _ref3$searchAsYouType === void 0 ? true : _ref3$searchAsYouType,\n    _ref3$ignoreCompositi = _ref3.ignoreCompositionEvents,\n    ignoreCompositionEvents = _ref3$ignoreCompositi === void 0 ? false : _ref3$ignoreCompositi,\n    _ref3$showReset = _ref3.showReset,\n    showReset = _ref3$showReset === void 0 ? true : _ref3$showReset,\n    _ref3$showSubmit = _ref3.showSubmit,\n    showSubmit = _ref3$showSubmit === void 0 ? true : _ref3$showSubmit,\n    _ref3$showLoadingIndi = _ref3.showLoadingIndicator,\n    showLoadingIndicator = _ref3$showLoadingIndi === void 0 ? true : _ref3$showLoadingIndi,\n    queryHook = _ref3.queryHook,\n    _ref3$templates = _ref3.templates,\n    userTemplates = _ref3$templates === void 0 ? {} : _ref3$templates;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    form: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'form'\n    }), userCssClasses.form),\n    input: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'input'\n    }), userCssClasses.input),\n    submit: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'submit'\n    }), userCssClasses.submit),\n    submitIcon: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'submitIcon'\n    }), userCssClasses.submitIcon),\n    reset: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'reset'\n    }), userCssClasses.reset),\n    resetIcon: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'resetIcon'\n    }), userCssClasses.resetIcon),\n    loadingIndicator: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'loadingIndicator'\n    }), userCssClasses.loadingIndicator),\n    loadingIcon: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'loadingIcon'\n    }), userCssClasses.loadingIcon)\n  };\n  var templates = _objectSpread(_objectSpread({}, _defaultTemplates.default), userTemplates);\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    placeholder: placeholder,\n    templates: templates,\n    autofocus: autofocus,\n    searchAsYouType: searchAsYouType,\n    ignoreCompositionEvents: ignoreCompositionEvents,\n    showReset: showReset,\n    showSubmit: showSubmit,\n    showLoadingIndicator: showLoadingIndicator\n  });\n  var makeWidget = (0, _connectSearchBox.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    queryHook: queryHook\n  })), {}, {\n    $$widgetType: 'ais.searchBox'\n  });\n};\nvar _default = exports.default = searchBox;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/sort-by/sort-by.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _Selector = _interopRequireDefault(require(\"../../components/Selector/Selector\"));\nvar _connectSortBy = _interopRequireDefault(require(\"../../connectors/sort-by/connectSortBy\"));\nvar _suit = require(\"../../lib/suit\");\nvar _utils = require(\"../../lib/utils\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'sort-by'\n});\nvar suit = (0, _suit.component)('SortBy');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses;\n  return function (_ref2, isFirstRendering) {\n    var currentRefinement = _ref2.currentRefinement,\n      options = _ref2.options,\n      refine = _ref2.refine;\n    if (isFirstRendering) {\n      return;\n    }\n    (0, _preact.render)((0, _preact.h)(\"div\", {\n      className: cssClasses.root\n    }, (0, _preact.h)(_Selector.default, {\n      cssClasses: cssClasses,\n      currentValue: currentRefinement,\n      options: options,\n      setValue: refine,\n      ariaLabel: \"Sort results by\"\n    })), containerNode);\n  };\n};\n\n/**\n * Sort by selector is a widget used for letting the user choose between different\n * indices that contains the same data with a different order / ranking formula.\n */\nvar sortBy = function sortBy(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    items = _ref3.items,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    transformItems = _ref3.transformItems;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    select: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'select'\n    }), userCssClasses.select),\n    option: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'option'\n    }), userCssClasses.option)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses\n  });\n  var makeWidget = (0, _connectSortBy.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    container: containerNode,\n    items: items,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.sortBy'\n  });\n};\nvar _default = exports.default = sortBy;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/stats/defaultTemplates.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nObject.defineProperty(exports, \"default\", {\n  enumerable: true,\n  get: function get() {\n    return _stats.defaultTemplates;\n  }\n});\nvar _stats = require(\"./stats\");"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/stats/stats.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.defaultTemplates = exports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _Stats = _interopRequireDefault(require(\"../../components/Stats/Stats\"));\nvar _connectStats = _interopRequireDefault(require(\"../../connectors/stats/connectStats\"));\nvar _formatNumber = require(\"../../lib/formatNumber\");\nvar _suit = require(\"../../lib/suit\");\nvar _templating = require(\"../../lib/templating\");\nvar _utils = require(\"../../lib/utils\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'stats'\n});\nvar suit = (0, _suit.component)('Stats');\nvar defaultTemplates = exports.defaultTemplates = {\n  text: function text(props) {\n    return \"\".concat(props.areHitsSorted ? getSortedResultsSentence(props) : getResultsSentence(props), \" found in \").concat(props.processingTimeMS, \"ms\");\n  }\n};\nfunction getSortedResultsSentence(_ref) {\n  var nbHits = _ref.nbHits,\n    hasNoSortedResults = _ref.hasNoSortedResults,\n    hasOneSortedResults = _ref.hasOneSortedResults,\n    hasManySortedResults = _ref.hasManySortedResults,\n    nbSortedHits = _ref.nbSortedHits;\n  var suffix = \"sorted out of \".concat((0, _formatNumber.formatNumber)(nbHits));\n  if (hasNoSortedResults) {\n    return \"No relevant results \".concat(suffix);\n  }\n  if (hasOneSortedResults) {\n    return \"1 relevant result \".concat(suffix);\n  }\n  if (hasManySortedResults) {\n    return \"\".concat((0, _formatNumber.formatNumber)(nbSortedHits || 0), \" relevant results \").concat(suffix);\n  }\n  return '';\n}\nfunction getResultsSentence(_ref2) {\n  var nbHits = _ref2.nbHits,\n    hasNoResults = _ref2.hasNoResults,\n    hasOneResult = _ref2.hasOneResult,\n    hasManyResults = _ref2.hasManyResults;\n  if (hasNoResults) {\n    return 'No results';\n  }\n  if (hasOneResult) {\n    return '1 result';\n  }\n  if (hasManyResults) {\n    return \"\".concat((0, _formatNumber.formatNumber)(nbHits), \" results\");\n  }\n  return '';\n}\nvar renderer = function renderer(_ref3) {\n  var renderState = _ref3.renderState,\n    cssClasses = _ref3.cssClasses,\n    containerNode = _ref3.containerNode,\n    templates = _ref3.templates;\n  return function (_ref4, isFirstRendering) {\n    var hitsPerPage = _ref4.hitsPerPage,\n      nbHits = _ref4.nbHits,\n      nbSortedHits = _ref4.nbSortedHits,\n      areHitsSorted = _ref4.areHitsSorted,\n      nbPages = _ref4.nbPages,\n      page = _ref4.page,\n      processingTimeMS = _ref4.processingTimeMS,\n      query = _ref4.query,\n      instantSearchInstance = _ref4.instantSearchInstance;\n    if (isFirstRendering) {\n      renderState.templateProps = (0, _templating.prepareTemplateProps)({\n        defaultTemplates: defaultTemplates,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    (0, _preact.render)((0, _preact.h)(_Stats.default, {\n      cssClasses: cssClasses,\n      hitsPerPage: hitsPerPage,\n      nbHits: nbHits,\n      nbSortedHits: nbSortedHits,\n      areHitsSorted: areHitsSorted,\n      nbPages: nbPages,\n      page: page,\n      processingTimeMS: processingTimeMS,\n      query: query,\n      templateProps: renderState.templateProps\n    }), containerNode);\n  };\n};\n\n/**\n * The `stats` widget is used to display useful insights about the current results.\n *\n * By default, it will display the **number of hits** and the time taken to compute the\n * results inside the engine.\n */\nvar stats = function stats(widgetParams) {\n  var _ref5 = widgetParams || {},\n    container = _ref5.container,\n    _ref5$cssClasses = _ref5.cssClasses,\n    userCssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses,\n    _ref5$templates = _ref5.templates,\n    templates = _ref5$templates === void 0 ? {} : _ref5$templates;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    text: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'text'\n    }), userCssClasses.text)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    templates: templates,\n    renderState: {}\n  });\n  var makeWidget = (0, _connectStats.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({})), {}, {\n    $$widgetType: 'ais.stats'\n  });\n};\nvar _default = exports.default = stats;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/toggle-refinement/defaultTemplates.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar defaultTemplates = {\n  labelText: function labelText(_ref) {\n    var name = _ref.name;\n    return name;\n  }\n};\nvar _default = exports.default = defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/toggle-refinement/toggle-refinement.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _ToggleRefinement = _interopRequireDefault(require(\"../../components/ToggleRefinement/ToggleRefinement\"));\nvar _connectToggleRefinement = _interopRequireDefault(require(\"../../connectors/toggle-refinement/connectToggleRefinement\"));\nvar _suit = require(\"../../lib/suit\");\nvar _templating = require(\"../../lib/templating\");\nvar _utils = require(\"../../lib/utils\");\nvar _defaultTemplates = _interopRequireDefault(require(\"./defaultTemplates\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'toggle-refinement'\n});\nvar suit = (0, _suit.component)('ToggleRefinement');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    renderState = _ref.renderState,\n    templates = _ref.templates;\n  return function (_ref2, isFirstRendering) {\n    var value = _ref2.value,\n      refine = _ref2.refine,\n      instantSearchInstance = _ref2.instantSearchInstance;\n    if (isFirstRendering) {\n      renderState.templateProps = (0, _templating.prepareTemplateProps)({\n        defaultTemplates: _defaultTemplates.default,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    (0, _preact.render)((0, _preact.h)(_ToggleRefinement.default, {\n      cssClasses: cssClasses,\n      currentRefinement: value,\n      templateProps: renderState.templateProps,\n      refine: refine\n    }), containerNode);\n  };\n};\n/**\n * The toggleRefinement widget lets the user either:\n *  - switch between two values for a single facetted attribute (free_shipping / not_free_shipping)\n *  - toggleRefinement a faceted value on and off (only 'canon' for brands)\n *\n * This widget is particularly useful if you have a boolean value in the records.\n *\n * @requirements\n * The attribute passed to `attribute` must be declared as an\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\n * in your Algolia settings.\n */\nvar toggleRefinement = function toggleRefinement(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    attribute = _ref3.attribute,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    _ref3$on = _ref3.on,\n    on = _ref3$on === void 0 ? true : _ref3$on,\n    off = _ref3.off;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    label: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'label'\n    }), userCssClasses.label),\n    checkbox: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'checkbox'\n    }), userCssClasses.checkbox),\n    labelText: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'labelText'\n    }), userCssClasses.labelText)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = (0, _connectToggleRefinement.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attribute: attribute,\n    on: on,\n    off: off\n  })), {}, {\n    $$widgetType: 'ais.toggleRefinement'\n  });\n};\nvar _default = exports.default = toggleRefinement;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/trending-items/trending-items.js",
    "content": "\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _Template = _interopRequireDefault(require(\"../../components/Template/Template\"));\nvar _connectTrendingItems = _interopRequireDefault(require(\"../../connectors/trending-items/connectTrendingItems\"));\nvar _templating = require(\"../../lib/templating\");\nvar _utils = require(\"../../lib/utils\");\nvar _excluded = [\"item\", \"sendEvent\"];\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'trending-items'\n});\nvar TrendingItems = (0, _instantsearchUiComponents.createTrendingItemsComponent)({\n  createElement: _preact.h,\n  Fragment: _preact.Fragment\n});\nfunction createRenderer(_ref) {\n  var renderState = _ref.renderState,\n    cssClasses = _ref.cssClasses,\n    containerNode = _ref.containerNode,\n    templates = _ref.templates;\n  return function renderer(_ref2, isFirstRendering) {\n    var items = _ref2.items,\n      results = _ref2.results,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      sendEvent = _ref2.sendEvent;\n    if (isFirstRendering) {\n      renderState.templateProps = (0, _templating.prepareTemplateProps)({\n        defaultTemplates: {},\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    var headerComponent = templates.header ? function (data) {\n      return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n        templateKey: \"header\",\n        rootTagName: \"fragment\",\n        data: {\n          cssClasses: data.classNames,\n          items: data.items\n        }\n      }));\n    } : undefined;\n    var itemComponent = templates.item ? function (_ref3) {\n      var item = _ref3.item,\n        _sendEvent = _ref3.sendEvent,\n        rootProps = _objectWithoutProperties(_ref3, _excluded);\n      return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n        templateKey: \"item\",\n        rootTagName: \"fragment\",\n        data: item,\n        sendEvent: _sendEvent,\n        rootProps: _objectSpread({}, rootProps)\n      }));\n    } : undefined;\n    var emptyComponent = templates.empty ? function () {\n      return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n        templateKey: \"empty\",\n        rootTagName: \"fragment\",\n        data: results\n      }));\n    } : undefined;\n    var layoutComponent = templates.layout ? function (data) {\n      return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n        templateKey: \"layout\",\n        rootTagName: \"fragment\",\n        data: {\n          sendEvent: sendEvent,\n          items: data.items,\n          templates: {\n            item: templates.item ? function (_ref4) {\n              var item = _ref4.item;\n              return (0, _preact.h)(_Template.default, _extends({}, renderState.templateProps, {\n                templateKey: \"item\",\n                rootTagName: \"fragment\",\n                data: item,\n                sendEvent: sendEvent\n              }));\n            } : undefined\n          },\n          cssClasses: {\n            list: data.classNames.list,\n            item: data.classNames.item\n          }\n        },\n        sendEvent: sendEvent\n      }));\n    } : undefined;\n    (0, _preact.render)((0, _preact.h)(TrendingItems, {\n      items: items,\n      sendEvent: sendEvent,\n      classNames: cssClasses,\n      headerComponent: headerComponent,\n      itemComponent: itemComponent,\n      emptyComponent: emptyComponent,\n      layout: layoutComponent,\n      status: instantSearchInstance.status\n    }), containerNode);\n  };\n}\nvar trendingItems = exports.default = function trendingItems(widgetParams) {\n  var _ref5 = widgetParams || {},\n    container = _ref5.container,\n    facetName = _ref5.facetName,\n    facetValue = _ref5.facetValue,\n    limit = _ref5.limit,\n    queryParameters = _ref5.queryParameters,\n    fallbackParameters = _ref5.fallbackParameters,\n    threshold = _ref5.threshold,\n    escapeHTML = _ref5.escapeHTML,\n    transformItems = _ref5.transformItems,\n    _ref5$templates = _ref5.templates,\n    templates = _ref5$templates === void 0 ? {} : _ref5$templates,\n    _ref5$cssClasses = _ref5.cssClasses,\n    cssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var specializedRenderer = createRenderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = (0, _connectTrendingItems.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  var facetParameters = facetName && facetValue ? {\n    facetName: facetName,\n    facetValue: facetValue\n  } : {};\n  return _objectSpread(_objectSpread({}, makeWidget(_objectSpread(_objectSpread({}, facetParameters), {}, {\n    limit: limit,\n    queryParameters: queryParameters,\n    fallbackParameters: fallbackParameters,\n    threshold: threshold,\n    escapeHTML: escapeHTML,\n    transformItems: transformItems\n  }))), {}, {\n    $$widgetType: 'ais.trendingItems'\n  });\n};"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/voice-search/defaultTemplates.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _preact = require(\"preact\");\nvar _ref2 = (0, _preact.h)(_preact.Fragment, null, (0, _preact.h)(\"line\", {\n  x1: \"1\",\n  y1: \"1\",\n  x2: \"23\",\n  y2: \"23\"\n}), (0, _preact.h)(\"path\", {\n  d: \"M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6\"\n}), (0, _preact.h)(\"path\", {\n  d: \"M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23\"\n}), (0, _preact.h)(\"line\", {\n  x1: \"12\",\n  y1: \"19\",\n  x2: \"12\",\n  y2: \"23\"\n}), (0, _preact.h)(\"line\", {\n  x1: \"8\",\n  y1: \"23\",\n  x2: \"16\",\n  y2: \"23\"\n}));\nvar _ref3 = (0, _preact.h)(\"path\", {\n  d: \"M19 10v2a7 7 0 0 1-14 0v-2\"\n});\nvar _ref4 = (0, _preact.h)(\"line\", {\n  x1: \"12\",\n  y1: \"19\",\n  x2: \"12\",\n  y2: \"23\"\n});\nvar _ref5 = (0, _preact.h)(\"line\", {\n  x1: \"8\",\n  y1: \"23\",\n  x2: \"16\",\n  y2: \"23\"\n});\nvar ButtonInnerElement = function ButtonInnerElement(_ref) {\n  var status = _ref.status,\n    errorCode = _ref.errorCode,\n    isListening = _ref.isListening;\n  if (status === 'error' && errorCode === 'not-allowed') {\n    return _ref2;\n  }\n  return (0, _preact.h)(_preact.Fragment, null, (0, _preact.h)(\"path\", {\n    d: \"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z\",\n    fill: isListening ? 'currentColor' : 'none'\n  }), _ref3, _ref4, _ref5);\n};\nvar defaultTemplates = {\n  buttonText: function buttonText(_ref6) {\n    var status = _ref6.status,\n      errorCode = _ref6.errorCode,\n      isListening = _ref6.isListening;\n    return (0, _preact.h)(\"svg\", {\n      width: \"16\",\n      height: \"16\",\n      viewBox: \"0 0 24 24\",\n      fill: \"none\",\n      stroke: \"currentColor\"\n      /* eslint-disable react/no-unknown-property */\n      // Preact supports kebab case attributes, and using camel case would\n      // require using `preact/compat`.\n      // @TODO: reconsider using the `react` ESLint preset\n      ,\n      \"stroke-width\": \"2\",\n      \"stroke-linecap\": \"round\",\n      \"stroke-linejoin\": \"round\"\n      /* eslint-enable react/no-unknown-property */\n    }, (0, _preact.h)(ButtonInnerElement, {\n      status: status,\n      errorCode: errorCode,\n      isListening: isListening\n    }));\n  },\n  status: function status(_ref7) {\n    var transcript = _ref7.transcript;\n    return (0, _preact.h)(\"p\", null, transcript);\n  }\n};\nvar _default = exports.default = defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/cjs/widgets/voice-search/voice-search.js",
    "content": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _instantsearchUiComponents = require(\"instantsearch-ui-components\");\nvar _preact = require(\"preact\");\nvar _VoiceSearch = _interopRequireDefault(require(\"../../components/VoiceSearch/VoiceSearch\"));\nvar _connectVoiceSearch = _interopRequireDefault(require(\"../../connectors/voice-search/connectVoiceSearch\"));\nvar _suit = require(\"../../lib/suit\");\nvar _utils = require(\"../../lib/utils\");\nvar _defaultTemplates = _interopRequireDefault(require(\"./defaultTemplates\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar withUsage = (0, _utils.createDocumentationMessageGenerator)({\n  name: 'voice-search'\n});\nvar suit = (0, _suit.component)('VoiceSearch');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    templates = _ref.templates;\n  return function (_ref2) {\n    var isBrowserSupported = _ref2.isBrowserSupported,\n      isListening = _ref2.isListening,\n      toggleListening = _ref2.toggleListening,\n      voiceListeningState = _ref2.voiceListeningState;\n    (0, _preact.render)((0, _preact.h)(_VoiceSearch.default, {\n      cssClasses: cssClasses,\n      templates: templates,\n      isBrowserSupported: isBrowserSupported,\n      isListening: isListening,\n      toggleListening: toggleListening,\n      voiceListeningState: voiceListeningState\n    }), containerNode);\n  };\n};\nvar voiceSearch = function voiceSearch(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    _ref3$templates = _ref3.templates,\n    userTemplates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    _ref3$searchAsYouSpea = _ref3.searchAsYouSpeak,\n    searchAsYouSpeak = _ref3$searchAsYouSpea === void 0 ? false : _ref3$searchAsYouSpea,\n    language = _ref3.language,\n    additionalQueryParameters = _ref3.additionalQueryParameters,\n    createVoiceSearchHelper = _ref3.createVoiceSearchHelper;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = (0, _utils.getContainerNode)(container);\n  var cssClasses = {\n    root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),\n    button: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'button'\n    }), userCssClasses.button),\n    status: (0, _instantsearchUiComponents.cx)(suit({\n      descendantName: 'status'\n    }), userCssClasses.status)\n  };\n  var templates = _objectSpread(_objectSpread({}, _defaultTemplates.default), userTemplates);\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    templates: templates\n  });\n  var makeWidget = (0, _connectVoiceSearch.default)(specializedRenderer, function () {\n    return (0, _preact.render)(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    container: containerNode,\n    cssClasses: cssClasses,\n    templates: templates,\n    searchAsYouSpeak: searchAsYouSpeak,\n    language: language,\n    additionalQueryParameters: additionalQueryParameters,\n    createVoiceSearchHelper: createVoiceSearchHelper\n  })), {}, {\n    $$widgetType: 'ais.voiceSearch'\n  });\n};\nvar _default = exports.default = voiceSearch;"
  },
  {
    "path": "js/instantsearch.js/dist/instantsearch.development.d.ts",
    "content": "import { AlgoliaSearchHelper } from 'algoliasearch-helper';\r\nimport { Banner } from 'algoliasearch-helper';\r\nimport type { CarouselProps } from 'instantsearch-ui-components';\r\nimport { CompositionClient } from 'algoliasearch-helper/types/algoliasearch.js';\r\nimport EventEmitter from '@algolia/events';\r\nimport { FindAnswersOptions } from 'algoliasearch-helper/types/algoliasearch.js';\r\nimport type { FrequentlyBoughtTogetherProps } from 'instantsearch-ui-components';\r\nimport { h } from 'preact';\r\nimport type { HighlightClassNames as HighlightClassNames_2 } from 'instantsearch-ui-components';\r\nimport type { HighlightProps as HighlightProps_3 } from 'instantsearch-ui-components';\r\nimport type { HitsClassNames } from 'instantsearch-ui-components';\r\nimport type { HoganOptions } from 'hogan.js';\r\nimport { html } from 'htm/preact';\r\nimport type { InsightsClient as InsightsClient_2 } from 'search-insights';\r\nimport type { InsightsMethodMap as InsightsMethodMap_2 } from 'search-insights';\r\nimport type { LookingSimilarProps } from 'instantsearch-ui-components';\r\nimport type * as Places from 'places.js';\r\nimport { PlainSearchParameters } from 'algoliasearch-helper';\r\nimport { default as qs_2 } from 'qs';\r\nimport type { RecommendClassNames } from 'instantsearch-ui-components';\r\nimport { RecommendParameters } from 'algoliasearch-helper';\r\nimport type { RecommendParametersOptions } from 'algoliasearch-helper';\r\nimport { RecommendResponse } from 'algoliasearch-helper/types/algoliasearch.js';\r\nimport type { RecommendResults } from 'algoliasearch-helper';\r\nimport type { RelatedProductsProps } from 'instantsearch-ui-components';\r\nimport { SearchClient } from 'algoliasearch-helper/types/algoliasearch.js';\r\nimport { SearchOptions } from 'algoliasearch-helper/types/algoliasearch.js';\r\nimport { SearchParameters } from 'algoliasearch-helper';\r\nimport { SearchResults } from 'algoliasearch-helper';\r\nimport type { TrendingItemsProps } from 'instantsearch-ui-components';\r\nimport { VNode } from 'preact';\r\nimport type { VNode as VNode_2 } from 'instantsearch-ui-components';\r\n\r\ndeclare type AlgoliaHit<THit extends NonNullable<object> = Record<string, any>> = {\r\n    objectID: string;\r\n    _highlightResult?: HitHighlightResult;\r\n    _snippetResult?: HitSnippetResult;\r\n    _rankingInfo?: {\r\n        promoted: boolean;\r\n        nbTypos: number;\r\n        firstMatchedWord: number;\r\n        proximityDistance?: number;\r\n        geoDistance: number;\r\n        geoPrecision?: number;\r\n        nbExactWords: number;\r\n        words: number;\r\n        filters: number;\r\n        userScore: number;\r\n        matchedGeoLocation?: {\r\n            lat: number;\r\n            lng: number;\r\n            distance: number;\r\n        };\r\n    };\r\n    _distinctSeqID?: number;\r\n    _geoloc?: GeoLoc;\r\n} & THit;\r\n\r\ndeclare const analytics: AnalyticsWidget;\r\n\r\ndeclare type AnalyticsWidget = WidgetFactory<AnalyticsWidgetDescription, AnalyticsWidgetParams, AnalyticsWidgetParams>;\r\n\r\ndeclare type AnalyticsWidgetDescription = {\r\n    $$type: 'ais.analytics';\r\n    $$widgetType: 'ais.analytics';\r\n    renderState: Record<string, unknown>;\r\n    indexRenderState: {\r\n        analytics: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams>;\r\n    };\r\n};\r\n\r\ndeclare type AnalyticsWidgetParams = {\r\n    /**\r\n     * A function that is called every time the query or refinements changes. You\r\n     * need to add the logic to push the data to your analytics platform.\r\n     */\r\n    pushFunction: AnalyticsWidgetParamsPushFunction;\r\n    /**\r\n     * The number of milliseconds between the last search keystroke and calling `pushFunction`.\r\n     *\r\n     * @default 3000\r\n     */\r\n    delay?: number;\r\n    /**\r\n     * Triggers `pushFunction` after click on page or redirecting the page. This is useful if\r\n     * you want the pushFunction to be called for the last actions before the user leaves the\r\n     * current page, even if the delay wasn’t reached.\r\n     *\r\n     * @default false\r\n     */\r\n    triggerOnUIInteraction?: boolean;\r\n    /**\r\n     * Triggers `pushFunction` when InstantSearch is initialized. This means\r\n     * the `pushFunction` might be called even though the user didn’t perfom\r\n     * any search-related action.\r\n     *\r\n     * @default true\r\n     */\r\n    pushInitialSearch?: boolean;\r\n    /**\r\n     * Triggers `pushFunction` when the page changes, either through the UI or programmatically.\r\n     *\r\n     * @default false\r\n     */\r\n    pushPagination?: boolean;\r\n};\r\n\r\ndeclare type AnalyticsWidgetParamsPushFunction = (\r\n/**\r\n * Contains the search parameters, serialized as a query string.\r\n */\r\nformattedParameters: string, \r\n/**\r\n * Contains the whole search state.\r\n */\r\nstate: SearchParameters, \r\n/**\r\n * The last received results.\r\n */\r\nresults: SearchResults) => void;\r\n\r\ndeclare type AnswersConnector = Connector<AnswersWidgetDescription, AnswersConnectorParams>;\r\n\r\ndeclare type AnswersConnectorParams = {\r\n    /**\r\n     * Attributes to use for predictions.\r\n     * If empty, we use all `searchableAttributes` to find answers.\r\n     * All your `attributesForPrediction` must be part of your `searchableAttributes`.\r\n     */\r\n    attributesForPrediction?: string[];\r\n    /**\r\n     * The languages in the query. Currently only supports `en`.\r\n     */\r\n    queryLanguages: ['en'];\r\n    /**\r\n     * Maximum number of answers to retrieve from the Answers Engine.\r\n     * Cannot be greater than 1000.\r\n     * @default 1\r\n     */\r\n    nbHits?: number;\r\n    /**\r\n     * Debounce time in milliseconds to debounce render\r\n     * @default 100\r\n     */\r\n    renderDebounceTime?: number;\r\n    /**\r\n     * Debounce time in milliseconds to debounce search\r\n     * @default 100\r\n     */\r\n    searchDebounceTime?: number;\r\n    /**\r\n     * Whether to escape HTML tags from hits string values.\r\n     *\r\n     * @default true\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Extra parameters to pass to findAnswers method.\r\n     * @default {}\r\n     */\r\n    extraParameters?: FindAnswersOptions;\r\n};\r\n\r\ndeclare type AnswersCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element of the widget.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the wrapping element when no results.\r\n     */\r\n    emptyRoot: string | string[];\r\n    /**\r\n     * CSS classes to add to the header.\r\n     */\r\n    header: string | string[];\r\n    /**\r\n     * CSS classes to add to the loader.\r\n     */\r\n    loader: string | string[];\r\n    /**\r\n     * CSS class to add to the list of results.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to each result.\r\n     */\r\n    item: string | string[];\r\n}>;\r\n\r\ndeclare type AnswersRenderState = {\r\n    /**\r\n     * The matched hits from Algolia API.\r\n     */\r\n    hits: Hit[];\r\n    /**\r\n     * Whether it's still loading the results from the Answers API.\r\n     */\r\n    isLoading: boolean;\r\n};\r\n\r\ndeclare type AnswersTemplates = Partial<{\r\n    /**\r\n     * Template to use for the header. This template will receive an object containing `hits` and `isLoading`.\r\n     */\r\n    header: Template<{\r\n        hits: Hit[];\r\n        isLoading: boolean;\r\n    }>;\r\n    /**\r\n     * Template to use for the loader.\r\n     */\r\n    loader: Template;\r\n    /**\r\n     * Template to use for each result. This template will receive an object containing a single record.\r\n     */\r\n    item: Template<Hit>;\r\n}>;\r\n\r\ndeclare type AnswersWidget = WidgetFactory<AnswersWidgetDescription & {\r\n    $$widgetType: 'ais.answers';\r\n}, AnswersConnectorParams, AnswersWidgetParams>;\r\n\r\ndeclare type AnswersWidgetDescription = {\r\n    $$type: 'ais.answers';\r\n    renderState: AnswersRenderState;\r\n    indexRenderState: {\r\n        answers: WidgetRenderState<AnswersRenderState, AnswersConnectorParams>;\r\n    };\r\n};\r\n\r\ndeclare type AnswersWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * The templates to use for the widget.\r\n     */\r\n    templates?: AnswersTemplates;\r\n    /**\r\n     * The CSS classes to override.\r\n     */\r\n    cssClasses?: AnswersCSSClasses;\r\n};\r\n\r\ndeclare type AnyWidgetFactory = WidgetFactory<{\r\n    $$type: string;\r\n}, Record<string, any>, any>;\r\n\r\ndeclare type AtLeastOne<TTarget, TMapped = {\r\n    [Key in keyof TTarget]: Pick<TTarget, Key>;\r\n}> = Partial<TTarget> & TMapped[keyof TMapped];\r\n\r\ndeclare type AugmentedWidget<TWidgetFactory extends AnyWidgetFactory, TOverriddenKeys extends keyof Widget = 'init' | 'render' | 'dispose'> = Omit<ReturnType<TWidgetFactory>, TOverriddenKeys | 'dependsOn' | 'getWidgetParameters'> & Pick<Required<Widget>, TOverriddenKeys>;\r\n\r\ndeclare type AutocompleteConnector = Connector<AutocompleteWidgetDescription, AutocompleteConnectorParams>;\r\n\r\ndeclare type AutocompleteConnectorParams = {\r\n    /**\r\n     * Escapes HTML entities from hits string values.\r\n     *\r\n     * @default `true`\r\n     */\r\n    escapeHTML?: boolean;\r\n};\r\n\r\ndeclare type AutocompleteRenderState = {\r\n    /**\r\n     * The current value of the query.\r\n     */\r\n    currentRefinement: string;\r\n    /**\r\n     * The indices this widget has access to.\r\n     */\r\n    indices: Array<{\r\n        /**\r\n         * The name of the index\r\n         */\r\n        indexName: string;\r\n        /**\r\n         * The id of the index\r\n         */\r\n        indexId: string;\r\n        /**\r\n         * The resolved hits from the index matching the query.\r\n         */\r\n        hits: Hit[];\r\n        /**\r\n         * The full results object from the Algolia API.\r\n         */\r\n        results: SearchResults;\r\n        /**\r\n         * Send event to insights middleware\r\n         */\r\n        sendEvent: SendEventForHits;\r\n    }>;\r\n    /**\r\n     * Searches into the indices with the provided query.\r\n     */\r\n    refine: (query: string) => void;\r\n};\r\n\r\ndeclare type AutocompleteWidgetDescription = {\r\n    $$type: 'ais.autocomplete';\r\n    renderState: AutocompleteRenderState;\r\n    indexRenderState: {\r\n        autocomplete: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        query: string;\r\n    };\r\n};\r\n\r\ndeclare type BaseHit = Record<string, any>;\r\n\r\ndeclare type BindEventForHits = BuiltInBindEventForHits & CustomBindEventForHits;\r\n\r\ndeclare type Bounds = {\r\n    /**\r\n     * The top right corner of the map view.\r\n     */\r\n    northEast: GeoLoc;\r\n    /**\r\n     * The bottom left corner of the map view.\r\n     */\r\n    southWest: GeoLoc;\r\n};\r\n\r\ndeclare const breadcrumb: BreadcrumbWidget;\r\n\r\ndeclare type BreadcrumbConnector = Connector<BreadcrumbWidgetDescription, BreadcrumbConnectorParams>;\r\n\r\ndeclare type BreadcrumbConnectorParams = {\r\n    /**\r\n     * Attributes to use to generate the hierarchy of the breadcrumb.\r\n     */\r\n    attributes: string[];\r\n    /**\r\n     * Prefix path to use if the first level is not the root level.\r\n     */\r\n    rootPath?: string;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<BreadcrumbConnectorParamsItem>;\r\n    /**\r\n     * The level separator used in the records.\r\n     *\r\n     * @default '>'\r\n     */\r\n    separator?: string;\r\n};\r\n\r\ndeclare type BreadcrumbConnectorParamsItem = {\r\n    /**\r\n     * Label of the category or subcategory.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Value of breadcrumb item.\r\n     */\r\n    value: string | null;\r\n};\r\n\r\ndeclare type BreadcrumbCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element of the widget.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element of the widget if there are no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to the items of the list. The items contains the link and the separator.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add to the selected item in the list: the last one or the home if there are no refinements.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS class to add to the separator.\r\n     */\r\n    separator: string | string[];\r\n    /**\r\n     * CSS class to add to the links in the items.\r\n     */\r\n    link: string | string[];\r\n}>;\r\n\r\ndeclare type BreadcrumbRenderState = {\r\n    /**\r\n     * Creates the URL for a single item name in the list.\r\n     */\r\n    createURL: CreateURL<BreadcrumbConnectorParamsItem['value']>;\r\n    /**\r\n     * Array of objects defining the different values and labels.\r\n     */\r\n    items: BreadcrumbConnectorParamsItem[];\r\n    /**\r\n     * Sets the path of the hierarchical filter and triggers a new search.\r\n     */\r\n    refine: (value: BreadcrumbConnectorParamsItem['value']) => void;\r\n    /**\r\n     * True if refinement can be applied.\r\n     */\r\n    canRefine: boolean;\r\n};\r\n\r\ndeclare type BreadcrumbTemplates = Partial<{\r\n    /**\r\n     * Label of the breadcrumb's first element.\r\n     */\r\n    home: Template;\r\n    /**\r\n     * Symbol used to separate the elements of the breadcrumb.\r\n     */\r\n    separator: Template;\r\n}>;\r\n\r\ndeclare type BreadcrumbWidget = WidgetFactory<BreadcrumbWidgetDescription & {\r\n    $$widgetType: 'ais.breadcrumb';\r\n}, BreadcrumbConnectorParams, BreadcrumbWidgetParams>;\r\n\r\ndeclare type BreadcrumbWidgetDescription = {\r\n    $$type: 'ais.breadcrumb';\r\n    renderState: BreadcrumbRenderState;\r\n    indexRenderState: {\r\n        breadcrumb: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type BreadcrumbWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: BreadcrumbTemplates;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: BreadcrumbCSSClasses;\r\n};\r\n\r\ndeclare class BrowserHistory<TRouteState> implements Router<TRouteState> {\r\n    $$type: string;\r\n    /**\r\n     * Transforms a UI state into a title for the page.\r\n     */\r\n    private readonly windowTitle?;\r\n    /**\r\n     * Time in milliseconds before performing a write in the history.\r\n     * It prevents from adding too many entries in the history and\r\n     * makes the back button more usable.\r\n     *\r\n     * @default 400\r\n     */\r\n    private readonly writeDelay;\r\n    /**\r\n     * Creates a full URL based on the route state.\r\n     * The storage adaptor maps all syncable keys to the query string of the URL.\r\n     */\r\n    private readonly _createURL;\r\n    /**\r\n     * Parses the URL into a route state.\r\n     * It should be symmetrical to `createURL`.\r\n     */\r\n    private readonly parseURL;\r\n    /**\r\n     * Returns the location to store in the history.\r\n     * @default () => window.location\r\n     */\r\n    private readonly getLocation;\r\n    private writeTimer?;\r\n    private _onPopState?;\r\n    /**\r\n     * Indicates if last action was back/forward in the browser.\r\n     */\r\n    private inPopState;\r\n    /**\r\n     * Indicates whether the history router is disposed or not.\r\n     */\r\n    protected isDisposed: boolean;\r\n    /**\r\n     * Indicates the window.history.length before the last call to\r\n     * window.history.pushState (called in `write`).\r\n     * It allows to determine if a `pushState` has been triggered elsewhere,\r\n     * and thus to prevent the `write` method from calling `pushState`.\r\n     */\r\n    private latestAcknowledgedHistory;\r\n    private _start?;\r\n    private _dispose?;\r\n    private _push?;\r\n    private _cleanUrlOnDispose;\r\n    /**\r\n     * Initializes a new storage provider that syncs the search state to the URL\r\n     * using web APIs (`window.location.pushState` and `onpopstate` event).\r\n     */\r\n    constructor({ windowTitle, writeDelay, createURL, parseURL, getLocation, start, dispose, push, cleanUrlOnDispose, }: BrowserHistoryArgs<TRouteState>);\r\n    /**\r\n     * Reads the URL and returns a syncable UI search state.\r\n     */\r\n    read(): TRouteState;\r\n    /**\r\n     * Pushes a search state into the URL.\r\n     */\r\n    write(routeState: TRouteState): void;\r\n    /**\r\n     * Sets a callback on the `onpopstate` event of the history API of the current page.\r\n     * It enables the URL sync to keep track of the changes.\r\n     */\r\n    onUpdate(callback: (routeState: TRouteState) => void): void;\r\n    /**\r\n     * Creates a complete URL from a given syncable UI state.\r\n     *\r\n     * It always generates the full URL, not a relative one.\r\n     * This allows to handle cases like using a <base href>.\r\n     * See: https://github.com/algolia/instantsearch/issues/790\r\n     */\r\n    createURL(routeState: TRouteState): string;\r\n    /**\r\n     * Removes the event listener and cleans up the URL.\r\n     */\r\n    dispose(): void;\r\n    start(): void;\r\n    private shouldWrite;\r\n}\r\n\r\ndeclare type BrowserHistoryArgs<TRouteState> = {\r\n    windowTitle?: (routeState: TRouteState) => string;\r\n    writeDelay: number;\r\n    createURL: CreateURL_2<TRouteState>;\r\n    parseURL: ParseURL<TRouteState>;\r\n    getLocation: () => Location;\r\n    start?: (onUpdate: () => void) => void;\r\n    dispose?: () => void;\r\n    push?: (url: string) => void;\r\n    /**\r\n     * Whether the URL should be cleaned up when the router is disposed.\r\n     * This can be useful when closing a modal containing InstantSearch, to\r\n     * remove active refinements from the URL.\r\n     * @default true\r\n     */\r\n    cleanUrlOnDispose?: boolean;\r\n};\r\n\r\ndeclare type BuiltInBindEventForHits = (eventType: string, hits: Hit | Hit[], eventName?: string, additionalData?: Record<string, any>) => string;\r\n\r\ndeclare type BuiltInSendEventForFacet = (eventType: string, facetValue: string, eventName?: string, additionalData?: Record<string, any>) => void;\r\n\r\ndeclare type BuiltInSendEventForHits = (eventType: string, hits: Hit | Hit[], eventName?: string, additionalData?: Record<string, any>) => void;\r\n\r\ndeclare type BuiltInSendEventForToggle = (eventType: string, isRefined: boolean, eventName?: string) => void;\r\n\r\ndeclare function carousel<TObject extends Record<string, unknown>>({ cssClasses, templates, }?: CreateCarouselTemplateProps<TObject>): ({ items, templates: widgetTemplates, cssClasses: widgetCssClasses, sendEvent, }: CarouselTemplateProps<TObject>) => h.JSX.Element;\r\n\r\ndeclare type CarouselTemplateProps<TObject extends Record<string, unknown>> = Pick<CarouselProps<TObject>, 'items'> & {\r\n    templates: {\r\n        item?: CarouselProps<TObject>['itemComponent'];\r\n    };\r\n    cssClasses?: Partial<CarouselProps<TObject>['classNames']>;\r\n} & {\r\n    sendEvent?: CarouselProps<TObject>['sendEvent'];\r\n};\r\n\r\ndeclare const clearRefinements: ClearRefinementsWidget;\r\n\r\ndeclare type ClearRefinementsConnector = Connector<ClearRefinementsWidgetDescription, ClearRefinementsConnectorParams>;\r\n\r\ndeclare type ClearRefinementsConnectorParams = {\r\n    /**\r\n     * The attributes to include in the refinements to clear (all by default). Cannot be used with `excludedAttributes`.\r\n     */\r\n    includedAttributes?: string[];\r\n    /**\r\n     * The attributes to exclude from the refinements to clear. Cannot be used with `includedAttributes`.\r\n     */\r\n    excludedAttributes?: string[];\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<string>;\r\n};\r\n\r\ndeclare type ClearRefinementsCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the wrapper element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the button of the widget.\r\n     */\r\n    button: string | string[];\r\n    /**\r\n     * CSS class to add to the button when there are no refinements.\r\n     */\r\n    disabledButton: string | string[];\r\n}>;\r\n\r\ndeclare type ClearRefinementsRenderState = {\r\n    /**\r\n     * Triggers the clear of all the currently refined values.\r\n     */\r\n    refine: () => void;\r\n    /**\r\n     * Indicates if search state is refined.\r\n     * @deprecated prefer reading canRefine\r\n     */\r\n    hasRefinements: boolean;\r\n    /**\r\n     * Indicates if search state can be refined.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Creates a url for the next state when refinements are cleared.\r\n     */\r\n    createURL: CreateURL<void>;\r\n};\r\n\r\ndeclare type ClearRefinementsTemplates = Partial<{\r\n    /**\r\n     * Template for the content of the button\r\n     */\r\n    resetLabel: Template<{\r\n        hasRefinements: boolean;\r\n    }>;\r\n}>;\r\n\r\ndeclare type ClearRefinementsWidget = WidgetFactory<ClearRefinementsWidgetDescription & {\r\n    $$widgetType: 'ais.clearRefinements';\r\n}, ClearRefinementsConnectorParams, ClearRefinementsWidgetParams>;\r\n\r\ndeclare type ClearRefinementsWidgetDescription = {\r\n    $$type: 'ais.clearRefinements';\r\n    renderState: ClearRefinementsRenderState;\r\n    indexRenderState: {\r\n        clearRefinements: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams>;\r\n    };\r\n};\r\n\r\ndeclare type ClearRefinementsWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: ClearRefinementsTemplates;\r\n    /**\r\n     * CSS classes to be added.\r\n     */\r\n    cssClasses?: ClearRefinementsCSSClasses;\r\n};\r\n\r\ndeclare type ComponentCSSClasses<TCSSClasses> = Required<{\r\n    [className in keyof TCSSClasses]: string;\r\n}>;\r\n\r\ndeclare const configure: ConfigureWidget;\r\n\r\ndeclare type ConfigureConnector = Connector<ConfigureWidgetDescription, ConfigureConnectorParams>;\r\n\r\ndeclare type ConfigureConnectorParams = {\r\n    /**\r\n     * A list of [search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/)\r\n     * to enable when the widget mounts.\r\n     */\r\n    searchParameters: PlainSearchParameters;\r\n};\r\n\r\ndeclare type ConfigureRelatedItemsConnector = Connector<ConfigureRelatedItemsWidgetDescription, ConfigureRelatedItemsConnectorParams>;\r\n\r\ndeclare type ConfigureRelatedItemsConnectorParams = {\r\n    /**\r\n     * The reference hit to extract the filters from.\r\n     */\r\n    hit: AlgoliaHit;\r\n    /**\r\n     * The schema to create the optional filters.\r\n     * Each key represents an attribute from the hit.\r\n     */\r\n    matchingPatterns: MatchingPatterns;\r\n    /**\r\n     * Function to transform the generated search parameters.\r\n     */\r\n    transformSearchParameters?: TransformSearchParameters;\r\n};\r\n\r\ndeclare type ConfigureRelatedItemsWidget = WidgetFactory<ConfigureRelatedItemsWidgetDescription & {\r\n    $$widgetType: 'ais.configureRelatedItems';\r\n}, ConfigureRelatedItemsConnectorParams, ConfigureRelatedItemsWidgetParams>;\r\n\r\ndeclare type ConfigureRelatedItemsWidgetDescription = {\r\n    $$type: 'ais.configureRelatedItems';\r\n} & Omit<ConfigureWidgetDescription, '$$type'>;\r\n\r\ndeclare type ConfigureRelatedItemsWidgetParams = PlainSearchParameters;\r\n\r\ndeclare type ConfigureRenderState = {\r\n    /**\r\n     * Refine the given search parameters.\r\n     */\r\n    refine: Refine;\r\n};\r\n\r\ndeclare type ConfigureWidget = (widgetParams: ConfigureWidgetParams) => Widget<ConfigureWidgetDescription & {\r\n    $$widgetType: 'ais.configure';\r\n    widgetParams: ConfigureConnectorParams;\r\n}>;\r\n\r\ndeclare type ConfigureWidgetDescription = {\r\n    $$type: 'ais.configure';\r\n    renderState: ConfigureRenderState;\r\n    indexRenderState: {\r\n        configure: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        configure: PlainSearchParameters;\r\n    };\r\n};\r\n\r\n/**\r\n * A list of [search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/)\r\n * to enable when the widget mounts.\r\n */\r\ndeclare type ConfigureWidgetParams = ConfigureConnectorParams['searchParameters'];\r\n\r\ndeclare const connectAutocomplete: AutocompleteConnector;\r\n\r\ndeclare const connectBreadcrumb: BreadcrumbConnector;\r\n\r\ndeclare const connectClearRefinements: ClearRefinementsConnector;\r\n\r\ndeclare const connectConfigure: ConfigureConnector;\r\n\r\ndeclare const connectCurrentRefinements: CurrentRefinementsConnector;\r\n\r\ndeclare const connectDynamicWidgets: DynamicWidgetsConnector;\r\n\r\n/**\r\n * **HierarchicalMenu** connector provides the logic to build a custom widget\r\n * that will give the user the ability to explore facets in a tree-like structure.\r\n *\r\n * This is commonly used for multi-level categorization of products on e-commerce\r\n * websites. From a UX point of view, we suggest not displaying more than two\r\n * levels deep.\r\n *\r\n * @type {Connector}\r\n * @param {function(HierarchicalMenuRenderingOptions, boolean)} renderFn Rendering function for the custom **HierarchicalMenu** widget.\r\n * @param {function} unmountFn Unmount function called when the widget is disposed.\r\n * @return {function(CustomHierarchicalMenuWidgetParams)} Re-usable widget factory for a custom **HierarchicalMenu** widget.\r\n */\r\ndeclare const connectHierarchicalMenu: HierarchicalMenuConnector;\r\n\r\ndeclare const connectHitsPerPage: HitsPerPageConnector;\r\n\r\ndeclare const connectHitsWithInsights: <TWidgetParams>(renderFn: Renderer<HitsRenderState, TWidgetParams & HitsConnectorParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & HitsConnectorParams<THit>) => {\r\n    $$type: \"ais.hits\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & HitsWidgetDescription[\"indexRenderState\"];\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions): {\r\n        hits: never[];\r\n        items: never[];\r\n        results: undefined;\r\n        banner: undefined;\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        widgetParams: TWidgetParams & HitsConnectorParams<THit>;\r\n    } | {\r\n        hits: Hit<BaseHit>[] | Hit<THit>[];\r\n        items: Hit<BaseHit>[] | Hit<THit>[];\r\n        results: SearchResults<any>;\r\n        banner: Banner | undefined;\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        widgetParams: TWidgetParams & HitsConnectorParams<THit>;\r\n    };\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetSearchParameters(state: SearchParameters, _uiState: {\r\n        uiState: {\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            page?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare const connectInfiniteHitsWithInsights: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<InfiniteHitsRenderState, TWidgetParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & InfiniteHitsConnectorParams<THit>) => {\r\n    $$type: \"ais.infiniteHits\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & InfiniteHitsWidgetDescription[\"indexRenderState\"];\r\n    getWidgetRenderState({ results, helper, parent, state: existingState, instantSearchInstance, }: InitOptions | RenderOptions): {\r\n        hits: Hit<THit>[];\r\n        items: Hit<THit>[];\r\n        currentPageHits: Hit<THit>[];\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        banner: Banner | undefined;\r\n        results: SearchResults<any> | undefined;\r\n        showPrevious: () => void;\r\n        showMore: () => void;\r\n        isFirstPage: boolean;\r\n        isLastPage: boolean;\r\n        widgetParams: TWidgetParams & InfiniteHitsConnectorParams<THit>;\r\n    };\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetUiState(uiState: {\r\n        page?: number | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    }, { searchParameters }: {\r\n        searchParameters: SearchParameters;\r\n        helper: AlgoliaSearchHelper;\r\n    }): {\r\n        page?: number | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    };\r\n    getWidgetSearchParameters(searchParameters: SearchParameters, { uiState }: {\r\n        uiState: {\r\n            page?: number | undefined;\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\n/**\r\n * **Menu** connector provides the logic to build a widget that will give the user the ability to choose a single value for a specific facet. The typical usage of menu is for navigation in categories.\r\n *\r\n * This connector provides a `toggleShowMore()` function to display more or less items and a `refine()`\r\n * function to select an item. While selecting a new element, the `refine` will also unselect the\r\n * one that is currently selected.\r\n *\r\n * **Requirement:** the attribute passed as `attribute` must be present in \"attributes for faceting\" on the Algolia dashboard or configured as attributesForFaceting via a set settings call to the Algolia API.\r\n */\r\ndeclare const connectMenu: MenuConnector;\r\n\r\ndeclare const connectNumericMenu: NumericMenuConnector;\r\n\r\n/**\r\n * The connector handles the business logic and exposes\r\n * a simplified API to the rendering function.\r\n */\r\ndeclare type Connector<TWidgetDescription extends WidgetDescription, TConnectorParams extends UnknownWidgetParams> = <TWidgetParams extends UnknownWidgetParams>(\r\n/**\r\n * The render function.\r\n */\r\nrenderFn: Renderer<TWidgetDescription['renderState'], TConnectorParams & TWidgetParams>, \r\n/**\r\n * The called function when unmounting a widget.\r\n */\r\nunmountFn?: Unmounter) => (widgetParams: TConnectorParams & TWidgetParams) => Widget<TWidgetDescription & {\r\n    widgetParams: typeof widgetParams;\r\n}>;\r\n\r\ndeclare type ConnectorRenderStates = AnswersWidgetDescription['indexRenderState'] & AutocompleteWidgetDescription['indexRenderState'] & BreadcrumbWidgetDescription['indexRenderState'] & ClearRefinementsWidgetDescription['indexRenderState'] & ConfigureWidgetDescription['indexRenderState'] & CurrentRefinementsWidgetDescription['indexRenderState'] & GeoSearchWidgetDescription['indexRenderState'] & HierarchicalMenuWidgetDescription['indexRenderState'] & HitsWidgetDescription['indexRenderState'] & HitsPerPageWidgetDescription['indexRenderState'] & InfiniteHitsWidgetDescription['indexRenderState'] & MenuWidgetDescription['indexRenderState'] & NumericMenuWidgetDescription['indexRenderState'] & PaginationWidgetDescription['indexRenderState'] & PoweredByWidgetDescription['indexRenderState'] & QueryRulesWidgetDescription['indexRenderState'] & RangeWidgetDescription['indexRenderState'] & RatingMenuWidgetDescription['indexRenderState'] & RefinementListWidgetDescription['indexRenderState'] & RelevantSortWidgetDescription['indexRenderState'] & SearchBoxWidgetDescription['indexRenderState'] & SortByWidgetDescription['indexRenderState'] & StatsWidgetDescription['indexRenderState'] & ToggleRefinementWidgetDescription['indexRenderState'] & VoiceSearchWidgetDescription['indexRenderState'];\r\n\r\ndeclare namespace connectors {\r\n    export {\r\n        EXPERIMENTAL_connectAnswers,\r\n        EXPERIMENTAL_connectConfigureRelatedItems,\r\n        EXPERIMENTAL_connectDynamicWidgets,\r\n        connectDynamicWidgets,\r\n        connectClearRefinements,\r\n        connectCurrentRefinements,\r\n        connectHierarchicalMenu,\r\n        _default as connectHits,\r\n        connectHitsWithInsights,\r\n        connectHitsPerPage,\r\n        _default_2 as connectInfiniteHits,\r\n        connectInfiniteHitsWithInsights,\r\n        connectMenu,\r\n        connectNumericMenu,\r\n        connectPagination,\r\n        connectRange,\r\n        connectRefinementList,\r\n        _default_3 as connectRelatedProducts,\r\n        connectSearchBox,\r\n        connectSortBy,\r\n        connectRatingMenu,\r\n        connectStats,\r\n        connectToggleRefinement,\r\n        _default_4 as connectTrendingItems,\r\n        connectBreadcrumb,\r\n        _default_5 as connectGeoSearch,\r\n        connectPoweredBy,\r\n        connectConfigure,\r\n        connectAutocomplete,\r\n        connectQueryRules,\r\n        connectVoiceSearch,\r\n        connectRelevantSort,\r\n        _default_6 as connectFrequentlyBoughtTogether,\r\n        _default_7 as connectLookingSimilar\r\n    }\r\n}\r\n\r\ndeclare type ConnectorUiStates = AutocompleteWidgetDescription['indexUiState'] & ConfigureWidgetDescription['indexUiState'] & GeoSearchWidgetDescription['indexUiState'] & HierarchicalMenuWidgetDescription['indexUiState'] & HitsPerPageWidgetDescription['indexUiState'] & InfiniteHitsWidgetDescription['indexUiState'] & MenuWidgetDescription['indexUiState'] & NumericMenuWidgetDescription['indexUiState'] & PaginationWidgetDescription['indexUiState'] & RangeWidgetDescription['indexUiState'] & RatingMenuWidgetDescription['indexUiState'] & RefinementListWidgetDescription['indexUiState'] & RelevantSortWidgetDescription['indexUiState'] & SearchBoxWidgetDescription['indexUiState'] & SortByWidgetDescription['indexUiState'] & ToggleRefinementWidgetDescription['indexUiState'] & VoiceSearchWidgetDescription['indexUiState'];\r\n\r\n/**\r\n * **Pagination** connector provides the logic to build a widget that will let the user\r\n * choose the current page of the results.\r\n *\r\n * When using the pagination with Algolia, you should be aware that the engine won't provide you pages\r\n * beyond the 1000th hits by default. You can find more information on the [Algolia documentation](https://www.algolia.com/doc/guides/searching/pagination/#pagination-limitations).\r\n */\r\ndeclare const connectPagination: PaginationConnector;\r\n\r\n/**\r\n * **PoweredBy** connector provides the logic to build a custom widget that will displays\r\n * the logo to redirect to Algolia.\r\n */\r\ndeclare const connectPoweredBy: PoweredByConnector;\r\n\r\ndeclare const connectQueryRules: QueryRulesConnector;\r\n\r\n/**\r\n * **Range** connector provides the logic to create custom widget that will let\r\n * the user refine results using a numeric range.\r\n *\r\n * This connectors provides a `refine()` function that accepts bounds. It will also provide\r\n * information about the min and max bounds for the current result set.\r\n */\r\ndeclare const connectRange: RangeConnector;\r\n\r\n/**\r\n * **StarRating** connector provides the logic to build a custom widget that will let\r\n * the user refine search results based on ratings.\r\n *\r\n * The connector provides to the rendering: `refine()` to select a value and\r\n * `items` that are the values that can be selected. `refine` should be used\r\n * with `items.value`.\r\n */\r\ndeclare const connectRatingMenu: RatingMenuConnector;\r\n\r\n/**\r\n * **RefinementList** connector provides the logic to build a custom widget that\r\n * will let the user filter the results based on the values of a specific facet.\r\n *\r\n * **Requirement:** the attribute passed as `attribute` must be present in\r\n * attributesForFaceting of the searched index.\r\n *\r\n * This connector provides:\r\n * - a `refine()` function to select an item.\r\n * - a `toggleShowMore()` function to display more or less items\r\n * - a `searchForItems()` function to search within the items.\r\n */\r\ndeclare const connectRefinementList: RefinementListConnector;\r\n\r\ndeclare const connectRelevantSort: RelevantSortConnector;\r\n\r\n/**\r\n * **SearchBox** connector provides the logic to build a widget that will let the user search for a query.\r\n *\r\n * The connector provides to the rendering: `refine()` to set the query. The behaviour of this function\r\n * may be impacted by the `queryHook` widget parameter.\r\n */\r\ndeclare const connectSearchBox: SearchBoxConnector;\r\n\r\ndeclare const connectSortBy: SortByConnector;\r\n\r\ndeclare const connectStats: StatsConnector;\r\n\r\n/**\r\n * **Toggle** connector provides the logic to build a custom widget that will provide\r\n * an on/off filtering feature based on an attribute value or values.\r\n *\r\n * Two modes are implemented in the custom widget:\r\n *  - with or without the value filtered\r\n *  - switch between two values.\r\n */\r\ndeclare const connectToggleRefinement: ToggleRefinementConnector;\r\n\r\ndeclare const connectVoiceSearch: VoiceSearchConnector;\r\n\r\ndeclare type CreateCarouselTemplateProps<TObject extends Record<string, unknown>> = {\r\n    templates?: Partial<{\r\n        previous: Exclude<Template_2, string>;\r\n        next: Exclude<Template_2, string>;\r\n    }>;\r\n    cssClasses?: Partial<CarouselProps<TObject>['classNames']>;\r\n};\r\n\r\ndeclare function createInfiniteHitsSessionStorageCache({ key, }?: {\r\n    /**\r\n     * If you display multiple instances of infiniteHits on the same page,\r\n     * you must provide a unique key for each instance.\r\n     */\r\n    key?: string;\r\n}): InfiniteHitsCache;\r\n\r\ndeclare type CreateInsightsMiddleware = typeof createInsightsMiddleware;\r\n\r\ndeclare function createInsightsMiddleware<TInsightsClient extends ProvidedInsightsClient>(props?: InsightsProps<TInsightsClient>): InternalMiddleware;\r\n\r\ndeclare type CreateMarker = (args: {\r\n    item: GeoHit;\r\n    map: google.maps.Map;\r\n}) => google.maps.OverlayView | google.maps.Marker;\r\n\r\n/**\r\n * Exposes the metadata of mounted widgets in a custom\r\n * `<meta name=\"instantsearch:widgets\" />` tag. The metadata per widget is:\r\n * - applied parameters\r\n * - widget name\r\n * - connector name\r\n */\r\ndeclare function createMetadataMiddleware({ $$internal, }?: {\r\n    $$internal?: boolean;\r\n}): InternalMiddleware;\r\n\r\ndeclare const createRouterMiddleware: <TUiState extends UiState = UiState, TRouteState = TUiState>(props?: RouterProps<TUiState, TRouteState>) => InternalMiddleware<TUiState>;\r\n\r\n/**\r\n * Creates the URL for the given value.\r\n */\r\ndeclare type CreateURL<TValue> = (value: TValue) => string;\r\n\r\ndeclare type CreateURL_2<TRouteState> = (args: {\r\n    qsModule: typeof qs_2;\r\n    routeState: TRouteState;\r\n    location: Location;\r\n}) => string;\r\n\r\ndeclare type CreateVoiceSearchHelper = (params: VoiceSearchHelperParams) => VoiceSearchHelper;\r\n\r\ndeclare const currentRefinements: CurrentRefinementsWidget;\r\n\r\ndeclare type CurrentRefinementsConnector = Connector<CurrentRefinementsWidgetDescription, CurrentRefinementsConnectorParams>;\r\n\r\ndeclare type CurrentRefinementsConnectorParams = {\r\n    /**\r\n     * The attributes to include in the widget (all by default).\r\n     * Cannot be used with `excludedAttributes`.\r\n     *\r\n     * @default `[]`\r\n     */\r\n    includedAttributes?: string[];\r\n    /**\r\n     * The attributes to exclude from the widget.\r\n     * Cannot be used with `includedAttributes`.\r\n     *\r\n     * @default `['query']`\r\n     */\r\n    excludedAttributes?: string[];\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<CurrentRefinementsConnectorParamsItem>;\r\n};\r\n\r\ndeclare type CurrentRefinementsConnectorParamsItem = {\r\n    /**\r\n     * The index name.\r\n     */\r\n    indexName: string;\r\n    /**\r\n     * The index id as provided to the index widget.\r\n     */\r\n    indexId: string;\r\n    /**\r\n     * The attribute on which the refinement is applied.\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * The textual representation of this attribute.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Currently applied refinements.\r\n     */\r\n    refinements: CurrentRefinementsConnectorParamsRefinement[];\r\n    /**\r\n     * Removes the given refinement and triggers a new search.\r\n     */\r\n    refine: (refinement: CurrentRefinementsConnectorParamsRefinement) => void;\r\n};\r\n\r\ndeclare type CurrentRefinementsConnectorParamsRefinement = {\r\n    /**\r\n     * The attribute on which the refinement is applied.\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * The type of the refinement.\r\n     */\r\n    type: 'facet' | 'exclude' | 'disjunctive' | 'hierarchical' | 'numeric' | 'query' | 'tag';\r\n    /**\r\n     * The raw value of the refinement.\r\n     */\r\n    value: string | number;\r\n    /**\r\n     * The label of the refinement to display.\r\n     */\r\n    label: string;\r\n    /**\r\n     * The value of the operator (only if applicable).\r\n     */\r\n    operator?: string;\r\n    /**\r\n     * The number of found items (only if applicable).\r\n     */\r\n    count?: number;\r\n    /**\r\n     * Whether the count is exhaustive (only if applicable).\r\n     */\r\n    exhaustive?: boolean;\r\n};\r\n\r\ndeclare type CurrentRefinementsCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to the each item element.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add to the label element.\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to the category element.\r\n     */\r\n    category: string | string[];\r\n    /**\r\n     * CSS class to add to the categoryLabel element.\r\n     */\r\n    categoryLabel: string | string[];\r\n    /**\r\n     * CSS class to add to the delete element.\r\n     */\r\n    delete: string | string[];\r\n}>;\r\n\r\ndeclare type CurrentRefinementsRenderState = {\r\n    /**\r\n     * All the currently refined items, grouped by attribute.\r\n     */\r\n    items: CurrentRefinementsConnectorParamsItem[];\r\n    /**\r\n     * Indicates if search state can be refined.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Removes the given refinement and triggers a new search.\r\n     */\r\n    refine: (refinement: CurrentRefinementsConnectorParamsRefinement) => void;\r\n    /**\r\n     * Generates a URL for the next state.\r\n     */\r\n    createURL: CreateURL<CurrentRefinementsConnectorParamsRefinement>;\r\n};\r\n\r\ndeclare type CurrentRefinementsWidget = WidgetFactory<CurrentRefinementsWidgetDescription & {\r\n    $$widgetType: 'ais.currentRefinements';\r\n}, CurrentRefinementsConnectorParams, CurrentRefinementsWidgetParams>;\r\n\r\ndeclare type CurrentRefinementsWidgetDescription = {\r\n    $$type: 'ais.currentRefinements';\r\n    renderState: CurrentRefinementsRenderState;\r\n    indexRenderState: {\r\n        currentRefinements: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams>;\r\n    };\r\n};\r\n\r\ndeclare type CurrentRefinementsWidgetParams = {\r\n    /**\r\n     * The CSS Selector or `HTMLElement` to insert the widget into.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * The CSS classes to override.\r\n     */\r\n    cssClasses?: CurrentRefinementsCSSClasses;\r\n};\r\n\r\ndeclare type CustomBindEventForHits = (customPayload: any) => string;\r\n\r\ndeclare type CustomSendEventForFacet = (customPayload: any) => void;\r\n\r\ndeclare type CustomSendEventForHits = (customPayload: any) => void;\r\n\r\ndeclare type CustomSendEventForToggle = (customPayload: any) => void;\r\n\r\ndeclare const _default: <TWidgetParams>(renderFn: Renderer<HitsRenderState, TWidgetParams & HitsConnectorParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & HitsConnectorParams<THit>) => {\r\n    $$type: \"ais.hits\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & HitsWidgetDescription[\"indexRenderState\"];\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions): {\r\n        hits: never[];\r\n        items: never[];\r\n        results: undefined;\r\n        banner: undefined;\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        widgetParams: TWidgetParams & HitsConnectorParams<THit>;\r\n    } | {\r\n        hits: Hit<BaseHit>[] | Hit<THit>[];\r\n        items: Hit<BaseHit>[] | Hit<THit>[];\r\n        results: SearchResults<any>;\r\n        banner: Banner | undefined;\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        widgetParams: TWidgetParams & HitsConnectorParams<THit>;\r\n    };\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetSearchParameters(state: SearchParameters, _uiState: {\r\n        uiState: {\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            page?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare const _default_10: <THit extends NonNullable<object> = BaseHit>(widgetParams: InfiniteHitsWidgetParams<THit> & InfiniteHitsConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.infiniteHits\";\r\n    $$type: \"ais.infiniteHits\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & InfiniteHitsWidgetDescription[\"indexRenderState\"];\r\n    getWidgetRenderState({ results, helper, parent, state: existingState, instantSearchInstance, }: InitOptions | RenderOptions): {\r\n        hits: Hit<THit>[];\r\n        items: Hit<THit>[];\r\n        currentPageHits: Hit<THit>[];\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        banner: Banner | undefined;\r\n        results: SearchResults<any> | undefined;\r\n        showPrevious: () => void;\r\n        showMore: () => void;\r\n        isFirstPage: boolean;\r\n        isLastPage: boolean;\r\n        widgetParams: Partial<InfiniteHitsWidgetParams<BaseHit>> & InfiniteHitsConnectorParams<THit>;\r\n    };\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetUiState(uiState: {\r\n        page?: number | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    }, { searchParameters }: {\r\n        searchParameters: SearchParameters;\r\n        helper: AlgoliaSearchHelper;\r\n    }): {\r\n        page?: number | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    };\r\n    getWidgetSearchParameters(searchParameters: SearchParameters, { uiState }: {\r\n        uiState: {\r\n            page?: number | undefined;\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare const _default_11: PlacesWidget;\r\n\r\ndeclare const _default_12: <THit extends NonNullable<object> = BaseHit>(widgetParams: RelatedProductsWidgetParams<THit> & RelatedProductsConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.relatedProducts\";\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.relatedProducts\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: Partial<{\r\n            answers: WidgetRenderState<AnswersRenderState, AnswersConnectorParams>;\r\n        } & {\r\n            autocomplete: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams>;\r\n        } & {\r\n            breadcrumb: {\r\n                [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n            };\r\n        } & {\r\n            clearRefinements: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams>;\r\n        } & {\r\n            configure: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams>;\r\n        } & {\r\n            currentRefinements: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams>;\r\n        } & {\r\n            geoSearch: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>>;\r\n        } & {\r\n            hierarchicalMenu: {\r\n                [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            hits: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            hitsPerPage: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams>;\r\n        } & {\r\n            infiniteHits: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            menu: {\r\n                [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n            };\r\n        } & {\r\n            numericMenu: {\r\n                [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            pagination: WidgetRenderState<PaginationRenderState, PaginationConnectorParams>;\r\n        } & {\r\n            poweredBy: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams>;\r\n        } & {\r\n            queryRules: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams>;\r\n        } & {\r\n            range: {\r\n                [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n            };\r\n        } & {\r\n            ratingMenu: {\r\n                [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            refinementList: {\r\n                [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n            };\r\n        } & {\r\n            relevantSort: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams>;\r\n        } & {\r\n            searchBox: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams>;\r\n        } & {\r\n            sortBy: WidgetRenderState<SortByRenderState, SortByConnectorParams>;\r\n        } & {\r\n            stats: WidgetRenderState<StatsRenderState, StatsConnectorParams>;\r\n        } & {\r\n            toggleRefinement: {\r\n                [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n            };\r\n        } & {\r\n            voiceSearch: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams>;\r\n        } & {\r\n            analytics: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams>;\r\n        } & {\r\n            places: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams>;\r\n        }>;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<BaseHit>[] | Hit<THit>[];\r\n        widgetParams: Partial<RelatedProductsWidgetParams<BaseHit>> & RelatedProductsConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\ndeclare const _default_13: <THit extends NonNullable<object> = BaseHit>(widgetParams: TrendingItemsWidgetParams<THit> & TrendingItemsConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.trendingItems\";\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.trendingItems\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: Partial<{\r\n            answers: WidgetRenderState<AnswersRenderState, AnswersConnectorParams>;\r\n        } & {\r\n            autocomplete: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams>;\r\n        } & {\r\n            breadcrumb: {\r\n                [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n            };\r\n        } & {\r\n            clearRefinements: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams>;\r\n        } & {\r\n            configure: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams>;\r\n        } & {\r\n            currentRefinements: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams>;\r\n        } & {\r\n            geoSearch: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>>;\r\n        } & {\r\n            hierarchicalMenu: {\r\n                [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            hits: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            hitsPerPage: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams>;\r\n        } & {\r\n            infiniteHits: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            menu: {\r\n                [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n            };\r\n        } & {\r\n            numericMenu: {\r\n                [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            pagination: WidgetRenderState<PaginationRenderState, PaginationConnectorParams>;\r\n        } & {\r\n            poweredBy: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams>;\r\n        } & {\r\n            queryRules: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams>;\r\n        } & {\r\n            range: {\r\n                [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n            };\r\n        } & {\r\n            ratingMenu: {\r\n                [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            refinementList: {\r\n                [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n            };\r\n        } & {\r\n            relevantSort: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams>;\r\n        } & {\r\n            searchBox: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams>;\r\n        } & {\r\n            sortBy: WidgetRenderState<SortByRenderState, SortByConnectorParams>;\r\n        } & {\r\n            stats: WidgetRenderState<StatsRenderState, StatsConnectorParams>;\r\n        } & {\r\n            toggleRefinement: {\r\n                [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n            };\r\n        } & {\r\n            voiceSearch: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams>;\r\n        } & {\r\n            analytics: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams>;\r\n        } & {\r\n            places: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams>;\r\n        }>;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<THit>[];\r\n        widgetParams: Partial<TrendingItemsWidgetParams<BaseHit>> & TrendingItemsConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\ndeclare const _default_14: <THit extends NonNullable<object> = BaseHit>(widgetParams: FrequentlyBoughtTogetherWidgetParams<THit> & FrequentlyBoughtTogetherConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.frequentlyBoughtTogether\";\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.frequentlyBoughtTogether\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: Partial<{\r\n            answers: WidgetRenderState<AnswersRenderState, AnswersConnectorParams>;\r\n        } & {\r\n            autocomplete: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams>;\r\n        } & {\r\n            breadcrumb: {\r\n                [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n            };\r\n        } & {\r\n            clearRefinements: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams>;\r\n        } & {\r\n            configure: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams>;\r\n        } & {\r\n            currentRefinements: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams>;\r\n        } & {\r\n            geoSearch: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>>;\r\n        } & {\r\n            hierarchicalMenu: {\r\n                [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            hits: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            hitsPerPage: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams>;\r\n        } & {\r\n            infiniteHits: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            menu: {\r\n                [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n            };\r\n        } & {\r\n            numericMenu: {\r\n                [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            pagination: WidgetRenderState<PaginationRenderState, PaginationConnectorParams>;\r\n        } & {\r\n            poweredBy: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams>;\r\n        } & {\r\n            queryRules: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams>;\r\n        } & {\r\n            range: {\r\n                [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n            };\r\n        } & {\r\n            ratingMenu: {\r\n                [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            refinementList: {\r\n                [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n            };\r\n        } & {\r\n            relevantSort: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams>;\r\n        } & {\r\n            searchBox: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams>;\r\n        } & {\r\n            sortBy: WidgetRenderState<SortByRenderState, SortByConnectorParams>;\r\n        } & {\r\n            stats: WidgetRenderState<StatsRenderState, StatsConnectorParams>;\r\n        } & {\r\n            toggleRefinement: {\r\n                [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n            };\r\n        } & {\r\n            voiceSearch: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams>;\r\n        } & {\r\n            analytics: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams>;\r\n        } & {\r\n            places: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams>;\r\n        }>;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<THit>[];\r\n        widgetParams: Partial<FrequentlyBoughtTogetherWidgetParams<BaseHit>> & FrequentlyBoughtTogetherConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\ndeclare const _default_15: <THit extends NonNullable<object> = BaseHit>(widgetParams: LookingSimilarWidgetParams<THit> & LookingSimilarConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.lookingSimilar\";\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.lookingSimilar\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: Partial<{\r\n            answers: WidgetRenderState<AnswersRenderState, AnswersConnectorParams>;\r\n        } & {\r\n            autocomplete: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams>;\r\n        } & {\r\n            breadcrumb: {\r\n                [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n            };\r\n        } & {\r\n            clearRefinements: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams>;\r\n        } & {\r\n            configure: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams>;\r\n        } & {\r\n            currentRefinements: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams>;\r\n        } & {\r\n            geoSearch: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>>;\r\n        } & {\r\n            hierarchicalMenu: {\r\n                [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            hits: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            hitsPerPage: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams>;\r\n        } & {\r\n            infiniteHits: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            menu: {\r\n                [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n            };\r\n        } & {\r\n            numericMenu: {\r\n                [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            pagination: WidgetRenderState<PaginationRenderState, PaginationConnectorParams>;\r\n        } & {\r\n            poweredBy: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams>;\r\n        } & {\r\n            queryRules: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams>;\r\n        } & {\r\n            range: {\r\n                [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n            };\r\n        } & {\r\n            ratingMenu: {\r\n                [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            refinementList: {\r\n                [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n            };\r\n        } & {\r\n            relevantSort: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams>;\r\n        } & {\r\n            searchBox: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams>;\r\n        } & {\r\n            sortBy: WidgetRenderState<SortByRenderState, SortByConnectorParams>;\r\n        } & {\r\n            stats: WidgetRenderState<StatsRenderState, StatsConnectorParams>;\r\n        } & {\r\n            toggleRefinement: {\r\n                [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n            };\r\n        } & {\r\n            voiceSearch: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams>;\r\n        } & {\r\n            analytics: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams>;\r\n        } & {\r\n            places: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams>;\r\n        }>;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<THit>[];\r\n        widgetParams: Partial<LookingSimilarWidgetParams<BaseHit>> & LookingSimilarConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\ndeclare const _default_2: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<InfiniteHitsRenderState, TWidgetParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & InfiniteHitsConnectorParams<THit>) => {\r\n    $$type: \"ais.infiniteHits\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & InfiniteHitsWidgetDescription[\"indexRenderState\"];\r\n    getWidgetRenderState({ results, helper, parent, state: existingState, instantSearchInstance, }: InitOptions | RenderOptions): {\r\n        hits: Hit<THit>[];\r\n        items: Hit<THit>[];\r\n        currentPageHits: Hit<THit>[];\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        banner: Banner | undefined;\r\n        results: SearchResults<any> | undefined;\r\n        showPrevious: () => void;\r\n        showMore: () => void;\r\n        isFirstPage: boolean;\r\n        isLastPage: boolean;\r\n        widgetParams: TWidgetParams & InfiniteHitsConnectorParams<THit>;\r\n    };\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetUiState(uiState: {\r\n        page?: number | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    }, { searchParameters }: {\r\n        searchParameters: SearchParameters;\r\n        helper: AlgoliaSearchHelper;\r\n    }): {\r\n        page?: number | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    };\r\n    getWidgetSearchParameters(searchParameters: SearchParameters, { uiState }: {\r\n        uiState: {\r\n            page?: number | undefined;\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare const _default_3: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<RelatedProductsRenderState, RelatedProductsConnectorParams & TWidgetParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & RelatedProductsConnectorParams<THit>) => {\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.relatedProducts\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: IndexRenderState;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<BaseHit>[] | Hit<THit>[];\r\n        widgetParams: TWidgetParams & RelatedProductsConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\ndeclare const _default_4: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<TrendingItemsRenderState, TWidgetParams & TrendingItemsConnectorParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & TrendingItemsConnectorParams<THit>) => {\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.trendingItems\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: IndexRenderState;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<THit>[];\r\n        widgetParams: TWidgetParams & TrendingItemsConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\n/**\r\n * The **GeoSearch** connector provides the logic to build a widget that will display the results on a map. It also provides a way to search for results based on their position. The connector provides functions to manage the search experience (search on map interaction or control the interaction for example).\r\n *\r\n * @requirements\r\n *\r\n * Note that the GeoSearch connector uses the [geosearch](https://www.algolia.com/doc/guides/searching/geo-search) capabilities of Algolia. Your hits **must** have a `_geoloc` attribute in order to be passed to the rendering function.\r\n *\r\n * Currently, the feature is not compatible with multiple values in the _geoloc attribute.\r\n */\r\ndeclare const _default_5: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<GeoSearchRenderState, TWidgetParams & GeoSearchConnectorParams>, unmountFn?: Unmounter) => <THit extends GeoHit = GeoHit>(widgetParams: TWidgetParams & GeoSearchConnectorParams<THit>) => {\r\n    $$type: \"ais.geoSearch\";\r\n    init(initArgs: InitOptions): void;\r\n    render(renderArgs: RenderOptions): void;\r\n    getWidgetRenderState(renderOptions: InitOptions | RenderOptions): {\r\n        items: GeoHit<THit>[];\r\n        position: {\r\n            lat: number;\r\n            lng: number;\r\n        } | undefined;\r\n        currentRefinement: {\r\n            northEast: {\r\n                lat: number;\r\n                lng: number;\r\n            };\r\n            southWest: {\r\n                lat: number;\r\n                lng: number;\r\n            };\r\n        } | undefined;\r\n        refine: ({ northEast: ne, southWest: sw }: Bounds) => void;\r\n        sendEvent: SendEventForHits;\r\n        clearMapRefinement: () => void;\r\n        isRefinedWithMap: () => boolean;\r\n        toggleRefineOnMapMove: () => void;\r\n        isRefineOnMapMove: () => boolean;\r\n        setMapMoveSinceLastRefine: () => void;\r\n        hasMapMoveSinceLastRefine: () => boolean;\r\n        widgetParams: TWidgetParams & GeoSearchConnectorParams<THit>;\r\n    };\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & GeoSearchWidgetDescription[\"indexRenderState\"];\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetUiState(uiState: {\r\n        geoSearch?: {\r\n            /**\r\n             * The rectangular area in geo coordinates.\r\n             * The rectangle is defined by two diagonally opposite points,\r\n             * hence by 4 floats separated by commas.\r\n             *\r\n             * @example '47.3165,4.9665,47.3424,5.0201'\r\n             */\r\n            boundingBox: string;\r\n        } | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        page?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    }, { searchParameters }: {\r\n        searchParameters: SearchParameters;\r\n        helper: AlgoliaSearchHelper;\r\n    }): {\r\n        geoSearch?: {\r\n            /**\r\n             * The rectangular area in geo coordinates.\r\n             * The rectangle is defined by two diagonally opposite points,\r\n             * hence by 4 floats separated by commas.\r\n             *\r\n             * @example '47.3165,4.9665,47.3424,5.0201'\r\n             */\r\n            boundingBox: string;\r\n        } | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        page?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    };\r\n    getWidgetSearchParameters(searchParameters: SearchParameters, { uiState }: {\r\n        uiState: {\r\n            geoSearch?: {\r\n                /**\r\n                 * The rectangular area in geo coordinates.\r\n                 * The rectangle is defined by two diagonally opposite points,\r\n                 * hence by 4 floats separated by commas.\r\n                 *\r\n                 * @example '47.3165,4.9665,47.3424,5.0201'\r\n                 */\r\n                boundingBox: string;\r\n            } | undefined;\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            page?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare const _default_6: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<FrequentlyBoughtTogetherRenderState, TWidgetParams & FrequentlyBoughtTogetherConnectorParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & FrequentlyBoughtTogetherConnectorParams<THit>) => {\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.frequentlyBoughtTogether\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: IndexRenderState;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<THit>[];\r\n        widgetParams: TWidgetParams & FrequentlyBoughtTogetherConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\ndeclare const _default_7: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<LookingSimilarRenderState, TWidgetParams & LookingSimilarConnectorParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & LookingSimilarConnectorParams<THit>) => {\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.lookingSimilar\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: IndexRenderState;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<THit>[];\r\n        widgetParams: TWidgetParams & LookingSimilarConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\n/**\r\n * The **GeoSearch** widget displays the list of results from the search on a Google Maps. It also provides a way to search for results based on their position. The widget also provide some of the common GeoSearch patterns like search on map interaction.\r\n *\r\n * @requirements\r\n *\r\n * Note that the GeoSearch widget uses the [geosearch](https://www.algolia.com/doc/guides/searching/geo-search) capabilities of Algolia. Your hits **must** have a `_geoloc` attribute in order to be displayed on the map.\r\n *\r\n * Currently, the feature is not compatible with multiple values in the _geoloc attribute.\r\n *\r\n * You are also responsible for loading the Google Maps library, it's not shipped with InstantSearch. You need to load the Google Maps library and pass a reference to the widget. You can find more information about how to install the library in [the Google Maps documentation](https://developers.google.com/maps/documentation/javascript/tutorial).\r\n *\r\n * Don't forget to explicitly set the `height` of the map container (default class `.ais-geo-search--map`), otherwise it won't be shown (it's a requirement of Google Maps).\r\n */\r\ndeclare const _default_8: <THit extends GeoHit = GeoHit>(widgetParams: GeoSearchWidgetParams<THit> & GeoSearchConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.geoSearch\";\r\n    $$type: \"ais.geoSearch\";\r\n    init(initArgs: InitOptions): void;\r\n    render(renderArgs: RenderOptions): void;\r\n    getWidgetRenderState(renderOptions: InitOptions | RenderOptions): {\r\n        items: GeoHit<THit>[];\r\n        position: {\r\n            lat: number;\r\n            lng: number;\r\n        } | undefined;\r\n        currentRefinement: {\r\n            northEast: {\r\n                lat: number;\r\n                lng: number;\r\n            };\r\n            southWest: {\r\n                lat: number;\r\n                lng: number;\r\n            };\r\n        } | undefined;\r\n        refine: ({ northEast: ne, southWest: sw }: {\r\n            northEast: GeoLoc;\r\n            southWest: GeoLoc;\r\n        }) => void;\r\n        sendEvent: SendEventForHits;\r\n        clearMapRefinement: () => void;\r\n        isRefinedWithMap: () => boolean;\r\n        toggleRefineOnMapMove: () => void;\r\n        isRefineOnMapMove: () => boolean;\r\n        setMapMoveSinceLastRefine: () => void;\r\n        hasMapMoveSinceLastRefine: () => boolean;\r\n        widgetParams: {\r\n            renderState: {\r\n                templateProps?: PreparedTemplateProps<GeoSearchTemplates>;\r\n                isUserInteraction?: boolean;\r\n                isPendingRefine?: boolean;\r\n                markers?: any[];\r\n            };\r\n            container: HTMLElement;\r\n            googleReference: GeoSearchWidgetParams[\"googleReference\"];\r\n            initialZoom: GeoSearchWidgetParams[\"initialZoom\"];\r\n            initialPosition: GeoSearchWidgetParams[\"initialPosition\"];\r\n            templates: Partial<{\r\n                /** Template to use for the marker. */\r\n                HTMLMarker: Template<GeoHit>;\r\n                /** Template for the reset button. */\r\n                reset: Template;\r\n                /** Template for the toggle label. */\r\n                toggle: Template;\r\n                /** Template for the redo button. */\r\n                redo: Template;\r\n            }>;\r\n            cssClasses: ComponentCSSClasses<Partial<{\r\n            /** The root div of the widget. */\r\n            root: string | string[];\r\n            /** The map container of the widget. */\r\n            map: string | string[];\r\n            /** The control element of the widget. */\r\n            control: string | string[];\r\n            /** The label of the control element. */\r\n            label: string | string[];\r\n            /** The selected label of the control element. */\r\n            selectedLabel: string | string[];\r\n            /** The input of the control element. */\r\n            input: string | string[];\r\n            /** The redo search button. */\r\n            redo: string | string[];\r\n            /** The disabled redo search button. */\r\n            disabledRedo: string | string[];\r\n            /** The reset refinement button. */\r\n            reset: string | string[];\r\n            }> | undefined>;\r\n            createMarker: CreateMarker;\r\n            markerOptions: GeoSearchMarker<google.maps.MarkerOptions | Partial<HTMLMarkerArguments>>;\r\n            enableRefine: GeoSearchWidgetParams[\"enableRefine\"];\r\n            enableClearMapRefinement: GeoSearchWidgetParams[\"enableClearMapRefinement\"];\r\n            enableRefineControl: GeoSearchWidgetParams[\"enableRefineControl\"];\r\n        } & GeoSearchConnectorParams<THit>;\r\n    };\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & GeoSearchWidgetDescription[\"indexRenderState\"];\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetUiState(uiState: {\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        page?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    }, { searchParameters }: {\r\n        searchParameters: SearchParameters;\r\n        helper: AlgoliaSearchHelper;\r\n    }): {\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        page?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    };\r\n    getWidgetSearchParameters(searchParameters: SearchParameters, { uiState }: {\r\n        uiState: {\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            page?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare const _default_9: <THit extends NonNullable<object> = BaseHit>(widgetParams: HitsWidgetParams<THit> & HitsConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.hits\";\r\n    $$type: \"ais.hits\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & HitsWidgetDescription[\"indexRenderState\"];\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions): {\r\n        hits: never[];\r\n        items: never[];\r\n        results: undefined;\r\n        banner: undefined;\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        widgetParams: Partial<HitsWidgetParams<BaseHit>> & HitsConnectorParams<THit>;\r\n    } | {\r\n        hits: Hit<BaseHit>[] | Hit<THit>[];\r\n        items: Hit<BaseHit>[] | Hit<THit>[];\r\n        results: SearchResults<any>;\r\n        banner: Banner | undefined;\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        widgetParams: Partial<HitsWidgetParams<BaseHit>> & HitsConnectorParams<THit>;\r\n    };\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetSearchParameters(state: SearchParameters, _uiState: {\r\n        uiState: {\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            page?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare type DisposeOptions = {\r\n    helper: AlgoliaSearchHelper;\r\n    state: SearchParameters;\r\n    recommendState: RecommendParameters;\r\n    parent: IndexWidget;\r\n};\r\n\r\ndeclare const dynamicWidgets: DynamicWidgetsWidget;\r\n\r\ndeclare type DynamicWidgetsConnector = Connector<DynamicWidgetsWidgetDescription, DynamicWidgetsConnectorParams>;\r\n\r\ndeclare type DynamicWidgetsConnectorParams = {\r\n    /**\r\n     * An array of widgets, displayed in the order defined by `facetOrdering`.\r\n     */\r\n    widgets: Widget[];\r\n    /**\r\n     * Function to return a fallback widget when an attribute isn't found in\r\n     * `widgets`.\r\n     */\r\n    fallbackWidget?: (args: {\r\n        /** The attribute name to create a widget for. */\r\n        attribute: string;\r\n    }) => Widget;\r\n    /**\r\n     * Function to transform the items to render.\r\n     * The function also exposes the full search response.\r\n     */\r\n    transformItems?: TransformItems<string, Omit<TransformItemsMetadata, 'results'> & {\r\n        results: NonNullable<TransformItemsMetadata['results']>;\r\n    }>;\r\n    /**\r\n     * To prevent unneeded extra network requests when widgets mount or unmount,\r\n     * we request all facet values by default. If you want to only request the\r\n     * facet values that are needed, you can set this option to the list of\r\n     * attributes you want to display.\r\n     *\r\n     * If `facets` is set to `['*']`, we request all facet values.\r\n     *\r\n     * Any facets that are requested due to the `facetOrdering` result are always\r\n     * requested by the widget that mounted itself.\r\n     *\r\n     * Setting `facets` to a value other than `['*']` will only prevent extra\r\n     * requests if all potential facets are listed.\r\n     *\r\n     * @default ['*']\r\n     */\r\n    facets?: ['*'] | string[];\r\n    /**\r\n     * If you have more than 20 facet values pinned, you need to increase the\r\n     * maxValuesPerFacet to at least that value.\r\n     *\r\n     * @default 20\r\n     */\r\n    maxValuesPerFacet?: number;\r\n};\r\n\r\ndeclare type DynamicWidgetsRenderState = {\r\n    attributesToRender: string[];\r\n};\r\n\r\ndeclare type DynamicWidgetsWidget = WidgetFactory<DynamicWidgetsWidgetDescription & {\r\n    $$widgetType: 'ais.dynamicWidgets';\r\n}, Omit<DynamicWidgetsConnectorParams, 'widgets' | 'fallbackWidget'>, DynamicWidgetsWidgetParams>;\r\n\r\ndeclare type DynamicWidgetsWidgetDescription = {\r\n    $$type: 'ais.dynamicWidgets';\r\n    renderState: DynamicWidgetsRenderState;\r\n    indexRenderState: {\r\n        dynamicWidgets: DynamicWidgetsRenderState;\r\n    };\r\n};\r\n\r\ndeclare type DynamicWidgetsWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * An array of widget creator functions, displayed in the order defined by\r\n     * `facetOrdering`.\r\n     */\r\n    widgets: Array<(container: HTMLElement) => Widget>;\r\n    /**\r\n     * Function to return a fallback widget when an attribute isn't found in\r\n     * `widgets`.\r\n     */\r\n    fallbackWidget?: (args: {\r\n        /** The attribute name to create a widget for. */\r\n        attribute: string;\r\n        /** CSS Selector or HTMLElement to insert the widget */\r\n        container: HTMLElement;\r\n    }) => Widget;\r\n};\r\n\r\ndeclare type Expand<T> = T extends infer O ? {\r\n    [K in keyof O]: O[K];\r\n} : never;\r\n\r\n/** @deprecated answers is no longer supported */\r\ndeclare const EXPERIMENTAL_answers: AnswersWidget;\r\n\r\n/** @deprecated use relatedItems instead */\r\ndeclare const EXPERIMENTAL_configureRelatedItems: ConfigureRelatedItemsWidget;\r\n\r\n/** @deprecated answers is no longer supported */\r\ndeclare const EXPERIMENTAL_connectAnswers: AnswersConnector;\r\n\r\n/** @deprecated use connectRelatedItems instead */\r\ndeclare const EXPERIMENTAL_connectConfigureRelatedItems: ConfigureRelatedItemsConnector;\r\n\r\n/** @deprecated use connectDynamicWidgets */\r\ndeclare const EXPERIMENTAL_connectDynamicWidgets: DynamicWidgetsConnector;\r\n\r\n/** @deprecated use dynamicWidgets */\r\ndeclare const EXPERIMENTAL_dynamicWidgets: DynamicWidgetsWidget;\r\n\r\ndeclare type FacetValue = string | boolean | number;\r\n\r\ndeclare type FrequentlyBoughtTogetherConnectorParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The objectIDs of the items to get the frequently bought together items for.\r\n     */\r\n    objectIDs: string[];\r\n    /**\r\n     * Threshold for the recommendations confidence score (between 0 and 100). Only recommendations with a greater score are returned.\r\n     */\r\n    threshold?: number;\r\n    /**\r\n     * The maximum number of recommendations to return.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * Parameters to pass to the request.\r\n     */\r\n    queryParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * Whether to escape HTML tags from items string values.\r\n     *\r\n     * @default true\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<Hit<THit>, {\r\n        results: RecommendResponse<AlgoliaHit<THit>>;\r\n    }>;\r\n};\r\n\r\ndeclare type FrequentlyBoughtTogetherCSSClasses = Partial<RecommendClassNames>;\r\n\r\ndeclare type FrequentlyBoughtTogetherRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The matched recommendations from Algolia API.\r\n     */\r\n    items: Array<Hit<THit>>;\r\n    /**\r\n     * Sends an event to the Insights middleware.\r\n     */\r\n    sendEvent: SendEventForHits;\r\n};\r\n\r\ndeclare type FrequentlyBoughtTogetherTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\r\n    /**\r\n     * Template to use when there are no results.\r\n     */\r\n    empty: Template<RecommendResponse<Hit<THit>>>;\r\n    /**\r\n     * Template to use for the header of the widget.\r\n     */\r\n    header: Template<Pick<Parameters<NonNullable<FrequentlyBoughtTogetherProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {\r\n        cssClasses: RecommendClassNames;\r\n    }>;\r\n    /**\r\n     * Template to use for each result. This template will receive an object containing a single record.\r\n     */\r\n    item: TemplateWithBindEvent<Hit<THit>>;\r\n    /**\r\n     * Template to use to wrap all items.\r\n     */\r\n    layout: Template<Pick<Parameters<NonNullable<FrequentlyBoughtTogetherProps<Hit<THit>>['layout']>>[0], 'items'> & {\r\n        templates: {\r\n            item: FrequentlyBoughtTogetherProps<Hit<THit>>['itemComponent'];\r\n        };\r\n        cssClasses: Pick<FrequentlyBoughtTogetherCSSClasses, 'list' | 'item'>;\r\n    }>;\r\n}>;\r\n\r\ndeclare type FrequentlyBoughtTogetherWidgetParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: FrequentlyBoughtTogetherTemplates<THit>;\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: FrequentlyBoughtTogetherCSSClasses;\r\n};\r\n\r\ndeclare type GeoHit<THit extends NonNullable<object> = BaseHit> = Hit<THit> & Required<Pick<Hit, '_geoloc'>>;\r\n\r\ndeclare type GeoLoc = {\r\n    lat: number;\r\n    lng: number;\r\n};\r\n\r\ndeclare type GeoSearchConnectorParams<THit extends GeoHit = GeoHit> = {\r\n    /**\r\n     * If true, refine will be triggered as you move the map.\r\n     * @default true\r\n     */\r\n    enableRefineOnMapMove?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     * @default items => items\r\n     */\r\n    transformItems?: TransformItems<GeoHit<THit>>;\r\n};\r\n\r\ndeclare type GeoSearchCSSClasses = Partial<{\r\n    /** The root div of the widget. */\r\n    root: string | string[];\r\n    /** The map container of the widget. */\r\n    map: string | string[];\r\n    /** The control element of the widget. */\r\n    control: string | string[];\r\n    /** The label of the control element. */\r\n    label: string | string[];\r\n    /** The selected label of the control element. */\r\n    selectedLabel: string | string[];\r\n    /** The input of the control element. */\r\n    input: string | string[];\r\n    /** The redo search button. */\r\n    redo: string | string[];\r\n    /** The disabled redo search button. */\r\n    disabledRedo: string | string[];\r\n    /** The reset refinement button. */\r\n    reset: string | string[];\r\n}>;\r\n\r\ndeclare type GeoSearchMarker<TOptions, THit extends GeoHit = GeoHit> = {\r\n    /**\r\n     * Function used to create the options passed to the Google Maps marker.\r\n     * See the documentation for more information:\r\n     * https://developers.google.com/maps/documentation/javascript/reference/3/#MarkerOptions\r\n     */\r\n    createOptions?: (item: THit) => TOptions;\r\n    /**\r\n     * Object that takes an event type (ex: `click`, `mouseover`) as key and a\r\n     * listener as value. The listener is provided with an object that contains:\r\n     * `event`, `item`, `marker`, `map`.\r\n     */\r\n    events: {\r\n        [key: string]: (event: {\r\n            item: any;\r\n            marker: any;\r\n            map: any;\r\n            event: any;\r\n        }) => void;\r\n    };\r\n};\r\n\r\ndeclare type GeoSearchRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * Reset the current bounding box refinement.\r\n     */\r\n    clearMapRefinement: () => void;\r\n    /**\r\n     * The current bounding box of the search.\r\n     */\r\n    currentRefinement?: Bounds;\r\n    /**\r\n     * Return true if the map has move since the last refinement.\r\n     */\r\n    hasMapMoveSinceLastRefine: () => boolean;\r\n    /**\r\n     * Return true if the current refinement is set with the map bounds.\r\n     */\r\n    isRefinedWithMap: () => boolean;\r\n    /**\r\n     * Return true if the user is able to refine on map move.\r\n     */\r\n    isRefineOnMapMove: () => boolean;\r\n    /**\r\n     * The matched hits from Algolia API.\r\n     */\r\n    items: Array<GeoHit<THit>>;\r\n    /**\r\n     * The current position of the search.\r\n     */\r\n    position?: GeoLoc;\r\n    /**\r\n     * Sets a bounding box to filter the results from the given map bounds.\r\n     */\r\n    refine: (bounds: Bounds) => void;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEventForHits;\r\n    /**\r\n     * Set the fact that the map has moved since the last refinement, should be\r\n     * called on each map move. The call to the function triggers a new rendering\r\n     * only when the value change.\r\n     */\r\n    setMapMoveSinceLastRefine: () => void;\r\n    /**\r\n     * Toggle the fact that the user is able to refine on map move.\r\n     */\r\n    toggleRefineOnMapMove: () => void;\r\n};\r\n\r\ndeclare type GeoSearchTemplates<THit extends GeoHit = GeoHit> = Partial<{\r\n    /** Template to use for the marker. */\r\n    HTMLMarker: Template<THit>;\r\n    /** Template for the reset button. */\r\n    reset: Template;\r\n    /** Template for the toggle label. */\r\n    toggle: Template;\r\n    /** Template for the redo button. */\r\n    redo: Template;\r\n}>;\r\n\r\ndeclare type GeoSearchWidgetDescription<THit extends GeoHit = GeoHit> = {\r\n    $$type: 'ais.geoSearch';\r\n    renderState: GeoSearchRenderState<THit>;\r\n    indexRenderState: {\r\n        geoSearch: WidgetRenderState<GeoSearchRenderState<THit>, GeoSearchConnectorParams<THit>>;\r\n    };\r\n    indexUiState: {\r\n        geoSearch: {\r\n            /**\r\n             * The rectangular area in geo coordinates.\r\n             * The rectangle is defined by two diagonally opposite points,\r\n             * hence by 4 floats separated by commas.\r\n             *\r\n             * @example '47.3165,4.9665,47.3424,5.0201'\r\n             */\r\n            boundingBox: string;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type GeoSearchWidgetParams<THit extends GeoHit = GeoHit> = {\r\n    /**\r\n     * By default the map will set the zoom accordingly to the markers displayed on it.\r\n     * When we refine it may happen that the results are empty. For those situations we\r\n     * need to provide a zoom to render the map.\r\n     * @default 1\r\n     */\r\n    initialZoom?: number;\r\n    /**\r\n     * By default the map will set the position accordingly to the markers displayed on it.\r\n     * When we refine it may happen that the results are empty. For those situations we need\r\n     * to provide a position to render the map. This option is ignored when the `position`\r\n     * is provided.\r\n     * @default { lat: 0, lng: 0 }\r\n     */\r\n    initialPosition?: GeoLoc;\r\n    /** Templates to use for the widget. */\r\n    templates?: GeoSearchTemplates<THit>;\r\n    /** CSS classes to add to the wrapping elements. */\r\n    cssClasses?: GeoSearchCSSClasses;\r\n    /**\r\n     * Options for customize the built-in Google Maps marker. This option is\r\n     * ignored when the `customHTMLMarker` is provided.\r\n     */\r\n    builtInMarker?: Partial<GeoSearchMarker<google.maps.MarkerOptions>>;\r\n    /**\r\n     * Options to customize the HTML marker. We provide an alternative to the\r\n     * built-in Google Maps marker in order to have a full control of the marker\r\n     * rendering. You can use plain HTML to build your marker.\r\n     */\r\n    customHTMLMarker?: Partial<GeoSearchMarker<Partial<HTMLMarkerArguments>>> | boolean;\r\n    /**\r\n     * If true, the map is used to search - otherwise it's for display purposes only.\r\n     * @default true\r\n     */\r\n    enableRefine?: boolean;\r\n    /**\r\n     * If true, a button is displayed on the map when the refinement is coming from\r\n     * the map in order to remove it.\r\n     * @default true\r\n     */\r\n    enableClearMapRefinement?: boolean;\r\n    /**\r\n     * If true, the user can toggle the option `enableRefineOnMapMove` directly from the map.\r\n     * @default true\r\n     */\r\n    enableRefineControl?: boolean;\r\n    /**\r\n     * Option forwarded to the Google Maps constructor.\r\n     * See the documentation for more information:\r\n     * https://developers.google.com/maps/documentation/javascript/reference/3/#MapOptions\r\n     */\r\n    mapOptions?: google.maps.MapOptions;\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Reference to the global `window.google` object.\r\n     * See [the documentation](https://developers.google.com/maps/documentation/javascript/tutorial) for more information.\r\n     */\r\n    googleReference: typeof window['google'];\r\n};\r\n\r\n/**\r\n * @deprecated This function will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\r\n */\r\ndeclare function getInsightsAnonymousUserToken(): string | undefined;\r\n\r\ndeclare function getInsightsAnonymousUserTokenInternal(): string | undefined;\r\n\r\ndeclare type GetWidgetRenderState<TWidgetFactory extends AnyWidgetFactory> = ReturnType<TWidgetFactory>['getWidgetRenderState'] extends (renderOptions: any) => infer TRenderState ? TRenderState extends Record<string, unknown> ? TRenderState : never : Record<string, unknown>;\r\n\r\ndeclare namespace helpers {\r\n    export {\r\n        reverseHighlight,\r\n        reverseSnippet,\r\n        highlight,\r\n        snippet,\r\n        insights,\r\n        getInsightsAnonymousUserToken,\r\n        getInsightsAnonymousUserTokenInternal,\r\n        HighlightOptions,\r\n        ReverseHighlightOptions,\r\n        SnippetOptions,\r\n        ReverseSnippetOptions\r\n    }\r\n}\r\n\r\ndeclare const hierarchicalMenu: HierarchicalMenuWidget;\r\n\r\ndeclare type HierarchicalMenuConnector = Connector<HierarchicalMenuWidgetDescription, HierarchicalMenuConnectorParams>;\r\n\r\ndeclare type HierarchicalMenuConnectorParams = {\r\n    /**\r\n     *  Attributes to use to generate the hierarchy of the menu.\r\n     */\r\n    attributes: string[];\r\n    /**\r\n     * Separator used in the attributes to separate level values.\r\n     */\r\n    separator?: string;\r\n    /**\r\n     * Prefix path to use if the first level is not the root level.\r\n     */\r\n    rootPath?: string | null;\r\n    /**\r\n     * Show the siblings of the selected parent levels of the current refined value. This\r\n     * does not impact the root level.\r\n     */\r\n    showParentLevel?: boolean;\r\n    /**\r\n     * Max number of values to display.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * Whether to display the \"show more\" button.\r\n     */\r\n    showMore?: boolean;\r\n    /**\r\n     * Max number of values to display when showing more.\r\n     */\r\n    showMoreLimit?: number;\r\n    /**\r\n     * How to sort refinements. Possible values: `count|isRefined|name:asc|name:desc`.\r\n     * You can also use a sort function that behaves like the standard Javascript [compareFunction](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Syntax).\r\n     *\r\n     * If a facetOrdering is set in the index settings, it is used when sortBy isn't passed\r\n     */\r\n    sortBy?: SortBy<SearchResults.HierarchicalFacet>;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<HierarchicalMenuItem>;\r\n};\r\n\r\ndeclare type HierarchicalMenuCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to the child list element.\r\n     */\r\n    childList: string | string[];\r\n    /**\r\n     * CSS class to add to each item element.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add to each selected item element.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS class to add to each parent item element.\r\n     */\r\n    parentItem: string | string[];\r\n    /**\r\n     * CSS class to add to each link (when using the default template).\r\n     */\r\n    link: string | string[];\r\n    /**\r\n     * CSS class to add to the link of each selected item element (when using the default template).\r\n     */\r\n    selectedItemLink: string | string[];\r\n    /**\r\n     * CSS class to add to each label (when using the default template).\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to each count element (when using the default template).\r\n     */\r\n    count: string | string[];\r\n    /**\r\n     * CSS class to add to the show more element.\r\n     */\r\n    showMore: string | string[];\r\n    /**\r\n     * CSS class to add to the disabled show more element.\r\n     */\r\n    disabledShowMore: string | string[];\r\n}>;\r\n\r\ndeclare type HierarchicalMenuItem = {\r\n    /**\r\n     * Value of the menu item.\r\n     */\r\n    value: string;\r\n    /**\r\n     * Human-readable value of the menu item.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Number of matched results after refinement is applied.\r\n     */\r\n    count: number;\r\n    /**\r\n     * Indicates if the refinement is applied.\r\n     */\r\n    isRefined: boolean;\r\n    /**\r\n     * n+1 level of items, same structure HierarchicalMenuItem\r\n     */\r\n    data: HierarchicalMenuItem[] | null;\r\n};\r\n\r\ndeclare type HierarchicalMenuRenderState = {\r\n    /**\r\n     * Creates an url for the next state for a clicked item.\r\n     */\r\n    createURL: CreateURL<string>;\r\n    /**\r\n     * Values to be rendered.\r\n     */\r\n    items: HierarchicalMenuItem[];\r\n    /**\r\n     * Sets the path of the hierarchical filter and triggers a new search.\r\n     */\r\n    refine: (value: string) => void;\r\n    /**\r\n     *  Indicates if search state can be refined.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * True if the menu is displaying all the menu items.\r\n     */\r\n    isShowingMore: boolean;\r\n    /**\r\n     * Toggles the number of values displayed between `limit` and `showMoreLimit`.\r\n     */\r\n    toggleShowMore: () => void;\r\n    /**\r\n     * `true` if the toggleShowMore button can be activated (enough items to display more or\r\n     * already displaying more than `limit` items)\r\n     */\r\n    canToggleShowMore: boolean;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEventForFacet;\r\n};\r\n\r\ndeclare type HierarchicalMenuTemplates = Partial<{\r\n    /**\r\n     * Item template, provided with `name`, `count`, `isRefined`, `url` data properties.\r\n     */\r\n    item: Template<{\r\n        name: string;\r\n        count: number;\r\n        isRefined: boolean;\r\n        url: string;\r\n        label: string;\r\n        cssClasses: HierarchicalMenuCSSClasses;\r\n    }>;\r\n    /**\r\n     * Template used for the show more text, provided with `isShowingMore` data property.\r\n     */\r\n    showMoreText: Template<{\r\n        isShowingMore: boolean;\r\n    }>;\r\n}>;\r\n\r\n/**\r\n * The hierarchical menu widget is used to create a navigation based on a hierarchy of facet attributes.\r\n *\r\n * It is commonly used for categories with subcategories.\r\n *\r\n * All attributes (lvl0, lvl1 here) must be declared as [attributes for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting) in your\r\n * Algolia settings.\r\n *\r\n * By default, the separator we expect is ` > ` (with spaces) but you can use\r\n * a different one by using the `separator` option.\r\n * @requirements\r\n * Your objects must be formatted in a specific way to be\r\n * able to display hierarchical menus. Here's an example:\r\n *\r\n * ```javascript\r\n * {\r\n *   \"objectID\": \"123\",\r\n *   \"name\": \"orange\",\r\n *   \"categories\": {\r\n *     \"lvl0\": \"fruits\",\r\n *     \"lvl1\": \"fruits > citrus\"\r\n *   }\r\n * }\r\n * ```\r\n *\r\n * Every level must be specified entirely.\r\n * It's also possible to have multiple values per level, for example:\r\n *\r\n * ```javascript\r\n * {\r\n *   \"objectID\": \"123\",\r\n *   \"name\": \"orange\",\r\n *   \"categories\": {\r\n *     \"lvl0\": [\"fruits\", \"vitamins\"],\r\n *     \"lvl1\": [\"fruits > citrus\", \"vitamins > C\"]\r\n *   }\r\n * }\r\n * ```\r\n * @type {WidgetFactory}\r\n * @devNovel HierarchicalMenu\r\n * @category filter\r\n * @param {HierarchicalMenuWidgetParams} widgetParams The HierarchicalMenu widget options.\r\n * @return {Widget} A new HierarchicalMenu widget instance.\r\n * @example\r\n * search.addWidgets([\r\n *   instantsearch.widgets.hierarchicalMenu({\r\n *     container: '#hierarchical-categories',\r\n *     attributes: ['hierarchicalCategories.lvl0', 'hierarchicalCategories.lvl1', 'hierarchicalCategories.lvl2'],\r\n *   })\r\n * ]);\r\n */\r\ndeclare type HierarchicalMenuWidget = WidgetFactory<HierarchicalMenuWidgetDescription & {\r\n    $$widgetType: 'ais.hierarchicalMenu';\r\n}, HierarchicalMenuConnectorParams, HierarchicalMenuWidgetParams>;\r\n\r\ndeclare type HierarchicalMenuWidgetDescription = {\r\n    $$type: 'ais.hierarchicalMenu';\r\n    renderState: HierarchicalMenuRenderState;\r\n    indexRenderState: {\r\n        hierarchicalMenu: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        hierarchicalMenu: {\r\n            [rootAttribute: string]: string[];\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type HierarchicalMenuWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Array of attributes to use to generate the hierarchy of the menu.\r\n     */\r\n    attributes: string[];\r\n    /**\r\n     * Separator used in the attributes to separate level values.\r\n     */\r\n    separator?: string;\r\n    /**\r\n     * Prefix path to use if the first level is not the root level.\r\n     */\r\n    rootPath?: string;\r\n    /**\r\n     * Show the siblings of the selected parent level of the current refined value.\r\n     *\r\n     * With `showParentLevel` set to `true` (default):\r\n     * - Parent lvl0\r\n     *   - **lvl1**\r\n     *     - **lvl2**\r\n     *     - lvl2\r\n     *     - lvl2\r\n     *   - lvl 1\r\n     *   - lvl 1\r\n     * - Parent lvl0\r\n     * - Parent lvl0\r\n     *\r\n     * With `showParentLevel` set to `false`:\r\n     * - Parent lvl0\r\n     *   - **lvl1**\r\n     *     - **lvl2**\r\n     * - Parent lvl0\r\n     * - Parent lvl0\r\n     */\r\n    showParentLevel?: boolean;\r\n    /**\r\n     * Max number of values to display.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * Whether to display the \"show more\" button.\r\n     */\r\n    showMore?: boolean;\r\n    /**\r\n     * Max number of values to display when showing more.\r\n     * does not impact the root level.\r\n     */\r\n    showMoreLimit?: number;\r\n    /**\r\n     * How to sort refinements. Possible values: `count|isRefined|name:asc|name:desc`.\r\n     * You can also use a sort function that behaves like the standard Javascript [compareFunction](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Syntax).\r\n     */\r\n    sortBy?: SortBy<HierarchicalMenuItem>;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<HierarchicalMenuItem>;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: HierarchicalMenuTemplates;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: HierarchicalMenuCSSClasses;\r\n};\r\n\r\n/**\r\n * @deprecated use html tagged templates and the Highlight component instead\r\n */\r\ndeclare function highlight({ attribute, highlightedTagName, hit, cssClasses, }: HighlightOptions): string;\r\n\r\ndeclare function Highlight_2<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: HighlightProps<THit>): h.JSX.Element;\r\n\r\ndeclare type HighlightClassNames = HighlightClassNames_2;\r\n\r\ndeclare type HighlightOptions = {\r\n    attribute: string | string[];\r\n    highlightedTagName?: string;\r\n    hit: Partial<Hit>;\r\n    cssClasses?: Partial<{\r\n        highlighted: string;\r\n    }>;\r\n};\r\n\r\ndeclare type HighlightProps<THit extends Hit<BaseHit>> = {\r\n    hit: THit;\r\n    attribute: keyof THit | string[];\r\n    cssClasses?: HighlightProps_2['classNames'];\r\n} & PartialKeys<Omit<HighlightProps_2, 'parts' | 'classNames'>, 'highlightedTagName' | 'nonHighlightedTagName' | 'separator'>;\r\n\r\ndeclare type HighlightProps_2 = Omit<HighlightProps_3, 'classNames'> & {\r\n    classNames?: Partial<HighlightClassNames>;\r\n};\r\n\r\ndeclare function historyRouter<TRouteState = UiState>({ createURL, parseURL, writeDelay, windowTitle, getLocation, start, dispose, push, cleanUrlOnDispose, }?: Partial<BrowserHistoryArgs<TRouteState>>): BrowserHistory<TRouteState>;\r\n\r\ndeclare type Hit<THit extends NonNullable<object> = Record<string, any>> = {\r\n    __position: number;\r\n    __queryID?: string;\r\n} & AlgoliaHit<THit>;\r\n\r\ndeclare type HitAttributeHighlightResult = {\r\n    value: string;\r\n    matchLevel: 'none' | 'partial' | 'full';\r\n    matchedWords: string[];\r\n    fullyHighlighted?: boolean;\r\n};\r\n\r\ndeclare type HitAttributeSnippetResult = Pick<HitAttributeHighlightResult, 'value' | 'matchLevel'>;\r\n\r\ndeclare type HitHighlightResult = {\r\n    [attribute: string]: HitAttributeHighlightResult | HitAttributeHighlightResult[] | HitHighlightResult[] | HitHighlightResult;\r\n};\r\n\r\ndeclare type HitsConnectorParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * Whether to escape HTML tags from hits string values.\r\n     *\r\n     * @default true\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<Hit<THit>>;\r\n};\r\n\r\ndeclare type HitsCSSClasses = Partial<HitsClassNames>;\r\n\r\ndeclare type HitSnippetResult = {\r\n    [attribute: string]: HitAttributeSnippetResult[] | HitSnippetResult[] | HitAttributeSnippetResult | HitSnippetResult;\r\n};\r\n\r\ndeclare const hitsPerPage: HitsPerPageWidget;\r\n\r\ndeclare type HitsPerPageConnector = Connector<HitsPerPageWidgetDescription, HitsPerPageConnectorParams>;\r\n\r\ndeclare type HitsPerPageConnectorParams = {\r\n    /**\r\n     * Array of objects defining the different values and labels.\r\n     */\r\n    items: HitsPerPageConnectorParamsItem[];\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<HitsPerPageRenderStateItem>;\r\n};\r\n\r\ndeclare type HitsPerPageConnectorParamsItem = {\r\n    /**\r\n     * Label to display in the option.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Number of hits to display per page.\r\n     */\r\n    value: number;\r\n    /**\r\n     * The default hits per page on first search.\r\n     *\r\n     * @default false\r\n     */\r\n    default?: boolean;\r\n};\r\n\r\ndeclare type HitsPerPageCSSClasses = Partial<{\r\n    /**\r\n     * CSS classes added to the outer `<div>`.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS classes added to the parent `<select>`.\r\n     */\r\n    select: string | string[];\r\n    /**\r\n     * CSS classes added to each `<option>`.\r\n     */\r\n    option: string | string[];\r\n}>;\r\n\r\ndeclare type HitsPerPageRenderState = {\r\n    /**\r\n     * Array of objects defining the different values and labels.\r\n     */\r\n    items: HitsPerPageRenderStateItem[];\r\n    /**\r\n     * Creates the URL for a single item name in the list.\r\n     */\r\n    createURL: CreateURL<HitsPerPageConnectorParamsItem['value']>;\r\n    /**\r\n     * Sets the number of hits per page and triggers a search.\r\n     */\r\n    refine: (value: number) => void;\r\n    /**\r\n     * Indicates whether or not the search has results.\r\n     * @deprecated Use `canRefine` instead.\r\n     */\r\n    hasNoResults: boolean;\r\n    /**\r\n     * Indicates if search state can be refined.\r\n     */\r\n    canRefine: boolean;\r\n};\r\n\r\ndeclare type HitsPerPageRenderStateItem = {\r\n    /**\r\n     * Label to display in the option.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Number of hits to display per page.\r\n     */\r\n    value: number;\r\n    /**\r\n     * Indicates if it's the current refined value.\r\n     */\r\n    isRefined: boolean;\r\n};\r\n\r\ndeclare type HitsPerPageWidget = WidgetFactory<HitsPerPageWidgetDescription & {\r\n    $$widgetType: 'ais.hitsPerPage';\r\n}, HitsPerPageConnectorParams, HitsPerPageWidgetParams>;\r\n\r\ndeclare type HitsPerPageWidgetDescription = {\r\n    $$type: 'ais.hitsPerPage';\r\n    renderState: HitsPerPageRenderState;\r\n    indexRenderState: {\r\n        hitsPerPage: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        hitsPerPage: number;\r\n    };\r\n};\r\n\r\ndeclare type HitsPerPageWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * CSS classes to be added.\r\n     */\r\n    cssClasses?: HitsPerPageCSSClasses;\r\n};\r\n\r\ndeclare type HitsRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The matched hits from Algolia API.\r\n     * @deprecated use `items` instead\r\n     */\r\n    hits: Array<Hit<THit>>;\r\n    /**\r\n     * The matched hits from Algolia API.\r\n     */\r\n    items: Array<Hit<THit>>;\r\n    /**\r\n     * The response from the Algolia API.\r\n     */\r\n    results?: SearchResults<Hit<THit>>;\r\n    /**\r\n     * The banner to display above the hits.\r\n     */\r\n    banner?: Banner;\r\n    /**\r\n     * Sends an event to the Insights middleware.\r\n     */\r\n    sendEvent: SendEventForHits;\r\n    /**\r\n     * Returns a string for the `data-insights-event` attribute for the Insights middleware\r\n     */\r\n    bindEvent: BindEventForHits;\r\n};\r\n\r\ndeclare type HitsTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\r\n    /**\r\n     * Template to use when there are no results.\r\n     *\r\n     * @default 'No Results'\r\n     */\r\n    empty: Template<SearchResults<THit>>;\r\n    /**\r\n     * Template to use for each result. This template will receive an object containing a single record.\r\n     *\r\n     * @default ''\r\n     */\r\n    item: TemplateWithBindEvent<Hit<THit> & {\r\n        /** @deprecated the index in the hits array, use __position instead, which is the absolute position */\r\n        __hitIndex: number;\r\n    }>;\r\n    /**\r\n     * Template to use for the banner.\r\n     */\r\n    banner: Template<{\r\n        banner: Required<HitsRenderState['banner']>;\r\n        className: string;\r\n    }>;\r\n}>;\r\n\r\ndeclare type HitsWidgetDescription<THit extends NonNullable<object> = BaseHit> = {\r\n    $$type: 'ais.hits';\r\n    renderState: HitsRenderState<THit>;\r\n    indexRenderState: {\r\n        hits: WidgetRenderState<HitsRenderState<THit>, HitsConnectorParams<THit>>;\r\n    };\r\n};\r\n\r\ndeclare type HitsWidgetParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: HitsTemplates<THit>;\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: HitsCSSClasses;\r\n};\r\n\r\ndeclare type HoganHelpers<TKeys extends string = string> = Record<TKeys, (text: string, render: (value: string) => string) => string>;\r\n\r\ndeclare type HTMLMarkerArguments = {\r\n    __id: string;\r\n    position: google.maps.LatLngLiteral;\r\n    map: google.maps.Map;\r\n    template: ReturnType<typeof renderTemplate>;\r\n    title?: string;\r\n    className: string;\r\n    anchor?: {\r\n        x: number;\r\n        y: number;\r\n    };\r\n};\r\n\r\ndeclare const index: (widgetParams: IndexWidgetParams) => IndexWidget;\r\n\r\ndeclare type IndexInitOptions = {\r\n    instantSearchInstance: InstantSearch;\r\n    parent: IndexWidget | null;\r\n    uiState: UiState;\r\n};\r\n\r\ndeclare type IndexRenderOptions = {\r\n    instantSearchInstance: InstantSearch;\r\n};\r\n\r\ndeclare type IndexRenderState = Partial<ConnectorRenderStates & WidgetRenderStates>;\r\n\r\ndeclare type IndexUiState = Partial<ConnectorUiStates & WidgetUiStates>;\r\n\r\ndeclare type IndexWidget<TUiState extends UiState = UiState> = Omit<Widget<IndexWidgetDescription & {\r\n    widgetParams: IndexWidgetParams;\r\n}>, 'getWidgetUiState' | 'getWidgetState'> & {\r\n    getIndexName: () => string;\r\n    getIndexId: () => string;\r\n    getHelper: () => AlgoliaSearchHelper | null;\r\n    getResults: () => SearchResults | null;\r\n    getResultsForWidget: (widget: IndexWidget | Widget) => SearchResults | RecommendResponse<any> | null;\r\n    getPreviousState: () => SearchParameters | null;\r\n    getScopedResults: () => ScopedResult[];\r\n    getParent: () => IndexWidget | null;\r\n    getWidgets: () => Array<Widget | IndexWidget>;\r\n    createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    addWidgets: (widgets: Array<Widget | IndexWidget>) => IndexWidget;\r\n    removeWidgets: (widgets: Array<Widget | IndexWidget>) => IndexWidget;\r\n    init: (options: IndexInitOptions) => void;\r\n    render: (options: IndexRenderOptions) => void;\r\n    dispose: () => void;\r\n    /**\r\n     * @deprecated\r\n     */\r\n    getWidgetState: (uiState: UiState) => UiState;\r\n    getWidgetUiState: <TSpecificUiState extends UiState = TUiState>(uiState: TSpecificUiState) => TSpecificUiState;\r\n    getWidgetSearchParameters: (searchParameters: SearchParameters, searchParametersOptions: {\r\n        uiState: IndexUiState;\r\n    }) => SearchParameters;\r\n    /**\r\n     * Set this index' UI state back to the state defined by the widgets.\r\n     * Can only be called after `init`.\r\n     */\r\n    refreshUiState: () => void;\r\n    /**\r\n     * Set this index' UI state and search. This is the equivalent of calling\r\n     * a spread `setUiState` on the InstantSearch instance.\r\n     * Can only be called after `init`.\r\n     */\r\n    setIndexUiState: (indexUiState: TUiState[string] | ((previousIndexUiState: TUiState[string]) => TUiState[string])) => void;\r\n};\r\n\r\ndeclare type IndexWidgetDescription = {\r\n    $$type: 'ais.index';\r\n    $$widgetType: 'ais.index';\r\n};\r\n\r\ndeclare type IndexWidgetParams = {\r\n    indexName: string;\r\n    indexId?: string;\r\n};\r\n\r\ndeclare type InfiniteHitsCache<THit extends NonNullable<object> = BaseHit> = {\r\n    read: Read<THit>;\r\n    write: Write<THit>;\r\n};\r\n\r\ndeclare type InfiniteHitsCachedHits<THit extends NonNullable<object>> = {\r\n    [page: number]: Array<Hit<THit>>;\r\n};\r\n\r\ndeclare type InfiniteHitsConnectorParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * Escapes HTML entities from hits string values.\r\n     *\r\n     * @default `true`\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Enable the button to load previous results.\r\n     *\r\n     * @default `false`\r\n     */\r\n    showPrevious?: boolean;\r\n    /**\r\n     * Receives the items, and is called before displaying them.\r\n     * Useful for mapping over the items to transform, and remove or reorder them.\r\n     */\r\n    transformItems?: TransformItems<Hit<THit>>;\r\n    /**\r\n     * Reads and writes hits from/to cache.\r\n     * When user comes back to the search page after leaving for product page,\r\n     * this helps restore InfiniteHits and its scroll position.\r\n     */\r\n    cache?: InfiniteHitsCache<THit>;\r\n};\r\n\r\ndeclare type InfiniteHitsCSSClasses = Partial<{\r\n    /**\r\n     * The root element of the widget.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * The root container without results.\r\n     */\r\n    emptyRoot: string | string[];\r\n    /**\r\n     * The list of results.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * The list item.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * The “Show previous” button.\r\n     */\r\n    loadPrevious: string | string[];\r\n    /**\r\n     * The disabled “Show previous” button.\r\n     */\r\n    disabledLoadPrevious: string | string[];\r\n    /**\r\n     * The “Show more” button.\r\n     */\r\n    loadMore: string | string[];\r\n    /**\r\n     * The disabled “Show more” button.\r\n     */\r\n    disabledLoadMore: string | string[];\r\n    /**\r\n     * Class names to apply to the banner element\r\n     */\r\n    bannerRoot: string | string[];\r\n    /**\r\n     * Class names to apply to the banner image element\r\n     */\r\n    bannerImage: string | string[];\r\n    /**\r\n     * Class names to apply to the banner link element\r\n     */\r\n    bannerLink: string | string[];\r\n}>;\r\n\r\ndeclare type InfiniteHitsRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * Loads the previous results.\r\n     */\r\n    showPrevious: () => void;\r\n    /**\r\n     * Loads the next page of hits.\r\n     */\r\n    showMore: () => void;\r\n    /**\r\n     * Indicates whether the first page of hits has been reached.\r\n     */\r\n    isFirstPage: boolean;\r\n    /**\r\n     * Indicates whether the last page of hits has been reached.\r\n     */\r\n    isLastPage: boolean;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEventForHits;\r\n    /**\r\n     * Returns a string of data-insights-event attribute for insights middleware\r\n     */\r\n    bindEvent: BindEventForHits;\r\n    /**\r\n     * Hits for the current page\r\n     */\r\n    currentPageHits: Array<Hit<THit>>;\r\n    /**\r\n     * Hits for current and cached pages\r\n     * @deprecated use `items` instead\r\n     */\r\n    hits: Array<Hit<THit>>;\r\n    /**\r\n     * Hits for current and cached pages\r\n     */\r\n    items: Array<Hit<THit>>;\r\n    /**\r\n     * The response from the Algolia API.\r\n     */\r\n    results?: SearchResults<Hit<THit>> | null;\r\n    /**\r\n     * The banner to display above the hits.\r\n     */\r\n    banner?: Banner;\r\n};\r\n\r\ndeclare type InfiniteHitsTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\r\n    /**\r\n     * The template to use when there are no results.\r\n     */\r\n    empty: Template<SearchResults<THit>>;\r\n    /**\r\n     * The template to use for the “Show previous” label.\r\n     */\r\n    showPreviousText: Template;\r\n    /**\r\n     * The template to use for the “Show more” label.\r\n     */\r\n    showMoreText: Template;\r\n    /**\r\n     * The template to use for each result.\r\n     */\r\n    item: TemplateWithBindEvent<Hit<THit> & {\r\n        /** @deprecated the index in the hits array, use __position instead, which is the absolute position */\r\n        __hitIndex: number;\r\n    }>;\r\n    /**\r\n     * Template to use for the banner.\r\n     */\r\n    banner: Template<{\r\n        banner: Required<InfiniteHitsRenderState['banner']>;\r\n        className: string;\r\n    }>;\r\n}>;\r\n\r\ndeclare type InfiniteHitsWidgetDescription<THit extends NonNullable<object> = BaseHit> = {\r\n    $$type: 'ais.infiniteHits';\r\n    renderState: InfiniteHitsRenderState<THit>;\r\n    indexRenderState: {\r\n        infiniteHits: WidgetRenderState<InfiniteHitsRenderState<THit>, InfiniteHitsConnectorParams<THit>>;\r\n    };\r\n    indexUiState: {\r\n        page: number;\r\n    };\r\n};\r\n\r\ndeclare type InfiniteHitsWidgetParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The CSS Selector or `HTMLElement` to insert the widget into.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * The CSS classes to override.\r\n     */\r\n    cssClasses?: InfiniteHitsCSSClasses;\r\n    /**\r\n     * The templates to use for the widget.\r\n     */\r\n    templates?: InfiniteHitsTemplates<THit>;\r\n    /**\r\n     * Reads and writes hits from/to cache.\r\n     * When user comes back to the search page after leaving for product page,\r\n     * this helps restore InfiniteHits and its scroll position.\r\n     */\r\n    cache?: InfiniteHitsCache;\r\n};\r\n\r\ndeclare type InitialResult = {\r\n    state?: PlainSearchParameters;\r\n    results?: SearchResults['_rawResults'];\r\n    recommendResults?: {\r\n        params: NonNullable<RecommendParametersOptions['params']>;\r\n        results: RecommendResults['_rawResults'];\r\n    };\r\n    requestParams?: SearchOptions[];\r\n};\r\n\r\ndeclare type InitialResults = Record<string, InitialResult>;\r\n\r\ndeclare type InitOptions = SharedRenderOptions & {\r\n    uiState: UiState;\r\n    results?: undefined;\r\n};\r\n\r\n/**\r\n * @deprecated This function will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\r\n */\r\ndeclare function insights(method: InsightsClientMethod, payload: Partial<InsightsClientPayload>): string;\r\n\r\ndeclare type InsightsClient = InsightsClient_2 & {\r\n    queue?: QueueItem[];\r\n};\r\n\r\ndeclare type InsightsClientMethod = keyof InsightsMethodMap;\r\n\r\ndeclare type InsightsClientPayload = {\r\n    eventName: string;\r\n    queryID: string;\r\n    index: string;\r\n    objectIDs: string[];\r\n    positions?: number[];\r\n};\r\n\r\ndeclare type InsightsClientWithGlobals = InsightsClient & {\r\n    shouldAddScript?: boolean;\r\n    version?: string;\r\n};\r\n\r\ndeclare type InsightsEvent<TMethod extends InsightsMethod = InsightsMethod> = InsightsEvent_2<TMethod>;\r\n\r\n/**\r\n * The event sent to the insights middleware.\r\n */\r\ndeclare type InsightsEvent_2<TMethod extends InsightsMethod = InsightsMethod> = {\r\n    insightsMethod?: TMethod;\r\n    payload: InsightsMethodMap[TMethod][0][0];\r\n    widgetType: string;\r\n    eventType: string;\r\n    eventModifier?: string;\r\n    hits?: Hit[];\r\n    attribute?: string;\r\n};\r\n\r\n/**\r\n * Method allowed by the insights middleware.\r\n */\r\ndeclare type InsightsMethod = 'clickedObjectIDsAfterSearch' | 'clickedObjectIDs' | 'clickedFilters' | 'convertedObjectIDsAfterSearch' | 'convertedObjectIDs' | 'convertedFilters' | 'viewedObjectIDs' | 'viewedFilters';\r\n\r\ndeclare type InsightsMethodMap = InsightsMethodMap_2;\r\n\r\ndeclare type InsightsProps<TInsightsClient extends ProvidedInsightsClient = ProvidedInsightsClient> = {\r\n    insightsClient?: TInsightsClient;\r\n    insightsInitParams?: Partial<InsightsMethodMap['init'][0][0]>;\r\n    onEvent?: (event: InsightsEvent, insightsClient: TInsightsClient) => void;\r\n};\r\n\r\n/**\r\n * The actual implementation of the InstantSearch. This is\r\n * created using the `instantsearch` factory function.\r\n * It emits the 'render' event every time a search is done\r\n */\r\ndeclare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TUiState> extends EventEmitter {\r\n    client: InstantSearchOptions['searchClient'];\r\n    indexName: string;\r\n    compositionID?: string;\r\n    insightsClient: InsightsClient | null;\r\n    onStateChange: InstantSearchOptions<TUiState>['onStateChange'] | null;\r\n    future: NonNullable<InstantSearchOptions<TUiState>['future']>;\r\n    helper: AlgoliaSearchHelper | null;\r\n    mainHelper: AlgoliaSearchHelper | null;\r\n    mainIndex: IndexWidget;\r\n    started: boolean;\r\n    templatesConfig: Record<string, unknown>;\r\n    renderState: RenderState;\r\n    _stalledSearchDelay: number;\r\n    _searchStalledTimer: any;\r\n    _initialUiState: TUiState;\r\n    _initialResults: InitialResults | null;\r\n    _createURL: CreateURL<TUiState>;\r\n    _searchFunction?: InstantSearchOptions['searchFunction'];\r\n    _mainHelperSearch?: AlgoliaSearchHelper['search'];\r\n    _hasSearchWidget: boolean;\r\n    _hasRecommendWidget: boolean;\r\n    _insights: InstantSearchOptions['insights'];\r\n    middleware: Array<{\r\n        creator: Middleware<TUiState>;\r\n        instance: MiddlewareDefinition<TUiState>;\r\n    }>;\r\n    sendEventToInsights: (event: InsightsEvent) => void;\r\n    /**\r\n     * The status of the search. Can be \"idle\", \"loading\", \"stalled\", or \"error\".\r\n     */\r\n    status: InstantSearchStatus;\r\n    /**\r\n     * The last returned error from the Search API.\r\n     * The error gets cleared when the next valid search response is rendered.\r\n     */\r\n    error: Error | undefined;\r\n    /**\r\n     * @deprecated use `status === 'stalled'` instead\r\n     */\r\n    get _isSearchStalled(): boolean;\r\n    constructor(options: InstantSearchOptions<TUiState, TRouteState>);\r\n    /**\r\n     * Hooks a middleware into the InstantSearch lifecycle.\r\n     */\r\n    use(...middleware: Array<Middleware<TUiState>>): this;\r\n    /**\r\n     * Removes a middleware from the InstantSearch lifecycle.\r\n     */\r\n    unuse(...middlewareToUnuse: Array<Middleware<TUiState>>): this;\r\n    EXPERIMENTAL_use(...middleware: Middleware[]): this;\r\n    /**\r\n     * Adds a widget to the search instance.\r\n     * A widget can be added either before or after InstantSearch has started.\r\n     * @param widget The widget to add to InstantSearch.\r\n     *\r\n     * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `addWidgets([widget])`.\r\n     */\r\n    addWidget(widget: Widget): this;\r\n    /**\r\n     * Adds multiple widgets to the search instance.\r\n     * Widgets can be added either before or after InstantSearch has started.\r\n     * @param widgets The array of widgets to add to InstantSearch.\r\n     */\r\n    addWidgets(widgets: Array<Widget | IndexWidget>): this;\r\n    /**\r\n     * Removes a widget from the search instance.\r\n     * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `removeWidgets([widget])`\r\n     * @param widget The widget instance to remove from InstantSearch.\r\n     *\r\n     * The widget must implement a `dispose()` method to clear its state.\r\n     */\r\n    removeWidget(widget: Widget | IndexWidget): this;\r\n    /**\r\n     * Removes multiple widgets from the search instance.\r\n     * @param widgets Array of widgets instances to remove from InstantSearch.\r\n     *\r\n     * The widgets must implement a `dispose()` method to clear their states.\r\n     */\r\n    removeWidgets(widgets: Array<Widget | IndexWidget>): this;\r\n    /**\r\n     * Ends the initialization of InstantSearch.js and triggers the\r\n     * first search.\r\n     */\r\n    start(): void;\r\n    /**\r\n     * Removes all widgets without triggering a search afterwards.\r\n     * @return {undefined} This method does not return anything\r\n     */\r\n    dispose(): void;\r\n    scheduleSearch: (() => void) & {\r\n        wait: () => Promise<void>;\r\n        cancel: () => void;\r\n    };\r\n    scheduleRender: ((shouldResetStatus?: boolean) => void) & {\r\n        wait: () => Promise<void>;\r\n        cancel: () => void;\r\n    };\r\n    scheduleStalledRender(): void;\r\n    /**\r\n     * Set the UI state and trigger a search.\r\n     * @param uiState The next UI state or a function computing it from the current state\r\n     * @param callOnStateChange private parameter used to know if the method is called from a state change\r\n     */\r\n    setUiState(uiState: TUiState | ((previousUiState: TUiState) => TUiState), callOnStateChange?: boolean): void;\r\n    getUiState(): TUiState;\r\n    onInternalStateChange: (() => void) & {\r\n        wait: () => Promise<void>;\r\n        cancel: () => void;\r\n    };\r\n    createURL(nextState?: TUiState): string;\r\n    refresh(): void;\r\n}\r\n\r\n/**\r\n * InstantSearch is the main component of InstantSearch.js. This object\r\n * manages the widget and lets you add new ones.\r\n *\r\n * Two parameters are required to get you started with InstantSearch.js:\r\n *  - `indexName`: the main index that you will use for your new search UI\r\n *  - `searchClient`: the search client to plug to InstantSearch.js\r\n *\r\n * The [search client provided by Algolia](algolia.com/doc/api-client/getting-started/what-is-the-api-client/javascript/)\r\n * needs an `appId` and an `apiKey`. Those parameters can be found in your\r\n * [Algolia dashboard](https://www.algolia.com/api-keys).\r\n *\r\n * If you want to get up and running quickly with InstantSearch.js, have a\r\n * look at the [getting started](https://www.algolia.com/doc/guides/building-search-ui/getting-started/js/).\r\n */\r\ndeclare const instantsearch: InstantSearchModule;\r\nexport default instantsearch;\r\n\r\ndeclare type InstantSearchModule = {\r\n    <TUiState = Record<string, unknown>, TRouteState = TUiState>(options: InstantSearchOptions<Expand<UiState & TUiState>, TRouteState>): InstantSearch<Expand<UiState & TUiState>, TRouteState>;\r\n    version: string;\r\n    connectors: typeof connectors;\r\n    widgets: typeof widgets;\r\n    middlewares: typeof middlewares;\r\n    routers: typeof routers;\r\n    stateMappings: typeof stateMappings;\r\n    templates: typeof templates;\r\n    createInfiniteHitsSessionStorageCache: typeof createInfiniteHitsSessionStorageCache;\r\n    /** @deprecated use html tagged templates and the Highlight component instead */\r\n    highlight: typeof helpers.highlight;\r\n    /** @deprecated use html tagged templates and the ReverseHighlight component instead */\r\n    reverseHighlight: typeof helpers.reverseHighlight;\r\n    /** @deprecated use html tagged templates and the Snippet component instead */\r\n    snippet: typeof helpers.snippet;\r\n    /** @deprecated use html tagged templates and the ReverseSnippet component instead */\r\n    reverseSnippet: typeof helpers.reverseSnippet;\r\n    /**\r\n     * @deprecated use createInsightsMiddleware\r\n     * @link https://www.algolia.com/doc/api-reference/widgets/insights/js/\r\n     */\r\n    insights: typeof helpers.insights;\r\n};\r\n\r\n/**\r\n * Global options for an InstantSearch instance.\r\n */\r\ndeclare type InstantSearchOptions<TUiState extends UiState = UiState, TRouteState = TUiState> = {\r\n    /**\r\n     * The name of the main index. If no indexName is provided, you have to manually add an index widget.\r\n     */\r\n    indexName?: string;\r\n    /**\r\n     * The objectID of the composition.\r\n     * If this is passed, the composition API will be used for search.\r\n     * Multi-index search is not supported with this option.\r\n     */\r\n    compositionID?: string;\r\n    /**\r\n     * The search client to plug to InstantSearch.js\r\n     *\r\n     * Usage:\r\n     * ```javascript\r\n     * // Using the default Algolia search client\r\n     * instantsearch({\r\n     *   indexName: 'indexName',\r\n     *   searchClient: algoliasearch('appId', 'apiKey')\r\n     * });\r\n     *\r\n     * // Using a custom search client\r\n     * instantsearch({\r\n     *   indexName: 'indexName',\r\n     *   searchClient: {\r\n     *     search(requests) {\r\n     *       // fetch response based on requests\r\n     *       return response;\r\n     *     },\r\n     *     searchForFacetValues(requests) {\r\n     *       // fetch response based on requests\r\n     *       return response;\r\n     *     }\r\n     *   }\r\n     * });\r\n     * ```\r\n     */\r\n    searchClient: SearchClient | CompositionClient;\r\n    /**\r\n     * The locale used to display numbers. This will be passed\r\n     * to `Number.prototype.toLocaleString()`\r\n     */\r\n    numberLocale?: string;\r\n    /**\r\n     * A hook that will be called each time a search needs to be done, with the\r\n     * helper as a parameter. It's your responsibility to call `helper.search()`.\r\n     * This option allows you to avoid doing searches at page load for example.\r\n     * @deprecated use onStateChange instead\r\n     */\r\n    searchFunction?: (helper: AlgoliaSearchHelper) => void;\r\n    /**\r\n     * Function called when the state changes.\r\n     *\r\n     * Using this function makes the instance controlled. This means that you\r\n     * become in charge of updating the UI state with the `setUiState` function.\r\n     */\r\n    onStateChange?: (params: {\r\n        uiState: TUiState;\r\n        setUiState: (uiState: TUiState | ((previousUiState: TUiState) => TUiState)) => void;\r\n    }) => void;\r\n    /**\r\n     * Injects a `uiState` to the `instantsearch` instance. You can use this option\r\n     * to provide an initial state to a widget. Note that the state is only used\r\n     * for the first search. To unconditionally pass additional parameters to the\r\n     * Algolia API, take a look at the `configure` widget.\r\n     */\r\n    initialUiState?: NoInfer_2<TUiState>;\r\n    /**\r\n     * Time before a search is considered stalled. The default is 200ms\r\n     */\r\n    stalledSearchDelay?: number;\r\n    /**\r\n     * Router configuration used to save the UI State into the URL or any other\r\n     * client side persistence. Passing `true` will use the default URL options.\r\n     */\r\n    routing?: RouterProps<TUiState, TRouteState> | boolean;\r\n    /**\r\n     * Enables the Insights middleware and loads the Insights library\r\n     * if not already loaded.\r\n     *\r\n     * The Insights middleware sends view and click events automatically, and lets\r\n     * you set up your own events.\r\n     *\r\n     * @default false\r\n     */\r\n    insights?: InsightsProps | boolean;\r\n    /**\r\n     * the instance of search-insights to use for sending insights events inside\r\n     * widgets like `hits`.\r\n     *\r\n     * @deprecated This property will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\r\n     */\r\n    insightsClient?: InsightsClient;\r\n    future?: {\r\n        /**\r\n         * Changes the way `dispose` is used in InstantSearch lifecycle.\r\n         *\r\n         * If `false` (by default), each widget unmounting will remove its state as well, even if there are multiple widgets reading that UI State.\r\n         *\r\n         * If `true`, each widget unmounting will only remove its own state if it's the last of its type. This allows for dynamically adding and removing widgets without losing their state.\r\n         *\r\n         * @default false\r\n         */\r\n        preserveSharedStateOnUnmount?: boolean;\r\n        /**\r\n         * Changes the way root levels of hierarchical facets have their count displayed.\r\n         *\r\n         * If `false` (by default), the count of the refined root level is updated to match the count of the actively refined parent level.\r\n         *\r\n         * If `true`, the count of the root level stays the same as the count of all children levels.\r\n         *\r\n         * @default false\r\n         */\r\n        persistHierarchicalRootCount?: boolean;\r\n    };\r\n};\r\n\r\ndeclare type InstantSearchStatus = 'idle' | 'loading' | 'stalled' | 'error';\r\n\r\ndeclare type InternalMiddleware<TUiState extends UiState = UiState> = (options: MiddlewareOptions) => MiddlewareDefinition<TUiState>;\r\n\r\ndeclare function isMetadataEnabled(): boolean;\r\n\r\ndeclare type LookingSimilarConnectorParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The `objectIDs` of the items to get similar looking products from.\r\n     */\r\n    objectIDs: string[];\r\n    /**\r\n     * The number of recommendations to retrieve.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * The threshold for the recommendations confidence score (between 0 and 100).\r\n     */\r\n    threshold?: number;\r\n    /**\r\n     * List of search parameters to send.\r\n     */\r\n    fallbackParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * List of search parameters to send.\r\n     */\r\n    queryParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * Whether to escape HTML tags from items string values.\r\n     *\r\n     * @default true\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<Hit<THit>, {\r\n        results: RecommendResponse<AlgoliaHit<THit>>;\r\n    }>;\r\n};\r\n\r\ndeclare type LookingSimilarCSSClasses = Partial<RecommendClassNames>;\r\n\r\ndeclare type LookingSimilarRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The matched recommendations from the Algolia API.\r\n     */\r\n    items: Array<Hit<THit>>;\r\n    /**\r\n     * Sends an event to the Insights middleware.\r\n     */\r\n    sendEvent: SendEventForHits;\r\n};\r\n\r\ndeclare type LookingSimilarTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\r\n    /**\r\n     * Template to use when there are no results.\r\n     */\r\n    empty: Template<RecommendResponse<Hit<THit>>>;\r\n    /**\r\n     * Template to use for the header of the widget.\r\n     */\r\n    header: Template<Pick<Parameters<NonNullable<LookingSimilarProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {\r\n        cssClasses: RecommendClassNames;\r\n    }>;\r\n    /**\r\n     * Template to use for each result. This template will receive an object containing a single record.\r\n     */\r\n    item: TemplateWithBindEvent<Hit<THit>>;\r\n    /**\r\n     * Template to use to wrap all items.\r\n     */\r\n    layout: Template<Pick<Parameters<NonNullable<LookingSimilarProps<Hit<THit>>['layout']>>[0], 'items'> & {\r\n        templates: {\r\n            item: LookingSimilarProps<Hit<THit>>['itemComponent'];\r\n        };\r\n        cssClasses: Pick<LookingSimilarCSSClasses, 'list' | 'item'>;\r\n    }>;\r\n}>;\r\n\r\ndeclare type LookingSimilarWidgetParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: LookingSimilarTemplates<THit>;\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: LookingSimilarCSSClasses;\r\n};\r\n\r\ndeclare type MatchingPatterns = {\r\n    [attribute: string]: {\r\n        /**\r\n         * The score of the optional filter.\r\n         *\r\n         * @see https://www.algolia.com/doc/guides/managing-results/rules/merchandising-and-promoting/in-depth/optional-filters/\r\n         */\r\n        score: number;\r\n    };\r\n};\r\n\r\ndeclare const menu: MenuWidget;\r\n\r\ndeclare type MenuConnector = Connector<MenuWidgetDescription, MenuConnectorParams>;\r\n\r\ndeclare type MenuConnectorParams = {\r\n    /**\r\n     * Name of the attribute for faceting (eg. \"free_shipping\").\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * How many facets values to retrieve.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * Whether to display a button that expands the number of items.\r\n     */\r\n    showMore?: boolean;\r\n    /**\r\n     * How many facets values to retrieve when `toggleShowMore` is called, this value is meant to be greater than `limit` option.\r\n     */\r\n    showMoreLimit?: number;\r\n    /**\r\n     * How to sort refinements. Possible values: `count|isRefined|name:asc|name:desc`.\r\n     *\r\n     * You can also use a sort function that behaves like the standard Javascript [compareFunction](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Syntax).\r\n     *\r\n     * If a facetOrdering is set in the index settings, it is used when sortBy isn't passed\r\n     */\r\n    sortBy?: SortBy<SearchResults.HierarchicalFacet>;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<MenuItem>;\r\n};\r\n\r\ndeclare type MenuCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to each item element.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add to each selected item element.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS class to add to each link (when using the default template).\r\n     */\r\n    link: string | string[];\r\n    /**\r\n     * CSS class to add to each label (when using the default template).\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to each count element (when using the default template).\r\n     */\r\n    count: string | string[];\r\n    /**\r\n     * CSS class to add to the show more button.\r\n     */\r\n    showMore: string | string[];\r\n    /**\r\n     * CSS class to add to the disabled show more button.\r\n     */\r\n    disabledShowMore: string | string[];\r\n}>;\r\n\r\ndeclare type MenuItem = {\r\n    /**\r\n     * The value of the menu item.\r\n     */\r\n    value: string;\r\n    /**\r\n     * Human-readable value of the menu item.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Number of results matched after refinement is applied.\r\n     */\r\n    count: number;\r\n    /**\r\n     * Indicates if the refinement is applied.\r\n     */\r\n    isRefined: boolean;\r\n};\r\n\r\ndeclare type MenuRenderState = {\r\n    /**\r\n     * The elements that can be refined for the current search results.\r\n     */\r\n    items: MenuItem[];\r\n    /**\r\n     * Creates the URL for a single item name in the list.\r\n     */\r\n    createURL: CreateURL<string>;\r\n    /**\r\n     * Filter the search to item value.\r\n     */\r\n    refine: (value: string) => void;\r\n    /**\r\n     * True if refinement can be applied.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * True if the menu is displaying all the menu items.\r\n     */\r\n    isShowingMore: boolean;\r\n    /**\r\n     * Toggles the number of values displayed between `limit` and `showMore.limit`.\r\n     */\r\n    toggleShowMore: () => void;\r\n    /**\r\n     * `true` if the toggleShowMore button can be activated (enough items to display more or\r\n     * already displaying more than `limit` items)\r\n     */\r\n    canToggleShowMore: boolean;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEventForFacet;\r\n};\r\n\r\ndeclare const menuSelect: MenuSelectWidget;\r\n\r\ndeclare type MenuSelectCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root when there are no items to display\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the select element.\r\n     */\r\n    select: string | string[];\r\n    /**\r\n     * CSS class to add to the option element.\r\n     */\r\n    option: string | string[];\r\n}>;\r\n\r\ndeclare type MenuSelectTemplates = Partial<{\r\n    /**\r\n     * Item template, provided with `label`, `count`, `isRefined` and `value` data properties.\r\n     */\r\n    item: Template<{\r\n        label: string;\r\n        value: string;\r\n        count: number;\r\n        isRefined: boolean;\r\n    }>;\r\n    /**\r\n     * Label of the \"see all\" option in the select.\r\n     */\r\n    defaultOption: Template;\r\n}>;\r\n\r\ndeclare type MenuSelectWidget = WidgetFactory<MenuWidgetDescription & {\r\n    $$widgetType: 'ais.menuSelect';\r\n}, MenuConnectorParams, MenuSelectWidgetParams>;\r\n\r\ndeclare type MenuSelectWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Customize the output through templating.\r\n     */\r\n    templates?: MenuSelectTemplates;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: MenuSelectCSSClasses;\r\n};\r\n\r\ndeclare type MenuTemplates = Partial<{\r\n    /**\r\n     * Item template. The string template gets the same values as the function.\r\n     */\r\n    item: Template<{\r\n        count: number;\r\n        cssClasses: MenuCSSClasses;\r\n        isRefined: boolean;\r\n        label: string;\r\n        url: string;\r\n        value: string;\r\n    }>;\r\n    /**\r\n     * Template used for the show more text, provided with `isShowingMore` data property.\r\n     */\r\n    showMoreText: Template<{\r\n        isShowingMore: boolean;\r\n    }>;\r\n}>;\r\n\r\ndeclare type MenuWidget = WidgetFactory<MenuWidgetDescription & {\r\n    $$widgetType: 'ais.menu';\r\n}, MenuConnectorParams, MenuWidgetParams>;\r\n\r\ndeclare type MenuWidgetDescription = {\r\n    $$type: 'ais.menu';\r\n    renderState: MenuRenderState;\r\n    indexRenderState: {\r\n        menu: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        menu: {\r\n            [attribute: string]: string;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type MenuWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Customize the output through templating.\r\n     */\r\n    templates?: MenuTemplates;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: MenuCSSClasses;\r\n};\r\n\r\ndeclare type Middleware<TUiState extends UiState = UiState> = (options: MiddlewareOptions) => AtLeastOne<MiddlewareDefinition<TUiState>>;\r\n\r\ndeclare type MiddlewareDefinition<TUiState extends UiState = UiState> = {\r\n    /**\r\n     * string to identify the middleware\r\n     */\r\n    $$type: string;\r\n    /**\r\n     * Change handler called on every UiState change\r\n     */\r\n    onStateChange: (options: {\r\n        uiState: TUiState;\r\n    }) => void;\r\n    /**\r\n     * Called when the middleware is added to InstantSearch\r\n     */\r\n    subscribe: () => void;\r\n    /**\r\n     * Called when InstantSearch is started\r\n     */\r\n    started: () => void;\r\n    /**\r\n     * Called when the middleware is removed from InstantSearch\r\n     */\r\n    unsubscribe: () => void;\r\n};\r\n\r\ndeclare type MiddlewareOptions = {\r\n    instantSearchInstance: InstantSearch;\r\n};\r\n\r\ndeclare namespace middlewares {\r\n    export {\r\n        createInsightsMiddleware,\r\n        InsightsEvent,\r\n        InsightsProps,\r\n        InsightsClientWithGlobals,\r\n        CreateInsightsMiddleware,\r\n        RouterProps,\r\n        createRouterMiddleware,\r\n        isMetadataEnabled,\r\n        createMetadataMiddleware\r\n    }\r\n}\r\n\r\ndeclare type NoInfer_2<T> = T extends infer S ? S : never;\r\n\r\ndeclare const numericMenu: NumericMenuWidget;\r\n\r\ndeclare type NumericMenuComponentCSSClasses = ComponentCSSClasses<NumericMenuCSSClasses>;\r\n\r\ndeclare type NumericMenuConnector = Connector<NumericMenuWidgetDescription, NumericMenuConnectorParams>;\r\n\r\ndeclare type NumericMenuConnectorParams = {\r\n    /**\r\n     * Name of the attribute for filtering\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * List of all the items\r\n     */\r\n    items: NumericMenuConnectorParamsItem[];\r\n    /**\r\n     * Function to transform the items passed to the templates\r\n     */\r\n    transformItems?: TransformItems<NumericMenuRenderStateItem>;\r\n};\r\n\r\ndeclare type NumericMenuConnectorParamsItem = {\r\n    /**\r\n     * Name of the option\r\n     */\r\n    label: string;\r\n    /**\r\n     * Higher bound of the option (<=)\r\n     */\r\n    start?: number;\r\n    /**\r\n     * Lower bound of the option (>=)\r\n     */\r\n    end?: number;\r\n};\r\n\r\ndeclare type NumericMenuCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to each item element.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add to each selected item element.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS class to add to each label element.\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to each label text element.\r\n     */\r\n    labelText: string | string[];\r\n    /**\r\n     * CSS class to add to each radio element (when using the default template).\r\n     */\r\n    radio: string | string[];\r\n}>;\r\n\r\ndeclare type NumericMenuRenderState = {\r\n    /**\r\n     * The list of available choices\r\n     */\r\n    items: NumericMenuRenderStateItem[];\r\n    /**\r\n     * Creates URLs for the next state, the string is the name of the selected option\r\n     */\r\n    createURL: CreateURL<NumericMenuRenderStateItem['value']>;\r\n    /**\r\n     * `true` if the last search contains no result\r\n     * @deprecated Use `canRefine` instead.\r\n     */\r\n    hasNoResults: boolean;\r\n    /**\r\n     * Indicates if search state can be refined.\r\n     *\r\n     * This is `true` if the last search contains no result and\r\n     * \"All\" range is selected\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Sets the selected value and trigger a new search\r\n     */\r\n    refine: (facetValue: string) => void;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEventForFacet;\r\n};\r\n\r\ndeclare type NumericMenuRenderStateItem = {\r\n    /**\r\n     *  Name of the option.\r\n     */\r\n    label: string;\r\n    /**\r\n     * URL encoded of the bounds object with the form `{start, end}`.\r\n     * This value can be used verbatim in the webpage and can be read by `refine`\r\n     * directly. If you want to inspect the value, you can do:\r\n     * `JSON.parse(decodeURI(value))` to get the object.\r\n     */\r\n    value: string;\r\n    /**\r\n     * True if the value is selected\r\n     */\r\n    isRefined: boolean;\r\n};\r\n\r\ndeclare type NumericMenuTemplates = Partial<{\r\n    /**\r\n     * Item template, provided with `label` (the name in the configuration), `isRefined`, `url`, `value` (the setting for the filter) data properties.\r\n     */\r\n    item: Template<{\r\n        /**\r\n         * The name of the attribute.\r\n         */\r\n        attribute: string;\r\n        /**\r\n         * The label for the option.\r\n         */\r\n        label: string;\r\n        /**\r\n         * The encoded URL of the bounds object with a {start, end} form. This\r\n         * value can be used verbatim in the webpage and can be read by refine\r\n         * directly. If you want to inspect the value, you can do JSON.parse(window.decodeURI(value))\r\n         * to get the object.\r\n         */\r\n        value: string;\r\n        /**\r\n         *  Whether or not the refinement is selected.\r\n         */\r\n        isRefined: boolean;\r\n        /**\r\n         * The URL with the applied refinement.\r\n         */\r\n        url: string;\r\n        /**\r\n         * The CSS classes provided to the widget.\r\n         */\r\n        cssClasses: NumericMenuComponentCSSClasses;\r\n    }>;\r\n}>;\r\n\r\ndeclare type NumericMenuWidget = WidgetFactory<NumericMenuWidgetDescription & {\r\n    $$widgetType: 'ais.numericMenu';\r\n}, NumericMenuConnectorParams, NumericMenuWidgetParams>;\r\n\r\ndeclare type NumericMenuWidgetDescription = {\r\n    $$type: 'ais.numericMenu';\r\n    renderState: NumericMenuRenderState;\r\n    indexRenderState: {\r\n        numericMenu: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        numericMenu: {\r\n            [attribute: string]: string;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type NumericMenuWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: NumericMenuTemplates;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: NumericMenuCSSClasses;\r\n};\r\n\r\ndeclare const pagination: PaginationWidget;\r\n\r\ndeclare type PaginationConnector = Connector<PaginationWidgetDescription, PaginationConnectorParams>;\r\n\r\ndeclare type PaginationConnectorParams = {\r\n    /**\r\n     * The total number of pages to browse.\r\n     */\r\n    totalPages?: number;\r\n    /**\r\n     * The padding of pages to show around the current page\r\n     * @default 3\r\n     */\r\n    padding?: number;\r\n};\r\n\r\ndeclare type PaginationCSSClasses = Partial<{\r\n    /**\r\n     * CSS classes added to the root element of the widget.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element of the widget if there are no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS classes added to the wrapping `<ul>`.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS classes added to each `<li>`.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS classes added to the first `<li>`.\r\n     */\r\n    firstPageItem: string | string[];\r\n    /**\r\n     * CSS classes added to the last `<li>`.\r\n     */\r\n    lastPageItem: string | string[];\r\n    /**\r\n     * CSS classes added to the previous `<li>`.\r\n     */\r\n    previousPageItem: string | string[];\r\n    /**\r\n     * CSS classes added to the next `<li>`.\r\n     */\r\n    nextPageItem: string | string[];\r\n    /**\r\n     * CSS classes added to page `<li>`.\r\n     */\r\n    pageItem: string | string[];\r\n    /**\r\n     * CSS classes added to the selected `<li>`.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS classes added to the disabled `<li>`.\r\n     */\r\n    disabledItem: string | string[];\r\n    /**\r\n     * CSS classes added to each link.\r\n     */\r\n    link: string | string[];\r\n}>;\r\n\r\ndeclare type PaginationRenderState = {\r\n    /** Creates URLs for the next state, the number is the page to generate the URL for. */\r\n    createURL: CreateURL<number>;\r\n    /** Sets the current page and triggers a search. */\r\n    refine: (page: number) => void;\r\n    /** true if this search returned more than one page */\r\n    canRefine: boolean;\r\n    /** The number of the page currently displayed. */\r\n    currentRefinement: number;\r\n    /** The number of hits computed for the last query (can be approximated). */\r\n    nbHits: number;\r\n    /** The number of pages for the result set. */\r\n    nbPages: number;\r\n    /** The actual pages relevant to the current situation and padding. */\r\n    pages: number[];\r\n    /** true if the current page is also the first page. */\r\n    isFirstPage: boolean;\r\n    /** true if the current page is also the last page. */\r\n    isLastPage: boolean;\r\n};\r\n\r\ndeclare type PaginationTemplates = Partial<{\r\n    /**\r\n     * Label for the Previous link.\r\n     */\r\n    previous: Template;\r\n    /**\r\n     * Label for the Next link.\r\n     */\r\n    next: Template;\r\n    /**\r\n     * Label for the link of a certain page\r\n     * Page is one-based, so `page` will be `1` for the first page.\r\n     */\r\n    page: Template<{\r\n        page: number;\r\n    }>;\r\n    /**\r\n     * Label for the First link.\r\n     */\r\n    first: Template;\r\n    /**\r\n     * Label for the Last link.\r\n     */\r\n    last: Template;\r\n}>;\r\n\r\ndeclare type PaginationWidget = WidgetFactory<PaginationWidgetDescription & {\r\n    $$widgetType: 'ais.pagination';\r\n}, PaginationConnectorParams, PaginationWidgetParams>;\r\n\r\ndeclare type PaginationWidgetDescription = {\r\n    $$type: 'ais.pagination';\r\n    renderState: PaginationRenderState;\r\n    indexRenderState: {\r\n        pagination: WidgetRenderState<PaginationRenderState, PaginationConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        page: number;\r\n    };\r\n};\r\n\r\ndeclare type PaginationWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * The max number of pages to browse.\r\n     */\r\n    totalPages?: number;\r\n    /**\r\n     * The number of pages to display on each side of the current page.\r\n     * @default 3\r\n     */\r\n    padding?: number;\r\n    /**\r\n     * Where to scroll after a click, set to `false` to disable.\r\n     * @default body\r\n     */\r\n    scrollTo?: string | HTMLElement | boolean;\r\n    /**\r\n     * Whether to show the \"first page\" control\r\n     * @default true\r\n     */\r\n    showFirst?: boolean;\r\n    /**\r\n     * Whether to show the \"last page\" control\r\n     * @default true\r\n     */\r\n    showLast?: boolean;\r\n    /**\r\n     * Whether to show the \"next page\" control\r\n     * @default true\r\n     */\r\n    showNext?: boolean;\r\n    /**\r\n     * Whether to show the \"previous page\" control\r\n     * @default true\r\n     */\r\n    showPrevious?: boolean;\r\n    /**\r\n     * Text to display in the links.\r\n     */\r\n    templates?: PaginationTemplates;\r\n    /**\r\n     * CSS classes to be added.\r\n     */\r\n    cssClasses?: PaginationCSSClasses;\r\n};\r\n\r\n/**\r\n * The panel widget wraps other widgets in a consistent panel design.\r\n * It also reacts, indicates and sets CSS classes when widgets are no longer relevant for refining.\r\n */\r\ndeclare const panel: PanelWidget;\r\n\r\ndeclare type PanelCSSClasses = Partial<{\r\n    /**\r\n     * CSS classes to add to the root element of the widget.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS classes to add to the root element of the widget when there's no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS classes to add to the root element when collapsible (`collapse` is defined).\r\n     */\r\n    collapsibleRoot: string | string[];\r\n    /**\r\n     * CSS classes to add to the root element when collapsed.\r\n     */\r\n    collapsedRoot: string | string[];\r\n    /**\r\n     * CSS classes to add to the collapse button element.\r\n     */\r\n    collapseButton: string | string[];\r\n    /**\r\n     * CSS classes to add to the collapse icon of the button.\r\n     */\r\n    collapseIcon: string | string[];\r\n    /**\r\n     * CSS classes to add to the header.\r\n     */\r\n    header: string | string[];\r\n    /**\r\n     * CSS classes to add to the body.\r\n     */\r\n    body: string | string[];\r\n    /**\r\n     * CSS classes to add to the footer.\r\n     */\r\n    footer: string | string[];\r\n}>;\r\n\r\ndeclare type PanelRenderOptions<TWidgetFactory extends AnyWidgetFactory> = RenderOptions & GetWidgetRenderState<TWidgetFactory>;\r\n\r\ndeclare type PanelTemplates<TWidget extends AnyWidgetFactory> = Partial<{\r\n    /**\r\n     * Template to use for the header.\r\n     */\r\n    header: Template<PanelRenderOptions<TWidget>>;\r\n    /**\r\n     * Template to use for the footer.\r\n     */\r\n    footer: Template<PanelRenderOptions<TWidget>>;\r\n    /**\r\n     * Template to use for collapse button.\r\n     */\r\n    collapseButtonText: Template<{\r\n        collapsed: boolean;\r\n    }>;\r\n}>;\r\n\r\ndeclare type PanelWidget = <TWidgetFactory extends AnyWidgetFactory>(panelWidgetParams?: PanelWidgetParams<TWidgetFactory>) => (widgetFactory: TWidgetFactory) => (widgetParams: Parameters<TWidgetFactory>[0]) => AugmentedWidget<TWidgetFactory>;\r\n\r\ndeclare type PanelWidgetParams<TWidgetFactory extends AnyWidgetFactory> = {\r\n    /**\r\n     * A function that is called on each render to determine if the\r\n     * panel should be hidden based on the render options.\r\n     */\r\n    hidden?: (options: PanelRenderOptions<TWidgetFactory>) => boolean;\r\n    /**\r\n     * A function that is called on each render to determine if the\r\n     * panel should be collapsed based on the render options.\r\n     */\r\n    collapsed?: (options: PanelRenderOptions<TWidgetFactory>) => boolean;\r\n    /**\r\n     * The templates to use for the widget.\r\n     */\r\n    templates?: PanelTemplates<TWidgetFactory>;\r\n    /**\r\n     * The CSS classes to override.\r\n     */\r\n    cssClasses?: PanelCSSClasses;\r\n};\r\n\r\ndeclare type ParamTrackedFilters = {\r\n    [facetName: string]: (facetValues: TrackedFilterRefinement[]) => TrackedFilterRefinement[];\r\n};\r\n\r\ndeclare type ParamTransformRuleContexts = (ruleContexts: string[]) => string[];\r\n\r\ndeclare type ParseURL<TRouteState> = (args: {\r\n    qsModule: typeof qs_2;\r\n    location: Location;\r\n}) => TRouteState;\r\n\r\n/**\r\n * Make certain keys of an object optional.\r\n */\r\ndeclare type PartialKeys<TObj, TKeys extends keyof TObj> = Omit<TObj, TKeys> & Partial<Pick<TObj, TKeys>>;\r\n\r\ndeclare type PlacesInstance = Places.PlacesInstance;\r\n\r\ndeclare type PlacesWidget = WidgetFactory<PlacesWidgetDescription, PlacesWidgetParams, PlacesWidgetParams>;\r\n\r\ndeclare type PlacesWidgetDescription = {\r\n    $$type: 'ais.places';\r\n    $$widgetType: 'ais.places';\r\n    renderState: Record<string, unknown>;\r\n    indexRenderState: {\r\n        places: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams>;\r\n    };\r\n    indexUiState: {\r\n        places: {\r\n            query: string;\r\n            position: string;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type PlacesWidgetParams = {\r\n    /**\r\n     * The Algolia Places reference to use.\r\n     *\r\n     * @see https://github.com/algolia/places\r\n     */\r\n    placesReference: (options: StaticOptions & ReconfigurableOptions) => PlacesInstance;\r\n    /**\r\n     * The default position when the input is empty.\r\n     */\r\n    defaultPosition?: string[];\r\n} & StaticOptions;\r\n\r\ndeclare const poweredBy: PoweredByWidget;\r\n\r\ndeclare type PoweredByConnector = Connector<PoweredByWidgetDescription, PoweredByConnectorParams>;\r\n\r\ndeclare type PoweredByConnectorParams = {\r\n    /** the url to redirect to on click */\r\n    url?: string;\r\n};\r\n\r\ndeclare type PoweredByCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the wrapping element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the link.\r\n     */\r\n    link: string | string[];\r\n    /**\r\n     * CSS class to add to the SVG logo.\r\n     */\r\n    logo: string | string[];\r\n}>;\r\n\r\ndeclare type PoweredByRenderState = {\r\n    /** the url to redirect to on click */\r\n    url: string;\r\n};\r\n\r\ndeclare type PoweredByWidget = WidgetFactory<PoweredByWidgetDescription & {\r\n    $$widgetType: 'ais.poweredBy';\r\n}, PoweredByConnectorParams, PoweredByWidgetParams>;\r\n\r\ndeclare type PoweredByWidgetDescription = {\r\n    $$type: 'ais.poweredBy';\r\n    renderState: PoweredByRenderState;\r\n    indexRenderState: {\r\n        poweredBy: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams>;\r\n    };\r\n};\r\n\r\ndeclare type PoweredByWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * The theme of the logo.\r\n     * @default 'light'\r\n     */\r\n    theme?: 'light' | 'dark';\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: PoweredByCSSClasses;\r\n};\r\n\r\ndeclare type PreparedTemplateProps<TTemplates extends Templates> = {\r\n    templatesConfig: TemplatesConfig;\r\n    templates: TTemplates;\r\n    useCustomCompileOptions: {\r\n        [TKey in keyof Partial<TTemplates>]: boolean;\r\n    };\r\n};\r\n\r\ndeclare type ProvidedInsightsClient = InsightsClient | null | undefined;\r\n\r\ndeclare const queryRuleContext: QueryRuleContextWidget;\r\n\r\ndeclare type QueryRuleContextWidget = WidgetFactory<QueryRulesWidgetDescription & {\r\n    $$widgetType: 'ais.queryRuleContext';\r\n}, QueryRulesConnectorParams, QueryRuleContextWidgetParams>;\r\n\r\ndeclare type QueryRuleContextWidgetParams = {\r\n    trackedFilters: ParamTrackedFilters;\r\n    transformRuleContexts?: ParamTransformRuleContexts;\r\n};\r\n\r\ndeclare const queryRuleCustomData: QueryRuleCustomDataWidget;\r\n\r\ndeclare type QueryRuleCustomDataCSSClasses = Partial<{\r\n    root: string | string[];\r\n}>;\r\n\r\ndeclare type QueryRuleCustomDataTemplates = Partial<{\r\n    default: Template<{\r\n        items: any[];\r\n    }>;\r\n}>;\r\n\r\ndeclare type QueryRuleCustomDataWidget = WidgetFactory<QueryRulesWidgetDescription & {\r\n    $$widgetType: 'ais.queryRuleCustomData';\r\n}, QueryRulesConnectorParams, QueryRuleCustomDataWidgetParams>;\r\n\r\ndeclare type QueryRuleCustomDataWidgetParams = {\r\n    container: string | HTMLElement;\r\n    cssClasses?: QueryRuleCustomDataCSSClasses;\r\n    templates?: QueryRuleCustomDataTemplates;\r\n};\r\n\r\ndeclare type QueryRulesConnector = Connector<QueryRulesWidgetDescription, QueryRulesConnectorParams>;\r\n\r\ndeclare type QueryRulesConnectorParams = {\r\n    trackedFilters?: ParamTrackedFilters;\r\n    transformRuleContexts?: ParamTransformRuleContexts;\r\n    transformItems?: TransformItems<any>;\r\n};\r\n\r\ndeclare type QueryRulesRenderState = {\r\n    items: any[];\r\n};\r\n\r\ndeclare type QueryRulesWidgetDescription = {\r\n    $$type: 'ais.queryRules';\r\n    renderState: QueryRulesRenderState;\r\n    indexRenderState: {\r\n        queryRules: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams>;\r\n    };\r\n};\r\n\r\ndeclare type QueueItem = QueueItemMap[keyof QueueItemMap];\r\n\r\ndeclare type QueueItemMap = {\r\n    [MethodName in keyof InsightsMethodMap]: [\r\n    methodName: MethodName,\r\n    ...args: InsightsMethodMap[MethodName][0][0]\r\n    ];\r\n};\r\n\r\ndeclare type Range_2 = {\r\n    min: RangeMin;\r\n    max: RangeMax;\r\n};\r\n\r\ndeclare type RangeBoundaries = [RangeMin, RangeMax];\r\n\r\ndeclare type RangeConnector = Connector<RangeWidgetDescription, RangeConnectorParams>;\r\n\r\ndeclare type RangeConnectorParams = {\r\n    /**\r\n     * Name of the attribute for faceting.\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * Minimal range value, default to automatically computed from the result set.\r\n     */\r\n    min?: number;\r\n    /**\r\n     * Maximal range value, default to automatically computed from the result set.\r\n     */\r\n    max?: number;\r\n    /**\r\n     * Number of digits after decimal point to use.\r\n     */\r\n    precision?: number;\r\n};\r\n\r\ndeclare const rangeInput: RangeInputWidget;\r\n\r\ndeclare type RangeInputCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when there's no refinements.\r\n     */\r\n    noRefinement: string | string[];\r\n    /**\r\n     * CSS class to add to the form element.\r\n     */\r\n    form: string | string[];\r\n    /**\r\n     * CSS class to add to the label element.\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to the input element.\r\n     */\r\n    input: string | string[];\r\n    /**\r\n     * CSS class to add to the min input element.\r\n     */\r\n    inputMin: string | string[];\r\n    /**\r\n     * CSS class to add to the max input element.\r\n     */\r\n    separator: string | string[];\r\n    /**\r\n     * CSS class to add to the separator of the form.\r\n     */\r\n    inputMax: string | string[];\r\n    /**\r\n     * CSS class to add to the submit button of the form.\r\n     */\r\n    submit: string | string[];\r\n}>;\r\n\r\ndeclare type RangeInputTemplates = Partial<{\r\n    /**\r\n     * The label of the separator, between min and max.\r\n     * @default \"to\"\r\n     */\r\n    separatorText: Template;\r\n    /**\r\n     * The label of the submit button\r\n     * @default \"Go\"\r\n     */\r\n    submitText: Template;\r\n}>;\r\n\r\ndeclare type RangeInputWidget = WidgetFactory<Omit<RangeWidgetDescription, '$$type'> & {\r\n    $$widgetType: 'ais.rangeInput';\r\n    $$type: 'ais.rangeInput';\r\n}, RangeConnectorParams, RangeInputWidgetParams>;\r\n\r\ndeclare type RangeInputWidgetParams = {\r\n    /**\r\n     * Valid CSS Selector as a string or DOMElement.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Name of the attribute for faceting.\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * Minimal slider value, default to automatically computed from the result set.\r\n     */\r\n    min?: number;\r\n    /**\r\n     * Maximal slider value, defaults to automatically computed from the result set.\r\n     */\r\n    max?: number;\r\n    /**\r\n     * Number of digits after decimal point to use.\r\n     * @default 0\r\n     */\r\n    precision?: number;\r\n    /**\r\n     * Labels to use for the widget.\r\n     */\r\n    templates?: RangeInputTemplates;\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: RangeInputCSSClasses;\r\n};\r\n\r\ndeclare type RangeMax = number | undefined;\r\n\r\ndeclare type RangeMin = number | undefined;\r\n\r\ndeclare type RangeRenderState = {\r\n    /**\r\n     * Sets a range to filter the results on. Both values\r\n     * are optional, and will default to the higher and lower bounds. You can use `undefined` to remove a\r\n     * previously set bound or to set an infinite bound.\r\n     * @param rangeValue tuple of [min, max] bounds\r\n     */\r\n    refine: (rangeValue: RangeBoundaries) => void;\r\n    /**\r\n     * Indicates whether this widget can be refined\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Send an event to the insights middleware\r\n     */\r\n    sendEvent: SendEventForFacet;\r\n    /**\r\n     * Maximum range possible for this search\r\n     */\r\n    range: Range_2;\r\n    /**\r\n     * Current refinement of the search\r\n     */\r\n    start: RangeBoundaries;\r\n    /**\r\n     * Transform for the rendering `from` and/or `to` values.\r\n     * Both functions take a `number` as input and should output a `string`.\r\n     */\r\n    format: {\r\n        from: (fromValue: number) => string;\r\n        to: (toValue: number) => string;\r\n    };\r\n};\r\n\r\n/**\r\n * The range slider is a widget which provides a user-friendly way to filter the\r\n * results based on a single numeric range.\r\n *\r\n * @requirements\r\n * The attribute passed to `attribute` must be declared as an\r\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\r\n * in your Algolia settings.\r\n *\r\n * The values inside this attribute must be JavaScript numbers (not strings).\r\n */\r\ndeclare const rangeSlider: RangeSliderWidget;\r\n\r\ndeclare type RangeSliderCssClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the disabled root element.\r\n     */\r\n    disabledRoot: string | string[];\r\n}>;\r\n\r\ndeclare type RangeSliderTooltipOptions = {\r\n    /**\r\n     * The function takes the raw value as input, and should return\r\n     * a string for the label that should be used for this value.\r\n     * @example\r\n     * { format(rawValue) {return '$' + Math.round(rawValue).toLocaleString() } }\r\n     */\r\n    format: (value: number) => string;\r\n};\r\n\r\ndeclare type RangeSliderWidget = WidgetFactory<Omit<RangeWidgetDescription, '$$type'> & {\r\n    $$widgetType: 'ais.rangeSlider';\r\n    $$type: 'ais.rangeSlider';\r\n}, RangeConnectorParams, RangeSliderWidgetParams>;\r\n\r\ndeclare type RangeSliderWidgetParams = {\r\n    /**\r\n     * CSS Selector or DOMElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Name of the attribute for faceting.;\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * Should we show tooltips or not.\r\n     * The default tooltip will show the raw value.\r\n     * You can also provide an object with a format function as an attribute.\r\n     * So that you can format the tooltip display value as you want.\r\n     * @default true\r\n     */\r\n    tooltips?: boolean | RangeSliderTooltipOptions;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: RangeSliderCssClasses;\r\n    /**\r\n     * Show slider pips.\r\n     * @default true\r\n     */\r\n    pips?: boolean;\r\n    /**\r\n     * Number of digits after decimal point to use.\r\n     * @default 0\r\n     */\r\n    precision?: number;\r\n    /**\r\n     * Every handle move will jump that number of steps.\r\n     */\r\n    step?: number;\r\n    /**\r\n     * Minimal slider value, default to automatically computed from the result set.\r\n     */\r\n    min?: number;\r\n    /**\r\n     * Maximal slider value, defaults to automatically computed from the result set.\r\n     */\r\n    max?: number;\r\n};\r\n\r\ndeclare type RangeWidgetDescription = {\r\n    $$type: 'ais.range';\r\n    renderState: RangeRenderState;\r\n    indexRenderState: {\r\n        range: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        range: {\r\n            [attribute: string]: string;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare const ratingMenu: RatingMenuWidget;\r\n\r\ndeclare type RatingMenuConnector = Connector<RatingMenuWidgetDescription, RatingMenuConnectorParams>;\r\n\r\ndeclare type RatingMenuConnectorParams = {\r\n    /**\r\n     * Name of the attribute for faceting (eg. \"free_shipping\").\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * The maximum rating value.\r\n     */\r\n    max?: number;\r\n};\r\n\r\ndeclare type RatingMenuCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when there's no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to each item element.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add the selected item element.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS class to add a disabled item element.\r\n     */\r\n    disabledItem: string | string[];\r\n    /**\r\n     * CSS class to add to each link element.\r\n     */\r\n    link: string | string[];\r\n    /**\r\n     * CSS class to add to each star element (when using the default template).\r\n     */\r\n    starIcon: string | string[];\r\n    /**\r\n     * CSS class to add to each full star element (when using the default template).\r\n     */\r\n    fullStarIcon: string | string[];\r\n    /**\r\n     * CSS class to add to each empty star element (when using the default template).\r\n     */\r\n    emptyStarIcon: string | string[];\r\n    /**\r\n     * CSS class to add to each label.\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to each counter.\r\n     */\r\n    count: string | string[];\r\n}>;\r\n\r\ndeclare type RatingMenuRenderState = {\r\n    /**\r\n     * Possible star ratings the user can apply.\r\n     */\r\n    items: StarRatingItems[];\r\n    /**\r\n     * Creates an URL for the next state (takes the item value as parameter). Takes the value of an item as parameter.\r\n     */\r\n    createURL: CreateURL<string>;\r\n    /**\r\n     *  Indicates if search state can be refined.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Selects a rating to filter the results (takes the filter value as parameter). Takes the value of an item as parameter.\r\n     */\r\n    refine: (value: string) => void;\r\n    /**\r\n     * `true` if the last search contains no result.\r\n     *\r\n     * @deprecated Use `canRefine` instead.\r\n     */\r\n    hasNoResults: boolean;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEvent;\r\n};\r\n\r\ndeclare type RatingMenuTemplates = Partial<{\r\n    /**\r\n     * Item template, provided with `name`, `count`, `isRefined`, `url` data properties.\r\n     */\r\n    item: Template<{\r\n        name: string;\r\n        label: string;\r\n        value: string;\r\n        count: number;\r\n        isRefined: boolean;\r\n        url: string;\r\n        stars: [boolean, boolean, boolean, boolean, boolean];\r\n        cssClasses: RatingMenuCSSClasses;\r\n        attribute?: string;\r\n        isFromSearch?: boolean;\r\n    }>;\r\n}>;\r\n\r\n/**\r\n * Rating menu is used for displaying grade like filters. The values are normalized within boundaries.\r\n *\r\n * The maximum value can be set (with `max`), the minimum is always 0.\r\n *\r\n * @requirements\r\n * The attribute passed to `attribute` must be declared as an\r\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\r\n * in your Algolia settings.\r\n *\r\n * The values inside this attribute must be JavaScript numbers (not strings).\r\n *\r\n * @type {WidgetFactory}\r\n * @devNovel RatingMenu\r\n * @category filter\r\n * @param {RatingMenuWidgetParams} widgetParams RatingMenu widget options.\r\n * @return {Widget} A new RatingMenu widget instance.\r\n * @example\r\n * search.addWidgets([\r\n *   instantsearch.widgets.ratingMenu({\r\n *     container: '#stars',\r\n *     attribute: 'rating',\r\n *     max: 5,\r\n *   })\r\n * ]);\r\n */\r\ndeclare type RatingMenuWidget = WidgetFactory<RatingMenuWidgetDescription & {\r\n    $$widgetType: 'ais.ratingMenu';\r\n}, RatingMenuConnectorParams, RatingMenuWidgetParams>;\r\n\r\ndeclare type RatingMenuWidgetDescription = {\r\n    $$type: 'ais.ratingMenu';\r\n    renderState: RatingMenuRenderState;\r\n    indexRenderState: {\r\n        ratingMenu: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        ratingMenu: {\r\n            [attribute: string]: number | undefined;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type RatingMenuWidgetParams = {\r\n    /**\r\n     * Place where to insert the widget in your webpage.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Name of the attribute in your records that contains the ratings.\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * The maximum rating value.\r\n     */\r\n    max?: number;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: RatingMenuTemplates;\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: RatingMenuCSSClasses;\r\n};\r\n\r\ndeclare type Read<THit extends NonNullable<object>> = ({ state, }: {\r\n    state: PlainSearchParameters;\r\n}) => InfiniteHitsCachedHits<THit> | null;\r\n\r\ndeclare type RecommendRenderOptions = SharedRenderOptions & {\r\n    results: RecommendResponse<any>;\r\n};\r\n\r\ndeclare type RecommendWidget<TWidgetDescription extends WidgetDescription & WidgetParams> = {\r\n    dependsOn: 'recommend';\r\n    $$id?: number;\r\n    getWidgetParameters: (state: RecommendParameters, widgetParametersOptions: {\r\n        uiState: Expand<Partial<TWidgetDescription['indexUiState'] & IndexUiState>>;\r\n    }) => RecommendParameters;\r\n    getRenderState: (renderState: Expand<IndexRenderState & Partial<TWidgetDescription['indexRenderState']>>, renderOptions: InitOptions | RecommendRenderOptions) => IndexRenderState & TWidgetDescription['indexRenderState'];\r\n    getWidgetRenderState: (renderOptions: InitOptions | RecommendRenderOptions) => Expand<WidgetRenderState<TWidgetDescription['renderState'], TWidgetDescription['widgetParams']>>;\r\n};\r\n\r\ndeclare type ReconfigurableOptions = Places.ReconfigurableOptions;\r\n\r\n/**\r\n * Refine the given search parameters.\r\n */\r\ndeclare type Refine = (searchParameters: PlainSearchParameters) => void;\r\n\r\ndeclare type Refine_2 = (relevancyStrictness: number | undefined) => void;\r\n\r\n/**\r\n * The refinement list widget is one of the most common widget that you can find\r\n * in a search UI. With this widget, the user can filter the dataset based on facets.\r\n *\r\n * The refinement list displays only the most relevant facets for the current search\r\n * context. The sort option only affects the facet that are returned by the engine,\r\n * not which facets are returned.\r\n *\r\n * This widget also implements search for facet values, which is a mini search inside the\r\n * values of the facets. This makes easy to deal with uncommon facet values.\r\n *\r\n * @requirements\r\n *\r\n * The attribute passed to `attribute` must be declared as an\r\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\r\n * in your Algolia settings.\r\n *\r\n * If you also want to use search for facet values on this attribute, you need to make it searchable using the [dashboard](https://www.algolia.com/explorer/display/) or using the [API](https://www.algolia.com/doc/guides/searching/faceting/#search-for-facet-values).\r\n */\r\ndeclare const refinementList: RefinementListWidget;\r\n\r\ndeclare type RefinementListConnector = Connector<RefinementListWidgetDescription, RefinementListConnectorParams>;\r\n\r\ndeclare type RefinementListConnectorParams = {\r\n    /**\r\n     * The name of the attribute in the records.\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * How the filters are combined together.\r\n     */\r\n    operator?: 'and' | 'or';\r\n    /**\r\n     * The max number of items to display when\r\n     * `showMoreLimit` is not set or if the widget is showing less value.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * Whether to display a button that expands the number of items.\r\n     */\r\n    showMore?: boolean;\r\n    /**\r\n     * The max number of items to display if the widget\r\n     * is showing more items.\r\n     */\r\n    showMoreLimit?: number;\r\n    /**\r\n     * How to sort refinements. Possible values: `count|isRefined|name:asc|name:desc`.\r\n     *\r\n     * You can also use a sort function that behaves like the standard Javascript [compareFunction](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Syntax).\r\n     *\r\n     * If a facetOrdering is set in the index settings, it is used when sortBy isn't passed\r\n     */\r\n    sortBy?: SortBy<SearchResults.FacetValue>;\r\n    /**\r\n     * Escapes the content of the facet values.\r\n     */\r\n    escapeFacetValues?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<RefinementListItem>;\r\n};\r\n\r\ndeclare type RefinementListCSSClasses = RefinementListOwnCSSClasses & RefinementListSearchableCSSClasses;\r\n\r\ndeclare type RefinementListItem = {\r\n    /**\r\n     * The value of the refinement list item.\r\n     */\r\n    value: string;\r\n    /**\r\n     * Human-readable value of the refinement list item.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Human-readable value of the searched refinement list item.\r\n     */\r\n    highlighted?: string;\r\n    /**\r\n     * Number of matched results after refinement is applied.\r\n     */\r\n    count: number;\r\n    /**\r\n     * Indicates if the list item is refined.\r\n     */\r\n    isRefined: boolean;\r\n};\r\n\r\ndeclare type RefinementListItemData = {\r\n    /**\r\n     * The number of occurrences of the facet in the result set.\r\n     */\r\n    count: number;\r\n    /**\r\n     * True if the value is selected.\r\n     */\r\n    isRefined: boolean;\r\n    /**\r\n     * The label to display.\r\n     */\r\n    label: string;\r\n    /**\r\n     * The value used for refining.\r\n     */\r\n    value: string;\r\n    /**\r\n     * The label highlighted (when using search for facet values). This value is displayed in the default template.\r\n     */\r\n    highlighted: string;\r\n    /**\r\n     * The url with this refinement selected.\r\n     */\r\n    url: string;\r\n    /**\r\n     * Object containing all the classes computed for the item.\r\n     */\r\n    cssClasses: RefinementListCSSClasses;\r\n    /**\r\n     * Whether the `items` prop contains facet values from the global search or from the search inside the items.\r\n     */\r\n    isFromSearch: boolean;\r\n};\r\n\r\ndeclare type RefinementListOwnCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the root element with no results.\r\n     */\r\n    noResults: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to each item element.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add to each selected element.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS class to add to each label element (when using the default template).\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to each checkbox element (when using the default template).\r\n     */\r\n    checkbox: string | string[];\r\n    /**\r\n     * CSS class to add to each label text element.\r\n     */\r\n    labelText: string | string[];\r\n    /**\r\n     * CSS class to add to the show more element\r\n     */\r\n    showMore: string | string[];\r\n    /**\r\n     * CSS class to add to the disabled show more element\r\n     */\r\n    disabledShowMore: string | string[];\r\n    /**\r\n     * CSS class to add to each count element (when using the default template).\r\n     */\r\n    count: string | string[];\r\n    /**\r\n     * CSS class to add to the searchable container.\r\n     */\r\n    searchBox: string | string[];\r\n}>;\r\n\r\ndeclare type RefinementListOwnTemplates = Partial<{\r\n    /**\r\n     * Item template, provided with `label`, `highlighted`, `value`, `count`, `isRefined`, `url` data properties.\r\n     */\r\n    item: Template<RefinementListItemData>;\r\n    /**\r\n     * Template used for the show more text, provided with `isShowingMore` data property.\r\n     */\r\n    showMoreText: Template<{\r\n        isShowingMore: boolean;\r\n    }>;\r\n    /**\r\n     * Templates to use for search for facet values when there are no results.\r\n     */\r\n    searchableNoResults: Template;\r\n}>;\r\n\r\ndeclare type RefinementListRenderState = {\r\n    /**\r\n     * The list of filtering values returned from Algolia API.\r\n     */\r\n    items: RefinementListItem[];\r\n    /**\r\n     * indicates whether the results are exhaustive (complete)\r\n     */\r\n    hasExhaustiveItems: boolean;\r\n    /**\r\n     * Creates the next state url for a selected refinement.\r\n     */\r\n    createURL: CreateURL<string>;\r\n    /**\r\n     * Action to apply selected refinements.\r\n     */\r\n    refine: (value: string) => void;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEventForFacet;\r\n    /**\r\n     * Searches for values inside the list.\r\n     */\r\n    searchForItems: (query: string) => void;\r\n    /**\r\n     * `true` if the values are from an index search.\r\n     */\r\n    isFromSearch: boolean;\r\n    /**\r\n     * `true` if a refinement can be applied.\r\n     * @MAJOR: reconsider how `canRefine` is computed so it both accounts for the\r\n     * items returned in the main search and in SFFV.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * `true` if the toggleShowMore button can be activated (enough items to display more or\r\n     * already displaying more than `limit` items)\r\n     */\r\n    canToggleShowMore: boolean;\r\n    /**\r\n     * True if the menu is displaying all the menu items.\r\n     */\r\n    isShowingMore: boolean;\r\n    /**\r\n     * Toggles the number of values displayed between `limit` and `showMoreLimit`.\r\n     */\r\n    toggleShowMore: () => void;\r\n};\r\n\r\ndeclare type RefinementListSearchableCSSClasses = Partial<{\r\n    searchableRoot: string | string[];\r\n    searchableForm: string | string[];\r\n    searchableInput: string | string[];\r\n    searchableSubmit: string | string[];\r\n    searchableSubmitIcon: string | string[];\r\n    searchableReset: string | string[];\r\n    searchableResetIcon: string | string[];\r\n    searchableLoadingIndicator: string | string[];\r\n    searchableLoadingIcon: string | string[];\r\n}>;\r\n\r\ndeclare type RefinementListSearchableTemplates = Partial<{\r\n    /**\r\n     * Templates to use for search for facet values submit button.\r\n     */\r\n    searchableSubmit: SearchBoxTemplates['submit'];\r\n    /**\r\n     * Templates to use for search for facet values reset button.\r\n     */\r\n    searchableReset: SearchBoxTemplates['reset'];\r\n    /**\r\n     * Templates to use for the search for facet values loading indicator.\r\n     */\r\n    searchableLoadingIndicator: SearchBoxTemplates['loadingIndicator'];\r\n}>;\r\n\r\ndeclare type RefinementListTemplates = RefinementListOwnTemplates & RefinementListSearchableTemplates;\r\n\r\ndeclare type RefinementListWidget = WidgetFactory<RefinementListWidgetDescription & {\r\n    $$widgetType: 'ais.refinementList';\r\n}, RefinementListConnectorParams, RefinementListWidgetParams>;\r\n\r\ndeclare type RefinementListWidgetDescription = {\r\n    $$type: 'ais.refinementList';\r\n    renderState: RefinementListRenderState;\r\n    indexRenderState: {\r\n        refinementList: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        refinementList: {\r\n            [attribute: string]: string[];\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type RefinementListWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Add a search input to let the user search for more facet values. In order\r\n     * to make this feature work, you need to make the attribute searchable\r\n     * [using the API](https://www.algolia.com/doc/guides/searching/faceting/?language=js#declaring-a-searchable-attribute-for-faceting)\r\n     * or [the dashboard](https://www.algolia.com/explorer/display/)\r\n     */\r\n    searchable?: boolean;\r\n    /**\r\n     * Value of the search field placeholder.\r\n     */\r\n    searchablePlaceholder?: string;\r\n    /**\r\n     * When `false` the search field will become disabled if there are less items\r\n     * to display than the `options.limit`, otherwise the search field is always usable.\r\n     */\r\n    searchableIsAlwaysActive?: boolean;\r\n    /**\r\n     * When activated, it will escape the facet values that are returned from Algolia.\r\n     * In this case, the surrounding tags will always be `<mark></mark>`.\r\n     */\r\n    searchableEscapeFacetValues?: boolean;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: RefinementListTemplates;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: RefinementListCSSClasses;\r\n};\r\n\r\ndeclare type RelatedProductsConnectorParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The `objectIDs` of the items to get related products from.\r\n     */\r\n    objectIDs: string[];\r\n    /**\r\n     * The number of recommendations to retrieve.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * The threshold for the recommendations confidence score (between 0 and 100).\r\n     */\r\n    threshold?: number;\r\n    /**\r\n     * List of search parameters to send.\r\n     */\r\n    fallbackParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * List of search parameters to send.\r\n     */\r\n    queryParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * Whether to escape HTML tags from items string values.\r\n     *\r\n     * @default true\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<Hit<THit>, {\r\n        results: RecommendResponse<AlgoliaHit<THit>>;\r\n    }>;\r\n};\r\n\r\ndeclare type RelatedProductsCSSClasses = Partial<RecommendClassNames>;\r\n\r\ndeclare type RelatedProductsRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The matched recommendations from the Algolia API.\r\n     */\r\n    items: Array<Hit<THit>>;\r\n    /**\r\n     * Sends an event to the Insights middleware.\r\n     */\r\n    sendEvent: SendEventForHits;\r\n};\r\n\r\ndeclare type RelatedProductsTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\r\n    /**\r\n     * Template to use when there are no results.\r\n     */\r\n    empty: Template<RecommendResponse<Hit<THit>>>;\r\n    /**\r\n     * Template to use for the header of the widget.\r\n     */\r\n    header: Template<Pick<Parameters<NonNullable<RelatedProductsProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {\r\n        cssClasses: RecommendClassNames;\r\n    }>;\r\n    /**\r\n     * Template to use for each result. This template will receive an object containing a single record.\r\n     */\r\n    item: TemplateWithBindEvent<Hit<THit>>;\r\n    /**\r\n     * Template to use to wrap all items.\r\n     */\r\n    layout: Template<Pick<Parameters<NonNullable<RelatedProductsProps<Hit<THit>>['layout']>>[0], 'items'> & {\r\n        templates: {\r\n            item: RelatedProductsProps<Hit<THit>>['itemComponent'];\r\n        };\r\n        cssClasses: Pick<RelatedProductsCSSClasses, 'list' | 'item'>;\r\n    }>;\r\n}>;\r\n\r\ndeclare type RelatedProductsWidgetParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * CSS selector or `HTMLElement` to insert the widget into.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to customize the widget.\r\n     */\r\n    templates?: RelatedProductsTemplates<THit>;\r\n    /**\r\n     * CSS classes to add to the widget elements.\r\n     */\r\n    cssClasses?: RelatedProductsCSSClasses;\r\n};\r\n\r\ndeclare const relevantSort: RelevantSortWidget;\r\n\r\ndeclare type RelevantSortConnector = Connector<RelevantSortWidgetDescription, RelevantSortConnectorParams>;\r\n\r\ndeclare type RelevantSortConnectorParams = Record<string, unknown>;\r\n\r\ndeclare type RelevantSortCSSClasses = Partial<{\r\n    root: string;\r\n    text: string;\r\n    button: string;\r\n}>;\r\n\r\ndeclare type RelevantSortRenderState = {\r\n    /**\r\n     * Indicates if it has appliedRelevancyStrictness greater than zero\r\n     */\r\n    isRelevantSorted: boolean;\r\n    /**\r\n     * Indicates if the results come from a virtual replica\r\n     */\r\n    isVirtualReplica: boolean;\r\n    /**\r\n     * Indicates if search state can be refined\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Sets the value as relevancyStrictness and trigger a new search\r\n     */\r\n    refine: Refine_2;\r\n};\r\n\r\ndeclare type RelevantSortTemplates = Partial<{\r\n    text: Template<{\r\n        isRelevantSorted: boolean;\r\n    }>;\r\n    button: Template<{\r\n        isRelevantSorted: boolean;\r\n    }>;\r\n}>;\r\n\r\ndeclare type RelevantSortWidget = WidgetFactory<RelevantSortWidgetDescription & {\r\n    $$widgetType: 'ais.relevantSort';\r\n}, RelevantSortConnectorParams, RelevantSortWidgetParams>;\r\n\r\ndeclare type RelevantSortWidgetDescription = {\r\n    $$type: 'ais.relevantSort';\r\n    renderState: RelevantSortRenderState;\r\n    indexRenderState: {\r\n        relevantSort: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        relevantSort: number;\r\n    };\r\n};\r\n\r\ndeclare type RelevantSortWidgetParams = {\r\n    container: string | HTMLElement;\r\n    cssClasses?: RelevantSortCSSClasses;\r\n    templates?: RelevantSortTemplates;\r\n};\r\n\r\n/**\r\n * The render function.\r\n */\r\ndeclare type Renderer<TRenderState, TWidgetParams> = (\r\n/**\r\n * The base render options plus the specific options of the widget.\r\n */\r\nrenderState: TRenderState & RendererOptions<TWidgetParams>, \r\n/**\r\n * If is the first run.\r\n */\r\nisFirstRender: boolean) => void;\r\n\r\n/**\r\n * The base renderer options. All render functions receive\r\n * the options below plus the specific options per connector.\r\n */\r\ndeclare type RendererOptions<TWidgetParams> = {\r\n    /**\r\n     * The original widget params. Useful as you may\r\n     * need them while using the render function.\r\n     */\r\n    widgetParams: TWidgetParams;\r\n    /**\r\n     * The current instant search instance.\r\n     */\r\n    instantSearchInstance: InstantSearch;\r\n    /**\r\n     * The original search results.\r\n     */\r\n    results?: SearchResults;\r\n    /**\r\n     * The mutable list of hits. The may change depending\r\n     * of the given transform items function.\r\n     */\r\n    hits?: Hit[];\r\n    /**\r\n     * The current insights client, if any.\r\n     */\r\n    insights?: InsightsClient;\r\n};\r\n\r\ndeclare type RenderOptions = SharedRenderOptions & {\r\n    results: SearchResults | null;\r\n};\r\n\r\ndeclare type RenderState = {\r\n    [indexId: string]: IndexRenderState;\r\n};\r\n\r\ndeclare type RenderStateLifeCycle<TWidgetDescription extends WidgetDescription & WidgetParams> = TWidgetDescription extends RequiredKeys<WidgetDescription, 'renderState' | 'indexRenderState'> & WidgetParams ? RequiredRenderStateLifeCycle<TWidgetDescription> : Partial<RequiredRenderStateLifeCycle<TWidgetDescription>>;\r\n\r\ndeclare function renderTemplate({ templates, templateKey, compileOptions, helpers, data, bindEvent, sendEvent, }: {\r\n    templates: Templates;\r\n    templateKey: string;\r\n    compileOptions?: HoganOptions;\r\n    helpers?: HoganHelpers;\r\n    data?: Record<string, any>;\r\n    bindEvent?: BindEventForHits;\r\n    sendEvent?: SendEventForHits;\r\n}): string | VNode<    {}> | VNode<    {}>[] | null;\r\n\r\ndeclare type RequiredKeys<TObject, TKeys extends keyof TObject> = Expand<Required<Pick<TObject, TKeys>> & Omit<TObject, TKeys>>;\r\n\r\ndeclare type RequiredRenderStateLifeCycle<TWidgetDescription extends WidgetDescription & WidgetParams> = {\r\n    /**\r\n     * Returns the render state of the current widget to pass to the render function.\r\n     */\r\n    getWidgetRenderState: (renderOptions: InitOptions | RenderOptions) => Expand<WidgetRenderState<TWidgetDescription['renderState'], TWidgetDescription['widgetParams']>>;\r\n    /**\r\n     * Returns IndexRenderState of the current index component tree\r\n     * to build the render state of the whole app.\r\n     */\r\n    getRenderState: (renderState: Expand<IndexRenderState & Partial<TWidgetDescription['indexRenderState']>>, renderOptions: InitOptions | RenderOptions) => IndexRenderState & TWidgetDescription['indexRenderState'];\r\n};\r\n\r\ndeclare type RequiredUiStateLifeCycle<TWidgetDescription extends WidgetDescription> = {\r\n    /**\r\n     * This function is required for a widget to be taken in account for routing.\r\n     * It will derive a uiState for this widget based on the existing uiState and\r\n     * the search parameters applied.\r\n     *\r\n     * @param uiState - Current state.\r\n     * @param widgetStateOptions - Extra information to calculate uiState.\r\n     */\r\n    getWidgetUiState: (uiState: Expand<Partial<TWidgetDescription['indexUiState'] & IndexUiState>>, widgetUiStateOptions: {\r\n        searchParameters: SearchParameters;\r\n        helper: AlgoliaSearchHelper;\r\n    }) => Partial<IndexUiState & TWidgetDescription['indexUiState']>;\r\n    /**\r\n     * This function is required for a widget to be taken in account for routing.\r\n     * It will derive a uiState for this widget based on the existing uiState and\r\n     * the search parameters applied.\r\n     *\r\n     * @deprecated Use `getWidgetUiState` instead.\r\n     * @param uiState - Current state.\r\n     * @param widgetStateOptions - Extra information to calculate uiState.\r\n     */\r\n    getWidgetState?: RequiredUiStateLifeCycle<TWidgetDescription>['getWidgetUiState'];\r\n    /**\r\n     * This function is required for a widget to behave correctly when a URL is\r\n     * loaded via e.g. Routing. It receives the current UiState and applied search\r\n     * parameters, and is expected to return a new search parameters.\r\n     *\r\n     * @param state - Applied search parameters.\r\n     * @param widgetSearchParametersOptions - Extra information to calculate next searchParameters.\r\n     */\r\n    getWidgetSearchParameters: (state: SearchParameters, widgetSearchParametersOptions: {\r\n        uiState: Expand<Partial<TWidgetDescription['indexUiState'] & IndexUiState>>;\r\n    }) => SearchParameters;\r\n};\r\n\r\ndeclare type RequiredWidgetLifeCycle<TWidgetDescription extends WidgetDescription> = {\r\n    /**\r\n     * Identifier for connectors and widgets.\r\n     */\r\n    $$type: TWidgetDescription['$$type'];\r\n    /**\r\n     * Called once before the first search.\r\n     */\r\n    init?: (options: InitOptions) => void;\r\n    /**\r\n     * Whether `render` should be called\r\n     */\r\n    shouldRender?: (options: ShouldRenderOptions) => boolean;\r\n    /**\r\n     * Called after each search response has been received.\r\n     */\r\n    render?: (options: RenderOptions) => void;\r\n    /**\r\n     * Called when this widget is unmounted. Used to remove refinements set by\r\n     * during this widget's initialization and life time.\r\n     */\r\n    dispose?: (options: DisposeOptions) => SearchParameters | RecommendParameters | void;\r\n};\r\n\r\ndeclare type RequiredWidgetType<TWidgetDescription extends WidgetDescription> = {\r\n    /**\r\n     * Identifier for widgets.\r\n     */\r\n    $$widgetType: TWidgetDescription['$$widgetType'];\r\n};\r\n\r\ndeclare function ReverseHighlight<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: ReverseHighlightProps<THit>): h.JSX.Element;\r\n\r\n/**\r\n * @deprecated use html tagged templates and the ReverseHighlight component instead\r\n */\r\ndeclare function reverseHighlight({ attribute, highlightedTagName, hit, cssClasses, }: ReverseHighlightOptions): string;\r\n\r\ndeclare type ReverseHighlightClassNames = HighlightClassNames_2;\r\n\r\ndeclare type ReverseHighlightOptions = {\r\n    attribute: string | string[];\r\n    highlightedTagName?: string;\r\n    hit: Partial<Hit>;\r\n    cssClasses?: Partial<{\r\n        highlighted: string;\r\n    }>;\r\n};\r\n\r\ndeclare type ReverseHighlightProps<THit extends Hit<BaseHit>> = {\r\n    hit: THit;\r\n    attribute: keyof THit | string[];\r\n    cssClasses?: ReverseHighlightProps_2['classNames'];\r\n} & PartialKeys<Omit<ReverseHighlightProps_2, 'parts' | 'classNames'>, 'highlightedTagName' | 'nonHighlightedTagName' | 'separator'>;\r\n\r\ndeclare type ReverseHighlightProps_2 = Omit<HighlightProps_3, 'classNames'> & {\r\n    classNames?: Partial<ReverseHighlightClassNames>;\r\n};\r\n\r\ndeclare function ReverseSnippet<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: ReverseSnippetProps<THit>): h.JSX.Element;\r\n\r\n/**\r\n * @deprecated use html tagged templates and the ReverseSnippet component instead\r\n */\r\ndeclare function reverseSnippet({ attribute, highlightedTagName, hit, cssClasses, }: ReverseSnippetOptions): string;\r\n\r\ndeclare type ReverseSnippetClassNames = HighlightClassNames_2;\r\n\r\ndeclare type ReverseSnippetOptions = {\r\n    attribute: string | string[];\r\n    highlightedTagName?: string;\r\n    hit: Partial<Hit>;\r\n    cssClasses?: Partial<{\r\n        highlighted: string;\r\n    }>;\r\n};\r\n\r\ndeclare type ReverseSnippetProps<THit extends Hit<BaseHit>> = {\r\n    hit: THit;\r\n    attribute: keyof THit | string[];\r\n    cssClasses?: ReverseSnippetProps_2['classNames'];\r\n} & PartialKeys<Omit<ReverseSnippetProps_2, 'parts' | 'classNames'>, 'highlightedTagName' | 'nonHighlightedTagName' | 'separator'>;\r\n\r\ndeclare type ReverseSnippetProps_2 = Omit<HighlightProps_3, 'classNames'> & {\r\n    classNames?: Partial<ReverseSnippetClassNames>;\r\n};\r\n\r\n/**\r\n * The router is the part that saves and reads the object from the storage.\r\n * Usually this is the URL.\r\n */\r\ndeclare type Router<TRouteState = UiState> = {\r\n    /**\r\n     * onUpdate Sets an event listener that is triggered when the storage is updated.\r\n     * The function should accept a callback to trigger when the update happens.\r\n     * In the case of the history / URL in a browser, the callback will be called\r\n     * by `onPopState`.\r\n     */\r\n    onUpdate: (callback: (route: TRouteState) => void) => void;\r\n    /**\r\n     * Reads the storage and gets a route object. It does not take parameters,\r\n     * and should return an object\r\n     */\r\n    read: () => TRouteState;\r\n    /**\r\n     * Pushes a route object into a storage. Takes the UI state mapped by the state\r\n     * mapping configured in the mapping\r\n     */\r\n    write: (route: TRouteState) => void;\r\n    /**\r\n     * Transforms a route object into a URL. It receives an object and should\r\n     * return a string. It may return an empty string.\r\n     */\r\n    createURL: (state: TRouteState) => string;\r\n    /**\r\n     * Called when InstantSearch is disposed. Used to remove subscriptions.\r\n     */\r\n    dispose: () => void;\r\n    /**\r\n     * Called when InstantSearch is started.\r\n     */\r\n    start?: () => void;\r\n    /**\r\n     * Identifier for this router. Used to differentiate between routers.\r\n     */\r\n    $$type?: string;\r\n};\r\n\r\ndeclare type RouterProps<TUiState extends UiState = UiState, TRouteState = TUiState> = {\r\n    router?: Router<TRouteState>;\r\n    stateMapping?: StateMapping<TUiState, TRouteState>;\r\n};\r\n\r\ndeclare namespace routers {\r\n    export {\r\n        historyRouter as history\r\n    }\r\n}\r\n\r\ndeclare type ScopedResult = {\r\n    indexId: string;\r\n    results: SearchResults | null;\r\n    helper: AlgoliaSearchHelper;\r\n};\r\n\r\ndeclare const searchBox: SearchBoxWidget;\r\n\r\ndeclare type SearchBoxComponentCSSClasses = ComponentCSSClasses<SearchBoxCSSClasses>;\r\n\r\ndeclare type SearchBoxConnector = Connector<SearchBoxWidgetDescription, SearchBoxConnectorParams>;\r\n\r\ndeclare type SearchBoxConnectorParams = {\r\n    /**\r\n     * A function that will be called every time\r\n     * a new value for the query is set. The first parameter is the query and the second is a\r\n     * function to actually trigger the search. The function takes the query as the parameter.\r\n     *\r\n     * This queryHook can be used to debounce the number of searches done from the searchBox.\r\n     */\r\n    queryHook?: (query: string, hook: (value: string) => void) => void;\r\n};\r\n\r\ndeclare type SearchBoxCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the wrapping `<div>`\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the form\r\n     */\r\n    form: string | string[];\r\n    /**\r\n     * CSS class to add to the input.\r\n     */\r\n    input: string | string[];\r\n    /**\r\n     * CSS classes added to the submit button.\r\n     */\r\n    submit: string | string[];\r\n    /**\r\n     * CSS classes added to the submit icon.\r\n     */\r\n    submitIcon: string | string[];\r\n    /**\r\n     * CSS classes added to the reset button.\r\n     */\r\n    reset: string | string[];\r\n    /**\r\n     * CSS classes added to the reset icon.\r\n     */\r\n    resetIcon: string | string[];\r\n    /**\r\n     * CSS classes added to the loading indicator element.\r\n     */\r\n    loadingIndicator: string | string[];\r\n    /**\r\n     * CSS classes added to the loading indicator icon.\r\n     */\r\n    loadingIcon: string | string[];\r\n}>;\r\n\r\n/**\r\n * @typedef {Object} CustomSearchBoxWidgetParams@typedef {Object} CustomSearchBoxWidgetParams\r\n * @property {function(string, function(string))} [queryHook = undefined] A function that will be called every time\r\n * a new value for the query is set. The first parameter is the query and the second is a\r\n * function to actually trigger the search. The function takes the query as the parameter.\r\n *\r\n * This queryHook can be used to debounce the number of searches done from the searchBox.\r\n */\r\ndeclare type SearchBoxRenderState = {\r\n    /**\r\n     * The query from the last search.\r\n     */\r\n    query: string;\r\n    /**\r\n     * Sets a new query and searches.\r\n     */\r\n    refine: (value: string) => void;\r\n    /**\r\n     * Remove the query and perform search.\r\n     */\r\n    clear: () => void;\r\n    /**\r\n     * `true` if the search results takes more than a certain time to come back\r\n     * from Algolia servers. This can be configured on the InstantSearch constructor with the attribute\r\n     * `stalledSearchDelay` which is 200ms, by default.\r\n     * @deprecated use `instantSearchInstance.status` instead\r\n     */\r\n    isSearchStalled: boolean;\r\n};\r\n\r\ndeclare type SearchBoxTemplates = Partial<{\r\n    /**\r\n     * Template used for displaying the submit button. Can accept a function or a Hogan string.\r\n     */\r\n    submit: Template<{\r\n        cssClasses: SearchBoxComponentCSSClasses;\r\n    }>;\r\n    /**\r\n     * Template used for displaying the reset button. Can accept a function or a Hogan string.\r\n     */\r\n    reset: Template<{\r\n        cssClasses: SearchBoxComponentCSSClasses;\r\n    }>;\r\n    /**\r\n     * Template used for displaying the loading indicator. Can accept a function or a Hogan string.\r\n     */\r\n    loadingIndicator: Template<{\r\n        cssClasses: SearchBoxComponentCSSClasses;\r\n    }>;\r\n}>;\r\n\r\n/**\r\n * The searchbox widget is used to let the user set a text based query.\r\n *\r\n * This is usually the  main entry point to start the search in an instantsearch context. For that\r\n * reason is usually placed on top, and not hidden so that the user can start searching right\r\n * away.\r\n *\r\n */\r\ndeclare type SearchBoxWidget = WidgetFactory<SearchBoxWidgetDescription & {\r\n    $$widgetType: 'ais.searchBox';\r\n}, SearchBoxConnectorParams, SearchBoxWidgetParams>;\r\n\r\ndeclare type SearchBoxWidgetDescription = {\r\n    $$type: 'ais.searchBox';\r\n    renderState: SearchBoxRenderState;\r\n    indexRenderState: {\r\n        searchBox: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        query: string;\r\n    };\r\n};\r\n\r\ndeclare type SearchBoxWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * The placeholder of the input\r\n     */\r\n    placeholder?: string;\r\n    /**\r\n     * Whether the input should be autofocused\r\n     */\r\n    autofocus?: boolean;\r\n    /**\r\n     * If set, trigger the search\r\n     * once `<Enter>` is pressed only.\r\n     */\r\n    searchAsYouType?: boolean;\r\n    /**\r\n     * Whether to update the search state in the middle of a\r\n     * composition session.\r\n     * @default false\r\n     */\r\n    ignoreCompositionEvents?: boolean;\r\n    /**\r\n     * Whether to show the reset button\r\n     */\r\n    showReset?: boolean;\r\n    /**\r\n     * Whether to show the submit button\r\n     */\r\n    showSubmit?: boolean;\r\n    /**\r\n     * Whether to show the loading indicator (replaces the submit if\r\n     * the search is stalled)\r\n     */\r\n    showLoadingIndicator?: boolean;\r\n    /**\r\n     * CSS classes to add\r\n     */\r\n    cssClasses?: SearchBoxCSSClasses;\r\n    /**\r\n     * Templates used for customizing the rendering of the searchbox\r\n     */\r\n    templates?: SearchBoxTemplates;\r\n    /**\r\n     * A function that is called every time a new search is done. You\r\n     * will get the query as the first parameter and a search (query) function to call as the second parameter.\r\n     * This `queryHook` can be used to debounce the number of searches done from the search box.\r\n     */\r\n    queryHook?: (query: string, hook: (value: string) => void) => void;\r\n};\r\n\r\ndeclare type SearchWidget<TWidgetDescription extends WidgetDescription> = {\r\n    dependsOn?: 'search';\r\n    getWidgetParameters?: (state: SearchParameters, widgetParametersOptions: {\r\n        uiState: Expand<Partial<TWidgetDescription['indexUiState'] & IndexUiState>>;\r\n    }) => SearchParameters;\r\n};\r\n\r\ndeclare type SendEvent = (...args: [InsightsEvent] | [string, string, string?]) => void;\r\n\r\ndeclare type SendEventForFacet = BuiltInSendEventForFacet & CustomSendEventForFacet;\r\n\r\ndeclare type SendEventForHits = BuiltInSendEventForHits & CustomSendEventForHits;\r\n\r\ndeclare type SendEventForToggle = BuiltInSendEventForToggle & CustomSendEventForToggle;\r\n\r\ndeclare type SharedRenderOptions = {\r\n    instantSearchInstance: InstantSearch;\r\n    parent: IndexWidget;\r\n    templatesConfig: Record<string, unknown>;\r\n    scopedResults: ScopedResult[];\r\n    state: SearchParameters;\r\n    renderState: IndexRenderState;\r\n    helper: AlgoliaSearchHelper;\r\n    /** @deprecated use `status` instead */\r\n    searchMetadata: {\r\n        /** @deprecated use `status === \"stalled\"` instead */\r\n        isSearchStalled: boolean;\r\n    };\r\n    status: InstantSearch['status'];\r\n    error: InstantSearch['error'];\r\n    createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n};\r\n\r\ndeclare type ShouldRenderOptions = {\r\n    instantSearchInstance: InstantSearch;\r\n};\r\n\r\ndeclare function simpleStateMapping<TUiState extends UiState = UiState>(): StateMapping<TUiState, TUiState>;\r\n\r\ndeclare function singleIndexStateMapping<TUiState extends UiState = UiState>(indexName: keyof TUiState): StateMapping<TUiState, TUiState[typeof indexName]>;\r\n\r\ndeclare function Snippet<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: SnippetProps<THit>): h.JSX.Element;\r\n\r\n/**\r\n * @deprecated use html tagged templates and the Snippet component instead\r\n */\r\ndeclare function snippet({ attribute, highlightedTagName, hit, cssClasses, }: SnippetOptions): string;\r\n\r\ndeclare type SnippetClassNames = HighlightClassNames_2;\r\n\r\ndeclare type SnippetOptions = {\r\n    attribute: string | string[];\r\n    highlightedTagName?: string;\r\n    hit: Partial<Hit>;\r\n    cssClasses?: {\r\n        highlighted?: string;\r\n    };\r\n};\r\n\r\ndeclare type SnippetProps<THit extends Hit<BaseHit>> = {\r\n    hit: THit;\r\n    attribute: keyof THit | string[];\r\n    cssClasses?: SnippetProps_2['classNames'];\r\n} & PartialKeys<Omit<SnippetProps_2, 'parts' | 'classNames'>, 'highlightedTagName' | 'nonHighlightedTagName' | 'separator'>;\r\n\r\ndeclare type SnippetProps_2 = Omit<HighlightProps_3, 'classNames'> & {\r\n    classNames?: Partial<SnippetClassNames>;\r\n};\r\n\r\n/**\r\n * Transforms the given items.\r\n */\r\ndeclare type SortBy<TItem> = ((a: TItem, b: TItem) => number) | Array<SortByDirection<'count' | 'name' | 'isRefined'>>;\r\n\r\n/**\r\n * Sort by selector is a widget used for letting the user choose between different\r\n * indices that contains the same data with a different order / ranking formula.\r\n */\r\ndeclare const sortBy: SortByWidget;\r\n\r\ndeclare type SortByConnector = Connector<SortByWidgetDescription, SortByConnectorParams>;\r\n\r\ndeclare type SortByConnectorParams = {\r\n    /**\r\n     * Array of objects defining the different indices to choose from.\r\n     */\r\n    items: SortByItem[];\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<SortByItem>;\r\n};\r\n\r\ndeclare type SortByDirection<TCriterion extends string> = TCriterion | `${TCriterion}:asc` | `${TCriterion}:desc`;\r\n\r\ndeclare type SortByIndexDefinition = {\r\n    /**\r\n     * The name of the index to target.\r\n     */\r\n    value: string;\r\n    /**\r\n     * The label of the index to display.\r\n     */\r\n    label: string;\r\n};\r\n\r\n/**\r\n * The **SortBy** connector provides the logic to build a custom widget that will display a\r\n * list of indices. With Algolia, this is most commonly used for changing ranking strategy. This allows\r\n * a user to change how the hits are being sorted.\r\n */\r\ndeclare type SortByItem = {\r\n    /**\r\n     * The name of the index to target.\r\n     */\r\n    value: string;\r\n    /**\r\n     * The label of the index to display.\r\n     */\r\n    label: string;\r\n};\r\n\r\ndeclare type SortByRenderState = {\r\n    /**\r\n     * The initially selected index.\r\n     */\r\n    initialIndex?: string;\r\n    /**\r\n     * The currently selected index.\r\n     */\r\n    currentRefinement: string;\r\n    /**\r\n     * All the available indices\r\n     */\r\n    options: SortByItem[];\r\n    /**\r\n     * Switches indices and triggers a new search.\r\n     */\r\n    refine: (value: string) => void;\r\n    /**\r\n     * `true` if the last search contains no result.\r\n     * @deprecated Use `canRefine` instead.\r\n     */\r\n    hasNoResults: boolean;\r\n    /**\r\n     * `true` if we can refine.\r\n     */\r\n    canRefine: boolean;\r\n};\r\n\r\ndeclare type SortByWidget = WidgetFactory<SortByWidgetDescription & {\r\n    $$widgetType: 'ais.sortBy';\r\n}, SortByConnectorParams, SortByWidgetParams>;\r\n\r\ndeclare type SortByWidgetCssClasses = Partial<{\r\n    /**\r\n     * CSS classes added to the outer `<div>`.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS classes added to the parent `<select>`.\r\n     */\r\n    select: string | string[];\r\n    /**\r\n     * CSS classes added to each `<option>`.\r\n     */\r\n    option: string | string[];\r\n}>;\r\n\r\ndeclare type SortByWidgetDescription = {\r\n    $$type: 'ais.sortBy';\r\n    renderState: SortByRenderState;\r\n    indexRenderState: {\r\n        sortBy: WidgetRenderState<SortByRenderState, SortByConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        sortBy: string;\r\n    };\r\n};\r\n\r\ndeclare type SortByWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Array of objects defining the different indices to choose from.\r\n     */\r\n    items: SortByIndexDefinition[];\r\n    /**\r\n     * CSS classes to be added.\r\n     */\r\n    cssClasses?: SortByWidgetCssClasses;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<SortByItem>;\r\n};\r\n\r\ndeclare type StarRatingItems = {\r\n    /**\r\n     * Name corresponding to the number of stars.\r\n     */\r\n    name: string;\r\n    /**\r\n     * Human-readable name corresponding to the number of stars.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Number of stars as string.\r\n     */\r\n    value: string;\r\n    /**\r\n     * Count of matched results corresponding to the number of stars.\r\n     */\r\n    count: number;\r\n    /**\r\n     *  Array of length of maximum rating value with stars to display or not.\r\n     */\r\n    stars: boolean[];\r\n    /**\r\n     * Indicates if star rating refinement is applied.\r\n     */\r\n    isRefined: boolean;\r\n};\r\n\r\n/**\r\n * The state mapping is a way to customize the structure before sending it to the router.\r\n * It can transform and filter out the properties. To work correctly, the following\r\n * should be valid for any UiState:\r\n * `UiState = routeToState(stateToRoute(UiState))`.\r\n */\r\ndeclare type StateMapping<TUiState = UiState, TRouteState = TUiState> = {\r\n    /**\r\n     * Transforms a UI state representation into a route object.\r\n     * It receives an object that contains the UI state of all the widgets in the page.\r\n     * It should return an object of any form as long as this form can be read by\r\n     * the `routeToState` function.\r\n     */\r\n    stateToRoute: (uiState: TUiState) => TRouteState;\r\n    /**\r\n     * Transforms route object into a UI state representation.\r\n     * It receives an object that contains the UI state stored by the router.\r\n     * The format is the output of `stateToRoute`.\r\n     */\r\n    routeToState: (routeState: TRouteState) => TUiState;\r\n    /**\r\n     * Identifier for this stateMapping. Used to differentiate between stateMappings.\r\n     */\r\n    $$type?: string;\r\n};\r\n\r\ndeclare namespace stateMappings {\r\n    export {\r\n        simpleStateMapping as simple,\r\n        singleIndexStateMapping as singleIndex\r\n    }\r\n}\r\n\r\ndeclare type StaticOptions = Places.StaticOptions;\r\n\r\n/**\r\n * The `stats` widget is used to display useful insights about the current results.\r\n *\r\n * By default, it will display the **number of hits** and the time taken to compute the\r\n * results inside the engine.\r\n */\r\ndeclare const stats: StatsWidget;\r\n\r\ndeclare type StatsConnector = Connector<StatsWidgetDescription, StatsConnectorParams>;\r\n\r\ndeclare type StatsConnectorParams = Record<string, unknown>;\r\n\r\ndeclare type StatsCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the text span element.\r\n     */\r\n    text: string | string[];\r\n}>;\r\n\r\n/**\r\n * **Stats** connector provides the logic to build a custom widget that will displays\r\n * search statistics (hits number and processing time).\r\n */\r\ndeclare type StatsRenderState = {\r\n    /**\r\n     * The maximum number of hits per page returned by Algolia.\r\n     */\r\n    hitsPerPage?: number;\r\n    /**\r\n     * The number of hits in the result set.\r\n     */\r\n    nbHits: number;\r\n    /**\r\n     * The number of sorted hits in the result set (when using Relevant sort).\r\n     */\r\n    nbSortedHits?: number;\r\n    /**\r\n     * Indicates whether the index is currently using Relevant sort and is displaying only sorted hits.\r\n     */\r\n    areHitsSorted: boolean;\r\n    /**\r\n     * The number of pages computed for the result set.\r\n     */\r\n    nbPages: number;\r\n    /**\r\n     * The current page.\r\n     */\r\n    page: number;\r\n    /**\r\n     * The time taken to compute the results inside the Algolia engine.\r\n     */\r\n    processingTimeMS: number;\r\n    /**\r\n     * The query used for the current search.\r\n     */\r\n    query: string;\r\n};\r\n\r\ndeclare type StatsTemplates = Partial<{\r\n    /**\r\n     * Text template, provided with `hasManyResults`, `hasNoResults`, `hasOneResult`, `hasNoSortedResults`, `hasOneSortedResults`, `hasManySortedResults`, `hitsPerPage`, `nbHits`, `nbSortedHits`, `nbPages`, `areHitsSorted`, `page`, `processingTimeMS`, `query`.\r\n     */\r\n    text: Template<TextTemplateProps & StatsRenderState>;\r\n}>;\r\n\r\ndeclare type StatsWidget = WidgetFactory<StatsWidgetDescription & {\r\n    $$widgetType: 'ais.stats';\r\n}, StatsConnectorParams, StatsWidgetParams>;\r\n\r\ndeclare type StatsWidgetDescription = {\r\n    $$type: 'ais.stats';\r\n    renderState: StatsRenderState;\r\n    indexRenderState: {\r\n        stats: WidgetRenderState<StatsRenderState, StatsConnectorParams>;\r\n    };\r\n};\r\n\r\ndeclare type StatsWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: StatsTemplates;\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: StatsCSSClasses;\r\n};\r\n\r\ndeclare type Status = 'initial' | 'askingPermission' | 'waiting' | 'recognizing' | 'finished' | 'error';\r\n\r\ndeclare type Template<TTemplateData = void> = string | ((data: TTemplateData, params: TemplateParams) => VNode | VNode[] | string | null);\r\n\r\ndeclare type Template_2 = (params: {\r\n    html: typeof html;\r\n}) => VNode_2 | VNode_2[] | null;\r\n\r\ndeclare type TemplateParams = {\r\n    html: typeof html;\r\n    components: {\r\n        Highlight: typeof Highlight_2;\r\n        ReverseHighlight: typeof ReverseHighlight;\r\n        Snippet: typeof Snippet;\r\n        ReverseSnippet: typeof ReverseSnippet;\r\n    };\r\n    sendEvent?: SendEventForHits;\r\n};\r\n\r\ndeclare type Templates = {\r\n    [key: string]: Template<any> | TemplateWithBindEvent<any> | undefined;\r\n};\r\n\r\ndeclare namespace templates {\r\n    export {\r\n        carousel\r\n    }\r\n}\r\n\r\ndeclare type TemplatesConfig = {\r\n    helpers?: HoganHelpers;\r\n    compileOptions?: HoganOptions;\r\n};\r\n\r\ndeclare type TemplateWithBindEvent<TTemplateData = void> = string | ((data: TTemplateData, params: TemplateWithBindEventParams) => VNode | VNode[] | string);\r\n\r\ndeclare interface TemplateWithBindEventParams extends TemplateParams {\r\n    /** @deprecated use sendEvent instead */\r\n    (...args: Parameters<BuiltInBindEventForHits>): ReturnType<BuiltInBindEventForHits>;\r\n    /** @deprecated use sendEvent instead */\r\n    (...args: Parameters<CustomBindEventForHits>): ReturnType<CustomBindEventForHits>;\r\n    sendEvent: SendEventForHits;\r\n}\r\n\r\ndeclare type TextTemplateProps = {\r\n    hasManyResults: boolean;\r\n    hasNoResults: boolean;\r\n    hasOneResult: boolean;\r\n    hasNoSortedResults: boolean;\r\n    hasOneSortedResults: boolean;\r\n    hasManySortedResults: boolean;\r\n};\r\n\r\n/**\r\n * The toggleRefinement widget lets the user either:\r\n *  - switch between two values for a single facetted attribute (free_shipping / not_free_shipping)\r\n *  - toggleRefinement a faceted value on and off (only 'canon' for brands)\r\n *\r\n * This widget is particularly useful if you have a boolean value in the records.\r\n *\r\n * @requirements\r\n * The attribute passed to `attribute` must be declared as an\r\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\r\n * in your Algolia settings.\r\n */\r\ndeclare const toggleRefinement: ToggleRefinementWidget;\r\n\r\ndeclare type ToggleRefinementConnector = Connector<ToggleRefinementWidgetDescription, ToggleRefinementConnectorParams>;\r\n\r\ndeclare type ToggleRefinementConnectorParams = {\r\n    /**\r\n     * Name of the attribute for faceting (e.g., \"free_shipping\").\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * Value to filter on when toggled.\r\n     * @default \"true\"\r\n     */\r\n    on?: FacetValue | FacetValue[];\r\n    /**\r\n     * Value to filter on when not toggled.\r\n     */\r\n    off?: FacetValue | FacetValue[];\r\n};\r\n\r\ndeclare type ToggleRefinementCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the label wrapping element.\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to the checkbox.\r\n     */\r\n    checkbox: string | string[];\r\n    /**\r\n     * CSS class to add to the label text.\r\n     */\r\n    labelText: string | string[];\r\n}>;\r\n\r\ndeclare type ToggleRefinementRenderState = {\r\n    /** The current toggle value */\r\n    value: {\r\n        /**\r\n         * The attribute name of this toggle.\r\n         */\r\n        name: string;\r\n        /**\r\n         * Whether the current option is \"on\" (true) or \"off\" (false)\r\n         */\r\n        isRefined: boolean;\r\n        /**\r\n         * Number of results if this option is toggled.\r\n         */\r\n        count: number | null;\r\n        /**\r\n         * Information about the \"on\" toggle.\r\n         */\r\n        onFacetValue: ToggleRefinementValue;\r\n        /**\r\n         * Information about the \"off\" toggle.\r\n         */\r\n        offFacetValue: ToggleRefinementValue;\r\n    };\r\n    /**\r\n     * Creates an URL for the next state.\r\n     */\r\n    createURL: CreateURL<void>;\r\n    /**\r\n     * Send a \"Facet Clicked\" Insights event.\r\n     */\r\n    sendEvent: SendEventForToggle;\r\n    /**\r\n     * Indicates if search state can be refined.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Updates to the next state by applying the toggle refinement.\r\n     */\r\n    refine: (value?: {\r\n        isRefined: boolean;\r\n    }) => void;\r\n};\r\n\r\ndeclare type ToggleRefinementTemplates = Partial<{\r\n    /**\r\n     * the text that describes the toggle action\r\n     */\r\n    labelText: Template<ToggleRefinementRenderState['value']>;\r\n}>;\r\n\r\ndeclare type ToggleRefinementValue = {\r\n    /**\r\n     * Whether this option is enabled.\r\n     */\r\n    isRefined: boolean;\r\n    /**\r\n     * Number of result if this option is toggled.\r\n     */\r\n    count: number | null;\r\n};\r\n\r\ndeclare type ToggleRefinementWidget = WidgetFactory<ToggleRefinementWidgetDescription & {\r\n    $$widgetType: 'ais.toggleRefinement';\r\n}, ToggleRefinementConnectorParams, ToggleRefinementWidgetParams>;\r\n\r\ndeclare type ToggleRefinementWidgetDescription = {\r\n    $$type: 'ais.toggleRefinement';\r\n    renderState: ToggleRefinementRenderState;\r\n    indexRenderState: {\r\n        toggleRefinement: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        toggle: {\r\n            [attribute: string]: boolean;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type ToggleRefinementWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: ToggleRefinementTemplates;\r\n    /**\r\n     * CSS classes to be added.\r\n     */\r\n    cssClasses?: ToggleRefinementCSSClasses;\r\n};\r\n\r\ndeclare type TrackedFilterRefinement = string | number | boolean;\r\n\r\n/**\r\n * Transforms the given items.\r\n */\r\ndeclare type TransformItems<TItem, TMetadata = TransformItemsMetadata> = (items: TItem[], metadata: TMetadata) => TItem[];\r\n\r\ndeclare type TransformItemsMetadata = {\r\n    results: SearchResults | undefined | null;\r\n};\r\n\r\ndeclare type TransformSearchParameters = (searchParameters: SearchParameters) => PlainSearchParameters;\r\n\r\ndeclare type TrendingItemsConnectorParams<THit extends NonNullable<object> = BaseHit> = ({\r\n    /**\r\n     * The facet attribute to get recommendations for.\r\n     */\r\n    facetName: string;\r\n    /**\r\n     * The facet value to get recommendations for.\r\n     */\r\n    facetValue: string;\r\n} | {\r\n    facetName?: string;\r\n    facetValue?: string;\r\n}) & {\r\n    /**\r\n     * The number of recommendations to retrieve.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * The threshold for the recommendations confidence score (between 0 and 100).\r\n     */\r\n    threshold?: number;\r\n    /**\r\n     * List of search parameters to send.\r\n     */\r\n    fallbackParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * List of search parameters to send.\r\n     */\r\n    queryParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * Whether to escape HTML tags from items string values.\r\n     *\r\n     * @default true\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<Hit<THit>, {\r\n        results: RecommendResponse<AlgoliaHit<THit>>;\r\n    }>;\r\n};\r\n\r\ndeclare type TrendingItemsCSSClasses = Partial<RecommendClassNames>;\r\n\r\ndeclare type TrendingItemsRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The matched recommendations from the Algolia API.\r\n     */\r\n    items: Array<Hit<THit>>;\r\n    /**\r\n     * Sends an event to the Insights middleware.\r\n     */\r\n    sendEvent: SendEventForHits;\r\n};\r\n\r\ndeclare type TrendingItemsTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\r\n    /**\r\n     * Template to use when there are no results.\r\n     */\r\n    empty: Template<RecommendResponse<Hit<THit>>>;\r\n    /**\r\n     * Template to use for the header of the widget.\r\n     */\r\n    header: Template<Pick<Parameters<NonNullable<TrendingItemsProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {\r\n        cssClasses: RecommendClassNames;\r\n    }>;\r\n    /**\r\n     * Template to use for each result. This template will receive an object containing a single record.\r\n     */\r\n    item: TemplateWithBindEvent<Hit<THit>>;\r\n    /**\r\n     * Template to use to wrap all items.\r\n     */\r\n    layout: Template<Pick<Parameters<NonNullable<TrendingItemsProps<Hit<THit>>['layout']>>[0], 'items'> & {\r\n        templates: {\r\n            item: TrendingItemsProps<Hit<THit>>['itemComponent'];\r\n        };\r\n        cssClasses: Pick<TrendingItemsCSSClasses, 'list' | 'item'>;\r\n    }>;\r\n}>;\r\n\r\ndeclare type TrendingItemsWidgetParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * CSS selector or `HTMLElement` to insert the widget into.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to customize the widget.\r\n     */\r\n    templates?: TrendingItemsTemplates<THit>;\r\n    /**\r\n     * CSS classes to add to the widget elements.\r\n     */\r\n    cssClasses?: TrendingItemsCSSClasses;\r\n};\r\n\r\ndeclare type UiState = {\r\n    [indexId: string]: IndexUiState;\r\n};\r\n\r\ndeclare type UiStateLifeCycle<TWidgetDescription extends WidgetDescription> = TWidgetDescription extends RequiredKeys<WidgetDescription, 'indexUiState'> ? RequiredUiStateLifeCycle<TWidgetDescription> : Partial<RequiredUiStateLifeCycle<TWidgetDescription>>;\r\n\r\ndeclare type UnknownWidgetParams = NonNullable<object>;\r\n\r\n/**\r\n * The called function when unmounting a widget.\r\n */\r\ndeclare type Unmounter = () => void;\r\n\r\ndeclare type VoiceListeningState = {\r\n    status: Status;\r\n    transcript: string;\r\n    isSpeechFinal: boolean;\r\n    errorCode?: string;\r\n};\r\n\r\ndeclare const voiceSearch: VoiceSearchWidget;\r\n\r\ndeclare type VoiceSearchConnector = Connector<VoiceSearchWidgetDescription, VoiceSearchConnectorParams>;\r\n\r\ndeclare type VoiceSearchConnectorParams = {\r\n    searchAsYouSpeak?: boolean;\r\n    language?: string;\r\n    additionalQueryParameters?: (params: {\r\n        query: string;\r\n    }) => PlainSearchParameters | void;\r\n    createVoiceSearchHelper?: CreateVoiceSearchHelper;\r\n};\r\n\r\ndeclare type VoiceSearchCSSClasses = Partial<{\r\n    root: string | string[];\r\n    button: string | string[];\r\n    status: string | string[];\r\n}>;\r\n\r\ndeclare type VoiceSearchHelper = {\r\n    getState: () => VoiceListeningState;\r\n    isBrowserSupported: () => boolean;\r\n    isListening: () => boolean;\r\n    startListening: () => void;\r\n    stopListening: () => void;\r\n    dispose: () => void;\r\n};\r\n\r\ndeclare type VoiceSearchHelperParams = {\r\n    searchAsYouSpeak: boolean;\r\n    language?: string;\r\n    onQueryChange: (query: string) => void;\r\n    onStateChange: () => void;\r\n};\r\n\r\ndeclare type VoiceSearchRenderState = {\r\n    isBrowserSupported: boolean;\r\n    isListening: boolean;\r\n    toggleListening: () => void;\r\n    voiceListeningState: VoiceListeningState;\r\n};\r\n\r\ndeclare type VoiceSearchTemplateProps = {\r\n    status: string;\r\n    errorCode: string;\r\n    isListening: boolean;\r\n    transcript: string;\r\n    isSpeechFinal: boolean;\r\n    isBrowserSupported: boolean;\r\n};\r\n\r\ndeclare type VoiceSearchTemplates = Partial<{\r\n    buttonText: Template<VoiceSearchTemplateProps>;\r\n    status: Template<VoiceSearchTemplateProps>;\r\n}>;\r\n\r\ndeclare type VoiceSearchWidget = WidgetFactory<VoiceSearchWidgetDescription & {\r\n    $$type: 'ais.voiceSearch';\r\n}, VoiceSearchConnectorParams, VoiceSearchWidgetParams>;\r\n\r\ndeclare type VoiceSearchWidgetDescription = {\r\n    $$type: 'ais.voiceSearch';\r\n    renderState: VoiceSearchRenderState;\r\n    indexRenderState: {\r\n        voiceSearch: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        query: string;\r\n    };\r\n};\r\n\r\ndeclare type VoiceSearchWidgetParams = {\r\n    container: string | HTMLElement;\r\n    cssClasses?: VoiceSearchCSSClasses;\r\n    templates?: VoiceSearchTemplates;\r\n    searchAsYouSpeak?: boolean;\r\n    language?: string;\r\n    additionalQueryParameters?: (params: {\r\n        query: string;\r\n    }) => PlainSearchParameters | void;\r\n    createVoiceSearchHelper?: CreateVoiceSearchHelper;\r\n};\r\n\r\ndeclare type Widget<TWidgetDescription extends WidgetDescription & WidgetParams = {\r\n    $$type: string;\r\n}> = Expand<RequiredWidgetLifeCycle<TWidgetDescription> & WidgetType<TWidgetDescription> & UiStateLifeCycle<TWidgetDescription> & RenderStateLifeCycle<TWidgetDescription>> & (SearchWidget<TWidgetDescription> | RecommendWidget<TWidgetDescription>);\r\n\r\ndeclare type WidgetDescription = {\r\n    $$type: string;\r\n    $$widgetType?: string;\r\n    renderState?: Record<string, unknown>;\r\n    indexRenderState?: Record<string, unknown>;\r\n    indexUiState?: Record<string, unknown>;\r\n};\r\n\r\n/**\r\n * The function that creates a new widget.\r\n */\r\ndeclare type WidgetFactory<TWidgetDescription extends WidgetDescription, TConnectorParams extends UnknownWidgetParams, TWidgetParams extends UnknownWidgetParams> = (\r\n/**\r\n * The params of the widget.\r\n */\r\nwidgetParams: TWidgetParams & TConnectorParams) => Widget<TWidgetDescription & {\r\n    widgetParams: TConnectorParams;\r\n}>;\r\n\r\ndeclare type WidgetParams = {\r\n    widgetParams?: UnknownWidgetParams;\r\n};\r\n\r\ndeclare type WidgetRenderState<TWidgetRenderState, TWidgetParams> = TWidgetRenderState & {\r\n    widgetParams: TWidgetParams;\r\n};\r\n\r\ndeclare type WidgetRenderStates = AnalyticsWidgetDescription['indexRenderState'] & PlacesWidgetDescription['indexRenderState'];\r\n\r\ndeclare namespace widgets {\r\n    export {\r\n        EXPERIMENTAL_answers,\r\n        EXPERIMENTAL_configureRelatedItems,\r\n        EXPERIMENTAL_dynamicWidgets,\r\n        dynamicWidgets,\r\n        analytics,\r\n        breadcrumb,\r\n        clearRefinements,\r\n        configure,\r\n        currentRefinements,\r\n        _default_8 as geoSearch,\r\n        hierarchicalMenu,\r\n        _default_9 as hits,\r\n        hitsPerPage,\r\n        index,\r\n        IndexWidget,\r\n        _default_10 as infiniteHits,\r\n        menu,\r\n        menuSelect,\r\n        numericMenu,\r\n        pagination,\r\n        panel,\r\n        _default_11 as places,\r\n        poweredBy,\r\n        queryRuleContext,\r\n        queryRuleCustomData,\r\n        _default_12 as relatedProducts,\r\n        rangeInput,\r\n        rangeSlider,\r\n        ratingMenu,\r\n        refinementList,\r\n        relevantSort,\r\n        searchBox,\r\n        sortBy,\r\n        stats,\r\n        toggleRefinement,\r\n        _default_13 as trendingItems,\r\n        voiceSearch,\r\n        _default_14 as frequentlyBoughtTogether,\r\n        _default_15 as lookingSimilar\r\n    }\r\n}\r\n\r\ndeclare type WidgetType<TWidgetDescription extends WidgetDescription> = TWidgetDescription extends RequiredKeys<WidgetDescription, '$$widgetType'> ? RequiredWidgetType<TWidgetDescription> : {\r\n    /**\r\n     * Identifier for widgets.\r\n     */\r\n    $$widgetType?: string;\r\n};\r\n\r\ndeclare type WidgetUiStates = PlacesWidgetDescription['indexUiState'];\r\n\r\ndeclare type Write<THit extends NonNullable<object>> = ({ state, hits, }: {\r\n    state: PlainSearchParameters;\r\n    hits: InfiniteHitsCachedHits<THit>;\r\n}) => void;\r\n\r\nexport { }\r\n"
  },
  {
    "path": "js/instantsearch.js/dist/instantsearch.development.js",
    "content": "/*! InstantSearch.js 4.78.3 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch */\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define(factory) :\n  (global = global || self, global.instantsearch = factory());\n}(this, (function () { 'use strict';\n\n  var id = 0;\n  function addWidgetId(widget) {\n    if (widget.dependsOn !== 'recommend') {\n      return;\n    }\n    widget.$$id = id++;\n  }\n\n  function capitalize(text) {\n    return text.toString().charAt(0).toUpperCase() + text.toString().slice(1);\n  }\n\n  function _iterableToArrayLimit(r, l) {\n    var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n    if (null != t) {\n      var e,\n        n,\n        i,\n        u,\n        a = [],\n        f = !0,\n        o = !1;\n      try {\n        if (i = (t = t.call(r)).next, 0 === l) {\n          if (Object(t) !== t) return;\n          f = !1;\n        } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n      } catch (r) {\n        o = !0, n = r;\n      } finally {\n        try {\n          if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;\n        } finally {\n          if (o) throw n;\n        }\n      }\n      return a;\n    }\n  }\n  function ownKeys(e, r) {\n    var t = Object.keys(e);\n    if (Object.getOwnPropertySymbols) {\n      var o = Object.getOwnPropertySymbols(e);\n      r && (o = o.filter(function (r) {\n        return Object.getOwnPropertyDescriptor(e, r).enumerable;\n      })), t.push.apply(t, o);\n    }\n    return t;\n  }\n  function _objectSpread2(e) {\n    for (var r = 1; r < arguments.length; r++) {\n      var t = null != arguments[r] ? arguments[r] : {};\n      r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n        _defineProperty(e, r, t[r]);\n      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n        Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n      });\n    }\n    return e;\n  }\n  function _toPrimitive(t, r) {\n    if (\"object\" != typeof t || !t) return t;\n    var e = t[Symbol.toPrimitive];\n    if (void 0 !== e) {\n      var i = e.call(t, r || \"default\");\n      if (\"object\" != typeof i) return i;\n      throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n    }\n    return (\"string\" === r ? String : Number)(t);\n  }\n  function _toPropertyKey(t) {\n    var i = _toPrimitive(t, \"string\");\n    return \"symbol\" == typeof i ? i : String(i);\n  }\n  function _typeof(o) {\n    \"@babel/helpers - typeof\";\n\n    return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n      return typeof o;\n    } : function (o) {\n      return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n    }, _typeof(o);\n  }\n  function _classCallCheck(instance, Constructor) {\n    if (!(instance instanceof Constructor)) {\n      throw new TypeError(\"Cannot call a class as a function\");\n    }\n  }\n  function _defineProperties(target, props) {\n    for (var i = 0; i < props.length; i++) {\n      var descriptor = props[i];\n      descriptor.enumerable = descriptor.enumerable || false;\n      descriptor.configurable = true;\n      if (\"value\" in descriptor) descriptor.writable = true;\n      Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);\n    }\n  }\n  function _createClass(Constructor, protoProps, staticProps) {\n    if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n    if (staticProps) _defineProperties(Constructor, staticProps);\n    Object.defineProperty(Constructor, \"prototype\", {\n      writable: false\n    });\n    return Constructor;\n  }\n  function _defineProperty(obj, key, value) {\n    key = _toPropertyKey(key);\n    if (key in obj) {\n      Object.defineProperty(obj, key, {\n        value: value,\n        enumerable: true,\n        configurable: true,\n        writable: true\n      });\n    } else {\n      obj[key] = value;\n    }\n    return obj;\n  }\n  function _extends() {\n    _extends = Object.assign ? Object.assign.bind() : function (target) {\n      for (var i = 1; i < arguments.length; i++) {\n        var source = arguments[i];\n        for (var key in source) {\n          if (Object.prototype.hasOwnProperty.call(source, key)) {\n            target[key] = source[key];\n          }\n        }\n      }\n      return target;\n    };\n    return _extends.apply(this, arguments);\n  }\n  function _inherits(subClass, superClass) {\n    if (typeof superClass !== \"function\" && superClass !== null) {\n      throw new TypeError(\"Super expression must either be null or a function\");\n    }\n    subClass.prototype = Object.create(superClass && superClass.prototype, {\n      constructor: {\n        value: subClass,\n        writable: true,\n        configurable: true\n      }\n    });\n    Object.defineProperty(subClass, \"prototype\", {\n      writable: false\n    });\n    if (superClass) _setPrototypeOf(subClass, superClass);\n  }\n  function _getPrototypeOf(o) {\n    _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n      return o.__proto__ || Object.getPrototypeOf(o);\n    };\n    return _getPrototypeOf(o);\n  }\n  function _setPrototypeOf(o, p) {\n    _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n      o.__proto__ = p;\n      return o;\n    };\n    return _setPrototypeOf(o, p);\n  }\n  function _isNativeReflectConstruct() {\n    if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n    if (Reflect.construct.sham) return false;\n    if (typeof Proxy === \"function\") return true;\n    try {\n      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n      return true;\n    } catch (e) {\n      return false;\n    }\n  }\n  function _objectDestructuringEmpty(obj) {\n    if (obj == null) throw new TypeError(\"Cannot destructure \" + obj);\n  }\n  function _objectWithoutPropertiesLoose(source, excluded) {\n    if (source == null) return {};\n    var target = {};\n    var sourceKeys = Object.keys(source);\n    var key, i;\n    for (i = 0; i < sourceKeys.length; i++) {\n      key = sourceKeys[i];\n      if (excluded.indexOf(key) >= 0) continue;\n      target[key] = source[key];\n    }\n    return target;\n  }\n  function _objectWithoutProperties(source, excluded) {\n    if (source == null) return {};\n    var target = _objectWithoutPropertiesLoose(source, excluded);\n    var key, i;\n    if (Object.getOwnPropertySymbols) {\n      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n      for (i = 0; i < sourceSymbolKeys.length; i++) {\n        key = sourceSymbolKeys[i];\n        if (excluded.indexOf(key) >= 0) continue;\n        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n        target[key] = source[key];\n      }\n    }\n    return target;\n  }\n  function _assertThisInitialized(self) {\n    if (self === void 0) {\n      throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n    }\n    return self;\n  }\n  function _possibleConstructorReturn(self, call) {\n    if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n      return call;\n    } else if (call !== void 0) {\n      throw new TypeError(\"Derived constructors may only return object or undefined\");\n    }\n    return _assertThisInitialized(self);\n  }\n  function _createSuper(Derived) {\n    var hasNativeReflectConstruct = _isNativeReflectConstruct();\n    return function _createSuperInternal() {\n      var Super = _getPrototypeOf(Derived),\n        result;\n      if (hasNativeReflectConstruct) {\n        var NewTarget = _getPrototypeOf(this).constructor;\n        result = Reflect.construct(Super, arguments, NewTarget);\n      } else {\n        result = Super.apply(this, arguments);\n      }\n      return _possibleConstructorReturn(this, result);\n    };\n  }\n  function _slicedToArray(arr, i) {\n    return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n  }\n  function _toConsumableArray(arr) {\n    return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n  }\n  function _arrayWithoutHoles(arr) {\n    if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n  }\n  function _arrayWithHoles(arr) {\n    if (Array.isArray(arr)) return arr;\n  }\n  function _iterableToArray(iter) {\n    if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n  }\n  function _unsupportedIterableToArray(o, minLen) {\n    if (!o) return;\n    if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n    var n = Object.prototype.toString.call(o).slice(8, -1);\n    if (n === \"Object\" && o.constructor) n = o.constructor.name;\n    if (n === \"Map\" || n === \"Set\") return Array.from(o);\n    if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n  }\n  function _arrayLikeToArray(arr, len) {\n    if (len == null || len > arr.length) len = arr.length;\n    for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n    return arr2;\n  }\n  function _nonIterableSpread() {\n    throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n  }\n  function _nonIterableRest() {\n    throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n  }\n  function _createForOfIteratorHelper(o, allowArrayLike) {\n    var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n    if (!it) {\n      if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n        if (it) o = it;\n        var i = 0;\n        var F = function () {};\n        return {\n          s: F,\n          n: function () {\n            if (i >= o.length) return {\n              done: true\n            };\n            return {\n              done: false,\n              value: o[i++]\n            };\n          },\n          e: function (e) {\n            throw e;\n          },\n          f: F\n        };\n      }\n      throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n    }\n    var normalCompletion = true,\n      didErr = false,\n      err;\n    return {\n      s: function () {\n        it = it.call(o);\n      },\n      n: function () {\n        var step = it.next();\n        normalCompletion = step.done;\n        return step;\n      },\n      e: function (e) {\n        didErr = true;\n        err = e;\n      },\n      f: function () {\n        try {\n          if (!normalCompletion && it.return != null) it.return();\n        } finally {\n          if (didErr) throw err;\n        }\n      }\n    };\n  }\n\n  function noop() {}\n\n  /**\n   * Logs a warning when this function is called, in development environment only.\n   */\n  var deprecate = function deprecate(fn, message) {\n    return fn;\n  };\n\n  /**\n   * Logs a warning\n   * This is used to log issues in development environment only.\n   */\n  var warn = noop;\n\n  /**\n   * Logs a warning if the condition is not met.\n   * This is used to log issues in development environment only.\n   */\n  var _warning = noop;\n  {\n    warn = function warn(message) {\n      // eslint-disable-next-line no-console\n      console.warn(\"[InstantSearch.js]: \".concat(message.trim()));\n    };\n    deprecate = function deprecate(fn, message) {\n      var hasAlreadyPrinted = false;\n      return function () {\n        if (!hasAlreadyPrinted) {\n          hasAlreadyPrinted = true;\n           warn(message) ;\n        }\n        return fn.apply(void 0, arguments);\n      };\n    };\n    _warning = function warning(condition, message) {\n      if (condition) {\n        return;\n      }\n      var hasAlreadyPrinted = _warning.cache[message];\n      if (!hasAlreadyPrinted) {\n        _warning.cache[message] = true;\n         warn(message) ;\n      }\n    };\n    _warning.cache = {};\n  }\n\n  /**\n   * A typed version of Object.keys, to use when looping over a static object\n   * inspired from https://stackoverflow.com/a/65117465/3185307\n   */\n  var keys = Object.keys;\n\n  // Some connectors are responsible for multiple widgets so we need\n  // to map them.\n  function getWidgetNames(connectorName) {\n    switch (connectorName) {\n      case 'range':\n        return [];\n      case 'menu':\n        return ['menu', 'menuSelect'];\n      default:\n        return [connectorName];\n    }\n  }\n  var stateToWidgetsMap = {\n    query: {\n      connectors: ['connectSearchBox'],\n      widgets: ['ais.searchBox', 'ais.autocomplete', 'ais.voiceSearch']\n    },\n    refinementList: {\n      connectors: ['connectRefinementList'],\n      widgets: ['ais.refinementList']\n    },\n    menu: {\n      connectors: ['connectMenu'],\n      widgets: ['ais.menu']\n    },\n    hierarchicalMenu: {\n      connectors: ['connectHierarchicalMenu'],\n      widgets: ['ais.hierarchicalMenu']\n    },\n    numericMenu: {\n      connectors: ['connectNumericMenu'],\n      widgets: ['ais.numericMenu']\n    },\n    ratingMenu: {\n      connectors: ['connectRatingMenu'],\n      widgets: ['ais.ratingMenu']\n    },\n    range: {\n      connectors: ['connectRange'],\n      widgets: ['ais.rangeInput', 'ais.rangeSlider', 'ais.range']\n    },\n    toggle: {\n      connectors: ['connectToggleRefinement'],\n      widgets: ['ais.toggleRefinement']\n    },\n    geoSearch: {\n      connectors: ['connectGeoSearch'],\n      widgets: ['ais.geoSearch']\n    },\n    sortBy: {\n      connectors: ['connectSortBy'],\n      widgets: ['ais.sortBy']\n    },\n    page: {\n      connectors: ['connectPagination'],\n      widgets: ['ais.pagination', 'ais.infiniteHits']\n    },\n    hitsPerPage: {\n      connectors: ['connectHitsPerPage'],\n      widgets: ['ais.hitsPerPage']\n    },\n    configure: {\n      connectors: ['connectConfigure'],\n      widgets: ['ais.configure']\n    },\n    places: {\n      connectors: [],\n      widgets: ['ais.places']\n    }\n  };\n  function checkIndexUiState(_ref) {\n    var index = _ref.index,\n      indexUiState = _ref.indexUiState;\n    var mountedWidgets = index.getWidgets().map(function (widget) {\n      return widget.$$type;\n    }).filter(Boolean);\n    var missingWidgets = keys(indexUiState).reduce(function (acc, parameter) {\n      var widgetUiState = stateToWidgetsMap[parameter];\n      if (!widgetUiState) {\n        return acc;\n      }\n      var requiredWidgets = widgetUiState.widgets;\n      if (requiredWidgets && !requiredWidgets.some(function (requiredWidget) {\n        return mountedWidgets.includes(requiredWidget);\n      })) {\n        acc.push([parameter, {\n          connectors: widgetUiState.connectors,\n          widgets: widgetUiState.widgets.map(function (widgetIdentifier) {\n            return widgetIdentifier.split('ais.')[1];\n          })\n        }]);\n      }\n      return acc;\n    }, []);\n     _warning(missingWidgets.length === 0, \"The UI state for the index \\\"\".concat(index.getIndexId(), \"\\\" is not consistent with the widgets mounted.\\n\\nThis can happen when the UI state is specified via `initialUiState`, `routing` or `setUiState` but that the widgets responsible for this state were not added. This results in those query parameters not being sent to the API.\\n\\nTo fully reflect the state, some widgets need to be added to the index \\\"\").concat(index.getIndexId(), \"\\\":\\n\\n\").concat(missingWidgets.map(function (_ref2) {\n      var _ref4;\n      var _ref3 = _slicedToArray(_ref2, 2),\n        stateParameter = _ref3[0],\n        widgets = _ref3[1].widgets;\n      return \"- `\".concat(stateParameter, \"` needs one of these widgets: \").concat((_ref4 = []).concat.apply(_ref4, _toConsumableArray(widgets.map(function (name) {\n        return getWidgetNames(name);\n      }))).map(function (name) {\n        return \"\\\"\".concat(name, \"\\\"\");\n      }).join(', '));\n    }).join('\\n'), \"\\n\\nIf you do not wish to display widgets but still want to support their search parameters, you can mount \\\"virtual widgets\\\" that don't render anything:\\n\\n```\\n\").concat(missingWidgets.filter(function (_ref5) {\n      var _ref6 = _slicedToArray(_ref5, 2),\n        _stateParameter = _ref6[0],\n        connectors = _ref6[1].connectors;\n      return connectors.length > 0;\n    }).map(function (_ref7) {\n      var _ref8 = _slicedToArray(_ref7, 2),\n        _stateParameter = _ref8[0],\n        _ref8$ = _ref8[1],\n        connectors = _ref8$.connectors,\n        widgets = _ref8$.widgets;\n      var capitalizedWidget = capitalize(widgets[0]);\n      var connectorName = connectors[0];\n      return \"const virtual\".concat(capitalizedWidget, \" = \").concat(connectorName, \"(() => null);\");\n    }).join('\\n'), \"\\n\\nsearch.addWidgets([\\n  \").concat(missingWidgets.filter(function (_ref9) {\n      var _ref10 = _slicedToArray(_ref9, 2),\n        _stateParameter = _ref10[0],\n        connectors = _ref10[1].connectors;\n      return connectors.length > 0;\n    }).map(function (_ref11) {\n      var _ref12 = _slicedToArray(_ref11, 2),\n        _stateParameter = _ref12[0],\n        widgets = _ref12[1].widgets;\n      var capitalizedWidget = capitalize(widgets[0]);\n      return \"virtual\".concat(capitalizedWidget, \"({ /* ... */ })\");\n    }).join(',\\n  '), \"\\n]);\\n```\\n\\nIf you're using custom widgets that do set these query parameters, we recommend using connectors instead.\\n\\nSee https://www.algolia.com/doc/guides/building-search-ui/widgets/customize-an-existing-widget/js/#customize-the-complete-ui-of-the-widgets\")) ;\n  }\n\n  function getObjectType(object) {\n    return Object.prototype.toString.call(object).slice(8, -1);\n  }\n\n  function checkRendering(rendering, usage) {\n    if (rendering === undefined || typeof rendering !== 'function') {\n      throw new Error(\"The render function is not valid (received type \".concat(getObjectType(rendering), \").\\n\\n\").concat(usage));\n    }\n  }\n\n  /**\n   * Clears the refinements of a SearchParameters object based on rules provided.\n   * The included attributes list is applied before the excluded attributes list. If the list\n   * is not provided, this list of all the currently refined attributes is used as included attributes.\n   * @returns search parameters with refinements cleared\n   */\n  function clearRefinements(_ref) {\n    var helper = _ref.helper,\n      _ref$attributesToClea = _ref.attributesToClear,\n      attributesToClear = _ref$attributesToClea === void 0 ? [] : _ref$attributesToClea;\n    var finalState = helper.state.setPage(0);\n    finalState = attributesToClear.reduce(function (state, attribute) {\n      if (finalState.isNumericRefined(attribute)) {\n        return state.removeNumericRefinement(attribute);\n      }\n      if (finalState.isHierarchicalFacet(attribute)) {\n        return state.removeHierarchicalFacetRefinement(attribute);\n      }\n      if (finalState.isDisjunctiveFacet(attribute)) {\n        return state.removeDisjunctiveFacetRefinement(attribute);\n      }\n      if (finalState.isConjunctiveFacet(attribute)) {\n        return state.removeFacetRefinement(attribute);\n      }\n      return state;\n    }, finalState);\n    if (attributesToClear.indexOf('query') !== -1) {\n      finalState = finalState.setQuery('');\n    }\n    return finalState;\n  }\n\n  /**\n   * This implementation is taken from Lodash implementation.\n   * See: https://github.com/lodash/lodash/blob/4.17.11-npm/escape.js\n   */\n\n  // Used to map characters to HTML entities.\n  var htmlEntities = {\n    '&': '&amp;',\n    '<': '&lt;',\n    '>': '&gt;',\n    '\"': '&quot;',\n    \"'\": '&#39;'\n  };\n\n  // Used to match HTML entities and HTML characters.\n  var regexUnescapedHtml = /[&<>\"']/g;\n  var regexHasUnescapedHtml = RegExp(regexUnescapedHtml.source);\n\n  /**\n   * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n   * corresponding HTML entities.\n   */\n  function escape$1(value) {\n    return value && regexHasUnescapedHtml.test(value) ? value.replace(regexUnescapedHtml, function (character) {\n      return htmlEntities[character];\n    }) : value;\n  }\n\n  /**\n   * This implementation is taken from Lodash implementation.\n   * See: https://github.com/lodash/lodash/blob/4.17.11-npm/unescape.js\n   */\n\n  // Used to map HTML entities to characters.\n  var htmlCharacters = {\n    '&amp;': '&',\n    '&lt;': '<',\n    '&gt;': '>',\n    '&quot;': '\"',\n    '&#39;': \"'\"\n  };\n\n  // Used to match HTML entities and HTML characters.\n  var regexEscapedHtml = /&(amp|quot|lt|gt|#39);/g;\n  var regexHasEscapedHtml = RegExp(regexEscapedHtml.source);\n\n  /**\n   * Converts the HTML entities \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n   * characters.\n   */\n  function unescape$1(value) {\n    return value && regexHasEscapedHtml.test(value) ? value.replace(regexEscapedHtml, function (character) {\n      return htmlCharacters[character];\n    }) : value;\n  }\n\n  /**\n   * This implementation is taken from Lodash implementation.\n   * See: https://github.com/lodash/lodash/blob/master/isPlainObject.js\n   */\n\n  function getTag(value) {\n    if (value === null) {\n      return value === undefined ? '[object Undefined]' : '[object Null]';\n    }\n    return Object.prototype.toString.call(value);\n  }\n  function isObjectLike(value) {\n    return _typeof(value) === 'object' && value !== null;\n  }\n\n  /**\n   * Checks if `value` is a plain object.\n   *\n   * A plain object is an object created by the `Object`\n   * constructor or with a `[[Prototype]]` of `null`.\n   */\n  function isPlainObject(value) {\n    if (!isObjectLike(value) || getTag(value) !== '[object Object]') {\n      return false;\n    }\n    if (Object.getPrototypeOf(value) === null) {\n      return true;\n    }\n    var proto = value;\n    while (Object.getPrototypeOf(proto) !== null) {\n      proto = Object.getPrototypeOf(proto);\n    }\n    return Object.getPrototypeOf(value) === proto;\n  }\n\n  var TAG_PLACEHOLDER = {\n    highlightPreTag: '__ais-highlight__',\n    highlightPostTag: '__/ais-highlight__'\n  };\n  var TAG_REPLACEMENT = {\n    highlightPreTag: '<mark>',\n    highlightPostTag: '</mark>'\n  };\n\n  // @MAJOR: in the future, this should only escape, not replace\n  function replaceTagsAndEscape(value) {\n    return escape$1(value).replace(new RegExp(TAG_PLACEHOLDER.highlightPreTag, 'g'), TAG_REPLACEMENT.highlightPreTag).replace(new RegExp(TAG_PLACEHOLDER.highlightPostTag, 'g'), TAG_REPLACEMENT.highlightPostTag);\n  }\n  function recursiveEscape(input) {\n    if (isPlainObject(input) && typeof input.value !== 'string') {\n      return Object.keys(input).reduce(function (acc, key) {\n        return _objectSpread2(_objectSpread2({}, acc), {}, _defineProperty({}, key, recursiveEscape(input[key])));\n      }, {});\n    }\n    if (Array.isArray(input)) {\n      return input.map(recursiveEscape);\n    }\n    return _objectSpread2(_objectSpread2({}, input), {}, {\n      value: replaceTagsAndEscape(input.value)\n    });\n  }\n  function escapeHits(hits) {\n    if (hits.__escaped === undefined) {\n      // We don't override the value on hit because it will mutate the raw results\n      // instead we make a shallow copy and we assign the escaped values on it.\n      hits = hits.map(function (_ref) {\n        var hit = _extends({}, (_objectDestructuringEmpty(_ref), _ref));\n        if (hit._highlightResult) {\n          hit._highlightResult = recursiveEscape(hit._highlightResult);\n        }\n        if (hit._snippetResult) {\n          hit._snippetResult = recursiveEscape(hit._snippetResult);\n        }\n        return hit;\n      });\n      hits.__escaped = true;\n    }\n    return hits;\n  }\n  function escapeFacets(facetHits) {\n    return facetHits.map(function (h) {\n      return _objectSpread2(_objectSpread2({}, h), {}, {\n        highlighted: replaceTagsAndEscape(h.highlighted)\n      });\n    });\n  }\n\n  function concatHighlightedParts(parts) {\n    var highlightPreTag = TAG_REPLACEMENT.highlightPreTag,\n      highlightPostTag = TAG_REPLACEMENT.highlightPostTag;\n    return parts.map(function (part) {\n      return part.isHighlighted ? highlightPreTag + part.value + highlightPostTag : part.value;\n    }).join('');\n  }\n\n  // copied from\n  // https://github.com/algolia/autocomplete.js/blob/307a7acc4283e10a19cb7d067f04f1bea79dc56f/packages/autocomplete-core/src/utils/createConcurrentSafePromise.ts#L1:L1\n  /**\n   * Creates a runner that executes promises in a concurrent-safe way.\n   *\n   * This is useful to prevent older promises to resolve after a newer promise,\n   * otherwise resulting in stale resolved values.\n   */\n  function createConcurrentSafePromise() {\n    var basePromiseId = -1;\n    var latestResolvedId = -1;\n    var latestResolvedValue = undefined;\n    return function runConcurrentSafePromise(promise) {\n      var currentPromiseId = ++basePromiseId;\n      return Promise.resolve(promise).then(function (x) {\n        // The promise might take too long to resolve and get outdated. This would\n        // result in resolving stale values.\n        // When this happens, we ignore the promise value and return the one\n        // coming from the latest resolved value.\n        //\n        // +----------------------------------+\n        // |        100ms                     |\n        // | run(1) +--->  R1                 |\n        // |        300ms                     |\n        // | run(2) +-------------> R2 (SKIP) |\n        // |        200ms                     |\n        // | run(3) +--------> R3             |\n        // +----------------------------------+\n        if (latestResolvedValue && currentPromiseId < latestResolvedId) {\n          return latestResolvedValue;\n        }\n        latestResolvedId = currentPromiseId;\n        latestResolvedValue = x;\n        return x;\n      });\n    };\n  }\n\n  function isFacetRefined(helper, facet, value) {\n    if (helper.state.isHierarchicalFacet(facet)) {\n      return helper.state.isHierarchicalFacetRefined(facet, value);\n    } else if (helper.state.isConjunctiveFacet(facet)) {\n      return helper.state.isFacetRefined(facet, value);\n    } else {\n      return helper.state.isDisjunctiveFacetRefined(facet, value);\n    }\n  }\n\n  function createSendEventForFacet(_ref) {\n    var instantSearchInstance = _ref.instantSearchInstance,\n      helper = _ref.helper,\n      attr = _ref.attribute,\n      widgetType = _ref.widgetType;\n    var sendEventForFacet = function sendEventForFacet() {\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n      var facetValue = args[1],\n        _args$ = args[2],\n        eventName = _args$ === void 0 ? 'Filter Applied' : _args$,\n        _args$2 = args[3],\n        additionalData = _args$2 === void 0 ? {} : _args$2;\n      var _args$0$split = args[0].split(':'),\n        _args$0$split2 = _slicedToArray(_args$0$split, 2),\n        eventType = _args$0$split2[0],\n        eventModifier = _args$0$split2[1];\n      var attribute = typeof attr === 'string' ? attr : attr(facetValue);\n      if (args.length === 1 && _typeof(args[0]) === 'object') {\n        instantSearchInstance.sendEventToInsights(args[0]);\n      } else if (eventType === 'click' && args.length >= 2 && args.length <= 4) {\n        if (!isFacetRefined(helper, attribute, facetValue)) {\n          var _helper$lastResults;\n          // send event only when the facet is being checked \"ON\"\n          instantSearchInstance.sendEventToInsights({\n            insightsMethod: 'clickedFilters',\n            widgetType: widgetType,\n            eventType: eventType,\n            eventModifier: eventModifier,\n            payload: _objectSpread2({\n              eventName: eventName,\n              index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,\n              filters: [\"\".concat(attribute, \":\").concat(facetValue)]\n            }, additionalData),\n            attribute: attribute\n          });\n        }\n      } else {\n        throw new Error(\"You need to pass between two and four arguments like:\\n  sendEvent('click', facetValue, eventName?, additionalData?);\\n\\nIf you want to send a custom payload, you can pass one object: sendEvent(customPayload);\\n\");\n      }\n    };\n    return sendEventForFacet;\n  }\n\n  function serializePayload(payload) {\n    return btoa(encodeURIComponent(JSON.stringify(payload)));\n  }\n  function deserializePayload(serialized) {\n    return JSON.parse(decodeURIComponent(atob(serialized)));\n  }\n\n  function chunk(arr) {\n    var chunkSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 20;\n    var chunks = [];\n    for (var i = 0; i < Math.ceil(arr.length / chunkSize); i++) {\n      chunks.push(arr.slice(i * chunkSize, (i + 1) * chunkSize));\n    }\n    return chunks;\n  }\n  function _buildEventPayloadsForHits(_ref) {\n    var helper = _ref.helper,\n      widgetType = _ref.widgetType,\n      methodName = _ref.methodName,\n      args = _ref.args,\n      instantSearchInstance = _ref.instantSearchInstance;\n    // when there's only one argument, that means it's custom\n    if (args.length === 1 && _typeof(args[0]) === 'object') {\n      return [args[0]];\n    }\n    var _args$0$split = args[0].split(':'),\n      _args$0$split2 = _slicedToArray(_args$0$split, 2),\n      eventType = _args$0$split2[0],\n      eventModifier = _args$0$split2[1];\n    var hits = args[1];\n    var eventName = args[2];\n    var additionalData = args[3] || {};\n    if (!hits) {\n      {\n        throw new Error(\"You need to pass hit or hits as the second argument like:\\n  \".concat(methodName, \"(eventType, hit);\\n  \"));\n      }\n    }\n    if ((eventType === 'click' || eventType === 'conversion') && !eventName) {\n      {\n        throw new Error(\"You need to pass eventName as the third argument for 'click' or 'conversion' events like:\\n  \".concat(methodName, \"('click', hit, 'Product Purchased');\\n\\n  To learn more about event naming: https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/in-depth/clicks-conversions-best-practices/\\n  \"));\n      }\n    }\n    var hitsArray = Array.isArray(hits) ? hits : [hits];\n    if (hitsArray.length === 0) {\n      return [];\n    }\n    var queryID = hitsArray[0].__queryID;\n    var hitsChunks = chunk(hitsArray);\n    var objectIDsByChunk = hitsChunks.map(function (batch) {\n      return batch.map(function (hit) {\n        return hit.objectID;\n      });\n    });\n    var positionsByChunk = hitsChunks.map(function (batch) {\n      return batch.map(function (hit) {\n        return hit.__position;\n      });\n    });\n    if (eventType === 'view') {\n      if (instantSearchInstance.status !== 'idle') {\n        return [];\n      }\n      return hitsChunks.map(function (batch, i) {\n        var _helper$lastResults;\n        return {\n          insightsMethod: 'viewedObjectIDs',\n          widgetType: widgetType,\n          eventType: eventType,\n          payload: _objectSpread2({\n            eventName: eventName || 'Hits Viewed',\n            index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,\n            objectIDs: objectIDsByChunk[i]\n          }, additionalData),\n          hits: batch,\n          eventModifier: eventModifier\n        };\n      });\n    } else if (eventType === 'click') {\n      return hitsChunks.map(function (batch, i) {\n        var _helper$lastResults2;\n        return {\n          insightsMethod: 'clickedObjectIDsAfterSearch',\n          widgetType: widgetType,\n          eventType: eventType,\n          payload: _objectSpread2({\n            eventName: eventName || 'Hit Clicked',\n            index: ((_helper$lastResults2 = helper.lastResults) === null || _helper$lastResults2 === void 0 ? void 0 : _helper$lastResults2.index) || helper.state.index,\n            queryID: queryID,\n            objectIDs: objectIDsByChunk[i],\n            positions: positionsByChunk[i]\n          }, additionalData),\n          hits: batch,\n          eventModifier: eventModifier\n        };\n      });\n    } else if (eventType === 'conversion') {\n      return hitsChunks.map(function (batch, i) {\n        var _helper$lastResults3;\n        return {\n          insightsMethod: 'convertedObjectIDsAfterSearch',\n          widgetType: widgetType,\n          eventType: eventType,\n          payload: _objectSpread2({\n            eventName: eventName || 'Hit Converted',\n            index: ((_helper$lastResults3 = helper.lastResults) === null || _helper$lastResults3 === void 0 ? void 0 : _helper$lastResults3.index) || helper.state.index,\n            queryID: queryID,\n            objectIDs: objectIDsByChunk[i]\n          }, additionalData),\n          hits: batch,\n          eventModifier: eventModifier\n        };\n      });\n    } else {\n      throw new Error(\"eventType(\\\"\".concat(eventType, \"\\\") is not supported.\\n    If you want to send a custom payload, you can pass one object: \").concat(methodName, \"(customPayload);\\n    \"));\n    }\n  }\n  function createSendEventForHits(_ref2) {\n    var instantSearchInstance = _ref2.instantSearchInstance,\n      helper = _ref2.helper,\n      widgetType = _ref2.widgetType;\n    var sentEvents = {};\n    var timer = undefined;\n    var sendEventForHits = function sendEventForHits() {\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n      var payloads = _buildEventPayloadsForHits({\n        widgetType: widgetType,\n        helper: helper,\n        methodName: 'sendEvent',\n        args: args,\n        instantSearchInstance: instantSearchInstance\n      });\n      payloads.forEach(function (payload) {\n        if (payload.eventType === 'click' && payload.eventModifier === 'internal' && sentEvents[payload.eventType]) {\n          return;\n        }\n        sentEvents[payload.eventType] = true;\n        instantSearchInstance.sendEventToInsights(payload);\n      });\n      clearTimeout(timer);\n      timer = setTimeout(function () {\n        sentEvents = {};\n      }, 0);\n    };\n    return sendEventForHits;\n  }\n  function createBindEventForHits(_ref3) {\n    var helper = _ref3.helper,\n      widgetType = _ref3.widgetType,\n      instantSearchInstance = _ref3.instantSearchInstance;\n    var bindEventForHits = function bindEventForHits() {\n      for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n        args[_key2] = arguments[_key2];\n      }\n      var payloads = _buildEventPayloadsForHits({\n        widgetType: widgetType,\n        helper: helper,\n        methodName: 'bindEvent',\n        args: args,\n        instantSearchInstance: instantSearchInstance\n      });\n      return payloads.length ? \"data-insights-event=\".concat(serializePayload(payloads)) : '';\n    };\n    return bindEventForHits;\n  }\n\n  function isIndexWidget(widget) {\n    return widget.$$type === 'ais.index';\n  }\n\n  function setIndexHelperState(finalUiState, indexWidget) {\n    var nextIndexUiState = finalUiState[indexWidget.getIndexId()] || {};\n    {\n      checkIndexUiState({\n        index: indexWidget,\n        indexUiState: nextIndexUiState\n      });\n    }\n    indexWidget.getHelper().setState(indexWidget.getWidgetSearchParameters(indexWidget.getHelper().state, {\n      uiState: nextIndexUiState\n    }));\n    indexWidget.getWidgets().filter(isIndexWidget).forEach(function (widget) {\n      return setIndexHelperState(finalUiState, widget);\n    });\n  }\n\n  // Debounce a function call to the trailing edge.\n  // The debounced function returns a promise.\n  function debounce(func, wait) {\n    var lastTimeout = null;\n    return function () {\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n      return new Promise(function (resolve, reject) {\n        if (lastTimeout) {\n          clearTimeout(lastTimeout);\n        }\n        lastTimeout = setTimeout(function () {\n          lastTimeout = null;\n          Promise.resolve(func.apply(void 0, args)).then(resolve).catch(reject);\n        }, wait);\n      });\n    };\n  }\n\n  var nextMicroTask = Promise.resolve();\n  function defer(callback) {\n    var progress = null;\n    var cancelled = false;\n    var fn = function fn() {\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n      if (progress !== null) {\n        return;\n      }\n      progress = nextMicroTask.then(function () {\n        progress = null;\n        if (cancelled) {\n          cancelled = false;\n          return;\n        }\n        callback.apply(void 0, args);\n      });\n    };\n    fn.wait = function () {\n      if (progress === null) {\n        throw new Error('The deferred function should be called before calling `wait()`');\n      }\n      return progress;\n    };\n    fn.cancel = function () {\n      if (progress === null) {\n        return;\n      }\n      cancelled = true;\n    };\n    return fn;\n  }\n\n  function createDocumentationLink(_ref) {\n    var name = _ref.name,\n      _ref$connector = _ref.connector,\n      connector = _ref$connector === void 0 ? false : _ref$connector;\n    return ['https://www.algolia.com/doc/api-reference/widgets/', name, '/js/', connector ? '#connector' : ''].join('');\n  }\n  function createDocumentationMessageGenerator() {\n    for (var _len = arguments.length, widgets = new Array(_len), _key = 0; _key < _len; _key++) {\n      widgets[_key] = arguments[_key];\n    }\n    var links = widgets.map(function (widget) {\n      return createDocumentationLink(widget);\n    }).join(', ');\n    return function (message) {\n      return [message, \"See documentation: \".concat(links)].filter(Boolean).join('\\n\\n');\n    };\n  }\n\n  function unescapeFacetValue(value) {\n    if (typeof value === 'string') {\n      return value.replace(/^\\\\-/, '-');\n    }\n    return value;\n  }\n  function escapeFacetValue(value) {\n    if (typeof value === 'number' && value < 0 || typeof value === 'string') {\n      return String(value).replace(/^-/, '\\\\-');\n    }\n    return value;\n  }\n\n  // We aren't using the native `Array.prototype.find` because the refactor away from Lodash is not\n  // published as a major version.\n  // Relying on the `find` polyfill on user-land, which before was only required for niche use-cases,\n  // was decided as too risky.\n  // @MAJOR Replace with the native `Array.prototype.find` method\n  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\n  function find(items, predicate) {\n    var value;\n    for (var i = 0; i < items.length; i++) {\n      value = items[i];\n      // inlined for performance: if (Call(predicate, thisArg, [value, i, list])) {\n      if (predicate(value, i, items)) {\n        return value;\n      }\n    }\n    return undefined;\n  }\n\n  // We aren't using the native `Array.prototype.findIndex` because the refactor away from Lodash is not\n  // published as a major version.\n  // Relying on the `findIndex` polyfill on user-land, which before was only required for niche use-cases,\n  // was decided as too risky.\n  // @MAJOR Replace with the native `Array.prototype.findIndex` method\n  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex\n  function findIndex(array, comparator) {\n    if (!Array.isArray(array)) {\n      return -1;\n    }\n    for (var i = 0; i < array.length; i++) {\n      if (comparator(array[i])) {\n        return i;\n      }\n    }\n    return -1;\n  }\n\n  var latLngRegExp = /^(-?\\d+(?:\\.\\d+)?),\\s*(-?\\d+(?:\\.\\d+)?)$/;\n  function aroundLatLngToPosition(value) {\n    var pattern = value.match(latLngRegExp);\n\n    // Since the value provided is the one send with the request, the API should\n    // throw an error due to the wrong format. So throw an error should be safe.\n    if (!pattern) {\n      throw new Error(\"Invalid value for \\\"aroundLatLng\\\" parameter: \\\"\".concat(value, \"\\\"\"));\n    }\n    return {\n      lat: parseFloat(pattern[1]),\n      lng: parseFloat(pattern[2])\n    };\n  }\n  function insideBoundingBoxArrayToBoundingBox(value) {\n    var _value = _slicedToArray(value, 1),\n      _value$ = _value[0],\n      _value$2 = _value$ === void 0 ? [undefined, undefined, undefined, undefined] : _value$,\n      _value$3 = _slicedToArray(_value$2, 4),\n      neLat = _value$3[0],\n      neLng = _value$3[1],\n      swLat = _value$3[2],\n      swLng = _value$3[3];\n\n    // Since the value provided is the one send with the request, the API should\n    // throw an error due to the wrong format. So throw an error should be safe.\n    if (!neLat || !neLng || !swLat || !swLng) {\n      throw new Error(\"Invalid value for \\\"insideBoundingBox\\\" parameter: [\".concat(value, \"]\"));\n    }\n    return {\n      northEast: {\n        lat: neLat,\n        lng: neLng\n      },\n      southWest: {\n        lat: swLat,\n        lng: swLng\n      }\n    };\n  }\n  function insideBoundingBoxStringToBoundingBox(value) {\n    var _value$split$map = value.split(',').map(parseFloat),\n      _value$split$map2 = _slicedToArray(_value$split$map, 4),\n      neLat = _value$split$map2[0],\n      neLng = _value$split$map2[1],\n      swLat = _value$split$map2[2],\n      swLng = _value$split$map2[3];\n\n    // Since the value provided is the one send with the request, the API should\n    // throw an error due to the wrong format. So throw an error should be safe.\n    if (!neLat || !neLng || !swLat || !swLng) {\n      throw new Error(\"Invalid value for \\\"insideBoundingBox\\\" parameter: \\\"\".concat(value, \"\\\"\"));\n    }\n    return {\n      northEast: {\n        lat: neLat,\n        lng: neLng\n      },\n      southWest: {\n        lat: swLat,\n        lng: swLng\n      }\n    };\n  }\n  function insideBoundingBoxToBoundingBox(value) {\n    if (Array.isArray(value)) {\n      return insideBoundingBoxArrayToBoundingBox(value);\n    }\n    return insideBoundingBoxStringToBoundingBox(value);\n  }\n\n  // typed as any, since it accepts the _real_ js clients, not the interface we otherwise expect\n  function getAppIdAndApiKey(searchClient) {\n    if (searchClient.appId && searchClient.apiKey) {\n      // searchClient v5\n      return [searchClient.appId, searchClient.apiKey];\n    } else if (searchClient.transporter) {\n      // searchClient v4 or v5\n      var transporter = searchClient.transporter;\n      var headers = transporter.headers || transporter.baseHeaders;\n      var queryParameters = transporter.queryParameters || transporter.baseQueryParameters;\n      var APP_ID = 'x-algolia-application-id';\n      var API_KEY = 'x-algolia-api-key';\n      var appId = headers[APP_ID] || queryParameters[APP_ID];\n      var apiKey = headers[API_KEY] || queryParameters[API_KEY];\n      return [appId, apiKey];\n    } else {\n      // searchClient v3\n      return [searchClient.applicationID, searchClient.apiKey];\n    }\n  }\n\n  function isDomElement(object) {\n    return object instanceof HTMLElement || Boolean(object) && object.nodeType > 0;\n  }\n\n  /**\n   * Return the container. If it's a string, it is considered a\n   * css selector and retrieves the first matching element. Otherwise\n   * test if it validates that it's a correct DOMElement.\n   *\n   * @param {string|HTMLElement} selectorOrHTMLElement CSS Selector or container node.\n   * @return {HTMLElement} Container node\n   * @throws Error when the type is not correct\n   */\n  function getContainerNode(selectorOrHTMLElement) {\n    var isSelectorString = typeof selectorOrHTMLElement === 'string';\n    var domElement = isSelectorString ? document.querySelector(selectorOrHTMLElement) : selectorOrHTMLElement;\n    if (!isDomElement(domElement)) {\n      var errorMessage = 'Container must be `string` or `HTMLElement`.';\n      if (isSelectorString) {\n        errorMessage += \" Unable to find \".concat(selectorOrHTMLElement);\n      }\n      throw new Error(errorMessage);\n    }\n    return domElement;\n  }\n\n  function getHighlightedParts(highlightedValue) {\n    // @MAJOR: this should use TAG_PLACEHOLDER\n    var highlightPostTag = TAG_REPLACEMENT.highlightPostTag,\n      highlightPreTag = TAG_REPLACEMENT.highlightPreTag;\n    var splitByPreTag = highlightedValue.split(highlightPreTag);\n    var firstValue = splitByPreTag.shift();\n    var elements = !firstValue ? [] : [{\n      value: firstValue,\n      isHighlighted: false\n    }];\n    splitByPreTag.forEach(function (split) {\n      var splitByPostTag = split.split(highlightPostTag);\n      elements.push({\n        value: splitByPostTag[0],\n        isHighlighted: true\n      });\n      if (splitByPostTag[1] !== '') {\n        elements.push({\n          value: splitByPostTag[1],\n          isHighlighted: false\n        });\n      }\n    });\n    return elements;\n  }\n\n  var hasAlphanumeric = new RegExp(/\\w/i);\n  function getHighlightFromSiblings(parts, i) {\n    var _parts, _parts2;\n    var current = parts[i];\n    var isNextHighlighted = ((_parts = parts[i + 1]) === null || _parts === void 0 ? void 0 : _parts.isHighlighted) || true;\n    var isPreviousHighlighted = ((_parts2 = parts[i - 1]) === null || _parts2 === void 0 ? void 0 : _parts2.isHighlighted) || true;\n    if (!hasAlphanumeric.test(unescape$1(current.value)) && isPreviousHighlighted === isNextHighlighted) {\n      return isPreviousHighlighted;\n    }\n    return current.isHighlighted;\n  }\n\n  function getPropertyByPath(object, path) {\n    var parts = Array.isArray(path) ? path : path.split('.');\n    return parts.reduce(function (current, key) {\n      return current && current[key];\n    }, object);\n  }\n\n  function getRefinement(state, type, attribute, name) {\n    var resultsFacets = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];\n    var res = {\n      type: type,\n      attribute: attribute,\n      name: name,\n      escapedValue: escapeFacetValue(name)\n    };\n    var facet = find(resultsFacets, function (resultsFacet) {\n      return resultsFacet.name === attribute;\n    });\n    var count;\n    if (type === 'hierarchical') {\n      var facetDeclaration = state.getHierarchicalFacetByName(attribute);\n      var nameParts = name.split(facetDeclaration.separator);\n      var getFacetRefinement = function getFacetRefinement(facetData) {\n        return function (refinementKey) {\n          return facetData[refinementKey];\n        };\n      };\n      var _loop = function _loop(i) {\n        facet = facet && facet.data && find(Object.keys(facet.data).map(getFacetRefinement(facet.data)), function (refinement) {\n          return refinement.name === nameParts[i];\n        });\n      };\n      for (var i = 0; facet !== undefined && i < nameParts.length; ++i) {\n        _loop(i);\n      }\n      count = facet && facet.count;\n    } else {\n      count = facet && facet.data && facet.data[res.name];\n    }\n    if (count !== undefined) {\n      res.count = count;\n    }\n    if (facet && facet.exhaustive !== undefined) {\n      res.exhaustive = facet.exhaustive;\n    }\n    return res;\n  }\n  function getRefinements(_results, state) {\n    var includesQuery = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n    var results = _results || {};\n    var refinements = [];\n    var _state$facetsRefineme = state.facetsRefinements,\n      facetsRefinements = _state$facetsRefineme === void 0 ? {} : _state$facetsRefineme,\n      _state$facetsExcludes = state.facetsExcludes,\n      facetsExcludes = _state$facetsExcludes === void 0 ? {} : _state$facetsExcludes,\n      _state$disjunctiveFac = state.disjunctiveFacetsRefinements,\n      disjunctiveFacetsRefinements = _state$disjunctiveFac === void 0 ? {} : _state$disjunctiveFac,\n      _state$hierarchicalFa = state.hierarchicalFacetsRefinements,\n      hierarchicalFacetsRefinements = _state$hierarchicalFa === void 0 ? {} : _state$hierarchicalFa,\n      _state$numericRefinem = state.numericRefinements,\n      numericRefinements = _state$numericRefinem === void 0 ? {} : _state$numericRefinem,\n      _state$tagRefinements = state.tagRefinements,\n      tagRefinements = _state$tagRefinements === void 0 ? [] : _state$tagRefinements;\n    Object.keys(facetsRefinements).forEach(function (attribute) {\n      var refinementNames = facetsRefinements[attribute];\n      refinementNames.forEach(function (refinementName) {\n        refinements.push(getRefinement(state, 'facet', attribute, refinementName, results.facets));\n      });\n    });\n    Object.keys(facetsExcludes).forEach(function (attribute) {\n      var refinementNames = facetsExcludes[attribute];\n      refinementNames.forEach(function (refinementName) {\n        refinements.push({\n          type: 'exclude',\n          attribute: attribute,\n          name: refinementName,\n          exclude: true\n        });\n      });\n    });\n    Object.keys(disjunctiveFacetsRefinements).forEach(function (attribute) {\n      var refinementNames = disjunctiveFacetsRefinements[attribute];\n      refinementNames.forEach(function (refinementName) {\n        refinements.push(getRefinement(state, 'disjunctive', attribute,\n        // We unescape any disjunctive refined values with `unescapeFacetValue` because\n        // they can be escaped on negative numeric values with `escapeFacetValue`.\n        unescapeFacetValue(refinementName), results.disjunctiveFacets));\n      });\n    });\n    Object.keys(hierarchicalFacetsRefinements).forEach(function (attribute) {\n      var refinementNames = hierarchicalFacetsRefinements[attribute];\n      refinementNames.forEach(function (refinement) {\n        refinements.push(getRefinement(state, 'hierarchical', attribute, refinement, results.hierarchicalFacets));\n      });\n    });\n    Object.keys(numericRefinements).forEach(function (attribute) {\n      var operators = numericRefinements[attribute];\n      Object.keys(operators).forEach(function (operatorOriginal) {\n        var operator = operatorOriginal;\n        var valueOrValues = operators[operator];\n        var refinementNames = Array.isArray(valueOrValues) ? valueOrValues : [valueOrValues];\n        refinementNames.forEach(function (refinementName) {\n          refinements.push({\n            type: 'numeric',\n            attribute: attribute,\n            name: \"\".concat(refinementName),\n            numericValue: refinementName,\n            operator: operator\n          });\n        });\n      });\n    });\n    tagRefinements.forEach(function (refinementName) {\n      refinements.push({\n        type: 'tag',\n        attribute: '_tags',\n        name: refinementName\n      });\n    });\n    if (includesQuery && state.query && state.query.trim()) {\n      refinements.push({\n        attribute: 'query',\n        type: 'query',\n        name: state.query,\n        query: state.query\n      });\n    }\n    return refinements;\n  }\n\n  function getWidgetAttribute(widget, initOptions) {\n    var _widget$getWidgetRend;\n    var renderState = (_widget$getWidgetRend = widget.getWidgetRenderState) === null || _widget$getWidgetRend === void 0 ? void 0 : _widget$getWidgetRend.call(widget, initOptions);\n    var attribute = null;\n    if (renderState && renderState.widgetParams) {\n      // casting as widgetParams is checked just before\n      var widgetParams = renderState.widgetParams;\n      if (widgetParams.attribute) {\n        attribute = widgetParams.attribute;\n      } else if (Array.isArray(widgetParams.attributes)) {\n        attribute = widgetParams.attributes[0];\n      }\n    }\n    if (typeof attribute !== 'string') {\n      throw new Error(\"Could not find the attribute of the widget:\\n\\n\".concat(JSON.stringify(widget), \"\\n\\nPlease check whether the widget's getWidgetRenderState returns widgetParams.attribute correctly.\"));\n    }\n    return attribute;\n  }\n\n  function addAbsolutePosition(hits, page, hitsPerPage) {\n    return hits.map(function (hit, idx) {\n      return _objectSpread2(_objectSpread2({}, hit), {}, {\n        __position: hitsPerPage * page + idx + 1\n      });\n    });\n  }\n\n  function addQueryID(hits, queryID) {\n    if (!queryID) {\n      return hits;\n    }\n    return hits.map(function (hit) {\n      return _objectSpread2(_objectSpread2({}, hit), {}, {\n        __queryID: queryID\n      });\n    });\n  }\n\n  function hydrateRecommendCache(helper, initialResults) {\n    var recommendCache = Object.keys(initialResults).reduce(function (acc, indexName) {\n      var initialResult = initialResults[indexName];\n      if (initialResult.recommendResults) {\n        // @MAJOR: Use `Object.assign` instead of spread operator\n        return _objectSpread2(_objectSpread2({}, acc), initialResult.recommendResults.results);\n      }\n      return acc;\n    }, {});\n    helper._recommendCache = recommendCache;\n  }\n\n  function hydrateSearchClient(client, results) {\n    if (!results) {\n      return;\n    }\n\n    // Disable cache hydration on:\n    // - Algoliasearch API Client < v4 with cache disabled\n    // - Third party clients (detected by the `addAlgoliaAgent` function missing)\n\n    if ((!('transporter' in client) || client._cacheHydrated) && (!client._useCache || typeof client.addAlgoliaAgent !== 'function')) {\n      return;\n    }\n    var cachedRequest = [Object.keys(results).reduce(function (acc, key) {\n      var _results$key = results[key],\n        state = _results$key.state,\n        requestParams = _results$key.requestParams,\n        serverResults = _results$key.results;\n      var mappedResults = serverResults && state ? serverResults.map(function (result, idx) {\n        return _objectSpread2({\n          indexName: state.index || result.index\n        }, requestParams !== null && requestParams !== void 0 && requestParams[idx] || result.params ? {\n          params: serializeQueryParameters((requestParams === null || requestParams === void 0 ? void 0 : requestParams[idx]) || deserializeQueryParameters(result.params))\n        } : {});\n      }) : [];\n      return acc.concat(mappedResults);\n    }, [])];\n    var cachedResults = Object.keys(results).reduce(function (acc, key) {\n      var res = results[key].results;\n      if (!res) {\n        return acc;\n      }\n      return acc.concat(res);\n    }, []);\n\n    // Algoliasearch API Client >= v4\n    // To hydrate the client we need to populate the cache with the data from\n    // the server (done in `hydrateSearchClientWithMultiIndexRequest` or\n    // `hydrateSearchClientWithSingleIndexRequest`). But since there is no way\n    // for us to compute the key the same way as `algoliasearch-client` we need\n    // to populate it on a custom key and override the `search` method to\n    // search on it first.\n    if ('transporter' in client && !client._cacheHydrated) {\n      client._cacheHydrated = true;\n      var baseMethod = client.search.bind(client);\n      client.search = function (requests) {\n        for (var _len = arguments.length, methodArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n          methodArgs[_key - 1] = arguments[_key];\n        }\n        var requestsWithSerializedParams = Array.isArray(requests) ?\n        // search client\n        requests.map(function (request) {\n          return _objectSpread2(_objectSpread2({}, request), {}, {\n            params: serializeQueryParameters(request.params)\n          });\n        }) :\n        // composition client\n        serializeQueryParameters(requests.requestBody.params);\n        return client.transporter.responsesCache.get({\n          method: 'search',\n          args: [requestsWithSerializedParams].concat(methodArgs)\n        }, function () {\n          return baseMethod.apply(void 0, [requests].concat(methodArgs));\n        });\n      };\n      client.transporter.responsesCache.set({\n        method: 'search',\n        args: cachedRequest\n      }, {\n        results: cachedResults\n      });\n    }\n\n    // Algoliasearch API Client < v4\n    // Prior to client v4 we didn't have a proper API to hydrate the client\n    // cache from the outside. The following code populates the cache with\n    // a single-index result. You can find more information about the\n    // computation of the key inside the client (see link below).\n    // https://github.com/algolia/algoliasearch-client-javascript/blob/c27e89ff92b2a854ae6f40dc524bffe0f0cbc169/src/AlgoliaSearchCore.js#L232-L240\n    if (!('transporter' in client)) {\n      var cacheKey = \"/1/indexes/*/queries_body_\".concat(JSON.stringify({\n        requests: cachedRequest\n      }));\n      client.cache = _objectSpread2(_objectSpread2({}, client.cache), {}, _defineProperty({}, cacheKey, JSON.stringify({\n        results: Object.keys(results).map(function (key) {\n          return results[key].results;\n        })\n      })));\n    }\n  }\n  function deserializeQueryParameters(parameters) {\n    return parameters.split('&').reduce(function (acc, parameter) {\n      var _parameter$split = parameter.split('='),\n        _parameter$split2 = _slicedToArray(_parameter$split, 2),\n        key = _parameter$split2[0],\n        value = _parameter$split2[1];\n      acc[key] = value ? decodeURIComponent(value) : '';\n      return acc;\n    }, {});\n  }\n\n  // This function is copied from the algoliasearch v4 API Client. If modified,\n  // consider updating it also in `serializeQueryParameters` from `@algolia/transporter`.\n  function serializeQueryParameters(parameters) {\n    var isObjectOrArray = function isObjectOrArray(value) {\n      return Object.prototype.toString.call(value) === '[object Object]' || Object.prototype.toString.call(value) === '[object Array]';\n    };\n    var encode = function encode(format) {\n      for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n        args[_key2 - 1] = arguments[_key2];\n      }\n      var i = 0;\n      return format.replace(/%s/g, function () {\n        return encodeURIComponent(args[i++]);\n      });\n    };\n    return Object.keys(parameters).map(function (key) {\n      return encode('%s=%s', key, isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key]);\n    }).join('&');\n  }\n\n  function isPrimitive(obj) {\n    return obj !== Object(obj);\n  }\n  function isEqual(first, second) {\n    if (first === second) {\n      return true;\n    }\n    if (isPrimitive(first) || isPrimitive(second) || typeof first === 'function' || typeof second === 'function') {\n      return first === second;\n    }\n    if (Object.keys(first).length !== Object.keys(second).length) {\n      return false;\n    }\n\n    // @TODO avoid for..of because of the large polyfill\n    // eslint-disable-next-line no-restricted-syntax\n    for (var _i = 0, _Object$keys = Object.keys(first); _i < _Object$keys.length; _i++) {\n      var key = _Object$keys[_i];\n      if (!(key in second)) {\n        return false;\n      }\n      if (!isEqual(first[key], second[key])) {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  // This is the `Number.isFinite()` polyfill recommended by MDN.\n  // We do not provide any tests for this function.\n  // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#Polyfill\n  // @MAJOR Replace with the native `Number.isFinite` method\n  function isFiniteNumber(value) {\n    return typeof value === 'number' && isFinite(value);\n  }\n\n  function isSpecialClick(event) {\n    var isMiddleClick = event.button === 1;\n    return isMiddleClick || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;\n  }\n\n  /**\n   * Recurse over all child indices\n   */\n  function walkIndex(indexWidget, callback) {\n    callback(indexWidget);\n    indexWidget.getWidgets().forEach(function (widget) {\n      if (isIndexWidget(widget)) {\n        walkIndex(widget, callback);\n      }\n    });\n  }\n\n  function uniq(array) {\n    return array.filter(function (value, index, self) {\n      return self.indexOf(value) === index;\n    });\n  }\n\n  var _excluded = [\"facets\", \"disjunctiveFacets\", \"facetsRefinements\", \"facetsExcludes\", \"disjunctiveFacetsRefinements\", \"numericRefinements\", \"tagRefinements\", \"hierarchicalFacets\", \"hierarchicalFacetsRefinements\", \"ruleContexts\"];\n  var mergeWithRest = function mergeWithRest(left, right) {\n    var facets = right.facets,\n      disjunctiveFacets = right.disjunctiveFacets,\n      facetsRefinements = right.facetsRefinements,\n      facetsExcludes = right.facetsExcludes,\n      disjunctiveFacetsRefinements = right.disjunctiveFacetsRefinements,\n      numericRefinements = right.numericRefinements,\n      tagRefinements = right.tagRefinements,\n      hierarchicalFacets = right.hierarchicalFacets,\n      hierarchicalFacetsRefinements = right.hierarchicalFacetsRefinements,\n      ruleContexts = right.ruleContexts,\n      rest = _objectWithoutProperties(right, _excluded);\n    return left.setQueryParameters(rest);\n  };\n\n  // Merge facets\n  var mergeFacets = function mergeFacets(left, right) {\n    return right.facets.reduce(function (_, name) {\n      return _.addFacet(name);\n    }, left);\n  };\n  var mergeDisjunctiveFacets = function mergeDisjunctiveFacets(left, right) {\n    return right.disjunctiveFacets.reduce(function (_, name) {\n      return _.addDisjunctiveFacet(name);\n    }, left);\n  };\n  var mergeHierarchicalFacets = function mergeHierarchicalFacets(left, right) {\n    return left.setQueryParameters({\n      hierarchicalFacets: right.hierarchicalFacets.reduce(function (facets, facet) {\n        var index = findIndex(facets, function (_) {\n          return _.name === facet.name;\n        });\n        if (index === -1) {\n          return facets.concat(facet);\n        }\n        var nextFacets = facets.slice();\n        nextFacets.splice(index, 1, facet);\n        return nextFacets;\n      }, left.hierarchicalFacets)\n    });\n  };\n\n  // Merge facet refinements\n  var mergeTagRefinements = function mergeTagRefinements(left, right) {\n    return right.tagRefinements.reduce(function (_, value) {\n      return _.addTagRefinement(value);\n    }, left);\n  };\n  var mergeFacetRefinements = function mergeFacetRefinements(left, right) {\n    return left.setQueryParameters({\n      facetsRefinements: _objectSpread2(_objectSpread2({}, left.facetsRefinements), right.facetsRefinements)\n    });\n  };\n  var mergeFacetsExcludes = function mergeFacetsExcludes(left, right) {\n    return left.setQueryParameters({\n      facetsExcludes: _objectSpread2(_objectSpread2({}, left.facetsExcludes), right.facetsExcludes)\n    });\n  };\n  var mergeDisjunctiveFacetsRefinements = function mergeDisjunctiveFacetsRefinements(left, right) {\n    return left.setQueryParameters({\n      disjunctiveFacetsRefinements: _objectSpread2(_objectSpread2({}, left.disjunctiveFacetsRefinements), right.disjunctiveFacetsRefinements)\n    });\n  };\n  var mergeNumericRefinements = function mergeNumericRefinements(left, right) {\n    return left.setQueryParameters({\n      numericRefinements: _objectSpread2(_objectSpread2({}, left.numericRefinements), right.numericRefinements)\n    });\n  };\n  var mergeHierarchicalFacetsRefinements = function mergeHierarchicalFacetsRefinements(left, right) {\n    return left.setQueryParameters({\n      hierarchicalFacetsRefinements: _objectSpread2(_objectSpread2({}, left.hierarchicalFacetsRefinements), right.hierarchicalFacetsRefinements)\n    });\n  };\n  var mergeRuleContexts = function mergeRuleContexts(left, right) {\n    var ruleContexts = uniq([].concat(left.ruleContexts).concat(right.ruleContexts).filter(Boolean));\n    if (ruleContexts.length > 0) {\n      return left.setQueryParameters({\n        ruleContexts: ruleContexts\n      });\n    }\n    return left;\n  };\n  var mergeSearchParameters = function mergeSearchParameters() {\n    for (var _len = arguments.length, parameters = new Array(_len), _key = 0; _key < _len; _key++) {\n      parameters[_key] = arguments[_key];\n    }\n    return parameters.reduce(function (left, right) {\n      var hierarchicalFacetsRefinementsMerged = mergeHierarchicalFacetsRefinements(left, right);\n      var hierarchicalFacetsMerged = mergeHierarchicalFacets(hierarchicalFacetsRefinementsMerged, right);\n      var tagRefinementsMerged = mergeTagRefinements(hierarchicalFacetsMerged, right);\n      var numericRefinementsMerged = mergeNumericRefinements(tagRefinementsMerged, right);\n      var disjunctiveFacetsRefinementsMerged = mergeDisjunctiveFacetsRefinements(numericRefinementsMerged, right);\n      var facetsExcludesMerged = mergeFacetsExcludes(disjunctiveFacetsRefinementsMerged, right);\n      var facetRefinementsMerged = mergeFacetRefinements(facetsExcludesMerged, right);\n      var disjunctiveFacetsMerged = mergeDisjunctiveFacets(facetRefinementsMerged, right);\n      var ruleContextsMerged = mergeRuleContexts(disjunctiveFacetsMerged, right);\n      var facetsMerged = mergeFacets(ruleContextsMerged, right);\n      return mergeWithRest(facetsMerged, right);\n    });\n  };\n\n  /**\n   * Creates a new object with the same keys as the original object, but without the excluded keys.\n   * @param source original object\n   * @param excluded keys to remove from the original object\n   * @returns the new object\n   */\n  function omit(source, excluded) {\n    if (source === null || source === undefined) {\n      return source;\n    }\n    return Object.keys(source).reduce(function (target, key) {\n      if (excluded.indexOf(key) >= 0) {\n        return target;\n      }\n      var validKey = key;\n      target[validKey] = source[validKey];\n      return target;\n    }, {});\n  }\n\n  function range(_ref) {\n    var _ref$start = _ref.start,\n      start = _ref$start === void 0 ? 0 : _ref$start,\n      end = _ref.end,\n      _ref$step = _ref.step,\n      step = _ref$step === void 0 ? 1 : _ref$step;\n    // We can't divide by 0 so we re-assign the step to 1 if it happens.\n    var limitStep = step === 0 ? 1 : step;\n\n    // In some cases the array to create has a decimal length.\n    // We therefore need to round the value.\n    // Example:\n    //   { start: 1, end: 5000, step: 500 }\n    //   => Array length = (5000 - 1) / 500 = 9.998\n    var arrayLength = Math.round((end - start) / limitStep);\n    return _toConsumableArray(Array(arrayLength)).map(function (_, current) {\n      return start + current * limitStep;\n    });\n  }\n\n  function createInitArgs(instantSearchInstance, parent, uiState) {\n    var helper = parent.getHelper();\n    return {\n      uiState: uiState,\n      helper: helper,\n      parent: parent,\n      instantSearchInstance: instantSearchInstance,\n      state: helper.state,\n      renderState: instantSearchInstance.renderState,\n      templatesConfig: instantSearchInstance.templatesConfig,\n      createURL: parent.createURL,\n      scopedResults: [],\n      searchMetadata: {\n        isSearchStalled: instantSearchInstance.status === 'stalled'\n      },\n      status: instantSearchInstance.status,\n      error: instantSearchInstance.error\n    };\n  }\n  function createRenderArgs(instantSearchInstance, parent, widget) {\n    var results = parent.getResultsForWidget(widget);\n    var helper = parent.getHelper();\n    return {\n      helper: helper,\n      parent: parent,\n      instantSearchInstance: instantSearchInstance,\n      results: results,\n      scopedResults: parent.getScopedResults(),\n      state: results && '_state' in results ? results._state : helper.state,\n      renderState: instantSearchInstance.renderState,\n      templatesConfig: instantSearchInstance.templatesConfig,\n      createURL: parent.createURL,\n      searchMetadata: {\n        isSearchStalled: instantSearchInstance.status === 'stalled'\n      },\n      status: instantSearchInstance.status,\n      error: instantSearchInstance.error\n    };\n  }\n\n  function resolveSearchParameters(current) {\n    var parent = current.getParent();\n    var states = [current.getHelper().state];\n    while (parent !== null) {\n      states = [parent.getHelper().state].concat(states);\n      parent = parent.getParent();\n    }\n    return states;\n  }\n\n  function reverseHighlightedParts(parts) {\n    if (!parts.some(function (part) {\n      return part.isHighlighted;\n    })) {\n      return parts.map(function (part) {\n        return _objectSpread2(_objectSpread2({}, part), {}, {\n          isHighlighted: false\n        });\n      });\n    }\n    return parts.map(function (part, i) {\n      return _objectSpread2(_objectSpread2({}, part), {}, {\n        isHighlighted: !getHighlightFromSiblings(parts, i)\n      });\n    });\n  }\n\n  // eslint-disable-next-line no-restricted-globals\n\n  /**\n   * Runs code on browser environments safely.\n   */\n  function safelyRunOnBrowser(callback) {\n    var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n        fallback: function fallback() {\n          return undefined;\n        }\n      },\n      fallback = _ref.fallback;\n    // eslint-disable-next-line no-restricted-globals\n    if (typeof window === 'undefined') {\n      return fallback();\n    }\n\n    // eslint-disable-next-line no-restricted-globals\n    return callback({\n      window: window\n    });\n  }\n\n  function toArray(value) {\n    return Array.isArray(value) ? value : [value];\n  }\n\n  function hasFindAnswersMethod(answersIndex) {\n    return typeof answersIndex.findAnswers === 'function';\n  }\n  var withUsage = createDocumentationMessageGenerator({\n    name: 'answers',\n    connector: true\n  });\n  /**\n   * @deprecated the answers service is no longer offered, and this widget will be removed in InstantSearch.js v5\n   */\n  var connectAnswers = function connectAnswers(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage());\n    return function (widgetParams) {\n      var _ref = widgetParams || {},\n        queryLanguages = _ref.queryLanguages,\n        attributesForPrediction = _ref.attributesForPrediction,\n        _ref$nbHits = _ref.nbHits,\n        nbHits = _ref$nbHits === void 0 ? 1 : _ref$nbHits,\n        _ref$renderDebounceTi = _ref.renderDebounceTime,\n        renderDebounceTime = _ref$renderDebounceTi === void 0 ? 100 : _ref$renderDebounceTi,\n        _ref$searchDebounceTi = _ref.searchDebounceTime,\n        searchDebounceTime = _ref$searchDebounceTi === void 0 ? 100 : _ref$searchDebounceTi,\n        _ref$escapeHTML = _ref.escapeHTML,\n        escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,\n        _ref$extraParameters = _ref.extraParameters,\n        extraParameters = _ref$extraParameters === void 0 ? {} : _ref$extraParameters;\n\n      // @ts-expect-error checking for the wrong value\n      if (!queryLanguages || queryLanguages.length === 0) {\n        throw new Error(withUsage('The `queryLanguages` expects an array of strings.'));\n      }\n      var runConcurrentSafePromise = createConcurrentSafePromise();\n      var lastHits = [];\n      var isLoading = false;\n      var debouncedRender = debounce(renderFn, renderDebounceTime);\n      var debouncedRefine;\n      return {\n        $$type: 'ais.answers',\n        init: function init(initOptions) {\n          var state = initOptions.state,\n            instantSearchInstance = initOptions.instantSearchInstance;\n          if (typeof instantSearchInstance.client.initIndex !== 'function') {\n            throw new Error(withUsage('`algoliasearch` <5 required.'));\n          }\n          var answersIndex = instantSearchInstance.client.initIndex(state.index);\n          if (!hasFindAnswersMethod(answersIndex)) {\n            throw new Error(withUsage('`algoliasearch` >= 4.8.0 required.'));\n          }\n          debouncedRefine = debounce(answersIndex.findAnswers, searchDebounceTime);\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: initOptions.instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var _this = this;\n          var query = renderOptions.state.query;\n          if (!query) {\n            // renders nothing with empty query\n            lastHits = [];\n            isLoading = false;\n            renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n              instantSearchInstance: renderOptions.instantSearchInstance\n            }), false);\n            return;\n          }\n\n          // render the loader\n          lastHits = [];\n          isLoading = true;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: renderOptions.instantSearchInstance\n          }), false);\n\n          // call /answers API\n          runConcurrentSafePromise(debouncedRefine(query, queryLanguages, _objectSpread2(_objectSpread2({}, extraParameters), {}, {\n            nbHits: nbHits,\n            attributesForPrediction: attributesForPrediction\n          }))).then(function (result) {\n            if (!result) {\n              // It's undefined when it's debounced.\n              return;\n            }\n            if (escapeHTML && result.hits.length > 0) {\n              result.hits = escapeHits(result.hits);\n            }\n            var hitsWithAbsolutePosition = addAbsolutePosition(result.hits, 0, nbHits);\n            var hitsWithAbsolutePositionAndQueryID = addQueryID(hitsWithAbsolutePosition, result.queryID);\n            lastHits = hitsWithAbsolutePositionAndQueryID;\n            isLoading = false;\n            debouncedRender(_objectSpread2(_objectSpread2({}, _this.getWidgetRenderState(renderOptions)), {}, {\n              instantSearchInstance: renderOptions.instantSearchInstance\n            }), false);\n          });\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            answers: this.getWidgetRenderState(renderOptions)\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState() {\n          return {\n            hits: lastHits,\n            isLoading: isLoading,\n            widgetParams: widgetParams\n          };\n        },\n        dispose: function dispose(_ref2) {\n          var state = _ref2.state;\n          unmountFn();\n          return state;\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(state) {\n          return state;\n        }\n      };\n    };\n  };\n\n  // Copyright Joyent, Inc. and other Node contributors.\n  //\n  // Permission is hereby granted, free of charge, to any person obtaining a\n  // copy of this software and associated documentation files (the\n  // \"Software\"), to deal in the Software without restriction, including\n  // without limitation the rights to use, copy, modify, merge, publish,\n  // distribute, sublicense, and/or sell copies of the Software, and to permit\n  // persons to whom the Software is furnished to do so, subject to the\n  // following conditions:\n  //\n  // The above copyright notice and this permission notice shall be included\n  // in all copies or substantial portions of the Software.\n  //\n  // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n  // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n  // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n  // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n  // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n  // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n  // USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n  function EventEmitter() {\n    this._events = this._events || {};\n    this._maxListeners = this._maxListeners || undefined;\n  }\n  var events = EventEmitter;\n\n  // Backwards-compat with node 0.10.x\n  // EventEmitter.EventEmitter = EventEmitter;\n\n  EventEmitter.prototype._events = undefined;\n  EventEmitter.prototype._maxListeners = undefined;\n\n  // By default EventEmitters will print a warning if more than 10 listeners are\n  // added to it. This is a useful default which helps finding memory leaks.\n  EventEmitter.defaultMaxListeners = 10;\n\n  // Obviously not all Emitters should be limited to 10. This function allows\n  // that to be increased. Set to zero for unlimited.\n  EventEmitter.prototype.setMaxListeners = function(n) {\n    if (!isNumber(n) || n < 0 || isNaN(n))\n      throw TypeError('n must be a positive number');\n    this._maxListeners = n;\n    return this;\n  };\n\n  EventEmitter.prototype.emit = function(type) {\n    var er, handler, len, args, i, listeners;\n\n    if (!this._events)\n      this._events = {};\n\n    // If there is no 'error' event listener then throw.\n    if (type === 'error') {\n      if (!this._events.error ||\n          (isObject(this._events.error) && !this._events.error.length)) {\n        er = arguments[1];\n        if (er instanceof Error) {\n          throw er; // Unhandled 'error' event\n        } else {\n          // At least give some kind of context to the user\n          var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n          err.context = er;\n          throw err;\n        }\n      }\n    }\n\n    handler = this._events[type];\n\n    if (isUndefined(handler))\n      return false;\n\n    if (isFunction(handler)) {\n      switch (arguments.length) {\n        // fast cases\n        case 1:\n          handler.call(this);\n          break;\n        case 2:\n          handler.call(this, arguments[1]);\n          break;\n        case 3:\n          handler.call(this, arguments[1], arguments[2]);\n          break;\n        // slower\n        default:\n          args = Array.prototype.slice.call(arguments, 1);\n          handler.apply(this, args);\n      }\n    } else if (isObject(handler)) {\n      args = Array.prototype.slice.call(arguments, 1);\n      listeners = handler.slice();\n      len = listeners.length;\n      for (i = 0; i < len; i++)\n        listeners[i].apply(this, args);\n    }\n\n    return true;\n  };\n\n  EventEmitter.prototype.addListener = function(type, listener) {\n    var m;\n\n    if (!isFunction(listener))\n      throw TypeError('listener must be a function');\n\n    if (!this._events)\n      this._events = {};\n\n    // To avoid recursion in the case that type === \"newListener\"! Before\n    // adding it to the listeners, first emit \"newListener\".\n    if (this._events.newListener)\n      this.emit('newListener', type,\n                isFunction(listener.listener) ?\n                listener.listener : listener);\n\n    if (!this._events[type])\n      // Optimize the case of one listener. Don't need the extra array object.\n      this._events[type] = listener;\n    else if (isObject(this._events[type]))\n      // If we've already got an array, just append.\n      this._events[type].push(listener);\n    else\n      // Adding the second element, need to change to array.\n      this._events[type] = [this._events[type], listener];\n\n    // Check for listener leak\n    if (isObject(this._events[type]) && !this._events[type].warned) {\n      if (!isUndefined(this._maxListeners)) {\n        m = this._maxListeners;\n      } else {\n        m = EventEmitter.defaultMaxListeners;\n      }\n\n      if (m && m > 0 && this._events[type].length > m) {\n        this._events[type].warned = true;\n        console.error('(node) warning: possible EventEmitter memory ' +\n                      'leak detected. %d listeners added. ' +\n                      'Use emitter.setMaxListeners() to increase limit.',\n                      this._events[type].length);\n        if (typeof console.trace === 'function') {\n          // not supported in IE 10\n          console.trace();\n        }\n      }\n    }\n\n    return this;\n  };\n\n  EventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\n  EventEmitter.prototype.once = function(type, listener) {\n    if (!isFunction(listener))\n      throw TypeError('listener must be a function');\n\n    var fired = false;\n\n    function g() {\n      this.removeListener(type, g);\n\n      if (!fired) {\n        fired = true;\n        listener.apply(this, arguments);\n      }\n    }\n\n    g.listener = listener;\n    this.on(type, g);\n\n    return this;\n  };\n\n  // emits a 'removeListener' event iff the listener was removed\n  EventEmitter.prototype.removeListener = function(type, listener) {\n    var list, position, length, i;\n\n    if (!isFunction(listener))\n      throw TypeError('listener must be a function');\n\n    if (!this._events || !this._events[type])\n      return this;\n\n    list = this._events[type];\n    length = list.length;\n    position = -1;\n\n    if (list === listener ||\n        (isFunction(list.listener) && list.listener === listener)) {\n      delete this._events[type];\n      if (this._events.removeListener)\n        this.emit('removeListener', type, listener);\n\n    } else if (isObject(list)) {\n      for (i = length; i-- > 0;) {\n        if (list[i] === listener ||\n            (list[i].listener && list[i].listener === listener)) {\n          position = i;\n          break;\n        }\n      }\n\n      if (position < 0)\n        return this;\n\n      if (list.length === 1) {\n        list.length = 0;\n        delete this._events[type];\n      } else {\n        list.splice(position, 1);\n      }\n\n      if (this._events.removeListener)\n        this.emit('removeListener', type, listener);\n    }\n\n    return this;\n  };\n\n  EventEmitter.prototype.removeAllListeners = function(type) {\n    var key, listeners;\n\n    if (!this._events)\n      return this;\n\n    // not listening for removeListener, no need to emit\n    if (!this._events.removeListener) {\n      if (arguments.length === 0)\n        this._events = {};\n      else if (this._events[type])\n        delete this._events[type];\n      return this;\n    }\n\n    // emit removeListener for all listeners on all events\n    if (arguments.length === 0) {\n      for (key in this._events) {\n        if (key === 'removeListener') continue;\n        this.removeAllListeners(key);\n      }\n      this.removeAllListeners('removeListener');\n      this._events = {};\n      return this;\n    }\n\n    listeners = this._events[type];\n\n    if (isFunction(listeners)) {\n      this.removeListener(type, listeners);\n    } else if (listeners) {\n      // LIFO order\n      while (listeners.length)\n        this.removeListener(type, listeners[listeners.length - 1]);\n    }\n    delete this._events[type];\n\n    return this;\n  };\n\n  EventEmitter.prototype.listeners = function(type) {\n    var ret;\n    if (!this._events || !this._events[type])\n      ret = [];\n    else if (isFunction(this._events[type]))\n      ret = [this._events[type]];\n    else\n      ret = this._events[type].slice();\n    return ret;\n  };\n\n  EventEmitter.prototype.listenerCount = function(type) {\n    if (this._events) {\n      var evlistener = this._events[type];\n\n      if (isFunction(evlistener))\n        return 1;\n      else if (evlistener)\n        return evlistener.length;\n    }\n    return 0;\n  };\n\n  EventEmitter.listenerCount = function(emitter, type) {\n    return emitter.listenerCount(type);\n  };\n\n  function isFunction(arg) {\n    return typeof arg === 'function';\n  }\n\n  function isNumber(arg) {\n    return typeof arg === 'number';\n  }\n\n  function isObject(arg) {\n    return typeof arg === 'object' && arg !== null;\n  }\n\n  function isUndefined(arg) {\n    return arg === void 0;\n  }\n\n  function inherits(ctor, superCtor) {\n    ctor.prototype = Object.create(superCtor.prototype, {\n      constructor: {\n        value: ctor,\n        enumerable: false,\n        writable: true,\n        configurable: true,\n      },\n    });\n  }\n\n  var inherits_1 = inherits;\n\n  /**\n   * A DerivedHelper is a way to create sub requests to\n   * Algolia from a main helper.\n   * @class\n   * @classdesc The DerivedHelper provides an event based interface for search callbacks:\n   *  - search: when a search is triggered using the `search()` method.\n   *  - result: when the response is retrieved from Algolia and is processed.\n   *    This event contains a {@link SearchResults} object and the\n   *    {@link SearchParameters} corresponding to this answer.\n   * @param {AlgoliaSearchHelper} mainHelper the main helper\n   * @param {function} fn the function to create the derived state for search\n   * @param {function} recommendFn the function to create the derived state for recommendations\n   */\n  function DerivedHelper(mainHelper, fn, recommendFn) {\n    this.main = mainHelper;\n    this.fn = fn;\n    this.recommendFn = recommendFn;\n    this.lastResults = null;\n    this.lastRecommendResults = null;\n  }\n\n  inherits_1(DerivedHelper, events);\n\n  /**\n   * Detach this helper from the main helper\n   * @return {undefined}\n   * @throws Error if the derived helper is already detached\n   */\n  DerivedHelper.prototype.detach = function () {\n    this.removeAllListeners();\n    this.main.detachDerivedHelper(this);\n  };\n\n  DerivedHelper.prototype.getModifiedState = function (parameters) {\n    return this.fn(parameters);\n  };\n\n  DerivedHelper.prototype.getModifiedRecommendState = function (parameters) {\n    return this.recommendFn(parameters);\n  };\n\n  var DerivedHelper_1 = DerivedHelper;\n\n  /**\n   * Replaces a leading - with \\-\n   * @private\n   * @param {any} value the facet value to replace\n   * @returns {any} the escaped facet value or the value if it was not a string\n   */\n  function escapeFacetValue$1(value) {\n    if (typeof value !== 'string') return value;\n\n    return String(value).replace(/^-/, '\\\\-');\n  }\n\n  /**\n   * Replaces a leading \\- with -\n   * @private\n   * @param {any} value the escaped facet value\n   * @returns {any} the unescaped facet value or the value if it was not a string\n   */\n  function unescapeFacetValue$1(value) {\n    if (typeof value !== 'string') return value;\n\n    return value.replace(/^\\\\-/, '-');\n  }\n\n  var escapeFacetValue_1 = {\n    escapeFacetValue: escapeFacetValue$1,\n    unescapeFacetValue: unescapeFacetValue$1,\n  };\n\n  function clone(value) {\n    if (typeof value === 'object' && value !== null) {\n      return _merge(Array.isArray(value) ? [] : {}, value);\n    }\n    return value;\n  }\n\n  function isObjectOrArrayOrFunction(value) {\n    return (\n      typeof value === 'function' ||\n      Array.isArray(value) ||\n      Object.prototype.toString.call(value) === '[object Object]'\n    );\n  }\n\n  function _merge(target, source) {\n    if (target === source) {\n      return target;\n    }\n\n    // eslint-disable-next-line no-restricted-syntax\n    for (var key in source) {\n      if (\n        !Object.prototype.hasOwnProperty.call(source, key) ||\n        key === '__proto__' ||\n        key === 'constructor'\n      ) {\n        // eslint-disable-next-line no-continue\n        continue;\n      }\n\n      var sourceVal = source[key];\n      var targetVal = target[key];\n\n      if (typeof targetVal !== 'undefined' && typeof sourceVal === 'undefined') {\n        // eslint-disable-next-line no-continue\n        continue;\n      }\n\n      if (\n        isObjectOrArrayOrFunction(targetVal) &&\n        isObjectOrArrayOrFunction(sourceVal)\n      ) {\n        target[key] = _merge(targetVal, sourceVal);\n      } else {\n        target[key] = clone(sourceVal);\n      }\n    }\n    return target;\n  }\n\n  /**\n   * This method is like Object.assign, but recursively merges own and inherited\n   * enumerable keyed properties of source objects into the destination object.\n   *\n   * NOTE: this behaves like lodash/merge, but:\n   * - does mutate functions if they are a source\n   * - treats non-plain objects as plain\n   * - does not work for circular objects\n   * - treats sparse arrays as sparse\n   * - does not convert Array-like objects (Arguments, NodeLists, etc.) to arrays\n   *\n   * @param {Object} target The destination object.\n   * @param {...Object} [sources] The source objects.\n   * @returns {Object} Returns `object`.\n   */\n  function merge(target) {\n    if (!isObjectOrArrayOrFunction(target)) {\n      target = {};\n    }\n\n    for (var i = 1, l = arguments.length; i < l; i++) {\n      var source = arguments[i];\n\n      if (isObjectOrArrayOrFunction(source)) {\n        _merge(target, source);\n      }\n    }\n    return target;\n  }\n\n  var merge_1 = merge;\n\n  function objectHasKeys(obj) {\n    return obj && Object.keys(obj).length > 0;\n  }\n\n  var objectHasKeys_1 = objectHasKeys;\n\n  // https://github.com/babel/babel/blob/3aaafae053fa75febb3aa45d45b6f00646e30ba4/packages/babel-helpers/src/helpers.js#L604-L620\n  function _objectWithoutPropertiesLoose$1(source, excluded) {\n    if (source === null) return {};\n    var target = {};\n    var sourceKeys = Object.keys(source);\n    var key;\n    var i;\n    for (i = 0; i < sourceKeys.length; i++) {\n      key = sourceKeys[i];\n      // eslint-disable-next-line no-continue\n      if (excluded.indexOf(key) >= 0) continue;\n      target[key] = source[key];\n    }\n    return target;\n  }\n\n  var omit$1 = _objectWithoutPropertiesLoose$1;\n\n  /**\n   * RecommendParameters is the data structure that contains all the information\n   * usable for getting recommendations from the Algolia API. It doesn't do the\n   * search itself, nor does it contains logic about the parameters.\n   * It is an immutable object, therefore it has been created in a way that each\n   * changes does not change the object itself but returns a copy with the\n   * modification.\n   * This object should probably not be instantiated outside of the helper. It\n   * will be provided when needed.\n   * @constructor\n   * @classdesc contains all the parameters for recommendations\n   * @param {RecommendParametersOptions} opts the options to create the object\n   */\n  function RecommendParameters(opts) {\n    opts = opts || {};\n    this.params = opts.params || [];\n  }\n\n  RecommendParameters.prototype = {\n    constructor: RecommendParameters,\n\n    addParams: function (params) {\n      var newParams = this.params.slice();\n\n      newParams.push(params);\n\n      return new RecommendParameters({ params: newParams });\n    },\n\n    removeParams: function (id) {\n      return new RecommendParameters({\n        params: this.params.filter(function (param) {\n          return param.$$id !== id;\n        }),\n      });\n    },\n\n    addFrequentlyBoughtTogether: function (params) {\n      return this.addParams(\n        Object.assign({}, params, { model: 'bought-together' })\n      );\n    },\n\n    addRelatedProducts: function (params) {\n      return this.addParams(\n        Object.assign({}, params, { model: 'related-products' })\n      );\n    },\n\n    addTrendingItems: function (params) {\n      return this.addParams(\n        Object.assign({}, params, { model: 'trending-items' })\n      );\n    },\n\n    addTrendingFacets: function (params) {\n      return this.addParams(\n        Object.assign({}, params, { model: 'trending-facets' })\n      );\n    },\n\n    addLookingSimilar: function (params) {\n      return this.addParams(\n        Object.assign({}, params, { model: 'looking-similar' })\n      );\n    },\n\n    _buildQueries: function (indexName, cache) {\n      return this.params\n        .filter(function (params) {\n          return cache[params.$$id] === undefined;\n        })\n        .map(function (params) {\n          var query = Object.assign({}, params, {\n            indexName: indexName,\n            // @TODO: remove this if it ever gets handled by the API\n            threshold: params.threshold || 0,\n          });\n          delete query.$$id;\n\n          return query;\n        });\n    },\n  };\n\n  var RecommendParameters_1 = RecommendParameters;\n\n  /**\n   * Constructor for SearchResults\n   * @class\n   * @classdesc SearchResults contains the results of a query to Algolia using the\n   * {@link AlgoliaSearchHelper}.\n   * @param {RecommendParameters} state state that led to the response\n   * @param {Record<string,RecommendResultItem>} results the results from algolia client\n   **/\n  function RecommendResults(state, results) {\n    this._state = state;\n    this._rawResults = {};\n\n    // eslint-disable-next-line consistent-this\n    var self = this;\n\n    state.params.forEach(function (param) {\n      var id = param.$$id;\n      self[id] = results[id];\n      self._rawResults[id] = results[id];\n    });\n  }\n\n  RecommendResults.prototype = {\n    constructor: RecommendResults,\n  };\n\n  var RecommendResults_1 = RecommendResults;\n\n  function sortObject(obj) {\n    return Object.keys(obj)\n      .sort()\n      .reduce(function (acc, curr) {\n        acc[curr] = obj[curr];\n        return acc;\n      }, {});\n  }\n\n  var requestBuilder = {\n    /**\n     * Get all the queries to send to the client, those queries can used directly\n     * with the Algolia client.\n     * @private\n     * @param  {string} index The name of the index\n     * @param  {SearchParameters} state The state from which to get the queries\n     * @return {object[]} The queries\n     */\n    _getQueries: function getQueries(index, state) {\n      var queries = [];\n\n      // One query for the hits\n      queries.push({\n        indexName: index,\n        params: requestBuilder._getHitsSearchParams(state),\n      });\n\n      // One for each disjunctive facets\n      state.getRefinedDisjunctiveFacets().forEach(function (refinedFacet) {\n        queries.push({\n          indexName: index,\n          params: requestBuilder._getDisjunctiveFacetSearchParams(\n            state,\n            refinedFacet\n          ),\n        });\n      });\n\n      // More to get the parent levels of the hierarchical facets when refined\n      state.getRefinedHierarchicalFacets().forEach(function (refinedFacet) {\n        var hierarchicalFacet = state.getHierarchicalFacetByName(refinedFacet);\n        var currentRefinement = state.getHierarchicalRefinement(refinedFacet);\n        var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n\n        // If we are deeper than level 0 (starting from `beer > IPA`)\n        // we want to get all parent values\n        if (\n          currentRefinement.length > 0 &&\n          currentRefinement[0].split(separator).length > 1\n        ) {\n          // We generate a map of the filters we will use for our facet values queries\n          var filtersMap = currentRefinement[0]\n            .split(separator)\n            .slice(0, -1)\n            .reduce(function createFiltersMap(map, segment, level) {\n              return map.concat({\n                attribute: hierarchicalFacet.attributes[level],\n                value:\n                  level === 0\n                    ? segment\n                    : [map[map.length - 1].value, segment].join(separator),\n              });\n            }, []);\n\n          filtersMap.forEach(function (filter, level) {\n            var params = requestBuilder._getDisjunctiveFacetSearchParams(\n              state,\n              filter.attribute,\n              level === 0\n            );\n\n            // Keep facet filters unrelated to current hierarchical attributes\n            function hasHierarchicalFacetFilter(value) {\n              return hierarchicalFacet.attributes.some(function (attribute) {\n                return attribute === value.split(':')[0];\n              });\n            }\n\n            var filteredFacetFilters = (params.facetFilters || []).reduce(\n              function (acc, facetFilter) {\n                if (Array.isArray(facetFilter)) {\n                  var filtered = facetFilter.filter(function (filterValue) {\n                    return !hasHierarchicalFacetFilter(filterValue);\n                  });\n\n                  if (filtered.length > 0) {\n                    acc.push(filtered);\n                  }\n                }\n\n                if (\n                  typeof facetFilter === 'string' &&\n                  !hasHierarchicalFacetFilter(facetFilter)\n                ) {\n                  acc.push(facetFilter);\n                }\n\n                return acc;\n              },\n              []\n            );\n\n            var parent = filtersMap[level - 1];\n            if (level > 0) {\n              params.facetFilters = filteredFacetFilters.concat(\n                parent.attribute + ':' + parent.value\n              );\n            } else if (filteredFacetFilters.length > 0) {\n              params.facetFilters = filteredFacetFilters;\n            } else {\n              delete params.facetFilters;\n            }\n\n            queries.push({ indexName: index, params: params });\n          });\n        }\n      });\n\n      return queries;\n    },\n\n    /**\n     * Get all the queries to send to the client, those queries can used directly\n     * with the Algolia client.\n     * @private\n     * @param  {SearchParameters} state The state from which to get the queries\n     * @return {object[]} The queries\n     */\n    _getCompositionQueries: function getQueries(state) {\n      return [\n        {\n          compositionID: state.index,\n          requestBody: {\n            params: requestBuilder._getCompositionHitsSearchParams(state),\n          },\n        },\n      ];\n    },\n\n    /**\n     * Build search parameters used to fetch hits\n     * @private\n     * @param  {SearchParameters} state The state from which to get the queries\n     * @return {object.<string, any>} The search parameters for hits\n     */\n    _getHitsSearchParams: function (state) {\n      var facets = state.facets\n        .concat(state.disjunctiveFacets)\n        .concat(requestBuilder._getHitsHierarchicalFacetsAttributes(state))\n        .sort();\n\n      var facetFilters = requestBuilder._getFacetFilters(state);\n      var numericFilters = requestBuilder._getNumericFilters(state);\n      var tagFilters = requestBuilder._getTagFilters(state);\n      var additionalParams = {};\n\n      if (facets.length > 0) {\n        additionalParams.facets = facets.indexOf('*') > -1 ? ['*'] : facets;\n      }\n\n      if (tagFilters.length > 0) {\n        additionalParams.tagFilters = tagFilters;\n      }\n\n      if (facetFilters.length > 0) {\n        additionalParams.facetFilters = facetFilters;\n      }\n\n      if (numericFilters.length > 0) {\n        additionalParams.numericFilters = numericFilters;\n      }\n\n      return sortObject(merge_1({}, state.getQueryParams(), additionalParams));\n    },\n\n    /**\n     * Build search parameters used to fetch hits\n     * @private\n     * @param  {SearchParameters} state The state from which to get the queries\n     * @return {object.<string, any>} The search parameters for hits\n     */\n    _getCompositionHitsSearchParams: function (state) {\n      var facets = state.facets\n        .concat(\n          state.disjunctiveFacets.map(function (value) {\n            if (\n              state.disjunctiveFacetsRefinements &&\n              state.disjunctiveFacetsRefinements[value] &&\n              state.disjunctiveFacetsRefinements[value].length > 0\n            ) {\n              // only tag a disjunctiveFacet as disjunctive if it has a value selected\n              // this helps avoid hitting the limit of 20 disjunctive facets in the Composition API\n              return 'disjunctive(' + value + ')';\n            }\n            return value;\n          })\n        )\n        .concat(requestBuilder._getHitsHierarchicalFacetsAttributes(state))\n        .sort();\n\n      var facetFilters = requestBuilder._getFacetFilters(state);\n      var numericFilters = requestBuilder._getNumericFilters(state);\n      var tagFilters = requestBuilder._getTagFilters(state);\n      var additionalParams = {};\n\n      if (facets.length > 0) {\n        additionalParams.facets = facets.indexOf('*') > -1 ? ['*'] : facets;\n      }\n\n      if (tagFilters.length > 0) {\n        additionalParams.tagFilters = tagFilters;\n      }\n\n      if (facetFilters.length > 0) {\n        additionalParams.facetFilters = facetFilters;\n      }\n\n      if (numericFilters.length > 0) {\n        additionalParams.numericFilters = numericFilters;\n      }\n\n      var params = state.getQueryParams();\n\n      delete params.highlightPreTag;\n      delete params.highlightPostTag;\n      // not a valid search parameter, it is handled in _getCompositionQueries\n      delete params.index;\n\n      return sortObject(merge_1({}, params, additionalParams));\n    },\n\n    /**\n     * Build search parameters used to fetch a disjunctive facet\n     * @private\n     * @param  {SearchParameters} state The state from which to get the queries\n     * @param  {string} facet the associated facet name\n     * @param  {boolean} hierarchicalRootLevel ?? FIXME\n     * @return {object} The search parameters for a disjunctive facet\n     */\n    _getDisjunctiveFacetSearchParams: function (\n      state,\n      facet,\n      hierarchicalRootLevel\n    ) {\n      var facetFilters = requestBuilder._getFacetFilters(\n        state,\n        facet,\n        hierarchicalRootLevel\n      );\n      var numericFilters = requestBuilder._getNumericFilters(state, facet);\n      var tagFilters = requestBuilder._getTagFilters(state);\n      var additionalParams = {\n        hitsPerPage: 0,\n        page: 0,\n        analytics: false,\n        clickAnalytics: false,\n      };\n\n      if (tagFilters.length > 0) {\n        additionalParams.tagFilters = tagFilters;\n      }\n\n      var hierarchicalFacet = state.getHierarchicalFacetByName(facet);\n\n      if (hierarchicalFacet) {\n        additionalParams.facets =\n          requestBuilder._getDisjunctiveHierarchicalFacetAttribute(\n            state,\n            hierarchicalFacet,\n            hierarchicalRootLevel\n          );\n      } else {\n        additionalParams.facets = facet;\n      }\n\n      if (numericFilters.length > 0) {\n        additionalParams.numericFilters = numericFilters;\n      }\n\n      if (facetFilters.length > 0) {\n        additionalParams.facetFilters = facetFilters;\n      }\n\n      return sortObject(merge_1({}, state.getQueryParams(), additionalParams));\n    },\n\n    /**\n     * Return the numeric filters in an algolia request fashion\n     * @private\n     * @param {SearchParameters} state the state from which to get the filters\n     * @param {string} [facetName] the name of the attribute for which the filters should be excluded\n     * @return {string[]} the numeric filters in the algolia format\n     */\n    _getNumericFilters: function (state, facetName) {\n      if (state.numericFilters) {\n        return state.numericFilters;\n      }\n\n      var numericFilters = [];\n\n      Object.keys(state.numericRefinements).forEach(function (attribute) {\n        var operators = state.numericRefinements[attribute] || {};\n        Object.keys(operators).forEach(function (operator) {\n          var values = operators[operator] || [];\n          if (facetName !== attribute) {\n            values.forEach(function (value) {\n              if (Array.isArray(value)) {\n                var vs = value.map(function (v) {\n                  return attribute + operator + v;\n                });\n                numericFilters.push(vs);\n              } else {\n                numericFilters.push(attribute + operator + value);\n              }\n            });\n          }\n        });\n      });\n\n      return numericFilters;\n    },\n\n    /**\n     * Return the tags filters depending on which format is used, either tagFilters or tagRefinements\n     * @private\n     * @param {SearchParameters} state the state from which to get the filters\n     * @return {string} Tag filters in a single string\n     */\n    _getTagFilters: function (state) {\n      if (state.tagFilters) {\n        return state.tagFilters;\n      }\n\n      return state.tagRefinements.join(',');\n    },\n\n    /**\n     * Build facetFilters parameter based on current refinements. The array returned\n     * contains strings representing the facet filters in the algolia format.\n     * @private\n     * @param  {SearchParameters} state The state from which to get the queries\n     * @param  {string} [facet] if set, the current disjunctive facet\n     * @param  {boolean} [hierarchicalRootLevel] ?? FIXME\n     * @return {array.<string>} The facet filters in the algolia format\n     */\n    _getFacetFilters: function (state, facet, hierarchicalRootLevel) {\n      var facetFilters = [];\n\n      var facetsRefinements = state.facetsRefinements || {};\n      Object.keys(facetsRefinements)\n        .sort()\n        .forEach(function (facetName) {\n          var facetValues = facetsRefinements[facetName] || [];\n          facetValues\n            .slice()\n            .sort()\n            .forEach(function (facetValue) {\n              facetFilters.push(facetName + ':' + facetValue);\n            });\n        });\n\n      var facetsExcludes = state.facetsExcludes || {};\n      Object.keys(facetsExcludes)\n        .sort()\n        .forEach(function (facetName) {\n          var facetValues = facetsExcludes[facetName] || [];\n          facetValues.sort().forEach(function (facetValue) {\n            facetFilters.push(facetName + ':-' + facetValue);\n          });\n        });\n\n      var disjunctiveFacetsRefinements = state.disjunctiveFacetsRefinements || {};\n      Object.keys(disjunctiveFacetsRefinements)\n        .sort()\n        .forEach(function (facetName) {\n          var facetValues = disjunctiveFacetsRefinements[facetName] || [];\n          if (facetName === facet || !facetValues || facetValues.length === 0) {\n            return;\n          }\n          var orFilters = [];\n\n          facetValues\n            .slice()\n            .sort()\n            .forEach(function (facetValue) {\n              orFilters.push(facetName + ':' + facetValue);\n            });\n\n          facetFilters.push(orFilters);\n        });\n\n      var hierarchicalFacetsRefinements =\n        state.hierarchicalFacetsRefinements || {};\n      Object.keys(hierarchicalFacetsRefinements)\n        .sort()\n        .forEach(function (facetName) {\n          var facetValues = hierarchicalFacetsRefinements[facetName] || [];\n          var facetValue = facetValues[0];\n\n          if (facetValue === undefined) {\n            return;\n          }\n\n          var hierarchicalFacet = state.getHierarchicalFacetByName(facetName);\n          var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n          var rootPath = state._getHierarchicalRootPath(hierarchicalFacet);\n          var attributeToRefine;\n          var attributesIndex;\n\n          // we ask for parent facet values only when the `facet` is the current hierarchical facet\n          if (facet === facetName) {\n            // if we are at the root level already, no need to ask for facet values, we get them from\n            // the hits query\n            if (\n              facetValue.indexOf(separator) === -1 ||\n              (!rootPath && hierarchicalRootLevel === true) ||\n              (rootPath &&\n                rootPath.split(separator).length ===\n                  facetValue.split(separator).length)\n            ) {\n              return;\n            }\n\n            if (!rootPath) {\n              attributesIndex = facetValue.split(separator).length - 2;\n              facetValue = facetValue.slice(0, facetValue.lastIndexOf(separator));\n            } else {\n              attributesIndex = rootPath.split(separator).length - 1;\n              facetValue = rootPath;\n            }\n\n            attributeToRefine = hierarchicalFacet.attributes[attributesIndex];\n          } else {\n            attributesIndex = facetValue.split(separator).length - 1;\n\n            attributeToRefine = hierarchicalFacet.attributes[attributesIndex];\n          }\n\n          if (attributeToRefine) {\n            facetFilters.push([attributeToRefine + ':' + facetValue]);\n          }\n        });\n\n      return facetFilters;\n    },\n\n    _getHitsHierarchicalFacetsAttributes: function (state) {\n      var out = [];\n\n      return state.hierarchicalFacets.reduce(\n        // ask for as much levels as there's hierarchical refinements\n        function getHitsAttributesForHierarchicalFacet(\n          allAttributes,\n          hierarchicalFacet\n        ) {\n          var hierarchicalRefinement = state.getHierarchicalRefinement(\n            hierarchicalFacet.name\n          )[0];\n\n          // if no refinement, ask for root level\n          if (!hierarchicalRefinement) {\n            allAttributes.push(hierarchicalFacet.attributes[0]);\n            return allAttributes;\n          }\n\n          var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n          var level = hierarchicalRefinement.split(separator).length;\n          var newAttributes = hierarchicalFacet.attributes.slice(0, level + 1);\n\n          return allAttributes.concat(newAttributes);\n        },\n        out\n      );\n    },\n\n    _getDisjunctiveHierarchicalFacetAttribute: function (\n      state,\n      hierarchicalFacet,\n      rootLevel\n    ) {\n      var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n      if (rootLevel === true) {\n        var rootPath = state._getHierarchicalRootPath(hierarchicalFacet);\n        var attributeIndex = 0;\n\n        if (rootPath) {\n          attributeIndex = rootPath.split(separator).length;\n        }\n        return [hierarchicalFacet.attributes[attributeIndex]];\n      }\n\n      var hierarchicalRefinement =\n        state.getHierarchicalRefinement(hierarchicalFacet.name)[0] || '';\n      // if refinement is 'beers > IPA > Flying dog',\n      // then we want `facets: ['beers > IPA']` as disjunctive facet (parent level values)\n\n      var parentLevel = hierarchicalRefinement.split(separator).length - 1;\n      return hierarchicalFacet.attributes.slice(0, parentLevel + 1);\n    },\n\n    getSearchForFacetQuery: function (facetName, query, maxFacetHits, state) {\n      var stateForSearchForFacetValues = state.isDisjunctiveFacet(facetName)\n        ? state.clearRefinements(facetName)\n        : state;\n      var searchForFacetSearchParameters = {\n        facetQuery: query,\n        facetName: facetName,\n      };\n      if (typeof maxFacetHits === 'number') {\n        searchForFacetSearchParameters.maxFacetHits = maxFacetHits;\n      }\n      return sortObject(\n        merge_1(\n          {},\n          requestBuilder._getHitsSearchParams(stateForSearchForFacetValues),\n          searchForFacetSearchParameters\n        )\n      );\n    },\n  };\n\n  var requestBuilder_1 = requestBuilder;\n\n  // NOTE: this behaves like lodash/defaults, but doesn't mutate the target\n  // it also preserve keys order\n  var defaultsPure = function defaultsPure() {\n    var sources = Array.prototype.slice.call(arguments);\n\n    return sources.reduceRight(function (acc, source) {\n      Object.keys(Object(source)).forEach(function (key) {\n        if (source[key] === undefined) {\n          return;\n        }\n        if (acc[key] !== undefined) {\n          // remove if already added, so that we can add it in correct order\n          delete acc[key];\n        }\n        acc[key] = source[key];\n      });\n      return acc;\n    }, {});\n  };\n\n  // @MAJOR can be replaced by native Array#find when we change support\n  var find$1 = function find(array, comparator) {\n    if (!Array.isArray(array)) {\n      return undefined;\n    }\n\n    for (var i = 0; i < array.length; i++) {\n      if (comparator(array[i])) {\n        return array[i];\n      }\n    }\n\n    return undefined;\n  };\n\n  function intersection(arr1, arr2) {\n    return arr1.filter(function (value, index) {\n      return (\n        arr2.indexOf(value) > -1 &&\n        arr1.indexOf(value) === index /* skips duplicates */\n      );\n    });\n  }\n\n  var intersection_1 = intersection;\n\n  function valToNumber(v) {\n    if (typeof v === 'number') {\n      return v;\n    } else if (typeof v === 'string') {\n      return parseFloat(v);\n    } else if (Array.isArray(v)) {\n      return v.map(valToNumber);\n    }\n\n    throw new Error(\n      'The value should be a number, a parsable string or an array of those.'\n    );\n  }\n\n  var valToNumber_1 = valToNumber;\n\n  var isValidUserToken = function isValidUserToken(userToken) {\n    if (userToken === null) {\n      return false;\n    }\n    return /^[a-zA-Z0-9_-]{1,64}$/.test(userToken);\n  };\n\n  /**\n   * Functions to manipulate refinement lists\n   *\n   * The RefinementList is not formally defined through a prototype but is based\n   * on a specific structure.\n   *\n   * @module SearchParameters.refinementList\n   *\n   * @typedef {string[]} SearchParameters.refinementList.Refinements\n   * @typedef {Object.<string, SearchParameters.refinementList.Refinements>} SearchParameters.refinementList.RefinementList\n   */\n\n\n\n\n\n  var lib = {\n    /**\n     * Adds a refinement to a RefinementList\n     * @param {RefinementList} refinementList the initial list\n     * @param {string} attribute the attribute to refine\n     * @param {string} value the value of the refinement, if the value is not a string it will be converted\n     * @return {RefinementList} a new and updated refinement list\n     */\n    addRefinement: function addRefinement(refinementList, attribute, value) {\n      if (lib.isRefined(refinementList, attribute, value)) {\n        return refinementList;\n      }\n\n      var valueAsString = '' + value;\n\n      var facetRefinement = !refinementList[attribute]\n        ? [valueAsString]\n        : refinementList[attribute].concat(valueAsString);\n\n      var mod = {};\n\n      mod[attribute] = facetRefinement;\n\n      return defaultsPure(mod, refinementList);\n    },\n    /**\n     * Removes refinement(s) for an attribute:\n     *  - if the value is specified removes the refinement for the value on the attribute\n     *  - if no value is specified removes all the refinements for this attribute\n     * @param {RefinementList} refinementList the initial list\n     * @param {string} attribute the attribute to refine\n     * @param {string} [value] the value of the refinement\n     * @return {RefinementList} a new and updated refinement lst\n     */\n    removeRefinement: function removeRefinement(\n      refinementList,\n      attribute,\n      value\n    ) {\n      if (value === undefined) {\n        // we use the \"filter\" form of clearRefinement, since it leaves empty values as-is\n        // the form with a string will remove the attribute completely\n        return lib.clearRefinement(refinementList, function (v, f) {\n          return attribute === f;\n        });\n      }\n\n      var valueAsString = '' + value;\n\n      return lib.clearRefinement(refinementList, function (v, f) {\n        return attribute === f && valueAsString === v;\n      });\n    },\n    /**\n     * Toggles the refinement value for an attribute.\n     * @param {RefinementList} refinementList the initial list\n     * @param {string} attribute the attribute to refine\n     * @param {string} value the value of the refinement\n     * @return {RefinementList} a new and updated list\n     */\n    toggleRefinement: function toggleRefinement(\n      refinementList,\n      attribute,\n      value\n    ) {\n      if (value === undefined)\n        throw new Error('toggleRefinement should be used with a value');\n\n      if (lib.isRefined(refinementList, attribute, value)) {\n        return lib.removeRefinement(refinementList, attribute, value);\n      }\n\n      return lib.addRefinement(refinementList, attribute, value);\n    },\n    /**\n     * Clear all or parts of a RefinementList. Depending on the arguments, three\n     * kinds of behavior can happen:\n     *  - if no attribute is provided: clears the whole list\n     *  - if an attribute is provided as a string: clears the list for the specific attribute\n     *  - if an attribute is provided as a function: discards the elements for which the function returns true\n     * @param {RefinementList} refinementList the initial list\n     * @param {string} [attribute] the attribute or function to discard\n     * @param {string} [refinementType] optional parameter to give more context to the attribute function\n     * @return {RefinementList} a new and updated refinement list\n     */\n    clearRefinement: function clearRefinement(\n      refinementList,\n      attribute,\n      refinementType\n    ) {\n      if (attribute === undefined) {\n        // return the same object if the list is already empty\n        // this is mainly for tests, as it doesn't have much impact on performance\n        if (!objectHasKeys_1(refinementList)) {\n          return refinementList;\n        }\n        return {};\n      } else if (typeof attribute === 'string') {\n        return omit$1(refinementList, [attribute]);\n      } else if (typeof attribute === 'function') {\n        var hasChanged = false;\n\n        var newRefinementList = Object.keys(refinementList).reduce(function (\n          memo,\n          key\n        ) {\n          var values = refinementList[key] || [];\n          var facetList = values.filter(function (value) {\n            return !attribute(value, key, refinementType);\n          });\n\n          if (facetList.length !== values.length) {\n            hasChanged = true;\n          }\n\n          memo[key] = facetList;\n\n          return memo;\n        },\n        {});\n\n        if (hasChanged) return newRefinementList;\n        return refinementList;\n      }\n\n      // We return nothing if the attribute is not undefined, a string or a function,\n      // as it is not a valid value for a refinement\n      return undefined;\n    },\n    /**\n     * Test if the refinement value is used for the attribute. If no refinement value\n     * is provided, test if the refinementList contains any refinement for the\n     * given attribute.\n     * @param {RefinementList} refinementList the list of refinement\n     * @param {string} attribute name of the attribute\n     * @param {string} [refinementValue] value of the filter/refinement\n     * @return {boolean} true if the attribute is refined, false otherwise\n     */\n    isRefined: function isRefined(refinementList, attribute, refinementValue) {\n      var containsRefinements =\n        Boolean(refinementList[attribute]) &&\n        refinementList[attribute].length > 0;\n\n      if (refinementValue === undefined || !containsRefinements) {\n        return containsRefinements;\n      }\n\n      var refinementValueAsString = '' + refinementValue;\n\n      return refinementList[attribute].indexOf(refinementValueAsString) !== -1;\n    },\n  };\n\n  var RefinementList = lib;\n\n  /**\n   * isEqual, but only for numeric refinement values, possible values:\n   * - 5\n   * - [5]\n   * - [[5]]\n   * - [[5,5],[4]]\n   * @param {any} a numeric refinement value\n   * @param {any} b numeric refinement value\n   * @return {boolean} true if the values are equal\n   */\n  function isEqualNumericRefinement(a, b) {\n    if (Array.isArray(a) && Array.isArray(b)) {\n      return (\n        a.length === b.length &&\n        a.every(function (el, i) {\n          return isEqualNumericRefinement(b[i], el);\n        })\n      );\n    }\n    return a === b;\n  }\n\n  /**\n   * like _.find but using deep equality to be able to use it\n   * to find arrays.\n   * @private\n   * @param {any[]} array array to search into (elements are base or array of base)\n   * @param {any} searchedValue the value we're looking for (base or array of base)\n   * @return {any} the searched value or undefined\n   */\n  function findArray(array, searchedValue) {\n    return find$1(array, function (currentValue) {\n      return isEqualNumericRefinement(currentValue, searchedValue);\n    });\n  }\n\n  /**\n   * The facet list is the structure used to store the list of values used to\n   * filter a single attribute.\n   * @typedef {string[]} SearchParameters.FacetList\n   */\n\n  /**\n   * Structure to store numeric filters with the operator as the key. The supported operators\n   * are `=`, `>`, `<`, `>=`, `<=` and `!=`.\n   * @typedef {Object.<string, Array.<number|number[]>>} SearchParameters.OperatorList\n   */\n\n  /**\n   * SearchParameters is the data structure that contains all the information\n   * usable for making a search to Algolia API. It doesn't do the search itself,\n   * nor does it contains logic about the parameters.\n   * It is an immutable object, therefore it has been created in a way that each\n   * changes does not change the object itself but returns a copy with the\n   * modification.\n   * This object should probably not be instantiated outside of the helper. It will\n   * be provided when needed. This object is documented for reference as you'll\n   * get it from events generated by the {@link AlgoliaSearchHelper}.\n   * If need be, instantiate the Helper from the factory function {@link SearchParameters.make}\n   * @constructor\n   * @classdesc contains all the parameters of a search\n   * @param {object|SearchParameters} newParameters existing parameters or partial object\n   * for the properties of a new SearchParameters\n   * @see SearchParameters.make\n   * @example <caption>SearchParameters of the first query in\n   *   <a href=\"http://demos.algolia.com/instant-search-demo/\">the instant search demo</a></caption>\n  {\n     \"query\": \"\",\n     \"disjunctiveFacets\": [\n        \"customerReviewCount\",\n        \"category\",\n        \"salePrice_range\",\n        \"manufacturer\"\n    ],\n     \"maxValuesPerFacet\": 30,\n     \"page\": 0,\n     \"hitsPerPage\": 10,\n     \"facets\": [\n        \"type\",\n        \"shipping\"\n    ]\n  }\n   */\n  function SearchParameters(newParameters) {\n    var params = newParameters\n      ? SearchParameters._parseNumbers(newParameters)\n      : {};\n\n    if (params.userToken !== undefined && !isValidUserToken(params.userToken)) {\n      // eslint-disable-next-line no-console\n      console.warn(\n        '[algoliasearch-helper] The `userToken` parameter is invalid. This can lead to wrong analytics.\\n  - Format: [a-zA-Z0-9_-]{1,64}'\n      );\n    }\n    /**\n     * This attribute contains the list of all the conjunctive facets\n     * used. This list will be added to requested facets in the\n     * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia.\n     * @member {string[]}\n     */\n    this.facets = params.facets || [];\n    /**\n     * This attribute contains the list of all the disjunctive facets\n     * used. This list will be added to requested facets in the\n     * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia.\n     * @member {string[]}\n     */\n    this.disjunctiveFacets = params.disjunctiveFacets || [];\n    /**\n     * This attribute contains the list of all the hierarchical facets\n     * used. This list will be added to requested facets in the\n     * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia.\n     * Hierarchical facets are a sub type of disjunctive facets that\n     * let you filter faceted attributes hierarchically.\n     * @member {string[]|object[]}\n     */\n    this.hierarchicalFacets = params.hierarchicalFacets || [];\n\n    // Refinements\n    /**\n     * This attribute contains all the filters that need to be\n     * applied on the conjunctive facets. Each facet must be properly\n     * defined in the `facets` attribute.\n     *\n     * The key is the name of the facet, and the `FacetList` contains all\n     * filters selected for the associated facet name.\n     *\n     * When querying algolia, the values stored in this attribute will\n     * be translated into the `facetFilters` attribute.\n     * @member {Object.<string, SearchParameters.FacetList>}\n     */\n    this.facetsRefinements = params.facetsRefinements || {};\n    /**\n     * This attribute contains all the filters that need to be\n     * excluded from the conjunctive facets. Each facet must be properly\n     * defined in the `facets` attribute.\n     *\n     * The key is the name of the facet, and the `FacetList` contains all\n     * filters excluded for the associated facet name.\n     *\n     * When querying algolia, the values stored in this attribute will\n     * be translated into the `facetFilters` attribute.\n     * @member {Object.<string, SearchParameters.FacetList>}\n     */\n    this.facetsExcludes = params.facetsExcludes || {};\n    /**\n     * This attribute contains all the filters that need to be\n     * applied on the disjunctive facets. Each facet must be properly\n     * defined in the `disjunctiveFacets` attribute.\n     *\n     * The key is the name of the facet, and the `FacetList` contains all\n     * filters selected for the associated facet name.\n     *\n     * When querying algolia, the values stored in this attribute will\n     * be translated into the `facetFilters` attribute.\n     * @member {Object.<string, SearchParameters.FacetList>}\n     */\n    this.disjunctiveFacetsRefinements = params.disjunctiveFacetsRefinements || {};\n    /**\n     * This attribute contains all the filters that need to be\n     * applied on the numeric attributes.\n     *\n     * The key is the name of the attribute, and the value is the\n     * filters to apply to this attribute.\n     *\n     * When querying algolia, the values stored in this attribute will\n     * be translated into the `numericFilters` attribute.\n     * @member {Object.<string, SearchParameters.OperatorList>}\n     */\n    this.numericRefinements = params.numericRefinements || {};\n    /**\n     * This attribute contains all the tags used to refine the query.\n     *\n     * When querying algolia, the values stored in this attribute will\n     * be translated into the `tagFilters` attribute.\n     * @member {string[]}\n     */\n    this.tagRefinements = params.tagRefinements || [];\n    /**\n     * This attribute contains all the filters that need to be\n     * applied on the hierarchical facets. Each facet must be properly\n     * defined in the `hierarchicalFacets` attribute.\n     *\n     * The key is the name of the facet, and the `FacetList` contains all\n     * filters selected for the associated facet name. The FacetList values\n     * are structured as a string that contain the values for each level\n     * separated by the configured separator.\n     *\n     * When querying algolia, the values stored in this attribute will\n     * be translated into the `facetFilters` attribute.\n     * @member {Object.<string, SearchParameters.FacetList>}\n     */\n    this.hierarchicalFacetsRefinements =\n      params.hierarchicalFacetsRefinements || {};\n\n    // eslint-disable-next-line consistent-this\n    var self = this;\n    Object.keys(params).forEach(function (paramName) {\n      var isKeyKnown = SearchParameters.PARAMETERS.indexOf(paramName) !== -1;\n      var isValueDefined = params[paramName] !== undefined;\n\n      if (!isKeyKnown && isValueDefined) {\n        self[paramName] = params[paramName];\n      }\n    });\n  }\n\n  /**\n   * List all the properties in SearchParameters and therefore all the known Algolia properties\n   * This doesn't contain any beta/hidden features.\n   * @private\n   */\n  SearchParameters.PARAMETERS = Object.keys(new SearchParameters());\n\n  /**\n   * @private\n   * @param {object} partialState full or part of a state\n   * @return {object} a new object with the number keys as number\n   */\n  SearchParameters._parseNumbers = function (partialState) {\n    // Do not parse numbers again in SearchParameters, they ought to be parsed already\n    if (partialState instanceof SearchParameters) return partialState;\n\n    var numbers = {};\n\n    var numberKeys = [\n      'aroundPrecision',\n      'aroundRadius',\n      'getRankingInfo',\n      'minWordSizefor2Typos',\n      'minWordSizefor1Typo',\n      'page',\n      'maxValuesPerFacet',\n      'distinct',\n      'minimumAroundRadius',\n      'hitsPerPage',\n      'minProximity',\n    ];\n\n    numberKeys.forEach(function (k) {\n      var value = partialState[k];\n      if (typeof value === 'string') {\n        var parsedValue = parseFloat(value);\n        // global isNaN is ok to use here, value is only number or NaN\n        numbers[k] = isNaN(parsedValue) ? value : parsedValue;\n      }\n    });\n\n    // there's two formats of insideBoundingBox, we need to parse\n    // the one which is an array of float geo rectangles\n    if (Array.isArray(partialState.insideBoundingBox)) {\n      numbers.insideBoundingBox = partialState.insideBoundingBox.map(function (\n        geoRect\n      ) {\n        if (Array.isArray(geoRect)) {\n          return geoRect.map(function (value) {\n            return parseFloat(value);\n          });\n        }\n        return geoRect;\n      });\n    }\n\n    if (partialState.numericRefinements) {\n      var numericRefinements = {};\n      Object.keys(partialState.numericRefinements).forEach(function (attribute) {\n        var operators = partialState.numericRefinements[attribute] || {};\n        numericRefinements[attribute] = {};\n        Object.keys(operators).forEach(function (operator) {\n          var values = operators[operator];\n          var parsedValues = values.map(function (v) {\n            if (Array.isArray(v)) {\n              return v.map(function (vPrime) {\n                if (typeof vPrime === 'string') {\n                  return parseFloat(vPrime);\n                }\n                return vPrime;\n              });\n            } else if (typeof v === 'string') {\n              return parseFloat(v);\n            }\n            return v;\n          });\n          numericRefinements[attribute][operator] = parsedValues;\n        });\n      });\n      numbers.numericRefinements = numericRefinements;\n    }\n\n    return merge_1(partialState, numbers);\n  };\n\n  /**\n   * Factory for SearchParameters\n   * @param {object|SearchParameters} newParameters existing parameters or partial\n   * object for the properties of a new SearchParameters\n   * @return {SearchParameters} frozen instance of SearchParameters\n   */\n  SearchParameters.make = function makeSearchParameters(newParameters) {\n    var instance = new SearchParameters(newParameters);\n\n    var hierarchicalFacets = newParameters.hierarchicalFacets || [];\n    hierarchicalFacets.forEach(function (facet) {\n      if (facet.rootPath) {\n        var currentRefinement = instance.getHierarchicalRefinement(facet.name);\n\n        if (\n          currentRefinement.length > 0 &&\n          currentRefinement[0].indexOf(facet.rootPath) !== 0\n        ) {\n          instance = instance.clearRefinements(facet.name);\n        }\n\n        // get it again in case it has been cleared\n        currentRefinement = instance.getHierarchicalRefinement(facet.name);\n        if (currentRefinement.length === 0) {\n          instance = instance.toggleHierarchicalFacetRefinement(\n            facet.name,\n            facet.rootPath\n          );\n        }\n      }\n    });\n\n    return instance;\n  };\n\n  /**\n   * Validates the new parameters based on the previous state\n   * @param {SearchParameters} currentState the current state\n   * @param {object|SearchParameters} parameters the new parameters to set\n   * @return {Error|null} Error if the modification is invalid, null otherwise\n   */\n  SearchParameters.validate = function (currentState, parameters) {\n    var params = parameters || {};\n\n    if (\n      currentState.tagFilters &&\n      params.tagRefinements &&\n      params.tagRefinements.length > 0\n    ) {\n      return new Error(\n        '[Tags] Cannot switch from the managed tag API to the advanced API. It is probably ' +\n          'an error, if it is really what you want, you should first clear the tags with clearTags method.'\n      );\n    }\n\n    if (currentState.tagRefinements.length > 0 && params.tagFilters) {\n      return new Error(\n        '[Tags] Cannot switch from the advanced tag API to the managed API. It is probably ' +\n          'an error, if it is not, you should first clear the tags with clearTags method.'\n      );\n    }\n\n    if (\n      currentState.numericFilters &&\n      params.numericRefinements &&\n      objectHasKeys_1(params.numericRefinements)\n    ) {\n      return new Error(\n        \"[Numeric filters] Can't switch from the advanced to the managed API. It\" +\n          ' is probably an error, if this is really what you want, you have to first' +\n          ' clear the numeric filters.'\n      );\n    }\n\n    if (objectHasKeys_1(currentState.numericRefinements) && params.numericFilters) {\n      return new Error(\n        \"[Numeric filters] Can't switch from the managed API to the advanced. It\" +\n          ' is probably an error, if this is really what you want, you have to first' +\n          ' clear the numeric filters.'\n      );\n    }\n\n    return null;\n  };\n\n  SearchParameters.prototype = {\n    constructor: SearchParameters,\n\n    /**\n     * Remove all refinements (disjunctive + conjunctive + excludes + numeric filters)\n     * @method\n     * @param {undefined|string|SearchParameters.clearCallback} [attribute] optional string or function\n     * - If not given, means to clear all the filters.\n     * - If `string`, means to clear all refinements for the `attribute` named filter.\n     * - If `function`, means to clear all the refinements that return truthy values.\n     * @return {SearchParameters} new instance with filters cleared\n     */\n    clearRefinements: function clearRefinements(attribute) {\n      var patch = {\n        numericRefinements: this._clearNumericRefinements(attribute),\n        facetsRefinements: RefinementList.clearRefinement(\n          this.facetsRefinements,\n          attribute,\n          'conjunctiveFacet'\n        ),\n        facetsExcludes: RefinementList.clearRefinement(\n          this.facetsExcludes,\n          attribute,\n          'exclude'\n        ),\n        disjunctiveFacetsRefinements: RefinementList.clearRefinement(\n          this.disjunctiveFacetsRefinements,\n          attribute,\n          'disjunctiveFacet'\n        ),\n        hierarchicalFacetsRefinements: RefinementList.clearRefinement(\n          this.hierarchicalFacetsRefinements,\n          attribute,\n          'hierarchicalFacet'\n        ),\n      };\n      if (\n        patch.numericRefinements === this.numericRefinements &&\n        patch.facetsRefinements === this.facetsRefinements &&\n        patch.facetsExcludes === this.facetsExcludes &&\n        patch.disjunctiveFacetsRefinements ===\n          this.disjunctiveFacetsRefinements &&\n        patch.hierarchicalFacetsRefinements === this.hierarchicalFacetsRefinements\n      ) {\n        return this;\n      }\n      return this.setQueryParameters(patch);\n    },\n    /**\n     * Remove all the refined tags from the SearchParameters\n     * @method\n     * @return {SearchParameters} new instance with tags cleared\n     */\n    clearTags: function clearTags() {\n      if (this.tagFilters === undefined && this.tagRefinements.length === 0)\n        return this;\n\n      return this.setQueryParameters({\n        tagFilters: undefined,\n        tagRefinements: [],\n      });\n    },\n    /**\n     * Set the index.\n     * @method\n     * @param {string} index the index name\n     * @return {SearchParameters} new instance\n     */\n    setIndex: function setIndex(index) {\n      if (index === this.index) return this;\n\n      return this.setQueryParameters({\n        index: index,\n      });\n    },\n    /**\n     * Query setter\n     * @method\n     * @param {string} newQuery value for the new query\n     * @return {SearchParameters} new instance\n     */\n    setQuery: function setQuery(newQuery) {\n      if (newQuery === this.query) return this;\n\n      return this.setQueryParameters({\n        query: newQuery,\n      });\n    },\n    /**\n     * Page setter\n     * @method\n     * @param {number} newPage new page number\n     * @return {SearchParameters} new instance\n     */\n    setPage: function setPage(newPage) {\n      if (newPage === this.page) return this;\n\n      return this.setQueryParameters({\n        page: newPage,\n      });\n    },\n    /**\n     * Facets setter\n     * The facets are the simple facets, used for conjunctive (and) faceting.\n     * @method\n     * @param {string[]} facets all the attributes of the algolia records used for conjunctive faceting\n     * @return {SearchParameters} new instance\n     */\n    setFacets: function setFacets(facets) {\n      return this.setQueryParameters({\n        facets: facets,\n      });\n    },\n    /**\n     * Disjunctive facets setter\n     * Change the list of disjunctive (or) facets the helper chan handle.\n     * @method\n     * @param {string[]} facets all the attributes of the algolia records used for disjunctive faceting\n     * @return {SearchParameters} new instance\n     */\n    setDisjunctiveFacets: function setDisjunctiveFacets(facets) {\n      return this.setQueryParameters({\n        disjunctiveFacets: facets,\n      });\n    },\n    /**\n     * HitsPerPage setter\n     * Hits per page represents the number of hits retrieved for this query\n     * @method\n     * @param {number} n number of hits retrieved per page of results\n     * @return {SearchParameters} new instance\n     */\n    setHitsPerPage: function setHitsPerPage(n) {\n      if (this.hitsPerPage === n) return this;\n\n      return this.setQueryParameters({\n        hitsPerPage: n,\n      });\n    },\n    /**\n     * typoTolerance setter\n     * Set the value of typoTolerance\n     * @method\n     * @param {string} typoTolerance new value of typoTolerance (\"true\", \"false\", \"min\" or \"strict\")\n     * @return {SearchParameters} new instance\n     */\n    setTypoTolerance: function setTypoTolerance(typoTolerance) {\n      if (this.typoTolerance === typoTolerance) return this;\n\n      return this.setQueryParameters({\n        typoTolerance: typoTolerance,\n      });\n    },\n    /**\n     * Add a numeric filter for a given attribute\n     * When value is an array, they are combined with OR\n     * When value is a single value, it will combined with AND\n     * @method\n     * @param {string} attribute attribute to set the filter on\n     * @param {string} operator operator of the filter (possible values: =, >, >=, <, <=, !=)\n     * @param {number | number[]} value value of the filter\n     * @return {SearchParameters} new instance\n     * @example\n     * // for price = 50 or 40\n     * state.addNumericRefinement('price', '=', [50, 40]);\n     * @example\n     * // for size = 38 and 40\n     * state.addNumericRefinement('size', '=', 38);\n     * state.addNumericRefinement('size', '=', 40);\n     */\n    addNumericRefinement: function (attribute, operator, value) {\n      var val = valToNumber_1(value);\n\n      if (this.isNumericRefined(attribute, operator, val)) return this;\n\n      var mod = merge_1({}, this.numericRefinements);\n\n      mod[attribute] = merge_1({}, mod[attribute]);\n\n      if (mod[attribute][operator]) {\n        // Array copy\n        mod[attribute][operator] = mod[attribute][operator].slice();\n        // Add the element. Concat can't be used here because value can be an array.\n        mod[attribute][operator].push(val);\n      } else {\n        mod[attribute][operator] = [val];\n      }\n\n      return this.setQueryParameters({\n        numericRefinements: mod,\n      });\n    },\n    /**\n     * Get the list of conjunctive refinements for a single facet\n     * @param {string} facetName name of the attribute used for faceting\n     * @return {string[]} list of refinements\n     */\n    getConjunctiveRefinements: function (facetName) {\n      if (!this.isConjunctiveFacet(facetName)) {\n        return [];\n      }\n      return this.facetsRefinements[facetName] || [];\n    },\n    /**\n     * Get the list of disjunctive refinements for a single facet\n     * @param {string} facetName name of the attribute used for faceting\n     * @return {string[]} list of refinements\n     */\n    getDisjunctiveRefinements: function (facetName) {\n      if (!this.isDisjunctiveFacet(facetName)) {\n        return [];\n      }\n      return this.disjunctiveFacetsRefinements[facetName] || [];\n    },\n    /**\n     * Get the list of hierarchical refinements for a single facet\n     * @param {string} facetName name of the attribute used for faceting\n     * @return {string[]} list of refinements\n     */\n    getHierarchicalRefinement: function (facetName) {\n      // we send an array but we currently do not support multiple\n      // hierarchicalRefinements for a hierarchicalFacet\n      return this.hierarchicalFacetsRefinements[facetName] || [];\n    },\n    /**\n     * Get the list of exclude refinements for a single facet\n     * @param {string} facetName name of the attribute used for faceting\n     * @return {string[]} list of refinements\n     */\n    getExcludeRefinements: function (facetName) {\n      if (!this.isConjunctiveFacet(facetName)) {\n        return [];\n      }\n      return this.facetsExcludes[facetName] || [];\n    },\n\n    /**\n     * Remove all the numeric filter for a given (attribute, operator)\n     * @method\n     * @param {string} attribute attribute to set the filter on\n     * @param {string} [operator] operator of the filter (possible values: =, >, >=, <, <=, !=)\n     * @param {number} [number] the value to be removed\n     * @return {SearchParameters} new instance\n     */\n    removeNumericRefinement: function (attribute, operator, number) {\n      var paramValue = number;\n      if (paramValue !== undefined) {\n        if (!this.isNumericRefined(attribute, operator, paramValue)) {\n          return this;\n        }\n        return this.setQueryParameters({\n          numericRefinements: this._clearNumericRefinements(function (\n            value,\n            key\n          ) {\n            return (\n              key === attribute &&\n              value.op === operator &&\n              isEqualNumericRefinement(value.val, valToNumber_1(paramValue))\n            );\n          }),\n        });\n      } else if (operator !== undefined) {\n        if (!this.isNumericRefined(attribute, operator)) return this;\n        return this.setQueryParameters({\n          numericRefinements: this._clearNumericRefinements(function (\n            value,\n            key\n          ) {\n            return key === attribute && value.op === operator;\n          }),\n        });\n      }\n\n      if (!this.isNumericRefined(attribute)) return this;\n      return this.setQueryParameters({\n        numericRefinements: this._clearNumericRefinements(function (value, key) {\n          return key === attribute;\n        }),\n      });\n    },\n    /**\n     * Get the list of numeric refinements for a single facet\n     * @param {string} facetName name of the attribute used for faceting\n     * @return {SearchParameters.OperatorList} list of refinements\n     */\n    getNumericRefinements: function (facetName) {\n      return this.numericRefinements[facetName] || {};\n    },\n    /**\n     * Return the current refinement for the (attribute, operator)\n     * @param {string} attribute attribute in the record\n     * @param {string} operator operator applied on the refined values\n     * @return {Array.<number|number[]>} refined values\n     */\n    getNumericRefinement: function (attribute, operator) {\n      return (\n        this.numericRefinements[attribute] &&\n        this.numericRefinements[attribute][operator]\n      );\n    },\n    /**\n     * Clear numeric filters.\n     * @method\n     * @private\n     * @param {string|SearchParameters.clearCallback} [attribute] optional string or function\n     * - If not given, means to clear all the filters.\n     * - If `string`, means to clear all refinements for the `attribute` named filter.\n     * - If `function`, means to clear all the refinements that return truthy values.\n     * @return {Object.<string, OperatorList>} new numeric refinements\n     */\n    _clearNumericRefinements: function _clearNumericRefinements(attribute) {\n      if (attribute === undefined) {\n        if (!objectHasKeys_1(this.numericRefinements)) {\n          return this.numericRefinements;\n        }\n        return {};\n      } else if (typeof attribute === 'string') {\n        return omit$1(this.numericRefinements, [attribute]);\n      } else if (typeof attribute === 'function') {\n        var hasChanged = false;\n        var numericRefinements = this.numericRefinements;\n        var newNumericRefinements = Object.keys(numericRefinements).reduce(\n          function (memo, key) {\n            var operators = numericRefinements[key];\n            var operatorList = {};\n\n            operators = operators || {};\n            Object.keys(operators).forEach(function (operator) {\n              var values = operators[operator] || [];\n              var outValues = [];\n              values.forEach(function (value) {\n                var predicateResult = attribute(\n                  { val: value, op: operator },\n                  key,\n                  'numeric'\n                );\n                if (!predicateResult) outValues.push(value);\n              });\n              if (outValues.length !== values.length) {\n                hasChanged = true;\n              }\n              operatorList[operator] = outValues;\n            });\n\n            memo[key] = operatorList;\n\n            return memo;\n          },\n          {}\n        );\n\n        if (hasChanged) return newNumericRefinements;\n        return this.numericRefinements;\n      }\n\n      // We return nothing if the attribute is not undefined, a string or a function,\n      // as it is not a valid value for a refinement\n      return undefined;\n    },\n    /**\n     * Add a facet to the facets attribute of the helper configuration, if it\n     * isn't already present.\n     * @method\n     * @param {string} facet facet name to add\n     * @return {SearchParameters} new instance\n     */\n    addFacet: function addFacet(facet) {\n      if (this.isConjunctiveFacet(facet)) {\n        return this;\n      }\n\n      return this.setQueryParameters({\n        facets: this.facets.concat([facet]),\n      });\n    },\n    /**\n     * Add a disjunctive facet to the disjunctiveFacets attribute of the helper\n     * configuration, if it isn't already present.\n     * @method\n     * @param {string} facet disjunctive facet name to add\n     * @return {SearchParameters} new instance\n     */\n    addDisjunctiveFacet: function addDisjunctiveFacet(facet) {\n      if (this.isDisjunctiveFacet(facet)) {\n        return this;\n      }\n\n      return this.setQueryParameters({\n        disjunctiveFacets: this.disjunctiveFacets.concat([facet]),\n      });\n    },\n    /**\n     * Add a hierarchical facet to the hierarchicalFacets attribute of the helper\n     * configuration.\n     * @method\n     * @param {object} hierarchicalFacet hierarchical facet to add\n     * @return {SearchParameters} new instance\n     * @throws will throw an error if a hierarchical facet with the same name was already declared\n     */\n    addHierarchicalFacet: function addHierarchicalFacet(hierarchicalFacet) {\n      if (this.isHierarchicalFacet(hierarchicalFacet.name)) {\n        throw new Error(\n          'Cannot declare two hierarchical facets with the same name: `' +\n            hierarchicalFacet.name +\n            '`'\n        );\n      }\n\n      return this.setQueryParameters({\n        hierarchicalFacets: this.hierarchicalFacets.concat([hierarchicalFacet]),\n      });\n    },\n    /**\n     * Add a refinement on a \"normal\" facet\n     * @method\n     * @param {string} facet attribute to apply the faceting on\n     * @param {string} value value of the attribute (will be converted to string)\n     * @return {SearchParameters} new instance\n     */\n    addFacetRefinement: function addFacetRefinement(facet, value) {\n      if (!this.isConjunctiveFacet(facet)) {\n        throw new Error(\n          facet +\n            ' is not defined in the facets attribute of the helper configuration'\n        );\n      }\n      if (RefinementList.isRefined(this.facetsRefinements, facet, value))\n        return this;\n\n      return this.setQueryParameters({\n        facetsRefinements: RefinementList.addRefinement(\n          this.facetsRefinements,\n          facet,\n          value\n        ),\n      });\n    },\n    /**\n     * Exclude a value from a \"normal\" facet\n     * @method\n     * @param {string} facet attribute to apply the exclusion on\n     * @param {string} value value of the attribute (will be converted to string)\n     * @return {SearchParameters} new instance\n     */\n    addExcludeRefinement: function addExcludeRefinement(facet, value) {\n      if (!this.isConjunctiveFacet(facet)) {\n        throw new Error(\n          facet +\n            ' is not defined in the facets attribute of the helper configuration'\n        );\n      }\n      if (RefinementList.isRefined(this.facetsExcludes, facet, value))\n        return this;\n\n      return this.setQueryParameters({\n        facetsExcludes: RefinementList.addRefinement(\n          this.facetsExcludes,\n          facet,\n          value\n        ),\n      });\n    },\n    /**\n     * Adds a refinement on a disjunctive facet.\n     * @method\n     * @param {string} facet attribute to apply the faceting on\n     * @param {string} value value of the attribute (will be converted to string)\n     * @return {SearchParameters} new instance\n     */\n    addDisjunctiveFacetRefinement: function addDisjunctiveFacetRefinement(\n      facet,\n      value\n    ) {\n      if (!this.isDisjunctiveFacet(facet)) {\n        throw new Error(\n          facet +\n            ' is not defined in the disjunctiveFacets attribute of the helper configuration'\n        );\n      }\n\n      if (\n        RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value)\n      )\n        return this;\n\n      return this.setQueryParameters({\n        disjunctiveFacetsRefinements: RefinementList.addRefinement(\n          this.disjunctiveFacetsRefinements,\n          facet,\n          value\n        ),\n      });\n    },\n    /**\n     * addTagRefinement adds a tag to the list used to filter the results\n     * @param {string} tag tag to be added\n     * @return {SearchParameters} new instance\n     */\n    addTagRefinement: function addTagRefinement(tag) {\n      if (this.isTagRefined(tag)) return this;\n\n      var modification = {\n        tagRefinements: this.tagRefinements.concat(tag),\n      };\n\n      return this.setQueryParameters(modification);\n    },\n    /**\n     * Remove a facet from the facets attribute of the helper configuration, if it\n     * is present.\n     * @method\n     * @param {string} facet facet name to remove\n     * @return {SearchParameters} new instance\n     */\n    removeFacet: function removeFacet(facet) {\n      if (!this.isConjunctiveFacet(facet)) {\n        return this;\n      }\n\n      return this.clearRefinements(facet).setQueryParameters({\n        facets: this.facets.filter(function (f) {\n          return f !== facet;\n        }),\n      });\n    },\n    /**\n     * Remove a disjunctive facet from the disjunctiveFacets attribute of the\n     * helper configuration, if it is present.\n     * @method\n     * @param {string} facet disjunctive facet name to remove\n     * @return {SearchParameters} new instance\n     */\n    removeDisjunctiveFacet: function removeDisjunctiveFacet(facet) {\n      if (!this.isDisjunctiveFacet(facet)) {\n        return this;\n      }\n\n      return this.clearRefinements(facet).setQueryParameters({\n        disjunctiveFacets: this.disjunctiveFacets.filter(function (f) {\n          return f !== facet;\n        }),\n      });\n    },\n    /**\n     * Remove a hierarchical facet from the hierarchicalFacets attribute of the\n     * helper configuration, if it is present.\n     * @method\n     * @param {string} facet hierarchical facet name to remove\n     * @return {SearchParameters} new instance\n     */\n    removeHierarchicalFacet: function removeHierarchicalFacet(facet) {\n      if (!this.isHierarchicalFacet(facet)) {\n        return this;\n      }\n\n      return this.clearRefinements(facet).setQueryParameters({\n        hierarchicalFacets: this.hierarchicalFacets.filter(function (f) {\n          return f.name !== facet;\n        }),\n      });\n    },\n    /**\n     * Remove a refinement set on facet. If a value is provided, it will clear the\n     * refinement for the given value, otherwise it will clear all the refinement\n     * values for the faceted attribute.\n     * @method\n     * @param {string} facet name of the attribute used for faceting\n     * @param {string} [value] value used to filter\n     * @return {SearchParameters} new instance\n     */\n    removeFacetRefinement: function removeFacetRefinement(facet, value) {\n      if (!this.isConjunctiveFacet(facet)) {\n        throw new Error(\n          facet +\n            ' is not defined in the facets attribute of the helper configuration'\n        );\n      }\n      if (!RefinementList.isRefined(this.facetsRefinements, facet, value))\n        return this;\n\n      return this.setQueryParameters({\n        facetsRefinements: RefinementList.removeRefinement(\n          this.facetsRefinements,\n          facet,\n          value\n        ),\n      });\n    },\n    /**\n     * Remove a negative refinement on a facet\n     * @method\n     * @param {string} facet name of the attribute used for faceting\n     * @param {string} value value used to filter\n     * @return {SearchParameters} new instance\n     */\n    removeExcludeRefinement: function removeExcludeRefinement(facet, value) {\n      if (!this.isConjunctiveFacet(facet)) {\n        throw new Error(\n          facet +\n            ' is not defined in the facets attribute of the helper configuration'\n        );\n      }\n      if (!RefinementList.isRefined(this.facetsExcludes, facet, value))\n        return this;\n\n      return this.setQueryParameters({\n        facetsExcludes: RefinementList.removeRefinement(\n          this.facetsExcludes,\n          facet,\n          value\n        ),\n      });\n    },\n    /**\n     * Remove a refinement on a disjunctive facet\n     * @method\n     * @param {string} facet name of the attribute used for faceting\n     * @param {string} value value used to filter\n     * @return {SearchParameters} new instance\n     */\n    removeDisjunctiveFacetRefinement: function removeDisjunctiveFacetRefinement(\n      facet,\n      value\n    ) {\n      if (!this.isDisjunctiveFacet(facet)) {\n        throw new Error(\n          facet +\n            ' is not defined in the disjunctiveFacets attribute of the helper configuration'\n        );\n      }\n      if (\n        !RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value)\n      )\n        return this;\n\n      return this.setQueryParameters({\n        disjunctiveFacetsRefinements: RefinementList.removeRefinement(\n          this.disjunctiveFacetsRefinements,\n          facet,\n          value\n        ),\n      });\n    },\n    /**\n     * Remove a tag from the list of tag refinements\n     * @method\n     * @param {string} tag the tag to remove\n     * @return {SearchParameters} new instance\n     */\n    removeTagRefinement: function removeTagRefinement(tag) {\n      if (!this.isTagRefined(tag)) return this;\n\n      var modification = {\n        tagRefinements: this.tagRefinements.filter(function (t) {\n          return t !== tag;\n        }),\n      };\n\n      return this.setQueryParameters(modification);\n    },\n    /**\n     * Generic toggle refinement method to use with facet, disjunctive facets\n     * and hierarchical facets\n     * @param  {string} facet the facet to refine\n     * @param  {string} value the associated value\n     * @return {SearchParameters} new instance\n     * @throws will throw an error if the facet is not declared in the settings of the helper\n     * @deprecated since version 2.19.0, see {@link SearchParameters#toggleFacetRefinement}\n     */\n    toggleRefinement: function toggleRefinement(facet, value) {\n      return this.toggleFacetRefinement(facet, value);\n    },\n    /**\n     * Generic toggle refinement method to use with facet, disjunctive facets\n     * and hierarchical facets\n     * @param  {string} facet the facet to refine\n     * @param  {string} value the associated value\n     * @return {SearchParameters} new instance\n     * @throws will throw an error if the facet is not declared in the settings of the helper\n     */\n    toggleFacetRefinement: function toggleFacetRefinement(facet, value) {\n      if (this.isHierarchicalFacet(facet)) {\n        return this.toggleHierarchicalFacetRefinement(facet, value);\n      } else if (this.isConjunctiveFacet(facet)) {\n        return this.toggleConjunctiveFacetRefinement(facet, value);\n      } else if (this.isDisjunctiveFacet(facet)) {\n        return this.toggleDisjunctiveFacetRefinement(facet, value);\n      }\n\n      throw new Error(\n        'Cannot refine the undeclared facet ' +\n          facet +\n          '; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets'\n      );\n    },\n    /**\n     * Switch the refinement applied over a facet/value\n     * @method\n     * @param {string} facet name of the attribute used for faceting\n     * @param {value} value value used for filtering\n     * @return {SearchParameters} new instance\n     */\n    toggleConjunctiveFacetRefinement: function toggleConjunctiveFacetRefinement(\n      facet,\n      value\n    ) {\n      if (!this.isConjunctiveFacet(facet)) {\n        throw new Error(\n          facet +\n            ' is not defined in the facets attribute of the helper configuration'\n        );\n      }\n\n      return this.setQueryParameters({\n        facetsRefinements: RefinementList.toggleRefinement(\n          this.facetsRefinements,\n          facet,\n          value\n        ),\n      });\n    },\n    /**\n     * Switch the refinement applied over a facet/value\n     * @method\n     * @param {string} facet name of the attribute used for faceting\n     * @param {value} value value used for filtering\n     * @return {SearchParameters} new instance\n     */\n    toggleExcludeFacetRefinement: function toggleExcludeFacetRefinement(\n      facet,\n      value\n    ) {\n      if (!this.isConjunctiveFacet(facet)) {\n        throw new Error(\n          facet +\n            ' is not defined in the facets attribute of the helper configuration'\n        );\n      }\n\n      return this.setQueryParameters({\n        facetsExcludes: RefinementList.toggleRefinement(\n          this.facetsExcludes,\n          facet,\n          value\n        ),\n      });\n    },\n    /**\n     * Switch the refinement applied over a facet/value\n     * @method\n     * @param {string} facet name of the attribute used for faceting\n     * @param {value} value value used for filtering\n     * @return {SearchParameters} new instance\n     */\n    toggleDisjunctiveFacetRefinement: function toggleDisjunctiveFacetRefinement(\n      facet,\n      value\n    ) {\n      if (!this.isDisjunctiveFacet(facet)) {\n        throw new Error(\n          facet +\n            ' is not defined in the disjunctiveFacets attribute of the helper configuration'\n        );\n      }\n\n      return this.setQueryParameters({\n        disjunctiveFacetsRefinements: RefinementList.toggleRefinement(\n          this.disjunctiveFacetsRefinements,\n          facet,\n          value\n        ),\n      });\n    },\n    /**\n     * Switch the refinement applied over a facet/value\n     * @method\n     * @param {string} facet name of the attribute used for faceting\n     * @param {value} value value used for filtering\n     * @return {SearchParameters} new instance\n     */\n    toggleHierarchicalFacetRefinement: function toggleHierarchicalFacetRefinement(\n      facet,\n      value\n    ) {\n      if (!this.isHierarchicalFacet(facet)) {\n        throw new Error(\n          facet +\n            ' is not defined in the hierarchicalFacets attribute of the helper configuration'\n        );\n      }\n\n      var separator = this._getHierarchicalFacetSeparator(\n        this.getHierarchicalFacetByName(facet)\n      );\n\n      var mod = {};\n\n      var upOneOrMultipleLevel =\n        this.hierarchicalFacetsRefinements[facet] !== undefined &&\n        this.hierarchicalFacetsRefinements[facet].length > 0 &&\n        // remove current refinement:\n        // refinement was 'beer > IPA', call is toggleRefine('beer > IPA'), refinement should be `beer`\n        (this.hierarchicalFacetsRefinements[facet][0] === value ||\n          // remove a parent refinement of the current refinement:\n          //  - refinement was 'beer > IPA > Flying dog'\n          //  - call is toggleRefine('beer > IPA')\n          //  - refinement should be `beer`\n          this.hierarchicalFacetsRefinements[facet][0].indexOf(\n            value + separator\n          ) === 0);\n\n      if (upOneOrMultipleLevel) {\n        if (value.indexOf(separator) === -1) {\n          // go back to root level\n          mod[facet] = [];\n        } else {\n          mod[facet] = [value.slice(0, value.lastIndexOf(separator))];\n        }\n      } else {\n        mod[facet] = [value];\n      }\n\n      return this.setQueryParameters({\n        hierarchicalFacetsRefinements: defaultsPure(\n          mod,\n          this.hierarchicalFacetsRefinements\n        ),\n      });\n    },\n\n    /**\n     * Adds a refinement on a hierarchical facet.\n     * @param {string} facet the facet name\n     * @param {string} path the hierarchical facet path\n     * @return {SearchParameter} the new state\n     * @throws Error if the facet is not defined or if the facet is refined\n     */\n    addHierarchicalFacetRefinement: function (facet, path) {\n      if (this.isHierarchicalFacetRefined(facet)) {\n        throw new Error(facet + ' is already refined.');\n      }\n      if (!this.isHierarchicalFacet(facet)) {\n        throw new Error(\n          facet +\n            ' is not defined in the hierarchicalFacets attribute of the helper configuration.'\n        );\n      }\n      var mod = {};\n      mod[facet] = [path];\n      return this.setQueryParameters({\n        hierarchicalFacetsRefinements: defaultsPure(\n          mod,\n          this.hierarchicalFacetsRefinements\n        ),\n      });\n    },\n\n    /**\n     * Removes the refinement set on a hierarchical facet.\n     * @param {string} facet the facet name\n     * @return {SearchParameter} the new state\n     * @throws Error if the facet is not defined or if the facet is not refined\n     */\n    removeHierarchicalFacetRefinement: function (facet) {\n      if (!this.isHierarchicalFacetRefined(facet)) {\n        return this;\n      }\n      var mod = {};\n      mod[facet] = [];\n      return this.setQueryParameters({\n        hierarchicalFacetsRefinements: defaultsPure(\n          mod,\n          this.hierarchicalFacetsRefinements\n        ),\n      });\n    },\n    /**\n     * Switch the tag refinement\n     * @method\n     * @param {string} tag the tag to remove or add\n     * @return {SearchParameters} new instance\n     */\n    toggleTagRefinement: function toggleTagRefinement(tag) {\n      if (this.isTagRefined(tag)) {\n        return this.removeTagRefinement(tag);\n      }\n\n      return this.addTagRefinement(tag);\n    },\n    /**\n     * Test if the facet name is from one of the disjunctive facets\n     * @method\n     * @param {string} facet facet name to test\n     * @return {boolean} true if facet is a disjunctive facet\n     */\n    isDisjunctiveFacet: function (facet) {\n      return this.disjunctiveFacets.indexOf(facet) > -1;\n    },\n    /**\n     * Test if the facet name is from one of the hierarchical facets\n     * @method\n     * @param {string} facetName facet name to test\n     * @return {boolean} true if facetName is a hierarchical facet\n     */\n    isHierarchicalFacet: function (facetName) {\n      return this.getHierarchicalFacetByName(facetName) !== undefined;\n    },\n    /**\n     * Test if the facet name is from one of the conjunctive/normal facets\n     * @method\n     * @param {string} facet facet name to test\n     * @return {boolean} true if facet is a conjunctive facet\n     */\n    isConjunctiveFacet: function (facet) {\n      return this.facets.indexOf(facet) > -1;\n    },\n    /**\n     * Returns true if the facet is refined, either for a specific value or in\n     * general.\n     * @method\n     * @param {string} facet name of the attribute for used for faceting\n     * @param {string} value, optional value. If passed will test that this value\n     * is filtering the given facet.\n     * @return {boolean} returns true if refined\n     */\n    isFacetRefined: function isFacetRefined(facet, value) {\n      if (!this.isConjunctiveFacet(facet)) {\n        return false;\n      }\n      return RefinementList.isRefined(this.facetsRefinements, facet, value);\n    },\n    /**\n     * Returns true if the facet contains exclusions or if a specific value is\n     * excluded.\n     *\n     * @method\n     * @param {string} facet name of the attribute for used for faceting\n     * @param {string} [value] optional value. If passed will test that this value\n     * is filtering the given facet.\n     * @return {boolean} returns true if refined\n     */\n    isExcludeRefined: function isExcludeRefined(facet, value) {\n      if (!this.isConjunctiveFacet(facet)) {\n        return false;\n      }\n      return RefinementList.isRefined(this.facetsExcludes, facet, value);\n    },\n    /**\n     * Returns true if the facet contains a refinement, or if a value passed is a\n     * refinement for the facet.\n     * @method\n     * @param {string} facet name of the attribute for used for faceting\n     * @param {string} value optional, will test if the value is used for refinement\n     * if there is one, otherwise will test if the facet contains any refinement\n     * @return {boolean} true if the facet is refined\n     */\n    isDisjunctiveFacetRefined: function isDisjunctiveFacetRefined(facet, value) {\n      if (!this.isDisjunctiveFacet(facet)) {\n        return false;\n      }\n      return RefinementList.isRefined(\n        this.disjunctiveFacetsRefinements,\n        facet,\n        value\n      );\n    },\n    /**\n     * Returns true if the facet contains a refinement, or if a value passed is a\n     * refinement for the facet.\n     * @method\n     * @param {string} facet name of the attribute for used for faceting\n     * @param {string} value optional, will test if the value is used for refinement\n     * if there is one, otherwise will test if the facet contains any refinement\n     * @return {boolean} true if the facet is refined\n     */\n    isHierarchicalFacetRefined: function isHierarchicalFacetRefined(\n      facet,\n      value\n    ) {\n      if (!this.isHierarchicalFacet(facet)) {\n        return false;\n      }\n\n      var refinements = this.getHierarchicalRefinement(facet);\n\n      if (!value) {\n        return refinements.length > 0;\n      }\n\n      return refinements.indexOf(value) !== -1;\n    },\n    /**\n     * Test if the triple (attribute, operator, value) is already refined.\n     * If only the attribute and the operator are provided, it tests if the\n     * contains any refinement value.\n     * @method\n     * @param {string} attribute attribute for which the refinement is applied\n     * @param {string} [operator] operator of the refinement\n     * @param {string} [value] value of the refinement\n     * @return {boolean} true if it is refined\n     */\n    isNumericRefined: function isNumericRefined(attribute, operator, value) {\n      if (value === undefined && operator === undefined) {\n        return Boolean(this.numericRefinements[attribute]);\n      }\n\n      var isOperatorDefined =\n        this.numericRefinements[attribute] &&\n        this.numericRefinements[attribute][operator] !== undefined;\n\n      if (value === undefined || !isOperatorDefined) {\n        return isOperatorDefined;\n      }\n\n      var parsedValue = valToNumber_1(value);\n      var isAttributeValueDefined =\n        findArray(this.numericRefinements[attribute][operator], parsedValue) !==\n        undefined;\n\n      return isOperatorDefined && isAttributeValueDefined;\n    },\n    /**\n     * Returns true if the tag refined, false otherwise\n     * @method\n     * @param {string} tag the tag to check\n     * @return {boolean} true if tag is refined\n     */\n    isTagRefined: function isTagRefined(tag) {\n      return this.tagRefinements.indexOf(tag) !== -1;\n    },\n    /**\n     * Returns the list of all disjunctive facets refined\n     * @method\n     * @param {string} facet name of the attribute used for faceting\n     * @param {value} value value used for filtering\n     * @return {string[]} returns the list of refinements\n     */\n    getRefinedDisjunctiveFacets: function getRefinedDisjunctiveFacets() {\n      // eslint-disable-next-line consistent-this\n      var self = this;\n\n      // attributes used for numeric filter can also be disjunctive\n      var disjunctiveNumericRefinedFacets = intersection_1(\n        Object.keys(this.numericRefinements).filter(function (facet) {\n          return Object.keys(self.numericRefinements[facet]).length > 0;\n        }),\n        this.disjunctiveFacets\n      );\n\n      return Object.keys(this.disjunctiveFacetsRefinements)\n        .filter(function (facet) {\n          return self.disjunctiveFacetsRefinements[facet].length > 0;\n        })\n        .concat(disjunctiveNumericRefinedFacets)\n        .concat(this.getRefinedHierarchicalFacets())\n        .sort();\n    },\n    /**\n     * Returns the list of all disjunctive facets refined\n     * @method\n     * @param {string} facet name of the attribute used for faceting\n     * @param {value} value value used for filtering\n     * @return {string[]} returns the list of refinements\n     */\n    getRefinedHierarchicalFacets: function getRefinedHierarchicalFacets() {\n      // eslint-disable-next-line consistent-this\n      var self = this;\n      return intersection_1(\n        // enforce the order between the two arrays,\n        // so that refinement name index === hierarchical facet index\n        this.hierarchicalFacets.map(function (facet) {\n          return facet.name;\n        }),\n        Object.keys(this.hierarchicalFacetsRefinements).filter(function (facet) {\n          return self.hierarchicalFacetsRefinements[facet].length > 0;\n        })\n      ).sort();\n    },\n    /**\n     * Returned the list of all disjunctive facets not refined\n     * @method\n     * @return {string[]} returns the list of facets that are not refined\n     */\n    getUnrefinedDisjunctiveFacets: function () {\n      var refinedFacets = this.getRefinedDisjunctiveFacets();\n\n      return this.disjunctiveFacets.filter(function (f) {\n        return refinedFacets.indexOf(f) === -1;\n      });\n    },\n\n    managedParameters: [\n      'index',\n\n      'facets',\n      'disjunctiveFacets',\n      'facetsRefinements',\n      'hierarchicalFacets',\n      'facetsExcludes',\n\n      'disjunctiveFacetsRefinements',\n      'numericRefinements',\n      'tagRefinements',\n      'hierarchicalFacetsRefinements',\n    ],\n\n    getQueryParams: function getQueryParams() {\n      var managedParameters = this.managedParameters;\n\n      var queryParams = {};\n\n      // eslint-disable-next-line consistent-this\n      var self = this;\n      Object.keys(this).forEach(function (paramName) {\n        var paramValue = self[paramName];\n        if (\n          managedParameters.indexOf(paramName) === -1 &&\n          paramValue !== undefined\n        ) {\n          queryParams[paramName] = paramValue;\n        }\n      });\n\n      return queryParams;\n    },\n    /**\n     * Let the user set a specific value for a given parameter. Will return the\n     * same instance if the parameter is invalid or if the value is the same as the\n     * previous one.\n     * @method\n     * @param {string} parameter the parameter name\n     * @param {any} value the value to be set, must be compliant with the definition\n     * of the attribute on the object\n     * @return {SearchParameters} the updated state\n     */\n    setQueryParameter: function setParameter(parameter, value) {\n      if (this[parameter] === value) return this;\n\n      var modification = {};\n\n      modification[parameter] = value;\n\n      return this.setQueryParameters(modification);\n    },\n    /**\n     * Let the user set any of the parameters with a plain object.\n     * @method\n     * @param {object} params all the keys and the values to be updated\n     * @return {SearchParameters} a new updated instance\n     */\n    setQueryParameters: function setQueryParameters(params) {\n      if (!params) return this;\n\n      var error = SearchParameters.validate(this, params);\n\n      if (error) {\n        throw error;\n      }\n\n      // eslint-disable-next-line consistent-this\n      var self = this;\n      var nextWithNumbers = SearchParameters._parseNumbers(params);\n      var previousPlainObject = Object.keys(this).reduce(function (acc, key) {\n        acc[key] = self[key];\n        return acc;\n      }, {});\n\n      var nextPlainObject = Object.keys(nextWithNumbers).reduce(function (\n        previous,\n        key\n      ) {\n        var isPreviousValueDefined = previous[key] !== undefined;\n        var isNextValueDefined = nextWithNumbers[key] !== undefined;\n\n        if (isPreviousValueDefined && !isNextValueDefined) {\n          return omit$1(previous, [key]);\n        }\n\n        if (isNextValueDefined) {\n          previous[key] = nextWithNumbers[key];\n        }\n\n        return previous;\n      },\n      previousPlainObject);\n\n      return new this.constructor(nextPlainObject);\n    },\n\n    /**\n     * Returns a new instance with the page reset. Two scenarios possible:\n     * the page is omitted -> return the given instance\n     * the page is set -> return a new instance with a page of 0\n     * @return {SearchParameters} a new updated instance\n     */\n    resetPage: function () {\n      if (this.page === undefined) {\n        return this;\n      }\n\n      return this.setPage(0);\n    },\n\n    /**\n     * Helper function to get the hierarchicalFacet separator or the default one (`>`)\n     * @param  {object} hierarchicalFacet the hierarchicalFacet object\n     * @return {string} returns the hierarchicalFacet.separator or `>` as default\n     */\n    _getHierarchicalFacetSortBy: function (hierarchicalFacet) {\n      return hierarchicalFacet.sortBy || ['isRefined:desc', 'name:asc'];\n    },\n\n    /**\n     * Helper function to get the hierarchicalFacet separator or the default one (`>`)\n     * @private\n     * @param  {object} hierarchicalFacet the hierarchicalFacet object\n     * @return {string} returns the hierarchicalFacet.separator or `>` as default\n     */\n    _getHierarchicalFacetSeparator: function (hierarchicalFacet) {\n      return hierarchicalFacet.separator || ' > ';\n    },\n\n    /**\n     * Helper function to get the hierarchicalFacet prefix path or null\n     * @private\n     * @param  {object} hierarchicalFacet the hierarchicalFacet object\n     * @return {string} returns the hierarchicalFacet.rootPath or null as default\n     */\n    _getHierarchicalRootPath: function (hierarchicalFacet) {\n      return hierarchicalFacet.rootPath || null;\n    },\n\n    /**\n     * Helper function to check if we show the parent level of the hierarchicalFacet\n     * @private\n     * @param  {object} hierarchicalFacet the hierarchicalFacet object\n     * @return {string} returns the hierarchicalFacet.showParentLevel or true as default\n     */\n    _getHierarchicalShowParentLevel: function (hierarchicalFacet) {\n      if (typeof hierarchicalFacet.showParentLevel === 'boolean') {\n        return hierarchicalFacet.showParentLevel;\n      }\n      return true;\n    },\n\n    /**\n     * Helper function to get the hierarchicalFacet by it's name\n     * @param  {string} hierarchicalFacetName the hierarchicalFacet name\n     * @return {object} a hierarchicalFacet\n     */\n    getHierarchicalFacetByName: function (hierarchicalFacetName) {\n      return find$1(this.hierarchicalFacets, function (f) {\n        return f.name === hierarchicalFacetName;\n      });\n    },\n\n    /**\n     * Get the current breadcrumb for a hierarchical facet, as an array\n     * @param  {string} facetName Hierarchical facet name\n     * @return {array.<string>} the path as an array of string\n     */\n    getHierarchicalFacetBreadcrumb: function (facetName) {\n      if (!this.isHierarchicalFacet(facetName)) {\n        return [];\n      }\n\n      var refinement = this.getHierarchicalRefinement(facetName)[0];\n      if (!refinement) return [];\n\n      var separator = this._getHierarchicalFacetSeparator(\n        this.getHierarchicalFacetByName(facetName)\n      );\n      var path = refinement.split(separator);\n      return path.map(function (part) {\n        return part.trim();\n      });\n    },\n\n    toString: function () {\n      return JSON.stringify(this, null, 2);\n    },\n  };\n\n  /**\n   * Callback used for clearRefinement method\n   * @callback SearchParameters.clearCallback\n   * @param {OperatorList|FacetList} value the value of the filter\n   * @param {string} key the current attribute name\n   * @param {string} type `numeric`, `disjunctiveFacet`, `conjunctiveFacet`, `hierarchicalFacet` or `exclude`\n   * depending on the type of facet\n   * @return {boolean} `true` if the element should be removed. `false` otherwise.\n   */\n  var SearchParameters_1 = SearchParameters;\n\n  var compact = function compact(array) {\n    if (!Array.isArray(array)) {\n      return [];\n    }\n\n    return array.filter(Boolean);\n  };\n\n  // @MAJOR can be replaced by native Array#findIndex when we change support\n  var findIndex$1 = function find(array, comparator) {\n    if (!Array.isArray(array)) {\n      return -1;\n    }\n\n    for (var i = 0; i < array.length; i++) {\n      if (comparator(array[i])) {\n        return i;\n      }\n    }\n    return -1;\n  };\n\n  /**\n   * Transform sort format from user friendly notation to lodash format\n   * @param {string[]} sortBy array of predicate of the form \"attribute:order\"\n   * @param {string[]} [defaults] array of predicate of the form \"attribute:order\"\n   * @return {array.<string[]>} array containing 2 elements : attributes, orders\n   */\n  var formatSort = function formatSort(sortBy, defaults) {\n    var defaultInstructions = (defaults || []).map(function (sort) {\n      return sort.split(':');\n    });\n\n    return sortBy.reduce(\n      function preparePredicate(out, sort) {\n        var sortInstruction = sort.split(':');\n\n        var matchingDefault = find$1(\n          defaultInstructions,\n          function (defaultInstruction) {\n            return defaultInstruction[0] === sortInstruction[0];\n          }\n        );\n\n        if (sortInstruction.length > 1 || !matchingDefault) {\n          out[0].push(sortInstruction[0]);\n          out[1].push(sortInstruction[1]);\n          return out;\n        }\n\n        out[0].push(matchingDefault[0]);\n        out[1].push(matchingDefault[1]);\n        return out;\n      },\n      [[], []]\n    );\n  };\n\n  // NOTE: this behaves like lodash/defaults, but doesn't mutate the target\n  // it also preserve keys order and keep the highest numeric value\n  function mergeNumericMax() {\n    var sources = Array.prototype.slice.call(arguments);\n\n    return sources.reduceRight(function (acc, source) {\n      Object.keys(Object(source)).forEach(function (key) {\n        var accValue = typeof acc[key] === 'number' ? acc[key] : 0;\n        var sourceValue = source[key];\n\n        if (sourceValue === undefined) {\n          return;\n        }\n\n        if (sourceValue >= accValue) {\n          if (acc[key] !== undefined) {\n            // remove if already added, so that we can add it in correct order\n            delete acc[key];\n          }\n          acc[key] = sourceValue;\n        }\n      });\n      return acc;\n    }, {});\n  }\n\n  var mergeNumericMax_1 = mergeNumericMax;\n\n  function compareAscending(value, other) {\n    if (value !== other) {\n      var valIsDefined = value !== undefined;\n      var valIsNull = value === null;\n\n      var othIsDefined = other !== undefined;\n      var othIsNull = other === null;\n\n      if (\n        (!othIsNull && value > other) ||\n        (valIsNull && othIsDefined) ||\n        !valIsDefined\n      ) {\n        return 1;\n      }\n      if (\n        (!valIsNull && value < other) ||\n        (othIsNull && valIsDefined) ||\n        !othIsDefined\n      ) {\n        return -1;\n      }\n    }\n    return 0;\n  }\n\n  /**\n   * @param {Array<object>} collection object with keys in attributes\n   * @param {Array<string>} iteratees attributes\n   * @param {Array<string>} orders asc | desc\n   * @return {Array<object>} sorted collection\n   */\n  function orderBy(collection, iteratees, orders) {\n    if (!Array.isArray(collection)) {\n      return [];\n    }\n\n    if (!Array.isArray(orders)) {\n      orders = [];\n    }\n\n    var result = collection.map(function (value, index) {\n      return {\n        criteria: iteratees.map(function (iteratee) {\n          return value[iteratee];\n        }),\n        index: index,\n        value: value,\n      };\n    });\n\n    result.sort(function comparer(object, other) {\n      var index = -1;\n\n      while (++index < object.criteria.length) {\n        var res = compareAscending(object.criteria[index], other.criteria[index]);\n        if (res) {\n          if (index >= orders.length) {\n            return res;\n          }\n          if (orders[index] === 'desc') {\n            return -res;\n          }\n          return res;\n        }\n      }\n\n      // This ensures a stable sort in V8 and other engines.\n      // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n      return object.index - other.index;\n    });\n\n    return result.map(function (res) {\n      return res.value;\n    });\n  }\n\n  var orderBy_1 = orderBy;\n\n  var generateHierarchicalTree_1 = generateTrees;\n\n\n\n\n\n  var escapeFacetValue$2 = escapeFacetValue_1.escapeFacetValue;\n  var unescapeFacetValue$2 = escapeFacetValue_1.unescapeFacetValue;\n\n  function generateTrees(state) {\n    return function generate(hierarchicalFacetResult, hierarchicalFacetIndex) {\n      var hierarchicalFacet = state.hierarchicalFacets[hierarchicalFacetIndex];\n      var hierarchicalFacetRefinement =\n        (state.hierarchicalFacetsRefinements[hierarchicalFacet.name] &&\n          state.hierarchicalFacetsRefinements[hierarchicalFacet.name][0]) ||\n        '';\n      var hierarchicalSeparator =\n        state._getHierarchicalFacetSeparator(hierarchicalFacet);\n      var hierarchicalRootPath =\n        state._getHierarchicalRootPath(hierarchicalFacet);\n      var hierarchicalShowParentLevel =\n        state._getHierarchicalShowParentLevel(hierarchicalFacet);\n      var sortBy = formatSort(\n        state._getHierarchicalFacetSortBy(hierarchicalFacet)\n      );\n\n      var rootExhaustive = hierarchicalFacetResult.every(function (facetResult) {\n        return facetResult.exhaustive;\n      });\n\n      var generateTreeFn = generateHierarchicalTree(\n        sortBy,\n        hierarchicalSeparator,\n        hierarchicalRootPath,\n        hierarchicalShowParentLevel,\n        hierarchicalFacetRefinement\n      );\n\n      var results = hierarchicalFacetResult;\n\n      if (hierarchicalRootPath) {\n        results = hierarchicalFacetResult.slice(\n          hierarchicalRootPath.split(hierarchicalSeparator).length\n        );\n      }\n\n      return results.reduce(generateTreeFn, {\n        name: state.hierarchicalFacets[hierarchicalFacetIndex].name,\n        count: null, // root level, no count\n        isRefined: true, // root level, always refined\n        path: null, // root level, no path\n        escapedValue: null,\n        exhaustive: rootExhaustive,\n        data: null,\n      });\n    };\n  }\n\n  function generateHierarchicalTree(\n    sortBy,\n    hierarchicalSeparator,\n    hierarchicalRootPath,\n    hierarchicalShowParentLevel,\n    currentRefinement\n  ) {\n    return function generateTree(\n      hierarchicalTree,\n      hierarchicalFacetResult,\n      currentHierarchicalLevel\n    ) {\n      var parent = hierarchicalTree;\n\n      if (currentHierarchicalLevel > 0) {\n        var level = 0;\n\n        parent = hierarchicalTree;\n\n        while (level < currentHierarchicalLevel) {\n          /**\n           * @type {object[]]} hierarchical data\n           */\n          var data = parent && Array.isArray(parent.data) ? parent.data : [];\n          parent = find$1(data, function (subtree) {\n            return subtree.isRefined;\n          });\n          level++;\n        }\n      }\n\n      // we found a refined parent, let's add current level data under it\n      if (parent) {\n        // filter values in case an object has multiple categories:\n        //   {\n        //     categories: {\n        //       level0: ['beers', 'bières'],\n        //       level1: ['beers > IPA', 'bières > Belges']\n        //     }\n        //   }\n        //\n        // If parent refinement is `beers`, then we do not want to have `bières > Belges`\n        // showing up\n\n        var picked = Object.keys(hierarchicalFacetResult.data)\n          .map(function (facetValue) {\n            return [facetValue, hierarchicalFacetResult.data[facetValue]];\n          })\n          .filter(function (tuple) {\n            var facetValue = tuple[0];\n            return onlyMatchingTree(\n              facetValue,\n              parent.path || hierarchicalRootPath,\n              currentRefinement,\n              hierarchicalSeparator,\n              hierarchicalRootPath,\n              hierarchicalShowParentLevel\n            );\n          });\n\n        parent.data = orderBy_1(\n          picked.map(function (tuple) {\n            var facetValue = tuple[0];\n            var facetCount = tuple[1];\n\n            return format(\n              facetCount,\n              facetValue,\n              hierarchicalSeparator,\n              unescapeFacetValue$2(currentRefinement),\n              hierarchicalFacetResult.exhaustive\n            );\n          }),\n          sortBy[0],\n          sortBy[1]\n        );\n      }\n\n      return hierarchicalTree;\n    };\n  }\n\n  // eslint-disable-next-line max-params\n  function onlyMatchingTree(\n    facetValue,\n    parentPath,\n    currentRefinement,\n    hierarchicalSeparator,\n    hierarchicalRootPath,\n    hierarchicalShowParentLevel\n  ) {\n    // we want the facetValue is a child of hierarchicalRootPath\n    if (\n      hierarchicalRootPath &&\n      (facetValue.indexOf(hierarchicalRootPath) !== 0 ||\n        hierarchicalRootPath === facetValue)\n    ) {\n      return false;\n    }\n\n    // we always want root levels (only when there is no prefix path)\n    return (\n      (!hierarchicalRootPath &&\n        facetValue.indexOf(hierarchicalSeparator) === -1) ||\n      // if there is a rootPath, being root level mean 1 level under rootPath\n      (hierarchicalRootPath &&\n        facetValue.split(hierarchicalSeparator).length -\n          hierarchicalRootPath.split(hierarchicalSeparator).length ===\n          1) ||\n      // if current refinement is a root level and current facetValue is a root level,\n      // keep the facetValue\n      (facetValue.indexOf(hierarchicalSeparator) === -1 &&\n        currentRefinement.indexOf(hierarchicalSeparator) === -1) ||\n      // currentRefinement is a child of the facet value\n      currentRefinement.indexOf(facetValue) === 0 ||\n      // facetValue is a child of the current parent, add it\n      (facetValue.indexOf(parentPath + hierarchicalSeparator) === 0 &&\n        (hierarchicalShowParentLevel ||\n          facetValue.indexOf(currentRefinement) === 0))\n    );\n  }\n\n  function format(\n    facetCount,\n    facetValue,\n    hierarchicalSeparator,\n    currentRefinement,\n    exhaustive\n  ) {\n    var parts = facetValue.split(hierarchicalSeparator);\n    return {\n      name: parts[parts.length - 1].trim(),\n      path: facetValue,\n      escapedValue: escapeFacetValue$2(facetValue),\n      count: facetCount,\n      isRefined:\n        currentRefinement === facetValue ||\n        currentRefinement.indexOf(facetValue + hierarchicalSeparator) === 0,\n      exhaustive: exhaustive,\n      data: null,\n    };\n  }\n\n  var escapeFacetValue$3 = escapeFacetValue_1.escapeFacetValue;\n  var unescapeFacetValue$3 = escapeFacetValue_1.unescapeFacetValue;\n\n\n\n  /**\n   * @typedef SearchResults.Facet\n   * @type {object}\n   * @property {string} name name of the attribute in the record\n   * @property {object} data the faceting data: value, number of entries\n   * @property {object} stats undefined unless facet_stats is retrieved from algolia\n   */\n\n  /**\n   * @typedef SearchResults.HierarchicalFacet\n   * @type {object}\n   * @property {string} name name of the current value given the hierarchical level, trimmed.\n   * If root node, you get the facet name\n   * @property {number} count number of objects matching this hierarchical value\n   * @property {string} path the current hierarchical value full path\n   * @property {boolean} isRefined `true` if the current value was refined, `false` otherwise\n   * @property {HierarchicalFacet[]} data sub values for the current level\n   */\n\n  /**\n   * @typedef SearchResults.FacetValue\n   * @type {object}\n   * @property {string} name the facet value itself\n   * @property {number} count times this facet appears in the results\n   * @property {boolean} isRefined is the facet currently selected\n   * @property {boolean} isExcluded is the facet currently excluded (only for conjunctive facets)\n   */\n\n  /**\n   * @typedef Refinement\n   * @type {object}\n   * @property {string} type the type of filter used:\n   * `numeric`, `facet`, `exclude`, `disjunctive`, `hierarchical`\n   * @property {string} attributeName name of the attribute used for filtering\n   * @property {string} name the value of the filter\n   * @property {number} numericValue the value as a number. Only for numeric filters.\n   * @property {string} operator the operator used. Only for numeric filters.\n   * @property {number} count the number of computed hits for this filter. Only on facets.\n   * @property {boolean} exhaustive if the count is exhaustive\n   */\n\n  /**\n   * Turn an array of attributes in an object of attributes with their position in the array as value\n   * @param {string[]} attributes the list of attributes in the record\n   * @return {object} the list of attributes indexed by attribute name\n   */\n  function getIndices(attributes) {\n    var indices = {};\n\n    attributes.forEach(function (val, idx) {\n      indices[val] = idx;\n    });\n\n    return indices;\n  }\n\n  function assignFacetStats(dest, facetStats, key) {\n    if (facetStats && facetStats[key]) {\n      dest.stats = facetStats[key];\n    }\n  }\n\n  /**\n   * @typedef {Object} HierarchicalFacet\n   * @property {string} name\n   * @property {string[]} attributes\n   */\n\n  /**\n   * @param {HierarchicalFacet[]} hierarchicalFacets All hierarchical facets\n   * @param {string} hierarchicalAttributeName The name of the hierarchical attribute\n   * @return {HierarchicalFacet} The hierarchical facet matching the attribute name\n   */\n  function findMatchingHierarchicalFacetFromAttributeName(\n    hierarchicalFacets,\n    hierarchicalAttributeName\n  ) {\n    return find$1(\n      hierarchicalFacets,\n      function facetKeyMatchesAttribute(hierarchicalFacet) {\n        var facetNames = hierarchicalFacet.attributes || [];\n        return facetNames.indexOf(hierarchicalAttributeName) > -1;\n      }\n    );\n  }\n\n  /**\n   * Constructor for SearchResults\n   * @class\n   * @classdesc SearchResults contains the results of a query to Algolia using the\n   * {@link AlgoliaSearchHelper}.\n   * @param {SearchParameters} state state that led to the response\n   * @param {array.<object>} results the results from algolia client\n   * @param {object} options options to control results content\n   * @example <caption>SearchResults of the first query in\n   * <a href=\"http://demos.algolia.com/instant-search-demo\">the instant search demo</a></caption>\n  {\n     \"hitsPerPage\": 10,\n     \"processingTimeMS\": 2,\n     \"facets\": [\n        {\n           \"name\": \"type\",\n           \"data\": {\n              \"HardGood\": 6627,\n              \"BlackTie\": 550,\n              \"Music\": 665,\n              \"Software\": 131,\n              \"Game\": 456,\n              \"Movie\": 1571\n           },\n           \"exhaustive\": false\n        },\n        {\n           \"exhaustive\": false,\n           \"data\": {\n              \"Free shipping\": 5507\n           },\n           \"name\": \"shipping\"\n        }\n    ],\n     \"hits\": [\n        {\n           \"thumbnailImage\": \"http://img.bbystatic.com/BestBuy_US/images/products/1688/1688832_54x108_s.gif\",\n           \"_highlightResult\": {\n              \"shortDescription\": {\n                 \"matchLevel\": \"none\",\n                 \"value\": \"Safeguard your PC, Mac, Android and iOS devices with comprehensive Internet protection\",\n                 \"matchedWords\": []\n              },\n              \"category\": {\n                 \"matchLevel\": \"none\",\n                 \"value\": \"Computer Security Software\",\n                 \"matchedWords\": []\n              },\n              \"manufacturer\": {\n                 \"matchedWords\": [],\n                 \"value\": \"Webroot\",\n                 \"matchLevel\": \"none\"\n              },\n              \"name\": {\n                 \"value\": \"Webroot SecureAnywhere Internet Security (3-Device) (1-Year Subscription) - Mac/Windows\",\n                 \"matchedWords\": [],\n                 \"matchLevel\": \"none\"\n              }\n           },\n           \"image\": \"http://img.bbystatic.com/BestBuy_US/images/products/1688/1688832_105x210_sc.jpg\",\n           \"shipping\": \"Free shipping\",\n           \"bestSellingRank\": 4,\n           \"shortDescription\": \"Safeguard your PC, Mac, Android and iOS devices with comprehensive Internet protection\",\n           \"url\": \"http://www.bestbuy.com/site/webroot-secureanywhere-internet-security-3-devi…d=1219060687969&skuId=1688832&cmp=RMX&ky=2d3GfEmNIzjA0vkzveHdZEBgpPCyMnLTJ\",\n           \"name\": \"Webroot SecureAnywhere Internet Security (3-Device) (1-Year Subscription) - Mac/Windows\",\n           \"category\": \"Computer Security Software\",\n           \"salePrice_range\": \"1 - 50\",\n           \"objectID\": \"1688832\",\n           \"type\": \"Software\",\n           \"customerReviewCount\": 5980,\n           \"salePrice\": 49.99,\n           \"manufacturer\": \"Webroot\"\n        },\n        ....\n    ],\n     \"nbHits\": 10000,\n     \"disjunctiveFacets\": [\n        {\n           \"exhaustive\": false,\n           \"data\": {\n              \"5\": 183,\n              \"12\": 112,\n              \"7\": 149,\n              ...\n           },\n           \"name\": \"customerReviewCount\",\n           \"stats\": {\n              \"max\": 7461,\n              \"avg\": 157.939,\n              \"min\": 1\n           }\n        },\n        {\n           \"data\": {\n              \"Printer Ink\": 142,\n              \"Wireless Speakers\": 60,\n              \"Point & Shoot Cameras\": 48,\n              ...\n           },\n           \"name\": \"category\",\n           \"exhaustive\": false\n        },\n        {\n           \"exhaustive\": false,\n           \"data\": {\n              \"> 5000\": 2,\n              \"1 - 50\": 6524,\n              \"501 - 2000\": 566,\n              \"201 - 500\": 1501,\n              \"101 - 200\": 1360,\n              \"2001 - 5000\": 47\n           },\n           \"name\": \"salePrice_range\"\n        },\n        {\n           \"data\": {\n              \"Dynex™\": 202,\n              \"Insignia™\": 230,\n              \"PNY\": 72,\n              ...\n           },\n           \"name\": \"manufacturer\",\n           \"exhaustive\": false\n        }\n    ],\n     \"query\": \"\",\n     \"nbPages\": 100,\n     \"page\": 0,\n     \"index\": \"bestbuy\"\n  }\n   **/\n  function SearchResults(state, results, options) {\n    var mainSubResponse = results[0] || {};\n\n    this._rawResults = results;\n\n    // eslint-disable-next-line consistent-this\n    var self = this;\n\n    // https://www.algolia.com/doc/api-reference/api-methods/search/#response\n    Object.keys(mainSubResponse).forEach(function (key) {\n      self[key] = mainSubResponse[key];\n    });\n\n    // Make every key of the result options reachable from the instance\n    var opts = defaultsPure(options, {\n      persistHierarchicalRootCount: false,\n    });\n    Object.keys(opts).forEach(function (key) {\n      self[key] = opts[key];\n    });\n\n    /**\n     * query used to generate the results\n     * @name query\n     * @member {string}\n     * @memberof SearchResults\n     * @instance\n     */\n    /**\n     * The query as parsed by the engine given all the rules.\n     * @name parsedQuery\n     * @member {string}\n     * @memberof SearchResults\n     * @instance\n     */\n    /**\n     * all the records that match the search parameters. Each record is\n     * augmented with a new attribute `_highlightResult`\n     * which is an object keyed by attribute and with the following properties:\n     * - `value` : the value of the facet highlighted (html)\n     * - `matchLevel`: `full`, `partial` or `none`, depending on how the query terms match\n     * @name hits\n     * @member {object[]}\n     * @memberof SearchResults\n     * @instance\n     */\n    /**\n     * index where the results come from\n     * @name index\n     * @member {string}\n     * @memberof SearchResults\n     * @instance\n     */\n    /**\n     * number of hits per page requested\n     * @name hitsPerPage\n     * @member {number}\n     * @memberof SearchResults\n     * @instance\n     */\n    /**\n     * total number of hits of this query on the index\n     * @name nbHits\n     * @member {number}\n     * @memberof SearchResults\n     * @instance\n     */\n    /**\n     * total number of pages with respect to the number of hits per page and the total number of hits\n     * @name nbPages\n     * @member {number}\n     * @memberof SearchResults\n     * @instance\n     */\n    /**\n     * current page\n     * @name page\n     * @member {number}\n     * @memberof SearchResults\n     * @instance\n     */\n    /**\n     * The position if the position was guessed by IP.\n     * @name aroundLatLng\n     * @member {string}\n     * @memberof SearchResults\n     * @instance\n     * @example \"48.8637,2.3615\",\n     */\n    /**\n     * The radius computed by Algolia.\n     * @name automaticRadius\n     * @member {string}\n     * @memberof SearchResults\n     * @instance\n     * @example \"126792922\",\n     */\n    /**\n     * String identifying the server used to serve this request.\n     *\n     * getRankingInfo needs to be set to `true` for this to be returned\n     *\n     * @name serverUsed\n     * @member {string}\n     * @memberof SearchResults\n     * @instance\n     * @example \"c7-use-2.algolia.net\",\n     */\n    /**\n     * Boolean that indicates if the computation of the counts did time out.\n     * @deprecated\n     * @name timeoutCounts\n     * @member {boolean}\n     * @memberof SearchResults\n     * @instance\n     */\n    /**\n     * Boolean that indicates if the computation of the hits did time out.\n     * @deprecated\n     * @name timeoutHits\n     * @member {boolean}\n     * @memberof SearchResults\n     * @instance\n     */\n    /**\n     * True if the counts of the facets is exhaustive\n     * @name exhaustiveFacetsCount\n     * @member {boolean}\n     * @memberof SearchResults\n     * @instance\n     */\n    /**\n     * True if the number of hits is exhaustive\n     * @name exhaustiveNbHits\n     * @member {boolean}\n     * @memberof SearchResults\n     * @instance\n     */\n    /**\n     * Contains the userData if they are set by a [query rule](https://www.algolia.com/doc/guides/query-rules/query-rules-overview/).\n     * @name userData\n     * @member {object[]}\n     * @memberof SearchResults\n     * @instance\n     */\n    /**\n     * queryID is the unique identifier of the query used to generate the current search results.\n     * This value is only available if the `clickAnalytics` search parameter is set to `true`.\n     * @name queryID\n     * @member {string}\n     * @memberof SearchResults\n     * @instance\n     */\n\n    /**\n     * sum of the processing time of all the queries\n     * @name processingTimeMS\n     * @member {number}\n     * @memberof SearchResults\n     * @instance\n     */\n    this.processingTimeMS = results.reduce(function (sum, result) {\n      return result.processingTimeMS === undefined\n        ? sum\n        : sum + result.processingTimeMS;\n    }, 0);\n\n    /**\n     * disjunctive facets results\n     * @member {SearchResults.Facet[]}\n     */\n    this.disjunctiveFacets = [];\n    /**\n     * disjunctive facets results\n     * @member {SearchResults.HierarchicalFacet[]}\n     */\n    this.hierarchicalFacets = state.hierarchicalFacets.map(\n      function initFutureTree() {\n        return [];\n      }\n    );\n    /**\n     * other facets results\n     * @member {SearchResults.Facet[]}\n     */\n    this.facets = [];\n\n    var disjunctiveFacets = state.getRefinedDisjunctiveFacets();\n\n    var facetsIndices = getIndices(state.facets);\n    var disjunctiveFacetsIndices = getIndices(state.disjunctiveFacets);\n    var nextDisjunctiveResult = 1;\n\n    // Since we send request only for disjunctive facets that have been refined,\n    // we get the facets information from the first, general, response.\n\n    var mainFacets = mainSubResponse.facets || {};\n\n    Object.keys(mainFacets).forEach(function (facetKey) {\n      var facetValueObject = mainFacets[facetKey];\n\n      var hierarchicalFacet = findMatchingHierarchicalFacetFromAttributeName(\n        state.hierarchicalFacets,\n        facetKey\n      );\n\n      if (hierarchicalFacet) {\n        // Place the hierarchicalFacet data at the correct index depending on\n        // the attributes order that was defined at the helper initialization\n        var facetIndex = hierarchicalFacet.attributes.indexOf(facetKey);\n        var idxAttributeName = findIndex$1(state.hierarchicalFacets, function (f) {\n          return f.name === hierarchicalFacet.name;\n        });\n        self.hierarchicalFacets[idxAttributeName][facetIndex] = {\n          attribute: facetKey,\n          data: facetValueObject,\n          exhaustive: mainSubResponse.exhaustiveFacetsCount,\n        };\n      } else {\n        var isFacetDisjunctive = state.disjunctiveFacets.indexOf(facetKey) !== -1;\n        var isFacetConjunctive = state.facets.indexOf(facetKey) !== -1;\n        var position;\n\n        if (isFacetDisjunctive) {\n          position = disjunctiveFacetsIndices[facetKey];\n          self.disjunctiveFacets[position] = {\n            name: facetKey,\n            data: facetValueObject,\n            exhaustive: mainSubResponse.exhaustiveFacetsCount,\n          };\n          assignFacetStats(\n            self.disjunctiveFacets[position],\n            mainSubResponse.facets_stats,\n            facetKey\n          );\n        }\n        if (isFacetConjunctive) {\n          position = facetsIndices[facetKey];\n          self.facets[position] = {\n            name: facetKey,\n            data: facetValueObject,\n            exhaustive: mainSubResponse.exhaustiveFacetsCount,\n          };\n          assignFacetStats(\n            self.facets[position],\n            mainSubResponse.facets_stats,\n            facetKey\n          );\n        }\n      }\n    });\n\n    // Make sure we do not keep holes within the hierarchical facets\n    this.hierarchicalFacets = compact(this.hierarchicalFacets);\n\n    // aggregate the refined disjunctive facets\n    disjunctiveFacets.forEach(function (disjunctiveFacet) {\n      var result = results[nextDisjunctiveResult];\n      var facets = result && result.facets ? result.facets : {};\n      var hierarchicalFacet = state.getHierarchicalFacetByName(disjunctiveFacet);\n\n      // There should be only item in facets.\n      Object.keys(facets).forEach(function (dfacet) {\n        var facetResults = facets[dfacet];\n\n        var position;\n\n        if (hierarchicalFacet) {\n          position = findIndex$1(state.hierarchicalFacets, function (f) {\n            return f.name === hierarchicalFacet.name;\n          });\n          var attributeIndex = findIndex$1(\n            self.hierarchicalFacets[position],\n            function (f) {\n              return f.attribute === dfacet;\n            }\n          );\n\n          // previous refinements and no results so not able to find it\n          if (attributeIndex === -1) {\n            return;\n          }\n\n          self.hierarchicalFacets[position][attributeIndex].data =\n            self.persistHierarchicalRootCount\n              ? mergeNumericMax_1(\n                  self.hierarchicalFacets[position][attributeIndex].data,\n                  facetResults\n                )\n              : defaultsPure(\n                  facetResults,\n                  self.hierarchicalFacets[position][attributeIndex].data\n                );\n        } else {\n          position = disjunctiveFacetsIndices[dfacet];\n\n          var dataFromMainRequest =\n            (mainSubResponse.facets && mainSubResponse.facets[dfacet]) || {};\n\n          self.disjunctiveFacets[position] = {\n            name: dfacet,\n            data: mergeNumericMax_1(dataFromMainRequest, facetResults),\n            exhaustive: result.exhaustiveFacetsCount,\n          };\n          assignFacetStats(\n            self.disjunctiveFacets[position],\n            result.facets_stats,\n            dfacet\n          );\n\n          if (state.disjunctiveFacetsRefinements[dfacet]) {\n            state.disjunctiveFacetsRefinements[dfacet].forEach(function (\n              refinementValue\n            ) {\n              // add the disjunctive refinements if it is no more retrieved\n              if (\n                !self.disjunctiveFacets[position].data[refinementValue] &&\n                state.disjunctiveFacetsRefinements[dfacet].indexOf(\n                  unescapeFacetValue$3(refinementValue)\n                ) > -1\n              ) {\n                self.disjunctiveFacets[position].data[refinementValue] = 0;\n              }\n            });\n          }\n        }\n      });\n      nextDisjunctiveResult++;\n    });\n\n    // if we have some parent level values for hierarchical facets, merge them\n    state.getRefinedHierarchicalFacets().forEach(function (refinedFacet) {\n      var hierarchicalFacet = state.getHierarchicalFacetByName(refinedFacet);\n      var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n\n      var currentRefinement = state.getHierarchicalRefinement(refinedFacet);\n      // if we are already at a root refinement (or no refinement at all), there is no\n      // root level values request\n      if (\n        currentRefinement.length === 0 ||\n        currentRefinement[0].split(separator).length < 2\n      ) {\n        return;\n      }\n\n      results.slice(nextDisjunctiveResult).forEach(function (result) {\n        var facets = result && result.facets ? result.facets : {};\n\n        Object.keys(facets).forEach(function (dfacet) {\n          var facetResults = facets[dfacet];\n          var position = findIndex$1(state.hierarchicalFacets, function (f) {\n            return f.name === hierarchicalFacet.name;\n          });\n          var attributeIndex = findIndex$1(\n            self.hierarchicalFacets[position],\n            function (f) {\n              return f.attribute === dfacet;\n            }\n          );\n\n          // previous refinements and no results so not able to find it\n          if (attributeIndex === -1) {\n            return;\n          }\n\n          // when we always get root levels, if the hits refinement is `beers > IPA` (count: 5),\n          // then the disjunctive values will be `beers` (count: 100),\n          // but we do not want to display\n          //   | beers (100)\n          //     > IPA (5)\n          // We want\n          //   | beers (5)\n          //     > IPA (5)\n          // @MAJOR: remove this legacy behaviour in next major version\n          var defaultData = {};\n\n          if (\n            currentRefinement.length > 0 &&\n            !self.persistHierarchicalRootCount\n          ) {\n            var root = currentRefinement[0].split(separator)[0];\n            defaultData[root] =\n              self.hierarchicalFacets[position][attributeIndex].data[root];\n          }\n\n          self.hierarchicalFacets[position][attributeIndex].data = defaultsPure(\n            defaultData,\n            facetResults,\n            self.hierarchicalFacets[position][attributeIndex].data\n          );\n        });\n\n        nextDisjunctiveResult++;\n      });\n    });\n\n    // add the excludes\n    Object.keys(state.facetsExcludes).forEach(function (facetName) {\n      var excludes = state.facetsExcludes[facetName];\n      var position = facetsIndices[facetName];\n\n      self.facets[position] = {\n        name: facetName,\n        data: mainFacets[facetName],\n        exhaustive: mainSubResponse.exhaustiveFacetsCount,\n      };\n      excludes.forEach(function (facetValue) {\n        self.facets[position] = self.facets[position] || { name: facetName };\n        self.facets[position].data = self.facets[position].data || {};\n        self.facets[position].data[facetValue] = 0;\n      });\n    });\n\n    /**\n     * @type {Array}\n     */\n    this.hierarchicalFacets = this.hierarchicalFacets.map(\n      generateHierarchicalTree_1(state)\n    );\n\n    /**\n     * @type {Array}\n     */\n    this.facets = compact(this.facets);\n    /**\n     * @type {Array}\n     */\n    this.disjunctiveFacets = compact(this.disjunctiveFacets);\n\n    this._state = state;\n  }\n\n  /**\n   * Get a facet object with its name\n   * @deprecated\n   * @param {string} name name of the faceted attribute\n   * @return {SearchResults.Facet} the facet object\n   */\n  SearchResults.prototype.getFacetByName = function (name) {\n    function predicate(facet) {\n      return facet.name === name;\n    }\n\n    return (\n      find$1(this.facets, predicate) ||\n      find$1(this.disjunctiveFacets, predicate) ||\n      find$1(this.hierarchicalFacets, predicate)\n    );\n  };\n\n  /**\n   * Get the facet values of a specified attribute from a SearchResults object.\n   * @private\n   * @param {SearchResults} results the search results to search in\n   * @param {string} attribute name of the faceted attribute to search for\n   * @return {array|object} facet values. For the hierarchical facets it is an object.\n   */\n  function extractNormalizedFacetValues(results, attribute) {\n    function predicate(facet) {\n      return facet.name === attribute;\n    }\n\n    if (results._state.isConjunctiveFacet(attribute)) {\n      var facet = find$1(results.facets, predicate);\n      if (!facet) return [];\n\n      return Object.keys(facet.data).map(function (name) {\n        var value = escapeFacetValue$3(name);\n        return {\n          name: name,\n          escapedValue: value,\n          count: facet.data[name],\n          isRefined: results._state.isFacetRefined(attribute, value),\n          isExcluded: results._state.isExcludeRefined(attribute, name),\n        };\n      });\n    } else if (results._state.isDisjunctiveFacet(attribute)) {\n      var disjunctiveFacet = find$1(results.disjunctiveFacets, predicate);\n      if (!disjunctiveFacet) return [];\n\n      return Object.keys(disjunctiveFacet.data).map(function (name) {\n        var value = escapeFacetValue$3(name);\n        return {\n          name: name,\n          escapedValue: value,\n          count: disjunctiveFacet.data[name],\n          isRefined: results._state.isDisjunctiveFacetRefined(attribute, value),\n        };\n      });\n    } else if (results._state.isHierarchicalFacet(attribute)) {\n      var hierarchicalFacetValues = find$1(results.hierarchicalFacets, predicate);\n      if (!hierarchicalFacetValues) return hierarchicalFacetValues;\n\n      var hierarchicalFacet =\n        results._state.getHierarchicalFacetByName(attribute);\n      var separator =\n        results._state._getHierarchicalFacetSeparator(hierarchicalFacet);\n      var currentRefinement = unescapeFacetValue$3(\n        results._state.getHierarchicalRefinement(attribute)[0] || ''\n      );\n\n      if (currentRefinement.indexOf(hierarchicalFacet.rootPath) === 0) {\n        currentRefinement = currentRefinement.replace(\n          hierarchicalFacet.rootPath + separator,\n          ''\n        );\n      }\n\n      var currentRefinementSplit = currentRefinement.split(separator);\n      currentRefinementSplit.unshift(attribute);\n\n      setIsRefined(hierarchicalFacetValues, currentRefinementSplit, 0);\n\n      return hierarchicalFacetValues;\n    }\n\n    return undefined;\n  }\n\n  /**\n   * Set the isRefined of a hierarchical facet result based on the current state.\n   * @param {SearchResults.HierarchicalFacet} item Hierarchical facet to fix\n   * @param {string[]} currentRefinement array of parts of the current hierarchical refinement\n   * @param {number} depth recursion depth in the currentRefinement\n   * @return {undefined} function mutates the item\n   */\n  function setIsRefined(item, currentRefinement, depth) {\n    item.isRefined =\n      item.name === (currentRefinement[depth] && currentRefinement[depth].trim());\n    if (item.data) {\n      item.data.forEach(function (child) {\n        setIsRefined(child, currentRefinement, depth + 1);\n      });\n    }\n  }\n\n  /**\n   * Sort nodes of a hierarchical or disjunctive facet results\n   * @private\n   * @param {function} sortFn sort function to apply\n   * @param {HierarchicalFacet|Array} node node upon which we want to apply the sort\n   * @param {string[]} names attribute names\n   * @param {number} [level=0] current index in the names array\n   * @return {HierarchicalFacet|Array} sorted node\n   */\n  function recSort(sortFn, node, names, level) {\n    level = level || 0;\n\n    if (Array.isArray(node)) {\n      return sortFn(node, names[level]);\n    }\n\n    if (!node.data || node.data.length === 0) {\n      return node;\n    }\n\n    var children = node.data.map(function (childNode) {\n      return recSort(sortFn, childNode, names, level + 1);\n    });\n    var sortedChildren = sortFn(children, names[level]);\n    var newNode = defaultsPure({ data: sortedChildren }, node);\n    return newNode;\n  }\n\n  SearchResults.DEFAULT_SORT = ['isRefined:desc', 'count:desc', 'name:asc'];\n\n  function vanillaSortFn(order, data) {\n    return data.sort(order);\n  }\n\n  /**\n   * @typedef FacetOrdering\n   * @type {Object}\n   * @property {string[]} [order]\n   * @property {'count' | 'alpha' | 'hidden'} [sortRemainingBy]\n   */\n\n  /**\n   * Sorts facet arrays via their facet ordering\n   * @param {Array} facetValues the values\n   * @param {FacetOrdering} facetOrdering the ordering\n   * @returns {Array} the sorted facet values\n   */\n  function sortViaFacetOrdering(facetValues, facetOrdering) {\n    var orderedFacets = [];\n    var remainingFacets = [];\n    var hide = facetOrdering.hide || [];\n    var order = facetOrdering.order || [];\n\n    /**\n     * an object with the keys being the values in order, the values their index:\n     * ['one', 'two'] -> { one: 0, two: 1 }\n     */\n    var reverseOrder = order.reduce(function (acc, name, i) {\n      acc[name] = i;\n      return acc;\n    }, {});\n\n    facetValues.forEach(function (item) {\n      // hierarchical facets get sorted using their raw name\n      var name = item.path || item.name;\n      var hidden = hide.indexOf(name) > -1;\n      if (!hidden && reverseOrder[name] !== undefined) {\n        orderedFacets[reverseOrder[name]] = item;\n      } else if (!hidden) {\n        remainingFacets.push(item);\n      }\n    });\n\n    orderedFacets = orderedFacets.filter(function (facet) {\n      return facet;\n    });\n\n    var sortRemainingBy = facetOrdering.sortRemainingBy;\n    var ordering;\n    if (sortRemainingBy === 'hidden') {\n      return orderedFacets;\n    } else if (sortRemainingBy === 'alpha') {\n      ordering = [\n        ['path', 'name'],\n        ['asc', 'asc'],\n      ];\n    } else {\n      ordering = [['count'], ['desc']];\n    }\n\n    return orderedFacets.concat(\n      orderBy_1(remainingFacets, ordering[0], ordering[1])\n    );\n  }\n\n  /**\n   * @param {SearchResults} results the search results class\n   * @param {string} attribute the attribute to retrieve ordering of\n   * @returns {FacetOrdering | undefined} the facet ordering\n   */\n  function getFacetOrdering(results, attribute) {\n    return (\n      results.renderingContent &&\n      results.renderingContent.facetOrdering &&\n      results.renderingContent.facetOrdering.values &&\n      results.renderingContent.facetOrdering.values[attribute]\n    );\n  }\n\n  /**\n   * Get a the list of values for a given facet attribute. Those values are sorted\n   * refinement first, descending count (bigger value on top), and name ascending\n   * (alphabetical order). The sort formula can overridden using either string based\n   * predicates or a function.\n   *\n   * This method will return all the values returned by the Algolia engine plus all\n   * the values already refined. This means that it can happen that the\n   * `maxValuesPerFacet` [configuration](https://www.algolia.com/doc/rest-api/search#param-maxValuesPerFacet)\n   * might not be respected if you have facet values that are already refined.\n   * @param {string} attribute attribute name\n   * @param {object} opts configuration options.\n   * @param {boolean} [opts.facetOrdering]\n   * Force the use of facetOrdering from the result if a sortBy is present. If\n   * sortBy isn't present, facetOrdering will be used automatically.\n   * @param {Array.<string> | function} opts.sortBy\n   * When using strings, it consists of\n   * the name of the [FacetValue](#SearchResults.FacetValue) or the\n   * [HierarchicalFacet](#SearchResults.HierarchicalFacet) attributes with the\n   * order (`asc` or `desc`). For example to order the value by count, the\n   * argument would be `['count:asc']`.\n   *\n   * If only the attribute name is specified, the ordering defaults to the one\n   * specified in the default value for this attribute.\n   *\n   * When not specified, the order is\n   * ascending.  This parameter can also be a function which takes two facet\n   * values and should return a number, 0 if equal, 1 if the first argument is\n   * bigger or -1 otherwise.\n   *\n   * The default value for this attribute `['isRefined:desc', 'count:desc', 'name:asc']`\n   * @return {FacetValue[]|HierarchicalFacet|undefined} depending on the type of facet of\n   * the attribute requested (hierarchical, disjunctive or conjunctive)\n   * @example\n   * helper.on('result', function(event){\n   *   //get values ordered only by name ascending using the string predicate\n   *   event.results.getFacetValues('city', {sortBy: ['name:asc']});\n   *   //get values  ordered only by count ascending using a function\n   *   event.results.getFacetValues('city', {\n   *     // this is equivalent to ['count:asc']\n   *     sortBy: function(a, b) {\n   *       if (a.count === b.count) return 0;\n   *       if (a.count > b.count)   return 1;\n   *       if (b.count > a.count)   return -1;\n   *     }\n   *   });\n   * });\n   */\n  SearchResults.prototype.getFacetValues = function (attribute, opts) {\n    var facetValues = extractNormalizedFacetValues(this, attribute);\n    if (!facetValues) {\n      return undefined;\n    }\n\n    var options = defaultsPure(opts, {\n      sortBy: SearchResults.DEFAULT_SORT,\n      // if no sortBy is given, attempt to sort based on facetOrdering\n      // if it is given, we still allow to sort via facet ordering first\n      facetOrdering: !(opts && opts.sortBy),\n    });\n\n    // eslint-disable-next-line consistent-this\n    var results = this;\n    var attributes;\n    if (Array.isArray(facetValues)) {\n      attributes = [attribute];\n    } else {\n      var config = results._state.getHierarchicalFacetByName(facetValues.name);\n      attributes = config.attributes;\n    }\n\n    return recSort(\n      function (data, facetName) {\n        if (options.facetOrdering) {\n          var facetOrdering = getFacetOrdering(results, facetName);\n          if (facetOrdering) {\n            return sortViaFacetOrdering(data, facetOrdering);\n          }\n        }\n\n        if (Array.isArray(options.sortBy)) {\n          var order = formatSort(options.sortBy, SearchResults.DEFAULT_SORT);\n          return orderBy_1(data, order[0], order[1]);\n        } else if (typeof options.sortBy === 'function') {\n          return vanillaSortFn(options.sortBy, data);\n        }\n        throw new Error(\n          'options.sortBy is optional but if defined it must be ' +\n            'either an array of string (predicates) or a sorting function'\n        );\n      },\n      facetValues,\n      attributes\n    );\n  };\n\n  /**\n   * Returns the facet stats if attribute is defined and the facet contains some.\n   * Otherwise returns undefined.\n   * @param {string} attribute name of the faceted attribute\n   * @return {object} The stats of the facet\n   */\n  SearchResults.prototype.getFacetStats = function (attribute) {\n    if (this._state.isConjunctiveFacet(attribute)) {\n      return getFacetStatsIfAvailable(this.facets, attribute);\n    } else if (this._state.isDisjunctiveFacet(attribute)) {\n      return getFacetStatsIfAvailable(this.disjunctiveFacets, attribute);\n    }\n\n    return undefined;\n  };\n\n  /**\n   * @typedef {Object} FacetListItem\n   * @property {string} name\n   */\n\n  /**\n   * @param {FacetListItem[]} facetList (has more items, but enough for here)\n   * @param {string} facetName The attribute to look for\n   * @return {object|undefined} The stats of the facet\n   */\n  function getFacetStatsIfAvailable(facetList, facetName) {\n    var data = find$1(facetList, function (facet) {\n      return facet.name === facetName;\n    });\n    return data && data.stats;\n  }\n\n  /**\n   * Returns all refinements for all filters + tags. It also provides\n   * additional information: count and exhaustiveness for each filter.\n   *\n   * See the [refinement type](#Refinement) for an exhaustive view of the available\n   * data.\n   *\n   * Note that for a numeric refinement, results are grouped per operator, this\n   * means that it will return responses for operators which are empty.\n   *\n   * @return {Array.<Refinement>} all the refinements\n   */\n  SearchResults.prototype.getRefinements = function () {\n    var state = this._state;\n    // eslint-disable-next-line consistent-this\n    var results = this;\n    var res = [];\n\n    Object.keys(state.facetsRefinements).forEach(function (attributeName) {\n      state.facetsRefinements[attributeName].forEach(function (name) {\n        res.push(\n          getRefinement$1(state, 'facet', attributeName, name, results.facets)\n        );\n      });\n    });\n\n    Object.keys(state.facetsExcludes).forEach(function (attributeName) {\n      state.facetsExcludes[attributeName].forEach(function (name) {\n        res.push(\n          getRefinement$1(state, 'exclude', attributeName, name, results.facets)\n        );\n      });\n    });\n\n    Object.keys(state.disjunctiveFacetsRefinements).forEach(function (\n      attributeName\n    ) {\n      state.disjunctiveFacetsRefinements[attributeName].forEach(function (name) {\n        res.push(\n          getRefinement$1(\n            state,\n            'disjunctive',\n            attributeName,\n            name,\n            results.disjunctiveFacets\n          )\n        );\n      });\n    });\n\n    Object.keys(state.hierarchicalFacetsRefinements).forEach(function (\n      attributeName\n    ) {\n      state.hierarchicalFacetsRefinements[attributeName].forEach(function (name) {\n        res.push(\n          getHierarchicalRefinement(\n            state,\n            attributeName,\n            name,\n            results.hierarchicalFacets\n          )\n        );\n      });\n    });\n\n    Object.keys(state.numericRefinements).forEach(function (attributeName) {\n      var operators = state.numericRefinements[attributeName];\n      Object.keys(operators).forEach(function (operator) {\n        operators[operator].forEach(function (value) {\n          res.push({\n            type: 'numeric',\n            attributeName: attributeName,\n            name: value,\n            numericValue: value,\n            operator: operator,\n          });\n        });\n      });\n    });\n\n    state.tagRefinements.forEach(function (name) {\n      res.push({ type: 'tag', attributeName: '_tags', name: name });\n    });\n\n    return res;\n  };\n\n  /**\n   * @typedef {Object} Facet\n   * @property {string} name\n   * @property {Object} data\n   * @property {boolean} exhaustive\n   */\n\n  /**\n   * @param {SearchParameters} state the current state\n   * @param {string} type the type of the refinement\n   * @param {string} attributeName The attribute of the facet\n   * @param {*} name The name of the facet\n   * @param {Facet[]} resultsFacets facets from the results\n   * @return {Refinement} the refinement\n   */\n  function getRefinement$1(state, type, attributeName, name, resultsFacets) {\n    var facet = find$1(resultsFacets, function (f) {\n      return f.name === attributeName;\n    });\n    var count = facet && facet.data && facet.data[name] ? facet.data[name] : 0;\n    var exhaustive = (facet && facet.exhaustive) || false;\n\n    return {\n      type: type,\n      attributeName: attributeName,\n      name: name,\n      count: count,\n      exhaustive: exhaustive,\n    };\n  }\n\n  /**\n   * @param {SearchParameters} state the current state\n   * @param {string} attributeName the attribute of the hierarchical facet\n   * @param {string} name the name of the facet\n   * @param {Facet[]} resultsFacets facets from the results\n   * @return {HierarchicalFacet} the hierarchical facet\n   */\n  function getHierarchicalRefinement(state, attributeName, name, resultsFacets) {\n    var facetDeclaration = state.getHierarchicalFacetByName(attributeName);\n    var separator = state._getHierarchicalFacetSeparator(facetDeclaration);\n    var split = name.split(separator);\n    var rootFacet = find$1(resultsFacets, function (facet) {\n      return facet.name === attributeName;\n    });\n\n    var facet = split.reduce(function (intermediateFacet, part) {\n      var newFacet =\n        intermediateFacet &&\n        find$1(intermediateFacet.data, function (f) {\n          return f.name === part;\n        });\n      return newFacet !== undefined ? newFacet : intermediateFacet;\n    }, rootFacet);\n\n    var count = (facet && facet.count) || 0;\n    var exhaustive = (facet && facet.exhaustive) || false;\n    var path = (facet && facet.path) || '';\n\n    return {\n      type: 'hierarchical',\n      attributeName: attributeName,\n      name: path,\n      count: count,\n      exhaustive: exhaustive,\n    };\n  }\n\n  var SearchResults_1 = SearchResults;\n\n  // @MAJOR: remove this function and use Array.prototype.flat\n  var flat = function flat(arr) {\n    return arr.reduce(function (acc, val) {\n      return acc.concat(val);\n    }, []);\n  };\n\n  function getAverageIndices(indexTracker, nrOfObjs) {\n    var avgIndices = [];\n\n    Object.keys(indexTracker).forEach(function (key) {\n      if (indexTracker[key].count < 2) {\n        indexTracker[key].indexSum += 100;\n      }\n      avgIndices.push({\n        objectID: key,\n        avgOfIndices: indexTracker[key].indexSum / nrOfObjs,\n      });\n    });\n\n    return avgIndices.sort(function (a, b) {\n      return a.avgOfIndices > b.avgOfIndices ? 1 : -1;\n    });\n  }\n\n  function sortAndMergeRecommendations(objectIDs, results) {\n    var indexTracker = {};\n\n    results.forEach(function (hits) {\n      hits.forEach(function (hit, index) {\n        if (objectIDs.includes(hit.objectID)) return;\n\n        if (!indexTracker[hit.objectID]) {\n          indexTracker[hit.objectID] = { indexSum: index, count: 1 };\n        } else {\n          indexTracker[hit.objectID] = {\n            indexSum: indexTracker[hit.objectID].indexSum + index,\n            count: indexTracker[hit.objectID].count + 1,\n          };\n        }\n      });\n    });\n\n    var sortedAverageIndices = getAverageIndices(indexTracker, results.length);\n\n    var finalOrder = sortedAverageIndices.reduce(function (\n      orderedHits,\n      avgIndexRef\n    ) {\n      var result = find$1(flat(results), function (hit) {\n        return hit.objectID === avgIndexRef.objectID;\n      });\n      return result ? orderedHits.concat(result) : orderedHits;\n    },\n    []);\n\n    return finalOrder;\n  }\n\n  var sortAndMergeRecommendations_1 = sortAndMergeRecommendations;\n\n  var version = '3.25.0';\n\n  var escapeFacetValue$4 = escapeFacetValue_1.escapeFacetValue;\n\n\n\n\n\n\n\n\n\n\n\n\n  /**\n   * Event triggered when a parameter is set or updated\n   * @event AlgoliaSearchHelper#event:change\n   * @property {object} event\n   * @property {SearchParameters} event.state the current parameters with the latest changes applied\n   * @property {SearchResults} event.results the previous results received from Algolia. `null` before the first request\n   * @example\n   * helper.on('change', function(event) {\n   *   console.log('The parameters have changed');\n   * });\n   */\n\n  /**\n   * Event triggered when a main search is sent to Algolia\n   * @event AlgoliaSearchHelper#event:search\n   * @property {object} event\n   * @property {SearchParameters} event.state the parameters used for this search\n   * @property {SearchResults} event.results the results from the previous search. `null` if it is the first search.\n   * @example\n   * helper.on('search', function(event) {\n   *   console.log('Search sent');\n   * });\n   */\n\n  /**\n   * Event triggered when a search using `searchForFacetValues` is sent to Algolia\n   * @event AlgoliaSearchHelper#event:searchForFacetValues\n   * @property {object} event\n   * @property {SearchParameters} event.state the parameters used for this search it is the first search.\n   * @property {string} event.facet the facet searched into\n   * @property {string} event.query the query used to search in the facets\n   * @example\n   * helper.on('searchForFacetValues', function(event) {\n   *   console.log('searchForFacetValues sent');\n   * });\n   */\n\n  /**\n   * Event triggered when a search using `searchOnce` is sent to Algolia\n   * @event AlgoliaSearchHelper#event:searchOnce\n   * @property {object} event\n   * @property {SearchParameters} event.state the parameters used for this search it is the first search.\n   * @example\n   * helper.on('searchOnce', function(event) {\n   *   console.log('searchOnce sent');\n   * });\n   */\n\n  /**\n   * Event triggered when the results are retrieved from Algolia\n   * @event AlgoliaSearchHelper#event:result\n   * @property {object} event\n   * @property {SearchResults} event.results the results received from Algolia\n   * @property {SearchParameters} event.state the parameters used to query Algolia. Those might be different from the one in the helper instance (for example if the network is unreliable).\n   * @example\n   * helper.on('result', function(event) {\n   *   console.log('Search results received');\n   * });\n   */\n\n  /**\n   * Event triggered when Algolia sends back an error. For example, if an unknown parameter is\n   * used, the error can be caught using this event.\n   * @event AlgoliaSearchHelper#event:error\n   * @property {object} event\n   * @property {Error} event.error the error returned by the Algolia.\n   * @example\n   * helper.on('error', function(event) {\n   *   console.log('Houston we got a problem.');\n   * });\n   */\n\n  /**\n   * Event triggered when the queue of queries have been depleted (with any result or outdated queries)\n   * @event AlgoliaSearchHelper#event:searchQueueEmpty\n   * @example\n   * helper.on('searchQueueEmpty', function() {\n   *   console.log('No more search pending');\n   *   // This is received before the result event if we're not expecting new results\n   * });\n   *\n   * helper.search();\n   */\n\n  /**\n   * Initialize a new AlgoliaSearchHelper\n   * @class\n   * @classdesc The AlgoliaSearchHelper is a class that ease the management of the\n   * search. It provides an event based interface for search callbacks:\n   *  - change: when the internal search state is changed.\n   *    This event contains a {@link SearchParameters} object and the\n   *    {@link SearchResults} of the last result if any.\n   *  - search: when a search is triggered using the `search()` method.\n   *  - result: when the response is retrieved from Algolia and is processed.\n   *    This event contains a {@link SearchResults} object and the\n   *    {@link SearchParameters} corresponding to this answer.\n   *  - error: when the response is an error. This event contains the error returned by the server.\n   * @param  {AlgoliaSearch} client an AlgoliaSearch client\n   * @param  {string} index the index name to query\n   * @param  {SearchParameters | object} options an object defining the initial\n   * config of the search. It doesn't have to be a {SearchParameters},\n   * just an object containing the properties you need from it.\n   * @param {SearchResultsOptions|object} searchResultsOptions an object defining the options to use when creating the search results.\n   */\n  function AlgoliaSearchHelper(client, index, options, searchResultsOptions) {\n    if (typeof client.addAlgoliaAgent === 'function') {\n      client.addAlgoliaAgent('JS Helper (' + version + ')');\n    }\n\n    this.setClient(client);\n    var opts = options || {};\n    opts.index = index;\n    this.state = SearchParameters_1.make(opts);\n    this.recommendState = new RecommendParameters_1({\n      params: opts.recommendState,\n    });\n    this.lastResults = null;\n    this.lastRecommendResults = null;\n    this._queryId = 0;\n    this._recommendQueryId = 0;\n    this._lastQueryIdReceived = -1;\n    this._lastRecommendQueryIdReceived = -1;\n    this.derivedHelpers = [];\n    this._currentNbQueries = 0;\n    this._currentNbRecommendQueries = 0;\n    this._searchResultsOptions = searchResultsOptions;\n    this._recommendCache = {};\n  }\n\n  inherits_1(AlgoliaSearchHelper, events);\n\n  /**\n   * Start the search with the parameters set in the state. When the\n   * method is called, it triggers a `search` event. The results will\n   * be available through the `result` event. If an error occurs, an\n   * `error` will be fired instead.\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires search\n   * @fires result\n   * @fires error\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.search = function () {\n    this._search({ onlyWithDerivedHelpers: false });\n    return this;\n  };\n\n  AlgoliaSearchHelper.prototype.searchOnlyWithDerivedHelpers = function () {\n    this._search({ onlyWithDerivedHelpers: true });\n    return this;\n  };\n\n  AlgoliaSearchHelper.prototype.searchWithComposition = function () {\n    this._runComposition({ onlyWithDerivedHelpers: true });\n    return this;\n  };\n  /**\n   * Sends the recommendation queries set in the state. When the method is\n   * called, it triggers a `fetch` event. The results will be available through\n   * the `result` event. If an error occurs, an `error` will be fired instead.\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires fetch\n   * @fires result\n   * @fires error\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.recommend = function () {\n    this._recommend();\n    return this;\n  };\n\n  /**\n   * Gets the search query parameters that would be sent to the Algolia Client\n   * for the hits\n   * @return {object} Query Parameters\n   */\n  AlgoliaSearchHelper.prototype.getQuery = function () {\n    var state = this.state;\n    return requestBuilder_1._getHitsSearchParams(state);\n  };\n\n  /**\n   * Start a search using a modified version of the current state. This method does\n   * not trigger the helper lifecycle and does not modify the state kept internally\n   * by the helper. This second aspect means that the next search call will be the\n   * same as a search call before calling searchOnce.\n   * @param {object} options can contain all the parameters that can be set to SearchParameters\n   * plus the index\n   * @param {function} [cb] optional callback executed when the response from the\n   * server is back.\n   * @return {promise|undefined} if a callback is passed the method returns undefined\n   * otherwise it returns a promise containing an object with two keys :\n   *  - content with a SearchResults\n   *  - state with the state used for the query as a SearchParameters\n   * @example\n   * // Changing the number of records returned per page to 1\n   * // This example uses the callback API\n   * var state = helper.searchOnce({hitsPerPage: 1},\n   *   function(error, content, state) {\n   *     // if an error occurred it will be passed in error, otherwise its value is null\n   *     // content contains the results formatted as a SearchResults\n   *     // state is the instance of SearchParameters used for this search\n   *   });\n   * @example\n   * // Changing the number of records returned per page to 1\n   * // This example uses the promise API\n   * var state1 = helper.searchOnce({hitsPerPage: 1})\n   *                 .then(promiseHandler);\n   *\n   * function promiseHandler(res) {\n   *   // res contains\n   *   // {\n   *   //   content : SearchResults\n   *   //   state   : SearchParameters (the one used for this specific search)\n   *   // }\n   * }\n   */\n  AlgoliaSearchHelper.prototype.searchOnce = function (options, cb) {\n    var tempState = !options\n      ? this.state\n      : this.state.setQueryParameters(options);\n    var queries = requestBuilder_1._getQueries(tempState.index, tempState);\n    // eslint-disable-next-line consistent-this\n    var self = this;\n\n    this._currentNbQueries++;\n\n    this.emit('searchOnce', {\n      state: tempState,\n    });\n\n    if (cb) {\n      this.client\n        .search(queries)\n        .then(function (content) {\n          self._currentNbQueries--;\n          if (self._currentNbQueries === 0) {\n            self.emit('searchQueueEmpty');\n          }\n\n          cb(null, new SearchResults_1(tempState, content.results), tempState);\n        })\n        .catch(function (err) {\n          self._currentNbQueries--;\n          if (self._currentNbQueries === 0) {\n            self.emit('searchQueueEmpty');\n          }\n\n          cb(err, null, tempState);\n        });\n\n      return undefined;\n    }\n\n    return this.client.search(queries).then(\n      function (content) {\n        self._currentNbQueries--;\n        if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n        return {\n          content: new SearchResults_1(tempState, content.results),\n          state: tempState,\n          _originalResponse: content,\n        };\n      },\n      function (e) {\n        self._currentNbQueries--;\n        if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n        throw e;\n      }\n    );\n  };\n\n  /**\n   * Start the search for answers with the parameters set in the state.\n   * This method returns a promise.\n   * @param {Object} options - the options for answers API call\n   * @param {string[]} options.attributesForPrediction - Attributes to use for predictions. If empty, `searchableAttributes` is used instead.\n   * @param {string[]} options.queryLanguages - The languages in the query. Currently only supports ['en'].\n   * @param {number} options.nbHits - Maximum number of answers to retrieve from the Answers Engine. Cannot be greater than 1000.\n   *\n   * @return {promise} the answer results\n   * @deprecated answers is deprecated and will be replaced with new initiatives\n   */\n  AlgoliaSearchHelper.prototype.findAnswers = function (options) {\n    // eslint-disable-next-line no-console\n    console.warn('[algoliasearch-helper] answers is no longer supported');\n    var state = this.state;\n    var derivedHelper = this.derivedHelpers[0];\n    if (!derivedHelper) {\n      return Promise.resolve([]);\n    }\n    var derivedState = derivedHelper.getModifiedState(state);\n    var data = merge_1(\n      {\n        attributesForPrediction: options.attributesForPrediction,\n        nbHits: options.nbHits,\n      },\n      {\n        params: omit$1(requestBuilder_1._getHitsSearchParams(derivedState), [\n          'attributesToSnippet',\n          'hitsPerPage',\n          'restrictSearchableAttributes',\n          'snippetEllipsisText',\n        ]),\n      }\n    );\n\n    var errorMessage =\n      'search for answers was called, but this client does not have a function client.initIndex(index).findAnswers';\n    if (typeof this.client.initIndex !== 'function') {\n      throw new Error(errorMessage);\n    }\n    var index = this.client.initIndex(derivedState.index);\n    if (typeof index.findAnswers !== 'function') {\n      throw new Error(errorMessage);\n    }\n    return index.findAnswers(derivedState.query, options.queryLanguages, data);\n  };\n\n  /**\n   * Structure of each result when using\n   * [`searchForFacetValues()`](reference.html#AlgoliaSearchHelper#searchForFacetValues)\n   * @typedef FacetSearchHit\n   * @type {object}\n   * @property {string} value the facet value\n   * @property {string} highlighted the facet value highlighted with the query string\n   * @property {number} count number of occurrence of this facet value\n   * @property {boolean} isRefined true if the value is already refined\n   */\n\n  /**\n   * Structure of the data resolved by the\n   * [`searchForFacetValues()`](reference.html#AlgoliaSearchHelper#searchForFacetValues)\n   * promise.\n   * @typedef FacetSearchResult\n   * @type {object}\n   * @property {FacetSearchHit} facetHits the results for this search for facet values\n   * @property {number} processingTimeMS time taken by the query inside the engine\n   */\n\n  /**\n   * Search for facet values based on an query and the name of a faceted attribute. This\n   * triggers a search and will return a promise. On top of using the query, it also sends\n   * the parameters from the state so that the search is narrowed down to only the possible values.\n   *\n   * See the description of [FacetSearchResult](reference.html#FacetSearchResult)\n   * @param {string} facet the name of the faceted attribute\n   * @param {string} query the string query for the search\n   * @param {number} [maxFacetHits] the maximum number values returned. Should be > 0 and <= 100\n   * @param {object} [userState] the set of custom parameters to use on top of the current state. Setting a property to `undefined` removes\n   * it in the generated query.\n   * @return {promise.<FacetSearchResult>} the results of the search\n   */\n  AlgoliaSearchHelper.prototype.searchForFacetValues = function (\n    facet,\n    query,\n    maxFacetHits,\n    userState\n  ) {\n    var clientHasSFFV =\n      typeof this.client.searchForFacetValues === 'function' &&\n      // v5 has a wrong sffv signature\n      typeof this.client.searchForFacets !== 'function';\n    var clientHasInitIndex = typeof this.client.initIndex === 'function';\n    if (\n      !clientHasSFFV &&\n      !clientHasInitIndex &&\n      typeof this.client.search !== 'function'\n    ) {\n      throw new Error(\n        'search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues'\n      );\n    }\n\n    var state = this.state.setQueryParameters(userState || {});\n    var isDisjunctive = state.isDisjunctiveFacet(facet);\n    var algoliaQuery = requestBuilder_1.getSearchForFacetQuery(\n      facet,\n      query,\n      maxFacetHits,\n      state\n    );\n\n    this._currentNbQueries++;\n    // eslint-disable-next-line consistent-this\n    var self = this;\n    var searchForFacetValuesPromise;\n    // newer algoliasearch ^3.27.1 - ~4.0.0\n    if (clientHasSFFV) {\n      searchForFacetValuesPromise = this.client.searchForFacetValues([\n        { indexName: state.index, params: algoliaQuery },\n      ]);\n      // algoliasearch < 3.27.1\n    } else if (clientHasInitIndex) {\n      searchForFacetValuesPromise = this.client\n        .initIndex(state.index)\n        .searchForFacetValues(algoliaQuery);\n      // algoliasearch ~5.0.0\n    } else {\n      // @MAJOR only use client.search\n      delete algoliaQuery.facetName;\n      searchForFacetValuesPromise = this.client\n        .search([\n          {\n            type: 'facet',\n            facet: facet,\n            indexName: state.index,\n            params: algoliaQuery,\n          },\n        ])\n        .then(function processResponse(response) {\n          return response.results[0];\n        });\n    }\n\n    this.emit('searchForFacetValues', {\n      state: state,\n      facet: facet,\n      query: query,\n    });\n\n    return searchForFacetValuesPromise.then(\n      function addIsRefined(content) {\n        self._currentNbQueries--;\n        if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n\n        content = Array.isArray(content) ? content[0] : content;\n\n        content.facetHits.forEach(function (f) {\n          f.escapedValue = escapeFacetValue$4(f.value);\n          f.isRefined = isDisjunctive\n            ? state.isDisjunctiveFacetRefined(facet, f.escapedValue)\n            : state.isFacetRefined(facet, f.escapedValue);\n        });\n\n        return content;\n      },\n      function (e) {\n        self._currentNbQueries--;\n        if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n        throw e;\n      }\n    );\n  };\n\n  /**\n   * Search for facet values using the Composition API & based on a query and the name of a faceted attribute.\n   * This triggers a search and will return a promise. On top of using the query, it also sends\n   * the parameters from the state so that the search is narrowed down to only the possible values.\n   *\n   * See the description of [FacetSearchResult](reference.html#FacetSearchResult)\n   * @param {string} facet the name of the faceted attribute\n   * @param {string} query the string query for the search\n   * @param {number} [maxFacetHits] the maximum number values returned. Should be > 0 and <= 100\n   * @param {object} [userState] the set of custom parameters to use on top of the current state. Setting a property to `undefined` removes\n   * it in the generated query.\n   * @return {promise.<FacetSearchResult>} the results of the search\n   */\n  AlgoliaSearchHelper.prototype.searchForCompositionFacetValues = function (\n    facet,\n    query,\n    maxFacetHits,\n    userState\n  ) {\n    if (typeof this.client.searchForFacetValues !== 'function') {\n      throw new Error(\n        'search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues'\n      );\n    }\n\n    var state = this.state.setQueryParameters(userState || {});\n    var isDisjunctive = state.isDisjunctiveFacet(facet);\n\n    this._currentNbQueries++;\n    // eslint-disable-next-line consistent-this\n    var self = this;\n    var searchForFacetValuesPromise;\n\n    searchForFacetValuesPromise = this.client.searchForFacetValues({\n      compositionID: state.index,\n      facetName: facet,\n      searchForFacetValuesRequest: {\n        params: {\n          query: query,\n          maxFacetHits: maxFacetHits,\n          searchQuery: requestBuilder_1._getCompositionHitsSearchParams(state),\n        },\n      },\n    });\n\n    this.emit('searchForFacetValues', {\n      state: state,\n      facet: facet,\n      query: query,\n    });\n\n    return searchForFacetValuesPromise.then(\n      function addIsRefined(content) {\n        self._currentNbQueries--;\n        if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n\n        content = content.results[0];\n\n        content.facetHits.forEach(function (f) {\n          f.escapedValue = escapeFacetValue$4(f.value);\n          f.isRefined = isDisjunctive\n            ? state.isDisjunctiveFacetRefined(facet, f.escapedValue)\n            : state.isFacetRefined(facet, f.escapedValue);\n        });\n\n        return content;\n      },\n      function (e) {\n        self._currentNbQueries--;\n        if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n        throw e;\n      }\n    );\n  };\n\n  /**\n   * Sets the text query used for the search.\n   *\n   * This method resets the current page to 0.\n   * @param  {string} q the user query\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.setQuery = function (q) {\n    this._change({\n      state: this.state.resetPage().setQuery(q),\n      isPageReset: true,\n    });\n\n    return this;\n  };\n\n  /**\n   * Remove all the types of refinements except tags. A string can be provided to remove\n   * only the refinements of a specific attribute. For more advanced use case, you can\n   * provide a function instead. This function should follow the\n   * [clearCallback definition](#SearchParameters.clearCallback).\n   *\n   * This method resets the current page to 0.\n   * @param {string} [name] optional name of the facet / attribute on which we want to remove all refinements\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   * @example\n   * // Removing all the refinements\n   * helper.clearRefinements().search();\n   * @example\n   * // Removing all the filters on a the category attribute.\n   * helper.clearRefinements('category').search();\n   * @example\n   * // Removing only the exclude filters on the category facet.\n   * helper.clearRefinements(function(value, attribute, type) {\n   *   return type === 'exclude' && attribute === 'category';\n   * }).search();\n   */\n  AlgoliaSearchHelper.prototype.clearRefinements = function (name) {\n    this._change({\n      state: this.state.resetPage().clearRefinements(name),\n      isPageReset: true,\n    });\n\n    return this;\n  };\n\n  /**\n   * Remove all the tag filters.\n   *\n   * This method resets the current page to 0.\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.clearTags = function () {\n    this._change({\n      state: this.state.resetPage().clearTags(),\n      isPageReset: true,\n    });\n\n    return this;\n  };\n\n  /**\n   * Adds a disjunctive filter to a faceted attribute with the `value` provided. If the\n   * filter is already set, it doesn't change the filters.\n   *\n   * This method resets the current page to 0.\n   * @param  {string} facet the facet to refine\n   * @param  {string} value the associated value (will be converted to string)\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.addDisjunctiveFacetRefinement = function (\n    facet,\n    value\n  ) {\n    this._change({\n      state: this.state.resetPage().addDisjunctiveFacetRefinement(facet, value),\n      isPageReset: true,\n    });\n\n    return this;\n  };\n\n  // eslint-disable-next-line valid-jsdoc\n  /**\n   * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addDisjunctiveFacetRefinement}\n   */\n  AlgoliaSearchHelper.prototype.addDisjunctiveRefine = function () {\n    return this.addDisjunctiveFacetRefinement.apply(this, arguments);\n  };\n\n  /**\n   * Adds a refinement on a hierarchical facet. It will throw\n   * an exception if the facet is not defined or if the facet\n   * is already refined.\n   *\n   * This method resets the current page to 0.\n   * @param {string} facet the facet name\n   * @param {string} path the hierarchical facet path\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @throws Error if the facet is not defined or if the facet is refined\n   * @chainable\n   * @fires change\n   */\n  AlgoliaSearchHelper.prototype.addHierarchicalFacetRefinement = function (\n    facet,\n    path\n  ) {\n    this._change({\n      state: this.state.resetPage().addHierarchicalFacetRefinement(facet, path),\n      isPageReset: true,\n    });\n\n    return this;\n  };\n\n  /**\n   * Adds a an numeric filter to an attribute with the `operator` and `value` provided. If the\n   * filter is already set, it doesn't change the filters.\n   *\n   * This method resets the current page to 0.\n   * @param  {string} attribute the attribute on which the numeric filter applies\n   * @param  {string} operator the operator of the filter\n   * @param  {number} value the value of the filter\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.addNumericRefinement = function (\n    attribute,\n    operator,\n    value\n  ) {\n    this._change({\n      state: this.state\n        .resetPage()\n        .addNumericRefinement(attribute, operator, value),\n      isPageReset: true,\n    });\n\n    return this;\n  };\n\n  /**\n   * Adds a filter to a faceted attribute with the `value` provided. If the\n   * filter is already set, it doesn't change the filters.\n   *\n   * This method resets the current page to 0.\n   * @param  {string} facet the facet to refine\n   * @param  {string} value the associated value (will be converted to string)\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.addFacetRefinement = function (facet, value) {\n    this._change({\n      state: this.state.resetPage().addFacetRefinement(facet, value),\n      isPageReset: true,\n    });\n\n    return this;\n  };\n\n  // eslint-disable-next-line valid-jsdoc\n  /**\n   * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addFacetRefinement}\n   */\n  AlgoliaSearchHelper.prototype.addRefine = function () {\n    return this.addFacetRefinement.apply(this, arguments);\n  };\n\n  /**\n   * Adds a an exclusion filter to a faceted attribute with the `value` provided. If the\n   * filter is already set, it doesn't change the filters.\n   *\n   * This method resets the current page to 0.\n   * @param  {string} facet the facet to refine\n   * @param  {string} value the associated value (will be converted to string)\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.addFacetExclusion = function (facet, value) {\n    this._change({\n      state: this.state.resetPage().addExcludeRefinement(facet, value),\n      isPageReset: true,\n    });\n\n    return this;\n  };\n\n  // eslint-disable-next-line valid-jsdoc\n  /**\n   * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addFacetExclusion}\n   */\n  AlgoliaSearchHelper.prototype.addExclude = function () {\n    return this.addFacetExclusion.apply(this, arguments);\n  };\n\n  /**\n   * Adds a tag filter with the `tag` provided. If the\n   * filter is already set, it doesn't change the filters.\n   *\n   * This method resets the current page to 0.\n   * @param {string} tag the tag to add to the filter\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.addTag = function (tag) {\n    this._change({\n      state: this.state.resetPage().addTagRefinement(tag),\n      isPageReset: true,\n    });\n\n    return this;\n  };\n\n  /**\n   * Adds a \"frequently bought together\" recommendation query.\n   *\n   * @param {FrequentlyBoughtTogetherQuery} params the parameters for the recommendation\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.addFrequentlyBoughtTogether = function (params) {\n    this._recommendChange({\n      state: this.recommendState.addFrequentlyBoughtTogether(params),\n    });\n\n    return this;\n  };\n\n  /**\n   * Adds a \"related products\" recommendation query.\n   *\n   * @param {RelatedProductsQuery} params the parameters for the recommendation\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.addRelatedProducts = function (params) {\n    this._recommendChange({\n      state: this.recommendState.addRelatedProducts(params),\n    });\n\n    return this;\n  };\n\n  /**\n   * Adds a \"trending items\" recommendation query.\n   *\n   * @param {TrendingItemsQuery} params the parameters for the recommendation\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.addTrendingItems = function (params) {\n    this._recommendChange({\n      state: this.recommendState.addTrendingItems(params),\n    });\n\n    return this;\n  };\n\n  /**\n   * Adds a \"trending facets\" recommendation query.\n   *\n   * @param {TrendingFacetsQuery} params the parameters for the recommendation\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.addTrendingFacets = function (params) {\n    this._recommendChange({\n      state: this.recommendState.addTrendingFacets(params),\n    });\n\n    return this;\n  };\n\n  /**\n   * Adds a \"looking similar\" recommendation query.\n   *\n   * @param {LookingSimilarQuery} params the parameters for the recommendation\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.addLookingSimilar = function (params) {\n    this._recommendChange({\n      state: this.recommendState.addLookingSimilar(params),\n    });\n\n    return this;\n  };\n\n  /**\n   * Removes an numeric filter to an attribute with the `operator` and `value` provided. If the\n   * filter is not set, it doesn't change the filters.\n   *\n   * Some parameters are optional, triggering different behavior:\n   *  - if the value is not provided, then all the numeric value will be removed for the\n   *  specified attribute/operator couple.\n   *  - if the operator is not provided either, then all the numeric filter on this attribute\n   *  will be removed.\n   *\n   * This method resets the current page to 0.\n   * @param  {string} attribute the attribute on which the numeric filter applies\n   * @param  {string} [operator] the operator of the filter\n   * @param  {number} [value] the value of the filter\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.removeNumericRefinement = function (\n    attribute,\n    operator,\n    value\n  ) {\n    this._change({\n      state: this.state\n        .resetPage()\n        .removeNumericRefinement(attribute, operator, value),\n      isPageReset: true,\n    });\n\n    return this;\n  };\n\n  /**\n   * Removes a disjunctive filter to a faceted attribute with the `value` provided. If the\n   * filter is not set, it doesn't change the filters.\n   *\n   * If the value is omitted, then this method will remove all the filters for the\n   * attribute.\n   *\n   * This method resets the current page to 0.\n   * @param  {string} facet the facet to refine\n   * @param  {string} [value] the associated value\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.removeDisjunctiveFacetRefinement = function (\n    facet,\n    value\n  ) {\n    this._change({\n      state: this.state\n        .resetPage()\n        .removeDisjunctiveFacetRefinement(facet, value),\n      isPageReset: true,\n    });\n\n    return this;\n  };\n\n  // eslint-disable-next-line valid-jsdoc\n  /**\n   * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeDisjunctiveFacetRefinement}\n   */\n  AlgoliaSearchHelper.prototype.removeDisjunctiveRefine = function () {\n    return this.removeDisjunctiveFacetRefinement.apply(this, arguments);\n  };\n\n  /**\n   * Removes the refinement set on a hierarchical facet.\n   * @param {string} facet the facet name\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @throws Error if the facet is not defined or if the facet is not refined\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.removeHierarchicalFacetRefinement = function (\n    facet\n  ) {\n    this._change({\n      state: this.state.resetPage().removeHierarchicalFacetRefinement(facet),\n      isPageReset: true,\n    });\n\n    return this;\n  };\n\n  /**\n   * Removes a filter to a faceted attribute with the `value` provided. If the\n   * filter is not set, it doesn't change the filters.\n   *\n   * If the value is omitted, then this method will remove all the filters for the\n   * attribute.\n   *\n   * This method resets the current page to 0.\n   * @param  {string} facet the facet to refine\n   * @param  {string} [value] the associated value\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.removeFacetRefinement = function (facet, value) {\n    this._change({\n      state: this.state.resetPage().removeFacetRefinement(facet, value),\n      isPageReset: true,\n    });\n\n    return this;\n  };\n\n  // eslint-disable-next-line valid-jsdoc\n  /**\n   * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeFacetRefinement}\n   */\n  AlgoliaSearchHelper.prototype.removeRefine = function () {\n    return this.removeFacetRefinement.apply(this, arguments);\n  };\n\n  /**\n   * Removes an exclusion filter to a faceted attribute with the `value` provided. If the\n   * filter is not set, it doesn't change the filters.\n   *\n   * If the value is omitted, then this method will remove all the filters for the\n   * attribute.\n   *\n   * This method resets the current page to 0.\n   * @param  {string} facet the facet to refine\n   * @param  {string} [value] the associated value\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.removeFacetExclusion = function (facet, value) {\n    this._change({\n      state: this.state.resetPage().removeExcludeRefinement(facet, value),\n      isPageReset: true,\n    });\n\n    return this;\n  };\n\n  // eslint-disable-next-line valid-jsdoc\n  /**\n   * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeFacetExclusion}\n   */\n  AlgoliaSearchHelper.prototype.removeExclude = function () {\n    return this.removeFacetExclusion.apply(this, arguments);\n  };\n\n  /**\n   * Removes a tag filter with the `tag` provided. If the\n   * filter is not set, it doesn't change the filters.\n   *\n   * This method resets the current page to 0.\n   * @param {string} tag tag to remove from the filter\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.removeTag = function (tag) {\n    this._change({\n      state: this.state.resetPage().removeTagRefinement(tag),\n      isPageReset: true,\n    });\n\n    return this;\n  };\n\n  /**\n   * Removes a \"frequently bought together\" recommendation query.\n   *\n   * @param {number} id identifier of the recommendation widget\n   * @returns {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.removeFrequentlyBoughtTogether = function (id) {\n    this._recommendChange({\n      state: this.recommendState.removeParams(id),\n    });\n\n    return this;\n  };\n\n  /**\n   * Removes a \"related products\" recommendation query.\n   *\n   * @param {number} id identifier of the recommendation widget\n   * @returns {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.removeRelatedProducts = function (id) {\n    this._recommendChange({\n      state: this.recommendState.removeParams(id),\n    });\n\n    return this;\n  };\n\n  /**\n   * Removes a \"trending items\" recommendation query.\n   *\n   * @param {number} id identifier of the recommendation widget\n   * @returns {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.removeTrendingItems = function (id) {\n    this._recommendChange({\n      state: this.recommendState.removeParams(id),\n    });\n\n    return this;\n  };\n\n  /**\n   * Removes a \"trending facets\" recommendation query.\n   *\n   * @param {number} id identifier of the recommendation widget\n   * @returns {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.removeTrendingFacets = function (id) {\n    this._recommendChange({\n      state: this.recommendState.removeParams(id),\n    });\n\n    return this;\n  };\n\n  /**\n   * Removes a \"looking similar\" recommendation query.\n   *\n   * @param {number} id identifier of the recommendation widget\n   * @returns {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.removeLookingSimilar = function (id) {\n    this._recommendChange({\n      state: this.recommendState.removeParams(id),\n    });\n\n    return this;\n  };\n\n  /**\n   * Adds or removes an exclusion filter to a faceted attribute with the `value` provided. If\n   * the value is set then it removes it, otherwise it adds the filter.\n   *\n   * This method resets the current page to 0.\n   * @param  {string} facet the facet to refine\n   * @param  {string} value the associated value\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.toggleFacetExclusion = function (facet, value) {\n    this._change({\n      state: this.state.resetPage().toggleExcludeFacetRefinement(facet, value),\n      isPageReset: true,\n    });\n\n    return this;\n  };\n\n  // eslint-disable-next-line valid-jsdoc\n  /**\n   * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#toggleFacetExclusion}\n   */\n  AlgoliaSearchHelper.prototype.toggleExclude = function () {\n    return this.toggleFacetExclusion.apply(this, arguments);\n  };\n\n  /**\n   * Adds or removes a filter to a faceted attribute with the `value` provided. If\n   * the value is set then it removes it, otherwise it adds the filter.\n   *\n   * This method can be used for conjunctive, disjunctive and hierarchical filters.\n   *\n   * This method resets the current page to 0.\n   * @param  {string} facet the facet to refine\n   * @param  {string} value the associated value\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @throws Error will throw an error if the facet is not declared in the settings of the helper\n   * @fires change\n   * @chainable\n   * @deprecated since version 2.19.0, see {@link AlgoliaSearchHelper#toggleFacetRefinement}\n   */\n  AlgoliaSearchHelper.prototype.toggleRefinement = function (facet, value) {\n    return this.toggleFacetRefinement(facet, value);\n  };\n\n  /**\n   * Adds or removes a filter to a faceted attribute with the `value` provided. If\n   * the value is set then it removes it, otherwise it adds the filter.\n   *\n   * This method can be used for conjunctive, disjunctive and hierarchical filters.\n   *\n   * This method resets the current page to 0.\n   * @param  {string} facet the facet to refine\n   * @param  {string} value the associated value\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @throws Error will throw an error if the facet is not declared in the settings of the helper\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.toggleFacetRefinement = function (facet, value) {\n    this._change({\n      state: this.state.resetPage().toggleFacetRefinement(facet, value),\n      isPageReset: true,\n    });\n\n    return this;\n  };\n\n  // eslint-disable-next-line valid-jsdoc\n  /**\n   * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#toggleFacetRefinement}\n   */\n  AlgoliaSearchHelper.prototype.toggleRefine = function () {\n    return this.toggleFacetRefinement.apply(this, arguments);\n  };\n\n  /**\n   * Adds or removes a tag filter with the `value` provided. If\n   * the value is set then it removes it, otherwise it adds the filter.\n   *\n   * This method resets the current page to 0.\n   * @param {string} tag tag to remove or add\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.toggleTag = function (tag) {\n    this._change({\n      state: this.state.resetPage().toggleTagRefinement(tag),\n      isPageReset: true,\n    });\n\n    return this;\n  };\n\n  /**\n   * Increments the page number by one.\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   * @example\n   * helper.setPage(0).nextPage().getPage();\n   * // returns 1\n   */\n  AlgoliaSearchHelper.prototype.nextPage = function () {\n    var page = this.state.page || 0;\n    return this.setPage(page + 1);\n  };\n\n  /**\n   * Decrements the page number by one.\n   * @fires change\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @chainable\n   * @example\n   * helper.setPage(1).previousPage().getPage();\n   * // returns 0\n   */\n  AlgoliaSearchHelper.prototype.previousPage = function () {\n    var page = this.state.page || 0;\n    return this.setPage(page - 1);\n  };\n\n  /**\n   * @private\n   * @param {number} page The page number\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @chainable\n   * @fires change\n   */\n  function setCurrentPage(page) {\n    if (page < 0) throw new Error('Page requested below 0.');\n\n    this._change({\n      state: this.state.setPage(page),\n      isPageReset: false,\n    });\n\n    return this;\n  }\n\n  /**\n   * Change the current page\n   * @deprecated\n   * @param  {number} page The page number\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.setCurrentPage = setCurrentPage;\n\n  /**\n   * Updates the current page.\n   * @function\n   * @param  {number} page The page number\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.setPage = setCurrentPage;\n\n  /**\n   * Updates the name of the index that will be targeted by the query.\n   *\n   * This method resets the current page to 0.\n   * @param {string} name the index name\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.setIndex = function (name) {\n    this._change({\n      state: this.state.resetPage().setIndex(name),\n      isPageReset: true,\n    });\n\n    return this;\n  };\n\n  /**\n   * Update a parameter of the search. This method reset the page\n   *\n   * The complete list of parameters is available on the\n   * [Algolia website](https://www.algolia.com/doc/rest#query-an-index).\n   * The most commonly used parameters have their own [shortcuts](#query-parameters-shortcuts)\n   * or benefit from higher-level APIs (all the kind of filters and facets have their own API)\n   *\n   * This method resets the current page to 0.\n   * @param {string} parameter name of the parameter to update\n   * @param {any} value new value of the parameter\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   * @example\n   * helper.setQueryParameter('hitsPerPage', 20).search();\n   */\n  AlgoliaSearchHelper.prototype.setQueryParameter = function (parameter, value) {\n    this._change({\n      state: this.state.resetPage().setQueryParameter(parameter, value),\n      isPageReset: true,\n    });\n\n    return this;\n  };\n\n  /**\n   * Set the whole state (warning: will erase previous state)\n   * @param {SearchParameters} newState the whole new state\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @fires change\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.setState = function (newState) {\n    this._change({\n      state: SearchParameters_1.make(newState),\n      isPageReset: false,\n    });\n\n    return this;\n  };\n\n  /**\n   * Override the current state without triggering a change event.\n   * Do not use this method unless you know what you are doing. (see the example\n   * for a legit use case)\n   * @param {SearchParameters} newState the whole new state\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   * @example\n   *  helper.on('change', function(state){\n   *    // In this function you might want to find a way to store the state in the url/history\n   *    updateYourURL(state)\n   *  })\n   *  window.onpopstate = function(event){\n   *    // This is naive though as you should check if the state is really defined etc.\n   *    helper.overrideStateWithoutTriggeringChangeEvent(event.state).search()\n   *  }\n   * @chainable\n   */\n  AlgoliaSearchHelper.prototype.overrideStateWithoutTriggeringChangeEvent =\n    function (newState) {\n      this.state = new SearchParameters_1(newState);\n      return this;\n    };\n\n  /**\n   * Check if an attribute has any numeric, conjunctive, disjunctive or hierarchical filters.\n   * @param {string} attribute the name of the attribute\n   * @return {boolean} true if the attribute is filtered by at least one value\n   * @example\n   * // hasRefinements works with numeric, conjunctive, disjunctive and hierarchical filters\n   * helper.hasRefinements('price'); // false\n   * helper.addNumericRefinement('price', '>', 100);\n   * helper.hasRefinements('price'); // true\n   *\n   * helper.hasRefinements('color'); // false\n   * helper.addFacetRefinement('color', 'blue');\n   * helper.hasRefinements('color'); // true\n   *\n   * helper.hasRefinements('material'); // false\n   * helper.addDisjunctiveFacetRefinement('material', 'plastic');\n   * helper.hasRefinements('material'); // true\n   *\n   * helper.hasRefinements('categories'); // false\n   * helper.toggleFacetRefinement('categories', 'kitchen > knife');\n   * helper.hasRefinements('categories'); // true\n   *\n   */\n  AlgoliaSearchHelper.prototype.hasRefinements = function (attribute) {\n    if (objectHasKeys_1(this.state.getNumericRefinements(attribute))) {\n      return true;\n    } else if (this.state.isConjunctiveFacet(attribute)) {\n      return this.state.isFacetRefined(attribute);\n    } else if (this.state.isDisjunctiveFacet(attribute)) {\n      return this.state.isDisjunctiveFacetRefined(attribute);\n    } else if (this.state.isHierarchicalFacet(attribute)) {\n      return this.state.isHierarchicalFacetRefined(attribute);\n    }\n\n    // there's currently no way to know that the user did call `addNumericRefinement` at some point\n    // thus we cannot distinguish if there once was a numeric refinement that was cleared\n    // so we will return false in every other situations to be consistent\n    // while what we should do here is throw because we did not find the attribute in any type\n    // of refinement\n    return false;\n  };\n\n  /**\n   * Check if a value is excluded for a specific faceted attribute. If the value\n   * is omitted then the function checks if there is any excluding refinements.\n   *\n   * @param  {string}  facet name of the attribute for used for faceting\n   * @param  {string}  [value] optional value. If passed will test that this value\n   * is filtering the given facet.\n   * @return {boolean} true if refined\n   * @example\n   * helper.isExcludeRefined('color'); // false\n   * helper.isExcludeRefined('color', 'blue') // false\n   * helper.isExcludeRefined('color', 'red') // false\n   *\n   * helper.addFacetExclusion('color', 'red');\n   *\n   * helper.isExcludeRefined('color'); // true\n   * helper.isExcludeRefined('color', 'blue') // false\n   * helper.isExcludeRefined('color', 'red') // true\n   */\n  AlgoliaSearchHelper.prototype.isExcluded = function (facet, value) {\n    return this.state.isExcludeRefined(facet, value);\n  };\n\n  // eslint-disable-next-line valid-jsdoc\n  /**\n   * @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasRefinements}\n   */\n  AlgoliaSearchHelper.prototype.isDisjunctiveRefined = function (facet, value) {\n    return this.state.isDisjunctiveFacetRefined(facet, value);\n  };\n\n  /**\n   * Check if the string is a currently filtering tag.\n   * @param {string} tag tag to check\n   * @return {boolean} true if the tag is currently refined\n   */\n  AlgoliaSearchHelper.prototype.hasTag = function (tag) {\n    return this.state.isTagRefined(tag);\n  };\n\n  // eslint-disable-next-line valid-jsdoc\n  /**\n   * @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasTag}\n   */\n  AlgoliaSearchHelper.prototype.isTagRefined = function () {\n    return this.hasTagRefinements.apply(this, arguments);\n  };\n\n  /**\n   * Get the name of the currently used index.\n   * @return {string} name of the index\n   * @example\n   * helper.setIndex('highestPrice_products').getIndex();\n   * // returns 'highestPrice_products'\n   */\n  AlgoliaSearchHelper.prototype.getIndex = function () {\n    return this.state.index;\n  };\n\n  function getCurrentPage() {\n    return this.state.page;\n  }\n\n  /**\n   * Get the currently selected page\n   * @deprecated\n   * @return {number} the current page\n   */\n  AlgoliaSearchHelper.prototype.getCurrentPage = getCurrentPage;\n  /**\n   * Get the currently selected page\n   * @function\n   * @return {number} the current page\n   */\n  AlgoliaSearchHelper.prototype.getPage = getCurrentPage;\n\n  /**\n   * Get all the tags currently set to filters the results.\n   *\n   * @return {string[]} The list of tags currently set.\n   */\n  AlgoliaSearchHelper.prototype.getTags = function () {\n    return this.state.tagRefinements;\n  };\n\n  /**\n   * Get the list of refinements for a given attribute. This method works with\n   * conjunctive, disjunctive, excluding and numerical filters.\n   *\n   * See also SearchResults#getRefinements\n   *\n   * @param {string} facetName attribute name used for faceting\n   * @return {Array.<FacetRefinement|NumericRefinement>} All Refinement are objects that contain a value, and\n   * a type. Numeric also contains an operator.\n   * @example\n   * helper.addNumericRefinement('price', '>', 100);\n   * helper.getRefinements('price');\n   * // [\n   * //   {\n   * //     \"value\": [\n   * //       100\n   * //     ],\n   * //     \"operator\": \">\",\n   * //     \"type\": \"numeric\"\n   * //   }\n   * // ]\n   * @example\n   * helper.addFacetRefinement('color', 'blue');\n   * helper.addFacetExclusion('color', 'red');\n   * helper.getRefinements('color');\n   * // [\n   * //   {\n   * //     \"value\": \"blue\",\n   * //     \"type\": \"conjunctive\"\n   * //   },\n   * //   {\n   * //     \"value\": \"red\",\n   * //     \"type\": \"exclude\"\n   * //   }\n   * // ]\n   * @example\n   * helper.addDisjunctiveFacetRefinement('material', 'plastic');\n   * // [\n   * //   {\n   * //     \"value\": \"plastic\",\n   * //     \"type\": \"disjunctive\"\n   * //   }\n   * // ]\n   */\n  AlgoliaSearchHelper.prototype.getRefinements = function (facetName) {\n    var refinements = [];\n\n    if (this.state.isConjunctiveFacet(facetName)) {\n      var conjRefinements = this.state.getConjunctiveRefinements(facetName);\n\n      conjRefinements.forEach(function (r) {\n        refinements.push({\n          value: r,\n          type: 'conjunctive',\n        });\n      });\n\n      var excludeRefinements = this.state.getExcludeRefinements(facetName);\n\n      excludeRefinements.forEach(function (r) {\n        refinements.push({\n          value: r,\n          type: 'exclude',\n        });\n      });\n    } else if (this.state.isDisjunctiveFacet(facetName)) {\n      var disjunctiveRefinements =\n        this.state.getDisjunctiveRefinements(facetName);\n\n      disjunctiveRefinements.forEach(function (r) {\n        refinements.push({\n          value: r,\n          type: 'disjunctive',\n        });\n      });\n    }\n\n    var numericRefinements = this.state.getNumericRefinements(facetName);\n\n    Object.keys(numericRefinements).forEach(function (operator) {\n      var value = numericRefinements[operator];\n\n      refinements.push({\n        value: value,\n        operator: operator,\n        type: 'numeric',\n      });\n    });\n\n    return refinements;\n  };\n\n  /**\n   * Return the current refinement for the (attribute, operator)\n   * @param {string} attribute attribute in the record\n   * @param {string} operator operator applied on the refined values\n   * @return {Array.<number|number[]>} refined values\n   */\n  AlgoliaSearchHelper.prototype.getNumericRefinement = function (\n    attribute,\n    operator\n  ) {\n    return this.state.getNumericRefinement(attribute, operator);\n  };\n\n  /**\n   * Get the current breadcrumb for a hierarchical facet, as an array\n   * @param  {string} facetName Hierarchical facet name\n   * @return {array.<string>} the path as an array of string\n   */\n  AlgoliaSearchHelper.prototype.getHierarchicalFacetBreadcrumb = function (\n    facetName\n  ) {\n    return this.state.getHierarchicalFacetBreadcrumb(facetName);\n  };\n\n  // /////////// PRIVATE\n\n  /**\n   * Perform the underlying queries\n   * @private\n   * @param {object} options options for the query\n   * @param {boolean} [options.onlyWithDerivedHelpers=false] if true, only the derived helpers will be queried\n   * @return {undefined} does not return anything\n   * @fires search\n   * @fires result\n   * @fires error\n   */\n  AlgoliaSearchHelper.prototype._search = function (options) {\n    var state = this.state;\n    var states = [];\n    var mainQueries = [];\n\n    if (!options.onlyWithDerivedHelpers) {\n      mainQueries = requestBuilder_1._getQueries(state.index, state);\n\n      states.push({\n        state: state,\n        queriesCount: mainQueries.length,\n        helper: this,\n      });\n\n      this.emit('search', {\n        state: state,\n        results: this.lastResults,\n      });\n    }\n\n    var derivedQueries = this.derivedHelpers.map(function (derivedHelper) {\n      var derivedState = derivedHelper.getModifiedState(state);\n      var derivedStateQueries = derivedState.index\n        ? requestBuilder_1._getQueries(derivedState.index, derivedState)\n        : [];\n\n      states.push({\n        state: derivedState,\n        queriesCount: derivedStateQueries.length,\n        helper: derivedHelper,\n      });\n\n      derivedHelper.emit('search', {\n        state: derivedState,\n        results: derivedHelper.lastResults,\n      });\n\n      return derivedStateQueries;\n    });\n\n    var queries = Array.prototype.concat.apply(mainQueries, derivedQueries);\n\n    var queryId = this._queryId++;\n    this._currentNbQueries++;\n\n    if (!queries.length) {\n      return Promise.resolve({ results: [] }).then(\n        this._dispatchAlgoliaResponse.bind(this, states, queryId)\n      );\n    }\n\n    try {\n      this.client\n        .search(queries)\n        .then(this._dispatchAlgoliaResponse.bind(this, states, queryId))\n        .catch(this._dispatchAlgoliaError.bind(this, queryId));\n    } catch (error) {\n      // If we reach this part, we're in an internal error state\n      this.emit('error', {\n        error: error,\n      });\n    }\n\n    return undefined;\n  };\n\n  /**\n   * Perform the underlying queries\n   * @private\n   * @param {boolean} [options.onlyWithDerivedHelpers=false] if true, only the derived helpers will be queried\n   * @return {undefined} does not return anything\n   * @fires search\n   * @fires result\n   * @fires error\n   */\n  AlgoliaSearchHelper.prototype._runComposition = function () {\n    var state = this.state;\n    var states = [];\n    var mainQueries = [];\n\n    var derivedQueries = this.derivedHelpers.map(function (derivedHelper) {\n      var derivedState = derivedHelper.getModifiedState(state);\n      var derivedStateQueries =\n        requestBuilder_1._getCompositionQueries(derivedState);\n\n      states.push({\n        state: derivedState,\n        queriesCount: derivedStateQueries.length,\n        helper: derivedHelper,\n      });\n\n      derivedHelper.emit('search', {\n        state: derivedState,\n        results: derivedHelper.lastResults,\n      });\n\n      return derivedStateQueries;\n    });\n\n    var queries = Array.prototype.concat.apply(mainQueries, derivedQueries);\n\n    var queryId = this._queryId++;\n    this._currentNbQueries++;\n\n    if (!queries.length) {\n      return Promise.resolve({ results: [] }).then(\n        this._dispatchAlgoliaResponse.bind(this, states, queryId)\n      );\n    }\n\n    if (queries.length > 1) {\n      throw new Error('Only one query is allowed when using a composition.');\n    }\n\n    var query = queries[0];\n\n    try {\n      this.client\n        .search(query)\n        .then(this._dispatchAlgoliaResponse.bind(this, states, queryId))\n        .catch(this._dispatchAlgoliaError.bind(this, queryId));\n    } catch (error) {\n      // If we reach this part, we're in an internal error state\n      this.emit('error', {\n        error: error,\n      });\n    }\n\n    return undefined;\n  };\n\n  AlgoliaSearchHelper.prototype._recommend = function () {\n    var searchState = this.state;\n    var recommendState = this.recommendState;\n    var index = this.getIndex();\n    var states = [{ state: recommendState, index: index, helper: this }];\n    var ids = recommendState.params.map(function (param) {\n      return param.$$id;\n    });\n\n    this.emit('fetch', {\n      recommend: {\n        state: recommendState,\n        results: this.lastRecommendResults,\n      },\n    });\n\n    var cache = this._recommendCache;\n\n    var derivedQueries = this.derivedHelpers.map(function (derivedHelper) {\n      var derivedIndex = derivedHelper.getModifiedState(searchState).index;\n      if (!derivedIndex) {\n        return [];\n      }\n\n      // Contrary to what is done when deriving the search state, we don't want to\n      // provide the current recommend state to the derived helper, as it would\n      // inherit unwanted queries. We instead provide an empty recommend state.\n      var derivedState = derivedHelper.getModifiedRecommendState(\n        new RecommendParameters_1()\n      );\n      states.push({\n        state: derivedState,\n        index: derivedIndex,\n        helper: derivedHelper,\n      });\n\n      ids = Array.prototype.concat.apply(\n        ids,\n        derivedState.params.map(function (param) {\n          return param.$$id;\n        })\n      );\n\n      derivedHelper.emit('fetch', {\n        recommend: {\n          state: derivedState,\n          results: derivedHelper.lastRecommendResults,\n        },\n      });\n\n      return derivedState._buildQueries(derivedIndex, cache);\n    });\n\n    var queries = Array.prototype.concat.apply(\n      this.recommendState._buildQueries(index, cache),\n      derivedQueries\n    );\n\n    if (queries.length === 0) {\n      return;\n    }\n\n    if (\n      queries.length > 0 &&\n      typeof this.client.getRecommendations === 'undefined'\n    ) {\n      // eslint-disable-next-line no-console\n      console.warn(\n        'Please update algoliasearch/lite to the latest version in order to use recommend widgets.'\n      );\n      return;\n    }\n\n    var queryId = this._recommendQueryId++;\n    this._currentNbRecommendQueries++;\n\n    try {\n      this.client\n        .getRecommendations(queries)\n        .then(this._dispatchRecommendResponse.bind(this, queryId, states, ids))\n        .catch(this._dispatchRecommendError.bind(this, queryId));\n    } catch (error) {\n      // If we reach this part, we're in an internal error state\n      this.emit('error', {\n        error: error,\n      });\n    }\n\n    return;\n  };\n\n  /**\n   * Transform the responses as sent by the server and transform them into a user\n   * usable object that merge the results of all the batch requests. It will dispatch\n   * over the different helper + derived helpers (when there are some).\n   * @private\n   * @param {array.<{SearchParameters, AlgoliaQueries, AlgoliaSearchHelper}>} states state used to generate the request\n   * @param {number} queryId id of the current request\n   * @param {object} content content of the response\n   * @return {undefined}\n   */\n  AlgoliaSearchHelper.prototype._dispatchAlgoliaResponse = function (\n    states,\n    queryId,\n    content\n  ) {\n    // eslint-disable-next-line consistent-this\n    var self = this;\n\n    // @TODO remove the number of outdated queries discarded instead of just one\n\n    if (queryId < this._lastQueryIdReceived) {\n      // Outdated answer\n      return;\n    }\n\n    this._currentNbQueries -= queryId - this._lastQueryIdReceived;\n    this._lastQueryIdReceived = queryId;\n\n    if (this._currentNbQueries === 0) this.emit('searchQueueEmpty');\n\n    var results = content.results.slice();\n    var rawContent = Object.keys(content).reduce(function (value, key) {\n      if (key !== 'results') value[key] = content[key];\n      return value;\n    }, {});\n\n    if (Object.keys(rawContent).length <= 0) {\n      rawContent = undefined;\n    }\n\n    states.forEach(function (s) {\n      var state = s.state;\n      var queriesCount = s.queriesCount;\n      var helper = s.helper;\n      var specificResults = results.splice(0, queriesCount);\n\n      if (!state.index) {\n        helper.emit('result', {\n          results: null,\n          state: state,\n        });\n        return;\n      }\n\n      helper.lastResults = new SearchResults_1(\n        state,\n        specificResults,\n        self._searchResultsOptions\n      );\n      if (rawContent !== undefined) helper.lastResults._rawContent = rawContent;\n\n      helper.emit('result', {\n        results: helper.lastResults,\n        state: state,\n      });\n    });\n  };\n\n  AlgoliaSearchHelper.prototype._dispatchRecommendResponse = function (\n    queryId,\n    states,\n    ids,\n    content\n  ) {\n    // @TODO remove the number of outdated queries discarded instead of just one\n\n    if (queryId < this._lastRecommendQueryIdReceived) {\n      // Outdated answer\n      return;\n    }\n\n    this._currentNbRecommendQueries -=\n      queryId - this._lastRecommendQueryIdReceived;\n    this._lastRecommendQueryIdReceived = queryId;\n\n    if (this._currentNbRecommendQueries === 0) this.emit('recommendQueueEmpty');\n\n    var cache = this._recommendCache;\n\n    var idsMap = {};\n    ids\n      .filter(function (id) {\n        return cache[id] === undefined;\n      })\n      .forEach(function (id, index) {\n        if (!idsMap[id]) idsMap[id] = [];\n\n        idsMap[id].push(index);\n      });\n\n    Object.keys(idsMap).forEach(function (id) {\n      var indices = idsMap[id];\n      var firstResult = content.results[indices[0]];\n      if (indices.length === 1) {\n        cache[id] = firstResult;\n        return;\n      }\n      cache[id] = Object.assign({}, firstResult, {\n        hits: sortAndMergeRecommendations_1(\n          ids,\n          indices.map(function (idx) {\n            return content.results[idx].hits;\n          })\n        ),\n      });\n    });\n\n    var results = {};\n    ids.forEach(function (id) {\n      results[id] = cache[id];\n    });\n\n    states.forEach(function (s) {\n      var state = s.state;\n      var helper = s.helper;\n\n      if (!s.index) {\n        // eslint-disable-next-line no-warning-comments\n        // TODO: emit \"result\" event when events for Recommend are implemented\n        helper.emit('recommend:result', {\n          results: null,\n          state: state,\n        });\n        return;\n      }\n\n      helper.lastRecommendResults = new RecommendResults_1(state, results);\n\n      // eslint-disable-next-line no-warning-comments\n      // TODO: emit \"result\" event when events for Recommend are implemented\n      helper.emit('recommend:result', {\n        recommend: {\n          results: helper.lastRecommendResults,\n          state: state,\n        },\n      });\n    });\n  };\n\n  AlgoliaSearchHelper.prototype._dispatchAlgoliaError = function (\n    queryId,\n    error\n  ) {\n    if (queryId < this._lastQueryIdReceived) {\n      // Outdated answer\n      return;\n    }\n\n    this._currentNbQueries -= queryId - this._lastQueryIdReceived;\n    this._lastQueryIdReceived = queryId;\n\n    this.emit('error', {\n      error: error,\n    });\n\n    if (this._currentNbQueries === 0) this.emit('searchQueueEmpty');\n  };\n\n  AlgoliaSearchHelper.prototype._dispatchRecommendError = function (\n    queryId,\n    error\n  ) {\n    if (queryId < this._lastRecommendQueryIdReceived) {\n      // Outdated answer\n      return;\n    }\n\n    this._currentNbRecommendQueries -=\n      queryId - this._lastRecommendQueryIdReceived;\n    this._lastRecommendQueryIdReceived = queryId;\n\n    this.emit('error', {\n      error: error,\n    });\n\n    if (this._currentNbRecommendQueries === 0) this.emit('recommendQueueEmpty');\n  };\n\n  AlgoliaSearchHelper.prototype.containsRefinement = function (\n    query,\n    facetFilters,\n    numericFilters,\n    tagFilters\n  ) {\n    return (\n      query ||\n      facetFilters.length !== 0 ||\n      numericFilters.length !== 0 ||\n      tagFilters.length !== 0\n    );\n  };\n\n  /**\n   * Test if there are some disjunctive refinements on the facet\n   * @private\n   * @param {string} facet the attribute to test\n   * @return {boolean} true if there are refinements on this attribute\n   */\n  AlgoliaSearchHelper.prototype._hasDisjunctiveRefinements = function (facet) {\n    return (\n      this.state.disjunctiveRefinements[facet] &&\n      this.state.disjunctiveRefinements[facet].length > 0\n    );\n  };\n\n  AlgoliaSearchHelper.prototype._change = function (event) {\n    var state = event.state;\n    var isPageReset = event.isPageReset;\n\n    if (state !== this.state) {\n      this.state = state;\n\n      this.emit('change', {\n        state: this.state,\n        results: this.lastResults,\n        isPageReset: isPageReset,\n      });\n    }\n  };\n\n  AlgoliaSearchHelper.prototype._recommendChange = function (event) {\n    var state = event.state;\n\n    if (state !== this.recommendState) {\n      this.recommendState = state;\n\n      // eslint-disable-next-line no-warning-comments\n      // TODO: emit \"change\" event when events for Recommend are implemented\n      this.emit('recommend:change', {\n        search: {\n          results: this.lastResults,\n          state: this.state,\n        },\n        recommend: {\n          results: this.lastRecommendResults,\n          state: this.recommendState,\n        },\n      });\n    }\n  };\n\n  /**\n   * Clears the cache of the underlying Algolia client.\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   */\n  AlgoliaSearchHelper.prototype.clearCache = function () {\n    if (this.client.clearCache) this.client.clearCache();\n    return this;\n  };\n\n  /**\n   * Updates the internal client instance. If the reference of the clients\n   * are equal then no update is actually done.\n   * @param  {AlgoliaSearch} newClient an AlgoliaSearch client\n   * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n   */\n  AlgoliaSearchHelper.prototype.setClient = function (newClient) {\n    if (this.client === newClient) return this;\n\n    if (typeof newClient.addAlgoliaAgent === 'function') {\n      newClient.addAlgoliaAgent('JS Helper (' + version + ')');\n    }\n    this.client = newClient;\n\n    return this;\n  };\n\n  /**\n   * Gets the instance of the currently used client.\n   * @return {AlgoliaSearch} the currently used client\n   */\n  AlgoliaSearchHelper.prototype.getClient = function () {\n    return this.client;\n  };\n\n  /**\n   * Creates an derived instance of the Helper. A derived helper\n   * is a way to request other indices synchronised with the lifecycle\n   * of the main Helper. This mechanism uses the multiqueries feature\n   * of Algolia to aggregate all the requests in a single network call.\n   *\n   * This method takes a function that is used to create a new SearchParameter\n   * that will be used to create requests to Algolia. Those new requests\n   * are created just before the `search` event. The signature of the function\n   * is `SearchParameters -> SearchParameters`.\n   *\n   * This method returns a new DerivedHelper which is an EventEmitter\n   * that fires the same `search`, `result` and `error` events. Those\n   * events, however, will receive data specific to this DerivedHelper\n   * and the SearchParameters that is returned by the call of the\n   * parameter function.\n   * @param {function} fn SearchParameters -> SearchParameters\n   * @param {function} recommendFn RecommendParameters -> RecommendParameters\n   * @return {DerivedHelper} a new DerivedHelper\n   */\n  AlgoliaSearchHelper.prototype.derive = function (fn, recommendFn) {\n    var derivedHelper = new DerivedHelper_1(this, fn, recommendFn);\n    this.derivedHelpers.push(derivedHelper);\n    return derivedHelper;\n  };\n\n  /**\n   * This method detaches a derived Helper from the main one. Prefer using the one from the\n   * derived helper itself, to remove the event listeners too.\n   * @private\n   * @param  {DerivedHelper} derivedHelper the derived helper to detach\n   * @return {undefined} nothing is returned\n   * @throws Error\n   */\n  AlgoliaSearchHelper.prototype.detachDerivedHelper = function (derivedHelper) {\n    var pos = this.derivedHelpers.indexOf(derivedHelper);\n    if (pos === -1) throw new Error('Derived helper already detached');\n    this.derivedHelpers.splice(pos, 1);\n  };\n\n  /**\n   * This method returns true if there is currently at least one on-going search.\n   * @return {boolean} true if there is a search pending\n   */\n  AlgoliaSearchHelper.prototype.hasPendingRequests = function () {\n    return this._currentNbQueries > 0;\n  };\n\n  /**\n   * @typedef AlgoliaSearchHelper.NumericRefinement\n   * @type {object}\n   * @property {number[]} value the numbers that are used for filtering this attribute with\n   * the operator specified.\n   * @property {string} operator the faceting data: value, number of entries\n   * @property {string} type will be 'numeric'\n   */\n\n  /**\n   * @typedef AlgoliaSearchHelper.FacetRefinement\n   * @type {object}\n   * @property {string} value the string use to filter the attribute\n   * @property {string} type the type of filter: 'conjunctive', 'disjunctive', 'exclude'\n   */\n\n  var algoliasearch_helper = AlgoliaSearchHelper;\n\n  /**\n   * The algoliasearchHelper module is the function that will let its\n   * contains everything needed to use the Algoliasearch\n   * Helper. It is a also a function that instanciate the helper.\n   * To use the helper, you also need the Algolia JS client v3.\n   * @example\n   * //using the UMD build\n   * var client = algoliasearch('latency', '6be0576ff61c053d5f9a3225e2a90f76');\n   * var helper = algoliasearchHelper(client, 'bestbuy', {\n   *   facets: ['shipping'],\n   *   disjunctiveFacets: ['category']\n   * });\n   * helper.on('result', function(event) {\n   *   console.log(event.results);\n   * });\n   * helper\n   *   .toggleFacetRefinement('category', 'Movies & TV Shows')\n   *   .toggleFacetRefinement('shipping', 'Free shipping')\n   *   .search();\n   * @example\n   * // The helper is an event emitter using the node API\n   * helper.on('result', updateTheResults);\n   * helper.once('result', updateTheResults);\n   * helper.removeListener('result', updateTheResults);\n   * helper.removeAllListeners('result');\n   * @module algoliasearchHelper\n   * @param  {AlgoliaSearch} client an AlgoliaSearch client\n   * @param  {string} index the name of the index to query\n   * @param  {SearchParameters|object} opts an object defining the initial config of the search. It doesn't have to be a {SearchParameters}, just an object containing the properties you need from it.\n   * @param {SearchResultsOptions|object} searchResultsOptions an object defining the options to use when creating the search results.\n   * @return {AlgoliaSearchHelper} The helper instance\n   */\n  function algoliasearchHelper(client, index, opts, searchResultsOptions) {\n    return new algoliasearch_helper(client, index, opts, searchResultsOptions);\n  }\n\n  /**\n   * The version currently used\n   * @member module:algoliasearchHelper.version\n   * @type {number}\n   */\n  algoliasearchHelper.version = version;\n\n  /**\n   * Constructor for the Helper.\n   * @member module:algoliasearchHelper.AlgoliaSearchHelper\n   * @type {AlgoliaSearchHelper}\n   */\n  algoliasearchHelper.AlgoliaSearchHelper = algoliasearch_helper;\n\n  /**\n   * Constructor for the object containing all the parameters of the search.\n   * @member module:algoliasearchHelper.SearchParameters\n   * @type {SearchParameters}\n   */\n  algoliasearchHelper.SearchParameters = SearchParameters_1;\n\n  /**\n   * Constructor for the object containing all the parameters for Recommend.\n   * @member module:algoliasearchHelper.RecommendParameters\n   * @type {RecommendParameters}\n   */\n  algoliasearchHelper.RecommendParameters = RecommendParameters_1;\n\n  /**\n   * Constructor for the object containing the results of the search.\n   * @member module:algoliasearchHelper.SearchResults\n   * @type {SearchResults}\n   */\n  algoliasearchHelper.SearchResults = SearchResults_1;\n\n  /**\n   * Constructor for the object containing the results for Recommend.\n   * @member module:algoliasearchHelper.RecommendResults\n   * @type {RecommendResults}\n   */\n  algoliasearchHelper.RecommendResults = RecommendResults_1;\n\n  var algoliasearchHelper_1 = algoliasearchHelper;\n\n  /**\n   * Refine the given search parameters.\n   */\n\n  var withUsage$1 = createDocumentationMessageGenerator({\n    name: 'configure',\n    connector: true\n  });\n  function getInitialSearchParameters(state, widgetParams) {\n    // We leverage the helper internals to remove the `widgetParams` from\n    // the state. The function `setQueryParameters` omits the values that\n    // are `undefined` on the next state.\n    return state.setQueryParameters(Object.keys(widgetParams.searchParameters).reduce(function (acc, key) {\n      return _objectSpread2(_objectSpread2({}, acc), {}, _defineProperty({}, key, undefined));\n    }, {}));\n  }\n  var connectConfigure = function connectConfigure() {\n    var renderFn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : noop;\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    return function (widgetParams) {\n      if (!widgetParams || !isPlainObject(widgetParams.searchParameters)) {\n        throw new Error(withUsage$1('The `searchParameters` option expects an object.'));\n      }\n      var connectorState = {};\n      function refine(helper) {\n        return function (searchParameters) {\n          // Merge new `searchParameters` with the ones set from other widgets\n          var actualState = getInitialSearchParameters(helper.state, widgetParams);\n          var nextSearchParameters = mergeSearchParameters(actualState, new algoliasearchHelper_1.SearchParameters(searchParameters));\n\n          // Update original `widgetParams.searchParameters` to the new refined one\n          widgetParams.searchParameters = searchParameters;\n\n          // Trigger a search with the resolved search parameters\n          helper.setState(nextSearchParameters).search();\n        };\n      }\n      return {\n        $$type: 'ais.configure',\n        init: function init(initOptions) {\n          var instantSearchInstance = initOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var instantSearchInstance = renderOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), false);\n        },\n        dispose: function dispose(_ref) {\n          var state = _ref.state;\n          unmountFn();\n          return getInitialSearchParameters(state, widgetParams);\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          var _renderState$configur;\n          var widgetRenderState = this.getWidgetRenderState(renderOptions);\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            configure: _objectSpread2(_objectSpread2({}, widgetRenderState), {}, {\n              widgetParams: _objectSpread2(_objectSpread2({}, widgetRenderState.widgetParams), {}, {\n                searchParameters: mergeSearchParameters(new algoliasearchHelper_1.SearchParameters((_renderState$configur = renderState.configure) === null || _renderState$configur === void 0 ? void 0 : _renderState$configur.widgetParams.searchParameters), new algoliasearchHelper_1.SearchParameters(widgetRenderState.widgetParams.searchParameters)).getQueryParams()\n              })\n            })\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref2) {\n          var helper = _ref2.helper;\n          if (!connectorState.refine) {\n            connectorState.refine = refine(helper);\n          }\n          return {\n            refine: connectorState.refine,\n            widgetParams: widgetParams\n          };\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(state, _ref3) {\n          var uiState = _ref3.uiState;\n          return mergeSearchParameters(state, new algoliasearchHelper_1.SearchParameters(_objectSpread2(_objectSpread2({}, uiState.configure), widgetParams.searchParameters)));\n        },\n        getWidgetUiState: function getWidgetUiState(uiState) {\n          return _objectSpread2(_objectSpread2({}, uiState), {}, {\n            configure: _objectSpread2(_objectSpread2({}, uiState.configure), widgetParams.searchParameters)\n          });\n        }\n      };\n    };\n  };\n\n  var withUsage$2 = createDocumentationMessageGenerator({\n    name: 'configure-related-items',\n    connector: true\n  });\n  function createOptionalFilter(_ref) {\n    var attributeName = _ref.attributeName,\n      attributeValue = _ref.attributeValue,\n      attributeScore = _ref.attributeScore;\n    return \"\".concat(attributeName, \":\").concat(attributeValue, \"<score=\").concat(attributeScore || 1, \">\");\n  }\n  var connectConfigureRelatedItems = function connectConfigureRelatedItems(renderFn, unmountFn) {\n    return function (widgetParams) {\n      var _ref2 = widgetParams || {},\n        hit = _ref2.hit,\n        matchingPatterns = _ref2.matchingPatterns,\n        _ref2$transformSearch = _ref2.transformSearchParameters,\n        transformSearchParameters = _ref2$transformSearch === void 0 ? function (x) {\n          return x;\n        } : _ref2$transformSearch;\n      if (!hit) {\n        throw new Error(withUsage$2('The `hit` option is required.'));\n      }\n      if (!matchingPatterns) {\n        throw new Error(withUsage$2('The `matchingPatterns` option is required.'));\n      }\n      var optionalFilters = Object.keys(matchingPatterns).reduce(function (acc, attributeName) {\n        var attribute = matchingPatterns[attributeName];\n        var attributeValue = getPropertyByPath(hit, attributeName);\n        var attributeScore = attribute.score;\n        if (Array.isArray(attributeValue)) {\n          return [].concat(_toConsumableArray(acc), [attributeValue.map(function (attributeSubValue) {\n            return createOptionalFilter({\n              attributeName: attributeName,\n              attributeValue: attributeSubValue,\n              attributeScore: attributeScore\n            });\n          })]);\n        }\n        if (typeof attributeValue === 'string') {\n          return [].concat(_toConsumableArray(acc), [createOptionalFilter({\n            attributeName: attributeName,\n            attributeValue: attributeValue,\n            attributeScore: attributeScore\n          })]);\n        }\n         _warning(false, \"\\nThe `matchingPatterns` option returned a value of type \".concat(getObjectType(attributeValue), \" for the \\\"\").concat(attributeName, \"\\\" key. This value was not sent to Algolia because `optionalFilters` only supports strings and array of strings.\\n\\nYou can remove the \\\"\").concat(attributeName, \"\\\" key from the `matchingPatterns` option.\\n\\nSee https://www.algolia.com/doc/api-reference/api-parameters/optionalFilters/\\n            \")) ;\n        return acc;\n      }, []);\n      var searchParameters = _objectSpread2({}, transformSearchParameters(new algoliasearchHelper_1.SearchParameters({\n        sumOrFiltersScores: true,\n        facetFilters: [\"objectID:-\".concat(hit.objectID)],\n        optionalFilters: optionalFilters\n      })));\n      var makeWidget = connectConfigure(renderFn, unmountFn);\n      return _objectSpread2(_objectSpread2({}, makeWidget({\n        searchParameters: searchParameters\n      })), {}, {\n        $$type: 'ais.configureRelatedItems'\n      });\n    };\n  };\n\n  var withUsage$3 = createDocumentationMessageGenerator({\n    name: 'dynamic-widgets',\n    connector: true\n  });\n  var MAX_WILDCARD_FACETS = 20;\n  var connectDynamicWidgets = function connectDynamicWidgets(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$3());\n    return function (widgetParams) {\n      var widgets = widgetParams.widgets,\n        _widgetParams$maxValu = widgetParams.maxValuesPerFacet,\n        maxValuesPerFacet = _widgetParams$maxValu === void 0 ? 20 : _widgetParams$maxValu,\n        _widgetParams$facets = widgetParams.facets,\n        facets = _widgetParams$facets === void 0 ? ['*'] : _widgetParams$facets,\n        _widgetParams$transfo = widgetParams.transformItems,\n        transformItems = _widgetParams$transfo === void 0 ? function (items) {\n          return items;\n        } : _widgetParams$transfo,\n        fallbackWidget = widgetParams.fallbackWidget;\n      if (!(widgets && Array.isArray(widgets) && widgets.every(function (widget) {\n        return _typeof(widget) === 'object';\n      }))) {\n        throw new Error(withUsage$3('The `widgets` option expects an array of widgets.'));\n      }\n      if (!Array.isArray(facets)) {\n        throw new Error(withUsage$3(\"The `facets` option only accepts an array of facets, you passed \".concat(JSON.stringify(facets))));\n      }\n      var localWidgets = new Map();\n      return {\n        $$type: 'ais.dynamicWidgets',\n        init: function init(initOptions) {\n          widgets.forEach(function (widget) {\n            var attribute = getWidgetAttribute(widget, initOptions);\n            localWidgets.set(attribute, {\n              widget: widget,\n              isMounted: false\n            });\n          });\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: initOptions.instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var parent = renderOptions.parent;\n          var renderState = this.getWidgetRenderState(renderOptions);\n          var widgetsToUnmount = [];\n          var widgetsToMount = [];\n          if (fallbackWidget) {\n            renderState.attributesToRender.forEach(function (attribute) {\n              if (!localWidgets.has(attribute)) {\n                var widget = fallbackWidget({\n                  attribute: attribute\n                });\n                localWidgets.set(attribute, {\n                  widget: widget,\n                  isMounted: false\n                });\n              }\n            });\n          }\n          localWidgets.forEach(function (_ref, attribute) {\n            var widget = _ref.widget,\n              isMounted = _ref.isMounted;\n            var shouldMount = renderState.attributesToRender.indexOf(attribute) > -1;\n            if (!isMounted && shouldMount) {\n              widgetsToMount.push(widget);\n              localWidgets.set(attribute, {\n                widget: widget,\n                isMounted: true\n              });\n            } else if (isMounted && !shouldMount) {\n              widgetsToUnmount.push(widget);\n              localWidgets.set(attribute, {\n                widget: widget,\n                isMounted: false\n              });\n            }\n          });\n          parent.addWidgets(widgetsToMount);\n          // make sure this only happens after the regular render, otherwise it\n          // happens too quick, since render is \"deferred\" for the next microtask,\n          // so this needs to be a whole task later\n          setTimeout(function () {\n            return parent.removeWidgets(widgetsToUnmount);\n          }, 0);\n          renderFn(_objectSpread2(_objectSpread2({}, renderState), {}, {\n            instantSearchInstance: renderOptions.instantSearchInstance\n          }), false);\n        },\n        dispose: function dispose(_ref2) {\n          var parent = _ref2.parent;\n          var toRemove = [];\n          localWidgets.forEach(function (_ref3) {\n            var widget = _ref3.widget,\n              isMounted = _ref3.isMounted;\n            if (isMounted) {\n              toRemove.push(widget);\n            }\n          });\n          parent.removeWidgets(toRemove);\n          unmountFn();\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(state) {\n          return facets.reduce(function (acc, curr) {\n            return acc.addFacet(curr);\n          }, state.setQueryParameters({\n            maxValuesPerFacet: Math.max(maxValuesPerFacet || 0, state.maxValuesPerFacet || 0)\n          }));\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            dynamicWidgets: this.getWidgetRenderState(renderOptions)\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref4) {\n          var _results$renderingCon, _results$renderingCon2, _results$renderingCon3, _results$renderingCon4;\n          var results = _ref4.results,\n            state = _ref4.state;\n          if (!results) {\n            return {\n              attributesToRender: [],\n              widgetParams: widgetParams\n            };\n          }\n          var attributesToRender = transformItems((_results$renderingCon = (_results$renderingCon2 = results.renderingContent) === null || _results$renderingCon2 === void 0 ? void 0 : (_results$renderingCon3 = _results$renderingCon2.facetOrdering) === null || _results$renderingCon3 === void 0 ? void 0 : (_results$renderingCon4 = _results$renderingCon3.facets) === null || _results$renderingCon4 === void 0 ? void 0 : _results$renderingCon4.order) !== null && _results$renderingCon !== void 0 ? _results$renderingCon : [], {\n            results: results\n          });\n          if (!Array.isArray(attributesToRender)) {\n            throw new Error(withUsage$3('The `transformItems` option expects a function that returns an Array.'));\n          }\n           _warning(maxValuesPerFacet >= (state.maxValuesPerFacet || 0), \"The maxValuesPerFacet set by dynamic widgets (\".concat(maxValuesPerFacet, \") is smaller than one of the limits set by a widget (\").concat(state.maxValuesPerFacet, \"). This causes a mismatch in query parameters and thus an extra network request when that widget is mounted.\")) ;\n           _warning(attributesToRender.length <= MAX_WILDCARD_FACETS || widgetParams.facets !== undefined, \"More than \".concat(MAX_WILDCARD_FACETS, \" facets are requested to be displayed without explicitly setting which facets to retrieve. This could have a performance impact. Set \\\"facets\\\" to [] to do two smaller network requests, or explicitly to ['*'] to avoid this warning.\")) ;\n          return {\n            attributesToRender: attributesToRender,\n            widgetParams: widgetParams\n          };\n        }\n      };\n    };\n  };\n\n  var withUsage$4 = createDocumentationMessageGenerator({\n    name: 'clear-refinements',\n    connector: true\n  });\n  var connectClearRefinements = function connectClearRefinements(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$4());\n    return function (widgetParams) {\n      var _ref = widgetParams || {},\n        _ref$includedAttribut = _ref.includedAttributes,\n        includedAttributes = _ref$includedAttribut === void 0 ? [] : _ref$includedAttribut,\n        _ref$excludedAttribut = _ref.excludedAttributes,\n        excludedAttributes = _ref$excludedAttribut === void 0 ? ['query'] : _ref$excludedAttribut,\n        _ref$transformItems = _ref.transformItems,\n        transformItems = _ref$transformItems === void 0 ? function (items) {\n          return items;\n        } : _ref$transformItems;\n      if (widgetParams && widgetParams.includedAttributes && widgetParams.excludedAttributes) {\n        throw new Error(withUsage$4('The options `includedAttributes` and `excludedAttributes` cannot be used together.'));\n      }\n      var connectorState = {\n        refine: noop,\n        createURL: function createURL() {\n          return '';\n        },\n        attributesToClear: []\n      };\n      var cachedRefine = function cachedRefine() {\n        return connectorState.refine();\n      };\n      var cachedCreateURL = function cachedCreateURL() {\n        return connectorState.createURL();\n      };\n      return {\n        $$type: 'ais.clearRefinements',\n        init: function init(initOptions) {\n          var instantSearchInstance = initOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var instantSearchInstance = renderOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), false);\n        },\n        dispose: function dispose() {\n          unmountFn();\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            clearRefinements: this.getWidgetRenderState(renderOptions)\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref2) {\n          var createURL = _ref2.createURL,\n            scopedResults = _ref2.scopedResults,\n            results = _ref2.results;\n          connectorState.attributesToClear = scopedResults.reduce(function (attributesToClear, scopedResult) {\n            return attributesToClear.concat(getAttributesToClear({\n              scopedResult: scopedResult,\n              includedAttributes: includedAttributes,\n              excludedAttributes: excludedAttributes,\n              transformItems: transformItems,\n              results: results\n            }));\n          }, []);\n          connectorState.refine = function () {\n            connectorState.attributesToClear.forEach(function (_ref3) {\n              var indexHelper = _ref3.helper,\n                items = _ref3.items;\n              indexHelper.setState(clearRefinements({\n                helper: indexHelper,\n                attributesToClear: items\n              })).search();\n            });\n          };\n          connectorState.createURL = function () {\n            return createURL(mergeSearchParameters.apply(void 0, _toConsumableArray(connectorState.attributesToClear.map(function (_ref4) {\n              var indexHelper = _ref4.helper,\n                items = _ref4.items;\n              return clearRefinements({\n                helper: indexHelper,\n                attributesToClear: items\n              });\n            }))));\n          };\n          var canRefine = connectorState.attributesToClear.some(function (attributeToClear) {\n            return attributeToClear.items.length > 0;\n          });\n          return {\n            canRefine: canRefine,\n            hasRefinements: canRefine,\n            refine: cachedRefine,\n            createURL: cachedCreateURL,\n            widgetParams: widgetParams\n          };\n        }\n      };\n    };\n  };\n  function getAttributesToClear(_ref5) {\n    var scopedResult = _ref5.scopedResult,\n      includedAttributes = _ref5.includedAttributes,\n      excludedAttributes = _ref5.excludedAttributes,\n      transformItems = _ref5.transformItems,\n      results = _ref5.results;\n    var includesQuery = includedAttributes.indexOf('query') !== -1 || excludedAttributes.indexOf('query') === -1;\n    return {\n      helper: scopedResult.helper,\n      items: transformItems(uniq(getRefinements(scopedResult.results, scopedResult.helper.state, includesQuery).map(function (refinement) {\n        return refinement.attribute;\n      }).filter(function (attribute) {\n        return (\n          // If the array is empty (default case), we keep all the attributes\n          includedAttributes.length === 0 ||\n          // Otherwise, only add the specified attributes\n          includedAttributes.indexOf(attribute) !== -1\n        );\n      }).filter(function (attribute) {\n        return (\n          // If the query is included, we ignore the default `excludedAttributes = ['query']`\n          attribute === 'query' && includesQuery ||\n          // Otherwise, ignore the excluded attributes\n          excludedAttributes.indexOf(attribute) === -1\n        );\n      })), {\n        results: results\n      })\n    };\n  }\n\n  var withUsage$5 = createDocumentationMessageGenerator({\n    name: 'current-refinements',\n    connector: true\n  });\n  var connectCurrentRefinements = function connectCurrentRefinements(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$5());\n    return function (widgetParams) {\n      if ((widgetParams || {}).includedAttributes && (widgetParams || {}).excludedAttributes) {\n        throw new Error(withUsage$5('The options `includedAttributes` and `excludedAttributes` cannot be used together.'));\n      }\n      var _ref = widgetParams || {},\n        includedAttributes = _ref.includedAttributes,\n        _ref$excludedAttribut = _ref.excludedAttributes,\n        excludedAttributes = _ref$excludedAttribut === void 0 ? ['query'] : _ref$excludedAttribut,\n        _ref$transformItems = _ref.transformItems,\n        transformItems = _ref$transformItems === void 0 ? function (items) {\n          return items;\n        } : _ref$transformItems;\n      return {\n        $$type: 'ais.currentRefinements',\n        init: function init(initOptions) {\n          var instantSearchInstance = initOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var instantSearchInstance = renderOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), false);\n        },\n        dispose: function dispose() {\n          unmountFn();\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            currentRefinements: this.getWidgetRenderState(renderOptions)\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref2) {\n          var results = _ref2.results,\n            scopedResults = _ref2.scopedResults,\n            _createURL = _ref2.createURL,\n            helper = _ref2.helper;\n          function getItems() {\n            if (!results) {\n              return transformItems(getRefinementsItems({\n                results: null,\n                helper: helper,\n                indexId: helper.state.index,\n                includedAttributes: includedAttributes,\n                excludedAttributes: excludedAttributes\n              }), {\n                results: results\n              });\n            }\n            return scopedResults.reduce(function (accResults, scopedResult) {\n              return accResults.concat(transformItems(getRefinementsItems({\n                results: scopedResult.results,\n                helper: scopedResult.helper,\n                indexId: scopedResult.indexId,\n                includedAttributes: includedAttributes,\n                excludedAttributes: excludedAttributes\n              }), {\n                results: results\n              }));\n            }, []);\n          }\n          var items = getItems();\n          return {\n            items: items,\n            canRefine: items.length > 0,\n            refine: function refine(refinement) {\n              return clearRefinement(helper, refinement);\n            },\n            createURL: function createURL(refinement) {\n              return _createURL(clearRefinementFromState(helper.state, refinement));\n            },\n            widgetParams: widgetParams\n          };\n        }\n      };\n    };\n  };\n  function getRefinementsItems(_ref3) {\n    var results = _ref3.results,\n      helper = _ref3.helper,\n      indexId = _ref3.indexId,\n      includedAttributes = _ref3.includedAttributes,\n      excludedAttributes = _ref3.excludedAttributes;\n    var includesQuery = (includedAttributes || []).indexOf('query') !== -1 || (excludedAttributes || []).indexOf('query') === -1;\n    var filterFunction = includedAttributes ? function (item) {\n      return includedAttributes.indexOf(item.attribute) !== -1;\n    } : function (item) {\n      return excludedAttributes.indexOf(item.attribute) === -1;\n    };\n    var items = getRefinements(results, helper.state, includesQuery).map(normalizeRefinement).filter(filterFunction);\n    return items.reduce(function (allItems, currentItem) {\n      return [].concat(_toConsumableArray(allItems.filter(function (item) {\n        return item.attribute !== currentItem.attribute;\n      })), [{\n        indexName: helper.state.index,\n        indexId: indexId,\n        attribute: currentItem.attribute,\n        label: currentItem.attribute,\n        refinements: items.filter(function (result) {\n          return result.attribute === currentItem.attribute;\n        })\n        // We want to keep the order of refinements except the numeric ones.\n        .sort(function (a, b) {\n          return a.type === 'numeric' ? a.value - b.value : 0;\n        }),\n        refine: function refine(refinement) {\n          return clearRefinement(helper, refinement);\n        }\n      }]);\n    }, []);\n  }\n  function clearRefinementFromState(state, refinement) {\n    state = state.resetPage();\n    switch (refinement.type) {\n      case 'facet':\n        return state.removeFacetRefinement(refinement.attribute, String(refinement.value));\n      case 'disjunctive':\n        return state.removeDisjunctiveFacetRefinement(refinement.attribute, String(refinement.value));\n      case 'hierarchical':\n        return state.removeHierarchicalFacetRefinement(refinement.attribute);\n      case 'exclude':\n        return state.removeExcludeRefinement(refinement.attribute, String(refinement.value));\n      case 'numeric':\n        return state.removeNumericRefinement(refinement.attribute, refinement.operator, String(refinement.value));\n      case 'tag':\n        return state.removeTagRefinement(String(refinement.value));\n      case 'query':\n        return state.setQueryParameter('query', '');\n      default:\n         _warning(false, \"The refinement type \\\"\".concat(refinement.type, \"\\\" does not exist and cannot be cleared from the current refinements.\")) ;\n        return state;\n    }\n  }\n  function clearRefinement(helper, refinement) {\n    helper.setState(clearRefinementFromState(helper.state, refinement)).search();\n  }\n  function getOperatorSymbol(operator) {\n    switch (operator) {\n      case '>=':\n        return '≥';\n      case '<=':\n        return '≤';\n      default:\n        return operator;\n    }\n  }\n  function normalizeRefinement(refinement) {\n    var value = getValue(refinement);\n    var label = refinement.operator ? \"\".concat(getOperatorSymbol(refinement.operator), \" \").concat(refinement.name) : refinement.name;\n    var normalizedRefinement = {\n      attribute: refinement.attribute,\n      type: refinement.type,\n      value: value,\n      label: label\n    };\n    if (refinement.operator !== undefined) {\n      normalizedRefinement.operator = refinement.operator;\n    }\n    if (refinement.count !== undefined) {\n      normalizedRefinement.count = refinement.count;\n    }\n    if (refinement.exhaustive !== undefined) {\n      normalizedRefinement.exhaustive = refinement.exhaustive;\n    }\n    return normalizedRefinement;\n  }\n  function getValue(refinement) {\n    if (refinement.type === 'numeric') {\n      return Number(refinement.name);\n    }\n    if ('escapedValue' in refinement) {\n      return refinement.escapedValue;\n    }\n    return refinement.name;\n  }\n\n  var _excluded$1 = [\"name\", \"escapedValue\", \"data\", \"path\"];\n  var withUsage$6 = createDocumentationMessageGenerator({\n    name: 'hierarchical-menu',\n    connector: true\n  });\n  var DEFAULT_SORT = ['name:asc'];\n  /**\n   * **HierarchicalMenu** connector provides the logic to build a custom widget\n   * that will give the user the ability to explore facets in a tree-like structure.\n   *\n   * This is commonly used for multi-level categorization of products on e-commerce\n   * websites. From a UX point of view, we suggest not displaying more than two\n   * levels deep.\n   *\n   * @type {Connector}\n   * @param {function(HierarchicalMenuRenderingOptions, boolean)} renderFn Rendering function for the custom **HierarchicalMenu** widget.\n   * @param {function} unmountFn Unmount function called when the widget is disposed.\n   * @return {function(CustomHierarchicalMenuWidgetParams)} Re-usable widget factory for a custom **HierarchicalMenu** widget.\n   */\n  var connectHierarchicalMenu = function connectHierarchicalMenu(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$6());\n    return function (widgetParams) {\n      var _ref = widgetParams || {},\n        attributes = _ref.attributes,\n        _ref$separator = _ref.separator,\n        separator = _ref$separator === void 0 ? ' > ' : _ref$separator,\n        _ref$rootPath = _ref.rootPath,\n        rootPath = _ref$rootPath === void 0 ? null : _ref$rootPath,\n        _ref$showParentLevel = _ref.showParentLevel,\n        showParentLevel = _ref$showParentLevel === void 0 ? true : _ref$showParentLevel,\n        _ref$limit = _ref.limit,\n        limit = _ref$limit === void 0 ? 10 : _ref$limit,\n        _ref$showMore = _ref.showMore,\n        showMore = _ref$showMore === void 0 ? false : _ref$showMore,\n        _ref$showMoreLimit = _ref.showMoreLimit,\n        showMoreLimit = _ref$showMoreLimit === void 0 ? 20 : _ref$showMoreLimit,\n        _ref$sortBy = _ref.sortBy,\n        sortBy = _ref$sortBy === void 0 ? DEFAULT_SORT : _ref$sortBy,\n        _ref$transformItems = _ref.transformItems,\n        transformItems = _ref$transformItems === void 0 ? function (items) {\n          return items;\n        } : _ref$transformItems;\n      if (!attributes || !Array.isArray(attributes) || attributes.length === 0) {\n        throw new Error(withUsage$6('The `attributes` option expects an array of strings.'));\n      }\n      if (showMore === true && showMoreLimit <= limit) {\n        throw new Error(withUsage$6('The `showMoreLimit` option must be greater than `limit`.'));\n      }\n      // we need to provide a hierarchicalFacet name for the search state\n      // so that we can always map $hierarchicalFacetName => real attributes\n      // we use the first attribute name\n      var _attributes = _slicedToArray(attributes, 1),\n        hierarchicalFacetName = _attributes[0];\n      var sendEvent;\n\n      // Provide the same function to the `renderFn` so that way the user\n      // has to only bind it once when `isFirstRendering` for instance\n      var toggleShowMore = function toggleShowMore() {};\n      function cachedToggleShowMore() {\n        toggleShowMore();\n      }\n      var _refine;\n      var isShowingMore = false;\n      function createToggleShowMore(renderOptions, widget) {\n        return function () {\n          isShowingMore = !isShowingMore;\n          widget.render(renderOptions);\n        };\n      }\n      function getLimit() {\n        return isShowingMore ? showMoreLimit : limit;\n      }\n      function _prepareFacetValues(facetValues) {\n        return facetValues.slice(0, getLimit()).map(function (_ref2) {\n          var label = _ref2.name,\n            value = _ref2.escapedValue,\n            data = _ref2.data,\n            path = _ref2.path,\n            subValue = _objectWithoutProperties(_ref2, _excluded$1);\n          var item = _objectSpread2(_objectSpread2({}, subValue), {}, {\n            value: value,\n            label: label,\n            data: null\n          });\n          if (Array.isArray(data)) {\n            item.data = _prepareFacetValues(data);\n          }\n          return item;\n        });\n      }\n      return {\n        $$type: 'ais.hierarchicalMenu',\n        init: function init(initOptions) {\n          var instantSearchInstance = initOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var instantSearchInstance = renderOptions.instantSearchInstance;\n          toggleShowMore = createToggleShowMore(renderOptions, this);\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), false);\n        },\n        dispose: function dispose(_ref3) {\n          var state = _ref3.state;\n          unmountFn();\n          return state.removeHierarchicalFacet(hierarchicalFacetName).setQueryParameter('maxValuesPerFacet', undefined);\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            hierarchicalMenu: _objectSpread2(_objectSpread2({}, renderState.hierarchicalMenu), {}, _defineProperty({}, hierarchicalFacetName, this.getWidgetRenderState(renderOptions)))\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref4) {\n          var _this = this;\n          var results = _ref4.results,\n            state = _ref4.state,\n            createURL = _ref4.createURL,\n            instantSearchInstance = _ref4.instantSearchInstance,\n            helper = _ref4.helper;\n          var items = [];\n          var canToggleShowMore = false;\n\n          // Bind createURL to this specific attribute\n          var _createURL = function _createURL(facetValue) {\n            return createURL(function (uiState) {\n              return _this.getWidgetUiState(uiState, {\n                searchParameters: state.resetPage().toggleFacetRefinement(hierarchicalFacetName, facetValue),\n                helper: helper\n              });\n            });\n          };\n          if (!sendEvent) {\n            sendEvent = createSendEventForFacet({\n              instantSearchInstance: instantSearchInstance,\n              helper: helper,\n              attribute: function attribute(facetValue) {\n                var index = facetValue.split(separator).length - 1;\n                return attributes[index];\n              },\n              widgetType: this.$$type\n            });\n          }\n          if (!_refine) {\n            _refine = function _refine(facetValue) {\n              sendEvent('click:internal', facetValue);\n              helper.toggleFacetRefinement(hierarchicalFacetName, facetValue).search();\n            };\n          }\n          if (results) {\n            var facetValues = results.getFacetValues(hierarchicalFacetName, {\n              sortBy: sortBy,\n              facetOrdering: sortBy === DEFAULT_SORT\n            });\n            var facetItems = facetValues && !Array.isArray(facetValues) && facetValues.data ? facetValues.data : [];\n\n            // If the limit is the max number of facet retrieved it is impossible to know\n            // if the facets are exhaustive. The only moment we are sure it is exhaustive\n            // is when it is strictly under the number requested unless we know that another\n            // widget has requested more values (maxValuesPerFacet > getLimit()).\n            // Because this is used for making the search of facets unable or not, it is important\n            // to be conservative here.\n            var hasExhaustiveItems = (state.maxValuesPerFacet || 0) > getLimit() ? facetItems.length <= getLimit() : facetItems.length < getLimit();\n            canToggleShowMore = showMore && (isShowingMore || !hasExhaustiveItems);\n            items = transformItems(_prepareFacetValues(facetItems), {\n              results: results\n            });\n          }\n          return {\n            items: items,\n            refine: _refine,\n            canRefine: items.length > 0,\n            createURL: _createURL,\n            sendEvent: sendEvent,\n            widgetParams: widgetParams,\n            isShowingMore: isShowingMore,\n            toggleShowMore: cachedToggleShowMore,\n            canToggleShowMore: canToggleShowMore\n          };\n        },\n        getWidgetUiState: function getWidgetUiState(uiState, _ref5) {\n          var searchParameters = _ref5.searchParameters;\n          var path = searchParameters.getHierarchicalFacetBreadcrumb(hierarchicalFacetName);\n          return removeEmptyRefinementsFromUiState(_objectSpread2(_objectSpread2({}, uiState), {}, {\n            hierarchicalMenu: _objectSpread2(_objectSpread2({}, uiState.hierarchicalMenu), {}, _defineProperty({}, hierarchicalFacetName, path))\n          }), hierarchicalFacetName);\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref6) {\n          var uiState = _ref6.uiState;\n          var values = uiState.hierarchicalMenu && uiState.hierarchicalMenu[hierarchicalFacetName];\n          if (searchParameters.isConjunctiveFacet(hierarchicalFacetName) || searchParameters.isDisjunctiveFacet(hierarchicalFacetName)) {\n             _warning(false, \"HierarchicalMenu: Attribute \\\"\".concat(hierarchicalFacetName, \"\\\" is already used by another widget applying conjunctive or disjunctive faceting.\\nAs this is not supported, please make sure to remove this other widget or this HierarchicalMenu widget will not work at all.\")) ;\n            return searchParameters;\n          }\n          if (searchParameters.isHierarchicalFacet(hierarchicalFacetName)) {\n            var facet = searchParameters.getHierarchicalFacetByName(hierarchicalFacetName);\n             _warning(isEqual(facet.attributes, attributes) && facet.separator === separator && facet.rootPath === rootPath, 'Using Breadcrumb and HierarchicalMenu on the same facet with different options overrides the configuration of the HierarchicalMenu.') ;\n          }\n          var withFacetConfiguration = searchParameters.removeHierarchicalFacet(hierarchicalFacetName).addHierarchicalFacet({\n            name: hierarchicalFacetName,\n            attributes: attributes,\n            separator: separator,\n            rootPath: rootPath,\n            showParentLevel: showParentLevel\n          });\n          var currentMaxValuesPerFacet = withFacetConfiguration.maxValuesPerFacet || 0;\n          var nextMaxValuesPerFacet = Math.max(currentMaxValuesPerFacet, showMore ? showMoreLimit : limit);\n          var withMaxValuesPerFacet = withFacetConfiguration.setQueryParameter('maxValuesPerFacet', nextMaxValuesPerFacet);\n          if (!values) {\n            return withMaxValuesPerFacet.setQueryParameters({\n              hierarchicalFacetsRefinements: _objectSpread2(_objectSpread2({}, withMaxValuesPerFacet.hierarchicalFacetsRefinements), {}, _defineProperty({}, hierarchicalFacetName, []))\n            });\n          }\n          return withMaxValuesPerFacet.addHierarchicalFacetRefinement(hierarchicalFacetName, values.join(separator));\n        }\n      };\n    };\n  };\n  function removeEmptyRefinementsFromUiState(indexUiState, attribute) {\n    if (!indexUiState.hierarchicalMenu) {\n      return indexUiState;\n    }\n    if (!indexUiState.hierarchicalMenu[attribute] || indexUiState.hierarchicalMenu[attribute].length === 0) {\n      delete indexUiState.hierarchicalMenu[attribute];\n    }\n    if (Object.keys(indexUiState.hierarchicalMenu).length === 0) {\n      delete indexUiState.hierarchicalMenu;\n    }\n    return indexUiState;\n  }\n\n  var withUsage$7 = createDocumentationMessageGenerator({\n    name: 'hits',\n    connector: true\n  });\n  var connectHits = (function connectHits(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$7());\n    return function (widgetParams) {\n      var _ref = widgetParams || {},\n        _ref$escapeHTML = _ref.escapeHTML,\n        escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,\n        _ref$transformItems = _ref.transformItems,\n        transformItems = _ref$transformItems === void 0 ? function (items) {\n          return items;\n        } : _ref$transformItems;\n      var sendEvent;\n      var bindEvent;\n      return {\n        $$type: 'ais.hits',\n        init: function init(initOptions) {\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: initOptions.instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var renderState = this.getWidgetRenderState(renderOptions);\n          renderFn(_objectSpread2(_objectSpread2({}, renderState), {}, {\n            instantSearchInstance: renderOptions.instantSearchInstance\n          }), false);\n          renderState.sendEvent('view:internal', renderState.items);\n        },\n        getRenderState: function getRenderState(renderState, renderOptions\n        // Type is explicitly redefined, to avoid having the TWidgetParams type in the definition\n        ) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            hits: this.getWidgetRenderState(renderOptions)\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref2) {\n          var _results$renderingCon, _results$renderingCon2, _results$renderingCon3;\n          var results = _ref2.results,\n            helper = _ref2.helper,\n            instantSearchInstance = _ref2.instantSearchInstance;\n          if (!sendEvent) {\n            sendEvent = createSendEventForHits({\n              instantSearchInstance: instantSearchInstance,\n              helper: helper,\n              widgetType: this.$$type\n            });\n          }\n          if (!bindEvent) {\n            bindEvent = createBindEventForHits({\n              helper: helper,\n              widgetType: this.$$type,\n              instantSearchInstance: instantSearchInstance\n            });\n          }\n          if (!results) {\n            return {\n              hits: [],\n              items: [],\n              results: undefined,\n              banner: undefined,\n              sendEvent: sendEvent,\n              bindEvent: bindEvent,\n              widgetParams: widgetParams\n            };\n          }\n          if (escapeHTML && results.hits.length > 0) {\n            results.hits = escapeHits(results.hits);\n          }\n          var hitsWithAbsolutePosition = addAbsolutePosition(results.hits, results.page, results.hitsPerPage);\n          var hitsWithAbsolutePositionAndQueryID = addQueryID(hitsWithAbsolutePosition, results.queryID);\n          var items = transformItems(hitsWithAbsolutePositionAndQueryID, {\n            results: results\n          });\n          var banner = (_results$renderingCon = results.renderingContent) === null || _results$renderingCon === void 0 ? void 0 : (_results$renderingCon2 = _results$renderingCon.widgets) === null || _results$renderingCon2 === void 0 ? void 0 : (_results$renderingCon3 = _results$renderingCon2.banners) === null || _results$renderingCon3 === void 0 ? void 0 : _results$renderingCon3[0];\n          return {\n            hits: items,\n            items: items,\n            results: results,\n            banner: banner,\n            sendEvent: sendEvent,\n            bindEvent: bindEvent,\n            widgetParams: widgetParams\n          };\n        },\n        dispose: function dispose(_ref3) {\n          var state = _ref3.state;\n          unmountFn();\n          if (!escapeHTML) {\n            return state;\n          }\n          return state.setQueryParameters(Object.keys(TAG_PLACEHOLDER).reduce(function (acc, key) {\n            return _objectSpread2(_objectSpread2({}, acc), {}, _defineProperty({}, key, undefined));\n          }, {}));\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(state, _uiState) {\n          if (!escapeHTML) {\n            return state;\n          }\n\n          // @MAJOR: set this globally, not in the Hits widget to allow Hits to be conditionally used\n          return state.setQueryParameters(TAG_PLACEHOLDER);\n        }\n      };\n    };\n  });\n\n  var getSelectedHits = function getSelectedHits(hits, selectedObjectIDs) {\n    return selectedObjectIDs.map(function (objectID) {\n      var hit = find(hits, function (h) {\n        return h.objectID === objectID;\n      });\n      if (typeof hit === 'undefined') {\n        throw new Error(\"Could not find objectID \\\"\".concat(objectID, \"\\\" passed to `clickedObjectIDsAfterSearch` in the returned hits. This is necessary to infer the absolute position and the query ID.\"));\n      }\n      return hit;\n    });\n  };\n  var getQueryID = function getQueryID(selectedHits) {\n    var queryIDs = uniq(selectedHits.map(function (hit) {\n      return hit.__queryID;\n    }));\n    if (queryIDs.length > 1) {\n      throw new Error('Insights currently allows a single `queryID`. The `objectIDs` provided map to multiple `queryID`s.');\n    }\n    var queryID = queryIDs[0];\n    if (typeof queryID !== 'string') {\n      throw new Error(\"Could not infer `queryID`. Ensure InstantSearch `clickAnalytics: true` was added with the Configure widget.\\n\\nSee: https://alg.li/lNiZZ7\");\n    }\n    return queryID;\n  };\n  var getPositions = function getPositions(selectedHits) {\n    return selectedHits.map(function (hit) {\n      return hit.__position;\n    });\n  };\n  var inferPayload = function inferPayload(_ref) {\n    var method = _ref.method,\n      results = _ref.results,\n      hits = _ref.hits,\n      objectIDs = _ref.objectIDs;\n    var index = results.index;\n    var selectedHits = getSelectedHits(hits, objectIDs);\n    var queryID = getQueryID(selectedHits);\n    switch (method) {\n      case 'clickedObjectIDsAfterSearch':\n        {\n          var positions = getPositions(selectedHits);\n          return {\n            index: index,\n            queryID: queryID,\n            objectIDs: objectIDs,\n            positions: positions\n          };\n        }\n      case 'convertedObjectIDsAfterSearch':\n        return {\n          index: index,\n          queryID: queryID,\n          objectIDs: objectIDs\n        };\n      default:\n        throw new Error(\"Unsupported method passed to insights: \\\"\".concat(method, \"\\\".\"));\n    }\n  };\n  var wrapInsightsClient = function wrapInsightsClient(aa, results, hits) {\n    return function (method) {\n      for (var _len = arguments.length, payloads = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n        payloads[_key - 1] = arguments[_key];\n      }\n      var payload = payloads[0];\n       _warning(false, \"`insights` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `insights` middleware.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\") ;\n      if (!aa) {\n        var withInstantSearchUsage = createDocumentationMessageGenerator({\n          name: 'instantsearch'\n        });\n        throw new Error(withInstantSearchUsage('The `insightsClient` option has not been provided to `instantsearch`.'));\n      }\n      if (!Array.isArray(payload.objectIDs)) {\n        throw new TypeError('Expected `objectIDs` to be an array.');\n      }\n      var inferredPayload = inferPayload({\n        method: method,\n        results: results,\n        hits: hits,\n        objectIDs: payload.objectIDs\n      });\n      aa(method, _objectSpread2(_objectSpread2({}, inferredPayload), payload));\n    };\n  };\n\n  /**\n   * @deprecated This function will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\n   * It passes `insights` to `HitsWithInsightsListener` and `InfiniteHitsWithInsightsListener`.\n   */\n  function withInsights(connector) {\n    return function (renderFn, unmountFn) {\n      return connector(function (renderOptions, isFirstRender) {\n        var results = renderOptions.results,\n          hits = renderOptions.hits,\n          instantSearchInstance = renderOptions.instantSearchInstance;\n        if (results && hits && instantSearchInstance) {\n          var insights = wrapInsightsClient(instantSearchInstance.insightsClient, results, hits);\n          return renderFn(_objectSpread2(_objectSpread2({}, renderOptions), {}, {\n            insights: insights\n          }), isFirstRender);\n        }\n        return renderFn(renderOptions, isFirstRender);\n      }, unmountFn);\n    };\n  }\n\n  var n,l,u,t,o,r,f={},e=[],c=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function s(n,l){for(var u in l)n[u]=l[u];return n}function a(n){var l=n.parentNode;l&&l.removeChild(n);}function h(l,u,i){var t,o,r,f={};for(r in u)\"key\"==r?t=u[r]:\"ref\"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),\"function\"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return v(l,f,t,o,null)}function v(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u:r};return null==r&&null!=l.vnode&&l.vnode(f),f}function y(){return {current:null}}function p(n){return n.children}function d(n,l){this.props=n,this.context=l;}function _(n,l){if(null==l)return n.__?_(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return \"function\"==typeof n.type?_(n):null}function k(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return k(n)}}function b(n){(!n.__d&&(n.__d=!0)&&t.push(n)&&!g.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||setTimeout)(g);}function g(){for(var n;g.__r=t.length;)n=t.sort(function(n,l){return n.__v.__b-l.__v.__b}),t=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=s({},t)).__v=t.__v+1,j(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?_(t):o,t.__h),z(u,t),t.__e!=o&&k(t)));});}function w(n,l,u,i,t,o,r,c,s,a){var h,y,d,k,b,g,w,x=i&&i.__k||e,C=x.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(k=u.__k[h]=null==(k=l[h])||\"boolean\"==typeof k?null:\"string\"==typeof k||\"number\"==typeof k||\"bigint\"==typeof k?v(null,k,null,null,k):Array.isArray(k)?v(p,{children:k},null,null,null):k.__b>0?v(k.type,k.props,k.key,k.ref?k.ref:null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(d=x[h])||d&&k.key==d.key&&k.type===d.type)x[h]=void 0;else for(y=0;y<C;y++){if((d=x[y])&&k.key==d.key&&k.type===d.type){x[y]=void 0;break}d=null;}j(n,k,d=d||f,t,o,r,c,s,a),b=k.__e,(y=k.ref)&&d.ref!=y&&(w||(w=[]),d.ref&&w.push(d.ref,null,k),w.push(y,k.__c||b,k)),null!=b?(null==g&&(g=b),\"function\"==typeof k.type&&k.__k===d.__k?k.__d=s=m(k,s,n):s=A(n,k,d,x,b,s),\"function\"==typeof u.type&&(u.__d=s)):s&&d.__e==s&&s.parentNode!=n&&(s=_(d));}for(u.__e=g,h=C;h--;)null!=x[h]&&(\"function\"==typeof u.type&&null!=x[h].__e&&x[h].__e==u.__d&&(u.__d=_(i,h+1)),N(x[h],x[h]));if(w)for(h=0;h<w.length;h++)M(w[h],w[++h],w[++h]);}function m(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l=\"function\"==typeof i.type?m(i,l,u):A(u,i,i,t,i.__e,l));return l}function A(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else{for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,o),r=o;}return void 0!==r?r:t.nextSibling}function C(n,l,u,i,t){var o;for(o in u)\"children\"===o||\"key\"===o||o in l||H(n,o,null,u[o],i);for(o in l)t&&\"function\"!=typeof l[o]||\"children\"===o||\"key\"===o||\"value\"===o||\"checked\"===o||u[o]===l[o]||H(n,o,l[o],u[o],i);}function $(n,l,u){\"-\"===l[0]?n.setProperty(l,u):n[l]=null==u?\"\":\"number\"!=typeof u||c.test(l)?u:u+\"px\";}function H(n,l,u,i,t){var o;n:if(\"style\"===l)if(\"string\"==typeof u)n.style.cssText=u;else{if(\"string\"==typeof i&&(n.style.cssText=i=\"\"),i)for(l in i)u&&l in u||$(n.style,l,\"\");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l]);}else if(\"o\"===l[0]&&\"n\"===l[1])o=l!==(l=l.replace(/Capture$/,\"\")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?T:I,o):n.removeEventListener(l,o?T:I,o);else if(\"dangerouslySetInnerHTML\"!==l){if(t)l=l.replace(/xlink(H|:h)/,\"h\").replace(/sName$/,\"s\");else if(\"href\"!==l&&\"list\"!==l&&\"form\"!==l&&\"tabIndex\"!==l&&\"download\"!==l&&l in n)try{n[l]=null==u?\"\":u;break n}catch(n){}\"function\"==typeof u||(null!=u&&(!1!==u||\"a\"===l[0]&&\"r\"===l[1])?n.setAttribute(l,u):n.removeAttribute(l));}}function I(n){this.l[n.type+!1](l.event?l.event(n):n);}function T(n){this.l[n.type+!0](l.event?l.event(n):n);}function j(n,u,i,t,o,r,f,e,c){var a,h,v,y,_,k,b,g,m,x,A,C,$,H=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(a=l.__b)&&a(u);try{n:if(\"function\"==typeof H){if(g=u.props,m=(a=H.contextType)&&t[a.__c],x=a?m?m.props.value:a.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:(\"prototype\"in H&&H.prototype.render?u.__c=h=new H(g,x):(u.__c=h=new d(g,x),h.constructor=H,h.render=O),m&&m.sub(h),h.props=g,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=H.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=s({},h.__s)),s(h.__s,H.getDerivedStateFromProps(g,h.__s))),y=h.props,_=h.state,v)null==H.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==H.getDerivedStateFromProps&&g!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(g,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(g,h.__s,x)||u.__v===i.__v){h.props=g,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(g,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,_,k);});}if(h.context=x,h.props=g,h.__v=u,h.__P=n,A=l.__r,C=0,\"prototype\"in H&&H.prototype.render)h.state=h.__s,h.__d=!1,A&&A(u),a=h.render(h.props,h.state,h.context);else do{h.__d=!1,A&&A(u),a=h.render(h.props,h.state,h.context),h.state=h.__s;}while(h.__d&&++C<25);h.state=h.__s,null!=h.getChildContext&&(t=s(s({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,_)),$=null!=a&&a.type===p&&null==a.key?a.props.children:a,w(n,Array.isArray($)?$:[$],u,i,t,o,r,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1;}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,o,r,f,c);(a=l.diffed)&&a(u);}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l.__e(n,u,i);}}function z(n,u){l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l.__e(n,u.__v);}});}function L(l,u,i,t,o,r,e,c){var s,h,v,y=i.props,p=u.props,d=u.type,k=0;if(\"svg\"===d&&(o=!0),null!=r)for(;k<r.length;k++)if((s=r[k])&&\"setAttribute\"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,r[k]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=o?document.createElementNS(\"http://www.w3.org/2000/svg\",d):document.createElement(d,p.is&&p),r=null,c=!1;}if(null===d)y===p||c&&l.data===p||(l.data=p);else{if(r=r&&n.call(l.childNodes),h=(y=i.props||f).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=r)for(y={},k=0;k<l.attributes.length;k++)y[l.attributes[k].name]=l.attributes[k].value;(v||h)&&(v&&(h&&v.__html==h.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||\"\"));}if(C(l,p,y,o,c),v)u.__k=[];else if(k=u.props.children,w(l,Array.isArray(k)?k:[k],u,i,t,o&&\"foreignObject\"!==d,r,e,r?r[0]:i.__k&&_(i,0),c),null!=r)for(k=r.length;k--;)null!=r[k]&&a(r[k]);c||(\"value\"in p&&void 0!==(k=p.value)&&(k!==l.value||\"progress\"===d&&!k||\"option\"===d&&k!==y.value)&&H(l,\"value\",k,y.value,!1),\"checked\"in p&&void 0!==(k=p.checked)&&k!==l.checked&&H(l,\"checked\",k,y.checked,!1));}return l}function M(n,u,i){try{\"function\"==typeof n?n(u):n.current=u;}catch(n){l.__e(n,i);}}function N(n,u,i){var t,o;if(l.unmount&&l.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(n){l.__e(n,u);}t.base=t.__P=null,n.__c=void 0;}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&N(t[o],u,\"function\"!=typeof n.type);i||null==n.__e||a(n.__e),n.__=n.__e=n.__d=void 0;}function O(n,l,u){return this.constructor(n,u)}function P(u,i,t){var o,r,e;l.__&&l.__(u,i),r=(o=\"function\"==typeof t)?null:t&&t.__k||i.__k,e=[],j(i,u=(!o&&t||i).__k=h(p,null,[u]),r||f,f,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,e,!o&&t?t:r?r.__e:i.firstChild,o),z(e,u);}n=e.slice,l={__e:function(n,l,u,i){for(var t,o,r;l=l.__;)if((t=l.__c)&&!t.__)try{if((o=t.constructor)&&null!=o.getDerivedStateFromError&&(t.setState(o.getDerivedStateFromError(n)),r=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),r=t.__d),r)return t.__E=t}catch(l){n=l;}throw n}},u=0,d.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=s({},this.state),\"function\"==typeof n&&(n=n(s({},u),this.props)),n&&s(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),b(this));},d.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),b(this));},d.prototype.render=p,t=[],g.__r=0,r=0;\n\n  /** @deprecated use bindEvent instead */\n  function readDataAttributes(domElement) {\n    var method = domElement.getAttribute('data-insights-method');\n    var serializedPayload = domElement.getAttribute('data-insights-payload');\n    if (typeof serializedPayload !== 'string') {\n      throw new Error('The insights helper expects `data-insights-payload` to be a base64-encoded JSON string.');\n    }\n    try {\n      var payload = deserializePayload(serializedPayload);\n      return {\n        method: method,\n        payload: payload\n      };\n    } catch (error) {\n      throw new Error('The insights helper was unable to parse `data-insights-payload`.');\n    }\n  }\n\n  /** @deprecated use bindEvent instead */\n  function writeDataAttributes(_ref) {\n    var method = _ref.method,\n      payload = _ref.payload;\n    if (_typeof(payload) !== 'object') {\n      throw new Error(\"The insights helper expects the payload to be an object.\");\n    }\n    var serializedPayload;\n    try {\n      serializedPayload = serializePayload(payload);\n    } catch (error) {\n      throw new Error(\"Could not JSON serialize the payload object.\");\n    }\n    return \"data-insights-method=\\\"\".concat(method, \"\\\" data-insights-payload=\\\"\").concat(serializedPayload, \"\\\"\");\n  }\n\n  /**\n   * @deprecated This function will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\n   */\n  function insights(method, payload) {\n     _warning(false, \"`insights` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `insights` middleware.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\") ;\n    return writeDataAttributes({\n      method: method,\n      payload: payload\n    });\n  }\n\n  var createInsightsEventHandler = function createInsightsEventHandler(_ref) {\n    var insights = _ref.insights,\n      sendEvent = _ref.sendEvent;\n    return function (event) {\n      // new way, e.g. bindEvent(\"click\", hit, \"Hit clicked\")\n      var insightsThroughSendEvent = findInsightsTarget(event.target, event.currentTarget, function (element) {\n        return element.hasAttribute('data-insights-event');\n      });\n      if (insightsThroughSendEvent) {\n        var payload = parseInsightsEvent(insightsThroughSendEvent);\n        payload.forEach(function (single) {\n          return sendEvent(single);\n        });\n      }\n\n      // old way, e.g. instantsearch.insights(\"clickedObjectIDsAfterSearch\", { .. })\n      var insightsThroughFunction = findInsightsTarget(event.target, event.currentTarget, function (element) {\n        return element.hasAttribute('data-insights-method') && element.hasAttribute('data-insights-payload');\n      });\n      if (insightsThroughFunction) {\n        var _readDataAttributes = readDataAttributes(insightsThroughFunction),\n          method = _readDataAttributes.method,\n          _payload = _readDataAttributes.payload;\n        insights(method, _payload);\n      }\n    };\n  };\n  function findInsightsTarget(startElement, endElement, validator) {\n    var element = startElement;\n    while (element && !validator(element)) {\n      if (element === endElement) {\n        return null;\n      }\n      element = element.parentElement;\n    }\n    return element;\n  }\n  function parseInsightsEvent(element) {\n    var serializedPayload = element.getAttribute('data-insights-event');\n    if (typeof serializedPayload !== 'string') {\n      throw new Error('The insights middleware expects `data-insights-event` to be a base64-encoded JSON string.');\n    }\n    try {\n      return deserializePayload(serializedPayload);\n    } catch (error) {\n      throw new Error('The insights middleware was unable to parse `data-insights-event`.');\n    }\n  }\n\n  /**\n   * Due to https://github.com/microsoft/web-build-tools/issues/1050, we need\n   * Connector<...> imported in this file, even though it is only used implicitly.\n   * This _uses_ Connector<...> so it is not accidentally removed by someone.\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n\n  var connectHitsWithInsights = withInsights(connectHits);\n\n  var withUsage$8 = createDocumentationMessageGenerator({\n    name: 'hits-per-page',\n    connector: true\n  });\n  var connectHitsPerPage = function connectHitsPerPage(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$8());\n    return function (widgetParams) {\n      var _ref = widgetParams || {},\n        userItems = _ref.items,\n        _ref$transformItems = _ref.transformItems,\n        transformItems = _ref$transformItems === void 0 ? function (items) {\n          return items;\n        } : _ref$transformItems;\n      if (!Array.isArray(userItems)) {\n        throw new Error(withUsage$8('The `items` option expects an array of objects.'));\n      }\n      var items = userItems;\n      var defaultItems = items.filter(function (item) {\n        return item.default === true;\n      });\n      if (defaultItems.length === 0) {\n        throw new Error(withUsage$8(\"A default value must be specified in `items`.\"));\n      }\n      if (defaultItems.length > 1) {\n        throw new Error(withUsage$8('More than one default value is specified in `items`.'));\n      }\n      var defaultItem = defaultItems[0];\n      var normalizeItems = function normalizeItems(_ref2) {\n        var hitsPerPage = _ref2.hitsPerPage;\n        return items.map(function (item) {\n          return _objectSpread2(_objectSpread2({}, item), {}, {\n            isRefined: Number(item.value) === Number(hitsPerPage)\n          });\n        });\n      };\n      var connectorState = {\n        getRefine: function getRefine(helper) {\n          return function (value) {\n            return !value && value !== 0 ? helper.setQueryParameter('hitsPerPage', undefined).search() : helper.setQueryParameter('hitsPerPage', value).search();\n          };\n        },\n        createURLFactory: function createURLFactory(_ref3) {\n          var state = _ref3.state,\n            createURL = _ref3.createURL,\n            getWidgetUiState = _ref3.getWidgetUiState,\n            helper = _ref3.helper;\n          return function (value) {\n            return createURL(function (uiState) {\n              return getWidgetUiState(uiState, {\n                searchParameters: state.resetPage().setQueryParameter('hitsPerPage', !value && value !== 0 ? undefined : value),\n                helper: helper\n              });\n            });\n          };\n        }\n      };\n      return {\n        $$type: 'ais.hitsPerPage',\n        init: function init(initOptions) {\n          var state = initOptions.state,\n            instantSearchInstance = initOptions.instantSearchInstance;\n          var isCurrentInOptions = items.some(function (item) {\n            return Number(state.hitsPerPage) === Number(item.value);\n          });\n          if (!isCurrentInOptions) {\n             _warning(state.hitsPerPage !== undefined, \"\\n`hitsPerPage` is not defined.\\nThe option `hitsPerPage` needs to be set using the `configure` widget.\\n\\nLearn more: https://www.algolia.com/doc/api-reference/widgets/hits-per-page/js/\\n            \") ;\n             _warning(false, \"\\nThe `items` option of `hitsPerPage` does not contain the \\\"hits per page\\\" value coming from the state: \".concat(state.hitsPerPage, \".\\n\\nYou may want to add another entry to the `items` option with this value.\")) ;\n            items = [\n            // The helper will convert the empty string to `undefined`.\n            {\n              value: '',\n              label: ''\n            }].concat(_toConsumableArray(items));\n          }\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), true);\n        },\n        render: function render(initOptions) {\n          var instantSearchInstance = initOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), false);\n        },\n        dispose: function dispose(_ref4) {\n          var state = _ref4.state;\n          unmountFn();\n          return state.setQueryParameter('hitsPerPage', undefined);\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            hitsPerPage: this.getWidgetRenderState(renderOptions)\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref5) {\n          var state = _ref5.state,\n            results = _ref5.results,\n            createURL = _ref5.createURL,\n            helper = _ref5.helper;\n          var canRefine = results ? results.nbHits > 0 : false;\n          return {\n            items: transformItems(normalizeItems(state), {\n              results: results\n            }),\n            refine: connectorState.getRefine(helper),\n            createURL: connectorState.createURLFactory({\n              state: state,\n              createURL: createURL,\n              getWidgetUiState: this.getWidgetUiState,\n              helper: helper\n            }),\n            hasNoResults: !canRefine,\n            canRefine: canRefine,\n            widgetParams: widgetParams\n          };\n        },\n        getWidgetUiState: function getWidgetUiState(uiState, _ref6) {\n          var searchParameters = _ref6.searchParameters;\n          var hitsPerPage = searchParameters.hitsPerPage;\n          if (hitsPerPage === undefined || hitsPerPage === defaultItem.value) {\n            return uiState;\n          }\n          return _objectSpread2(_objectSpread2({}, uiState), {}, {\n            hitsPerPage: hitsPerPage\n          });\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref7) {\n          var uiState = _ref7.uiState;\n          return searchParameters.setQueryParameters({\n            hitsPerPage: uiState.hitsPerPage || defaultItem.value\n          });\n        }\n      };\n    };\n  };\n\n  var _excluded$2 = [\"page\"],\n    _excluded2 = [\"clickAnalytics\", \"userToken\"];\n  var withUsage$9 = createDocumentationMessageGenerator({\n    name: 'infinite-hits',\n    connector: true\n  });\n  function getStateWithoutPage(state) {\n    var _ref = state || {},\n      page = _ref.page,\n      rest = _objectWithoutProperties(_ref, _excluded$2);\n    return rest;\n  }\n  function normalizeState(state) {\n    var _ref2 = state || {},\n      clickAnalytics = _ref2.clickAnalytics,\n      userToken = _ref2.userToken,\n      rest = _objectWithoutProperties(_ref2, _excluded2);\n    return rest;\n  }\n  function getInMemoryCache() {\n    var cachedHits = null;\n    var cachedState = null;\n    return {\n      read: function read(_ref3) {\n        var state = _ref3.state;\n        return isEqual(cachedState, getStateWithoutPage(state)) ? cachedHits : null;\n      },\n      write: function write(_ref4) {\n        var state = _ref4.state,\n          hits = _ref4.hits;\n        cachedState = getStateWithoutPage(state);\n        cachedHits = hits;\n      }\n    };\n  }\n  function extractHitsFromCachedHits(cachedHits) {\n    return Object.keys(cachedHits).map(Number).sort(function (a, b) {\n      return a - b;\n    }).reduce(function (acc, page) {\n      return acc.concat(cachedHits[page]);\n    }, []);\n  }\n  var connectInfiniteHits = (function connectInfiniteHits(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$9());\n    return function (widgetParams) {\n      var _ref5 = widgetParams || {},\n        _ref5$escapeHTML = _ref5.escapeHTML,\n        escapeHTML = _ref5$escapeHTML === void 0 ? true : _ref5$escapeHTML,\n        _ref5$transformItems = _ref5.transformItems,\n        transformItems = _ref5$transformItems === void 0 ? function (items) {\n          return items;\n        } : _ref5$transformItems,\n        _ref5$cache = _ref5.cache,\n        cache = _ref5$cache === void 0 ? getInMemoryCache() : _ref5$cache;\n      var showPrevious;\n      var showMore;\n      var sendEvent;\n      var bindEvent;\n      var getFirstReceivedPage = function getFirstReceivedPage(state, cachedHits) {\n        var _state$page = state.page,\n          page = _state$page === void 0 ? 0 : _state$page;\n        var pages = Object.keys(cachedHits).map(Number);\n        if (pages.length === 0) {\n          return page;\n        } else {\n          return Math.min.apply(Math, [page].concat(_toConsumableArray(pages)));\n        }\n      };\n      var getLastReceivedPage = function getLastReceivedPage(state, cachedHits) {\n        var _state$page2 = state.page,\n          page = _state$page2 === void 0 ? 0 : _state$page2;\n        var pages = Object.keys(cachedHits).map(Number);\n        if (pages.length === 0) {\n          return page;\n        } else {\n          return Math.max.apply(Math, [page].concat(_toConsumableArray(pages)));\n        }\n      };\n      var getShowPrevious = function getShowPrevious(helper) {\n        return function () {\n          // Using the helper's `overrideStateWithoutTriggeringChangeEvent` method\n          // avoid updating the browser URL when the user displays the previous page.\n          helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread2(_objectSpread2({}, helper.state), {}, {\n            page: getFirstReceivedPage(helper.state, cache.read({\n              state: normalizeState(helper.state)\n            }) || {}) - 1\n          })).searchWithoutTriggeringOnStateChange();\n        };\n      };\n      var getShowMore = function getShowMore(helper) {\n        return function () {\n          helper.setPage(getLastReceivedPage(helper.state, cache.read({\n            state: normalizeState(helper.state)\n          }) || {}) + 1).search();\n        };\n      };\n      return {\n        $$type: 'ais.infiniteHits',\n        init: function init(initOptions) {\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: initOptions.instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var instantSearchInstance = renderOptions.instantSearchInstance;\n          var widgetRenderState = this.getWidgetRenderState(renderOptions);\n          renderFn(_objectSpread2(_objectSpread2({}, widgetRenderState), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), false);\n          sendEvent('view:internal', widgetRenderState.currentPageHits);\n        },\n        getRenderState: function getRenderState(renderState, renderOptions\n        // Type is explicitly redefined, to avoid having the TWidgetParams type in the definition\n        ) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            infiniteHits: this.getWidgetRenderState(renderOptions)\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref6) {\n          var _results$renderingCon, _results$renderingCon2, _results$renderingCon3;\n          var results = _ref6.results,\n            helper = _ref6.helper,\n            parent = _ref6.parent,\n            existingState = _ref6.state,\n            instantSearchInstance = _ref6.instantSearchInstance;\n          var isFirstPage;\n          var currentPageHits = [];\n          /**\n           * We bail out of optimistic UI here, as the cache is based on search\n           * parameters, and we don't want to invalidate the cache when the search\n           * is loading.\n           */\n          var state = parent.getPreviousState() || existingState;\n          var cachedHits = cache.read({\n            state: normalizeState(state)\n          }) || {};\n          var banner = results === null || results === void 0 ? void 0 : (_results$renderingCon = results.renderingContent) === null || _results$renderingCon === void 0 ? void 0 : (_results$renderingCon2 = _results$renderingCon.widgets) === null || _results$renderingCon2 === void 0 ? void 0 : (_results$renderingCon3 = _results$renderingCon2.banners) === null || _results$renderingCon3 === void 0 ? void 0 : _results$renderingCon3[0];\n          if (!results) {\n            showPrevious = getShowPrevious(helper);\n            showMore = getShowMore(helper);\n            sendEvent = createSendEventForHits({\n              instantSearchInstance: instantSearchInstance,\n              helper: helper,\n              widgetType: this.$$type\n            });\n            bindEvent = createBindEventForHits({\n              helper: helper,\n              widgetType: this.$$type,\n              instantSearchInstance: instantSearchInstance\n            });\n            isFirstPage = state.page === undefined || getFirstReceivedPage(state, cachedHits) === 0;\n          } else {\n            var _state$disjunctiveFac, _state$hierarchicalFa;\n            var _state$page3 = state.page,\n              _page = _state$page3 === void 0 ? 0 : _state$page3;\n            if (escapeHTML && results.hits.length > 0) {\n              results.hits = escapeHits(results.hits);\n            }\n            var hitsWithAbsolutePosition = addAbsolutePosition(results.hits, results.page, results.hitsPerPage);\n            var hitsWithAbsolutePositionAndQueryID = addQueryID(hitsWithAbsolutePosition, results.queryID);\n            var transformedHits = transformItems(hitsWithAbsolutePositionAndQueryID, {\n              results: results\n            });\n\n            /*\n              With dynamic widgets, facets are not included in the state before their relevant widgets are mounted. Until then, we need to bail out of writing this incomplete state representation in cache.\n            */\n            var hasDynamicWidgets = false;\n            walkIndex(instantSearchInstance.mainIndex, function (indexWidget) {\n              if (!hasDynamicWidgets && indexWidget.getWidgets().some(function (_ref7) {\n                var $$type = _ref7.$$type;\n                return $$type === 'ais.dynamicWidgets';\n              })) {\n                hasDynamicWidgets = true;\n              }\n            });\n            var hasNoFacets = !((_state$disjunctiveFac = state.disjunctiveFacets) !== null && _state$disjunctiveFac !== void 0 && _state$disjunctiveFac.length) && !(state.facets || []).filter(function (f) {\n              return f !== '*';\n            }).length && !((_state$hierarchicalFa = state.hierarchicalFacets) !== null && _state$hierarchicalFa !== void 0 && _state$hierarchicalFa.length);\n            if (cachedHits[_page] === undefined && !results.__isArtificial && instantSearchInstance.status === 'idle' && !(hasDynamicWidgets && hasNoFacets)) {\n              cachedHits[_page] = transformedHits;\n              cache.write({\n                state: normalizeState(state),\n                hits: cachedHits\n              });\n            }\n            currentPageHits = transformedHits;\n            isFirstPage = getFirstReceivedPage(state, cachedHits) === 0;\n          }\n          var items = extractHitsFromCachedHits(cachedHits);\n          var isLastPage = results ? results.nbPages <= getLastReceivedPage(state, cachedHits) + 1 : true;\n          return {\n            hits: items,\n            items: items,\n            currentPageHits: currentPageHits,\n            sendEvent: sendEvent,\n            bindEvent: bindEvent,\n            banner: banner,\n            results: results || undefined,\n            showPrevious: showPrevious,\n            showMore: showMore,\n            isFirstPage: isFirstPage,\n            isLastPage: isLastPage,\n            widgetParams: widgetParams\n          };\n        },\n        dispose: function dispose(_ref8) {\n          var state = _ref8.state;\n          unmountFn();\n          var stateWithoutPage = state.setQueryParameter('page', undefined);\n          if (!escapeHTML) {\n            return stateWithoutPage;\n          }\n          return stateWithoutPage.setQueryParameters(Object.keys(TAG_PLACEHOLDER).reduce(function (acc, key) {\n            return _objectSpread2(_objectSpread2({}, acc), {}, _defineProperty({}, key, undefined));\n          }, {}));\n        },\n        getWidgetUiState: function getWidgetUiState(uiState, _ref9) {\n          var searchParameters = _ref9.searchParameters;\n          var page = searchParameters.page || 0;\n          if (!page) {\n            // return without adding `page` to uiState\n            // because we don't want `page=1` in the URL\n            return uiState;\n          }\n          return _objectSpread2(_objectSpread2({}, uiState), {}, {\n            // The page in the UI state is incremented by one\n            // to expose the user value (not `0`).\n            page: page + 1\n          });\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref10) {\n          var uiState = _ref10.uiState;\n          var widgetSearchParameters = searchParameters;\n          if (escapeHTML) {\n            // @MAJOR: set this globally, not in the InfiniteHits widget to allow InfiniteHits to be conditionally used\n            widgetSearchParameters = searchParameters.setQueryParameters(TAG_PLACEHOLDER);\n          }\n\n          // The page in the search parameters is decremented by one\n          // to get to the actual parameter value from the UI state.\n          var page = uiState.page ? uiState.page - 1 : 0;\n          return widgetSearchParameters.setQueryParameter('page', page);\n        }\n      };\n    };\n  });\n\n  /**\n   * Due to https://github.com/microsoft/web-build-tools/issues/1050, we need\n   * Connector<...> imported in this file, even though it is only used implicitly.\n   * This _uses_ Connector<...> so it is not accidentally removed by someone.\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n\n  var connectInfiniteHitsWithInsights = withInsights(connectInfiniteHits);\n\n  var _excluded$3 = [\"name\", \"escapedValue\", \"path\"];\n  var withUsage$a = createDocumentationMessageGenerator({\n    name: 'menu',\n    connector: true\n  });\n  var DEFAULT_SORT$1 = ['isRefined', 'name:asc'];\n  /**\n   * **Menu** connector provides the logic to build a widget that will give the user the ability to choose a single value for a specific facet. The typical usage of menu is for navigation in categories.\n   *\n   * This connector provides a `toggleShowMore()` function to display more or less items and a `refine()`\n   * function to select an item. While selecting a new element, the `refine` will also unselect the\n   * one that is currently selected.\n   *\n   * **Requirement:** the attribute passed as `attribute` must be present in \"attributes for faceting\" on the Algolia dashboard or configured as attributesForFaceting via a set settings call to the Algolia API.\n   */\n  var connectMenu = function connectMenu(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$a());\n    return function (widgetParams) {\n      var _ref = widgetParams || {},\n        attribute = _ref.attribute,\n        _ref$limit = _ref.limit,\n        limit = _ref$limit === void 0 ? 10 : _ref$limit,\n        _ref$showMore = _ref.showMore,\n        showMore = _ref$showMore === void 0 ? false : _ref$showMore,\n        _ref$showMoreLimit = _ref.showMoreLimit,\n        showMoreLimit = _ref$showMoreLimit === void 0 ? 20 : _ref$showMoreLimit,\n        _ref$sortBy = _ref.sortBy,\n        sortBy = _ref$sortBy === void 0 ? DEFAULT_SORT$1 : _ref$sortBy,\n        _ref$transformItems = _ref.transformItems,\n        transformItems = _ref$transformItems === void 0 ? function (items) {\n          return items;\n        } : _ref$transformItems;\n      if (!attribute) {\n        throw new Error(withUsage$a('The `attribute` option is required.'));\n      }\n      if (showMore === true && showMoreLimit <= limit) {\n        throw new Error(withUsage$a('The `showMoreLimit` option must be greater than `limit`.'));\n      }\n      var sendEvent;\n      var _createURL;\n      var _refine;\n\n      // Provide the same function to the `renderFn` so that way the user\n      // has to only bind it once when `isFirstRendering` for instance\n      var isShowingMore = false;\n      var toggleShowMore = function toggleShowMore() {};\n      function createToggleShowMore(renderOptions, widget) {\n        return function () {\n          isShowingMore = !isShowingMore;\n          widget.render(renderOptions);\n        };\n      }\n      function cachedToggleShowMore() {\n        toggleShowMore();\n      }\n      function getLimit() {\n        return isShowingMore ? showMoreLimit : limit;\n      }\n      return {\n        $$type: 'ais.menu',\n        init: function init(initOptions) {\n          var instantSearchInstance = initOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var instantSearchInstance = renderOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), false);\n        },\n        dispose: function dispose(_ref2) {\n          var state = _ref2.state;\n          unmountFn();\n          return state.removeHierarchicalFacet(attribute).setQueryParameter('maxValuesPerFacet', undefined);\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            menu: _objectSpread2(_objectSpread2({}, renderState.menu), {}, _defineProperty({}, attribute, this.getWidgetRenderState(renderOptions)))\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(renderOptions) {\n          var _this = this;\n          var results = renderOptions.results,\n            createURL = renderOptions.createURL,\n            instantSearchInstance = renderOptions.instantSearchInstance,\n            helper = renderOptions.helper;\n          var items = [];\n          var canToggleShowMore = false;\n          if (!sendEvent) {\n            sendEvent = createSendEventForFacet({\n              instantSearchInstance: instantSearchInstance,\n              helper: helper,\n              attribute: attribute,\n              widgetType: this.$$type\n            });\n          }\n          if (!_createURL) {\n            _createURL = function _createURL(facetValue) {\n              return createURL(function (uiState) {\n                return _this.getWidgetUiState(uiState, {\n                  searchParameters: helper.state.resetPage().toggleFacetRefinement(attribute, facetValue),\n                  helper: helper\n                });\n              });\n            };\n          }\n          if (!_refine) {\n            _refine = function _refine(facetValue) {\n              var _helper$getHierarchic = helper.getHierarchicalFacetBreadcrumb(attribute),\n                _helper$getHierarchic2 = _slicedToArray(_helper$getHierarchic, 1),\n                refinedItem = _helper$getHierarchic2[0];\n              sendEvent('click:internal', facetValue ? facetValue : refinedItem);\n              helper.toggleFacetRefinement(attribute, facetValue ? facetValue : refinedItem).search();\n            };\n          }\n          if (renderOptions.results) {\n            toggleShowMore = createToggleShowMore(renderOptions, this);\n          }\n          if (results) {\n            var facetValues = results.getFacetValues(attribute, {\n              sortBy: sortBy,\n              facetOrdering: sortBy === DEFAULT_SORT$1\n            });\n            var facetItems = facetValues && !Array.isArray(facetValues) && facetValues.data ? facetValues.data : [];\n            canToggleShowMore = showMore && (isShowingMore || facetItems.length > getLimit());\n            items = transformItems(facetItems.slice(0, getLimit()).map(function (_ref3) {\n              var label = _ref3.name,\n                value = _ref3.escapedValue,\n                path = _ref3.path,\n                item = _objectWithoutProperties(_ref3, _excluded$3);\n              return _objectSpread2(_objectSpread2({}, item), {}, {\n                label: label,\n                value: value\n              });\n            }), {\n              results: results\n            });\n          }\n          return {\n            items: items,\n            createURL: _createURL,\n            refine: _refine,\n            sendEvent: sendEvent,\n            canRefine: items.length > 0,\n            widgetParams: widgetParams,\n            isShowingMore: isShowingMore,\n            toggleShowMore: cachedToggleShowMore,\n            canToggleShowMore: canToggleShowMore\n          };\n        },\n        getWidgetUiState: function getWidgetUiState(uiState, _ref4) {\n          var searchParameters = _ref4.searchParameters;\n          var _searchParameters$get = searchParameters.getHierarchicalFacetBreadcrumb(attribute),\n            _searchParameters$get2 = _slicedToArray(_searchParameters$get, 1),\n            value = _searchParameters$get2[0];\n          return removeEmptyRefinementsFromUiState$1(_objectSpread2(_objectSpread2({}, uiState), {}, {\n            menu: _objectSpread2(_objectSpread2({}, uiState.menu), {}, _defineProperty({}, attribute, value))\n          }), attribute);\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref5) {\n          var uiState = _ref5.uiState;\n          var value = uiState.menu && uiState.menu[attribute];\n          if (searchParameters.isConjunctiveFacet(attribute) || searchParameters.isDisjunctiveFacet(attribute)) {\n             _warning(false, \"Menu: Attribute \\\"\".concat(attribute, \"\\\" is already used by another widget applying conjunctive or disjunctive faceting.\\nAs this is not supported, please make sure to remove this other widget or this Menu widget will not work at all.\")) ;\n            return searchParameters;\n          }\n          var withFacetConfiguration = searchParameters.removeHierarchicalFacet(attribute).addHierarchicalFacet({\n            name: attribute,\n            attributes: [attribute]\n          });\n          var currentMaxValuesPerFacet = withFacetConfiguration.maxValuesPerFacet || 0;\n          var nextMaxValuesPerFacet = Math.max(currentMaxValuesPerFacet, showMore ? showMoreLimit : limit);\n          var withMaxValuesPerFacet = withFacetConfiguration.setQueryParameter('maxValuesPerFacet', nextMaxValuesPerFacet);\n          if (!value) {\n            return withMaxValuesPerFacet.setQueryParameters({\n              hierarchicalFacetsRefinements: _objectSpread2(_objectSpread2({}, withMaxValuesPerFacet.hierarchicalFacetsRefinements), {}, _defineProperty({}, attribute, []))\n            });\n          }\n          return withMaxValuesPerFacet.addHierarchicalFacetRefinement(attribute, value);\n        }\n      };\n    };\n  };\n  function removeEmptyRefinementsFromUiState$1(indexUiState, attribute) {\n    if (!indexUiState.menu) {\n      return indexUiState;\n    }\n    if (indexUiState.menu[attribute] === undefined) {\n      delete indexUiState.menu[attribute];\n    }\n    if (Object.keys(indexUiState.menu).length === 0) {\n      delete indexUiState.menu;\n    }\n    return indexUiState;\n  }\n\n  var withUsage$b = createDocumentationMessageGenerator({\n    name: 'numeric-menu',\n    connector: true\n  });\n  var $$type = 'ais.numericMenu';\n  var createSendEvent = function createSendEvent(_ref) {\n    var instantSearchInstance = _ref.instantSearchInstance;\n    return function () {\n      if (arguments.length === 1) {\n        instantSearchInstance.sendEventToInsights(arguments.length <= 0 ? undefined : arguments[0]);\n        return;\n      }\n    };\n  };\n  var connectNumericMenu = function connectNumericMenu(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$b());\n    return function (widgetParams) {\n      var _ref2 = widgetParams || {},\n        _ref2$attribute = _ref2.attribute,\n        attribute = _ref2$attribute === void 0 ? '' : _ref2$attribute,\n        _ref2$items = _ref2.items,\n        items = _ref2$items === void 0 ? [] : _ref2$items,\n        _ref2$transformItems = _ref2.transformItems,\n        transformItems = _ref2$transformItems === void 0 ? function (item) {\n          return item;\n        } : _ref2$transformItems;\n      if (attribute === '') {\n        throw new Error(withUsage$b('The `attribute` option is required.'));\n      }\n      if (!items || items.length === 0) {\n        throw new Error(withUsage$b('The `items` option expects an array of objects.'));\n      }\n      var prepareItems = function prepareItems(state) {\n        return items.map(function (_ref3) {\n          var start = _ref3.start,\n            end = _ref3.end,\n            label = _ref3.label;\n          return {\n            label: label,\n            value: encodeURI(JSON.stringify({\n              start: start,\n              end: end\n            })),\n            isRefined: isRefined(state, attribute, {\n              start: start,\n              end: end,\n              label: label\n            })\n          };\n        });\n      };\n      var connectorState = {};\n      return {\n        $$type: $$type,\n        init: function init(initOptions) {\n          var instantSearchInstance = initOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var instantSearchInstance = renderOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), false);\n        },\n        dispose: function dispose(_ref4) {\n          var state = _ref4.state;\n          unmountFn();\n          return state.removeNumericRefinement(attribute);\n        },\n        getWidgetUiState: function getWidgetUiState(uiState, _ref5) {\n          var searchParameters = _ref5.searchParameters;\n          var values = searchParameters.getNumericRefinements(attribute);\n          var equal = values['='] && values['='][0];\n          if (equal || equal === 0) {\n            return _objectSpread2(_objectSpread2({}, uiState), {}, {\n              numericMenu: _objectSpread2(_objectSpread2({}, uiState.numericMenu), {}, _defineProperty({}, attribute, \"\".concat(values['='])))\n            });\n          }\n          var min = values['>='] && values['>='][0] || '';\n          var max = values['<='] && values['<='][0] || '';\n          return removeEmptyRefinementsFromUiState$2(_objectSpread2(_objectSpread2({}, uiState), {}, {\n            numericMenu: _objectSpread2(_objectSpread2({}, uiState.numericMenu), {}, _defineProperty({}, attribute, \"\".concat(min, \":\").concat(max)))\n          }), attribute);\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref6) {\n          var uiState = _ref6.uiState;\n          var value = uiState.numericMenu && uiState.numericMenu[attribute];\n          var withoutRefinements = searchParameters.setQueryParameters({\n            numericRefinements: _objectSpread2(_objectSpread2({}, searchParameters.numericRefinements), {}, _defineProperty({}, attribute, {}))\n          });\n          if (!value) {\n            return withoutRefinements;\n          }\n          var isExact = value.indexOf(':') === -1;\n          if (isExact) {\n            return withoutRefinements.addNumericRefinement(attribute, '=', Number(value));\n          }\n          var _value$split$map = value.split(':').map(parseFloat),\n            _value$split$map2 = _slicedToArray(_value$split$map, 2),\n            min = _value$split$map2[0],\n            max = _value$split$map2[1];\n          var withMinRefinement = isFiniteNumber(min) ? withoutRefinements.addNumericRefinement(attribute, '>=', min) : withoutRefinements;\n          var withMaxRefinement = isFiniteNumber(max) ? withMinRefinement.addNumericRefinement(attribute, '<=', max) : withMinRefinement;\n          return withMaxRefinement;\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            numericMenu: _objectSpread2(_objectSpread2({}, renderState.numericMenu), {}, _defineProperty({}, attribute, this.getWidgetRenderState(renderOptions)))\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref7) {\n          var _this = this;\n          var results = _ref7.results,\n            state = _ref7.state,\n            instantSearchInstance = _ref7.instantSearchInstance,\n            helper = _ref7.helper,\n            createURL = _ref7.createURL;\n          if (!connectorState.refine) {\n            connectorState.refine = function (facetValue) {\n              var refinedState = getRefinedState(helper.state, attribute, facetValue);\n              connectorState.sendEvent('click:internal', facetValue);\n              helper.setState(refinedState).search();\n            };\n          }\n          if (!connectorState.createURL) {\n            connectorState.createURL = function (newState) {\n              return function (facetValue) {\n                return createURL(function (uiState) {\n                  return _this.getWidgetUiState(uiState, {\n                    searchParameters: getRefinedState(newState, attribute, facetValue),\n                    helper: helper\n                  });\n                });\n              };\n            };\n          }\n          if (!connectorState.sendEvent) {\n            connectorState.sendEvent = createSendEvent({\n              instantSearchInstance: instantSearchInstance\n            });\n          }\n          var hasNoResults = results ? results.nbHits === 0 : true;\n          var preparedItems = prepareItems(state);\n          var allIsSelected = true;\n          // @TODO avoid for..of for polyfill reasons\n          // eslint-disable-next-line no-restricted-syntax\n          var _iterator = _createForOfIteratorHelper(preparedItems),\n            _step;\n          try {\n            for (_iterator.s(); !(_step = _iterator.n()).done;) {\n              var item = _step.value;\n              if (item.isRefined && decodeURI(item.value) !== '{}') {\n                allIsSelected = false;\n                break;\n              }\n            }\n          } catch (err) {\n            _iterator.e(err);\n          } finally {\n            _iterator.f();\n          }\n          return {\n            createURL: connectorState.createURL(state),\n            items: transformItems(preparedItems, {\n              results: results\n            }),\n            hasNoResults: hasNoResults,\n            canRefine: !(hasNoResults && allIsSelected),\n            refine: connectorState.refine,\n            sendEvent: connectorState.sendEvent,\n            widgetParams: widgetParams\n          };\n        }\n      };\n    };\n  };\n  function isRefined(state, attribute, option) {\n    // @TODO: same as another spot, why is this mixing arrays & elements?\n    var currentRefinements = state.getNumericRefinements(attribute);\n    if (option.start !== undefined && option.end !== undefined) {\n      if (option.start === option.end) {\n        return hasNumericRefinement(currentRefinements, '=', option.start);\n      } else {\n        return hasNumericRefinement(currentRefinements, '>=', option.start) && hasNumericRefinement(currentRefinements, '<=', option.end);\n      }\n    }\n    if (option.start !== undefined) {\n      return hasNumericRefinement(currentRefinements, '>=', option.start);\n    }\n    if (option.end !== undefined) {\n      return hasNumericRefinement(currentRefinements, '<=', option.end);\n    }\n    if (option.start === undefined && option.end === undefined) {\n      return Object.keys(currentRefinements).every(function (operator) {\n        return (currentRefinements[operator] || []).length === 0;\n      });\n    }\n    return false;\n  }\n  function getRefinedState(state, attribute, facetValue) {\n    var resolvedState = state;\n    var refinedOption = JSON.parse(decodeURI(facetValue));\n\n    // @TODO: why is array / element mixed here & hasRefinements; seems wrong?\n    var currentRefinements = resolvedState.getNumericRefinements(attribute);\n    if (refinedOption.start === undefined && refinedOption.end === undefined) {\n      return resolvedState.removeNumericRefinement(attribute);\n    }\n    if (!isRefined(resolvedState, attribute, refinedOption)) {\n      resolvedState = resolvedState.removeNumericRefinement(attribute);\n    }\n    if (refinedOption.start !== undefined && refinedOption.end !== undefined) {\n      if (refinedOption.start > refinedOption.end) {\n        throw new Error('option.start should be > to option.end');\n      }\n      if (refinedOption.start === refinedOption.end) {\n        if (hasNumericRefinement(currentRefinements, '=', refinedOption.start)) {\n          resolvedState = resolvedState.removeNumericRefinement(attribute, '=', refinedOption.start);\n        } else {\n          resolvedState = resolvedState.addNumericRefinement(attribute, '=', refinedOption.start);\n        }\n        return resolvedState;\n      }\n    }\n    if (refinedOption.start !== undefined) {\n      if (hasNumericRefinement(currentRefinements, '>=', refinedOption.start)) {\n        resolvedState = resolvedState.removeNumericRefinement(attribute, '>=', refinedOption.start);\n      }\n      resolvedState = resolvedState.addNumericRefinement(attribute, '>=', refinedOption.start);\n    }\n    if (refinedOption.end !== undefined) {\n      if (hasNumericRefinement(currentRefinements, '<=', refinedOption.end)) {\n        resolvedState = resolvedState.removeNumericRefinement(attribute, '<=', refinedOption.end);\n      }\n      resolvedState = resolvedState.addNumericRefinement(attribute, '<=', refinedOption.end);\n    }\n    if (typeof resolvedState.page === 'number') {\n      resolvedState.page = 0;\n    }\n    return resolvedState;\n  }\n  function hasNumericRefinement(currentRefinements, operator, value) {\n    return currentRefinements[operator] !== undefined && currentRefinements[operator].includes(value);\n  }\n  function removeEmptyRefinementsFromUiState$2(indexUiState, attribute) {\n    if (!indexUiState.numericMenu) {\n      return indexUiState;\n    }\n    if (indexUiState.numericMenu[attribute] === ':') {\n      delete indexUiState.numericMenu[attribute];\n    }\n    if (Object.keys(indexUiState.numericMenu).length === 0) {\n      delete indexUiState.numericMenu;\n    }\n    return indexUiState;\n  }\n\n  var Paginator = /*#__PURE__*/function () {\n    function Paginator(params) {\n      _classCallCheck(this, Paginator);\n      _defineProperty(this, \"currentPage\", void 0);\n      _defineProperty(this, \"total\", void 0);\n      _defineProperty(this, \"padding\", void 0);\n      this.currentPage = params.currentPage;\n      this.total = params.total;\n      this.padding = params.padding;\n    }\n    _createClass(Paginator, [{\n      key: \"pages\",\n      value: function pages() {\n        var total = this.total,\n          currentPage = this.currentPage,\n          padding = this.padding;\n        if (total === 0) return [0];\n        var totalDisplayedPages = this.nbPagesDisplayed(padding, total);\n        if (totalDisplayedPages === total) {\n          return range({\n            end: total\n          });\n        }\n        var paddingLeft = this.calculatePaddingLeft(currentPage, padding, total, totalDisplayedPages);\n        var paddingRight = totalDisplayedPages - paddingLeft;\n        var first = currentPage - paddingLeft;\n        var last = currentPage + paddingRight;\n        return range({\n          start: first,\n          end: last\n        });\n      }\n    }, {\n      key: \"nbPagesDisplayed\",\n      value: function nbPagesDisplayed(padding, total) {\n        return Math.min(2 * padding + 1, total);\n      }\n    }, {\n      key: \"calculatePaddingLeft\",\n      value: function calculatePaddingLeft(current, padding, total, totalDisplayedPages) {\n        if (current <= padding) {\n          return current;\n        }\n        if (current >= total - padding) {\n          return totalDisplayedPages - (total - current);\n        }\n        return padding;\n      }\n    }, {\n      key: \"isLastPage\",\n      value: function isLastPage() {\n        return this.currentPage >= this.total - 1;\n      }\n    }, {\n      key: \"isFirstPage\",\n      value: function isFirstPage() {\n        return this.currentPage <= 0;\n      }\n    }]);\n    return Paginator;\n  }();\n\n  var withUsage$c = createDocumentationMessageGenerator({\n    name: 'pagination',\n    connector: true\n  });\n  /**\n   * **Pagination** connector provides the logic to build a widget that will let the user\n   * choose the current page of the results.\n   *\n   * When using the pagination with Algolia, you should be aware that the engine won't provide you pages\n   * beyond the 1000th hits by default. You can find more information on the [Algolia documentation](https://www.algolia.com/doc/guides/searching/pagination/#pagination-limitations).\n   */\n  var connectPagination = function connectPagination(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$c());\n    return function (widgetParams) {\n      var _ref = widgetParams || {},\n        totalPages = _ref.totalPages,\n        _ref$padding = _ref.padding,\n        padding = _ref$padding === void 0 ? 3 : _ref$padding;\n      var pager = new Paginator({\n        currentPage: 0,\n        total: 0,\n        padding: padding\n      });\n      var connectorState = {};\n      function getMaxPage(_ref2) {\n        var nbPages = _ref2.nbPages;\n        return totalPages !== undefined ? Math.min(totalPages, nbPages) : nbPages;\n      }\n      return {\n        $$type: 'ais.pagination',\n        init: function init(initOptions) {\n          var instantSearchInstance = initOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var instantSearchInstance = renderOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), false);\n        },\n        dispose: function dispose(_ref3) {\n          var state = _ref3.state;\n          unmountFn();\n          return state.setQueryParameter('page', undefined);\n        },\n        getWidgetUiState: function getWidgetUiState(uiState, _ref4) {\n          var searchParameters = _ref4.searchParameters;\n          var page = searchParameters.page || 0;\n          if (!page) {\n            return uiState;\n          }\n          return _objectSpread2(_objectSpread2({}, uiState), {}, {\n            page: page + 1\n          });\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref5) {\n          var uiState = _ref5.uiState;\n          var page = uiState.page ? uiState.page - 1 : 0;\n          return searchParameters.setQueryParameter('page', page);\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref6) {\n          var results = _ref6.results,\n            helper = _ref6.helper,\n            state = _ref6.state,\n            createURL = _ref6.createURL;\n          if (!connectorState.refine) {\n            connectorState.refine = function (page) {\n              helper.setPage(page);\n              helper.search();\n            };\n          }\n          if (!connectorState.createURL) {\n            connectorState.createURL = function (page) {\n              return createURL(function (uiState) {\n                return _objectSpread2(_objectSpread2({}, uiState), {}, {\n                  page: page + 1\n                });\n              });\n            };\n          }\n          var page = state.page || 0;\n          var nbPages = getMaxPage(results || {\n            nbPages: 0\n          });\n          pager.currentPage = page;\n          pager.total = nbPages;\n          return {\n            createURL: connectorState.createURL,\n            refine: connectorState.refine,\n            canRefine: nbPages > 1,\n            currentRefinement: page,\n            nbHits: (results === null || results === void 0 ? void 0 : results.nbHits) || 0,\n            nbPages: nbPages,\n            pages: results ? pager.pages() : [],\n            isFirstPage: pager.isFirstPage(),\n            isLastPage: pager.isLastPage(),\n            widgetParams: widgetParams\n          };\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            pagination: this.getWidgetRenderState(renderOptions)\n          });\n        }\n      };\n    };\n  };\n\n  var withUsage$d = createDocumentationMessageGenerator({\n    name: 'range-input',\n    connector: true\n  }, {\n    name: 'range-slider',\n    connector: true\n  });\n  var $$type$1 = 'ais.range';\n\n  // @MAJOR: potentially we should consolidate these types\n\n  function toPrecision(_ref) {\n    var min = _ref.min,\n      max = _ref.max,\n      precision = _ref.precision;\n    var pow = Math.pow(10, precision);\n    return {\n      min: min ? Math.floor(min * pow) / pow : min,\n      max: max ? Math.ceil(max * pow) / pow : max\n    };\n  }\n\n  /**\n   * **Range** connector provides the logic to create custom widget that will let\n   * the user refine results using a numeric range.\n   *\n   * This connectors provides a `refine()` function that accepts bounds. It will also provide\n   * information about the min and max bounds for the current result set.\n   */\n  var connectRange = function connectRange(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$d());\n    return function (widgetParams) {\n      var _ref2 = widgetParams || {},\n        _ref2$attribute = _ref2.attribute,\n        attribute = _ref2$attribute === void 0 ? '' : _ref2$attribute,\n        minBound = _ref2.min,\n        maxBound = _ref2.max,\n        _ref2$precision = _ref2.precision,\n        precision = _ref2$precision === void 0 ? 0 : _ref2$precision;\n      if (!attribute) {\n        throw new Error(withUsage$d('The `attribute` option is required.'));\n      }\n      if (isFiniteNumber(minBound) && isFiniteNumber(maxBound) && minBound > maxBound) {\n        throw new Error(withUsage$d(\"The `max` option can't be lower than `min`.\"));\n      }\n      var formatToNumber = function formatToNumber(v) {\n        return Number(Number(v).toFixed(precision));\n      };\n      var rangeFormatter = {\n        from: function from(v) {\n          return v.toLocaleString();\n        },\n        to: function to(v) {\n          return formatToNumber(v).toLocaleString();\n        }\n      };\n\n      // eslint-disable-next-line complexity\n      var getRefinedState = function getRefinedState(helper, currentRange, nextMin, nextMax) {\n        var resolvedState = helper.state;\n        var currentRangeMin = currentRange.min,\n          currentRangeMax = currentRange.max;\n        var _ref3 = resolvedState.getNumericRefinement(attribute, '>=') || [],\n          _ref4 = _slicedToArray(_ref3, 1),\n          min = _ref4[0];\n        var _ref5 = resolvedState.getNumericRefinement(attribute, '<=') || [],\n          _ref6 = _slicedToArray(_ref5, 1),\n          max = _ref6[0];\n        var isResetMin = nextMin === undefined || nextMin === '';\n        var isResetMax = nextMax === undefined || nextMax === '';\n        var _toPrecision = toPrecision({\n            min: !isResetMin ? parseFloat(nextMin) : undefined,\n            max: !isResetMax ? parseFloat(nextMax) : undefined,\n            precision: precision\n          }),\n          nextMinAsNumber = _toPrecision.min,\n          nextMaxAsNumber = _toPrecision.max;\n        var newNextMin;\n        if (!isFiniteNumber(minBound) && currentRangeMin === nextMinAsNumber) {\n          newNextMin = undefined;\n        } else if (isFiniteNumber(minBound) && isResetMin) {\n          newNextMin = minBound;\n        } else {\n          newNextMin = nextMinAsNumber;\n        }\n        var newNextMax;\n        if (!isFiniteNumber(maxBound) && currentRangeMax === nextMaxAsNumber) {\n          newNextMax = undefined;\n        } else if (isFiniteNumber(maxBound) && isResetMax) {\n          newNextMax = maxBound;\n        } else {\n          newNextMax = nextMaxAsNumber;\n        }\n        var isResetNewNextMin = newNextMin === undefined;\n        var isGreaterThanCurrentRange = isFiniteNumber(currentRangeMin) && currentRangeMin <= newNextMin;\n        var isMinValid = isResetNewNextMin || isFiniteNumber(newNextMin) && (!isFiniteNumber(currentRangeMin) || isGreaterThanCurrentRange);\n        var isResetNewNextMax = newNextMax === undefined;\n        var isLowerThanRange = isFiniteNumber(newNextMax) && currentRangeMax >= newNextMax;\n        var isMaxValid = isResetNewNextMax || isFiniteNumber(newNextMax) && (!isFiniteNumber(currentRangeMax) || isLowerThanRange);\n        var hasMinChange = min !== newNextMin;\n        var hasMaxChange = max !== newNextMax;\n        if ((hasMinChange || hasMaxChange) && isMinValid && isMaxValid) {\n          resolvedState = resolvedState.removeNumericRefinement(attribute);\n          if (isFiniteNumber(newNextMin)) {\n            resolvedState = resolvedState.addNumericRefinement(attribute, '>=', newNextMin);\n          }\n          if (isFiniteNumber(newNextMax)) {\n            resolvedState = resolvedState.addNumericRefinement(attribute, '<=', newNextMax);\n          }\n          return resolvedState.resetPage();\n        }\n        return null;\n      };\n      var createSendEvent = function createSendEvent(instantSearchInstance) {\n        return function () {\n          if (arguments.length === 1) {\n            instantSearchInstance.sendEventToInsights(arguments.length <= 0 ? undefined : arguments[0]);\n            return;\n          }\n        };\n      };\n      function _getCurrentRange(stats) {\n        var min;\n        if (isFiniteNumber(minBound)) {\n          min = minBound;\n        } else if (isFiniteNumber(stats.min)) {\n          min = stats.min;\n        } else {\n          min = 0;\n        }\n        var max;\n        if (isFiniteNumber(maxBound)) {\n          max = maxBound;\n        } else if (isFiniteNumber(stats.max)) {\n          max = stats.max;\n        } else {\n          max = 0;\n        }\n        return toPrecision({\n          min: min,\n          max: max,\n          precision: precision\n        });\n      }\n      function _getCurrentRefinement(helper) {\n        var _ref7 = helper.getNumericRefinement(attribute, '>=') || [],\n          _ref8 = _slicedToArray(_ref7, 1),\n          minValue = _ref8[0];\n        var _ref9 = helper.getNumericRefinement(attribute, '<=') || [],\n          _ref10 = _slicedToArray(_ref9, 1),\n          maxValue = _ref10[0];\n        var min = isFiniteNumber(minValue) ? minValue : -Infinity;\n        var max = isFiniteNumber(maxValue) ? maxValue : Infinity;\n        return [min, max];\n      }\n      function _refine(helper, currentRange) {\n        return function () {\n          var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [undefined, undefined],\n            _ref12 = _slicedToArray(_ref11, 2),\n            nextMin = _ref12[0],\n            nextMax = _ref12[1];\n          var refinedState = getRefinedState(helper, currentRange, nextMin, nextMax);\n          if (refinedState) {\n            helper.setState(refinedState).search();\n          }\n        };\n      }\n      return {\n        $$type: $$type$1,\n        init: function init(initOptions) {\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: initOptions.instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: renderOptions.instantSearchInstance\n          }), false);\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            range: _objectSpread2(_objectSpread2({}, renderState.range), {}, _defineProperty({}, attribute, this.getWidgetRenderState(renderOptions)))\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref13) {\n          var results = _ref13.results,\n            helper = _ref13.helper,\n            instantSearchInstance = _ref13.instantSearchInstance;\n          var facetsFromResults = results && results.disjunctiveFacets || [];\n          var facet = find(facetsFromResults, function (facetResult) {\n            return facetResult.name === attribute;\n          });\n          var stats = facet && facet.stats || {\n            min: undefined,\n            max: undefined\n          };\n          var currentRange = _getCurrentRange(stats);\n          var start = _getCurrentRefinement(helper);\n          var refine;\n          if (!results) {\n            // On first render pass an empty range\n            // to be able to bypass the validation\n            // related to it\n            refine = _refine(helper, {\n              min: undefined,\n              max: undefined\n            });\n          } else {\n            refine = _refine(helper, currentRange);\n          }\n          return {\n            refine: refine,\n            canRefine: currentRange.min !== currentRange.max,\n            format: rangeFormatter,\n            range: currentRange,\n            sendEvent: createSendEvent(instantSearchInstance),\n            widgetParams: _objectSpread2(_objectSpread2({}, widgetParams), {}, {\n              precision: precision\n            }),\n            start: start\n          };\n        },\n        dispose: function dispose(_ref14) {\n          var state = _ref14.state;\n          unmountFn();\n          return state.removeDisjunctiveFacet(attribute).removeNumericRefinement(attribute);\n        },\n        getWidgetUiState: function getWidgetUiState(uiState, _ref15) {\n          var searchParameters = _ref15.searchParameters;\n          var _searchParameters$get = searchParameters.getNumericRefinements(attribute),\n            _searchParameters$get2 = _searchParameters$get['>='],\n            min = _searchParameters$get2 === void 0 ? [] : _searchParameters$get2,\n            _searchParameters$get3 = _searchParameters$get['<='],\n            max = _searchParameters$get3 === void 0 ? [] : _searchParameters$get3;\n          if (min.length === 0 && max.length === 0) {\n            return uiState;\n          }\n          return _objectSpread2(_objectSpread2({}, uiState), {}, {\n            range: _objectSpread2(_objectSpread2({}, uiState.range), {}, _defineProperty({}, attribute, \"\".concat(min, \":\").concat(max)))\n          });\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref16) {\n          var uiState = _ref16.uiState;\n          var widgetSearchParameters = searchParameters.addDisjunctiveFacet(attribute).setQueryParameters({\n            numericRefinements: _objectSpread2(_objectSpread2({}, searchParameters.numericRefinements), {}, _defineProperty({}, attribute, {}))\n          });\n          if (isFiniteNumber(minBound)) {\n            widgetSearchParameters = widgetSearchParameters.addNumericRefinement(attribute, '>=', minBound);\n          }\n          if (isFiniteNumber(maxBound)) {\n            widgetSearchParameters = widgetSearchParameters.addNumericRefinement(attribute, '<=', maxBound);\n          }\n          var value = uiState.range && uiState.range[attribute];\n          if (!value || value.indexOf(':') === -1) {\n            return widgetSearchParameters;\n          }\n          var _value$split$map = value.split(':').map(parseFloat),\n            _value$split$map2 = _slicedToArray(_value$split$map, 2),\n            lowerBound = _value$split$map2[0],\n            upperBound = _value$split$map2[1];\n          if (isFiniteNumber(lowerBound) && (!isFiniteNumber(minBound) || minBound < lowerBound)) {\n            widgetSearchParameters = widgetSearchParameters.removeNumericRefinement(attribute, '>=');\n            widgetSearchParameters = widgetSearchParameters.addNumericRefinement(attribute, '>=', lowerBound);\n          }\n          if (isFiniteNumber(upperBound) && (!isFiniteNumber(maxBound) || upperBound < maxBound)) {\n            widgetSearchParameters = widgetSearchParameters.removeNumericRefinement(attribute, '<=');\n            widgetSearchParameters = widgetSearchParameters.addNumericRefinement(attribute, '<=', upperBound);\n          }\n          return widgetSearchParameters;\n        }\n      };\n    };\n  };\n\n  var _excluded$4 = [\"name\", \"escapedValue\"],\n    _excluded2$1 = [\"escapedValue\", \"value\"];\n  var withUsage$e = createDocumentationMessageGenerator({\n    name: 'refinement-list',\n    connector: true\n  });\n  var DEFAULT_SORT$2 = ['isRefined', 'count:desc', 'name:asc'];\n  /**\n   * **RefinementList** connector provides the logic to build a custom widget that\n   * will let the user filter the results based on the values of a specific facet.\n   *\n   * **Requirement:** the attribute passed as `attribute` must be present in\n   * attributesForFaceting of the searched index.\n   *\n   * This connector provides:\n   * - a `refine()` function to select an item.\n   * - a `toggleShowMore()` function to display more or less items\n   * - a `searchForItems()` function to search within the items.\n   */\n  var connectRefinementList = function connectRefinementList(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$e());\n    return function (widgetParams) {\n      var _ref = widgetParams || {},\n        attribute = _ref.attribute,\n        _ref$operator = _ref.operator,\n        operator = _ref$operator === void 0 ? 'or' : _ref$operator,\n        _ref$limit = _ref.limit,\n        limit = _ref$limit === void 0 ? 10 : _ref$limit,\n        _ref$showMore = _ref.showMore,\n        showMore = _ref$showMore === void 0 ? false : _ref$showMore,\n        _ref$showMoreLimit = _ref.showMoreLimit,\n        showMoreLimit = _ref$showMoreLimit === void 0 ? 20 : _ref$showMoreLimit,\n        _ref$sortBy = _ref.sortBy,\n        sortBy = _ref$sortBy === void 0 ? DEFAULT_SORT$2 : _ref$sortBy,\n        _ref$escapeFacetValue = _ref.escapeFacetValues,\n        escapeFacetValues = _ref$escapeFacetValue === void 0 ? true : _ref$escapeFacetValue,\n        _ref$transformItems = _ref.transformItems,\n        transformItems = _ref$transformItems === void 0 ? function (items) {\n          return items;\n        } : _ref$transformItems;\n      if (!attribute) {\n        throw new Error(withUsage$e('The `attribute` option is required.'));\n      }\n      if (!/^(and|or)$/.test(operator)) {\n        throw new Error(withUsage$e(\"The `operator` must one of: `\\\"and\\\"`, `\\\"or\\\"` (got \\\"\".concat(operator, \"\\\").\")));\n      }\n      if (showMore === true && showMoreLimit <= limit) {\n        throw new Error(withUsage$e('`showMoreLimit` should be greater than `limit`.'));\n      }\n      var formatItems = function formatItems(_ref2) {\n        var label = _ref2.name,\n          value = _ref2.escapedValue,\n          item = _objectWithoutProperties(_ref2, _excluded$4);\n        return _objectSpread2(_objectSpread2({}, item), {}, {\n          value: value,\n          label: label,\n          highlighted: label\n        });\n      };\n      var lastResultsFromMainSearch;\n      var lastItemsFromMainSearch = [];\n      var hasExhaustiveItems = true;\n      var triggerRefine;\n      var sendEvent;\n      var isShowingMore = false;\n      // Provide the same function to the `renderFn` so that way the user\n      // has to only bind it once when `isFirstRendering` for instance\n      var toggleShowMore = function toggleShowMore() {};\n      function cachedToggleShowMore() {\n        toggleShowMore();\n      }\n      function createToggleShowMore(renderOptions, widget) {\n        return function () {\n          isShowingMore = !isShowingMore;\n          widget.render(renderOptions);\n        };\n      }\n      function getLimit() {\n        return isShowingMore ? showMoreLimit : limit;\n      }\n      var searchForFacetValues = function searchForFacetValues() {\n        return function () {};\n      };\n      var createSearchForFacetValues = function createSearchForFacetValues(helper, widget) {\n        return function (renderOptions) {\n          return function (query) {\n            var instantSearchInstance = renderOptions.instantSearchInstance,\n              searchResults = renderOptions.results;\n            if (query === '' && lastItemsFromMainSearch) {\n              // render with previous data from the helper.\n              renderFn(_objectSpread2(_objectSpread2({}, widget.getWidgetRenderState(_objectSpread2(_objectSpread2({}, renderOptions), {}, {\n                results: lastResultsFromMainSearch\n              }))), {}, {\n                instantSearchInstance: instantSearchInstance\n              }), false);\n            } else {\n              var tags = {\n                highlightPreTag: escapeFacetValues ? TAG_PLACEHOLDER.highlightPreTag : TAG_REPLACEMENT.highlightPreTag,\n                highlightPostTag: escapeFacetValues ? TAG_PLACEHOLDER.highlightPostTag : TAG_REPLACEMENT.highlightPostTag\n              };\n              helper.searchForFacetValues(attribute, query,\n              // We cap the `maxFacetHits` value to 100 because the Algolia API\n              // doesn't support a greater number.\n              // See https://www.algolia.com/doc/api-reference/api-parameters/maxFacetHits/\n              Math.min(getLimit(), 100), tags).then(function (results) {\n                var facetValues = escapeFacetValues ? escapeFacets(results.facetHits) : results.facetHits;\n                var normalizedFacetValues = transformItems(facetValues.map(function (_ref3) {\n                  var escapedValue = _ref3.escapedValue,\n                    value = _ref3.value,\n                    item = _objectWithoutProperties(_ref3, _excluded2$1);\n                  return _objectSpread2(_objectSpread2({}, item), {}, {\n                    value: escapedValue,\n                    label: value\n                  });\n                }), {\n                  results: searchResults\n                });\n                renderFn(_objectSpread2(_objectSpread2({}, widget.getWidgetRenderState(_objectSpread2(_objectSpread2({}, renderOptions), {}, {\n                  results: lastResultsFromMainSearch\n                }))), {}, {\n                  items: normalizedFacetValues,\n                  canToggleShowMore: false,\n                  canRefine: true,\n                  isFromSearch: true,\n                  instantSearchInstance: instantSearchInstance\n                }), false);\n              });\n            }\n          };\n        };\n      };\n      return {\n        $$type: 'ais.refinementList',\n        init: function init(initOptions) {\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: initOptions.instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: renderOptions.instantSearchInstance\n          }), false);\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            refinementList: _objectSpread2(_objectSpread2({}, renderState.refinementList), {}, _defineProperty({}, attribute, this.getWidgetRenderState(renderOptions)))\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(renderOptions) {\n          var _this = this;\n          var results = renderOptions.results,\n            state = renderOptions.state,\n            _createURL = renderOptions.createURL,\n            instantSearchInstance = renderOptions.instantSearchInstance,\n            helper = renderOptions.helper;\n          var items = [];\n          var facetValues = [];\n          if (!sendEvent || !triggerRefine || !searchForFacetValues) {\n            sendEvent = createSendEventForFacet({\n              instantSearchInstance: instantSearchInstance,\n              helper: helper,\n              attribute: attribute,\n              widgetType: this.$$type\n            });\n            triggerRefine = function triggerRefine(facetValue) {\n              sendEvent('click:internal', facetValue);\n              helper.toggleFacetRefinement(attribute, facetValue).search();\n            };\n            searchForFacetValues = createSearchForFacetValues(helper, this);\n          }\n          if (results) {\n            var values = results.getFacetValues(attribute, {\n              sortBy: sortBy,\n              facetOrdering: sortBy === DEFAULT_SORT$2\n            });\n            facetValues = values && Array.isArray(values) ? values : [];\n            items = transformItems(facetValues.slice(0, getLimit()).map(formatItems), {\n              results: results\n            });\n            var maxValuesPerFacetConfig = state.maxValuesPerFacet;\n            var currentLimit = getLimit();\n            // If the limit is the max number of facet retrieved it is impossible to know\n            // if the facets are exhaustive. The only moment we are sure it is exhaustive\n            // is when it is strictly under the number requested unless we know that another\n            // widget has requested more values (maxValuesPerFacet > getLimit()).\n            // Because this is used for making the search of facets unable or not, it is important\n            // to be conservative here.\n            hasExhaustiveItems = maxValuesPerFacetConfig > currentLimit ? facetValues.length <= currentLimit : facetValues.length < currentLimit;\n            lastResultsFromMainSearch = results;\n            lastItemsFromMainSearch = items;\n            if (renderOptions.results) {\n              toggleShowMore = createToggleShowMore(renderOptions, this);\n            }\n          }\n\n          // Do not mistake searchForFacetValues and searchFacetValues which is the actual search\n          // function\n          var searchFacetValues = searchForFacetValues && searchForFacetValues(renderOptions);\n          var canShowLess = isShowingMore && lastItemsFromMainSearch.length > limit;\n          var canShowMore = showMore && !hasExhaustiveItems;\n          var canToggleShowMore = canShowLess || canShowMore;\n          return {\n            createURL: function createURL(facetValue) {\n              return _createURL(function (uiState) {\n                return _this.getWidgetUiState(uiState, {\n                  searchParameters: state.resetPage().toggleFacetRefinement(attribute, facetValue),\n                  helper: helper\n                });\n              });\n            },\n            items: items,\n            refine: triggerRefine,\n            searchForItems: searchFacetValues,\n            isFromSearch: false,\n            canRefine: items.length > 0,\n            widgetParams: widgetParams,\n            isShowingMore: isShowingMore,\n            canToggleShowMore: canToggleShowMore,\n            toggleShowMore: cachedToggleShowMore,\n            sendEvent: sendEvent,\n            hasExhaustiveItems: hasExhaustiveItems\n          };\n        },\n        dispose: function dispose(_ref4) {\n          var state = _ref4.state;\n          unmountFn();\n          var withoutMaxValuesPerFacet = state.setQueryParameter('maxValuesPerFacet', undefined);\n          if (operator === 'and') {\n            return withoutMaxValuesPerFacet.removeFacet(attribute);\n          }\n          return withoutMaxValuesPerFacet.removeDisjunctiveFacet(attribute);\n        },\n        getWidgetUiState: function getWidgetUiState(uiState, _ref5) {\n          var searchParameters = _ref5.searchParameters;\n          var values = operator === 'or' ? searchParameters.getDisjunctiveRefinements(attribute) : searchParameters.getConjunctiveRefinements(attribute);\n          return removeEmptyRefinementsFromUiState$3(_objectSpread2(_objectSpread2({}, uiState), {}, {\n            refinementList: _objectSpread2(_objectSpread2({}, uiState.refinementList), {}, _defineProperty({}, attribute, values))\n          }), attribute);\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref6) {\n          var uiState = _ref6.uiState;\n          var isDisjunctive = operator === 'or';\n          if (searchParameters.isHierarchicalFacet(attribute)) {\n             _warning(false, \"RefinementList: Attribute \\\"\".concat(attribute, \"\\\" is already used by another widget applying hierarchical faceting.\\nAs this is not supported, please make sure to remove this other widget or this RefinementList widget will not work at all.\")) ;\n            return searchParameters;\n          }\n          if (isDisjunctive && searchParameters.isConjunctiveFacet(attribute) || !isDisjunctive && searchParameters.isDisjunctiveFacet(attribute)) {\n             _warning(false, \"RefinementList: Attribute \\\"\".concat(attribute, \"\\\" is used by another refinement list with a different operator.\\nAs this is not supported, please make sure to only use this attribute with one of the two operators.\")) ;\n            return searchParameters;\n          }\n          var values = uiState.refinementList && uiState.refinementList[attribute];\n          var withFacetConfiguration = isDisjunctive ? searchParameters.addDisjunctiveFacet(attribute).removeDisjunctiveFacetRefinement(attribute) : searchParameters.addFacet(attribute).removeFacetRefinement(attribute);\n          var currentMaxValuesPerFacet = withFacetConfiguration.maxValuesPerFacet || 0;\n          var nextMaxValuesPerFacet = Math.max(currentMaxValuesPerFacet, showMore ? showMoreLimit : limit);\n          var withMaxValuesPerFacet = withFacetConfiguration.setQueryParameter('maxValuesPerFacet', nextMaxValuesPerFacet);\n          if (!values) {\n            var key = isDisjunctive ? 'disjunctiveFacetsRefinements' : 'facetsRefinements';\n            return withMaxValuesPerFacet.setQueryParameters(_defineProperty({}, key, _objectSpread2(_objectSpread2({}, withMaxValuesPerFacet[key]), {}, _defineProperty({}, attribute, []))));\n          }\n          return values.reduce(function (parameters, value) {\n            return isDisjunctive ? parameters.addDisjunctiveFacetRefinement(attribute, value) : parameters.addFacetRefinement(attribute, value);\n          }, withMaxValuesPerFacet);\n        }\n      };\n    };\n  };\n  function removeEmptyRefinementsFromUiState$3(indexUiState, attribute) {\n    if (!indexUiState.refinementList) {\n      return indexUiState;\n    }\n    if (!indexUiState.refinementList[attribute] || indexUiState.refinementList[attribute].length === 0) {\n      delete indexUiState.refinementList[attribute];\n    }\n    if (Object.keys(indexUiState.refinementList).length === 0) {\n      delete indexUiState.refinementList;\n    }\n    return indexUiState;\n  }\n\n  var withUsage$f = createDocumentationMessageGenerator({\n    name: 'related-products',\n    connector: true\n  });\n  var connectRelatedProducts = (function connectRelatedProducts(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$f());\n    return function (widgetParams) {\n      var _ref = widgetParams || {},\n        _ref$escapeHTML = _ref.escapeHTML,\n        escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,\n        objectIDs = _ref.objectIDs,\n        limit = _ref.limit,\n        threshold = _ref.threshold,\n        fallbackParameters = _ref.fallbackParameters,\n        queryParameters = _ref.queryParameters,\n        _ref$transformItems = _ref.transformItems,\n        transformItems = _ref$transformItems === void 0 ? function (items) {\n          return items;\n        } : _ref$transformItems;\n      if (!objectIDs || objectIDs.length === 0) {\n        throw new Error(withUsage$f('The `objectIDs` option is required.'));\n      }\n      var sendEvent;\n      return {\n        dependsOn: 'recommend',\n        $$type: 'ais.relatedProducts',\n        init: function init(initOptions) {\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: initOptions.instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var renderState = this.getWidgetRenderState(renderOptions);\n          renderFn(_objectSpread2(_objectSpread2({}, renderState), {}, {\n            instantSearchInstance: renderOptions.instantSearchInstance\n          }), false);\n        },\n        getRenderState: function getRenderState(renderState) {\n          return renderState;\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref2) {\n          var results = _ref2.results,\n            helper = _ref2.helper,\n            instantSearchInstance = _ref2.instantSearchInstance;\n          if (!sendEvent) {\n            sendEvent = createSendEventForHits({\n              instantSearchInstance: instantSearchInstance,\n              helper: helper,\n              widgetType: this.$$type\n            });\n          }\n          if (results === null || results === undefined) {\n            return {\n              items: [],\n              widgetParams: widgetParams,\n              sendEvent: sendEvent\n            };\n          }\n          if (escapeHTML && results.hits.length > 0) {\n            results.hits = escapeHits(results.hits);\n          }\n          var itemsWithAbsolutePosition = addAbsolutePosition(results.hits, 0, 1);\n          var itemsWithAbsolutePositionAndQueryID = addQueryID(itemsWithAbsolutePosition, results.queryID);\n          var transformedItems = transformItems(itemsWithAbsolutePositionAndQueryID, {\n            results: results\n          });\n          return {\n            items: transformedItems,\n            widgetParams: widgetParams,\n            sendEvent: sendEvent\n          };\n        },\n        dispose: function dispose(_ref3) {\n          var recommendState = _ref3.recommendState;\n          unmountFn();\n          return recommendState.removeParams(this.$$id);\n        },\n        getWidgetParameters: function getWidgetParameters(state) {\n          var _this = this;\n          return objectIDs.reduce(function (acc, objectID) {\n            return acc.addRelatedProducts({\n              objectID: objectID,\n              maxRecommendations: limit,\n              threshold: threshold,\n              fallbackParameters: _objectSpread2(_objectSpread2({}, fallbackParameters), escapeHTML ? TAG_PLACEHOLDER : {}),\n              queryParameters: _objectSpread2(_objectSpread2({}, queryParameters), escapeHTML ? TAG_PLACEHOLDER : {}),\n              $$id: _this.$$id\n            });\n          }, state.removeParams(this.$$id));\n        }\n      };\n    };\n  });\n\n  var withUsage$g = createDocumentationMessageGenerator({\n    name: 'search-box',\n    connector: true\n  });\n\n  /**\n   * @typedef {Object} CustomSearchBoxWidgetParams\n   * @property {function(string, function(string))} [queryHook = undefined] A function that will be called every time\n   * a new value for the query is set. The first parameter is the query and the second is a\n   * function to actually trigger the search. The function takes the query as the parameter.\n   *\n   * This queryHook can be used to debounce the number of searches done from the searchBox.\n   */\n\n  var defaultQueryHook = function defaultQueryHook(query, hook) {\n    return hook(query);\n  };\n\n  /**\n   * **SearchBox** connector provides the logic to build a widget that will let the user search for a query.\n   *\n   * The connector provides to the rendering: `refine()` to set the query. The behaviour of this function\n   * may be impacted by the `queryHook` widget parameter.\n   */\n  var connectSearchBox = function connectSearchBox(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$g());\n    return function (widgetParams) {\n      var _ref = widgetParams || {},\n        _ref$queryHook = _ref.queryHook,\n        queryHook = _ref$queryHook === void 0 ? defaultQueryHook : _ref$queryHook;\n      var _refine;\n      var _clear;\n      return {\n        $$type: 'ais.searchBox',\n        init: function init(initOptions) {\n          var instantSearchInstance = initOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var instantSearchInstance = renderOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), false);\n        },\n        dispose: function dispose(_ref2) {\n          var state = _ref2.state;\n          unmountFn();\n          return state.setQueryParameter('query', undefined);\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            searchBox: this.getWidgetRenderState(renderOptions)\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref3) {\n          var helper = _ref3.helper,\n            instantSearchInstance = _ref3.instantSearchInstance,\n            state = _ref3.state;\n          if (!_refine) {\n            _refine = function _refine(query) {\n              queryHook(query, function (q) {\n                return helper.setQuery(q).search();\n              });\n            };\n            _clear = function _clear() {\n              helper.setQuery('').search();\n            };\n          }\n          return {\n            query: state.query || '',\n            refine: _refine,\n            clear: _clear,\n            widgetParams: widgetParams,\n            isSearchStalled: instantSearchInstance.status === 'stalled'\n          };\n        },\n        getWidgetUiState: function getWidgetUiState(uiState, _ref4) {\n          var searchParameters = _ref4.searchParameters;\n          var query = searchParameters.query || '';\n          if (query === '' || uiState && uiState.query === query) {\n            return uiState;\n          }\n          return _objectSpread2(_objectSpread2({}, uiState), {}, {\n            query: query\n          });\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref5) {\n          var uiState = _ref5.uiState;\n          return searchParameters.setQueryParameter('query', uiState.query || '');\n        }\n      };\n    };\n  };\n\n  var withUsage$h = createDocumentationMessageGenerator({\n    name: 'sort-by',\n    connector: true\n  });\n\n  /**\n   * The **SortBy** connector provides the logic to build a custom widget that will display a\n   * list of indices. With Algolia, this is most commonly used for changing ranking strategy. This allows\n   * a user to change how the hits are being sorted.\n   */\n\n  var connectSortBy = function connectSortBy(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$h());\n    var connectorState = {};\n    return function (widgetParams) {\n      var _ref = widgetParams || {},\n        items = _ref.items,\n        _ref$transformItems = _ref.transformItems,\n        transformItems = _ref$transformItems === void 0 ? function (x) {\n          return x;\n        } : _ref$transformItems;\n      if (!Array.isArray(items)) {\n        throw new Error(withUsage$h('The `items` option expects an array of objects.'));\n      }\n      return {\n        $$type: 'ais.sortBy',\n        init: function init(initOptions) {\n          var instantSearchInstance = initOptions.instantSearchInstance;\n          var widgetRenderState = this.getWidgetRenderState(initOptions);\n          var currentIndex = widgetRenderState.currentRefinement;\n          var isCurrentIndexInItems = find(items, function (item) {\n            return item.value === currentIndex;\n          });\n           _warning(isCurrentIndexInItems !== undefined, \"The index named \\\"\".concat(currentIndex, \"\\\" is not listed in the `items` of `sortBy`.\")) ;\n          renderFn(_objectSpread2(_objectSpread2({}, widgetRenderState), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var instantSearchInstance = renderOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), false);\n        },\n        dispose: function dispose(_ref2) {\n          var state = _ref2.state;\n          unmountFn();\n          return connectorState.initialIndex ? state.setIndex(connectorState.initialIndex) : state;\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            sortBy: this.getWidgetRenderState(renderOptions)\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref3) {\n          var results = _ref3.results,\n            helper = _ref3.helper,\n            state = _ref3.state,\n            parent = _ref3.parent;\n          if (!connectorState.initialIndex && parent) {\n            connectorState.initialIndex = parent.getIndexName();\n          }\n          if (!connectorState.setIndex) {\n            connectorState.setIndex = function (indexName) {\n              helper.setIndex(indexName).search();\n            };\n          }\n          var hasNoResults = results ? results.nbHits === 0 : true;\n          return {\n            currentRefinement: state.index,\n            options: transformItems(items, {\n              results: results\n            }),\n            refine: connectorState.setIndex,\n            hasNoResults: hasNoResults,\n            canRefine: !hasNoResults && items.length > 0,\n            widgetParams: widgetParams\n          };\n        },\n        getWidgetUiState: function getWidgetUiState(uiState, _ref4) {\n          var searchParameters = _ref4.searchParameters;\n          var currentIndex = searchParameters.index;\n          return _objectSpread2(_objectSpread2({}, uiState), {}, {\n            sortBy: currentIndex !== connectorState.initialIndex ? currentIndex : undefined\n          });\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref5) {\n          var uiState = _ref5.uiState;\n          return searchParameters.setQueryParameter('index', uiState.sortBy || connectorState.initialIndex || searchParameters.index);\n        }\n      };\n    };\n  };\n\n  var withUsage$i = createDocumentationMessageGenerator({\n    name: 'rating-menu',\n    connector: true\n  });\n  var $$type$2 = 'ais.ratingMenu';\n  var MAX_VALUES_PER_FACET_API_LIMIT = 1000;\n  var STEP = 1;\n  var createSendEvent$1 = function createSendEvent(_ref) {\n    var instantSearchInstance = _ref.instantSearchInstance,\n      helper = _ref.helper,\n      getRefinedStar = _ref.getRefinedStar,\n      attribute = _ref.attribute;\n    return function () {\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n      if (args.length === 1) {\n        instantSearchInstance.sendEventToInsights(args[0]);\n        return;\n      }\n      var facetValue = args[1],\n        _args$ = args[2],\n        eventName = _args$ === void 0 ? 'Filter Applied' : _args$;\n      var _args$0$split = args[0].split(':'),\n        _args$0$split2 = _slicedToArray(_args$0$split, 2),\n        eventType = _args$0$split2[0],\n        eventModifier = _args$0$split2[1];\n      if (eventType !== 'click') {\n        return;\n      }\n      var isRefined = getRefinedStar() === Number(facetValue);\n      if (!isRefined) {\n        var _helper$lastResults;\n        instantSearchInstance.sendEventToInsights({\n          insightsMethod: 'clickedFilters',\n          widgetType: $$type$2,\n          eventType: eventType,\n          eventModifier: eventModifier,\n          payload: {\n            eventName: eventName,\n            index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,\n            filters: [\"\".concat(attribute, \">=\").concat(facetValue)]\n          },\n          attribute: attribute\n        });\n      }\n    };\n  };\n  /**\n   * **StarRating** connector provides the logic to build a custom widget that will let\n   * the user refine search results based on ratings.\n   *\n   * The connector provides to the rendering: `refine()` to select a value and\n   * `items` that are the values that can be selected. `refine` should be used\n   * with `items.value`.\n   */\n  var connectRatingMenu = function connectRatingMenu(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$i());\n    return function (widgetParams) {\n      var _ref2 = widgetParams || {},\n        attribute = _ref2.attribute,\n        _ref2$max = _ref2.max,\n        max = _ref2$max === void 0 ? 5 : _ref2$max;\n      var sendEvent;\n      if (!attribute) {\n        throw new Error(withUsage$i('The `attribute` option is required.'));\n      }\n      var _getRefinedStar = function getRefinedStar(state) {\n        var _values$;\n        var values = state.getNumericRefinements(attribute);\n        if (!((_values$ = values['>=']) !== null && _values$ !== void 0 && _values$.length)) {\n          return undefined;\n        }\n        return values['>='][0];\n      };\n      var getFacetsMaxDecimalPlaces = function getFacetsMaxDecimalPlaces(facetResults) {\n        var maxDecimalPlaces = 0;\n        facetResults.forEach(function (facetResult) {\n          var _facetResult$name$spl = facetResult.name.split('.'),\n            _facetResult$name$spl2 = _slicedToArray(_facetResult$name$spl, 2),\n            _facetResult$name$spl3 = _facetResult$name$spl2[1],\n            decimal = _facetResult$name$spl3 === void 0 ? '' : _facetResult$name$spl3;\n          maxDecimalPlaces = Math.max(maxDecimalPlaces, decimal.length);\n        });\n        return maxDecimalPlaces;\n      };\n      var getFacetValuesWarningMessage = function getFacetValuesWarningMessage(_ref3) {\n        var maxDecimalPlaces = _ref3.maxDecimalPlaces,\n          maxFacets = _ref3.maxFacets,\n          maxValuesPerFacet = _ref3.maxValuesPerFacet;\n        var maxDecimalPlacesInRange = Math.max(0, Math.floor(Math.log10(MAX_VALUES_PER_FACET_API_LIMIT / max)));\n        var maxFacetsInRange = Math.min(MAX_VALUES_PER_FACET_API_LIMIT, Math.pow(10, maxDecimalPlacesInRange) * max);\n        var solutions = [];\n        if (maxFacets > MAX_VALUES_PER_FACET_API_LIMIT) {\n          solutions.push(\"- Update your records to lower the precision of the values in the \\\"\".concat(attribute, \"\\\" attribute (for example: \").concat(5.123456789.toPrecision(maxDecimalPlaces + 1), \" to \").concat(5.123456789.toPrecision(maxDecimalPlacesInRange + 1), \")\"));\n        }\n        if (maxValuesPerFacet < maxFacetsInRange) {\n          solutions.push(\"- Increase the maximum number of facet values to \".concat(maxFacetsInRange, \" using the \\\"configure\\\" widget \").concat(createDocumentationLink({\n            name: 'configure'\n          }), \" and the \\\"maxValuesPerFacet\\\" parameter https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/\"));\n        }\n        return \"The \".concat(attribute, \" attribute can have \").concat(maxFacets, \" different values (0 to \").concat(max, \" with a maximum of \").concat(maxDecimalPlaces, \" decimals = \").concat(maxFacets, \") but you retrieved only \").concat(maxValuesPerFacet, \" facet values. Therefore the number of results that match the refinements can be incorrect.\\n    \").concat(solutions.length ? \"To resolve this problem you can:\\n\".concat(solutions.join('\\n')) : \"\");\n      };\n      function getRefinedState(state, facetValue) {\n        var isRefined = _getRefinedStar(state) === Number(facetValue);\n        var emptyState = state.resetPage().removeNumericRefinement(attribute);\n        if (!isRefined) {\n          return emptyState.addNumericRefinement(attribute, '<=', max).addNumericRefinement(attribute, '>=', Number(facetValue));\n        }\n        return emptyState;\n      }\n      var toggleRefinement = function toggleRefinement(helper, facetValue) {\n        sendEvent('click:internal', facetValue);\n        helper.setState(getRefinedState(helper.state, facetValue)).search();\n      };\n      var connectorState = {\n        toggleRefinementFactory: function toggleRefinementFactory(helper) {\n          return toggleRefinement.bind(null, helper);\n        },\n        createURLFactory: function createURLFactory(_ref4) {\n          var state = _ref4.state,\n            createURL = _ref4.createURL,\n            getWidgetUiState = _ref4.getWidgetUiState,\n            helper = _ref4.helper;\n          return function (value) {\n            return createURL(function (uiState) {\n              return getWidgetUiState(uiState, {\n                searchParameters: getRefinedState(state, value),\n                helper: helper\n              });\n            });\n          };\n        }\n      };\n      return {\n        $$type: $$type$2,\n        init: function init(initOptions) {\n          var instantSearchInstance = initOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var instantSearchInstance = renderOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), false);\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            ratingMenu: _objectSpread2(_objectSpread2({}, renderState.ratingMenu), {}, _defineProperty({}, attribute, this.getWidgetRenderState(renderOptions)))\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref5) {\n          var helper = _ref5.helper,\n            results = _ref5.results,\n            state = _ref5.state,\n            instantSearchInstance = _ref5.instantSearchInstance,\n            createURL = _ref5.createURL;\n          var facetValues = [];\n          if (!sendEvent) {\n            sendEvent = createSendEvent$1({\n              instantSearchInstance: instantSearchInstance,\n              helper: helper,\n              getRefinedStar: function getRefinedStar() {\n                return _getRefinedStar(helper.state);\n              },\n              attribute: attribute\n            });\n          }\n          var refinementIsApplied = false;\n          var totalCount = 0;\n          var facetResults = results === null || results === void 0 ? void 0 : results.getFacetValues(attribute, {});\n          if (results && facetResults) {\n            var maxValuesPerFacet = facetResults.length;\n            var maxDecimalPlaces = getFacetsMaxDecimalPlaces(facetResults);\n            var maxFacets = Math.pow(10, maxDecimalPlaces) * max;\n             _warning(maxFacets <= maxValuesPerFacet || Boolean(results.__isArtificial), getFacetValuesWarningMessage({\n              maxDecimalPlaces: maxDecimalPlaces,\n              maxFacets: maxFacets,\n              maxValuesPerFacet: maxValuesPerFacet\n            })) ;\n            var refinedStar = _getRefinedStar(state);\n            var _loop = function _loop(star) {\n              var isRefined = refinedStar === star;\n              refinementIsApplied = refinementIsApplied || isRefined;\n              var count = facetResults.filter(function (f) {\n                return Number(f.name) >= star && Number(f.name) <= max;\n              }).map(function (f) {\n                return f.count;\n              }).reduce(function (sum, current) {\n                return sum + current;\n              }, 0);\n              totalCount += count;\n              if (refinedStar && !isRefined && count === 0) {\n                // skip count==0 when at least 1 refinement is enabled\n                // eslint-disable-next-line no-continue\n                return \"continue\";\n              }\n              var stars = _toConsumableArray(new Array(Math.floor(max / STEP))).map(function (_v, i) {\n                return i * STEP < star;\n              });\n              facetValues.push({\n                stars: stars,\n                name: String(star),\n                label: String(star),\n                value: String(star),\n                count: count,\n                isRefined: isRefined\n              });\n            };\n            for (var star = STEP; star < max; star += STEP) {\n              var _ret = _loop(star);\n              if (_ret === \"continue\") continue;\n            }\n          }\n          facetValues = facetValues.reverse();\n          var hasNoResults = results ? results.nbHits === 0 : true;\n          return {\n            items: facetValues,\n            hasNoResults: hasNoResults,\n            canRefine: (!hasNoResults || refinementIsApplied) && totalCount > 0,\n            refine: connectorState.toggleRefinementFactory(helper),\n            sendEvent: sendEvent,\n            createURL: connectorState.createURLFactory({\n              state: state,\n              createURL: createURL,\n              helper: helper,\n              getWidgetUiState: this.getWidgetUiState\n            }),\n            widgetParams: widgetParams\n          };\n        },\n        dispose: function dispose(_ref6) {\n          var state = _ref6.state;\n          unmountFn();\n          return state.removeNumericRefinement(attribute);\n        },\n        getWidgetUiState: function getWidgetUiState(uiState, _ref7) {\n          var searchParameters = _ref7.searchParameters;\n          var value = _getRefinedStar(searchParameters);\n          return removeEmptyRefinementsFromUiState$4(_objectSpread2(_objectSpread2({}, uiState), {}, {\n            ratingMenu: _objectSpread2(_objectSpread2({}, uiState.ratingMenu), {}, _defineProperty({}, attribute, typeof value === 'number' ? value : undefined))\n          }), attribute);\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref8) {\n          var uiState = _ref8.uiState;\n          var value = uiState.ratingMenu && uiState.ratingMenu[attribute];\n          var withDisjunctiveFacet = searchParameters.addDisjunctiveFacet(attribute).removeNumericRefinement(attribute).removeDisjunctiveFacetRefinement(attribute);\n          if (!value) {\n            return withDisjunctiveFacet.setQueryParameters({\n              numericRefinements: _objectSpread2(_objectSpread2({}, withDisjunctiveFacet.numericRefinements), {}, _defineProperty({}, attribute, {}))\n            });\n          }\n          return withDisjunctiveFacet.addNumericRefinement(attribute, '<=', max).addNumericRefinement(attribute, '>=', value);\n        }\n      };\n    };\n  };\n  function removeEmptyRefinementsFromUiState$4(indexUiState, attribute) {\n    if (!indexUiState.ratingMenu) {\n      return indexUiState;\n    }\n    if (typeof indexUiState.ratingMenu[attribute] !== 'number') {\n      delete indexUiState.ratingMenu[attribute];\n    }\n    if (Object.keys(indexUiState.ratingMenu).length === 0) {\n      delete indexUiState.ratingMenu;\n    }\n    return indexUiState;\n  }\n\n  var withUsage$j = createDocumentationMessageGenerator({\n    name: 'stats',\n    connector: true\n  });\n\n  /**\n   * **Stats** connector provides the logic to build a custom widget that will displays\n   * search statistics (hits number and processing time).\n   */\n\n  var connectStats = function connectStats(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$j());\n    return function (widgetParams) {\n      return {\n        $$type: 'ais.stats',\n        init: function init(initOptions) {\n          var instantSearchInstance = initOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var instantSearchInstance = renderOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), false);\n        },\n        dispose: function dispose() {\n          unmountFn();\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            stats: this.getWidgetRenderState(renderOptions)\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref) {\n          var results = _ref.results,\n            state = _ref.state;\n          if (!results) {\n            return {\n              hitsPerPage: state.hitsPerPage,\n              nbHits: 0,\n              nbSortedHits: undefined,\n              areHitsSorted: false,\n              nbPages: 0,\n              page: state.page || 0,\n              processingTimeMS: -1,\n              query: state.query || '',\n              widgetParams: widgetParams\n            };\n          }\n          return {\n            hitsPerPage: results.hitsPerPage,\n            nbHits: results.nbHits,\n            nbSortedHits: results.nbSortedHits,\n            areHitsSorted: typeof results.appliedRelevancyStrictness !== 'undefined' && results.appliedRelevancyStrictness > 0 && results.nbSortedHits !== results.nbHits,\n            nbPages: results.nbPages,\n            page: results.page,\n            processingTimeMS: results.processingTimeMS,\n            query: results.query,\n            widgetParams: widgetParams\n          };\n        }\n      };\n    };\n  };\n\n  var withUsage$k = createDocumentationMessageGenerator({\n    name: 'toggle-refinement',\n    connector: true\n  });\n  var $$type$3 = 'ais.toggleRefinement';\n  var createSendEvent$2 = function createSendEvent(_ref) {\n    var instantSearchInstance = _ref.instantSearchInstance,\n      helper = _ref.helper,\n      attribute = _ref.attribute,\n      on = _ref.on;\n    var sendEventForToggle = function sendEventForToggle() {\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n      if (args.length === 1) {\n        instantSearchInstance.sendEventToInsights(args[0]);\n        return;\n      }\n      var isRefined = args[1],\n        _args$ = args[2],\n        eventName = _args$ === void 0 ? 'Filter Applied' : _args$;\n      var _args$0$split = args[0].split(':'),\n        _args$0$split2 = _slicedToArray(_args$0$split, 2),\n        eventType = _args$0$split2[0],\n        eventModifier = _args$0$split2[1];\n      if (eventType !== 'click' || on === undefined) {\n        return;\n      }\n\n      // only send an event when the refinement gets applied,\n      // not when it gets removed\n      if (!isRefined) {\n        var _helper$lastResults;\n        instantSearchInstance.sendEventToInsights({\n          insightsMethod: 'clickedFilters',\n          widgetType: $$type$3,\n          eventType: eventType,\n          eventModifier: eventModifier,\n          payload: {\n            eventName: eventName,\n            index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,\n            filters: on.map(function (value) {\n              return \"\".concat(attribute, \":\").concat(value);\n            })\n          },\n          attribute: attribute\n        });\n      }\n    };\n    return sendEventForToggle;\n  };\n  /**\n   * **Toggle** connector provides the logic to build a custom widget that will provide\n   * an on/off filtering feature based on an attribute value or values.\n   *\n   * Two modes are implemented in the custom widget:\n   *  - with or without the value filtered\n   *  - switch between two values.\n   */\n  var connectToggleRefinement = function connectToggleRefinement(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$k());\n    return function (widgetParams) {\n      var _ref2 = widgetParams || {},\n        attribute = _ref2.attribute,\n        _ref2$on = _ref2.on,\n        userOn = _ref2$on === void 0 ? true : _ref2$on,\n        userOff = _ref2.off;\n      if (!attribute) {\n        throw new Error(withUsage$k('The `attribute` option is required.'));\n      }\n      var hasAnOffValue = userOff !== undefined;\n      // even though facet values can be numbers and boolean,\n      // the helper methods only accept string in the type\n      var on = toArray(userOn).map(escapeFacetValue);\n      var off = hasAnOffValue ? toArray(userOff).map(escapeFacetValue) : undefined;\n      var sendEvent;\n      var toggleRefinementFactory = function toggleRefinementFactory(helper) {\n        return function () {\n          var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n              isRefined: false\n            },\n            isRefined = _ref3.isRefined;\n          if (!isRefined) {\n            sendEvent('click:internal', isRefined);\n            if (hasAnOffValue) {\n              off.forEach(function (v) {\n                return helper.removeDisjunctiveFacetRefinement(attribute, v);\n              });\n            }\n            on.forEach(function (v) {\n              return helper.addDisjunctiveFacetRefinement(attribute, v);\n            });\n          } else {\n            on.forEach(function (v) {\n              return helper.removeDisjunctiveFacetRefinement(attribute, v);\n            });\n            if (hasAnOffValue) {\n              off.forEach(function (v) {\n                return helper.addDisjunctiveFacetRefinement(attribute, v);\n              });\n            }\n          }\n          helper.search();\n        };\n      };\n      var connectorState = {\n        createURLFactory: function createURLFactory(isRefined, _ref4) {\n          var state = _ref4.state,\n            createURL = _ref4.createURL,\n            getWidgetUiState = _ref4.getWidgetUiState,\n            helper = _ref4.helper;\n          return function () {\n            state = state.resetPage();\n            var valuesToRemove = isRefined ? on : off;\n            if (valuesToRemove) {\n              valuesToRemove.forEach(function (v) {\n                state = state.removeDisjunctiveFacetRefinement(attribute, v);\n              });\n            }\n            var valuesToAdd = isRefined ? off : on;\n            if (valuesToAdd) {\n              valuesToAdd.forEach(function (v) {\n                state = state.addDisjunctiveFacetRefinement(attribute, v);\n              });\n            }\n            return createURL(function (uiState) {\n              return getWidgetUiState(uiState, {\n                searchParameters: state,\n                helper: helper\n              });\n            });\n          };\n        }\n      };\n      return {\n        $$type: $$type$3,\n        init: function init(initOptions) {\n          var instantSearchInstance = initOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var instantSearchInstance = renderOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), false);\n        },\n        dispose: function dispose(_ref5) {\n          var state = _ref5.state;\n          unmountFn();\n          return state.removeDisjunctiveFacet(attribute);\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            toggleRefinement: _objectSpread2(_objectSpread2({}, renderState.toggleRefinement), {}, _defineProperty({}, attribute, this.getWidgetRenderState(renderOptions)))\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref6) {\n          var state = _ref6.state,\n            helper = _ref6.helper,\n            results = _ref6.results,\n            createURL = _ref6.createURL,\n            instantSearchInstance = _ref6.instantSearchInstance;\n          var isRefined = results ? on.every(function (v) {\n            return state.isDisjunctiveFacetRefined(attribute, v);\n          }) : on.every(function (v) {\n            return state.isDisjunctiveFacetRefined(attribute, v);\n          });\n          var onFacetValue = {\n            isRefined: isRefined,\n            count: 0\n          };\n          var offFacetValue = {\n            isRefined: hasAnOffValue && !isRefined,\n            count: 0\n          };\n          if (results) {\n            var offValue = toArray(off || false);\n            var allFacetValues = results.getFacetValues(attribute, {}) || [];\n            var onData = on.map(function (v) {\n              return find(allFacetValues, function (_ref7) {\n                var escapedValue = _ref7.escapedValue;\n                return escapedValue === escapeFacetValue(String(v));\n              });\n            }).filter(function (v) {\n              return v !== undefined;\n            });\n            var offData = hasAnOffValue ? offValue.map(function (v) {\n              return find(allFacetValues, function (_ref8) {\n                var escapedValue = _ref8.escapedValue;\n                return escapedValue === escapeFacetValue(String(v));\n              });\n            }).filter(function (v) {\n              return v !== undefined;\n            }) : [];\n            onFacetValue = {\n              isRefined: onData.length ? onData.every(function (v) {\n                return v.isRefined;\n              }) : false,\n              count: onData.reduce(function (acc, v) {\n                return acc + v.count;\n              }, 0) || null\n            };\n            offFacetValue = {\n              isRefined: offData.length ? offData.every(function (v) {\n                return v.isRefined;\n              }) : false,\n              count: offData.reduce(function (acc, v) {\n                return acc + v.count;\n              }, 0) || allFacetValues.reduce(function (total, _ref9) {\n                var count = _ref9.count;\n                return total + count;\n              }, 0)\n            };\n          }\n          if (!sendEvent) {\n            sendEvent = createSendEvent$2({\n              instantSearchInstance: instantSearchInstance,\n              attribute: attribute,\n              on: on,\n              helper: helper\n            });\n          }\n          var nextRefinement = isRefined ? offFacetValue : onFacetValue;\n          return {\n            value: {\n              name: attribute,\n              isRefined: isRefined,\n              count: results ? nextRefinement.count : null,\n              onFacetValue: onFacetValue,\n              offFacetValue: offFacetValue\n            },\n            createURL: connectorState.createURLFactory(isRefined, {\n              state: state,\n              createURL: createURL,\n              helper: helper,\n              getWidgetUiState: this.getWidgetUiState\n            }),\n            sendEvent: sendEvent,\n            canRefine: Boolean(results ? nextRefinement.count : null),\n            refine: toggleRefinementFactory(helper),\n            widgetParams: widgetParams\n          };\n        },\n        getWidgetUiState: function getWidgetUiState(uiState, _ref10) {\n          var searchParameters = _ref10.searchParameters;\n          var isRefined = on && on.every(function (v) {\n            return searchParameters.isDisjunctiveFacetRefined(attribute, v);\n          });\n          if (!isRefined) {\n            var _uiState$toggle;\n            // This needs to be done in the case `uiState` comes from `createURL`\n            (_uiState$toggle = uiState.toggle) === null || _uiState$toggle === void 0 ? true : delete _uiState$toggle[attribute];\n            return uiState;\n          }\n          return _objectSpread2(_objectSpread2({}, uiState), {}, {\n            toggle: _objectSpread2(_objectSpread2({}, uiState.toggle), {}, _defineProperty({}, attribute, isRefined))\n          });\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref11) {\n          var uiState = _ref11.uiState;\n          if (searchParameters.isHierarchicalFacet(attribute) || searchParameters.isConjunctiveFacet(attribute)) {\n             _warning(false, \"ToggleRefinement: Attribute \\\"\".concat(attribute, \"\\\" is already used by another widget of a different type.\\nAs this is not supported, please make sure to remove this other widget or this ToggleRefinement widget will not work at all.\")) ;\n            return searchParameters;\n          }\n          var withFacetConfiguration = searchParameters.addDisjunctiveFacet(attribute).removeDisjunctiveFacetRefinement(attribute);\n          var isRefined = Boolean(uiState.toggle && uiState.toggle[attribute]);\n          if (isRefined) {\n            if (on) {\n              on.forEach(function (v) {\n                withFacetConfiguration = withFacetConfiguration.addDisjunctiveFacetRefinement(attribute, v);\n              });\n            }\n            return withFacetConfiguration;\n          }\n\n          // It's not refined with an `off` value\n          if (hasAnOffValue) {\n            if (off) {\n              off.forEach(function (v) {\n                withFacetConfiguration = withFacetConfiguration.addDisjunctiveFacetRefinement(attribute, v);\n              });\n            }\n            return withFacetConfiguration;\n          }\n\n          // It's not refined without an `off` value\n          return withFacetConfiguration.setQueryParameters({\n            disjunctiveFacetsRefinements: _objectSpread2(_objectSpread2({}, searchParameters.disjunctiveFacetsRefinements), {}, _defineProperty({}, attribute, []))\n          });\n        }\n      };\n    };\n  };\n\n  var withUsage$l = createDocumentationMessageGenerator({\n    name: 'trending-items',\n    connector: true\n  });\n  var connectTrendingItems = (function connectTrendingItems(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$l());\n    return function (widgetParams) {\n      var _ref = widgetParams || {},\n        facetName = _ref.facetName,\n        facetValue = _ref.facetValue,\n        limit = _ref.limit,\n        threshold = _ref.threshold,\n        fallbackParameters = _ref.fallbackParameters,\n        queryParameters = _ref.queryParameters,\n        _ref$escapeHTML = _ref.escapeHTML,\n        escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,\n        _ref$transformItems = _ref.transformItems,\n        transformItems = _ref$transformItems === void 0 ? function (items) {\n          return items;\n        } : _ref$transformItems;\n      if (facetName && !facetValue || !facetName && facetValue) {\n        throw new Error(withUsage$l(\"When you provide facetName (received type \".concat(getObjectType(facetName), \"), you must also provide facetValue (received type \").concat(getObjectType(facetValue), \").\")));\n      }\n      var sendEvent;\n      return {\n        dependsOn: 'recommend',\n        $$type: 'ais.trendingItems',\n        init: function init(initOptions) {\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: initOptions.instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var renderState = this.getWidgetRenderState(renderOptions);\n          renderFn(_objectSpread2(_objectSpread2({}, renderState), {}, {\n            instantSearchInstance: renderOptions.instantSearchInstance\n          }), false);\n        },\n        getRenderState: function getRenderState(renderState) {\n          return renderState;\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref2) {\n          var results = _ref2.results,\n            helper = _ref2.helper,\n            instantSearchInstance = _ref2.instantSearchInstance;\n          if (!sendEvent) {\n            sendEvent = createSendEventForHits({\n              instantSearchInstance: instantSearchInstance,\n              helper: helper,\n              widgetType: this.$$type\n            });\n          }\n          if (results === null || results === undefined) {\n            return {\n              items: [],\n              widgetParams: widgetParams,\n              sendEvent: sendEvent\n            };\n          }\n          if (escapeHTML && results.hits.length > 0) {\n            results.hits = escapeHits(results.hits);\n          }\n          var itemsWithAbsolutePosition = addAbsolutePosition(results.hits, 0, 1);\n          var itemsWithAbsolutePositionAndQueryID = addQueryID(itemsWithAbsolutePosition, results.queryID);\n          var transformedItems = transformItems(itemsWithAbsolutePositionAndQueryID, {\n            results: results\n          });\n          return {\n            items: transformedItems,\n            widgetParams: widgetParams,\n            sendEvent: sendEvent\n          };\n        },\n        dispose: function dispose(_ref3) {\n          var recommendState = _ref3.recommendState;\n          unmountFn();\n          return recommendState.removeParams(this.$$id);\n        },\n        getWidgetParameters: function getWidgetParameters(state) {\n          return state.removeParams(this.$$id).addTrendingItems({\n            facetName: facetName,\n            facetValue: facetValue,\n            maxRecommendations: limit,\n            threshold: threshold,\n            fallbackParameters: _objectSpread2(_objectSpread2({}, fallbackParameters), escapeHTML ? TAG_PLACEHOLDER : {}),\n            queryParameters: _objectSpread2(_objectSpread2({}, queryParameters), escapeHTML ? TAG_PLACEHOLDER : {}),\n            $$id: this.$$id\n          });\n        }\n      };\n    };\n  });\n\n  var withUsage$m = createDocumentationMessageGenerator({\n    name: 'breadcrumb',\n    connector: true\n  });\n  var connectBreadcrumb = function connectBreadcrumb(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$m());\n    var connectorState = {};\n    return function (widgetParams) {\n      var _ref = widgetParams || {},\n        attributes = _ref.attributes,\n        _ref$separator = _ref.separator,\n        separator = _ref$separator === void 0 ? ' > ' : _ref$separator,\n        _ref$rootPath = _ref.rootPath,\n        rootPath = _ref$rootPath === void 0 ? null : _ref$rootPath,\n        _ref$transformItems = _ref.transformItems,\n        transformItems = _ref$transformItems === void 0 ? function (items) {\n          return items;\n        } : _ref$transformItems;\n      if (!attributes || !Array.isArray(attributes) || attributes.length === 0) {\n        throw new Error(withUsage$m('The `attributes` option expects an array of strings.'));\n      }\n      var _attributes = _slicedToArray(attributes, 1),\n        hierarchicalFacetName = _attributes[0];\n      function getRefinedState(state, facetValue) {\n        if (!facetValue) {\n          var breadcrumb = state.getHierarchicalFacetBreadcrumb(hierarchicalFacetName);\n          if (breadcrumb.length === 0) {\n            return state;\n          } else {\n            return state.resetPage().toggleFacetRefinement(hierarchicalFacetName, breadcrumb[0]);\n          }\n        }\n        return state.resetPage().toggleFacetRefinement(hierarchicalFacetName, facetValue);\n      }\n      return {\n        $$type: 'ais.breadcrumb',\n        init: function init(initOptions) {\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: initOptions.instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: renderOptions.instantSearchInstance\n          }), false);\n        },\n        dispose: function dispose() {\n          unmountFn();\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            breadcrumb: _objectSpread2(_objectSpread2({}, renderState.breadcrumb), {}, _defineProperty({}, hierarchicalFacetName, this.getWidgetRenderState(renderOptions)))\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref2) {\n          var _this = this;\n          var helper = _ref2.helper,\n            createURL = _ref2.createURL,\n            results = _ref2.results,\n            state = _ref2.state;\n          function getItems() {\n            // The hierarchicalFacets condition is required for flavors\n            // that render immediately with empty results, without relying\n            // on init() (like React InstantSearch).\n            if (!results || state.hierarchicalFacets.length === 0) {\n              return [];\n            }\n            var _state$hierarchicalFa = _slicedToArray(state.hierarchicalFacets, 1),\n              facetName = _state$hierarchicalFa[0].name;\n            var facetValues = results.getFacetValues(facetName, {});\n            var facetItems = facetValues && !Array.isArray(facetValues) && facetValues.data ? facetValues.data : [];\n            var items = transformItems(shiftItemsValues(prepareItems(facetItems)), {\n              results: results\n            });\n            return items;\n          }\n          var items = getItems();\n          if (!connectorState.createURL) {\n            connectorState.createURL = function (facetValue) {\n              return createURL(function (uiState) {\n                return _this.getWidgetUiState(uiState, {\n                  searchParameters: getRefinedState(helper.state, facetValue),\n                  helper: helper\n                });\n              });\n            };\n          }\n          if (!connectorState.refine) {\n            connectorState.refine = function (facetValue) {\n              helper.setState(getRefinedState(helper.state, facetValue)).search();\n            };\n          }\n          return {\n            canRefine: items.length > 0,\n            createURL: connectorState.createURL,\n            items: items,\n            refine: connectorState.refine,\n            widgetParams: widgetParams\n          };\n        },\n        getWidgetUiState: function getWidgetUiState(uiState, _ref3) {\n          var searchParameters = _ref3.searchParameters;\n          var path = searchParameters.getHierarchicalFacetBreadcrumb(hierarchicalFacetName);\n          return removeEmptyRefinementsFromUiState$5(_objectSpread2(_objectSpread2({}, uiState), {}, {\n            hierarchicalMenu: _objectSpread2(_objectSpread2({}, uiState.hierarchicalMenu), {}, _defineProperty({}, hierarchicalFacetName, path))\n          }), hierarchicalFacetName);\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref4) {\n          var uiState = _ref4.uiState;\n          var values = uiState.hierarchicalMenu && uiState.hierarchicalMenu[hierarchicalFacetName];\n          if (searchParameters.isConjunctiveFacet(hierarchicalFacetName) || searchParameters.isDisjunctiveFacet(hierarchicalFacetName)) {\n             _warning(false, \"HierarchicalMenu: Attribute \\\"\".concat(hierarchicalFacetName, \"\\\" is already used by another widget applying conjunctive or disjunctive faceting.\\nAs this is not supported, please make sure to remove this other widget or this HierarchicalMenu widget will not work at all.\")) ;\n            return searchParameters;\n          }\n          if (searchParameters.isHierarchicalFacet(hierarchicalFacetName)) {\n            var facet = searchParameters.getHierarchicalFacetByName(hierarchicalFacetName);\n             _warning(isEqual(facet.attributes, attributes) && facet.separator === separator && facet.rootPath === rootPath, 'Using Breadcrumb and HierarchicalMenu on the same facet with different options overrides the configuration of the HierarchicalMenu.') ;\n          }\n          var withFacetConfiguration = searchParameters.removeHierarchicalFacet(hierarchicalFacetName).addHierarchicalFacet({\n            name: hierarchicalFacetName,\n            attributes: attributes,\n            separator: separator,\n            rootPath: rootPath\n          });\n          if (!values) {\n            return withFacetConfiguration.setQueryParameters({\n              hierarchicalFacetsRefinements: _objectSpread2(_objectSpread2({}, withFacetConfiguration.hierarchicalFacetsRefinements), {}, _defineProperty({}, hierarchicalFacetName, []))\n            });\n          }\n          return withFacetConfiguration.addHierarchicalFacetRefinement(hierarchicalFacetName, values.join(separator));\n        }\n      };\n    };\n  };\n  function prepareItems(data) {\n    return data.reduce(function (result, currentItem) {\n      if (currentItem.isRefined) {\n        result.push({\n          label: currentItem.name,\n          value: currentItem.escapedValue\n        });\n        if (Array.isArray(currentItem.data)) {\n          result = result.concat(prepareItems(currentItem.data));\n        }\n      }\n      return result;\n    }, []);\n  }\n  function shiftItemsValues(array) {\n    return array.map(function (x, idx) {\n      return {\n        label: x.label,\n        value: idx + 1 === array.length ? null : array[idx + 1].value\n      };\n    });\n  }\n  function removeEmptyRefinementsFromUiState$5(indexUiState, attribute) {\n    if (!indexUiState.hierarchicalMenu) {\n      return indexUiState;\n    }\n    if (!indexUiState.hierarchicalMenu[attribute] || !indexUiState.hierarchicalMenu[attribute].length) {\n      delete indexUiState.hierarchicalMenu[attribute];\n    }\n    if (Object.keys(indexUiState.hierarchicalMenu).length === 0) {\n      delete indexUiState.hierarchicalMenu;\n    }\n    return indexUiState;\n  }\n\n  var withUsage$n = createDocumentationMessageGenerator({\n    name: 'geo-search',\n    connector: true\n  });\n\n  // in this connector, we assume insideBoundingBox is only a string,\n  // even though in the helper it's defined as number[][] alone.\n  // This can be done, since the connector assumes \"control\" of the parameter\n  function getBoundingBoxAsString(state) {\n    return state.insideBoundingBox || '';\n  }\n  function setBoundingBoxAsString(state, value) {\n    return state.setQueryParameter('insideBoundingBox', value);\n  }\n  var $$type$4 = 'ais.geoSearch';\n  /**\n   * The **GeoSearch** connector provides the logic to build a widget that will display the results on a map. It also provides a way to search for results based on their position. The connector provides functions to manage the search experience (search on map interaction or control the interaction for example).\n   *\n   * @requirements\n   *\n   * Note that the GeoSearch connector uses the [geosearch](https://www.algolia.com/doc/guides/searching/geo-search) capabilities of Algolia. Your hits **must** have a `_geoloc` attribute in order to be passed to the rendering function.\n   *\n   * Currently, the feature is not compatible with multiple values in the _geoloc attribute.\n   */\n  var connectGeoSearch = (function connectGeoSearch(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$n());\n    return function (widgetParams) {\n      var _ref = widgetParams || {},\n        _ref$enableRefineOnMa = _ref.enableRefineOnMapMove,\n        enableRefineOnMapMove = _ref$enableRefineOnMa === void 0 ? true : _ref$enableRefineOnMa,\n        _ref$transformItems = _ref.transformItems,\n        transformItems = _ref$transformItems === void 0 ? function (items) {\n          return items;\n        } : _ref$transformItems;\n      var widgetState = {\n        isRefineOnMapMove: enableRefineOnMapMove,\n        // @MAJOR hasMapMoveSinceLastRefine -> hasMapMovedSinceLastRefine\n        hasMapMoveSinceLastRefine: false,\n        lastRefinePosition: '',\n        lastRefineBoundingBox: '',\n        internalToggleRefineOnMapMove: noop,\n        internalSetMapMoveSinceLastRefine: noop\n      };\n      var getPositionFromState = function getPositionFromState(state) {\n        return state.aroundLatLng ? aroundLatLngToPosition(state.aroundLatLng) : undefined;\n      };\n      var getCurrentRefinementFromState = function getCurrentRefinementFromState(state) {\n        return state.insideBoundingBox && insideBoundingBoxToBoundingBox(state.insideBoundingBox);\n      };\n      var refine = function refine(helper) {\n        return function (_ref2) {\n          var ne = _ref2.northEast,\n            sw = _ref2.southWest;\n          var boundingBox = [ne.lat, ne.lng, sw.lat, sw.lng].join();\n          helper.setState(setBoundingBoxAsString(helper.state, boundingBox).resetPage()).search();\n          widgetState.hasMapMoveSinceLastRefine = false;\n          widgetState.lastRefineBoundingBox = boundingBox;\n        };\n      };\n      var clearMapRefinement = function clearMapRefinement(helper) {\n        return function () {\n          helper.setQueryParameter('insideBoundingBox', undefined).search();\n        };\n      };\n      var isRefinedWithMap = function isRefinedWithMap(state) {\n        return function () {\n          return Boolean(state.insideBoundingBox);\n        };\n      };\n      var toggleRefineOnMapMove = function toggleRefineOnMapMove() {\n        return widgetState.internalToggleRefineOnMapMove();\n      };\n      var createInternalToggleRefinementOnMapMove = function createInternalToggleRefinementOnMapMove(renderOptions, render) {\n        return function () {\n          widgetState.isRefineOnMapMove = !widgetState.isRefineOnMapMove;\n          render(renderOptions);\n        };\n      };\n      var isRefineOnMapMove = function isRefineOnMapMove() {\n        return widgetState.isRefineOnMapMove;\n      };\n      var setMapMoveSinceLastRefine = function setMapMoveSinceLastRefine() {\n        return widgetState.internalSetMapMoveSinceLastRefine();\n      };\n      var createInternalSetMapMoveSinceLastRefine = function createInternalSetMapMoveSinceLastRefine(renderOptions, render) {\n        return function () {\n          var shouldTriggerRender = widgetState.hasMapMoveSinceLastRefine !== true;\n          widgetState.hasMapMoveSinceLastRefine = true;\n          if (shouldTriggerRender) {\n            render(renderOptions);\n          }\n        };\n      };\n      var hasMapMoveSinceLastRefine = function hasMapMoveSinceLastRefine() {\n        return widgetState.hasMapMoveSinceLastRefine;\n      };\n      var sendEvent;\n      return {\n        $$type: $$type$4,\n        init: function init(initArgs) {\n          var instantSearchInstance = initArgs.instantSearchInstance;\n          var isFirstRendering = true;\n          widgetState.internalToggleRefineOnMapMove = createInternalToggleRefinementOnMapMove(initArgs, noop);\n          widgetState.internalSetMapMoveSinceLastRefine = createInternalSetMapMoveSinceLastRefine(initArgs, noop);\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initArgs)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), isFirstRendering);\n        },\n        render: function render(renderArgs) {\n          var helper = renderArgs.helper,\n            instantSearchInstance = renderArgs.instantSearchInstance;\n          var isFirstRendering = false;\n          // We don't use the state provided by the render function because we need\n          // to be sure that the state is the latest one for the following condition\n          var state = helper.state;\n          var positionChangedSinceLastRefine = Boolean(state.aroundLatLng) && Boolean(widgetState.lastRefinePosition) && state.aroundLatLng !== widgetState.lastRefinePosition;\n          var boundingBoxChangedSinceLastRefine = !state.insideBoundingBox && Boolean(widgetState.lastRefineBoundingBox) && state.insideBoundingBox !== widgetState.lastRefineBoundingBox;\n          if (positionChangedSinceLastRefine || boundingBoxChangedSinceLastRefine) {\n            widgetState.hasMapMoveSinceLastRefine = false;\n          }\n          widgetState.lastRefinePosition = state.aroundLatLng || '';\n          widgetState.lastRefineBoundingBox = getBoundingBoxAsString(state);\n          widgetState.internalToggleRefineOnMapMove = createInternalToggleRefinementOnMapMove(renderArgs, this.render.bind(this));\n          widgetState.internalSetMapMoveSinceLastRefine = createInternalSetMapMoveSinceLastRefine(renderArgs, this.render.bind(this));\n          var widgetRenderState = this.getWidgetRenderState(renderArgs);\n          sendEvent('view:internal', widgetRenderState.items);\n          renderFn(_objectSpread2(_objectSpread2({}, widgetRenderState), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), isFirstRendering);\n        },\n        getWidgetRenderState: function getWidgetRenderState(renderOptions) {\n          var helper = renderOptions.helper,\n            results = renderOptions.results,\n            instantSearchInstance = renderOptions.instantSearchInstance;\n          var state = helper.state;\n          var items = results ? transformItems(results.hits.filter(function (hit) {\n            return hit._geoloc;\n          }), {\n            results: results\n          }) : [];\n          if (!sendEvent) {\n            sendEvent = createSendEventForHits({\n              instantSearchInstance: instantSearchInstance,\n              helper: helper,\n              widgetType: $$type$4\n            });\n          }\n          return {\n            items: items,\n            position: getPositionFromState(state),\n            currentRefinement: getCurrentRefinementFromState(state),\n            refine: refine(helper),\n            sendEvent: sendEvent,\n            clearMapRefinement: clearMapRefinement(helper),\n            isRefinedWithMap: isRefinedWithMap(state),\n            toggleRefineOnMapMove: toggleRefineOnMapMove,\n            isRefineOnMapMove: isRefineOnMapMove,\n            setMapMoveSinceLastRefine: setMapMoveSinceLastRefine,\n            hasMapMoveSinceLastRefine: hasMapMoveSinceLastRefine,\n            widgetParams: widgetParams\n          };\n        },\n        getRenderState: function getRenderState(renderState, renderOptions\n        // Type is explicitly redefined, to avoid having the TWidgetParams type in the definition\n        ) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            geoSearch: this.getWidgetRenderState(renderOptions)\n          });\n        },\n        dispose: function dispose(_ref3) {\n          var state = _ref3.state;\n          unmountFn();\n          return state.setQueryParameter('insideBoundingBox', undefined);\n        },\n        getWidgetUiState: function getWidgetUiState(uiState, _ref4) {\n          var searchParameters = _ref4.searchParameters;\n          var boundingBox = getBoundingBoxAsString(searchParameters);\n          if (!boundingBox || uiState && uiState.geoSearch && uiState.geoSearch.boundingBox === boundingBox) {\n            return uiState;\n          }\n          return _objectSpread2(_objectSpread2({}, uiState), {}, {\n            geoSearch: {\n              boundingBox: boundingBox\n            }\n          });\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref5) {\n          var uiState = _ref5.uiState;\n          if (!uiState || !uiState.geoSearch) {\n            return searchParameters.setQueryParameter('insideBoundingBox', undefined);\n          }\n          return setBoundingBoxAsString(searchParameters, uiState.geoSearch.boundingBox);\n        }\n      };\n    };\n  });\n\n  var withUsage$o = createDocumentationMessageGenerator({\n    name: 'powered-by',\n    connector: true\n  });\n  /**\n   * **PoweredBy** connector provides the logic to build a custom widget that will displays\n   * the logo to redirect to Algolia.\n   */\n  var connectPoweredBy = function connectPoweredBy(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$o());\n    var defaultUrl = 'https://www.algolia.com/?' + 'utm_source=instantsearch.js&' + 'utm_medium=website&' + \"utm_content=\".concat(safelyRunOnBrowser(function (_ref) {\n      var _window$location;\n      var window = _ref.window;\n      return ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location.hostname) || '';\n    }, {\n      fallback: function fallback() {\n        return '';\n      }\n    }), \"&\") + 'utm_campaign=poweredby';\n    return function (widgetParams) {\n      var _ref2 = widgetParams || {},\n        _ref2$url = _ref2.url,\n        url = _ref2$url === void 0 ? defaultUrl : _ref2$url;\n      return {\n        $$type: 'ais.poweredBy',\n        init: function init(initOptions) {\n          var instantSearchInstance = initOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var instantSearchInstance = renderOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), false);\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            poweredBy: this.getWidgetRenderState(renderOptions)\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState() {\n          return {\n            url: url,\n            widgetParams: widgetParams\n          };\n        },\n        dispose: function dispose() {\n          unmountFn();\n        }\n      };\n    };\n  };\n\n  var withUsage$p = createDocumentationMessageGenerator({\n    name: 'autocomplete',\n    connector: true\n  });\n  var connectAutocomplete = function connectAutocomplete(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$p());\n    return function (widgetParams) {\n      var _ref = widgetParams || {},\n        _ref$escapeHTML = _ref.escapeHTML,\n        escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML;\n       _warning(!widgetParams.indices, \"\\nThe option `indices` has been removed from the Autocomplete connector.\\n\\nThe indices to target are now inferred from the widgets tree.\\n\".concat(Array.isArray(widgetParams.indices) ? \"\\nAn alternative would be:\\n\\nconst autocomplete = connectAutocomplete(renderer);\\n\\nsearch.addWidgets([\\n  \".concat(widgetParams.indices.map(function (_ref2) {\n        var value = _ref2.value;\n        return \"index({ indexName: '\".concat(value, \"' }),\");\n      }).join('\\n  '), \"\\n  autocomplete()\\n]);\\n\") : '', \"\\n      \")) ;\n      var connectorState = {};\n      return {\n        $$type: 'ais.autocomplete',\n        init: function init(initOptions) {\n          var instantSearchInstance = initOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var instantSearchInstance = renderOptions.instantSearchInstance;\n          var renderState = this.getWidgetRenderState(renderOptions);\n          renderState.indices.forEach(function (_ref3) {\n            var sendEvent = _ref3.sendEvent,\n              hits = _ref3.hits;\n            sendEvent('view:internal', hits);\n          });\n          renderFn(_objectSpread2(_objectSpread2({}, renderState), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), false);\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            autocomplete: this.getWidgetRenderState(renderOptions)\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref4) {\n          var _this = this;\n          var helper = _ref4.helper,\n            state = _ref4.state,\n            scopedResults = _ref4.scopedResults,\n            instantSearchInstance = _ref4.instantSearchInstance;\n          if (!connectorState.refine) {\n            connectorState.refine = function (query) {\n              helper.setQuery(query).search();\n            };\n          }\n          var indices = scopedResults.map(function (scopedResult) {\n            var _scopedResult$results, _scopedResult$results2;\n            // We need to escape the hits because highlighting\n            // exposes HTML tags to the end-user.\n            if (scopedResult.results) {\n              scopedResult.results.hits = escapeHTML ? escapeHits(scopedResult.results.hits) : scopedResult.results.hits;\n            }\n            var sendEvent = createSendEventForHits({\n              instantSearchInstance: instantSearchInstance,\n              helper: scopedResult.helper,\n              widgetType: _this.$$type\n            });\n            return {\n              indexId: scopedResult.indexId,\n              indexName: ((_scopedResult$results = scopedResult.results) === null || _scopedResult$results === void 0 ? void 0 : _scopedResult$results.index) || '',\n              hits: ((_scopedResult$results2 = scopedResult.results) === null || _scopedResult$results2 === void 0 ? void 0 : _scopedResult$results2.hits) || [],\n              results: scopedResult.results || {},\n              sendEvent: sendEvent\n            };\n          });\n          return {\n            currentRefinement: state.query || '',\n            indices: indices,\n            refine: connectorState.refine,\n            widgetParams: widgetParams\n          };\n        },\n        getWidgetUiState: function getWidgetUiState(uiState, _ref5) {\n          var searchParameters = _ref5.searchParameters;\n          var query = searchParameters.query || '';\n          if (query === '' || uiState && uiState.query === query) {\n            return uiState;\n          }\n          return _objectSpread2(_objectSpread2({}, uiState), {}, {\n            query: query\n          });\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref6) {\n          var uiState = _ref6.uiState;\n          var parameters = {\n            query: uiState.query || ''\n          };\n          if (!escapeHTML) {\n            return searchParameters.setQueryParameters(parameters);\n          }\n          return searchParameters.setQueryParameters(_objectSpread2(_objectSpread2({}, parameters), TAG_PLACEHOLDER));\n        },\n        dispose: function dispose(_ref7) {\n          var state = _ref7.state;\n          unmountFn();\n          var stateWithoutQuery = state.setQueryParameter('query', undefined);\n          if (!escapeHTML) {\n            return stateWithoutQuery;\n          }\n          return stateWithoutQuery.setQueryParameters(Object.keys(TAG_PLACEHOLDER).reduce(function (acc, key) {\n            return _objectSpread2(_objectSpread2({}, acc), {}, _defineProperty({}, key, undefined));\n          }, {}));\n        }\n      };\n    };\n  };\n\n  var withUsage$q = createDocumentationMessageGenerator({\n    name: 'query-rules',\n    connector: true\n  });\n  function hasStateRefinements(state) {\n    return [state.disjunctiveFacetsRefinements, state.facetsRefinements, state.hierarchicalFacetsRefinements, state.numericRefinements].some(function (refinement) {\n      return Boolean(refinement && Object.keys(refinement).length > 0);\n    });\n  }\n\n  // A context rule must consist only of alphanumeric characters, hyphens, and underscores.\n  // See https://www.algolia.com/doc/guides/managing-results/refine-results/merchandising-and-promoting/in-depth/implementing-query-rules/#context\n  function escapeRuleContext(ruleName) {\n    return ruleName.replace(/[^a-z0-9-_]+/gi, '_');\n  }\n  function getRuleContextsFromTrackedFilters(_ref) {\n    var helper = _ref.helper,\n      sharedHelperState = _ref.sharedHelperState,\n      trackedFilters = _ref.trackedFilters;\n    var ruleContexts = Object.keys(trackedFilters).reduce(function (facets, facetName) {\n      var facetRefinements = getRefinements(helper.lastResults || {}, sharedHelperState, true).filter(function (refinement) {\n        return refinement.attribute === facetName;\n      }).map(function (refinement) {\n        return refinement.numericValue || refinement.name;\n      });\n      var getTrackedFacetValues = trackedFilters[facetName];\n      var trackedFacetValues = getTrackedFacetValues(facetRefinements);\n      return [].concat(_toConsumableArray(facets), _toConsumableArray(facetRefinements.filter(function (facetRefinement) {\n        return trackedFacetValues.includes(facetRefinement);\n      }).map(function (facetValue) {\n        return escapeRuleContext(\"ais-\".concat(facetName, \"-\").concat(facetValue));\n      })));\n    }, []);\n    return ruleContexts;\n  }\n  function applyRuleContexts(event) {\n    var helper = this.helper,\n      initialRuleContexts = this.initialRuleContexts,\n      trackedFilters = this.trackedFilters,\n      transformRuleContexts = this.transformRuleContexts;\n    var sharedHelperState = event.state;\n    var previousRuleContexts = sharedHelperState.ruleContexts || [];\n    var newRuleContexts = getRuleContextsFromTrackedFilters({\n      helper: helper,\n      sharedHelperState: sharedHelperState,\n      trackedFilters: trackedFilters\n    });\n    var nextRuleContexts = [].concat(_toConsumableArray(initialRuleContexts), _toConsumableArray(newRuleContexts));\n     _warning(nextRuleContexts.length <= 10, \"\\nThe maximum number of `ruleContexts` is 10. They have been sliced to that limit.\\nConsider using `transformRuleContexts` to minimize the number of rules sent to Algolia.\\n\") ;\n    var ruleContexts = transformRuleContexts(nextRuleContexts).slice(0, 10);\n    if (!isEqual(previousRuleContexts, ruleContexts)) {\n      helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread2(_objectSpread2({}, sharedHelperState), {}, {\n        ruleContexts: ruleContexts\n      }));\n    }\n  }\n  var connectQueryRules = function connectQueryRules(_render) {\n    var unmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(_render, withUsage$q());\n    return function (widgetParams) {\n      var _ref2 = widgetParams || {},\n        _ref2$trackedFilters = _ref2.trackedFilters,\n        trackedFilters = _ref2$trackedFilters === void 0 ? {} : _ref2$trackedFilters,\n        _ref2$transformRuleCo = _ref2.transformRuleContexts,\n        transformRuleContexts = _ref2$transformRuleCo === void 0 ? function (rules) {\n          return rules;\n        } : _ref2$transformRuleCo,\n        _ref2$transformItems = _ref2.transformItems,\n        transformItems = _ref2$transformItems === void 0 ? function (items) {\n          return items;\n        } : _ref2$transformItems;\n      Object.keys(trackedFilters).forEach(function (facetName) {\n        if (typeof trackedFilters[facetName] !== 'function') {\n          throw new Error(withUsage$q(\"'The \\\"\".concat(facetName, \"\\\" filter value in the `trackedFilters` option expects a function.\")));\n        }\n      });\n      var hasTrackedFilters = Object.keys(trackedFilters).length > 0;\n\n      // We store the initial rule contexts applied before creating the widget\n      // so that we do not override them with the rules created from `trackedFilters`.\n      var initialRuleContexts = [];\n      var onHelperChange;\n      return {\n        $$type: 'ais.queryRules',\n        init: function init(initOptions) {\n          var helper = initOptions.helper,\n            state = initOptions.state,\n            instantSearchInstance = initOptions.instantSearchInstance;\n          initialRuleContexts = state.ruleContexts || [];\n          onHelperChange = applyRuleContexts.bind({\n            helper: helper,\n            initialRuleContexts: initialRuleContexts,\n            trackedFilters: trackedFilters,\n            transformRuleContexts: transformRuleContexts\n          });\n          if (hasTrackedFilters) {\n            // We need to apply the `ruleContexts` based on the `trackedFilters`\n            // before the helper changes state in some cases:\n            //   - Some filters are applied on the first load (e.g. using `configure`)\n            //   - The `transformRuleContexts` option sets initial `ruleContexts`.\n            if (hasStateRefinements(state) || Boolean(widgetParams.transformRuleContexts)) {\n              onHelperChange({\n                state: state\n              });\n            }\n\n            // We track every change in the helper to override its state and add\n            // any `ruleContexts` needed based on the `trackedFilters`.\n            helper.on('change', onHelperChange);\n          }\n          _render(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var instantSearchInstance = renderOptions.instantSearchInstance;\n          _render(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), false);\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref3) {\n          var results = _ref3.results;\n          var _ref4 = results || {},\n            _ref4$userData = _ref4.userData,\n            userData = _ref4$userData === void 0 ? [] : _ref4$userData;\n          var items = transformItems(userData, {\n            results: results\n          });\n          return {\n            items: items,\n            widgetParams: widgetParams\n          };\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            queryRules: this.getWidgetRenderState(renderOptions)\n          });\n        },\n        dispose: function dispose(_ref5) {\n          var helper = _ref5.helper,\n            state = _ref5.state;\n          unmount();\n          if (hasTrackedFilters) {\n            helper.removeListener('change', onHelperChange);\n            return state.setQueryParameter('ruleContexts', initialRuleContexts);\n          }\n          return state;\n        }\n      };\n    };\n  };\n\n  // `SpeechRecognition` is an API used on the browser so we can safely disable\n  // the `window` check.\n  /* eslint-disable no-restricted-globals */\n  /* global SpeechRecognition SpeechRecognitionEvent */\n\n  var createVoiceSearchHelper = function createVoiceSearchHelper(_ref) {\n    var searchAsYouSpeak = _ref.searchAsYouSpeak,\n      language = _ref.language,\n      onQueryChange = _ref.onQueryChange,\n      onStateChange = _ref.onStateChange;\n    var SpeechRecognitionAPI = window.webkitSpeechRecognition || window.SpeechRecognition;\n    var getDefaultState = function getDefaultState(status) {\n      return {\n        status: status,\n        transcript: '',\n        isSpeechFinal: false,\n        errorCode: undefined\n      };\n    };\n    var state = getDefaultState('initial');\n    var recognition;\n    var isBrowserSupported = function isBrowserSupported() {\n      return Boolean(SpeechRecognitionAPI);\n    };\n    var isListening = function isListening() {\n      return state.status === 'askingPermission' || state.status === 'waiting' || state.status === 'recognizing';\n    };\n    var setState = function setState() {\n      var newState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n      state = _objectSpread2(_objectSpread2({}, state), newState);\n      onStateChange();\n    };\n    var getState = function getState() {\n      return state;\n    };\n    var resetState = function resetState() {\n      var status = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'initial';\n      setState(getDefaultState(status));\n    };\n    var onStart = function onStart() {\n      setState({\n        status: 'waiting'\n      });\n    };\n    var onError = function onError(event) {\n      setState({\n        status: 'error',\n        errorCode: event.error\n      });\n    };\n    var onResult = function onResult(event) {\n      setState({\n        status: 'recognizing',\n        transcript: event.results[0] && event.results[0][0] && event.results[0][0].transcript || '',\n        isSpeechFinal: event.results[0] && event.results[0].isFinal\n      });\n      if (searchAsYouSpeak && state.transcript) {\n        onQueryChange(state.transcript);\n      }\n    };\n    var onEnd = function onEnd() {\n      if (!state.errorCode && state.transcript && !searchAsYouSpeak) {\n        onQueryChange(state.transcript);\n      }\n      if (state.status !== 'error') {\n        setState({\n          status: 'finished'\n        });\n      }\n    };\n    var startListening = function startListening() {\n      recognition = new SpeechRecognitionAPI();\n      if (!recognition) {\n        return;\n      }\n      resetState('askingPermission');\n      recognition.interimResults = true;\n      if (language) {\n        recognition.lang = language;\n      }\n      recognition.addEventListener('start', onStart);\n      recognition.addEventListener('error', onError);\n      recognition.addEventListener('result', onResult);\n      recognition.addEventListener('end', onEnd);\n      recognition.start();\n    };\n    var dispose = function dispose() {\n      if (!recognition) {\n        return;\n      }\n      recognition.stop();\n      recognition.removeEventListener('start', onStart);\n      recognition.removeEventListener('error', onError);\n      recognition.removeEventListener('result', onResult);\n      recognition.removeEventListener('end', onEnd);\n      recognition = undefined;\n    };\n    var stopListening = function stopListening() {\n      dispose();\n      // Because `dispose` removes event listeners, `end` listener is not called.\n      // So we're setting the `status` as `finished` here.\n      // If we don't do it, it will be still `waiting` or `recognizing`.\n      resetState('finished');\n    };\n    return {\n      getState: getState,\n      isBrowserSupported: isBrowserSupported,\n      isListening: isListening,\n      startListening: startListening,\n      stopListening: stopListening,\n      dispose: dispose\n    };\n  };\n\n  var withUsage$r = createDocumentationMessageGenerator({\n    name: 'voice-search',\n    connector: true\n  });\n  var connectVoiceSearch = function connectVoiceSearch(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$r());\n    return function (widgetParams) {\n      var _widgetParams$searchA = widgetParams.searchAsYouSpeak,\n        searchAsYouSpeak = _widgetParams$searchA === void 0 ? false : _widgetParams$searchA,\n        language = widgetParams.language,\n        additionalQueryParameters = widgetParams.additionalQueryParameters,\n        _widgetParams$createV = widgetParams.createVoiceSearchHelper,\n        createVoiceSearchHelper$1 = _widgetParams$createV === void 0 ? createVoiceSearchHelper : _widgetParams$createV;\n      return {\n        $$type: 'ais.voiceSearch',\n        init: function init(initOptions) {\n          var instantSearchInstance = initOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var instantSearchInstance = renderOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), false);\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            voiceSearch: this.getWidgetRenderState(renderOptions)\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(renderOptions) {\n          var _this = this;\n          var helper = renderOptions.helper,\n            instantSearchInstance = renderOptions.instantSearchInstance;\n          if (!this._refine) {\n            this._refine = function (query) {\n              if (query !== helper.state.query) {\n                var queryLanguages = language ? [language.split('-')[0]] : undefined;\n                // @ts-ignore queryLanguages is allowed to be a string, not just an array\n                helper.setQueryParameter('queryLanguages', queryLanguages);\n                if (typeof additionalQueryParameters === 'function') {\n                  helper.setState(helper.state.setQueryParameters(_objectSpread2({\n                    ignorePlurals: true,\n                    removeStopWords: true,\n                    // @ts-ignore optionalWords is allowed to be a string too\n                    optionalWords: query\n                  }, additionalQueryParameters({\n                    query: query\n                  }))));\n                }\n                helper.setQuery(query).search();\n              }\n            };\n          }\n          if (!this._voiceSearchHelper) {\n            this._voiceSearchHelper = createVoiceSearchHelper$1({\n              searchAsYouSpeak: searchAsYouSpeak,\n              language: language,\n              onQueryChange: function onQueryChange(query) {\n                return _this._refine(query);\n              },\n              onStateChange: function onStateChange() {\n                renderFn(_objectSpread2(_objectSpread2({}, _this.getWidgetRenderState(renderOptions)), {}, {\n                  instantSearchInstance: instantSearchInstance\n                }), false);\n              }\n            });\n          }\n          var _voiceSearchHelper = this._voiceSearchHelper,\n            isBrowserSupported = _voiceSearchHelper.isBrowserSupported,\n            isListening = _voiceSearchHelper.isListening,\n            startListening = _voiceSearchHelper.startListening,\n            stopListening = _voiceSearchHelper.stopListening,\n            getState = _voiceSearchHelper.getState;\n          return {\n            isBrowserSupported: isBrowserSupported(),\n            isListening: isListening(),\n            toggleListening: function toggleListening() {\n              if (!isBrowserSupported()) {\n                return;\n              }\n              if (isListening()) {\n                stopListening();\n              } else {\n                startListening();\n              }\n            },\n            voiceListeningState: getState(),\n            widgetParams: widgetParams\n          };\n        },\n        dispose: function dispose(_ref) {\n          var state = _ref.state;\n          this._voiceSearchHelper.dispose();\n          unmountFn();\n          var newState = state;\n          if (typeof additionalQueryParameters === 'function') {\n            var additional = additionalQueryParameters({\n              query: ''\n            });\n            var toReset = additional ? Object.keys(additional).reduce(function (acc, current) {\n              // @ts-ignore search parameters is typed as readonly in v4\n              acc[current] = undefined;\n              return acc;\n            }, {}) : {};\n            newState = state.setQueryParameters(_objectSpread2({\n              // @ts-ignore (queryLanguages is not added to algoliasearch v3)\n              queryLanguages: undefined,\n              ignorePlurals: undefined,\n              removeStopWords: undefined,\n              optionalWords: undefined\n            }, toReset));\n          }\n          return newState.setQueryParameter('query', undefined);\n        },\n        getWidgetUiState: function getWidgetUiState(uiState, _ref2) {\n          var searchParameters = _ref2.searchParameters;\n          var query = searchParameters.query || '';\n          if (!query) {\n            return uiState;\n          }\n          return _objectSpread2(_objectSpread2({}, uiState), {}, {\n            query: query\n          });\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref3) {\n          var uiState = _ref3.uiState;\n          return searchParameters.setQueryParameter('query', uiState.query || '');\n        }\n      };\n    };\n  };\n\n  var connectRelevantSort = function connectRelevantSort() {\n    var renderFn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : noop;\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    return function (widgetParams) {\n      var connectorState = {};\n      return {\n        $$type: 'ais.relevantSort',\n        init: function init(initOptions) {\n          var instantSearchInstance = initOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var instantSearchInstance = renderOptions.instantSearchInstance;\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: instantSearchInstance\n          }), false);\n        },\n        dispose: function dispose(_ref) {\n          var state = _ref.state;\n          unmountFn();\n          return state.setQueryParameter('relevancyStrictness', undefined);\n        },\n        getRenderState: function getRenderState(renderState, renderOptions) {\n          return _objectSpread2(_objectSpread2({}, renderState), {}, {\n            relevantSort: this.getWidgetRenderState(renderOptions)\n          });\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref2) {\n          var results = _ref2.results,\n            helper = _ref2.helper;\n          if (!connectorState.refine) {\n            connectorState.refine = function (relevancyStrictness) {\n              helper.setQueryParameter('relevancyStrictness', relevancyStrictness).search();\n            };\n          }\n          var _ref3 = results || {},\n            appliedRelevancyStrictness = _ref3.appliedRelevancyStrictness;\n          var isVirtualReplica = appliedRelevancyStrictness !== undefined;\n          return {\n            isRelevantSorted: typeof appliedRelevancyStrictness !== 'undefined' && appliedRelevancyStrictness > 0,\n            isVirtualReplica: isVirtualReplica,\n            canRefine: isVirtualReplica,\n            refine: connectorState.refine,\n            widgetParams: widgetParams\n          };\n        },\n        getWidgetSearchParameters: function getWidgetSearchParameters(state, _ref4) {\n          var _uiState$relevantSort;\n          var uiState = _ref4.uiState;\n          return state.setQueryParameter('relevancyStrictness', (_uiState$relevantSort = uiState.relevantSort) !== null && _uiState$relevantSort !== void 0 ? _uiState$relevantSort : state.relevancyStrictness);\n        },\n        getWidgetUiState: function getWidgetUiState(uiState, _ref5) {\n          var searchParameters = _ref5.searchParameters;\n          return _objectSpread2(_objectSpread2({}, uiState), {}, {\n            relevantSort: searchParameters.relevancyStrictness || uiState.relevantSort\n          });\n        }\n      };\n    };\n  };\n\n  var withUsage$s = createDocumentationMessageGenerator({\n    name: 'frequently-bought-together',\n    connector: true\n  });\n  var connectFrequentlyBoughtTogether = (function connectFrequentlyBoughtTogether(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$s());\n    return function (widgetParams) {\n      var _ref = widgetParams || {},\n        _ref$escapeHTML = _ref.escapeHTML,\n        escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,\n        _ref$transformItems = _ref.transformItems,\n        transformItems = _ref$transformItems === void 0 ? function (items) {\n          return items;\n        } : _ref$transformItems,\n        objectIDs = _ref.objectIDs,\n        limit = _ref.limit,\n        threshold = _ref.threshold,\n        queryParameters = _ref.queryParameters;\n      if (!objectIDs || objectIDs.length === 0) {\n        throw new Error(withUsage$s('The `objectIDs` option is required.'));\n      }\n      var sendEvent;\n      return {\n        dependsOn: 'recommend',\n        $$type: 'ais.frequentlyBoughtTogether',\n        init: function init(initOptions) {\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: initOptions.instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var renderState = this.getWidgetRenderState(renderOptions);\n          renderFn(_objectSpread2(_objectSpread2({}, renderState), {}, {\n            instantSearchInstance: renderOptions.instantSearchInstance\n          }), false);\n        },\n        getRenderState: function getRenderState(renderState) {\n          return renderState;\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref2) {\n          var results = _ref2.results,\n            helper = _ref2.helper,\n            instantSearchInstance = _ref2.instantSearchInstance;\n          if (!sendEvent) {\n            sendEvent = createSendEventForHits({\n              instantSearchInstance: instantSearchInstance,\n              helper: helper,\n              widgetType: this.$$type\n            });\n          }\n          if (results === null || results === undefined) {\n            return {\n              items: [],\n              widgetParams: widgetParams,\n              sendEvent: sendEvent\n            };\n          }\n          if (escapeHTML && results.hits.length > 0) {\n            results.hits = escapeHits(results.hits);\n          }\n          var itemsWithAbsolutePosition = addAbsolutePosition(results.hits, 0, 1);\n          var itemsWithAbsolutePositionAndQueryID = addQueryID(itemsWithAbsolutePosition, results.queryID);\n          var transformedItems = transformItems(itemsWithAbsolutePositionAndQueryID, {\n            results: results\n          });\n          return {\n            items: transformedItems,\n            widgetParams: widgetParams,\n            sendEvent: sendEvent\n          };\n        },\n        dispose: function dispose(_ref3) {\n          var recommendState = _ref3.recommendState;\n          unmountFn();\n          return recommendState.removeParams(this.$$id);\n        },\n        getWidgetParameters: function getWidgetParameters(state) {\n          var _this = this;\n          return objectIDs.reduce(function (acc, objectID) {\n            return acc.addFrequentlyBoughtTogether({\n              objectID: objectID,\n              threshold: threshold,\n              maxRecommendations: limit,\n              queryParameters: _objectSpread2(_objectSpread2({}, queryParameters), escapeHTML ? TAG_PLACEHOLDER : {}),\n              $$id: _this.$$id\n            });\n          }, state.removeParams(this.$$id));\n        }\n      };\n    };\n  });\n\n  var withUsage$t = createDocumentationMessageGenerator({\n    name: 'looking-similar',\n    connector: true\n  });\n  var connectLookingSimilar = (function connectLookingSimilar(renderFn) {\n    var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n    checkRendering(renderFn, withUsage$t());\n    return function (widgetParams) {\n      var _ref = widgetParams || {},\n        _ref$escapeHTML = _ref.escapeHTML,\n        escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,\n        objectIDs = _ref.objectIDs,\n        limit = _ref.limit,\n        threshold = _ref.threshold,\n        fallbackParameters = _ref.fallbackParameters,\n        queryParameters = _ref.queryParameters,\n        _ref$transformItems = _ref.transformItems,\n        transformItems = _ref$transformItems === void 0 ? function (items) {\n          return items;\n        } : _ref$transformItems;\n      if (!objectIDs || objectIDs.length === 0) {\n        throw new Error(withUsage$t('The `objectIDs` option is required.'));\n      }\n      var sendEvent;\n      return {\n        dependsOn: 'recommend',\n        $$type: 'ais.lookingSimilar',\n        init: function init(initOptions) {\n          renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {\n            instantSearchInstance: initOptions.instantSearchInstance\n          }), true);\n        },\n        render: function render(renderOptions) {\n          var renderState = this.getWidgetRenderState(renderOptions);\n          renderFn(_objectSpread2(_objectSpread2({}, renderState), {}, {\n            instantSearchInstance: renderOptions.instantSearchInstance\n          }), false);\n        },\n        getRenderState: function getRenderState(renderState) {\n          return renderState;\n        },\n        getWidgetRenderState: function getWidgetRenderState(_ref2) {\n          var results = _ref2.results,\n            helper = _ref2.helper,\n            instantSearchInstance = _ref2.instantSearchInstance;\n          if (!sendEvent) {\n            sendEvent = createSendEventForHits({\n              instantSearchInstance: instantSearchInstance,\n              helper: helper,\n              widgetType: this.$$type\n            });\n          }\n          if (results === null || results === undefined) {\n            return {\n              items: [],\n              widgetParams: widgetParams,\n              sendEvent: sendEvent\n            };\n          }\n          if (escapeHTML && results.hits.length > 0) {\n            results.hits = escapeHits(results.hits);\n          }\n          var itemsWithAbsolutePosition = addAbsolutePosition(results.hits, 0, 1);\n          var itemsWithAbsolutePositionAndQueryID = addQueryID(itemsWithAbsolutePosition, results.queryID);\n          var transformedItems = transformItems(itemsWithAbsolutePositionAndQueryID, {\n            results: results\n          });\n          return {\n            items: transformedItems,\n            widgetParams: widgetParams,\n            sendEvent: sendEvent\n          };\n        },\n        dispose: function dispose(_ref3) {\n          var recommendState = _ref3.recommendState;\n          unmountFn();\n          return recommendState.removeParams(this.$$id);\n        },\n        getWidgetParameters: function getWidgetParameters(state) {\n          var _this = this;\n          return objectIDs.reduce(function (acc, objectID) {\n            return acc.addLookingSimilar({\n              objectID: objectID,\n              maxRecommendations: limit,\n              threshold: threshold,\n              fallbackParameters: _objectSpread2(_objectSpread2({}, fallbackParameters), escapeHTML ? TAG_PLACEHOLDER : {}),\n              queryParameters: _objectSpread2(_objectSpread2({}, queryParameters), escapeHTML ? TAG_PLACEHOLDER : {}),\n              $$id: _this.$$id\n            });\n          }, state.removeParams(this.$$id));\n        }\n      };\n    };\n  });\n\n  /** @deprecated answers is no longer supported */\n  var EXPERIMENTAL_connectAnswers = deprecate(connectAnswers, 'answers is no longer supported');\n\n  /** @deprecated use connectRelatedItems instead */\n  var EXPERIMENTAL_connectConfigureRelatedItems = deprecate(connectConfigureRelatedItems, 'EXPERIMENTAL_connectConfigureRelatedItems is deprecated and will be removed in a next minor version of InstantSearch. Please use connectRelatedItems instead.');\n\n  /** @deprecated use connectDynamicWidgets */\n  var EXPERIMENTAL_connectDynamicWidgets = deprecate(connectDynamicWidgets, 'use connectDynamicWidgets');\n\n  var connectors = /*#__PURE__*/Object.freeze({\n    __proto__: null,\n    EXPERIMENTAL_connectAnswers: EXPERIMENTAL_connectAnswers,\n    EXPERIMENTAL_connectConfigureRelatedItems: EXPERIMENTAL_connectConfigureRelatedItems,\n    EXPERIMENTAL_connectDynamicWidgets: EXPERIMENTAL_connectDynamicWidgets,\n    connectDynamicWidgets: connectDynamicWidgets,\n    connectClearRefinements: connectClearRefinements,\n    connectCurrentRefinements: connectCurrentRefinements,\n    connectHierarchicalMenu: connectHierarchicalMenu,\n    connectHits: connectHits,\n    connectHitsWithInsights: connectHitsWithInsights,\n    connectHitsPerPage: connectHitsPerPage,\n    connectInfiniteHits: connectInfiniteHits,\n    connectInfiniteHitsWithInsights: connectInfiniteHitsWithInsights,\n    connectMenu: connectMenu,\n    connectNumericMenu: connectNumericMenu,\n    connectPagination: connectPagination,\n    connectRange: connectRange,\n    connectRefinementList: connectRefinementList,\n    connectRelatedProducts: connectRelatedProducts,\n    connectSearchBox: connectSearchBox,\n    connectSortBy: connectSortBy,\n    connectRatingMenu: connectRatingMenu,\n    connectStats: connectStats,\n    connectToggleRefinement: connectToggleRefinement,\n    connectTrendingItems: connectTrendingItems,\n    connectBreadcrumb: connectBreadcrumb,\n    connectGeoSearch: connectGeoSearch,\n    connectPoweredBy: connectPoweredBy,\n    connectConfigure: connectConfigure,\n    connectAutocomplete: connectAutocomplete,\n    connectQueryRules: connectQueryRules,\n    connectVoiceSearch: connectVoiceSearch,\n    connectRelevantSort: connectRelevantSort,\n    connectFrequentlyBoughtTogether: connectFrequentlyBoughtTogether,\n    connectLookingSimilar: connectLookingSimilar\n  });\n\n  var NAMESPACE = 'ais';\n  var component = function component(componentName) {\n    return function () {\n      var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n        descendantName = _ref.descendantName,\n        modifierName = _ref.modifierName;\n      var descendent = descendantName ? \"-\".concat(descendantName) : '';\n      var modifier = modifierName ? \"--\".concat(modifierName) : '';\n      return \"\".concat(NAMESPACE, \"-\").concat(componentName).concat(descendent).concat(modifier);\n    };\n  };\n\n  var suit = component('Highlight');\n\n  /**\n   * @deprecated use html tagged templates and the Highlight component instead\n   */\n  function highlight(_ref) {\n    var attribute = _ref.attribute,\n      _ref$highlightedTagNa = _ref.highlightedTagName,\n      highlightedTagName = _ref$highlightedTagNa === void 0 ? 'mark' : _ref$highlightedTagNa,\n      hit = _ref.hit,\n      _ref$cssClasses = _ref.cssClasses,\n      cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;\n     _warning(false, \"`instantsearch.highlight` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `Highlight` component.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/?client=html+tagged+templates#upgrade-templates\") ;\n    var highlightAttributeResult = getPropertyByPath(hit._highlightResult, attribute);\n\n    // @MAJOR fallback to attribute value if highlight is not found\n     _warning(highlightAttributeResult, \"Could not enable highlight for \\\"\".concat(attribute, \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\\n\\nSee: https://alg.li/highlighting\\n\")) ;\n    var _ref2 = highlightAttributeResult || {},\n      _ref2$value = _ref2.value,\n      attributeValue = _ref2$value === void 0 ? '' : _ref2$value;\n\n    // cx is not used, since it would be bundled as a dependency for Vue\n    var className = suit({\n      descendantName: 'highlighted'\n    }) + (cssClasses.highlighted ? \" \".concat(cssClasses.highlighted) : '');\n    return attributeValue.replace(new RegExp(TAG_REPLACEMENT.highlightPreTag, 'g'), \"<\".concat(highlightedTagName, \" class=\\\"\").concat(className, \"\\\">\")).replace(new RegExp(TAG_REPLACEMENT.highlightPostTag, 'g'), \"</\".concat(highlightedTagName, \">\"));\n  }\n\n  var suit$1 = component('ReverseHighlight');\n\n  /**\n   * @deprecated use html tagged templates and the ReverseHighlight component instead\n   */\n  function reverseHighlight(_ref) {\n    var attribute = _ref.attribute,\n      _ref$highlightedTagNa = _ref.highlightedTagName,\n      highlightedTagName = _ref$highlightedTagNa === void 0 ? 'mark' : _ref$highlightedTagNa,\n      hit = _ref.hit,\n      _ref$cssClasses = _ref.cssClasses,\n      cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;\n     _warning(false, \"`instantsearch.reverseHighlight` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `ReverseHighlight` component.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/?client=html+tagged+templates#upgrade-templates\") ;\n    var highlightAttributeResult = getPropertyByPath(hit._highlightResult, attribute);\n\n    // @MAJOR fallback to attribute value if highlight is not found\n     _warning(highlightAttributeResult, \"Could not enable reverse highlight for \\\"\".concat(attribute, \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\\n\\nSee: https://alg.li/highlighting\\n\")) ;\n    var _ref2 = highlightAttributeResult || {},\n      _ref2$value = _ref2.value,\n      attributeValue = _ref2$value === void 0 ? '' : _ref2$value;\n\n    // cx is not used, since it would be bundled as a dependency for Vue\n    var className = suit$1({\n      descendantName: 'highlighted'\n    }) + (cssClasses.highlighted ? \" \".concat(cssClasses.highlighted) : '');\n    var reverseHighlightedValue = concatHighlightedParts(reverseHighlightedParts(getHighlightedParts(attributeValue)));\n    return reverseHighlightedValue.replace(new RegExp(TAG_REPLACEMENT.highlightPreTag, 'g'), \"<\".concat(highlightedTagName, \" class=\\\"\").concat(className, \"\\\">\")).replace(new RegExp(TAG_REPLACEMENT.highlightPostTag, 'g'), \"</\".concat(highlightedTagName, \">\"));\n  }\n\n  var suit$2 = component('Snippet');\n\n  /**\n   * @deprecated use html tagged templates and the Snippet component instead\n   */\n  function snippet(_ref) {\n    var attribute = _ref.attribute,\n      _ref$highlightedTagNa = _ref.highlightedTagName,\n      highlightedTagName = _ref$highlightedTagNa === void 0 ? 'mark' : _ref$highlightedTagNa,\n      hit = _ref.hit,\n      _ref$cssClasses = _ref.cssClasses,\n      cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;\n     _warning(false, \"`instantsearch.snippet` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `Snippet` component.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/?client=html+tagged+templates#upgrade-templates\") ;\n    var snippetAttributeResult = getPropertyByPath(hit._snippetResult, attribute);\n\n    // @MAJOR fallback to attribute value if snippet is not found\n     _warning(snippetAttributeResult, \"Could not enable snippet for \\\"\".concat(attribute, \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\\n\\nSee: https://alg.li/highlighting\\n\")) ;\n    var _ref2 = snippetAttributeResult || {},\n      _ref2$value = _ref2.value,\n      attributeValue = _ref2$value === void 0 ? '' : _ref2$value;\n\n    // cx is not used, since it would be bundled as a dependency for Vue\n    var className = suit$2({\n      descendantName: 'highlighted'\n    }) + (cssClasses.highlighted ? \" \".concat(cssClasses.highlighted) : '');\n    return attributeValue.replace(new RegExp(TAG_REPLACEMENT.highlightPreTag, 'g'), \"<\".concat(highlightedTagName, \" class=\\\"\").concat(className, \"\\\">\")).replace(new RegExp(TAG_REPLACEMENT.highlightPostTag, 'g'), \"</\".concat(highlightedTagName, \">\"));\n  }\n\n  var suit$3 = component('ReverseSnippet');\n\n  /**\n   * @deprecated use html tagged templates and the ReverseSnippet component instead\n   */\n  function reverseSnippet(_ref) {\n    var attribute = _ref.attribute,\n      _ref$highlightedTagNa = _ref.highlightedTagName,\n      highlightedTagName = _ref$highlightedTagNa === void 0 ? 'mark' : _ref$highlightedTagNa,\n      hit = _ref.hit,\n      _ref$cssClasses = _ref.cssClasses,\n      cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;\n     _warning(false, \"`instantsearch.reverseSnippet` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `ReverseSnippet` component.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/?client=html+tagged+templates#upgrade-templates\") ;\n    var snippetAttributeResult = getPropertyByPath(hit._snippetResult, attribute);\n\n    // @MAJOR fallback to attribute value if snippet is not found\n     _warning(snippetAttributeResult, \"Could not enable reverse snippet for \\\"\".concat(attribute, \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\\n\\nSee: https://alg.li/highlighting\\n\")) ;\n    var _ref2 = snippetAttributeResult || {},\n      _ref2$value = _ref2.value,\n      attributeValue = _ref2$value === void 0 ? '' : _ref2$value;\n\n    // cx is not used, since it would be bundled as a dependency for Vue\n    var className = suit$3({\n      descendantName: 'highlighted'\n    }) + (cssClasses.highlighted ? \" \".concat(cssClasses.highlighted) : '');\n    var reverseHighlightedValue = concatHighlightedParts(reverseHighlightedParts(getHighlightedParts(attributeValue)));\n    return reverseHighlightedValue.replace(new RegExp(TAG_REPLACEMENT.highlightPreTag, 'g'), \"<\".concat(highlightedTagName, \" class=\\\"\").concat(className, \"\\\">\")).replace(new RegExp(TAG_REPLACEMENT.highlightPostTag, 'g'), \"</\".concat(highlightedTagName, \">\"));\n  }\n\n  var ANONYMOUS_TOKEN_COOKIE_KEY = '_ALGOLIA';\n  function getCookie(name) {\n    if ((typeof document === \"undefined\" ? \"undefined\" : _typeof(document)) !== 'object' || typeof document.cookie !== 'string') {\n      return undefined;\n    }\n    var prefix = \"\".concat(name, \"=\");\n    var cookies = document.cookie.split(';');\n    for (var i = 0; i < cookies.length; i++) {\n      var cookie = cookies[i];\n      while (cookie.charAt(0) === ' ') {\n        cookie = cookie.substring(1);\n      }\n      if (cookie.indexOf(prefix) === 0) {\n        return cookie.substring(prefix.length, cookie.length);\n      }\n    }\n    return undefined;\n  }\n  function getInsightsAnonymousUserTokenInternal() {\n    return getCookie(ANONYMOUS_TOKEN_COOKIE_KEY);\n  }\n\n  var _excluded$5 = [\"page\"];\n  function getStateWithoutPage$1(state) {\n    var _ref = state || {},\n      page = _ref.page,\n      rest = _objectWithoutProperties(_ref, _excluded$5);\n    return rest;\n  }\n  function createInfiniteHitsSessionStorageCache() {\n    var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n      key = _ref2.key;\n    var KEY = ['ais.infiniteHits', key].filter(Boolean).join(':');\n    return {\n      read: function read(_ref3) {\n        var state = _ref3.state;\n        var sessionStorage = safelyRunOnBrowser(function (_ref4) {\n          var window = _ref4.window;\n          return window.sessionStorage;\n        });\n        if (!sessionStorage) {\n          return null;\n        }\n        try {\n          var cache = JSON.parse(\n          // @ts-expect-error JSON.parse() requires a string, but it actually accepts null, too.\n          sessionStorage.getItem(KEY));\n          return cache && isEqual(cache.state, getStateWithoutPage$1(state)) ? cache.hits : null;\n        } catch (error) {\n          if (error instanceof SyntaxError) {\n            try {\n              sessionStorage.removeItem(KEY);\n            } catch (err) {\n              // do nothing\n            }\n          }\n          return null;\n        }\n      },\n      write: function write(_ref5) {\n        var state = _ref5.state,\n          hits = _ref5.hits;\n        var sessionStorage = safelyRunOnBrowser(function (_ref6) {\n          var window = _ref6.window;\n          return window.sessionStorage;\n        });\n        if (!sessionStorage) {\n          return;\n        }\n        try {\n          sessionStorage.setItem(KEY, JSON.stringify({\n            state: getStateWithoutPage$1(state),\n            hits: hits\n          }));\n        } catch (error) {\n          // do nothing\n        }\n      }\n    };\n  }\n\n  /**\n   * Create UUID according to\n   * https://www.ietf.org/rfc/rfc4122.txt.\n   *\n   * @returns Generated UUID.\n   */\n  function createUUID() {\n    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n      /* eslint-disable no-bitwise */\n      var r = Math.random() * 16 | 0;\n      var v = c === 'x' ? r : r & 0x3 | 0x8;\n      /* eslint-enable */\n      return v.toString(16);\n    });\n  }\n\n  var ALGOLIA_INSIGHTS_VERSION = '2.17.2';\n  var ALGOLIA_INSIGHTS_SRC = \"https://cdn.jsdelivr.net/npm/search-insights@\".concat(ALGOLIA_INSIGHTS_VERSION, \"/dist/search-insights.min.js\");\n  function createInsightsMiddleware() {\n    var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    var _insightsClient = props.insightsClient,\n      insightsInitParams = props.insightsInitParams,\n      onEvent = props.onEvent,\n      _props$$$internal = props.$$internal,\n      $$internal = _props$$$internal === void 0 ? false : _props$$$internal,\n      _props$$$automatic = props.$$automatic,\n      $$automatic = _props$$$automatic === void 0 ? false : _props$$$automatic;\n    var potentialInsightsClient = _insightsClient;\n    if (!_insightsClient && _insightsClient !== null) {\n      safelyRunOnBrowser(function (_ref) {\n        var window = _ref.window;\n        var pointer = window.AlgoliaAnalyticsObject || 'aa';\n        if (typeof pointer === 'string') {\n          potentialInsightsClient = window[pointer];\n        }\n        if (!potentialInsightsClient) {\n          window.AlgoliaAnalyticsObject = pointer;\n          if (!window[pointer]) {\n            window[pointer] = function () {\n              if (!window[pointer].queue) {\n                window[pointer].queue = [];\n              }\n              for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n                args[_key] = arguments[_key];\n              }\n              window[pointer].queue.push(args);\n            };\n            window[pointer].version = ALGOLIA_INSIGHTS_VERSION;\n            window[pointer].shouldAddScript = true;\n          }\n          potentialInsightsClient = window[pointer];\n        }\n      });\n    }\n    // if still no insightsClient was found, we use a noop\n    var insightsClient = potentialInsightsClient || noop;\n    return function (_ref2) {\n      var instantSearchInstance = _ref2.instantSearchInstance;\n      // remove existing default insights middleware\n      // user-provided insights middleware takes precedence\n      var existingInsightsMiddlewares = instantSearchInstance.middleware.filter(function (m) {\n        return m.instance.$$type === 'ais.insights' && m.instance.$$internal;\n      }).map(function (m) {\n        return m.creator;\n      });\n      instantSearchInstance.unuse.apply(instantSearchInstance, _toConsumableArray(existingInsightsMiddlewares));\n      var _getAppIdAndApiKey = getAppIdAndApiKey(instantSearchInstance.client),\n        _getAppIdAndApiKey2 = _slicedToArray(_getAppIdAndApiKey, 2),\n        appId = _getAppIdAndApiKey2[0],\n        apiKey = _getAppIdAndApiKey2[1];\n\n      // search-insights.js also throws an error so dev-only clarification is sufficient\n       _warning(Boolean(appId && apiKey), 'could not extract Algolia credentials from searchClient in insights middleware.') ;\n      var queuedInitParams = undefined;\n      var queuedUserToken = undefined;\n      var userTokenBeforeInit = undefined;\n      var queue = insightsClient.queue;\n      if (Array.isArray(queue)) {\n        // Context: The umd build of search-insights is asynchronously loaded by the snippet.\n        //\n        // When user calls `aa('setUserToken', 'my-user-token')` before `search-insights` is loaded,\n        // ['setUserToken', 'my-user-token'] gets stored in `aa.queue`.\n        // Whenever `search-insights` is finally loaded, it will process the queue.\n        //\n        // But here's the reason why we handle it here:\n        // At this point, even though `search-insights` is not loaded yet,\n        // we still want to read the token from the queue.\n        // Otherwise, the first search call will be fired without the token.\n        var _map = ['setUserToken', 'init'].map(function (key) {\n          var _ref3 = find(queue.slice().reverse(), function (_ref5) {\n              var _ref6 = _slicedToArray(_ref5, 1),\n                method = _ref6[0];\n              return method === key;\n            }) || [],\n            _ref4 = _slicedToArray(_ref3, 2),\n            value = _ref4[1];\n          return value;\n        });\n        var _map2 = _slicedToArray(_map, 2);\n        queuedUserToken = _map2[0];\n        queuedInitParams = _map2[1];\n      }\n\n      // If user called `aa('setUserToken')` before creating the Insights middleware,\n      // we temporarily store the token and set it later on.\n      //\n      // Otherwise, the `init` call might override them with anonymous user token.\n      insightsClient('getUserToken', null, function (_error, userToken) {\n        userTokenBeforeInit = normalizeUserToken(userToken);\n      });\n\n      // Only `init` if the `insightsInitParams` option is passed or\n      // if the `insightsClient` version doesn't supports optional `init` calling.\n      if (insightsInitParams || !isModernInsightsClient(insightsClient)) {\n        insightsClient('init', _objectSpread2({\n          appId: appId,\n          apiKey: apiKey,\n          partial: true\n        }, insightsInitParams));\n      }\n      var initialParameters;\n      var helper;\n      return {\n        $$type: 'ais.insights',\n        $$internal: $$internal,\n        $$automatic: $$automatic,\n        onStateChange: function onStateChange() {},\n        subscribe: function subscribe() {\n          if (!insightsClient.shouldAddScript) return;\n          var errorMessage = '[insights middleware]: could not load search-insights.js. Please load it manually following https://alg.li/insights-init';\n          try {\n            var script = document.createElement('script');\n            script.async = true;\n            script.src = ALGOLIA_INSIGHTS_SRC;\n            script.onerror = function () {\n              instantSearchInstance.emit('error', new Error(errorMessage));\n            };\n            document.body.appendChild(script);\n            insightsClient.shouldAddScript = false;\n          } catch (cause) {\n            insightsClient.shouldAddScript = false;\n            instantSearchInstance.emit('error', new Error(errorMessage));\n          }\n        },\n        started: function started() {\n          insightsClient('addAlgoliaAgent', 'insights-middleware');\n          helper = instantSearchInstance.mainHelper;\n          var queueAtStart = insightsClient.queue;\n          if (Array.isArray(queueAtStart)) {\n            var _map3 = ['setUserToken', 'init'].map(function (key) {\n              var _ref7 = find(queueAtStart.slice().reverse(), function (_ref9) {\n                  var _ref10 = _slicedToArray(_ref9, 1),\n                    method = _ref10[0];\n                  return method === key;\n                }) || [],\n                _ref8 = _slicedToArray(_ref7, 2),\n                value = _ref8[1];\n              return value;\n            });\n            var _map4 = _slicedToArray(_map3, 2);\n            queuedUserToken = _map4[0];\n            queuedInitParams = _map4[1];\n          }\n          initialParameters = getInitialParameters(instantSearchInstance);\n\n          // We don't want to force clickAnalytics when the insights is enabled from the search response.\n          // This means we don't enable insights for indices that don't opt in\n          if (!$$automatic) {\n            helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread2(_objectSpread2({}, helper.state), {}, {\n              clickAnalytics: true\n            }));\n          }\n          if (!$$internal) {\n            instantSearchInstance.scheduleSearch();\n          }\n          var setUserTokenToSearch = function setUserTokenToSearch(userToken) {\n            var immediate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n            var normalizedUserToken = normalizeUserToken(userToken);\n            if (!normalizedUserToken) {\n              return;\n            }\n            var existingToken = helper.state.userToken;\n            function applyToken() {\n              helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread2(_objectSpread2({}, helper.state), {}, {\n                userToken: normalizedUserToken\n              }));\n              if (existingToken && existingToken !== userToken) {\n                instantSearchInstance.scheduleSearch();\n              }\n            }\n\n            // Delay the token application to the next render cycle\n            if (!immediate) {\n              setTimeout(applyToken, 0);\n            } else {\n              applyToken();\n            }\n          };\n          function setUserToken(token) {\n            setUserTokenToSearch(token, true);\n            insightsClient('setUserToken', token);\n          }\n          var anonymousUserToken = undefined;\n          var anonymousTokenFromInsights = getInsightsAnonymousUserTokenInternal();\n          if (anonymousTokenFromInsights) {\n            // When `aa('init', { ... })` is called, it creates an anonymous user token in cookie.\n            // We can set it as userToken on instantsearch and insights. If it's not set as an insights\n            // userToken before a sendEvent, insights automatically generates a new anonymous token,\n            // causing a state change and an unnecessary query on instantsearch.\n            anonymousUserToken = anonymousTokenFromInsights;\n          } else {\n            var token = \"anonymous-\".concat(createUUID());\n            anonymousUserToken = token;\n          }\n          var userTokenFromInit;\n\n          // With SSR, the token could be be set on the state. We make sure\n          // that insights is in sync with that token since, there is no\n          // insights lib on the server.\n          var tokenFromSearchParameters = initialParameters.userToken;\n\n          // When the first query is sent, the token is possibly not yet set by\n          // the insights onChange callbacks (if insights isn't yet loaded).\n          // It is explicitly being set here so that the first query has the\n          // initial tokens set and ensure a second query isn't automatically\n          // made when the onChange callback actually changes the state.\n          if (insightsInitParams !== null && insightsInitParams !== void 0 && insightsInitParams.userToken) {\n            userTokenFromInit = insightsInitParams.userToken;\n          }\n          if (userTokenFromInit) {\n            setUserToken(userTokenFromInit);\n          } else if (tokenFromSearchParameters) {\n            setUserToken(tokenFromSearchParameters);\n          } else if (userTokenBeforeInit) {\n            setUserToken(userTokenBeforeInit);\n          } else if (queuedUserToken) {\n            setUserToken(queuedUserToken);\n          } else if (anonymousUserToken) {\n            var _queuedInitParams;\n            setUserToken(anonymousUserToken);\n            if (insightsInitParams !== null && insightsInitParams !== void 0 && insightsInitParams.useCookie || (_queuedInitParams = queuedInitParams) !== null && _queuedInitParams !== void 0 && _queuedInitParams.useCookie) {\n              var _queuedInitParams2;\n              saveTokenAsCookie(anonymousUserToken, (insightsInitParams === null || insightsInitParams === void 0 ? void 0 : insightsInitParams.cookieDuration) || ((_queuedInitParams2 = queuedInitParams) === null || _queuedInitParams2 === void 0 ? void 0 : _queuedInitParams2.cookieDuration));\n            }\n          }\n\n          // This updates userToken which is set explicitly by `aa('setUserToken', userToken)`\n          insightsClient('onUserTokenChange', function (token) {\n            return setUserTokenToSearch(token, true);\n          }, {\n            immediate: true\n          });\n          var insightsClientWithLocalCredentials = insightsClient;\n          if (isModernInsightsClient(insightsClient)) {\n            insightsClientWithLocalCredentials = function insightsClientWithLocalCredentials(method, payload) {\n              var _getAppIdAndApiKey3 = getAppIdAndApiKey(instantSearchInstance.client),\n                _getAppIdAndApiKey4 = _slicedToArray(_getAppIdAndApiKey3, 2),\n                latestAppId = _getAppIdAndApiKey4[0],\n                latestApiKey = _getAppIdAndApiKey4[1];\n              var extraParams = {\n                headers: {\n                  'X-Algolia-Application-Id': latestAppId,\n                  'X-Algolia-API-Key': latestApiKey\n                }\n              };\n\n              // @ts-ignore we are calling this only when we know that the client actually is correct\n              return insightsClient(method, payload, extraParams);\n            };\n          }\n          var viewedObjectIDs = new Set();\n          var lastQueryId;\n          instantSearchInstance.mainHelper.derivedHelpers[0].on('result', function (_ref11) {\n            var results = _ref11.results;\n            if (results && (!results.queryID || results.queryID !== lastQueryId)) {\n              lastQueryId = results.queryID;\n              viewedObjectIDs.clear();\n            }\n          });\n          instantSearchInstance.sendEventToInsights = function (event) {\n            if (onEvent) {\n              onEvent(event, insightsClientWithLocalCredentials);\n            } else if (event.insightsMethod) {\n              if (event.insightsMethod === 'viewedObjectIDs') {\n                var _payload = event.payload;\n                var difference = _payload.objectIDs.filter(function (objectID) {\n                  return !viewedObjectIDs.has(objectID);\n                });\n                if (difference.length === 0) {\n                  return;\n                }\n                difference.forEach(function (objectID) {\n                  return viewedObjectIDs.add(objectID);\n                });\n                _payload.objectIDs = difference;\n              }\n\n              // Source is used to differentiate events sent by instantsearch from those sent manually.\n              event.payload.algoliaSource = ['instantsearch'];\n              if ($$automatic) {\n                event.payload.algoliaSource.push('instantsearch-automatic');\n              }\n              if (event.eventModifier === 'internal') {\n                event.payload.algoliaSource.push('instantsearch-internal');\n              }\n              insightsClientWithLocalCredentials(event.insightsMethod, event.payload);\n               _warning(Boolean(helper.state.userToken), \"\\nCannot send event to Algolia Insights because `userToken` is not set.\\n\\nSee documentation: https://www.algolia.com/doc/guides/building-search-ui/going-further/send-insights-events/js/#setting-the-usertoken\\n\") ;\n            } else {\n               _warning(false, 'Cannot send event to Algolia Insights because `insightsMethod` option is missing.') ;\n            }\n          };\n        },\n        unsubscribe: function unsubscribe() {\n          insightsClient('onUserTokenChange', undefined);\n          instantSearchInstance.sendEventToInsights = noop;\n          if (helper && initialParameters) {\n            helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread2(_objectSpread2({}, helper.state), initialParameters));\n            instantSearchInstance.scheduleSearch();\n          }\n        }\n      };\n    };\n  }\n  function getInitialParameters(instantSearchInstance) {\n    var _instantSearchInstanc, _instantSearchInstanc2;\n    // in SSR, the initial state we use in this domain is set on the main index\n    var stateFromInitialResults = ((_instantSearchInstanc = instantSearchInstance._initialResults) === null || _instantSearchInstanc === void 0 ? void 0 : (_instantSearchInstanc2 = _instantSearchInstanc[instantSearchInstance.indexName]) === null || _instantSearchInstanc2 === void 0 ? void 0 : _instantSearchInstanc2.state) || {};\n    var stateFromHelper = instantSearchInstance.mainHelper.state;\n    return {\n      userToken: stateFromInitialResults.userToken || stateFromHelper.userToken,\n      clickAnalytics: stateFromInitialResults.clickAnalytics || stateFromHelper.clickAnalytics\n    };\n  }\n  function saveTokenAsCookie(token, cookieDuration) {\n    var MONTH = 30 * 24 * 60 * 60 * 1000;\n    var d = new Date();\n    d.setTime(d.getTime() + (cookieDuration || MONTH * 6));\n    var expires = \"expires=\".concat(d.toUTCString());\n    document.cookie = \"_ALGOLIA=\".concat(token, \";\").concat(expires, \";path=/\");\n  }\n\n  /**\n   * Determines if a given insights `client` supports the optional call to `init`\n   * and the ability to set credentials via extra parameters when sending events.\n   */\n  function isModernInsightsClient(client) {\n    var _split$map = (client.version || '').split('.').map(Number),\n      _split$map2 = _slicedToArray(_split$map, 2),\n      major = _split$map2[0],\n      minor = _split$map2[1];\n\n    /* eslint-disable @typescript-eslint/naming-convention */\n    var v3 = major >= 3;\n    var v2_6 = major === 2 && minor >= 6;\n    var v1_10 = major === 1 && minor >= 10;\n    /* eslint-enable @typescript-eslint/naming-convention */\n\n    return v3 || v2_6 || v1_10;\n  }\n\n  /**\n   * While `search-insights` supports both string and number user tokens,\n   * the Search API only accepts strings. This function normalizes the user token.\n   */\n  function normalizeUserToken(userToken) {\n    if (!userToken) {\n      return undefined;\n    }\n    return typeof userToken === 'number' ? userToken.toString() : userToken;\n  }\n\n  function extractWidgetPayload(widgets, instantSearchInstance, payload) {\n    var initOptions = createInitArgs(instantSearchInstance, instantSearchInstance.mainIndex, instantSearchInstance._initialUiState);\n    widgets.forEach(function (widget) {\n      var widgetParams = {};\n      if (widget.getWidgetRenderState) {\n        var renderState = widget.getWidgetRenderState(initOptions);\n        if (renderState && renderState.widgetParams) {\n          // casting, as we just earlier checked widgetParams exists, and thus an object\n          widgetParams = renderState.widgetParams;\n        }\n      }\n\n      // since we destructure in all widgets, the parameters with defaults are set to \"undefined\"\n      var params = Object.keys(widgetParams).filter(function (key) {\n        return widgetParams[key] !== undefined;\n      });\n      payload.widgets.push({\n        type: widget.$$type,\n        widgetType: widget.$$widgetType,\n        params: params\n      });\n      if (widget.$$type === 'ais.index') {\n        extractWidgetPayload(widget.getWidgets(), instantSearchInstance, payload);\n      }\n    });\n  }\n  function isMetadataEnabled() {\n    return safelyRunOnBrowser(function (_ref) {\n      var _window$navigator, _window$navigator$use;\n      var window = _ref.window;\n      return ((_window$navigator = window.navigator) === null || _window$navigator === void 0 ? void 0 : (_window$navigator$use = _window$navigator.userAgent) === null || _window$navigator$use === void 0 ? void 0 : _window$navigator$use.indexOf('Algolia Crawler')) > -1;\n    }, {\n      fallback: function fallback() {\n        return false;\n      }\n    });\n  }\n\n  /**\n   * Exposes the metadata of mounted widgets in a custom\n   * `<meta name=\"instantsearch:widgets\" />` tag. The metadata per widget is:\n   * - applied parameters\n   * - widget name\n   * - connector name\n   */\n  function createMetadataMiddleware() {\n    var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n      _ref2$$$internal = _ref2.$$internal,\n      $$internal = _ref2$$$internal === void 0 ? false : _ref2$$$internal;\n    return function (_ref3) {\n      var instantSearchInstance = _ref3.instantSearchInstance;\n      var payload = {\n        widgets: []\n      };\n      var payloadContainer = document.createElement('meta');\n      var refNode = document.querySelector('head');\n      payloadContainer.name = 'instantsearch:widgets';\n      return {\n        $$type: 'ais.metadata',\n        $$internal: $$internal,\n        onStateChange: function onStateChange() {},\n        subscribe: function subscribe() {\n          // using setTimeout here to delay extraction until widgets have been added in a tick (e.g. Vue)\n          setTimeout(function () {\n            var client = instantSearchInstance.client;\n            payload.ua = client.transporter && client.transporter.userAgent ? client.transporter.userAgent.value : client._ua;\n            extractWidgetPayload(instantSearchInstance.mainIndex.getWidgets(), instantSearchInstance, payload);\n            instantSearchInstance.middleware.forEach(function (middleware) {\n              return payload.widgets.push({\n                middleware: true,\n                type: middleware.instance.$$type,\n                internal: middleware.instance.$$internal\n              });\n            });\n            payloadContainer.content = JSON.stringify(payload);\n            refNode.appendChild(payloadContainer);\n          }, 0);\n        },\n        started: function started() {},\n        unsubscribe: function unsubscribe() {\n          payloadContainer.remove();\n        }\n      };\n    };\n  }\n\n  var replace = String.prototype.replace;\n  var percentTwenties = /%20/g;\n\n  var Format = {\n      RFC1738: 'RFC1738',\n      RFC3986: 'RFC3986'\n  };\n\n  var formats = {\n      'default': Format.RFC3986,\n      formatters: {\n          RFC1738: function (value) {\n              return replace.call(value, percentTwenties, '+');\n          },\n          RFC3986: function (value) {\n              return String(value);\n          }\n      },\n      RFC1738: Format.RFC1738,\n      RFC3986: Format.RFC3986\n  };\n\n  var has = Object.prototype.hasOwnProperty;\n  var isArray = Array.isArray;\n\n  var hexTable = (function () {\n      var array = [];\n      for (var i = 0; i < 256; ++i) {\n          array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());\n      }\n\n      return array;\n  }());\n\n  var compactQueue = function compactQueue(queue) {\n      while (queue.length > 1) {\n          var item = queue.pop();\n          var obj = item.obj[item.prop];\n\n          if (isArray(obj)) {\n              var compacted = [];\n\n              for (var j = 0; j < obj.length; ++j) {\n                  if (typeof obj[j] !== 'undefined') {\n                      compacted.push(obj[j]);\n                  }\n              }\n\n              item.obj[item.prop] = compacted;\n          }\n      }\n  };\n\n  var arrayToObject = function arrayToObject(source, options) {\n      var obj = options && options.plainObjects ? Object.create(null) : {};\n      for (var i = 0; i < source.length; ++i) {\n          if (typeof source[i] !== 'undefined') {\n              obj[i] = source[i];\n          }\n      }\n\n      return obj;\n  };\n\n  var merge$1 = function merge(target, source, options) {\n      /* eslint no-param-reassign: 0 */\n      if (!source) {\n          return target;\n      }\n\n      if (typeof source !== 'object') {\n          if (isArray(target)) {\n              target.push(source);\n          } else if (target && typeof target === 'object') {\n              if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {\n                  target[source] = true;\n              }\n          } else {\n              return [target, source];\n          }\n\n          return target;\n      }\n\n      if (!target || typeof target !== 'object') {\n          return [target].concat(source);\n      }\n\n      var mergeTarget = target;\n      if (isArray(target) && !isArray(source)) {\n          mergeTarget = arrayToObject(target, options);\n      }\n\n      if (isArray(target) && isArray(source)) {\n          source.forEach(function (item, i) {\n              if (has.call(target, i)) {\n                  var targetItem = target[i];\n                  if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n                      target[i] = merge(targetItem, item, options);\n                  } else {\n                      target.push(item);\n                  }\n              } else {\n                  target[i] = item;\n              }\n          });\n          return target;\n      }\n\n      return Object.keys(source).reduce(function (acc, key) {\n          var value = source[key];\n\n          if (has.call(acc, key)) {\n              acc[key] = merge(acc[key], value, options);\n          } else {\n              acc[key] = value;\n          }\n          return acc;\n      }, mergeTarget);\n  };\n\n  var assign = function assignSingleSource(target, source) {\n      return Object.keys(source).reduce(function (acc, key) {\n          acc[key] = source[key];\n          return acc;\n      }, target);\n  };\n\n  var decode = function (str, decoder, charset) {\n      var strWithoutPlus = str.replace(/\\+/g, ' ');\n      if (charset === 'iso-8859-1') {\n          // unescape never throws, no try...catch needed:\n          return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n      }\n      // utf-8\n      try {\n          return decodeURIComponent(strWithoutPlus);\n      } catch (e) {\n          return strWithoutPlus;\n      }\n  };\n\n  var encode = function encode(str, defaultEncoder, charset, kind, format) {\n      // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n      // It has been adapted here for stricter adherence to RFC 3986\n      if (str.length === 0) {\n          return str;\n      }\n\n      var string = str;\n      if (typeof str === 'symbol') {\n          string = Symbol.prototype.toString.call(str);\n      } else if (typeof str !== 'string') {\n          string = String(str);\n      }\n\n      if (charset === 'iso-8859-1') {\n          return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n              return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n          });\n      }\n\n      var out = '';\n      for (var i = 0; i < string.length; ++i) {\n          var c = string.charCodeAt(i);\n\n          if (\n              c === 0x2D // -\n              || c === 0x2E // .\n              || c === 0x5F // _\n              || c === 0x7E // ~\n              || (c >= 0x30 && c <= 0x39) // 0-9\n              || (c >= 0x41 && c <= 0x5A) // a-z\n              || (c >= 0x61 && c <= 0x7A) // A-Z\n              || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )\n          ) {\n              out += string.charAt(i);\n              continue;\n          }\n\n          if (c < 0x80) {\n              out = out + hexTable[c];\n              continue;\n          }\n\n          if (c < 0x800) {\n              out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);\n              continue;\n          }\n\n          if (c < 0xD800 || c >= 0xE000) {\n              out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);\n              continue;\n          }\n\n          i += 1;\n          c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));\n          /* eslint operator-linebreak: [2, \"before\"] */\n          out += hexTable[0xF0 | (c >> 18)]\n              + hexTable[0x80 | ((c >> 12) & 0x3F)]\n              + hexTable[0x80 | ((c >> 6) & 0x3F)]\n              + hexTable[0x80 | (c & 0x3F)];\n      }\n\n      return out;\n  };\n\n  var compact$1 = function compact(value) {\n      var queue = [{ obj: { o: value }, prop: 'o' }];\n      var refs = [];\n\n      for (var i = 0; i < queue.length; ++i) {\n          var item = queue[i];\n          var obj = item.obj[item.prop];\n\n          var keys = Object.keys(obj);\n          for (var j = 0; j < keys.length; ++j) {\n              var key = keys[j];\n              var val = obj[key];\n              if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n                  queue.push({ obj: obj, prop: key });\n                  refs.push(val);\n              }\n          }\n      }\n\n      compactQueue(queue);\n\n      return value;\n  };\n\n  var isRegExp = function isRegExp(obj) {\n      return Object.prototype.toString.call(obj) === '[object RegExp]';\n  };\n\n  var isBuffer = function isBuffer(obj) {\n      if (!obj || typeof obj !== 'object') {\n          return false;\n      }\n\n      return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n  };\n\n  var combine = function combine(a, b) {\n      return [].concat(a, b);\n  };\n\n  var maybeMap = function maybeMap(val, fn) {\n      if (isArray(val)) {\n          var mapped = [];\n          for (var i = 0; i < val.length; i += 1) {\n              mapped.push(fn(val[i]));\n          }\n          return mapped;\n      }\n      return fn(val);\n  };\n\n  var utils = {\n      arrayToObject: arrayToObject,\n      assign: assign,\n      combine: combine,\n      compact: compact$1,\n      decode: decode,\n      encode: encode,\n      isBuffer: isBuffer,\n      isRegExp: isRegExp,\n      maybeMap: maybeMap,\n      merge: merge$1\n  };\n\n  var has$1 = Object.prototype.hasOwnProperty;\n\n  var arrayPrefixGenerators = {\n      brackets: function brackets(prefix) {\n          return prefix + '[]';\n      },\n      comma: 'comma',\n      indices: function indices(prefix, key) {\n          return prefix + '[' + key + ']';\n      },\n      repeat: function repeat(prefix) {\n          return prefix;\n      }\n  };\n\n  var isArray$1 = Array.isArray;\n  var split = String.prototype.split;\n  var push = Array.prototype.push;\n  var pushToArray = function (arr, valueOrArray) {\n      push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);\n  };\n\n  var toISO = Date.prototype.toISOString;\n\n  var defaultFormat = formats['default'];\n  var defaults = {\n      addQueryPrefix: false,\n      allowDots: false,\n      charset: 'utf-8',\n      charsetSentinel: false,\n      delimiter: '&',\n      encode: true,\n      encoder: utils.encode,\n      encodeValuesOnly: false,\n      format: defaultFormat,\n      formatter: formats.formatters[defaultFormat],\n      // deprecated\n      indices: false,\n      serializeDate: function serializeDate(date) {\n          return toISO.call(date);\n      },\n      skipNulls: false,\n      strictNullHandling: false\n  };\n\n  var isNonNullishPrimitive = function isNonNullishPrimitive(v) {\n      return typeof v === 'string'\n          || typeof v === 'number'\n          || typeof v === 'boolean'\n          || typeof v === 'symbol'\n          || typeof v === 'bigint';\n  };\n\n  var stringify = function stringify(\n      object,\n      prefix,\n      generateArrayPrefix,\n      strictNullHandling,\n      skipNulls,\n      encoder,\n      filter,\n      sort,\n      allowDots,\n      serializeDate,\n      format,\n      formatter,\n      encodeValuesOnly,\n      charset\n  ) {\n      var obj = object;\n      if (typeof filter === 'function') {\n          obj = filter(prefix, obj);\n      } else if (obj instanceof Date) {\n          obj = serializeDate(obj);\n      } else if (generateArrayPrefix === 'comma' && isArray$1(obj)) {\n          obj = utils.maybeMap(obj, function (value) {\n              if (value instanceof Date) {\n                  return serializeDate(value);\n              }\n              return value;\n          });\n      }\n\n      if (obj === null) {\n          if (strictNullHandling) {\n              return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;\n          }\n\n          obj = '';\n      }\n\n      if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {\n          if (encoder) {\n              var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);\n              if (generateArrayPrefix === 'comma' && encodeValuesOnly) {\n                  var valuesArray = split.call(String(obj), ',');\n                  var valuesJoined = '';\n                  for (var i = 0; i < valuesArray.length; ++i) {\n                      valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));\n                  }\n                  return [formatter(keyValue) + '=' + valuesJoined];\n              }\n              return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];\n          }\n          return [formatter(prefix) + '=' + formatter(String(obj))];\n      }\n\n      var values = [];\n\n      if (typeof obj === 'undefined') {\n          return values;\n      }\n\n      var objKeys;\n      if (generateArrayPrefix === 'comma' && isArray$1(obj)) {\n          // we need to join elements in\n          objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];\n      } else if (isArray$1(filter)) {\n          objKeys = filter;\n      } else {\n          var keys = Object.keys(obj);\n          objKeys = sort ? keys.sort(sort) : keys;\n      }\n\n      for (var j = 0; j < objKeys.length; ++j) {\n          var key = objKeys[j];\n          var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];\n\n          if (skipNulls && value === null) {\n              continue;\n          }\n\n          var keyPrefix = isArray$1(obj)\n              ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix\n              : prefix + (allowDots ? '.' + key : '[' + key + ']');\n\n          pushToArray(values, stringify(\n              value,\n              keyPrefix,\n              generateArrayPrefix,\n              strictNullHandling,\n              skipNulls,\n              encoder,\n              filter,\n              sort,\n              allowDots,\n              serializeDate,\n              format,\n              formatter,\n              encodeValuesOnly,\n              charset\n          ));\n      }\n\n      return values;\n  };\n\n  var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {\n      if (!opts) {\n          return defaults;\n      }\n\n      if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {\n          throw new TypeError('Encoder has to be a function.');\n      }\n\n      var charset = opts.charset || defaults.charset;\n      if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n          throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n      }\n\n      var format = formats['default'];\n      if (typeof opts.format !== 'undefined') {\n          if (!has$1.call(formats.formatters, opts.format)) {\n              throw new TypeError('Unknown format option provided.');\n          }\n          format = opts.format;\n      }\n      var formatter = formats.formatters[format];\n\n      var filter = defaults.filter;\n      if (typeof opts.filter === 'function' || isArray$1(opts.filter)) {\n          filter = opts.filter;\n      }\n\n      return {\n          addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n          allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n          charset: charset,\n          charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n          delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n          encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n          encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,\n          encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,\n          filter: filter,\n          format: format,\n          formatter: formatter,\n          serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,\n          skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,\n          sort: typeof opts.sort === 'function' ? opts.sort : null,\n          strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n      };\n  };\n\n  var stringify_1 = function (object, opts) {\n      var obj = object;\n      var options = normalizeStringifyOptions(opts);\n\n      var objKeys;\n      var filter;\n\n      if (typeof options.filter === 'function') {\n          filter = options.filter;\n          obj = filter('', obj);\n      } else if (isArray$1(options.filter)) {\n          filter = options.filter;\n          objKeys = filter;\n      }\n\n      var keys = [];\n\n      if (typeof obj !== 'object' || obj === null) {\n          return '';\n      }\n\n      var arrayFormat;\n      if (opts && opts.arrayFormat in arrayPrefixGenerators) {\n          arrayFormat = opts.arrayFormat;\n      } else if (opts && 'indices' in opts) {\n          arrayFormat = opts.indices ? 'indices' : 'repeat';\n      } else {\n          arrayFormat = 'indices';\n      }\n\n      var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];\n\n      if (!objKeys) {\n          objKeys = Object.keys(obj);\n      }\n\n      if (options.sort) {\n          objKeys.sort(options.sort);\n      }\n\n      for (var i = 0; i < objKeys.length; ++i) {\n          var key = objKeys[i];\n\n          if (options.skipNulls && obj[key] === null) {\n              continue;\n          }\n          pushToArray(keys, stringify(\n              obj[key],\n              key,\n              generateArrayPrefix,\n              options.strictNullHandling,\n              options.skipNulls,\n              options.encode ? options.encoder : null,\n              options.filter,\n              options.sort,\n              options.allowDots,\n              options.serializeDate,\n              options.format,\n              options.formatter,\n              options.encodeValuesOnly,\n              options.charset\n          ));\n      }\n\n      var joined = keys.join(options.delimiter);\n      var prefix = options.addQueryPrefix === true ? '?' : '';\n\n      if (options.charsetSentinel) {\n          if (options.charset === 'iso-8859-1') {\n              // encodeURIComponent('&#10003;'), the \"numeric entity\" representation of a checkmark\n              prefix += 'utf8=%26%2310003%3B&';\n          } else {\n              // encodeURIComponent('✓')\n              prefix += 'utf8=%E2%9C%93&';\n          }\n      }\n\n      return joined.length > 0 ? prefix + joined : '';\n  };\n\n  var has$2 = Object.prototype.hasOwnProperty;\n  var isArray$2 = Array.isArray;\n\n  var defaults$1 = {\n      allowDots: false,\n      allowPrototypes: false,\n      arrayLimit: 20,\n      charset: 'utf-8',\n      charsetSentinel: false,\n      comma: false,\n      decoder: utils.decode,\n      delimiter: '&',\n      depth: 5,\n      ignoreQueryPrefix: false,\n      interpretNumericEntities: false,\n      parameterLimit: 1000,\n      parseArrays: true,\n      plainObjects: false,\n      strictNullHandling: false\n  };\n\n  var interpretNumericEntities = function (str) {\n      return str.replace(/&#(\\d+);/g, function ($0, numberStr) {\n          return String.fromCharCode(parseInt(numberStr, 10));\n      });\n  };\n\n  var parseArrayValue = function (val, options) {\n      if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {\n          return val.split(',');\n      }\n\n      return val;\n  };\n\n  // This is what browsers will submit when the ✓ character occurs in an\n  // application/x-www-form-urlencoded body and the encoding of the page containing\n  // the form is iso-8859-1, or when the submitted form has an accept-charset\n  // attribute of iso-8859-1. Presumably also with other charsets that do not contain\n  // the ✓ character, such as us-ascii.\n  var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')\n\n  // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.\n  var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')\n\n  var parseValues = function parseQueryStringValues(str, options) {\n      var obj = {};\n      var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n      var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;\n      var parts = cleanStr.split(options.delimiter, limit);\n      var skipIndex = -1; // Keep track of where the utf8 sentinel was found\n      var i;\n\n      var charset = options.charset;\n      if (options.charsetSentinel) {\n          for (i = 0; i < parts.length; ++i) {\n              if (parts[i].indexOf('utf8=') === 0) {\n                  if (parts[i] === charsetSentinel) {\n                      charset = 'utf-8';\n                  } else if (parts[i] === isoSentinel) {\n                      charset = 'iso-8859-1';\n                  }\n                  skipIndex = i;\n                  i = parts.length; // The eslint settings do not allow break;\n              }\n          }\n      }\n\n      for (i = 0; i < parts.length; ++i) {\n          if (i === skipIndex) {\n              continue;\n          }\n          var part = parts[i];\n\n          var bracketEqualsPos = part.indexOf(']=');\n          var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n          var key, val;\n          if (pos === -1) {\n              key = options.decoder(part, defaults$1.decoder, charset, 'key');\n              val = options.strictNullHandling ? null : '';\n          } else {\n              key = options.decoder(part.slice(0, pos), defaults$1.decoder, charset, 'key');\n              val = utils.maybeMap(\n                  parseArrayValue(part.slice(pos + 1), options),\n                  function (encodedVal) {\n                      return options.decoder(encodedVal, defaults$1.decoder, charset, 'value');\n                  }\n              );\n          }\n\n          if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {\n              val = interpretNumericEntities(val);\n          }\n\n          if (part.indexOf('[]=') > -1) {\n              val = isArray$2(val) ? [val] : val;\n          }\n\n          if (has$2.call(obj, key)) {\n              obj[key] = utils.combine(obj[key], val);\n          } else {\n              obj[key] = val;\n          }\n      }\n\n      return obj;\n  };\n\n  var parseObject = function (chain, val, options, valuesParsed) {\n      var leaf = valuesParsed ? val : parseArrayValue(val, options);\n\n      for (var i = chain.length - 1; i >= 0; --i) {\n          var obj;\n          var root = chain[i];\n\n          if (root === '[]' && options.parseArrays) {\n              obj = [].concat(leaf);\n          } else {\n              obj = options.plainObjects ? Object.create(null) : {};\n              var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n              var index = parseInt(cleanRoot, 10);\n              if (!options.parseArrays && cleanRoot === '') {\n                  obj = { 0: leaf };\n              } else if (\n                  !isNaN(index)\n                  && root !== cleanRoot\n                  && String(index) === cleanRoot\n                  && index >= 0\n                  && (options.parseArrays && index <= options.arrayLimit)\n              ) {\n                  obj = [];\n                  obj[index] = leaf;\n              } else if (cleanRoot !== '__proto__') {\n                  obj[cleanRoot] = leaf;\n              }\n          }\n\n          leaf = obj;\n      }\n\n      return leaf;\n  };\n\n  var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {\n      if (!givenKey) {\n          return;\n      }\n\n      // Transform dot notation to bracket notation\n      var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n      // The regex chunks\n\n      var brackets = /(\\[[^[\\]]*])/;\n      var child = /(\\[[^[\\]]*])/g;\n\n      // Get the parent\n\n      var segment = options.depth > 0 && brackets.exec(key);\n      var parent = segment ? key.slice(0, segment.index) : key;\n\n      // Stash the parent if it exists\n\n      var keys = [];\n      if (parent) {\n          // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties\n          if (!options.plainObjects && has$2.call(Object.prototype, parent)) {\n              if (!options.allowPrototypes) {\n                  return;\n              }\n          }\n\n          keys.push(parent);\n      }\n\n      // Loop through children appending to the array until we hit depth\n\n      var i = 0;\n      while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {\n          i += 1;\n          if (!options.plainObjects && has$2.call(Object.prototype, segment[1].slice(1, -1))) {\n              if (!options.allowPrototypes) {\n                  return;\n              }\n          }\n          keys.push(segment[1]);\n      }\n\n      // If there's a remainder, just add whatever is left\n\n      if (segment) {\n          keys.push('[' + key.slice(segment.index) + ']');\n      }\n\n      return parseObject(keys, val, options, valuesParsed);\n  };\n\n  var normalizeParseOptions = function normalizeParseOptions(opts) {\n      if (!opts) {\n          return defaults$1;\n      }\n\n      if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {\n          throw new TypeError('Decoder has to be a function.');\n      }\n\n      if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n          throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n      }\n      var charset = typeof opts.charset === 'undefined' ? defaults$1.charset : opts.charset;\n\n      return {\n          allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,\n          allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults$1.allowPrototypes,\n          arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults$1.arrayLimit,\n          charset: charset,\n          charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,\n          comma: typeof opts.comma === 'boolean' ? opts.comma : defaults$1.comma,\n          decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults$1.decoder,\n          delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults$1.delimiter,\n          // eslint-disable-next-line no-implicit-coercion, no-extra-parens\n          depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults$1.depth,\n          ignoreQueryPrefix: opts.ignoreQueryPrefix === true,\n          interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults$1.interpretNumericEntities,\n          parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults$1.parameterLimit,\n          parseArrays: opts.parseArrays !== false,\n          plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults$1.plainObjects,\n          strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling\n      };\n  };\n\n  var parse = function (str, opts) {\n      var options = normalizeParseOptions(opts);\n\n      if (str === '' || str === null || typeof str === 'undefined') {\n          return options.plainObjects ? Object.create(null) : {};\n      }\n\n      var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n      var obj = options.plainObjects ? Object.create(null) : {};\n\n      // Iterate over the keys and setup the new object\n\n      var keys = Object.keys(tempObj);\n      for (var i = 0; i < keys.length; ++i) {\n          var key = keys[i];\n          var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');\n          obj = utils.merge(obj, newObj, options);\n      }\n\n      return utils.compact(obj);\n  };\n\n  var lib$1 = {\n      formats: formats,\n      parse: parse,\n      stringify: stringify_1\n  };\n\n  var setWindowTitle = function setWindowTitle(title) {\n    if (title) {\n      // This function is only executed on browsers so we can disable this check.\n      // eslint-disable-next-line no-restricted-globals\n      window.document.title = title;\n    }\n  };\n  var BrowserHistory = /*#__PURE__*/function () {\n    /**\n     * Initializes a new storage provider that syncs the search state to the URL\n     * using web APIs (`window.location.pushState` and `onpopstate` event).\n     */\n    function BrowserHistory(_ref) {\n      var _this = this;\n      var windowTitle = _ref.windowTitle,\n        _ref$writeDelay = _ref.writeDelay,\n        writeDelay = _ref$writeDelay === void 0 ? 400 : _ref$writeDelay,\n        createURL = _ref.createURL,\n        parseURL = _ref.parseURL,\n        getLocation = _ref.getLocation,\n        start = _ref.start,\n        dispose = _ref.dispose,\n        push = _ref.push,\n        cleanUrlOnDispose = _ref.cleanUrlOnDispose;\n      _classCallCheck(this, BrowserHistory);\n      _defineProperty(this, \"$$type\", 'ais.browser');\n      /**\n       * Transforms a UI state into a title for the page.\n       */\n      _defineProperty(this, \"windowTitle\", void 0);\n      /**\n       * Time in milliseconds before performing a write in the history.\n       * It prevents from adding too many entries in the history and\n       * makes the back button more usable.\n       *\n       * @default 400\n       */\n      _defineProperty(this, \"writeDelay\", void 0);\n      /**\n       * Creates a full URL based on the route state.\n       * The storage adaptor maps all syncable keys to the query string of the URL.\n       */\n      _defineProperty(this, \"_createURL\", void 0);\n      /**\n       * Parses the URL into a route state.\n       * It should be symmetrical to `createURL`.\n       */\n      _defineProperty(this, \"parseURL\", void 0);\n      /**\n       * Returns the location to store in the history.\n       * @default () => window.location\n       */\n      _defineProperty(this, \"getLocation\", void 0);\n      _defineProperty(this, \"writeTimer\", void 0);\n      _defineProperty(this, \"_onPopState\", void 0);\n      /**\n       * Indicates if last action was back/forward in the browser.\n       */\n      _defineProperty(this, \"inPopState\", false);\n      /**\n       * Indicates whether the history router is disposed or not.\n       */\n      _defineProperty(this, \"isDisposed\", false);\n      /**\n       * Indicates the window.history.length before the last call to\n       * window.history.pushState (called in `write`).\n       * It allows to determine if a `pushState` has been triggered elsewhere,\n       * and thus to prevent the `write` method from calling `pushState`.\n       */\n      _defineProperty(this, \"latestAcknowledgedHistory\", 0);\n      _defineProperty(this, \"_start\", void 0);\n      _defineProperty(this, \"_dispose\", void 0);\n      _defineProperty(this, \"_push\", void 0);\n      _defineProperty(this, \"_cleanUrlOnDispose\", void 0);\n      this.windowTitle = windowTitle;\n      this.writeTimer = undefined;\n      this.writeDelay = writeDelay;\n      this._createURL = createURL;\n      this.parseURL = parseURL;\n      this.getLocation = getLocation;\n      this._start = start;\n      this._dispose = dispose;\n      this._push = push;\n      this._cleanUrlOnDispose = typeof cleanUrlOnDispose === 'undefined' ? true : cleanUrlOnDispose;\n      if ( typeof cleanUrlOnDispose === 'undefined') {\n        // eslint-disable-next-line no-console\n        console.info(\"Starting from the next major version, InstantSearch will not clean up the URL from active refinements when it is disposed.\\n\\nWe recommend setting `cleanUrlOnDispose` to false to adopt this change today.\\nTo stay with the current behaviour and remove this warning, set the option to true.\\n\\nSee documentation: \".concat(createDocumentationLink({\n          name: 'history-router'\n        }), \"#widget-param-cleanurlondispose\"));\n      }\n      safelyRunOnBrowser(function (_ref2) {\n        var window = _ref2.window;\n        var title = _this.windowTitle && _this.windowTitle(_this.read());\n        setWindowTitle(title);\n        _this.latestAcknowledgedHistory = window.history.length;\n      });\n    }\n\n    /**\n     * Reads the URL and returns a syncable UI search state.\n     */\n    _createClass(BrowserHistory, [{\n      key: \"read\",\n      value: function read() {\n        return this.parseURL({\n          qsModule: lib$1,\n          location: this.getLocation()\n        });\n      }\n\n      /**\n       * Pushes a search state into the URL.\n       */\n    }, {\n      key: \"write\",\n      value: function write(routeState) {\n        var _this2 = this;\n        safelyRunOnBrowser(function (_ref3) {\n          var window = _ref3.window;\n          var url = _this2.createURL(routeState);\n          var title = _this2.windowTitle && _this2.windowTitle(routeState);\n          if (_this2.writeTimer) {\n            clearTimeout(_this2.writeTimer);\n          }\n          _this2.writeTimer = setTimeout(function () {\n            setWindowTitle(title);\n            if (_this2.shouldWrite(url)) {\n              if (_this2._push) {\n                _this2._push(url);\n              } else {\n                window.history.pushState(routeState, title || '', url);\n              }\n              _this2.latestAcknowledgedHistory = window.history.length;\n            }\n            _this2.inPopState = false;\n            _this2.writeTimer = undefined;\n          }, _this2.writeDelay);\n        });\n      }\n\n      /**\n       * Sets a callback on the `onpopstate` event of the history API of the current page.\n       * It enables the URL sync to keep track of the changes.\n       */\n    }, {\n      key: \"onUpdate\",\n      value: function onUpdate(callback) {\n        var _this3 = this;\n        if (this._start) {\n          this._start(function () {\n            callback(_this3.read());\n          });\n        }\n        this._onPopState = function () {\n          if (_this3.writeTimer) {\n            clearTimeout(_this3.writeTimer);\n            _this3.writeTimer = undefined;\n          }\n          _this3.inPopState = true;\n\n          // We always read the state from the URL because the state of the history\n          // can be incorect in some cases (e.g. using React Router).\n          callback(_this3.read());\n        };\n        safelyRunOnBrowser(function (_ref4) {\n          var window = _ref4.window;\n          window.addEventListener('popstate', _this3._onPopState);\n        });\n      }\n\n      /**\n       * Creates a complete URL from a given syncable UI state.\n       *\n       * It always generates the full URL, not a relative one.\n       * This allows to handle cases like using a <base href>.\n       * See: https://github.com/algolia/instantsearch/issues/790\n       */\n    }, {\n      key: \"createURL\",\n      value: function createURL(routeState) {\n        var url = this._createURL({\n          qsModule: lib$1,\n          routeState: routeState,\n          location: this.getLocation()\n        });\n        {\n          try {\n            // We just want to check if the URL is valid.\n            // eslint-disable-next-line no-new\n            new URL(url);\n          } catch (e) {\n             _warning(false, \"The URL returned by the `createURL` function is invalid.\\nPlease make sure it returns an absolute URL to avoid issues, e.g: `https://algolia.com/search?query=iphone`.\") ;\n          }\n        }\n        return url;\n      }\n\n      /**\n       * Removes the event listener and cleans up the URL.\n       */\n    }, {\n      key: \"dispose\",\n      value: function dispose() {\n        var _this4 = this;\n        if (this._dispose) {\n          this._dispose();\n        }\n        this.isDisposed = true;\n        safelyRunOnBrowser(function (_ref5) {\n          var window = _ref5.window;\n          if (_this4._onPopState) {\n            window.removeEventListener('popstate', _this4._onPopState);\n          }\n        });\n        if (this.writeTimer) {\n          clearTimeout(this.writeTimer);\n        }\n        if (this._cleanUrlOnDispose) {\n          this.write({});\n        }\n      }\n    }, {\n      key: \"start\",\n      value: function start() {\n        this.isDisposed = false;\n      }\n    }, {\n      key: \"shouldWrite\",\n      value: function shouldWrite(url) {\n        var _this5 = this;\n        return safelyRunOnBrowser(function (_ref6) {\n          var window = _ref6.window;\n          // When disposed and the cleanUrlOnDispose is set to false, we do not want to write the URL.\n          if (_this5.isDisposed && !_this5._cleanUrlOnDispose) {\n            return false;\n          }\n\n          // We do want to `pushState` if:\n          // - the router is not disposed, IS.js needs to update the URL\n          // OR\n          // - the last write was from InstantSearch.js\n          // (unlike a SPA, where it would have last written)\n          var lastPushWasByISAfterDispose = !(_this5.isDisposed && _this5.latestAcknowledgedHistory !== window.history.length);\n          return (\n            // When the last state change was through popstate, the IS.js state changes,\n            // but that should not write the URL.\n            !_this5.inPopState &&\n            // When the previous pushState after dispose was by IS.js, we want to write the URL.\n            lastPushWasByISAfterDispose &&\n            // When the URL is the same as the current one, we do not want to write it.\n            url !== window.location.href\n          );\n        });\n      }\n    }]);\n    return BrowserHistory;\n  }();\n  function historyRouter() {\n    var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n      _ref7$createURL = _ref7.createURL,\n      createURL = _ref7$createURL === void 0 ? function (_ref8) {\n        var qsModule = _ref8.qsModule,\n          routeState = _ref8.routeState,\n          location = _ref8.location;\n        var protocol = location.protocol,\n          hostname = location.hostname,\n          _location$port = location.port,\n          port = _location$port === void 0 ? '' : _location$port,\n          pathname = location.pathname,\n          hash = location.hash;\n        var queryString = qsModule.stringify(routeState);\n        var portWithPrefix = port === '' ? '' : \":\".concat(port);\n\n        // IE <= 11 has no proper `location.origin` so we cannot rely on it.\n        if (!queryString) {\n          return \"\".concat(protocol, \"//\").concat(hostname).concat(portWithPrefix).concat(pathname).concat(hash);\n        }\n        return \"\".concat(protocol, \"//\").concat(hostname).concat(portWithPrefix).concat(pathname, \"?\").concat(queryString).concat(hash);\n      } : _ref7$createURL,\n      _ref7$parseURL = _ref7.parseURL,\n      parseURL = _ref7$parseURL === void 0 ? function (_ref9) {\n        var qsModule = _ref9.qsModule,\n          location = _ref9.location;\n        // `qs` by default converts arrays with more than 20 items to an object.\n        // We want to avoid this because the data structure manipulated can therefore vary.\n        // Setting the limit to `100` seems a good number because the engine's default is 100\n        // (it can go up to 1000 but it is very unlikely to select more than 100 items in the UI).\n        //\n        // Using an `arrayLimit` of `n` allows `n + 1` items.\n        //\n        // See:\n        //   - https://github.com/ljharb/qs#parsing-arrays\n        //   - https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/\n        return qsModule.parse(location.search.slice(1), {\n          arrayLimit: 99\n        });\n      } : _ref7$parseURL,\n      _ref7$writeDelay = _ref7.writeDelay,\n      writeDelay = _ref7$writeDelay === void 0 ? 400 : _ref7$writeDelay,\n      windowTitle = _ref7.windowTitle,\n      _ref7$getLocation = _ref7.getLocation,\n      getLocation = _ref7$getLocation === void 0 ? function () {\n        return safelyRunOnBrowser(function (_ref10) {\n          var window = _ref10.window;\n          return window.location;\n        }, {\n          fallback: function fallback() {\n            throw new Error('You need to provide `getLocation` to the `history` router in environments where `window` does not exist.');\n          }\n        });\n      } : _ref7$getLocation,\n      start = _ref7.start,\n      dispose = _ref7.dispose,\n      push = _ref7.push,\n      cleanUrlOnDispose = _ref7.cleanUrlOnDispose;\n    return new BrowserHistory({\n      createURL: createURL,\n      parseURL: parseURL,\n      writeDelay: writeDelay,\n      windowTitle: windowTitle,\n      getLocation: getLocation,\n      start: start,\n      dispose: dispose,\n      push: push,\n      cleanUrlOnDispose: cleanUrlOnDispose\n    });\n  }\n\n  var _excluded$6 = [\"configure\"];\n  function getIndexStateWithoutConfigure(uiState) {\n    var configure = uiState.configure,\n      trackedUiState = _objectWithoutProperties(uiState, _excluded$6);\n    return trackedUiState;\n  }\n\n  // technically a URL could contain any key, since users provide it,\n  // which is why the input to this function is UiState, not something\n  // which excludes \"configure\" as this function does.\n  function simpleStateMapping() {\n    return {\n      $$type: 'ais.simple',\n      stateToRoute: function stateToRoute(uiState) {\n        return Object.keys(uiState).reduce(function (state, indexId) {\n          return _objectSpread2(_objectSpread2({}, state), {}, _defineProperty({}, indexId, getIndexStateWithoutConfigure(uiState[indexId])));\n        }, {});\n      },\n      routeToState: function routeToState() {\n        var routeState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n        return Object.keys(routeState).reduce(function (state, indexId) {\n          return _objectSpread2(_objectSpread2({}, state), {}, _defineProperty({}, indexId, getIndexStateWithoutConfigure(routeState[indexId])));\n        }, {});\n      }\n    };\n  }\n\n  var createRouterMiddleware = function createRouterMiddleware() {\n    var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    var _props$router = props.router,\n      router = _props$router === void 0 ? historyRouter() : _props$router,\n      _props$stateMapping = props.stateMapping,\n      stateMapping = _props$stateMapping === void 0 ? simpleStateMapping() : _props$stateMapping,\n      _props$$$internal = props.$$internal,\n      $$internal = _props$$$internal === void 0 ? false : _props$$$internal;\n    return function (_ref) {\n      var instantSearchInstance = _ref.instantSearchInstance;\n      function topLevelCreateURL(nextState) {\n        var previousUiState =\n        // If only the mainIndex is initialized, we don't yet know what other\n        // index widgets are used. Therefore we fall back to the initialUiState.\n        // We can't indiscriminately use the initialUiState because then we\n        // reintroduce state that was changed by the user.\n        // When there are no widgets, we are sure the user can't yet have made\n        // any changes.\n        instantSearchInstance.mainIndex.getWidgets().length === 0 ? instantSearchInstance._initialUiState : instantSearchInstance.mainIndex.getWidgetUiState({});\n        var uiState = Object.keys(nextState).reduce(function (acc, indexId) {\n          return _objectSpread2(_objectSpread2({}, acc), {}, _defineProperty({}, indexId, nextState[indexId]));\n        }, previousUiState);\n        var route = stateMapping.stateToRoute(uiState);\n        return router.createURL(route);\n      }\n\n      // casting to UiState here to keep createURL unaware of custom UiState\n      // (as long as it's an object, it's ok)\n      instantSearchInstance._createURL = topLevelCreateURL;\n      var lastRouteState = undefined;\n      var initialUiState = instantSearchInstance._initialUiState;\n      return {\n        $$type: \"ais.router({router:\".concat(router.$$type || '__unknown__', \", stateMapping:\").concat(stateMapping.$$type || '__unknown__', \"})\"),\n        $$internal: $$internal,\n        onStateChange: function onStateChange(_ref2) {\n          var uiState = _ref2.uiState;\n          var routeState = stateMapping.stateToRoute(uiState);\n          if (lastRouteState === undefined || !isEqual(lastRouteState, routeState)) {\n            router.write(routeState);\n            lastRouteState = routeState;\n          }\n        },\n        subscribe: function subscribe() {\n           _warning(Object.keys(initialUiState).length === 0, 'Using `initialUiState` together with routing is not recommended. The `initialUiState` will be overwritten by the URL parameters.') ;\n          instantSearchInstance._initialUiState = _objectSpread2(_objectSpread2({}, initialUiState), stateMapping.routeToState(router.read()));\n          router.onUpdate(function (route) {\n            if (instantSearchInstance.mainIndex.getWidgets().length > 0) {\n              instantSearchInstance.setUiState(stateMapping.routeToState(route));\n            }\n          });\n        },\n        started: function started() {\n          var _router$start;\n          (_router$start = router.start) === null || _router$start === void 0 ? void 0 : _router$start.call(router);\n        },\n        unsubscribe: function unsubscribe() {\n          router.dispose();\n        }\n      };\n    };\n  };\n\n  var _excluded$7 = [\"initialSearchParameters\"],\n    _excluded2$2 = [\"initialRecommendParameters\"];\n  var withUsage$u = createDocumentationMessageGenerator({\n    name: 'index-widget'\n  });\n  /**\n   * This is the same content as helper._change / setState, but allowing for extra\n   * UiState to be synchronized.\n   * see: https://github.com/algolia/algoliasearch-helper-js/blob/6b835ffd07742f2d6b314022cce6848f5cfecd4a/src/algoliasearch.helper.js#L1311-L1324\n   */\n  function privateHelperSetState(helper, _ref) {\n    var state = _ref.state,\n      recommendState = _ref.recommendState,\n      isPageReset = _ref.isPageReset,\n      _uiState = _ref._uiState;\n    if (state !== helper.state) {\n      helper.state = state;\n      helper.emit('change', {\n        state: helper.state,\n        results: helper.lastResults,\n        isPageReset: isPageReset,\n        _uiState: _uiState\n      });\n    }\n    if (recommendState !== helper.recommendState) {\n      helper.recommendState = recommendState;\n\n      // eslint-disable-next-line no-warning-comments\n      // TODO: emit \"change\" event when events for Recommend are implemented\n    }\n  }\n  function getLocalWidgetsUiState(widgets, widgetStateOptions) {\n    var initialUiState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n    return widgets.reduce(function (uiState, widget) {\n      if (isIndexWidget(widget)) {\n        return uiState;\n      }\n      if (!widget.getWidgetUiState && !widget.getWidgetState) {\n        return uiState;\n      }\n      if (widget.getWidgetUiState) {\n        return widget.getWidgetUiState(uiState, widgetStateOptions);\n      }\n      return widget.getWidgetState(uiState, widgetStateOptions);\n    }, initialUiState);\n  }\n  function getLocalWidgetsSearchParameters(widgets, widgetSearchParametersOptions) {\n    var initialSearchParameters = widgetSearchParametersOptions.initialSearchParameters,\n      rest = _objectWithoutProperties(widgetSearchParametersOptions, _excluded$7);\n    return widgets.reduce(function (state, widget) {\n      if (!widget.getWidgetSearchParameters || isIndexWidget(widget)) {\n        return state;\n      }\n      if (widget.dependsOn === 'search' && widget.getWidgetParameters) {\n        return widget.getWidgetParameters(state, rest);\n      }\n      return widget.getWidgetSearchParameters(state, rest);\n    }, initialSearchParameters);\n  }\n  function getLocalWidgetsRecommendParameters(widgets, widgetRecommendParametersOptions) {\n    var initialRecommendParameters = widgetRecommendParametersOptions.initialRecommendParameters,\n      rest = _objectWithoutProperties(widgetRecommendParametersOptions, _excluded2$2);\n    return widgets.reduce(function (state, widget) {\n      if (!isIndexWidget(widget) && widget.dependsOn === 'recommend' && widget.getWidgetParameters) {\n        return widget.getWidgetParameters(state, rest);\n      }\n      return state;\n    }, initialRecommendParameters);\n  }\n  function resetPageFromWidgets(widgets) {\n    var indexWidgets = widgets.filter(isIndexWidget);\n    if (indexWidgets.length === 0) {\n      return;\n    }\n    indexWidgets.forEach(function (widget) {\n      var widgetHelper = widget.getHelper();\n      privateHelperSetState(widgetHelper, {\n        state: widgetHelper.state.resetPage(),\n        recommendState: widgetHelper.recommendState,\n        isPageReset: true\n      });\n      resetPageFromWidgets(widget.getWidgets());\n    });\n  }\n  function resolveScopedResultsFromWidgets(widgets) {\n    var indexWidgets = widgets.filter(isIndexWidget);\n    return indexWidgets.reduce(function (scopedResults, current) {\n      return scopedResults.concat.apply(scopedResults, [{\n        indexId: current.getIndexId(),\n        results: current.getResults(),\n        helper: current.getHelper()\n      }].concat(_toConsumableArray(resolveScopedResultsFromWidgets(current.getWidgets()))));\n    }, []);\n  }\n  var index = function index(widgetParams) {\n    if (widgetParams === undefined || widgetParams.indexName === undefined) {\n      throw new Error(withUsage$u('The `indexName` option is required.'));\n    }\n    var indexName = widgetParams.indexName,\n      _widgetParams$indexId = widgetParams.indexId,\n      indexId = _widgetParams$indexId === void 0 ? indexName : _widgetParams$indexId;\n    var localWidgets = [];\n    var localUiState = {};\n    var localInstantSearchInstance = null;\n    var localParent = null;\n    var helper = null;\n    var derivedHelper = null;\n    var lastValidSearchParameters = null;\n    var hasRecommendWidget = false;\n    var hasSearchWidget = false;\n    return {\n      $$type: 'ais.index',\n      $$widgetType: 'ais.index',\n      getIndexName: function getIndexName() {\n        return indexName;\n      },\n      getIndexId: function getIndexId() {\n        return indexId;\n      },\n      getHelper: function getHelper() {\n        return helper;\n      },\n      getResults: function getResults() {\n        var _derivedHelper;\n        if (!((_derivedHelper = derivedHelper) !== null && _derivedHelper !== void 0 && _derivedHelper.lastResults)) return null;\n\n        // To make the UI optimistic, we patch the state to display to the current\n        // one instead of the one associated with the latest results.\n        // This means user-driven UI changes (e.g., checked checkbox) are reflected\n        // immediately instead of waiting for Algolia to respond, regardless of\n        // the status of the network request.\n        derivedHelper.lastResults._state = helper.state;\n        return derivedHelper.lastResults;\n      },\n      getResultsForWidget: function getResultsForWidget(widget) {\n        var _helper;\n        if (widget.dependsOn !== 'recommend' || isIndexWidget(widget) || widget.$$id === undefined) {\n          return this.getResults();\n        }\n        if (!((_helper = helper) !== null && _helper !== void 0 && _helper.lastRecommendResults)) {\n          return null;\n        }\n        return helper.lastRecommendResults[widget.$$id];\n      },\n      getPreviousState: function getPreviousState() {\n        return lastValidSearchParameters;\n      },\n      getScopedResults: function getScopedResults() {\n        var widgetParent = this.getParent();\n        var widgetSiblings;\n        if (widgetParent) {\n          widgetSiblings = widgetParent.getWidgets();\n        } else if (indexName.length === 0) {\n          // The widget is the root but has no index name:\n          // we resolve results from its children index widgets\n          widgetSiblings = this.getWidgets();\n        } else {\n          // The widget is the root and has an index name:\n          // we consider itself as the only sibling\n          widgetSiblings = [this];\n        }\n        return resolveScopedResultsFromWidgets(widgetSiblings);\n      },\n      getParent: function getParent() {\n        return localParent;\n      },\n      createURL: function createURL(nextState) {\n        if (typeof nextState === 'function') {\n          return localInstantSearchInstance._createURL(_defineProperty({}, indexId, nextState(localUiState)));\n        }\n        return localInstantSearchInstance._createURL(_defineProperty({}, indexId, getLocalWidgetsUiState(localWidgets, {\n          searchParameters: nextState,\n          helper: helper\n        })));\n      },\n      getWidgets: function getWidgets() {\n        return localWidgets;\n      },\n      addWidgets: function addWidgets(widgets) {\n        var _this = this;\n        if (!Array.isArray(widgets)) {\n          throw new Error(withUsage$u('The `addWidgets` method expects an array of widgets.'));\n        }\n        if (widgets.some(function (widget) {\n          return typeof widget.init !== 'function' && typeof widget.render !== 'function';\n        })) {\n          throw new Error(withUsage$u('The widget definition expects a `render` and/or an `init` method.'));\n        }\n        widgets.forEach(function (widget) {\n          if (isIndexWidget(widget)) {\n            return;\n          }\n          if (localInstantSearchInstance && widget.dependsOn === 'recommend') {\n            localInstantSearchInstance._hasRecommendWidget = true;\n          } else if (localInstantSearchInstance) {\n            localInstantSearchInstance._hasSearchWidget = true;\n          } else if (widget.dependsOn === 'recommend') {\n            hasRecommendWidget = true;\n          } else {\n            hasSearchWidget = true;\n          }\n          addWidgetId(widget);\n        });\n        localWidgets = localWidgets.concat(widgets);\n        if (localInstantSearchInstance && Boolean(widgets.length)) {\n          privateHelperSetState(helper, {\n            state: getLocalWidgetsSearchParameters(localWidgets, {\n              uiState: localUiState,\n              initialSearchParameters: helper.state\n            }),\n            recommendState: getLocalWidgetsRecommendParameters(localWidgets, {\n              uiState: localUiState,\n              initialRecommendParameters: helper.recommendState\n            }),\n            _uiState: localUiState\n          });\n\n          // We compute the render state before calling `init` in a separate loop\n          // to construct the whole render state object that is then passed to\n          // `init`.\n          widgets.forEach(function (widget) {\n            if (widget.getRenderState) {\n              var renderState = widget.getRenderState(localInstantSearchInstance.renderState[_this.getIndexId()] || {}, createInitArgs(localInstantSearchInstance, _this, localInstantSearchInstance._initialUiState));\n              storeRenderState({\n                renderState: renderState,\n                instantSearchInstance: localInstantSearchInstance,\n                parent: _this\n              });\n            }\n          });\n          widgets.forEach(function (widget) {\n            if (widget.init) {\n              widget.init(createInitArgs(localInstantSearchInstance, _this, localInstantSearchInstance._initialUiState));\n            }\n          });\n          localInstantSearchInstance.scheduleSearch();\n        }\n        return this;\n      },\n      removeWidgets: function removeWidgets(widgets) {\n        var _this2 = this;\n        if (!Array.isArray(widgets)) {\n          throw new Error(withUsage$u('The `removeWidgets` method expects an array of widgets.'));\n        }\n        if (widgets.some(function (widget) {\n          return typeof widget.dispose !== 'function';\n        })) {\n          throw new Error(withUsage$u('The widget definition expects a `dispose` method.'));\n        }\n        localWidgets = localWidgets.filter(function (widget) {\n          return widgets.indexOf(widget) === -1;\n        });\n        localWidgets.forEach(function (widget) {\n          if (isIndexWidget(widget)) {\n            return;\n          }\n          if (localInstantSearchInstance && widget.dependsOn === 'recommend') {\n            localInstantSearchInstance._hasRecommendWidget = true;\n          } else if (localInstantSearchInstance) {\n            localInstantSearchInstance._hasSearchWidget = true;\n          } else if (widget.dependsOn === 'recommend') {\n            hasRecommendWidget = true;\n          } else {\n            hasSearchWidget = true;\n          }\n        });\n        if (localInstantSearchInstance && Boolean(widgets.length)) {\n          var _widgets$reduce = widgets.reduce(function (states, widget) {\n              // the `dispose` method exists at this point we already assert it\n              var next = widget.dispose({\n                helper: helper,\n                state: states.cleanedSearchState,\n                recommendState: states.cleanedRecommendState,\n                parent: _this2\n              });\n              if (next instanceof algoliasearchHelper_1.RecommendParameters) {\n                states.cleanedRecommendState = next;\n              } else if (next) {\n                states.cleanedSearchState = next;\n              }\n              return states;\n            }, {\n              cleanedSearchState: helper.state,\n              cleanedRecommendState: helper.recommendState\n            }),\n            cleanedSearchState = _widgets$reduce.cleanedSearchState,\n            cleanedRecommendState = _widgets$reduce.cleanedRecommendState;\n          var newState = localInstantSearchInstance.future.preserveSharedStateOnUnmount ? getLocalWidgetsSearchParameters(localWidgets, {\n            uiState: localUiState,\n            initialSearchParameters: new algoliasearchHelper_1.SearchParameters({\n              index: this.getIndexName()\n            })\n          }) : getLocalWidgetsSearchParameters(localWidgets, {\n            uiState: getLocalWidgetsUiState(localWidgets, {\n              searchParameters: cleanedSearchState,\n              helper: helper\n            }),\n            initialSearchParameters: cleanedSearchState\n          });\n          localUiState = getLocalWidgetsUiState(localWidgets, {\n            searchParameters: newState,\n            helper: helper\n          });\n          helper.setState(newState);\n          helper.recommendState = cleanedRecommendState;\n          if (localWidgets.length) {\n            localInstantSearchInstance.scheduleSearch();\n          }\n        }\n        return this;\n      },\n      init: function init(_ref2) {\n        var _this3 = this,\n          _instantSearchInstanc;\n        var instantSearchInstance = _ref2.instantSearchInstance,\n          parent = _ref2.parent,\n          uiState = _ref2.uiState;\n        if (helper !== null) {\n          // helper is already initialized, therefore we do not need to set up\n          // any listeners\n          return;\n        }\n        localInstantSearchInstance = instantSearchInstance;\n        localParent = parent;\n        localUiState = uiState[indexId] || {};\n\n        // The `mainHelper` is already defined at this point. The instance is created\n        // inside InstantSearch at the `start` method, which occurs before the `init`\n        // step.\n        var mainHelper = instantSearchInstance.mainHelper;\n        var parameters = getLocalWidgetsSearchParameters(localWidgets, {\n          uiState: localUiState,\n          initialSearchParameters: new algoliasearchHelper_1.SearchParameters({\n            index: indexName\n          })\n        });\n        var recommendParameters = getLocalWidgetsRecommendParameters(localWidgets, {\n          uiState: localUiState,\n          initialRecommendParameters: new algoliasearchHelper_1.RecommendParameters()\n        });\n\n        // This Helper is only used for state management we do not care about the\n        // `searchClient`. Only the \"main\" Helper created at the `InstantSearch`\n        // level is aware of the client.\n        helper = algoliasearchHelper_1({}, parameters.index, parameters);\n        helper.recommendState = recommendParameters;\n\n        // We forward the call to `search` to the \"main\" instance of the Helper\n        // which is responsible for managing the queries (it's the only one that is\n        // aware of the `searchClient`).\n        helper.search = function () {\n          if (instantSearchInstance.onStateChange) {\n            instantSearchInstance.onStateChange({\n              uiState: instantSearchInstance.mainIndex.getWidgetUiState({}),\n              setUiState: function setUiState(nextState) {\n                return instantSearchInstance.setUiState(nextState, false);\n              }\n            });\n\n            // We don't trigger a search when controlled because it becomes the\n            // responsibility of `setUiState`.\n            return mainHelper;\n          }\n          return mainHelper.search();\n        };\n        helper.searchWithoutTriggeringOnStateChange = function () {\n          return mainHelper.search();\n        };\n\n        // We use the same pattern for the `searchForFacetValues`.\n        helper.searchForFacetValues = function (facetName, facetValue, maxFacetHits, userState) {\n          var state = helper.state.setQueryParameters(userState);\n          return mainHelper.searchForFacetValues(facetName, facetValue, maxFacetHits, state);\n        };\n        derivedHelper = mainHelper.derive(function () {\n          return mergeSearchParameters.apply(void 0, [mainHelper.state].concat(_toConsumableArray(resolveSearchParameters(_this3))));\n        }, function () {\n          return _this3.getHelper().recommendState;\n        });\n        var indexInitialResults = (_instantSearchInstanc = instantSearchInstance._initialResults) === null || _instantSearchInstanc === void 0 ? void 0 : _instantSearchInstanc[this.getIndexId()];\n        if (indexInitialResults !== null && indexInitialResults !== void 0 && indexInitialResults.results) {\n          // We restore the shape of the results provided to the instance to respect\n          // the helper's structure.\n          var results = new algoliasearchHelper_1.SearchResults(new algoliasearchHelper_1.SearchParameters(indexInitialResults.state), indexInitialResults.results);\n          derivedHelper.lastResults = results;\n          helper.lastResults = results;\n        }\n        if (indexInitialResults !== null && indexInitialResults !== void 0 && indexInitialResults.recommendResults) {\n          var recommendResults = new algoliasearchHelper_1.RecommendResults(new algoliasearchHelper_1.RecommendParameters({\n            params: indexInitialResults.recommendResults.params\n          }), indexInitialResults.recommendResults.results);\n          derivedHelper.lastRecommendResults = recommendResults;\n          helper.lastRecommendResults = recommendResults;\n        }\n\n        // Subscribe to the Helper state changes for the page before widgets\n        // are initialized. This behavior mimics the original one of the Helper.\n        // It makes sense to replicate it at the `init` step. We have another\n        // listener on `change` below, once `init` is done.\n        helper.on('change', function (_ref3) {\n          var isPageReset = _ref3.isPageReset;\n          if (isPageReset) {\n            resetPageFromWidgets(localWidgets);\n          }\n        });\n        derivedHelper.on('search', function () {\n          // The index does not manage the \"staleness\" of the search. This is the\n          // responsibility of the main instance. It does not make sense to manage\n          // it at the index level because it's either: all of them or none of them\n          // that are stalled. The queries are performed into a single network request.\n          instantSearchInstance.scheduleStalledRender();\n          {\n            checkIndexUiState({\n              index: _this3,\n              indexUiState: localUiState\n            });\n          }\n        });\n        derivedHelper.on('result', function (_ref4) {\n          var results = _ref4.results;\n          // The index does not render the results it schedules a new render\n          // to let all the other indices emit their own results. It allows us to\n          // run the render process in one pass.\n          instantSearchInstance.scheduleRender();\n\n          // the derived helper is the one which actually searches, but the helper\n          // which is exposed e.g. via instance.helper, doesn't search, and thus\n          // does not have access to lastResults, which it used to in pre-federated\n          // search behavior.\n          helper.lastResults = results;\n          lastValidSearchParameters = results === null || results === void 0 ? void 0 : results._state;\n        });\n\n        // eslint-disable-next-line no-warning-comments\n        // TODO: listen to \"result\" event when events for Recommend are implemented\n        derivedHelper.on('recommend:result', function (_ref5) {\n          var recommend = _ref5.recommend;\n          // The index does not render the results it schedules a new render\n          // to let all the other indices emit their own results. It allows us to\n          // run the render process in one pass.\n          instantSearchInstance.scheduleRender();\n\n          // the derived helper is the one which actually searches, but the helper\n          // which is exposed e.g. via instance.helper, doesn't search, and thus\n          // does not have access to lastRecommendResults.\n          helper.lastRecommendResults = recommend.results;\n        });\n\n        // We compute the render state before calling `init` in a separate loop\n        // to construct the whole render state object that is then passed to\n        // `init`.\n        localWidgets.forEach(function (widget) {\n          if (widget.getRenderState) {\n            var renderState = widget.getRenderState(instantSearchInstance.renderState[_this3.getIndexId()] || {}, createInitArgs(instantSearchInstance, _this3, uiState));\n            storeRenderState({\n              renderState: renderState,\n              instantSearchInstance: instantSearchInstance,\n              parent: _this3\n            });\n          }\n        });\n        localWidgets.forEach(function (widget) {\n           _warning(\n          // if it has NO getWidgetState or if it has getWidgetUiState, we don't warn\n          // aka we warn if there's _only_ getWidgetState\n          !widget.getWidgetState || Boolean(widget.getWidgetUiState), 'The `getWidgetState` method is renamed `getWidgetUiState` and will no longer exist under that name in InstantSearch.js 5.x. Please use `getWidgetUiState` instead.') ;\n          if (widget.init) {\n            widget.init(createInitArgs(instantSearchInstance, _this3, uiState));\n          }\n        });\n\n        // Subscribe to the Helper state changes for the `uiState` once widgets\n        // are initialized. Until the first render, state changes are part of the\n        // configuration step. This is mainly for backward compatibility with custom\n        // widgets. When the subscription happens before the `init` step, the (static)\n        // configuration of the widget is pushed in the URL. That's what we want to avoid.\n        // https://github.com/algolia/instantsearch/pull/994/commits/4a672ae3fd78809e213de0368549ef12e9dc9454\n        helper.on('change', function (event) {\n          var state = event.state;\n          var _uiState = event._uiState;\n          localUiState = getLocalWidgetsUiState(localWidgets, {\n            searchParameters: state,\n            helper: helper\n          }, _uiState || {});\n\n          // We don't trigger an internal change when controlled because it\n          // becomes the responsibility of `setUiState`.\n          if (!instantSearchInstance.onStateChange) {\n            instantSearchInstance.onInternalStateChange();\n          }\n        });\n        if (indexInitialResults) {\n          // If there are initial results, we're not notified of the next results\n          // because we don't trigger an initial search. We therefore need to directly\n          // schedule a render that will render the results injected on the helper.\n          instantSearchInstance.scheduleRender();\n        }\n        if (hasRecommendWidget) {\n          instantSearchInstance._hasRecommendWidget = true;\n        }\n        if (hasSearchWidget) {\n          instantSearchInstance._hasSearchWidget = true;\n        }\n      },\n      render: function render(_ref6) {\n        var _derivedHelper2,\n          _this4 = this;\n        var instantSearchInstance = _ref6.instantSearchInstance;\n        // we can't attach a listener to the error event of search, as the error\n        // then would no longer be thrown for global handlers.\n        if (instantSearchInstance.status === 'error' && !instantSearchInstance.mainHelper.hasPendingRequests() && lastValidSearchParameters) {\n          helper.setState(lastValidSearchParameters);\n        }\n\n        // We only render index widgets if there are no results.\n        // This makes sure `render` is never called with `results` being `null`.\n        var widgetsToRender = this.getResults() || (_derivedHelper2 = derivedHelper) !== null && _derivedHelper2 !== void 0 && _derivedHelper2.lastRecommendResults ? localWidgets : localWidgets.filter(isIndexWidget);\n        widgetsToRender = widgetsToRender.filter(function (widget) {\n          if (!widget.shouldRender) {\n            return true;\n          }\n          return widget.shouldRender({\n            instantSearchInstance: instantSearchInstance\n          });\n        });\n        widgetsToRender.forEach(function (widget) {\n          if (widget.getRenderState) {\n            var renderState = widget.getRenderState(instantSearchInstance.renderState[_this4.getIndexId()] || {}, createRenderArgs(instantSearchInstance, _this4, widget));\n            storeRenderState({\n              renderState: renderState,\n              instantSearchInstance: instantSearchInstance,\n              parent: _this4\n            });\n          }\n        });\n        widgetsToRender.forEach(function (widget) {\n          // At this point, all the variables used below are set. Both `helper`\n          // and `derivedHelper` have been created at the `init` step. The attribute\n          // `lastResults` might be `null` though. It's possible that a stalled render\n          // happens before the result e.g with a dynamically added index the request might\n          // be delayed. The render is triggered for the complete tree but some parts do\n          // not have results yet.\n\n          if (widget.render) {\n            widget.render(createRenderArgs(instantSearchInstance, _this4, widget));\n          }\n        });\n      },\n      dispose: function dispose() {\n        var _this5 = this,\n          _helper2,\n          _derivedHelper3;\n        localWidgets.forEach(function (widget) {\n          if (widget.dispose && helper) {\n            // The dispose function is always called once the instance is started\n            // (it's an effect of `removeWidgets`). The index is initialized and\n            // the Helper is available. We don't care about the return value of\n            // `dispose` because the index is removed. We can't call `removeWidgets`\n            // because we want to keep the widgets on the instance, to allow idempotent\n            // operations on `add` & `remove`.\n            widget.dispose({\n              helper: helper,\n              state: helper.state,\n              recommendState: helper.recommendState,\n              parent: _this5\n            });\n          }\n        });\n        localInstantSearchInstance = null;\n        localParent = null;\n        (_helper2 = helper) === null || _helper2 === void 0 ? void 0 : _helper2.removeAllListeners();\n        helper = null;\n        (_derivedHelper3 = derivedHelper) === null || _derivedHelper3 === void 0 ? void 0 : _derivedHelper3.detach();\n        derivedHelper = null;\n      },\n      getWidgetUiState: function getWidgetUiState(uiState) {\n        return localWidgets.filter(isIndexWidget).reduce(function (previousUiState, innerIndex) {\n          return innerIndex.getWidgetUiState(previousUiState);\n        }, _objectSpread2(_objectSpread2({}, uiState), {}, _defineProperty({}, indexId, _objectSpread2(_objectSpread2({}, uiState[indexId]), localUiState))));\n      },\n      getWidgetState: function getWidgetState(uiState) {\n         _warning(false, 'The `getWidgetState` method is renamed `getWidgetUiState` and will no longer exist under that name in InstantSearch.js 5.x. Please use `getWidgetUiState` instead.') ;\n        return this.getWidgetUiState(uiState);\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref7) {\n        var uiState = _ref7.uiState;\n        return getLocalWidgetsSearchParameters(localWidgets, {\n          uiState: uiState,\n          initialSearchParameters: searchParameters\n        });\n      },\n      refreshUiState: function refreshUiState() {\n        localUiState = getLocalWidgetsUiState(localWidgets, {\n          searchParameters: this.getHelper().state,\n          helper: this.getHelper()\n        }, localUiState);\n      },\n      setIndexUiState: function setIndexUiState(indexUiState) {\n        var nextIndexUiState = typeof indexUiState === 'function' ? indexUiState(localUiState) : indexUiState;\n        localInstantSearchInstance.setUiState(function (state) {\n          return _objectSpread2(_objectSpread2({}, state), {}, _defineProperty({}, indexId, nextIndexUiState));\n        });\n      }\n    };\n  };\n  function storeRenderState(_ref8) {\n    var renderState = _ref8.renderState,\n      instantSearchInstance = _ref8.instantSearchInstance,\n      parent = _ref8.parent;\n    var parentIndexName = parent ? parent.getIndexId() : instantSearchInstance.mainIndex.getIndexId();\n    instantSearchInstance.renderState = _objectSpread2(_objectSpread2({}, instantSearchInstance.renderState), {}, _defineProperty({}, parentIndexName, _objectSpread2(_objectSpread2({}, instantSearchInstance.renderState[parentIndexName]), renderState)));\n  }\n\n  function formatNumber(value, numberLocale) {\n    return value.toLocaleString(numberLocale);\n  }\n\n  function hoganHelpers(_ref) {\n    var numberLocale = _ref.numberLocale;\n    return {\n      formatNumber: function formatNumber$1(value, render) {\n        return formatNumber(Number(render(value)), numberLocale);\n      },\n      highlight: function highlight$1(options, render) {\n        try {\n          var highlightOptions = JSON.parse(options);\n          return render(highlight(_objectSpread2(_objectSpread2({}, highlightOptions), {}, {\n            hit: this\n          })));\n        } catch (error) {\n          throw new Error(\"\\nThe highlight helper expects a JSON object of the format:\\n{ \\\"attribute\\\": \\\"name\\\", \\\"highlightedTagName\\\": \\\"mark\\\" }\");\n        }\n      },\n      reverseHighlight: function reverseHighlight$1(options, render) {\n        try {\n          var reverseHighlightOptions = JSON.parse(options);\n          return render(reverseHighlight(_objectSpread2(_objectSpread2({}, reverseHighlightOptions), {}, {\n            hit: this\n          })));\n        } catch (error) {\n          throw new Error(\"\\n  The reverseHighlight helper expects a JSON object of the format:\\n  { \\\"attribute\\\": \\\"name\\\", \\\"highlightedTagName\\\": \\\"mark\\\" }\");\n        }\n      },\n      snippet: function snippet$1(options, render) {\n        try {\n          var snippetOptions = JSON.parse(options);\n          return render(snippet(_objectSpread2(_objectSpread2({}, snippetOptions), {}, {\n            hit: this\n          })));\n        } catch (error) {\n          throw new Error(\"\\nThe snippet helper expects a JSON object of the format:\\n{ \\\"attribute\\\": \\\"name\\\", \\\"highlightedTagName\\\": \\\"mark\\\" }\");\n        }\n      },\n      reverseSnippet: function reverseSnippet$1(options, render) {\n        try {\n          var reverseSnippetOptions = JSON.parse(options);\n          return render(reverseSnippet(_objectSpread2(_objectSpread2({}, reverseSnippetOptions), {}, {\n            hit: this\n          })));\n        } catch (error) {\n          throw new Error(\"\\n  The reverseSnippet helper expects a JSON object of the format:\\n  { \\\"attribute\\\": \\\"name\\\", \\\"highlightedTagName\\\": \\\"mark\\\" }\");\n        }\n      },\n      insights: function insights$1(options, render) {\n        try {\n          var _JSON$parse = JSON.parse(options),\n            method = _JSON$parse.method,\n            payload = _JSON$parse.payload;\n          return render(insights(method, _objectSpread2({\n            objectIDs: [this.objectID]\n          }, payload)));\n        } catch (error) {\n          throw new Error(\"\\nThe insights helper expects a JSON object of the format:\\n{ \\\"method\\\": \\\"method-name\\\", \\\"payload\\\": { \\\"eventName\\\": \\\"name of the event\\\" } }\");\n        }\n      }\n    };\n  }\n\n  var version$1 = '4.78.3';\n\n  var withUsage$v = createDocumentationMessageGenerator({\n    name: 'instantsearch'\n  });\n  function defaultCreateURL() {\n    return '#';\n  }\n\n  // this purposely breaks typescript's type inference to ensure it's not used\n  // as it's used for a default parameter for example\n  // source: https://github.com/Microsoft/TypeScript/issues/14829#issuecomment-504042546\n\n  /**\n   * Global options for an InstantSearch instance.\n   */\n\n  var INSTANTSEARCH_FUTURE_DEFAULTS = {\n    preserveSharedStateOnUnmount: false,\n    persistHierarchicalRootCount: false\n  };\n\n  /**\n   * The actual implementation of the InstantSearch. This is\n   * created using the `instantsearch` factory function.\n   * It emits the 'render' event every time a search is done\n   */\n  var InstantSearch = /*#__PURE__*/function (_EventEmitter) {\n    _inherits(InstantSearch, _EventEmitter);\n    var _super = _createSuper(InstantSearch);\n    function InstantSearch(options) {\n      var _options$future2;\n      var _this;\n      _classCallCheck(this, InstantSearch);\n      _this = _super.call(this);\n\n      // prevent `render` event listening from causing a warning\n      _defineProperty(_assertThisInitialized(_this), \"client\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"indexName\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"compositionID\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"insightsClient\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"onStateChange\", null);\n      _defineProperty(_assertThisInitialized(_this), \"future\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"helper\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"mainHelper\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"mainIndex\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"started\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"templatesConfig\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"renderState\", {});\n      _defineProperty(_assertThisInitialized(_this), \"_stalledSearchDelay\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"_searchStalledTimer\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"_initialUiState\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"_initialResults\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"_createURL\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"_searchFunction\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"_mainHelperSearch\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"_hasSearchWidget\", false);\n      _defineProperty(_assertThisInitialized(_this), \"_hasRecommendWidget\", false);\n      _defineProperty(_assertThisInitialized(_this), \"_insights\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"middleware\", []);\n      _defineProperty(_assertThisInitialized(_this), \"sendEventToInsights\", void 0);\n      /**\n       * The status of the search. Can be \"idle\", \"loading\", \"stalled\", or \"error\".\n       */\n      _defineProperty(_assertThisInitialized(_this), \"status\", 'idle');\n      /**\n       * The last returned error from the Search API.\n       * The error gets cleared when the next valid search response is rendered.\n       */\n      _defineProperty(_assertThisInitialized(_this), \"error\", undefined);\n      _defineProperty(_assertThisInitialized(_this), \"scheduleSearch\", defer(function () {\n        if (_this.started) {\n          _this.mainHelper.search();\n        }\n      }));\n      _defineProperty(_assertThisInitialized(_this), \"scheduleRender\", defer(function () {\n        var _this$mainHelper;\n        var shouldResetStatus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n        if (!((_this$mainHelper = _this.mainHelper) !== null && _this$mainHelper !== void 0 && _this$mainHelper.hasPendingRequests())) {\n          clearTimeout(_this._searchStalledTimer);\n          _this._searchStalledTimer = null;\n          if (shouldResetStatus) {\n            _this.status = 'idle';\n            _this.error = undefined;\n          }\n        }\n        _this.mainIndex.render({\n          instantSearchInstance: _assertThisInitialized(_this)\n        });\n        _this.emit('render');\n      }));\n      _defineProperty(_assertThisInitialized(_this), \"onInternalStateChange\", defer(function () {\n        var nextUiState = _this.mainIndex.getWidgetUiState({});\n        _this.middleware.forEach(function (_ref) {\n          var instance = _ref.instance;\n          instance.onStateChange({\n            uiState: nextUiState\n          });\n        });\n      }));\n      _this.setMaxListeners(100);\n      var _options$indexName = options.indexName,\n        indexName = _options$indexName === void 0 ? '' : _options$indexName,\n        compositionID = options.compositionID,\n        numberLocale = options.numberLocale,\n        _options$initialUiSta = options.initialUiState,\n        initialUiState = _options$initialUiSta === void 0 ? {} : _options$initialUiSta,\n        _options$routing = options.routing,\n        routing = _options$routing === void 0 ? null : _options$routing,\n        _options$insights = options.insights,\n        insights = _options$insights === void 0 ? undefined : _options$insights,\n        searchFunction = options.searchFunction,\n        _options$stalledSearc = options.stalledSearchDelay,\n        stalledSearchDelay = _options$stalledSearc === void 0 ? 200 : _options$stalledSearc,\n        _options$searchClient = options.searchClient,\n        searchClient = _options$searchClient === void 0 ? null : _options$searchClient,\n        _options$insightsClie = options.insightsClient,\n        insightsClient = _options$insightsClie === void 0 ? null : _options$insightsClie,\n        _options$onStateChang = options.onStateChange,\n        onStateChange = _options$onStateChang === void 0 ? null : _options$onStateChang,\n        _options$future = options.future,\n        future = _options$future === void 0 ? _objectSpread2(_objectSpread2({}, INSTANTSEARCH_FUTURE_DEFAULTS), options.future || {}) : _options$future;\n      if (searchClient === null) {\n        throw new Error(withUsage$v('The `searchClient` option is required.'));\n      }\n      if (typeof searchClient.search !== 'function') {\n        throw new Error(\"The `searchClient` must implement a `search` method.\\n\\nSee: https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/backend-instantsearch/js/\");\n      }\n      if (typeof searchClient.addAlgoliaAgent === 'function') {\n        searchClient.addAlgoliaAgent(\"instantsearch.js (\".concat(version$1, \")\"));\n      }\n       _warning(insightsClient === null, \"`insightsClient` property has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `insights` middleware.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\") ;\n      if (insightsClient && typeof insightsClient !== 'function') {\n        throw new Error(withUsage$v('The `insightsClient` option should be a function.'));\n      }\n       _warning(!options.searchParameters, \"The `searchParameters` option is deprecated and will not be supported in InstantSearch.js 4.x.\\n\\nYou can replace it with the `configure` widget:\\n\\n```\\nsearch.addWidgets([\\n  configure(\".concat(JSON.stringify(options.searchParameters, null, 2), \")\\n]);\\n```\\n\\nSee \").concat(createDocumentationLink({\n        name: 'configure'\n      }))) ;\n      if ( ((_options$future2 = options.future) === null || _options$future2 === void 0 ? void 0 : _options$future2.preserveSharedStateOnUnmount) === undefined) {\n        // eslint-disable-next-line no-console\n        console.info(\"Starting from the next major version, InstantSearch will change how widgets state is preserved when they are removed. InstantSearch will keep the state of unmounted widgets to be usable by other widgets with the same attribute.\\n\\nWe recommend setting `future.preserveSharedStateOnUnmount` to true to adopt this change today.\\nTo stay with the current behaviour and remove this warning, set the option to false.\\n\\nSee documentation: \".concat(createDocumentationLink({\n          name: 'instantsearch'\n        }), \"#widget-param-future\\n          \"));\n      }\n      _this.client = searchClient;\n      _this.future = future;\n      _this.insightsClient = insightsClient;\n      _this.indexName = indexName;\n      _this.compositionID = compositionID;\n      _this.helper = null;\n      _this.mainHelper = null;\n      _this.mainIndex = index({\n        // we use an index widget to render compositions\n        // this only works because there's only one composition index allow for now\n        indexName: _this.compositionID || _this.indexName\n      });\n      _this.onStateChange = onStateChange;\n      _this.started = false;\n      _this.templatesConfig = {\n        helpers: hoganHelpers({\n          numberLocale: numberLocale\n        }),\n        compileOptions: {}\n      };\n      _this._stalledSearchDelay = stalledSearchDelay;\n      _this._searchStalledTimer = null;\n      _this._createURL = defaultCreateURL;\n      _this._initialUiState = initialUiState;\n      _this._initialResults = null;\n      _this._insights = insights;\n      if (searchFunction) {\n         _warning(false, \"The `searchFunction` option is deprecated. Use `onStateChange` instead.\") ;\n        _this._searchFunction = searchFunction;\n      }\n      _this.sendEventToInsights = noop;\n      if (routing) {\n        var routerOptions = typeof routing === 'boolean' ? {} : routing;\n        routerOptions.$$internal = true;\n        _this.use(createRouterMiddleware(routerOptions));\n      }\n\n      // This is the default Insights middleware,\n      // added when `insights` is set to true by the user.\n      // Any user-provided middleware will be added later and override this one.\n      if (insights) {\n        var insightsOptions = typeof insights === 'boolean' ? {} : insights;\n        insightsOptions.$$internal = true;\n        _this.use(createInsightsMiddleware(insightsOptions));\n      }\n      if (isMetadataEnabled()) {\n        _this.use(createMetadataMiddleware({\n          $$internal: true\n        }));\n      }\n      return _this;\n    }\n\n    /**\n     * Hooks a middleware into the InstantSearch lifecycle.\n     */\n    _createClass(InstantSearch, [{\n      key: \"_isSearchStalled\",\n      get:\n      /**\n       * @deprecated use `status === 'stalled'` instead\n       */\n      function get() {\n         _warning(false, \"`InstantSearch._isSearchStalled` is deprecated and will be removed in InstantSearch.js 5.0.\\n\\nUse `InstantSearch.status === \\\"stalled\\\"` instead.\") ;\n        return this.status === 'stalled';\n      }\n    }, {\n      key: \"use\",\n      value: function use() {\n        var _this2 = this;\n        for (var _len = arguments.length, middleware = new Array(_len), _key = 0; _key < _len; _key++) {\n          middleware[_key] = arguments[_key];\n        }\n        var newMiddlewareList = middleware.map(function (fn) {\n          var newMiddleware = _objectSpread2({\n            $$type: '__unknown__',\n            $$internal: false,\n            subscribe: noop,\n            started: noop,\n            unsubscribe: noop,\n            onStateChange: noop\n          }, fn({\n            instantSearchInstance: _this2\n          }));\n          _this2.middleware.push({\n            creator: fn,\n            instance: newMiddleware\n          });\n          return newMiddleware;\n        });\n\n        // If the instance has already started, we directly subscribe the\n        // middleware so they're notified of changes.\n        if (this.started) {\n          newMiddlewareList.forEach(function (m) {\n            m.subscribe();\n            m.started();\n          });\n        }\n        return this;\n      }\n\n      /**\n       * Removes a middleware from the InstantSearch lifecycle.\n       */\n    }, {\n      key: \"unuse\",\n      value: function unuse() {\n        for (var _len2 = arguments.length, middlewareToUnuse = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n          middlewareToUnuse[_key2] = arguments[_key2];\n        }\n        this.middleware.filter(function (m) {\n          return middlewareToUnuse.includes(m.creator);\n        }).forEach(function (m) {\n          return m.instance.unsubscribe();\n        });\n        this.middleware = this.middleware.filter(function (m) {\n          return !middlewareToUnuse.includes(m.creator);\n        });\n        return this;\n      }\n\n      // @major we shipped with EXPERIMENTAL_use, but have changed that to just `use` now\n    }, {\n      key: \"EXPERIMENTAL_use\",\n      value: function EXPERIMENTAL_use() {\n         _warning(false, 'The middleware API is now considered stable, so we recommend replacing `EXPERIMENTAL_use` with `use` before upgrading to the next major version.') ;\n        return this.use.apply(this, arguments);\n      }\n\n      /**\n       * Adds a widget to the search instance.\n       * A widget can be added either before or after InstantSearch has started.\n       * @param widget The widget to add to InstantSearch.\n       *\n       * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `addWidgets([widget])`.\n       */\n    }, {\n      key: \"addWidget\",\n      value: function addWidget(widget) {\n         _warning(false, 'addWidget will still be supported in 4.x releases, but not further. It is replaced by `addWidgets([widget])`') ;\n        return this.addWidgets([widget]);\n      }\n\n      /**\n       * Adds multiple widgets to the search instance.\n       * Widgets can be added either before or after InstantSearch has started.\n       * @param widgets The array of widgets to add to InstantSearch.\n       */\n    }, {\n      key: \"addWidgets\",\n      value: function addWidgets(widgets) {\n        if (!Array.isArray(widgets)) {\n          throw new Error(withUsage$v('The `addWidgets` method expects an array of widgets. Please use `addWidget`.'));\n        }\n        if (widgets.some(function (widget) {\n          return typeof widget.init !== 'function' && typeof widget.render !== 'function';\n        })) {\n          throw new Error(withUsage$v('The widget definition expects a `render` and/or an `init` method.'));\n        }\n        if (this.compositionID && widgets.some(isIndexWidget)) {\n          throw new Error(withUsage$v('The `index` widget cannot be used with a composition-based InstantSearch implementation.'));\n        }\n        this.mainIndex.addWidgets(widgets);\n        return this;\n      }\n\n      /**\n       * Removes a widget from the search instance.\n       * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `removeWidgets([widget])`\n       * @param widget The widget instance to remove from InstantSearch.\n       *\n       * The widget must implement a `dispose()` method to clear its state.\n       */\n    }, {\n      key: \"removeWidget\",\n      value: function removeWidget(widget) {\n         _warning(false, 'removeWidget will still be supported in 4.x releases, but not further. It is replaced by `removeWidgets([widget])`') ;\n        return this.removeWidgets([widget]);\n      }\n\n      /**\n       * Removes multiple widgets from the search instance.\n       * @param widgets Array of widgets instances to remove from InstantSearch.\n       *\n       * The widgets must implement a `dispose()` method to clear their states.\n       */\n    }, {\n      key: \"removeWidgets\",\n      value: function removeWidgets(widgets) {\n        if (!Array.isArray(widgets)) {\n          throw new Error(withUsage$v('The `removeWidgets` method expects an array of widgets. Please use `removeWidget`.'));\n        }\n        if (widgets.some(function (widget) {\n          return typeof widget.dispose !== 'function';\n        })) {\n          throw new Error(withUsage$v('The widget definition expects a `dispose` method.'));\n        }\n        this.mainIndex.removeWidgets(widgets);\n        return this;\n      }\n\n      /**\n       * Ends the initialization of InstantSearch.js and triggers the\n       * first search.\n       */\n    }, {\n      key: \"start\",\n      value: function start() {\n        var _this3 = this;\n        if (this.started) {\n          throw new Error(withUsage$v('The `start` method has already been called once.'));\n        }\n\n        // This Helper is used for the queries, we don't care about its state. The\n        // states are managed at the `index` level. We use this Helper to create\n        // DerivedHelper scoped into the `index` widgets.\n        // In Vue InstantSearch' hydrate, a main helper gets set before start, so\n        // we need to respect this helper as a way to keep all listeners correct.\n        var mainHelper = this.mainHelper || algoliasearchHelper_1(this.client, this.indexName, undefined, {\n          persistHierarchicalRootCount: this.future.persistHierarchicalRootCount\n        });\n        if (this.compositionID) {\n          mainHelper.searchForFacetValues = mainHelper.searchForCompositionFacetValues.bind(mainHelper);\n        }\n        mainHelper.search = function () {\n          _this3.status = 'loading';\n          _this3.scheduleRender(false);\n           _warning(Boolean(_this3.indexName) || Boolean(_this3.compositionID) || _this3.mainIndex.getWidgets().some(isIndexWidget), 'No indexName provided, nor an explicit index widget in the widgets tree. This is required to be able to display results.') ;\n\n          // This solution allows us to keep the exact same API for the users but\n          // under the hood, we have a different implementation. It should be\n          // completely transparent for the rest of the codebase. Only this module\n          // is impacted.\n          if (_this3._hasSearchWidget) {\n            if (_this3.compositionID) {\n              mainHelper.searchWithComposition();\n            } else {\n              mainHelper.searchOnlyWithDerivedHelpers();\n            }\n          }\n          if (_this3._hasRecommendWidget) {\n            mainHelper.recommend();\n          }\n          return mainHelper;\n        };\n        if (this._searchFunction) {\n          // this client isn't used to actually search, but required for the helper\n          // to not throw errors\n          var fakeClient = {\n            search: function search() {\n              return new Promise(noop);\n            }\n          };\n          this._mainHelperSearch = mainHelper.search.bind(mainHelper);\n          mainHelper.search = function () {\n            var mainIndexHelper = _this3.mainIndex.getHelper();\n            var searchFunctionHelper = algoliasearchHelper_1(fakeClient, mainIndexHelper.state.index, mainIndexHelper.state);\n            searchFunctionHelper.once('search', function (_ref2) {\n              var state = _ref2.state;\n              mainIndexHelper.overrideStateWithoutTriggeringChangeEvent(state);\n              _this3._mainHelperSearch();\n            });\n            // Forward state changes from `searchFunctionHelper` to `mainIndexHelper`\n            searchFunctionHelper.on('change', function (_ref3) {\n              var state = _ref3.state;\n              mainIndexHelper.setState(state);\n            });\n            _this3._searchFunction(searchFunctionHelper);\n            return mainHelper;\n          };\n        }\n\n        // Only the \"main\" Helper emits the `error` event vs the one for `search`\n        // and `results` that are also emitted on the derived one.\n        mainHelper.on('error', function (_ref4) {\n          var error = _ref4.error;\n          if (!(error instanceof Error)) {\n            // typescript lies here, error is in some cases { name: string, message: string }\n            var err = error;\n            error = Object.keys(err).reduce(function (acc, key) {\n              acc[key] = err[key];\n              return acc;\n            }, new Error(err.message));\n          }\n          // If an error is emitted, it is re-thrown by events. In previous versions\n          // we emitted {error}, which is thrown as:\n          // \"Uncaught, unspecified \\\"error\\\" event. ([object Object])\"\n          // To avoid breaking changes, we make the error available in both\n          // `error` and `error.error`\n          // @MAJOR emit only error\n          error.error = error;\n          _this3.error = error;\n          _this3.status = 'error';\n          _this3.scheduleRender(false);\n\n          // This needs to execute last because it throws the error.\n          _this3.emit('error', error);\n        });\n        this.mainHelper = mainHelper;\n        this.middleware.forEach(function (_ref5) {\n          var instance = _ref5.instance;\n          instance.subscribe();\n        });\n        this.mainIndex.init({\n          instantSearchInstance: this,\n          parent: null,\n          uiState: this._initialUiState\n        });\n        if (this._initialResults) {\n          hydrateSearchClient(this.client, this._initialResults);\n          hydrateRecommendCache(this.mainHelper, this._initialResults);\n          var originalScheduleSearch = this.scheduleSearch;\n          // We don't schedule a first search when initial results are provided\n          // because we already have the results to render. This skips the initial\n          // network request on the browser on `start`.\n          this.scheduleSearch = defer(noop);\n          // We also skip the initial network request when widgets are dynamically\n          // added in the first tick (that's the case in all the framework-based flavors).\n          // When we add a widget to `index`, it calls `scheduleSearch`. We can rely\n          // on our `defer` util to restore the original `scheduleSearch` value once\n          // widgets are added to hook back to the regular lifecycle.\n          defer(function () {\n            _this3.scheduleSearch = originalScheduleSearch;\n          })();\n        }\n        // We only schedule a search when widgets have been added before `start()`\n        // because there are listeners that can use these results.\n        // This is especially useful in framework-based flavors that wait for\n        // dynamically-added widgets to trigger a network request. It avoids\n        // having to batch this initial network request with the one coming from\n        // `addWidgets()`.\n        // Later, we could also skip `index()` widgets and widgets that don't read\n        // the results, but this is an optimization that has a very low impact for now.\n        else if (this.mainIndex.getWidgets().length > 0) {\n          this.scheduleSearch();\n        }\n\n        // Keep the previous reference for legacy purpose, some pattern use\n        // the direct Helper access `search.helper` (e.g multi-index).\n        this.helper = this.mainIndex.getHelper();\n\n        // track we started the search if we add more widgets,\n        // to init them directly after add\n        this.started = true;\n        this.middleware.forEach(function (_ref6) {\n          var instance = _ref6.instance;\n          instance.started();\n        });\n\n        // This is the automatic Insights middleware,\n        // added when `insights` is unset and the initial results possess `queryID`.\n        // Any user-provided middleware will be added later and override this one.\n        if (typeof this._insights === 'undefined') {\n          mainHelper.derivedHelpers[0].once('result', function () {\n            var hasAutomaticInsights = _this3.mainIndex.getScopedResults().some(function (_ref7) {\n              var results = _ref7.results;\n              return results === null || results === void 0 ? void 0 : results._automaticInsights;\n            });\n            if (hasAutomaticInsights) {\n              _this3.use(createInsightsMiddleware({\n                $$internal: true,\n                $$automatic: true\n              }));\n            }\n          });\n        }\n      }\n\n      /**\n       * Removes all widgets without triggering a search afterwards.\n       * @return {undefined} This method does not return anything\n       */\n    }, {\n      key: \"dispose\",\n      value: function dispose() {\n        var _this$mainHelper2;\n        this.scheduleSearch.cancel();\n        this.scheduleRender.cancel();\n        clearTimeout(this._searchStalledTimer);\n        this.removeWidgets(this.mainIndex.getWidgets());\n        this.mainIndex.dispose();\n\n        // You can not start an instance two times, therefore a disposed instance\n        // needs to set started as false otherwise this can not be restarted at a\n        // later point.\n        this.started = false;\n\n        // The helper needs to be reset to perform the next search from a fresh state.\n        // If not reset, it would use the state stored before calling `dispose()`.\n        this.removeAllListeners();\n        (_this$mainHelper2 = this.mainHelper) === null || _this$mainHelper2 === void 0 ? void 0 : _this$mainHelper2.removeAllListeners();\n        this.mainHelper = null;\n        this.helper = null;\n        this.middleware.forEach(function (_ref8) {\n          var instance = _ref8.instance;\n          instance.unsubscribe();\n        });\n      }\n    }, {\n      key: \"scheduleStalledRender\",\n      value: function scheduleStalledRender() {\n        var _this4 = this;\n        if (!this._searchStalledTimer) {\n          this._searchStalledTimer = setTimeout(function () {\n            _this4.status = 'stalled';\n            _this4.scheduleRender();\n          }, this._stalledSearchDelay);\n        }\n      }\n\n      /**\n       * Set the UI state and trigger a search.\n       * @param uiState The next UI state or a function computing it from the current state\n       * @param callOnStateChange private parameter used to know if the method is called from a state change\n       */\n    }, {\n      key: \"setUiState\",\n      value: function setUiState(uiState) {\n        var _this5 = this;\n        var callOnStateChange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n        if (!this.mainHelper) {\n          throw new Error(withUsage$v('The `start` method needs to be called before `setUiState`.'));\n        }\n\n        // We refresh the index UI state to update the local UI state that the\n        // main index passes to the function form of `setUiState`.\n        this.mainIndex.refreshUiState();\n        var nextUiState = typeof uiState === 'function' ? uiState(this.mainIndex.getWidgetUiState({})) : uiState;\n        if (this.onStateChange && callOnStateChange) {\n          this.onStateChange({\n            uiState: nextUiState,\n            setUiState: function setUiState(finalUiState) {\n              setIndexHelperState(typeof finalUiState === 'function' ? finalUiState(nextUiState) : finalUiState, _this5.mainIndex);\n              _this5.scheduleSearch();\n              _this5.onInternalStateChange();\n            }\n          });\n        } else {\n          setIndexHelperState(nextUiState, this.mainIndex);\n          this.scheduleSearch();\n          this.onInternalStateChange();\n        }\n      }\n    }, {\n      key: \"getUiState\",\n      value: function getUiState() {\n        if (this.started) {\n          // We refresh the index UI state to make sure changes from `refine` are taken in account\n          this.mainIndex.refreshUiState();\n        }\n        return this.mainIndex.getWidgetUiState({});\n      }\n    }, {\n      key: \"createURL\",\n      value: function createURL() {\n        var nextState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n        if (!this.started) {\n          throw new Error(withUsage$v('The `start` method needs to be called before `createURL`.'));\n        }\n        return this._createURL(nextState);\n      }\n    }, {\n      key: \"refresh\",\n      value: function refresh() {\n        if (!this.mainHelper) {\n          throw new Error(withUsage$v('The `start` method needs to be called before `refresh`.'));\n        }\n        this.mainHelper.clearCache().search();\n      }\n    }]);\n    return InstantSearch;\n  }(events);\n\n\n\n  var routers = /*#__PURE__*/Object.freeze({\n    __proto__: null,\n    history: historyRouter\n  });\n\n  var _excluded$8 = [\"configure\"];\n  function getIndexStateWithoutConfigure$1(uiState) {\n    var configure = uiState.configure,\n      trackedUiState = _objectWithoutProperties(uiState, _excluded$8);\n    return trackedUiState;\n  }\n  function singleIndexStateMapping(indexName) {\n    return {\n      $$type: 'ais.singleIndex',\n      stateToRoute: function stateToRoute(uiState) {\n        return getIndexStateWithoutConfigure$1(uiState[indexName] || {});\n      },\n      routeToState: function routeToState() {\n        var routeState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n        return _defineProperty({}, indexName, getIndexStateWithoutConfigure$1(routeState));\n      }\n    };\n  }\n\n\n\n  var stateMappings = /*#__PURE__*/Object.freeze({\n    __proto__: null,\n    simple: simpleStateMapping,\n    singleIndex: singleIndexStateMapping\n  });\n\n\n\n  var middlewares = /*#__PURE__*/Object.freeze({\n    __proto__: null,\n    createInsightsMiddleware: createInsightsMiddleware,\n    createRouterMiddleware: createRouterMiddleware,\n    isMetadataEnabled: isMetadataEnabled,\n    createMetadataMiddleware: createMetadataMiddleware\n  });\n\n  var n$1=function(t,s,r,e){var u;s[0]=0;for(var h=1;h<s.length;h++){var p=s[h++],a=s[h]?(s[0]|=p?1:2,r[s[h++]]):s[++h];3===p?e[0]=a:4===p?e[1]=Object.assign(e[1]||{},a):5===p?(e[1]=e[1]||{})[s[++h]]=a:6===p?e[1][s[++h]]+=a+\"\":p?(u=t.apply(a,n$1(t,a,r,[\"\",null])),e.push(u),a[0]?s[0]|=2:(s[h-2]=0,s[h]=u)):e.push(a);}return e},t$1=new Map;function e$1(s){var r=t$1.get(this);return r||(r=new Map,t$1.set(this,r)),(r=n$1(this,r.get(s)||(r.set(s,r=function(n){for(var t,s,r=1,e=\"\",u=\"\",h=[0],p=function(n){1===r&&(n||(e=e.replace(/^\\s*\\n\\s*|\\s*\\n\\s*$/g,\"\")))?h.push(0,n,e):3===r&&(n||e)?(h.push(3,n,e),r=2):2===r&&\"...\"===e&&n?h.push(4,n,0):2===r&&e&&!n?h.push(5,0,!0,e):r>=5&&((e||!n&&5===r)&&(h.push(r,0,e,s),r=6),n&&(h.push(r,n,0,s),r=6)),e=\"\";},a=0;a<n.length;a++){a&&(1===r&&p(),p(a));for(var l=0;l<n[a].length;l++)t=n[a][l],1===r?\"<\"===t?(p(),h=[h],r=3):e+=t:4===r?\"--\"===e&&\">\"===t?(r=1,e=\"\"):e=t+e[0]:u?t===u?u=\"\":e+=t:'\"'===t||\"'\"===t?u=t:\">\"===t?(p(),r=1):r&&(\"=\"===t?(r=5,s=e,e=\"\"):\"/\"===t&&(r<5||\">\"===n[a][l+1])?(p(),3===r&&(h=h[0]),r=h,(h=h[0]).push(2,0,r),r=0):\" \"===t||\"\\t\"===t||\"\\n\"===t||\"\\r\"===t?(p(),r=2):e+=t),3===r&&\"!--\"===e&&(r=4,h=h[0]);}return p(),h}(s)),r),arguments,[])).length>1?r:r[0]}\n\n  var m$1=e$1.bind(h);\n\n  function unwrapExports (x) {\n  \treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n  }\n\n  function createCommonjsModule(fn, module) {\n  \treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n  }\n\n  var _extends_1 = createCommonjsModule(function (module) {\n  function _extends() {\n    module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {\n      for (var i = 1; i < arguments.length; i++) {\n        var source = arguments[i];\n        for (var key in source) {\n          if (Object.prototype.hasOwnProperty.call(source, key)) {\n            target[key] = source[key];\n          }\n        }\n      }\n      return target;\n    }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n    return _extends.apply(this, arguments);\n  }\n  module.exports = _extends, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n  });\n\n  var _extends$1 = unwrapExports(_extends_1);\n\n  var _typeof_1 = createCommonjsModule(function (module) {\n  function _typeof(obj) {\n    \"@babel/helpers - typeof\";\n\n    return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n      return typeof obj;\n    } : function (obj) {\n      return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n    }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n  }\n  module.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n  });\n\n  unwrapExports(_typeof_1);\n\n  var toPrimitive = createCommonjsModule(function (module) {\n  var _typeof = _typeof_1[\"default\"];\n  function _toPrimitive(input, hint) {\n    if (_typeof(input) !== \"object\" || input === null) return input;\n    var prim = input[Symbol.toPrimitive];\n    if (prim !== undefined) {\n      var res = prim.call(input, hint || \"default\");\n      if (_typeof(res) !== \"object\") return res;\n      throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n    }\n    return (hint === \"string\" ? String : Number)(input);\n  }\n  module.exports = _toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n  });\n\n  unwrapExports(toPrimitive);\n\n  var toPropertyKey = createCommonjsModule(function (module) {\n  var _typeof = _typeof_1[\"default\"];\n\n  function _toPropertyKey(arg) {\n    var key = toPrimitive(arg, \"string\");\n    return _typeof(key) === \"symbol\" ? key : String(key);\n  }\n  module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n  });\n\n  unwrapExports(toPropertyKey);\n\n  var defineProperty = createCommonjsModule(function (module) {\n  function _defineProperty(obj, key, value) {\n    key = toPropertyKey(key);\n    if (key in obj) {\n      Object.defineProperty(obj, key, {\n        value: value,\n        enumerable: true,\n        configurable: true,\n        writable: true\n      });\n    } else {\n      obj[key] = value;\n    }\n    return obj;\n  }\n  module.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n  });\n\n  var _defineProperty$1 = unwrapExports(defineProperty);\n\n  var objectWithoutPropertiesLoose = createCommonjsModule(function (module) {\n  function _objectWithoutPropertiesLoose(source, excluded) {\n    if (source == null) return {};\n    var target = {};\n    var sourceKeys = Object.keys(source);\n    var key, i;\n    for (i = 0; i < sourceKeys.length; i++) {\n      key = sourceKeys[i];\n      if (excluded.indexOf(key) >= 0) continue;\n      target[key] = source[key];\n    }\n    return target;\n  }\n  module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n  });\n\n  unwrapExports(objectWithoutPropertiesLoose);\n\n  var objectWithoutProperties = createCommonjsModule(function (module) {\n  function _objectWithoutProperties(source, excluded) {\n    if (source == null) return {};\n    var target = objectWithoutPropertiesLoose(source, excluded);\n    var key, i;\n    if (Object.getOwnPropertySymbols) {\n      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n      for (i = 0; i < sourceSymbolKeys.length; i++) {\n        key = sourceSymbolKeys[i];\n        if (excluded.indexOf(key) >= 0) continue;\n        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n        target[key] = source[key];\n      }\n    }\n    return target;\n  }\n  module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n  });\n\n  var _objectWithoutProperties$1 = unwrapExports(objectWithoutProperties);\n\n  function cx() {\n    for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) {\n      classNames[_key] = arguments[_key];\n    }\n    return classNames.reduce(function (acc, className) {\n      if (Array.isArray(className)) {\n        return acc.concat(className);\n      }\n      return acc.concat([className]);\n    }, []).filter(Boolean).join(' ');\n  }\n\n  function createDefaultEmptyComponent(_ref) {\n    var createElement = _ref.createElement,\n      Fragment = _ref.Fragment;\n    return function DefaultEmpty() {\n      return createElement(Fragment, null, \"No results\");\n    };\n  }\n\n  function createDefaultHeaderComponent(_ref) {\n    var createElement = _ref.createElement;\n    return function DefaultHeader(userProps) {\n      var _userProps$classNames = userProps.classNames,\n        classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,\n        items = userProps.items,\n        translations = userProps.translations;\n      if (!items || items.length < 1) {\n        return null;\n      }\n      if (!translations.title) {\n        return null;\n      }\n      return createElement(\"h3\", {\n        className: classNames.title\n      }, translations.title);\n    };\n  }\n\n  function createDefaultItemComponent(_ref) {\n    var createElement = _ref.createElement,\n      Fragment = _ref.Fragment;\n    return function DefaultItem(userProps) {\n      return createElement(Fragment, null, JSON.stringify(userProps.item, null, 2));\n    };\n  }\n\n  function createListComponent(_ref) {\n    var createElement = _ref.createElement;\n    return function List(userProps) {\n      var _userProps$classNames = userProps.classNames,\n        classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,\n        ItemComponent = userProps.itemComponent,\n        items = userProps.items,\n        sendEvent = userProps.sendEvent;\n      return createElement(\"div\", {\n        className: classNames.container\n      }, createElement(\"ol\", {\n        className: classNames.list\n      }, items.map(function (item) {\n        return createElement(\"li\", {\n          key: item.objectID,\n          className: classNames.item,\n          onClick: function onClick() {\n            sendEvent('click:internal', item, 'Item Clicked');\n          },\n          onAuxClick: function onAuxClick() {\n            sendEvent('click:internal', item, 'Item Clicked');\n          }\n        }, createElement(ItemComponent, {\n          item: item,\n          sendEvent: sendEvent\n        }));\n      })));\n    };\n  }\n\n  var _excluded$9 = [\"listRef\", \"nextButtonRef\", \"previousButtonRef\", \"carouselIdRef\", \"classNames\", \"itemComponent\", \"previousIconComponent\", \"nextIconComponent\", \"items\", \"translations\", \"sendEvent\"];\n  function ownKeys$1(e, r) {\n    var t = Object.keys(e);\n    if (Object.getOwnPropertySymbols) {\n      var o = Object.getOwnPropertySymbols(e);\n      r && (o = o.filter(function (r) {\n        return Object.getOwnPropertyDescriptor(e, r).enumerable;\n      })), t.push.apply(t, o);\n    }\n    return t;\n  }\n  function _objectSpread(e) {\n    for (var r = 1; r < arguments.length; r++) {\n      var t = null != arguments[r] ? arguments[r] : {};\n      r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) {\n        _defineProperty$1(e, r, t[r]);\n      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) {\n        Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n      });\n    }\n    return e;\n  }\n  var lastCarouselId = 0;\n  function generateCarouselId() {\n    return \"ais-Carousel-\".concat(lastCarouselId++);\n  }\n  function PreviousIconDefaultComponent(_ref) {\n    var createElement = _ref.createElement;\n    return createElement(\"svg\", {\n      width: \"8\",\n      height: \"16\",\n      viewBox: \"0 0 8 16\",\n      fill: \"none\"\n    }, createElement(\"path\", {\n      fillRule: \"evenodd\",\n      clipRule: \"evenodd\",\n      fill: \"currentColor\",\n      d: \"M7.13809 0.744078C7.39844 1.06951 7.39844 1.59715 7.13809 1.92259L2.27616 8L7.13809 14.0774C7.39844 14.4028 7.39844 14.9305 7.13809 15.2559C6.87774 15.5814 6.45563 15.5814 6.19528 15.2559L0.861949 8.58926C0.6016 8.26382 0.6016 7.73618 0.861949 7.41074L6.19528 0.744078C6.45563 0.418641 6.87774 0.418641 7.13809 0.744078Z\"\n    }));\n  }\n  function NextIconDefaultComponent(_ref2) {\n    var createElement = _ref2.createElement;\n    return createElement(\"svg\", {\n      width: \"8\",\n      height: \"16\",\n      viewBox: \"0 0 8 16\",\n      fill: \"none\"\n    }, createElement(\"path\", {\n      fillRule: \"evenodd\",\n      clipRule: \"evenodd\",\n      fill: \"currentColor\",\n      d: \"M0.861908 15.2559C0.601559 14.9305 0.601559 14.4028 0.861908 14.0774L5.72384 8L0.861908 1.92259C0.601559 1.59715 0.601559 1.06952 0.861908 0.744079C1.12226 0.418642 1.54437 0.418642 1.80472 0.744079L7.13805 7.41074C7.3984 7.73618 7.3984 8.26382 7.13805 8.58926L1.80472 15.2559C1.54437 15.5814 1.12226 15.5814 0.861908 15.2559Z\"\n    }));\n  }\n  function createCarouselComponent(_ref3) {\n    var createElement = _ref3.createElement,\n      Fragment = _ref3.Fragment;\n    return function Carousel(userProps) {\n      var listRef = userProps.listRef,\n        nextButtonRef = userProps.nextButtonRef,\n        previousButtonRef = userProps.previousButtonRef,\n        carouselIdRef = userProps.carouselIdRef,\n        _userProps$classNames = userProps.classNames,\n        classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,\n        _userProps$itemCompon = userProps.itemComponent,\n        ItemComponent = _userProps$itemCompon === void 0 ? createDefaultItemComponent({\n          createElement: createElement,\n          Fragment: Fragment\n        }) : _userProps$itemCompon,\n        _userProps$previousIc = userProps.previousIconComponent,\n        PreviousIconComponent = _userProps$previousIc === void 0 ? PreviousIconDefaultComponent : _userProps$previousIc,\n        _userProps$nextIconCo = userProps.nextIconComponent,\n        NextIconComponent = _userProps$nextIconCo === void 0 ? NextIconDefaultComponent : _userProps$nextIconCo,\n        items = userProps.items,\n        userTranslations = userProps.translations,\n        sendEvent = userProps.sendEvent,\n        props = _objectWithoutProperties$1(userProps, _excluded$9);\n      var translations = _objectSpread({\n        listLabel: 'Items',\n        nextButtonLabel: 'Next',\n        nextButtonTitle: 'Next',\n        previousButtonLabel: 'Previous',\n        previousButtonTitle: 'Previous'\n      }, userTranslations);\n      var cssClasses = {\n        root: cx('ais-Carousel', classNames.root),\n        list: cx('ais-Carousel-list', classNames.list),\n        item: cx('ais-Carousel-item', classNames.item),\n        navigation: cx('ais-Carousel-navigation', classNames.navigation),\n        navigationNext: cx('ais-Carousel-navigation--next', classNames.navigationNext),\n        navigationPrevious: cx('ais-Carousel-navigation--previous', classNames.navigationPrevious)\n      };\n      function scrollLeft() {\n        if (listRef.current) {\n          listRef.current.scrollLeft -= listRef.current.offsetWidth * 0.75;\n        }\n      }\n      function scrollRight() {\n        if (listRef.current) {\n          listRef.current.scrollLeft += listRef.current.offsetWidth * 0.75;\n        }\n      }\n      function updateNavigationButtonsProps() {\n        if (!listRef.current || !previousButtonRef.current || !nextButtonRef.current) {\n          return;\n        }\n        previousButtonRef.current.hidden = listRef.current.scrollLeft <= 0;\n        nextButtonRef.current.hidden = listRef.current.scrollLeft + listRef.current.clientWidth >= listRef.current.scrollWidth;\n      }\n      if (items.length === 0) {\n        return null;\n      }\n      return createElement(\"div\", _extends$1({}, props, {\n        className: cx(cssClasses.root)\n      }), createElement(\"button\", {\n        ref: previousButtonRef,\n        title: translations.previousButtonTitle,\n        \"aria-label\": translations.previousButtonLabel,\n        hidden: true,\n        \"aria-controls\": carouselIdRef.current,\n        className: cx(cssClasses.navigation, cssClasses.navigationPrevious),\n        onClick: function onClick(event) {\n          event.preventDefault();\n          scrollLeft();\n        }\n      }, createElement(PreviousIconComponent, {\n        createElement: createElement\n      })), createElement(\"ol\", {\n        className: cx(cssClasses.list),\n        ref: listRef,\n        tabIndex: 0,\n        id: carouselIdRef.current,\n        \"aria-roledescription\": \"carousel\",\n        \"aria-label\": translations.listLabel,\n        \"aria-live\": \"polite\",\n        onScroll: updateNavigationButtonsProps,\n        onKeyDown: function onKeyDown(event) {\n          if (event.key === 'ArrowLeft') {\n            event.preventDefault();\n            scrollLeft();\n          } else if (event.key === 'ArrowRight') {\n            event.preventDefault();\n            scrollRight();\n          }\n        }\n      }, items.map(function (item, index) {\n        return createElement(\"li\", {\n          key: item.objectID,\n          className: cx(cssClasses.item),\n          \"aria-roledescription\": \"slide\",\n          \"aria-label\": \"\".concat(index + 1, \" of \").concat(items.length),\n          onClick: function onClick() {\n            sendEvent('click:internal', item, 'Item Clicked');\n          },\n          onAuxClick: function onAuxClick() {\n            sendEvent('click:internal', item, 'Item Clicked');\n          }\n        }, createElement(ItemComponent, {\n          item: item,\n          sendEvent: sendEvent\n        }));\n      })), createElement(\"button\", {\n        ref: nextButtonRef,\n        title: translations.nextButtonTitle,\n        \"aria-label\": translations.nextButtonLabel,\n        \"aria-controls\": carouselIdRef.current,\n        className: cx(cssClasses.navigation, cssClasses.navigationNext),\n        onClick: function onClick(event) {\n          event.preventDefault();\n          scrollRight();\n        }\n      }, createElement(NextIconComponent, {\n        createElement: createElement\n      })));\n    };\n  }\n\n  var _excluded$a = [\"classNames\", \"emptyComponent\", \"headerComponent\", \"itemComponent\", \"layout\", \"items\", \"status\", \"translations\", \"sendEvent\"];\n  function ownKeys$2(e, r) {\n    var t = Object.keys(e);\n    if (Object.getOwnPropertySymbols) {\n      var o = Object.getOwnPropertySymbols(e);\n      r && (o = o.filter(function (r) {\n        return Object.getOwnPropertyDescriptor(e, r).enumerable;\n      })), t.push.apply(t, o);\n    }\n    return t;\n  }\n  function _objectSpread$1(e) {\n    for (var r = 1; r < arguments.length; r++) {\n      var t = null != arguments[r] ? arguments[r] : {};\n      r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) {\n        _defineProperty$1(e, r, t[r]);\n      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) {\n        Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n      });\n    }\n    return e;\n  }\n  function createFrequentlyBoughtTogetherComponent(_ref) {\n    var createElement = _ref.createElement,\n      Fragment = _ref.Fragment;\n    return function FrequentlyBoughtTogether(userProps) {\n      var _userProps$classNames = userProps.classNames,\n        classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,\n        _userProps$emptyCompo = userProps.emptyComponent,\n        EmptyComponent = _userProps$emptyCompo === void 0 ? createDefaultEmptyComponent({\n          createElement: createElement,\n          Fragment: Fragment\n        }) : _userProps$emptyCompo,\n        _userProps$headerComp = userProps.headerComponent,\n        HeaderComponent = _userProps$headerComp === void 0 ? createDefaultHeaderComponent({\n          createElement: createElement,\n          Fragment: Fragment\n        }) : _userProps$headerComp,\n        _userProps$itemCompon = userProps.itemComponent,\n        ItemComponent = _userProps$itemCompon === void 0 ? createDefaultItemComponent({\n          createElement: createElement,\n          Fragment: Fragment\n        }) : _userProps$itemCompon,\n        _userProps$layout = userProps.layout,\n        Layout = _userProps$layout === void 0 ? createListComponent({\n          createElement: createElement,\n          Fragment: Fragment\n        }) : _userProps$layout,\n        items = userProps.items,\n        status = userProps.status,\n        userTranslations = userProps.translations,\n        sendEvent = userProps.sendEvent,\n        props = _objectWithoutProperties$1(userProps, _excluded$a);\n      var translations = _objectSpread$1({\n        title: 'Frequently bought together',\n        sliderLabel: 'Frequently bought together products'\n      }, userTranslations);\n      var cssClasses = {\n        root: cx('ais-FrequentlyBoughtTogether', classNames.root),\n        emptyRoot: cx('ais-FrequentlyBoughtTogether', classNames.root, 'ais-FrequentlyBoughtTogether--empty', classNames.emptyRoot, props.className),\n        title: cx('ais-FrequentlyBoughtTogether-title', classNames.title),\n        container: cx('ais-FrequentlyBoughtTogether-container', classNames.container),\n        list: cx('ais-FrequentlyBoughtTogether-list', classNames.list),\n        item: cx('ais-FrequentlyBoughtTogether-item', classNames.item)\n      };\n      if (items.length === 0 && status === 'idle') {\n        return createElement(\"section\", _extends$1({}, props, {\n          className: cssClasses.emptyRoot\n        }), createElement(EmptyComponent, null));\n      }\n      return createElement(\"section\", _extends$1({}, props, {\n        className: cssClasses.root\n      }), createElement(HeaderComponent, {\n        classNames: cssClasses,\n        items: items,\n        translations: translations\n      }), createElement(Layout, {\n        classNames: cssClasses,\n        itemComponent: ItemComponent,\n        items: items,\n        sendEvent: sendEvent\n      }));\n    };\n  }\n\n  var _excluded$b = [\"parts\", \"highlightedTagName\", \"nonHighlightedTagName\", \"separator\", \"className\", \"classNames\"];\n  function createHighlightPartComponent(_ref) {\n    var createElement = _ref.createElement;\n    return function HighlightPart(_ref2) {\n      var classNames = _ref2.classNames,\n        children = _ref2.children,\n        highlightedTagName = _ref2.highlightedTagName,\n        isHighlighted = _ref2.isHighlighted,\n        nonHighlightedTagName = _ref2.nonHighlightedTagName;\n      var TagName = isHighlighted ? highlightedTagName : nonHighlightedTagName;\n      return createElement(TagName, {\n        className: isHighlighted ? classNames.highlighted : classNames.nonHighlighted\n      }, children);\n    };\n  }\n  function createHighlightComponent(_ref3) {\n    var createElement = _ref3.createElement,\n      Fragment = _ref3.Fragment;\n    var HighlightPart = createHighlightPartComponent({\n      createElement: createElement,\n      Fragment: Fragment\n    });\n    return function Highlight(userProps) {\n      var parts = userProps.parts,\n        _userProps$highlighte = userProps.highlightedTagName,\n        highlightedTagName = _userProps$highlighte === void 0 ? 'mark' : _userProps$highlighte,\n        _userProps$nonHighlig = userProps.nonHighlightedTagName,\n        nonHighlightedTagName = _userProps$nonHighlig === void 0 ? 'span' : _userProps$nonHighlig,\n        _userProps$separator = userProps.separator,\n        separator = _userProps$separator === void 0 ? ', ' : _userProps$separator,\n        className = userProps.className,\n        _userProps$classNames = userProps.classNames,\n        classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,\n        props = _objectWithoutProperties$1(userProps, _excluded$b);\n      return createElement(\"span\", _extends$1({}, props, {\n        className: cx(classNames.root, className)\n      }), parts.map(function (part, partIndex) {\n        var isLastPart = partIndex === parts.length - 1;\n        return createElement(Fragment, {\n          key: partIndex\n        }, part.map(function (subPart, subPartIndex) {\n          return createElement(HighlightPart, {\n            key: subPartIndex,\n            classNames: classNames,\n            highlightedTagName: highlightedTagName,\n            nonHighlightedTagName: nonHighlightedTagName,\n            isHighlighted: subPart.isHighlighted\n          }, subPart.value);\n        }), !isLastPart && createElement(\"span\", {\n          className: classNames.separator\n        }, separator));\n      }));\n    };\n  }\n\n  var _excluded$c = [\"classNames\", \"hits\", \"itemComponent\", \"sendEvent\", \"emptyComponent\", \"banner\", \"bannerComponent\"];\n\n  // Should be imported from a shared package in the future\n\n  function createDefaultBannerComponent(_ref) {\n    var createElement = _ref.createElement;\n    return function DefaultBanner(_ref2) {\n      var classNames = _ref2.classNames,\n        banner = _ref2.banner;\n      if (!banner.image.urls[0].url) {\n        return null;\n      }\n      return createElement(\"aside\", {\n        className: cx('ais-Hits-banner', classNames.bannerRoot)\n      }, banner.link ? createElement(\"a\", {\n        className: cx('ais-Hits-banner-link', classNames.bannerLink),\n        href: banner.link.url,\n        target: banner.link.target\n      }, createElement(\"img\", {\n        className: cx('ais-Hits-banner-image', classNames.bannerImage),\n        src: banner.image.urls[0].url,\n        alt: banner.image.title\n      })) : createElement(\"img\", {\n        className: cx('ais-Hits-banner-image', classNames.bannerImage),\n        src: banner.image.urls[0].url,\n        alt: banner.image.title\n      }));\n    };\n  }\n  function createHitsComponent(_ref3) {\n    var createElement = _ref3.createElement,\n      Fragment = _ref3.Fragment;\n    var DefaultBannerComponent = createDefaultBannerComponent({\n      createElement: createElement,\n      Fragment: Fragment\n    });\n    return function Hits(userProps) {\n      var _userProps$classNames = userProps.classNames,\n        classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,\n        hits = userProps.hits,\n        ItemComponent = userProps.itemComponent,\n        sendEvent = userProps.sendEvent,\n        EmptyComponent = userProps.emptyComponent,\n        banner = userProps.banner,\n        BannerComponent = userProps.bannerComponent,\n        props = _objectWithoutProperties$1(userProps, _excluded$c);\n      return createElement(\"div\", _extends$1({}, props, {\n        className: cx('ais-Hits', classNames.root, hits.length === 0 && cx('ais-Hits--empty', classNames.emptyRoot), props.className)\n      }), banner && (BannerComponent ? createElement(BannerComponent, {\n        className: cx('ais-Hits-banner', classNames.bannerRoot),\n        banner: banner\n      }) : createElement(DefaultBannerComponent, {\n        classNames: classNames,\n        banner: banner\n      })), hits.length === 0 && EmptyComponent ? createElement(EmptyComponent, null) : createElement(\"ol\", {\n        className: cx('ais-Hits-list', classNames.list)\n      }, hits.map(function (hit, index) {\n        return createElement(ItemComponent, {\n          key: hit.objectID,\n          hit: hit,\n          index: index,\n          className: cx('ais-Hits-item', classNames.item),\n          onClick: function onClick() {\n            sendEvent('click:internal', hit, 'Hit Clicked');\n          },\n          onAuxClick: function onAuxClick() {\n            sendEvent('click:internal', hit, 'Hit Clicked');\n          }\n        });\n      })));\n    };\n  }\n\n  var _excluded$d = [\"classNames\", \"emptyComponent\", \"headerComponent\", \"itemComponent\", \"layout\", \"items\", \"status\", \"translations\", \"sendEvent\"];\n  function ownKeys$3(e, r) {\n    var t = Object.keys(e);\n    if (Object.getOwnPropertySymbols) {\n      var o = Object.getOwnPropertySymbols(e);\n      r && (o = o.filter(function (r) {\n        return Object.getOwnPropertyDescriptor(e, r).enumerable;\n      })), t.push.apply(t, o);\n    }\n    return t;\n  }\n  function _objectSpread$2(e) {\n    for (var r = 1; r < arguments.length; r++) {\n      var t = null != arguments[r] ? arguments[r] : {};\n      r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) {\n        _defineProperty$1(e, r, t[r]);\n      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) {\n        Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n      });\n    }\n    return e;\n  }\n  function createLookingSimilarComponent(_ref) {\n    var createElement = _ref.createElement,\n      Fragment = _ref.Fragment;\n    return function LookingSimilar(userProps) {\n      var _userProps$classNames = userProps.classNames,\n        classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,\n        _userProps$emptyCompo = userProps.emptyComponent,\n        EmptyComponent = _userProps$emptyCompo === void 0 ? createDefaultEmptyComponent({\n          createElement: createElement,\n          Fragment: Fragment\n        }) : _userProps$emptyCompo,\n        _userProps$headerComp = userProps.headerComponent,\n        HeaderComponent = _userProps$headerComp === void 0 ? createDefaultHeaderComponent({\n          createElement: createElement,\n          Fragment: Fragment\n        }) : _userProps$headerComp,\n        _userProps$itemCompon = userProps.itemComponent,\n        ItemComponent = _userProps$itemCompon === void 0 ? createDefaultItemComponent({\n          createElement: createElement,\n          Fragment: Fragment\n        }) : _userProps$itemCompon,\n        _userProps$layout = userProps.layout,\n        Layout = _userProps$layout === void 0 ? createListComponent({\n          createElement: createElement,\n          Fragment: Fragment\n        }) : _userProps$layout,\n        items = userProps.items,\n        status = userProps.status,\n        userTranslations = userProps.translations,\n        sendEvent = userProps.sendEvent,\n        props = _objectWithoutProperties$1(userProps, _excluded$d);\n      var translations = _objectSpread$2({\n        title: 'Looking similar',\n        sliderLabel: 'Looking similar'\n      }, userTranslations);\n      var cssClasses = {\n        root: cx('ais-LookingSimilar', classNames.root),\n        emptyRoot: cx('ais-LookingSimilar', classNames.root, 'ais-LookingSimilar--empty', classNames.emptyRoot, props.className),\n        title: cx('ais-LookingSimilar-title', classNames.title),\n        container: cx('ais-LookingSimilar-container', classNames.container),\n        list: cx('ais-LookingSimilar-list', classNames.list),\n        item: cx('ais-LookingSimilar-item', classNames.item)\n      };\n      if (items.length === 0 && status === 'idle') {\n        return createElement(\"section\", _extends$1({}, props, {\n          className: cssClasses.emptyRoot\n        }), createElement(EmptyComponent, null));\n      }\n      return createElement(\"section\", _extends$1({}, props, {\n        className: cssClasses.root\n      }), createElement(HeaderComponent, {\n        classNames: cssClasses,\n        items: items,\n        translations: translations\n      }), createElement(Layout, {\n        classNames: cssClasses,\n        itemComponent: ItemComponent,\n        items: items,\n        sendEvent: sendEvent\n      }));\n    };\n  }\n\n  var _excluded$e = [\"classNames\", \"emptyComponent\", \"headerComponent\", \"itemComponent\", \"layout\", \"items\", \"status\", \"translations\", \"sendEvent\"];\n  function ownKeys$4(e, r) {\n    var t = Object.keys(e);\n    if (Object.getOwnPropertySymbols) {\n      var o = Object.getOwnPropertySymbols(e);\n      r && (o = o.filter(function (r) {\n        return Object.getOwnPropertyDescriptor(e, r).enumerable;\n      })), t.push.apply(t, o);\n    }\n    return t;\n  }\n  function _objectSpread$3(e) {\n    for (var r = 1; r < arguments.length; r++) {\n      var t = null != arguments[r] ? arguments[r] : {};\n      r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) {\n        _defineProperty$1(e, r, t[r]);\n      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) {\n        Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n      });\n    }\n    return e;\n  }\n  function createRelatedProductsComponent(_ref) {\n    var createElement = _ref.createElement,\n      Fragment = _ref.Fragment;\n    return function RelatedProducts(userProps) {\n      var _userProps$classNames = userProps.classNames,\n        classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,\n        _userProps$emptyCompo = userProps.emptyComponent,\n        EmptyComponent = _userProps$emptyCompo === void 0 ? createDefaultEmptyComponent({\n          createElement: createElement,\n          Fragment: Fragment\n        }) : _userProps$emptyCompo,\n        _userProps$headerComp = userProps.headerComponent,\n        HeaderComponent = _userProps$headerComp === void 0 ? createDefaultHeaderComponent({\n          createElement: createElement,\n          Fragment: Fragment\n        }) : _userProps$headerComp,\n        _userProps$itemCompon = userProps.itemComponent,\n        ItemComponent = _userProps$itemCompon === void 0 ? createDefaultItemComponent({\n          createElement: createElement,\n          Fragment: Fragment\n        }) : _userProps$itemCompon,\n        _userProps$layout = userProps.layout,\n        Layout = _userProps$layout === void 0 ? createListComponent({\n          createElement: createElement,\n          Fragment: Fragment\n        }) : _userProps$layout,\n        items = userProps.items,\n        status = userProps.status,\n        userTranslations = userProps.translations,\n        sendEvent = userProps.sendEvent,\n        props = _objectWithoutProperties$1(userProps, _excluded$e);\n      var translations = _objectSpread$3({\n        title: 'Related products',\n        sliderLabel: 'Related products'\n      }, userTranslations);\n      var cssClasses = {\n        root: cx('ais-RelatedProducts', classNames.root),\n        emptyRoot: cx('ais-RelatedProducts', classNames.root, 'ais-RelatedProducts--empty', classNames.emptyRoot, props.className),\n        title: cx('ais-RelatedProducts-title', classNames.title),\n        container: cx('ais-RelatedProducts-container', classNames.container),\n        list: cx('ais-RelatedProducts-list', classNames.list),\n        item: cx('ais-RelatedProducts-item', classNames.item)\n      };\n      if (items.length === 0 && status === 'idle') {\n        return createElement(\"section\", _extends$1({}, props, {\n          className: cssClasses.emptyRoot\n        }), createElement(EmptyComponent, null));\n      }\n      return createElement(\"section\", _extends$1({}, props, {\n        className: cssClasses.root\n      }), createElement(HeaderComponent, {\n        classNames: cssClasses,\n        items: items,\n        translations: translations\n      }), createElement(Layout, {\n        classNames: cssClasses,\n        itemComponent: ItemComponent,\n        items: items,\n        sendEvent: sendEvent\n      }));\n    };\n  }\n\n  var _excluded$f = [\"classNames\", \"emptyComponent\", \"headerComponent\", \"itemComponent\", \"layout\", \"items\", \"status\", \"translations\", \"sendEvent\"];\n  function ownKeys$5(e, r) {\n    var t = Object.keys(e);\n    if (Object.getOwnPropertySymbols) {\n      var o = Object.getOwnPropertySymbols(e);\n      r && (o = o.filter(function (r) {\n        return Object.getOwnPropertyDescriptor(e, r).enumerable;\n      })), t.push.apply(t, o);\n    }\n    return t;\n  }\n  function _objectSpread$4(e) {\n    for (var r = 1; r < arguments.length; r++) {\n      var t = null != arguments[r] ? arguments[r] : {};\n      r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) {\n        _defineProperty$1(e, r, t[r]);\n      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) {\n        Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n      });\n    }\n    return e;\n  }\n  function createTrendingItemsComponent(_ref) {\n    var createElement = _ref.createElement,\n      Fragment = _ref.Fragment;\n    return function TrendingItems(userProps) {\n      var _userProps$classNames = userProps.classNames,\n        classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,\n        _userProps$emptyCompo = userProps.emptyComponent,\n        EmptyComponent = _userProps$emptyCompo === void 0 ? createDefaultEmptyComponent({\n          createElement: createElement,\n          Fragment: Fragment\n        }) : _userProps$emptyCompo,\n        _userProps$headerComp = userProps.headerComponent,\n        HeaderComponent = _userProps$headerComp === void 0 ? createDefaultHeaderComponent({\n          createElement: createElement,\n          Fragment: Fragment\n        }) : _userProps$headerComp,\n        _userProps$itemCompon = userProps.itemComponent,\n        ItemComponent = _userProps$itemCompon === void 0 ? createDefaultItemComponent({\n          createElement: createElement,\n          Fragment: Fragment\n        }) : _userProps$itemCompon,\n        _userProps$layout = userProps.layout,\n        Layout = _userProps$layout === void 0 ? createListComponent({\n          createElement: createElement,\n          Fragment: Fragment\n        }) : _userProps$layout,\n        items = userProps.items,\n        status = userProps.status,\n        userTranslations = userProps.translations,\n        sendEvent = userProps.sendEvent,\n        props = _objectWithoutProperties$1(userProps, _excluded$f);\n      var translations = _objectSpread$4({\n        title: 'Trending items',\n        sliderLabel: 'Trending items'\n      }, userTranslations);\n      var cssClasses = {\n        root: cx('ais-TrendingItems', classNames.root),\n        emptyRoot: cx('ais-TrendingItems', classNames.root, 'ais-TrendingItems--empty', classNames.emptyRoot, props.className),\n        title: cx('ais-TrendingItems-title', classNames.title),\n        container: cx('ais-TrendingItems-container', classNames.container),\n        list: cx('ais-TrendingItems-list', classNames.list),\n        item: cx('ais-TrendingItems-item', classNames.item)\n      };\n      if (items.length === 0 && status === 'idle') {\n        return createElement(\"section\", _extends$1({}, props, {\n          className: cssClasses.emptyRoot\n        }), createElement(EmptyComponent, null));\n      }\n      return createElement(\"section\", _extends$1({}, props, {\n        className: cssClasses.root\n      }), createElement(HeaderComponent, {\n        classNames: cssClasses,\n        items: items,\n        translations: translations\n      }), createElement(Layout, {\n        classNames: cssClasses,\n        itemComponent: ItemComponent,\n        items: items,\n        sendEvent: sendEvent\n      }));\n    };\n  }\n\n  var r$1,u$1,i,o$1,f$1=0,c$1=[],e$2=[],a$1=l.__b,v$1=l.__r,l$1=l.diffed,m$2=l.__c,d$1=l.unmount;function p$1(t,r){l.__h&&l.__h(u$1,t,f$1||r),f$1=0;var i=u$1.__H||(u$1.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:e$2}),i.__[t]}function y$1(n){return f$1=1,h$1(C$1,n)}function h$1(n,t,i){var o=p$1(r$1++,2);if(o.t=n,!o.__c&&(o.__=[i?i(t):C$1(void 0,t),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=u$1,!u$1.u)){u$1.u=!0;var f=u$1.shouldComponentUpdate;u$1.shouldComponentUpdate=function(n,t,r){if(!o.__c.__H)return !0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return !n.__N}))return !f||f.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0);}}),!!i&&(!f||f.call(this,n,t,r))};}return o.__N||o.__}function s$1(t,i){var o=p$1(r$1++,3);!l.__s&&B(o.__H,i)&&(o.__=t,o.i=i,u$1.__H.__h.push(o));}function A$1(n){return f$1=5,T$1(function(){return {current:n}},[])}function T$1(n,t){var u=p$1(r$1++,7);return B(u.__H,t)?(u.__V=n(),u.i=t,u.__h=n,u.__V):u.__}function g$1(){for(var t;t=c$1.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(w$1),t.__H.__h.forEach(z$1),t.__H.__h=[];}catch(r){t.__H.__h=[],l.__e(r,t.__v);}}l.__b=function(n){\"function\"!=typeof n.type||n.o||n.type===p?n.o||(n.o=n.__&&n.__.o?n.__.o:\"\"):n.o=(n.__&&n.__.o?n.__.o:\"\")+(n.__&&n.__.__k?n.__.__k.indexOf(n):0),u$1=null,a$1&&a$1(n);},l.__r=function(n){v$1&&v$1(n),r$1=0;var t=(u$1=n.__c).__H;t&&(i===u$1?(t.__h=[],u$1.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=e$2,n.__N=n.i=void 0;})):(t.__h.forEach(w$1),t.__h.forEach(z$1),t.__h=[])),i=u$1;},l.diffed=function(t){l$1&&l$1(t);var r=t.__c;r&&r.__H&&(r.__H.__h.length&&(1!==c$1.push(r)&&o$1===l.requestAnimationFrame||((o$1=l.requestAnimationFrame)||k$1)(g$1)),r.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==e$2&&(n.__=n.__V),n.i=void 0,n.__V=e$2;})),i=u$1=null;},l.__c=function(t,r){r.some(function(t){try{t.__h.forEach(w$1),t.__h=t.__h.filter(function(n){return !n.__||z$1(n)});}catch(u){r.some(function(n){n.__h&&(n.__h=[]);}),r=[],l.__e(u,t.__v);}}),m$2&&m$2(t,r);},l.unmount=function(t){d$1&&d$1(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{w$1(n);}catch(n){r=n;}}),u.__H=void 0,r&&l.__e(r,u.__v));};var j$1=\"function\"==typeof requestAnimationFrame;function k$1(n){var t,r=function(){clearTimeout(u),j$1&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);j$1&&(t=requestAnimationFrame(r));}function w$1(n){var t=u$1,r=n.__c;\"function\"==typeof r&&(n.__c=void 0,r()),u$1=t;}function z$1(n){var t=u$1;n.__c=n.__(),u$1=t;}function B(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function C$1(n,t){return \"function\"==typeof t?t(n):t}\n\n  var Carousel = createCarouselComponent({\n    createElement: h,\n    Fragment: p\n  });\n  function CarouselWithRefs(props) {\n    var carouselRefs = {\n      listRef: A$1(null),\n      nextButtonRef: A$1(null),\n      previousButtonRef: A$1(null),\n      carouselIdRef: A$1(generateCarouselId())\n    };\n    return h(Carousel, _extends({}, carouselRefs, props));\n  }\n  function carousel() {\n    var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n      cssClasses = _ref.cssClasses,\n      _ref$templates = _ref.templates,\n      templates = _ref$templates === void 0 ? {} : _ref$templates;\n    return function CarouselTemplate(_ref2) {\n      var items = _ref2.items,\n        widgetTemplates = _ref2.templates,\n        _ref2$cssClasses = _ref2.cssClasses,\n        widgetCssClasses = _ref2$cssClasses === void 0 ? {} : _ref2$cssClasses,\n        _ref2$sendEvent = _ref2.sendEvent,\n        sendEvent = _ref2$sendEvent === void 0 ? function () {} : _ref2$sendEvent;\n      var previous = templates.previous,\n        next = templates.next;\n      return h(CarouselWithRefs, {\n        items: items,\n        sendEvent: sendEvent,\n        itemComponent: widgetTemplates.item,\n        previousIconComponent: previous ? function () {\n          return previous({\n            html: m$1\n          });\n        } : undefined,\n        nextIconComponent: next ? function () {\n          return next({\n            html: m$1\n          });\n        } : undefined,\n        classNames: _objectSpread2(_objectSpread2({}, cssClasses), {\n          list: cx(cssClasses === null || cssClasses === void 0 ? void 0 : cssClasses.list, widgetCssClasses === null || widgetCssClasses === void 0 ? void 0 : widgetCssClasses.list),\n          item: cx(cssClasses === null || cssClasses === void 0 ? void 0 : cssClasses.item, widgetCssClasses === null || widgetCssClasses === void 0 ? void 0 : widgetCssClasses.item)\n        })\n      });\n    };\n  }\n\n\n\n  var templates = /*#__PURE__*/Object.freeze({\n    __proto__: null,\n    carousel: carousel\n  });\n\n  function prepareTemplates(\n  // can not use = {} here, since the template could have different constraints\n  defaultTemplates) {\n    var templates = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n    var allKeys = uniq([].concat(_toConsumableArray(Object.keys(defaultTemplates || {})), _toConsumableArray(Object.keys(templates))));\n    return allKeys.reduce(function (config, key) {\n      var defaultTemplate = defaultTemplates ? defaultTemplates[key] : undefined;\n      var customTemplate = templates[key];\n      var isCustomTemplate = customTemplate !== undefined && customTemplate !== defaultTemplate;\n      config.templates[key] = isCustomTemplate ? customTemplate : defaultTemplate;\n      config.useCustomCompileOptions[key] = isCustomTemplate;\n      return config;\n    }, {\n      // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n      templates: {},\n      // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n      useCustomCompileOptions: {}\n    });\n  }\n\n  /**\n   * Prepares an object to be passed to the Template widget\n   */\n  function prepareTemplateProps(_ref) {\n    var defaultTemplates = _ref.defaultTemplates,\n      templates = _ref.templates,\n      templatesConfig = _ref.templatesConfig;\n    var preparedTemplates = prepareTemplates(defaultTemplates, templates);\n    return _objectSpread2({\n      templatesConfig: templatesConfig\n    }, preparedTemplates);\n  }\n\n  var compiler = createCommonjsModule(function (module, exports) {\n  /*\n   *  Copyright 2011 Twitter, Inc.\n   *  Licensed under the Apache License, Version 2.0 (the \"License\");\n   *  you may not use this file except in compliance with the License.\n   *  You may obtain a copy of the License at\n   *\n   *  http://www.apache.org/licenses/LICENSE-2.0\n   *\n   *  Unless required by applicable law or agreed to in writing, software\n   *  distributed under the License is distributed on an \"AS IS\" BASIS,\n   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   *  See the License for the specific language governing permissions and\n   *  limitations under the License.\n   */\n\n  (function (Hogan) {\n    // Setup regex  assignments\n    // remove whitespace according to Mustache spec\n    var rIsWhitespace = /\\S/,\n        rQuot = /\\\"/g,\n        rNewline =  /\\n/g,\n        rCr = /\\r/g,\n        rSlash = /\\\\/g,\n        rLineSep = /\\u2028/,\n        rParagraphSep = /\\u2029/;\n\n    Hogan.tags = {\n      '#': 1, '^': 2, '<': 3, '$': 4,\n      '/': 5, '!': 6, '>': 7, '=': 8, '_v': 9,\n      '{': 10, '&': 11, '_t': 12\n    };\n\n    Hogan.scan = function scan(text, delimiters) {\n      var len = text.length,\n          IN_TEXT = 0,\n          IN_TAG_TYPE = 1,\n          IN_TAG = 2,\n          state = IN_TEXT,\n          tagType = null,\n          tag = null,\n          buf = '',\n          tokens = [],\n          seenTag = false,\n          i = 0,\n          lineStart = 0,\n          otag = '{{',\n          ctag = '}}';\n\n      function addBuf() {\n        if (buf.length > 0) {\n          tokens.push({tag: '_t', text: new String(buf)});\n          buf = '';\n        }\n      }\n\n      function lineIsWhitespace() {\n        var isAllWhitespace = true;\n        for (var j = lineStart; j < tokens.length; j++) {\n          isAllWhitespace =\n            (Hogan.tags[tokens[j].tag] < Hogan.tags['_v']) ||\n            (tokens[j].tag == '_t' && tokens[j].text.match(rIsWhitespace) === null);\n          if (!isAllWhitespace) {\n            return false;\n          }\n        }\n\n        return isAllWhitespace;\n      }\n\n      function filterLine(haveSeenTag, noNewLine) {\n        addBuf();\n\n        if (haveSeenTag && lineIsWhitespace()) {\n          for (var j = lineStart, next; j < tokens.length; j++) {\n            if (tokens[j].text) {\n              if ((next = tokens[j+1]) && next.tag == '>') {\n                // set indent to token value\n                next.indent = tokens[j].text.toString();\n              }\n              tokens.splice(j, 1);\n            }\n          }\n        } else if (!noNewLine) {\n          tokens.push({tag:'\\n'});\n        }\n\n        seenTag = false;\n        lineStart = tokens.length;\n      }\n\n      function changeDelimiters(text, index) {\n        var close = '=' + ctag,\n            closeIndex = text.indexOf(close, index),\n            delimiters = trim(\n              text.substring(text.indexOf('=', index) + 1, closeIndex)\n            ).split(' ');\n\n        otag = delimiters[0];\n        ctag = delimiters[delimiters.length - 1];\n\n        return closeIndex + close.length - 1;\n      }\n\n      if (delimiters) {\n        delimiters = delimiters.split(' ');\n        otag = delimiters[0];\n        ctag = delimiters[1];\n      }\n\n      for (i = 0; i < len; i++) {\n        if (state == IN_TEXT) {\n          if (tagChange(otag, text, i)) {\n            --i;\n            addBuf();\n            state = IN_TAG_TYPE;\n          } else {\n            if (text.charAt(i) == '\\n') {\n              filterLine(seenTag);\n            } else {\n              buf += text.charAt(i);\n            }\n          }\n        } else if (state == IN_TAG_TYPE) {\n          i += otag.length - 1;\n          tag = Hogan.tags[text.charAt(i + 1)];\n          tagType = tag ? text.charAt(i + 1) : '_v';\n          if (tagType == '=') {\n            i = changeDelimiters(text, i);\n            state = IN_TEXT;\n          } else {\n            if (tag) {\n              i++;\n            }\n            state = IN_TAG;\n          }\n          seenTag = i;\n        } else {\n          if (tagChange(ctag, text, i)) {\n            tokens.push({tag: tagType, n: trim(buf), otag: otag, ctag: ctag,\n                         i: (tagType == '/') ? seenTag - otag.length : i + ctag.length});\n            buf = '';\n            i += ctag.length - 1;\n            state = IN_TEXT;\n            if (tagType == '{') {\n              if (ctag == '}}') {\n                i++;\n              } else {\n                cleanTripleStache(tokens[tokens.length - 1]);\n              }\n            }\n          } else {\n            buf += text.charAt(i);\n          }\n        }\n      }\n\n      filterLine(seenTag, true);\n\n      return tokens;\n    };\n\n    function cleanTripleStache(token) {\n      if (token.n.substr(token.n.length - 1) === '}') {\n        token.n = token.n.substring(0, token.n.length - 1);\n      }\n    }\n\n    function trim(s) {\n      if (s.trim) {\n        return s.trim();\n      }\n\n      return s.replace(/^\\s*|\\s*$/g, '');\n    }\n\n    function tagChange(tag, text, index) {\n      if (text.charAt(index) != tag.charAt(0)) {\n        return false;\n      }\n\n      for (var i = 1, l = tag.length; i < l; i++) {\n        if (text.charAt(index + i) != tag.charAt(i)) {\n          return false;\n        }\n      }\n\n      return true;\n    }\n\n    // the tags allowed inside super templates\n    var allowedInSuper = {'_t': true, '\\n': true, '$': true, '/': true};\n\n    function buildTree(tokens, kind, stack, customTags) {\n      var instructions = [],\n          opener = null,\n          tail = null,\n          token = null;\n\n      tail = stack[stack.length - 1];\n\n      while (tokens.length > 0) {\n        token = tokens.shift();\n\n        if (tail && tail.tag == '<' && !(token.tag in allowedInSuper)) {\n          throw new Error('Illegal content in < super tag.');\n        }\n\n        if (Hogan.tags[token.tag] <= Hogan.tags['$'] || isOpener(token, customTags)) {\n          stack.push(token);\n          token.nodes = buildTree(tokens, token.tag, stack, customTags);\n        } else if (token.tag == '/') {\n          if (stack.length === 0) {\n            throw new Error('Closing tag without opener: /' + token.n);\n          }\n          opener = stack.pop();\n          if (token.n != opener.n && !isCloser(token.n, opener.n, customTags)) {\n            throw new Error('Nesting error: ' + opener.n + ' vs. ' + token.n);\n          }\n          opener.end = token.i;\n          return instructions;\n        } else if (token.tag == '\\n') {\n          token.last = (tokens.length == 0) || (tokens[0].tag == '\\n');\n        }\n\n        instructions.push(token);\n      }\n\n      if (stack.length > 0) {\n        throw new Error('missing closing tag: ' + stack.pop().n);\n      }\n\n      return instructions;\n    }\n\n    function isOpener(token, tags) {\n      for (var i = 0, l = tags.length; i < l; i++) {\n        if (tags[i].o == token.n) {\n          token.tag = '#';\n          return true;\n        }\n      }\n    }\n\n    function isCloser(close, open, tags) {\n      for (var i = 0, l = tags.length; i < l; i++) {\n        if (tags[i].c == close && tags[i].o == open) {\n          return true;\n        }\n      }\n    }\n\n    function stringifySubstitutions(obj) {\n      var items = [];\n      for (var key in obj) {\n        items.push('\"' + esc(key) + '\": function(c,p,t,i) {' + obj[key] + '}');\n      }\n      return \"{ \" + items.join(\",\") + \" }\";\n    }\n\n    function stringifyPartials(codeObj) {\n      var partials = [];\n      for (var key in codeObj.partials) {\n        partials.push('\"' + esc(key) + '\":{name:\"' + esc(codeObj.partials[key].name) + '\", ' + stringifyPartials(codeObj.partials[key]) + \"}\");\n      }\n      return \"partials: {\" + partials.join(\",\") + \"}, subs: \" + stringifySubstitutions(codeObj.subs);\n    }\n\n    Hogan.stringify = function(codeObj, text, options) {\n      return \"{code: function (c,p,i) { \" + Hogan.wrapMain(codeObj.code) + \" },\" + stringifyPartials(codeObj) +  \"}\";\n    };\n\n    var serialNo = 0;\n    Hogan.generate = function(tree, text, options) {\n      serialNo = 0;\n      var context = { code: '', subs: {}, partials: {} };\n      Hogan.walk(tree, context);\n\n      if (options.asString) {\n        return this.stringify(context, text, options);\n      }\n\n      return this.makeTemplate(context, text, options);\n    };\n\n    Hogan.wrapMain = function(code) {\n      return 'var t=this;t.b(i=i||\"\");' + code + 'return t.fl();';\n    };\n\n    Hogan.template = Hogan.Template;\n\n    Hogan.makeTemplate = function(codeObj, text, options) {\n      var template = this.makePartials(codeObj);\n      template.code = new Function('c', 'p', 'i', this.wrapMain(codeObj.code));\n      return new this.template(template, text, this, options);\n    };\n\n    Hogan.makePartials = function(codeObj) {\n      var key, template = {subs: {}, partials: codeObj.partials, name: codeObj.name};\n      for (key in template.partials) {\n        template.partials[key] = this.makePartials(template.partials[key]);\n      }\n      for (key in codeObj.subs) {\n        template.subs[key] = new Function('c', 'p', 't', 'i', codeObj.subs[key]);\n      }\n      return template;\n    };\n\n    function esc(s) {\n      return s.replace(rSlash, '\\\\\\\\')\n              .replace(rQuot, '\\\\\\\"')\n              .replace(rNewline, '\\\\n')\n              .replace(rCr, '\\\\r')\n              .replace(rLineSep, '\\\\u2028')\n              .replace(rParagraphSep, '\\\\u2029');\n    }\n\n    function chooseMethod(s) {\n      return (~s.indexOf('.')) ? 'd' : 'f';\n    }\n\n    function createPartial(node, context) {\n      var prefix = \"<\" + (context.prefix || \"\");\n      var sym = prefix + node.n + serialNo++;\n      context.partials[sym] = {name: node.n, partials: {}};\n      context.code += 't.b(t.rp(\"' +  esc(sym) + '\",c,p,\"' + (node.indent || '') + '\"));';\n      return sym;\n    }\n\n    Hogan.codegen = {\n      '#': function(node, context) {\n        context.code += 'if(t.s(t.' + chooseMethod(node.n) + '(\"' + esc(node.n) + '\",c,p,1),' +\n                        'c,p,0,' + node.i + ',' + node.end + ',\"' + node.otag + \" \" + node.ctag + '\")){' +\n                        't.rs(c,p,' + 'function(c,p,t){';\n        Hogan.walk(node.nodes, context);\n        context.code += '});c.pop();}';\n      },\n\n      '^': function(node, context) {\n        context.code += 'if(!t.s(t.' + chooseMethod(node.n) + '(\"' + esc(node.n) + '\",c,p,1),c,p,1,0,0,\"\")){';\n        Hogan.walk(node.nodes, context);\n        context.code += '};';\n      },\n\n      '>': createPartial,\n      '<': function(node, context) {\n        var ctx = {partials: {}, code: '', subs: {}, inPartial: true};\n        Hogan.walk(node.nodes, ctx);\n        var template = context.partials[createPartial(node, context)];\n        template.subs = ctx.subs;\n        template.partials = ctx.partials;\n      },\n\n      '$': function(node, context) {\n        var ctx = {subs: {}, code: '', partials: context.partials, prefix: node.n};\n        Hogan.walk(node.nodes, ctx);\n        context.subs[node.n] = ctx.code;\n        if (!context.inPartial) {\n          context.code += 't.sub(\"' + esc(node.n) + '\",c,p,i);';\n        }\n      },\n\n      '\\n': function(node, context) {\n        context.code += write('\"\\\\n\"' + (node.last ? '' : ' + i'));\n      },\n\n      '_v': function(node, context) {\n        context.code += 't.b(t.v(t.' + chooseMethod(node.n) + '(\"' + esc(node.n) + '\",c,p,0)));';\n      },\n\n      '_t': function(node, context) {\n        context.code += write('\"' + esc(node.text) + '\"');\n      },\n\n      '{': tripleStache,\n\n      '&': tripleStache\n    };\n\n    function tripleStache(node, context) {\n      context.code += 't.b(t.t(t.' + chooseMethod(node.n) + '(\"' + esc(node.n) + '\",c,p,0)));';\n    }\n\n    function write(s) {\n      return 't.b(' + s + ');';\n    }\n\n    Hogan.walk = function(nodelist, context) {\n      var func;\n      for (var i = 0, l = nodelist.length; i < l; i++) {\n        func = Hogan.codegen[nodelist[i].tag];\n        func && func(nodelist[i], context);\n      }\n      return context;\n    };\n\n    Hogan.parse = function(tokens, text, options) {\n      options = options || {};\n      return buildTree(tokens, '', [], options.sectionTags || []);\n    };\n\n    Hogan.cache = {};\n\n    Hogan.cacheKey = function(text, options) {\n      return [text, !!options.asString, !!options.disableLambda, options.delimiters, !!options.modelGet].join('||');\n    };\n\n    Hogan.compile = function(text, options) {\n      options = options || {};\n      var key = Hogan.cacheKey(text, options);\n      var template = this.cache[key];\n\n      if (template) {\n        var partials = template.partials;\n        for (var name in partials) {\n          delete partials[name].instance;\n        }\n        return template;\n      }\n\n      template = this.generate(this.parse(this.scan(text, options.delimiters), text, options), text, options);\n      return this.cache[key] = template;\n    };\n  })( exports );\n  });\n\n  var template = createCommonjsModule(function (module, exports) {\n\n  (function (Hogan) {\n    Hogan.Template = function (codeObj, text, compiler, options) {\n      codeObj = codeObj || {};\n      this.r = codeObj.code || this.r;\n      this.c = compiler;\n      this.options = options || {};\n      this.text = text || '';\n      this.partials = codeObj.partials || {};\n      this.subs = codeObj.subs || {};\n      this.buf = '';\n    };\n\n    Hogan.Template.prototype = {\n      // render: replaced by generated code.\n      r: function (context, partials, indent) { return ''; },\n\n      // variable escaping\n      v: hoganEscape,\n\n      // triple stache\n      t: coerceToString,\n\n      render: function render(context, partials, indent) {\n        return this.ri([context], partials || {}, indent);\n      },\n\n      // render internal -- a hook for overrides that catches partials too\n      ri: function (context, partials, indent) {\n        return this.r(context, partials, indent);\n      },\n\n      // ensurePartial\n      ep: function(symbol, partials) {\n        var partial = this.partials[symbol];\n\n        // check to see that if we've instantiated this partial before\n        var template = partials[partial.name];\n        if (partial.instance && partial.base == template) {\n          return partial.instance;\n        }\n\n        if (typeof template == 'string') {\n          if (!this.c) {\n            throw new Error(\"No compiler available.\");\n          }\n          template = this.c.compile(template, this.options);\n        }\n\n        if (!template) {\n          return null;\n        }\n\n        // We use this to check whether the partials dictionary has changed\n        this.partials[symbol].base = template;\n\n        if (partial.subs) {\n          // Make sure we consider parent template now\n          if (!partials.stackText) partials.stackText = {};\n          for (key in partial.subs) {\n            if (!partials.stackText[key]) {\n              partials.stackText[key] = (this.activeSub !== undefined && partials.stackText[this.activeSub]) ? partials.stackText[this.activeSub] : this.text;\n            }\n          }\n          template = createSpecializedPartial(template, partial.subs, partial.partials,\n            this.stackSubs, this.stackPartials, partials.stackText);\n        }\n        this.partials[symbol].instance = template;\n\n        return template;\n      },\n\n      // tries to find a partial in the current scope and render it\n      rp: function(symbol, context, partials, indent) {\n        var partial = this.ep(symbol, partials);\n        if (!partial) {\n          return '';\n        }\n\n        return partial.ri(context, partials, indent);\n      },\n\n      // render a section\n      rs: function(context, partials, section) {\n        var tail = context[context.length - 1];\n\n        if (!isArray(tail)) {\n          section(context, partials, this);\n          return;\n        }\n\n        for (var i = 0; i < tail.length; i++) {\n          context.push(tail[i]);\n          section(context, partials, this);\n          context.pop();\n        }\n      },\n\n      // maybe start a section\n      s: function(val, ctx, partials, inverted, start, end, tags) {\n        var pass;\n\n        if (isArray(val) && val.length === 0) {\n          return false;\n        }\n\n        if (typeof val == 'function') {\n          val = this.ms(val, ctx, partials, inverted, start, end, tags);\n        }\n\n        pass = !!val;\n\n        if (!inverted && pass && ctx) {\n          ctx.push((typeof val == 'object') ? val : ctx[ctx.length - 1]);\n        }\n\n        return pass;\n      },\n\n      // find values with dotted names\n      d: function(key, ctx, partials, returnFound) {\n        var found,\n            names = key.split('.'),\n            val = this.f(names[0], ctx, partials, returnFound),\n            doModelGet = this.options.modelGet,\n            cx = null;\n\n        if (key === '.' && isArray(ctx[ctx.length - 2])) {\n          val = ctx[ctx.length - 1];\n        } else {\n          for (var i = 1; i < names.length; i++) {\n            found = findInScope(names[i], val, doModelGet);\n            if (found !== undefined) {\n              cx = val;\n              val = found;\n            } else {\n              val = '';\n            }\n          }\n        }\n\n        if (returnFound && !val) {\n          return false;\n        }\n\n        if (!returnFound && typeof val == 'function') {\n          ctx.push(cx);\n          val = this.mv(val, ctx, partials);\n          ctx.pop();\n        }\n\n        return val;\n      },\n\n      // find values with normal names\n      f: function(key, ctx, partials, returnFound) {\n        var val = false,\n            v = null,\n            found = false,\n            doModelGet = this.options.modelGet;\n\n        for (var i = ctx.length - 1; i >= 0; i--) {\n          v = ctx[i];\n          val = findInScope(key, v, doModelGet);\n          if (val !== undefined) {\n            found = true;\n            break;\n          }\n        }\n\n        if (!found) {\n          return (returnFound) ? false : \"\";\n        }\n\n        if (!returnFound && typeof val == 'function') {\n          val = this.mv(val, ctx, partials);\n        }\n\n        return val;\n      },\n\n      // higher order templates\n      ls: function(func, cx, partials, text, tags) {\n        var oldTags = this.options.delimiters;\n\n        this.options.delimiters = tags;\n        this.b(this.ct(coerceToString(func.call(cx, text)), cx, partials));\n        this.options.delimiters = oldTags;\n\n        return false;\n      },\n\n      // compile text\n      ct: function(text, cx, partials) {\n        if (this.options.disableLambda) {\n          throw new Error('Lambda features disabled.');\n        }\n        return this.c.compile(text, this.options).render(cx, partials);\n      },\n\n      // template result buffering\n      b: function(s) { this.buf += s; },\n\n      fl: function() { var r = this.buf; this.buf = ''; return r; },\n\n      // method replace section\n      ms: function(func, ctx, partials, inverted, start, end, tags) {\n        var textSource,\n            cx = ctx[ctx.length - 1],\n            result = func.call(cx);\n\n        if (typeof result == 'function') {\n          if (inverted) {\n            return true;\n          } else {\n            textSource = (this.activeSub && this.subsText && this.subsText[this.activeSub]) ? this.subsText[this.activeSub] : this.text;\n            return this.ls(result, cx, partials, textSource.substring(start, end), tags);\n          }\n        }\n\n        return result;\n      },\n\n      // method replace variable\n      mv: function(func, ctx, partials) {\n        var cx = ctx[ctx.length - 1];\n        var result = func.call(cx);\n\n        if (typeof result == 'function') {\n          return this.ct(coerceToString(result.call(cx)), cx, partials);\n        }\n\n        return result;\n      },\n\n      sub: function(name, context, partials, indent) {\n        var f = this.subs[name];\n        if (f) {\n          this.activeSub = name;\n          f(context, partials, this, indent);\n          this.activeSub = false;\n        }\n      }\n\n    };\n\n    //Find a key in an object\n    function findInScope(key, scope, doModelGet) {\n      var val;\n\n      if (scope && typeof scope == 'object') {\n\n        if (scope[key] !== undefined) {\n          val = scope[key];\n\n        // try lookup with get for backbone or similar model data\n        } else if (doModelGet && scope.get && typeof scope.get == 'function') {\n          val = scope.get(key);\n        }\n      }\n\n      return val;\n    }\n\n    function createSpecializedPartial(instance, subs, partials, stackSubs, stackPartials, stackText) {\n      function PartialTemplate() {}    PartialTemplate.prototype = instance;\n      function Substitutions() {}    Substitutions.prototype = instance.subs;\n      var key;\n      var partial = new PartialTemplate();\n      partial.subs = new Substitutions();\n      partial.subsText = {};  //hehe. substext.\n      partial.buf = '';\n\n      stackSubs = stackSubs || {};\n      partial.stackSubs = stackSubs;\n      partial.subsText = stackText;\n      for (key in subs) {\n        if (!stackSubs[key]) stackSubs[key] = subs[key];\n      }\n      for (key in stackSubs) {\n        partial.subs[key] = stackSubs[key];\n      }\n\n      stackPartials = stackPartials || {};\n      partial.stackPartials = stackPartials;\n      for (key in partials) {\n        if (!stackPartials[key]) stackPartials[key] = partials[key];\n      }\n      for (key in stackPartials) {\n        partial.partials[key] = stackPartials[key];\n      }\n\n      return partial;\n    }\n\n    var rAmp = /&/g,\n        rLt = /</g,\n        rGt = />/g,\n        rApos = /\\'/g,\n        rQuot = /\\\"/g,\n        hChars = /[&<>\\\"\\']/;\n\n    function coerceToString(val) {\n      return String((val === null || val === undefined) ? '' : val);\n    }\n\n    function hoganEscape(str) {\n      str = coerceToString(str);\n      return hChars.test(str) ?\n        str\n          .replace(rAmp, '&amp;')\n          .replace(rLt, '&lt;')\n          .replace(rGt, '&gt;')\n          .replace(rApos, '&#39;')\n          .replace(rQuot, '&quot;') :\n        str;\n    }\n\n    var isArray = Array.isArray || function(a) {\n      return Object.prototype.toString.call(a) === '[object Array]';\n    };\n\n  })( exports );\n  });\n\n  /*\n   *  Copyright 2011 Twitter, Inc.\n   *  Licensed under the Apache License, Version 2.0 (the \"License\");\n   *  you may not use this file except in compliance with the License.\n   *  You may obtain a copy of the License at\n   *\n   *  http://www.apache.org/licenses/LICENSE-2.0\n   *\n   *  Unless required by applicable law or agreed to in writing, software\n   *  distributed under the License is distributed on an \"AS IS\" BASIS,\n   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   *  See the License for the specific language governing permissions and\n   *  limitations under the License.\n   */\n\n  // This file is for use with Node.js. See dist/ for browser files.\n\n\n  compiler.Template = template.Template;\n  compiler.template = compiler.Template;\n  var hogan = compiler;\n\n  var InternalHighlight = createHighlightComponent({\n    createElement: h,\n    Fragment: p\n  });\n\n  var _excluded$g = [\"classNames\"];\n  function Highlight(_ref) {\n    var _ref$classNames = _ref.classNames,\n      classNames = _ref$classNames === void 0 ? {} : _ref$classNames,\n      props = _objectWithoutProperties(_ref, _excluded$g);\n    return h(InternalHighlight, _extends({\n      classNames: {\n        root: cx('ais-Highlight', classNames.root),\n        highlighted: cx('ais-Highlight-highlighted', classNames.highlighted),\n        nonHighlighted: cx('ais-Highlight-nonHighlighted', classNames.nonHighlighted),\n        separator: cx('ais-Highlight-separator', classNames.separator)\n      }\n    }, props));\n  }\n\n  var _excluded$h = [\"hit\", \"attribute\", \"cssClasses\"];\n  function Highlight$1(_ref) {\n    var hit = _ref.hit,\n      attribute = _ref.attribute,\n      cssClasses = _ref.cssClasses,\n      props = _objectWithoutProperties(_ref, _excluded$h);\n    var property = getPropertyByPath(hit._highlightResult, attribute) || [];\n    var properties = toArray(property);\n     _warning(Boolean(properties.length), \"Could not enable highlight for \\\"\".concat(attribute.toString(), \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\\n\\nSee: https://alg.li/highlighting\\n\")) ;\n    var parts = properties.map(function (_ref2) {\n      var value = _ref2.value;\n      return getHighlightedParts(unescape$1(value || ''));\n    });\n    return h(Highlight, _extends({}, props, {\n      parts: parts,\n      classNames: cssClasses\n    }));\n  }\n\n  var _excluded$i = [\"classNames\"];\n  function ReverseHighlight(_ref) {\n    var _ref$classNames = _ref.classNames,\n      classNames = _ref$classNames === void 0 ? {} : _ref$classNames,\n      props = _objectWithoutProperties(_ref, _excluded$i);\n    return h(InternalHighlight, _extends({\n      classNames: {\n        root: cx('ais-ReverseHighlight', classNames.root),\n        highlighted: cx('ais-ReverseHighlight-highlighted', classNames.highlighted),\n        nonHighlighted: cx('ais-ReverseHighlight-nonHighlighted', classNames.nonHighlighted),\n        separator: cx('ais-ReverseHighlight-separator', classNames.separator)\n      }\n    }, props));\n  }\n\n  var _excluded$j = [\"hit\", \"attribute\", \"cssClasses\"],\n    _excluded2$3 = [\"isHighlighted\"];\n  function ReverseHighlight$1(_ref) {\n    var hit = _ref.hit,\n      attribute = _ref.attribute,\n      cssClasses = _ref.cssClasses,\n      props = _objectWithoutProperties(_ref, _excluded$j);\n    var property = getPropertyByPath(hit._highlightResult, attribute) || [];\n    var properties = toArray(property);\n     _warning(Boolean(properties.length), \"Could not enable highlight for \\\"\".concat(attribute.toString(), \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\\n\\nSee: https://alg.li/highlighting\\n\")) ;\n    var parts = properties.map(function (_ref2) {\n      var value = _ref2.value;\n      return getHighlightedParts(unescape$1(value || '')).map(function (_ref3) {\n        var isHighlighted = _ref3.isHighlighted,\n          rest = _objectWithoutProperties(_ref3, _excluded2$3);\n        return _objectSpread2(_objectSpread2({}, rest), {}, {\n          isHighlighted: !isHighlighted\n        });\n      });\n    });\n    return h(ReverseHighlight, _extends({}, props, {\n      parts: parts,\n      classNames: cssClasses\n    }));\n  }\n\n  var _excluded$k = [\"classNames\"];\n  function ReverseSnippet(_ref) {\n    var _ref$classNames = _ref.classNames,\n      classNames = _ref$classNames === void 0 ? {} : _ref$classNames,\n      props = _objectWithoutProperties(_ref, _excluded$k);\n    return h(InternalHighlight, _extends({\n      classNames: {\n        root: cx('ais-ReverseSnippet', classNames.root),\n        highlighted: cx('ais-ReverseSnippet-highlighted', classNames.highlighted),\n        nonHighlighted: cx('ais-ReverseSnippet-nonHighlighted', classNames.nonHighlighted),\n        separator: cx('ais-ReverseSnippet-separator', classNames.separator)\n      }\n    }, props));\n  }\n\n  var _excluded$l = [\"hit\", \"attribute\", \"cssClasses\"],\n    _excluded2$4 = [\"isHighlighted\"];\n  function ReverseSnippet$1(_ref) {\n    var hit = _ref.hit,\n      attribute = _ref.attribute,\n      cssClasses = _ref.cssClasses,\n      props = _objectWithoutProperties(_ref, _excluded$l);\n    var property = getPropertyByPath(hit._snippetResult, attribute) || [];\n    var properties = toArray(property);\n     _warning(Boolean(properties.length), \"Could not enable snippet for \\\"\".concat(attribute.toString(), \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\\n\\nSee: https://alg.li/highlighting\\n\")) ;\n    var parts = properties.map(function (_ref2) {\n      var value = _ref2.value;\n      return getHighlightedParts(unescape$1(value || '')).map(function (_ref3) {\n        var isHighlighted = _ref3.isHighlighted,\n          rest = _objectWithoutProperties(_ref3, _excluded2$4);\n        return _objectSpread2(_objectSpread2({}, rest), {}, {\n          isHighlighted: !isHighlighted\n        });\n      });\n    });\n    return h(ReverseSnippet, _extends({}, props, {\n      parts: parts,\n      classNames: cssClasses\n    }));\n  }\n\n  var _excluded$m = [\"classNames\"];\n  function Snippet(_ref) {\n    var _ref$classNames = _ref.classNames,\n      classNames = _ref$classNames === void 0 ? {} : _ref$classNames,\n      props = _objectWithoutProperties(_ref, _excluded$m);\n    return h(InternalHighlight, _extends({\n      classNames: {\n        root: cx('ais-Snippet', classNames.root),\n        highlighted: cx('ais-Snippet-highlighted', classNames.highlighted),\n        nonHighlighted: cx('ais-Snippet-nonHighlighted', classNames.nonHighlighted),\n        separator: cx('ais-Snippet-separator', classNames.separator)\n      }\n    }, props));\n  }\n\n  var _excluded$n = [\"hit\", \"attribute\", \"cssClasses\"];\n  function Snippet$1(_ref) {\n    var hit = _ref.hit,\n      attribute = _ref.attribute,\n      cssClasses = _ref.cssClasses,\n      props = _objectWithoutProperties(_ref, _excluded$n);\n    var property = getPropertyByPath(hit._snippetResult, attribute) || [];\n    var properties = toArray(property);\n     _warning(Boolean(properties.length), \"Could not enable snippet for \\\"\".concat(attribute.toString(), \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\\n\\nSee: https://alg.li/highlighting\\n\")) ;\n    var parts = properties.map(function (_ref2) {\n      var value = _ref2.value;\n      return getHighlightedParts(unescape$1(value || ''));\n    });\n    return h(Snippet, _extends({}, props, {\n      parts: parts,\n      classNames: cssClasses\n    }));\n  }\n\n  // We add all our template helper methods to the template as lambdas. Note\n  // that lambdas in Mustache are supposed to accept a second argument of\n  // `render` to get the rendered value, not the literal `{{value}}`. But\n  // this is currently broken (see https://github.com/twitter/hogan.js/issues/222).\n  function transformHelpersToHogan() {\n    var helpers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    var compileOptions = arguments.length > 1 ? arguments[1] : undefined;\n    var data = arguments.length > 2 ? arguments[2] : undefined;\n    return Object.keys(helpers).reduce(function (acc, helperKey) {\n      return _objectSpread2(_objectSpread2({}, acc), {}, _defineProperty({}, helperKey, function () {\n        var _this = this;\n        return function (text) {\n          var render = function render(value) {\n            return hogan.compile(value, compileOptions).render(_this);\n          };\n          return helpers[helperKey].call(data, text, render);\n        };\n      }));\n    }, {});\n  }\n  function renderTemplate(_ref) {\n    var templates = _ref.templates,\n      templateKey = _ref.templateKey,\n      compileOptions = _ref.compileOptions,\n      helpers = _ref.helpers,\n      data = _ref.data,\n      bindEvent = _ref.bindEvent,\n      sendEvent = _ref.sendEvent;\n    var template = templates[templateKey];\n    if (typeof template !== 'string' && typeof template !== 'function') {\n      throw new Error(\"Template must be 'string' or 'function', was '\".concat(_typeof(template), \"' (key: \").concat(templateKey, \")\"));\n    }\n    if (typeof template === 'function') {\n      // @MAJOR no longer pass bindEvent when string templates are removed\n      var params = bindEvent || {};\n      params.html = m$1;\n      params.sendEvent = sendEvent;\n      params.components = {\n        Highlight: Highlight$1,\n        ReverseHighlight: ReverseHighlight$1,\n        Snippet: Snippet$1,\n        ReverseSnippet: ReverseSnippet$1\n      };\n\n      // @MAJOR remove the `as any` when string templates are removed\n      // needed because not every template receives sendEvent\n      return template(data, params);\n    }\n    var transformedHelpers = transformHelpersToHogan(helpers, compileOptions, data);\n    return hogan.compile(template, compileOptions).render(_objectSpread2(_objectSpread2({}, data), {}, {\n      helpers: transformedHelpers\n    })).replace(/[ \\n\\r\\t\\f\\xA0]+/g, function (spaces) {\n      return spaces.replace(/(^|\\xA0+)[^\\xA0]+/g, '$1 ');\n    }).trim();\n  }\n\n  var RawHtml = /*#__PURE__*/function (_Component) {\n    _inherits(RawHtml, _Component);\n    var _super = _createSuper(RawHtml);\n    function RawHtml() {\n      var _this;\n      _classCallCheck(this, RawHtml);\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n      _this = _super.call.apply(_super, [this].concat(args));\n      _defineProperty(_assertThisInitialized(_this), \"ref\", y());\n      _defineProperty(_assertThisInitialized(_this), \"nodes\", []);\n      return _this;\n    }\n    _createClass(RawHtml, [{\n      key: \"componentDidMount\",\n      value: function componentDidMount() {\n        var fragment = new DocumentFragment();\n        var root = document.createElement('div');\n        root.innerHTML = this.props.content;\n        this.nodes = _toConsumableArray(root.childNodes);\n        this.nodes.forEach(function (node) {\n          return fragment.appendChild(node);\n        });\n        this.ref.current.replaceWith(fragment);\n      }\n    }, {\n      key: \"componentWillUnmount\",\n      value: function componentWillUnmount() {\n        this.nodes.forEach(function (node) {\n          if (node instanceof Element) {\n            node.outerHTML = '';\n            return;\n          }\n          node.nodeValue = '';\n        });\n        // if there is one TextNode first and one TextNode last, the\n        // last one's nodeValue will be assigned to the first.\n        if (this.nodes[0].nodeValue) {\n          this.nodes[0].nodeValue = '';\n        }\n      }\n    }, {\n      key: \"render\",\n      value: function render() {\n        return h(\"div\", {\n          ref: this.ref\n        });\n      }\n    }]);\n    return RawHtml;\n  }(d);\n  var defaultProps = {\n    data: {},\n    rootTagName: 'div',\n    useCustomCompileOptions: {},\n    templates: {},\n    templatesConfig: {}\n  };\n  // @TODO: Template should be a generic and receive TData to pass to Templates (to avoid TTemplateData to be set as `any`)\n  var Template = /*#__PURE__*/function (_Component2) {\n    _inherits(Template, _Component2);\n    var _super2 = _createSuper(Template);\n    function Template() {\n      _classCallCheck(this, Template);\n      return _super2.apply(this, arguments);\n    }\n    _createClass(Template, [{\n      key: \"shouldComponentUpdate\",\n      value: function shouldComponentUpdate(nextProps) {\n        return !isEqual(this.props.data, nextProps.data) || this.props.templateKey !== nextProps.templateKey || !isEqual(this.props.rootProps, nextProps.rootProps);\n      }\n    }, {\n      key: \"render\",\n      value: function render() {\n        var _this2 = this;\n        {\n          var nonFunctionTemplates = Object.keys(this.props.templates).filter(function (key) {\n            return typeof _this2.props.templates[key] !== 'function';\n          });\n           _warning(nonFunctionTemplates.length === 0, \"Hogan.js and string-based templates are deprecated and will not be supported in InstantSearch.js 5.x.\\n\\nYou can replace them with function-form templates and use either the provided `html` function or JSX templates.\\n\\nString-based templates: \".concat(nonFunctionTemplates.join(', '), \".\\n\\nSee: https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/#upgrade-templates\")) ;\n        }\n        var RootTagName = this.props.rootTagName === 'fragment' ? p : this.props.rootTagName;\n        var useCustomCompileOptions = this.props.useCustomCompileOptions[this.props.templateKey];\n        var compileOptions = useCustomCompileOptions ? this.props.templatesConfig.compileOptions : {};\n        var content = renderTemplate({\n          templates: this.props.templates,\n          templateKey: this.props.templateKey,\n          compileOptions: compileOptions,\n          helpers: this.props.templatesConfig.helpers,\n          data: this.props.data,\n          bindEvent: this.props.bindEvent,\n          sendEvent: this.props.sendEvent\n        });\n        if (content === null) {\n          // Adds a noscript to the DOM but virtual DOM is null\n          // See http://facebook.github.io/react/docs/component-specs.html#render\n          return null;\n        }\n        if (_typeof(content) === 'object') {\n          return h(RootTagName, this.props.rootProps, content);\n        }\n\n        // This is to handle Hogan templates with Fragment as rootTagName\n        if (RootTagName === p) {\n          return h(RawHtml, {\n            content: content,\n            key: Math.random()\n          });\n        }\n        return h(RootTagName, _extends({}, this.props.rootProps, {\n          dangerouslySetInnerHTML: {\n            __html: content\n          }\n        }));\n      }\n    }]);\n    return Template;\n  }(d);\n  _defineProperty(Template, \"defaultProps\", defaultProps);\n\n  var Answers = function Answers(_ref) {\n    var hits = _ref.hits,\n      isLoading = _ref.isLoading,\n      cssClasses = _ref.cssClasses,\n      templateProps = _ref.templateProps;\n    return h(\"div\", {\n      className: cx(cssClasses.root, hits.length === 0 && cssClasses.emptyRoot)\n    }, h(Template, _extends({}, templateProps, {\n      templateKey: \"header\",\n      rootProps: {\n        className: cssClasses.header\n      },\n      data: {\n        hits: hits,\n        isLoading: isLoading\n      }\n    })), isLoading ? h(Template, _extends({}, templateProps, {\n      templateKey: \"loader\",\n      rootProps: {\n        className: cssClasses.loader\n      }\n    })) : h(\"ul\", {\n      className: cssClasses.list\n    }, hits.map(function (hit, index) {\n      return h(Template, _extends({}, templateProps, {\n        templateKey: \"item\",\n        rootTagName: \"li\",\n        rootProps: {\n          className: cssClasses.item\n        },\n        key: hit.objectID,\n        data: _objectSpread2(_objectSpread2({}, hit), {}, {\n          get __hitIndex() {\n             _warning(false, 'The `__hitIndex` property is deprecated. Use the absolute `__position` instead.') ;\n            return index;\n          }\n        })\n      }));\n    })));\n  };\n\n  var defaultTemplates = {\n    header: function header() {\n      return '';\n    },\n    loader: function loader() {\n      return '';\n    },\n    item: function item(_item) {\n      return JSON.stringify(_item);\n    }\n  };\n\n  var withUsage$w = createDocumentationMessageGenerator({\n    name: 'answers'\n  });\n  var suit$4 = component('Answers');\n  var renderer = function renderer(_ref) {\n    var containerNode = _ref.containerNode,\n      cssClasses = _ref.cssClasses,\n      renderState = _ref.renderState,\n      templates = _ref.templates;\n    return function (_ref2, isFirstRendering) {\n      var hits = _ref2.hits,\n        isLoading = _ref2.isLoading,\n        instantSearchInstance = _ref2.instantSearchInstance;\n      if (isFirstRendering) {\n        renderState.templateProps = prepareTemplateProps({\n          defaultTemplates: defaultTemplates,\n          templatesConfig: instantSearchInstance.templatesConfig,\n          templates: templates\n        });\n        return;\n      }\n      P(h(Answers, {\n        cssClasses: cssClasses,\n        hits: hits,\n        isLoading: isLoading,\n        templateProps: renderState.templateProps\n      }), containerNode);\n    };\n  };\n  /**\n   * @deprecated the answers service is no longer offered, and this widget will be removed in InstantSearch.js v5\n   */\n  var answersWidget = function answersWidget(widgetParams) {\n    var _ref3 = widgetParams || {},\n      container = _ref3.container,\n      attributesForPrediction = _ref3.attributesForPrediction,\n      queryLanguages = _ref3.queryLanguages,\n      nbHits = _ref3.nbHits,\n      searchDebounceTime = _ref3.searchDebounceTime,\n      renderDebounceTime = _ref3.renderDebounceTime,\n      escapeHTML = _ref3.escapeHTML,\n      extraParameters = _ref3.extraParameters,\n      _ref3$templates = _ref3.templates,\n      templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n      _ref3$cssClasses = _ref3.cssClasses,\n      userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses;\n    if (!container) {\n      throw new Error(withUsage$w('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$4(), userCssClasses.root),\n      emptyRoot: cx(suit$4({\n        modifierName: 'empty'\n      }), userCssClasses.emptyRoot),\n      header: cx(suit$4({\n        descendantName: 'header'\n      }), userCssClasses.header),\n      loader: cx(suit$4({\n        descendantName: 'loader'\n      }), userCssClasses.loader),\n      list: cx(suit$4({\n        descendantName: 'list'\n      }), userCssClasses.list),\n      item: cx(suit$4({\n        descendantName: 'item'\n      }), userCssClasses.item)\n    };\n    var specializedRenderer = renderer({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      templates: templates,\n      renderState: {}\n    });\n    var makeWidget = connectAnswers(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      attributesForPrediction: attributesForPrediction,\n      queryLanguages: queryLanguages,\n      nbHits: nbHits,\n      searchDebounceTime: searchDebounceTime,\n      renderDebounceTime: renderDebounceTime,\n      escapeHTML: escapeHTML,\n      extraParameters: extraParameters\n    })), {}, {\n      $$widgetType: 'ais.answers'\n    });\n  };\n  var answers = deprecate(answersWidget, 'The answers widget is deprecated and will be removed in InstantSearch.js 5.0');\n\n  var configureRelatedItems = function configureRelatedItems(widgetParams) {\n    var makeWidget = connectConfigureRelatedItems(noop);\n    return _objectSpread2(_objectSpread2({}, makeWidget(widgetParams)), {}, {\n      $$widgetType: 'ais.configureRelatedItems'\n    });\n  };\n\n  var _excluded$o = [\"container\", \"widgets\", \"fallbackWidget\"];\n  var withUsage$x = createDocumentationMessageGenerator({\n    name: 'dynamic-widgets'\n  });\n  var suit$5 = component('DynamicWidgets');\n  function createContainer(rootContainer) {\n    var container = document.createElement('div');\n    container.className = suit$5({\n      descendantName: 'widget'\n    });\n    rootContainer.appendChild(container);\n    return container;\n  }\n  var dynamicWidgets = function dynamicWidgets(widgetParams) {\n    var _ref = widgetParams || {},\n      containerSelector = _ref.container,\n      widgets = _ref.widgets,\n      fallbackWidget = _ref.fallbackWidget,\n      otherWidgetParams = _objectWithoutProperties(_ref, _excluded$o);\n    if (!containerSelector) {\n      throw new Error(withUsage$x('The `container` option is required.'));\n    }\n    if (!(widgets && Array.isArray(widgets) && widgets.every(function (widget) {\n      return typeof widget === 'function';\n    }))) {\n      throw new Error(withUsage$x('The `widgets` option expects an array of callbacks.'));\n    }\n    var userContainer = getContainerNode(containerSelector);\n    var rootContainer = document.createElement('div');\n    rootContainer.className = suit$5();\n    var containers = new Map();\n    var connectorWidgets = [];\n    var makeWidget = connectDynamicWidgets(function (_ref2, isFirstRender) {\n      var attributesToRender = _ref2.attributesToRender;\n      if (isFirstRender) {\n        userContainer.appendChild(rootContainer);\n      }\n      attributesToRender.forEach(function (attribute) {\n        if (!containers.has(attribute)) {\n          return;\n        }\n        var container = containers.get(attribute);\n        rootContainer.appendChild(container);\n      });\n    }, function () {\n      userContainer.removeChild(rootContainer);\n    });\n    var widget = makeWidget(_objectSpread2(_objectSpread2({}, otherWidgetParams), {}, {\n      widgets: connectorWidgets,\n      fallbackWidget: typeof fallbackWidget === 'function' ? function (_ref3) {\n        var attribute = _ref3.attribute;\n        var container = createContainer(rootContainer);\n        containers.set(attribute, container);\n        return fallbackWidget({\n          attribute: attribute,\n          container: container\n        });\n      } : undefined\n    }));\n    return _objectSpread2(_objectSpread2({}, widget), {}, {\n      init: function init(initOptions) {\n        widgets.forEach(function (cb) {\n          var container = createContainer(rootContainer);\n          var childWidget = cb(container);\n          var attribute = getWidgetAttribute(childWidget, initOptions);\n          containers.set(attribute, container);\n          connectorWidgets.push(childWidget);\n        });\n        widget.init(initOptions);\n      },\n      $$widgetType: 'ais.dynamicWidgets'\n    });\n  };\n\n  var withUsage$y = createDocumentationMessageGenerator({\n    name: 'analytics'\n  });\n  // @major this widget will be removed from the next major version.\n  var analytics = function analytics(widgetParams) {\n    var _ref = widgetParams || {},\n      pushFunction = _ref.pushFunction,\n      _ref$delay = _ref.delay,\n      delay = _ref$delay === void 0 ? 3000 : _ref$delay,\n      _ref$triggerOnUIInter = _ref.triggerOnUIInteraction,\n      triggerOnUIInteraction = _ref$triggerOnUIInter === void 0 ? false : _ref$triggerOnUIInter,\n      _ref$pushInitialSearc = _ref.pushInitialSearch,\n      pushInitialSearch = _ref$pushInitialSearc === void 0 ? true : _ref$pushInitialSearc,\n      _ref$pushPagination = _ref.pushPagination,\n      pushPagination = _ref$pushPagination === void 0 ? false : _ref$pushPagination;\n    if (!pushFunction) {\n      throw new Error(withUsage$y('The `pushFunction` option is required.'));\n    }\n     _warning(false, \"`analytics` widget has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `insights` middleware.\\n\\nFor the migration, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/#analytics-widget\") ;\n    var cachedState = null;\n    var serializeRefinements = function serializeRefinements(parameters) {\n      var refinements = [];\n\n      // eslint-disable-next-line no-restricted-syntax\n      for (var parameter in parameters) {\n        if (parameters.hasOwnProperty(parameter)) {\n          var values = parameters[parameter].join('+');\n          refinements.push(\"\".concat(encodeURIComponent(parameter), \"=\").concat(encodeURIComponent(parameter), \"_\").concat(encodeURIComponent(values)));\n        }\n      }\n      return refinements.join('&');\n    };\n    var serializeNumericRefinements = function serializeNumericRefinements(numericRefinements) {\n      var refinements = [];\n\n      // eslint-disable-next-line no-restricted-syntax\n      for (var attribute in numericRefinements) {\n        if (numericRefinements.hasOwnProperty(attribute)) {\n          var filter = numericRefinements[attribute];\n          if (filter.hasOwnProperty('>=') && filter.hasOwnProperty('<=')) {\n            if (filter['>='] && filter['>='][0] === filter['<='] && filter['<='][0]) {\n              refinements.push(\"\".concat(attribute, \"=\").concat(attribute, \"_\").concat(filter['>=']));\n            } else {\n              refinements.push(\"\".concat(attribute, \"=\").concat(attribute, \"_\").concat(filter['>='], \"to\").concat(filter['<=']));\n            }\n          } else if (filter.hasOwnProperty('>=')) {\n            refinements.push(\"\".concat(attribute, \"=\").concat(attribute, \"_from\").concat(filter['>=']));\n          } else if (filter.hasOwnProperty('<=')) {\n            refinements.push(\"\".concat(attribute, \"=\").concat(attribute, \"_to\").concat(filter['<=']));\n          } else if (filter.hasOwnProperty('=')) {\n            var equals = [];\n\n            // eslint-disable-next-line no-restricted-syntax\n            for (var equal in filter['=']) {\n              // eslint-disable-next-line max-depth\n              if (filter['='].hasOwnProperty(equal)) {\n                // @ts-ignore somehow 'equal' is a string, even though it's a number?\n                equals.push(filter['='][equal]);\n              }\n            }\n            refinements.push(\"\".concat(attribute, \"=\").concat(attribute, \"_\").concat(equals.join('-')));\n          }\n        }\n      }\n      return refinements.join('&');\n    };\n    var lastSentData = '';\n    var sendAnalytics = function sendAnalytics(analyticsState) {\n      if (analyticsState === null) {\n        return;\n      }\n      var serializedParams = [];\n      var serializedRefinements = serializeRefinements(_objectSpread2(_objectSpread2(_objectSpread2({}, analyticsState.state.disjunctiveFacetsRefinements), analyticsState.state.facetsRefinements), analyticsState.state.hierarchicalFacetsRefinements));\n      var serializedNumericRefinements = serializeNumericRefinements(analyticsState.state.numericRefinements);\n      if (serializedRefinements !== '') {\n        serializedParams.push(serializedRefinements);\n      }\n      if (serializedNumericRefinements !== '') {\n        serializedParams.push(serializedNumericRefinements);\n      }\n      var stringifiedParams = serializedParams.join('&');\n      var dataToSend = \"Query: \".concat(analyticsState.state.query || '', \", \").concat(stringifiedParams);\n      if (pushPagination === true) {\n        dataToSend += \", Page: \".concat(analyticsState.state.page || 0);\n      }\n      if (lastSentData !== dataToSend) {\n        pushFunction(stringifiedParams, analyticsState.state, analyticsState.results);\n        lastSentData = dataToSend;\n      }\n    };\n    var pushTimeout;\n    var isInitialSearch = true;\n    if (pushInitialSearch === true) {\n      isInitialSearch = false;\n    }\n    var onClick = function onClick() {\n      sendAnalytics(cachedState);\n    };\n    var onUnload = function onUnload() {\n      sendAnalytics(cachedState);\n    };\n    return {\n      $$type: 'ais.analytics',\n      $$widgetType: 'ais.analytics',\n      init: function init() {\n        if (triggerOnUIInteraction === true) {\n          document.addEventListener('click', onClick);\n          window.addEventListener('beforeunload', onUnload);\n        }\n      },\n      render: function render(_ref2) {\n        var results = _ref2.results,\n          state = _ref2.state;\n        if (!results) {\n          return;\n        }\n        if (isInitialSearch === true) {\n          isInitialSearch = false;\n          return;\n        }\n        cachedState = {\n          results: results,\n          state: state\n        };\n        if (pushTimeout) {\n          clearTimeout(pushTimeout);\n        }\n        pushTimeout = window.setTimeout(function () {\n          return sendAnalytics(cachedState);\n        }, delay);\n      },\n      dispose: function dispose() {\n        if (triggerOnUIInteraction === true) {\n          document.removeEventListener('click', onClick);\n          window.removeEventListener('beforeunload', onUnload);\n        }\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread2(_objectSpread2({}, renderState), {}, {\n          analytics: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState() {\n        return {\n          widgetParams: widgetParams\n        };\n      }\n    };\n  };\n\n  var Breadcrumb = function Breadcrumb(_ref) {\n    var items = _ref.items,\n      cssClasses = _ref.cssClasses,\n      templateProps = _ref.templateProps,\n      createURL = _ref.createURL,\n      refine = _ref.refine;\n    return h(\"div\", {\n      className: cx(cssClasses.root, items.length === 0 && cssClasses.noRefinementRoot)\n    }, h(\"ul\", {\n      className: cssClasses.list\n    }, h(\"li\", {\n      className: cx(cssClasses.item, items.length === 0 && cssClasses.selectedItem)\n    }, h(Template, _extends({}, templateProps, {\n      templateKey: \"home\",\n      rootTagName: \"a\",\n      rootProps: {\n        className: cssClasses.link,\n        href: createURL(null),\n        onClick: function onClick(event) {\n          if (isSpecialClick(event)) {\n            return;\n          }\n          event.preventDefault();\n          refine(null);\n        }\n      }\n    }))), items.map(function (item, idx) {\n      var isLast = idx === items.length - 1;\n      return h(\"li\", {\n        key: item.label + idx,\n        className: cx(cssClasses.item, isLast && cssClasses.selectedItem)\n      }, h(Template, _extends({}, templateProps, {\n        templateKey: \"separator\",\n        rootTagName: \"span\",\n        rootProps: {\n          className: cssClasses.separator,\n          'aria-hidden': true\n        }\n      })), isLast ? item.label : h(\"a\", {\n        className: cssClasses.link,\n        href: createURL(item.value),\n        onClick: function onClick(event) {\n          if (isSpecialClick(event)) {\n            return;\n          }\n          event.preventDefault();\n          refine(item.value);\n        }\n      }, item.label));\n    })));\n  };\n\n  var defaultTemplates$1 = {\n    home: function home() {\n      return 'Home';\n    },\n    separator: function separator() {\n      return '>';\n    }\n  };\n\n  var withUsage$z = createDocumentationMessageGenerator({\n    name: 'breadcrumb'\n  });\n  var suit$6 = component('Breadcrumb');\n  var renderer$1 = function renderer(_ref) {\n    var containerNode = _ref.containerNode,\n      cssClasses = _ref.cssClasses,\n      renderState = _ref.renderState,\n      templates = _ref.templates;\n    return function (_ref2, isFirstRendering) {\n      var canRefine = _ref2.canRefine,\n        createURL = _ref2.createURL,\n        instantSearchInstance = _ref2.instantSearchInstance,\n        items = _ref2.items,\n        refine = _ref2.refine;\n      if (isFirstRendering) {\n        renderState.templateProps = prepareTemplateProps({\n          defaultTemplates: defaultTemplates$1,\n          templatesConfig: instantSearchInstance.templatesConfig,\n          templates: templates\n        });\n        return;\n      }\n      P(h(Breadcrumb, {\n        canRefine: canRefine,\n        cssClasses: cssClasses,\n        createURL: createURL,\n        items: items,\n        refine: refine,\n        templateProps: renderState.templateProps\n      }), containerNode);\n    };\n  };\n  var breadcrumb = function breadcrumb(widgetParams) {\n    var _ref3 = widgetParams || {},\n      container = _ref3.container,\n      attributes = _ref3.attributes,\n      separator = _ref3.separator,\n      rootPath = _ref3.rootPath,\n      transformItems = _ref3.transformItems,\n      _ref3$templates = _ref3.templates,\n      templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n      _ref3$cssClasses = _ref3.cssClasses,\n      userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses;\n    if (!container) {\n      throw new Error(withUsage$z('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$6(), userCssClasses.root),\n      noRefinementRoot: cx(suit$6({\n        modifierName: 'noRefinement'\n      }), userCssClasses.noRefinementRoot),\n      list: cx(suit$6({\n        descendantName: 'list'\n      }), userCssClasses.list),\n      item: cx(suit$6({\n        descendantName: 'item'\n      }), userCssClasses.item),\n      selectedItem: cx(suit$6({\n        descendantName: 'item',\n        modifierName: 'selected'\n      }), userCssClasses.selectedItem),\n      separator: cx(suit$6({\n        descendantName: 'separator'\n      }), userCssClasses.separator),\n      link: cx(suit$6({\n        descendantName: 'link'\n      }), userCssClasses.link)\n    };\n    var specializedRenderer = renderer$1({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      renderState: {},\n      templates: templates\n    });\n    var makeWidget = connectBreadcrumb(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      attributes: attributes,\n      separator: separator,\n      rootPath: rootPath,\n      transformItems: transformItems\n    })), {}, {\n      $$widgetType: 'ais.breadcrumb'\n    });\n  };\n\n  var ClearRefinements = function ClearRefinements(_ref) {\n    var hasRefinements = _ref.hasRefinements,\n      refine = _ref.refine,\n      cssClasses = _ref.cssClasses,\n      templateProps = _ref.templateProps;\n    return h(\"div\", {\n      className: cssClasses.root\n    }, h(Template, _extends({}, templateProps, {\n      templateKey: \"resetLabel\",\n      rootTagName: \"button\",\n      rootProps: {\n        className: cx(cssClasses.button, !hasRefinements && cssClasses.disabledButton),\n        onClick: refine,\n        disabled: !hasRefinements\n      },\n      data: {\n        hasRefinements: hasRefinements\n      }\n    })));\n  };\n\n  var defaultTemplates$2 = {\n    resetLabel: function resetLabel() {\n      return 'Clear refinements';\n    }\n  };\n\n  var withUsage$A = createDocumentationMessageGenerator({\n    name: 'clear-refinements'\n  });\n  var suit$7 = component('ClearRefinements');\n  var renderer$2 = function renderer(_ref) {\n    var containerNode = _ref.containerNode,\n      cssClasses = _ref.cssClasses,\n      renderState = _ref.renderState,\n      templates = _ref.templates;\n    return function (_ref2, isFirstRendering) {\n      var refine = _ref2.refine,\n        canRefine = _ref2.canRefine,\n        instantSearchInstance = _ref2.instantSearchInstance;\n      if (isFirstRendering) {\n        renderState.templateProps = prepareTemplateProps({\n          defaultTemplates: defaultTemplates$2,\n          templatesConfig: instantSearchInstance.templatesConfig,\n          templates: templates\n        });\n        return;\n      }\n      P(h(ClearRefinements, {\n        refine: refine,\n        cssClasses: cssClasses,\n        hasRefinements: canRefine,\n        templateProps: renderState.templateProps\n      }), containerNode);\n    };\n  };\n  var clearRefinements$1 = function clearRefinements(widgetParams) {\n    var _ref3 = widgetParams || {},\n      container = _ref3.container,\n      _ref3$templates = _ref3.templates,\n      templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n      includedAttributes = _ref3.includedAttributes,\n      excludedAttributes = _ref3.excludedAttributes,\n      transformItems = _ref3.transformItems,\n      _ref3$cssClasses = _ref3.cssClasses,\n      userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses;\n    if (!container) {\n      throw new Error(withUsage$A('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$7(), userCssClasses.root),\n      button: cx(suit$7({\n        descendantName: 'button'\n      }), userCssClasses.button),\n      disabledButton: cx(suit$7({\n        descendantName: 'button',\n        modifierName: 'disabled'\n      }), userCssClasses.disabledButton)\n    };\n    var specializedRenderer = renderer$2({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      renderState: {},\n      templates: templates\n    });\n    var makeWidget = connectClearRefinements(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      includedAttributes: includedAttributes,\n      excludedAttributes: excludedAttributes,\n      transformItems: transformItems\n    })), {}, {\n      $$widgetType: 'ais.clearRefinements'\n    });\n  };\n\n  /**\n   * A list of [search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/)\n   * to enable when the widget mounts.\n   */\n\n  var configure = function configure(widgetParams) {\n    // This is a renderless widget that falls back to the connector's\n    // noop render and unmount functions.\n    var makeWidget = connectConfigure(noop);\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      searchParameters: widgetParams\n    })), {}, {\n      $$widgetType: 'ais.configure'\n    });\n  };\n\n  var createItemKey = function createItemKey(_ref) {\n    var attribute = _ref.attribute,\n      value = _ref.value,\n      type = _ref.type,\n      operator = _ref.operator;\n    return [attribute, type, value, operator].map(function (key) {\n      return key;\n    }).filter(Boolean).join(':');\n  };\n  var handleClick = function handleClick(callback) {\n    return function (event) {\n      if (isSpecialClick(event)) {\n        return;\n      }\n      event.preventDefault();\n      callback();\n    };\n  };\n  var CurrentRefinements = function CurrentRefinements(_ref2) {\n    var items = _ref2.items,\n      cssClasses = _ref2.cssClasses,\n      canRefine = _ref2.canRefine;\n    return h(\"div\", {\n      className: cx(cssClasses.root, !canRefine && cssClasses.noRefinementRoot)\n    }, h(\"ul\", {\n      className: cssClasses.list\n    }, items.map(function (item, index) {\n      return h(\"li\", {\n        key: \"\".concat(item.indexName, \"-\").concat(item.attribute, \"-\").concat(index),\n        className: cssClasses.item\n      }, h(\"span\", {\n        className: cssClasses.label\n      }, capitalize(item.label), \": \"), item.refinements.map(function (refinement) {\n        return h(\"span\", {\n          key: createItemKey(refinement),\n          className: cssClasses.category\n        }, h(\"span\", {\n          className: cssClasses.categoryLabel\n        }, refinement.attribute === 'query' ? h(\"q\", null, refinement.label) : refinement.label), h(\"button\", {\n          className: cssClasses.delete,\n          type: \"button\",\n          onClick: handleClick(item.refine.bind(null, refinement))\n        }, \"\\u2715\"));\n      }));\n    })));\n  };\n\n  var withUsage$B = createDocumentationMessageGenerator({\n    name: 'current-refinements'\n  });\n  var suit$8 = component('CurrentRefinements');\n  var renderer$3 = function renderer(_ref, isFirstRender) {\n    var items = _ref.items,\n      widgetParams = _ref.widgetParams,\n      canRefine = _ref.canRefine;\n    if (isFirstRender) {\n      return;\n    }\n    var _ref2 = widgetParams,\n      container = _ref2.container,\n      cssClasses = _ref2.cssClasses;\n    P(h(CurrentRefinements, {\n      cssClasses: cssClasses,\n      items: items,\n      canRefine: canRefine\n    }), container);\n  };\n  var currentRefinements = function currentRefinements(widgetParams) {\n    var _ref3 = widgetParams || {},\n      container = _ref3.container,\n      includedAttributes = _ref3.includedAttributes,\n      excludedAttributes = _ref3.excludedAttributes,\n      _ref3$cssClasses = _ref3.cssClasses,\n      userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n      transformItems = _ref3.transformItems;\n    if (!container) {\n      throw new Error(withUsage$B('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$8(), userCssClasses.root),\n      noRefinementRoot: cx(suit$8({\n        modifierName: 'noRefinement'\n      }), userCssClasses.noRefinementRoot),\n      list: cx(suit$8({\n        descendantName: 'list'\n      }), userCssClasses.list),\n      item: cx(suit$8({\n        descendantName: 'item'\n      }), userCssClasses.item),\n      label: cx(suit$8({\n        descendantName: 'label'\n      }), userCssClasses.label),\n      category: cx(suit$8({\n        descendantName: 'category'\n      }), userCssClasses.category),\n      categoryLabel: cx(suit$8({\n        descendantName: 'categoryLabel'\n      }), userCssClasses.categoryLabel),\n      delete: cx(suit$8({\n        descendantName: 'delete'\n      }), userCssClasses.delete)\n    };\n    var makeWidget = connectCurrentRefinements(renderer$3, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      container: containerNode,\n      cssClasses: cssClasses,\n      includedAttributes: includedAttributes,\n      excludedAttributes: excludedAttributes,\n      transformItems: transformItems\n    })), {}, {\n      $$widgetType: 'ais.currentRefinements'\n    });\n  };\n\n  var createHTMLMarker = function createHTMLMarker(googleReference) {\n    var HTMLMarker = /*#__PURE__*/function (_googleReference$maps) {\n      _inherits(HTMLMarker, _googleReference$maps);\n      var _super = _createSuper(HTMLMarker);\n      function HTMLMarker(_ref) {\n        var _this;\n        var __id = _ref.__id,\n          position = _ref.position,\n          map = _ref.map,\n          template = _ref.template,\n          className = _ref.className,\n          _ref$anchor = _ref.anchor,\n          anchor = _ref$anchor === void 0 ? {\n            x: 0,\n            y: 0\n          } : _ref$anchor;\n        _classCallCheck(this, HTMLMarker);\n        _this = _super.call(this);\n        _defineProperty(_assertThisInitialized(_this), \"__id\", void 0);\n        _defineProperty(_assertThisInitialized(_this), \"anchor\", void 0);\n        _defineProperty(_assertThisInitialized(_this), \"offset\", void 0);\n        _defineProperty(_assertThisInitialized(_this), \"listeners\", void 0);\n        _defineProperty(_assertThisInitialized(_this), \"latLng\", void 0);\n        _defineProperty(_assertThisInitialized(_this), \"element\", void 0);\n        _this.__id = __id;\n        _this.anchor = anchor;\n        _this.listeners = {};\n        _this.latLng = new googleReference.maps.LatLng(position);\n        _this.element = document.createElement('div');\n        _this.element.className = className;\n        _this.element.style.position = 'absolute';\n        if (_typeof(template) === 'object') {\n          P(template, _this.element);\n        } else {\n          _this.element.innerHTML = template;\n        }\n        _this.setMap(map);\n        return _this;\n      }\n      _createClass(HTMLMarker, [{\n        key: \"onAdd\",\n        value: function onAdd() {\n          // Append the element to the map\n          this.getPanes().overlayMouseTarget.appendChild(this.element);\n\n          // Compute the offset onAdd & cache it because afterwards\n          // it won't retrieve the correct values, we also avoid\n          // to read the values on every draw\n          var bbBox = this.element.getBoundingClientRect();\n          this.offset = {\n            x: this.anchor.x + bbBox.width / 2,\n            y: this.anchor.y + bbBox.height\n          };\n\n          // Force the width of the element will avoid the\n          // content to collapse when we move the map\n          this.element.style.width = \"\".concat(bbBox.width, \"px\");\n        }\n      }, {\n        key: \"draw\",\n        value: function draw() {\n          var position = this.getProjection().fromLatLngToDivPixel(this.latLng);\n          this.element.style.left = \"\".concat(Math.round(position.x - this.offset.x), \"px\");\n          this.element.style.top = \"\".concat(Math.round(position.y - this.offset.y), \"px\");\n\n          // Markers to the south are in front of markers to the north\n          // This is the default behaviour of Google Maps\n          this.element.style.zIndex = String(parseInt(this.element.style.top, 10));\n        }\n      }, {\n        key: \"onRemove\",\n        value: function onRemove() {\n          var _this2 = this;\n          if (this.element) {\n            this.element.parentNode.removeChild(this.element);\n            Object.keys(this.listeners).forEach(function (eventName) {\n              _this2.element.removeEventListener(eventName, _this2.listeners[eventName]);\n            });\n\n            // after onRemove the class is no longer used, thus it can be deleted\n            // @ts-expect-error\n            delete this.element;\n            // @ts-expect-error\n            delete this.listeners;\n          }\n        }\n      }, {\n        key: \"addListener\",\n        value: function addListener(eventName, listener) {\n          this.listeners[eventName] = listener;\n          var element = this.element;\n          element.addEventListener(eventName, listener);\n          return {\n            remove: function remove() {\n              return element.removeEventListener(eventName, listener);\n            }\n          };\n        }\n      }, {\n        key: \"getPosition\",\n        value: function getPosition() {\n          return this.latLng;\n        }\n      }]);\n      return HTMLMarker;\n    }(googleReference.maps.OverlayView);\n    return HTMLMarker;\n  };\n\n  var _ref = h(\"p\", null, \"Your custom HTML Marker\");\n  var defaultTemplates$3 = {\n    HTMLMarker: function HTMLMarker() {\n      return _ref;\n    },\n    reset: function reset() {\n      return 'Clear the map refinement';\n    },\n    toggle: function toggle() {\n      return 'Search as I move the map';\n    },\n    redo: function redo() {\n      return 'Redo search here';\n    }\n  };\n\n  var GeoSearchButton = function GeoSearchButton(_ref) {\n    var className = _ref.className,\n      _ref$disabled = _ref.disabled,\n      disabled = _ref$disabled === void 0 ? false : _ref$disabled,\n      onClick = _ref.onClick,\n      children = _ref.children;\n    return h(\"button\", {\n      className: className,\n      onClick: onClick,\n      disabled: disabled\n    }, children);\n  };\n\n  var GeoSearchToggle = function GeoSearchToggle(_ref) {\n    var classNameLabel = _ref.classNameLabel,\n      classNameInput = _ref.classNameInput,\n      checked = _ref.checked,\n      onToggle = _ref.onToggle,\n      children = _ref.children;\n    return h(\"label\", {\n      className: classNameLabel\n    }, h(\"input\", {\n      className: classNameInput,\n      type: \"checkbox\",\n      checked: checked,\n      onChange: onToggle\n    }), children);\n  };\n\n  var GeoSearchControls = function GeoSearchControls(_ref) {\n    var cssClasses = _ref.cssClasses,\n      enableRefine = _ref.enableRefine,\n      enableRefineControl = _ref.enableRefineControl,\n      enableClearMapRefinement = _ref.enableClearMapRefinement,\n      isRefineOnMapMove = _ref.isRefineOnMapMove,\n      isRefinedWithMap = _ref.isRefinedWithMap,\n      hasMapMoveSinceLastRefine = _ref.hasMapMoveSinceLastRefine,\n      onRefineToggle = _ref.onRefineToggle,\n      onRefineClick = _ref.onRefineClick,\n      onClearClick = _ref.onClearClick,\n      templateProps = _ref.templateProps;\n    return h(p, null, enableRefine && h(\"div\", null, enableRefineControl && h(\"div\", {\n      className: cssClasses.control\n    }, isRefineOnMapMove || !hasMapMoveSinceLastRefine ? h(GeoSearchToggle, {\n      classNameLabel: cx(cssClasses.label, isRefineOnMapMove && cssClasses.selectedLabel),\n      classNameInput: cssClasses.input,\n      checked: isRefineOnMapMove,\n      onToggle: onRefineToggle\n    }, h(Template, _extends({}, templateProps, {\n      templateKey: \"toggle\",\n      rootTagName: \"span\"\n    }))) : h(GeoSearchButton, {\n      className: cssClasses.redo,\n      disabled: !hasMapMoveSinceLastRefine,\n      onClick: onRefineClick\n    }, h(Template, _extends({}, templateProps, {\n      templateKey: \"redo\",\n      rootTagName: \"span\"\n    })))), !enableRefineControl && !isRefineOnMapMove && h(\"div\", {\n      className: cssClasses.control\n    }, h(GeoSearchButton, {\n      className: cx(cssClasses.redo, !hasMapMoveSinceLastRefine && cssClasses.disabledRedo),\n      disabled: !hasMapMoveSinceLastRefine,\n      onClick: onRefineClick\n    }, h(Template, _extends({}, templateProps, {\n      templateKey: \"redo\",\n      rootTagName: \"span\"\n    })))), enableClearMapRefinement && isRefinedWithMap && h(GeoSearchButton, {\n      className: cssClasses.reset,\n      onClick: onClearClick\n    }, h(Template, _extends({}, templateProps, {\n      templateKey: \"reset\",\n      rootTagName: \"span\"\n    })))));\n  };\n\n  var refineWithMap = function refineWithMap(_ref) {\n    var refine = _ref.refine,\n      mapInstance = _ref.mapInstance;\n    return refine({\n      northEast: mapInstance.getBounds().getNorthEast().toJSON(),\n      southWest: mapInstance.getBounds().getSouthWest().toJSON()\n    });\n  };\n  var collectMarkersForNextRender = function collectMarkersForNextRender(markers, nextIds) {\n    return markers.reduce(function (_ref2, marker) {\n      var _ref3 = _slicedToArray(_ref2, 2),\n        update = _ref3[0],\n        exit = _ref3[1];\n      var persist = nextIds.includes(marker.__id);\n      return persist ? [update.concat(marker), exit] : [update, exit.concat(marker)];\n    }, [[], []]);\n  };\n  var createBoundingBoxFromMarkers = function createBoundingBoxFromMarkers(google, markers) {\n    var latLngBounds = markers.reduce(function (acc, marker) {\n      return acc.extend(marker.getPosition());\n    }, new google.maps.LatLngBounds());\n    return {\n      northEast: latLngBounds.getNorthEast().toJSON(),\n      southWest: latLngBounds.getSouthWest().toJSON()\n    };\n  };\n  var lockUserInteraction = function lockUserInteraction(renderState, functionThatAltersTheMapPosition) {\n    renderState.isUserInteraction = false;\n    functionThatAltersTheMapPosition();\n    renderState.isUserInteraction = true;\n  };\n  var renderer$4 = function renderer(_ref4, isFirstRendering) {\n    var items = _ref4.items,\n      position = _ref4.position,\n      currentRefinement = _ref4.currentRefinement,\n      refine = _ref4.refine,\n      clearMapRefinement = _ref4.clearMapRefinement,\n      toggleRefineOnMapMove = _ref4.toggleRefineOnMapMove,\n      isRefineOnMapMove = _ref4.isRefineOnMapMove,\n      setMapMoveSinceLastRefine = _ref4.setMapMoveSinceLastRefine,\n      hasMapMoveSinceLastRefine = _ref4.hasMapMoveSinceLastRefine,\n      isRefinedWithMap = _ref4.isRefinedWithMap,\n      widgetParams = _ref4.widgetParams,\n      instantSearchInstance = _ref4.instantSearchInstance;\n    var container = widgetParams.container,\n      googleReference = widgetParams.googleReference,\n      cssClasses = widgetParams.cssClasses,\n      templates = widgetParams.templates,\n      initialZoom = widgetParams.initialZoom,\n      initialPosition = widgetParams.initialPosition,\n      enableRefine = widgetParams.enableRefine,\n      enableClearMapRefinement = widgetParams.enableClearMapRefinement,\n      enableRefineControl = widgetParams.enableRefineControl,\n      mapOptions = widgetParams.mapOptions,\n      createMarker = widgetParams.createMarker,\n      markerOptions = widgetParams.markerOptions,\n      renderState = widgetParams.renderState;\n    if (isFirstRendering) {\n      renderState.isUserInteraction = true;\n      renderState.isPendingRefine = false;\n      renderState.markers = [];\n      var rootElement = document.createElement('div');\n      rootElement.className = cssClasses.root;\n      container.appendChild(rootElement);\n      var mapElement = document.createElement('div');\n      mapElement.className = cssClasses.map;\n      rootElement.appendChild(mapElement);\n      var treeElement = document.createElement('div');\n      treeElement.className = cssClasses.tree;\n      rootElement.appendChild(treeElement);\n      renderState.mapInstance = new googleReference.maps.Map(mapElement, _objectSpread2({\n        mapTypeControl: false,\n        fullscreenControl: false,\n        streetViewControl: false,\n        clickableIcons: false,\n        zoomControlOptions: {\n          position: googleReference.maps.ControlPosition.LEFT_TOP\n        }\n      }, mapOptions));\n      var setupListenersWhenMapIsReady = function setupListenersWhenMapIsReady() {\n        var onChange = function onChange() {\n          if (renderState.isUserInteraction && enableRefine) {\n            setMapMoveSinceLastRefine();\n            if (isRefineOnMapMove()) {\n              renderState.isPendingRefine = true;\n            }\n          }\n        };\n        renderState.mapInstance.addListener('center_changed', onChange);\n        renderState.mapInstance.addListener('zoom_changed', onChange);\n        renderState.mapInstance.addListener('dragstart', onChange);\n        renderState.mapInstance.addListener('idle', function () {\n          if (renderState.isUserInteraction && renderState.isPendingRefine) {\n            renderState.isPendingRefine = false;\n            refineWithMap({\n              mapInstance: renderState.mapInstance,\n              refine: refine\n            });\n          }\n        });\n      };\n      googleReference.maps.event.addListenerOnce(renderState.mapInstance, 'idle', setupListenersWhenMapIsReady);\n      renderState.templateProps = prepareTemplateProps({\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n\n    // Collect markers that need to be updated or removed\n    var nextItemsIds = items.map(function (_) {\n      return _.objectID;\n    });\n    var _collectMarkersForNex = collectMarkersForNextRender(renderState.markers, nextItemsIds),\n      _collectMarkersForNex2 = _slicedToArray(_collectMarkersForNex, 2),\n      updateMarkers = _collectMarkersForNex2[0],\n      exitMarkers = _collectMarkersForNex2[1];\n\n    // Collect items that will be added\n    var updateMarkerIds = updateMarkers.map(function (_) {\n      return _.__id;\n    });\n    var nextPendingItems = items.filter(function (item) {\n      return !updateMarkerIds.includes(item.objectID);\n    });\n\n    // Remove all markers that need to be removed\n    exitMarkers.forEach(function (marker) {\n      return marker.setMap(null);\n    });\n\n    // Create the markers from the items\n    renderState.markers = updateMarkers.concat(nextPendingItems.map(function (item) {\n      var marker = createMarker({\n        map: renderState.mapInstance,\n        item: item\n      });\n      Object.keys(markerOptions.events).forEach(function (eventName) {\n        marker.addListener(eventName, function (event) {\n          markerOptions.events[eventName]({\n            map: renderState.mapInstance,\n            event: event,\n            item: item,\n            marker: marker\n          });\n        });\n      });\n      return marker;\n    }));\n    var shouldUpdate = !hasMapMoveSinceLastRefine();\n\n    // We use this value for differentiate the padding to apply during\n    // fitBounds. When we don't have a currenRefinement (boundingBox)\n    // we let Google Maps compute the automatic padding. But when we\n    // provide the currentRefinement we explicitly set the padding\n    // to `0` otherwise the map will decrease the zoom on each refine.\n    var boundingBoxPadding = currentRefinement ? 0 : null;\n    var boundingBox = !currentRefinement && Boolean(renderState.markers.length) ? createBoundingBoxFromMarkers(googleReference, renderState.markers) : currentRefinement;\n    if (boundingBox && shouldUpdate) {\n      lockUserInteraction(renderState, function () {\n        renderState.mapInstance.fitBounds(new googleReference.maps.LatLngBounds(boundingBox.southWest, boundingBox.northEast), boundingBoxPadding);\n      });\n    } else if (shouldUpdate) {\n      lockUserInteraction(renderState, function () {\n        renderState.mapInstance.setCenter(position || initialPosition);\n        renderState.mapInstance.setZoom(initialZoom);\n      });\n    }\n    P(h(GeoSearchControls, {\n      cssClasses: cssClasses,\n      enableRefine: enableRefine,\n      enableRefineControl: enableRefineControl,\n      enableClearMapRefinement: enableClearMapRefinement,\n      isRefineOnMapMove: isRefineOnMapMove(),\n      isRefinedWithMap: isRefinedWithMap(),\n      hasMapMoveSinceLastRefine: hasMapMoveSinceLastRefine(),\n      onRefineToggle: toggleRefineOnMapMove,\n      onRefineClick: function onRefineClick() {\n        return refineWithMap({\n          mapInstance: renderState.mapInstance,\n          refine: refine\n        });\n      },\n      onClearClick: clearMapRefinement,\n      templateProps: renderState.templateProps\n    }), container.querySelector(\".\".concat(cssClasses.tree)));\n  };\n\n  var _excluded$p = [\"initialZoom\", \"initialPosition\", \"templates\", \"cssClasses\", \"builtInMarker\", \"customHTMLMarker\", \"enableRefine\", \"enableClearMapRefinement\", \"enableRefineControl\", \"container\", \"googleReference\"],\n    _excluded2$5 = [\"item\"],\n    _excluded3 = [\"item\"];\n  var withUsage$C = createDocumentationMessageGenerator({\n    name: 'geo-search'\n  });\n  var suit$9 = component('GeoSearch');\n  /**\n   * The **GeoSearch** widget displays the list of results from the search on a Google Maps. It also provides a way to search for results based on their position. The widget also provide some of the common GeoSearch patterns like search on map interaction.\n   *\n   * @requirements\n   *\n   * Note that the GeoSearch widget uses the [geosearch](https://www.algolia.com/doc/guides/searching/geo-search) capabilities of Algolia. Your hits **must** have a `_geoloc` attribute in order to be displayed on the map.\n   *\n   * Currently, the feature is not compatible with multiple values in the _geoloc attribute.\n   *\n   * You are also responsible for loading the Google Maps library, it's not shipped with InstantSearch. You need to load the Google Maps library and pass a reference to the widget. You can find more information about how to install the library in [the Google Maps documentation](https://developers.google.com/maps/documentation/javascript/tutorial).\n   *\n   * Don't forget to explicitly set the `height` of the map container (default class `.ais-geo-search--map`), otherwise it won't be shown (it's a requirement of Google Maps).\n   */\n  var geoSearch = (function geoSearch(widgetParams) {\n    var _ref = widgetParams || {},\n      _ref$initialZoom = _ref.initialZoom,\n      initialZoom = _ref$initialZoom === void 0 ? 1 : _ref$initialZoom,\n      _ref$initialPosition = _ref.initialPosition,\n      initialPosition = _ref$initialPosition === void 0 ? {\n        lat: 0,\n        lng: 0\n      } : _ref$initialPosition,\n      _ref$templates = _ref.templates,\n      userTemplates = _ref$templates === void 0 ? {} : _ref$templates,\n      _ref$cssClasses = _ref.cssClasses,\n      userCssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses,\n      _ref$builtInMarker = _ref.builtInMarker,\n      userBuiltInMarker = _ref$builtInMarker === void 0 ? {} : _ref$builtInMarker,\n      userCustomHTMLMarker = _ref.customHTMLMarker,\n      _ref$enableRefine = _ref.enableRefine,\n      enableRefine = _ref$enableRefine === void 0 ? true : _ref$enableRefine,\n      _ref$enableClearMapRe = _ref.enableClearMapRefinement,\n      enableClearMapRefinement = _ref$enableClearMapRe === void 0 ? true : _ref$enableClearMapRe,\n      _ref$enableRefineCont = _ref.enableRefineControl,\n      enableRefineControl = _ref$enableRefineCont === void 0 ? true : _ref$enableRefineCont,\n      container = _ref.container,\n      googleReference = _ref.googleReference,\n      otherWidgetParams = _objectWithoutProperties(_ref, _excluded$p);\n    var defaultBuiltInMarker = {\n      createOptions: function createOptions() {\n        return {};\n      },\n      events: {}\n    };\n    var defaultCustomHTMLMarker = {\n      createOptions: function createOptions() {\n        return {};\n      },\n      events: {}\n    };\n    if (!container) {\n      throw new Error(withUsage$C('The `container` option is required.'));\n    }\n    if (!googleReference) {\n      throw new Error(withUsage$C('The `googleReference` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$9(), userCssClasses.root),\n      // Required only to mount / unmount the Preact tree\n      tree: suit$9({\n        descendantName: 'tree'\n      }),\n      map: cx(suit$9({\n        descendantName: 'map'\n      }), userCssClasses.map),\n      control: cx(suit$9({\n        descendantName: 'control'\n      }), userCssClasses.control),\n      label: cx(suit$9({\n        descendantName: 'label'\n      }), userCssClasses.label),\n      selectedLabel: cx(suit$9({\n        descendantName: 'label',\n        modifierName: 'selected'\n      }), userCssClasses.selectedLabel),\n      input: cx(suit$9({\n        descendantName: 'input'\n      }), userCssClasses.input),\n      redo: cx(suit$9({\n        descendantName: 'redo'\n      }), userCssClasses.redo),\n      disabledRedo: cx(suit$9({\n        descendantName: 'redo',\n        modifierName: 'disabled'\n      }), userCssClasses.disabledRedo),\n      reset: cx(suit$9({\n        descendantName: 'reset'\n      }), userCssClasses.reset)\n    };\n    var templates = _objectSpread2(_objectSpread2({}, defaultTemplates$3), userTemplates);\n    var builtInMarker = _objectSpread2(_objectSpread2({}, defaultBuiltInMarker), userBuiltInMarker);\n    var isCustomHTMLMarker = Boolean(userCustomHTMLMarker) || Boolean(userTemplates.HTMLMarker);\n    var customHTMLMarker = isCustomHTMLMarker && _objectSpread2(_objectSpread2({}, defaultCustomHTMLMarker), userCustomHTMLMarker);\n    var createBuiltInMarker = function createBuiltInMarker(_ref2) {\n      var item = _ref2.item,\n        rest = _objectWithoutProperties(_ref2, _excluded2$5);\n      return new googleReference.maps.Marker(_objectSpread2(_objectSpread2(_objectSpread2({}, builtInMarker.createOptions(item)), rest), {}, {\n        // @ts-expect-error @types/googlemaps doesn't document this\n        __id: item.objectID,\n        position: item._geoloc\n      }));\n    };\n    var HTMLMarker = createHTMLMarker(googleReference);\n    var createCustomHTMLMarker = function createCustomHTMLMarker(_ref3) {\n      var item = _ref3.item,\n        rest = _objectWithoutProperties(_ref3, _excluded3);\n      return new HTMLMarker(_objectSpread2(_objectSpread2(_objectSpread2({}, customHTMLMarker.createOptions(item)), rest), {}, {\n        __id: item.objectID,\n        position: item._geoloc,\n        className: cx(suit$9({\n          descendantName: 'marker'\n        })),\n        template: renderTemplate({\n          templateKey: 'HTMLMarker',\n          templates: templates,\n          data: item\n        })\n      }));\n    };\n    var createMarker = !customHTMLMarker ? createBuiltInMarker : createCustomHTMLMarker;\n    var markerOptions = !customHTMLMarker ? builtInMarker : customHTMLMarker;\n    var makeWidget = connectGeoSearch(renderer$4, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget(_objectSpread2(_objectSpread2({}, otherWidgetParams), {}, {\n      // @TODO: this type doesn't preserve the generic correctly,\n      // (but as they're internal only it's not a big problem)\n      templates: templates,\n      renderState: {},\n      container: containerNode,\n      googleReference: googleReference,\n      initialZoom: initialZoom,\n      initialPosition: initialPosition,\n      cssClasses: cssClasses,\n      createMarker: createMarker,\n      markerOptions: markerOptions,\n      enableRefine: enableRefine,\n      enableClearMapRefinement: enableClearMapRefinement,\n      enableRefineControl: enableRefineControl\n    }))), {}, {\n      $$widgetType: 'ais.geoSearch'\n    });\n  });\n\n  var defaultProps$1 = {\n    query: '',\n    showSubmit: true,\n    showReset: true,\n    showLoadingIndicator: true,\n    autofocus: false,\n    searchAsYouType: true,\n    ignoreCompositionEvents: false,\n    isSearchStalled: false,\n    disabled: false,\n    ariaLabel: 'Search',\n    onChange: noop,\n    onSubmit: noop,\n    onReset: noop,\n    refine: noop\n  };\n  var SearchBox = /*#__PURE__*/function (_Component) {\n    _inherits(SearchBox, _Component);\n    var _super = _createSuper(SearchBox);\n    function SearchBox() {\n      var _this;\n      _classCallCheck(this, SearchBox);\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n      _this = _super.call.apply(_super, [this].concat(args));\n      _defineProperty(_assertThisInitialized(_this), \"state\", {\n        query: _this.props.query,\n        focused: false\n      });\n      _defineProperty(_assertThisInitialized(_this), \"input\", y());\n      _defineProperty(_assertThisInitialized(_this), \"onInput\", function (event) {\n        var _this$props = _this.props,\n          searchAsYouType = _this$props.searchAsYouType,\n          refine = _this$props.refine,\n          onChange = _this$props.onChange;\n        var query = event.target.value;\n        if (!(_this.props.ignoreCompositionEvents && event.isComposing)) {\n          if (searchAsYouType) {\n            refine(query);\n          }\n          _this.setState({\n            query: query\n          });\n          onChange(event);\n        }\n      });\n      _defineProperty(_assertThisInitialized(_this), \"onSubmit\", function (event) {\n        var _this$props2 = _this.props,\n          searchAsYouType = _this$props2.searchAsYouType,\n          refine = _this$props2.refine,\n          onSubmit = _this$props2.onSubmit;\n        event.preventDefault();\n        event.stopPropagation();\n        if (_this.input.current) {\n          _this.input.current.blur();\n        }\n        if (!searchAsYouType) {\n          refine(_this.state.query);\n        }\n        onSubmit(event);\n        return false;\n      });\n      _defineProperty(_assertThisInitialized(_this), \"onReset\", function (event) {\n        var _this$props3 = _this.props,\n          refine = _this$props3.refine,\n          onReset = _this$props3.onReset;\n        var query = '';\n        if (_this.input.current) {\n          _this.input.current.focus();\n        }\n        refine(query);\n        _this.setState({\n          query: query\n        });\n        onReset(event);\n      });\n      _defineProperty(_assertThisInitialized(_this), \"onBlur\", function () {\n        _this.setState({\n          focused: false\n        });\n      });\n      _defineProperty(_assertThisInitialized(_this), \"onFocus\", function () {\n        _this.setState({\n          focused: true\n        });\n      });\n      return _this;\n    }\n    _createClass(SearchBox, [{\n      key: \"resetInput\",\n      value:\n      /**\n       * This public method is used in the RefinementList SFFV search box\n       * to reset the input state when an item is selected.\n       *\n       * @see RefinementList#componentWillReceiveProps\n       * @return {undefined}\n       */\n      function resetInput() {\n        this.setState({\n          query: ''\n        });\n      }\n    }, {\n      key: \"componentWillReceiveProps\",\n      value: function componentWillReceiveProps(nextProps) {\n        /**\n         * when the user is typing, we don't want to replace the query typed\n         * by the user (state.query) with the query exposed by the connector (props.query)\n         * see: https://github.com/algolia/instantsearch/issues/4141\n         */\n        if (!this.state.focused && nextProps.query !== this.state.query) {\n          this.setState({\n            query: nextProps.query\n          });\n        }\n      }\n    }, {\n      key: \"render\",\n      value: function render() {\n        var _this$props4 = this.props,\n          cssClasses = _this$props4.cssClasses,\n          placeholder = _this$props4.placeholder,\n          autofocus = _this$props4.autofocus,\n          showSubmit = _this$props4.showSubmit,\n          showReset = _this$props4.showReset,\n          showLoadingIndicator = _this$props4.showLoadingIndicator,\n          templates = _this$props4.templates,\n          isSearchStalled = _this$props4.isSearchStalled,\n          ariaLabel = _this$props4.ariaLabel;\n        return h(\"div\", {\n          className: cssClasses.root\n        }, h(\"form\", {\n          action: \"\",\n          role: \"search\",\n          className: cssClasses.form,\n          noValidate: true,\n          onSubmit: this.onSubmit,\n          onReset: this.onReset\n        }, h(\"input\", {\n          ref: this.input,\n          value: this.state.query,\n          disabled: this.props.disabled,\n          className: cssClasses.input,\n          type: \"search\",\n          placeholder: placeholder,\n          autoFocus: autofocus,\n          autoComplete: \"off\",\n          autoCorrect: \"off\",\n          autoCapitalize: \"off\"\n          // @ts-expect-error `spellCheck` attribute is missing in preact JSX types\n          ,\n          spellCheck: \"false\",\n          maxLength: 512,\n          onInput: this.onInput\n          // see: https://github.com/preactjs/preact/issues/1978\n          // eslint-disable-next-line react/no-unknown-property\n          ,\n          oncompositionend: this.onInput,\n          onBlur: this.onBlur,\n          onFocus: this.onFocus,\n          \"aria-label\": ariaLabel\n        }), h(Template, {\n          templateKey: \"submit\",\n          rootTagName: \"button\",\n          rootProps: {\n            className: cssClasses.submit,\n            type: 'submit',\n            title: 'Submit the search query',\n            hidden: !showSubmit\n          },\n          templates: templates,\n          data: {\n            cssClasses: cssClasses\n          }\n        }), h(Template, {\n          templateKey: \"reset\",\n          rootTagName: \"button\",\n          rootProps: {\n            className: cssClasses.reset,\n            type: 'reset',\n            title: 'Clear the search query',\n            hidden: !(showReset && this.state.query.trim() && !isSearchStalled)\n          },\n          templates: templates,\n          data: {\n            cssClasses: cssClasses\n          }\n        }), showLoadingIndicator && h(Template, {\n          templateKey: \"loadingIndicator\",\n          rootTagName: \"span\",\n          rootProps: {\n            className: cssClasses.loadingIndicator,\n            hidden: !isSearchStalled\n          },\n          templates: templates,\n          data: {\n            cssClasses: cssClasses\n          }\n        })));\n      }\n    }]);\n    return SearchBox;\n  }(d);\n  _defineProperty(SearchBox, \"defaultProps\", defaultProps$1);\n\n  function RefinementListItem(_ref) {\n    var className = _ref.className,\n      handleClick = _ref.handleClick,\n      facetValueToRefine = _ref.facetValueToRefine,\n      isRefined = _ref.isRefined,\n      templateProps = _ref.templateProps,\n      templateKey = _ref.templateKey,\n      templateData = _ref.templateData,\n      subItems = _ref.subItems;\n    return h(\"li\", {\n      className: className,\n      onClick: function onClick(originalEvent) {\n        handleClick({\n          facetValueToRefine: facetValueToRefine,\n          isRefined: isRefined,\n          originalEvent: originalEvent\n        });\n      }\n    }, h(Template, _extends({}, templateProps, {\n      templateKey: templateKey,\n      data: templateData\n    })), subItems);\n  }\n\n  var _excluded$q = [\"root\"];\n\n  // CSS types\n\n  var defaultProps$2 = {\n    cssClasses: {},\n    depth: 0\n  };\n  function isHierarchicalMenuItem(facetValue) {\n    return facetValue.data !== undefined;\n  }\n  var RefinementList$1 = /*#__PURE__*/function (_Component) {\n    _inherits(RefinementList, _Component);\n    var _super = _createSuper(RefinementList);\n    function RefinementList() {\n      var _this;\n      _classCallCheck(this, RefinementList);\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n      _this = _super.call.apply(_super, [this].concat(args));\n      _defineProperty(_assertThisInitialized(_this), \"listRef\", y());\n      _defineProperty(_assertThisInitialized(_this), \"searchBox\", y());\n      _defineProperty(_assertThisInitialized(_this), \"lastRefinedValue\", undefined);\n      _defineProperty(_assertThisInitialized(_this), \"_generateFacetItem\", function (facetValue) {\n        var subItems;\n        if (isHierarchicalMenuItem(facetValue) && Array.isArray(facetValue.data) && facetValue.data.length > 0) {\n          var _this$props$cssClasse = _this.props.cssClasses,\n            root = _this$props$cssClasse.root,\n            cssClasses = _objectWithoutProperties(_this$props$cssClasse, _excluded$q);\n          subItems = h(RefinementList, _extends({}, _this.props, {\n            // We want to keep `root` required for external usage but not for the\n            // sub items.\n            cssClasses: cssClasses,\n            depth: _this.props.depth + 1,\n            facetValues: facetValue.data,\n            showMore: false,\n            className: _this.props.cssClasses.childList\n          }));\n        }\n        var url = _this.props.createURL(facetValue.value);\n        var templateData = _objectSpread2(_objectSpread2({}, facetValue), {}, {\n          url: url,\n          attribute: _this.props.attribute,\n          cssClasses: _this.props.cssClasses,\n          isFromSearch: _this.props.isFromSearch\n        });\n        var key = facetValue.value;\n        if (facetValue.isRefined !== undefined) {\n          key += \"/\".concat(facetValue.isRefined);\n        }\n        if (facetValue.count !== undefined) {\n          key += \"/\".concat(facetValue.count);\n        }\n        var refinementListItemClassName = cx(_this.props.cssClasses.item, facetValue.isRefined && _this.props.cssClasses.selectedItem, !facetValue.count && _this.props.cssClasses.disabledItem, Boolean(isHierarchicalMenuItem(facetValue) && Array.isArray(facetValue.data) && facetValue.data.length > 0) && _this.props.cssClasses.parentItem);\n        return h(RefinementListItem, {\n          templateKey: \"item\",\n          key: key,\n          facetValueToRefine: facetValue.value,\n          handleClick: _this.handleItemClick,\n          isRefined: facetValue.isRefined,\n          className: refinementListItemClassName,\n          subItems: subItems,\n          templateData: templateData,\n          templateProps: _this.props.templateProps\n        });\n      });\n      // Click events on DOM tree like LABEL > INPUT will result in two click events\n      // instead of one.\n      // No matter the framework, see https://www.google.com/search?q=click+label+twice\n      //\n      // Thus making it hard to distinguish activation from deactivation because both click events\n      // are very close. Debounce is a solution but hacky.\n      //\n      // So the code here checks if the click was done on or in a LABEL. If this LABEL\n      // has a checkbox inside, we ignore the first click event because we will get another one.\n      //\n      // We also check if the click was done inside a link and then e.preventDefault() because we already\n      // handle the url\n      //\n      // Finally, we always stop propagation of the event to avoid multiple levels RefinementLists to fail: click\n      // on child would click on parent also\n      _defineProperty(_assertThisInitialized(_this), \"handleItemClick\", function (_ref) {\n        var facetValueToRefine = _ref.facetValueToRefine,\n          isRefined = _ref.isRefined,\n          originalEvent = _ref.originalEvent;\n        if (isSpecialClick(originalEvent)) {\n          // do not alter the default browser behavior\n          // if one special key is down\n          return;\n        }\n        var parent = originalEvent.target;\n        if (parent === null || parent.parentNode === null) {\n          return;\n        }\n        if (isRefined && parent.parentNode.querySelector('input[type=\"radio\"]:checked')) {\n          // Prevent refinement for being reset if the user clicks on an already checked radio button\n          return;\n        }\n        if (parent.tagName === 'INPUT') {\n          _this.refine(facetValueToRefine);\n          return;\n        }\n        while (parent !== originalEvent.currentTarget) {\n          if (parent.tagName === 'LABEL' && (parent.querySelector('input[type=\"checkbox\"]') || parent.querySelector('input[type=\"radio\"]'))) {\n            return;\n          }\n          if (parent.tagName === 'A' && parent.href) {\n            originalEvent.preventDefault();\n          }\n          parent = parent.parentNode;\n        }\n        originalEvent.stopPropagation();\n        _this.refine(facetValueToRefine);\n      });\n      return _this;\n    }\n    _createClass(RefinementList, [{\n      key: \"shouldComponentUpdate\",\n      value: function shouldComponentUpdate(nextProps) {\n        var areFacetValuesDifferent = !isEqual(this.props.facetValues, nextProps.facetValues);\n        return areFacetValuesDifferent;\n      }\n    }, {\n      key: \"refine\",\n      value: function refine(facetValueToRefine) {\n        this.lastRefinedValue = facetValueToRefine;\n        this.props.toggleRefinement(facetValueToRefine);\n      }\n    }, {\n      key: \"componentWillReceiveProps\",\n      value: function componentWillReceiveProps(nextProps) {\n        if (this.searchBox.current && !nextProps.isFromSearch) {\n          this.searchBox.current.resetInput();\n        }\n      }\n\n      /**\n       * This sets focus on the last refined input element after a render\n       * because Preact does not perform it automatically.\n       * @see https://github.com/preactjs/preact/issues/3242\n       */\n    }, {\n      key: \"componentDidUpdate\",\n      value: function componentDidUpdate() {\n        var _this$listRef$current, _this$listRef$current2, _this$lastRefinedValu;\n        (_this$listRef$current = this.listRef.current) === null || _this$listRef$current === void 0 ? void 0 : (_this$listRef$current2 = _this$listRef$current.querySelector(\"input[value=\\\"\".concat((_this$lastRefinedValu = this.lastRefinedValue) === null || _this$lastRefinedValu === void 0 ? void 0 : _this$lastRefinedValu.replace('\"', '\\\\\"'), \"\\\"]\"))) === null || _this$listRef$current2 === void 0 ? void 0 : _this$listRef$current2.focus();\n        this.lastRefinedValue = undefined;\n      }\n    }, {\n      key: \"refineFirstValue\",\n      value: function refineFirstValue() {\n        var firstValue = this.props.facetValues && this.props.facetValues[0];\n        if (firstValue) {\n          var actualValue = firstValue.value;\n          this.props.toggleRefinement(actualValue);\n        }\n      }\n    }, {\n      key: \"render\",\n      value: function render() {\n        var _this2 = this;\n        var showMoreButtonClassName = cx(this.props.cssClasses.showMore, !(this.props.showMore === true && this.props.canToggleShowMore) && this.props.cssClasses.disabledShowMore);\n        var showMoreButton = this.props.showMore === true && h(Template, _extends({}, this.props.templateProps, {\n          templateKey: \"showMoreText\",\n          rootTagName: \"button\",\n          rootProps: {\n            className: showMoreButtonClassName,\n            disabled: !this.props.canToggleShowMore,\n            onClick: this.props.toggleShowMore\n          },\n          data: {\n            isShowingMore: this.props.isShowingMore\n          }\n        }));\n        var shouldDisableSearchBox = this.props.searchIsAlwaysActive !== true && !(this.props.isFromSearch || !this.props.hasExhaustiveItems);\n        var searchBox = this.props.searchFacetValues && h(\"div\", {\n          className: this.props.cssClasses.searchBox\n        }, h(SearchBox, {\n          ref: this.searchBox,\n          placeholder: this.props.searchPlaceholder,\n          disabled: shouldDisableSearchBox,\n          cssClasses: this.props.cssClasses.searchable,\n          templates: this.props.searchBoxTemplateProps.templates,\n          onChange: function onChange(event) {\n            return _this2.props.searchFacetValues(event.target.value);\n          },\n          onReset: function onReset() {\n            return _this2.props.searchFacetValues('');\n          },\n          onSubmit: function onSubmit() {\n            return _this2.refineFirstValue();\n          }\n          // This sets the search box to a controlled state because\n          // we don't rely on the `refine` prop but on `onChange`.\n          ,\n          searchAsYouType: false,\n          ariaLabel: \"Search for filters\"\n        }));\n        var facetValues = this.props.facetValues && this.props.facetValues.length > 0 && h(\"ul\", {\n          ref: this.listRef,\n          className: this.props.cssClasses.list\n        }, this.props.facetValues.map(this._generateFacetItem, this));\n        var noResults = this.props.searchFacetValues && this.props.isFromSearch && (!this.props.facetValues || this.props.facetValues.length === 0) && h(Template, _extends({}, this.props.templateProps, {\n          templateKey: \"searchableNoResults\",\n          rootProps: {\n            className: this.props.cssClasses.noResults\n          }\n        }));\n        var rootClassName = cx(this.props.cssClasses.root, (!this.props.facetValues || this.props.facetValues.length === 0) && this.props.cssClasses.noRefinementRoot, this.props.className);\n        return h(\"div\", {\n          className: rootClassName\n        }, this.props.children, searchBox, facetValues, noResults, showMoreButton);\n      }\n    }]);\n    return RefinementList;\n  }(d);\n  _defineProperty(RefinementList$1, \"defaultProps\", defaultProps$2);\n\n  var defaultTemplates$4 = {\n    item: function item(_ref) {\n      var url = _ref.url,\n        label = _ref.label,\n        count = _ref.count,\n        cssClasses = _ref.cssClasses,\n        isRefined = _ref.isRefined;\n      return h(\"a\", {\n        className: cx(cx(cssClasses.link), cx(isRefined ? cssClasses.selectedItemLink : undefined)),\n        href: url\n      }, h(\"span\", {\n        className: cx(cssClasses.label)\n      }, label), h(\"span\", {\n        className: cx(cssClasses.count)\n      }, formatNumber(count)));\n    },\n    showMoreText: function showMoreText(_ref2) {\n      var isShowingMore = _ref2.isShowingMore;\n      return isShowingMore ? 'Show less' : 'Show more';\n    }\n  };\n\n  var withUsage$D = createDocumentationMessageGenerator({\n    name: 'hierarchical-menu'\n  });\n  var suit$a = component('HierarchicalMenu');\n  var renderer$5 = function renderer(_ref) {\n    var cssClasses = _ref.cssClasses,\n      containerNode = _ref.containerNode,\n      showMore = _ref.showMore,\n      templates = _ref.templates,\n      renderState = _ref.renderState;\n    return function (_ref2, isFirstRendering) {\n      var createURL = _ref2.createURL,\n        items = _ref2.items,\n        refine = _ref2.refine,\n        instantSearchInstance = _ref2.instantSearchInstance,\n        isShowingMore = _ref2.isShowingMore,\n        toggleShowMore = _ref2.toggleShowMore,\n        canToggleShowMore = _ref2.canToggleShowMore;\n      if (isFirstRendering) {\n        renderState.templateProps = prepareTemplateProps({\n          defaultTemplates: defaultTemplates$4,\n          templatesConfig: instantSearchInstance.templatesConfig,\n          templates: templates\n        });\n        return;\n      }\n      P(h(RefinementList$1, {\n        createURL: createURL,\n        cssClasses: cssClasses,\n        facetValues: items,\n        templateProps: renderState.templateProps,\n        toggleRefinement: refine,\n        showMore: showMore,\n        toggleShowMore: toggleShowMore,\n        isShowingMore: isShowingMore,\n        canToggleShowMore: canToggleShowMore\n      }), containerNode);\n    };\n  };\n\n  /**\n   * The hierarchical menu widget is used to create a navigation based on a hierarchy of facet attributes.\n   *\n   * It is commonly used for categories with subcategories.\n   *\n   * All attributes (lvl0, lvl1 here) must be declared as [attributes for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting) in your\n   * Algolia settings.\n   *\n   * By default, the separator we expect is ` > ` (with spaces) but you can use\n   * a different one by using the `separator` option.\n   * @requirements\n   * Your objects must be formatted in a specific way to be\n   * able to display hierarchical menus. Here's an example:\n   *\n   * ```javascript\n   * {\n   *   \"objectID\": \"123\",\n   *   \"name\": \"orange\",\n   *   \"categories\": {\n   *     \"lvl0\": \"fruits\",\n   *     \"lvl1\": \"fruits > citrus\"\n   *   }\n   * }\n   * ```\n   *\n   * Every level must be specified entirely.\n   * It's also possible to have multiple values per level, for example:\n   *\n   * ```javascript\n   * {\n   *   \"objectID\": \"123\",\n   *   \"name\": \"orange\",\n   *   \"categories\": {\n   *     \"lvl0\": [\"fruits\", \"vitamins\"],\n   *     \"lvl1\": [\"fruits > citrus\", \"vitamins > C\"]\n   *   }\n   * }\n   * ```\n   * @type {WidgetFactory}\n   * @devNovel HierarchicalMenu\n   * @category filter\n   * @param {HierarchicalMenuWidgetParams} widgetParams The HierarchicalMenu widget options.\n   * @return {Widget} A new HierarchicalMenu widget instance.\n   * @example\n   * search.addWidgets([\n   *   instantsearch.widgets.hierarchicalMenu({\n   *     container: '#hierarchical-categories',\n   *     attributes: ['hierarchicalCategories.lvl0', 'hierarchicalCategories.lvl1', 'hierarchicalCategories.lvl2'],\n   *   })\n   * ]);\n   */\n\n  var hierarchicalMenu = function hierarchicalMenu(widgetParams) {\n    var _ref3 = widgetParams || {},\n      container = _ref3.container,\n      attributes = _ref3.attributes,\n      separator = _ref3.separator,\n      rootPath = _ref3.rootPath,\n      showParentLevel = _ref3.showParentLevel,\n      limit = _ref3.limit,\n      _ref3$showMore = _ref3.showMore,\n      showMore = _ref3$showMore === void 0 ? false : _ref3$showMore,\n      showMoreLimit = _ref3.showMoreLimit,\n      sortBy = _ref3.sortBy,\n      transformItems = _ref3.transformItems,\n      _ref3$templates = _ref3.templates,\n      templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n      _ref3$cssClasses = _ref3.cssClasses,\n      userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses;\n    if (!container) {\n      throw new Error(withUsage$D('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$a(), userCssClasses.root),\n      noRefinementRoot: cx(suit$a({\n        modifierName: 'noRefinement'\n      }), userCssClasses.noRefinementRoot),\n      list: cx(suit$a({\n        descendantName: 'list'\n      }), userCssClasses.list),\n      childList: cx(suit$a({\n        descendantName: 'list',\n        modifierName: 'child'\n      }), userCssClasses.childList),\n      item: cx(suit$a({\n        descendantName: 'item'\n      }), userCssClasses.item),\n      selectedItem: cx(suit$a({\n        descendantName: 'item',\n        modifierName: 'selected'\n      }), userCssClasses.selectedItem),\n      parentItem: cx(suit$a({\n        descendantName: 'item',\n        modifierName: 'parent'\n      }), userCssClasses.parentItem),\n      link: cx(suit$a({\n        descendantName: 'link'\n      }), userCssClasses.link),\n      selectedItemLink: cx(suit$a({\n        descendantName: 'link',\n        modifierName: 'selected'\n      }), userCssClasses.selectedItemLink),\n      label: cx(suit$a({\n        descendantName: 'label'\n      }), userCssClasses.label),\n      count: cx(suit$a({\n        descendantName: 'count'\n      }), userCssClasses.count),\n      showMore: cx(suit$a({\n        descendantName: 'showMore'\n      }), userCssClasses.showMore),\n      disabledShowMore: cx(suit$a({\n        descendantName: 'showMore',\n        modifierName: 'disabled'\n      }), userCssClasses.disabledShowMore)\n    };\n    var specializedRenderer = renderer$5({\n      cssClasses: cssClasses,\n      containerNode: containerNode,\n      templates: templates,\n      showMore: showMore,\n      renderState: {}\n    });\n    var makeWidget = connectHierarchicalMenu(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      attributes: attributes,\n      separator: separator,\n      rootPath: rootPath,\n      showParentLevel: showParentLevel,\n      limit: limit,\n      showMore: showMore,\n      showMoreLimit: showMoreLimit,\n      sortBy: sortBy,\n      transformItems: transformItems\n    })), {}, {\n      $$widgetType: 'ais.hierarchicalMenu'\n    });\n  };\n\n  // false positive lint error\n  // eslint-disable-next-line @typescript-eslint/consistent-type-imports\n\n  var defaultTemplates$5 = {\n    empty: function empty() {\n      return 'No results';\n    },\n    item: function item(data) {\n      return JSON.stringify(omit(data, ['__hitIndex']), null, 2);\n    }\n  };\n\n  var _excluded$r = [\"hit\", \"index\"];\n  var withUsage$E = createDocumentationMessageGenerator({\n    name: 'hits'\n  });\n  var Hits = createHitsComponent({\n    createElement: h,\n    Fragment: p\n  });\n  var renderer$6 = function renderer(_ref) {\n    var renderState = _ref.renderState,\n      cssClasses = _ref.cssClasses,\n      containerNode = _ref.containerNode,\n      templates = _ref.templates;\n    return function (_ref2, isFirstRendering) {\n      var items = _ref2.items,\n        results = _ref2.results,\n        instantSearchInstance = _ref2.instantSearchInstance,\n        insights = _ref2.insights,\n        bindEvent = _ref2.bindEvent,\n        sendEvent = _ref2.sendEvent,\n        banner = _ref2.banner;\n      if (isFirstRendering) {\n        renderState.templateProps = prepareTemplateProps({\n          defaultTemplates: defaultTemplates$5,\n          templatesConfig: instantSearchInstance.templatesConfig,\n          templates: templates\n        });\n        return;\n      }\n      var handleInsightsClick = createInsightsEventHandler({\n        insights: insights,\n        sendEvent: sendEvent\n      });\n      var emptyComponent = function emptyComponent(_ref3) {\n        var rootProps = _extends({}, (_objectDestructuringEmpty(_ref3), _ref3));\n        return h(Template, _extends({}, renderState.templateProps, {\n          rootProps: rootProps,\n          templateKey: \"empty\",\n          data: results,\n          rootTagName: \"fragment\"\n        }));\n      };\n\n      // @MAJOR: Move default hit component back to the UI library\n      // once flavour specificities are erased\n      var itemComponent = function itemComponent(_ref4) {\n        var hit = _ref4.hit,\n          index = _ref4.index,\n          rootProps = _objectWithoutProperties(_ref4, _excluded$r);\n        return h(Template, _extends({}, renderState.templateProps, {\n          templateKey: \"item\",\n          rootTagName: \"li\",\n          rootProps: _objectSpread2(_objectSpread2({}, rootProps), {}, {\n            onClick: function onClick(event) {\n              handleInsightsClick(event);\n              rootProps.onClick();\n            },\n            onAuxClick: function onAuxClick(event) {\n              handleInsightsClick(event);\n              rootProps.onAuxClick();\n            }\n          }),\n          data: _objectSpread2(_objectSpread2({}, hit), {}, {\n            get __hitIndex() {\n               _warning(false, 'The `__hitIndex` property is deprecated. Use the absolute `__position` instead.') ;\n              return index;\n            }\n          }),\n          bindEvent: bindEvent,\n          sendEvent: sendEvent\n        }));\n      };\n      var bannerComponent = function bannerComponent(props) {\n        return h(Template, _extends({}, renderState.templateProps, {\n          templateKey: \"banner\",\n          data: props,\n          rootTagName: \"fragment\"\n        }));\n      };\n      P(h(Hits, {\n        hits: items,\n        itemComponent: itemComponent,\n        sendEvent: sendEvent,\n        classNames: cssClasses,\n        emptyComponent: emptyComponent,\n        banner: banner,\n        bannerComponent: templates.banner ? bannerComponent : undefined\n      }), containerNode);\n    };\n  };\n  var hits = (function hits(widgetParams) {\n    var _ref5 = widgetParams || {},\n      container = _ref5.container,\n      escapeHTML = _ref5.escapeHTML,\n      transformItems = _ref5.transformItems,\n      _ref5$templates = _ref5.templates,\n      templates = _ref5$templates === void 0 ? {} : _ref5$templates,\n      _ref5$cssClasses = _ref5.cssClasses,\n      cssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses;\n    if (!container) {\n      throw new Error(withUsage$E('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var specializedRenderer = renderer$6({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      renderState: {},\n      templates: templates\n    });\n    var makeWidget = withInsights(connectHits)(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      escapeHTML: escapeHTML,\n      transformItems: transformItems\n    })), {}, {\n      $$widgetType: 'ais.hits'\n    });\n  });\n\n  function Selector(_ref) {\n    var currentValue = _ref.currentValue,\n      options = _ref.options,\n      cssClasses = _ref.cssClasses,\n      setValue = _ref.setValue,\n      ariaLabel = _ref.ariaLabel;\n    return h(\"select\", {\n      className: cx(cssClasses.select),\n      onChange: function onChange(event) {\n        return setValue(event.target.value);\n      },\n      value: \"\".concat(currentValue),\n      \"aria-label\": ariaLabel\n    }, options.map(function (option) {\n      return h(\"option\", {\n        className: cx(cssClasses.option),\n        key: option.label + option.value,\n        value: \"\".concat(option.value)\n      }, option.label);\n    }));\n  }\n\n  var withUsage$F = createDocumentationMessageGenerator({\n    name: 'hits-per-page'\n  });\n  var suit$b = component('HitsPerPage');\n  var renderer$7 = function renderer(_ref) {\n    var containerNode = _ref.containerNode,\n      cssClasses = _ref.cssClasses;\n    return function (_ref2, isFirstRendering) {\n      var items = _ref2.items,\n        refine = _ref2.refine;\n      if (isFirstRendering) return;\n      var _ref3 = find(items, function (_ref4) {\n          var isRefined = _ref4.isRefined;\n          return isRefined;\n        }) || {},\n        currentValue = _ref3.value;\n      P(h(\"div\", {\n        className: cssClasses.root\n      }, h(Selector, {\n        cssClasses: cssClasses,\n        currentValue: currentValue,\n        options: items\n        // @ts-expect-error: the refine function expects a number, but setValue will call it with a string. We don't want to change the type of the refine function because it's part of the connector API.\n        ,\n        setValue: refine\n      })), containerNode);\n    };\n  };\n  var hitsPerPage = function hitsPerPage(widgetParams) {\n    var _ref5 = widgetParams || {},\n      container = _ref5.container,\n      items = _ref5.items,\n      _ref5$cssClasses = _ref5.cssClasses,\n      userCssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses,\n      transformItems = _ref5.transformItems;\n    if (!container) {\n      throw new Error(withUsage$F('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$b(), userCssClasses.root),\n      select: cx(suit$b({\n        descendantName: 'select'\n      }), userCssClasses.select),\n      option: cx(suit$b({\n        descendantName: 'option'\n      }), userCssClasses.option)\n    };\n    var specializedRenderer = renderer$7({\n      containerNode: containerNode,\n      cssClasses: cssClasses\n    });\n    var makeWidget = connectHitsPerPage(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      items: items,\n      transformItems: transformItems\n    })), {}, {\n      $$widgetType: 'ais.hitsPerPage'\n    });\n  };\n\n  var DefaultBanner = function DefaultBanner(_ref) {\n    var banner = _ref.banner,\n      classNames = _ref.classNames;\n    if (!banner.image.urls[0].url) {\n      return null;\n    }\n    return h(\"aside\", {\n      className: cx(classNames.bannerRoot)\n    }, banner.link ? h(\"a\", {\n      className: cx(classNames.bannerLink),\n      href: banner.link.url,\n      target: banner.link.target\n    }, h(\"img\", {\n      className: cx(classNames.bannerImage),\n      src: banner.image.urls[0].url,\n      alt: banner.image.title\n    })) : h(\"img\", {\n      className: cx(classNames.bannerImage),\n      src: banner.image.urls[0].url,\n      alt: banner.image.title\n    }));\n  };\n  var InfiniteHits = function InfiniteHits(_ref2) {\n    var results = _ref2.results,\n      hits = _ref2.hits,\n      insights = _ref2.insights,\n      bindEvent = _ref2.bindEvent,\n      sendEvent = _ref2.sendEvent,\n      hasShowPrevious = _ref2.hasShowPrevious,\n      showPrevious = _ref2.showPrevious,\n      showMore = _ref2.showMore,\n      isFirstPage = _ref2.isFirstPage,\n      isLastPage = _ref2.isLastPage,\n      cssClasses = _ref2.cssClasses,\n      templateProps = _ref2.templateProps,\n      banner = _ref2.banner;\n    var handleInsightsClick = createInsightsEventHandler({\n      insights: insights,\n      sendEvent: sendEvent\n    });\n    if (results.hits.length === 0) {\n      return h(\"div\", {\n        className: cx(cssClasses.root, cssClasses.emptyRoot),\n        onClick: handleInsightsClick\n      }, banner && (templateProps.templates.banner ? h(Template, _extends({}, templateProps, {\n        templateKey: \"banner\",\n        rootTagName: \"fragment\",\n        data: {\n          banner: banner,\n          className: cssClasses.bannerRoot\n        }\n      })) : h(DefaultBanner, {\n        banner: banner,\n        classNames: cssClasses\n      })), h(Template, _extends({}, templateProps, {\n        templateKey: \"empty\",\n        rootTagName: \"fragment\",\n        data: results\n      })));\n    }\n    return h(\"div\", {\n      className: cssClasses.root\n    }, hasShowPrevious && h(Template, _extends({}, templateProps, {\n      templateKey: \"showPreviousText\",\n      rootTagName: \"button\",\n      rootProps: {\n        className: cx(cssClasses.loadPrevious, isFirstPage && cssClasses.disabledLoadPrevious),\n        disabled: isFirstPage,\n        onClick: showPrevious\n      }\n    })), banner && (templateProps.templates.banner ? h(Template, _extends({}, templateProps, {\n      templateKey: \"banner\",\n      rootTagName: \"fragment\",\n      data: {\n        banner: banner,\n        className: cssClasses.bannerRoot\n      }\n    })) : h(DefaultBanner, {\n      banner: banner,\n      classNames: cssClasses\n    })), h(\"ol\", {\n      className: cssClasses.list\n    }, hits.map(function (hit, index) {\n      return h(Template, _extends({}, templateProps, {\n        templateKey: \"item\",\n        rootTagName: \"li\",\n        rootProps: {\n          className: cssClasses.item,\n          onClick: function onClick(event) {\n            handleInsightsClick(event);\n            sendEvent('click:internal', hit, 'Hit Clicked');\n          },\n          onAuxClick: function onAuxClick(event) {\n            handleInsightsClick(event);\n            sendEvent('click:internal', hit, 'Hit Clicked');\n          }\n        },\n        key: hit.objectID,\n        data: _objectSpread2(_objectSpread2({}, hit), {}, {\n          get __hitIndex() {\n             _warning(false, 'The `__hitIndex` property is deprecated. Use the absolute `__position` instead.') ;\n            return index;\n          }\n        }),\n        bindEvent: bindEvent,\n        sendEvent: sendEvent\n      }));\n    })), h(Template, _extends({}, templateProps, {\n      templateKey: \"showMoreText\",\n      rootTagName: \"button\",\n      rootProps: {\n        className: cx(cssClasses.loadMore, isLastPage && cssClasses.disabledLoadMore),\n        disabled: isLastPage,\n        onClick: showMore\n      }\n    })));\n  };\n\n  var defaultTemplates$6 = {\n    empty: function empty() {\n      return 'No results';\n    },\n    showPreviousText: function showPreviousText() {\n      return 'Show previous results';\n    },\n    showMoreText: function showMoreText() {\n      return 'Show more results';\n    },\n    item: function item(data) {\n      return JSON.stringify(omit(data, ['__hitIndex']), null, 2);\n    }\n  };\n\n  var withUsage$G = createDocumentationMessageGenerator({\n    name: 'infinite-hits'\n  });\n  var suit$c = component('InfiniteHits');\n  var renderer$8 = function renderer(_ref) {\n    var containerNode = _ref.containerNode,\n      cssClasses = _ref.cssClasses,\n      renderState = _ref.renderState,\n      templates = _ref.templates,\n      hasShowPrevious = _ref.showPrevious;\n    return function (_ref2, isFirstRendering) {\n      var items = _ref2.items,\n        results = _ref2.results,\n        showMore = _ref2.showMore,\n        showPrevious = _ref2.showPrevious,\n        isFirstPage = _ref2.isFirstPage,\n        isLastPage = _ref2.isLastPage,\n        instantSearchInstance = _ref2.instantSearchInstance,\n        insights = _ref2.insights,\n        bindEvent = _ref2.bindEvent,\n        sendEvent = _ref2.sendEvent,\n        banner = _ref2.banner;\n      if (isFirstRendering) {\n        renderState.templateProps = prepareTemplateProps({\n          defaultTemplates: defaultTemplates$6,\n          templatesConfig: instantSearchInstance.templatesConfig,\n          templates: templates\n        });\n        return;\n      }\n      P(h(InfiniteHits, {\n        cssClasses: cssClasses,\n        hits: items,\n        results: results,\n        hasShowPrevious: hasShowPrevious,\n        showPrevious: showPrevious,\n        showMore: showMore,\n        templateProps: renderState.templateProps,\n        isFirstPage: isFirstPage,\n        isLastPage: isLastPage,\n        insights: insights,\n        sendEvent: sendEvent,\n        bindEvent: bindEvent,\n        banner: banner\n      }), containerNode);\n    };\n  };\n  var infiniteHits = (function infiniteHits(widgetParams) {\n    var _ref3 = widgetParams || {},\n      container = _ref3.container,\n      escapeHTML = _ref3.escapeHTML,\n      transformItems = _ref3.transformItems,\n      _ref3$templates = _ref3.templates,\n      templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n      _ref3$cssClasses = _ref3.cssClasses,\n      userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n      showPrevious = _ref3.showPrevious,\n      cache = _ref3.cache;\n    if (!container) {\n      throw new Error(withUsage$G('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$c(), userCssClasses.root),\n      emptyRoot: cx(suit$c({\n        modifierName: 'empty'\n      }), userCssClasses.emptyRoot),\n      item: cx(suit$c({\n        descendantName: 'item'\n      }), userCssClasses.item),\n      list: cx(suit$c({\n        descendantName: 'list'\n      }), userCssClasses.list),\n      loadPrevious: cx(suit$c({\n        descendantName: 'loadPrevious'\n      }), userCssClasses.loadPrevious),\n      disabledLoadPrevious: cx(suit$c({\n        descendantName: 'loadPrevious',\n        modifierName: 'disabled'\n      }), userCssClasses.disabledLoadPrevious),\n      loadMore: cx(suit$c({\n        descendantName: 'loadMore'\n      }), userCssClasses.loadMore),\n      disabledLoadMore: cx(suit$c({\n        descendantName: 'loadMore',\n        modifierName: 'disabled'\n      }), userCssClasses.disabledLoadMore),\n      bannerRoot: cx(suit$c({\n        descendantName: 'banner'\n      }), userCssClasses.bannerRoot),\n      bannerImage: cx(suit$c({\n        descendantName: 'banner-image'\n      }), userCssClasses.bannerImage),\n      bannerLink: cx(suit$c({\n        descendantName: 'banner-link'\n      }), userCssClasses.bannerLink)\n    };\n    var specializedRenderer = renderer$8({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      templates: templates,\n      showPrevious: showPrevious,\n      renderState: {}\n    });\n    var makeWidget = withInsights(connectInfiniteHits)(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      escapeHTML: escapeHTML,\n      transformItems: transformItems,\n      showPrevious: showPrevious,\n      cache: cache\n    })), {}, {\n      $$widgetType: 'ais.infiniteHits'\n    });\n  });\n\n  var defaultTemplates$7 = {\n    item: function item(_ref) {\n      var cssClasses = _ref.cssClasses,\n        url = _ref.url,\n        label = _ref.label,\n        count = _ref.count;\n      return h(\"a\", {\n        className: cx(cssClasses.link),\n        href: url\n      }, h(\"span\", {\n        className: cx(cssClasses.label)\n      }, label), h(\"span\", {\n        className: cx(cssClasses.count)\n      }, formatNumber(count)));\n    },\n    showMoreText: function showMoreText(_ref2) {\n      var isShowingMore = _ref2.isShowingMore;\n      return isShowingMore ? 'Show less' : 'Show more';\n    }\n  };\n\n  var withUsage$H = createDocumentationMessageGenerator({\n    name: 'menu'\n  });\n  var suit$d = component('Menu');\n  var renderer$9 = function renderer(_ref) {\n    var containerNode = _ref.containerNode,\n      cssClasses = _ref.cssClasses,\n      renderState = _ref.renderState,\n      templates = _ref.templates,\n      showMore = _ref.showMore;\n    return function (_ref2, isFirstRendering) {\n      var refine = _ref2.refine,\n        items = _ref2.items,\n        createURL = _ref2.createURL,\n        instantSearchInstance = _ref2.instantSearchInstance,\n        isShowingMore = _ref2.isShowingMore,\n        toggleShowMore = _ref2.toggleShowMore,\n        canToggleShowMore = _ref2.canToggleShowMore;\n      if (isFirstRendering) {\n        renderState.templateProps = prepareTemplateProps({\n          defaultTemplates: defaultTemplates$7,\n          templatesConfig: instantSearchInstance.templatesConfig,\n          templates: templates\n        });\n        return;\n      }\n      var facetValues = items.map(function (facetValue) {\n        return _objectSpread2(_objectSpread2({}, facetValue), {}, {\n          url: createURL(facetValue.value)\n        });\n      });\n      P(h(RefinementList$1, {\n        createURL: createURL,\n        cssClasses: cssClasses,\n        facetValues: facetValues,\n        showMore: showMore,\n        templateProps: renderState.templateProps,\n        toggleRefinement: refine,\n        toggleShowMore: toggleShowMore,\n        isShowingMore: isShowingMore,\n        canToggleShowMore: canToggleShowMore\n      }), containerNode);\n    };\n  };\n  var menu = function menu(widgetParams) {\n    var _ref3 = widgetParams || {},\n      container = _ref3.container,\n      attribute = _ref3.attribute,\n      sortBy = _ref3.sortBy,\n      limit = _ref3.limit,\n      showMore = _ref3.showMore,\n      showMoreLimit = _ref3.showMoreLimit,\n      _ref3$cssClasses = _ref3.cssClasses,\n      userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n      _ref3$templates = _ref3.templates,\n      templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n      transformItems = _ref3.transformItems;\n    if (!container) {\n      throw new Error(withUsage$H('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$d(), userCssClasses.root),\n      noRefinementRoot: cx(suit$d({\n        modifierName: 'noRefinement'\n      }), userCssClasses.noRefinementRoot),\n      list: cx(suit$d({\n        descendantName: 'list'\n      }), userCssClasses.list),\n      item: cx(suit$d({\n        descendantName: 'item'\n      }), userCssClasses.item),\n      selectedItem: cx(suit$d({\n        descendantName: 'item',\n        modifierName: 'selected'\n      }), userCssClasses.selectedItem),\n      link: cx(suit$d({\n        descendantName: 'link'\n      }), userCssClasses.link),\n      label: cx(suit$d({\n        descendantName: 'label'\n      }), userCssClasses.label),\n      count: cx(suit$d({\n        descendantName: 'count'\n      }), userCssClasses.count),\n      showMore: cx(suit$d({\n        descendantName: 'showMore'\n      }), userCssClasses.showMore),\n      disabledShowMore: cx(suit$d({\n        descendantName: 'showMore',\n        modifierName: 'disabled'\n      }), userCssClasses.disabledShowMore)\n    };\n    var specializedRenderer = renderer$9({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      renderState: {},\n      templates: templates,\n      showMore: showMore\n    });\n    var makeWidget = connectMenu(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      attribute: attribute,\n      limit: limit,\n      showMore: showMore,\n      showMoreLimit: showMoreLimit,\n      sortBy: sortBy,\n      transformItems: transformItems\n    })), {}, {\n      $$widgetType: 'ais.menu'\n    });\n  };\n\n  function MenuSelect(_ref) {\n    var cssClasses = _ref.cssClasses,\n      templateProps = _ref.templateProps,\n      items = _ref.items,\n      refine = _ref.refine;\n    var _ref2 = find(items, function (item) {\n        return item.isRefined;\n      }) || {\n        value: ''\n      },\n      selectedValue = _ref2.value;\n    return h(\"div\", {\n      className: cx(cssClasses.root, items.length === 0 && cssClasses.noRefinementRoot)\n    }, h(\"select\", {\n      className: cssClasses.select,\n      value: selectedValue,\n      onChange: function onChange(event) {\n        refine(event.target.value);\n      }\n    }, h(Template, _extends({}, templateProps, {\n      templateKey: \"defaultOption\",\n      rootTagName: \"option\",\n      rootProps: {\n        value: '',\n        className: cssClasses.option\n      }\n    })), items.map(function (item) {\n      return h(Template, _extends({}, templateProps, {\n        templateKey: \"item\",\n        rootTagName: \"option\",\n        rootProps: {\n          value: item.value,\n          className: cssClasses.option\n        },\n        key: item.value,\n        data: item\n      }));\n    })));\n  }\n\n  var defaultTemplates$8 = {\n    item: function item(_ref) {\n      var label = _ref.label,\n        count = _ref.count;\n      return \"\".concat(label, \" (\").concat(formatNumber(count), \")\");\n    },\n    defaultOption: function defaultOption() {\n      return 'See all';\n    }\n  };\n\n  var withUsage$I = createDocumentationMessageGenerator({\n    name: 'menu-select'\n  });\n  var suit$e = component('MenuSelect');\n  var renderer$a = function renderer(_ref) {\n    var containerNode = _ref.containerNode,\n      cssClasses = _ref.cssClasses,\n      renderState = _ref.renderState,\n      templates = _ref.templates;\n    return function (_ref2, isFirstRendering) {\n      var refine = _ref2.refine,\n        items = _ref2.items,\n        instantSearchInstance = _ref2.instantSearchInstance;\n      if (isFirstRendering) {\n        renderState.templateProps = prepareTemplateProps({\n          defaultTemplates: defaultTemplates$8,\n          templatesConfig: instantSearchInstance.templatesConfig,\n          templates: templates\n        });\n        return;\n      }\n      P(h(MenuSelect, {\n        cssClasses: cssClasses,\n        items: items,\n        refine: refine,\n        templateProps: renderState.templateProps\n      }), containerNode);\n    };\n  };\n  var menuSelect = function menuSelect(widgetParams) {\n    var _ref3 = widgetParams || {},\n      container = _ref3.container,\n      attribute = _ref3.attribute,\n      _ref3$sortBy = _ref3.sortBy,\n      sortBy = _ref3$sortBy === void 0 ? ['name:asc'] : _ref3$sortBy,\n      _ref3$limit = _ref3.limit,\n      limit = _ref3$limit === void 0 ? 10 : _ref3$limit,\n      _ref3$cssClasses = _ref3.cssClasses,\n      userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n      _ref3$templates = _ref3.templates,\n      templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n      transformItems = _ref3.transformItems;\n    if (!container) {\n      throw new Error(withUsage$I('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$e(), userCssClasses.root),\n      noRefinementRoot: cx(suit$e({\n        modifierName: 'noRefinement'\n      }), userCssClasses.noRefinementRoot),\n      select: cx(suit$e({\n        descendantName: 'select'\n      }), userCssClasses.select),\n      option: cx(suit$e({\n        descendantName: 'option'\n      }), userCssClasses.option)\n    };\n    var specializedRenderer = renderer$a({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      renderState: {},\n      templates: templates\n    });\n    var makeWidget = connectMenu(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      attribute: attribute,\n      limit: limit,\n      sortBy: sortBy,\n      transformItems: transformItems\n    })), {}, {\n      $$widgetType: 'ais.menuSelect'\n    });\n  };\n\n  var defaultTemplates$9 = {\n    item: function item(_ref) {\n      var cssClasses = _ref.cssClasses,\n        attribute = _ref.attribute,\n        label = _ref.label,\n        isRefined = _ref.isRefined;\n      return h(\"label\", {\n        className: cssClasses.label\n      }, h(\"input\", {\n        type: \"radio\",\n        className: cssClasses.radio,\n        name: attribute,\n        defaultChecked: isRefined\n      }), h(\"span\", {\n        className: cssClasses.labelText\n      }, label));\n    }\n  };\n\n  var withUsage$J = createDocumentationMessageGenerator({\n    name: 'numeric-menu'\n  });\n  var suit$f = component('NumericMenu');\n  var renderer$b = function renderer(_ref) {\n    var containerNode = _ref.containerNode,\n      attribute = _ref.attribute,\n      cssClasses = _ref.cssClasses,\n      renderState = _ref.renderState,\n      templates = _ref.templates;\n    return function (_ref2, isFirstRendering) {\n      var createURL = _ref2.createURL,\n        instantSearchInstance = _ref2.instantSearchInstance,\n        refine = _ref2.refine,\n        items = _ref2.items;\n      if (isFirstRendering) {\n        renderState.templateProps = prepareTemplateProps({\n          defaultTemplates: defaultTemplates$9,\n          templatesConfig: instantSearchInstance.templatesConfig,\n          templates: templates\n        });\n        return;\n      }\n      P(h(RefinementList$1, {\n        createURL: createURL,\n        cssClasses: cssClasses,\n        facetValues: items,\n        templateProps: renderState.templateProps,\n        toggleRefinement: refine,\n        attribute: attribute\n      }), containerNode);\n    };\n  };\n  var numericMenu = function numericMenu(widgetParams) {\n    var _ref3 = widgetParams || {},\n      container = _ref3.container,\n      attribute = _ref3.attribute,\n      items = _ref3.items,\n      _ref3$cssClasses = _ref3.cssClasses,\n      userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n      _ref3$templates = _ref3.templates,\n      templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n      transformItems = _ref3.transformItems;\n    if (!container) {\n      throw new Error(withUsage$J('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$f(), userCssClasses.root),\n      noRefinementRoot: cx(suit$f({\n        modifierName: 'noRefinement'\n      }), userCssClasses.noRefinementRoot),\n      list: cx(suit$f({\n        descendantName: 'list'\n      }), userCssClasses.list),\n      item: cx(suit$f({\n        descendantName: 'item'\n      }), userCssClasses.item),\n      selectedItem: cx(suit$f({\n        descendantName: 'item',\n        modifierName: 'selected'\n      }), userCssClasses.selectedItem),\n      label: cx(suit$f({\n        descendantName: 'label'\n      }), userCssClasses.label),\n      radio: cx(suit$f({\n        descendantName: 'radio'\n      }), userCssClasses.radio),\n      labelText: cx(suit$f({\n        descendantName: 'labelText'\n      }), userCssClasses.labelText)\n    };\n    var specializedRenderer = renderer$b({\n      containerNode: containerNode,\n      attribute: attribute,\n      cssClasses: cssClasses,\n      renderState: {},\n      templates: templates\n    });\n    var makeWidget = connectNumericMenu(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      attribute: attribute,\n      items: items,\n      transformItems: transformItems\n    })), {}, {\n      $$widgetType: 'ais.numericMenu'\n    });\n  };\n\n  function Pagination(props) {\n    function createClickHandler(pageNumber) {\n      return function (event) {\n        if (isSpecialClick(event)) {\n          // do not alter the default browser behavior\n          // if one special key is down\n          return;\n        }\n        event.preventDefault();\n        props.setCurrentPage(pageNumber);\n      };\n    }\n    return h(\"div\", {\n      className: cx(props.cssClasses.root, props.nbPages <= 1 && props.cssClasses.noRefinementRoot)\n    }, h(\"ul\", {\n      className: props.cssClasses.list\n    }, props.showFirst && h(PaginationLink, {\n      ariaLabel: \"First Page\",\n      className: props.cssClasses.firstPageItem,\n      isDisabled: props.isFirstPage,\n      templates: props.templates,\n      templateKey: \"first\",\n      pageNumber: 0,\n      createURL: props.createURL,\n      cssClasses: props.cssClasses,\n      createClickHandler: createClickHandler\n    }), props.showPrevious && h(PaginationLink, {\n      ariaLabel: \"Previous Page\",\n      className: props.cssClasses.previousPageItem,\n      isDisabled: props.isFirstPage,\n      templates: props.templates,\n      templateKey: \"previous\",\n      pageNumber: props.currentPage - 1,\n      createURL: props.createURL,\n      cssClasses: props.cssClasses,\n      createClickHandler: createClickHandler\n    }), props.pages.map(function (pageNumber) {\n      return h(PaginationLink, {\n        key: pageNumber,\n        ariaLabel: \"Page \".concat(pageNumber + 1),\n        className: props.cssClasses.pageItem,\n        isSelected: pageNumber === props.currentPage,\n        templates: props.templates,\n        templateKey: \"page\",\n        pageNumber: pageNumber,\n        createURL: props.createURL,\n        cssClasses: props.cssClasses,\n        createClickHandler: createClickHandler\n      });\n    }), props.showNext && h(PaginationLink, {\n      ariaLabel: \"Next Page\",\n      className: props.cssClasses.nextPageItem,\n      isDisabled: props.isLastPage,\n      templates: props.templates,\n      templateKey: \"next\",\n      pageNumber: props.currentPage + 1,\n      createURL: props.createURL,\n      cssClasses: props.cssClasses,\n      createClickHandler: createClickHandler\n    }), props.showLast && h(PaginationLink, {\n      ariaLabel: \"Last Page, Page \".concat(props.nbPages),\n      className: props.cssClasses.lastPageItem,\n      isDisabled: props.isLastPage,\n      templates: props.templates,\n      templateKey: \"last\",\n      pageNumber: props.nbPages - 1,\n      createURL: props.createURL,\n      cssClasses: props.cssClasses,\n      createClickHandler: createClickHandler\n    })));\n  }\n  function PaginationLink(_ref) {\n    var templates = _ref.templates,\n      templateKey = _ref.templateKey,\n      ariaLabel = _ref.ariaLabel,\n      pageNumber = _ref.pageNumber,\n      className = _ref.className,\n      _ref$isDisabled = _ref.isDisabled,\n      isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,\n      _ref$isSelected = _ref.isSelected,\n      isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,\n      cssClasses = _ref.cssClasses,\n      createURL = _ref.createURL,\n      createClickHandler = _ref.createClickHandler;\n    return h(\"li\", {\n      className: cx(cssClasses.item, isDisabled && cssClasses.disabledItem, className, isSelected && cssClasses.selectedItem)\n    }, isDisabled ? h(Template, {\n      rootTagName: \"span\",\n      rootProps: {\n        className: cssClasses.link,\n        'aria-label': ariaLabel\n      },\n      templateKey: templateKey,\n      templates: templates,\n      data: {\n        page: pageNumber + 1\n      }\n    }) : h(Template, {\n      rootTagName: \"a\",\n      rootProps: {\n        className: cssClasses.link,\n        'aria-label': ariaLabel,\n        href: createURL(pageNumber),\n        onClick: createClickHandler(pageNumber)\n      },\n      templateKey: templateKey,\n      templates: templates,\n      data: {\n        page: pageNumber + 1\n      }\n    }));\n  }\n\n  var suit$g = component('Pagination');\n  var withUsage$K = createDocumentationMessageGenerator({\n    name: 'pagination'\n  });\n  var defaultTemplates$a = {\n    previous: function previous() {\n      return '‹';\n    },\n    next: function next() {\n      return '›';\n    },\n    page: function page(_ref) {\n      var _page = _ref.page;\n      return \"\".concat(_page);\n    },\n    first: function first() {\n      return '«';\n    },\n    last: function last() {\n      return '»';\n    }\n  };\n  var renderer$c = function renderer(_ref2) {\n    var containerNode = _ref2.containerNode,\n      cssClasses = _ref2.cssClasses,\n      templates = _ref2.templates,\n      showFirst = _ref2.showFirst,\n      showLast = _ref2.showLast,\n      showPrevious = _ref2.showPrevious,\n      showNext = _ref2.showNext,\n      scrollToNode = _ref2.scrollToNode;\n    return function (_ref3, isFirstRendering) {\n      var createURL = _ref3.createURL,\n        currentRefinement = _ref3.currentRefinement,\n        nbPages = _ref3.nbPages,\n        pages = _ref3.pages,\n        isFirstPage = _ref3.isFirstPage,\n        isLastPage = _ref3.isLastPage,\n        refine = _ref3.refine;\n      if (isFirstRendering) return;\n      var setCurrentPage = function setCurrentPage(pageNumber) {\n        refine(pageNumber);\n        if (scrollToNode !== false) {\n          scrollToNode.scrollIntoView();\n        }\n      };\n      P(h(Pagination, {\n        createURL: createURL,\n        cssClasses: cssClasses,\n        currentPage: currentRefinement,\n        templates: templates,\n        nbPages: nbPages,\n        pages: pages,\n        isFirstPage: isFirstPage,\n        isLastPage: isLastPage,\n        setCurrentPage: setCurrentPage,\n        showFirst: showFirst,\n        showLast: showLast,\n        showPrevious: showPrevious,\n        showNext: showNext\n      }), containerNode);\n    };\n  };\n  var pagination = function pagination(widgetParams) {\n    var _ref4 = widgetParams || {},\n      container = _ref4.container,\n      _ref4$templates = _ref4.templates,\n      userTemplates = _ref4$templates === void 0 ? {} : _ref4$templates,\n      _ref4$cssClasses = _ref4.cssClasses,\n      userCssClasses = _ref4$cssClasses === void 0 ? {} : _ref4$cssClasses,\n      totalPages = _ref4.totalPages,\n      padding = _ref4.padding,\n      _ref4$showFirst = _ref4.showFirst,\n      showFirst = _ref4$showFirst === void 0 ? true : _ref4$showFirst,\n      _ref4$showLast = _ref4.showLast,\n      showLast = _ref4$showLast === void 0 ? true : _ref4$showLast,\n      _ref4$showPrevious = _ref4.showPrevious,\n      showPrevious = _ref4$showPrevious === void 0 ? true : _ref4$showPrevious,\n      _ref4$showNext = _ref4.showNext,\n      showNext = _ref4$showNext === void 0 ? true : _ref4$showNext,\n      _ref4$scrollTo = _ref4.scrollTo,\n      userScrollTo = _ref4$scrollTo === void 0 ? 'body' : _ref4$scrollTo;\n    if (!container) {\n      throw new Error(withUsage$K('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var scrollTo = userScrollTo === true ? 'body' : userScrollTo;\n    var scrollToNode = scrollTo !== false ? getContainerNode(scrollTo) : false;\n    var cssClasses = {\n      root: cx(suit$g(), userCssClasses.root),\n      noRefinementRoot: cx(suit$g({\n        modifierName: 'noRefinement'\n      }), userCssClasses.noRefinementRoot),\n      list: cx(suit$g({\n        descendantName: 'list'\n      }), userCssClasses.list),\n      item: cx(suit$g({\n        descendantName: 'item'\n      }), userCssClasses.item),\n      firstPageItem: cx(suit$g({\n        descendantName: 'item',\n        modifierName: 'firstPage'\n      }), userCssClasses.firstPageItem),\n      lastPageItem: cx(suit$g({\n        descendantName: 'item',\n        modifierName: 'lastPage'\n      }), userCssClasses.lastPageItem),\n      previousPageItem: cx(suit$g({\n        descendantName: 'item',\n        modifierName: 'previousPage'\n      }), userCssClasses.previousPageItem),\n      nextPageItem: cx(suit$g({\n        descendantName: 'item',\n        modifierName: 'nextPage'\n      }), userCssClasses.nextPageItem),\n      pageItem: cx(suit$g({\n        descendantName: 'item',\n        modifierName: 'page'\n      }), userCssClasses.pageItem),\n      selectedItem: cx(suit$g({\n        descendantName: 'item',\n        modifierName: 'selected'\n      }), userCssClasses.selectedItem),\n      disabledItem: cx(suit$g({\n        descendantName: 'item',\n        modifierName: 'disabled'\n      }), userCssClasses.disabledItem),\n      link: cx(suit$g({\n        descendantName: 'link'\n      }), userCssClasses.link)\n    };\n    var templates = _objectSpread2(_objectSpread2({}, defaultTemplates$a), userTemplates);\n    var specializedRenderer = renderer$c({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      templates: templates,\n      showFirst: showFirst,\n      showLast: showLast,\n      showPrevious: showPrevious,\n      showNext: showNext,\n      scrollToNode: scrollToNode\n    });\n    var makeWidget = connectPagination(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      totalPages: totalPages,\n      padding: padding\n    })), {}, {\n      $$widgetType: 'ais.pagination'\n    });\n  };\n\n  function Panel(props) {\n    var _useState = y$1(props.isCollapsed),\n      _useState2 = _slicedToArray(_useState, 2),\n      isCollapsed = _useState2[0],\n      setIsCollapsed = _useState2[1];\n    var _useState3 = y$1(false),\n      _useState4 = _slicedToArray(_useState3, 2),\n      isControlled = _useState4[0],\n      setIsControlled = _useState4[1];\n    var bodyRef = A$1(null);\n    s$1(function () {\n      var node = bodyRef.current;\n      if (!node) {\n        return undefined;\n      }\n      node.appendChild(props.bodyElement);\n      return function () {\n        node.removeChild(props.bodyElement);\n      };\n    }, [bodyRef, props.bodyElement]);\n    if (!isControlled && props.isCollapsed !== isCollapsed) {\n      setIsCollapsed(props.isCollapsed);\n    }\n    return h(\"div\", {\n      className: cx(props.cssClasses.root, props.hidden && props.cssClasses.noRefinementRoot, props.collapsible && props.cssClasses.collapsibleRoot, isCollapsed && props.cssClasses.collapsedRoot),\n      hidden: props.hidden\n    }, props.templates.header && h(\"div\", {\n      className: props.cssClasses.header\n    }, h(Template, {\n      templates: props.templates,\n      templateKey: \"header\",\n      rootTagName: \"span\",\n      data: props.data\n    }), props.collapsible && h(\"button\", {\n      className: props.cssClasses.collapseButton,\n      \"aria-expanded\": !isCollapsed,\n      onClick: function onClick(event) {\n        event.preventDefault();\n        setIsControlled(true);\n        setIsCollapsed(function (prevIsCollapsed) {\n          return !prevIsCollapsed;\n        });\n      }\n    }, h(Template, {\n      templates: props.templates,\n      templateKey: \"collapseButtonText\",\n      rootTagName: \"span\",\n      data: {\n        collapsed: isCollapsed\n      }\n    }))), h(\"div\", {\n      className: props.cssClasses.body,\n      ref: bodyRef\n    }), props.templates.footer && h(Template, {\n      templates: props.templates,\n      templateKey: \"footer\",\n      rootProps: {\n        className: props.cssClasses.footer\n      },\n      data: props.data\n    }));\n  }\n\n  var withUsage$L = createDocumentationMessageGenerator({\n    name: 'panel'\n  });\n  var suit$h = component('Panel');\n  var renderer$d = function renderer(_ref) {\n    var containerNode = _ref.containerNode,\n      bodyContainerNode = _ref.bodyContainerNode,\n      cssClasses = _ref.cssClasses,\n      templates = _ref.templates;\n    return function (_ref2) {\n      var options = _ref2.options,\n        hidden = _ref2.hidden,\n        collapsible = _ref2.collapsible,\n        collapsed = _ref2.collapsed;\n      P(h(Panel, {\n        cssClasses: cssClasses,\n        hidden: hidden,\n        collapsible: collapsible,\n        isCollapsed: collapsed,\n        templates: templates,\n        data: options,\n        bodyElement: bodyContainerNode\n      }), containerNode);\n    };\n  };\n  /**\n   * The panel widget wraps other widgets in a consistent panel design.\n   * It also reacts, indicates and sets CSS classes when widgets are no longer relevant for refining.\n   */\n  var panel = function panel(panelWidgetParams) {\n    var _ref3 = panelWidgetParams || {},\n      _ref3$templates = _ref3.templates,\n      templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n      _ref3$hidden = _ref3.hidden,\n      hidden = _ref3$hidden === void 0 ? function () {\n        return false;\n      } : _ref3$hidden,\n      collapsed = _ref3.collapsed,\n      _ref3$cssClasses = _ref3.cssClasses,\n      userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses;\n     _warning(typeof hidden === 'function', \"The `hidden` option in the \\\"panel\\\" widget expects a function returning a boolean (received type \".concat(getObjectType(hidden), \").\")) ;\n     _warning(typeof collapsed === 'undefined' || typeof collapsed === 'function', \"The `collapsed` option in the \\\"panel\\\" widget expects a function returning a boolean (received type \".concat(getObjectType(collapsed), \").\")) ;\n    var bodyContainerNode = document.createElement('div');\n    var collapsible = Boolean(collapsed);\n    var collapsedFn = typeof collapsed === 'function' ? collapsed : function () {\n      return false;\n    };\n    var cssClasses = {\n      root: cx(suit$h(), userCssClasses.root),\n      noRefinementRoot: cx(suit$h({\n        modifierName: 'noRefinement'\n      }), userCssClasses.noRefinementRoot),\n      collapsibleRoot: cx(suit$h({\n        modifierName: 'collapsible'\n      }), userCssClasses.collapsibleRoot),\n      collapsedRoot: cx(suit$h({\n        modifierName: 'collapsed'\n      }), userCssClasses.collapsedRoot),\n      collapseButton: cx(suit$h({\n        descendantName: 'collapseButton'\n      }), userCssClasses.collapseButton),\n      collapseIcon: cx(suit$h({\n        descendantName: 'collapseIcon'\n      }), userCssClasses.collapseIcon),\n      body: cx(suit$h({\n        descendantName: 'body'\n      }), userCssClasses.body),\n      header: cx(suit$h({\n        descendantName: 'header'\n      }), userCssClasses.header),\n      footer: cx(suit$h({\n        descendantName: 'footer'\n      }), userCssClasses.footer)\n    };\n    return function (widgetFactory) {\n      return function (widgetParams) {\n        if (!(widgetParams && widgetParams.container)) {\n          throw new Error(withUsage$L(\"The `container` option is required in the widget within the panel.\"));\n        }\n        var containerNode = getContainerNode(widgetParams.container);\n        var defaultTemplates = {\n          collapseButtonText: function collapseButtonText(_ref4) {\n            var isCollapsed = _ref4.collapsed;\n            return \"<svg\\n          class=\\\"\".concat(cssClasses.collapseIcon, \"\\\"\\n          style=\\\"width: 1em; height: 1em;\\\"\\n          viewBox=\\\"0 0 500 500\\\"\\n        >\\n        <path d=\\\"\").concat(isCollapsed ? 'M100 250l300-150v300z' : 'M250 400l150-300H100z', \"\\\" fill=\\\"currentColor\\\" />\\n        </svg>\");\n          }\n        };\n        var renderPanel = renderer$d({\n          containerNode: containerNode,\n          bodyContainerNode: bodyContainerNode,\n          cssClasses: cssClasses,\n          templates: _objectSpread2(_objectSpread2({}, defaultTemplates), templates)\n        });\n        var widget = widgetFactory(_objectSpread2(_objectSpread2({}, widgetParams), {}, {\n          container: bodyContainerNode\n        }));\n\n        // TypeScript somehow loses track of the ...widget type, since it's\n        // not directly returned. Eventually the \"as AugmentedWidget<typeof widgetFactory>\"\n        // will not be needed anymore.\n        // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n        return _objectSpread2(_objectSpread2({}, widget), {}, {\n          init: function init() {\n            for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n              args[_key] = arguments[_key];\n            }\n            var renderOptions = args[0];\n            var options = _objectSpread2(_objectSpread2({}, widget.getWidgetRenderState ? widget.getWidgetRenderState(renderOptions) : {}), renderOptions);\n            renderPanel({\n              options: options,\n              hidden: true,\n              collapsible: collapsible,\n              collapsed: false\n            });\n            if (typeof widget.init === 'function') {\n              var _widget$init;\n              (_widget$init = widget.init).call.apply(_widget$init, [this].concat(args));\n            }\n          },\n          render: function render() {\n            for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n              args[_key2] = arguments[_key2];\n            }\n            var renderOptions = args[0];\n            var options = _objectSpread2(_objectSpread2({}, widget.getWidgetRenderState ? widget.getWidgetRenderState(renderOptions) : {}), renderOptions);\n            renderPanel({\n              options: options,\n              hidden: Boolean(hidden(options)),\n              collapsible: collapsible,\n              collapsed: Boolean(collapsedFn(options))\n            });\n            if (typeof widget.render === 'function') {\n              var _widget$render;\n              (_widget$render = widget.render).call.apply(_widget$render, [this].concat(args));\n            }\n          },\n          dispose: function dispose() {\n            P(null, containerNode);\n            if (typeof widget.dispose === 'function') {\n              var _widget$dispose;\n              for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n                args[_key3] = arguments[_key3];\n              }\n              return (_widget$dispose = widget.dispose).call.apply(_widget$dispose, [this].concat(args));\n            }\n            return undefined;\n          }\n        });\n      };\n    };\n  };\n\n  var _excluded$s = [\"placesReference\", \"defaultPosition\"],\n    _excluded2$6 = [\"places\"];\n\n  /* Places.js is an optional dependency, no error should be reported if the package is missing */\n  /** @ts-ignore */\n\n  // using the type like this requires only one ts-ignore\n\n  /**\n   * This widget sets the geolocation value for the search based on the selected\n   * result in the Algolia Places autocomplete.\n   * @deprecated the places service is no longer offered, and this widget will be removed in InstantSearch.js v5\n   */\n  var placesWidget = function placesWidget(widgetParams) {\n    var _ref = widgetParams || {},\n      placesReference = _ref.placesReference,\n      _ref$defaultPosition = _ref.defaultPosition,\n      defaultPosition = _ref$defaultPosition === void 0 ? [] : _ref$defaultPosition,\n      placesOptions = _objectWithoutProperties(_ref, _excluded$s);\n    if (typeof placesReference !== 'function') {\n      throw new Error('The `placesReference` option requires a valid Places.js reference.');\n    }\n    var placesAutocomplete = placesReference(placesOptions);\n    var state = {\n      query: '',\n      initialLatLngViaIP: undefined,\n      isInitialLatLngViaIPSet: false\n    };\n    return {\n      $$type: 'ais.places',\n      $$widgetType: 'ais.places',\n      init: function init(_ref2) {\n        var helper = _ref2.helper;\n        placesAutocomplete.on('change', function (eventOptions) {\n          var _eventOptions$suggest = eventOptions.suggestion,\n            value = _eventOptions$suggest.value,\n            _eventOptions$suggest2 = _eventOptions$suggest.latlng,\n            lat = _eventOptions$suggest2.lat,\n            lng = _eventOptions$suggest2.lng;\n          state.query = value;\n          helper.setQueryParameter('insideBoundingBox', undefined).setQueryParameter('aroundLatLngViaIP', false).setQueryParameter('aroundLatLng', \"\".concat(lat, \",\").concat(lng)).search();\n        });\n        placesAutocomplete.on('clear', function () {\n          state.query = '';\n          helper.setQueryParameter('insideBoundingBox', undefined);\n          if (defaultPosition.length > 1) {\n            helper.setQueryParameter('aroundLatLngViaIP', false).setQueryParameter('aroundLatLng', defaultPosition.join(','));\n          } else {\n            helper.setQueryParameter('aroundLatLngViaIP', state.initialLatLngViaIP).setQueryParameter('aroundLatLng', undefined);\n          }\n          helper.search();\n        });\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref3) {\n        var searchParameters = _ref3.searchParameters;\n        var position = searchParameters.aroundLatLng || defaultPosition.join(',');\n        var hasPositionSet = position !== defaultPosition.join(',');\n        if (!hasPositionSet && !state.query) {\n          var places = uiState.places,\n            uiStateWithoutPlaces = _objectWithoutProperties(uiState, _excluded2$6);\n          return uiStateWithoutPlaces;\n        }\n        return _objectSpread2(_objectSpread2({}, uiState), {}, {\n          places: {\n            query: state.query,\n            position: position\n          }\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref4) {\n        var uiState = _ref4.uiState;\n        var _ref5 = uiState.places || {},\n          _ref5$query = _ref5.query,\n          query = _ref5$query === void 0 ? '' : _ref5$query,\n          _ref5$position = _ref5.position,\n          position = _ref5$position === void 0 ? defaultPosition.join(',') : _ref5$position;\n        state.query = query;\n        if (!state.isInitialLatLngViaIPSet) {\n          state.isInitialLatLngViaIPSet = true;\n          state.initialLatLngViaIP = searchParameters.aroundLatLngViaIP;\n        }\n        placesAutocomplete.setVal(query);\n        placesAutocomplete.close();\n        return searchParameters.setQueryParameter('insideBoundingBox', undefined).setQueryParameter('aroundLatLngViaIP', false).setQueryParameter('aroundLatLng', position || undefined);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread2(_objectSpread2({}, renderState), {}, {\n          places: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState() {\n        return {\n          widgetParams: widgetParams\n        };\n      }\n    };\n  };\n  var places = deprecate(placesWidget, 'The places widget is deprecated and will be removed in InstantSearch.js 5.0.');\n\n  var PoweredBy = function PoweredBy(_ref) {\n    var url = _ref.url,\n      theme = _ref.theme,\n      cssClasses = _ref.cssClasses;\n    return h(\"div\", {\n      className: cssClasses.root\n    }, h(\"a\", {\n      href: url,\n      target: \"_blank\",\n      className: cssClasses.link,\n      \"aria-label\": \"Search by Algolia\",\n      rel: \"noopener noreferrer\"\n    }, h(\"svg\", {\n      height: \"1.2em\",\n      className: cssClasses.logo,\n      viewBox: \"0 0 572 64\"\n      // This style is necessary as long as it's not included in InstantSearch.css.\n      // For now, InstantSearch.css sets a maximum width of 70px.\n      ,\n      style: {\n        width: 'auto'\n      }\n    }, h(\"path\", {\n      fill: theme === 'dark' ? '#FFF' : '#36395A',\n      d: \"M16 48.3c-3.4 0-6.3-.6-8.7-1.7A12.4 12.4 0 0 1 1.9 42C.6 40 0 38 0 35.4h6.5a6.7 6.7 0 0 0 3.9 6c1.4.7 3.3 1.1 5.6 1.1 2.2 0 4-.3 5.4-1a7 7 0 0 0 3-2.4 6 6 0 0 0 1-3.4c0-1.5-.6-2.8-1.9-3.7-1.3-1-3.3-1.6-5.9-1.8l-4-.4c-3.7-.3-6.6-1.4-8.8-3.4a10 10 0 0 1-3.3-7.9c0-2.4.6-4.6 1.8-6.4a12 12 0 0 1 5-4.3c2.2-1 4.7-1.6 7.5-1.6s5.5.5 7.6 1.6a12 12 0 0 1 5 4.4c1.2 1.8 1.8 4 1.8 6.7h-6.5a6.4 6.4 0 0 0-3.5-5.9c-1-.6-2.6-1-4.4-1s-3.2.3-4.4 1c-1.1.6-2 1.4-2.6 2.4-.5 1-.8 2-.8 3.1a5 5 0 0 0 1.5 3.6c1 1 2.6 1.7 4.7 1.9l4 .3c2.8.2 5.2.8 7.2 1.8 2.1 1 3.7 2.2 4.9 3.8a9.7 9.7 0 0 1 1.7 5.8c0 2.5-.7 4.7-2 6.6a13 13 0 0 1-5.6 4.4c-2.4 1-5.2 1.6-8.4 1.6Zm35.6 0c-2.6 0-4.8-.4-6.7-1.3a13 13 0 0 1-4.7-3.5 17.1 17.1 0 0 1-3.6-10.4v-1c0-2 .3-3.8 1-5.6a13 13 0 0 1 7.3-8.3 15 15 0 0 1 6.3-1.4A13.2 13.2 0 0 1 64 24.3c1 2.2 1.6 4.6 1.6 7.2V34H39.4v-4.3h21.8l-1.8 2.2c0-2-.3-3.7-.9-5.1a7.3 7.3 0 0 0-2.7-3.4c-1.2-.7-2.7-1.1-4.6-1.1s-3.4.4-4.7 1.3a8 8 0 0 0-2.9 3.6c-.6 1.5-.9 3.3-.9 5.4 0 2 .3 3.7 1 5.3a7.9 7.9 0 0 0 2.8 3.7c1.3.8 3 1.3 5 1.3s3.8-.5 5.1-1.3c1.3-1 2.1-2 2.4-3.2h6a11.8 11.8 0 0 1-7 8.7 16 16 0 0 1-6.4 1.2ZM80 48c-2.2 0-4-.3-5.7-1a8.4 8.4 0 0 1-3.7-3.3 9.7 9.7 0 0 1-1.3-5.2c0-2 .5-3.8 1.5-5.2a9 9 0 0 1 4.3-3.1c1.8-.7 4-1 6.7-1H89v4.1h-7.5c-2 0-3.4.5-4.4 1.4-1 1-1.6 2.1-1.6 3.6s.5 2.7 1.6 3.6c1 1 2.5 1.4 4.4 1.4 1.1 0 2.2-.2 3.2-.7 1-.4 1.9-1 2.6-2 .6-1 1-2.4 1-4.2l1.7 2.1c-.2 2-.7 3.8-1.5 5.2a9 9 0 0 1-3.4 3.3 12 12 0 0 1-5.3 1Zm9.5-.7v-8.8h-1v-10c0-1.8-.5-3.2-1.4-4.1-1-1-2.4-1.4-4.2-1.4a142.9 142.9 0 0 0-10.2.4v-5.6a74.8 74.8 0 0 1 8.6-.4c3 0 5.5.4 7.5 1.2s3.4 2 4.4 3.6c1 1.7 1.4 4 1.4 6.7v18.4h-5Zm12.9 0V17.8h5v12.3h-.2c0-4.2 1-7.4 2.8-9.5a11 11 0 0 1 8.3-3.1h1v5.6h-2a9 9 0 0 0-6.3 2.2c-1.5 1.5-2.2 3.6-2.2 6.4v15.6h-6.4Zm34.4 1a15 15 0 0 1-6.6-1.3c-1.9-.9-3.4-2-4.7-3.5a15.5 15.5 0 0 1-2.7-5c-.6-1.7-1-3.6-1-5.4v-1c0-2 .4-3.8 1-5.6a15 15 0 0 1 2.8-4.9c1.3-1.5 2.8-2.6 4.6-3.5a16.4 16.4 0 0 1 13.3.2c2 1 3.5 2.3 4.8 4a12 12 0 0 1 2 6H144c-.2-1.6-1-3-2.2-4.1a7.5 7.5 0 0 0-5.2-1.7 8 8 0 0 0-4.7 1.3 8 8 0 0 0-2.8 3.6 13.8 13.8 0 0 0 0 10.3c.6 1.5 1.5 2.7 2.8 3.6s2.8 1.3 4.8 1.3c1.5 0 2.7-.2 3.8-.8a7 7 0 0 0 2.6-2c.7-1 1-2 1.2-3.2h6.2a11 11 0 0 1-2 6.2 15.1 15.1 0 0 1-11.8 5.5Zm19.7-1v-40h6.4V31h-1.3c0-3 .4-5.5 1.1-7.6a9.7 9.7 0 0 1 3.5-4.8A9.9 9.9 0 0 1 172 17h.3c3.5 0 6 1.1 7.9 3.5 1.7 2.3 2.6 5.7 2.6 10v16.8h-6.4V29.6c0-2.1-.6-3.8-1.8-5a6.4 6.4 0 0 0-4.8-1.8c-2 0-3.7.7-5 2a7.8 7.8 0 0 0-1.9 5.5v17h-6.4Zm63.8 1a12.2 12.2 0 0 1-10.9-6.2 19 19 0 0 1-1.8-7.3h1.4v12.5h-5.1v-40h6.4v19.8l-2 3.5c.2-3.1.8-5.7 1.9-7.7a11 11 0 0 1 4.4-4.5c1.8-1 3.9-1.5 6.1-1.5a13.4 13.4 0 0 1 12.8 9.1c.7 1.9 1 3.8 1 6v1c0 2.2-.3 4.1-1 6a13.6 13.6 0 0 1-13.2 9.4Zm-1.2-5.5a8.4 8.4 0 0 0 7.9-5c.7-1.5 1.1-3.3 1.1-5.3s-.4-3.8-1.1-5.3a8.7 8.7 0 0 0-3.2-3.6 9.6 9.6 0 0 0-9.2-.2 8.5 8.5 0 0 0-3.3 3.2c-.8 1.4-1.3 3-1.3 5v2.3a9 9 0 0 0 1.3 4.8 9 9 0 0 0 3.4 3c1.4.7 2.8 1 4.4 1Zm27.3 3.9-10-28.9h6.5l9.5 28.9h-6Zm-7.5 12.2v-5.7h4.9c1 0 2-.1 2.9-.4a4 4 0 0 0 2-1.4c.4-.7.9-1.6 1.2-2.7l8.6-30.9h6.2l-9.3 32.4a14 14 0 0 1-2.5 5 8.9 8.9 0 0 1-4 2.8c-1.5.6-3.4.9-5.6.9h-4.4Zm9-12.2v-5.2h6.4v5.2H248Z\"\n    }), h(\"path\", {\n      fill: theme === 'dark' ? '#FFF' : '#003DFF',\n      d: \"M534.4 9.1H528a.8.8 0 0 1-.7-.7V1.8c0-.4.2-.7.6-.8l6.5-1c.4 0 .8.2.9.6v7.8c0 .4-.4.7-.8.7zM428 35.2V.8c0-.5-.3-.8-.7-.8h-.2l-6.4 1c-.4 0-.7.4-.7.8v35c0 1.6 0 11.8 12.3 12.2.5 0 .8-.4.8-.8V43c0-.4-.3-.7-.6-.8-4.5-.5-4.5-6-4.5-7zm106.5-21.8H528c-.4 0-.7.4-.7.8v34c0 .4.3.8.7.8h6.5c.4 0 .8-.4.8-.8v-34c0-.5-.4-.8-.8-.8zm-17.7 21.8V.8c0-.5-.3-.8-.8-.8l-6.5 1c-.4 0-.7.4-.7.8v35c0 1.6 0 11.8 12.3 12.2.4 0 .8-.4.8-.8V43c0-.4-.3-.7-.7-.8-4.4-.5-4.4-6-4.4-7zm-22.2-20.6a16.5 16.5 0 0 1 8.6 9.3c.8 2.2 1.3 4.8 1.3 7.5a19.4 19.4 0 0 1-4.6 12.6 14.8 14.8 0 0 1-5.2 3.6c-2 .9-5.2 1.4-6.8 1.4a21 21 0 0 1-6.7-1.4 15.4 15.4 0 0 1-8.6-9.3 21.3 21.3 0 0 1 0-14.4 15.2 15.2 0 0 1 8.6-9.3c2-.8 4.3-1.2 6.7-1.2s4.6.4 6.7 1.2zm-6.7 27.6c2.7 0 4.7-1 6.2-3s2.2-4.3 2.2-7.8-.7-6.3-2.2-8.3-3.5-3-6.2-3-4.7 1-6.1 3c-1.5 2-2.2 4.8-2.2 8.3s.7 5.8 2.2 7.8 3.5 3 6.2 3zm-88.8-28.8c-6.2 0-11.7 3.3-14.8 8.2a18.6 18.6 0 0 0 4.8 25.2c1.8 1.2 4 1.8 6.2 1.7s.1 0 .1 0h.9c4.2-.7 8-4 9.1-8.1v7.4c0 .4.3.7.8.7h6.4a.7.7 0 0 0 .7-.7V14.2c0-.5-.3-.8-.7-.8h-13.5zm6.3 26.5a9.8 9.8 0 0 1-5.7 2h-.5a10 10 0 0 1-9.2-14c1.4-3.7 5-6.3 9-6.3h6.4v18.3zm152.3-26.5h13.5c.5 0 .8.3.8.7v33.7c0 .4-.3.7-.8.7h-6.4a.7.7 0 0 1-.8-.7v-7.4c-1.2 4-4.8 7.4-9 8h-.1a4.2 4.2 0 0 1-.5.1h-.9a10.3 10.3 0 0 1-7-2.6c-4-3.3-6.5-8.4-6.5-14.2 0-3.7 1-7.2 3-10 3-5 8.5-8.3 14.7-8.3zm.6 28.4c2.2-.1 4.2-.6 5.7-2V21.7h-6.3a9.8 9.8 0 0 0-9 6.4 10.2 10.2 0 0 0 9.1 13.9h.5zM452.8 13.4c-6.2 0-11.7 3.3-14.8 8.2a18.5 18.5 0 0 0 3.6 24.3 10.4 10.4 0 0 0 13 .6c2.2-1.5 3.8-3.7 4.5-6.1v7.8c0 2.8-.8 5-2.2 6.3-1.5 1.5-4 2.2-7.5 2.2l-6-.3c-.3 0-.7.2-.8.5l-1.6 5.5c-.1.4.1.8.5 1h.1c2.8.4 5.5.6 7 .6 6.3 0 11-1.4 14-4.1 2.7-2.5 4.2-6.3 4.5-11.4V14.2c0-.5-.4-.8-.8-.8h-13.5zm6.3 8.2v18.3a9.6 9.6 0 0 1-5.6 2h-1a10.3 10.3 0 0 1-8.8-14c1.4-3.7 5-6.3 9-6.3h6.4zM291 31.5A32 32 0 0 1 322.8 0h30.8c.6 0 1.2.5 1.2 1.2v61.5c0 1.1-1.3 1.7-2.2 1l-19.2-17a18 18 0 0 1-11 3.4 18.1 18.1 0 1 1 18.2-14.8c-.1.4-.5.7-.9.6-.1 0-.3 0-.4-.2l-3.8-3.4c-.4-.3-.6-.8-.7-1.4a12 12 0 1 0-2.4 8.3c.4-.4 1-.5 1.6-.2l14.7 13.1v-46H323a26 26 0 1 0 10 49.7c.8-.4 1.6-.2 2.3.3l3 2.7c.3.2.3.7 0 1l-.2.2a32 32 0 0 1-47.2-28.6z\"\n    }))));\n  };\n\n  var suit$i = component('PoweredBy');\n  var withUsage$M = createDocumentationMessageGenerator({\n    name: 'powered-by'\n  });\n  var renderer$e = function renderer(_ref) {\n    var containerNode = _ref.containerNode,\n      cssClasses = _ref.cssClasses;\n    return function (_ref2, isFirstRendering) {\n      var url = _ref2.url,\n        widgetParams = _ref2.widgetParams;\n      if (isFirstRendering) {\n        var _widgetParams$theme = widgetParams.theme,\n          theme = _widgetParams$theme === void 0 ? 'light' : _widgetParams$theme;\n        P(h(PoweredBy, {\n          cssClasses: cssClasses,\n          url: url,\n          theme: theme\n        }), containerNode);\n        return;\n      }\n    };\n  };\n  var poweredBy = function poweredBy(widgetParams) {\n    var _ref3 = widgetParams || {},\n      container = _ref3.container,\n      _ref3$cssClasses = _ref3.cssClasses,\n      userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n      _ref3$theme = _ref3.theme,\n      theme = _ref3$theme === void 0 ? 'light' : _ref3$theme;\n    if (!container) {\n      throw new Error(withUsage$M('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$i(), suit$i({\n        modifierName: theme === 'dark' ? 'dark' : 'light'\n      }), userCssClasses.root),\n      link: cx(suit$i({\n        descendantName: 'link'\n      }), userCssClasses.link),\n      logo: cx(suit$i({\n        descendantName: 'logo'\n      }), userCssClasses.logo)\n    };\n    var specializedRenderer = renderer$e({\n      containerNode: containerNode,\n      cssClasses: cssClasses\n    });\n    var makeWidget = connectPoweredBy(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      theme: theme\n    })), {}, {\n      $$widgetType: 'ais.poweredBy'\n    });\n  };\n\n  var withUsage$N = createDocumentationMessageGenerator({\n    name: 'query-rule-context'\n  });\n  var queryRuleContext = function queryRuleContext() {\n    var widgetParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    if (!widgetParams.trackedFilters) {\n      throw new Error(withUsage$N('The `trackedFilters` option is required.'));\n    }\n    return _objectSpread2(_objectSpread2({}, connectQueryRules(noop)(widgetParams)), {}, {\n      $$widgetType: 'ais.queryRuleContext'\n    });\n  };\n\n  var QueryRuleCustomData = function QueryRuleCustomData(_ref) {\n    var cssClasses = _ref.cssClasses,\n      templates = _ref.templates,\n      items = _ref.items;\n    return h(Template, {\n      templateKey: \"default\",\n      templates: templates,\n      rootProps: {\n        className: cssClasses.root\n      },\n      data: {\n        items: items\n      }\n    });\n  };\n\n  var defaultTemplates$b = {\n    default: function _default(_ref) {\n      var items = _ref.items;\n      return JSON.stringify(items, null, 2);\n    }\n  };\n  var withUsage$O = createDocumentationMessageGenerator({\n    name: 'query-rule-custom-data'\n  });\n  var suit$j = component('QueryRuleCustomData');\n  var renderer$f = function renderer(_ref2) {\n    var containerNode = _ref2.containerNode,\n      cssClasses = _ref2.cssClasses,\n      templates = _ref2.templates;\n    return function (_ref3) {\n      var items = _ref3.items;\n      P(h(QueryRuleCustomData, {\n        cssClasses: cssClasses,\n        templates: templates,\n        items: items\n      }), containerNode);\n    };\n  };\n  var queryRuleCustomData = function queryRuleCustomData(widgetParams) {\n    var _ref4 = widgetParams || {},\n      container = _ref4.container,\n      _ref4$cssClasses = _ref4.cssClasses,\n      userCssClasses = _ref4$cssClasses === void 0 ? {} : _ref4$cssClasses,\n      _ref4$templates = _ref4.templates,\n      userTemplates = _ref4$templates === void 0 ? {} : _ref4$templates,\n      _ref4$transformItems = _ref4.transformItems,\n      transformItems = _ref4$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref4$transformItems;\n    if (!container) {\n      throw new Error(withUsage$O('The `container` option is required.'));\n    }\n    var cssClasses = {\n      root: cx(suit$j(), userCssClasses.root)\n    };\n    var containerNode = getContainerNode(container);\n    var templates = _objectSpread2(_objectSpread2({}, defaultTemplates$b), userTemplates);\n    var specializedRenderer = renderer$f({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      renderState: {},\n      templates: templates\n    });\n    var makeWidget = connectQueryRules(specializedRenderer, function () {\n      P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      transformItems: transformItems\n    })), {}, {\n      $$widgetType: 'ais.queryRuleCustomData'\n    });\n  };\n\n  var _excluded$t = [\"item\", \"sendEvent\"];\n  var withUsage$P = createDocumentationMessageGenerator({\n    name: 'related-products'\n  });\n  var RelatedProducts = createRelatedProductsComponent({\n    createElement: h,\n    Fragment: p\n  });\n  function createRenderer(_ref) {\n    var renderState = _ref.renderState,\n      cssClasses = _ref.cssClasses,\n      containerNode = _ref.containerNode,\n      templates = _ref.templates;\n    return function renderer(_ref2, isFirstRendering) {\n      var items = _ref2.items,\n        results = _ref2.results,\n        instantSearchInstance = _ref2.instantSearchInstance,\n        sendEvent = _ref2.sendEvent;\n      if (isFirstRendering) {\n        renderState.templateProps = prepareTemplateProps({\n          defaultTemplates: {},\n          templatesConfig: instantSearchInstance.templatesConfig,\n          templates: templates\n        });\n        return;\n      }\n      var headerComponent = templates.header ? function (data) {\n        return h(Template, _extends({}, renderState.templateProps, {\n          templateKey: \"header\",\n          rootTagName: \"fragment\",\n          data: {\n            cssClasses: data.classNames,\n            items: data.items\n          }\n        }));\n      } : undefined;\n      var itemComponent = templates.item ? function (_ref3) {\n        var item = _ref3.item,\n          _sendEvent = _ref3.sendEvent,\n          rootProps = _objectWithoutProperties(_ref3, _excluded$t);\n        return h(Template, _extends({}, renderState.templateProps, {\n          templateKey: \"item\",\n          rootTagName: \"fragment\",\n          data: item,\n          sendEvent: _sendEvent,\n          rootProps: _objectSpread2({}, rootProps)\n        }));\n      } : undefined;\n      var emptyComponent = templates.empty ? function () {\n        return h(Template, _extends({}, renderState.templateProps, {\n          templateKey: \"empty\",\n          rootTagName: \"fragment\",\n          data: results\n        }));\n      } : undefined;\n      var layoutComponent = templates.layout ? function (data) {\n        return h(Template, _extends({}, renderState.templateProps, {\n          templateKey: \"layout\",\n          rootTagName: \"fragment\",\n          data: {\n            sendEvent: sendEvent,\n            items: data.items,\n            templates: {\n              item: templates.item ? function (_ref4) {\n                var item = _ref4.item;\n                return h(Template, _extends({}, renderState.templateProps, {\n                  templateKey: \"item\",\n                  rootTagName: \"fragment\",\n                  data: item,\n                  sendEvent: sendEvent\n                }));\n              } : undefined\n            },\n            cssClasses: {\n              list: data.classNames.list,\n              item: data.classNames.item\n            }\n          },\n          sendEvent: sendEvent\n        }));\n      } : undefined;\n      P(h(RelatedProducts, {\n        items: items,\n        sendEvent: sendEvent,\n        classNames: cssClasses,\n        headerComponent: headerComponent,\n        itemComponent: itemComponent,\n        emptyComponent: emptyComponent,\n        layout: layoutComponent,\n        status: instantSearchInstance.status\n      }), containerNode);\n    };\n  }\n  var relatedProducts = (function relatedProducts(widgetParams) {\n    var _ref5 = widgetParams || {},\n      container = _ref5.container,\n      objectIDs = _ref5.objectIDs,\n      limit = _ref5.limit,\n      queryParameters = _ref5.queryParameters,\n      fallbackParameters = _ref5.fallbackParameters,\n      threshold = _ref5.threshold,\n      escapeHTML = _ref5.escapeHTML,\n      transformItems = _ref5.transformItems,\n      _ref5$templates = _ref5.templates,\n      templates = _ref5$templates === void 0 ? {} : _ref5$templates,\n      _ref5$cssClasses = _ref5.cssClasses,\n      cssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses;\n    if (!container) {\n      throw new Error(withUsage$P('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var specializedRenderer = createRenderer({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      renderState: {},\n      templates: templates\n    });\n    var makeWidget = connectRelatedProducts(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      objectIDs: objectIDs,\n      limit: limit,\n      queryParameters: queryParameters,\n      fallbackParameters: fallbackParameters,\n      threshold: threshold,\n      escapeHTML: escapeHTML,\n      transformItems: transformItems\n    })), {}, {\n      $$widgetType: 'ais.relatedProducts'\n    });\n  });\n\n  // Strips leading `0` from a positive number value\n  function stripLeadingZeroFromInput(value) {\n    return value.replace(/^(0+)\\d/, function (part) {\n      return Number(part).toString();\n    });\n  }\n  var RangeInput = /*#__PURE__*/function (_Component) {\n    _inherits(RangeInput, _Component);\n    var _super = _createSuper(RangeInput);\n    function RangeInput() {\n      var _this$props$values$mi, _this$props$values$ma;\n      var _this;\n      _classCallCheck(this, RangeInput);\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n      _this = _super.call.apply(_super, [this].concat(args));\n      _defineProperty(_assertThisInitialized(_this), \"state\", {\n        min: (_this$props$values$mi = _this.props.values.min) === null || _this$props$values$mi === void 0 ? void 0 : _this$props$values$mi.toString(),\n        max: (_this$props$values$ma = _this.props.values.max) === null || _this$props$values$ma === void 0 ? void 0 : _this$props$values$ma.toString()\n      });\n      _defineProperty(_assertThisInitialized(_this), \"onInput\", function (key) {\n        return function (event) {\n          var _ref = event.currentTarget,\n            value = _ref.value;\n          _this.setState(_defineProperty({}, key, value));\n        };\n      });\n      _defineProperty(_assertThisInitialized(_this), \"onSubmit\", function (event) {\n        event.preventDefault();\n        var _this$state = _this.state,\n          min = _this$state.min,\n          max = _this$state.max;\n        _this.props.refine([min ? Number(min) : undefined, max ? Number(max) : undefined]);\n      });\n      return _this;\n    }\n    _createClass(RangeInput, [{\n      key: \"componentWillReceiveProps\",\n      value: function componentWillReceiveProps(nextProps) {\n        var _nextProps$values$min, _nextProps$values$max;\n        this.setState({\n          min: (_nextProps$values$min = nextProps.values.min) === null || _nextProps$values$min === void 0 ? void 0 : _nextProps$values$min.toString(),\n          max: (_nextProps$values$max = nextProps.values.max) === null || _nextProps$values$max === void 0 ? void 0 : _nextProps$values$max.toString()\n        });\n      }\n    }, {\n      key: \"render\",\n      value: function render() {\n        var _this$state2 = this.state,\n          minValue = _this$state2.min,\n          maxValue = _this$state2.max;\n        var _this$props = this.props,\n          min = _this$props.min,\n          max = _this$props.max,\n          step = _this$props.step,\n          cssClasses = _this$props.cssClasses,\n          templateProps = _this$props.templateProps;\n        var isDisabled = min && max ? min >= max : false;\n        var hasRefinements = Boolean(minValue || maxValue);\n        var rootClassNames = cx(cssClasses.root, !hasRefinements && cssClasses.noRefinement);\n        return h(\"div\", {\n          className: rootClassNames\n        }, h(\"form\", {\n          className: cssClasses.form,\n          onSubmit: this.onSubmit\n        }, h(\"label\", {\n          className: cssClasses.label\n        }, h(\"input\", {\n          className: cx(cssClasses.input, cssClasses.inputMin),\n          type: \"number\",\n          min: min,\n          max: max,\n          step: step,\n          value: stripLeadingZeroFromInput(minValue !== null && minValue !== void 0 ? minValue : ''),\n          onInput: this.onInput('min'),\n          placeholder: min === null || min === void 0 ? void 0 : min.toString(),\n          disabled: isDisabled\n        })), h(Template, _extends({}, templateProps, {\n          templateKey: \"separatorText\",\n          rootTagName: \"span\",\n          rootProps: {\n            className: cssClasses.separator\n          }\n        })), h(\"label\", {\n          className: cssClasses.label\n        }, h(\"input\", {\n          className: cx(cssClasses.input, cssClasses.inputMax),\n          type: \"number\",\n          min: min,\n          max: max,\n          step: step,\n          value: stripLeadingZeroFromInput(maxValue !== null && maxValue !== void 0 ? maxValue : ''),\n          onInput: this.onInput('max'),\n          placeholder: max === null || max === void 0 ? void 0 : max.toString(),\n          disabled: isDisabled\n        })), h(Template, _extends({}, templateProps, {\n          templateKey: \"submitText\",\n          rootTagName: \"button\",\n          rootProps: {\n            type: 'submit',\n            className: cssClasses.submit,\n            disabled: isDisabled\n          }\n        }))));\n      }\n    }]);\n    return RangeInput;\n  }(d);\n\n  var withUsage$Q = createDocumentationMessageGenerator({\n    name: 'range-input'\n  });\n  var suit$k = component('RangeInput');\n  var defaultTemplates$c = {\n    separatorText: function separatorText() {\n      return 'to';\n    },\n    submitText: function submitText() {\n      return 'Go';\n    }\n  };\n  var renderer$g = function renderer(_ref) {\n    var containerNode = _ref.containerNode,\n      cssClasses = _ref.cssClasses,\n      renderState = _ref.renderState,\n      templates = _ref.templates;\n    return function (_ref2, isFirstRendering) {\n      var refine = _ref2.refine,\n        range = _ref2.range,\n        start = _ref2.start,\n        widgetParams = _ref2.widgetParams,\n        instantSearchInstance = _ref2.instantSearchInstance;\n      if (isFirstRendering) {\n        renderState.templateProps = prepareTemplateProps({\n          defaultTemplates: defaultTemplates$c,\n          templatesConfig: instantSearchInstance.templatesConfig,\n          templates: templates\n        });\n        return;\n      }\n      var rangeMin = range.min,\n        rangeMax = range.max;\n      var _start = _slicedToArray(start, 2),\n        minValue = _start[0],\n        maxValue = _start[1];\n      var step = 1 / Math.pow(10, widgetParams.precision || 0);\n      var values = {\n        min: minValue !== -Infinity && minValue !== rangeMin ? minValue : undefined,\n        max: maxValue !== Infinity && maxValue !== rangeMax ? maxValue : undefined\n      };\n      P(h(RangeInput, {\n        min: rangeMin,\n        max: rangeMax,\n        step: step,\n        values: values,\n        cssClasses: cssClasses,\n        refine: refine,\n        templateProps: renderState.templateProps\n      }), containerNode);\n    };\n  };\n  var rangeInput = function rangeInput(widgetParams) {\n    var _ref3 = widgetParams || {},\n      container = _ref3.container,\n      attribute = _ref3.attribute,\n      min = _ref3.min,\n      max = _ref3.max,\n      _ref3$precision = _ref3.precision,\n      precision = _ref3$precision === void 0 ? 0 : _ref3$precision,\n      _ref3$cssClasses = _ref3.cssClasses,\n      userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n      _ref3$templates = _ref3.templates,\n      templates = _ref3$templates === void 0 ? {} : _ref3$templates;\n    if (!container) {\n      throw new Error(withUsage$Q('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$k(), userCssClasses.root),\n      noRefinement: cx(suit$k({\n        modifierName: 'noRefinement'\n      })),\n      form: cx(suit$k({\n        descendantName: 'form'\n      }), userCssClasses.form),\n      label: cx(suit$k({\n        descendantName: 'label'\n      }), userCssClasses.label),\n      input: cx(suit$k({\n        descendantName: 'input'\n      }), userCssClasses.input),\n      inputMin: cx(suit$k({\n        descendantName: 'input',\n        modifierName: 'min'\n      }), userCssClasses.inputMin),\n      inputMax: cx(suit$k({\n        descendantName: 'input',\n        modifierName: 'max'\n      }), userCssClasses.inputMax),\n      separator: cx(suit$k({\n        descendantName: 'separator'\n      }), userCssClasses.separator),\n      submit: cx(suit$k({\n        descendantName: 'submit'\n      }), userCssClasses.submit)\n    };\n    var specializedRenderer = renderer$g({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      templates: templates,\n      renderState: {}\n    });\n    var makeWidget = connectRange(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      attribute: attribute,\n      min: min,\n      max: max,\n      precision: precision\n    })), {}, {\n      $$type: 'ais.rangeInput',\n      $$widgetType: 'ais.rangeInput'\n    });\n  };\n\n  var Pit = function Pit(_ref) {\n    var style = _ref.style,\n      children = _ref.children;\n    // first, end & middle\n    var positionValue = Math.round(parseFloat(style.left));\n    var shouldDisplayValue = [0, 50, 100].includes(positionValue);\n    var value = children;\n    var pitValue = Math.round(parseInt(value, 10) * 100) / 100;\n    return h(\"div\", {\n      style: _objectSpread2(_objectSpread2({}, style), {}, {\n        marginLeft: positionValue === 100 ? '-2px' : 0\n      }),\n      className: cx('rheostat-marker', 'rheostat-marker-horizontal', shouldDisplayValue && 'rheostat-marker-large')\n    }, shouldDisplayValue && h(\"div\", {\n      className: 'rheostat-value'\n    }, pitValue));\n  };\n\n  var KEYS = {\n    DOWN: 40,\n    END: 35,\n    ESC: 27,\n    HOME: 36,\n    LEFT: 37,\n    PAGE_DOWN: 34,\n    PAGE_UP: 33,\n    RIGHT: 39,\n    UP: 38\n  };\n  var PERCENT_EMPTY = 0;\n  var PERCENT_FULL = 100;\n  function getPosition(value, min, max) {\n    return (value - min) / (max - min) * 100;\n  }\n  function getValue$1(pos, min, max) {\n    var decimal = pos / 100;\n    if (pos === 0) {\n      return min;\n    } else if (pos === 100) {\n      return max;\n    }\n    return Math.round((max - min) * decimal + min);\n  }\n  function getClassName(props) {\n    var orientation = props.orientation === 'vertical' ? 'rheostat-vertical' : 'rheostat-horizontal';\n    return ['rheostat', orientation].concat(props.className.split(' ')).join(' ');\n  }\n  function getHandleFor(ev) {\n    return Number(ev.currentTarget.getAttribute('data-handle-key'));\n  }\n  function killEvent(ev) {\n    ev.stopPropagation();\n    ev.preventDefault();\n  }\n  function Button(props) {\n    return h(\"button\", _extends({}, props, {\n      type: \"button\"\n    }));\n  }\n\n  // Preact doesn't have builtin types for Style, JSX.HTMLAttributes['style'] is just object\n  // maybe migrate to csstype later?\n  var _ref6 = h(\"div\", {\n    className: \"rheostat-background\"\n  });\n  var Rheostat = /*#__PURE__*/function (_Component) {\n    _inherits(Rheostat, _Component);\n    var _super = _createSuper(Rheostat);\n    function Rheostat() {\n      var _this;\n      _classCallCheck(this, Rheostat);\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n      _this = _super.call.apply(_super, [this].concat(args));\n      _defineProperty(_assertThisInitialized(_this), \"x\", [0, 0].map(function (y) {\n        return y;\n      }));\n      _defineProperty(_assertThisInitialized(_this), \"state\", {\n        className: getClassName(_this.props),\n        // non-null thanks to defaultProps\n        handlePos: _this.props.values.map(function (value) {\n          return getPosition(value, _this.props.min, _this.props.max);\n        }),\n        handleDimensions: 0,\n        mousePos: null,\n        sliderBox: {},\n        slidingIndex: null,\n        // non-null thanks to defaultProps\n        values: _this.props.values\n      });\n      _defineProperty(_assertThisInitialized(_this), \"rheostat\", y());\n      _defineProperty(_assertThisInitialized(_this), \"componentWillReceiveProps\", function (nextProps) {\n        var _this$props = _this.props,\n          className = _this$props.className,\n          disabled = _this$props.disabled,\n          min = _this$props.min,\n          max = _this$props.max,\n          orientation = _this$props.orientation;\n        var _this$state = _this.state,\n          values = _this$state.values,\n          slidingIndex = _this$state.slidingIndex;\n        var minMaxChanged = nextProps.min !== min || nextProps.max !== max;\n        var valuesChanged = values.length !== nextProps.values.length || values.some(function (value, idx) {\n          return nextProps.values[idx] !== value;\n        });\n        var orientationChanged = nextProps.className !== className || nextProps.orientation !== orientation;\n        var willBeDisabled = nextProps.disabled && !disabled;\n        if (orientationChanged) {\n          _this.setState({\n            className: getClassName(nextProps)\n          });\n        }\n        if (minMaxChanged || valuesChanged) _this.updateNewValues(nextProps);\n        if (willBeDisabled && slidingIndex !== null) {\n          _this.endSlide();\n        }\n      });\n      _defineProperty(_assertThisInitialized(_this), \"getPublicState\", function () {\n        var _this$props2 = _this.props,\n          min = _this$props2.min,\n          max = _this$props2.max;\n        var values = _this.state.values;\n        return {\n          max: max,\n          min: min,\n          values: values\n        };\n      });\n      _defineProperty(_assertThisInitialized(_this), \"getSliderBoundingBox\", function () {\n        // only gets called after render, so it will always be defined\n        var node = _this.rheostat.current;\n        var rect = node.getBoundingClientRect();\n        return {\n          height: rect.height || node.clientHeight,\n          left: rect.left,\n          top: rect.top,\n          width: rect.width || node.clientWidth\n        };\n      });\n      _defineProperty(_assertThisInitialized(_this), \"getProgressStyle\", function (idx) {\n        var handlePos = _this.state.handlePos;\n        var value = handlePos[idx];\n        if (idx === 0) {\n          return _this.props.orientation === 'vertical' ? {\n            height: \"\".concat(value, \"%\"),\n            top: 0\n          } : {\n            left: 0,\n            width: \"\".concat(value, \"%\")\n          };\n        }\n        var prevValue = handlePos[idx - 1];\n        var diffValue = value - prevValue;\n        return _this.props.orientation === 'vertical' ? {\n          height: \"\".concat(diffValue, \"%\"),\n          top: \"\".concat(prevValue, \"%\")\n        } : {\n          left: \"\".concat(prevValue, \"%\"),\n          width: \"\".concat(diffValue, \"%\")\n        };\n      });\n      _defineProperty(_assertThisInitialized(_this), \"getMinValue\", function (idx) {\n        return _this.state.values[idx - 1] ? Math.max(_this.props.min, _this.state.values[idx - 1]) : _this.props.min;\n      });\n      _defineProperty(_assertThisInitialized(_this), \"getMaxValue\", function (idx) {\n        return _this.state.values[idx + 1] ? Math.min(_this.props.max, _this.state.values[idx + 1]) : _this.props.max;\n      });\n      _defineProperty(_assertThisInitialized(_this), \"getHandleDimensions\", function (ev, sliderBox) {\n        var handleNode = ev.currentTarget || null;\n        if (!handleNode) return 0;\n        return _this.props.orientation === 'vertical' ? handleNode.clientHeight / sliderBox.height * PERCENT_FULL / 2 : handleNode.clientWidth / sliderBox.width * PERCENT_FULL / 2;\n      });\n      _defineProperty(_assertThisInitialized(_this), \"getClosestSnapPoint\", function (value) {\n        // non-null thanks to defaultProps\n        if (!_this.props.snapPoints.length) return value;\n        return _this.props.snapPoints.reduce(function (snapTo, snap) {\n          return Math.abs(snapTo - value) < Math.abs(snap - value) ? snapTo : snap;\n        });\n      });\n      _defineProperty(_assertThisInitialized(_this), \"getSnapPosition\", function (positionPercent) {\n        if (!_this.props.snap) return positionPercent;\n        var _ref = _this.props,\n          max = _ref.max,\n          min = _ref.min;\n        var value = getValue$1(positionPercent, min, max);\n        var snapValue = _this.getClosestSnapPoint(value);\n        return getPosition(snapValue, min, max);\n      });\n      _defineProperty(_assertThisInitialized(_this), \"getNextPositionForKey\", function (idx, keyCode) {\n        var _stepMultiplier;\n        var _this$state2 = _this.state,\n          handlePos = _this$state2.handlePos,\n          values = _this$state2.values;\n        var _ref2 = _this.props,\n          max = _ref2.max,\n          min = _ref2.min,\n          snapPoints = _ref2.snapPoints;\n        var shouldSnap = _this.props.snap;\n        var proposedValue = values[idx];\n        var proposedPercentage = handlePos[idx];\n        var originalPercentage = proposedPercentage;\n        var stepValue = 1;\n        if (max >= 100) {\n          proposedPercentage = Math.round(proposedPercentage);\n        } else {\n          stepValue = 100 / (max - min);\n        }\n        var currentIndex = null;\n        if (shouldSnap) {\n          currentIndex = snapPoints.indexOf(_this.getClosestSnapPoint(values[idx]));\n        }\n        var stepMultiplier = (_stepMultiplier = {}, _defineProperty(_stepMultiplier, KEYS.LEFT, function (v) {\n          return v * -1;\n        }), _defineProperty(_stepMultiplier, KEYS.RIGHT, function (v) {\n          return v;\n        }), _defineProperty(_stepMultiplier, KEYS.UP, function (v) {\n          return v;\n        }), _defineProperty(_stepMultiplier, KEYS.DOWN, function (v) {\n          return v * -1;\n        }), _defineProperty(_stepMultiplier, KEYS.PAGE_DOWN, function (v) {\n          return v > 1 ? -v : v * -10;\n        }), _defineProperty(_stepMultiplier, KEYS.PAGE_UP, function (v) {\n          return v > 1 ? v : v * 10;\n        }), _stepMultiplier);\n        if (Object.prototype.hasOwnProperty.call(stepMultiplier, keyCode)) {\n          proposedPercentage += stepMultiplier[keyCode](stepValue);\n          if (shouldSnap) {\n            if (!currentIndex) ; else if (proposedPercentage > originalPercentage) {\n              // move cursor right unless overflow\n              if (currentIndex < snapPoints.length - 1) {\n                proposedValue = snapPoints[currentIndex + 1];\n              }\n              // move cursor left unless there is overflow\n            } else if (currentIndex > 0) {\n              proposedValue = snapPoints[currentIndex - 1];\n            }\n          }\n        } else if (keyCode === KEYS.HOME) {\n          proposedPercentage = PERCENT_EMPTY;\n          if (shouldSnap) {\n            proposedValue = snapPoints[0];\n          }\n        } else if (keyCode === KEYS.END) {\n          proposedPercentage = PERCENT_FULL;\n          if (shouldSnap) {\n            proposedValue = snapPoints[snapPoints.length - 1];\n          }\n        } else {\n          return null;\n        }\n        return shouldSnap ? getPosition(proposedValue, min, max) : proposedPercentage;\n      });\n      _defineProperty(_assertThisInitialized(_this), \"getNextState\", function (idx, proposedPosition) {\n        var handlePos = _this.state.handlePos;\n        var _ref3 = _this.props,\n          max = _ref3.max,\n          min = _ref3.min;\n        var actualPosition = _this.validatePosition(idx, proposedPosition);\n        var nextHandlePos = handlePos.map(function (pos, index) {\n          return index === idx ? actualPosition : pos;\n        });\n        return {\n          handlePos: nextHandlePos,\n          values: nextHandlePos.map(function (pos) {\n            return getValue$1(pos, min, max);\n          })\n        };\n      });\n      _defineProperty(_assertThisInitialized(_this), \"getClosestHandle\", function (positionPercent) {\n        var handlePos = _this.state.handlePos;\n        return handlePos.reduce(function (closestIdx, _node, idx) {\n          var challenger = Math.abs(handlePos[idx] - positionPercent);\n          var current = Math.abs(handlePos[closestIdx] - positionPercent);\n          return challenger < current ? idx : closestIdx;\n        }, 0);\n      });\n      _defineProperty(_assertThisInitialized(_this), \"setStartSlide\", function (ev, x, y) {\n        var sliderBox = _this.getSliderBoundingBox();\n        _this.setState({\n          handleDimensions: _this.getHandleDimensions(ev, sliderBox),\n          mousePos: {\n            x: x,\n            y: y\n          },\n          sliderBox: sliderBox,\n          slidingIndex: getHandleFor(ev)\n        });\n      });\n      _defineProperty(_assertThisInitialized(_this), \"startMouseSlide\", function (ev) {\n        _this.setStartSlide(ev, ev.clientX, ev.clientY);\n        document.addEventListener('mousemove', _this.handleMouseSlide, false);\n        document.addEventListener('mouseup', _this.endSlide, false);\n        killEvent(ev);\n      });\n      _defineProperty(_assertThisInitialized(_this), \"startTouchSlide\", function (ev) {\n        if (ev.changedTouches.length > 1) return;\n        var touch = ev.changedTouches[0];\n        _this.setStartSlide(ev, touch.clientX, touch.clientY);\n        document.addEventListener('touchmove', _this.handleTouchSlide, false);\n        document.addEventListener('touchend', _this.endSlide, false);\n        if (_this.props.onSliderDragStart) _this.props.onSliderDragStart();\n        killEvent(ev);\n      });\n      _defineProperty(_assertThisInitialized(_this), \"handleMouseSlide\", function (ev) {\n        if (_this.state.slidingIndex === null) return;\n        _this.handleSlide(ev.clientX, ev.clientY);\n        killEvent(ev);\n      });\n      _defineProperty(_assertThisInitialized(_this), \"handleTouchSlide\", function (ev) {\n        if (_this.state.slidingIndex === null) return;\n        if (ev.changedTouches.length > 1) {\n          _this.endSlide();\n          return;\n        }\n        var touch = ev.changedTouches[0];\n        _this.handleSlide(touch.clientX, touch.clientY);\n        killEvent(ev);\n      });\n      _defineProperty(_assertThisInitialized(_this), \"handleSlide\", function (x, y) {\n        var _this$state3 = _this.state,\n          idx = _this$state3.slidingIndex,\n          sliderBox = _this$state3.sliderBox;\n        var positionPercent = _this.props.orientation === 'vertical' ? (y - sliderBox.top) / sliderBox.height * PERCENT_FULL : (x - sliderBox.left) / sliderBox.width * PERCENT_FULL;\n        _this.slideTo(idx, positionPercent);\n        if (_this.canMove(idx, positionPercent)) {\n          // update mouse positions\n          _this.setState({\n            mousePos: {\n              x: x,\n              y: y\n            }\n          });\n          if (_this.props.onSliderDragMove) _this.props.onSliderDragMove();\n        }\n      });\n      _defineProperty(_assertThisInitialized(_this), \"endSlide\", function () {\n        var idx = _this.state.slidingIndex;\n        _this.setState({\n          slidingIndex: null\n        });\n        document.removeEventListener('mouseup', _this.endSlide, false);\n        document.removeEventListener('touchend', _this.endSlide, false);\n        document.removeEventListener('touchmove', _this.handleTouchSlide, false);\n        document.removeEventListener('mousemove', _this.handleMouseSlide, false);\n        if (_this.props.onSliderDragEnd) _this.props.onSliderDragEnd();\n        if (_this.props.snap) {\n          var positionPercent = _this.getSnapPosition(_this.state.handlePos[idx]);\n          _this.slideTo(idx, positionPercent, function () {\n            return _this.fireChangeEvent();\n          });\n        } else {\n          _this.fireChangeEvent();\n        }\n      });\n      _defineProperty(_assertThisInitialized(_this), \"handleClick\", function (ev) {\n        if (ev.target.getAttribute('data-handle-key')) {\n          return;\n        }\n\n        // Calculate the position of the slider on the page so we can determine\n        // the position where you click in relativity.\n        var sliderBox = _this.getSliderBoundingBox();\n        var positionDecimal = _this.props.orientation === 'vertical' ? (ev.clientY - sliderBox.top) / sliderBox.height : (ev.clientX - sliderBox.left) / sliderBox.width;\n        var positionPercent = positionDecimal * PERCENT_FULL;\n        var handleId = _this.getClosestHandle(positionPercent);\n        var validPositionPercent = _this.getSnapPosition(positionPercent);\n\n        // Move the handle there\n        _this.slideTo(handleId, validPositionPercent, function () {\n          return _this.fireChangeEvent();\n        });\n        if (_this.props.onClick) _this.props.onClick();\n      });\n      _defineProperty(_assertThisInitialized(_this), \"handleKeydown\", function (ev) {\n        var idx = getHandleFor(ev);\n        if (ev.keyCode === KEYS.ESC) {\n          ev.currentTarget.blur();\n          return;\n        }\n        var proposedPercentage = _this.getNextPositionForKey(idx, ev.keyCode);\n        if (proposedPercentage === null) return;\n        if (_this.canMove(idx, proposedPercentage)) {\n          _this.slideTo(idx, proposedPercentage, function () {\n            return _this.fireChangeEvent();\n          });\n          if (_this.props.onKeyPress) _this.props.onKeyPress();\n        }\n        killEvent(ev);\n      });\n      // Make sure the proposed position respects the bounds and\n      // does not collide with other handles too much.\n      _defineProperty(_assertThisInitialized(_this), \"validatePosition\", function (idx, proposedPosition) {\n        var _this$state4 = _this.state,\n          handlePos = _this$state4.handlePos,\n          handleDimensions = _this$state4.handleDimensions;\n        return Math.max(Math.min(proposedPosition, handlePos[idx + 1] !== undefined ? handlePos[idx + 1] - handleDimensions : PERCENT_FULL // 100% is the highest value\n        ), handlePos[idx - 1] !== undefined ? handlePos[idx - 1] + handleDimensions : PERCENT_EMPTY // 0% is the lowest value\n        );\n      });\n      _defineProperty(_assertThisInitialized(_this), \"validateValues\", function (proposedValues, props) {\n        var _ref4 = props || _this.props,\n          max = _ref4.max,\n          min = _ref4.min;\n        return proposedValues.map(function (value, idx, values) {\n          var realValue = Math.max(Math.min(value, max), min);\n          if (values.length && realValue < values[idx - 1]) {\n            return values[idx - 1];\n          }\n          return realValue;\n        });\n      });\n      _defineProperty(_assertThisInitialized(_this), \"canMove\", function (idx, proposedPosition) {\n        var _this$state5 = _this.state,\n          handlePos = _this$state5.handlePos,\n          handleDimensions = _this$state5.handleDimensions;\n        if (proposedPosition < PERCENT_EMPTY) return false;\n        if (proposedPosition > PERCENT_FULL) return false;\n        var nextHandlePosition = handlePos[idx + 1] !== undefined ? handlePos[idx + 1] - handleDimensions : Infinity;\n        if (proposedPosition > nextHandlePosition) return false;\n        var prevHandlePosition = handlePos[idx - 1] !== undefined ? handlePos[idx - 1] + handleDimensions : -Infinity;\n        if (proposedPosition < prevHandlePosition) return false;\n        return true;\n      });\n      _defineProperty(_assertThisInitialized(_this), \"fireChangeEvent\", function () {\n        var onChange = _this.props.onChange;\n        if (onChange) onChange(_this.getPublicState());\n      });\n      _defineProperty(_assertThisInitialized(_this), \"slideTo\", function (idx, proposedPosition, onAfterSet) {\n        var nextState = _this.getNextState(idx, proposedPosition);\n        _this.setState(nextState, function () {\n          var onValuesUpdated = _this.props.onValuesUpdated;\n          if (onValuesUpdated) onValuesUpdated(_this.getPublicState());\n          if (onAfterSet) onAfterSet();\n        });\n      });\n      _defineProperty(_assertThisInitialized(_this), \"updateNewValues\", function (nextProps) {\n        var slidingIndex = _this.state.slidingIndex;\n\n        // Don't update while the slider is sliding\n        if (slidingIndex !== null) {\n          return;\n        }\n        var max = nextProps.max,\n          min = nextProps.min,\n          values = nextProps.values;\n        var nextValues = _this.validateValues(values, nextProps);\n        _this.setState({\n          handlePos: nextValues.map(function (value) {\n            return getPosition(value, min, max);\n          }),\n          values: nextValues\n        }, function () {\n          return _this.fireChangeEvent();\n        });\n      });\n      _defineProperty(_assertThisInitialized(_this), \"render\", function () {\n        var _ref5 = _this.props,\n          children = _ref5.children,\n          disabled = _ref5.disabled,\n          Handle = _ref5.handle,\n          max = _ref5.max,\n          min = _ref5.min,\n          orientation = _ref5.orientation,\n          PitComponent = _ref5.pitComponent,\n          pitPoints = _ref5.pitPoints,\n          ProgressBar = _ref5.progressBar; // all required thanks to defaultProps\n        var _this$state6 = _this.state,\n          className = _this$state6.className,\n          handlePos = _this$state6.handlePos,\n          values = _this$state6.values;\n        return h(\"div\", {\n          className: className,\n          ref: _this.rheostat,\n          onClick: disabled ? undefined : _this.handleClick,\n          style: {\n            position: 'relative'\n          }\n        }, _ref6, handlePos.map(function (pos, idx) {\n          var handleStyle = orientation === 'vertical' ? {\n            top: \"\".concat(pos, \"%\"),\n            position: 'absolute'\n          } : {\n            left: \"\".concat(pos, \"%\"),\n            position: 'absolute'\n          };\n          return h(Handle, {\n            \"aria-valuemax\": _this.getMaxValue(idx),\n            \"aria-valuemin\": _this.getMinValue(idx),\n            \"aria-valuenow\": values[idx],\n            \"aria-disabled\": disabled,\n            \"data-handle-key\": idx,\n            className: \"rheostat-handle\",\n            key: \"handle-\".concat(idx),\n            onClick: killEvent,\n            onKeyDown: disabled ? undefined : _this.handleKeydown,\n            onMouseDown: disabled ? undefined : _this.startMouseSlide,\n            onTouchStart: disabled ? undefined : _this.startTouchSlide,\n            role: \"slider\",\n            style: handleStyle,\n            tabIndex: 0\n          });\n        }), handlePos.map(function (_node, idx, arr) {\n          if (idx === 0 && arr.length > 1) {\n            return null;\n          }\n          return h(ProgressBar, {\n            className: \"rheostat-progress\",\n            key: \"progress-bar-\".concat(idx),\n            style: _this.getProgressStyle(idx)\n          });\n        }), PitComponent && pitPoints.map(function (n) {\n          var pos = getPosition(n, min, max);\n          var pitStyle = orientation === 'vertical' ? {\n            top: \"\".concat(pos, \"%\"),\n            position: 'absolute'\n          } : {\n            left: \"\".concat(pos, \"%\"),\n            position: 'absolute'\n          };\n          return h(PitComponent, {\n            key: \"pit-\".concat(n),\n            style: pitStyle\n          }, n);\n        }), children);\n      });\n      return _this;\n    }\n    return _createClass(Rheostat);\n  }(d);\n  _defineProperty(Rheostat, \"defaultProps\", {\n    className: '',\n    children: null,\n    disabled: false,\n    handle: Button,\n    max: PERCENT_FULL,\n    min: PERCENT_EMPTY,\n    onClick: null,\n    onChange: null,\n    onKeyPress: null,\n    onSliderDragEnd: null,\n    onSliderDragMove: null,\n    onSliderDragStart: null,\n    onValuesUpdated: null,\n    orientation: 'horizontal',\n    pitComponent: null,\n    pitPoints: [],\n    progressBar: 'div',\n    snap: false,\n    snapPoints: [],\n    values: [PERCENT_EMPTY]\n  });\n\n  var Slider = /*#__PURE__*/function (_Component) {\n    _inherits(Slider, _Component);\n    var _super = _createSuper(Slider);\n    function Slider() {\n      var _this;\n      _classCallCheck(this, Slider);\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n      _this = _super.call.apply(_super, [this].concat(args));\n      _defineProperty(_assertThisInitialized(_this), \"handleChange\", function (_ref) {\n        var values = _ref.values;\n        if (!_this.isDisabled) {\n          _this.props.refine(values);\n        }\n      });\n      _defineProperty(_assertThisInitialized(_this), \"createHandleComponent\", function (tooltips) {\n        return function (props) {\n          // display only two decimals after comma,\n          // and apply `tooltips.format()` if any\n          var roundedValue = Math.round(\n          // have to cast as a string, as the value given to the prop is a number, but becomes a string when read\n          parseFloat(props['aria-valuenow']) * 100) / 100;\n          var value = _typeof(tooltips) === 'object' && tooltips.format ? tooltips.format(roundedValue) : roundedValue;\n          var className = cx(props.className, props['data-handle-key'] === 0 && 'rheostat-handle-lower', props['data-handle-key'] === 1 && 'rheostat-handle-upper');\n          var ariaLabel = props['data-handle-key'] === 0 ? 'Minimum Filter Handle' : 'Maximum Filter Handle';\n          return h(\"div\", _extends({}, props, {\n            className: className,\n            \"aria-label\": ariaLabel\n          }), tooltips && h(\"div\", {\n            className: \"rheostat-tooltip\"\n          }, value));\n        };\n      });\n      return _this;\n    }\n    _createClass(Slider, [{\n      key: \"isDisabled\",\n      get: function get() {\n        return this.props.min >= this.props.max;\n      }\n    }, {\n      key: \"computeDefaultPitPoints\",\n      value:\n      // creates an array number where to display a pit point on the slider\n      function computeDefaultPitPoints(_ref2) {\n        var min = _ref2.min,\n          max = _ref2.max;\n        var totalLength = max - min;\n        var steps = 34;\n        var stepsLength = totalLength / steps;\n        var pitPoints = [min].concat(_toConsumableArray(range({\n          end: steps - 1\n        }).map(function (step) {\n          return min + stepsLength * (step + 1);\n        })), [max]);\n        return pitPoints;\n      }\n\n      // creates an array of values where the slider should snap to\n    }, {\n      key: \"computeSnapPoints\",\n      value: function computeSnapPoints(_ref3) {\n        var min = _ref3.min,\n          max = _ref3.max,\n          step = _ref3.step;\n        if (!step) return undefined;\n        return [].concat(_toConsumableArray(range({\n          start: min,\n          end: max,\n          step: step\n        })), [max]);\n      }\n    }, {\n      key: \"render\",\n      value: function render() {\n        var _this$props = this.props,\n          tooltips = _this$props.tooltips,\n          step = _this$props.step,\n          pips = _this$props.pips,\n          values = _this$props.values,\n          cssClasses = _this$props.cssClasses;\n\n        // @TODO: figure out why this.props needs to be non-null asserted\n        var _ref4 = this.isDisabled ? {\n            min: this.props.min,\n            max: this.props.max + 0.001\n          } : this.props,\n          min = _ref4.min,\n          max = _ref4.max;\n        var snapPoints = this.computeSnapPoints({\n          min: min,\n          max: max,\n          step: step\n        });\n        var pitPoints = pips === false ? [] : this.computeDefaultPitPoints({\n          min: min,\n          max: max\n        });\n        return h(\"div\", {\n          className: cx(cssClasses.root, this.isDisabled && cssClasses.disabledRoot)\n        }, h(Rheostat, {\n          handle: this.createHandleComponent(tooltips),\n          onChange: this.handleChange,\n          min: min,\n          max: max,\n          pitComponent: Pit,\n          pitPoints: pitPoints,\n          snap: true,\n          snapPoints: snapPoints,\n          values: this.isDisabled ? [min, max] : values,\n          disabled: this.isDisabled\n        }));\n      }\n    }]);\n    return Slider;\n  }(d);\n\n  var withUsage$R = createDocumentationMessageGenerator({\n    name: 'range-slider'\n  });\n  var suit$l = component('RangeSlider');\n  var renderer$h = function renderer(_ref) {\n    var containerNode = _ref.containerNode,\n      cssClasses = _ref.cssClasses,\n      pips = _ref.pips,\n      step = _ref.step,\n      tooltips = _ref.tooltips;\n    return function (_ref2, isFirstRendering) {\n      var refine = _ref2.refine,\n        range = _ref2.range,\n        start = _ref2.start;\n      if (isFirstRendering) {\n        // There's no information at this point, let's render nothing.\n        return;\n      }\n      var minRange = range.min,\n        maxRange = range.max;\n      var _start = _slicedToArray(start, 2),\n        minStart = _start[0],\n        maxStart = _start[1];\n      var minFinite = minStart === -Infinity ? minRange : minStart;\n      var maxFinite = maxStart === Infinity ? maxRange : maxStart;\n\n      // Clamp values to the range for avoid extra rendering & refinement\n      // Should probably be done on the connector side, but we need to stay\n      // backward compatible so we still need to pass [-Infinity, Infinity]\n      var values = [minFinite > maxRange ? maxRange : minFinite, maxFinite < minRange ? minRange : maxFinite];\n      P(h(Slider, {\n        cssClasses: cssClasses,\n        refine: refine,\n        min: minRange,\n        max: maxRange,\n        values: values,\n        tooltips: tooltips,\n        step: step,\n        pips: pips\n      }), containerNode);\n    };\n  };\n  /**\n   * The range slider is a widget which provides a user-friendly way to filter the\n   * results based on a single numeric range.\n   *\n   * @requirements\n   * The attribute passed to `attribute` must be declared as an\n   * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\n   * in your Algolia settings.\n   *\n   * The values inside this attribute must be JavaScript numbers (not strings).\n   */\n  var rangeSlider = function rangeSlider(widgetParams) {\n    var _ref3 = widgetParams || {},\n      container = _ref3.container,\n      attribute = _ref3.attribute,\n      min = _ref3.min,\n      max = _ref3.max,\n      _ref3$cssClasses = _ref3.cssClasses,\n      userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n      step = _ref3.step,\n      _ref3$pips = _ref3.pips,\n      pips = _ref3$pips === void 0 ? true : _ref3$pips,\n      _ref3$precision = _ref3.precision,\n      precision = _ref3$precision === void 0 ? 0 : _ref3$precision,\n      _ref3$tooltips = _ref3.tooltips,\n      tooltips = _ref3$tooltips === void 0 ? true : _ref3$tooltips;\n    if (!container) {\n      throw new Error(withUsage$R('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$l(), userCssClasses.root),\n      disabledRoot: cx(suit$l({\n        modifierName: 'disabled'\n      }), userCssClasses.disabledRoot)\n    };\n    var specializedRenderer = renderer$h({\n      containerNode: containerNode,\n      step: step,\n      pips: pips,\n      tooltips: tooltips,\n      cssClasses: cssClasses\n    });\n    var makeWidget = connectRange(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      attribute: attribute,\n      min: min,\n      max: max,\n      precision: precision\n    })), {}, {\n      $$type: 'ais.rangeSlider',\n      $$widgetType: 'ais.rangeSlider'\n    });\n  };\n\n  function ItemWrapper(_ref) {\n    var children = _ref.children,\n      count = _ref.count,\n      value = _ref.value,\n      url = _ref.url,\n      cssClasses = _ref.cssClasses;\n    if (count) {\n      return h(\"a\", {\n        className: cx(cssClasses.link),\n        \"aria-label\": \"\".concat(value, \" & up\"),\n        href: url\n      }, children);\n    }\n    return h(\"div\", {\n      className: cx(cssClasses.link),\n      \"aria-label\": \"\".concat(value, \" & up\"),\n      disabled: true\n    }, children);\n  }\n  var defaultTemplates$d = {\n    item: function item(_ref2) {\n      var count = _ref2.count,\n        value = _ref2.value,\n        url = _ref2.url,\n        stars = _ref2.stars,\n        cssClasses = _ref2.cssClasses;\n      return h(ItemWrapper, {\n        count: count,\n        value: value,\n        url: url,\n        cssClasses: cssClasses\n      }, stars.map(function (isFull, index) {\n        return h(\"svg\", {\n          key: index,\n          className: cx(cssClasses.starIcon, isFull ? cssClasses.fullStarIcon : cssClasses.emptyStarIcon),\n          \"aria-hidden\": \"true\",\n          width: \"24\",\n          height: \"24\"\n        }, h(\"use\", {\n          xlinkHref: isFull ? '#ais-RatingMenu-starSymbol' : '#ais-RatingMenu-starEmptySymbol'\n        }));\n      }), h(\"span\", {\n        \"aria-hidden\": \"true\",\n        className: cx(cssClasses.label)\n      }, \"& Up\"), count && h(\"span\", {\n        className: cx(cssClasses.count)\n      }, formatNumber(count)));\n    }\n  };\n\n  var withUsage$S = createDocumentationMessageGenerator({\n    name: 'rating-menu'\n  });\n  var suit$m = component('RatingMenu');\n  var _ref3 = h(\"path\", {\n    d: \"M12 .288l2.833 8.718h9.167l-7.417 5.389 2.833 8.718-7.416-5.388-7.417 5.388 2.833-8.718-7.416-5.389h9.167z\"\n  });\n  var _ref4 = h(\"path\", {\n    d: \"M12 6.76l1.379 4.246h4.465l-3.612 2.625 1.379 4.246-3.611-2.625-3.612 2.625 1.379-4.246-3.612-2.625h4.465l1.38-4.246zm0-6.472l-2.833 8.718h-9.167l7.416 5.389-2.833 8.718 7.417-5.388 7.416 5.388-2.833-8.718 7.417-5.389h-9.167l-2.833-8.718z\"\n  });\n  var renderer$i = function renderer(_ref) {\n    var containerNode = _ref.containerNode,\n      cssClasses = _ref.cssClasses,\n      templates = _ref.templates,\n      renderState = _ref.renderState;\n    return function (_ref2, isFirstRendering) {\n      var refine = _ref2.refine,\n        items = _ref2.items,\n        createURL = _ref2.createURL,\n        instantSearchInstance = _ref2.instantSearchInstance;\n      if (isFirstRendering) {\n        renderState.templateProps = prepareTemplateProps({\n          defaultTemplates: defaultTemplates$d,\n          templatesConfig: instantSearchInstance.templatesConfig,\n          templates: templates\n        });\n        return;\n      }\n      P(h(RefinementList$1, {\n        createURL: createURL,\n        cssClasses: cssClasses,\n        facetValues: items,\n        templateProps: renderState.templateProps,\n        toggleRefinement: refine\n      }, h(\"svg\", {\n        style: \"display:none;\"\n      }, h(\"symbol\", {\n        id: suit$m({\n          descendantName: 'starSymbol'\n        }),\n        viewBox: \"0 0 24 24\"\n      }, _ref3), h(\"symbol\", {\n        id: suit$m({\n          descendantName: 'starEmptySymbol'\n        }),\n        viewBox: \"0 0 24 24\"\n      }, _ref4))), containerNode);\n    };\n  };\n\n  /**\n   * Rating menu is used for displaying grade like filters. The values are normalized within boundaries.\n   *\n   * The maximum value can be set (with `max`), the minimum is always 0.\n   *\n   * @requirements\n   * The attribute passed to `attribute` must be declared as an\n   * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\n   * in your Algolia settings.\n   *\n   * The values inside this attribute must be JavaScript numbers (not strings).\n   *\n   * @type {WidgetFactory}\n   * @devNovel RatingMenu\n   * @category filter\n   * @param {RatingMenuWidgetParams} widgetParams RatingMenu widget options.\n   * @return {Widget} A new RatingMenu widget instance.\n   * @example\n   * search.addWidgets([\n   *   instantsearch.widgets.ratingMenu({\n   *     container: '#stars',\n   *     attribute: 'rating',\n   *     max: 5,\n   *   })\n   * ]);\n   */\n\n  var ratingMenu = function ratingMenu(widgetParams) {\n    var _ref5 = widgetParams || {},\n      container = _ref5.container,\n      attribute = _ref5.attribute,\n      _ref5$max = _ref5.max,\n      max = _ref5$max === void 0 ? 5 : _ref5$max,\n      _ref5$cssClasses = _ref5.cssClasses,\n      userCssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses,\n      _ref5$templates = _ref5.templates,\n      templates = _ref5$templates === void 0 ? {} : _ref5$templates;\n    if (!container) {\n      throw new Error(withUsage$S('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$m(), userCssClasses.root),\n      noRefinementRoot: cx(suit$m({\n        modifierName: 'noRefinement'\n      }), userCssClasses.noRefinementRoot),\n      list: cx(suit$m({\n        descendantName: 'list'\n      }), userCssClasses.list),\n      item: cx(suit$m({\n        descendantName: 'item'\n      }), userCssClasses.item),\n      selectedItem: cx(suit$m({\n        descendantName: 'item',\n        modifierName: 'selected'\n      }), userCssClasses.selectedItem),\n      disabledItem: cx(suit$m({\n        descendantName: 'item',\n        modifierName: 'disabled'\n      }), userCssClasses.disabledItem),\n      link: cx(suit$m({\n        descendantName: 'link'\n      }), userCssClasses.link),\n      starIcon: cx(suit$m({\n        descendantName: 'starIcon'\n      }), userCssClasses.starIcon),\n      fullStarIcon: cx(suit$m({\n        descendantName: 'starIcon',\n        modifierName: 'full'\n      }), userCssClasses.fullStarIcon),\n      emptyStarIcon: cx(suit$m({\n        descendantName: 'starIcon',\n        modifierName: 'empty'\n      }), userCssClasses.emptyStarIcon),\n      label: cx(suit$m({\n        descendantName: 'label'\n      }), userCssClasses.label),\n      count: cx(suit$m({\n        descendantName: 'count'\n      }), userCssClasses.count)\n    };\n    var specializedRenderer = renderer$i({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      renderState: {},\n      templates: templates\n    });\n    var makeWidget = connectRatingMenu(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      attribute: attribute,\n      max: max\n    })), {}, {\n      $$widgetType: 'ais.ratingMenu'\n    });\n  };\n\n  var _ref2 = h(\"path\", {\n    d: \"M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z\"\n  });\n  var _ref4$1 = h(\"path\", {\n    d: \"M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z\"\n  });\n  var _ref6$1 = h(\"g\", {\n    fill: \"none\",\n    \"fill-rule\": \"evenodd\"\n  }, h(\"g\", {\n    transform: \"translate(1 1)\",\n    \"stroke-width\": \"2\"\n  }, h(\"circle\", {\n    \"stroke-opacity\": \".5\",\n    cx: \"18\",\n    cy: \"18\",\n    r: \"18\"\n  }), h(\"path\", {\n    d: \"M36 18c0-9.94-8.06-18-18-18\"\n  }, h(\"animateTransform\", {\n    attributeName: \"transform\",\n    type: \"rotate\",\n    from: \"0 18 18\",\n    to: \"360 18 18\",\n    dur: \"1s\",\n    repeatCount: \"indefinite\"\n  }))));\n  var defaultTemplate = {\n    reset: function reset(_ref) {\n      var cssClasses = _ref.cssClasses;\n      return h(\"svg\", {\n        className: cssClasses.resetIcon,\n        viewBox: \"0 0 20 20\",\n        width: \"10\",\n        height: \"10\",\n        \"aria-hidden\": \"true\"\n      }, _ref2);\n    },\n    submit: function submit(_ref3) {\n      var cssClasses = _ref3.cssClasses;\n      return h(\"svg\", {\n        className: cssClasses.submitIcon,\n        width: \"10\",\n        height: \"10\",\n        viewBox: \"0 0 40 40\",\n        \"aria-hidden\": \"true\"\n      }, _ref4$1);\n    },\n    loadingIndicator: function loadingIndicator(_ref5) {\n      var cssClasses = _ref5.cssClasses;\n      /* eslint-disable react/no-unknown-property */\n      // Preact supports kebab case attributes, and using camel case would\n      // require using `preact/compat`.\n      // @TODO: reconsider using the `react` ESLint preset\n      return h(\"svg\", {\n        \"aria-label\": \"Results are loading\",\n        className: cssClasses.loadingIcon,\n        width: \"16\",\n        height: \"16\",\n        viewBox: \"0 0 38 38\",\n        stroke: \"#444\",\n        \"aria-hidden\": \"true\"\n      }, _ref6$1);\n      /* eslint-enable react/no-unknown-property */\n    }\n  };\n\n  var defaultTemplates$e = {\n    item: function item(_ref) {\n      var cssClasses = _ref.cssClasses,\n        count = _ref.count,\n        value = _ref.value,\n        highlighted = _ref.highlighted,\n        isRefined = _ref.isRefined,\n        isFromSearch = _ref.isFromSearch;\n      return h(\"label\", {\n        className: cx(cssClasses.label)\n      }, h(\"input\", {\n        type: \"checkbox\",\n        className: cx(cssClasses.checkbox),\n        value: value,\n        defaultChecked: isRefined\n      }), h(\"span\", {\n        className: cx(cssClasses.labelText),\n        dangerouslySetInnerHTML: isFromSearch ? {\n          __html: highlighted\n        } : undefined\n      }, !isFromSearch && highlighted), h(\"span\", {\n        className: cx(cssClasses.count)\n      }, formatNumber(count)));\n    },\n    showMoreText: function showMoreText(_ref2) {\n      var isShowingMore = _ref2.isShowingMore;\n      return isShowingMore ? 'Show less' : 'Show more';\n    },\n    searchableNoResults: function searchableNoResults() {\n      return 'No results';\n    }\n  };\n\n  var withUsage$T = createDocumentationMessageGenerator({\n    name: 'refinement-list'\n  });\n  var suit$n = component('RefinementList');\n  var searchBoxSuit = component('SearchBox');\n  var renderer$j = function renderer(_ref) {\n    var containerNode = _ref.containerNode,\n      cssClasses = _ref.cssClasses,\n      templates = _ref.templates,\n      searchBoxTemplates = _ref.searchBoxTemplates,\n      renderState = _ref.renderState,\n      showMore = _ref.showMore,\n      searchable = _ref.searchable,\n      searchablePlaceholder = _ref.searchablePlaceholder,\n      searchableIsAlwaysActive = _ref.searchableIsAlwaysActive;\n    return function (_ref2, isFirstRendering) {\n      var refine = _ref2.refine,\n        items = _ref2.items,\n        createURL = _ref2.createURL,\n        searchForItems = _ref2.searchForItems,\n        isFromSearch = _ref2.isFromSearch,\n        instantSearchInstance = _ref2.instantSearchInstance,\n        toggleShowMore = _ref2.toggleShowMore,\n        isShowingMore = _ref2.isShowingMore,\n        hasExhaustiveItems = _ref2.hasExhaustiveItems,\n        canToggleShowMore = _ref2.canToggleShowMore;\n      if (isFirstRendering) {\n        renderState.templateProps = prepareTemplateProps({\n          defaultTemplates: defaultTemplates$e,\n          templatesConfig: instantSearchInstance.templatesConfig,\n          templates: templates\n        });\n        renderState.searchBoxTemplateProps = prepareTemplateProps({\n          defaultTemplates: defaultTemplate,\n          templatesConfig: instantSearchInstance.templatesConfig,\n          templates: searchBoxTemplates\n        });\n        return;\n      }\n      P(h(RefinementList$1, {\n        createURL: createURL,\n        cssClasses: cssClasses,\n        facetValues: items,\n        templateProps: renderState.templateProps,\n        searchBoxTemplateProps: renderState.searchBoxTemplateProps,\n        toggleRefinement: refine,\n        searchFacetValues: searchable ? searchForItems : undefined,\n        searchPlaceholder: searchablePlaceholder,\n        searchIsAlwaysActive: searchableIsAlwaysActive,\n        isFromSearch: isFromSearch,\n        showMore: showMore && !isFromSearch && items.length > 0,\n        toggleShowMore: toggleShowMore,\n        isShowingMore: isShowingMore,\n        hasExhaustiveItems: hasExhaustiveItems,\n        canToggleShowMore: canToggleShowMore\n      }), containerNode);\n    };\n  };\n  /**\n   * The refinement list widget is one of the most common widget that you can find\n   * in a search UI. With this widget, the user can filter the dataset based on facets.\n   *\n   * The refinement list displays only the most relevant facets for the current search\n   * context. The sort option only affects the facet that are returned by the engine,\n   * not which facets are returned.\n   *\n   * This widget also implements search for facet values, which is a mini search inside the\n   * values of the facets. This makes easy to deal with uncommon facet values.\n   *\n   * @requirements\n   *\n   * The attribute passed to `attribute` must be declared as an\n   * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\n   * in your Algolia settings.\n   *\n   * If you also want to use search for facet values on this attribute, you need to make it searchable using the [dashboard](https://www.algolia.com/explorer/display/) or using the [API](https://www.algolia.com/doc/guides/searching/faceting/#search-for-facet-values).\n   */\n  var refinementList = function refinementList(widgetParams) {\n    var _ref3 = widgetParams || {},\n      container = _ref3.container,\n      attribute = _ref3.attribute,\n      operator = _ref3.operator,\n      sortBy = _ref3.sortBy,\n      limit = _ref3.limit,\n      showMore = _ref3.showMore,\n      showMoreLimit = _ref3.showMoreLimit,\n      _ref3$searchable = _ref3.searchable,\n      searchable = _ref3$searchable === void 0 ? false : _ref3$searchable,\n      _ref3$searchablePlace = _ref3.searchablePlaceholder,\n      searchablePlaceholder = _ref3$searchablePlace === void 0 ? 'Search...' : _ref3$searchablePlace,\n      _ref3$searchableEscap = _ref3.searchableEscapeFacetValues,\n      searchableEscapeFacetValues = _ref3$searchableEscap === void 0 ? true : _ref3$searchableEscap,\n      _ref3$searchableIsAlw = _ref3.searchableIsAlwaysActive,\n      searchableIsAlwaysActive = _ref3$searchableIsAlw === void 0 ? true : _ref3$searchableIsAlw,\n      _ref3$cssClasses = _ref3.cssClasses,\n      userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n      _ref3$templates = _ref3.templates,\n      templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n      transformItems = _ref3.transformItems;\n    if (!container) {\n      throw new Error(withUsage$T('The `container` option is required.'));\n    }\n    var escapeFacetValues = searchable ? Boolean(searchableEscapeFacetValues) : false;\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$n(), userCssClasses.root),\n      noRefinementRoot: cx(suit$n({\n        modifierName: 'noRefinement'\n      }), userCssClasses.noRefinementRoot),\n      list: cx(suit$n({\n        descendantName: 'list'\n      }), userCssClasses.list),\n      item: cx(suit$n({\n        descendantName: 'item'\n      }), userCssClasses.item),\n      selectedItem: cx(suit$n({\n        descendantName: 'item',\n        modifierName: 'selected'\n      }), userCssClasses.selectedItem),\n      searchBox: cx(suit$n({\n        descendantName: 'searchBox'\n      }), userCssClasses.searchBox),\n      label: cx(suit$n({\n        descendantName: 'label'\n      }), userCssClasses.label),\n      checkbox: cx(suit$n({\n        descendantName: 'checkbox'\n      }), userCssClasses.checkbox),\n      labelText: cx(suit$n({\n        descendantName: 'labelText'\n      }), userCssClasses.labelText),\n      count: cx(suit$n({\n        descendantName: 'count'\n      }), userCssClasses.count),\n      noResults: cx(suit$n({\n        descendantName: 'noResults'\n      }), userCssClasses.noResults),\n      showMore: cx(suit$n({\n        descendantName: 'showMore'\n      }), userCssClasses.showMore),\n      disabledShowMore: cx(suit$n({\n        descendantName: 'showMore',\n        modifierName: 'disabled'\n      }), userCssClasses.disabledShowMore),\n      searchable: {\n        root: cx(searchBoxSuit(), userCssClasses.searchableRoot),\n        form: cx(searchBoxSuit({\n          descendantName: 'form'\n        }), userCssClasses.searchableForm),\n        input: cx(searchBoxSuit({\n          descendantName: 'input'\n        }), userCssClasses.searchableInput),\n        submit: cx(searchBoxSuit({\n          descendantName: 'submit'\n        }), userCssClasses.searchableSubmit),\n        submitIcon: cx(searchBoxSuit({\n          descendantName: 'submitIcon'\n        }), userCssClasses.searchableSubmitIcon),\n        reset: cx(searchBoxSuit({\n          descendantName: 'reset'\n        }), userCssClasses.searchableReset),\n        resetIcon: cx(searchBoxSuit({\n          descendantName: 'resetIcon'\n        }), userCssClasses.searchableResetIcon),\n        loadingIndicator: cx(searchBoxSuit({\n          descendantName: 'loadingIndicator'\n        }), userCssClasses.searchableLoadingIndicator),\n        loadingIcon: cx(searchBoxSuit({\n          descendantName: 'loadingIcon'\n        }), userCssClasses.searchableLoadingIcon)\n      }\n    };\n    var specializedRenderer = renderer$j({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      templates: templates,\n      searchBoxTemplates: {\n        submit: templates.searchableSubmit,\n        reset: templates.searchableReset,\n        loadingIndicator: templates.searchableLoadingIndicator\n      },\n      renderState: {},\n      searchable: searchable,\n      searchablePlaceholder: searchablePlaceholder,\n      searchableIsAlwaysActive: searchableIsAlwaysActive,\n      showMore: showMore\n    });\n    var makeWidget = connectRefinementList(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      attribute: attribute,\n      operator: operator,\n      limit: limit,\n      showMore: showMore,\n      showMoreLimit: showMoreLimit,\n      sortBy: sortBy,\n      escapeFacetValues: escapeFacetValues,\n      transformItems: transformItems\n    })), {}, {\n      $$widgetType: 'ais.refinementList'\n    });\n  };\n\n  var RelevantSort = function RelevantSort(_ref) {\n    var cssClasses = _ref.cssClasses,\n      templates = _ref.templates,\n      isRelevantSorted = _ref.isRelevantSorted,\n      isVirtualReplica = _ref.isVirtualReplica,\n      refine = _ref.refine;\n    return isVirtualReplica ? h(\"div\", {\n      className: cssClasses.root\n    }, h(Template, {\n      templateKey: \"text\",\n      templates: templates,\n      rootProps: {\n        className: cssClasses.text\n      },\n      data: {\n        isRelevantSorted: isRelevantSorted\n      }\n    }), h(\"button\", {\n      type: \"button\",\n      className: cssClasses.button,\n      onClick: function onClick() {\n        if (isRelevantSorted) {\n          refine(0);\n        } else {\n          refine(undefined);\n        }\n      }\n    }, h(Template, {\n      rootTagName: \"span\",\n      templateKey: \"button\",\n      templates: templates,\n      data: {\n        isRelevantSorted: isRelevantSorted\n      }\n    }))) : null;\n  };\n\n  var defaultTemplates$f = {\n    text: function text() {\n      return '';\n    },\n    button: function button(_ref) {\n      var isRelevantSorted = _ref.isRelevantSorted;\n      return isRelevantSorted ? 'See all results' : 'See relevant results';\n    }\n  };\n\n  var withUsage$U = createDocumentationMessageGenerator({\n    name: 'relevant-sort'\n  });\n  var suit$o = component('RelevantSort');\n  var renderer$k = function renderer(_ref) {\n    var containerNode = _ref.containerNode,\n      cssClasses = _ref.cssClasses,\n      templates = _ref.templates;\n    return function (_ref2) {\n      var isRelevantSorted = _ref2.isRelevantSorted,\n        isVirtualReplica = _ref2.isVirtualReplica,\n        refine = _ref2.refine;\n      P(h(RelevantSort, {\n        cssClasses: cssClasses,\n        templates: templates,\n        isRelevantSorted: isRelevantSorted,\n        isVirtualReplica: isVirtualReplica,\n        refine: refine\n      }), containerNode);\n    };\n  };\n  var relevantSort = function relevantSort(widgetParams) {\n    var container = widgetParams.container,\n      _widgetParams$templat = widgetParams.templates,\n      userTemplates = _widgetParams$templat === void 0 ? {} : _widgetParams$templat,\n      _widgetParams$cssClas = widgetParams.cssClasses,\n      userCssClasses = _widgetParams$cssClas === void 0 ? {} : _widgetParams$cssClas;\n    if (!container) {\n      throw new Error(withUsage$U('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$o(), userCssClasses.root),\n      text: cx(suit$o({\n        descendantName: 'text'\n      }), userCssClasses.text),\n      button: cx(suit$o({\n        descendantName: 'button'\n      }), userCssClasses.button)\n    };\n    var templates = _objectSpread2(_objectSpread2({}, defaultTemplates$f), userTemplates);\n    var specializedRenderer = renderer$k({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      renderState: {},\n      templates: templates\n    });\n    var makeWidget = connectRelevantSort(specializedRenderer, function () {\n      P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({})), {}, {\n      $$widgetType: 'ais.relevantSort'\n    });\n  };\n\n  var withUsage$V = createDocumentationMessageGenerator({\n    name: 'search-box'\n  });\n  var suit$p = component('SearchBox');\n  var renderer$l = function renderer(_ref) {\n    var containerNode = _ref.containerNode,\n      cssClasses = _ref.cssClasses,\n      placeholder = _ref.placeholder,\n      templates = _ref.templates,\n      autofocus = _ref.autofocus,\n      searchAsYouType = _ref.searchAsYouType,\n      ignoreCompositionEvents = _ref.ignoreCompositionEvents,\n      showReset = _ref.showReset,\n      showSubmit = _ref.showSubmit,\n      showLoadingIndicator = _ref.showLoadingIndicator;\n    return function (_ref2) {\n      var refine = _ref2.refine,\n        query = _ref2.query,\n        isSearchStalled = _ref2.isSearchStalled;\n      P(h(SearchBox, {\n        query: query,\n        placeholder: placeholder,\n        autofocus: autofocus,\n        refine: refine,\n        searchAsYouType: searchAsYouType,\n        ignoreCompositionEvents: ignoreCompositionEvents,\n        templates: templates,\n        showSubmit: showSubmit,\n        showReset: showReset,\n        showLoadingIndicator: showLoadingIndicator,\n        isSearchStalled: isSearchStalled,\n        cssClasses: cssClasses\n      }), containerNode);\n    };\n  };\n\n  /**\n   * The searchbox widget is used to let the user set a text based query.\n   *\n   * This is usually the  main entry point to start the search in an instantsearch context. For that\n   * reason is usually placed on top, and not hidden so that the user can start searching right\n   * away.\n   *\n   */\n\n  var searchBox = function searchBox(widgetParams) {\n    var _ref3 = widgetParams || {},\n      container = _ref3.container,\n      _ref3$placeholder = _ref3.placeholder,\n      placeholder = _ref3$placeholder === void 0 ? '' : _ref3$placeholder,\n      _ref3$cssClasses = _ref3.cssClasses,\n      userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n      _ref3$autofocus = _ref3.autofocus,\n      autofocus = _ref3$autofocus === void 0 ? false : _ref3$autofocus,\n      _ref3$searchAsYouType = _ref3.searchAsYouType,\n      searchAsYouType = _ref3$searchAsYouType === void 0 ? true : _ref3$searchAsYouType,\n      _ref3$ignoreCompositi = _ref3.ignoreCompositionEvents,\n      ignoreCompositionEvents = _ref3$ignoreCompositi === void 0 ? false : _ref3$ignoreCompositi,\n      _ref3$showReset = _ref3.showReset,\n      showReset = _ref3$showReset === void 0 ? true : _ref3$showReset,\n      _ref3$showSubmit = _ref3.showSubmit,\n      showSubmit = _ref3$showSubmit === void 0 ? true : _ref3$showSubmit,\n      _ref3$showLoadingIndi = _ref3.showLoadingIndicator,\n      showLoadingIndicator = _ref3$showLoadingIndi === void 0 ? true : _ref3$showLoadingIndi,\n      queryHook = _ref3.queryHook,\n      _ref3$templates = _ref3.templates,\n      userTemplates = _ref3$templates === void 0 ? {} : _ref3$templates;\n    if (!container) {\n      throw new Error(withUsage$V('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$p(), userCssClasses.root),\n      form: cx(suit$p({\n        descendantName: 'form'\n      }), userCssClasses.form),\n      input: cx(suit$p({\n        descendantName: 'input'\n      }), userCssClasses.input),\n      submit: cx(suit$p({\n        descendantName: 'submit'\n      }), userCssClasses.submit),\n      submitIcon: cx(suit$p({\n        descendantName: 'submitIcon'\n      }), userCssClasses.submitIcon),\n      reset: cx(suit$p({\n        descendantName: 'reset'\n      }), userCssClasses.reset),\n      resetIcon: cx(suit$p({\n        descendantName: 'resetIcon'\n      }), userCssClasses.resetIcon),\n      loadingIndicator: cx(suit$p({\n        descendantName: 'loadingIndicator'\n      }), userCssClasses.loadingIndicator),\n      loadingIcon: cx(suit$p({\n        descendantName: 'loadingIcon'\n      }), userCssClasses.loadingIcon)\n    };\n    var templates = _objectSpread2(_objectSpread2({}, defaultTemplate), userTemplates);\n    var specializedRenderer = renderer$l({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      placeholder: placeholder,\n      templates: templates,\n      autofocus: autofocus,\n      searchAsYouType: searchAsYouType,\n      ignoreCompositionEvents: ignoreCompositionEvents,\n      showReset: showReset,\n      showSubmit: showSubmit,\n      showLoadingIndicator: showLoadingIndicator\n    });\n    var makeWidget = connectSearchBox(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      queryHook: queryHook\n    })), {}, {\n      $$widgetType: 'ais.searchBox'\n    });\n  };\n\n  var withUsage$W = createDocumentationMessageGenerator({\n    name: 'sort-by'\n  });\n  var suit$q = component('SortBy');\n  var renderer$m = function renderer(_ref) {\n    var containerNode = _ref.containerNode,\n      cssClasses = _ref.cssClasses;\n    return function (_ref2, isFirstRendering) {\n      var currentRefinement = _ref2.currentRefinement,\n        options = _ref2.options,\n        refine = _ref2.refine;\n      if (isFirstRendering) {\n        return;\n      }\n      P(h(\"div\", {\n        className: cssClasses.root\n      }, h(Selector, {\n        cssClasses: cssClasses,\n        currentValue: currentRefinement,\n        options: options,\n        setValue: refine,\n        ariaLabel: \"Sort results by\"\n      })), containerNode);\n    };\n  };\n\n  /**\n   * Sort by selector is a widget used for letting the user choose between different\n   * indices that contains the same data with a different order / ranking formula.\n   */\n  var sortBy = function sortBy(widgetParams) {\n    var _ref3 = widgetParams || {},\n      container = _ref3.container,\n      items = _ref3.items,\n      _ref3$cssClasses = _ref3.cssClasses,\n      userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n      transformItems = _ref3.transformItems;\n    if (!container) {\n      throw new Error(withUsage$W('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$q(), userCssClasses.root),\n      select: cx(suit$q({\n        descendantName: 'select'\n      }), userCssClasses.select),\n      option: cx(suit$q({\n        descendantName: 'option'\n      }), userCssClasses.option)\n    };\n    var specializedRenderer = renderer$m({\n      containerNode: containerNode,\n      cssClasses: cssClasses\n    });\n    var makeWidget = connectSortBy(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      container: containerNode,\n      items: items,\n      transformItems: transformItems\n    })), {}, {\n      $$widgetType: 'ais.sortBy'\n    });\n  };\n\n  var _excluded$u = [\"nbHits\", \"nbSortedHits\", \"cssClasses\", \"templateProps\"];\n  var Stats = function Stats(_ref) {\n    var nbHits = _ref.nbHits,\n      nbSortedHits = _ref.nbSortedHits,\n      cssClasses = _ref.cssClasses,\n      templateProps = _ref.templateProps,\n      rest = _objectWithoutProperties(_ref, _excluded$u);\n    return h(\"div\", {\n      className: cx(cssClasses.root)\n    }, h(Template, _extends({}, templateProps, {\n      templateKey: \"text\",\n      rootTagName: \"span\",\n      rootProps: {\n        className: cssClasses.text\n      },\n      data: _objectSpread2({\n        hasManySortedResults: nbSortedHits && nbSortedHits > 1,\n        hasNoSortedResults: nbSortedHits === 0,\n        hasOneSortedResults: nbSortedHits === 1,\n        hasManyResults: nbHits > 1,\n        hasNoResults: nbHits === 0,\n        hasOneResult: nbHits === 1,\n        nbHits: nbHits,\n        nbSortedHits: nbSortedHits,\n        cssClasses: cssClasses\n      }, rest)\n    })));\n  };\n\n  var withUsage$X = createDocumentationMessageGenerator({\n    name: 'stats'\n  });\n  var suit$r = component('Stats');\n  var defaultTemplates$g = {\n    text: function text(props) {\n      return \"\".concat(props.areHitsSorted ? getSortedResultsSentence(props) : getResultsSentence(props), \" found in \").concat(props.processingTimeMS, \"ms\");\n    }\n  };\n  function getSortedResultsSentence(_ref) {\n    var nbHits = _ref.nbHits,\n      hasNoSortedResults = _ref.hasNoSortedResults,\n      hasOneSortedResults = _ref.hasOneSortedResults,\n      hasManySortedResults = _ref.hasManySortedResults,\n      nbSortedHits = _ref.nbSortedHits;\n    var suffix = \"sorted out of \".concat(formatNumber(nbHits));\n    if (hasNoSortedResults) {\n      return \"No relevant results \".concat(suffix);\n    }\n    if (hasOneSortedResults) {\n      return \"1 relevant result \".concat(suffix);\n    }\n    if (hasManySortedResults) {\n      return \"\".concat(formatNumber(nbSortedHits || 0), \" relevant results \").concat(suffix);\n    }\n    return '';\n  }\n  function getResultsSentence(_ref2) {\n    var nbHits = _ref2.nbHits,\n      hasNoResults = _ref2.hasNoResults,\n      hasOneResult = _ref2.hasOneResult,\n      hasManyResults = _ref2.hasManyResults;\n    if (hasNoResults) {\n      return 'No results';\n    }\n    if (hasOneResult) {\n      return '1 result';\n    }\n    if (hasManyResults) {\n      return \"\".concat(formatNumber(nbHits), \" results\");\n    }\n    return '';\n  }\n  var renderer$n = function renderer(_ref3) {\n    var renderState = _ref3.renderState,\n      cssClasses = _ref3.cssClasses,\n      containerNode = _ref3.containerNode,\n      templates = _ref3.templates;\n    return function (_ref4, isFirstRendering) {\n      var hitsPerPage = _ref4.hitsPerPage,\n        nbHits = _ref4.nbHits,\n        nbSortedHits = _ref4.nbSortedHits,\n        areHitsSorted = _ref4.areHitsSorted,\n        nbPages = _ref4.nbPages,\n        page = _ref4.page,\n        processingTimeMS = _ref4.processingTimeMS,\n        query = _ref4.query,\n        instantSearchInstance = _ref4.instantSearchInstance;\n      if (isFirstRendering) {\n        renderState.templateProps = prepareTemplateProps({\n          defaultTemplates: defaultTemplates$g,\n          templatesConfig: instantSearchInstance.templatesConfig,\n          templates: templates\n        });\n        return;\n      }\n      P(h(Stats, {\n        cssClasses: cssClasses,\n        hitsPerPage: hitsPerPage,\n        nbHits: nbHits,\n        nbSortedHits: nbSortedHits,\n        areHitsSorted: areHitsSorted,\n        nbPages: nbPages,\n        page: page,\n        processingTimeMS: processingTimeMS,\n        query: query,\n        templateProps: renderState.templateProps\n      }), containerNode);\n    };\n  };\n\n  /**\n   * The `stats` widget is used to display useful insights about the current results.\n   *\n   * By default, it will display the **number of hits** and the time taken to compute the\n   * results inside the engine.\n   */\n  var stats = function stats(widgetParams) {\n    var _ref5 = widgetParams || {},\n      container = _ref5.container,\n      _ref5$cssClasses = _ref5.cssClasses,\n      userCssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses,\n      _ref5$templates = _ref5.templates,\n      templates = _ref5$templates === void 0 ? {} : _ref5$templates;\n    if (!container) {\n      throw new Error(withUsage$X('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$r(), userCssClasses.root),\n      text: cx(suit$r({\n        descendantName: 'text'\n      }), userCssClasses.text)\n    };\n    var specializedRenderer = renderer$n({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      templates: templates,\n      renderState: {}\n    });\n    var makeWidget = connectStats(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({})), {}, {\n      $$widgetType: 'ais.stats'\n    });\n  };\n\n  var ToggleRefinement = function ToggleRefinement(_ref) {\n    var currentRefinement = _ref.currentRefinement,\n      refine = _ref.refine,\n      cssClasses = _ref.cssClasses,\n      templateProps = _ref.templateProps;\n    return h(\"div\", {\n      className: cssClasses.root\n    }, h(\"label\", {\n      className: cssClasses.label\n    }, h(\"input\", {\n      className: cssClasses.checkbox,\n      type: \"checkbox\",\n      checked: currentRefinement.isRefined,\n      onChange: function onChange(event) {\n        return refine({\n          isRefined: !event.target.checked\n        });\n      }\n    }), h(Template, _extends({}, templateProps, {\n      rootTagName: \"span\",\n      rootProps: {\n        className: cssClasses.labelText\n      },\n      templateKey: \"labelText\",\n      data: currentRefinement\n    }))));\n  };\n\n  var defaultTemplates$h = {\n    labelText: function labelText(_ref) {\n      var name = _ref.name;\n      return name;\n    }\n  };\n\n  var withUsage$Y = createDocumentationMessageGenerator({\n    name: 'toggle-refinement'\n  });\n  var suit$s = component('ToggleRefinement');\n  var renderer$o = function renderer(_ref) {\n    var containerNode = _ref.containerNode,\n      cssClasses = _ref.cssClasses,\n      renderState = _ref.renderState,\n      templates = _ref.templates;\n    return function (_ref2, isFirstRendering) {\n      var value = _ref2.value,\n        refine = _ref2.refine,\n        instantSearchInstance = _ref2.instantSearchInstance;\n      if (isFirstRendering) {\n        renderState.templateProps = prepareTemplateProps({\n          defaultTemplates: defaultTemplates$h,\n          templatesConfig: instantSearchInstance.templatesConfig,\n          templates: templates\n        });\n        return;\n      }\n      P(h(ToggleRefinement, {\n        cssClasses: cssClasses,\n        currentRefinement: value,\n        templateProps: renderState.templateProps,\n        refine: refine\n      }), containerNode);\n    };\n  };\n  /**\n   * The toggleRefinement widget lets the user either:\n   *  - switch between two values for a single facetted attribute (free_shipping / not_free_shipping)\n   *  - toggleRefinement a faceted value on and off (only 'canon' for brands)\n   *\n   * This widget is particularly useful if you have a boolean value in the records.\n   *\n   * @requirements\n   * The attribute passed to `attribute` must be declared as an\n   * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\n   * in your Algolia settings.\n   */\n  var toggleRefinement = function toggleRefinement(widgetParams) {\n    var _ref3 = widgetParams || {},\n      container = _ref3.container,\n      attribute = _ref3.attribute,\n      _ref3$cssClasses = _ref3.cssClasses,\n      userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n      _ref3$templates = _ref3.templates,\n      templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n      _ref3$on = _ref3.on,\n      on = _ref3$on === void 0 ? true : _ref3$on,\n      off = _ref3.off;\n    if (!container) {\n      throw new Error(withUsage$Y('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$s(), userCssClasses.root),\n      label: cx(suit$s({\n        descendantName: 'label'\n      }), userCssClasses.label),\n      checkbox: cx(suit$s({\n        descendantName: 'checkbox'\n      }), userCssClasses.checkbox),\n      labelText: cx(suit$s({\n        descendantName: 'labelText'\n      }), userCssClasses.labelText)\n    };\n    var specializedRenderer = renderer$o({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      renderState: {},\n      templates: templates\n    });\n    var makeWidget = connectToggleRefinement(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      attribute: attribute,\n      on: on,\n      off: off\n    })), {}, {\n      $$widgetType: 'ais.toggleRefinement'\n    });\n  };\n\n  var _excluded$v = [\"item\", \"sendEvent\"];\n  var withUsage$Z = createDocumentationMessageGenerator({\n    name: 'trending-items'\n  });\n  var TrendingItems = createTrendingItemsComponent({\n    createElement: h,\n    Fragment: p\n  });\n  function createRenderer$1(_ref) {\n    var renderState = _ref.renderState,\n      cssClasses = _ref.cssClasses,\n      containerNode = _ref.containerNode,\n      templates = _ref.templates;\n    return function renderer(_ref2, isFirstRendering) {\n      var items = _ref2.items,\n        results = _ref2.results,\n        instantSearchInstance = _ref2.instantSearchInstance,\n        sendEvent = _ref2.sendEvent;\n      if (isFirstRendering) {\n        renderState.templateProps = prepareTemplateProps({\n          defaultTemplates: {},\n          templatesConfig: instantSearchInstance.templatesConfig,\n          templates: templates\n        });\n        return;\n      }\n      var headerComponent = templates.header ? function (data) {\n        return h(Template, _extends({}, renderState.templateProps, {\n          templateKey: \"header\",\n          rootTagName: \"fragment\",\n          data: {\n            cssClasses: data.classNames,\n            items: data.items\n          }\n        }));\n      } : undefined;\n      var itemComponent = templates.item ? function (_ref3) {\n        var item = _ref3.item,\n          _sendEvent = _ref3.sendEvent,\n          rootProps = _objectWithoutProperties(_ref3, _excluded$v);\n        return h(Template, _extends({}, renderState.templateProps, {\n          templateKey: \"item\",\n          rootTagName: \"fragment\",\n          data: item,\n          sendEvent: _sendEvent,\n          rootProps: _objectSpread2({}, rootProps)\n        }));\n      } : undefined;\n      var emptyComponent = templates.empty ? function () {\n        return h(Template, _extends({}, renderState.templateProps, {\n          templateKey: \"empty\",\n          rootTagName: \"fragment\",\n          data: results\n        }));\n      } : undefined;\n      var layoutComponent = templates.layout ? function (data) {\n        return h(Template, _extends({}, renderState.templateProps, {\n          templateKey: \"layout\",\n          rootTagName: \"fragment\",\n          data: {\n            sendEvent: sendEvent,\n            items: data.items,\n            templates: {\n              item: templates.item ? function (_ref4) {\n                var item = _ref4.item;\n                return h(Template, _extends({}, renderState.templateProps, {\n                  templateKey: \"item\",\n                  rootTagName: \"fragment\",\n                  data: item,\n                  sendEvent: sendEvent\n                }));\n              } : undefined\n            },\n            cssClasses: {\n              list: data.classNames.list,\n              item: data.classNames.item\n            }\n          },\n          sendEvent: sendEvent\n        }));\n      } : undefined;\n      P(h(TrendingItems, {\n        items: items,\n        sendEvent: sendEvent,\n        classNames: cssClasses,\n        headerComponent: headerComponent,\n        itemComponent: itemComponent,\n        emptyComponent: emptyComponent,\n        layout: layoutComponent,\n        status: instantSearchInstance.status\n      }), containerNode);\n    };\n  }\n  var trendingItems = (function trendingItems(widgetParams) {\n    var _ref5 = widgetParams || {},\n      container = _ref5.container,\n      facetName = _ref5.facetName,\n      facetValue = _ref5.facetValue,\n      limit = _ref5.limit,\n      queryParameters = _ref5.queryParameters,\n      fallbackParameters = _ref5.fallbackParameters,\n      threshold = _ref5.threshold,\n      escapeHTML = _ref5.escapeHTML,\n      transformItems = _ref5.transformItems,\n      _ref5$templates = _ref5.templates,\n      templates = _ref5$templates === void 0 ? {} : _ref5$templates,\n      _ref5$cssClasses = _ref5.cssClasses,\n      cssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses;\n    if (!container) {\n      throw new Error(withUsage$Z('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var specializedRenderer = createRenderer$1({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      renderState: {},\n      templates: templates\n    });\n    var makeWidget = connectTrendingItems(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    var facetParameters = facetName && facetValue ? {\n      facetName: facetName,\n      facetValue: facetValue\n    } : {};\n    return _objectSpread2(_objectSpread2({}, makeWidget(_objectSpread2(_objectSpread2({}, facetParameters), {}, {\n      limit: limit,\n      queryParameters: queryParameters,\n      fallbackParameters: fallbackParameters,\n      threshold: threshold,\n      escapeHTML: escapeHTML,\n      transformItems: transformItems\n    }))), {}, {\n      $$widgetType: 'ais.trendingItems'\n    });\n  });\n\n  var VoiceSearch = function VoiceSearch(_ref) {\n    var cssClasses = _ref.cssClasses,\n      isBrowserSupported = _ref.isBrowserSupported,\n      isListening = _ref.isListening,\n      toggleListening = _ref.toggleListening,\n      voiceListeningState = _ref.voiceListeningState,\n      templates = _ref.templates;\n    var handleClick = function handleClick(event) {\n      if (event.currentTarget instanceof HTMLElement) {\n        event.currentTarget.blur();\n      }\n      toggleListening();\n    };\n    var status = voiceListeningState.status,\n      transcript = voiceListeningState.transcript,\n      isSpeechFinal = voiceListeningState.isSpeechFinal,\n      errorCode = voiceListeningState.errorCode;\n    return h(\"div\", {\n      className: cssClasses.root\n    }, h(Template, {\n      templateKey: \"buttonText\",\n      rootTagName: \"button\",\n      rootProps: {\n        className: cssClasses.button,\n        type: 'button',\n        title: \"Search by voice\".concat(isBrowserSupported ? '' : ' (not supported on this browser)'),\n        onClick: handleClick,\n        disabled: !isBrowserSupported\n      },\n      data: {\n        status: status,\n        errorCode: errorCode,\n        isListening: isListening,\n        transcript: transcript,\n        isSpeechFinal: isSpeechFinal,\n        isBrowserSupported: isBrowserSupported\n      },\n      templates: templates\n    }), h(Template, {\n      templateKey: \"status\",\n      rootProps: {\n        className: cssClasses.status\n      },\n      data: {\n        status: status,\n        errorCode: errorCode,\n        isListening: isListening,\n        transcript: transcript,\n        isSpeechFinal: isSpeechFinal,\n        isBrowserSupported: isBrowserSupported\n      },\n      templates: templates\n    }));\n  };\n\n  var _ref2$1 = h(p, null, h(\"line\", {\n    x1: \"1\",\n    y1: \"1\",\n    x2: \"23\",\n    y2: \"23\"\n  }), h(\"path\", {\n    d: \"M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6\"\n  }), h(\"path\", {\n    d: \"M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23\"\n  }), h(\"line\", {\n    x1: \"12\",\n    y1: \"19\",\n    x2: \"12\",\n    y2: \"23\"\n  }), h(\"line\", {\n    x1: \"8\",\n    y1: \"23\",\n    x2: \"16\",\n    y2: \"23\"\n  }));\n  var _ref3$1 = h(\"path\", {\n    d: \"M19 10v2a7 7 0 0 1-14 0v-2\"\n  });\n  var _ref4$2 = h(\"line\", {\n    x1: \"12\",\n    y1: \"19\",\n    x2: \"12\",\n    y2: \"23\"\n  });\n  var _ref5 = h(\"line\", {\n    x1: \"8\",\n    y1: \"23\",\n    x2: \"16\",\n    y2: \"23\"\n  });\n  var ButtonInnerElement = function ButtonInnerElement(_ref) {\n    var status = _ref.status,\n      errorCode = _ref.errorCode,\n      isListening = _ref.isListening;\n    if (status === 'error' && errorCode === 'not-allowed') {\n      return _ref2$1;\n    }\n    return h(p, null, h(\"path\", {\n      d: \"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z\",\n      fill: isListening ? 'currentColor' : 'none'\n    }), _ref3$1, _ref4$2, _ref5);\n  };\n  var defaultTemplates$i = {\n    buttonText: function buttonText(_ref6) {\n      var status = _ref6.status,\n        errorCode = _ref6.errorCode,\n        isListening = _ref6.isListening;\n      return h(\"svg\", {\n        width: \"16\",\n        height: \"16\",\n        viewBox: \"0 0 24 24\",\n        fill: \"none\",\n        stroke: \"currentColor\"\n        /* eslint-disable react/no-unknown-property */\n        // Preact supports kebab case attributes, and using camel case would\n        // require using `preact/compat`.\n        // @TODO: reconsider using the `react` ESLint preset\n        ,\n        \"stroke-width\": \"2\",\n        \"stroke-linecap\": \"round\",\n        \"stroke-linejoin\": \"round\"\n        /* eslint-enable react/no-unknown-property */\n      }, h(ButtonInnerElement, {\n        status: status,\n        errorCode: errorCode,\n        isListening: isListening\n      }));\n    },\n    status: function status(_ref7) {\n      var transcript = _ref7.transcript;\n      return h(\"p\", null, transcript);\n    }\n  };\n\n  var withUsage$_ = createDocumentationMessageGenerator({\n    name: 'voice-search'\n  });\n  var suit$t = component('VoiceSearch');\n  var renderer$p = function renderer(_ref) {\n    var containerNode = _ref.containerNode,\n      cssClasses = _ref.cssClasses,\n      templates = _ref.templates;\n    return function (_ref2) {\n      var isBrowserSupported = _ref2.isBrowserSupported,\n        isListening = _ref2.isListening,\n        toggleListening = _ref2.toggleListening,\n        voiceListeningState = _ref2.voiceListeningState;\n      P(h(VoiceSearch, {\n        cssClasses: cssClasses,\n        templates: templates,\n        isBrowserSupported: isBrowserSupported,\n        isListening: isListening,\n        toggleListening: toggleListening,\n        voiceListeningState: voiceListeningState\n      }), containerNode);\n    };\n  };\n  var voiceSearch = function voiceSearch(widgetParams) {\n    var _ref3 = widgetParams || {},\n      container = _ref3.container,\n      _ref3$cssClasses = _ref3.cssClasses,\n      userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n      _ref3$templates = _ref3.templates,\n      userTemplates = _ref3$templates === void 0 ? {} : _ref3$templates,\n      _ref3$searchAsYouSpea = _ref3.searchAsYouSpeak,\n      searchAsYouSpeak = _ref3$searchAsYouSpea === void 0 ? false : _ref3$searchAsYouSpea,\n      language = _ref3.language,\n      additionalQueryParameters = _ref3.additionalQueryParameters,\n      createVoiceSearchHelper = _ref3.createVoiceSearchHelper;\n    if (!container) {\n      throw new Error(withUsage$_('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var cssClasses = {\n      root: cx(suit$t(), userCssClasses.root),\n      button: cx(suit$t({\n        descendantName: 'button'\n      }), userCssClasses.button),\n      status: cx(suit$t({\n        descendantName: 'status'\n      }), userCssClasses.status)\n    };\n    var templates = _objectSpread2(_objectSpread2({}, defaultTemplates$i), userTemplates);\n    var specializedRenderer = renderer$p({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      templates: templates\n    });\n    var makeWidget = connectVoiceSearch(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      container: containerNode,\n      cssClasses: cssClasses,\n      templates: templates,\n      searchAsYouSpeak: searchAsYouSpeak,\n      language: language,\n      additionalQueryParameters: additionalQueryParameters,\n      createVoiceSearchHelper: createVoiceSearchHelper\n    })), {}, {\n      $$widgetType: 'ais.voiceSearch'\n    });\n  };\n\n  var _excluded$w = [\"item\", \"sendEvent\"];\n  var withUsage$$ = createDocumentationMessageGenerator({\n    name: 'frequently-bought-together'\n  });\n  var FrequentlyBoughtTogether = createFrequentlyBoughtTogetherComponent({\n    createElement: h,\n    Fragment: p\n  });\n  var renderer$q = function renderer(_ref) {\n    var renderState = _ref.renderState,\n      cssClasses = _ref.cssClasses,\n      containerNode = _ref.containerNode,\n      templates = _ref.templates;\n    return function (_ref2, isFirstRendering) {\n      var items = _ref2.items,\n        results = _ref2.results,\n        instantSearchInstance = _ref2.instantSearchInstance,\n        sendEvent = _ref2.sendEvent;\n      if (isFirstRendering) {\n        renderState.templateProps = prepareTemplateProps({\n          defaultTemplates: {},\n          templatesConfig: instantSearchInstance.templatesConfig,\n          templates: templates\n        });\n        return;\n      }\n      var headerComponent = templates.header ? function (data) {\n        return h(Template, _extends({}, renderState.templateProps, {\n          templateKey: \"header\",\n          rootTagName: \"fragment\",\n          data: {\n            cssClasses: data.classNames,\n            items: data.items\n          }\n        }));\n      } : undefined;\n      var itemComponent = templates.item ? function (_ref3) {\n        var item = _ref3.item,\n          _sendEvent = _ref3.sendEvent,\n          rootProps = _objectWithoutProperties(_ref3, _excluded$w);\n        return h(Template, _extends({}, renderState.templateProps, {\n          templateKey: \"item\",\n          rootTagName: \"fragment\",\n          data: item,\n          sendEvent: _sendEvent,\n          rootProps: _objectSpread2({}, rootProps)\n        }));\n      } : undefined;\n      var emptyComponent = templates.empty ? function () {\n        return h(Template, _extends({}, renderState.templateProps, {\n          templateKey: \"empty\",\n          rootTagName: \"fragment\",\n          data: results\n        }));\n      } : undefined;\n      var layoutComponent = templates.layout ? function (data) {\n        return h(Template, _extends({}, renderState.templateProps, {\n          templateKey: \"layout\",\n          rootTagName: \"fragment\",\n          data: {\n            sendEvent: sendEvent,\n            items: data.items,\n            templates: {\n              item: templates.item ? function (_ref4) {\n                var item = _ref4.item;\n                return h(Template, _extends({}, renderState.templateProps, {\n                  templateKey: \"item\",\n                  rootTagName: \"fragment\",\n                  data: item,\n                  sendEvent: sendEvent\n                }));\n              } : undefined\n            },\n            cssClasses: {\n              list: data.classNames.list,\n              item: data.classNames.item\n            }\n          },\n          sendEvent: sendEvent\n        }));\n      } : undefined;\n      P(h(FrequentlyBoughtTogether, {\n        items: items,\n        headerComponent: headerComponent,\n        itemComponent: itemComponent,\n        sendEvent: sendEvent,\n        classNames: cssClasses,\n        emptyComponent: emptyComponent,\n        layout: layoutComponent,\n        status: instantSearchInstance.status\n      }), containerNode);\n    };\n  };\n  var frequentlyBoughtTogether = (function frequentlyBoughtTogether(widgetParams) {\n    var _ref5 = widgetParams || {},\n      container = _ref5.container,\n      objectIDs = _ref5.objectIDs,\n      limit = _ref5.limit,\n      queryParameters = _ref5.queryParameters,\n      threshold = _ref5.threshold,\n      escapeHTML = _ref5.escapeHTML,\n      transformItems = _ref5.transformItems,\n      _ref5$templates = _ref5.templates,\n      templates = _ref5$templates === void 0 ? {} : _ref5$templates,\n      _ref5$cssClasses = _ref5.cssClasses,\n      cssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses;\n    if (!container) {\n      throw new Error(withUsage$$('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var specializedRenderer = renderer$q({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      renderState: {},\n      templates: templates\n    });\n    var makeWidget = connectFrequentlyBoughtTogether(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      objectIDs: objectIDs,\n      limit: limit,\n      queryParameters: queryParameters,\n      threshold: threshold,\n      escapeHTML: escapeHTML,\n      transformItems: transformItems\n    })), {}, {\n      $$widgetType: 'ais.frequentlyBoughtTogether'\n    });\n  });\n\n  var _excluded$x = [\"item\", \"sendEvent\"];\n  var withUsage$10 = createDocumentationMessageGenerator({\n    name: 'looking-similar'\n  });\n  var LookingSimilar = createLookingSimilarComponent({\n    createElement: h,\n    Fragment: p\n  });\n  function createRenderer$2(_ref) {\n    var renderState = _ref.renderState,\n      cssClasses = _ref.cssClasses,\n      containerNode = _ref.containerNode,\n      templates = _ref.templates;\n    return function (_ref2, isFirstRendering) {\n      var items = _ref2.items,\n        results = _ref2.results,\n        instantSearchInstance = _ref2.instantSearchInstance,\n        sendEvent = _ref2.sendEvent;\n      if (isFirstRendering) {\n        renderState.templateProps = prepareTemplateProps({\n          defaultTemplates: {},\n          templatesConfig: instantSearchInstance.templatesConfig,\n          templates: templates\n        });\n        return;\n      }\n      var headerComponent = templates.header ? function (data) {\n        return h(Template, _extends({}, renderState.templateProps, {\n          templateKey: \"header\",\n          rootTagName: \"fragment\",\n          data: {\n            cssClasses: data.classNames,\n            items: data.items\n          }\n        }));\n      } : undefined;\n      var itemComponent = templates.item ? function (_ref3) {\n        var item = _ref3.item,\n          _sendEvent = _ref3.sendEvent,\n          rootProps = _objectWithoutProperties(_ref3, _excluded$x);\n        return h(Template, _extends({}, renderState.templateProps, {\n          templateKey: \"item\",\n          rootTagName: \"fragment\",\n          data: item,\n          sendEvent: _sendEvent,\n          rootProps: _objectSpread2({}, rootProps)\n        }));\n      } : undefined;\n      var emptyComponent = templates.empty ? function () {\n        return h(Template, _extends({}, renderState.templateProps, {\n          templateKey: \"empty\",\n          rootTagName: \"fragment\",\n          data: results\n        }));\n      } : undefined;\n      var layoutComponent = templates.layout ? function (data) {\n        return h(Template, _extends({}, renderState.templateProps, {\n          templateKey: \"layout\",\n          rootTagName: \"fragment\",\n          data: {\n            sendEvent: sendEvent,\n            items: data.items,\n            templates: {\n              item: templates.item ? function (_ref4) {\n                var item = _ref4.item;\n                return h(Template, _extends({}, renderState.templateProps, {\n                  templateKey: \"item\",\n                  rootTagName: \"fragment\",\n                  data: item,\n                  sendEvent: sendEvent\n                }));\n              } : undefined\n            },\n            cssClasses: {\n              list: data.classNames.list,\n              item: data.classNames.item\n            }\n          },\n          sendEvent: sendEvent\n        }));\n      } : undefined;\n      P(h(LookingSimilar, {\n        items: items,\n        headerComponent: headerComponent,\n        itemComponent: itemComponent,\n        sendEvent: function sendEvent() {},\n        classNames: cssClasses,\n        emptyComponent: emptyComponent,\n        layout: layoutComponent,\n        status: instantSearchInstance.status\n      }), containerNode);\n    };\n  }\n  var lookingSimilar = (function lookingSimilar(widgetParams) {\n    var _ref5 = widgetParams || {},\n      container = _ref5.container,\n      objectIDs = _ref5.objectIDs,\n      limit = _ref5.limit,\n      queryParameters = _ref5.queryParameters,\n      fallbackParameters = _ref5.fallbackParameters,\n      threshold = _ref5.threshold,\n      escapeHTML = _ref5.escapeHTML,\n      transformItems = _ref5.transformItems,\n      _ref5$templates = _ref5.templates,\n      templates = _ref5$templates === void 0 ? {} : _ref5$templates,\n      _ref5$cssClasses = _ref5.cssClasses,\n      cssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses;\n    if (!container) {\n      throw new Error(withUsage$10('The `container` option is required.'));\n    }\n    var containerNode = getContainerNode(container);\n    var specializedRenderer = createRenderer$2({\n      containerNode: containerNode,\n      cssClasses: cssClasses,\n      renderState: {},\n      templates: templates\n    });\n    var makeWidget = connectLookingSimilar(specializedRenderer, function () {\n      return P(null, containerNode);\n    });\n    return _objectSpread2(_objectSpread2({}, makeWidget({\n      objectIDs: objectIDs,\n      limit: limit,\n      queryParameters: queryParameters,\n      fallbackParameters: fallbackParameters,\n      threshold: threshold,\n      escapeHTML: escapeHTML,\n      transformItems: transformItems\n    })), {}, {\n      $$widgetType: 'ais.lookingSimilar'\n    });\n  });\n\n  /** @deprecated answers is no longer supported */\n  var EXPERIMENTAL_answers = deprecate(answers, 'answers is no longer supported');\n\n  /** @deprecated use relatedItems instead */\n  var EXPERIMENTAL_configureRelatedItems = deprecate(configureRelatedItems, 'EXPERIMENTAL_configureRelatedItems is deprecated and will be removed in a next minor version of InstantSearch. Please use relatedItems instead.');\n\n  /** @deprecated use dynamicWidgets */\n  var EXPERIMENTAL_dynamicWidgets = deprecate(dynamicWidgets, 'use dynamicWidgets');\n\n  var widgets = /*#__PURE__*/Object.freeze({\n    __proto__: null,\n    EXPERIMENTAL_answers: EXPERIMENTAL_answers,\n    EXPERIMENTAL_configureRelatedItems: EXPERIMENTAL_configureRelatedItems,\n    EXPERIMENTAL_dynamicWidgets: EXPERIMENTAL_dynamicWidgets,\n    dynamicWidgets: dynamicWidgets,\n    analytics: analytics,\n    breadcrumb: breadcrumb,\n    clearRefinements: clearRefinements$1,\n    configure: configure,\n    currentRefinements: currentRefinements,\n    geoSearch: geoSearch,\n    hierarchicalMenu: hierarchicalMenu,\n    hits: hits,\n    hitsPerPage: hitsPerPage,\n    index: index,\n    infiniteHits: infiniteHits,\n    menu: menu,\n    menuSelect: menuSelect,\n    numericMenu: numericMenu,\n    pagination: pagination,\n    panel: panel,\n    places: places,\n    poweredBy: poweredBy,\n    queryRuleContext: queryRuleContext,\n    queryRuleCustomData: queryRuleCustomData,\n    relatedProducts: relatedProducts,\n    rangeInput: rangeInput,\n    rangeSlider: rangeSlider,\n    ratingMenu: ratingMenu,\n    refinementList: refinementList,\n    relevantSort: relevantSort,\n    searchBox: searchBox,\n    sortBy: sortBy,\n    stats: stats,\n    toggleRefinement: toggleRefinement,\n    trendingItems: trendingItems,\n    voiceSearch: voiceSearch,\n    frequentlyBoughtTogether: frequentlyBoughtTogether,\n    lookingSimilar: lookingSimilar\n  });\n\n  /**\n   * InstantSearch is the main component of InstantSearch.js. This object\n   * manages the widget and lets you add new ones.\n   *\n   * Two parameters are required to get you started with InstantSearch.js:\n   *  - `indexName`: the main index that you will use for your new search UI\n   *  - `searchClient`: the search client to plug to InstantSearch.js\n   *\n   * The [search client provided by Algolia](algolia.com/doc/api-client/getting-started/what-is-the-api-client/javascript/)\n   * needs an `appId` and an `apiKey`. Those parameters can be found in your\n   * [Algolia dashboard](https://www.algolia.com/api-keys).\n   *\n   * If you want to get up and running quickly with InstantSearch.js, have a\n   * look at the [getting started](https://www.algolia.com/doc/guides/building-search-ui/getting-started/js/).\n   */\n  var instantsearch = function instantsearch(options) {\n    return new InstantSearch(options);\n  };\n  instantsearch.version = version$1;\n  instantsearch.connectors = connectors;\n  instantsearch.widgets = widgets;\n  instantsearch.middlewares = middlewares;\n  instantsearch.routers = routers;\n  instantsearch.stateMappings = stateMappings;\n  instantsearch.templates = templates;\n  instantsearch.createInfiniteHitsSessionStorageCache = createInfiniteHitsSessionStorageCache;\n  instantsearch.highlight = highlight;\n  instantsearch.reverseHighlight = reverseHighlight;\n  instantsearch.snippet = snippet;\n  instantsearch.reverseSnippet = reverseSnippet;\n  instantsearch.insights = insights;\n\n  return instantsearch;\n\n})));\n//# sourceMappingURL=instantsearch.development.js.map\n"
  },
  {
    "path": "js/instantsearch.js/dist/instantsearch.production.d.ts",
    "content": "import { AlgoliaSearchHelper } from 'algoliasearch-helper';\r\nimport { Banner } from 'algoliasearch-helper';\r\nimport type { CarouselProps } from 'instantsearch-ui-components';\r\nimport { CompositionClient } from 'algoliasearch-helper/types/algoliasearch.js';\r\nimport EventEmitter from '@algolia/events';\r\nimport { FindAnswersOptions } from 'algoliasearch-helper/types/algoliasearch.js';\r\nimport type { FrequentlyBoughtTogetherProps } from 'instantsearch-ui-components';\r\nimport { h } from 'preact';\r\nimport type { HighlightClassNames as HighlightClassNames_2 } from 'instantsearch-ui-components';\r\nimport type { HighlightProps as HighlightProps_3 } from 'instantsearch-ui-components';\r\nimport type { HitsClassNames } from 'instantsearch-ui-components';\r\nimport type { HoganOptions } from 'hogan.js';\r\nimport { html } from 'htm/preact';\r\nimport type { InsightsClient as InsightsClient_2 } from 'search-insights';\r\nimport type { InsightsMethodMap as InsightsMethodMap_2 } from 'search-insights';\r\nimport type { LookingSimilarProps } from 'instantsearch-ui-components';\r\nimport type * as Places from 'places.js';\r\nimport { PlainSearchParameters } from 'algoliasearch-helper';\r\nimport { default as qs_2 } from 'qs';\r\nimport type { RecommendClassNames } from 'instantsearch-ui-components';\r\nimport { RecommendParameters } from 'algoliasearch-helper';\r\nimport type { RecommendParametersOptions } from 'algoliasearch-helper';\r\nimport { RecommendResponse } from 'algoliasearch-helper/types/algoliasearch.js';\r\nimport type { RecommendResults } from 'algoliasearch-helper';\r\nimport type { RelatedProductsProps } from 'instantsearch-ui-components';\r\nimport { SearchClient } from 'algoliasearch-helper/types/algoliasearch.js';\r\nimport { SearchOptions } from 'algoliasearch-helper/types/algoliasearch.js';\r\nimport { SearchParameters } from 'algoliasearch-helper';\r\nimport { SearchResults } from 'algoliasearch-helper';\r\nimport type { TrendingItemsProps } from 'instantsearch-ui-components';\r\nimport { VNode } from 'preact';\r\nimport type { VNode as VNode_2 } from 'instantsearch-ui-components';\r\n\r\ndeclare type AlgoliaHit<THit extends NonNullable<object> = Record<string, any>> = {\r\n    objectID: string;\r\n    _highlightResult?: HitHighlightResult;\r\n    _snippetResult?: HitSnippetResult;\r\n    _rankingInfo?: {\r\n        promoted: boolean;\r\n        nbTypos: number;\r\n        firstMatchedWord: number;\r\n        proximityDistance?: number;\r\n        geoDistance: number;\r\n        geoPrecision?: number;\r\n        nbExactWords: number;\r\n        words: number;\r\n        filters: number;\r\n        userScore: number;\r\n        matchedGeoLocation?: {\r\n            lat: number;\r\n            lng: number;\r\n            distance: number;\r\n        };\r\n    };\r\n    _distinctSeqID?: number;\r\n    _geoloc?: GeoLoc;\r\n} & THit;\r\n\r\ndeclare const analytics: AnalyticsWidget;\r\n\r\ndeclare type AnalyticsWidget = WidgetFactory<AnalyticsWidgetDescription, AnalyticsWidgetParams, AnalyticsWidgetParams>;\r\n\r\ndeclare type AnalyticsWidgetDescription = {\r\n    $$type: 'ais.analytics';\r\n    $$widgetType: 'ais.analytics';\r\n    renderState: Record<string, unknown>;\r\n    indexRenderState: {\r\n        analytics: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams>;\r\n    };\r\n};\r\n\r\ndeclare type AnalyticsWidgetParams = {\r\n    /**\r\n     * A function that is called every time the query or refinements changes. You\r\n     * need to add the logic to push the data to your analytics platform.\r\n     */\r\n    pushFunction: AnalyticsWidgetParamsPushFunction;\r\n    /**\r\n     * The number of milliseconds between the last search keystroke and calling `pushFunction`.\r\n     *\r\n     * @default 3000\r\n     */\r\n    delay?: number;\r\n    /**\r\n     * Triggers `pushFunction` after click on page or redirecting the page. This is useful if\r\n     * you want the pushFunction to be called for the last actions before the user leaves the\r\n     * current page, even if the delay wasn’t reached.\r\n     *\r\n     * @default false\r\n     */\r\n    triggerOnUIInteraction?: boolean;\r\n    /**\r\n     * Triggers `pushFunction` when InstantSearch is initialized. This means\r\n     * the `pushFunction` might be called even though the user didn’t perfom\r\n     * any search-related action.\r\n     *\r\n     * @default true\r\n     */\r\n    pushInitialSearch?: boolean;\r\n    /**\r\n     * Triggers `pushFunction` when the page changes, either through the UI or programmatically.\r\n     *\r\n     * @default false\r\n     */\r\n    pushPagination?: boolean;\r\n};\r\n\r\ndeclare type AnalyticsWidgetParamsPushFunction = (\r\n/**\r\n * Contains the search parameters, serialized as a query string.\r\n */\r\nformattedParameters: string, \r\n/**\r\n * Contains the whole search state.\r\n */\r\nstate: SearchParameters, \r\n/**\r\n * The last received results.\r\n */\r\nresults: SearchResults) => void;\r\n\r\ndeclare type AnswersConnector = Connector<AnswersWidgetDescription, AnswersConnectorParams>;\r\n\r\ndeclare type AnswersConnectorParams = {\r\n    /**\r\n     * Attributes to use for predictions.\r\n     * If empty, we use all `searchableAttributes` to find answers.\r\n     * All your `attributesForPrediction` must be part of your `searchableAttributes`.\r\n     */\r\n    attributesForPrediction?: string[];\r\n    /**\r\n     * The languages in the query. Currently only supports `en`.\r\n     */\r\n    queryLanguages: ['en'];\r\n    /**\r\n     * Maximum number of answers to retrieve from the Answers Engine.\r\n     * Cannot be greater than 1000.\r\n     * @default 1\r\n     */\r\n    nbHits?: number;\r\n    /**\r\n     * Debounce time in milliseconds to debounce render\r\n     * @default 100\r\n     */\r\n    renderDebounceTime?: number;\r\n    /**\r\n     * Debounce time in milliseconds to debounce search\r\n     * @default 100\r\n     */\r\n    searchDebounceTime?: number;\r\n    /**\r\n     * Whether to escape HTML tags from hits string values.\r\n     *\r\n     * @default true\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Extra parameters to pass to findAnswers method.\r\n     * @default {}\r\n     */\r\n    extraParameters?: FindAnswersOptions;\r\n};\r\n\r\ndeclare type AnswersCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element of the widget.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the wrapping element when no results.\r\n     */\r\n    emptyRoot: string | string[];\r\n    /**\r\n     * CSS classes to add to the header.\r\n     */\r\n    header: string | string[];\r\n    /**\r\n     * CSS classes to add to the loader.\r\n     */\r\n    loader: string | string[];\r\n    /**\r\n     * CSS class to add to the list of results.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to each result.\r\n     */\r\n    item: string | string[];\r\n}>;\r\n\r\ndeclare type AnswersRenderState = {\r\n    /**\r\n     * The matched hits from Algolia API.\r\n     */\r\n    hits: Hit[];\r\n    /**\r\n     * Whether it's still loading the results from the Answers API.\r\n     */\r\n    isLoading: boolean;\r\n};\r\n\r\ndeclare type AnswersTemplates = Partial<{\r\n    /**\r\n     * Template to use for the header. This template will receive an object containing `hits` and `isLoading`.\r\n     */\r\n    header: Template<{\r\n        hits: Hit[];\r\n        isLoading: boolean;\r\n    }>;\r\n    /**\r\n     * Template to use for the loader.\r\n     */\r\n    loader: Template;\r\n    /**\r\n     * Template to use for each result. This template will receive an object containing a single record.\r\n     */\r\n    item: Template<Hit>;\r\n}>;\r\n\r\ndeclare type AnswersWidget = WidgetFactory<AnswersWidgetDescription & {\r\n    $$widgetType: 'ais.answers';\r\n}, AnswersConnectorParams, AnswersWidgetParams>;\r\n\r\ndeclare type AnswersWidgetDescription = {\r\n    $$type: 'ais.answers';\r\n    renderState: AnswersRenderState;\r\n    indexRenderState: {\r\n        answers: WidgetRenderState<AnswersRenderState, AnswersConnectorParams>;\r\n    };\r\n};\r\n\r\ndeclare type AnswersWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * The templates to use for the widget.\r\n     */\r\n    templates?: AnswersTemplates;\r\n    /**\r\n     * The CSS classes to override.\r\n     */\r\n    cssClasses?: AnswersCSSClasses;\r\n};\r\n\r\ndeclare type AnyWidgetFactory = WidgetFactory<{\r\n    $$type: string;\r\n}, Record<string, any>, any>;\r\n\r\ndeclare type AtLeastOne<TTarget, TMapped = {\r\n    [Key in keyof TTarget]: Pick<TTarget, Key>;\r\n}> = Partial<TTarget> & TMapped[keyof TMapped];\r\n\r\ndeclare type AugmentedWidget<TWidgetFactory extends AnyWidgetFactory, TOverriddenKeys extends keyof Widget = 'init' | 'render' | 'dispose'> = Omit<ReturnType<TWidgetFactory>, TOverriddenKeys | 'dependsOn' | 'getWidgetParameters'> & Pick<Required<Widget>, TOverriddenKeys>;\r\n\r\ndeclare type AutocompleteConnector = Connector<AutocompleteWidgetDescription, AutocompleteConnectorParams>;\r\n\r\ndeclare type AutocompleteConnectorParams = {\r\n    /**\r\n     * Escapes HTML entities from hits string values.\r\n     *\r\n     * @default `true`\r\n     */\r\n    escapeHTML?: boolean;\r\n};\r\n\r\ndeclare type AutocompleteRenderState = {\r\n    /**\r\n     * The current value of the query.\r\n     */\r\n    currentRefinement: string;\r\n    /**\r\n     * The indices this widget has access to.\r\n     */\r\n    indices: Array<{\r\n        /**\r\n         * The name of the index\r\n         */\r\n        indexName: string;\r\n        /**\r\n         * The id of the index\r\n         */\r\n        indexId: string;\r\n        /**\r\n         * The resolved hits from the index matching the query.\r\n         */\r\n        hits: Hit[];\r\n        /**\r\n         * The full results object from the Algolia API.\r\n         */\r\n        results: SearchResults;\r\n        /**\r\n         * Send event to insights middleware\r\n         */\r\n        sendEvent: SendEventForHits;\r\n    }>;\r\n    /**\r\n     * Searches into the indices with the provided query.\r\n     */\r\n    refine: (query: string) => void;\r\n};\r\n\r\ndeclare type AutocompleteWidgetDescription = {\r\n    $$type: 'ais.autocomplete';\r\n    renderState: AutocompleteRenderState;\r\n    indexRenderState: {\r\n        autocomplete: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        query: string;\r\n    };\r\n};\r\n\r\ndeclare type BaseHit = Record<string, any>;\r\n\r\ndeclare type BindEventForHits = BuiltInBindEventForHits & CustomBindEventForHits;\r\n\r\ndeclare type Bounds = {\r\n    /**\r\n     * The top right corner of the map view.\r\n     */\r\n    northEast: GeoLoc;\r\n    /**\r\n     * The bottom left corner of the map view.\r\n     */\r\n    southWest: GeoLoc;\r\n};\r\n\r\ndeclare const breadcrumb: BreadcrumbWidget;\r\n\r\ndeclare type BreadcrumbConnector = Connector<BreadcrumbWidgetDescription, BreadcrumbConnectorParams>;\r\n\r\ndeclare type BreadcrumbConnectorParams = {\r\n    /**\r\n     * Attributes to use to generate the hierarchy of the breadcrumb.\r\n     */\r\n    attributes: string[];\r\n    /**\r\n     * Prefix path to use if the first level is not the root level.\r\n     */\r\n    rootPath?: string;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<BreadcrumbConnectorParamsItem>;\r\n    /**\r\n     * The level separator used in the records.\r\n     *\r\n     * @default '>'\r\n     */\r\n    separator?: string;\r\n};\r\n\r\ndeclare type BreadcrumbConnectorParamsItem = {\r\n    /**\r\n     * Label of the category or subcategory.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Value of breadcrumb item.\r\n     */\r\n    value: string | null;\r\n};\r\n\r\ndeclare type BreadcrumbCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element of the widget.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element of the widget if there are no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to the items of the list. The items contains the link and the separator.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add to the selected item in the list: the last one or the home if there are no refinements.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS class to add to the separator.\r\n     */\r\n    separator: string | string[];\r\n    /**\r\n     * CSS class to add to the links in the items.\r\n     */\r\n    link: string | string[];\r\n}>;\r\n\r\ndeclare type BreadcrumbRenderState = {\r\n    /**\r\n     * Creates the URL for a single item name in the list.\r\n     */\r\n    createURL: CreateURL<BreadcrumbConnectorParamsItem['value']>;\r\n    /**\r\n     * Array of objects defining the different values and labels.\r\n     */\r\n    items: BreadcrumbConnectorParamsItem[];\r\n    /**\r\n     * Sets the path of the hierarchical filter and triggers a new search.\r\n     */\r\n    refine: (value: BreadcrumbConnectorParamsItem['value']) => void;\r\n    /**\r\n     * True if refinement can be applied.\r\n     */\r\n    canRefine: boolean;\r\n};\r\n\r\ndeclare type BreadcrumbTemplates = Partial<{\r\n    /**\r\n     * Label of the breadcrumb's first element.\r\n     */\r\n    home: Template;\r\n    /**\r\n     * Symbol used to separate the elements of the breadcrumb.\r\n     */\r\n    separator: Template;\r\n}>;\r\n\r\ndeclare type BreadcrumbWidget = WidgetFactory<BreadcrumbWidgetDescription & {\r\n    $$widgetType: 'ais.breadcrumb';\r\n}, BreadcrumbConnectorParams, BreadcrumbWidgetParams>;\r\n\r\ndeclare type BreadcrumbWidgetDescription = {\r\n    $$type: 'ais.breadcrumb';\r\n    renderState: BreadcrumbRenderState;\r\n    indexRenderState: {\r\n        breadcrumb: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type BreadcrumbWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: BreadcrumbTemplates;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: BreadcrumbCSSClasses;\r\n};\r\n\r\ndeclare class BrowserHistory<TRouteState> implements Router<TRouteState> {\r\n    $$type: string;\r\n    /**\r\n     * Transforms a UI state into a title for the page.\r\n     */\r\n    private readonly windowTitle?;\r\n    /**\r\n     * Time in milliseconds before performing a write in the history.\r\n     * It prevents from adding too many entries in the history and\r\n     * makes the back button more usable.\r\n     *\r\n     * @default 400\r\n     */\r\n    private readonly writeDelay;\r\n    /**\r\n     * Creates a full URL based on the route state.\r\n     * The storage adaptor maps all syncable keys to the query string of the URL.\r\n     */\r\n    private readonly _createURL;\r\n    /**\r\n     * Parses the URL into a route state.\r\n     * It should be symmetrical to `createURL`.\r\n     */\r\n    private readonly parseURL;\r\n    /**\r\n     * Returns the location to store in the history.\r\n     * @default () => window.location\r\n     */\r\n    private readonly getLocation;\r\n    private writeTimer?;\r\n    private _onPopState?;\r\n    /**\r\n     * Indicates if last action was back/forward in the browser.\r\n     */\r\n    private inPopState;\r\n    /**\r\n     * Indicates whether the history router is disposed or not.\r\n     */\r\n    protected isDisposed: boolean;\r\n    /**\r\n     * Indicates the window.history.length before the last call to\r\n     * window.history.pushState (called in `write`).\r\n     * It allows to determine if a `pushState` has been triggered elsewhere,\r\n     * and thus to prevent the `write` method from calling `pushState`.\r\n     */\r\n    private latestAcknowledgedHistory;\r\n    private _start?;\r\n    private _dispose?;\r\n    private _push?;\r\n    private _cleanUrlOnDispose;\r\n    /**\r\n     * Initializes a new storage provider that syncs the search state to the URL\r\n     * using web APIs (`window.location.pushState` and `onpopstate` event).\r\n     */\r\n    constructor({ windowTitle, writeDelay, createURL, parseURL, getLocation, start, dispose, push, cleanUrlOnDispose, }: BrowserHistoryArgs<TRouteState>);\r\n    /**\r\n     * Reads the URL and returns a syncable UI search state.\r\n     */\r\n    read(): TRouteState;\r\n    /**\r\n     * Pushes a search state into the URL.\r\n     */\r\n    write(routeState: TRouteState): void;\r\n    /**\r\n     * Sets a callback on the `onpopstate` event of the history API of the current page.\r\n     * It enables the URL sync to keep track of the changes.\r\n     */\r\n    onUpdate(callback: (routeState: TRouteState) => void): void;\r\n    /**\r\n     * Creates a complete URL from a given syncable UI state.\r\n     *\r\n     * It always generates the full URL, not a relative one.\r\n     * This allows to handle cases like using a <base href>.\r\n     * See: https://github.com/algolia/instantsearch/issues/790\r\n     */\r\n    createURL(routeState: TRouteState): string;\r\n    /**\r\n     * Removes the event listener and cleans up the URL.\r\n     */\r\n    dispose(): void;\r\n    start(): void;\r\n    private shouldWrite;\r\n}\r\n\r\ndeclare type BrowserHistoryArgs<TRouteState> = {\r\n    windowTitle?: (routeState: TRouteState) => string;\r\n    writeDelay: number;\r\n    createURL: CreateURL_2<TRouteState>;\r\n    parseURL: ParseURL<TRouteState>;\r\n    getLocation: () => Location;\r\n    start?: (onUpdate: () => void) => void;\r\n    dispose?: () => void;\r\n    push?: (url: string) => void;\r\n    /**\r\n     * Whether the URL should be cleaned up when the router is disposed.\r\n     * This can be useful when closing a modal containing InstantSearch, to\r\n     * remove active refinements from the URL.\r\n     * @default true\r\n     */\r\n    cleanUrlOnDispose?: boolean;\r\n};\r\n\r\ndeclare type BuiltInBindEventForHits = (eventType: string, hits: Hit | Hit[], eventName?: string, additionalData?: Record<string, any>) => string;\r\n\r\ndeclare type BuiltInSendEventForFacet = (eventType: string, facetValue: string, eventName?: string, additionalData?: Record<string, any>) => void;\r\n\r\ndeclare type BuiltInSendEventForHits = (eventType: string, hits: Hit | Hit[], eventName?: string, additionalData?: Record<string, any>) => void;\r\n\r\ndeclare type BuiltInSendEventForToggle = (eventType: string, isRefined: boolean, eventName?: string) => void;\r\n\r\ndeclare function carousel<TObject extends Record<string, unknown>>({ cssClasses, templates, }?: CreateCarouselTemplateProps<TObject>): ({ items, templates: widgetTemplates, cssClasses: widgetCssClasses, sendEvent, }: CarouselTemplateProps<TObject>) => h.JSX.Element;\r\n\r\ndeclare type CarouselTemplateProps<TObject extends Record<string, unknown>> = Pick<CarouselProps<TObject>, 'items'> & {\r\n    templates: {\r\n        item?: CarouselProps<TObject>['itemComponent'];\r\n    };\r\n    cssClasses?: Partial<CarouselProps<TObject>['classNames']>;\r\n} & {\r\n    sendEvent?: CarouselProps<TObject>['sendEvent'];\r\n};\r\n\r\ndeclare const clearRefinements: ClearRefinementsWidget;\r\n\r\ndeclare type ClearRefinementsConnector = Connector<ClearRefinementsWidgetDescription, ClearRefinementsConnectorParams>;\r\n\r\ndeclare type ClearRefinementsConnectorParams = {\r\n    /**\r\n     * The attributes to include in the refinements to clear (all by default). Cannot be used with `excludedAttributes`.\r\n     */\r\n    includedAttributes?: string[];\r\n    /**\r\n     * The attributes to exclude from the refinements to clear. Cannot be used with `includedAttributes`.\r\n     */\r\n    excludedAttributes?: string[];\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<string>;\r\n};\r\n\r\ndeclare type ClearRefinementsCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the wrapper element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the button of the widget.\r\n     */\r\n    button: string | string[];\r\n    /**\r\n     * CSS class to add to the button when there are no refinements.\r\n     */\r\n    disabledButton: string | string[];\r\n}>;\r\n\r\ndeclare type ClearRefinementsRenderState = {\r\n    /**\r\n     * Triggers the clear of all the currently refined values.\r\n     */\r\n    refine: () => void;\r\n    /**\r\n     * Indicates if search state is refined.\r\n     * @deprecated prefer reading canRefine\r\n     */\r\n    hasRefinements: boolean;\r\n    /**\r\n     * Indicates if search state can be refined.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Creates a url for the next state when refinements are cleared.\r\n     */\r\n    createURL: CreateURL<void>;\r\n};\r\n\r\ndeclare type ClearRefinementsTemplates = Partial<{\r\n    /**\r\n     * Template for the content of the button\r\n     */\r\n    resetLabel: Template<{\r\n        hasRefinements: boolean;\r\n    }>;\r\n}>;\r\n\r\ndeclare type ClearRefinementsWidget = WidgetFactory<ClearRefinementsWidgetDescription & {\r\n    $$widgetType: 'ais.clearRefinements';\r\n}, ClearRefinementsConnectorParams, ClearRefinementsWidgetParams>;\r\n\r\ndeclare type ClearRefinementsWidgetDescription = {\r\n    $$type: 'ais.clearRefinements';\r\n    renderState: ClearRefinementsRenderState;\r\n    indexRenderState: {\r\n        clearRefinements: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams>;\r\n    };\r\n};\r\n\r\ndeclare type ClearRefinementsWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: ClearRefinementsTemplates;\r\n    /**\r\n     * CSS classes to be added.\r\n     */\r\n    cssClasses?: ClearRefinementsCSSClasses;\r\n};\r\n\r\ndeclare type ComponentCSSClasses<TCSSClasses> = Required<{\r\n    [className in keyof TCSSClasses]: string;\r\n}>;\r\n\r\ndeclare const configure: ConfigureWidget;\r\n\r\ndeclare type ConfigureConnector = Connector<ConfigureWidgetDescription, ConfigureConnectorParams>;\r\n\r\ndeclare type ConfigureConnectorParams = {\r\n    /**\r\n     * A list of [search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/)\r\n     * to enable when the widget mounts.\r\n     */\r\n    searchParameters: PlainSearchParameters;\r\n};\r\n\r\ndeclare type ConfigureRelatedItemsConnector = Connector<ConfigureRelatedItemsWidgetDescription, ConfigureRelatedItemsConnectorParams>;\r\n\r\ndeclare type ConfigureRelatedItemsConnectorParams = {\r\n    /**\r\n     * The reference hit to extract the filters from.\r\n     */\r\n    hit: AlgoliaHit;\r\n    /**\r\n     * The schema to create the optional filters.\r\n     * Each key represents an attribute from the hit.\r\n     */\r\n    matchingPatterns: MatchingPatterns;\r\n    /**\r\n     * Function to transform the generated search parameters.\r\n     */\r\n    transformSearchParameters?: TransformSearchParameters;\r\n};\r\n\r\ndeclare type ConfigureRelatedItemsWidget = WidgetFactory<ConfigureRelatedItemsWidgetDescription & {\r\n    $$widgetType: 'ais.configureRelatedItems';\r\n}, ConfigureRelatedItemsConnectorParams, ConfigureRelatedItemsWidgetParams>;\r\n\r\ndeclare type ConfigureRelatedItemsWidgetDescription = {\r\n    $$type: 'ais.configureRelatedItems';\r\n} & Omit<ConfigureWidgetDescription, '$$type'>;\r\n\r\ndeclare type ConfigureRelatedItemsWidgetParams = PlainSearchParameters;\r\n\r\ndeclare type ConfigureRenderState = {\r\n    /**\r\n     * Refine the given search parameters.\r\n     */\r\n    refine: Refine;\r\n};\r\n\r\ndeclare type ConfigureWidget = (widgetParams: ConfigureWidgetParams) => Widget<ConfigureWidgetDescription & {\r\n    $$widgetType: 'ais.configure';\r\n    widgetParams: ConfigureConnectorParams;\r\n}>;\r\n\r\ndeclare type ConfigureWidgetDescription = {\r\n    $$type: 'ais.configure';\r\n    renderState: ConfigureRenderState;\r\n    indexRenderState: {\r\n        configure: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        configure: PlainSearchParameters;\r\n    };\r\n};\r\n\r\n/**\r\n * A list of [search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/)\r\n * to enable when the widget mounts.\r\n */\r\ndeclare type ConfigureWidgetParams = ConfigureConnectorParams['searchParameters'];\r\n\r\ndeclare const connectAutocomplete: AutocompleteConnector;\r\n\r\ndeclare const connectBreadcrumb: BreadcrumbConnector;\r\n\r\ndeclare const connectClearRefinements: ClearRefinementsConnector;\r\n\r\ndeclare const connectConfigure: ConfigureConnector;\r\n\r\ndeclare const connectCurrentRefinements: CurrentRefinementsConnector;\r\n\r\ndeclare const connectDynamicWidgets: DynamicWidgetsConnector;\r\n\r\n/**\r\n * **HierarchicalMenu** connector provides the logic to build a custom widget\r\n * that will give the user the ability to explore facets in a tree-like structure.\r\n *\r\n * This is commonly used for multi-level categorization of products on e-commerce\r\n * websites. From a UX point of view, we suggest not displaying more than two\r\n * levels deep.\r\n *\r\n * @type {Connector}\r\n * @param {function(HierarchicalMenuRenderingOptions, boolean)} renderFn Rendering function for the custom **HierarchicalMenu** widget.\r\n * @param {function} unmountFn Unmount function called when the widget is disposed.\r\n * @return {function(CustomHierarchicalMenuWidgetParams)} Re-usable widget factory for a custom **HierarchicalMenu** widget.\r\n */\r\ndeclare const connectHierarchicalMenu: HierarchicalMenuConnector;\r\n\r\ndeclare const connectHitsPerPage: HitsPerPageConnector;\r\n\r\ndeclare const connectHitsWithInsights: <TWidgetParams>(renderFn: Renderer<HitsRenderState, TWidgetParams & HitsConnectorParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & HitsConnectorParams<THit>) => {\r\n    $$type: \"ais.hits\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & HitsWidgetDescription[\"indexRenderState\"];\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions): {\r\n        hits: never[];\r\n        items: never[];\r\n        results: undefined;\r\n        banner: undefined;\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        widgetParams: TWidgetParams & HitsConnectorParams<THit>;\r\n    } | {\r\n        hits: Hit<BaseHit>[] | Hit<THit>[];\r\n        items: Hit<BaseHit>[] | Hit<THit>[];\r\n        results: SearchResults<any>;\r\n        banner: Banner | undefined;\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        widgetParams: TWidgetParams & HitsConnectorParams<THit>;\r\n    };\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetSearchParameters(state: SearchParameters, _uiState: {\r\n        uiState: {\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            page?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare const connectInfiniteHitsWithInsights: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<InfiniteHitsRenderState, TWidgetParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & InfiniteHitsConnectorParams<THit>) => {\r\n    $$type: \"ais.infiniteHits\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & InfiniteHitsWidgetDescription[\"indexRenderState\"];\r\n    getWidgetRenderState({ results, helper, parent, state: existingState, instantSearchInstance, }: InitOptions | RenderOptions): {\r\n        hits: Hit<THit>[];\r\n        items: Hit<THit>[];\r\n        currentPageHits: Hit<THit>[];\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        banner: Banner | undefined;\r\n        results: SearchResults<any> | undefined;\r\n        showPrevious: () => void;\r\n        showMore: () => void;\r\n        isFirstPage: boolean;\r\n        isLastPage: boolean;\r\n        widgetParams: TWidgetParams & InfiniteHitsConnectorParams<THit>;\r\n    };\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetUiState(uiState: {\r\n        page?: number | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    }, { searchParameters }: {\r\n        searchParameters: SearchParameters;\r\n        helper: AlgoliaSearchHelper;\r\n    }): {\r\n        page?: number | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    };\r\n    getWidgetSearchParameters(searchParameters: SearchParameters, { uiState }: {\r\n        uiState: {\r\n            page?: number | undefined;\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\n/**\r\n * **Menu** connector provides the logic to build a widget that will give the user the ability to choose a single value for a specific facet. The typical usage of menu is for navigation in categories.\r\n *\r\n * This connector provides a `toggleShowMore()` function to display more or less items and a `refine()`\r\n * function to select an item. While selecting a new element, the `refine` will also unselect the\r\n * one that is currently selected.\r\n *\r\n * **Requirement:** the attribute passed as `attribute` must be present in \"attributes for faceting\" on the Algolia dashboard or configured as attributesForFaceting via a set settings call to the Algolia API.\r\n */\r\ndeclare const connectMenu: MenuConnector;\r\n\r\ndeclare const connectNumericMenu: NumericMenuConnector;\r\n\r\n/**\r\n * The connector handles the business logic and exposes\r\n * a simplified API to the rendering function.\r\n */\r\ndeclare type Connector<TWidgetDescription extends WidgetDescription, TConnectorParams extends UnknownWidgetParams> = <TWidgetParams extends UnknownWidgetParams>(\r\n/**\r\n * The render function.\r\n */\r\nrenderFn: Renderer<TWidgetDescription['renderState'], TConnectorParams & TWidgetParams>, \r\n/**\r\n * The called function when unmounting a widget.\r\n */\r\nunmountFn?: Unmounter) => (widgetParams: TConnectorParams & TWidgetParams) => Widget<TWidgetDescription & {\r\n    widgetParams: typeof widgetParams;\r\n}>;\r\n\r\ndeclare type ConnectorRenderStates = AnswersWidgetDescription['indexRenderState'] & AutocompleteWidgetDescription['indexRenderState'] & BreadcrumbWidgetDescription['indexRenderState'] & ClearRefinementsWidgetDescription['indexRenderState'] & ConfigureWidgetDescription['indexRenderState'] & CurrentRefinementsWidgetDescription['indexRenderState'] & GeoSearchWidgetDescription['indexRenderState'] & HierarchicalMenuWidgetDescription['indexRenderState'] & HitsWidgetDescription['indexRenderState'] & HitsPerPageWidgetDescription['indexRenderState'] & InfiniteHitsWidgetDescription['indexRenderState'] & MenuWidgetDescription['indexRenderState'] & NumericMenuWidgetDescription['indexRenderState'] & PaginationWidgetDescription['indexRenderState'] & PoweredByWidgetDescription['indexRenderState'] & QueryRulesWidgetDescription['indexRenderState'] & RangeWidgetDescription['indexRenderState'] & RatingMenuWidgetDescription['indexRenderState'] & RefinementListWidgetDescription['indexRenderState'] & RelevantSortWidgetDescription['indexRenderState'] & SearchBoxWidgetDescription['indexRenderState'] & SortByWidgetDescription['indexRenderState'] & StatsWidgetDescription['indexRenderState'] & ToggleRefinementWidgetDescription['indexRenderState'] & VoiceSearchWidgetDescription['indexRenderState'];\r\n\r\ndeclare namespace connectors {\r\n    export {\r\n        EXPERIMENTAL_connectAnswers,\r\n        EXPERIMENTAL_connectConfigureRelatedItems,\r\n        EXPERIMENTAL_connectDynamicWidgets,\r\n        connectDynamicWidgets,\r\n        connectClearRefinements,\r\n        connectCurrentRefinements,\r\n        connectHierarchicalMenu,\r\n        _default as connectHits,\r\n        connectHitsWithInsights,\r\n        connectHitsPerPage,\r\n        _default_2 as connectInfiniteHits,\r\n        connectInfiniteHitsWithInsights,\r\n        connectMenu,\r\n        connectNumericMenu,\r\n        connectPagination,\r\n        connectRange,\r\n        connectRefinementList,\r\n        _default_3 as connectRelatedProducts,\r\n        connectSearchBox,\r\n        connectSortBy,\r\n        connectRatingMenu,\r\n        connectStats,\r\n        connectToggleRefinement,\r\n        _default_4 as connectTrendingItems,\r\n        connectBreadcrumb,\r\n        _default_5 as connectGeoSearch,\r\n        connectPoweredBy,\r\n        connectConfigure,\r\n        connectAutocomplete,\r\n        connectQueryRules,\r\n        connectVoiceSearch,\r\n        connectRelevantSort,\r\n        _default_6 as connectFrequentlyBoughtTogether,\r\n        _default_7 as connectLookingSimilar\r\n    }\r\n}\r\n\r\ndeclare type ConnectorUiStates = AutocompleteWidgetDescription['indexUiState'] & ConfigureWidgetDescription['indexUiState'] & GeoSearchWidgetDescription['indexUiState'] & HierarchicalMenuWidgetDescription['indexUiState'] & HitsPerPageWidgetDescription['indexUiState'] & InfiniteHitsWidgetDescription['indexUiState'] & MenuWidgetDescription['indexUiState'] & NumericMenuWidgetDescription['indexUiState'] & PaginationWidgetDescription['indexUiState'] & RangeWidgetDescription['indexUiState'] & RatingMenuWidgetDescription['indexUiState'] & RefinementListWidgetDescription['indexUiState'] & RelevantSortWidgetDescription['indexUiState'] & SearchBoxWidgetDescription['indexUiState'] & SortByWidgetDescription['indexUiState'] & ToggleRefinementWidgetDescription['indexUiState'] & VoiceSearchWidgetDescription['indexUiState'];\r\n\r\n/**\r\n * **Pagination** connector provides the logic to build a widget that will let the user\r\n * choose the current page of the results.\r\n *\r\n * When using the pagination with Algolia, you should be aware that the engine won't provide you pages\r\n * beyond the 1000th hits by default. You can find more information on the [Algolia documentation](https://www.algolia.com/doc/guides/searching/pagination/#pagination-limitations).\r\n */\r\ndeclare const connectPagination: PaginationConnector;\r\n\r\n/**\r\n * **PoweredBy** connector provides the logic to build a custom widget that will displays\r\n * the logo to redirect to Algolia.\r\n */\r\ndeclare const connectPoweredBy: PoweredByConnector;\r\n\r\ndeclare const connectQueryRules: QueryRulesConnector;\r\n\r\n/**\r\n * **Range** connector provides the logic to create custom widget that will let\r\n * the user refine results using a numeric range.\r\n *\r\n * This connectors provides a `refine()` function that accepts bounds. It will also provide\r\n * information about the min and max bounds for the current result set.\r\n */\r\ndeclare const connectRange: RangeConnector;\r\n\r\n/**\r\n * **StarRating** connector provides the logic to build a custom widget that will let\r\n * the user refine search results based on ratings.\r\n *\r\n * The connector provides to the rendering: `refine()` to select a value and\r\n * `items` that are the values that can be selected. `refine` should be used\r\n * with `items.value`.\r\n */\r\ndeclare const connectRatingMenu: RatingMenuConnector;\r\n\r\n/**\r\n * **RefinementList** connector provides the logic to build a custom widget that\r\n * will let the user filter the results based on the values of a specific facet.\r\n *\r\n * **Requirement:** the attribute passed as `attribute` must be present in\r\n * attributesForFaceting of the searched index.\r\n *\r\n * This connector provides:\r\n * - a `refine()` function to select an item.\r\n * - a `toggleShowMore()` function to display more or less items\r\n * - a `searchForItems()` function to search within the items.\r\n */\r\ndeclare const connectRefinementList: RefinementListConnector;\r\n\r\ndeclare const connectRelevantSort: RelevantSortConnector;\r\n\r\n/**\r\n * **SearchBox** connector provides the logic to build a widget that will let the user search for a query.\r\n *\r\n * The connector provides to the rendering: `refine()` to set the query. The behaviour of this function\r\n * may be impacted by the `queryHook` widget parameter.\r\n */\r\ndeclare const connectSearchBox: SearchBoxConnector;\r\n\r\ndeclare const connectSortBy: SortByConnector;\r\n\r\ndeclare const connectStats: StatsConnector;\r\n\r\n/**\r\n * **Toggle** connector provides the logic to build a custom widget that will provide\r\n * an on/off filtering feature based on an attribute value or values.\r\n *\r\n * Two modes are implemented in the custom widget:\r\n *  - with or without the value filtered\r\n *  - switch between two values.\r\n */\r\ndeclare const connectToggleRefinement: ToggleRefinementConnector;\r\n\r\ndeclare const connectVoiceSearch: VoiceSearchConnector;\r\n\r\ndeclare type CreateCarouselTemplateProps<TObject extends Record<string, unknown>> = {\r\n    templates?: Partial<{\r\n        previous: Exclude<Template_2, string>;\r\n        next: Exclude<Template_2, string>;\r\n    }>;\r\n    cssClasses?: Partial<CarouselProps<TObject>['classNames']>;\r\n};\r\n\r\ndeclare function createInfiniteHitsSessionStorageCache({ key, }?: {\r\n    /**\r\n     * If you display multiple instances of infiniteHits on the same page,\r\n     * you must provide a unique key for each instance.\r\n     */\r\n    key?: string;\r\n}): InfiniteHitsCache;\r\n\r\ndeclare type CreateInsightsMiddleware = typeof createInsightsMiddleware;\r\n\r\ndeclare function createInsightsMiddleware<TInsightsClient extends ProvidedInsightsClient>(props?: InsightsProps<TInsightsClient>): InternalMiddleware;\r\n\r\ndeclare type CreateMarker = (args: {\r\n    item: GeoHit;\r\n    map: google.maps.Map;\r\n}) => google.maps.OverlayView | google.maps.Marker;\r\n\r\n/**\r\n * Exposes the metadata of mounted widgets in a custom\r\n * `<meta name=\"instantsearch:widgets\" />` tag. The metadata per widget is:\r\n * - applied parameters\r\n * - widget name\r\n * - connector name\r\n */\r\ndeclare function createMetadataMiddleware({ $$internal, }?: {\r\n    $$internal?: boolean;\r\n}): InternalMiddleware;\r\n\r\ndeclare const createRouterMiddleware: <TUiState extends UiState = UiState, TRouteState = TUiState>(props?: RouterProps<TUiState, TRouteState>) => InternalMiddleware<TUiState>;\r\n\r\n/**\r\n * Creates the URL for the given value.\r\n */\r\ndeclare type CreateURL<TValue> = (value: TValue) => string;\r\n\r\ndeclare type CreateURL_2<TRouteState> = (args: {\r\n    qsModule: typeof qs_2;\r\n    routeState: TRouteState;\r\n    location: Location;\r\n}) => string;\r\n\r\ndeclare type CreateVoiceSearchHelper = (params: VoiceSearchHelperParams) => VoiceSearchHelper;\r\n\r\ndeclare const currentRefinements: CurrentRefinementsWidget;\r\n\r\ndeclare type CurrentRefinementsConnector = Connector<CurrentRefinementsWidgetDescription, CurrentRefinementsConnectorParams>;\r\n\r\ndeclare type CurrentRefinementsConnectorParams = {\r\n    /**\r\n     * The attributes to include in the widget (all by default).\r\n     * Cannot be used with `excludedAttributes`.\r\n     *\r\n     * @default `[]`\r\n     */\r\n    includedAttributes?: string[];\r\n    /**\r\n     * The attributes to exclude from the widget.\r\n     * Cannot be used with `includedAttributes`.\r\n     *\r\n     * @default `['query']`\r\n     */\r\n    excludedAttributes?: string[];\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<CurrentRefinementsConnectorParamsItem>;\r\n};\r\n\r\ndeclare type CurrentRefinementsConnectorParamsItem = {\r\n    /**\r\n     * The index name.\r\n     */\r\n    indexName: string;\r\n    /**\r\n     * The index id as provided to the index widget.\r\n     */\r\n    indexId: string;\r\n    /**\r\n     * The attribute on which the refinement is applied.\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * The textual representation of this attribute.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Currently applied refinements.\r\n     */\r\n    refinements: CurrentRefinementsConnectorParamsRefinement[];\r\n    /**\r\n     * Removes the given refinement and triggers a new search.\r\n     */\r\n    refine: (refinement: CurrentRefinementsConnectorParamsRefinement) => void;\r\n};\r\n\r\ndeclare type CurrentRefinementsConnectorParamsRefinement = {\r\n    /**\r\n     * The attribute on which the refinement is applied.\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * The type of the refinement.\r\n     */\r\n    type: 'facet' | 'exclude' | 'disjunctive' | 'hierarchical' | 'numeric' | 'query' | 'tag';\r\n    /**\r\n     * The raw value of the refinement.\r\n     */\r\n    value: string | number;\r\n    /**\r\n     * The label of the refinement to display.\r\n     */\r\n    label: string;\r\n    /**\r\n     * The value of the operator (only if applicable).\r\n     */\r\n    operator?: string;\r\n    /**\r\n     * The number of found items (only if applicable).\r\n     */\r\n    count?: number;\r\n    /**\r\n     * Whether the count is exhaustive (only if applicable).\r\n     */\r\n    exhaustive?: boolean;\r\n};\r\n\r\ndeclare type CurrentRefinementsCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to the each item element.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add to the label element.\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to the category element.\r\n     */\r\n    category: string | string[];\r\n    /**\r\n     * CSS class to add to the categoryLabel element.\r\n     */\r\n    categoryLabel: string | string[];\r\n    /**\r\n     * CSS class to add to the delete element.\r\n     */\r\n    delete: string | string[];\r\n}>;\r\n\r\ndeclare type CurrentRefinementsRenderState = {\r\n    /**\r\n     * All the currently refined items, grouped by attribute.\r\n     */\r\n    items: CurrentRefinementsConnectorParamsItem[];\r\n    /**\r\n     * Indicates if search state can be refined.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Removes the given refinement and triggers a new search.\r\n     */\r\n    refine: (refinement: CurrentRefinementsConnectorParamsRefinement) => void;\r\n    /**\r\n     * Generates a URL for the next state.\r\n     */\r\n    createURL: CreateURL<CurrentRefinementsConnectorParamsRefinement>;\r\n};\r\n\r\ndeclare type CurrentRefinementsWidget = WidgetFactory<CurrentRefinementsWidgetDescription & {\r\n    $$widgetType: 'ais.currentRefinements';\r\n}, CurrentRefinementsConnectorParams, CurrentRefinementsWidgetParams>;\r\n\r\ndeclare type CurrentRefinementsWidgetDescription = {\r\n    $$type: 'ais.currentRefinements';\r\n    renderState: CurrentRefinementsRenderState;\r\n    indexRenderState: {\r\n        currentRefinements: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams>;\r\n    };\r\n};\r\n\r\ndeclare type CurrentRefinementsWidgetParams = {\r\n    /**\r\n     * The CSS Selector or `HTMLElement` to insert the widget into.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * The CSS classes to override.\r\n     */\r\n    cssClasses?: CurrentRefinementsCSSClasses;\r\n};\r\n\r\ndeclare type CustomBindEventForHits = (customPayload: any) => string;\r\n\r\ndeclare type CustomSendEventForFacet = (customPayload: any) => void;\r\n\r\ndeclare type CustomSendEventForHits = (customPayload: any) => void;\r\n\r\ndeclare type CustomSendEventForToggle = (customPayload: any) => void;\r\n\r\ndeclare const _default: <TWidgetParams>(renderFn: Renderer<HitsRenderState, TWidgetParams & HitsConnectorParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & HitsConnectorParams<THit>) => {\r\n    $$type: \"ais.hits\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & HitsWidgetDescription[\"indexRenderState\"];\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions): {\r\n        hits: never[];\r\n        items: never[];\r\n        results: undefined;\r\n        banner: undefined;\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        widgetParams: TWidgetParams & HitsConnectorParams<THit>;\r\n    } | {\r\n        hits: Hit<BaseHit>[] | Hit<THit>[];\r\n        items: Hit<BaseHit>[] | Hit<THit>[];\r\n        results: SearchResults<any>;\r\n        banner: Banner | undefined;\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        widgetParams: TWidgetParams & HitsConnectorParams<THit>;\r\n    };\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetSearchParameters(state: SearchParameters, _uiState: {\r\n        uiState: {\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            page?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare const _default_10: <THit extends NonNullable<object> = BaseHit>(widgetParams: InfiniteHitsWidgetParams<THit> & InfiniteHitsConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.infiniteHits\";\r\n    $$type: \"ais.infiniteHits\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & InfiniteHitsWidgetDescription[\"indexRenderState\"];\r\n    getWidgetRenderState({ results, helper, parent, state: existingState, instantSearchInstance, }: InitOptions | RenderOptions): {\r\n        hits: Hit<THit>[];\r\n        items: Hit<THit>[];\r\n        currentPageHits: Hit<THit>[];\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        banner: Banner | undefined;\r\n        results: SearchResults<any> | undefined;\r\n        showPrevious: () => void;\r\n        showMore: () => void;\r\n        isFirstPage: boolean;\r\n        isLastPage: boolean;\r\n        widgetParams: Partial<InfiniteHitsWidgetParams<BaseHit>> & InfiniteHitsConnectorParams<THit>;\r\n    };\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetUiState(uiState: {\r\n        page?: number | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    }, { searchParameters }: {\r\n        searchParameters: SearchParameters;\r\n        helper: AlgoliaSearchHelper;\r\n    }): {\r\n        page?: number | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    };\r\n    getWidgetSearchParameters(searchParameters: SearchParameters, { uiState }: {\r\n        uiState: {\r\n            page?: number | undefined;\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare const _default_11: PlacesWidget;\r\n\r\ndeclare const _default_12: <THit extends NonNullable<object> = BaseHit>(widgetParams: RelatedProductsWidgetParams<THit> & RelatedProductsConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.relatedProducts\";\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.relatedProducts\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: Partial<{\r\n            answers: WidgetRenderState<AnswersRenderState, AnswersConnectorParams>;\r\n        } & {\r\n            autocomplete: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams>;\r\n        } & {\r\n            breadcrumb: {\r\n                [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n            };\r\n        } & {\r\n            clearRefinements: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams>;\r\n        } & {\r\n            configure: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams>;\r\n        } & {\r\n            currentRefinements: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams>;\r\n        } & {\r\n            geoSearch: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>>;\r\n        } & {\r\n            hierarchicalMenu: {\r\n                [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            hits: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            hitsPerPage: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams>;\r\n        } & {\r\n            infiniteHits: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            menu: {\r\n                [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n            };\r\n        } & {\r\n            numericMenu: {\r\n                [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            pagination: WidgetRenderState<PaginationRenderState, PaginationConnectorParams>;\r\n        } & {\r\n            poweredBy: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams>;\r\n        } & {\r\n            queryRules: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams>;\r\n        } & {\r\n            range: {\r\n                [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n            };\r\n        } & {\r\n            ratingMenu: {\r\n                [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            refinementList: {\r\n                [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n            };\r\n        } & {\r\n            relevantSort: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams>;\r\n        } & {\r\n            searchBox: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams>;\r\n        } & {\r\n            sortBy: WidgetRenderState<SortByRenderState, SortByConnectorParams>;\r\n        } & {\r\n            stats: WidgetRenderState<StatsRenderState, StatsConnectorParams>;\r\n        } & {\r\n            toggleRefinement: {\r\n                [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n            };\r\n        } & {\r\n            voiceSearch: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams>;\r\n        } & {\r\n            analytics: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams>;\r\n        } & {\r\n            places: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams>;\r\n        }>;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<BaseHit>[] | Hit<THit>[];\r\n        widgetParams: Partial<RelatedProductsWidgetParams<BaseHit>> & RelatedProductsConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\ndeclare const _default_13: <THit extends NonNullable<object> = BaseHit>(widgetParams: TrendingItemsWidgetParams<THit> & TrendingItemsConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.trendingItems\";\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.trendingItems\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: Partial<{\r\n            answers: WidgetRenderState<AnswersRenderState, AnswersConnectorParams>;\r\n        } & {\r\n            autocomplete: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams>;\r\n        } & {\r\n            breadcrumb: {\r\n                [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n            };\r\n        } & {\r\n            clearRefinements: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams>;\r\n        } & {\r\n            configure: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams>;\r\n        } & {\r\n            currentRefinements: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams>;\r\n        } & {\r\n            geoSearch: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>>;\r\n        } & {\r\n            hierarchicalMenu: {\r\n                [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            hits: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            hitsPerPage: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams>;\r\n        } & {\r\n            infiniteHits: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            menu: {\r\n                [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n            };\r\n        } & {\r\n            numericMenu: {\r\n                [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            pagination: WidgetRenderState<PaginationRenderState, PaginationConnectorParams>;\r\n        } & {\r\n            poweredBy: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams>;\r\n        } & {\r\n            queryRules: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams>;\r\n        } & {\r\n            range: {\r\n                [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n            };\r\n        } & {\r\n            ratingMenu: {\r\n                [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            refinementList: {\r\n                [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n            };\r\n        } & {\r\n            relevantSort: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams>;\r\n        } & {\r\n            searchBox: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams>;\r\n        } & {\r\n            sortBy: WidgetRenderState<SortByRenderState, SortByConnectorParams>;\r\n        } & {\r\n            stats: WidgetRenderState<StatsRenderState, StatsConnectorParams>;\r\n        } & {\r\n            toggleRefinement: {\r\n                [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n            };\r\n        } & {\r\n            voiceSearch: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams>;\r\n        } & {\r\n            analytics: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams>;\r\n        } & {\r\n            places: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams>;\r\n        }>;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<THit>[];\r\n        widgetParams: Partial<TrendingItemsWidgetParams<BaseHit>> & TrendingItemsConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\ndeclare const _default_14: <THit extends NonNullable<object> = BaseHit>(widgetParams: FrequentlyBoughtTogetherWidgetParams<THit> & FrequentlyBoughtTogetherConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.frequentlyBoughtTogether\";\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.frequentlyBoughtTogether\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: Partial<{\r\n            answers: WidgetRenderState<AnswersRenderState, AnswersConnectorParams>;\r\n        } & {\r\n            autocomplete: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams>;\r\n        } & {\r\n            breadcrumb: {\r\n                [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n            };\r\n        } & {\r\n            clearRefinements: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams>;\r\n        } & {\r\n            configure: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams>;\r\n        } & {\r\n            currentRefinements: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams>;\r\n        } & {\r\n            geoSearch: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>>;\r\n        } & {\r\n            hierarchicalMenu: {\r\n                [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            hits: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            hitsPerPage: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams>;\r\n        } & {\r\n            infiniteHits: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            menu: {\r\n                [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n            };\r\n        } & {\r\n            numericMenu: {\r\n                [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            pagination: WidgetRenderState<PaginationRenderState, PaginationConnectorParams>;\r\n        } & {\r\n            poweredBy: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams>;\r\n        } & {\r\n            queryRules: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams>;\r\n        } & {\r\n            range: {\r\n                [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n            };\r\n        } & {\r\n            ratingMenu: {\r\n                [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            refinementList: {\r\n                [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n            };\r\n        } & {\r\n            relevantSort: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams>;\r\n        } & {\r\n            searchBox: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams>;\r\n        } & {\r\n            sortBy: WidgetRenderState<SortByRenderState, SortByConnectorParams>;\r\n        } & {\r\n            stats: WidgetRenderState<StatsRenderState, StatsConnectorParams>;\r\n        } & {\r\n            toggleRefinement: {\r\n                [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n            };\r\n        } & {\r\n            voiceSearch: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams>;\r\n        } & {\r\n            analytics: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams>;\r\n        } & {\r\n            places: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams>;\r\n        }>;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<THit>[];\r\n        widgetParams: Partial<FrequentlyBoughtTogetherWidgetParams<BaseHit>> & FrequentlyBoughtTogetherConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\ndeclare const _default_15: <THit extends NonNullable<object> = BaseHit>(widgetParams: LookingSimilarWidgetParams<THit> & LookingSimilarConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.lookingSimilar\";\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.lookingSimilar\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: Partial<{\r\n            answers: WidgetRenderState<AnswersRenderState, AnswersConnectorParams>;\r\n        } & {\r\n            autocomplete: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams>;\r\n        } & {\r\n            breadcrumb: {\r\n                [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n            };\r\n        } & {\r\n            clearRefinements: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams>;\r\n        } & {\r\n            configure: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams>;\r\n        } & {\r\n            currentRefinements: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams>;\r\n        } & {\r\n            geoSearch: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>>;\r\n        } & {\r\n            hierarchicalMenu: {\r\n                [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            hits: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            hitsPerPage: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams>;\r\n        } & {\r\n            infiniteHits: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            menu: {\r\n                [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n            };\r\n        } & {\r\n            numericMenu: {\r\n                [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            pagination: WidgetRenderState<PaginationRenderState, PaginationConnectorParams>;\r\n        } & {\r\n            poweredBy: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams>;\r\n        } & {\r\n            queryRules: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams>;\r\n        } & {\r\n            range: {\r\n                [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n            };\r\n        } & {\r\n            ratingMenu: {\r\n                [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            refinementList: {\r\n                [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n            };\r\n        } & {\r\n            relevantSort: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams>;\r\n        } & {\r\n            searchBox: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams>;\r\n        } & {\r\n            sortBy: WidgetRenderState<SortByRenderState, SortByConnectorParams>;\r\n        } & {\r\n            stats: WidgetRenderState<StatsRenderState, StatsConnectorParams>;\r\n        } & {\r\n            toggleRefinement: {\r\n                [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n            };\r\n        } & {\r\n            voiceSearch: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams>;\r\n        } & {\r\n            analytics: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams>;\r\n        } & {\r\n            places: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams>;\r\n        }>;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<THit>[];\r\n        widgetParams: Partial<LookingSimilarWidgetParams<BaseHit>> & LookingSimilarConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\ndeclare const _default_2: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<InfiniteHitsRenderState, TWidgetParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & InfiniteHitsConnectorParams<THit>) => {\r\n    $$type: \"ais.infiniteHits\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & InfiniteHitsWidgetDescription[\"indexRenderState\"];\r\n    getWidgetRenderState({ results, helper, parent, state: existingState, instantSearchInstance, }: InitOptions | RenderOptions): {\r\n        hits: Hit<THit>[];\r\n        items: Hit<THit>[];\r\n        currentPageHits: Hit<THit>[];\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        banner: Banner | undefined;\r\n        results: SearchResults<any> | undefined;\r\n        showPrevious: () => void;\r\n        showMore: () => void;\r\n        isFirstPage: boolean;\r\n        isLastPage: boolean;\r\n        widgetParams: TWidgetParams & InfiniteHitsConnectorParams<THit>;\r\n    };\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetUiState(uiState: {\r\n        page?: number | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    }, { searchParameters }: {\r\n        searchParameters: SearchParameters;\r\n        helper: AlgoliaSearchHelper;\r\n    }): {\r\n        page?: number | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    };\r\n    getWidgetSearchParameters(searchParameters: SearchParameters, { uiState }: {\r\n        uiState: {\r\n            page?: number | undefined;\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare const _default_3: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<RelatedProductsRenderState, RelatedProductsConnectorParams & TWidgetParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & RelatedProductsConnectorParams<THit>) => {\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.relatedProducts\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: IndexRenderState;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<BaseHit>[] | Hit<THit>[];\r\n        widgetParams: TWidgetParams & RelatedProductsConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\ndeclare const _default_4: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<TrendingItemsRenderState, TWidgetParams & TrendingItemsConnectorParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & TrendingItemsConnectorParams<THit>) => {\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.trendingItems\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: IndexRenderState;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<THit>[];\r\n        widgetParams: TWidgetParams & TrendingItemsConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\n/**\r\n * The **GeoSearch** connector provides the logic to build a widget that will display the results on a map. It also provides a way to search for results based on their position. The connector provides functions to manage the search experience (search on map interaction or control the interaction for example).\r\n *\r\n * @requirements\r\n *\r\n * Note that the GeoSearch connector uses the [geosearch](https://www.algolia.com/doc/guides/searching/geo-search) capabilities of Algolia. Your hits **must** have a `_geoloc` attribute in order to be passed to the rendering function.\r\n *\r\n * Currently, the feature is not compatible with multiple values in the _geoloc attribute.\r\n */\r\ndeclare const _default_5: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<GeoSearchRenderState, TWidgetParams & GeoSearchConnectorParams>, unmountFn?: Unmounter) => <THit extends GeoHit = GeoHit>(widgetParams: TWidgetParams & GeoSearchConnectorParams<THit>) => {\r\n    $$type: \"ais.geoSearch\";\r\n    init(initArgs: InitOptions): void;\r\n    render(renderArgs: RenderOptions): void;\r\n    getWidgetRenderState(renderOptions: InitOptions | RenderOptions): {\r\n        items: GeoHit<THit>[];\r\n        position: {\r\n            lat: number;\r\n            lng: number;\r\n        } | undefined;\r\n        currentRefinement: {\r\n            northEast: {\r\n                lat: number;\r\n                lng: number;\r\n            };\r\n            southWest: {\r\n                lat: number;\r\n                lng: number;\r\n            };\r\n        } | undefined;\r\n        refine: ({ northEast: ne, southWest: sw }: Bounds) => void;\r\n        sendEvent: SendEventForHits;\r\n        clearMapRefinement: () => void;\r\n        isRefinedWithMap: () => boolean;\r\n        toggleRefineOnMapMove: () => void;\r\n        isRefineOnMapMove: () => boolean;\r\n        setMapMoveSinceLastRefine: () => void;\r\n        hasMapMoveSinceLastRefine: () => boolean;\r\n        widgetParams: TWidgetParams & GeoSearchConnectorParams<THit>;\r\n    };\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & GeoSearchWidgetDescription[\"indexRenderState\"];\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetUiState(uiState: {\r\n        geoSearch?: {\r\n            /**\r\n             * The rectangular area in geo coordinates.\r\n             * The rectangle is defined by two diagonally opposite points,\r\n             * hence by 4 floats separated by commas.\r\n             *\r\n             * @example '47.3165,4.9665,47.3424,5.0201'\r\n             */\r\n            boundingBox: string;\r\n        } | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        page?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    }, { searchParameters }: {\r\n        searchParameters: SearchParameters;\r\n        helper: AlgoliaSearchHelper;\r\n    }): {\r\n        geoSearch?: {\r\n            /**\r\n             * The rectangular area in geo coordinates.\r\n             * The rectangle is defined by two diagonally opposite points,\r\n             * hence by 4 floats separated by commas.\r\n             *\r\n             * @example '47.3165,4.9665,47.3424,5.0201'\r\n             */\r\n            boundingBox: string;\r\n        } | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        page?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    };\r\n    getWidgetSearchParameters(searchParameters: SearchParameters, { uiState }: {\r\n        uiState: {\r\n            geoSearch?: {\r\n                /**\r\n                 * The rectangular area in geo coordinates.\r\n                 * The rectangle is defined by two diagonally opposite points,\r\n                 * hence by 4 floats separated by commas.\r\n                 *\r\n                 * @example '47.3165,4.9665,47.3424,5.0201'\r\n                 */\r\n                boundingBox: string;\r\n            } | undefined;\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            page?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare const _default_6: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<FrequentlyBoughtTogetherRenderState, TWidgetParams & FrequentlyBoughtTogetherConnectorParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & FrequentlyBoughtTogetherConnectorParams<THit>) => {\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.frequentlyBoughtTogether\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: IndexRenderState;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<THit>[];\r\n        widgetParams: TWidgetParams & FrequentlyBoughtTogetherConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\ndeclare const _default_7: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<LookingSimilarRenderState, TWidgetParams & LookingSimilarConnectorParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & LookingSimilarConnectorParams<THit>) => {\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.lookingSimilar\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: IndexRenderState;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<THit>[];\r\n        widgetParams: TWidgetParams & LookingSimilarConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\n/**\r\n * The **GeoSearch** widget displays the list of results from the search on a Google Maps. It also provides a way to search for results based on their position. The widget also provide some of the common GeoSearch patterns like search on map interaction.\r\n *\r\n * @requirements\r\n *\r\n * Note that the GeoSearch widget uses the [geosearch](https://www.algolia.com/doc/guides/searching/geo-search) capabilities of Algolia. Your hits **must** have a `_geoloc` attribute in order to be displayed on the map.\r\n *\r\n * Currently, the feature is not compatible with multiple values in the _geoloc attribute.\r\n *\r\n * You are also responsible for loading the Google Maps library, it's not shipped with InstantSearch. You need to load the Google Maps library and pass a reference to the widget. You can find more information about how to install the library in [the Google Maps documentation](https://developers.google.com/maps/documentation/javascript/tutorial).\r\n *\r\n * Don't forget to explicitly set the `height` of the map container (default class `.ais-geo-search--map`), otherwise it won't be shown (it's a requirement of Google Maps).\r\n */\r\ndeclare const _default_8: <THit extends GeoHit = GeoHit>(widgetParams: GeoSearchWidgetParams<THit> & GeoSearchConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.geoSearch\";\r\n    $$type: \"ais.geoSearch\";\r\n    init(initArgs: InitOptions): void;\r\n    render(renderArgs: RenderOptions): void;\r\n    getWidgetRenderState(renderOptions: InitOptions | RenderOptions): {\r\n        items: GeoHit<THit>[];\r\n        position: {\r\n            lat: number;\r\n            lng: number;\r\n        } | undefined;\r\n        currentRefinement: {\r\n            northEast: {\r\n                lat: number;\r\n                lng: number;\r\n            };\r\n            southWest: {\r\n                lat: number;\r\n                lng: number;\r\n            };\r\n        } | undefined;\r\n        refine: ({ northEast: ne, southWest: sw }: {\r\n            northEast: GeoLoc;\r\n            southWest: GeoLoc;\r\n        }) => void;\r\n        sendEvent: SendEventForHits;\r\n        clearMapRefinement: () => void;\r\n        isRefinedWithMap: () => boolean;\r\n        toggleRefineOnMapMove: () => void;\r\n        isRefineOnMapMove: () => boolean;\r\n        setMapMoveSinceLastRefine: () => void;\r\n        hasMapMoveSinceLastRefine: () => boolean;\r\n        widgetParams: {\r\n            renderState: {\r\n                templateProps?: PreparedTemplateProps<GeoSearchTemplates>;\r\n                isUserInteraction?: boolean;\r\n                isPendingRefine?: boolean;\r\n                markers?: any[];\r\n            };\r\n            container: HTMLElement;\r\n            googleReference: GeoSearchWidgetParams[\"googleReference\"];\r\n            initialZoom: GeoSearchWidgetParams[\"initialZoom\"];\r\n            initialPosition: GeoSearchWidgetParams[\"initialPosition\"];\r\n            templates: Partial<{\r\n                /** Template to use for the marker. */\r\n                HTMLMarker: Template<GeoHit>;\r\n                /** Template for the reset button. */\r\n                reset: Template;\r\n                /** Template for the toggle label. */\r\n                toggle: Template;\r\n                /** Template for the redo button. */\r\n                redo: Template;\r\n            }>;\r\n            cssClasses: ComponentCSSClasses<Partial<{\r\n            /** The root div of the widget. */\r\n            root: string | string[];\r\n            /** The map container of the widget. */\r\n            map: string | string[];\r\n            /** The control element of the widget. */\r\n            control: string | string[];\r\n            /** The label of the control element. */\r\n            label: string | string[];\r\n            /** The selected label of the control element. */\r\n            selectedLabel: string | string[];\r\n            /** The input of the control element. */\r\n            input: string | string[];\r\n            /** The redo search button. */\r\n            redo: string | string[];\r\n            /** The disabled redo search button. */\r\n            disabledRedo: string | string[];\r\n            /** The reset refinement button. */\r\n            reset: string | string[];\r\n            }> | undefined>;\r\n            createMarker: CreateMarker;\r\n            markerOptions: GeoSearchMarker<google.maps.MarkerOptions | Partial<HTMLMarkerArguments>>;\r\n            enableRefine: GeoSearchWidgetParams[\"enableRefine\"];\r\n            enableClearMapRefinement: GeoSearchWidgetParams[\"enableClearMapRefinement\"];\r\n            enableRefineControl: GeoSearchWidgetParams[\"enableRefineControl\"];\r\n        } & GeoSearchConnectorParams<THit>;\r\n    };\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & GeoSearchWidgetDescription[\"indexRenderState\"];\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetUiState(uiState: {\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        page?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    }, { searchParameters }: {\r\n        searchParameters: SearchParameters;\r\n        helper: AlgoliaSearchHelper;\r\n    }): {\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        page?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    };\r\n    getWidgetSearchParameters(searchParameters: SearchParameters, { uiState }: {\r\n        uiState: {\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            page?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare const _default_9: <THit extends NonNullable<object> = BaseHit>(widgetParams: HitsWidgetParams<THit> & HitsConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.hits\";\r\n    $$type: \"ais.hits\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & HitsWidgetDescription[\"indexRenderState\"];\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions): {\r\n        hits: never[];\r\n        items: never[];\r\n        results: undefined;\r\n        banner: undefined;\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        widgetParams: Partial<HitsWidgetParams<BaseHit>> & HitsConnectorParams<THit>;\r\n    } | {\r\n        hits: Hit<BaseHit>[] | Hit<THit>[];\r\n        items: Hit<BaseHit>[] | Hit<THit>[];\r\n        results: SearchResults<any>;\r\n        banner: Banner | undefined;\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        widgetParams: Partial<HitsWidgetParams<BaseHit>> & HitsConnectorParams<THit>;\r\n    };\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetSearchParameters(state: SearchParameters, _uiState: {\r\n        uiState: {\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            page?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare type DisposeOptions = {\r\n    helper: AlgoliaSearchHelper;\r\n    state: SearchParameters;\r\n    recommendState: RecommendParameters;\r\n    parent: IndexWidget;\r\n};\r\n\r\ndeclare const dynamicWidgets: DynamicWidgetsWidget;\r\n\r\ndeclare type DynamicWidgetsConnector = Connector<DynamicWidgetsWidgetDescription, DynamicWidgetsConnectorParams>;\r\n\r\ndeclare type DynamicWidgetsConnectorParams = {\r\n    /**\r\n     * An array of widgets, displayed in the order defined by `facetOrdering`.\r\n     */\r\n    widgets: Widget[];\r\n    /**\r\n     * Function to return a fallback widget when an attribute isn't found in\r\n     * `widgets`.\r\n     */\r\n    fallbackWidget?: (args: {\r\n        /** The attribute name to create a widget for. */\r\n        attribute: string;\r\n    }) => Widget;\r\n    /**\r\n     * Function to transform the items to render.\r\n     * The function also exposes the full search response.\r\n     */\r\n    transformItems?: TransformItems<string, Omit<TransformItemsMetadata, 'results'> & {\r\n        results: NonNullable<TransformItemsMetadata['results']>;\r\n    }>;\r\n    /**\r\n     * To prevent unneeded extra network requests when widgets mount or unmount,\r\n     * we request all facet values by default. If you want to only request the\r\n     * facet values that are needed, you can set this option to the list of\r\n     * attributes you want to display.\r\n     *\r\n     * If `facets` is set to `['*']`, we request all facet values.\r\n     *\r\n     * Any facets that are requested due to the `facetOrdering` result are always\r\n     * requested by the widget that mounted itself.\r\n     *\r\n     * Setting `facets` to a value other than `['*']` will only prevent extra\r\n     * requests if all potential facets are listed.\r\n     *\r\n     * @default ['*']\r\n     */\r\n    facets?: ['*'] | string[];\r\n    /**\r\n     * If you have more than 20 facet values pinned, you need to increase the\r\n     * maxValuesPerFacet to at least that value.\r\n     *\r\n     * @default 20\r\n     */\r\n    maxValuesPerFacet?: number;\r\n};\r\n\r\ndeclare type DynamicWidgetsRenderState = {\r\n    attributesToRender: string[];\r\n};\r\n\r\ndeclare type DynamicWidgetsWidget = WidgetFactory<DynamicWidgetsWidgetDescription & {\r\n    $$widgetType: 'ais.dynamicWidgets';\r\n}, Omit<DynamicWidgetsConnectorParams, 'widgets' | 'fallbackWidget'>, DynamicWidgetsWidgetParams>;\r\n\r\ndeclare type DynamicWidgetsWidgetDescription = {\r\n    $$type: 'ais.dynamicWidgets';\r\n    renderState: DynamicWidgetsRenderState;\r\n    indexRenderState: {\r\n        dynamicWidgets: DynamicWidgetsRenderState;\r\n    };\r\n};\r\n\r\ndeclare type DynamicWidgetsWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * An array of widget creator functions, displayed in the order defined by\r\n     * `facetOrdering`.\r\n     */\r\n    widgets: Array<(container: HTMLElement) => Widget>;\r\n    /**\r\n     * Function to return a fallback widget when an attribute isn't found in\r\n     * `widgets`.\r\n     */\r\n    fallbackWidget?: (args: {\r\n        /** The attribute name to create a widget for. */\r\n        attribute: string;\r\n        /** CSS Selector or HTMLElement to insert the widget */\r\n        container: HTMLElement;\r\n    }) => Widget;\r\n};\r\n\r\ndeclare type Expand<T> = T extends infer O ? {\r\n    [K in keyof O]: O[K];\r\n} : never;\r\n\r\n/** @deprecated answers is no longer supported */\r\ndeclare const EXPERIMENTAL_answers: AnswersWidget;\r\n\r\n/** @deprecated use relatedItems instead */\r\ndeclare const EXPERIMENTAL_configureRelatedItems: ConfigureRelatedItemsWidget;\r\n\r\n/** @deprecated answers is no longer supported */\r\ndeclare const EXPERIMENTAL_connectAnswers: AnswersConnector;\r\n\r\n/** @deprecated use connectRelatedItems instead */\r\ndeclare const EXPERIMENTAL_connectConfigureRelatedItems: ConfigureRelatedItemsConnector;\r\n\r\n/** @deprecated use connectDynamicWidgets */\r\ndeclare const EXPERIMENTAL_connectDynamicWidgets: DynamicWidgetsConnector;\r\n\r\n/** @deprecated use dynamicWidgets */\r\ndeclare const EXPERIMENTAL_dynamicWidgets: DynamicWidgetsWidget;\r\n\r\ndeclare type FacetValue = string | boolean | number;\r\n\r\ndeclare type FrequentlyBoughtTogetherConnectorParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The objectIDs of the items to get the frequently bought together items for.\r\n     */\r\n    objectIDs: string[];\r\n    /**\r\n     * Threshold for the recommendations confidence score (between 0 and 100). Only recommendations with a greater score are returned.\r\n     */\r\n    threshold?: number;\r\n    /**\r\n     * The maximum number of recommendations to return.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * Parameters to pass to the request.\r\n     */\r\n    queryParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * Whether to escape HTML tags from items string values.\r\n     *\r\n     * @default true\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<Hit<THit>, {\r\n        results: RecommendResponse<AlgoliaHit<THit>>;\r\n    }>;\r\n};\r\n\r\ndeclare type FrequentlyBoughtTogetherCSSClasses = Partial<RecommendClassNames>;\r\n\r\ndeclare type FrequentlyBoughtTogetherRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The matched recommendations from Algolia API.\r\n     */\r\n    items: Array<Hit<THit>>;\r\n    /**\r\n     * Sends an event to the Insights middleware.\r\n     */\r\n    sendEvent: SendEventForHits;\r\n};\r\n\r\ndeclare type FrequentlyBoughtTogetherTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\r\n    /**\r\n     * Template to use when there are no results.\r\n     */\r\n    empty: Template<RecommendResponse<Hit<THit>>>;\r\n    /**\r\n     * Template to use for the header of the widget.\r\n     */\r\n    header: Template<Pick<Parameters<NonNullable<FrequentlyBoughtTogetherProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {\r\n        cssClasses: RecommendClassNames;\r\n    }>;\r\n    /**\r\n     * Template to use for each result. This template will receive an object containing a single record.\r\n     */\r\n    item: TemplateWithBindEvent<Hit<THit>>;\r\n    /**\r\n     * Template to use to wrap all items.\r\n     */\r\n    layout: Template<Pick<Parameters<NonNullable<FrequentlyBoughtTogetherProps<Hit<THit>>['layout']>>[0], 'items'> & {\r\n        templates: {\r\n            item: FrequentlyBoughtTogetherProps<Hit<THit>>['itemComponent'];\r\n        };\r\n        cssClasses: Pick<FrequentlyBoughtTogetherCSSClasses, 'list' | 'item'>;\r\n    }>;\r\n}>;\r\n\r\ndeclare type FrequentlyBoughtTogetherWidgetParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: FrequentlyBoughtTogetherTemplates<THit>;\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: FrequentlyBoughtTogetherCSSClasses;\r\n};\r\n\r\ndeclare type GeoHit<THit extends NonNullable<object> = BaseHit> = Hit<THit> & Required<Pick<Hit, '_geoloc'>>;\r\n\r\ndeclare type GeoLoc = {\r\n    lat: number;\r\n    lng: number;\r\n};\r\n\r\ndeclare type GeoSearchConnectorParams<THit extends GeoHit = GeoHit> = {\r\n    /**\r\n     * If true, refine will be triggered as you move the map.\r\n     * @default true\r\n     */\r\n    enableRefineOnMapMove?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     * @default items => items\r\n     */\r\n    transformItems?: TransformItems<GeoHit<THit>>;\r\n};\r\n\r\ndeclare type GeoSearchCSSClasses = Partial<{\r\n    /** The root div of the widget. */\r\n    root: string | string[];\r\n    /** The map container of the widget. */\r\n    map: string | string[];\r\n    /** The control element of the widget. */\r\n    control: string | string[];\r\n    /** The label of the control element. */\r\n    label: string | string[];\r\n    /** The selected label of the control element. */\r\n    selectedLabel: string | string[];\r\n    /** The input of the control element. */\r\n    input: string | string[];\r\n    /** The redo search button. */\r\n    redo: string | string[];\r\n    /** The disabled redo search button. */\r\n    disabledRedo: string | string[];\r\n    /** The reset refinement button. */\r\n    reset: string | string[];\r\n}>;\r\n\r\ndeclare type GeoSearchMarker<TOptions, THit extends GeoHit = GeoHit> = {\r\n    /**\r\n     * Function used to create the options passed to the Google Maps marker.\r\n     * See the documentation for more information:\r\n     * https://developers.google.com/maps/documentation/javascript/reference/3/#MarkerOptions\r\n     */\r\n    createOptions?: (item: THit) => TOptions;\r\n    /**\r\n     * Object that takes an event type (ex: `click`, `mouseover`) as key and a\r\n     * listener as value. The listener is provided with an object that contains:\r\n     * `event`, `item`, `marker`, `map`.\r\n     */\r\n    events: {\r\n        [key: string]: (event: {\r\n            item: any;\r\n            marker: any;\r\n            map: any;\r\n            event: any;\r\n        }) => void;\r\n    };\r\n};\r\n\r\ndeclare type GeoSearchRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * Reset the current bounding box refinement.\r\n     */\r\n    clearMapRefinement: () => void;\r\n    /**\r\n     * The current bounding box of the search.\r\n     */\r\n    currentRefinement?: Bounds;\r\n    /**\r\n     * Return true if the map has move since the last refinement.\r\n     */\r\n    hasMapMoveSinceLastRefine: () => boolean;\r\n    /**\r\n     * Return true if the current refinement is set with the map bounds.\r\n     */\r\n    isRefinedWithMap: () => boolean;\r\n    /**\r\n     * Return true if the user is able to refine on map move.\r\n     */\r\n    isRefineOnMapMove: () => boolean;\r\n    /**\r\n     * The matched hits from Algolia API.\r\n     */\r\n    items: Array<GeoHit<THit>>;\r\n    /**\r\n     * The current position of the search.\r\n     */\r\n    position?: GeoLoc;\r\n    /**\r\n     * Sets a bounding box to filter the results from the given map bounds.\r\n     */\r\n    refine: (bounds: Bounds) => void;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEventForHits;\r\n    /**\r\n     * Set the fact that the map has moved since the last refinement, should be\r\n     * called on each map move. The call to the function triggers a new rendering\r\n     * only when the value change.\r\n     */\r\n    setMapMoveSinceLastRefine: () => void;\r\n    /**\r\n     * Toggle the fact that the user is able to refine on map move.\r\n     */\r\n    toggleRefineOnMapMove: () => void;\r\n};\r\n\r\ndeclare type GeoSearchTemplates<THit extends GeoHit = GeoHit> = Partial<{\r\n    /** Template to use for the marker. */\r\n    HTMLMarker: Template<THit>;\r\n    /** Template for the reset button. */\r\n    reset: Template;\r\n    /** Template for the toggle label. */\r\n    toggle: Template;\r\n    /** Template for the redo button. */\r\n    redo: Template;\r\n}>;\r\n\r\ndeclare type GeoSearchWidgetDescription<THit extends GeoHit = GeoHit> = {\r\n    $$type: 'ais.geoSearch';\r\n    renderState: GeoSearchRenderState<THit>;\r\n    indexRenderState: {\r\n        geoSearch: WidgetRenderState<GeoSearchRenderState<THit>, GeoSearchConnectorParams<THit>>;\r\n    };\r\n    indexUiState: {\r\n        geoSearch: {\r\n            /**\r\n             * The rectangular area in geo coordinates.\r\n             * The rectangle is defined by two diagonally opposite points,\r\n             * hence by 4 floats separated by commas.\r\n             *\r\n             * @example '47.3165,4.9665,47.3424,5.0201'\r\n             */\r\n            boundingBox: string;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type GeoSearchWidgetParams<THit extends GeoHit = GeoHit> = {\r\n    /**\r\n     * By default the map will set the zoom accordingly to the markers displayed on it.\r\n     * When we refine it may happen that the results are empty. For those situations we\r\n     * need to provide a zoom to render the map.\r\n     * @default 1\r\n     */\r\n    initialZoom?: number;\r\n    /**\r\n     * By default the map will set the position accordingly to the markers displayed on it.\r\n     * When we refine it may happen that the results are empty. For those situations we need\r\n     * to provide a position to render the map. This option is ignored when the `position`\r\n     * is provided.\r\n     * @default { lat: 0, lng: 0 }\r\n     */\r\n    initialPosition?: GeoLoc;\r\n    /** Templates to use for the widget. */\r\n    templates?: GeoSearchTemplates<THit>;\r\n    /** CSS classes to add to the wrapping elements. */\r\n    cssClasses?: GeoSearchCSSClasses;\r\n    /**\r\n     * Options for customize the built-in Google Maps marker. This option is\r\n     * ignored when the `customHTMLMarker` is provided.\r\n     */\r\n    builtInMarker?: Partial<GeoSearchMarker<google.maps.MarkerOptions>>;\r\n    /**\r\n     * Options to customize the HTML marker. We provide an alternative to the\r\n     * built-in Google Maps marker in order to have a full control of the marker\r\n     * rendering. You can use plain HTML to build your marker.\r\n     */\r\n    customHTMLMarker?: Partial<GeoSearchMarker<Partial<HTMLMarkerArguments>>> | boolean;\r\n    /**\r\n     * If true, the map is used to search - otherwise it's for display purposes only.\r\n     * @default true\r\n     */\r\n    enableRefine?: boolean;\r\n    /**\r\n     * If true, a button is displayed on the map when the refinement is coming from\r\n     * the map in order to remove it.\r\n     * @default true\r\n     */\r\n    enableClearMapRefinement?: boolean;\r\n    /**\r\n     * If true, the user can toggle the option `enableRefineOnMapMove` directly from the map.\r\n     * @default true\r\n     */\r\n    enableRefineControl?: boolean;\r\n    /**\r\n     * Option forwarded to the Google Maps constructor.\r\n     * See the documentation for more information:\r\n     * https://developers.google.com/maps/documentation/javascript/reference/3/#MapOptions\r\n     */\r\n    mapOptions?: google.maps.MapOptions;\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Reference to the global `window.google` object.\r\n     * See [the documentation](https://developers.google.com/maps/documentation/javascript/tutorial) for more information.\r\n     */\r\n    googleReference: typeof window['google'];\r\n};\r\n\r\n/**\r\n * @deprecated This function will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\r\n */\r\ndeclare function getInsightsAnonymousUserToken(): string | undefined;\r\n\r\ndeclare function getInsightsAnonymousUserTokenInternal(): string | undefined;\r\n\r\ndeclare type GetWidgetRenderState<TWidgetFactory extends AnyWidgetFactory> = ReturnType<TWidgetFactory>['getWidgetRenderState'] extends (renderOptions: any) => infer TRenderState ? TRenderState extends Record<string, unknown> ? TRenderState : never : Record<string, unknown>;\r\n\r\ndeclare namespace helpers {\r\n    export {\r\n        reverseHighlight,\r\n        reverseSnippet,\r\n        highlight,\r\n        snippet,\r\n        insights,\r\n        getInsightsAnonymousUserToken,\r\n        getInsightsAnonymousUserTokenInternal,\r\n        HighlightOptions,\r\n        ReverseHighlightOptions,\r\n        SnippetOptions,\r\n        ReverseSnippetOptions\r\n    }\r\n}\r\n\r\ndeclare const hierarchicalMenu: HierarchicalMenuWidget;\r\n\r\ndeclare type HierarchicalMenuConnector = Connector<HierarchicalMenuWidgetDescription, HierarchicalMenuConnectorParams>;\r\n\r\ndeclare type HierarchicalMenuConnectorParams = {\r\n    /**\r\n     *  Attributes to use to generate the hierarchy of the menu.\r\n     */\r\n    attributes: string[];\r\n    /**\r\n     * Separator used in the attributes to separate level values.\r\n     */\r\n    separator?: string;\r\n    /**\r\n     * Prefix path to use if the first level is not the root level.\r\n     */\r\n    rootPath?: string | null;\r\n    /**\r\n     * Show the siblings of the selected parent levels of the current refined value. This\r\n     * does not impact the root level.\r\n     */\r\n    showParentLevel?: boolean;\r\n    /**\r\n     * Max number of values to display.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * Whether to display the \"show more\" button.\r\n     */\r\n    showMore?: boolean;\r\n    /**\r\n     * Max number of values to display when showing more.\r\n     */\r\n    showMoreLimit?: number;\r\n    /**\r\n     * How to sort refinements. Possible values: `count|isRefined|name:asc|name:desc`.\r\n     * You can also use a sort function that behaves like the standard Javascript [compareFunction](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Syntax).\r\n     *\r\n     * If a facetOrdering is set in the index settings, it is used when sortBy isn't passed\r\n     */\r\n    sortBy?: SortBy<SearchResults.HierarchicalFacet>;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<HierarchicalMenuItem>;\r\n};\r\n\r\ndeclare type HierarchicalMenuCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to the child list element.\r\n     */\r\n    childList: string | string[];\r\n    /**\r\n     * CSS class to add to each item element.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add to each selected item element.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS class to add to each parent item element.\r\n     */\r\n    parentItem: string | string[];\r\n    /**\r\n     * CSS class to add to each link (when using the default template).\r\n     */\r\n    link: string | string[];\r\n    /**\r\n     * CSS class to add to the link of each selected item element (when using the default template).\r\n     */\r\n    selectedItemLink: string | string[];\r\n    /**\r\n     * CSS class to add to each label (when using the default template).\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to each count element (when using the default template).\r\n     */\r\n    count: string | string[];\r\n    /**\r\n     * CSS class to add to the show more element.\r\n     */\r\n    showMore: string | string[];\r\n    /**\r\n     * CSS class to add to the disabled show more element.\r\n     */\r\n    disabledShowMore: string | string[];\r\n}>;\r\n\r\ndeclare type HierarchicalMenuItem = {\r\n    /**\r\n     * Value of the menu item.\r\n     */\r\n    value: string;\r\n    /**\r\n     * Human-readable value of the menu item.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Number of matched results after refinement is applied.\r\n     */\r\n    count: number;\r\n    /**\r\n     * Indicates if the refinement is applied.\r\n     */\r\n    isRefined: boolean;\r\n    /**\r\n     * n+1 level of items, same structure HierarchicalMenuItem\r\n     */\r\n    data: HierarchicalMenuItem[] | null;\r\n};\r\n\r\ndeclare type HierarchicalMenuRenderState = {\r\n    /**\r\n     * Creates an url for the next state for a clicked item.\r\n     */\r\n    createURL: CreateURL<string>;\r\n    /**\r\n     * Values to be rendered.\r\n     */\r\n    items: HierarchicalMenuItem[];\r\n    /**\r\n     * Sets the path of the hierarchical filter and triggers a new search.\r\n     */\r\n    refine: (value: string) => void;\r\n    /**\r\n     *  Indicates if search state can be refined.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * True if the menu is displaying all the menu items.\r\n     */\r\n    isShowingMore: boolean;\r\n    /**\r\n     * Toggles the number of values displayed between `limit` and `showMoreLimit`.\r\n     */\r\n    toggleShowMore: () => void;\r\n    /**\r\n     * `true` if the toggleShowMore button can be activated (enough items to display more or\r\n     * already displaying more than `limit` items)\r\n     */\r\n    canToggleShowMore: boolean;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEventForFacet;\r\n};\r\n\r\ndeclare type HierarchicalMenuTemplates = Partial<{\r\n    /**\r\n     * Item template, provided with `name`, `count`, `isRefined`, `url` data properties.\r\n     */\r\n    item: Template<{\r\n        name: string;\r\n        count: number;\r\n        isRefined: boolean;\r\n        url: string;\r\n        label: string;\r\n        cssClasses: HierarchicalMenuCSSClasses;\r\n    }>;\r\n    /**\r\n     * Template used for the show more text, provided with `isShowingMore` data property.\r\n     */\r\n    showMoreText: Template<{\r\n        isShowingMore: boolean;\r\n    }>;\r\n}>;\r\n\r\n/**\r\n * The hierarchical menu widget is used to create a navigation based on a hierarchy of facet attributes.\r\n *\r\n * It is commonly used for categories with subcategories.\r\n *\r\n * All attributes (lvl0, lvl1 here) must be declared as [attributes for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting) in your\r\n * Algolia settings.\r\n *\r\n * By default, the separator we expect is ` > ` (with spaces) but you can use\r\n * a different one by using the `separator` option.\r\n * @requirements\r\n * Your objects must be formatted in a specific way to be\r\n * able to display hierarchical menus. Here's an example:\r\n *\r\n * ```javascript\r\n * {\r\n *   \"objectID\": \"123\",\r\n *   \"name\": \"orange\",\r\n *   \"categories\": {\r\n *     \"lvl0\": \"fruits\",\r\n *     \"lvl1\": \"fruits > citrus\"\r\n *   }\r\n * }\r\n * ```\r\n *\r\n * Every level must be specified entirely.\r\n * It's also possible to have multiple values per level, for example:\r\n *\r\n * ```javascript\r\n * {\r\n *   \"objectID\": \"123\",\r\n *   \"name\": \"orange\",\r\n *   \"categories\": {\r\n *     \"lvl0\": [\"fruits\", \"vitamins\"],\r\n *     \"lvl1\": [\"fruits > citrus\", \"vitamins > C\"]\r\n *   }\r\n * }\r\n * ```\r\n * @type {WidgetFactory}\r\n * @devNovel HierarchicalMenu\r\n * @category filter\r\n * @param {HierarchicalMenuWidgetParams} widgetParams The HierarchicalMenu widget options.\r\n * @return {Widget} A new HierarchicalMenu widget instance.\r\n * @example\r\n * search.addWidgets([\r\n *   instantsearch.widgets.hierarchicalMenu({\r\n *     container: '#hierarchical-categories',\r\n *     attributes: ['hierarchicalCategories.lvl0', 'hierarchicalCategories.lvl1', 'hierarchicalCategories.lvl2'],\r\n *   })\r\n * ]);\r\n */\r\ndeclare type HierarchicalMenuWidget = WidgetFactory<HierarchicalMenuWidgetDescription & {\r\n    $$widgetType: 'ais.hierarchicalMenu';\r\n}, HierarchicalMenuConnectorParams, HierarchicalMenuWidgetParams>;\r\n\r\ndeclare type HierarchicalMenuWidgetDescription = {\r\n    $$type: 'ais.hierarchicalMenu';\r\n    renderState: HierarchicalMenuRenderState;\r\n    indexRenderState: {\r\n        hierarchicalMenu: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        hierarchicalMenu: {\r\n            [rootAttribute: string]: string[];\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type HierarchicalMenuWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Array of attributes to use to generate the hierarchy of the menu.\r\n     */\r\n    attributes: string[];\r\n    /**\r\n     * Separator used in the attributes to separate level values.\r\n     */\r\n    separator?: string;\r\n    /**\r\n     * Prefix path to use if the first level is not the root level.\r\n     */\r\n    rootPath?: string;\r\n    /**\r\n     * Show the siblings of the selected parent level of the current refined value.\r\n     *\r\n     * With `showParentLevel` set to `true` (default):\r\n     * - Parent lvl0\r\n     *   - **lvl1**\r\n     *     - **lvl2**\r\n     *     - lvl2\r\n     *     - lvl2\r\n     *   - lvl 1\r\n     *   - lvl 1\r\n     * - Parent lvl0\r\n     * - Parent lvl0\r\n     *\r\n     * With `showParentLevel` set to `false`:\r\n     * - Parent lvl0\r\n     *   - **lvl1**\r\n     *     - **lvl2**\r\n     * - Parent lvl0\r\n     * - Parent lvl0\r\n     */\r\n    showParentLevel?: boolean;\r\n    /**\r\n     * Max number of values to display.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * Whether to display the \"show more\" button.\r\n     */\r\n    showMore?: boolean;\r\n    /**\r\n     * Max number of values to display when showing more.\r\n     * does not impact the root level.\r\n     */\r\n    showMoreLimit?: number;\r\n    /**\r\n     * How to sort refinements. Possible values: `count|isRefined|name:asc|name:desc`.\r\n     * You can also use a sort function that behaves like the standard Javascript [compareFunction](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Syntax).\r\n     */\r\n    sortBy?: SortBy<HierarchicalMenuItem>;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<HierarchicalMenuItem>;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: HierarchicalMenuTemplates;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: HierarchicalMenuCSSClasses;\r\n};\r\n\r\n/**\r\n * @deprecated use html tagged templates and the Highlight component instead\r\n */\r\ndeclare function highlight({ attribute, highlightedTagName, hit, cssClasses, }: HighlightOptions): string;\r\n\r\ndeclare function Highlight_2<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: HighlightProps<THit>): h.JSX.Element;\r\n\r\ndeclare type HighlightClassNames = HighlightClassNames_2;\r\n\r\ndeclare type HighlightOptions = {\r\n    attribute: string | string[];\r\n    highlightedTagName?: string;\r\n    hit: Partial<Hit>;\r\n    cssClasses?: Partial<{\r\n        highlighted: string;\r\n    }>;\r\n};\r\n\r\ndeclare type HighlightProps<THit extends Hit<BaseHit>> = {\r\n    hit: THit;\r\n    attribute: keyof THit | string[];\r\n    cssClasses?: HighlightProps_2['classNames'];\r\n} & PartialKeys<Omit<HighlightProps_2, 'parts' | 'classNames'>, 'highlightedTagName' | 'nonHighlightedTagName' | 'separator'>;\r\n\r\ndeclare type HighlightProps_2 = Omit<HighlightProps_3, 'classNames'> & {\r\n    classNames?: Partial<HighlightClassNames>;\r\n};\r\n\r\ndeclare function historyRouter<TRouteState = UiState>({ createURL, parseURL, writeDelay, windowTitle, getLocation, start, dispose, push, cleanUrlOnDispose, }?: Partial<BrowserHistoryArgs<TRouteState>>): BrowserHistory<TRouteState>;\r\n\r\ndeclare type Hit<THit extends NonNullable<object> = Record<string, any>> = {\r\n    __position: number;\r\n    __queryID?: string;\r\n} & AlgoliaHit<THit>;\r\n\r\ndeclare type HitAttributeHighlightResult = {\r\n    value: string;\r\n    matchLevel: 'none' | 'partial' | 'full';\r\n    matchedWords: string[];\r\n    fullyHighlighted?: boolean;\r\n};\r\n\r\ndeclare type HitAttributeSnippetResult = Pick<HitAttributeHighlightResult, 'value' | 'matchLevel'>;\r\n\r\ndeclare type HitHighlightResult = {\r\n    [attribute: string]: HitAttributeHighlightResult | HitAttributeHighlightResult[] | HitHighlightResult[] | HitHighlightResult;\r\n};\r\n\r\ndeclare type HitsConnectorParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * Whether to escape HTML tags from hits string values.\r\n     *\r\n     * @default true\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<Hit<THit>>;\r\n};\r\n\r\ndeclare type HitsCSSClasses = Partial<HitsClassNames>;\r\n\r\ndeclare type HitSnippetResult = {\r\n    [attribute: string]: HitAttributeSnippetResult[] | HitSnippetResult[] | HitAttributeSnippetResult | HitSnippetResult;\r\n};\r\n\r\ndeclare const hitsPerPage: HitsPerPageWidget;\r\n\r\ndeclare type HitsPerPageConnector = Connector<HitsPerPageWidgetDescription, HitsPerPageConnectorParams>;\r\n\r\ndeclare type HitsPerPageConnectorParams = {\r\n    /**\r\n     * Array of objects defining the different values and labels.\r\n     */\r\n    items: HitsPerPageConnectorParamsItem[];\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<HitsPerPageRenderStateItem>;\r\n};\r\n\r\ndeclare type HitsPerPageConnectorParamsItem = {\r\n    /**\r\n     * Label to display in the option.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Number of hits to display per page.\r\n     */\r\n    value: number;\r\n    /**\r\n     * The default hits per page on first search.\r\n     *\r\n     * @default false\r\n     */\r\n    default?: boolean;\r\n};\r\n\r\ndeclare type HitsPerPageCSSClasses = Partial<{\r\n    /**\r\n     * CSS classes added to the outer `<div>`.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS classes added to the parent `<select>`.\r\n     */\r\n    select: string | string[];\r\n    /**\r\n     * CSS classes added to each `<option>`.\r\n     */\r\n    option: string | string[];\r\n}>;\r\n\r\ndeclare type HitsPerPageRenderState = {\r\n    /**\r\n     * Array of objects defining the different values and labels.\r\n     */\r\n    items: HitsPerPageRenderStateItem[];\r\n    /**\r\n     * Creates the URL for a single item name in the list.\r\n     */\r\n    createURL: CreateURL<HitsPerPageConnectorParamsItem['value']>;\r\n    /**\r\n     * Sets the number of hits per page and triggers a search.\r\n     */\r\n    refine: (value: number) => void;\r\n    /**\r\n     * Indicates whether or not the search has results.\r\n     * @deprecated Use `canRefine` instead.\r\n     */\r\n    hasNoResults: boolean;\r\n    /**\r\n     * Indicates if search state can be refined.\r\n     */\r\n    canRefine: boolean;\r\n};\r\n\r\ndeclare type HitsPerPageRenderStateItem = {\r\n    /**\r\n     * Label to display in the option.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Number of hits to display per page.\r\n     */\r\n    value: number;\r\n    /**\r\n     * Indicates if it's the current refined value.\r\n     */\r\n    isRefined: boolean;\r\n};\r\n\r\ndeclare type HitsPerPageWidget = WidgetFactory<HitsPerPageWidgetDescription & {\r\n    $$widgetType: 'ais.hitsPerPage';\r\n}, HitsPerPageConnectorParams, HitsPerPageWidgetParams>;\r\n\r\ndeclare type HitsPerPageWidgetDescription = {\r\n    $$type: 'ais.hitsPerPage';\r\n    renderState: HitsPerPageRenderState;\r\n    indexRenderState: {\r\n        hitsPerPage: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        hitsPerPage: number;\r\n    };\r\n};\r\n\r\ndeclare type HitsPerPageWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * CSS classes to be added.\r\n     */\r\n    cssClasses?: HitsPerPageCSSClasses;\r\n};\r\n\r\ndeclare type HitsRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The matched hits from Algolia API.\r\n     * @deprecated use `items` instead\r\n     */\r\n    hits: Array<Hit<THit>>;\r\n    /**\r\n     * The matched hits from Algolia API.\r\n     */\r\n    items: Array<Hit<THit>>;\r\n    /**\r\n     * The response from the Algolia API.\r\n     */\r\n    results?: SearchResults<Hit<THit>>;\r\n    /**\r\n     * The banner to display above the hits.\r\n     */\r\n    banner?: Banner;\r\n    /**\r\n     * Sends an event to the Insights middleware.\r\n     */\r\n    sendEvent: SendEventForHits;\r\n    /**\r\n     * Returns a string for the `data-insights-event` attribute for the Insights middleware\r\n     */\r\n    bindEvent: BindEventForHits;\r\n};\r\n\r\ndeclare type HitsTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\r\n    /**\r\n     * Template to use when there are no results.\r\n     *\r\n     * @default 'No Results'\r\n     */\r\n    empty: Template<SearchResults<THit>>;\r\n    /**\r\n     * Template to use for each result. This template will receive an object containing a single record.\r\n     *\r\n     * @default ''\r\n     */\r\n    item: TemplateWithBindEvent<Hit<THit> & {\r\n        /** @deprecated the index in the hits array, use __position instead, which is the absolute position */\r\n        __hitIndex: number;\r\n    }>;\r\n    /**\r\n     * Template to use for the banner.\r\n     */\r\n    banner: Template<{\r\n        banner: Required<HitsRenderState['banner']>;\r\n        className: string;\r\n    }>;\r\n}>;\r\n\r\ndeclare type HitsWidgetDescription<THit extends NonNullable<object> = BaseHit> = {\r\n    $$type: 'ais.hits';\r\n    renderState: HitsRenderState<THit>;\r\n    indexRenderState: {\r\n        hits: WidgetRenderState<HitsRenderState<THit>, HitsConnectorParams<THit>>;\r\n    };\r\n};\r\n\r\ndeclare type HitsWidgetParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: HitsTemplates<THit>;\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: HitsCSSClasses;\r\n};\r\n\r\ndeclare type HoganHelpers<TKeys extends string = string> = Record<TKeys, (text: string, render: (value: string) => string) => string>;\r\n\r\ndeclare type HTMLMarkerArguments = {\r\n    __id: string;\r\n    position: google.maps.LatLngLiteral;\r\n    map: google.maps.Map;\r\n    template: ReturnType<typeof renderTemplate>;\r\n    title?: string;\r\n    className: string;\r\n    anchor?: {\r\n        x: number;\r\n        y: number;\r\n    };\r\n};\r\n\r\ndeclare const index: (widgetParams: IndexWidgetParams) => IndexWidget;\r\n\r\ndeclare type IndexInitOptions = {\r\n    instantSearchInstance: InstantSearch;\r\n    parent: IndexWidget | null;\r\n    uiState: UiState;\r\n};\r\n\r\ndeclare type IndexRenderOptions = {\r\n    instantSearchInstance: InstantSearch;\r\n};\r\n\r\ndeclare type IndexRenderState = Partial<ConnectorRenderStates & WidgetRenderStates>;\r\n\r\ndeclare type IndexUiState = Partial<ConnectorUiStates & WidgetUiStates>;\r\n\r\ndeclare type IndexWidget<TUiState extends UiState = UiState> = Omit<Widget<IndexWidgetDescription & {\r\n    widgetParams: IndexWidgetParams;\r\n}>, 'getWidgetUiState' | 'getWidgetState'> & {\r\n    getIndexName: () => string;\r\n    getIndexId: () => string;\r\n    getHelper: () => AlgoliaSearchHelper | null;\r\n    getResults: () => SearchResults | null;\r\n    getResultsForWidget: (widget: IndexWidget | Widget) => SearchResults | RecommendResponse<any> | null;\r\n    getPreviousState: () => SearchParameters | null;\r\n    getScopedResults: () => ScopedResult[];\r\n    getParent: () => IndexWidget | null;\r\n    getWidgets: () => Array<Widget | IndexWidget>;\r\n    createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    addWidgets: (widgets: Array<Widget | IndexWidget>) => IndexWidget;\r\n    removeWidgets: (widgets: Array<Widget | IndexWidget>) => IndexWidget;\r\n    init: (options: IndexInitOptions) => void;\r\n    render: (options: IndexRenderOptions) => void;\r\n    dispose: () => void;\r\n    /**\r\n     * @deprecated\r\n     */\r\n    getWidgetState: (uiState: UiState) => UiState;\r\n    getWidgetUiState: <TSpecificUiState extends UiState = TUiState>(uiState: TSpecificUiState) => TSpecificUiState;\r\n    getWidgetSearchParameters: (searchParameters: SearchParameters, searchParametersOptions: {\r\n        uiState: IndexUiState;\r\n    }) => SearchParameters;\r\n    /**\r\n     * Set this index' UI state back to the state defined by the widgets.\r\n     * Can only be called after `init`.\r\n     */\r\n    refreshUiState: () => void;\r\n    /**\r\n     * Set this index' UI state and search. This is the equivalent of calling\r\n     * a spread `setUiState` on the InstantSearch instance.\r\n     * Can only be called after `init`.\r\n     */\r\n    setIndexUiState: (indexUiState: TUiState[string] | ((previousIndexUiState: TUiState[string]) => TUiState[string])) => void;\r\n};\r\n\r\ndeclare type IndexWidgetDescription = {\r\n    $$type: 'ais.index';\r\n    $$widgetType: 'ais.index';\r\n};\r\n\r\ndeclare type IndexWidgetParams = {\r\n    indexName: string;\r\n    indexId?: string;\r\n};\r\n\r\ndeclare type InfiniteHitsCache<THit extends NonNullable<object> = BaseHit> = {\r\n    read: Read<THit>;\r\n    write: Write<THit>;\r\n};\r\n\r\ndeclare type InfiniteHitsCachedHits<THit extends NonNullable<object>> = {\r\n    [page: number]: Array<Hit<THit>>;\r\n};\r\n\r\ndeclare type InfiniteHitsConnectorParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * Escapes HTML entities from hits string values.\r\n     *\r\n     * @default `true`\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Enable the button to load previous results.\r\n     *\r\n     * @default `false`\r\n     */\r\n    showPrevious?: boolean;\r\n    /**\r\n     * Receives the items, and is called before displaying them.\r\n     * Useful for mapping over the items to transform, and remove or reorder them.\r\n     */\r\n    transformItems?: TransformItems<Hit<THit>>;\r\n    /**\r\n     * Reads and writes hits from/to cache.\r\n     * When user comes back to the search page after leaving for product page,\r\n     * this helps restore InfiniteHits and its scroll position.\r\n     */\r\n    cache?: InfiniteHitsCache<THit>;\r\n};\r\n\r\ndeclare type InfiniteHitsCSSClasses = Partial<{\r\n    /**\r\n     * The root element of the widget.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * The root container without results.\r\n     */\r\n    emptyRoot: string | string[];\r\n    /**\r\n     * The list of results.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * The list item.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * The “Show previous” button.\r\n     */\r\n    loadPrevious: string | string[];\r\n    /**\r\n     * The disabled “Show previous” button.\r\n     */\r\n    disabledLoadPrevious: string | string[];\r\n    /**\r\n     * The “Show more” button.\r\n     */\r\n    loadMore: string | string[];\r\n    /**\r\n     * The disabled “Show more” button.\r\n     */\r\n    disabledLoadMore: string | string[];\r\n    /**\r\n     * Class names to apply to the banner element\r\n     */\r\n    bannerRoot: string | string[];\r\n    /**\r\n     * Class names to apply to the banner image element\r\n     */\r\n    bannerImage: string | string[];\r\n    /**\r\n     * Class names to apply to the banner link element\r\n     */\r\n    bannerLink: string | string[];\r\n}>;\r\n\r\ndeclare type InfiniteHitsRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * Loads the previous results.\r\n     */\r\n    showPrevious: () => void;\r\n    /**\r\n     * Loads the next page of hits.\r\n     */\r\n    showMore: () => void;\r\n    /**\r\n     * Indicates whether the first page of hits has been reached.\r\n     */\r\n    isFirstPage: boolean;\r\n    /**\r\n     * Indicates whether the last page of hits has been reached.\r\n     */\r\n    isLastPage: boolean;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEventForHits;\r\n    /**\r\n     * Returns a string of data-insights-event attribute for insights middleware\r\n     */\r\n    bindEvent: BindEventForHits;\r\n    /**\r\n     * Hits for the current page\r\n     */\r\n    currentPageHits: Array<Hit<THit>>;\r\n    /**\r\n     * Hits for current and cached pages\r\n     * @deprecated use `items` instead\r\n     */\r\n    hits: Array<Hit<THit>>;\r\n    /**\r\n     * Hits for current and cached pages\r\n     */\r\n    items: Array<Hit<THit>>;\r\n    /**\r\n     * The response from the Algolia API.\r\n     */\r\n    results?: SearchResults<Hit<THit>> | null;\r\n    /**\r\n     * The banner to display above the hits.\r\n     */\r\n    banner?: Banner;\r\n};\r\n\r\ndeclare type InfiniteHitsTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\r\n    /**\r\n     * The template to use when there are no results.\r\n     */\r\n    empty: Template<SearchResults<THit>>;\r\n    /**\r\n     * The template to use for the “Show previous” label.\r\n     */\r\n    showPreviousText: Template;\r\n    /**\r\n     * The template to use for the “Show more” label.\r\n     */\r\n    showMoreText: Template;\r\n    /**\r\n     * The template to use for each result.\r\n     */\r\n    item: TemplateWithBindEvent<Hit<THit> & {\r\n        /** @deprecated the index in the hits array, use __position instead, which is the absolute position */\r\n        __hitIndex: number;\r\n    }>;\r\n    /**\r\n     * Template to use for the banner.\r\n     */\r\n    banner: Template<{\r\n        banner: Required<InfiniteHitsRenderState['banner']>;\r\n        className: string;\r\n    }>;\r\n}>;\r\n\r\ndeclare type InfiniteHitsWidgetDescription<THit extends NonNullable<object> = BaseHit> = {\r\n    $$type: 'ais.infiniteHits';\r\n    renderState: InfiniteHitsRenderState<THit>;\r\n    indexRenderState: {\r\n        infiniteHits: WidgetRenderState<InfiniteHitsRenderState<THit>, InfiniteHitsConnectorParams<THit>>;\r\n    };\r\n    indexUiState: {\r\n        page: number;\r\n    };\r\n};\r\n\r\ndeclare type InfiniteHitsWidgetParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The CSS Selector or `HTMLElement` to insert the widget into.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * The CSS classes to override.\r\n     */\r\n    cssClasses?: InfiniteHitsCSSClasses;\r\n    /**\r\n     * The templates to use for the widget.\r\n     */\r\n    templates?: InfiniteHitsTemplates<THit>;\r\n    /**\r\n     * Reads and writes hits from/to cache.\r\n     * When user comes back to the search page after leaving for product page,\r\n     * this helps restore InfiniteHits and its scroll position.\r\n     */\r\n    cache?: InfiniteHitsCache;\r\n};\r\n\r\ndeclare type InitialResult = {\r\n    state?: PlainSearchParameters;\r\n    results?: SearchResults['_rawResults'];\r\n    recommendResults?: {\r\n        params: NonNullable<RecommendParametersOptions['params']>;\r\n        results: RecommendResults['_rawResults'];\r\n    };\r\n    requestParams?: SearchOptions[];\r\n};\r\n\r\ndeclare type InitialResults = Record<string, InitialResult>;\r\n\r\ndeclare type InitOptions = SharedRenderOptions & {\r\n    uiState: UiState;\r\n    results?: undefined;\r\n};\r\n\r\n/**\r\n * @deprecated This function will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\r\n */\r\ndeclare function insights(method: InsightsClientMethod, payload: Partial<InsightsClientPayload>): string;\r\n\r\ndeclare type InsightsClient = InsightsClient_2 & {\r\n    queue?: QueueItem[];\r\n};\r\n\r\ndeclare type InsightsClientMethod = keyof InsightsMethodMap;\r\n\r\ndeclare type InsightsClientPayload = {\r\n    eventName: string;\r\n    queryID: string;\r\n    index: string;\r\n    objectIDs: string[];\r\n    positions?: number[];\r\n};\r\n\r\ndeclare type InsightsClientWithGlobals = InsightsClient & {\r\n    shouldAddScript?: boolean;\r\n    version?: string;\r\n};\r\n\r\ndeclare type InsightsEvent<TMethod extends InsightsMethod = InsightsMethod> = InsightsEvent_2<TMethod>;\r\n\r\n/**\r\n * The event sent to the insights middleware.\r\n */\r\ndeclare type InsightsEvent_2<TMethod extends InsightsMethod = InsightsMethod> = {\r\n    insightsMethod?: TMethod;\r\n    payload: InsightsMethodMap[TMethod][0][0];\r\n    widgetType: string;\r\n    eventType: string;\r\n    eventModifier?: string;\r\n    hits?: Hit[];\r\n    attribute?: string;\r\n};\r\n\r\n/**\r\n * Method allowed by the insights middleware.\r\n */\r\ndeclare type InsightsMethod = 'clickedObjectIDsAfterSearch' | 'clickedObjectIDs' | 'clickedFilters' | 'convertedObjectIDsAfterSearch' | 'convertedObjectIDs' | 'convertedFilters' | 'viewedObjectIDs' | 'viewedFilters';\r\n\r\ndeclare type InsightsMethodMap = InsightsMethodMap_2;\r\n\r\ndeclare type InsightsProps<TInsightsClient extends ProvidedInsightsClient = ProvidedInsightsClient> = {\r\n    insightsClient?: TInsightsClient;\r\n    insightsInitParams?: Partial<InsightsMethodMap['init'][0][0]>;\r\n    onEvent?: (event: InsightsEvent, insightsClient: TInsightsClient) => void;\r\n};\r\n\r\n/**\r\n * The actual implementation of the InstantSearch. This is\r\n * created using the `instantsearch` factory function.\r\n * It emits the 'render' event every time a search is done\r\n */\r\ndeclare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TUiState> extends EventEmitter {\r\n    client: InstantSearchOptions['searchClient'];\r\n    indexName: string;\r\n    compositionID?: string;\r\n    insightsClient: InsightsClient | null;\r\n    onStateChange: InstantSearchOptions<TUiState>['onStateChange'] | null;\r\n    future: NonNullable<InstantSearchOptions<TUiState>['future']>;\r\n    helper: AlgoliaSearchHelper | null;\r\n    mainHelper: AlgoliaSearchHelper | null;\r\n    mainIndex: IndexWidget;\r\n    started: boolean;\r\n    templatesConfig: Record<string, unknown>;\r\n    renderState: RenderState;\r\n    _stalledSearchDelay: number;\r\n    _searchStalledTimer: any;\r\n    _initialUiState: TUiState;\r\n    _initialResults: InitialResults | null;\r\n    _createURL: CreateURL<TUiState>;\r\n    _searchFunction?: InstantSearchOptions['searchFunction'];\r\n    _mainHelperSearch?: AlgoliaSearchHelper['search'];\r\n    _hasSearchWidget: boolean;\r\n    _hasRecommendWidget: boolean;\r\n    _insights: InstantSearchOptions['insights'];\r\n    middleware: Array<{\r\n        creator: Middleware<TUiState>;\r\n        instance: MiddlewareDefinition<TUiState>;\r\n    }>;\r\n    sendEventToInsights: (event: InsightsEvent) => void;\r\n    /**\r\n     * The status of the search. Can be \"idle\", \"loading\", \"stalled\", or \"error\".\r\n     */\r\n    status: InstantSearchStatus;\r\n    /**\r\n     * The last returned error from the Search API.\r\n     * The error gets cleared when the next valid search response is rendered.\r\n     */\r\n    error: Error | undefined;\r\n    /**\r\n     * @deprecated use `status === 'stalled'` instead\r\n     */\r\n    get _isSearchStalled(): boolean;\r\n    constructor(options: InstantSearchOptions<TUiState, TRouteState>);\r\n    /**\r\n     * Hooks a middleware into the InstantSearch lifecycle.\r\n     */\r\n    use(...middleware: Array<Middleware<TUiState>>): this;\r\n    /**\r\n     * Removes a middleware from the InstantSearch lifecycle.\r\n     */\r\n    unuse(...middlewareToUnuse: Array<Middleware<TUiState>>): this;\r\n    EXPERIMENTAL_use(...middleware: Middleware[]): this;\r\n    /**\r\n     * Adds a widget to the search instance.\r\n     * A widget can be added either before or after InstantSearch has started.\r\n     * @param widget The widget to add to InstantSearch.\r\n     *\r\n     * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `addWidgets([widget])`.\r\n     */\r\n    addWidget(widget: Widget): this;\r\n    /**\r\n     * Adds multiple widgets to the search instance.\r\n     * Widgets can be added either before or after InstantSearch has started.\r\n     * @param widgets The array of widgets to add to InstantSearch.\r\n     */\r\n    addWidgets(widgets: Array<Widget | IndexWidget>): this;\r\n    /**\r\n     * Removes a widget from the search instance.\r\n     * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `removeWidgets([widget])`\r\n     * @param widget The widget instance to remove from InstantSearch.\r\n     *\r\n     * The widget must implement a `dispose()` method to clear its state.\r\n     */\r\n    removeWidget(widget: Widget | IndexWidget): this;\r\n    /**\r\n     * Removes multiple widgets from the search instance.\r\n     * @param widgets Array of widgets instances to remove from InstantSearch.\r\n     *\r\n     * The widgets must implement a `dispose()` method to clear their states.\r\n     */\r\n    removeWidgets(widgets: Array<Widget | IndexWidget>): this;\r\n    /**\r\n     * Ends the initialization of InstantSearch.js and triggers the\r\n     * first search.\r\n     */\r\n    start(): void;\r\n    /**\r\n     * Removes all widgets without triggering a search afterwards.\r\n     * @return {undefined} This method does not return anything\r\n     */\r\n    dispose(): void;\r\n    scheduleSearch: (() => void) & {\r\n        wait: () => Promise<void>;\r\n        cancel: () => void;\r\n    };\r\n    scheduleRender: ((shouldResetStatus?: boolean) => void) & {\r\n        wait: () => Promise<void>;\r\n        cancel: () => void;\r\n    };\r\n    scheduleStalledRender(): void;\r\n    /**\r\n     * Set the UI state and trigger a search.\r\n     * @param uiState The next UI state or a function computing it from the current state\r\n     * @param callOnStateChange private parameter used to know if the method is called from a state change\r\n     */\r\n    setUiState(uiState: TUiState | ((previousUiState: TUiState) => TUiState), callOnStateChange?: boolean): void;\r\n    getUiState(): TUiState;\r\n    onInternalStateChange: (() => void) & {\r\n        wait: () => Promise<void>;\r\n        cancel: () => void;\r\n    };\r\n    createURL(nextState?: TUiState): string;\r\n    refresh(): void;\r\n}\r\n\r\n/**\r\n * InstantSearch is the main component of InstantSearch.js. This object\r\n * manages the widget and lets you add new ones.\r\n *\r\n * Two parameters are required to get you started with InstantSearch.js:\r\n *  - `indexName`: the main index that you will use for your new search UI\r\n *  - `searchClient`: the search client to plug to InstantSearch.js\r\n *\r\n * The [search client provided by Algolia](algolia.com/doc/api-client/getting-started/what-is-the-api-client/javascript/)\r\n * needs an `appId` and an `apiKey`. Those parameters can be found in your\r\n * [Algolia dashboard](https://www.algolia.com/api-keys).\r\n *\r\n * If you want to get up and running quickly with InstantSearch.js, have a\r\n * look at the [getting started](https://www.algolia.com/doc/guides/building-search-ui/getting-started/js/).\r\n */\r\ndeclare const instantsearch: InstantSearchModule;\r\nexport default instantsearch;\r\n\r\ndeclare type InstantSearchModule = {\r\n    <TUiState = Record<string, unknown>, TRouteState = TUiState>(options: InstantSearchOptions<Expand<UiState & TUiState>, TRouteState>): InstantSearch<Expand<UiState & TUiState>, TRouteState>;\r\n    version: string;\r\n    connectors: typeof connectors;\r\n    widgets: typeof widgets;\r\n    middlewares: typeof middlewares;\r\n    routers: typeof routers;\r\n    stateMappings: typeof stateMappings;\r\n    templates: typeof templates;\r\n    createInfiniteHitsSessionStorageCache: typeof createInfiniteHitsSessionStorageCache;\r\n    /** @deprecated use html tagged templates and the Highlight component instead */\r\n    highlight: typeof helpers.highlight;\r\n    /** @deprecated use html tagged templates and the ReverseHighlight component instead */\r\n    reverseHighlight: typeof helpers.reverseHighlight;\r\n    /** @deprecated use html tagged templates and the Snippet component instead */\r\n    snippet: typeof helpers.snippet;\r\n    /** @deprecated use html tagged templates and the ReverseSnippet component instead */\r\n    reverseSnippet: typeof helpers.reverseSnippet;\r\n    /**\r\n     * @deprecated use createInsightsMiddleware\r\n     * @link https://www.algolia.com/doc/api-reference/widgets/insights/js/\r\n     */\r\n    insights: typeof helpers.insights;\r\n};\r\n\r\n/**\r\n * Global options for an InstantSearch instance.\r\n */\r\ndeclare type InstantSearchOptions<TUiState extends UiState = UiState, TRouteState = TUiState> = {\r\n    /**\r\n     * The name of the main index. If no indexName is provided, you have to manually add an index widget.\r\n     */\r\n    indexName?: string;\r\n    /**\r\n     * The objectID of the composition.\r\n     * If this is passed, the composition API will be used for search.\r\n     * Multi-index search is not supported with this option.\r\n     */\r\n    compositionID?: string;\r\n    /**\r\n     * The search client to plug to InstantSearch.js\r\n     *\r\n     * Usage:\r\n     * ```javascript\r\n     * // Using the default Algolia search client\r\n     * instantsearch({\r\n     *   indexName: 'indexName',\r\n     *   searchClient: algoliasearch('appId', 'apiKey')\r\n     * });\r\n     *\r\n     * // Using a custom search client\r\n     * instantsearch({\r\n     *   indexName: 'indexName',\r\n     *   searchClient: {\r\n     *     search(requests) {\r\n     *       // fetch response based on requests\r\n     *       return response;\r\n     *     },\r\n     *     searchForFacetValues(requests) {\r\n     *       // fetch response based on requests\r\n     *       return response;\r\n     *     }\r\n     *   }\r\n     * });\r\n     * ```\r\n     */\r\n    searchClient: SearchClient | CompositionClient;\r\n    /**\r\n     * The locale used to display numbers. This will be passed\r\n     * to `Number.prototype.toLocaleString()`\r\n     */\r\n    numberLocale?: string;\r\n    /**\r\n     * A hook that will be called each time a search needs to be done, with the\r\n     * helper as a parameter. It's your responsibility to call `helper.search()`.\r\n     * This option allows you to avoid doing searches at page load for example.\r\n     * @deprecated use onStateChange instead\r\n     */\r\n    searchFunction?: (helper: AlgoliaSearchHelper) => void;\r\n    /**\r\n     * Function called when the state changes.\r\n     *\r\n     * Using this function makes the instance controlled. This means that you\r\n     * become in charge of updating the UI state with the `setUiState` function.\r\n     */\r\n    onStateChange?: (params: {\r\n        uiState: TUiState;\r\n        setUiState: (uiState: TUiState | ((previousUiState: TUiState) => TUiState)) => void;\r\n    }) => void;\r\n    /**\r\n     * Injects a `uiState` to the `instantsearch` instance. You can use this option\r\n     * to provide an initial state to a widget. Note that the state is only used\r\n     * for the first search. To unconditionally pass additional parameters to the\r\n     * Algolia API, take a look at the `configure` widget.\r\n     */\r\n    initialUiState?: NoInfer_2<TUiState>;\r\n    /**\r\n     * Time before a search is considered stalled. The default is 200ms\r\n     */\r\n    stalledSearchDelay?: number;\r\n    /**\r\n     * Router configuration used to save the UI State into the URL or any other\r\n     * client side persistence. Passing `true` will use the default URL options.\r\n     */\r\n    routing?: RouterProps<TUiState, TRouteState> | boolean;\r\n    /**\r\n     * Enables the Insights middleware and loads the Insights library\r\n     * if not already loaded.\r\n     *\r\n     * The Insights middleware sends view and click events automatically, and lets\r\n     * you set up your own events.\r\n     *\r\n     * @default false\r\n     */\r\n    insights?: InsightsProps | boolean;\r\n    /**\r\n     * the instance of search-insights to use for sending insights events inside\r\n     * widgets like `hits`.\r\n     *\r\n     * @deprecated This property will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\r\n     */\r\n    insightsClient?: InsightsClient;\r\n    future?: {\r\n        /**\r\n         * Changes the way `dispose` is used in InstantSearch lifecycle.\r\n         *\r\n         * If `false` (by default), each widget unmounting will remove its state as well, even if there are multiple widgets reading that UI State.\r\n         *\r\n         * If `true`, each widget unmounting will only remove its own state if it's the last of its type. This allows for dynamically adding and removing widgets without losing their state.\r\n         *\r\n         * @default false\r\n         */\r\n        preserveSharedStateOnUnmount?: boolean;\r\n        /**\r\n         * Changes the way root levels of hierarchical facets have their count displayed.\r\n         *\r\n         * If `false` (by default), the count of the refined root level is updated to match the count of the actively refined parent level.\r\n         *\r\n         * If `true`, the count of the root level stays the same as the count of all children levels.\r\n         *\r\n         * @default false\r\n         */\r\n        persistHierarchicalRootCount?: boolean;\r\n    };\r\n};\r\n\r\ndeclare type InstantSearchStatus = 'idle' | 'loading' | 'stalled' | 'error';\r\n\r\ndeclare type InternalMiddleware<TUiState extends UiState = UiState> = (options: MiddlewareOptions) => MiddlewareDefinition<TUiState>;\r\n\r\ndeclare function isMetadataEnabled(): boolean;\r\n\r\ndeclare type LookingSimilarConnectorParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The `objectIDs` of the items to get similar looking products from.\r\n     */\r\n    objectIDs: string[];\r\n    /**\r\n     * The number of recommendations to retrieve.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * The threshold for the recommendations confidence score (between 0 and 100).\r\n     */\r\n    threshold?: number;\r\n    /**\r\n     * List of search parameters to send.\r\n     */\r\n    fallbackParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * List of search parameters to send.\r\n     */\r\n    queryParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * Whether to escape HTML tags from items string values.\r\n     *\r\n     * @default true\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<Hit<THit>, {\r\n        results: RecommendResponse<AlgoliaHit<THit>>;\r\n    }>;\r\n};\r\n\r\ndeclare type LookingSimilarCSSClasses = Partial<RecommendClassNames>;\r\n\r\ndeclare type LookingSimilarRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The matched recommendations from the Algolia API.\r\n     */\r\n    items: Array<Hit<THit>>;\r\n    /**\r\n     * Sends an event to the Insights middleware.\r\n     */\r\n    sendEvent: SendEventForHits;\r\n};\r\n\r\ndeclare type LookingSimilarTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\r\n    /**\r\n     * Template to use when there are no results.\r\n     */\r\n    empty: Template<RecommendResponse<Hit<THit>>>;\r\n    /**\r\n     * Template to use for the header of the widget.\r\n     */\r\n    header: Template<Pick<Parameters<NonNullable<LookingSimilarProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {\r\n        cssClasses: RecommendClassNames;\r\n    }>;\r\n    /**\r\n     * Template to use for each result. This template will receive an object containing a single record.\r\n     */\r\n    item: TemplateWithBindEvent<Hit<THit>>;\r\n    /**\r\n     * Template to use to wrap all items.\r\n     */\r\n    layout: Template<Pick<Parameters<NonNullable<LookingSimilarProps<Hit<THit>>['layout']>>[0], 'items'> & {\r\n        templates: {\r\n            item: LookingSimilarProps<Hit<THit>>['itemComponent'];\r\n        };\r\n        cssClasses: Pick<LookingSimilarCSSClasses, 'list' | 'item'>;\r\n    }>;\r\n}>;\r\n\r\ndeclare type LookingSimilarWidgetParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: LookingSimilarTemplates<THit>;\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: LookingSimilarCSSClasses;\r\n};\r\n\r\ndeclare type MatchingPatterns = {\r\n    [attribute: string]: {\r\n        /**\r\n         * The score of the optional filter.\r\n         *\r\n         * @see https://www.algolia.com/doc/guides/managing-results/rules/merchandising-and-promoting/in-depth/optional-filters/\r\n         */\r\n        score: number;\r\n    };\r\n};\r\n\r\ndeclare const menu: MenuWidget;\r\n\r\ndeclare type MenuConnector = Connector<MenuWidgetDescription, MenuConnectorParams>;\r\n\r\ndeclare type MenuConnectorParams = {\r\n    /**\r\n     * Name of the attribute for faceting (eg. \"free_shipping\").\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * How many facets values to retrieve.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * Whether to display a button that expands the number of items.\r\n     */\r\n    showMore?: boolean;\r\n    /**\r\n     * How many facets values to retrieve when `toggleShowMore` is called, this value is meant to be greater than `limit` option.\r\n     */\r\n    showMoreLimit?: number;\r\n    /**\r\n     * How to sort refinements. Possible values: `count|isRefined|name:asc|name:desc`.\r\n     *\r\n     * You can also use a sort function that behaves like the standard Javascript [compareFunction](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Syntax).\r\n     *\r\n     * If a facetOrdering is set in the index settings, it is used when sortBy isn't passed\r\n     */\r\n    sortBy?: SortBy<SearchResults.HierarchicalFacet>;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<MenuItem>;\r\n};\r\n\r\ndeclare type MenuCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to each item element.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add to each selected item element.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS class to add to each link (when using the default template).\r\n     */\r\n    link: string | string[];\r\n    /**\r\n     * CSS class to add to each label (when using the default template).\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to each count element (when using the default template).\r\n     */\r\n    count: string | string[];\r\n    /**\r\n     * CSS class to add to the show more button.\r\n     */\r\n    showMore: string | string[];\r\n    /**\r\n     * CSS class to add to the disabled show more button.\r\n     */\r\n    disabledShowMore: string | string[];\r\n}>;\r\n\r\ndeclare type MenuItem = {\r\n    /**\r\n     * The value of the menu item.\r\n     */\r\n    value: string;\r\n    /**\r\n     * Human-readable value of the menu item.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Number of results matched after refinement is applied.\r\n     */\r\n    count: number;\r\n    /**\r\n     * Indicates if the refinement is applied.\r\n     */\r\n    isRefined: boolean;\r\n};\r\n\r\ndeclare type MenuRenderState = {\r\n    /**\r\n     * The elements that can be refined for the current search results.\r\n     */\r\n    items: MenuItem[];\r\n    /**\r\n     * Creates the URL for a single item name in the list.\r\n     */\r\n    createURL: CreateURL<string>;\r\n    /**\r\n     * Filter the search to item value.\r\n     */\r\n    refine: (value: string) => void;\r\n    /**\r\n     * True if refinement can be applied.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * True if the menu is displaying all the menu items.\r\n     */\r\n    isShowingMore: boolean;\r\n    /**\r\n     * Toggles the number of values displayed between `limit` and `showMore.limit`.\r\n     */\r\n    toggleShowMore: () => void;\r\n    /**\r\n     * `true` if the toggleShowMore button can be activated (enough items to display more or\r\n     * already displaying more than `limit` items)\r\n     */\r\n    canToggleShowMore: boolean;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEventForFacet;\r\n};\r\n\r\ndeclare const menuSelect: MenuSelectWidget;\r\n\r\ndeclare type MenuSelectCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root when there are no items to display\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the select element.\r\n     */\r\n    select: string | string[];\r\n    /**\r\n     * CSS class to add to the option element.\r\n     */\r\n    option: string | string[];\r\n}>;\r\n\r\ndeclare type MenuSelectTemplates = Partial<{\r\n    /**\r\n     * Item template, provided with `label`, `count`, `isRefined` and `value` data properties.\r\n     */\r\n    item: Template<{\r\n        label: string;\r\n        value: string;\r\n        count: number;\r\n        isRefined: boolean;\r\n    }>;\r\n    /**\r\n     * Label of the \"see all\" option in the select.\r\n     */\r\n    defaultOption: Template;\r\n}>;\r\n\r\ndeclare type MenuSelectWidget = WidgetFactory<MenuWidgetDescription & {\r\n    $$widgetType: 'ais.menuSelect';\r\n}, MenuConnectorParams, MenuSelectWidgetParams>;\r\n\r\ndeclare type MenuSelectWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Customize the output through templating.\r\n     */\r\n    templates?: MenuSelectTemplates;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: MenuSelectCSSClasses;\r\n};\r\n\r\ndeclare type MenuTemplates = Partial<{\r\n    /**\r\n     * Item template. The string template gets the same values as the function.\r\n     */\r\n    item: Template<{\r\n        count: number;\r\n        cssClasses: MenuCSSClasses;\r\n        isRefined: boolean;\r\n        label: string;\r\n        url: string;\r\n        value: string;\r\n    }>;\r\n    /**\r\n     * Template used for the show more text, provided with `isShowingMore` data property.\r\n     */\r\n    showMoreText: Template<{\r\n        isShowingMore: boolean;\r\n    }>;\r\n}>;\r\n\r\ndeclare type MenuWidget = WidgetFactory<MenuWidgetDescription & {\r\n    $$widgetType: 'ais.menu';\r\n}, MenuConnectorParams, MenuWidgetParams>;\r\n\r\ndeclare type MenuWidgetDescription = {\r\n    $$type: 'ais.menu';\r\n    renderState: MenuRenderState;\r\n    indexRenderState: {\r\n        menu: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        menu: {\r\n            [attribute: string]: string;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type MenuWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Customize the output through templating.\r\n     */\r\n    templates?: MenuTemplates;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: MenuCSSClasses;\r\n};\r\n\r\ndeclare type Middleware<TUiState extends UiState = UiState> = (options: MiddlewareOptions) => AtLeastOne<MiddlewareDefinition<TUiState>>;\r\n\r\ndeclare type MiddlewareDefinition<TUiState extends UiState = UiState> = {\r\n    /**\r\n     * string to identify the middleware\r\n     */\r\n    $$type: string;\r\n    /**\r\n     * Change handler called on every UiState change\r\n     */\r\n    onStateChange: (options: {\r\n        uiState: TUiState;\r\n    }) => void;\r\n    /**\r\n     * Called when the middleware is added to InstantSearch\r\n     */\r\n    subscribe: () => void;\r\n    /**\r\n     * Called when InstantSearch is started\r\n     */\r\n    started: () => void;\r\n    /**\r\n     * Called when the middleware is removed from InstantSearch\r\n     */\r\n    unsubscribe: () => void;\r\n};\r\n\r\ndeclare type MiddlewareOptions = {\r\n    instantSearchInstance: InstantSearch;\r\n};\r\n\r\ndeclare namespace middlewares {\r\n    export {\r\n        createInsightsMiddleware,\r\n        InsightsEvent,\r\n        InsightsProps,\r\n        InsightsClientWithGlobals,\r\n        CreateInsightsMiddleware,\r\n        RouterProps,\r\n        createRouterMiddleware,\r\n        isMetadataEnabled,\r\n        createMetadataMiddleware\r\n    }\r\n}\r\n\r\ndeclare type NoInfer_2<T> = T extends infer S ? S : never;\r\n\r\ndeclare const numericMenu: NumericMenuWidget;\r\n\r\ndeclare type NumericMenuComponentCSSClasses = ComponentCSSClasses<NumericMenuCSSClasses>;\r\n\r\ndeclare type NumericMenuConnector = Connector<NumericMenuWidgetDescription, NumericMenuConnectorParams>;\r\n\r\ndeclare type NumericMenuConnectorParams = {\r\n    /**\r\n     * Name of the attribute for filtering\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * List of all the items\r\n     */\r\n    items: NumericMenuConnectorParamsItem[];\r\n    /**\r\n     * Function to transform the items passed to the templates\r\n     */\r\n    transformItems?: TransformItems<NumericMenuRenderStateItem>;\r\n};\r\n\r\ndeclare type NumericMenuConnectorParamsItem = {\r\n    /**\r\n     * Name of the option\r\n     */\r\n    label: string;\r\n    /**\r\n     * Higher bound of the option (<=)\r\n     */\r\n    start?: number;\r\n    /**\r\n     * Lower bound of the option (>=)\r\n     */\r\n    end?: number;\r\n};\r\n\r\ndeclare type NumericMenuCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to each item element.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add to each selected item element.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS class to add to each label element.\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to each label text element.\r\n     */\r\n    labelText: string | string[];\r\n    /**\r\n     * CSS class to add to each radio element (when using the default template).\r\n     */\r\n    radio: string | string[];\r\n}>;\r\n\r\ndeclare type NumericMenuRenderState = {\r\n    /**\r\n     * The list of available choices\r\n     */\r\n    items: NumericMenuRenderStateItem[];\r\n    /**\r\n     * Creates URLs for the next state, the string is the name of the selected option\r\n     */\r\n    createURL: CreateURL<NumericMenuRenderStateItem['value']>;\r\n    /**\r\n     * `true` if the last search contains no result\r\n     * @deprecated Use `canRefine` instead.\r\n     */\r\n    hasNoResults: boolean;\r\n    /**\r\n     * Indicates if search state can be refined.\r\n     *\r\n     * This is `true` if the last search contains no result and\r\n     * \"All\" range is selected\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Sets the selected value and trigger a new search\r\n     */\r\n    refine: (facetValue: string) => void;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEventForFacet;\r\n};\r\n\r\ndeclare type NumericMenuRenderStateItem = {\r\n    /**\r\n     *  Name of the option.\r\n     */\r\n    label: string;\r\n    /**\r\n     * URL encoded of the bounds object with the form `{start, end}`.\r\n     * This value can be used verbatim in the webpage and can be read by `refine`\r\n     * directly. If you want to inspect the value, you can do:\r\n     * `JSON.parse(decodeURI(value))` to get the object.\r\n     */\r\n    value: string;\r\n    /**\r\n     * True if the value is selected\r\n     */\r\n    isRefined: boolean;\r\n};\r\n\r\ndeclare type NumericMenuTemplates = Partial<{\r\n    /**\r\n     * Item template, provided with `label` (the name in the configuration), `isRefined`, `url`, `value` (the setting for the filter) data properties.\r\n     */\r\n    item: Template<{\r\n        /**\r\n         * The name of the attribute.\r\n         */\r\n        attribute: string;\r\n        /**\r\n         * The label for the option.\r\n         */\r\n        label: string;\r\n        /**\r\n         * The encoded URL of the bounds object with a {start, end} form. This\r\n         * value can be used verbatim in the webpage and can be read by refine\r\n         * directly. If you want to inspect the value, you can do JSON.parse(window.decodeURI(value))\r\n         * to get the object.\r\n         */\r\n        value: string;\r\n        /**\r\n         *  Whether or not the refinement is selected.\r\n         */\r\n        isRefined: boolean;\r\n        /**\r\n         * The URL with the applied refinement.\r\n         */\r\n        url: string;\r\n        /**\r\n         * The CSS classes provided to the widget.\r\n         */\r\n        cssClasses: NumericMenuComponentCSSClasses;\r\n    }>;\r\n}>;\r\n\r\ndeclare type NumericMenuWidget = WidgetFactory<NumericMenuWidgetDescription & {\r\n    $$widgetType: 'ais.numericMenu';\r\n}, NumericMenuConnectorParams, NumericMenuWidgetParams>;\r\n\r\ndeclare type NumericMenuWidgetDescription = {\r\n    $$type: 'ais.numericMenu';\r\n    renderState: NumericMenuRenderState;\r\n    indexRenderState: {\r\n        numericMenu: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        numericMenu: {\r\n            [attribute: string]: string;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type NumericMenuWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: NumericMenuTemplates;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: NumericMenuCSSClasses;\r\n};\r\n\r\ndeclare const pagination: PaginationWidget;\r\n\r\ndeclare type PaginationConnector = Connector<PaginationWidgetDescription, PaginationConnectorParams>;\r\n\r\ndeclare type PaginationConnectorParams = {\r\n    /**\r\n     * The total number of pages to browse.\r\n     */\r\n    totalPages?: number;\r\n    /**\r\n     * The padding of pages to show around the current page\r\n     * @default 3\r\n     */\r\n    padding?: number;\r\n};\r\n\r\ndeclare type PaginationCSSClasses = Partial<{\r\n    /**\r\n     * CSS classes added to the root element of the widget.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element of the widget if there are no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS classes added to the wrapping `<ul>`.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS classes added to each `<li>`.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS classes added to the first `<li>`.\r\n     */\r\n    firstPageItem: string | string[];\r\n    /**\r\n     * CSS classes added to the last `<li>`.\r\n     */\r\n    lastPageItem: string | string[];\r\n    /**\r\n     * CSS classes added to the previous `<li>`.\r\n     */\r\n    previousPageItem: string | string[];\r\n    /**\r\n     * CSS classes added to the next `<li>`.\r\n     */\r\n    nextPageItem: string | string[];\r\n    /**\r\n     * CSS classes added to page `<li>`.\r\n     */\r\n    pageItem: string | string[];\r\n    /**\r\n     * CSS classes added to the selected `<li>`.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS classes added to the disabled `<li>`.\r\n     */\r\n    disabledItem: string | string[];\r\n    /**\r\n     * CSS classes added to each link.\r\n     */\r\n    link: string | string[];\r\n}>;\r\n\r\ndeclare type PaginationRenderState = {\r\n    /** Creates URLs for the next state, the number is the page to generate the URL for. */\r\n    createURL: CreateURL<number>;\r\n    /** Sets the current page and triggers a search. */\r\n    refine: (page: number) => void;\r\n    /** true if this search returned more than one page */\r\n    canRefine: boolean;\r\n    /** The number of the page currently displayed. */\r\n    currentRefinement: number;\r\n    /** The number of hits computed for the last query (can be approximated). */\r\n    nbHits: number;\r\n    /** The number of pages for the result set. */\r\n    nbPages: number;\r\n    /** The actual pages relevant to the current situation and padding. */\r\n    pages: number[];\r\n    /** true if the current page is also the first page. */\r\n    isFirstPage: boolean;\r\n    /** true if the current page is also the last page. */\r\n    isLastPage: boolean;\r\n};\r\n\r\ndeclare type PaginationTemplates = Partial<{\r\n    /**\r\n     * Label for the Previous link.\r\n     */\r\n    previous: Template;\r\n    /**\r\n     * Label for the Next link.\r\n     */\r\n    next: Template;\r\n    /**\r\n     * Label for the link of a certain page\r\n     * Page is one-based, so `page` will be `1` for the first page.\r\n     */\r\n    page: Template<{\r\n        page: number;\r\n    }>;\r\n    /**\r\n     * Label for the First link.\r\n     */\r\n    first: Template;\r\n    /**\r\n     * Label for the Last link.\r\n     */\r\n    last: Template;\r\n}>;\r\n\r\ndeclare type PaginationWidget = WidgetFactory<PaginationWidgetDescription & {\r\n    $$widgetType: 'ais.pagination';\r\n}, PaginationConnectorParams, PaginationWidgetParams>;\r\n\r\ndeclare type PaginationWidgetDescription = {\r\n    $$type: 'ais.pagination';\r\n    renderState: PaginationRenderState;\r\n    indexRenderState: {\r\n        pagination: WidgetRenderState<PaginationRenderState, PaginationConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        page: number;\r\n    };\r\n};\r\n\r\ndeclare type PaginationWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * The max number of pages to browse.\r\n     */\r\n    totalPages?: number;\r\n    /**\r\n     * The number of pages to display on each side of the current page.\r\n     * @default 3\r\n     */\r\n    padding?: number;\r\n    /**\r\n     * Where to scroll after a click, set to `false` to disable.\r\n     * @default body\r\n     */\r\n    scrollTo?: string | HTMLElement | boolean;\r\n    /**\r\n     * Whether to show the \"first page\" control\r\n     * @default true\r\n     */\r\n    showFirst?: boolean;\r\n    /**\r\n     * Whether to show the \"last page\" control\r\n     * @default true\r\n     */\r\n    showLast?: boolean;\r\n    /**\r\n     * Whether to show the \"next page\" control\r\n     * @default true\r\n     */\r\n    showNext?: boolean;\r\n    /**\r\n     * Whether to show the \"previous page\" control\r\n     * @default true\r\n     */\r\n    showPrevious?: boolean;\r\n    /**\r\n     * Text to display in the links.\r\n     */\r\n    templates?: PaginationTemplates;\r\n    /**\r\n     * CSS classes to be added.\r\n     */\r\n    cssClasses?: PaginationCSSClasses;\r\n};\r\n\r\n/**\r\n * The panel widget wraps other widgets in a consistent panel design.\r\n * It also reacts, indicates and sets CSS classes when widgets are no longer relevant for refining.\r\n */\r\ndeclare const panel: PanelWidget;\r\n\r\ndeclare type PanelCSSClasses = Partial<{\r\n    /**\r\n     * CSS classes to add to the root element of the widget.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS classes to add to the root element of the widget when there's no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS classes to add to the root element when collapsible (`collapse` is defined).\r\n     */\r\n    collapsibleRoot: string | string[];\r\n    /**\r\n     * CSS classes to add to the root element when collapsed.\r\n     */\r\n    collapsedRoot: string | string[];\r\n    /**\r\n     * CSS classes to add to the collapse button element.\r\n     */\r\n    collapseButton: string | string[];\r\n    /**\r\n     * CSS classes to add to the collapse icon of the button.\r\n     */\r\n    collapseIcon: string | string[];\r\n    /**\r\n     * CSS classes to add to the header.\r\n     */\r\n    header: string | string[];\r\n    /**\r\n     * CSS classes to add to the body.\r\n     */\r\n    body: string | string[];\r\n    /**\r\n     * CSS classes to add to the footer.\r\n     */\r\n    footer: string | string[];\r\n}>;\r\n\r\ndeclare type PanelRenderOptions<TWidgetFactory extends AnyWidgetFactory> = RenderOptions & GetWidgetRenderState<TWidgetFactory>;\r\n\r\ndeclare type PanelTemplates<TWidget extends AnyWidgetFactory> = Partial<{\r\n    /**\r\n     * Template to use for the header.\r\n     */\r\n    header: Template<PanelRenderOptions<TWidget>>;\r\n    /**\r\n     * Template to use for the footer.\r\n     */\r\n    footer: Template<PanelRenderOptions<TWidget>>;\r\n    /**\r\n     * Template to use for collapse button.\r\n     */\r\n    collapseButtonText: Template<{\r\n        collapsed: boolean;\r\n    }>;\r\n}>;\r\n\r\ndeclare type PanelWidget = <TWidgetFactory extends AnyWidgetFactory>(panelWidgetParams?: PanelWidgetParams<TWidgetFactory>) => (widgetFactory: TWidgetFactory) => (widgetParams: Parameters<TWidgetFactory>[0]) => AugmentedWidget<TWidgetFactory>;\r\n\r\ndeclare type PanelWidgetParams<TWidgetFactory extends AnyWidgetFactory> = {\r\n    /**\r\n     * A function that is called on each render to determine if the\r\n     * panel should be hidden based on the render options.\r\n     */\r\n    hidden?: (options: PanelRenderOptions<TWidgetFactory>) => boolean;\r\n    /**\r\n     * A function that is called on each render to determine if the\r\n     * panel should be collapsed based on the render options.\r\n     */\r\n    collapsed?: (options: PanelRenderOptions<TWidgetFactory>) => boolean;\r\n    /**\r\n     * The templates to use for the widget.\r\n     */\r\n    templates?: PanelTemplates<TWidgetFactory>;\r\n    /**\r\n     * The CSS classes to override.\r\n     */\r\n    cssClasses?: PanelCSSClasses;\r\n};\r\n\r\ndeclare type ParamTrackedFilters = {\r\n    [facetName: string]: (facetValues: TrackedFilterRefinement[]) => TrackedFilterRefinement[];\r\n};\r\n\r\ndeclare type ParamTransformRuleContexts = (ruleContexts: string[]) => string[];\r\n\r\ndeclare type ParseURL<TRouteState> = (args: {\r\n    qsModule: typeof qs_2;\r\n    location: Location;\r\n}) => TRouteState;\r\n\r\n/**\r\n * Make certain keys of an object optional.\r\n */\r\ndeclare type PartialKeys<TObj, TKeys extends keyof TObj> = Omit<TObj, TKeys> & Partial<Pick<TObj, TKeys>>;\r\n\r\ndeclare type PlacesInstance = Places.PlacesInstance;\r\n\r\ndeclare type PlacesWidget = WidgetFactory<PlacesWidgetDescription, PlacesWidgetParams, PlacesWidgetParams>;\r\n\r\ndeclare type PlacesWidgetDescription = {\r\n    $$type: 'ais.places';\r\n    $$widgetType: 'ais.places';\r\n    renderState: Record<string, unknown>;\r\n    indexRenderState: {\r\n        places: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams>;\r\n    };\r\n    indexUiState: {\r\n        places: {\r\n            query: string;\r\n            position: string;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type PlacesWidgetParams = {\r\n    /**\r\n     * The Algolia Places reference to use.\r\n     *\r\n     * @see https://github.com/algolia/places\r\n     */\r\n    placesReference: (options: StaticOptions & ReconfigurableOptions) => PlacesInstance;\r\n    /**\r\n     * The default position when the input is empty.\r\n     */\r\n    defaultPosition?: string[];\r\n} & StaticOptions;\r\n\r\ndeclare const poweredBy: PoweredByWidget;\r\n\r\ndeclare type PoweredByConnector = Connector<PoweredByWidgetDescription, PoweredByConnectorParams>;\r\n\r\ndeclare type PoweredByConnectorParams = {\r\n    /** the url to redirect to on click */\r\n    url?: string;\r\n};\r\n\r\ndeclare type PoweredByCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the wrapping element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the link.\r\n     */\r\n    link: string | string[];\r\n    /**\r\n     * CSS class to add to the SVG logo.\r\n     */\r\n    logo: string | string[];\r\n}>;\r\n\r\ndeclare type PoweredByRenderState = {\r\n    /** the url to redirect to on click */\r\n    url: string;\r\n};\r\n\r\ndeclare type PoweredByWidget = WidgetFactory<PoweredByWidgetDescription & {\r\n    $$widgetType: 'ais.poweredBy';\r\n}, PoweredByConnectorParams, PoweredByWidgetParams>;\r\n\r\ndeclare type PoweredByWidgetDescription = {\r\n    $$type: 'ais.poweredBy';\r\n    renderState: PoweredByRenderState;\r\n    indexRenderState: {\r\n        poweredBy: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams>;\r\n    };\r\n};\r\n\r\ndeclare type PoweredByWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * The theme of the logo.\r\n     * @default 'light'\r\n     */\r\n    theme?: 'light' | 'dark';\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: PoweredByCSSClasses;\r\n};\r\n\r\ndeclare type PreparedTemplateProps<TTemplates extends Templates> = {\r\n    templatesConfig: TemplatesConfig;\r\n    templates: TTemplates;\r\n    useCustomCompileOptions: {\r\n        [TKey in keyof Partial<TTemplates>]: boolean;\r\n    };\r\n};\r\n\r\ndeclare type ProvidedInsightsClient = InsightsClient | null | undefined;\r\n\r\ndeclare const queryRuleContext: QueryRuleContextWidget;\r\n\r\ndeclare type QueryRuleContextWidget = WidgetFactory<QueryRulesWidgetDescription & {\r\n    $$widgetType: 'ais.queryRuleContext';\r\n}, QueryRulesConnectorParams, QueryRuleContextWidgetParams>;\r\n\r\ndeclare type QueryRuleContextWidgetParams = {\r\n    trackedFilters: ParamTrackedFilters;\r\n    transformRuleContexts?: ParamTransformRuleContexts;\r\n};\r\n\r\ndeclare const queryRuleCustomData: QueryRuleCustomDataWidget;\r\n\r\ndeclare type QueryRuleCustomDataCSSClasses = Partial<{\r\n    root: string | string[];\r\n}>;\r\n\r\ndeclare type QueryRuleCustomDataTemplates = Partial<{\r\n    default: Template<{\r\n        items: any[];\r\n    }>;\r\n}>;\r\n\r\ndeclare type QueryRuleCustomDataWidget = WidgetFactory<QueryRulesWidgetDescription & {\r\n    $$widgetType: 'ais.queryRuleCustomData';\r\n}, QueryRulesConnectorParams, QueryRuleCustomDataWidgetParams>;\r\n\r\ndeclare type QueryRuleCustomDataWidgetParams = {\r\n    container: string | HTMLElement;\r\n    cssClasses?: QueryRuleCustomDataCSSClasses;\r\n    templates?: QueryRuleCustomDataTemplates;\r\n};\r\n\r\ndeclare type QueryRulesConnector = Connector<QueryRulesWidgetDescription, QueryRulesConnectorParams>;\r\n\r\ndeclare type QueryRulesConnectorParams = {\r\n    trackedFilters?: ParamTrackedFilters;\r\n    transformRuleContexts?: ParamTransformRuleContexts;\r\n    transformItems?: TransformItems<any>;\r\n};\r\n\r\ndeclare type QueryRulesRenderState = {\r\n    items: any[];\r\n};\r\n\r\ndeclare type QueryRulesWidgetDescription = {\r\n    $$type: 'ais.queryRules';\r\n    renderState: QueryRulesRenderState;\r\n    indexRenderState: {\r\n        queryRules: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams>;\r\n    };\r\n};\r\n\r\ndeclare type QueueItem = QueueItemMap[keyof QueueItemMap];\r\n\r\ndeclare type QueueItemMap = {\r\n    [MethodName in keyof InsightsMethodMap]: [\r\n    methodName: MethodName,\r\n    ...args: InsightsMethodMap[MethodName][0][0]\r\n    ];\r\n};\r\n\r\ndeclare type Range_2 = {\r\n    min: RangeMin;\r\n    max: RangeMax;\r\n};\r\n\r\ndeclare type RangeBoundaries = [RangeMin, RangeMax];\r\n\r\ndeclare type RangeConnector = Connector<RangeWidgetDescription, RangeConnectorParams>;\r\n\r\ndeclare type RangeConnectorParams = {\r\n    /**\r\n     * Name of the attribute for faceting.\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * Minimal range value, default to automatically computed from the result set.\r\n     */\r\n    min?: number;\r\n    /**\r\n     * Maximal range value, default to automatically computed from the result set.\r\n     */\r\n    max?: number;\r\n    /**\r\n     * Number of digits after decimal point to use.\r\n     */\r\n    precision?: number;\r\n};\r\n\r\ndeclare const rangeInput: RangeInputWidget;\r\n\r\ndeclare type RangeInputCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when there's no refinements.\r\n     */\r\n    noRefinement: string | string[];\r\n    /**\r\n     * CSS class to add to the form element.\r\n     */\r\n    form: string | string[];\r\n    /**\r\n     * CSS class to add to the label element.\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to the input element.\r\n     */\r\n    input: string | string[];\r\n    /**\r\n     * CSS class to add to the min input element.\r\n     */\r\n    inputMin: string | string[];\r\n    /**\r\n     * CSS class to add to the max input element.\r\n     */\r\n    separator: string | string[];\r\n    /**\r\n     * CSS class to add to the separator of the form.\r\n     */\r\n    inputMax: string | string[];\r\n    /**\r\n     * CSS class to add to the submit button of the form.\r\n     */\r\n    submit: string | string[];\r\n}>;\r\n\r\ndeclare type RangeInputTemplates = Partial<{\r\n    /**\r\n     * The label of the separator, between min and max.\r\n     * @default \"to\"\r\n     */\r\n    separatorText: Template;\r\n    /**\r\n     * The label of the submit button\r\n     * @default \"Go\"\r\n     */\r\n    submitText: Template;\r\n}>;\r\n\r\ndeclare type RangeInputWidget = WidgetFactory<Omit<RangeWidgetDescription, '$$type'> & {\r\n    $$widgetType: 'ais.rangeInput';\r\n    $$type: 'ais.rangeInput';\r\n}, RangeConnectorParams, RangeInputWidgetParams>;\r\n\r\ndeclare type RangeInputWidgetParams = {\r\n    /**\r\n     * Valid CSS Selector as a string or DOMElement.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Name of the attribute for faceting.\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * Minimal slider value, default to automatically computed from the result set.\r\n     */\r\n    min?: number;\r\n    /**\r\n     * Maximal slider value, defaults to automatically computed from the result set.\r\n     */\r\n    max?: number;\r\n    /**\r\n     * Number of digits after decimal point to use.\r\n     * @default 0\r\n     */\r\n    precision?: number;\r\n    /**\r\n     * Labels to use for the widget.\r\n     */\r\n    templates?: RangeInputTemplates;\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: RangeInputCSSClasses;\r\n};\r\n\r\ndeclare type RangeMax = number | undefined;\r\n\r\ndeclare type RangeMin = number | undefined;\r\n\r\ndeclare type RangeRenderState = {\r\n    /**\r\n     * Sets a range to filter the results on. Both values\r\n     * are optional, and will default to the higher and lower bounds. You can use `undefined` to remove a\r\n     * previously set bound or to set an infinite bound.\r\n     * @param rangeValue tuple of [min, max] bounds\r\n     */\r\n    refine: (rangeValue: RangeBoundaries) => void;\r\n    /**\r\n     * Indicates whether this widget can be refined\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Send an event to the insights middleware\r\n     */\r\n    sendEvent: SendEventForFacet;\r\n    /**\r\n     * Maximum range possible for this search\r\n     */\r\n    range: Range_2;\r\n    /**\r\n     * Current refinement of the search\r\n     */\r\n    start: RangeBoundaries;\r\n    /**\r\n     * Transform for the rendering `from` and/or `to` values.\r\n     * Both functions take a `number` as input and should output a `string`.\r\n     */\r\n    format: {\r\n        from: (fromValue: number) => string;\r\n        to: (toValue: number) => string;\r\n    };\r\n};\r\n\r\n/**\r\n * The range slider is a widget which provides a user-friendly way to filter the\r\n * results based on a single numeric range.\r\n *\r\n * @requirements\r\n * The attribute passed to `attribute` must be declared as an\r\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\r\n * in your Algolia settings.\r\n *\r\n * The values inside this attribute must be JavaScript numbers (not strings).\r\n */\r\ndeclare const rangeSlider: RangeSliderWidget;\r\n\r\ndeclare type RangeSliderCssClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the disabled root element.\r\n     */\r\n    disabledRoot: string | string[];\r\n}>;\r\n\r\ndeclare type RangeSliderTooltipOptions = {\r\n    /**\r\n     * The function takes the raw value as input, and should return\r\n     * a string for the label that should be used for this value.\r\n     * @example\r\n     * { format(rawValue) {return '$' + Math.round(rawValue).toLocaleString() } }\r\n     */\r\n    format: (value: number) => string;\r\n};\r\n\r\ndeclare type RangeSliderWidget = WidgetFactory<Omit<RangeWidgetDescription, '$$type'> & {\r\n    $$widgetType: 'ais.rangeSlider';\r\n    $$type: 'ais.rangeSlider';\r\n}, RangeConnectorParams, RangeSliderWidgetParams>;\r\n\r\ndeclare type RangeSliderWidgetParams = {\r\n    /**\r\n     * CSS Selector or DOMElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Name of the attribute for faceting.;\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * Should we show tooltips or not.\r\n     * The default tooltip will show the raw value.\r\n     * You can also provide an object with a format function as an attribute.\r\n     * So that you can format the tooltip display value as you want.\r\n     * @default true\r\n     */\r\n    tooltips?: boolean | RangeSliderTooltipOptions;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: RangeSliderCssClasses;\r\n    /**\r\n     * Show slider pips.\r\n     * @default true\r\n     */\r\n    pips?: boolean;\r\n    /**\r\n     * Number of digits after decimal point to use.\r\n     * @default 0\r\n     */\r\n    precision?: number;\r\n    /**\r\n     * Every handle move will jump that number of steps.\r\n     */\r\n    step?: number;\r\n    /**\r\n     * Minimal slider value, default to automatically computed from the result set.\r\n     */\r\n    min?: number;\r\n    /**\r\n     * Maximal slider value, defaults to automatically computed from the result set.\r\n     */\r\n    max?: number;\r\n};\r\n\r\ndeclare type RangeWidgetDescription = {\r\n    $$type: 'ais.range';\r\n    renderState: RangeRenderState;\r\n    indexRenderState: {\r\n        range: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        range: {\r\n            [attribute: string]: string;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare const ratingMenu: RatingMenuWidget;\r\n\r\ndeclare type RatingMenuConnector = Connector<RatingMenuWidgetDescription, RatingMenuConnectorParams>;\r\n\r\ndeclare type RatingMenuConnectorParams = {\r\n    /**\r\n     * Name of the attribute for faceting (eg. \"free_shipping\").\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * The maximum rating value.\r\n     */\r\n    max?: number;\r\n};\r\n\r\ndeclare type RatingMenuCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when there's no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to each item element.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add the selected item element.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS class to add a disabled item element.\r\n     */\r\n    disabledItem: string | string[];\r\n    /**\r\n     * CSS class to add to each link element.\r\n     */\r\n    link: string | string[];\r\n    /**\r\n     * CSS class to add to each star element (when using the default template).\r\n     */\r\n    starIcon: string | string[];\r\n    /**\r\n     * CSS class to add to each full star element (when using the default template).\r\n     */\r\n    fullStarIcon: string | string[];\r\n    /**\r\n     * CSS class to add to each empty star element (when using the default template).\r\n     */\r\n    emptyStarIcon: string | string[];\r\n    /**\r\n     * CSS class to add to each label.\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to each counter.\r\n     */\r\n    count: string | string[];\r\n}>;\r\n\r\ndeclare type RatingMenuRenderState = {\r\n    /**\r\n     * Possible star ratings the user can apply.\r\n     */\r\n    items: StarRatingItems[];\r\n    /**\r\n     * Creates an URL for the next state (takes the item value as parameter). Takes the value of an item as parameter.\r\n     */\r\n    createURL: CreateURL<string>;\r\n    /**\r\n     *  Indicates if search state can be refined.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Selects a rating to filter the results (takes the filter value as parameter). Takes the value of an item as parameter.\r\n     */\r\n    refine: (value: string) => void;\r\n    /**\r\n     * `true` if the last search contains no result.\r\n     *\r\n     * @deprecated Use `canRefine` instead.\r\n     */\r\n    hasNoResults: boolean;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEvent;\r\n};\r\n\r\ndeclare type RatingMenuTemplates = Partial<{\r\n    /**\r\n     * Item template, provided with `name`, `count`, `isRefined`, `url` data properties.\r\n     */\r\n    item: Template<{\r\n        name: string;\r\n        label: string;\r\n        value: string;\r\n        count: number;\r\n        isRefined: boolean;\r\n        url: string;\r\n        stars: [boolean, boolean, boolean, boolean, boolean];\r\n        cssClasses: RatingMenuCSSClasses;\r\n        attribute?: string;\r\n        isFromSearch?: boolean;\r\n    }>;\r\n}>;\r\n\r\n/**\r\n * Rating menu is used for displaying grade like filters. The values are normalized within boundaries.\r\n *\r\n * The maximum value can be set (with `max`), the minimum is always 0.\r\n *\r\n * @requirements\r\n * The attribute passed to `attribute` must be declared as an\r\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\r\n * in your Algolia settings.\r\n *\r\n * The values inside this attribute must be JavaScript numbers (not strings).\r\n *\r\n * @type {WidgetFactory}\r\n * @devNovel RatingMenu\r\n * @category filter\r\n * @param {RatingMenuWidgetParams} widgetParams RatingMenu widget options.\r\n * @return {Widget} A new RatingMenu widget instance.\r\n * @example\r\n * search.addWidgets([\r\n *   instantsearch.widgets.ratingMenu({\r\n *     container: '#stars',\r\n *     attribute: 'rating',\r\n *     max: 5,\r\n *   })\r\n * ]);\r\n */\r\ndeclare type RatingMenuWidget = WidgetFactory<RatingMenuWidgetDescription & {\r\n    $$widgetType: 'ais.ratingMenu';\r\n}, RatingMenuConnectorParams, RatingMenuWidgetParams>;\r\n\r\ndeclare type RatingMenuWidgetDescription = {\r\n    $$type: 'ais.ratingMenu';\r\n    renderState: RatingMenuRenderState;\r\n    indexRenderState: {\r\n        ratingMenu: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        ratingMenu: {\r\n            [attribute: string]: number | undefined;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type RatingMenuWidgetParams = {\r\n    /**\r\n     * Place where to insert the widget in your webpage.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Name of the attribute in your records that contains the ratings.\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * The maximum rating value.\r\n     */\r\n    max?: number;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: RatingMenuTemplates;\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: RatingMenuCSSClasses;\r\n};\r\n\r\ndeclare type Read<THit extends NonNullable<object>> = ({ state, }: {\r\n    state: PlainSearchParameters;\r\n}) => InfiniteHitsCachedHits<THit> | null;\r\n\r\ndeclare type RecommendRenderOptions = SharedRenderOptions & {\r\n    results: RecommendResponse<any>;\r\n};\r\n\r\ndeclare type RecommendWidget<TWidgetDescription extends WidgetDescription & WidgetParams> = {\r\n    dependsOn: 'recommend';\r\n    $$id?: number;\r\n    getWidgetParameters: (state: RecommendParameters, widgetParametersOptions: {\r\n        uiState: Expand<Partial<TWidgetDescription['indexUiState'] & IndexUiState>>;\r\n    }) => RecommendParameters;\r\n    getRenderState: (renderState: Expand<IndexRenderState & Partial<TWidgetDescription['indexRenderState']>>, renderOptions: InitOptions | RecommendRenderOptions) => IndexRenderState & TWidgetDescription['indexRenderState'];\r\n    getWidgetRenderState: (renderOptions: InitOptions | RecommendRenderOptions) => Expand<WidgetRenderState<TWidgetDescription['renderState'], TWidgetDescription['widgetParams']>>;\r\n};\r\n\r\ndeclare type ReconfigurableOptions = Places.ReconfigurableOptions;\r\n\r\n/**\r\n * Refine the given search parameters.\r\n */\r\ndeclare type Refine = (searchParameters: PlainSearchParameters) => void;\r\n\r\ndeclare type Refine_2 = (relevancyStrictness: number | undefined) => void;\r\n\r\n/**\r\n * The refinement list widget is one of the most common widget that you can find\r\n * in a search UI. With this widget, the user can filter the dataset based on facets.\r\n *\r\n * The refinement list displays only the most relevant facets for the current search\r\n * context. The sort option only affects the facet that are returned by the engine,\r\n * not which facets are returned.\r\n *\r\n * This widget also implements search for facet values, which is a mini search inside the\r\n * values of the facets. This makes easy to deal with uncommon facet values.\r\n *\r\n * @requirements\r\n *\r\n * The attribute passed to `attribute` must be declared as an\r\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\r\n * in your Algolia settings.\r\n *\r\n * If you also want to use search for facet values on this attribute, you need to make it searchable using the [dashboard](https://www.algolia.com/explorer/display/) or using the [API](https://www.algolia.com/doc/guides/searching/faceting/#search-for-facet-values).\r\n */\r\ndeclare const refinementList: RefinementListWidget;\r\n\r\ndeclare type RefinementListConnector = Connector<RefinementListWidgetDescription, RefinementListConnectorParams>;\r\n\r\ndeclare type RefinementListConnectorParams = {\r\n    /**\r\n     * The name of the attribute in the records.\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * How the filters are combined together.\r\n     */\r\n    operator?: 'and' | 'or';\r\n    /**\r\n     * The max number of items to display when\r\n     * `showMoreLimit` is not set or if the widget is showing less value.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * Whether to display a button that expands the number of items.\r\n     */\r\n    showMore?: boolean;\r\n    /**\r\n     * The max number of items to display if the widget\r\n     * is showing more items.\r\n     */\r\n    showMoreLimit?: number;\r\n    /**\r\n     * How to sort refinements. Possible values: `count|isRefined|name:asc|name:desc`.\r\n     *\r\n     * You can also use a sort function that behaves like the standard Javascript [compareFunction](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Syntax).\r\n     *\r\n     * If a facetOrdering is set in the index settings, it is used when sortBy isn't passed\r\n     */\r\n    sortBy?: SortBy<SearchResults.FacetValue>;\r\n    /**\r\n     * Escapes the content of the facet values.\r\n     */\r\n    escapeFacetValues?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<RefinementListItem>;\r\n};\r\n\r\ndeclare type RefinementListCSSClasses = RefinementListOwnCSSClasses & RefinementListSearchableCSSClasses;\r\n\r\ndeclare type RefinementListItem = {\r\n    /**\r\n     * The value of the refinement list item.\r\n     */\r\n    value: string;\r\n    /**\r\n     * Human-readable value of the refinement list item.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Human-readable value of the searched refinement list item.\r\n     */\r\n    highlighted?: string;\r\n    /**\r\n     * Number of matched results after refinement is applied.\r\n     */\r\n    count: number;\r\n    /**\r\n     * Indicates if the list item is refined.\r\n     */\r\n    isRefined: boolean;\r\n};\r\n\r\ndeclare type RefinementListItemData = {\r\n    /**\r\n     * The number of occurrences of the facet in the result set.\r\n     */\r\n    count: number;\r\n    /**\r\n     * True if the value is selected.\r\n     */\r\n    isRefined: boolean;\r\n    /**\r\n     * The label to display.\r\n     */\r\n    label: string;\r\n    /**\r\n     * The value used for refining.\r\n     */\r\n    value: string;\r\n    /**\r\n     * The label highlighted (when using search for facet values). This value is displayed in the default template.\r\n     */\r\n    highlighted: string;\r\n    /**\r\n     * The url with this refinement selected.\r\n     */\r\n    url: string;\r\n    /**\r\n     * Object containing all the classes computed for the item.\r\n     */\r\n    cssClasses: RefinementListCSSClasses;\r\n    /**\r\n     * Whether the `items` prop contains facet values from the global search or from the search inside the items.\r\n     */\r\n    isFromSearch: boolean;\r\n};\r\n\r\ndeclare type RefinementListOwnCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the root element with no results.\r\n     */\r\n    noResults: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to each item element.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add to each selected element.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS class to add to each label element (when using the default template).\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to each checkbox element (when using the default template).\r\n     */\r\n    checkbox: string | string[];\r\n    /**\r\n     * CSS class to add to each label text element.\r\n     */\r\n    labelText: string | string[];\r\n    /**\r\n     * CSS class to add to the show more element\r\n     */\r\n    showMore: string | string[];\r\n    /**\r\n     * CSS class to add to the disabled show more element\r\n     */\r\n    disabledShowMore: string | string[];\r\n    /**\r\n     * CSS class to add to each count element (when using the default template).\r\n     */\r\n    count: string | string[];\r\n    /**\r\n     * CSS class to add to the searchable container.\r\n     */\r\n    searchBox: string | string[];\r\n}>;\r\n\r\ndeclare type RefinementListOwnTemplates = Partial<{\r\n    /**\r\n     * Item template, provided with `label`, `highlighted`, `value`, `count`, `isRefined`, `url` data properties.\r\n     */\r\n    item: Template<RefinementListItemData>;\r\n    /**\r\n     * Template used for the show more text, provided with `isShowingMore` data property.\r\n     */\r\n    showMoreText: Template<{\r\n        isShowingMore: boolean;\r\n    }>;\r\n    /**\r\n     * Templates to use for search for facet values when there are no results.\r\n     */\r\n    searchableNoResults: Template;\r\n}>;\r\n\r\ndeclare type RefinementListRenderState = {\r\n    /**\r\n     * The list of filtering values returned from Algolia API.\r\n     */\r\n    items: RefinementListItem[];\r\n    /**\r\n     * indicates whether the results are exhaustive (complete)\r\n     */\r\n    hasExhaustiveItems: boolean;\r\n    /**\r\n     * Creates the next state url for a selected refinement.\r\n     */\r\n    createURL: CreateURL<string>;\r\n    /**\r\n     * Action to apply selected refinements.\r\n     */\r\n    refine: (value: string) => void;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEventForFacet;\r\n    /**\r\n     * Searches for values inside the list.\r\n     */\r\n    searchForItems: (query: string) => void;\r\n    /**\r\n     * `true` if the values are from an index search.\r\n     */\r\n    isFromSearch: boolean;\r\n    /**\r\n     * `true` if a refinement can be applied.\r\n     * @MAJOR: reconsider how `canRefine` is computed so it both accounts for the\r\n     * items returned in the main search and in SFFV.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * `true` if the toggleShowMore button can be activated (enough items to display more or\r\n     * already displaying more than `limit` items)\r\n     */\r\n    canToggleShowMore: boolean;\r\n    /**\r\n     * True if the menu is displaying all the menu items.\r\n     */\r\n    isShowingMore: boolean;\r\n    /**\r\n     * Toggles the number of values displayed between `limit` and `showMoreLimit`.\r\n     */\r\n    toggleShowMore: () => void;\r\n};\r\n\r\ndeclare type RefinementListSearchableCSSClasses = Partial<{\r\n    searchableRoot: string | string[];\r\n    searchableForm: string | string[];\r\n    searchableInput: string | string[];\r\n    searchableSubmit: string | string[];\r\n    searchableSubmitIcon: string | string[];\r\n    searchableReset: string | string[];\r\n    searchableResetIcon: string | string[];\r\n    searchableLoadingIndicator: string | string[];\r\n    searchableLoadingIcon: string | string[];\r\n}>;\r\n\r\ndeclare type RefinementListSearchableTemplates = Partial<{\r\n    /**\r\n     * Templates to use for search for facet values submit button.\r\n     */\r\n    searchableSubmit: SearchBoxTemplates['submit'];\r\n    /**\r\n     * Templates to use for search for facet values reset button.\r\n     */\r\n    searchableReset: SearchBoxTemplates['reset'];\r\n    /**\r\n     * Templates to use for the search for facet values loading indicator.\r\n     */\r\n    searchableLoadingIndicator: SearchBoxTemplates['loadingIndicator'];\r\n}>;\r\n\r\ndeclare type RefinementListTemplates = RefinementListOwnTemplates & RefinementListSearchableTemplates;\r\n\r\ndeclare type RefinementListWidget = WidgetFactory<RefinementListWidgetDescription & {\r\n    $$widgetType: 'ais.refinementList';\r\n}, RefinementListConnectorParams, RefinementListWidgetParams>;\r\n\r\ndeclare type RefinementListWidgetDescription = {\r\n    $$type: 'ais.refinementList';\r\n    renderState: RefinementListRenderState;\r\n    indexRenderState: {\r\n        refinementList: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        refinementList: {\r\n            [attribute: string]: string[];\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type RefinementListWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Add a search input to let the user search for more facet values. In order\r\n     * to make this feature work, you need to make the attribute searchable\r\n     * [using the API](https://www.algolia.com/doc/guides/searching/faceting/?language=js#declaring-a-searchable-attribute-for-faceting)\r\n     * or [the dashboard](https://www.algolia.com/explorer/display/)\r\n     */\r\n    searchable?: boolean;\r\n    /**\r\n     * Value of the search field placeholder.\r\n     */\r\n    searchablePlaceholder?: string;\r\n    /**\r\n     * When `false` the search field will become disabled if there are less items\r\n     * to display than the `options.limit`, otherwise the search field is always usable.\r\n     */\r\n    searchableIsAlwaysActive?: boolean;\r\n    /**\r\n     * When activated, it will escape the facet values that are returned from Algolia.\r\n     * In this case, the surrounding tags will always be `<mark></mark>`.\r\n     */\r\n    searchableEscapeFacetValues?: boolean;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: RefinementListTemplates;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: RefinementListCSSClasses;\r\n};\r\n\r\ndeclare type RelatedProductsConnectorParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The `objectIDs` of the items to get related products from.\r\n     */\r\n    objectIDs: string[];\r\n    /**\r\n     * The number of recommendations to retrieve.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * The threshold for the recommendations confidence score (between 0 and 100).\r\n     */\r\n    threshold?: number;\r\n    /**\r\n     * List of search parameters to send.\r\n     */\r\n    fallbackParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * List of search parameters to send.\r\n     */\r\n    queryParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * Whether to escape HTML tags from items string values.\r\n     *\r\n     * @default true\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<Hit<THit>, {\r\n        results: RecommendResponse<AlgoliaHit<THit>>;\r\n    }>;\r\n};\r\n\r\ndeclare type RelatedProductsCSSClasses = Partial<RecommendClassNames>;\r\n\r\ndeclare type RelatedProductsRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The matched recommendations from the Algolia API.\r\n     */\r\n    items: Array<Hit<THit>>;\r\n    /**\r\n     * Sends an event to the Insights middleware.\r\n     */\r\n    sendEvent: SendEventForHits;\r\n};\r\n\r\ndeclare type RelatedProductsTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\r\n    /**\r\n     * Template to use when there are no results.\r\n     */\r\n    empty: Template<RecommendResponse<Hit<THit>>>;\r\n    /**\r\n     * Template to use for the header of the widget.\r\n     */\r\n    header: Template<Pick<Parameters<NonNullable<RelatedProductsProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {\r\n        cssClasses: RecommendClassNames;\r\n    }>;\r\n    /**\r\n     * Template to use for each result. This template will receive an object containing a single record.\r\n     */\r\n    item: TemplateWithBindEvent<Hit<THit>>;\r\n    /**\r\n     * Template to use to wrap all items.\r\n     */\r\n    layout: Template<Pick<Parameters<NonNullable<RelatedProductsProps<Hit<THit>>['layout']>>[0], 'items'> & {\r\n        templates: {\r\n            item: RelatedProductsProps<Hit<THit>>['itemComponent'];\r\n        };\r\n        cssClasses: Pick<RelatedProductsCSSClasses, 'list' | 'item'>;\r\n    }>;\r\n}>;\r\n\r\ndeclare type RelatedProductsWidgetParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * CSS selector or `HTMLElement` to insert the widget into.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to customize the widget.\r\n     */\r\n    templates?: RelatedProductsTemplates<THit>;\r\n    /**\r\n     * CSS classes to add to the widget elements.\r\n     */\r\n    cssClasses?: RelatedProductsCSSClasses;\r\n};\r\n\r\ndeclare const relevantSort: RelevantSortWidget;\r\n\r\ndeclare type RelevantSortConnector = Connector<RelevantSortWidgetDescription, RelevantSortConnectorParams>;\r\n\r\ndeclare type RelevantSortConnectorParams = Record<string, unknown>;\r\n\r\ndeclare type RelevantSortCSSClasses = Partial<{\r\n    root: string;\r\n    text: string;\r\n    button: string;\r\n}>;\r\n\r\ndeclare type RelevantSortRenderState = {\r\n    /**\r\n     * Indicates if it has appliedRelevancyStrictness greater than zero\r\n     */\r\n    isRelevantSorted: boolean;\r\n    /**\r\n     * Indicates if the results come from a virtual replica\r\n     */\r\n    isVirtualReplica: boolean;\r\n    /**\r\n     * Indicates if search state can be refined\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Sets the value as relevancyStrictness and trigger a new search\r\n     */\r\n    refine: Refine_2;\r\n};\r\n\r\ndeclare type RelevantSortTemplates = Partial<{\r\n    text: Template<{\r\n        isRelevantSorted: boolean;\r\n    }>;\r\n    button: Template<{\r\n        isRelevantSorted: boolean;\r\n    }>;\r\n}>;\r\n\r\ndeclare type RelevantSortWidget = WidgetFactory<RelevantSortWidgetDescription & {\r\n    $$widgetType: 'ais.relevantSort';\r\n}, RelevantSortConnectorParams, RelevantSortWidgetParams>;\r\n\r\ndeclare type RelevantSortWidgetDescription = {\r\n    $$type: 'ais.relevantSort';\r\n    renderState: RelevantSortRenderState;\r\n    indexRenderState: {\r\n        relevantSort: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        relevantSort: number;\r\n    };\r\n};\r\n\r\ndeclare type RelevantSortWidgetParams = {\r\n    container: string | HTMLElement;\r\n    cssClasses?: RelevantSortCSSClasses;\r\n    templates?: RelevantSortTemplates;\r\n};\r\n\r\n/**\r\n * The render function.\r\n */\r\ndeclare type Renderer<TRenderState, TWidgetParams> = (\r\n/**\r\n * The base render options plus the specific options of the widget.\r\n */\r\nrenderState: TRenderState & RendererOptions<TWidgetParams>, \r\n/**\r\n * If is the first run.\r\n */\r\nisFirstRender: boolean) => void;\r\n\r\n/**\r\n * The base renderer options. All render functions receive\r\n * the options below plus the specific options per connector.\r\n */\r\ndeclare type RendererOptions<TWidgetParams> = {\r\n    /**\r\n     * The original widget params. Useful as you may\r\n     * need them while using the render function.\r\n     */\r\n    widgetParams: TWidgetParams;\r\n    /**\r\n     * The current instant search instance.\r\n     */\r\n    instantSearchInstance: InstantSearch;\r\n    /**\r\n     * The original search results.\r\n     */\r\n    results?: SearchResults;\r\n    /**\r\n     * The mutable list of hits. The may change depending\r\n     * of the given transform items function.\r\n     */\r\n    hits?: Hit[];\r\n    /**\r\n     * The current insights client, if any.\r\n     */\r\n    insights?: InsightsClient;\r\n};\r\n\r\ndeclare type RenderOptions = SharedRenderOptions & {\r\n    results: SearchResults | null;\r\n};\r\n\r\ndeclare type RenderState = {\r\n    [indexId: string]: IndexRenderState;\r\n};\r\n\r\ndeclare type RenderStateLifeCycle<TWidgetDescription extends WidgetDescription & WidgetParams> = TWidgetDescription extends RequiredKeys<WidgetDescription, 'renderState' | 'indexRenderState'> & WidgetParams ? RequiredRenderStateLifeCycle<TWidgetDescription> : Partial<RequiredRenderStateLifeCycle<TWidgetDescription>>;\r\n\r\ndeclare function renderTemplate({ templates, templateKey, compileOptions, helpers, data, bindEvent, sendEvent, }: {\r\n    templates: Templates;\r\n    templateKey: string;\r\n    compileOptions?: HoganOptions;\r\n    helpers?: HoganHelpers;\r\n    data?: Record<string, any>;\r\n    bindEvent?: BindEventForHits;\r\n    sendEvent?: SendEventForHits;\r\n}): string | VNode<    {}> | VNode<    {}>[] | null;\r\n\r\ndeclare type RequiredKeys<TObject, TKeys extends keyof TObject> = Expand<Required<Pick<TObject, TKeys>> & Omit<TObject, TKeys>>;\r\n\r\ndeclare type RequiredRenderStateLifeCycle<TWidgetDescription extends WidgetDescription & WidgetParams> = {\r\n    /**\r\n     * Returns the render state of the current widget to pass to the render function.\r\n     */\r\n    getWidgetRenderState: (renderOptions: InitOptions | RenderOptions) => Expand<WidgetRenderState<TWidgetDescription['renderState'], TWidgetDescription['widgetParams']>>;\r\n    /**\r\n     * Returns IndexRenderState of the current index component tree\r\n     * to build the render state of the whole app.\r\n     */\r\n    getRenderState: (renderState: Expand<IndexRenderState & Partial<TWidgetDescription['indexRenderState']>>, renderOptions: InitOptions | RenderOptions) => IndexRenderState & TWidgetDescription['indexRenderState'];\r\n};\r\n\r\ndeclare type RequiredUiStateLifeCycle<TWidgetDescription extends WidgetDescription> = {\r\n    /**\r\n     * This function is required for a widget to be taken in account for routing.\r\n     * It will derive a uiState for this widget based on the existing uiState and\r\n     * the search parameters applied.\r\n     *\r\n     * @param uiState - Current state.\r\n     * @param widgetStateOptions - Extra information to calculate uiState.\r\n     */\r\n    getWidgetUiState: (uiState: Expand<Partial<TWidgetDescription['indexUiState'] & IndexUiState>>, widgetUiStateOptions: {\r\n        searchParameters: SearchParameters;\r\n        helper: AlgoliaSearchHelper;\r\n    }) => Partial<IndexUiState & TWidgetDescription['indexUiState']>;\r\n    /**\r\n     * This function is required for a widget to be taken in account for routing.\r\n     * It will derive a uiState for this widget based on the existing uiState and\r\n     * the search parameters applied.\r\n     *\r\n     * @deprecated Use `getWidgetUiState` instead.\r\n     * @param uiState - Current state.\r\n     * @param widgetStateOptions - Extra information to calculate uiState.\r\n     */\r\n    getWidgetState?: RequiredUiStateLifeCycle<TWidgetDescription>['getWidgetUiState'];\r\n    /**\r\n     * This function is required for a widget to behave correctly when a URL is\r\n     * loaded via e.g. Routing. It receives the current UiState and applied search\r\n     * parameters, and is expected to return a new search parameters.\r\n     *\r\n     * @param state - Applied search parameters.\r\n     * @param widgetSearchParametersOptions - Extra information to calculate next searchParameters.\r\n     */\r\n    getWidgetSearchParameters: (state: SearchParameters, widgetSearchParametersOptions: {\r\n        uiState: Expand<Partial<TWidgetDescription['indexUiState'] & IndexUiState>>;\r\n    }) => SearchParameters;\r\n};\r\n\r\ndeclare type RequiredWidgetLifeCycle<TWidgetDescription extends WidgetDescription> = {\r\n    /**\r\n     * Identifier for connectors and widgets.\r\n     */\r\n    $$type: TWidgetDescription['$$type'];\r\n    /**\r\n     * Called once before the first search.\r\n     */\r\n    init?: (options: InitOptions) => void;\r\n    /**\r\n     * Whether `render` should be called\r\n     */\r\n    shouldRender?: (options: ShouldRenderOptions) => boolean;\r\n    /**\r\n     * Called after each search response has been received.\r\n     */\r\n    render?: (options: RenderOptions) => void;\r\n    /**\r\n     * Called when this widget is unmounted. Used to remove refinements set by\r\n     * during this widget's initialization and life time.\r\n     */\r\n    dispose?: (options: DisposeOptions) => SearchParameters | RecommendParameters | void;\r\n};\r\n\r\ndeclare type RequiredWidgetType<TWidgetDescription extends WidgetDescription> = {\r\n    /**\r\n     * Identifier for widgets.\r\n     */\r\n    $$widgetType: TWidgetDescription['$$widgetType'];\r\n};\r\n\r\ndeclare function ReverseHighlight<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: ReverseHighlightProps<THit>): h.JSX.Element;\r\n\r\n/**\r\n * @deprecated use html tagged templates and the ReverseHighlight component instead\r\n */\r\ndeclare function reverseHighlight({ attribute, highlightedTagName, hit, cssClasses, }: ReverseHighlightOptions): string;\r\n\r\ndeclare type ReverseHighlightClassNames = HighlightClassNames_2;\r\n\r\ndeclare type ReverseHighlightOptions = {\r\n    attribute: string | string[];\r\n    highlightedTagName?: string;\r\n    hit: Partial<Hit>;\r\n    cssClasses?: Partial<{\r\n        highlighted: string;\r\n    }>;\r\n};\r\n\r\ndeclare type ReverseHighlightProps<THit extends Hit<BaseHit>> = {\r\n    hit: THit;\r\n    attribute: keyof THit | string[];\r\n    cssClasses?: ReverseHighlightProps_2['classNames'];\r\n} & PartialKeys<Omit<ReverseHighlightProps_2, 'parts' | 'classNames'>, 'highlightedTagName' | 'nonHighlightedTagName' | 'separator'>;\r\n\r\ndeclare type ReverseHighlightProps_2 = Omit<HighlightProps_3, 'classNames'> & {\r\n    classNames?: Partial<ReverseHighlightClassNames>;\r\n};\r\n\r\ndeclare function ReverseSnippet<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: ReverseSnippetProps<THit>): h.JSX.Element;\r\n\r\n/**\r\n * @deprecated use html tagged templates and the ReverseSnippet component instead\r\n */\r\ndeclare function reverseSnippet({ attribute, highlightedTagName, hit, cssClasses, }: ReverseSnippetOptions): string;\r\n\r\ndeclare type ReverseSnippetClassNames = HighlightClassNames_2;\r\n\r\ndeclare type ReverseSnippetOptions = {\r\n    attribute: string | string[];\r\n    highlightedTagName?: string;\r\n    hit: Partial<Hit>;\r\n    cssClasses?: Partial<{\r\n        highlighted: string;\r\n    }>;\r\n};\r\n\r\ndeclare type ReverseSnippetProps<THit extends Hit<BaseHit>> = {\r\n    hit: THit;\r\n    attribute: keyof THit | string[];\r\n    cssClasses?: ReverseSnippetProps_2['classNames'];\r\n} & PartialKeys<Omit<ReverseSnippetProps_2, 'parts' | 'classNames'>, 'highlightedTagName' | 'nonHighlightedTagName' | 'separator'>;\r\n\r\ndeclare type ReverseSnippetProps_2 = Omit<HighlightProps_3, 'classNames'> & {\r\n    classNames?: Partial<ReverseSnippetClassNames>;\r\n};\r\n\r\n/**\r\n * The router is the part that saves and reads the object from the storage.\r\n * Usually this is the URL.\r\n */\r\ndeclare type Router<TRouteState = UiState> = {\r\n    /**\r\n     * onUpdate Sets an event listener that is triggered when the storage is updated.\r\n     * The function should accept a callback to trigger when the update happens.\r\n     * In the case of the history / URL in a browser, the callback will be called\r\n     * by `onPopState`.\r\n     */\r\n    onUpdate: (callback: (route: TRouteState) => void) => void;\r\n    /**\r\n     * Reads the storage and gets a route object. It does not take parameters,\r\n     * and should return an object\r\n     */\r\n    read: () => TRouteState;\r\n    /**\r\n     * Pushes a route object into a storage. Takes the UI state mapped by the state\r\n     * mapping configured in the mapping\r\n     */\r\n    write: (route: TRouteState) => void;\r\n    /**\r\n     * Transforms a route object into a URL. It receives an object and should\r\n     * return a string. It may return an empty string.\r\n     */\r\n    createURL: (state: TRouteState) => string;\r\n    /**\r\n     * Called when InstantSearch is disposed. Used to remove subscriptions.\r\n     */\r\n    dispose: () => void;\r\n    /**\r\n     * Called when InstantSearch is started.\r\n     */\r\n    start?: () => void;\r\n    /**\r\n     * Identifier for this router. Used to differentiate between routers.\r\n     */\r\n    $$type?: string;\r\n};\r\n\r\ndeclare type RouterProps<TUiState extends UiState = UiState, TRouteState = TUiState> = {\r\n    router?: Router<TRouteState>;\r\n    stateMapping?: StateMapping<TUiState, TRouteState>;\r\n};\r\n\r\ndeclare namespace routers {\r\n    export {\r\n        historyRouter as history\r\n    }\r\n}\r\n\r\ndeclare type ScopedResult = {\r\n    indexId: string;\r\n    results: SearchResults | null;\r\n    helper: AlgoliaSearchHelper;\r\n};\r\n\r\ndeclare const searchBox: SearchBoxWidget;\r\n\r\ndeclare type SearchBoxComponentCSSClasses = ComponentCSSClasses<SearchBoxCSSClasses>;\r\n\r\ndeclare type SearchBoxConnector = Connector<SearchBoxWidgetDescription, SearchBoxConnectorParams>;\r\n\r\ndeclare type SearchBoxConnectorParams = {\r\n    /**\r\n     * A function that will be called every time\r\n     * a new value for the query is set. The first parameter is the query and the second is a\r\n     * function to actually trigger the search. The function takes the query as the parameter.\r\n     *\r\n     * This queryHook can be used to debounce the number of searches done from the searchBox.\r\n     */\r\n    queryHook?: (query: string, hook: (value: string) => void) => void;\r\n};\r\n\r\ndeclare type SearchBoxCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the wrapping `<div>`\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the form\r\n     */\r\n    form: string | string[];\r\n    /**\r\n     * CSS class to add to the input.\r\n     */\r\n    input: string | string[];\r\n    /**\r\n     * CSS classes added to the submit button.\r\n     */\r\n    submit: string | string[];\r\n    /**\r\n     * CSS classes added to the submit icon.\r\n     */\r\n    submitIcon: string | string[];\r\n    /**\r\n     * CSS classes added to the reset button.\r\n     */\r\n    reset: string | string[];\r\n    /**\r\n     * CSS classes added to the reset icon.\r\n     */\r\n    resetIcon: string | string[];\r\n    /**\r\n     * CSS classes added to the loading indicator element.\r\n     */\r\n    loadingIndicator: string | string[];\r\n    /**\r\n     * CSS classes added to the loading indicator icon.\r\n     */\r\n    loadingIcon: string | string[];\r\n}>;\r\n\r\n/**\r\n * @typedef {Object} CustomSearchBoxWidgetParams@typedef {Object} CustomSearchBoxWidgetParams\r\n * @property {function(string, function(string))} [queryHook = undefined] A function that will be called every time\r\n * a new value for the query is set. The first parameter is the query and the second is a\r\n * function to actually trigger the search. The function takes the query as the parameter.\r\n *\r\n * This queryHook can be used to debounce the number of searches done from the searchBox.\r\n */\r\ndeclare type SearchBoxRenderState = {\r\n    /**\r\n     * The query from the last search.\r\n     */\r\n    query: string;\r\n    /**\r\n     * Sets a new query and searches.\r\n     */\r\n    refine: (value: string) => void;\r\n    /**\r\n     * Remove the query and perform search.\r\n     */\r\n    clear: () => void;\r\n    /**\r\n     * `true` if the search results takes more than a certain time to come back\r\n     * from Algolia servers. This can be configured on the InstantSearch constructor with the attribute\r\n     * `stalledSearchDelay` which is 200ms, by default.\r\n     * @deprecated use `instantSearchInstance.status` instead\r\n     */\r\n    isSearchStalled: boolean;\r\n};\r\n\r\ndeclare type SearchBoxTemplates = Partial<{\r\n    /**\r\n     * Template used for displaying the submit button. Can accept a function or a Hogan string.\r\n     */\r\n    submit: Template<{\r\n        cssClasses: SearchBoxComponentCSSClasses;\r\n    }>;\r\n    /**\r\n     * Template used for displaying the reset button. Can accept a function or a Hogan string.\r\n     */\r\n    reset: Template<{\r\n        cssClasses: SearchBoxComponentCSSClasses;\r\n    }>;\r\n    /**\r\n     * Template used for displaying the loading indicator. Can accept a function or a Hogan string.\r\n     */\r\n    loadingIndicator: Template<{\r\n        cssClasses: SearchBoxComponentCSSClasses;\r\n    }>;\r\n}>;\r\n\r\n/**\r\n * The searchbox widget is used to let the user set a text based query.\r\n *\r\n * This is usually the  main entry point to start the search in an instantsearch context. For that\r\n * reason is usually placed on top, and not hidden so that the user can start searching right\r\n * away.\r\n *\r\n */\r\ndeclare type SearchBoxWidget = WidgetFactory<SearchBoxWidgetDescription & {\r\n    $$widgetType: 'ais.searchBox';\r\n}, SearchBoxConnectorParams, SearchBoxWidgetParams>;\r\n\r\ndeclare type SearchBoxWidgetDescription = {\r\n    $$type: 'ais.searchBox';\r\n    renderState: SearchBoxRenderState;\r\n    indexRenderState: {\r\n        searchBox: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        query: string;\r\n    };\r\n};\r\n\r\ndeclare type SearchBoxWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * The placeholder of the input\r\n     */\r\n    placeholder?: string;\r\n    /**\r\n     * Whether the input should be autofocused\r\n     */\r\n    autofocus?: boolean;\r\n    /**\r\n     * If set, trigger the search\r\n     * once `<Enter>` is pressed only.\r\n     */\r\n    searchAsYouType?: boolean;\r\n    /**\r\n     * Whether to update the search state in the middle of a\r\n     * composition session.\r\n     * @default false\r\n     */\r\n    ignoreCompositionEvents?: boolean;\r\n    /**\r\n     * Whether to show the reset button\r\n     */\r\n    showReset?: boolean;\r\n    /**\r\n     * Whether to show the submit button\r\n     */\r\n    showSubmit?: boolean;\r\n    /**\r\n     * Whether to show the loading indicator (replaces the submit if\r\n     * the search is stalled)\r\n     */\r\n    showLoadingIndicator?: boolean;\r\n    /**\r\n     * CSS classes to add\r\n     */\r\n    cssClasses?: SearchBoxCSSClasses;\r\n    /**\r\n     * Templates used for customizing the rendering of the searchbox\r\n     */\r\n    templates?: SearchBoxTemplates;\r\n    /**\r\n     * A function that is called every time a new search is done. You\r\n     * will get the query as the first parameter and a search (query) function to call as the second parameter.\r\n     * This `queryHook` can be used to debounce the number of searches done from the search box.\r\n     */\r\n    queryHook?: (query: string, hook: (value: string) => void) => void;\r\n};\r\n\r\ndeclare type SearchWidget<TWidgetDescription extends WidgetDescription> = {\r\n    dependsOn?: 'search';\r\n    getWidgetParameters?: (state: SearchParameters, widgetParametersOptions: {\r\n        uiState: Expand<Partial<TWidgetDescription['indexUiState'] & IndexUiState>>;\r\n    }) => SearchParameters;\r\n};\r\n\r\ndeclare type SendEvent = (...args: [InsightsEvent] | [string, string, string?]) => void;\r\n\r\ndeclare type SendEventForFacet = BuiltInSendEventForFacet & CustomSendEventForFacet;\r\n\r\ndeclare type SendEventForHits = BuiltInSendEventForHits & CustomSendEventForHits;\r\n\r\ndeclare type SendEventForToggle = BuiltInSendEventForToggle & CustomSendEventForToggle;\r\n\r\ndeclare type SharedRenderOptions = {\r\n    instantSearchInstance: InstantSearch;\r\n    parent: IndexWidget;\r\n    templatesConfig: Record<string, unknown>;\r\n    scopedResults: ScopedResult[];\r\n    state: SearchParameters;\r\n    renderState: IndexRenderState;\r\n    helper: AlgoliaSearchHelper;\r\n    /** @deprecated use `status` instead */\r\n    searchMetadata: {\r\n        /** @deprecated use `status === \"stalled\"` instead */\r\n        isSearchStalled: boolean;\r\n    };\r\n    status: InstantSearch['status'];\r\n    error: InstantSearch['error'];\r\n    createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n};\r\n\r\ndeclare type ShouldRenderOptions = {\r\n    instantSearchInstance: InstantSearch;\r\n};\r\n\r\ndeclare function simpleStateMapping<TUiState extends UiState = UiState>(): StateMapping<TUiState, TUiState>;\r\n\r\ndeclare function singleIndexStateMapping<TUiState extends UiState = UiState>(indexName: keyof TUiState): StateMapping<TUiState, TUiState[typeof indexName]>;\r\n\r\ndeclare function Snippet<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: SnippetProps<THit>): h.JSX.Element;\r\n\r\n/**\r\n * @deprecated use html tagged templates and the Snippet component instead\r\n */\r\ndeclare function snippet({ attribute, highlightedTagName, hit, cssClasses, }: SnippetOptions): string;\r\n\r\ndeclare type SnippetClassNames = HighlightClassNames_2;\r\n\r\ndeclare type SnippetOptions = {\r\n    attribute: string | string[];\r\n    highlightedTagName?: string;\r\n    hit: Partial<Hit>;\r\n    cssClasses?: {\r\n        highlighted?: string;\r\n    };\r\n};\r\n\r\ndeclare type SnippetProps<THit extends Hit<BaseHit>> = {\r\n    hit: THit;\r\n    attribute: keyof THit | string[];\r\n    cssClasses?: SnippetProps_2['classNames'];\r\n} & PartialKeys<Omit<SnippetProps_2, 'parts' | 'classNames'>, 'highlightedTagName' | 'nonHighlightedTagName' | 'separator'>;\r\n\r\ndeclare type SnippetProps_2 = Omit<HighlightProps_3, 'classNames'> & {\r\n    classNames?: Partial<SnippetClassNames>;\r\n};\r\n\r\n/**\r\n * Transforms the given items.\r\n */\r\ndeclare type SortBy<TItem> = ((a: TItem, b: TItem) => number) | Array<SortByDirection<'count' | 'name' | 'isRefined'>>;\r\n\r\n/**\r\n * Sort by selector is a widget used for letting the user choose between different\r\n * indices that contains the same data with a different order / ranking formula.\r\n */\r\ndeclare const sortBy: SortByWidget;\r\n\r\ndeclare type SortByConnector = Connector<SortByWidgetDescription, SortByConnectorParams>;\r\n\r\ndeclare type SortByConnectorParams = {\r\n    /**\r\n     * Array of objects defining the different indices to choose from.\r\n     */\r\n    items: SortByItem[];\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<SortByItem>;\r\n};\r\n\r\ndeclare type SortByDirection<TCriterion extends string> = TCriterion | `${TCriterion}:asc` | `${TCriterion}:desc`;\r\n\r\ndeclare type SortByIndexDefinition = {\r\n    /**\r\n     * The name of the index to target.\r\n     */\r\n    value: string;\r\n    /**\r\n     * The label of the index to display.\r\n     */\r\n    label: string;\r\n};\r\n\r\n/**\r\n * The **SortBy** connector provides the logic to build a custom widget that will display a\r\n * list of indices. With Algolia, this is most commonly used for changing ranking strategy. This allows\r\n * a user to change how the hits are being sorted.\r\n */\r\ndeclare type SortByItem = {\r\n    /**\r\n     * The name of the index to target.\r\n     */\r\n    value: string;\r\n    /**\r\n     * The label of the index to display.\r\n     */\r\n    label: string;\r\n};\r\n\r\ndeclare type SortByRenderState = {\r\n    /**\r\n     * The initially selected index.\r\n     */\r\n    initialIndex?: string;\r\n    /**\r\n     * The currently selected index.\r\n     */\r\n    currentRefinement: string;\r\n    /**\r\n     * All the available indices\r\n     */\r\n    options: SortByItem[];\r\n    /**\r\n     * Switches indices and triggers a new search.\r\n     */\r\n    refine: (value: string) => void;\r\n    /**\r\n     * `true` if the last search contains no result.\r\n     * @deprecated Use `canRefine` instead.\r\n     */\r\n    hasNoResults: boolean;\r\n    /**\r\n     * `true` if we can refine.\r\n     */\r\n    canRefine: boolean;\r\n};\r\n\r\ndeclare type SortByWidget = WidgetFactory<SortByWidgetDescription & {\r\n    $$widgetType: 'ais.sortBy';\r\n}, SortByConnectorParams, SortByWidgetParams>;\r\n\r\ndeclare type SortByWidgetCssClasses = Partial<{\r\n    /**\r\n     * CSS classes added to the outer `<div>`.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS classes added to the parent `<select>`.\r\n     */\r\n    select: string | string[];\r\n    /**\r\n     * CSS classes added to each `<option>`.\r\n     */\r\n    option: string | string[];\r\n}>;\r\n\r\ndeclare type SortByWidgetDescription = {\r\n    $$type: 'ais.sortBy';\r\n    renderState: SortByRenderState;\r\n    indexRenderState: {\r\n        sortBy: WidgetRenderState<SortByRenderState, SortByConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        sortBy: string;\r\n    };\r\n};\r\n\r\ndeclare type SortByWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Array of objects defining the different indices to choose from.\r\n     */\r\n    items: SortByIndexDefinition[];\r\n    /**\r\n     * CSS classes to be added.\r\n     */\r\n    cssClasses?: SortByWidgetCssClasses;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<SortByItem>;\r\n};\r\n\r\ndeclare type StarRatingItems = {\r\n    /**\r\n     * Name corresponding to the number of stars.\r\n     */\r\n    name: string;\r\n    /**\r\n     * Human-readable name corresponding to the number of stars.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Number of stars as string.\r\n     */\r\n    value: string;\r\n    /**\r\n     * Count of matched results corresponding to the number of stars.\r\n     */\r\n    count: number;\r\n    /**\r\n     *  Array of length of maximum rating value with stars to display or not.\r\n     */\r\n    stars: boolean[];\r\n    /**\r\n     * Indicates if star rating refinement is applied.\r\n     */\r\n    isRefined: boolean;\r\n};\r\n\r\n/**\r\n * The state mapping is a way to customize the structure before sending it to the router.\r\n * It can transform and filter out the properties. To work correctly, the following\r\n * should be valid for any UiState:\r\n * `UiState = routeToState(stateToRoute(UiState))`.\r\n */\r\ndeclare type StateMapping<TUiState = UiState, TRouteState = TUiState> = {\r\n    /**\r\n     * Transforms a UI state representation into a route object.\r\n     * It receives an object that contains the UI state of all the widgets in the page.\r\n     * It should return an object of any form as long as this form can be read by\r\n     * the `routeToState` function.\r\n     */\r\n    stateToRoute: (uiState: TUiState) => TRouteState;\r\n    /**\r\n     * Transforms route object into a UI state representation.\r\n     * It receives an object that contains the UI state stored by the router.\r\n     * The format is the output of `stateToRoute`.\r\n     */\r\n    routeToState: (routeState: TRouteState) => TUiState;\r\n    /**\r\n     * Identifier for this stateMapping. Used to differentiate between stateMappings.\r\n     */\r\n    $$type?: string;\r\n};\r\n\r\ndeclare namespace stateMappings {\r\n    export {\r\n        simpleStateMapping as simple,\r\n        singleIndexStateMapping as singleIndex\r\n    }\r\n}\r\n\r\ndeclare type StaticOptions = Places.StaticOptions;\r\n\r\n/**\r\n * The `stats` widget is used to display useful insights about the current results.\r\n *\r\n * By default, it will display the **number of hits** and the time taken to compute the\r\n * results inside the engine.\r\n */\r\ndeclare const stats: StatsWidget;\r\n\r\ndeclare type StatsConnector = Connector<StatsWidgetDescription, StatsConnectorParams>;\r\n\r\ndeclare type StatsConnectorParams = Record<string, unknown>;\r\n\r\ndeclare type StatsCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the text span element.\r\n     */\r\n    text: string | string[];\r\n}>;\r\n\r\n/**\r\n * **Stats** connector provides the logic to build a custom widget that will displays\r\n * search statistics (hits number and processing time).\r\n */\r\ndeclare type StatsRenderState = {\r\n    /**\r\n     * The maximum number of hits per page returned by Algolia.\r\n     */\r\n    hitsPerPage?: number;\r\n    /**\r\n     * The number of hits in the result set.\r\n     */\r\n    nbHits: number;\r\n    /**\r\n     * The number of sorted hits in the result set (when using Relevant sort).\r\n     */\r\n    nbSortedHits?: number;\r\n    /**\r\n     * Indicates whether the index is currently using Relevant sort and is displaying only sorted hits.\r\n     */\r\n    areHitsSorted: boolean;\r\n    /**\r\n     * The number of pages computed for the result set.\r\n     */\r\n    nbPages: number;\r\n    /**\r\n     * The current page.\r\n     */\r\n    page: number;\r\n    /**\r\n     * The time taken to compute the results inside the Algolia engine.\r\n     */\r\n    processingTimeMS: number;\r\n    /**\r\n     * The query used for the current search.\r\n     */\r\n    query: string;\r\n};\r\n\r\ndeclare type StatsTemplates = Partial<{\r\n    /**\r\n     * Text template, provided with `hasManyResults`, `hasNoResults`, `hasOneResult`, `hasNoSortedResults`, `hasOneSortedResults`, `hasManySortedResults`, `hitsPerPage`, `nbHits`, `nbSortedHits`, `nbPages`, `areHitsSorted`, `page`, `processingTimeMS`, `query`.\r\n     */\r\n    text: Template<TextTemplateProps & StatsRenderState>;\r\n}>;\r\n\r\ndeclare type StatsWidget = WidgetFactory<StatsWidgetDescription & {\r\n    $$widgetType: 'ais.stats';\r\n}, StatsConnectorParams, StatsWidgetParams>;\r\n\r\ndeclare type StatsWidgetDescription = {\r\n    $$type: 'ais.stats';\r\n    renderState: StatsRenderState;\r\n    indexRenderState: {\r\n        stats: WidgetRenderState<StatsRenderState, StatsConnectorParams>;\r\n    };\r\n};\r\n\r\ndeclare type StatsWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: StatsTemplates;\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: StatsCSSClasses;\r\n};\r\n\r\ndeclare type Status = 'initial' | 'askingPermission' | 'waiting' | 'recognizing' | 'finished' | 'error';\r\n\r\ndeclare type Template<TTemplateData = void> = string | ((data: TTemplateData, params: TemplateParams) => VNode | VNode[] | string | null);\r\n\r\ndeclare type Template_2 = (params: {\r\n    html: typeof html;\r\n}) => VNode_2 | VNode_2[] | null;\r\n\r\ndeclare type TemplateParams = {\r\n    html: typeof html;\r\n    components: {\r\n        Highlight: typeof Highlight_2;\r\n        ReverseHighlight: typeof ReverseHighlight;\r\n        Snippet: typeof Snippet;\r\n        ReverseSnippet: typeof ReverseSnippet;\r\n    };\r\n    sendEvent?: SendEventForHits;\r\n};\r\n\r\ndeclare type Templates = {\r\n    [key: string]: Template<any> | TemplateWithBindEvent<any> | undefined;\r\n};\r\n\r\ndeclare namespace templates {\r\n    export {\r\n        carousel\r\n    }\r\n}\r\n\r\ndeclare type TemplatesConfig = {\r\n    helpers?: HoganHelpers;\r\n    compileOptions?: HoganOptions;\r\n};\r\n\r\ndeclare type TemplateWithBindEvent<TTemplateData = void> = string | ((data: TTemplateData, params: TemplateWithBindEventParams) => VNode | VNode[] | string);\r\n\r\ndeclare interface TemplateWithBindEventParams extends TemplateParams {\r\n    /** @deprecated use sendEvent instead */\r\n    (...args: Parameters<BuiltInBindEventForHits>): ReturnType<BuiltInBindEventForHits>;\r\n    /** @deprecated use sendEvent instead */\r\n    (...args: Parameters<CustomBindEventForHits>): ReturnType<CustomBindEventForHits>;\r\n    sendEvent: SendEventForHits;\r\n}\r\n\r\ndeclare type TextTemplateProps = {\r\n    hasManyResults: boolean;\r\n    hasNoResults: boolean;\r\n    hasOneResult: boolean;\r\n    hasNoSortedResults: boolean;\r\n    hasOneSortedResults: boolean;\r\n    hasManySortedResults: boolean;\r\n};\r\n\r\n/**\r\n * The toggleRefinement widget lets the user either:\r\n *  - switch between two values for a single facetted attribute (free_shipping / not_free_shipping)\r\n *  - toggleRefinement a faceted value on and off (only 'canon' for brands)\r\n *\r\n * This widget is particularly useful if you have a boolean value in the records.\r\n *\r\n * @requirements\r\n * The attribute passed to `attribute` must be declared as an\r\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\r\n * in your Algolia settings.\r\n */\r\ndeclare const toggleRefinement: ToggleRefinementWidget;\r\n\r\ndeclare type ToggleRefinementConnector = Connector<ToggleRefinementWidgetDescription, ToggleRefinementConnectorParams>;\r\n\r\ndeclare type ToggleRefinementConnectorParams = {\r\n    /**\r\n     * Name of the attribute for faceting (e.g., \"free_shipping\").\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * Value to filter on when toggled.\r\n     * @default \"true\"\r\n     */\r\n    on?: FacetValue | FacetValue[];\r\n    /**\r\n     * Value to filter on when not toggled.\r\n     */\r\n    off?: FacetValue | FacetValue[];\r\n};\r\n\r\ndeclare type ToggleRefinementCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the label wrapping element.\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to the checkbox.\r\n     */\r\n    checkbox: string | string[];\r\n    /**\r\n     * CSS class to add to the label text.\r\n     */\r\n    labelText: string | string[];\r\n}>;\r\n\r\ndeclare type ToggleRefinementRenderState = {\r\n    /** The current toggle value */\r\n    value: {\r\n        /**\r\n         * The attribute name of this toggle.\r\n         */\r\n        name: string;\r\n        /**\r\n         * Whether the current option is \"on\" (true) or \"off\" (false)\r\n         */\r\n        isRefined: boolean;\r\n        /**\r\n         * Number of results if this option is toggled.\r\n         */\r\n        count: number | null;\r\n        /**\r\n         * Information about the \"on\" toggle.\r\n         */\r\n        onFacetValue: ToggleRefinementValue;\r\n        /**\r\n         * Information about the \"off\" toggle.\r\n         */\r\n        offFacetValue: ToggleRefinementValue;\r\n    };\r\n    /**\r\n     * Creates an URL for the next state.\r\n     */\r\n    createURL: CreateURL<void>;\r\n    /**\r\n     * Send a \"Facet Clicked\" Insights event.\r\n     */\r\n    sendEvent: SendEventForToggle;\r\n    /**\r\n     * Indicates if search state can be refined.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Updates to the next state by applying the toggle refinement.\r\n     */\r\n    refine: (value?: {\r\n        isRefined: boolean;\r\n    }) => void;\r\n};\r\n\r\ndeclare type ToggleRefinementTemplates = Partial<{\r\n    /**\r\n     * the text that describes the toggle action\r\n     */\r\n    labelText: Template<ToggleRefinementRenderState['value']>;\r\n}>;\r\n\r\ndeclare type ToggleRefinementValue = {\r\n    /**\r\n     * Whether this option is enabled.\r\n     */\r\n    isRefined: boolean;\r\n    /**\r\n     * Number of result if this option is toggled.\r\n     */\r\n    count: number | null;\r\n};\r\n\r\ndeclare type ToggleRefinementWidget = WidgetFactory<ToggleRefinementWidgetDescription & {\r\n    $$widgetType: 'ais.toggleRefinement';\r\n}, ToggleRefinementConnectorParams, ToggleRefinementWidgetParams>;\r\n\r\ndeclare type ToggleRefinementWidgetDescription = {\r\n    $$type: 'ais.toggleRefinement';\r\n    renderState: ToggleRefinementRenderState;\r\n    indexRenderState: {\r\n        toggleRefinement: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        toggle: {\r\n            [attribute: string]: boolean;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type ToggleRefinementWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: ToggleRefinementTemplates;\r\n    /**\r\n     * CSS classes to be added.\r\n     */\r\n    cssClasses?: ToggleRefinementCSSClasses;\r\n};\r\n\r\ndeclare type TrackedFilterRefinement = string | number | boolean;\r\n\r\n/**\r\n * Transforms the given items.\r\n */\r\ndeclare type TransformItems<TItem, TMetadata = TransformItemsMetadata> = (items: TItem[], metadata: TMetadata) => TItem[];\r\n\r\ndeclare type TransformItemsMetadata = {\r\n    results: SearchResults | undefined | null;\r\n};\r\n\r\ndeclare type TransformSearchParameters = (searchParameters: SearchParameters) => PlainSearchParameters;\r\n\r\ndeclare type TrendingItemsConnectorParams<THit extends NonNullable<object> = BaseHit> = ({\r\n    /**\r\n     * The facet attribute to get recommendations for.\r\n     */\r\n    facetName: string;\r\n    /**\r\n     * The facet value to get recommendations for.\r\n     */\r\n    facetValue: string;\r\n} | {\r\n    facetName?: string;\r\n    facetValue?: string;\r\n}) & {\r\n    /**\r\n     * The number of recommendations to retrieve.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * The threshold for the recommendations confidence score (between 0 and 100).\r\n     */\r\n    threshold?: number;\r\n    /**\r\n     * List of search parameters to send.\r\n     */\r\n    fallbackParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * List of search parameters to send.\r\n     */\r\n    queryParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * Whether to escape HTML tags from items string values.\r\n     *\r\n     * @default true\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<Hit<THit>, {\r\n        results: RecommendResponse<AlgoliaHit<THit>>;\r\n    }>;\r\n};\r\n\r\ndeclare type TrendingItemsCSSClasses = Partial<RecommendClassNames>;\r\n\r\ndeclare type TrendingItemsRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The matched recommendations from the Algolia API.\r\n     */\r\n    items: Array<Hit<THit>>;\r\n    /**\r\n     * Sends an event to the Insights middleware.\r\n     */\r\n    sendEvent: SendEventForHits;\r\n};\r\n\r\ndeclare type TrendingItemsTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\r\n    /**\r\n     * Template to use when there are no results.\r\n     */\r\n    empty: Template<RecommendResponse<Hit<THit>>>;\r\n    /**\r\n     * Template to use for the header of the widget.\r\n     */\r\n    header: Template<Pick<Parameters<NonNullable<TrendingItemsProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {\r\n        cssClasses: RecommendClassNames;\r\n    }>;\r\n    /**\r\n     * Template to use for each result. This template will receive an object containing a single record.\r\n     */\r\n    item: TemplateWithBindEvent<Hit<THit>>;\r\n    /**\r\n     * Template to use to wrap all items.\r\n     */\r\n    layout: Template<Pick<Parameters<NonNullable<TrendingItemsProps<Hit<THit>>['layout']>>[0], 'items'> & {\r\n        templates: {\r\n            item: TrendingItemsProps<Hit<THit>>['itemComponent'];\r\n        };\r\n        cssClasses: Pick<TrendingItemsCSSClasses, 'list' | 'item'>;\r\n    }>;\r\n}>;\r\n\r\ndeclare type TrendingItemsWidgetParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * CSS selector or `HTMLElement` to insert the widget into.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to customize the widget.\r\n     */\r\n    templates?: TrendingItemsTemplates<THit>;\r\n    /**\r\n     * CSS classes to add to the widget elements.\r\n     */\r\n    cssClasses?: TrendingItemsCSSClasses;\r\n};\r\n\r\ndeclare type UiState = {\r\n    [indexId: string]: IndexUiState;\r\n};\r\n\r\ndeclare type UiStateLifeCycle<TWidgetDescription extends WidgetDescription> = TWidgetDescription extends RequiredKeys<WidgetDescription, 'indexUiState'> ? RequiredUiStateLifeCycle<TWidgetDescription> : Partial<RequiredUiStateLifeCycle<TWidgetDescription>>;\r\n\r\ndeclare type UnknownWidgetParams = NonNullable<object>;\r\n\r\n/**\r\n * The called function when unmounting a widget.\r\n */\r\ndeclare type Unmounter = () => void;\r\n\r\ndeclare type VoiceListeningState = {\r\n    status: Status;\r\n    transcript: string;\r\n    isSpeechFinal: boolean;\r\n    errorCode?: string;\r\n};\r\n\r\ndeclare const voiceSearch: VoiceSearchWidget;\r\n\r\ndeclare type VoiceSearchConnector = Connector<VoiceSearchWidgetDescription, VoiceSearchConnectorParams>;\r\n\r\ndeclare type VoiceSearchConnectorParams = {\r\n    searchAsYouSpeak?: boolean;\r\n    language?: string;\r\n    additionalQueryParameters?: (params: {\r\n        query: string;\r\n    }) => PlainSearchParameters | void;\r\n    createVoiceSearchHelper?: CreateVoiceSearchHelper;\r\n};\r\n\r\ndeclare type VoiceSearchCSSClasses = Partial<{\r\n    root: string | string[];\r\n    button: string | string[];\r\n    status: string | string[];\r\n}>;\r\n\r\ndeclare type VoiceSearchHelper = {\r\n    getState: () => VoiceListeningState;\r\n    isBrowserSupported: () => boolean;\r\n    isListening: () => boolean;\r\n    startListening: () => void;\r\n    stopListening: () => void;\r\n    dispose: () => void;\r\n};\r\n\r\ndeclare type VoiceSearchHelperParams = {\r\n    searchAsYouSpeak: boolean;\r\n    language?: string;\r\n    onQueryChange: (query: string) => void;\r\n    onStateChange: () => void;\r\n};\r\n\r\ndeclare type VoiceSearchRenderState = {\r\n    isBrowserSupported: boolean;\r\n    isListening: boolean;\r\n    toggleListening: () => void;\r\n    voiceListeningState: VoiceListeningState;\r\n};\r\n\r\ndeclare type VoiceSearchTemplateProps = {\r\n    status: string;\r\n    errorCode: string;\r\n    isListening: boolean;\r\n    transcript: string;\r\n    isSpeechFinal: boolean;\r\n    isBrowserSupported: boolean;\r\n};\r\n\r\ndeclare type VoiceSearchTemplates = Partial<{\r\n    buttonText: Template<VoiceSearchTemplateProps>;\r\n    status: Template<VoiceSearchTemplateProps>;\r\n}>;\r\n\r\ndeclare type VoiceSearchWidget = WidgetFactory<VoiceSearchWidgetDescription & {\r\n    $$type: 'ais.voiceSearch';\r\n}, VoiceSearchConnectorParams, VoiceSearchWidgetParams>;\r\n\r\ndeclare type VoiceSearchWidgetDescription = {\r\n    $$type: 'ais.voiceSearch';\r\n    renderState: VoiceSearchRenderState;\r\n    indexRenderState: {\r\n        voiceSearch: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        query: string;\r\n    };\r\n};\r\n\r\ndeclare type VoiceSearchWidgetParams = {\r\n    container: string | HTMLElement;\r\n    cssClasses?: VoiceSearchCSSClasses;\r\n    templates?: VoiceSearchTemplates;\r\n    searchAsYouSpeak?: boolean;\r\n    language?: string;\r\n    additionalQueryParameters?: (params: {\r\n        query: string;\r\n    }) => PlainSearchParameters | void;\r\n    createVoiceSearchHelper?: CreateVoiceSearchHelper;\r\n};\r\n\r\ndeclare type Widget<TWidgetDescription extends WidgetDescription & WidgetParams = {\r\n    $$type: string;\r\n}> = Expand<RequiredWidgetLifeCycle<TWidgetDescription> & WidgetType<TWidgetDescription> & UiStateLifeCycle<TWidgetDescription> & RenderStateLifeCycle<TWidgetDescription>> & (SearchWidget<TWidgetDescription> | RecommendWidget<TWidgetDescription>);\r\n\r\ndeclare type WidgetDescription = {\r\n    $$type: string;\r\n    $$widgetType?: string;\r\n    renderState?: Record<string, unknown>;\r\n    indexRenderState?: Record<string, unknown>;\r\n    indexUiState?: Record<string, unknown>;\r\n};\r\n\r\n/**\r\n * The function that creates a new widget.\r\n */\r\ndeclare type WidgetFactory<TWidgetDescription extends WidgetDescription, TConnectorParams extends UnknownWidgetParams, TWidgetParams extends UnknownWidgetParams> = (\r\n/**\r\n * The params of the widget.\r\n */\r\nwidgetParams: TWidgetParams & TConnectorParams) => Widget<TWidgetDescription & {\r\n    widgetParams: TConnectorParams;\r\n}>;\r\n\r\ndeclare type WidgetParams = {\r\n    widgetParams?: UnknownWidgetParams;\r\n};\r\n\r\ndeclare type WidgetRenderState<TWidgetRenderState, TWidgetParams> = TWidgetRenderState & {\r\n    widgetParams: TWidgetParams;\r\n};\r\n\r\ndeclare type WidgetRenderStates = AnalyticsWidgetDescription['indexRenderState'] & PlacesWidgetDescription['indexRenderState'];\r\n\r\ndeclare namespace widgets {\r\n    export {\r\n        EXPERIMENTAL_answers,\r\n        EXPERIMENTAL_configureRelatedItems,\r\n        EXPERIMENTAL_dynamicWidgets,\r\n        dynamicWidgets,\r\n        analytics,\r\n        breadcrumb,\r\n        clearRefinements,\r\n        configure,\r\n        currentRefinements,\r\n        _default_8 as geoSearch,\r\n        hierarchicalMenu,\r\n        _default_9 as hits,\r\n        hitsPerPage,\r\n        index,\r\n        IndexWidget,\r\n        _default_10 as infiniteHits,\r\n        menu,\r\n        menuSelect,\r\n        numericMenu,\r\n        pagination,\r\n        panel,\r\n        _default_11 as places,\r\n        poweredBy,\r\n        queryRuleContext,\r\n        queryRuleCustomData,\r\n        _default_12 as relatedProducts,\r\n        rangeInput,\r\n        rangeSlider,\r\n        ratingMenu,\r\n        refinementList,\r\n        relevantSort,\r\n        searchBox,\r\n        sortBy,\r\n        stats,\r\n        toggleRefinement,\r\n        _default_13 as trendingItems,\r\n        voiceSearch,\r\n        _default_14 as frequentlyBoughtTogether,\r\n        _default_15 as lookingSimilar\r\n    }\r\n}\r\n\r\ndeclare type WidgetType<TWidgetDescription extends WidgetDescription> = TWidgetDescription extends RequiredKeys<WidgetDescription, '$$widgetType'> ? RequiredWidgetType<TWidgetDescription> : {\r\n    /**\r\n     * Identifier for widgets.\r\n     */\r\n    $$widgetType?: string;\r\n};\r\n\r\ndeclare type WidgetUiStates = PlacesWidgetDescription['indexUiState'];\r\n\r\ndeclare type Write<THit extends NonNullable<object>> = ({ state, hits, }: {\r\n    state: PlainSearchParameters;\r\n    hits: InfiniteHitsCachedHits<THit>;\r\n}) => void;\r\n\r\nexport { }\r\n"
  },
  {
    "path": "js/instantsearch.js/dist/instantsearch.production.min.d.ts",
    "content": "import { AlgoliaSearchHelper } from 'algoliasearch-helper';\r\nimport { Banner } from 'algoliasearch-helper';\r\nimport type { CarouselProps } from 'instantsearch-ui-components';\r\nimport { CompositionClient } from 'algoliasearch-helper/types/algoliasearch.js';\r\nimport EventEmitter from '@algolia/events';\r\nimport { FindAnswersOptions } from 'algoliasearch-helper/types/algoliasearch.js';\r\nimport type { FrequentlyBoughtTogetherProps } from 'instantsearch-ui-components';\r\nimport { h } from 'preact';\r\nimport type { HighlightClassNames as HighlightClassNames_2 } from 'instantsearch-ui-components';\r\nimport type { HighlightProps as HighlightProps_3 } from 'instantsearch-ui-components';\r\nimport type { HitsClassNames } from 'instantsearch-ui-components';\r\nimport type { HoganOptions } from 'hogan.js';\r\nimport { html } from 'htm/preact';\r\nimport type { InsightsClient as InsightsClient_2 } from 'search-insights';\r\nimport type { InsightsMethodMap as InsightsMethodMap_2 } from 'search-insights';\r\nimport type { LookingSimilarProps } from 'instantsearch-ui-components';\r\nimport type * as Places from 'places.js';\r\nimport { PlainSearchParameters } from 'algoliasearch-helper';\r\nimport { default as qs_2 } from 'qs';\r\nimport type { RecommendClassNames } from 'instantsearch-ui-components';\r\nimport { RecommendParameters } from 'algoliasearch-helper';\r\nimport type { RecommendParametersOptions } from 'algoliasearch-helper';\r\nimport { RecommendResponse } from 'algoliasearch-helper/types/algoliasearch.js';\r\nimport type { RecommendResults } from 'algoliasearch-helper';\r\nimport type { RelatedProductsProps } from 'instantsearch-ui-components';\r\nimport { SearchClient } from 'algoliasearch-helper/types/algoliasearch.js';\r\nimport { SearchOptions } from 'algoliasearch-helper/types/algoliasearch.js';\r\nimport { SearchParameters } from 'algoliasearch-helper';\r\nimport { SearchResults } from 'algoliasearch-helper';\r\nimport type { TrendingItemsProps } from 'instantsearch-ui-components';\r\nimport { VNode } from 'preact';\r\nimport type { VNode as VNode_2 } from 'instantsearch-ui-components';\r\n\r\ndeclare type AlgoliaHit<THit extends NonNullable<object> = Record<string, any>> = {\r\n    objectID: string;\r\n    _highlightResult?: HitHighlightResult;\r\n    _snippetResult?: HitSnippetResult;\r\n    _rankingInfo?: {\r\n        promoted: boolean;\r\n        nbTypos: number;\r\n        firstMatchedWord: number;\r\n        proximityDistance?: number;\r\n        geoDistance: number;\r\n        geoPrecision?: number;\r\n        nbExactWords: number;\r\n        words: number;\r\n        filters: number;\r\n        userScore: number;\r\n        matchedGeoLocation?: {\r\n            lat: number;\r\n            lng: number;\r\n            distance: number;\r\n        };\r\n    };\r\n    _distinctSeqID?: number;\r\n    _geoloc?: GeoLoc;\r\n} & THit;\r\n\r\ndeclare const analytics: AnalyticsWidget;\r\n\r\ndeclare type AnalyticsWidget = WidgetFactory<AnalyticsWidgetDescription, AnalyticsWidgetParams, AnalyticsWidgetParams>;\r\n\r\ndeclare type AnalyticsWidgetDescription = {\r\n    $$type: 'ais.analytics';\r\n    $$widgetType: 'ais.analytics';\r\n    renderState: Record<string, unknown>;\r\n    indexRenderState: {\r\n        analytics: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams>;\r\n    };\r\n};\r\n\r\ndeclare type AnalyticsWidgetParams = {\r\n    /**\r\n     * A function that is called every time the query or refinements changes. You\r\n     * need to add the logic to push the data to your analytics platform.\r\n     */\r\n    pushFunction: AnalyticsWidgetParamsPushFunction;\r\n    /**\r\n     * The number of milliseconds between the last search keystroke and calling `pushFunction`.\r\n     *\r\n     * @default 3000\r\n     */\r\n    delay?: number;\r\n    /**\r\n     * Triggers `pushFunction` after click on page or redirecting the page. This is useful if\r\n     * you want the pushFunction to be called for the last actions before the user leaves the\r\n     * current page, even if the delay wasn’t reached.\r\n     *\r\n     * @default false\r\n     */\r\n    triggerOnUIInteraction?: boolean;\r\n    /**\r\n     * Triggers `pushFunction` when InstantSearch is initialized. This means\r\n     * the `pushFunction` might be called even though the user didn’t perfom\r\n     * any search-related action.\r\n     *\r\n     * @default true\r\n     */\r\n    pushInitialSearch?: boolean;\r\n    /**\r\n     * Triggers `pushFunction` when the page changes, either through the UI or programmatically.\r\n     *\r\n     * @default false\r\n     */\r\n    pushPagination?: boolean;\r\n};\r\n\r\ndeclare type AnalyticsWidgetParamsPushFunction = (\r\n/**\r\n * Contains the search parameters, serialized as a query string.\r\n */\r\nformattedParameters: string, \r\n/**\r\n * Contains the whole search state.\r\n */\r\nstate: SearchParameters, \r\n/**\r\n * The last received results.\r\n */\r\nresults: SearchResults) => void;\r\n\r\ndeclare type AnswersConnector = Connector<AnswersWidgetDescription, AnswersConnectorParams>;\r\n\r\ndeclare type AnswersConnectorParams = {\r\n    /**\r\n     * Attributes to use for predictions.\r\n     * If empty, we use all `searchableAttributes` to find answers.\r\n     * All your `attributesForPrediction` must be part of your `searchableAttributes`.\r\n     */\r\n    attributesForPrediction?: string[];\r\n    /**\r\n     * The languages in the query. Currently only supports `en`.\r\n     */\r\n    queryLanguages: ['en'];\r\n    /**\r\n     * Maximum number of answers to retrieve from the Answers Engine.\r\n     * Cannot be greater than 1000.\r\n     * @default 1\r\n     */\r\n    nbHits?: number;\r\n    /**\r\n     * Debounce time in milliseconds to debounce render\r\n     * @default 100\r\n     */\r\n    renderDebounceTime?: number;\r\n    /**\r\n     * Debounce time in milliseconds to debounce search\r\n     * @default 100\r\n     */\r\n    searchDebounceTime?: number;\r\n    /**\r\n     * Whether to escape HTML tags from hits string values.\r\n     *\r\n     * @default true\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Extra parameters to pass to findAnswers method.\r\n     * @default {}\r\n     */\r\n    extraParameters?: FindAnswersOptions;\r\n};\r\n\r\ndeclare type AnswersCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element of the widget.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the wrapping element when no results.\r\n     */\r\n    emptyRoot: string | string[];\r\n    /**\r\n     * CSS classes to add to the header.\r\n     */\r\n    header: string | string[];\r\n    /**\r\n     * CSS classes to add to the loader.\r\n     */\r\n    loader: string | string[];\r\n    /**\r\n     * CSS class to add to the list of results.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to each result.\r\n     */\r\n    item: string | string[];\r\n}>;\r\n\r\ndeclare type AnswersRenderState = {\r\n    /**\r\n     * The matched hits from Algolia API.\r\n     */\r\n    hits: Hit[];\r\n    /**\r\n     * Whether it's still loading the results from the Answers API.\r\n     */\r\n    isLoading: boolean;\r\n};\r\n\r\ndeclare type AnswersTemplates = Partial<{\r\n    /**\r\n     * Template to use for the header. This template will receive an object containing `hits` and `isLoading`.\r\n     */\r\n    header: Template<{\r\n        hits: Hit[];\r\n        isLoading: boolean;\r\n    }>;\r\n    /**\r\n     * Template to use for the loader.\r\n     */\r\n    loader: Template;\r\n    /**\r\n     * Template to use for each result. This template will receive an object containing a single record.\r\n     */\r\n    item: Template<Hit>;\r\n}>;\r\n\r\ndeclare type AnswersWidget = WidgetFactory<AnswersWidgetDescription & {\r\n    $$widgetType: 'ais.answers';\r\n}, AnswersConnectorParams, AnswersWidgetParams>;\r\n\r\ndeclare type AnswersWidgetDescription = {\r\n    $$type: 'ais.answers';\r\n    renderState: AnswersRenderState;\r\n    indexRenderState: {\r\n        answers: WidgetRenderState<AnswersRenderState, AnswersConnectorParams>;\r\n    };\r\n};\r\n\r\ndeclare type AnswersWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * The templates to use for the widget.\r\n     */\r\n    templates?: AnswersTemplates;\r\n    /**\r\n     * The CSS classes to override.\r\n     */\r\n    cssClasses?: AnswersCSSClasses;\r\n};\r\n\r\ndeclare type AnyWidgetFactory = WidgetFactory<{\r\n    $$type: string;\r\n}, Record<string, any>, any>;\r\n\r\ndeclare type AtLeastOne<TTarget, TMapped = {\r\n    [Key in keyof TTarget]: Pick<TTarget, Key>;\r\n}> = Partial<TTarget> & TMapped[keyof TMapped];\r\n\r\ndeclare type AugmentedWidget<TWidgetFactory extends AnyWidgetFactory, TOverriddenKeys extends keyof Widget = 'init' | 'render' | 'dispose'> = Omit<ReturnType<TWidgetFactory>, TOverriddenKeys | 'dependsOn' | 'getWidgetParameters'> & Pick<Required<Widget>, TOverriddenKeys>;\r\n\r\ndeclare type AutocompleteConnector = Connector<AutocompleteWidgetDescription, AutocompleteConnectorParams>;\r\n\r\ndeclare type AutocompleteConnectorParams = {\r\n    /**\r\n     * Escapes HTML entities from hits string values.\r\n     *\r\n     * @default `true`\r\n     */\r\n    escapeHTML?: boolean;\r\n};\r\n\r\ndeclare type AutocompleteRenderState = {\r\n    /**\r\n     * The current value of the query.\r\n     */\r\n    currentRefinement: string;\r\n    /**\r\n     * The indices this widget has access to.\r\n     */\r\n    indices: Array<{\r\n        /**\r\n         * The name of the index\r\n         */\r\n        indexName: string;\r\n        /**\r\n         * The id of the index\r\n         */\r\n        indexId: string;\r\n        /**\r\n         * The resolved hits from the index matching the query.\r\n         */\r\n        hits: Hit[];\r\n        /**\r\n         * The full results object from the Algolia API.\r\n         */\r\n        results: SearchResults;\r\n        /**\r\n         * Send event to insights middleware\r\n         */\r\n        sendEvent: SendEventForHits;\r\n    }>;\r\n    /**\r\n     * Searches into the indices with the provided query.\r\n     */\r\n    refine: (query: string) => void;\r\n};\r\n\r\ndeclare type AutocompleteWidgetDescription = {\r\n    $$type: 'ais.autocomplete';\r\n    renderState: AutocompleteRenderState;\r\n    indexRenderState: {\r\n        autocomplete: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        query: string;\r\n    };\r\n};\r\n\r\ndeclare type BaseHit = Record<string, any>;\r\n\r\ndeclare type BindEventForHits = BuiltInBindEventForHits & CustomBindEventForHits;\r\n\r\ndeclare type Bounds = {\r\n    /**\r\n     * The top right corner of the map view.\r\n     */\r\n    northEast: GeoLoc;\r\n    /**\r\n     * The bottom left corner of the map view.\r\n     */\r\n    southWest: GeoLoc;\r\n};\r\n\r\ndeclare const breadcrumb: BreadcrumbWidget;\r\n\r\ndeclare type BreadcrumbConnector = Connector<BreadcrumbWidgetDescription, BreadcrumbConnectorParams>;\r\n\r\ndeclare type BreadcrumbConnectorParams = {\r\n    /**\r\n     * Attributes to use to generate the hierarchy of the breadcrumb.\r\n     */\r\n    attributes: string[];\r\n    /**\r\n     * Prefix path to use if the first level is not the root level.\r\n     */\r\n    rootPath?: string;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<BreadcrumbConnectorParamsItem>;\r\n    /**\r\n     * The level separator used in the records.\r\n     *\r\n     * @default '>'\r\n     */\r\n    separator?: string;\r\n};\r\n\r\ndeclare type BreadcrumbConnectorParamsItem = {\r\n    /**\r\n     * Label of the category or subcategory.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Value of breadcrumb item.\r\n     */\r\n    value: string | null;\r\n};\r\n\r\ndeclare type BreadcrumbCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element of the widget.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element of the widget if there are no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to the items of the list. The items contains the link and the separator.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add to the selected item in the list: the last one or the home if there are no refinements.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS class to add to the separator.\r\n     */\r\n    separator: string | string[];\r\n    /**\r\n     * CSS class to add to the links in the items.\r\n     */\r\n    link: string | string[];\r\n}>;\r\n\r\ndeclare type BreadcrumbRenderState = {\r\n    /**\r\n     * Creates the URL for a single item name in the list.\r\n     */\r\n    createURL: CreateURL<BreadcrumbConnectorParamsItem['value']>;\r\n    /**\r\n     * Array of objects defining the different values and labels.\r\n     */\r\n    items: BreadcrumbConnectorParamsItem[];\r\n    /**\r\n     * Sets the path of the hierarchical filter and triggers a new search.\r\n     */\r\n    refine: (value: BreadcrumbConnectorParamsItem['value']) => void;\r\n    /**\r\n     * True if refinement can be applied.\r\n     */\r\n    canRefine: boolean;\r\n};\r\n\r\ndeclare type BreadcrumbTemplates = Partial<{\r\n    /**\r\n     * Label of the breadcrumb's first element.\r\n     */\r\n    home: Template;\r\n    /**\r\n     * Symbol used to separate the elements of the breadcrumb.\r\n     */\r\n    separator: Template;\r\n}>;\r\n\r\ndeclare type BreadcrumbWidget = WidgetFactory<BreadcrumbWidgetDescription & {\r\n    $$widgetType: 'ais.breadcrumb';\r\n}, BreadcrumbConnectorParams, BreadcrumbWidgetParams>;\r\n\r\ndeclare type BreadcrumbWidgetDescription = {\r\n    $$type: 'ais.breadcrumb';\r\n    renderState: BreadcrumbRenderState;\r\n    indexRenderState: {\r\n        breadcrumb: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type BreadcrumbWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: BreadcrumbTemplates;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: BreadcrumbCSSClasses;\r\n};\r\n\r\ndeclare class BrowserHistory<TRouteState> implements Router<TRouteState> {\r\n    $$type: string;\r\n    /**\r\n     * Transforms a UI state into a title for the page.\r\n     */\r\n    private readonly windowTitle?;\r\n    /**\r\n     * Time in milliseconds before performing a write in the history.\r\n     * It prevents from adding too many entries in the history and\r\n     * makes the back button more usable.\r\n     *\r\n     * @default 400\r\n     */\r\n    private readonly writeDelay;\r\n    /**\r\n     * Creates a full URL based on the route state.\r\n     * The storage adaptor maps all syncable keys to the query string of the URL.\r\n     */\r\n    private readonly _createURL;\r\n    /**\r\n     * Parses the URL into a route state.\r\n     * It should be symmetrical to `createURL`.\r\n     */\r\n    private readonly parseURL;\r\n    /**\r\n     * Returns the location to store in the history.\r\n     * @default () => window.location\r\n     */\r\n    private readonly getLocation;\r\n    private writeTimer?;\r\n    private _onPopState?;\r\n    /**\r\n     * Indicates if last action was back/forward in the browser.\r\n     */\r\n    private inPopState;\r\n    /**\r\n     * Indicates whether the history router is disposed or not.\r\n     */\r\n    protected isDisposed: boolean;\r\n    /**\r\n     * Indicates the window.history.length before the last call to\r\n     * window.history.pushState (called in `write`).\r\n     * It allows to determine if a `pushState` has been triggered elsewhere,\r\n     * and thus to prevent the `write` method from calling `pushState`.\r\n     */\r\n    private latestAcknowledgedHistory;\r\n    private _start?;\r\n    private _dispose?;\r\n    private _push?;\r\n    private _cleanUrlOnDispose;\r\n    /**\r\n     * Initializes a new storage provider that syncs the search state to the URL\r\n     * using web APIs (`window.location.pushState` and `onpopstate` event).\r\n     */\r\n    constructor({ windowTitle, writeDelay, createURL, parseURL, getLocation, start, dispose, push, cleanUrlOnDispose, }: BrowserHistoryArgs<TRouteState>);\r\n    /**\r\n     * Reads the URL and returns a syncable UI search state.\r\n     */\r\n    read(): TRouteState;\r\n    /**\r\n     * Pushes a search state into the URL.\r\n     */\r\n    write(routeState: TRouteState): void;\r\n    /**\r\n     * Sets a callback on the `onpopstate` event of the history API of the current page.\r\n     * It enables the URL sync to keep track of the changes.\r\n     */\r\n    onUpdate(callback: (routeState: TRouteState) => void): void;\r\n    /**\r\n     * Creates a complete URL from a given syncable UI state.\r\n     *\r\n     * It always generates the full URL, not a relative one.\r\n     * This allows to handle cases like using a <base href>.\r\n     * See: https://github.com/algolia/instantsearch/issues/790\r\n     */\r\n    createURL(routeState: TRouteState): string;\r\n    /**\r\n     * Removes the event listener and cleans up the URL.\r\n     */\r\n    dispose(): void;\r\n    start(): void;\r\n    private shouldWrite;\r\n}\r\n\r\ndeclare type BrowserHistoryArgs<TRouteState> = {\r\n    windowTitle?: (routeState: TRouteState) => string;\r\n    writeDelay: number;\r\n    createURL: CreateURL_2<TRouteState>;\r\n    parseURL: ParseURL<TRouteState>;\r\n    getLocation: () => Location;\r\n    start?: (onUpdate: () => void) => void;\r\n    dispose?: () => void;\r\n    push?: (url: string) => void;\r\n    /**\r\n     * Whether the URL should be cleaned up when the router is disposed.\r\n     * This can be useful when closing a modal containing InstantSearch, to\r\n     * remove active refinements from the URL.\r\n     * @default true\r\n     */\r\n    cleanUrlOnDispose?: boolean;\r\n};\r\n\r\ndeclare type BuiltInBindEventForHits = (eventType: string, hits: Hit | Hit[], eventName?: string, additionalData?: Record<string, any>) => string;\r\n\r\ndeclare type BuiltInSendEventForFacet = (eventType: string, facetValue: string, eventName?: string, additionalData?: Record<string, any>) => void;\r\n\r\ndeclare type BuiltInSendEventForHits = (eventType: string, hits: Hit | Hit[], eventName?: string, additionalData?: Record<string, any>) => void;\r\n\r\ndeclare type BuiltInSendEventForToggle = (eventType: string, isRefined: boolean, eventName?: string) => void;\r\n\r\ndeclare function carousel<TObject extends Record<string, unknown>>({ cssClasses, templates, }?: CreateCarouselTemplateProps<TObject>): ({ items, templates: widgetTemplates, cssClasses: widgetCssClasses, sendEvent, }: CarouselTemplateProps<TObject>) => h.JSX.Element;\r\n\r\ndeclare type CarouselTemplateProps<TObject extends Record<string, unknown>> = Pick<CarouselProps<TObject>, 'items'> & {\r\n    templates: {\r\n        item?: CarouselProps<TObject>['itemComponent'];\r\n    };\r\n    cssClasses?: Partial<CarouselProps<TObject>['classNames']>;\r\n} & {\r\n    sendEvent?: CarouselProps<TObject>['sendEvent'];\r\n};\r\n\r\ndeclare const clearRefinements: ClearRefinementsWidget;\r\n\r\ndeclare type ClearRefinementsConnector = Connector<ClearRefinementsWidgetDescription, ClearRefinementsConnectorParams>;\r\n\r\ndeclare type ClearRefinementsConnectorParams = {\r\n    /**\r\n     * The attributes to include in the refinements to clear (all by default). Cannot be used with `excludedAttributes`.\r\n     */\r\n    includedAttributes?: string[];\r\n    /**\r\n     * The attributes to exclude from the refinements to clear. Cannot be used with `includedAttributes`.\r\n     */\r\n    excludedAttributes?: string[];\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<string>;\r\n};\r\n\r\ndeclare type ClearRefinementsCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the wrapper element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the button of the widget.\r\n     */\r\n    button: string | string[];\r\n    /**\r\n     * CSS class to add to the button when there are no refinements.\r\n     */\r\n    disabledButton: string | string[];\r\n}>;\r\n\r\ndeclare type ClearRefinementsRenderState = {\r\n    /**\r\n     * Triggers the clear of all the currently refined values.\r\n     */\r\n    refine: () => void;\r\n    /**\r\n     * Indicates if search state is refined.\r\n     * @deprecated prefer reading canRefine\r\n     */\r\n    hasRefinements: boolean;\r\n    /**\r\n     * Indicates if search state can be refined.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Creates a url for the next state when refinements are cleared.\r\n     */\r\n    createURL: CreateURL<void>;\r\n};\r\n\r\ndeclare type ClearRefinementsTemplates = Partial<{\r\n    /**\r\n     * Template for the content of the button\r\n     */\r\n    resetLabel: Template<{\r\n        hasRefinements: boolean;\r\n    }>;\r\n}>;\r\n\r\ndeclare type ClearRefinementsWidget = WidgetFactory<ClearRefinementsWidgetDescription & {\r\n    $$widgetType: 'ais.clearRefinements';\r\n}, ClearRefinementsConnectorParams, ClearRefinementsWidgetParams>;\r\n\r\ndeclare type ClearRefinementsWidgetDescription = {\r\n    $$type: 'ais.clearRefinements';\r\n    renderState: ClearRefinementsRenderState;\r\n    indexRenderState: {\r\n        clearRefinements: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams>;\r\n    };\r\n};\r\n\r\ndeclare type ClearRefinementsWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: ClearRefinementsTemplates;\r\n    /**\r\n     * CSS classes to be added.\r\n     */\r\n    cssClasses?: ClearRefinementsCSSClasses;\r\n};\r\n\r\ndeclare type ComponentCSSClasses<TCSSClasses> = Required<{\r\n    [className in keyof TCSSClasses]: string;\r\n}>;\r\n\r\ndeclare const configure: ConfigureWidget;\r\n\r\ndeclare type ConfigureConnector = Connector<ConfigureWidgetDescription, ConfigureConnectorParams>;\r\n\r\ndeclare type ConfigureConnectorParams = {\r\n    /**\r\n     * A list of [search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/)\r\n     * to enable when the widget mounts.\r\n     */\r\n    searchParameters: PlainSearchParameters;\r\n};\r\n\r\ndeclare type ConfigureRelatedItemsConnector = Connector<ConfigureRelatedItemsWidgetDescription, ConfigureRelatedItemsConnectorParams>;\r\n\r\ndeclare type ConfigureRelatedItemsConnectorParams = {\r\n    /**\r\n     * The reference hit to extract the filters from.\r\n     */\r\n    hit: AlgoliaHit;\r\n    /**\r\n     * The schema to create the optional filters.\r\n     * Each key represents an attribute from the hit.\r\n     */\r\n    matchingPatterns: MatchingPatterns;\r\n    /**\r\n     * Function to transform the generated search parameters.\r\n     */\r\n    transformSearchParameters?: TransformSearchParameters;\r\n};\r\n\r\ndeclare type ConfigureRelatedItemsWidget = WidgetFactory<ConfigureRelatedItemsWidgetDescription & {\r\n    $$widgetType: 'ais.configureRelatedItems';\r\n}, ConfigureRelatedItemsConnectorParams, ConfigureRelatedItemsWidgetParams>;\r\n\r\ndeclare type ConfigureRelatedItemsWidgetDescription = {\r\n    $$type: 'ais.configureRelatedItems';\r\n} & Omit<ConfigureWidgetDescription, '$$type'>;\r\n\r\ndeclare type ConfigureRelatedItemsWidgetParams = PlainSearchParameters;\r\n\r\ndeclare type ConfigureRenderState = {\r\n    /**\r\n     * Refine the given search parameters.\r\n     */\r\n    refine: Refine;\r\n};\r\n\r\ndeclare type ConfigureWidget = (widgetParams: ConfigureWidgetParams) => Widget<ConfigureWidgetDescription & {\r\n    $$widgetType: 'ais.configure';\r\n    widgetParams: ConfigureConnectorParams;\r\n}>;\r\n\r\ndeclare type ConfigureWidgetDescription = {\r\n    $$type: 'ais.configure';\r\n    renderState: ConfigureRenderState;\r\n    indexRenderState: {\r\n        configure: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        configure: PlainSearchParameters;\r\n    };\r\n};\r\n\r\n/**\r\n * A list of [search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/)\r\n * to enable when the widget mounts.\r\n */\r\ndeclare type ConfigureWidgetParams = ConfigureConnectorParams['searchParameters'];\r\n\r\ndeclare const connectAutocomplete: AutocompleteConnector;\r\n\r\ndeclare const connectBreadcrumb: BreadcrumbConnector;\r\n\r\ndeclare const connectClearRefinements: ClearRefinementsConnector;\r\n\r\ndeclare const connectConfigure: ConfigureConnector;\r\n\r\ndeclare const connectCurrentRefinements: CurrentRefinementsConnector;\r\n\r\ndeclare const connectDynamicWidgets: DynamicWidgetsConnector;\r\n\r\n/**\r\n * **HierarchicalMenu** connector provides the logic to build a custom widget\r\n * that will give the user the ability to explore facets in a tree-like structure.\r\n *\r\n * This is commonly used for multi-level categorization of products on e-commerce\r\n * websites. From a UX point of view, we suggest not displaying more than two\r\n * levels deep.\r\n *\r\n * @type {Connector}\r\n * @param {function(HierarchicalMenuRenderingOptions, boolean)} renderFn Rendering function for the custom **HierarchicalMenu** widget.\r\n * @param {function} unmountFn Unmount function called when the widget is disposed.\r\n * @return {function(CustomHierarchicalMenuWidgetParams)} Re-usable widget factory for a custom **HierarchicalMenu** widget.\r\n */\r\ndeclare const connectHierarchicalMenu: HierarchicalMenuConnector;\r\n\r\ndeclare const connectHitsPerPage: HitsPerPageConnector;\r\n\r\ndeclare const connectHitsWithInsights: <TWidgetParams>(renderFn: Renderer<HitsRenderState, TWidgetParams & HitsConnectorParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & HitsConnectorParams<THit>) => {\r\n    $$type: \"ais.hits\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & HitsWidgetDescription[\"indexRenderState\"];\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions): {\r\n        hits: never[];\r\n        items: never[];\r\n        results: undefined;\r\n        banner: undefined;\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        widgetParams: TWidgetParams & HitsConnectorParams<THit>;\r\n    } | {\r\n        hits: Hit<BaseHit>[] | Hit<THit>[];\r\n        items: Hit<BaseHit>[] | Hit<THit>[];\r\n        results: SearchResults<any>;\r\n        banner: Banner | undefined;\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        widgetParams: TWidgetParams & HitsConnectorParams<THit>;\r\n    };\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetSearchParameters(state: SearchParameters, _uiState: {\r\n        uiState: {\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            page?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare const connectInfiniteHitsWithInsights: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<InfiniteHitsRenderState, TWidgetParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & InfiniteHitsConnectorParams<THit>) => {\r\n    $$type: \"ais.infiniteHits\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & InfiniteHitsWidgetDescription[\"indexRenderState\"];\r\n    getWidgetRenderState({ results, helper, parent, state: existingState, instantSearchInstance, }: InitOptions | RenderOptions): {\r\n        hits: Hit<THit>[];\r\n        items: Hit<THit>[];\r\n        currentPageHits: Hit<THit>[];\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        banner: Banner | undefined;\r\n        results: SearchResults<any> | undefined;\r\n        showPrevious: () => void;\r\n        showMore: () => void;\r\n        isFirstPage: boolean;\r\n        isLastPage: boolean;\r\n        widgetParams: TWidgetParams & InfiniteHitsConnectorParams<THit>;\r\n    };\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetUiState(uiState: {\r\n        page?: number | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    }, { searchParameters }: {\r\n        searchParameters: SearchParameters;\r\n        helper: AlgoliaSearchHelper;\r\n    }): {\r\n        page?: number | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    };\r\n    getWidgetSearchParameters(searchParameters: SearchParameters, { uiState }: {\r\n        uiState: {\r\n            page?: number | undefined;\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\n/**\r\n * **Menu** connector provides the logic to build a widget that will give the user the ability to choose a single value for a specific facet. The typical usage of menu is for navigation in categories.\r\n *\r\n * This connector provides a `toggleShowMore()` function to display more or less items and a `refine()`\r\n * function to select an item. While selecting a new element, the `refine` will also unselect the\r\n * one that is currently selected.\r\n *\r\n * **Requirement:** the attribute passed as `attribute` must be present in \"attributes for faceting\" on the Algolia dashboard or configured as attributesForFaceting via a set settings call to the Algolia API.\r\n */\r\ndeclare const connectMenu: MenuConnector;\r\n\r\ndeclare const connectNumericMenu: NumericMenuConnector;\r\n\r\n/**\r\n * The connector handles the business logic and exposes\r\n * a simplified API to the rendering function.\r\n */\r\ndeclare type Connector<TWidgetDescription extends WidgetDescription, TConnectorParams extends UnknownWidgetParams> = <TWidgetParams extends UnknownWidgetParams>(\r\n/**\r\n * The render function.\r\n */\r\nrenderFn: Renderer<TWidgetDescription['renderState'], TConnectorParams & TWidgetParams>, \r\n/**\r\n * The called function when unmounting a widget.\r\n */\r\nunmountFn?: Unmounter) => (widgetParams: TConnectorParams & TWidgetParams) => Widget<TWidgetDescription & {\r\n    widgetParams: typeof widgetParams;\r\n}>;\r\n\r\ndeclare type ConnectorRenderStates = AnswersWidgetDescription['indexRenderState'] & AutocompleteWidgetDescription['indexRenderState'] & BreadcrumbWidgetDescription['indexRenderState'] & ClearRefinementsWidgetDescription['indexRenderState'] & ConfigureWidgetDescription['indexRenderState'] & CurrentRefinementsWidgetDescription['indexRenderState'] & GeoSearchWidgetDescription['indexRenderState'] & HierarchicalMenuWidgetDescription['indexRenderState'] & HitsWidgetDescription['indexRenderState'] & HitsPerPageWidgetDescription['indexRenderState'] & InfiniteHitsWidgetDescription['indexRenderState'] & MenuWidgetDescription['indexRenderState'] & NumericMenuWidgetDescription['indexRenderState'] & PaginationWidgetDescription['indexRenderState'] & PoweredByWidgetDescription['indexRenderState'] & QueryRulesWidgetDescription['indexRenderState'] & RangeWidgetDescription['indexRenderState'] & RatingMenuWidgetDescription['indexRenderState'] & RefinementListWidgetDescription['indexRenderState'] & RelevantSortWidgetDescription['indexRenderState'] & SearchBoxWidgetDescription['indexRenderState'] & SortByWidgetDescription['indexRenderState'] & StatsWidgetDescription['indexRenderState'] & ToggleRefinementWidgetDescription['indexRenderState'] & VoiceSearchWidgetDescription['indexRenderState'];\r\n\r\ndeclare namespace connectors {\r\n    export {\r\n        EXPERIMENTAL_connectAnswers,\r\n        EXPERIMENTAL_connectConfigureRelatedItems,\r\n        EXPERIMENTAL_connectDynamicWidgets,\r\n        connectDynamicWidgets,\r\n        connectClearRefinements,\r\n        connectCurrentRefinements,\r\n        connectHierarchicalMenu,\r\n        _default as connectHits,\r\n        connectHitsWithInsights,\r\n        connectHitsPerPage,\r\n        _default_2 as connectInfiniteHits,\r\n        connectInfiniteHitsWithInsights,\r\n        connectMenu,\r\n        connectNumericMenu,\r\n        connectPagination,\r\n        connectRange,\r\n        connectRefinementList,\r\n        _default_3 as connectRelatedProducts,\r\n        connectSearchBox,\r\n        connectSortBy,\r\n        connectRatingMenu,\r\n        connectStats,\r\n        connectToggleRefinement,\r\n        _default_4 as connectTrendingItems,\r\n        connectBreadcrumb,\r\n        _default_5 as connectGeoSearch,\r\n        connectPoweredBy,\r\n        connectConfigure,\r\n        connectAutocomplete,\r\n        connectQueryRules,\r\n        connectVoiceSearch,\r\n        connectRelevantSort,\r\n        _default_6 as connectFrequentlyBoughtTogether,\r\n        _default_7 as connectLookingSimilar\r\n    }\r\n}\r\n\r\ndeclare type ConnectorUiStates = AutocompleteWidgetDescription['indexUiState'] & ConfigureWidgetDescription['indexUiState'] & GeoSearchWidgetDescription['indexUiState'] & HierarchicalMenuWidgetDescription['indexUiState'] & HitsPerPageWidgetDescription['indexUiState'] & InfiniteHitsWidgetDescription['indexUiState'] & MenuWidgetDescription['indexUiState'] & NumericMenuWidgetDescription['indexUiState'] & PaginationWidgetDescription['indexUiState'] & RangeWidgetDescription['indexUiState'] & RatingMenuWidgetDescription['indexUiState'] & RefinementListWidgetDescription['indexUiState'] & RelevantSortWidgetDescription['indexUiState'] & SearchBoxWidgetDescription['indexUiState'] & SortByWidgetDescription['indexUiState'] & ToggleRefinementWidgetDescription['indexUiState'] & VoiceSearchWidgetDescription['indexUiState'];\r\n\r\n/**\r\n * **Pagination** connector provides the logic to build a widget that will let the user\r\n * choose the current page of the results.\r\n *\r\n * When using the pagination with Algolia, you should be aware that the engine won't provide you pages\r\n * beyond the 1000th hits by default. You can find more information on the [Algolia documentation](https://www.algolia.com/doc/guides/searching/pagination/#pagination-limitations).\r\n */\r\ndeclare const connectPagination: PaginationConnector;\r\n\r\n/**\r\n * **PoweredBy** connector provides the logic to build a custom widget that will displays\r\n * the logo to redirect to Algolia.\r\n */\r\ndeclare const connectPoweredBy: PoweredByConnector;\r\n\r\ndeclare const connectQueryRules: QueryRulesConnector;\r\n\r\n/**\r\n * **Range** connector provides the logic to create custom widget that will let\r\n * the user refine results using a numeric range.\r\n *\r\n * This connectors provides a `refine()` function that accepts bounds. It will also provide\r\n * information about the min and max bounds for the current result set.\r\n */\r\ndeclare const connectRange: RangeConnector;\r\n\r\n/**\r\n * **StarRating** connector provides the logic to build a custom widget that will let\r\n * the user refine search results based on ratings.\r\n *\r\n * The connector provides to the rendering: `refine()` to select a value and\r\n * `items` that are the values that can be selected. `refine` should be used\r\n * with `items.value`.\r\n */\r\ndeclare const connectRatingMenu: RatingMenuConnector;\r\n\r\n/**\r\n * **RefinementList** connector provides the logic to build a custom widget that\r\n * will let the user filter the results based on the values of a specific facet.\r\n *\r\n * **Requirement:** the attribute passed as `attribute` must be present in\r\n * attributesForFaceting of the searched index.\r\n *\r\n * This connector provides:\r\n * - a `refine()` function to select an item.\r\n * - a `toggleShowMore()` function to display more or less items\r\n * - a `searchForItems()` function to search within the items.\r\n */\r\ndeclare const connectRefinementList: RefinementListConnector;\r\n\r\ndeclare const connectRelevantSort: RelevantSortConnector;\r\n\r\n/**\r\n * **SearchBox** connector provides the logic to build a widget that will let the user search for a query.\r\n *\r\n * The connector provides to the rendering: `refine()` to set the query. The behaviour of this function\r\n * may be impacted by the `queryHook` widget parameter.\r\n */\r\ndeclare const connectSearchBox: SearchBoxConnector;\r\n\r\ndeclare const connectSortBy: SortByConnector;\r\n\r\ndeclare const connectStats: StatsConnector;\r\n\r\n/**\r\n * **Toggle** connector provides the logic to build a custom widget that will provide\r\n * an on/off filtering feature based on an attribute value or values.\r\n *\r\n * Two modes are implemented in the custom widget:\r\n *  - with or without the value filtered\r\n *  - switch between two values.\r\n */\r\ndeclare const connectToggleRefinement: ToggleRefinementConnector;\r\n\r\ndeclare const connectVoiceSearch: VoiceSearchConnector;\r\n\r\ndeclare type CreateCarouselTemplateProps<TObject extends Record<string, unknown>> = {\r\n    templates?: Partial<{\r\n        previous: Exclude<Template_2, string>;\r\n        next: Exclude<Template_2, string>;\r\n    }>;\r\n    cssClasses?: Partial<CarouselProps<TObject>['classNames']>;\r\n};\r\n\r\ndeclare function createInfiniteHitsSessionStorageCache({ key, }?: {\r\n    /**\r\n     * If you display multiple instances of infiniteHits on the same page,\r\n     * you must provide a unique key for each instance.\r\n     */\r\n    key?: string;\r\n}): InfiniteHitsCache;\r\n\r\ndeclare type CreateInsightsMiddleware = typeof createInsightsMiddleware;\r\n\r\ndeclare function createInsightsMiddleware<TInsightsClient extends ProvidedInsightsClient>(props?: InsightsProps<TInsightsClient>): InternalMiddleware;\r\n\r\ndeclare type CreateMarker = (args: {\r\n    item: GeoHit;\r\n    map: google.maps.Map;\r\n}) => google.maps.OverlayView | google.maps.Marker;\r\n\r\n/**\r\n * Exposes the metadata of mounted widgets in a custom\r\n * `<meta name=\"instantsearch:widgets\" />` tag. The metadata per widget is:\r\n * - applied parameters\r\n * - widget name\r\n * - connector name\r\n */\r\ndeclare function createMetadataMiddleware({ $$internal, }?: {\r\n    $$internal?: boolean;\r\n}): InternalMiddleware;\r\n\r\ndeclare const createRouterMiddleware: <TUiState extends UiState = UiState, TRouteState = TUiState>(props?: RouterProps<TUiState, TRouteState>) => InternalMiddleware<TUiState>;\r\n\r\n/**\r\n * Creates the URL for the given value.\r\n */\r\ndeclare type CreateURL<TValue> = (value: TValue) => string;\r\n\r\ndeclare type CreateURL_2<TRouteState> = (args: {\r\n    qsModule: typeof qs_2;\r\n    routeState: TRouteState;\r\n    location: Location;\r\n}) => string;\r\n\r\ndeclare type CreateVoiceSearchHelper = (params: VoiceSearchHelperParams) => VoiceSearchHelper;\r\n\r\ndeclare const currentRefinements: CurrentRefinementsWidget;\r\n\r\ndeclare type CurrentRefinementsConnector = Connector<CurrentRefinementsWidgetDescription, CurrentRefinementsConnectorParams>;\r\n\r\ndeclare type CurrentRefinementsConnectorParams = {\r\n    /**\r\n     * The attributes to include in the widget (all by default).\r\n     * Cannot be used with `excludedAttributes`.\r\n     *\r\n     * @default `[]`\r\n     */\r\n    includedAttributes?: string[];\r\n    /**\r\n     * The attributes to exclude from the widget.\r\n     * Cannot be used with `includedAttributes`.\r\n     *\r\n     * @default `['query']`\r\n     */\r\n    excludedAttributes?: string[];\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<CurrentRefinementsConnectorParamsItem>;\r\n};\r\n\r\ndeclare type CurrentRefinementsConnectorParamsItem = {\r\n    /**\r\n     * The index name.\r\n     */\r\n    indexName: string;\r\n    /**\r\n     * The index id as provided to the index widget.\r\n     */\r\n    indexId: string;\r\n    /**\r\n     * The attribute on which the refinement is applied.\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * The textual representation of this attribute.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Currently applied refinements.\r\n     */\r\n    refinements: CurrentRefinementsConnectorParamsRefinement[];\r\n    /**\r\n     * Removes the given refinement and triggers a new search.\r\n     */\r\n    refine: (refinement: CurrentRefinementsConnectorParamsRefinement) => void;\r\n};\r\n\r\ndeclare type CurrentRefinementsConnectorParamsRefinement = {\r\n    /**\r\n     * The attribute on which the refinement is applied.\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * The type of the refinement.\r\n     */\r\n    type: 'facet' | 'exclude' | 'disjunctive' | 'hierarchical' | 'numeric' | 'query' | 'tag';\r\n    /**\r\n     * The raw value of the refinement.\r\n     */\r\n    value: string | number;\r\n    /**\r\n     * The label of the refinement to display.\r\n     */\r\n    label: string;\r\n    /**\r\n     * The value of the operator (only if applicable).\r\n     */\r\n    operator?: string;\r\n    /**\r\n     * The number of found items (only if applicable).\r\n     */\r\n    count?: number;\r\n    /**\r\n     * Whether the count is exhaustive (only if applicable).\r\n     */\r\n    exhaustive?: boolean;\r\n};\r\n\r\ndeclare type CurrentRefinementsCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to the each item element.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add to the label element.\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to the category element.\r\n     */\r\n    category: string | string[];\r\n    /**\r\n     * CSS class to add to the categoryLabel element.\r\n     */\r\n    categoryLabel: string | string[];\r\n    /**\r\n     * CSS class to add to the delete element.\r\n     */\r\n    delete: string | string[];\r\n}>;\r\n\r\ndeclare type CurrentRefinementsRenderState = {\r\n    /**\r\n     * All the currently refined items, grouped by attribute.\r\n     */\r\n    items: CurrentRefinementsConnectorParamsItem[];\r\n    /**\r\n     * Indicates if search state can be refined.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Removes the given refinement and triggers a new search.\r\n     */\r\n    refine: (refinement: CurrentRefinementsConnectorParamsRefinement) => void;\r\n    /**\r\n     * Generates a URL for the next state.\r\n     */\r\n    createURL: CreateURL<CurrentRefinementsConnectorParamsRefinement>;\r\n};\r\n\r\ndeclare type CurrentRefinementsWidget = WidgetFactory<CurrentRefinementsWidgetDescription & {\r\n    $$widgetType: 'ais.currentRefinements';\r\n}, CurrentRefinementsConnectorParams, CurrentRefinementsWidgetParams>;\r\n\r\ndeclare type CurrentRefinementsWidgetDescription = {\r\n    $$type: 'ais.currentRefinements';\r\n    renderState: CurrentRefinementsRenderState;\r\n    indexRenderState: {\r\n        currentRefinements: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams>;\r\n    };\r\n};\r\n\r\ndeclare type CurrentRefinementsWidgetParams = {\r\n    /**\r\n     * The CSS Selector or `HTMLElement` to insert the widget into.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * The CSS classes to override.\r\n     */\r\n    cssClasses?: CurrentRefinementsCSSClasses;\r\n};\r\n\r\ndeclare type CustomBindEventForHits = (customPayload: any) => string;\r\n\r\ndeclare type CustomSendEventForFacet = (customPayload: any) => void;\r\n\r\ndeclare type CustomSendEventForHits = (customPayload: any) => void;\r\n\r\ndeclare type CustomSendEventForToggle = (customPayload: any) => void;\r\n\r\ndeclare const _default: <TWidgetParams>(renderFn: Renderer<HitsRenderState, TWidgetParams & HitsConnectorParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & HitsConnectorParams<THit>) => {\r\n    $$type: \"ais.hits\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & HitsWidgetDescription[\"indexRenderState\"];\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions): {\r\n        hits: never[];\r\n        items: never[];\r\n        results: undefined;\r\n        banner: undefined;\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        widgetParams: TWidgetParams & HitsConnectorParams<THit>;\r\n    } | {\r\n        hits: Hit<BaseHit>[] | Hit<THit>[];\r\n        items: Hit<BaseHit>[] | Hit<THit>[];\r\n        results: SearchResults<any>;\r\n        banner: Banner | undefined;\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        widgetParams: TWidgetParams & HitsConnectorParams<THit>;\r\n    };\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetSearchParameters(state: SearchParameters, _uiState: {\r\n        uiState: {\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            page?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare const _default_10: <THit extends NonNullable<object> = BaseHit>(widgetParams: InfiniteHitsWidgetParams<THit> & InfiniteHitsConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.infiniteHits\";\r\n    $$type: \"ais.infiniteHits\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & InfiniteHitsWidgetDescription[\"indexRenderState\"];\r\n    getWidgetRenderState({ results, helper, parent, state: existingState, instantSearchInstance, }: InitOptions | RenderOptions): {\r\n        hits: Hit<THit>[];\r\n        items: Hit<THit>[];\r\n        currentPageHits: Hit<THit>[];\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        banner: Banner | undefined;\r\n        results: SearchResults<any> | undefined;\r\n        showPrevious: () => void;\r\n        showMore: () => void;\r\n        isFirstPage: boolean;\r\n        isLastPage: boolean;\r\n        widgetParams: Partial<InfiniteHitsWidgetParams<BaseHit>> & InfiniteHitsConnectorParams<THit>;\r\n    };\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetUiState(uiState: {\r\n        page?: number | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    }, { searchParameters }: {\r\n        searchParameters: SearchParameters;\r\n        helper: AlgoliaSearchHelper;\r\n    }): {\r\n        page?: number | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    };\r\n    getWidgetSearchParameters(searchParameters: SearchParameters, { uiState }: {\r\n        uiState: {\r\n            page?: number | undefined;\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare const _default_11: PlacesWidget;\r\n\r\ndeclare const _default_12: <THit extends NonNullable<object> = BaseHit>(widgetParams: RelatedProductsWidgetParams<THit> & RelatedProductsConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.relatedProducts\";\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.relatedProducts\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: Partial<{\r\n            answers: WidgetRenderState<AnswersRenderState, AnswersConnectorParams>;\r\n        } & {\r\n            autocomplete: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams>;\r\n        } & {\r\n            breadcrumb: {\r\n                [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n            };\r\n        } & {\r\n            clearRefinements: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams>;\r\n        } & {\r\n            configure: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams>;\r\n        } & {\r\n            currentRefinements: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams>;\r\n        } & {\r\n            geoSearch: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>>;\r\n        } & {\r\n            hierarchicalMenu: {\r\n                [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            hits: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            hitsPerPage: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams>;\r\n        } & {\r\n            infiniteHits: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            menu: {\r\n                [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n            };\r\n        } & {\r\n            numericMenu: {\r\n                [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            pagination: WidgetRenderState<PaginationRenderState, PaginationConnectorParams>;\r\n        } & {\r\n            poweredBy: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams>;\r\n        } & {\r\n            queryRules: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams>;\r\n        } & {\r\n            range: {\r\n                [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n            };\r\n        } & {\r\n            ratingMenu: {\r\n                [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            refinementList: {\r\n                [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n            };\r\n        } & {\r\n            relevantSort: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams>;\r\n        } & {\r\n            searchBox: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams>;\r\n        } & {\r\n            sortBy: WidgetRenderState<SortByRenderState, SortByConnectorParams>;\r\n        } & {\r\n            stats: WidgetRenderState<StatsRenderState, StatsConnectorParams>;\r\n        } & {\r\n            toggleRefinement: {\r\n                [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n            };\r\n        } & {\r\n            voiceSearch: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams>;\r\n        } & {\r\n            analytics: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams>;\r\n        } & {\r\n            places: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams>;\r\n        }>;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<BaseHit>[] | Hit<THit>[];\r\n        widgetParams: Partial<RelatedProductsWidgetParams<BaseHit>> & RelatedProductsConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\ndeclare const _default_13: <THit extends NonNullable<object> = BaseHit>(widgetParams: TrendingItemsWidgetParams<THit> & TrendingItemsConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.trendingItems\";\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.trendingItems\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: Partial<{\r\n            answers: WidgetRenderState<AnswersRenderState, AnswersConnectorParams>;\r\n        } & {\r\n            autocomplete: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams>;\r\n        } & {\r\n            breadcrumb: {\r\n                [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n            };\r\n        } & {\r\n            clearRefinements: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams>;\r\n        } & {\r\n            configure: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams>;\r\n        } & {\r\n            currentRefinements: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams>;\r\n        } & {\r\n            geoSearch: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>>;\r\n        } & {\r\n            hierarchicalMenu: {\r\n                [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            hits: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            hitsPerPage: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams>;\r\n        } & {\r\n            infiniteHits: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            menu: {\r\n                [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n            };\r\n        } & {\r\n            numericMenu: {\r\n                [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            pagination: WidgetRenderState<PaginationRenderState, PaginationConnectorParams>;\r\n        } & {\r\n            poweredBy: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams>;\r\n        } & {\r\n            queryRules: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams>;\r\n        } & {\r\n            range: {\r\n                [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n            };\r\n        } & {\r\n            ratingMenu: {\r\n                [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            refinementList: {\r\n                [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n            };\r\n        } & {\r\n            relevantSort: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams>;\r\n        } & {\r\n            searchBox: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams>;\r\n        } & {\r\n            sortBy: WidgetRenderState<SortByRenderState, SortByConnectorParams>;\r\n        } & {\r\n            stats: WidgetRenderState<StatsRenderState, StatsConnectorParams>;\r\n        } & {\r\n            toggleRefinement: {\r\n                [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n            };\r\n        } & {\r\n            voiceSearch: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams>;\r\n        } & {\r\n            analytics: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams>;\r\n        } & {\r\n            places: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams>;\r\n        }>;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<THit>[];\r\n        widgetParams: Partial<TrendingItemsWidgetParams<BaseHit>> & TrendingItemsConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\ndeclare const _default_14: <THit extends NonNullable<object> = BaseHit>(widgetParams: FrequentlyBoughtTogetherWidgetParams<THit> & FrequentlyBoughtTogetherConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.frequentlyBoughtTogether\";\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.frequentlyBoughtTogether\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: Partial<{\r\n            answers: WidgetRenderState<AnswersRenderState, AnswersConnectorParams>;\r\n        } & {\r\n            autocomplete: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams>;\r\n        } & {\r\n            breadcrumb: {\r\n                [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n            };\r\n        } & {\r\n            clearRefinements: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams>;\r\n        } & {\r\n            configure: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams>;\r\n        } & {\r\n            currentRefinements: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams>;\r\n        } & {\r\n            geoSearch: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>>;\r\n        } & {\r\n            hierarchicalMenu: {\r\n                [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            hits: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            hitsPerPage: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams>;\r\n        } & {\r\n            infiniteHits: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            menu: {\r\n                [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n            };\r\n        } & {\r\n            numericMenu: {\r\n                [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            pagination: WidgetRenderState<PaginationRenderState, PaginationConnectorParams>;\r\n        } & {\r\n            poweredBy: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams>;\r\n        } & {\r\n            queryRules: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams>;\r\n        } & {\r\n            range: {\r\n                [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n            };\r\n        } & {\r\n            ratingMenu: {\r\n                [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            refinementList: {\r\n                [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n            };\r\n        } & {\r\n            relevantSort: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams>;\r\n        } & {\r\n            searchBox: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams>;\r\n        } & {\r\n            sortBy: WidgetRenderState<SortByRenderState, SortByConnectorParams>;\r\n        } & {\r\n            stats: WidgetRenderState<StatsRenderState, StatsConnectorParams>;\r\n        } & {\r\n            toggleRefinement: {\r\n                [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n            };\r\n        } & {\r\n            voiceSearch: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams>;\r\n        } & {\r\n            analytics: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams>;\r\n        } & {\r\n            places: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams>;\r\n        }>;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<THit>[];\r\n        widgetParams: Partial<FrequentlyBoughtTogetherWidgetParams<BaseHit>> & FrequentlyBoughtTogetherConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\ndeclare const _default_15: <THit extends NonNullable<object> = BaseHit>(widgetParams: LookingSimilarWidgetParams<THit> & LookingSimilarConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.lookingSimilar\";\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.lookingSimilar\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: Partial<{\r\n            answers: WidgetRenderState<AnswersRenderState, AnswersConnectorParams>;\r\n        } & {\r\n            autocomplete: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams>;\r\n        } & {\r\n            breadcrumb: {\r\n                [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n            };\r\n        } & {\r\n            clearRefinements: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams>;\r\n        } & {\r\n            configure: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams>;\r\n        } & {\r\n            currentRefinements: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams>;\r\n        } & {\r\n            geoSearch: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>>;\r\n        } & {\r\n            hierarchicalMenu: {\r\n                [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            hits: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            hitsPerPage: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams>;\r\n        } & {\r\n            infiniteHits: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>>;\r\n        } & {\r\n            menu: {\r\n                [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n            };\r\n        } & {\r\n            numericMenu: {\r\n                [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            pagination: WidgetRenderState<PaginationRenderState, PaginationConnectorParams>;\r\n        } & {\r\n            poweredBy: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams>;\r\n        } & {\r\n            queryRules: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams>;\r\n        } & {\r\n            range: {\r\n                [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n            };\r\n        } & {\r\n            ratingMenu: {\r\n                [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n            };\r\n        } & {\r\n            refinementList: {\r\n                [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n            };\r\n        } & {\r\n            relevantSort: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams>;\r\n        } & {\r\n            searchBox: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams>;\r\n        } & {\r\n            sortBy: WidgetRenderState<SortByRenderState, SortByConnectorParams>;\r\n        } & {\r\n            stats: WidgetRenderState<StatsRenderState, StatsConnectorParams>;\r\n        } & {\r\n            toggleRefinement: {\r\n                [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n            };\r\n        } & {\r\n            voiceSearch: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams>;\r\n        } & {\r\n            analytics: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams>;\r\n        } & {\r\n            places: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams>;\r\n        }>;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<THit>[];\r\n        widgetParams: Partial<LookingSimilarWidgetParams<BaseHit>> & LookingSimilarConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\ndeclare const _default_2: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<InfiniteHitsRenderState, TWidgetParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & InfiniteHitsConnectorParams<THit>) => {\r\n    $$type: \"ais.infiniteHits\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & InfiniteHitsWidgetDescription[\"indexRenderState\"];\r\n    getWidgetRenderState({ results, helper, parent, state: existingState, instantSearchInstance, }: InitOptions | RenderOptions): {\r\n        hits: Hit<THit>[];\r\n        items: Hit<THit>[];\r\n        currentPageHits: Hit<THit>[];\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        banner: Banner | undefined;\r\n        results: SearchResults<any> | undefined;\r\n        showPrevious: () => void;\r\n        showMore: () => void;\r\n        isFirstPage: boolean;\r\n        isLastPage: boolean;\r\n        widgetParams: TWidgetParams & InfiniteHitsConnectorParams<THit>;\r\n    };\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetUiState(uiState: {\r\n        page?: number | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    }, { searchParameters }: {\r\n        searchParameters: SearchParameters;\r\n        helper: AlgoliaSearchHelper;\r\n    }): {\r\n        page?: number | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    };\r\n    getWidgetSearchParameters(searchParameters: SearchParameters, { uiState }: {\r\n        uiState: {\r\n            page?: number | undefined;\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare const _default_3: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<RelatedProductsRenderState, RelatedProductsConnectorParams & TWidgetParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & RelatedProductsConnectorParams<THit>) => {\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.relatedProducts\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: IndexRenderState;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<BaseHit>[] | Hit<THit>[];\r\n        widgetParams: TWidgetParams & RelatedProductsConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\ndeclare const _default_4: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<TrendingItemsRenderState, TWidgetParams & TrendingItemsConnectorParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & TrendingItemsConnectorParams<THit>) => {\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.trendingItems\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: IndexRenderState;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<THit>[];\r\n        widgetParams: TWidgetParams & TrendingItemsConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\n/**\r\n * The **GeoSearch** connector provides the logic to build a widget that will display the results on a map. It also provides a way to search for results based on their position. The connector provides functions to manage the search experience (search on map interaction or control the interaction for example).\r\n *\r\n * @requirements\r\n *\r\n * Note that the GeoSearch connector uses the [geosearch](https://www.algolia.com/doc/guides/searching/geo-search) capabilities of Algolia. Your hits **must** have a `_geoloc` attribute in order to be passed to the rendering function.\r\n *\r\n * Currently, the feature is not compatible with multiple values in the _geoloc attribute.\r\n */\r\ndeclare const _default_5: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<GeoSearchRenderState, TWidgetParams & GeoSearchConnectorParams>, unmountFn?: Unmounter) => <THit extends GeoHit = GeoHit>(widgetParams: TWidgetParams & GeoSearchConnectorParams<THit>) => {\r\n    $$type: \"ais.geoSearch\";\r\n    init(initArgs: InitOptions): void;\r\n    render(renderArgs: RenderOptions): void;\r\n    getWidgetRenderState(renderOptions: InitOptions | RenderOptions): {\r\n        items: GeoHit<THit>[];\r\n        position: {\r\n            lat: number;\r\n            lng: number;\r\n        } | undefined;\r\n        currentRefinement: {\r\n            northEast: {\r\n                lat: number;\r\n                lng: number;\r\n            };\r\n            southWest: {\r\n                lat: number;\r\n                lng: number;\r\n            };\r\n        } | undefined;\r\n        refine: ({ northEast: ne, southWest: sw }: Bounds) => void;\r\n        sendEvent: SendEventForHits;\r\n        clearMapRefinement: () => void;\r\n        isRefinedWithMap: () => boolean;\r\n        toggleRefineOnMapMove: () => void;\r\n        isRefineOnMapMove: () => boolean;\r\n        setMapMoveSinceLastRefine: () => void;\r\n        hasMapMoveSinceLastRefine: () => boolean;\r\n        widgetParams: TWidgetParams & GeoSearchConnectorParams<THit>;\r\n    };\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & GeoSearchWidgetDescription[\"indexRenderState\"];\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetUiState(uiState: {\r\n        geoSearch?: {\r\n            /**\r\n             * The rectangular area in geo coordinates.\r\n             * The rectangle is defined by two diagonally opposite points,\r\n             * hence by 4 floats separated by commas.\r\n             *\r\n             * @example '47.3165,4.9665,47.3424,5.0201'\r\n             */\r\n            boundingBox: string;\r\n        } | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        page?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    }, { searchParameters }: {\r\n        searchParameters: SearchParameters;\r\n        helper: AlgoliaSearchHelper;\r\n    }): {\r\n        geoSearch?: {\r\n            /**\r\n             * The rectangular area in geo coordinates.\r\n             * The rectangle is defined by two diagonally opposite points,\r\n             * hence by 4 floats separated by commas.\r\n             *\r\n             * @example '47.3165,4.9665,47.3424,5.0201'\r\n             */\r\n            boundingBox: string;\r\n        } | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        page?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    };\r\n    getWidgetSearchParameters(searchParameters: SearchParameters, { uiState }: {\r\n        uiState: {\r\n            geoSearch?: {\r\n                /**\r\n                 * The rectangular area in geo coordinates.\r\n                 * The rectangle is defined by two diagonally opposite points,\r\n                 * hence by 4 floats separated by commas.\r\n                 *\r\n                 * @example '47.3165,4.9665,47.3424,5.0201'\r\n                 */\r\n                boundingBox: string;\r\n            } | undefined;\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            page?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare const _default_6: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<FrequentlyBoughtTogetherRenderState, TWidgetParams & FrequentlyBoughtTogetherConnectorParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & FrequentlyBoughtTogetherConnectorParams<THit>) => {\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.frequentlyBoughtTogether\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: IndexRenderState;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<THit>[];\r\n        widgetParams: TWidgetParams & FrequentlyBoughtTogetherConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\ndeclare const _default_7: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<LookingSimilarRenderState, TWidgetParams & LookingSimilarConnectorParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & LookingSimilarConnectorParams<THit>) => {\r\n    dependsOn: \"recommend\";\r\n    $$type: \"ais.lookingSimilar\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }): {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    };\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions | ({\r\n        instantSearchInstance: InstantSearch;\r\n        parent: IndexWidget;\r\n        templatesConfig: Record<string, unknown>;\r\n        scopedResults: ScopedResult[];\r\n        state: SearchParameters;\r\n        renderState: IndexRenderState;\r\n        helper: AlgoliaSearchHelper;\r\n        searchMetadata: {\r\n            isSearchStalled: boolean;\r\n        };\r\n        status: InstantSearch[\"status\"];\r\n        error: InstantSearch[\"error\"];\r\n        createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    } & {\r\n        results: RecommendResponse<any>;\r\n    })): {\r\n        items: Hit<THit>[];\r\n        widgetParams: TWidgetParams & LookingSimilarConnectorParams<THit>;\r\n        sendEvent: SendEventForHits;\r\n    };\r\n    dispose({ recommendState }: DisposeOptions): RecommendParameters;\r\n    getWidgetParameters(state: RecommendParameters): RecommendParameters;\r\n};\r\n\r\n/**\r\n * The **GeoSearch** widget displays the list of results from the search on a Google Maps. It also provides a way to search for results based on their position. The widget also provide some of the common GeoSearch patterns like search on map interaction.\r\n *\r\n * @requirements\r\n *\r\n * Note that the GeoSearch widget uses the [geosearch](https://www.algolia.com/doc/guides/searching/geo-search) capabilities of Algolia. Your hits **must** have a `_geoloc` attribute in order to be displayed on the map.\r\n *\r\n * Currently, the feature is not compatible with multiple values in the _geoloc attribute.\r\n *\r\n * You are also responsible for loading the Google Maps library, it's not shipped with InstantSearch. You need to load the Google Maps library and pass a reference to the widget. You can find more information about how to install the library in [the Google Maps documentation](https://developers.google.com/maps/documentation/javascript/tutorial).\r\n *\r\n * Don't forget to explicitly set the `height` of the map container (default class `.ais-geo-search--map`), otherwise it won't be shown (it's a requirement of Google Maps).\r\n */\r\ndeclare const _default_8: <THit extends GeoHit = GeoHit>(widgetParams: GeoSearchWidgetParams<THit> & GeoSearchConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.geoSearch\";\r\n    $$type: \"ais.geoSearch\";\r\n    init(initArgs: InitOptions): void;\r\n    render(renderArgs: RenderOptions): void;\r\n    getWidgetRenderState(renderOptions: InitOptions | RenderOptions): {\r\n        items: GeoHit<THit>[];\r\n        position: {\r\n            lat: number;\r\n            lng: number;\r\n        } | undefined;\r\n        currentRefinement: {\r\n            northEast: {\r\n                lat: number;\r\n                lng: number;\r\n            };\r\n            southWest: {\r\n                lat: number;\r\n                lng: number;\r\n            };\r\n        } | undefined;\r\n        refine: ({ northEast: ne, southWest: sw }: {\r\n            northEast: GeoLoc;\r\n            southWest: GeoLoc;\r\n        }) => void;\r\n        sendEvent: SendEventForHits;\r\n        clearMapRefinement: () => void;\r\n        isRefinedWithMap: () => boolean;\r\n        toggleRefineOnMapMove: () => void;\r\n        isRefineOnMapMove: () => boolean;\r\n        setMapMoveSinceLastRefine: () => void;\r\n        hasMapMoveSinceLastRefine: () => boolean;\r\n        widgetParams: {\r\n            renderState: {\r\n                templateProps?: PreparedTemplateProps<GeoSearchTemplates>;\r\n                isUserInteraction?: boolean;\r\n                isPendingRefine?: boolean;\r\n                markers?: any[];\r\n            };\r\n            container: HTMLElement;\r\n            googleReference: GeoSearchWidgetParams[\"googleReference\"];\r\n            initialZoom: GeoSearchWidgetParams[\"initialZoom\"];\r\n            initialPosition: GeoSearchWidgetParams[\"initialPosition\"];\r\n            templates: Partial<{\r\n                /** Template to use for the marker. */\r\n                HTMLMarker: Template<GeoHit>;\r\n                /** Template for the reset button. */\r\n                reset: Template;\r\n                /** Template for the toggle label. */\r\n                toggle: Template;\r\n                /** Template for the redo button. */\r\n                redo: Template;\r\n            }>;\r\n            cssClasses: ComponentCSSClasses<Partial<{\r\n            /** The root div of the widget. */\r\n            root: string | string[];\r\n            /** The map container of the widget. */\r\n            map: string | string[];\r\n            /** The control element of the widget. */\r\n            control: string | string[];\r\n            /** The label of the control element. */\r\n            label: string | string[];\r\n            /** The selected label of the control element. */\r\n            selectedLabel: string | string[];\r\n            /** The input of the control element. */\r\n            input: string | string[];\r\n            /** The redo search button. */\r\n            redo: string | string[];\r\n            /** The disabled redo search button. */\r\n            disabledRedo: string | string[];\r\n            /** The reset refinement button. */\r\n            reset: string | string[];\r\n            }> | undefined>;\r\n            createMarker: CreateMarker;\r\n            markerOptions: GeoSearchMarker<google.maps.MarkerOptions | Partial<HTMLMarkerArguments>>;\r\n            enableRefine: GeoSearchWidgetParams[\"enableRefine\"];\r\n            enableClearMapRefinement: GeoSearchWidgetParams[\"enableClearMapRefinement\"];\r\n            enableRefineControl: GeoSearchWidgetParams[\"enableRefineControl\"];\r\n        } & GeoSearchConnectorParams<THit>;\r\n    };\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & GeoSearchWidgetDescription[\"indexRenderState\"];\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetUiState(uiState: {\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        page?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    }, { searchParameters }: {\r\n        searchParameters: SearchParameters;\r\n        helper: AlgoliaSearchHelper;\r\n    }): {\r\n        geoSearch?: {\r\n            boundingBox: string;\r\n        } | undefined;\r\n        query?: string | undefined;\r\n        configure?: PlainSearchParameters | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: string[];\r\n        } | undefined;\r\n        hitsPerPage?: number | undefined;\r\n        page?: number | undefined;\r\n        menu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        range?: {\r\n            [attribute: string]: string;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: number | undefined;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: string[];\r\n        } | undefined;\r\n        relevantSort?: number | undefined;\r\n        sortBy?: string | undefined;\r\n        toggle?: {\r\n            [attribute: string]: boolean;\r\n        } | undefined;\r\n        places?: {\r\n            query: string;\r\n            position: string;\r\n        } | undefined;\r\n    };\r\n    getWidgetSearchParameters(searchParameters: SearchParameters, { uiState }: {\r\n        uiState: {\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            page?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare const _default_9: <THit extends NonNullable<object> = BaseHit>(widgetParams: HitsWidgetParams<THit> & HitsConnectorParams<THit>) => {\r\n    $$widgetType: \"ais.hits\";\r\n    $$type: \"ais.hits\";\r\n    init(initOptions: InitOptions): void;\r\n    render(renderOptions: RenderOptions): void;\r\n    getRenderState(renderState: {\r\n        answers?: WidgetRenderState<AnswersRenderState, AnswersConnectorParams> | undefined;\r\n        autocomplete?: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams> | undefined;\r\n        breadcrumb?: {\r\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\r\n        } | undefined;\r\n        clearRefinements?: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams> | undefined;\r\n        configure?: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams> | undefined;\r\n        currentRefinements?: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams> | undefined;\r\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\r\n        hierarchicalMenu?: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        } | undefined;\r\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\r\n        hitsPerPage?: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams> | undefined;\r\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\r\n        menu?: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        } | undefined;\r\n        numericMenu?: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        } | undefined;\r\n        pagination?: WidgetRenderState<PaginationRenderState, PaginationConnectorParams> | undefined;\r\n        poweredBy?: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams> | undefined;\r\n        queryRules?: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams> | undefined;\r\n        range?: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        } | undefined;\r\n        ratingMenu?: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        } | undefined;\r\n        refinementList?: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        } | undefined;\r\n        relevantSort?: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams> | undefined;\r\n        searchBox?: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams> | undefined;\r\n        sortBy?: WidgetRenderState<SortByRenderState, SortByConnectorParams> | undefined;\r\n        stats?: WidgetRenderState<StatsRenderState, StatsConnectorParams> | undefined;\r\n        toggleRefinement?: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        } | undefined;\r\n        voiceSearch?: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams> | undefined;\r\n        analytics?: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams> | undefined;\r\n        places?: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams> | undefined;\r\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & HitsWidgetDescription[\"indexRenderState\"];\r\n    getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions): {\r\n        hits: never[];\r\n        items: never[];\r\n        results: undefined;\r\n        banner: undefined;\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        widgetParams: Partial<HitsWidgetParams<BaseHit>> & HitsConnectorParams<THit>;\r\n    } | {\r\n        hits: Hit<BaseHit>[] | Hit<THit>[];\r\n        items: Hit<BaseHit>[] | Hit<THit>[];\r\n        results: SearchResults<any>;\r\n        banner: Banner | undefined;\r\n        sendEvent: SendEventForHits;\r\n        bindEvent: BindEventForHits;\r\n        widgetParams: Partial<HitsWidgetParams<BaseHit>> & HitsConnectorParams<THit>;\r\n    };\r\n    dispose({ state }: DisposeOptions): SearchParameters;\r\n    getWidgetSearchParameters(state: SearchParameters, _uiState: {\r\n        uiState: {\r\n            query?: string | undefined;\r\n            configure?: PlainSearchParameters | undefined;\r\n            geoSearch?: {\r\n                boundingBox: string;\r\n            } | undefined;\r\n            hierarchicalMenu?: {\r\n                [rootAttribute: string]: string[];\r\n            } | undefined;\r\n            hitsPerPage?: number | undefined;\r\n            page?: number | undefined;\r\n            menu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            numericMenu?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            range?: {\r\n                [attribute: string]: string;\r\n            } | undefined;\r\n            ratingMenu?: {\r\n                [attribute: string]: number | undefined;\r\n            } | undefined;\r\n            refinementList?: {\r\n                [attribute: string]: string[];\r\n            } | undefined;\r\n            relevantSort?: number | undefined;\r\n            sortBy?: string | undefined;\r\n            toggle?: {\r\n                [attribute: string]: boolean;\r\n            } | undefined;\r\n            places?: {\r\n                query: string;\r\n                position: string;\r\n            } | undefined;\r\n        };\r\n    }): SearchParameters;\r\n};\r\n\r\ndeclare type DisposeOptions = {\r\n    helper: AlgoliaSearchHelper;\r\n    state: SearchParameters;\r\n    recommendState: RecommendParameters;\r\n    parent: IndexWidget;\r\n};\r\n\r\ndeclare const dynamicWidgets: DynamicWidgetsWidget;\r\n\r\ndeclare type DynamicWidgetsConnector = Connector<DynamicWidgetsWidgetDescription, DynamicWidgetsConnectorParams>;\r\n\r\ndeclare type DynamicWidgetsConnectorParams = {\r\n    /**\r\n     * An array of widgets, displayed in the order defined by `facetOrdering`.\r\n     */\r\n    widgets: Widget[];\r\n    /**\r\n     * Function to return a fallback widget when an attribute isn't found in\r\n     * `widgets`.\r\n     */\r\n    fallbackWidget?: (args: {\r\n        /** The attribute name to create a widget for. */\r\n        attribute: string;\r\n    }) => Widget;\r\n    /**\r\n     * Function to transform the items to render.\r\n     * The function also exposes the full search response.\r\n     */\r\n    transformItems?: TransformItems<string, Omit<TransformItemsMetadata, 'results'> & {\r\n        results: NonNullable<TransformItemsMetadata['results']>;\r\n    }>;\r\n    /**\r\n     * To prevent unneeded extra network requests when widgets mount or unmount,\r\n     * we request all facet values by default. If you want to only request the\r\n     * facet values that are needed, you can set this option to the list of\r\n     * attributes you want to display.\r\n     *\r\n     * If `facets` is set to `['*']`, we request all facet values.\r\n     *\r\n     * Any facets that are requested due to the `facetOrdering` result are always\r\n     * requested by the widget that mounted itself.\r\n     *\r\n     * Setting `facets` to a value other than `['*']` will only prevent extra\r\n     * requests if all potential facets are listed.\r\n     *\r\n     * @default ['*']\r\n     */\r\n    facets?: ['*'] | string[];\r\n    /**\r\n     * If you have more than 20 facet values pinned, you need to increase the\r\n     * maxValuesPerFacet to at least that value.\r\n     *\r\n     * @default 20\r\n     */\r\n    maxValuesPerFacet?: number;\r\n};\r\n\r\ndeclare type DynamicWidgetsRenderState = {\r\n    attributesToRender: string[];\r\n};\r\n\r\ndeclare type DynamicWidgetsWidget = WidgetFactory<DynamicWidgetsWidgetDescription & {\r\n    $$widgetType: 'ais.dynamicWidgets';\r\n}, Omit<DynamicWidgetsConnectorParams, 'widgets' | 'fallbackWidget'>, DynamicWidgetsWidgetParams>;\r\n\r\ndeclare type DynamicWidgetsWidgetDescription = {\r\n    $$type: 'ais.dynamicWidgets';\r\n    renderState: DynamicWidgetsRenderState;\r\n    indexRenderState: {\r\n        dynamicWidgets: DynamicWidgetsRenderState;\r\n    };\r\n};\r\n\r\ndeclare type DynamicWidgetsWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * An array of widget creator functions, displayed in the order defined by\r\n     * `facetOrdering`.\r\n     */\r\n    widgets: Array<(container: HTMLElement) => Widget>;\r\n    /**\r\n     * Function to return a fallback widget when an attribute isn't found in\r\n     * `widgets`.\r\n     */\r\n    fallbackWidget?: (args: {\r\n        /** The attribute name to create a widget for. */\r\n        attribute: string;\r\n        /** CSS Selector or HTMLElement to insert the widget */\r\n        container: HTMLElement;\r\n    }) => Widget;\r\n};\r\n\r\ndeclare type Expand<T> = T extends infer O ? {\r\n    [K in keyof O]: O[K];\r\n} : never;\r\n\r\n/** @deprecated answers is no longer supported */\r\ndeclare const EXPERIMENTAL_answers: AnswersWidget;\r\n\r\n/** @deprecated use relatedItems instead */\r\ndeclare const EXPERIMENTAL_configureRelatedItems: ConfigureRelatedItemsWidget;\r\n\r\n/** @deprecated answers is no longer supported */\r\ndeclare const EXPERIMENTAL_connectAnswers: AnswersConnector;\r\n\r\n/** @deprecated use connectRelatedItems instead */\r\ndeclare const EXPERIMENTAL_connectConfigureRelatedItems: ConfigureRelatedItemsConnector;\r\n\r\n/** @deprecated use connectDynamicWidgets */\r\ndeclare const EXPERIMENTAL_connectDynamicWidgets: DynamicWidgetsConnector;\r\n\r\n/** @deprecated use dynamicWidgets */\r\ndeclare const EXPERIMENTAL_dynamicWidgets: DynamicWidgetsWidget;\r\n\r\ndeclare type FacetValue = string | boolean | number;\r\n\r\ndeclare type FrequentlyBoughtTogetherConnectorParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The objectIDs of the items to get the frequently bought together items for.\r\n     */\r\n    objectIDs: string[];\r\n    /**\r\n     * Threshold for the recommendations confidence score (between 0 and 100). Only recommendations with a greater score are returned.\r\n     */\r\n    threshold?: number;\r\n    /**\r\n     * The maximum number of recommendations to return.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * Parameters to pass to the request.\r\n     */\r\n    queryParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * Whether to escape HTML tags from items string values.\r\n     *\r\n     * @default true\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<Hit<THit>, {\r\n        results: RecommendResponse<AlgoliaHit<THit>>;\r\n    }>;\r\n};\r\n\r\ndeclare type FrequentlyBoughtTogetherCSSClasses = Partial<RecommendClassNames>;\r\n\r\ndeclare type FrequentlyBoughtTogetherRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The matched recommendations from Algolia API.\r\n     */\r\n    items: Array<Hit<THit>>;\r\n    /**\r\n     * Sends an event to the Insights middleware.\r\n     */\r\n    sendEvent: SendEventForHits;\r\n};\r\n\r\ndeclare type FrequentlyBoughtTogetherTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\r\n    /**\r\n     * Template to use when there are no results.\r\n     */\r\n    empty: Template<RecommendResponse<Hit<THit>>>;\r\n    /**\r\n     * Template to use for the header of the widget.\r\n     */\r\n    header: Template<Pick<Parameters<NonNullable<FrequentlyBoughtTogetherProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {\r\n        cssClasses: RecommendClassNames;\r\n    }>;\r\n    /**\r\n     * Template to use for each result. This template will receive an object containing a single record.\r\n     */\r\n    item: TemplateWithBindEvent<Hit<THit>>;\r\n    /**\r\n     * Template to use to wrap all items.\r\n     */\r\n    layout: Template<Pick<Parameters<NonNullable<FrequentlyBoughtTogetherProps<Hit<THit>>['layout']>>[0], 'items'> & {\r\n        templates: {\r\n            item: FrequentlyBoughtTogetherProps<Hit<THit>>['itemComponent'];\r\n        };\r\n        cssClasses: Pick<FrequentlyBoughtTogetherCSSClasses, 'list' | 'item'>;\r\n    }>;\r\n}>;\r\n\r\ndeclare type FrequentlyBoughtTogetherWidgetParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: FrequentlyBoughtTogetherTemplates<THit>;\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: FrequentlyBoughtTogetherCSSClasses;\r\n};\r\n\r\ndeclare type GeoHit<THit extends NonNullable<object> = BaseHit> = Hit<THit> & Required<Pick<Hit, '_geoloc'>>;\r\n\r\ndeclare type GeoLoc = {\r\n    lat: number;\r\n    lng: number;\r\n};\r\n\r\ndeclare type GeoSearchConnectorParams<THit extends GeoHit = GeoHit> = {\r\n    /**\r\n     * If true, refine will be triggered as you move the map.\r\n     * @default true\r\n     */\r\n    enableRefineOnMapMove?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     * @default items => items\r\n     */\r\n    transformItems?: TransformItems<GeoHit<THit>>;\r\n};\r\n\r\ndeclare type GeoSearchCSSClasses = Partial<{\r\n    /** The root div of the widget. */\r\n    root: string | string[];\r\n    /** The map container of the widget. */\r\n    map: string | string[];\r\n    /** The control element of the widget. */\r\n    control: string | string[];\r\n    /** The label of the control element. */\r\n    label: string | string[];\r\n    /** The selected label of the control element. */\r\n    selectedLabel: string | string[];\r\n    /** The input of the control element. */\r\n    input: string | string[];\r\n    /** The redo search button. */\r\n    redo: string | string[];\r\n    /** The disabled redo search button. */\r\n    disabledRedo: string | string[];\r\n    /** The reset refinement button. */\r\n    reset: string | string[];\r\n}>;\r\n\r\ndeclare type GeoSearchMarker<TOptions, THit extends GeoHit = GeoHit> = {\r\n    /**\r\n     * Function used to create the options passed to the Google Maps marker.\r\n     * See the documentation for more information:\r\n     * https://developers.google.com/maps/documentation/javascript/reference/3/#MarkerOptions\r\n     */\r\n    createOptions?: (item: THit) => TOptions;\r\n    /**\r\n     * Object that takes an event type (ex: `click`, `mouseover`) as key and a\r\n     * listener as value. The listener is provided with an object that contains:\r\n     * `event`, `item`, `marker`, `map`.\r\n     */\r\n    events: {\r\n        [key: string]: (event: {\r\n            item: any;\r\n            marker: any;\r\n            map: any;\r\n            event: any;\r\n        }) => void;\r\n    };\r\n};\r\n\r\ndeclare type GeoSearchRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * Reset the current bounding box refinement.\r\n     */\r\n    clearMapRefinement: () => void;\r\n    /**\r\n     * The current bounding box of the search.\r\n     */\r\n    currentRefinement?: Bounds;\r\n    /**\r\n     * Return true if the map has move since the last refinement.\r\n     */\r\n    hasMapMoveSinceLastRefine: () => boolean;\r\n    /**\r\n     * Return true if the current refinement is set with the map bounds.\r\n     */\r\n    isRefinedWithMap: () => boolean;\r\n    /**\r\n     * Return true if the user is able to refine on map move.\r\n     */\r\n    isRefineOnMapMove: () => boolean;\r\n    /**\r\n     * The matched hits from Algolia API.\r\n     */\r\n    items: Array<GeoHit<THit>>;\r\n    /**\r\n     * The current position of the search.\r\n     */\r\n    position?: GeoLoc;\r\n    /**\r\n     * Sets a bounding box to filter the results from the given map bounds.\r\n     */\r\n    refine: (bounds: Bounds) => void;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEventForHits;\r\n    /**\r\n     * Set the fact that the map has moved since the last refinement, should be\r\n     * called on each map move. The call to the function triggers a new rendering\r\n     * only when the value change.\r\n     */\r\n    setMapMoveSinceLastRefine: () => void;\r\n    /**\r\n     * Toggle the fact that the user is able to refine on map move.\r\n     */\r\n    toggleRefineOnMapMove: () => void;\r\n};\r\n\r\ndeclare type GeoSearchTemplates<THit extends GeoHit = GeoHit> = Partial<{\r\n    /** Template to use for the marker. */\r\n    HTMLMarker: Template<THit>;\r\n    /** Template for the reset button. */\r\n    reset: Template;\r\n    /** Template for the toggle label. */\r\n    toggle: Template;\r\n    /** Template for the redo button. */\r\n    redo: Template;\r\n}>;\r\n\r\ndeclare type GeoSearchWidgetDescription<THit extends GeoHit = GeoHit> = {\r\n    $$type: 'ais.geoSearch';\r\n    renderState: GeoSearchRenderState<THit>;\r\n    indexRenderState: {\r\n        geoSearch: WidgetRenderState<GeoSearchRenderState<THit>, GeoSearchConnectorParams<THit>>;\r\n    };\r\n    indexUiState: {\r\n        geoSearch: {\r\n            /**\r\n             * The rectangular area in geo coordinates.\r\n             * The rectangle is defined by two diagonally opposite points,\r\n             * hence by 4 floats separated by commas.\r\n             *\r\n             * @example '47.3165,4.9665,47.3424,5.0201'\r\n             */\r\n            boundingBox: string;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type GeoSearchWidgetParams<THit extends GeoHit = GeoHit> = {\r\n    /**\r\n     * By default the map will set the zoom accordingly to the markers displayed on it.\r\n     * When we refine it may happen that the results are empty. For those situations we\r\n     * need to provide a zoom to render the map.\r\n     * @default 1\r\n     */\r\n    initialZoom?: number;\r\n    /**\r\n     * By default the map will set the position accordingly to the markers displayed on it.\r\n     * When we refine it may happen that the results are empty. For those situations we need\r\n     * to provide a position to render the map. This option is ignored when the `position`\r\n     * is provided.\r\n     * @default { lat: 0, lng: 0 }\r\n     */\r\n    initialPosition?: GeoLoc;\r\n    /** Templates to use for the widget. */\r\n    templates?: GeoSearchTemplates<THit>;\r\n    /** CSS classes to add to the wrapping elements. */\r\n    cssClasses?: GeoSearchCSSClasses;\r\n    /**\r\n     * Options for customize the built-in Google Maps marker. This option is\r\n     * ignored when the `customHTMLMarker` is provided.\r\n     */\r\n    builtInMarker?: Partial<GeoSearchMarker<google.maps.MarkerOptions>>;\r\n    /**\r\n     * Options to customize the HTML marker. We provide an alternative to the\r\n     * built-in Google Maps marker in order to have a full control of the marker\r\n     * rendering. You can use plain HTML to build your marker.\r\n     */\r\n    customHTMLMarker?: Partial<GeoSearchMarker<Partial<HTMLMarkerArguments>>> | boolean;\r\n    /**\r\n     * If true, the map is used to search - otherwise it's for display purposes only.\r\n     * @default true\r\n     */\r\n    enableRefine?: boolean;\r\n    /**\r\n     * If true, a button is displayed on the map when the refinement is coming from\r\n     * the map in order to remove it.\r\n     * @default true\r\n     */\r\n    enableClearMapRefinement?: boolean;\r\n    /**\r\n     * If true, the user can toggle the option `enableRefineOnMapMove` directly from the map.\r\n     * @default true\r\n     */\r\n    enableRefineControl?: boolean;\r\n    /**\r\n     * Option forwarded to the Google Maps constructor.\r\n     * See the documentation for more information:\r\n     * https://developers.google.com/maps/documentation/javascript/reference/3/#MapOptions\r\n     */\r\n    mapOptions?: google.maps.MapOptions;\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Reference to the global `window.google` object.\r\n     * See [the documentation](https://developers.google.com/maps/documentation/javascript/tutorial) for more information.\r\n     */\r\n    googleReference: typeof window['google'];\r\n};\r\n\r\n/**\r\n * @deprecated This function will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\r\n */\r\ndeclare function getInsightsAnonymousUserToken(): string | undefined;\r\n\r\ndeclare function getInsightsAnonymousUserTokenInternal(): string | undefined;\r\n\r\ndeclare type GetWidgetRenderState<TWidgetFactory extends AnyWidgetFactory> = ReturnType<TWidgetFactory>['getWidgetRenderState'] extends (renderOptions: any) => infer TRenderState ? TRenderState extends Record<string, unknown> ? TRenderState : never : Record<string, unknown>;\r\n\r\ndeclare namespace helpers {\r\n    export {\r\n        reverseHighlight,\r\n        reverseSnippet,\r\n        highlight,\r\n        snippet,\r\n        insights,\r\n        getInsightsAnonymousUserToken,\r\n        getInsightsAnonymousUserTokenInternal,\r\n        HighlightOptions,\r\n        ReverseHighlightOptions,\r\n        SnippetOptions,\r\n        ReverseSnippetOptions\r\n    }\r\n}\r\n\r\ndeclare const hierarchicalMenu: HierarchicalMenuWidget;\r\n\r\ndeclare type HierarchicalMenuConnector = Connector<HierarchicalMenuWidgetDescription, HierarchicalMenuConnectorParams>;\r\n\r\ndeclare type HierarchicalMenuConnectorParams = {\r\n    /**\r\n     *  Attributes to use to generate the hierarchy of the menu.\r\n     */\r\n    attributes: string[];\r\n    /**\r\n     * Separator used in the attributes to separate level values.\r\n     */\r\n    separator?: string;\r\n    /**\r\n     * Prefix path to use if the first level is not the root level.\r\n     */\r\n    rootPath?: string | null;\r\n    /**\r\n     * Show the siblings of the selected parent levels of the current refined value. This\r\n     * does not impact the root level.\r\n     */\r\n    showParentLevel?: boolean;\r\n    /**\r\n     * Max number of values to display.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * Whether to display the \"show more\" button.\r\n     */\r\n    showMore?: boolean;\r\n    /**\r\n     * Max number of values to display when showing more.\r\n     */\r\n    showMoreLimit?: number;\r\n    /**\r\n     * How to sort refinements. Possible values: `count|isRefined|name:asc|name:desc`.\r\n     * You can also use a sort function that behaves like the standard Javascript [compareFunction](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Syntax).\r\n     *\r\n     * If a facetOrdering is set in the index settings, it is used when sortBy isn't passed\r\n     */\r\n    sortBy?: SortBy<SearchResults.HierarchicalFacet>;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<HierarchicalMenuItem>;\r\n};\r\n\r\ndeclare type HierarchicalMenuCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to the child list element.\r\n     */\r\n    childList: string | string[];\r\n    /**\r\n     * CSS class to add to each item element.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add to each selected item element.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS class to add to each parent item element.\r\n     */\r\n    parentItem: string | string[];\r\n    /**\r\n     * CSS class to add to each link (when using the default template).\r\n     */\r\n    link: string | string[];\r\n    /**\r\n     * CSS class to add to the link of each selected item element (when using the default template).\r\n     */\r\n    selectedItemLink: string | string[];\r\n    /**\r\n     * CSS class to add to each label (when using the default template).\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to each count element (when using the default template).\r\n     */\r\n    count: string | string[];\r\n    /**\r\n     * CSS class to add to the show more element.\r\n     */\r\n    showMore: string | string[];\r\n    /**\r\n     * CSS class to add to the disabled show more element.\r\n     */\r\n    disabledShowMore: string | string[];\r\n}>;\r\n\r\ndeclare type HierarchicalMenuItem = {\r\n    /**\r\n     * Value of the menu item.\r\n     */\r\n    value: string;\r\n    /**\r\n     * Human-readable value of the menu item.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Number of matched results after refinement is applied.\r\n     */\r\n    count: number;\r\n    /**\r\n     * Indicates if the refinement is applied.\r\n     */\r\n    isRefined: boolean;\r\n    /**\r\n     * n+1 level of items, same structure HierarchicalMenuItem\r\n     */\r\n    data: HierarchicalMenuItem[] | null;\r\n};\r\n\r\ndeclare type HierarchicalMenuRenderState = {\r\n    /**\r\n     * Creates an url for the next state for a clicked item.\r\n     */\r\n    createURL: CreateURL<string>;\r\n    /**\r\n     * Values to be rendered.\r\n     */\r\n    items: HierarchicalMenuItem[];\r\n    /**\r\n     * Sets the path of the hierarchical filter and triggers a new search.\r\n     */\r\n    refine: (value: string) => void;\r\n    /**\r\n     *  Indicates if search state can be refined.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * True if the menu is displaying all the menu items.\r\n     */\r\n    isShowingMore: boolean;\r\n    /**\r\n     * Toggles the number of values displayed between `limit` and `showMoreLimit`.\r\n     */\r\n    toggleShowMore: () => void;\r\n    /**\r\n     * `true` if the toggleShowMore button can be activated (enough items to display more or\r\n     * already displaying more than `limit` items)\r\n     */\r\n    canToggleShowMore: boolean;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEventForFacet;\r\n};\r\n\r\ndeclare type HierarchicalMenuTemplates = Partial<{\r\n    /**\r\n     * Item template, provided with `name`, `count`, `isRefined`, `url` data properties.\r\n     */\r\n    item: Template<{\r\n        name: string;\r\n        count: number;\r\n        isRefined: boolean;\r\n        url: string;\r\n        label: string;\r\n        cssClasses: HierarchicalMenuCSSClasses;\r\n    }>;\r\n    /**\r\n     * Template used for the show more text, provided with `isShowingMore` data property.\r\n     */\r\n    showMoreText: Template<{\r\n        isShowingMore: boolean;\r\n    }>;\r\n}>;\r\n\r\n/**\r\n * The hierarchical menu widget is used to create a navigation based on a hierarchy of facet attributes.\r\n *\r\n * It is commonly used for categories with subcategories.\r\n *\r\n * All attributes (lvl0, lvl1 here) must be declared as [attributes for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting) in your\r\n * Algolia settings.\r\n *\r\n * By default, the separator we expect is ` > ` (with spaces) but you can use\r\n * a different one by using the `separator` option.\r\n * @requirements\r\n * Your objects must be formatted in a specific way to be\r\n * able to display hierarchical menus. Here's an example:\r\n *\r\n * ```javascript\r\n * {\r\n *   \"objectID\": \"123\",\r\n *   \"name\": \"orange\",\r\n *   \"categories\": {\r\n *     \"lvl0\": \"fruits\",\r\n *     \"lvl1\": \"fruits > citrus\"\r\n *   }\r\n * }\r\n * ```\r\n *\r\n * Every level must be specified entirely.\r\n * It's also possible to have multiple values per level, for example:\r\n *\r\n * ```javascript\r\n * {\r\n *   \"objectID\": \"123\",\r\n *   \"name\": \"orange\",\r\n *   \"categories\": {\r\n *     \"lvl0\": [\"fruits\", \"vitamins\"],\r\n *     \"lvl1\": [\"fruits > citrus\", \"vitamins > C\"]\r\n *   }\r\n * }\r\n * ```\r\n * @type {WidgetFactory}\r\n * @devNovel HierarchicalMenu\r\n * @category filter\r\n * @param {HierarchicalMenuWidgetParams} widgetParams The HierarchicalMenu widget options.\r\n * @return {Widget} A new HierarchicalMenu widget instance.\r\n * @example\r\n * search.addWidgets([\r\n *   instantsearch.widgets.hierarchicalMenu({\r\n *     container: '#hierarchical-categories',\r\n *     attributes: ['hierarchicalCategories.lvl0', 'hierarchicalCategories.lvl1', 'hierarchicalCategories.lvl2'],\r\n *   })\r\n * ]);\r\n */\r\ndeclare type HierarchicalMenuWidget = WidgetFactory<HierarchicalMenuWidgetDescription & {\r\n    $$widgetType: 'ais.hierarchicalMenu';\r\n}, HierarchicalMenuConnectorParams, HierarchicalMenuWidgetParams>;\r\n\r\ndeclare type HierarchicalMenuWidgetDescription = {\r\n    $$type: 'ais.hierarchicalMenu';\r\n    renderState: HierarchicalMenuRenderState;\r\n    indexRenderState: {\r\n        hierarchicalMenu: {\r\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        hierarchicalMenu: {\r\n            [rootAttribute: string]: string[];\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type HierarchicalMenuWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Array of attributes to use to generate the hierarchy of the menu.\r\n     */\r\n    attributes: string[];\r\n    /**\r\n     * Separator used in the attributes to separate level values.\r\n     */\r\n    separator?: string;\r\n    /**\r\n     * Prefix path to use if the first level is not the root level.\r\n     */\r\n    rootPath?: string;\r\n    /**\r\n     * Show the siblings of the selected parent level of the current refined value.\r\n     *\r\n     * With `showParentLevel` set to `true` (default):\r\n     * - Parent lvl0\r\n     *   - **lvl1**\r\n     *     - **lvl2**\r\n     *     - lvl2\r\n     *     - lvl2\r\n     *   - lvl 1\r\n     *   - lvl 1\r\n     * - Parent lvl0\r\n     * - Parent lvl0\r\n     *\r\n     * With `showParentLevel` set to `false`:\r\n     * - Parent lvl0\r\n     *   - **lvl1**\r\n     *     - **lvl2**\r\n     * - Parent lvl0\r\n     * - Parent lvl0\r\n     */\r\n    showParentLevel?: boolean;\r\n    /**\r\n     * Max number of values to display.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * Whether to display the \"show more\" button.\r\n     */\r\n    showMore?: boolean;\r\n    /**\r\n     * Max number of values to display when showing more.\r\n     * does not impact the root level.\r\n     */\r\n    showMoreLimit?: number;\r\n    /**\r\n     * How to sort refinements. Possible values: `count|isRefined|name:asc|name:desc`.\r\n     * You can also use a sort function that behaves like the standard Javascript [compareFunction](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Syntax).\r\n     */\r\n    sortBy?: SortBy<HierarchicalMenuItem>;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<HierarchicalMenuItem>;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: HierarchicalMenuTemplates;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: HierarchicalMenuCSSClasses;\r\n};\r\n\r\n/**\r\n * @deprecated use html tagged templates and the Highlight component instead\r\n */\r\ndeclare function highlight({ attribute, highlightedTagName, hit, cssClasses, }: HighlightOptions): string;\r\n\r\ndeclare function Highlight_2<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: HighlightProps<THit>): h.JSX.Element;\r\n\r\ndeclare type HighlightClassNames = HighlightClassNames_2;\r\n\r\ndeclare type HighlightOptions = {\r\n    attribute: string | string[];\r\n    highlightedTagName?: string;\r\n    hit: Partial<Hit>;\r\n    cssClasses?: Partial<{\r\n        highlighted: string;\r\n    }>;\r\n};\r\n\r\ndeclare type HighlightProps<THit extends Hit<BaseHit>> = {\r\n    hit: THit;\r\n    attribute: keyof THit | string[];\r\n    cssClasses?: HighlightProps_2['classNames'];\r\n} & PartialKeys<Omit<HighlightProps_2, 'parts' | 'classNames'>, 'highlightedTagName' | 'nonHighlightedTagName' | 'separator'>;\r\n\r\ndeclare type HighlightProps_2 = Omit<HighlightProps_3, 'classNames'> & {\r\n    classNames?: Partial<HighlightClassNames>;\r\n};\r\n\r\ndeclare function historyRouter<TRouteState = UiState>({ createURL, parseURL, writeDelay, windowTitle, getLocation, start, dispose, push, cleanUrlOnDispose, }?: Partial<BrowserHistoryArgs<TRouteState>>): BrowserHistory<TRouteState>;\r\n\r\ndeclare type Hit<THit extends NonNullable<object> = Record<string, any>> = {\r\n    __position: number;\r\n    __queryID?: string;\r\n} & AlgoliaHit<THit>;\r\n\r\ndeclare type HitAttributeHighlightResult = {\r\n    value: string;\r\n    matchLevel: 'none' | 'partial' | 'full';\r\n    matchedWords: string[];\r\n    fullyHighlighted?: boolean;\r\n};\r\n\r\ndeclare type HitAttributeSnippetResult = Pick<HitAttributeHighlightResult, 'value' | 'matchLevel'>;\r\n\r\ndeclare type HitHighlightResult = {\r\n    [attribute: string]: HitAttributeHighlightResult | HitAttributeHighlightResult[] | HitHighlightResult[] | HitHighlightResult;\r\n};\r\n\r\ndeclare type HitsConnectorParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * Whether to escape HTML tags from hits string values.\r\n     *\r\n     * @default true\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<Hit<THit>>;\r\n};\r\n\r\ndeclare type HitsCSSClasses = Partial<HitsClassNames>;\r\n\r\ndeclare type HitSnippetResult = {\r\n    [attribute: string]: HitAttributeSnippetResult[] | HitSnippetResult[] | HitAttributeSnippetResult | HitSnippetResult;\r\n};\r\n\r\ndeclare const hitsPerPage: HitsPerPageWidget;\r\n\r\ndeclare type HitsPerPageConnector = Connector<HitsPerPageWidgetDescription, HitsPerPageConnectorParams>;\r\n\r\ndeclare type HitsPerPageConnectorParams = {\r\n    /**\r\n     * Array of objects defining the different values and labels.\r\n     */\r\n    items: HitsPerPageConnectorParamsItem[];\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<HitsPerPageRenderStateItem>;\r\n};\r\n\r\ndeclare type HitsPerPageConnectorParamsItem = {\r\n    /**\r\n     * Label to display in the option.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Number of hits to display per page.\r\n     */\r\n    value: number;\r\n    /**\r\n     * The default hits per page on first search.\r\n     *\r\n     * @default false\r\n     */\r\n    default?: boolean;\r\n};\r\n\r\ndeclare type HitsPerPageCSSClasses = Partial<{\r\n    /**\r\n     * CSS classes added to the outer `<div>`.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS classes added to the parent `<select>`.\r\n     */\r\n    select: string | string[];\r\n    /**\r\n     * CSS classes added to each `<option>`.\r\n     */\r\n    option: string | string[];\r\n}>;\r\n\r\ndeclare type HitsPerPageRenderState = {\r\n    /**\r\n     * Array of objects defining the different values and labels.\r\n     */\r\n    items: HitsPerPageRenderStateItem[];\r\n    /**\r\n     * Creates the URL for a single item name in the list.\r\n     */\r\n    createURL: CreateURL<HitsPerPageConnectorParamsItem['value']>;\r\n    /**\r\n     * Sets the number of hits per page and triggers a search.\r\n     */\r\n    refine: (value: number) => void;\r\n    /**\r\n     * Indicates whether or not the search has results.\r\n     * @deprecated Use `canRefine` instead.\r\n     */\r\n    hasNoResults: boolean;\r\n    /**\r\n     * Indicates if search state can be refined.\r\n     */\r\n    canRefine: boolean;\r\n};\r\n\r\ndeclare type HitsPerPageRenderStateItem = {\r\n    /**\r\n     * Label to display in the option.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Number of hits to display per page.\r\n     */\r\n    value: number;\r\n    /**\r\n     * Indicates if it's the current refined value.\r\n     */\r\n    isRefined: boolean;\r\n};\r\n\r\ndeclare type HitsPerPageWidget = WidgetFactory<HitsPerPageWidgetDescription & {\r\n    $$widgetType: 'ais.hitsPerPage';\r\n}, HitsPerPageConnectorParams, HitsPerPageWidgetParams>;\r\n\r\ndeclare type HitsPerPageWidgetDescription = {\r\n    $$type: 'ais.hitsPerPage';\r\n    renderState: HitsPerPageRenderState;\r\n    indexRenderState: {\r\n        hitsPerPage: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        hitsPerPage: number;\r\n    };\r\n};\r\n\r\ndeclare type HitsPerPageWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * CSS classes to be added.\r\n     */\r\n    cssClasses?: HitsPerPageCSSClasses;\r\n};\r\n\r\ndeclare type HitsRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The matched hits from Algolia API.\r\n     * @deprecated use `items` instead\r\n     */\r\n    hits: Array<Hit<THit>>;\r\n    /**\r\n     * The matched hits from Algolia API.\r\n     */\r\n    items: Array<Hit<THit>>;\r\n    /**\r\n     * The response from the Algolia API.\r\n     */\r\n    results?: SearchResults<Hit<THit>>;\r\n    /**\r\n     * The banner to display above the hits.\r\n     */\r\n    banner?: Banner;\r\n    /**\r\n     * Sends an event to the Insights middleware.\r\n     */\r\n    sendEvent: SendEventForHits;\r\n    /**\r\n     * Returns a string for the `data-insights-event` attribute for the Insights middleware\r\n     */\r\n    bindEvent: BindEventForHits;\r\n};\r\n\r\ndeclare type HitsTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\r\n    /**\r\n     * Template to use when there are no results.\r\n     *\r\n     * @default 'No Results'\r\n     */\r\n    empty: Template<SearchResults<THit>>;\r\n    /**\r\n     * Template to use for each result. This template will receive an object containing a single record.\r\n     *\r\n     * @default ''\r\n     */\r\n    item: TemplateWithBindEvent<Hit<THit> & {\r\n        /** @deprecated the index in the hits array, use __position instead, which is the absolute position */\r\n        __hitIndex: number;\r\n    }>;\r\n    /**\r\n     * Template to use for the banner.\r\n     */\r\n    banner: Template<{\r\n        banner: Required<HitsRenderState['banner']>;\r\n        className: string;\r\n    }>;\r\n}>;\r\n\r\ndeclare type HitsWidgetDescription<THit extends NonNullable<object> = BaseHit> = {\r\n    $$type: 'ais.hits';\r\n    renderState: HitsRenderState<THit>;\r\n    indexRenderState: {\r\n        hits: WidgetRenderState<HitsRenderState<THit>, HitsConnectorParams<THit>>;\r\n    };\r\n};\r\n\r\ndeclare type HitsWidgetParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: HitsTemplates<THit>;\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: HitsCSSClasses;\r\n};\r\n\r\ndeclare type HoganHelpers<TKeys extends string = string> = Record<TKeys, (text: string, render: (value: string) => string) => string>;\r\n\r\ndeclare type HTMLMarkerArguments = {\r\n    __id: string;\r\n    position: google.maps.LatLngLiteral;\r\n    map: google.maps.Map;\r\n    template: ReturnType<typeof renderTemplate>;\r\n    title?: string;\r\n    className: string;\r\n    anchor?: {\r\n        x: number;\r\n        y: number;\r\n    };\r\n};\r\n\r\ndeclare const index: (widgetParams: IndexWidgetParams) => IndexWidget;\r\n\r\ndeclare type IndexInitOptions = {\r\n    instantSearchInstance: InstantSearch;\r\n    parent: IndexWidget | null;\r\n    uiState: UiState;\r\n};\r\n\r\ndeclare type IndexRenderOptions = {\r\n    instantSearchInstance: InstantSearch;\r\n};\r\n\r\ndeclare type IndexRenderState = Partial<ConnectorRenderStates & WidgetRenderStates>;\r\n\r\ndeclare type IndexUiState = Partial<ConnectorUiStates & WidgetUiStates>;\r\n\r\ndeclare type IndexWidget<TUiState extends UiState = UiState> = Omit<Widget<IndexWidgetDescription & {\r\n    widgetParams: IndexWidgetParams;\r\n}>, 'getWidgetUiState' | 'getWidgetState'> & {\r\n    getIndexName: () => string;\r\n    getIndexId: () => string;\r\n    getHelper: () => AlgoliaSearchHelper | null;\r\n    getResults: () => SearchResults | null;\r\n    getResultsForWidget: (widget: IndexWidget | Widget) => SearchResults | RecommendResponse<any> | null;\r\n    getPreviousState: () => SearchParameters | null;\r\n    getScopedResults: () => ScopedResult[];\r\n    getParent: () => IndexWidget | null;\r\n    getWidgets: () => Array<Widget | IndexWidget>;\r\n    createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n    addWidgets: (widgets: Array<Widget | IndexWidget>) => IndexWidget;\r\n    removeWidgets: (widgets: Array<Widget | IndexWidget>) => IndexWidget;\r\n    init: (options: IndexInitOptions) => void;\r\n    render: (options: IndexRenderOptions) => void;\r\n    dispose: () => void;\r\n    /**\r\n     * @deprecated\r\n     */\r\n    getWidgetState: (uiState: UiState) => UiState;\r\n    getWidgetUiState: <TSpecificUiState extends UiState = TUiState>(uiState: TSpecificUiState) => TSpecificUiState;\r\n    getWidgetSearchParameters: (searchParameters: SearchParameters, searchParametersOptions: {\r\n        uiState: IndexUiState;\r\n    }) => SearchParameters;\r\n    /**\r\n     * Set this index' UI state back to the state defined by the widgets.\r\n     * Can only be called after `init`.\r\n     */\r\n    refreshUiState: () => void;\r\n    /**\r\n     * Set this index' UI state and search. This is the equivalent of calling\r\n     * a spread `setUiState` on the InstantSearch instance.\r\n     * Can only be called after `init`.\r\n     */\r\n    setIndexUiState: (indexUiState: TUiState[string] | ((previousIndexUiState: TUiState[string]) => TUiState[string])) => void;\r\n};\r\n\r\ndeclare type IndexWidgetDescription = {\r\n    $$type: 'ais.index';\r\n    $$widgetType: 'ais.index';\r\n};\r\n\r\ndeclare type IndexWidgetParams = {\r\n    indexName: string;\r\n    indexId?: string;\r\n};\r\n\r\ndeclare type InfiniteHitsCache<THit extends NonNullable<object> = BaseHit> = {\r\n    read: Read<THit>;\r\n    write: Write<THit>;\r\n};\r\n\r\ndeclare type InfiniteHitsCachedHits<THit extends NonNullable<object>> = {\r\n    [page: number]: Array<Hit<THit>>;\r\n};\r\n\r\ndeclare type InfiniteHitsConnectorParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * Escapes HTML entities from hits string values.\r\n     *\r\n     * @default `true`\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Enable the button to load previous results.\r\n     *\r\n     * @default `false`\r\n     */\r\n    showPrevious?: boolean;\r\n    /**\r\n     * Receives the items, and is called before displaying them.\r\n     * Useful for mapping over the items to transform, and remove or reorder them.\r\n     */\r\n    transformItems?: TransformItems<Hit<THit>>;\r\n    /**\r\n     * Reads and writes hits from/to cache.\r\n     * When user comes back to the search page after leaving for product page,\r\n     * this helps restore InfiniteHits and its scroll position.\r\n     */\r\n    cache?: InfiniteHitsCache<THit>;\r\n};\r\n\r\ndeclare type InfiniteHitsCSSClasses = Partial<{\r\n    /**\r\n     * The root element of the widget.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * The root container without results.\r\n     */\r\n    emptyRoot: string | string[];\r\n    /**\r\n     * The list of results.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * The list item.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * The “Show previous” button.\r\n     */\r\n    loadPrevious: string | string[];\r\n    /**\r\n     * The disabled “Show previous” button.\r\n     */\r\n    disabledLoadPrevious: string | string[];\r\n    /**\r\n     * The “Show more” button.\r\n     */\r\n    loadMore: string | string[];\r\n    /**\r\n     * The disabled “Show more” button.\r\n     */\r\n    disabledLoadMore: string | string[];\r\n    /**\r\n     * Class names to apply to the banner element\r\n     */\r\n    bannerRoot: string | string[];\r\n    /**\r\n     * Class names to apply to the banner image element\r\n     */\r\n    bannerImage: string | string[];\r\n    /**\r\n     * Class names to apply to the banner link element\r\n     */\r\n    bannerLink: string | string[];\r\n}>;\r\n\r\ndeclare type InfiniteHitsRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * Loads the previous results.\r\n     */\r\n    showPrevious: () => void;\r\n    /**\r\n     * Loads the next page of hits.\r\n     */\r\n    showMore: () => void;\r\n    /**\r\n     * Indicates whether the first page of hits has been reached.\r\n     */\r\n    isFirstPage: boolean;\r\n    /**\r\n     * Indicates whether the last page of hits has been reached.\r\n     */\r\n    isLastPage: boolean;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEventForHits;\r\n    /**\r\n     * Returns a string of data-insights-event attribute for insights middleware\r\n     */\r\n    bindEvent: BindEventForHits;\r\n    /**\r\n     * Hits for the current page\r\n     */\r\n    currentPageHits: Array<Hit<THit>>;\r\n    /**\r\n     * Hits for current and cached pages\r\n     * @deprecated use `items` instead\r\n     */\r\n    hits: Array<Hit<THit>>;\r\n    /**\r\n     * Hits for current and cached pages\r\n     */\r\n    items: Array<Hit<THit>>;\r\n    /**\r\n     * The response from the Algolia API.\r\n     */\r\n    results?: SearchResults<Hit<THit>> | null;\r\n    /**\r\n     * The banner to display above the hits.\r\n     */\r\n    banner?: Banner;\r\n};\r\n\r\ndeclare type InfiniteHitsTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\r\n    /**\r\n     * The template to use when there are no results.\r\n     */\r\n    empty: Template<SearchResults<THit>>;\r\n    /**\r\n     * The template to use for the “Show previous” label.\r\n     */\r\n    showPreviousText: Template;\r\n    /**\r\n     * The template to use for the “Show more” label.\r\n     */\r\n    showMoreText: Template;\r\n    /**\r\n     * The template to use for each result.\r\n     */\r\n    item: TemplateWithBindEvent<Hit<THit> & {\r\n        /** @deprecated the index in the hits array, use __position instead, which is the absolute position */\r\n        __hitIndex: number;\r\n    }>;\r\n    /**\r\n     * Template to use for the banner.\r\n     */\r\n    banner: Template<{\r\n        banner: Required<InfiniteHitsRenderState['banner']>;\r\n        className: string;\r\n    }>;\r\n}>;\r\n\r\ndeclare type InfiniteHitsWidgetDescription<THit extends NonNullable<object> = BaseHit> = {\r\n    $$type: 'ais.infiniteHits';\r\n    renderState: InfiniteHitsRenderState<THit>;\r\n    indexRenderState: {\r\n        infiniteHits: WidgetRenderState<InfiniteHitsRenderState<THit>, InfiniteHitsConnectorParams<THit>>;\r\n    };\r\n    indexUiState: {\r\n        page: number;\r\n    };\r\n};\r\n\r\ndeclare type InfiniteHitsWidgetParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The CSS Selector or `HTMLElement` to insert the widget into.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * The CSS classes to override.\r\n     */\r\n    cssClasses?: InfiniteHitsCSSClasses;\r\n    /**\r\n     * The templates to use for the widget.\r\n     */\r\n    templates?: InfiniteHitsTemplates<THit>;\r\n    /**\r\n     * Reads and writes hits from/to cache.\r\n     * When user comes back to the search page after leaving for product page,\r\n     * this helps restore InfiniteHits and its scroll position.\r\n     */\r\n    cache?: InfiniteHitsCache;\r\n};\r\n\r\ndeclare type InitialResult = {\r\n    state?: PlainSearchParameters;\r\n    results?: SearchResults['_rawResults'];\r\n    recommendResults?: {\r\n        params: NonNullable<RecommendParametersOptions['params']>;\r\n        results: RecommendResults['_rawResults'];\r\n    };\r\n    requestParams?: SearchOptions[];\r\n};\r\n\r\ndeclare type InitialResults = Record<string, InitialResult>;\r\n\r\ndeclare type InitOptions = SharedRenderOptions & {\r\n    uiState: UiState;\r\n    results?: undefined;\r\n};\r\n\r\n/**\r\n * @deprecated This function will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\r\n */\r\ndeclare function insights(method: InsightsClientMethod, payload: Partial<InsightsClientPayload>): string;\r\n\r\ndeclare type InsightsClient = InsightsClient_2 & {\r\n    queue?: QueueItem[];\r\n};\r\n\r\ndeclare type InsightsClientMethod = keyof InsightsMethodMap;\r\n\r\ndeclare type InsightsClientPayload = {\r\n    eventName: string;\r\n    queryID: string;\r\n    index: string;\r\n    objectIDs: string[];\r\n    positions?: number[];\r\n};\r\n\r\ndeclare type InsightsClientWithGlobals = InsightsClient & {\r\n    shouldAddScript?: boolean;\r\n    version?: string;\r\n};\r\n\r\ndeclare type InsightsEvent<TMethod extends InsightsMethod = InsightsMethod> = InsightsEvent_2<TMethod>;\r\n\r\n/**\r\n * The event sent to the insights middleware.\r\n */\r\ndeclare type InsightsEvent_2<TMethod extends InsightsMethod = InsightsMethod> = {\r\n    insightsMethod?: TMethod;\r\n    payload: InsightsMethodMap[TMethod][0][0];\r\n    widgetType: string;\r\n    eventType: string;\r\n    eventModifier?: string;\r\n    hits?: Hit[];\r\n    attribute?: string;\r\n};\r\n\r\n/**\r\n * Method allowed by the insights middleware.\r\n */\r\ndeclare type InsightsMethod = 'clickedObjectIDsAfterSearch' | 'clickedObjectIDs' | 'clickedFilters' | 'convertedObjectIDsAfterSearch' | 'convertedObjectIDs' | 'convertedFilters' | 'viewedObjectIDs' | 'viewedFilters';\r\n\r\ndeclare type InsightsMethodMap = InsightsMethodMap_2;\r\n\r\ndeclare type InsightsProps<TInsightsClient extends ProvidedInsightsClient = ProvidedInsightsClient> = {\r\n    insightsClient?: TInsightsClient;\r\n    insightsInitParams?: Partial<InsightsMethodMap['init'][0][0]>;\r\n    onEvent?: (event: InsightsEvent, insightsClient: TInsightsClient) => void;\r\n};\r\n\r\n/**\r\n * The actual implementation of the InstantSearch. This is\r\n * created using the `instantsearch` factory function.\r\n * It emits the 'render' event every time a search is done\r\n */\r\ndeclare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TUiState> extends EventEmitter {\r\n    client: InstantSearchOptions['searchClient'];\r\n    indexName: string;\r\n    compositionID?: string;\r\n    insightsClient: InsightsClient | null;\r\n    onStateChange: InstantSearchOptions<TUiState>['onStateChange'] | null;\r\n    future: NonNullable<InstantSearchOptions<TUiState>['future']>;\r\n    helper: AlgoliaSearchHelper | null;\r\n    mainHelper: AlgoliaSearchHelper | null;\r\n    mainIndex: IndexWidget;\r\n    started: boolean;\r\n    templatesConfig: Record<string, unknown>;\r\n    renderState: RenderState;\r\n    _stalledSearchDelay: number;\r\n    _searchStalledTimer: any;\r\n    _initialUiState: TUiState;\r\n    _initialResults: InitialResults | null;\r\n    _createURL: CreateURL<TUiState>;\r\n    _searchFunction?: InstantSearchOptions['searchFunction'];\r\n    _mainHelperSearch?: AlgoliaSearchHelper['search'];\r\n    _hasSearchWidget: boolean;\r\n    _hasRecommendWidget: boolean;\r\n    _insights: InstantSearchOptions['insights'];\r\n    middleware: Array<{\r\n        creator: Middleware<TUiState>;\r\n        instance: MiddlewareDefinition<TUiState>;\r\n    }>;\r\n    sendEventToInsights: (event: InsightsEvent) => void;\r\n    /**\r\n     * The status of the search. Can be \"idle\", \"loading\", \"stalled\", or \"error\".\r\n     */\r\n    status: InstantSearchStatus;\r\n    /**\r\n     * The last returned error from the Search API.\r\n     * The error gets cleared when the next valid search response is rendered.\r\n     */\r\n    error: Error | undefined;\r\n    /**\r\n     * @deprecated use `status === 'stalled'` instead\r\n     */\r\n    get _isSearchStalled(): boolean;\r\n    constructor(options: InstantSearchOptions<TUiState, TRouteState>);\r\n    /**\r\n     * Hooks a middleware into the InstantSearch lifecycle.\r\n     */\r\n    use(...middleware: Array<Middleware<TUiState>>): this;\r\n    /**\r\n     * Removes a middleware from the InstantSearch lifecycle.\r\n     */\r\n    unuse(...middlewareToUnuse: Array<Middleware<TUiState>>): this;\r\n    EXPERIMENTAL_use(...middleware: Middleware[]): this;\r\n    /**\r\n     * Adds a widget to the search instance.\r\n     * A widget can be added either before or after InstantSearch has started.\r\n     * @param widget The widget to add to InstantSearch.\r\n     *\r\n     * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `addWidgets([widget])`.\r\n     */\r\n    addWidget(widget: Widget): this;\r\n    /**\r\n     * Adds multiple widgets to the search instance.\r\n     * Widgets can be added either before or after InstantSearch has started.\r\n     * @param widgets The array of widgets to add to InstantSearch.\r\n     */\r\n    addWidgets(widgets: Array<Widget | IndexWidget>): this;\r\n    /**\r\n     * Removes a widget from the search instance.\r\n     * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `removeWidgets([widget])`\r\n     * @param widget The widget instance to remove from InstantSearch.\r\n     *\r\n     * The widget must implement a `dispose()` method to clear its state.\r\n     */\r\n    removeWidget(widget: Widget | IndexWidget): this;\r\n    /**\r\n     * Removes multiple widgets from the search instance.\r\n     * @param widgets Array of widgets instances to remove from InstantSearch.\r\n     *\r\n     * The widgets must implement a `dispose()` method to clear their states.\r\n     */\r\n    removeWidgets(widgets: Array<Widget | IndexWidget>): this;\r\n    /**\r\n     * Ends the initialization of InstantSearch.js and triggers the\r\n     * first search.\r\n     */\r\n    start(): void;\r\n    /**\r\n     * Removes all widgets without triggering a search afterwards.\r\n     * @return {undefined} This method does not return anything\r\n     */\r\n    dispose(): void;\r\n    scheduleSearch: (() => void) & {\r\n        wait: () => Promise<void>;\r\n        cancel: () => void;\r\n    };\r\n    scheduleRender: ((shouldResetStatus?: boolean) => void) & {\r\n        wait: () => Promise<void>;\r\n        cancel: () => void;\r\n    };\r\n    scheduleStalledRender(): void;\r\n    /**\r\n     * Set the UI state and trigger a search.\r\n     * @param uiState The next UI state or a function computing it from the current state\r\n     * @param callOnStateChange private parameter used to know if the method is called from a state change\r\n     */\r\n    setUiState(uiState: TUiState | ((previousUiState: TUiState) => TUiState), callOnStateChange?: boolean): void;\r\n    getUiState(): TUiState;\r\n    onInternalStateChange: (() => void) & {\r\n        wait: () => Promise<void>;\r\n        cancel: () => void;\r\n    };\r\n    createURL(nextState?: TUiState): string;\r\n    refresh(): void;\r\n}\r\n\r\n/**\r\n * InstantSearch is the main component of InstantSearch.js. This object\r\n * manages the widget and lets you add new ones.\r\n *\r\n * Two parameters are required to get you started with InstantSearch.js:\r\n *  - `indexName`: the main index that you will use for your new search UI\r\n *  - `searchClient`: the search client to plug to InstantSearch.js\r\n *\r\n * The [search client provided by Algolia](algolia.com/doc/api-client/getting-started/what-is-the-api-client/javascript/)\r\n * needs an `appId` and an `apiKey`. Those parameters can be found in your\r\n * [Algolia dashboard](https://www.algolia.com/api-keys).\r\n *\r\n * If you want to get up and running quickly with InstantSearch.js, have a\r\n * look at the [getting started](https://www.algolia.com/doc/guides/building-search-ui/getting-started/js/).\r\n */\r\ndeclare const instantsearch: InstantSearchModule;\r\nexport default instantsearch;\r\n\r\ndeclare type InstantSearchModule = {\r\n    <TUiState = Record<string, unknown>, TRouteState = TUiState>(options: InstantSearchOptions<Expand<UiState & TUiState>, TRouteState>): InstantSearch<Expand<UiState & TUiState>, TRouteState>;\r\n    version: string;\r\n    connectors: typeof connectors;\r\n    widgets: typeof widgets;\r\n    middlewares: typeof middlewares;\r\n    routers: typeof routers;\r\n    stateMappings: typeof stateMappings;\r\n    templates: typeof templates;\r\n    createInfiniteHitsSessionStorageCache: typeof createInfiniteHitsSessionStorageCache;\r\n    /** @deprecated use html tagged templates and the Highlight component instead */\r\n    highlight: typeof helpers.highlight;\r\n    /** @deprecated use html tagged templates and the ReverseHighlight component instead */\r\n    reverseHighlight: typeof helpers.reverseHighlight;\r\n    /** @deprecated use html tagged templates and the Snippet component instead */\r\n    snippet: typeof helpers.snippet;\r\n    /** @deprecated use html tagged templates and the ReverseSnippet component instead */\r\n    reverseSnippet: typeof helpers.reverseSnippet;\r\n    /**\r\n     * @deprecated use createInsightsMiddleware\r\n     * @link https://www.algolia.com/doc/api-reference/widgets/insights/js/\r\n     */\r\n    insights: typeof helpers.insights;\r\n};\r\n\r\n/**\r\n * Global options for an InstantSearch instance.\r\n */\r\ndeclare type InstantSearchOptions<TUiState extends UiState = UiState, TRouteState = TUiState> = {\r\n    /**\r\n     * The name of the main index. If no indexName is provided, you have to manually add an index widget.\r\n     */\r\n    indexName?: string;\r\n    /**\r\n     * The objectID of the composition.\r\n     * If this is passed, the composition API will be used for search.\r\n     * Multi-index search is not supported with this option.\r\n     */\r\n    compositionID?: string;\r\n    /**\r\n     * The search client to plug to InstantSearch.js\r\n     *\r\n     * Usage:\r\n     * ```javascript\r\n     * // Using the default Algolia search client\r\n     * instantsearch({\r\n     *   indexName: 'indexName',\r\n     *   searchClient: algoliasearch('appId', 'apiKey')\r\n     * });\r\n     *\r\n     * // Using a custom search client\r\n     * instantsearch({\r\n     *   indexName: 'indexName',\r\n     *   searchClient: {\r\n     *     search(requests) {\r\n     *       // fetch response based on requests\r\n     *       return response;\r\n     *     },\r\n     *     searchForFacetValues(requests) {\r\n     *       // fetch response based on requests\r\n     *       return response;\r\n     *     }\r\n     *   }\r\n     * });\r\n     * ```\r\n     */\r\n    searchClient: SearchClient | CompositionClient;\r\n    /**\r\n     * The locale used to display numbers. This will be passed\r\n     * to `Number.prototype.toLocaleString()`\r\n     */\r\n    numberLocale?: string;\r\n    /**\r\n     * A hook that will be called each time a search needs to be done, with the\r\n     * helper as a parameter. It's your responsibility to call `helper.search()`.\r\n     * This option allows you to avoid doing searches at page load for example.\r\n     * @deprecated use onStateChange instead\r\n     */\r\n    searchFunction?: (helper: AlgoliaSearchHelper) => void;\r\n    /**\r\n     * Function called when the state changes.\r\n     *\r\n     * Using this function makes the instance controlled. This means that you\r\n     * become in charge of updating the UI state with the `setUiState` function.\r\n     */\r\n    onStateChange?: (params: {\r\n        uiState: TUiState;\r\n        setUiState: (uiState: TUiState | ((previousUiState: TUiState) => TUiState)) => void;\r\n    }) => void;\r\n    /**\r\n     * Injects a `uiState` to the `instantsearch` instance. You can use this option\r\n     * to provide an initial state to a widget. Note that the state is only used\r\n     * for the first search. To unconditionally pass additional parameters to the\r\n     * Algolia API, take a look at the `configure` widget.\r\n     */\r\n    initialUiState?: NoInfer_2<TUiState>;\r\n    /**\r\n     * Time before a search is considered stalled. The default is 200ms\r\n     */\r\n    stalledSearchDelay?: number;\r\n    /**\r\n     * Router configuration used to save the UI State into the URL or any other\r\n     * client side persistence. Passing `true` will use the default URL options.\r\n     */\r\n    routing?: RouterProps<TUiState, TRouteState> | boolean;\r\n    /**\r\n     * Enables the Insights middleware and loads the Insights library\r\n     * if not already loaded.\r\n     *\r\n     * The Insights middleware sends view and click events automatically, and lets\r\n     * you set up your own events.\r\n     *\r\n     * @default false\r\n     */\r\n    insights?: InsightsProps | boolean;\r\n    /**\r\n     * the instance of search-insights to use for sending insights events inside\r\n     * widgets like `hits`.\r\n     *\r\n     * @deprecated This property will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\r\n     */\r\n    insightsClient?: InsightsClient;\r\n    future?: {\r\n        /**\r\n         * Changes the way `dispose` is used in InstantSearch lifecycle.\r\n         *\r\n         * If `false` (by default), each widget unmounting will remove its state as well, even if there are multiple widgets reading that UI State.\r\n         *\r\n         * If `true`, each widget unmounting will only remove its own state if it's the last of its type. This allows for dynamically adding and removing widgets without losing their state.\r\n         *\r\n         * @default false\r\n         */\r\n        preserveSharedStateOnUnmount?: boolean;\r\n        /**\r\n         * Changes the way root levels of hierarchical facets have their count displayed.\r\n         *\r\n         * If `false` (by default), the count of the refined root level is updated to match the count of the actively refined parent level.\r\n         *\r\n         * If `true`, the count of the root level stays the same as the count of all children levels.\r\n         *\r\n         * @default false\r\n         */\r\n        persistHierarchicalRootCount?: boolean;\r\n    };\r\n};\r\n\r\ndeclare type InstantSearchStatus = 'idle' | 'loading' | 'stalled' | 'error';\r\n\r\ndeclare type InternalMiddleware<TUiState extends UiState = UiState> = (options: MiddlewareOptions) => MiddlewareDefinition<TUiState>;\r\n\r\ndeclare function isMetadataEnabled(): boolean;\r\n\r\ndeclare type LookingSimilarConnectorParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The `objectIDs` of the items to get similar looking products from.\r\n     */\r\n    objectIDs: string[];\r\n    /**\r\n     * The number of recommendations to retrieve.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * The threshold for the recommendations confidence score (between 0 and 100).\r\n     */\r\n    threshold?: number;\r\n    /**\r\n     * List of search parameters to send.\r\n     */\r\n    fallbackParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * List of search parameters to send.\r\n     */\r\n    queryParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * Whether to escape HTML tags from items string values.\r\n     *\r\n     * @default true\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<Hit<THit>, {\r\n        results: RecommendResponse<AlgoliaHit<THit>>;\r\n    }>;\r\n};\r\n\r\ndeclare type LookingSimilarCSSClasses = Partial<RecommendClassNames>;\r\n\r\ndeclare type LookingSimilarRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The matched recommendations from the Algolia API.\r\n     */\r\n    items: Array<Hit<THit>>;\r\n    /**\r\n     * Sends an event to the Insights middleware.\r\n     */\r\n    sendEvent: SendEventForHits;\r\n};\r\n\r\ndeclare type LookingSimilarTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\r\n    /**\r\n     * Template to use when there are no results.\r\n     */\r\n    empty: Template<RecommendResponse<Hit<THit>>>;\r\n    /**\r\n     * Template to use for the header of the widget.\r\n     */\r\n    header: Template<Pick<Parameters<NonNullable<LookingSimilarProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {\r\n        cssClasses: RecommendClassNames;\r\n    }>;\r\n    /**\r\n     * Template to use for each result. This template will receive an object containing a single record.\r\n     */\r\n    item: TemplateWithBindEvent<Hit<THit>>;\r\n    /**\r\n     * Template to use to wrap all items.\r\n     */\r\n    layout: Template<Pick<Parameters<NonNullable<LookingSimilarProps<Hit<THit>>['layout']>>[0], 'items'> & {\r\n        templates: {\r\n            item: LookingSimilarProps<Hit<THit>>['itemComponent'];\r\n        };\r\n        cssClasses: Pick<LookingSimilarCSSClasses, 'list' | 'item'>;\r\n    }>;\r\n}>;\r\n\r\ndeclare type LookingSimilarWidgetParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: LookingSimilarTemplates<THit>;\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: LookingSimilarCSSClasses;\r\n};\r\n\r\ndeclare type MatchingPatterns = {\r\n    [attribute: string]: {\r\n        /**\r\n         * The score of the optional filter.\r\n         *\r\n         * @see https://www.algolia.com/doc/guides/managing-results/rules/merchandising-and-promoting/in-depth/optional-filters/\r\n         */\r\n        score: number;\r\n    };\r\n};\r\n\r\ndeclare const menu: MenuWidget;\r\n\r\ndeclare type MenuConnector = Connector<MenuWidgetDescription, MenuConnectorParams>;\r\n\r\ndeclare type MenuConnectorParams = {\r\n    /**\r\n     * Name of the attribute for faceting (eg. \"free_shipping\").\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * How many facets values to retrieve.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * Whether to display a button that expands the number of items.\r\n     */\r\n    showMore?: boolean;\r\n    /**\r\n     * How many facets values to retrieve when `toggleShowMore` is called, this value is meant to be greater than `limit` option.\r\n     */\r\n    showMoreLimit?: number;\r\n    /**\r\n     * How to sort refinements. Possible values: `count|isRefined|name:asc|name:desc`.\r\n     *\r\n     * You can also use a sort function that behaves like the standard Javascript [compareFunction](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Syntax).\r\n     *\r\n     * If a facetOrdering is set in the index settings, it is used when sortBy isn't passed\r\n     */\r\n    sortBy?: SortBy<SearchResults.HierarchicalFacet>;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<MenuItem>;\r\n};\r\n\r\ndeclare type MenuCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to each item element.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add to each selected item element.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS class to add to each link (when using the default template).\r\n     */\r\n    link: string | string[];\r\n    /**\r\n     * CSS class to add to each label (when using the default template).\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to each count element (when using the default template).\r\n     */\r\n    count: string | string[];\r\n    /**\r\n     * CSS class to add to the show more button.\r\n     */\r\n    showMore: string | string[];\r\n    /**\r\n     * CSS class to add to the disabled show more button.\r\n     */\r\n    disabledShowMore: string | string[];\r\n}>;\r\n\r\ndeclare type MenuItem = {\r\n    /**\r\n     * The value of the menu item.\r\n     */\r\n    value: string;\r\n    /**\r\n     * Human-readable value of the menu item.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Number of results matched after refinement is applied.\r\n     */\r\n    count: number;\r\n    /**\r\n     * Indicates if the refinement is applied.\r\n     */\r\n    isRefined: boolean;\r\n};\r\n\r\ndeclare type MenuRenderState = {\r\n    /**\r\n     * The elements that can be refined for the current search results.\r\n     */\r\n    items: MenuItem[];\r\n    /**\r\n     * Creates the URL for a single item name in the list.\r\n     */\r\n    createURL: CreateURL<string>;\r\n    /**\r\n     * Filter the search to item value.\r\n     */\r\n    refine: (value: string) => void;\r\n    /**\r\n     * True if refinement can be applied.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * True if the menu is displaying all the menu items.\r\n     */\r\n    isShowingMore: boolean;\r\n    /**\r\n     * Toggles the number of values displayed between `limit` and `showMore.limit`.\r\n     */\r\n    toggleShowMore: () => void;\r\n    /**\r\n     * `true` if the toggleShowMore button can be activated (enough items to display more or\r\n     * already displaying more than `limit` items)\r\n     */\r\n    canToggleShowMore: boolean;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEventForFacet;\r\n};\r\n\r\ndeclare const menuSelect: MenuSelectWidget;\r\n\r\ndeclare type MenuSelectCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root when there are no items to display\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the select element.\r\n     */\r\n    select: string | string[];\r\n    /**\r\n     * CSS class to add to the option element.\r\n     */\r\n    option: string | string[];\r\n}>;\r\n\r\ndeclare type MenuSelectTemplates = Partial<{\r\n    /**\r\n     * Item template, provided with `label`, `count`, `isRefined` and `value` data properties.\r\n     */\r\n    item: Template<{\r\n        label: string;\r\n        value: string;\r\n        count: number;\r\n        isRefined: boolean;\r\n    }>;\r\n    /**\r\n     * Label of the \"see all\" option in the select.\r\n     */\r\n    defaultOption: Template;\r\n}>;\r\n\r\ndeclare type MenuSelectWidget = WidgetFactory<MenuWidgetDescription & {\r\n    $$widgetType: 'ais.menuSelect';\r\n}, MenuConnectorParams, MenuSelectWidgetParams>;\r\n\r\ndeclare type MenuSelectWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Customize the output through templating.\r\n     */\r\n    templates?: MenuSelectTemplates;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: MenuSelectCSSClasses;\r\n};\r\n\r\ndeclare type MenuTemplates = Partial<{\r\n    /**\r\n     * Item template. The string template gets the same values as the function.\r\n     */\r\n    item: Template<{\r\n        count: number;\r\n        cssClasses: MenuCSSClasses;\r\n        isRefined: boolean;\r\n        label: string;\r\n        url: string;\r\n        value: string;\r\n    }>;\r\n    /**\r\n     * Template used for the show more text, provided with `isShowingMore` data property.\r\n     */\r\n    showMoreText: Template<{\r\n        isShowingMore: boolean;\r\n    }>;\r\n}>;\r\n\r\ndeclare type MenuWidget = WidgetFactory<MenuWidgetDescription & {\r\n    $$widgetType: 'ais.menu';\r\n}, MenuConnectorParams, MenuWidgetParams>;\r\n\r\ndeclare type MenuWidgetDescription = {\r\n    $$type: 'ais.menu';\r\n    renderState: MenuRenderState;\r\n    indexRenderState: {\r\n        menu: {\r\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        menu: {\r\n            [attribute: string]: string;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type MenuWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Customize the output through templating.\r\n     */\r\n    templates?: MenuTemplates;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: MenuCSSClasses;\r\n};\r\n\r\ndeclare type Middleware<TUiState extends UiState = UiState> = (options: MiddlewareOptions) => AtLeastOne<MiddlewareDefinition<TUiState>>;\r\n\r\ndeclare type MiddlewareDefinition<TUiState extends UiState = UiState> = {\r\n    /**\r\n     * string to identify the middleware\r\n     */\r\n    $$type: string;\r\n    /**\r\n     * Change handler called on every UiState change\r\n     */\r\n    onStateChange: (options: {\r\n        uiState: TUiState;\r\n    }) => void;\r\n    /**\r\n     * Called when the middleware is added to InstantSearch\r\n     */\r\n    subscribe: () => void;\r\n    /**\r\n     * Called when InstantSearch is started\r\n     */\r\n    started: () => void;\r\n    /**\r\n     * Called when the middleware is removed from InstantSearch\r\n     */\r\n    unsubscribe: () => void;\r\n};\r\n\r\ndeclare type MiddlewareOptions = {\r\n    instantSearchInstance: InstantSearch;\r\n};\r\n\r\ndeclare namespace middlewares {\r\n    export {\r\n        createInsightsMiddleware,\r\n        InsightsEvent,\r\n        InsightsProps,\r\n        InsightsClientWithGlobals,\r\n        CreateInsightsMiddleware,\r\n        RouterProps,\r\n        createRouterMiddleware,\r\n        isMetadataEnabled,\r\n        createMetadataMiddleware\r\n    }\r\n}\r\n\r\ndeclare type NoInfer_2<T> = T extends infer S ? S : never;\r\n\r\ndeclare const numericMenu: NumericMenuWidget;\r\n\r\ndeclare type NumericMenuComponentCSSClasses = ComponentCSSClasses<NumericMenuCSSClasses>;\r\n\r\ndeclare type NumericMenuConnector = Connector<NumericMenuWidgetDescription, NumericMenuConnectorParams>;\r\n\r\ndeclare type NumericMenuConnectorParams = {\r\n    /**\r\n     * Name of the attribute for filtering\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * List of all the items\r\n     */\r\n    items: NumericMenuConnectorParamsItem[];\r\n    /**\r\n     * Function to transform the items passed to the templates\r\n     */\r\n    transformItems?: TransformItems<NumericMenuRenderStateItem>;\r\n};\r\n\r\ndeclare type NumericMenuConnectorParamsItem = {\r\n    /**\r\n     * Name of the option\r\n     */\r\n    label: string;\r\n    /**\r\n     * Higher bound of the option (<=)\r\n     */\r\n    start?: number;\r\n    /**\r\n     * Lower bound of the option (>=)\r\n     */\r\n    end?: number;\r\n};\r\n\r\ndeclare type NumericMenuCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to each item element.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add to each selected item element.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS class to add to each label element.\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to each label text element.\r\n     */\r\n    labelText: string | string[];\r\n    /**\r\n     * CSS class to add to each radio element (when using the default template).\r\n     */\r\n    radio: string | string[];\r\n}>;\r\n\r\ndeclare type NumericMenuRenderState = {\r\n    /**\r\n     * The list of available choices\r\n     */\r\n    items: NumericMenuRenderStateItem[];\r\n    /**\r\n     * Creates URLs for the next state, the string is the name of the selected option\r\n     */\r\n    createURL: CreateURL<NumericMenuRenderStateItem['value']>;\r\n    /**\r\n     * `true` if the last search contains no result\r\n     * @deprecated Use `canRefine` instead.\r\n     */\r\n    hasNoResults: boolean;\r\n    /**\r\n     * Indicates if search state can be refined.\r\n     *\r\n     * This is `true` if the last search contains no result and\r\n     * \"All\" range is selected\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Sets the selected value and trigger a new search\r\n     */\r\n    refine: (facetValue: string) => void;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEventForFacet;\r\n};\r\n\r\ndeclare type NumericMenuRenderStateItem = {\r\n    /**\r\n     *  Name of the option.\r\n     */\r\n    label: string;\r\n    /**\r\n     * URL encoded of the bounds object with the form `{start, end}`.\r\n     * This value can be used verbatim in the webpage and can be read by `refine`\r\n     * directly. If you want to inspect the value, you can do:\r\n     * `JSON.parse(decodeURI(value))` to get the object.\r\n     */\r\n    value: string;\r\n    /**\r\n     * True if the value is selected\r\n     */\r\n    isRefined: boolean;\r\n};\r\n\r\ndeclare type NumericMenuTemplates = Partial<{\r\n    /**\r\n     * Item template, provided with `label` (the name in the configuration), `isRefined`, `url`, `value` (the setting for the filter) data properties.\r\n     */\r\n    item: Template<{\r\n        /**\r\n         * The name of the attribute.\r\n         */\r\n        attribute: string;\r\n        /**\r\n         * The label for the option.\r\n         */\r\n        label: string;\r\n        /**\r\n         * The encoded URL of the bounds object with a {start, end} form. This\r\n         * value can be used verbatim in the webpage and can be read by refine\r\n         * directly. If you want to inspect the value, you can do JSON.parse(window.decodeURI(value))\r\n         * to get the object.\r\n         */\r\n        value: string;\r\n        /**\r\n         *  Whether or not the refinement is selected.\r\n         */\r\n        isRefined: boolean;\r\n        /**\r\n         * The URL with the applied refinement.\r\n         */\r\n        url: string;\r\n        /**\r\n         * The CSS classes provided to the widget.\r\n         */\r\n        cssClasses: NumericMenuComponentCSSClasses;\r\n    }>;\r\n}>;\r\n\r\ndeclare type NumericMenuWidget = WidgetFactory<NumericMenuWidgetDescription & {\r\n    $$widgetType: 'ais.numericMenu';\r\n}, NumericMenuConnectorParams, NumericMenuWidgetParams>;\r\n\r\ndeclare type NumericMenuWidgetDescription = {\r\n    $$type: 'ais.numericMenu';\r\n    renderState: NumericMenuRenderState;\r\n    indexRenderState: {\r\n        numericMenu: {\r\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        numericMenu: {\r\n            [attribute: string]: string;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type NumericMenuWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: NumericMenuTemplates;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: NumericMenuCSSClasses;\r\n};\r\n\r\ndeclare const pagination: PaginationWidget;\r\n\r\ndeclare type PaginationConnector = Connector<PaginationWidgetDescription, PaginationConnectorParams>;\r\n\r\ndeclare type PaginationConnectorParams = {\r\n    /**\r\n     * The total number of pages to browse.\r\n     */\r\n    totalPages?: number;\r\n    /**\r\n     * The padding of pages to show around the current page\r\n     * @default 3\r\n     */\r\n    padding?: number;\r\n};\r\n\r\ndeclare type PaginationCSSClasses = Partial<{\r\n    /**\r\n     * CSS classes added to the root element of the widget.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element of the widget if there are no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS classes added to the wrapping `<ul>`.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS classes added to each `<li>`.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS classes added to the first `<li>`.\r\n     */\r\n    firstPageItem: string | string[];\r\n    /**\r\n     * CSS classes added to the last `<li>`.\r\n     */\r\n    lastPageItem: string | string[];\r\n    /**\r\n     * CSS classes added to the previous `<li>`.\r\n     */\r\n    previousPageItem: string | string[];\r\n    /**\r\n     * CSS classes added to the next `<li>`.\r\n     */\r\n    nextPageItem: string | string[];\r\n    /**\r\n     * CSS classes added to page `<li>`.\r\n     */\r\n    pageItem: string | string[];\r\n    /**\r\n     * CSS classes added to the selected `<li>`.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS classes added to the disabled `<li>`.\r\n     */\r\n    disabledItem: string | string[];\r\n    /**\r\n     * CSS classes added to each link.\r\n     */\r\n    link: string | string[];\r\n}>;\r\n\r\ndeclare type PaginationRenderState = {\r\n    /** Creates URLs for the next state, the number is the page to generate the URL for. */\r\n    createURL: CreateURL<number>;\r\n    /** Sets the current page and triggers a search. */\r\n    refine: (page: number) => void;\r\n    /** true if this search returned more than one page */\r\n    canRefine: boolean;\r\n    /** The number of the page currently displayed. */\r\n    currentRefinement: number;\r\n    /** The number of hits computed for the last query (can be approximated). */\r\n    nbHits: number;\r\n    /** The number of pages for the result set. */\r\n    nbPages: number;\r\n    /** The actual pages relevant to the current situation and padding. */\r\n    pages: number[];\r\n    /** true if the current page is also the first page. */\r\n    isFirstPage: boolean;\r\n    /** true if the current page is also the last page. */\r\n    isLastPage: boolean;\r\n};\r\n\r\ndeclare type PaginationTemplates = Partial<{\r\n    /**\r\n     * Label for the Previous link.\r\n     */\r\n    previous: Template;\r\n    /**\r\n     * Label for the Next link.\r\n     */\r\n    next: Template;\r\n    /**\r\n     * Label for the link of a certain page\r\n     * Page is one-based, so `page` will be `1` for the first page.\r\n     */\r\n    page: Template<{\r\n        page: number;\r\n    }>;\r\n    /**\r\n     * Label for the First link.\r\n     */\r\n    first: Template;\r\n    /**\r\n     * Label for the Last link.\r\n     */\r\n    last: Template;\r\n}>;\r\n\r\ndeclare type PaginationWidget = WidgetFactory<PaginationWidgetDescription & {\r\n    $$widgetType: 'ais.pagination';\r\n}, PaginationConnectorParams, PaginationWidgetParams>;\r\n\r\ndeclare type PaginationWidgetDescription = {\r\n    $$type: 'ais.pagination';\r\n    renderState: PaginationRenderState;\r\n    indexRenderState: {\r\n        pagination: WidgetRenderState<PaginationRenderState, PaginationConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        page: number;\r\n    };\r\n};\r\n\r\ndeclare type PaginationWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * The max number of pages to browse.\r\n     */\r\n    totalPages?: number;\r\n    /**\r\n     * The number of pages to display on each side of the current page.\r\n     * @default 3\r\n     */\r\n    padding?: number;\r\n    /**\r\n     * Where to scroll after a click, set to `false` to disable.\r\n     * @default body\r\n     */\r\n    scrollTo?: string | HTMLElement | boolean;\r\n    /**\r\n     * Whether to show the \"first page\" control\r\n     * @default true\r\n     */\r\n    showFirst?: boolean;\r\n    /**\r\n     * Whether to show the \"last page\" control\r\n     * @default true\r\n     */\r\n    showLast?: boolean;\r\n    /**\r\n     * Whether to show the \"next page\" control\r\n     * @default true\r\n     */\r\n    showNext?: boolean;\r\n    /**\r\n     * Whether to show the \"previous page\" control\r\n     * @default true\r\n     */\r\n    showPrevious?: boolean;\r\n    /**\r\n     * Text to display in the links.\r\n     */\r\n    templates?: PaginationTemplates;\r\n    /**\r\n     * CSS classes to be added.\r\n     */\r\n    cssClasses?: PaginationCSSClasses;\r\n};\r\n\r\n/**\r\n * The panel widget wraps other widgets in a consistent panel design.\r\n * It also reacts, indicates and sets CSS classes when widgets are no longer relevant for refining.\r\n */\r\ndeclare const panel: PanelWidget;\r\n\r\ndeclare type PanelCSSClasses = Partial<{\r\n    /**\r\n     * CSS classes to add to the root element of the widget.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS classes to add to the root element of the widget when there's no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS classes to add to the root element when collapsible (`collapse` is defined).\r\n     */\r\n    collapsibleRoot: string | string[];\r\n    /**\r\n     * CSS classes to add to the root element when collapsed.\r\n     */\r\n    collapsedRoot: string | string[];\r\n    /**\r\n     * CSS classes to add to the collapse button element.\r\n     */\r\n    collapseButton: string | string[];\r\n    /**\r\n     * CSS classes to add to the collapse icon of the button.\r\n     */\r\n    collapseIcon: string | string[];\r\n    /**\r\n     * CSS classes to add to the header.\r\n     */\r\n    header: string | string[];\r\n    /**\r\n     * CSS classes to add to the body.\r\n     */\r\n    body: string | string[];\r\n    /**\r\n     * CSS classes to add to the footer.\r\n     */\r\n    footer: string | string[];\r\n}>;\r\n\r\ndeclare type PanelRenderOptions<TWidgetFactory extends AnyWidgetFactory> = RenderOptions & GetWidgetRenderState<TWidgetFactory>;\r\n\r\ndeclare type PanelTemplates<TWidget extends AnyWidgetFactory> = Partial<{\r\n    /**\r\n     * Template to use for the header.\r\n     */\r\n    header: Template<PanelRenderOptions<TWidget>>;\r\n    /**\r\n     * Template to use for the footer.\r\n     */\r\n    footer: Template<PanelRenderOptions<TWidget>>;\r\n    /**\r\n     * Template to use for collapse button.\r\n     */\r\n    collapseButtonText: Template<{\r\n        collapsed: boolean;\r\n    }>;\r\n}>;\r\n\r\ndeclare type PanelWidget = <TWidgetFactory extends AnyWidgetFactory>(panelWidgetParams?: PanelWidgetParams<TWidgetFactory>) => (widgetFactory: TWidgetFactory) => (widgetParams: Parameters<TWidgetFactory>[0]) => AugmentedWidget<TWidgetFactory>;\r\n\r\ndeclare type PanelWidgetParams<TWidgetFactory extends AnyWidgetFactory> = {\r\n    /**\r\n     * A function that is called on each render to determine if the\r\n     * panel should be hidden based on the render options.\r\n     */\r\n    hidden?: (options: PanelRenderOptions<TWidgetFactory>) => boolean;\r\n    /**\r\n     * A function that is called on each render to determine if the\r\n     * panel should be collapsed based on the render options.\r\n     */\r\n    collapsed?: (options: PanelRenderOptions<TWidgetFactory>) => boolean;\r\n    /**\r\n     * The templates to use for the widget.\r\n     */\r\n    templates?: PanelTemplates<TWidgetFactory>;\r\n    /**\r\n     * The CSS classes to override.\r\n     */\r\n    cssClasses?: PanelCSSClasses;\r\n};\r\n\r\ndeclare type ParamTrackedFilters = {\r\n    [facetName: string]: (facetValues: TrackedFilterRefinement[]) => TrackedFilterRefinement[];\r\n};\r\n\r\ndeclare type ParamTransformRuleContexts = (ruleContexts: string[]) => string[];\r\n\r\ndeclare type ParseURL<TRouteState> = (args: {\r\n    qsModule: typeof qs_2;\r\n    location: Location;\r\n}) => TRouteState;\r\n\r\n/**\r\n * Make certain keys of an object optional.\r\n */\r\ndeclare type PartialKeys<TObj, TKeys extends keyof TObj> = Omit<TObj, TKeys> & Partial<Pick<TObj, TKeys>>;\r\n\r\ndeclare type PlacesInstance = Places.PlacesInstance;\r\n\r\ndeclare type PlacesWidget = WidgetFactory<PlacesWidgetDescription, PlacesWidgetParams, PlacesWidgetParams>;\r\n\r\ndeclare type PlacesWidgetDescription = {\r\n    $$type: 'ais.places';\r\n    $$widgetType: 'ais.places';\r\n    renderState: Record<string, unknown>;\r\n    indexRenderState: {\r\n        places: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams>;\r\n    };\r\n    indexUiState: {\r\n        places: {\r\n            query: string;\r\n            position: string;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type PlacesWidgetParams = {\r\n    /**\r\n     * The Algolia Places reference to use.\r\n     *\r\n     * @see https://github.com/algolia/places\r\n     */\r\n    placesReference: (options: StaticOptions & ReconfigurableOptions) => PlacesInstance;\r\n    /**\r\n     * The default position when the input is empty.\r\n     */\r\n    defaultPosition?: string[];\r\n} & StaticOptions;\r\n\r\ndeclare const poweredBy: PoweredByWidget;\r\n\r\ndeclare type PoweredByConnector = Connector<PoweredByWidgetDescription, PoweredByConnectorParams>;\r\n\r\ndeclare type PoweredByConnectorParams = {\r\n    /** the url to redirect to on click */\r\n    url?: string;\r\n};\r\n\r\ndeclare type PoweredByCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the wrapping element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the link.\r\n     */\r\n    link: string | string[];\r\n    /**\r\n     * CSS class to add to the SVG logo.\r\n     */\r\n    logo: string | string[];\r\n}>;\r\n\r\ndeclare type PoweredByRenderState = {\r\n    /** the url to redirect to on click */\r\n    url: string;\r\n};\r\n\r\ndeclare type PoweredByWidget = WidgetFactory<PoweredByWidgetDescription & {\r\n    $$widgetType: 'ais.poweredBy';\r\n}, PoweredByConnectorParams, PoweredByWidgetParams>;\r\n\r\ndeclare type PoweredByWidgetDescription = {\r\n    $$type: 'ais.poweredBy';\r\n    renderState: PoweredByRenderState;\r\n    indexRenderState: {\r\n        poweredBy: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams>;\r\n    };\r\n};\r\n\r\ndeclare type PoweredByWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * The theme of the logo.\r\n     * @default 'light'\r\n     */\r\n    theme?: 'light' | 'dark';\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: PoweredByCSSClasses;\r\n};\r\n\r\ndeclare type PreparedTemplateProps<TTemplates extends Templates> = {\r\n    templatesConfig: TemplatesConfig;\r\n    templates: TTemplates;\r\n    useCustomCompileOptions: {\r\n        [TKey in keyof Partial<TTemplates>]: boolean;\r\n    };\r\n};\r\n\r\ndeclare type ProvidedInsightsClient = InsightsClient | null | undefined;\r\n\r\ndeclare const queryRuleContext: QueryRuleContextWidget;\r\n\r\ndeclare type QueryRuleContextWidget = WidgetFactory<QueryRulesWidgetDescription & {\r\n    $$widgetType: 'ais.queryRuleContext';\r\n}, QueryRulesConnectorParams, QueryRuleContextWidgetParams>;\r\n\r\ndeclare type QueryRuleContextWidgetParams = {\r\n    trackedFilters: ParamTrackedFilters;\r\n    transformRuleContexts?: ParamTransformRuleContexts;\r\n};\r\n\r\ndeclare const queryRuleCustomData: QueryRuleCustomDataWidget;\r\n\r\ndeclare type QueryRuleCustomDataCSSClasses = Partial<{\r\n    root: string | string[];\r\n}>;\r\n\r\ndeclare type QueryRuleCustomDataTemplates = Partial<{\r\n    default: Template<{\r\n        items: any[];\r\n    }>;\r\n}>;\r\n\r\ndeclare type QueryRuleCustomDataWidget = WidgetFactory<QueryRulesWidgetDescription & {\r\n    $$widgetType: 'ais.queryRuleCustomData';\r\n}, QueryRulesConnectorParams, QueryRuleCustomDataWidgetParams>;\r\n\r\ndeclare type QueryRuleCustomDataWidgetParams = {\r\n    container: string | HTMLElement;\r\n    cssClasses?: QueryRuleCustomDataCSSClasses;\r\n    templates?: QueryRuleCustomDataTemplates;\r\n};\r\n\r\ndeclare type QueryRulesConnector = Connector<QueryRulesWidgetDescription, QueryRulesConnectorParams>;\r\n\r\ndeclare type QueryRulesConnectorParams = {\r\n    trackedFilters?: ParamTrackedFilters;\r\n    transformRuleContexts?: ParamTransformRuleContexts;\r\n    transformItems?: TransformItems<any>;\r\n};\r\n\r\ndeclare type QueryRulesRenderState = {\r\n    items: any[];\r\n};\r\n\r\ndeclare type QueryRulesWidgetDescription = {\r\n    $$type: 'ais.queryRules';\r\n    renderState: QueryRulesRenderState;\r\n    indexRenderState: {\r\n        queryRules: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams>;\r\n    };\r\n};\r\n\r\ndeclare type QueueItem = QueueItemMap[keyof QueueItemMap];\r\n\r\ndeclare type QueueItemMap = {\r\n    [MethodName in keyof InsightsMethodMap]: [\r\n    methodName: MethodName,\r\n    ...args: InsightsMethodMap[MethodName][0][0]\r\n    ];\r\n};\r\n\r\ndeclare type Range_2 = {\r\n    min: RangeMin;\r\n    max: RangeMax;\r\n};\r\n\r\ndeclare type RangeBoundaries = [RangeMin, RangeMax];\r\n\r\ndeclare type RangeConnector = Connector<RangeWidgetDescription, RangeConnectorParams>;\r\n\r\ndeclare type RangeConnectorParams = {\r\n    /**\r\n     * Name of the attribute for faceting.\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * Minimal range value, default to automatically computed from the result set.\r\n     */\r\n    min?: number;\r\n    /**\r\n     * Maximal range value, default to automatically computed from the result set.\r\n     */\r\n    max?: number;\r\n    /**\r\n     * Number of digits after decimal point to use.\r\n     */\r\n    precision?: number;\r\n};\r\n\r\ndeclare const rangeInput: RangeInputWidget;\r\n\r\ndeclare type RangeInputCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when there's no refinements.\r\n     */\r\n    noRefinement: string | string[];\r\n    /**\r\n     * CSS class to add to the form element.\r\n     */\r\n    form: string | string[];\r\n    /**\r\n     * CSS class to add to the label element.\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to the input element.\r\n     */\r\n    input: string | string[];\r\n    /**\r\n     * CSS class to add to the min input element.\r\n     */\r\n    inputMin: string | string[];\r\n    /**\r\n     * CSS class to add to the max input element.\r\n     */\r\n    separator: string | string[];\r\n    /**\r\n     * CSS class to add to the separator of the form.\r\n     */\r\n    inputMax: string | string[];\r\n    /**\r\n     * CSS class to add to the submit button of the form.\r\n     */\r\n    submit: string | string[];\r\n}>;\r\n\r\ndeclare type RangeInputTemplates = Partial<{\r\n    /**\r\n     * The label of the separator, between min and max.\r\n     * @default \"to\"\r\n     */\r\n    separatorText: Template;\r\n    /**\r\n     * The label of the submit button\r\n     * @default \"Go\"\r\n     */\r\n    submitText: Template;\r\n}>;\r\n\r\ndeclare type RangeInputWidget = WidgetFactory<Omit<RangeWidgetDescription, '$$type'> & {\r\n    $$widgetType: 'ais.rangeInput';\r\n    $$type: 'ais.rangeInput';\r\n}, RangeConnectorParams, RangeInputWidgetParams>;\r\n\r\ndeclare type RangeInputWidgetParams = {\r\n    /**\r\n     * Valid CSS Selector as a string or DOMElement.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Name of the attribute for faceting.\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * Minimal slider value, default to automatically computed from the result set.\r\n     */\r\n    min?: number;\r\n    /**\r\n     * Maximal slider value, defaults to automatically computed from the result set.\r\n     */\r\n    max?: number;\r\n    /**\r\n     * Number of digits after decimal point to use.\r\n     * @default 0\r\n     */\r\n    precision?: number;\r\n    /**\r\n     * Labels to use for the widget.\r\n     */\r\n    templates?: RangeInputTemplates;\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: RangeInputCSSClasses;\r\n};\r\n\r\ndeclare type RangeMax = number | undefined;\r\n\r\ndeclare type RangeMin = number | undefined;\r\n\r\ndeclare type RangeRenderState = {\r\n    /**\r\n     * Sets a range to filter the results on. Both values\r\n     * are optional, and will default to the higher and lower bounds. You can use `undefined` to remove a\r\n     * previously set bound or to set an infinite bound.\r\n     * @param rangeValue tuple of [min, max] bounds\r\n     */\r\n    refine: (rangeValue: RangeBoundaries) => void;\r\n    /**\r\n     * Indicates whether this widget can be refined\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Send an event to the insights middleware\r\n     */\r\n    sendEvent: SendEventForFacet;\r\n    /**\r\n     * Maximum range possible for this search\r\n     */\r\n    range: Range_2;\r\n    /**\r\n     * Current refinement of the search\r\n     */\r\n    start: RangeBoundaries;\r\n    /**\r\n     * Transform for the rendering `from` and/or `to` values.\r\n     * Both functions take a `number` as input and should output a `string`.\r\n     */\r\n    format: {\r\n        from: (fromValue: number) => string;\r\n        to: (toValue: number) => string;\r\n    };\r\n};\r\n\r\n/**\r\n * The range slider is a widget which provides a user-friendly way to filter the\r\n * results based on a single numeric range.\r\n *\r\n * @requirements\r\n * The attribute passed to `attribute` must be declared as an\r\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\r\n * in your Algolia settings.\r\n *\r\n * The values inside this attribute must be JavaScript numbers (not strings).\r\n */\r\ndeclare const rangeSlider: RangeSliderWidget;\r\n\r\ndeclare type RangeSliderCssClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the disabled root element.\r\n     */\r\n    disabledRoot: string | string[];\r\n}>;\r\n\r\ndeclare type RangeSliderTooltipOptions = {\r\n    /**\r\n     * The function takes the raw value as input, and should return\r\n     * a string for the label that should be used for this value.\r\n     * @example\r\n     * { format(rawValue) {return '$' + Math.round(rawValue).toLocaleString() } }\r\n     */\r\n    format: (value: number) => string;\r\n};\r\n\r\ndeclare type RangeSliderWidget = WidgetFactory<Omit<RangeWidgetDescription, '$$type'> & {\r\n    $$widgetType: 'ais.rangeSlider';\r\n    $$type: 'ais.rangeSlider';\r\n}, RangeConnectorParams, RangeSliderWidgetParams>;\r\n\r\ndeclare type RangeSliderWidgetParams = {\r\n    /**\r\n     * CSS Selector or DOMElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Name of the attribute for faceting.;\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * Should we show tooltips or not.\r\n     * The default tooltip will show the raw value.\r\n     * You can also provide an object with a format function as an attribute.\r\n     * So that you can format the tooltip display value as you want.\r\n     * @default true\r\n     */\r\n    tooltips?: boolean | RangeSliderTooltipOptions;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: RangeSliderCssClasses;\r\n    /**\r\n     * Show slider pips.\r\n     * @default true\r\n     */\r\n    pips?: boolean;\r\n    /**\r\n     * Number of digits after decimal point to use.\r\n     * @default 0\r\n     */\r\n    precision?: number;\r\n    /**\r\n     * Every handle move will jump that number of steps.\r\n     */\r\n    step?: number;\r\n    /**\r\n     * Minimal slider value, default to automatically computed from the result set.\r\n     */\r\n    min?: number;\r\n    /**\r\n     * Maximal slider value, defaults to automatically computed from the result set.\r\n     */\r\n    max?: number;\r\n};\r\n\r\ndeclare type RangeWidgetDescription = {\r\n    $$type: 'ais.range';\r\n    renderState: RangeRenderState;\r\n    indexRenderState: {\r\n        range: {\r\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        range: {\r\n            [attribute: string]: string;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare const ratingMenu: RatingMenuWidget;\r\n\r\ndeclare type RatingMenuConnector = Connector<RatingMenuWidgetDescription, RatingMenuConnectorParams>;\r\n\r\ndeclare type RatingMenuConnectorParams = {\r\n    /**\r\n     * Name of the attribute for faceting (eg. \"free_shipping\").\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * The maximum rating value.\r\n     */\r\n    max?: number;\r\n};\r\n\r\ndeclare type RatingMenuCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when there's no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to each item element.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add the selected item element.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS class to add a disabled item element.\r\n     */\r\n    disabledItem: string | string[];\r\n    /**\r\n     * CSS class to add to each link element.\r\n     */\r\n    link: string | string[];\r\n    /**\r\n     * CSS class to add to each star element (when using the default template).\r\n     */\r\n    starIcon: string | string[];\r\n    /**\r\n     * CSS class to add to each full star element (when using the default template).\r\n     */\r\n    fullStarIcon: string | string[];\r\n    /**\r\n     * CSS class to add to each empty star element (when using the default template).\r\n     */\r\n    emptyStarIcon: string | string[];\r\n    /**\r\n     * CSS class to add to each label.\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to each counter.\r\n     */\r\n    count: string | string[];\r\n}>;\r\n\r\ndeclare type RatingMenuRenderState = {\r\n    /**\r\n     * Possible star ratings the user can apply.\r\n     */\r\n    items: StarRatingItems[];\r\n    /**\r\n     * Creates an URL for the next state (takes the item value as parameter). Takes the value of an item as parameter.\r\n     */\r\n    createURL: CreateURL<string>;\r\n    /**\r\n     *  Indicates if search state can be refined.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Selects a rating to filter the results (takes the filter value as parameter). Takes the value of an item as parameter.\r\n     */\r\n    refine: (value: string) => void;\r\n    /**\r\n     * `true` if the last search contains no result.\r\n     *\r\n     * @deprecated Use `canRefine` instead.\r\n     */\r\n    hasNoResults: boolean;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEvent;\r\n};\r\n\r\ndeclare type RatingMenuTemplates = Partial<{\r\n    /**\r\n     * Item template, provided with `name`, `count`, `isRefined`, `url` data properties.\r\n     */\r\n    item: Template<{\r\n        name: string;\r\n        label: string;\r\n        value: string;\r\n        count: number;\r\n        isRefined: boolean;\r\n        url: string;\r\n        stars: [boolean, boolean, boolean, boolean, boolean];\r\n        cssClasses: RatingMenuCSSClasses;\r\n        attribute?: string;\r\n        isFromSearch?: boolean;\r\n    }>;\r\n}>;\r\n\r\n/**\r\n * Rating menu is used for displaying grade like filters. The values are normalized within boundaries.\r\n *\r\n * The maximum value can be set (with `max`), the minimum is always 0.\r\n *\r\n * @requirements\r\n * The attribute passed to `attribute` must be declared as an\r\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\r\n * in your Algolia settings.\r\n *\r\n * The values inside this attribute must be JavaScript numbers (not strings).\r\n *\r\n * @type {WidgetFactory}\r\n * @devNovel RatingMenu\r\n * @category filter\r\n * @param {RatingMenuWidgetParams} widgetParams RatingMenu widget options.\r\n * @return {Widget} A new RatingMenu widget instance.\r\n * @example\r\n * search.addWidgets([\r\n *   instantsearch.widgets.ratingMenu({\r\n *     container: '#stars',\r\n *     attribute: 'rating',\r\n *     max: 5,\r\n *   })\r\n * ]);\r\n */\r\ndeclare type RatingMenuWidget = WidgetFactory<RatingMenuWidgetDescription & {\r\n    $$widgetType: 'ais.ratingMenu';\r\n}, RatingMenuConnectorParams, RatingMenuWidgetParams>;\r\n\r\ndeclare type RatingMenuWidgetDescription = {\r\n    $$type: 'ais.ratingMenu';\r\n    renderState: RatingMenuRenderState;\r\n    indexRenderState: {\r\n        ratingMenu: {\r\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        ratingMenu: {\r\n            [attribute: string]: number | undefined;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type RatingMenuWidgetParams = {\r\n    /**\r\n     * Place where to insert the widget in your webpage.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Name of the attribute in your records that contains the ratings.\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * The maximum rating value.\r\n     */\r\n    max?: number;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: RatingMenuTemplates;\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: RatingMenuCSSClasses;\r\n};\r\n\r\ndeclare type Read<THit extends NonNullable<object>> = ({ state, }: {\r\n    state: PlainSearchParameters;\r\n}) => InfiniteHitsCachedHits<THit> | null;\r\n\r\ndeclare type RecommendRenderOptions = SharedRenderOptions & {\r\n    results: RecommendResponse<any>;\r\n};\r\n\r\ndeclare type RecommendWidget<TWidgetDescription extends WidgetDescription & WidgetParams> = {\r\n    dependsOn: 'recommend';\r\n    $$id?: number;\r\n    getWidgetParameters: (state: RecommendParameters, widgetParametersOptions: {\r\n        uiState: Expand<Partial<TWidgetDescription['indexUiState'] & IndexUiState>>;\r\n    }) => RecommendParameters;\r\n    getRenderState: (renderState: Expand<IndexRenderState & Partial<TWidgetDescription['indexRenderState']>>, renderOptions: InitOptions | RecommendRenderOptions) => IndexRenderState & TWidgetDescription['indexRenderState'];\r\n    getWidgetRenderState: (renderOptions: InitOptions | RecommendRenderOptions) => Expand<WidgetRenderState<TWidgetDescription['renderState'], TWidgetDescription['widgetParams']>>;\r\n};\r\n\r\ndeclare type ReconfigurableOptions = Places.ReconfigurableOptions;\r\n\r\n/**\r\n * Refine the given search parameters.\r\n */\r\ndeclare type Refine = (searchParameters: PlainSearchParameters) => void;\r\n\r\ndeclare type Refine_2 = (relevancyStrictness: number | undefined) => void;\r\n\r\n/**\r\n * The refinement list widget is one of the most common widget that you can find\r\n * in a search UI. With this widget, the user can filter the dataset based on facets.\r\n *\r\n * The refinement list displays only the most relevant facets for the current search\r\n * context. The sort option only affects the facet that are returned by the engine,\r\n * not which facets are returned.\r\n *\r\n * This widget also implements search for facet values, which is a mini search inside the\r\n * values of the facets. This makes easy to deal with uncommon facet values.\r\n *\r\n * @requirements\r\n *\r\n * The attribute passed to `attribute` must be declared as an\r\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\r\n * in your Algolia settings.\r\n *\r\n * If you also want to use search for facet values on this attribute, you need to make it searchable using the [dashboard](https://www.algolia.com/explorer/display/) or using the [API](https://www.algolia.com/doc/guides/searching/faceting/#search-for-facet-values).\r\n */\r\ndeclare const refinementList: RefinementListWidget;\r\n\r\ndeclare type RefinementListConnector = Connector<RefinementListWidgetDescription, RefinementListConnectorParams>;\r\n\r\ndeclare type RefinementListConnectorParams = {\r\n    /**\r\n     * The name of the attribute in the records.\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * How the filters are combined together.\r\n     */\r\n    operator?: 'and' | 'or';\r\n    /**\r\n     * The max number of items to display when\r\n     * `showMoreLimit` is not set or if the widget is showing less value.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * Whether to display a button that expands the number of items.\r\n     */\r\n    showMore?: boolean;\r\n    /**\r\n     * The max number of items to display if the widget\r\n     * is showing more items.\r\n     */\r\n    showMoreLimit?: number;\r\n    /**\r\n     * How to sort refinements. Possible values: `count|isRefined|name:asc|name:desc`.\r\n     *\r\n     * You can also use a sort function that behaves like the standard Javascript [compareFunction](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Syntax).\r\n     *\r\n     * If a facetOrdering is set in the index settings, it is used when sortBy isn't passed\r\n     */\r\n    sortBy?: SortBy<SearchResults.FacetValue>;\r\n    /**\r\n     * Escapes the content of the facet values.\r\n     */\r\n    escapeFacetValues?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<RefinementListItem>;\r\n};\r\n\r\ndeclare type RefinementListCSSClasses = RefinementListOwnCSSClasses & RefinementListSearchableCSSClasses;\r\n\r\ndeclare type RefinementListItem = {\r\n    /**\r\n     * The value of the refinement list item.\r\n     */\r\n    value: string;\r\n    /**\r\n     * Human-readable value of the refinement list item.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Human-readable value of the searched refinement list item.\r\n     */\r\n    highlighted?: string;\r\n    /**\r\n     * Number of matched results after refinement is applied.\r\n     */\r\n    count: number;\r\n    /**\r\n     * Indicates if the list item is refined.\r\n     */\r\n    isRefined: boolean;\r\n};\r\n\r\ndeclare type RefinementListItemData = {\r\n    /**\r\n     * The number of occurrences of the facet in the result set.\r\n     */\r\n    count: number;\r\n    /**\r\n     * True if the value is selected.\r\n     */\r\n    isRefined: boolean;\r\n    /**\r\n     * The label to display.\r\n     */\r\n    label: string;\r\n    /**\r\n     * The value used for refining.\r\n     */\r\n    value: string;\r\n    /**\r\n     * The label highlighted (when using search for facet values). This value is displayed in the default template.\r\n     */\r\n    highlighted: string;\r\n    /**\r\n     * The url with this refinement selected.\r\n     */\r\n    url: string;\r\n    /**\r\n     * Object containing all the classes computed for the item.\r\n     */\r\n    cssClasses: RefinementListCSSClasses;\r\n    /**\r\n     * Whether the `items` prop contains facet values from the global search or from the search inside the items.\r\n     */\r\n    isFromSearch: boolean;\r\n};\r\n\r\ndeclare type RefinementListOwnCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the root element when no refinements.\r\n     */\r\n    noRefinementRoot: string | string[];\r\n    /**\r\n     * CSS class to add to the root element with no results.\r\n     */\r\n    noResults: string | string[];\r\n    /**\r\n     * CSS class to add to the list element.\r\n     */\r\n    list: string | string[];\r\n    /**\r\n     * CSS class to add to each item element.\r\n     */\r\n    item: string | string[];\r\n    /**\r\n     * CSS class to add to each selected element.\r\n     */\r\n    selectedItem: string | string[];\r\n    /**\r\n     * CSS class to add to each label element (when using the default template).\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to each checkbox element (when using the default template).\r\n     */\r\n    checkbox: string | string[];\r\n    /**\r\n     * CSS class to add to each label text element.\r\n     */\r\n    labelText: string | string[];\r\n    /**\r\n     * CSS class to add to the show more element\r\n     */\r\n    showMore: string | string[];\r\n    /**\r\n     * CSS class to add to the disabled show more element\r\n     */\r\n    disabledShowMore: string | string[];\r\n    /**\r\n     * CSS class to add to each count element (when using the default template).\r\n     */\r\n    count: string | string[];\r\n    /**\r\n     * CSS class to add to the searchable container.\r\n     */\r\n    searchBox: string | string[];\r\n}>;\r\n\r\ndeclare type RefinementListOwnTemplates = Partial<{\r\n    /**\r\n     * Item template, provided with `label`, `highlighted`, `value`, `count`, `isRefined`, `url` data properties.\r\n     */\r\n    item: Template<RefinementListItemData>;\r\n    /**\r\n     * Template used for the show more text, provided with `isShowingMore` data property.\r\n     */\r\n    showMoreText: Template<{\r\n        isShowingMore: boolean;\r\n    }>;\r\n    /**\r\n     * Templates to use for search for facet values when there are no results.\r\n     */\r\n    searchableNoResults: Template;\r\n}>;\r\n\r\ndeclare type RefinementListRenderState = {\r\n    /**\r\n     * The list of filtering values returned from Algolia API.\r\n     */\r\n    items: RefinementListItem[];\r\n    /**\r\n     * indicates whether the results are exhaustive (complete)\r\n     */\r\n    hasExhaustiveItems: boolean;\r\n    /**\r\n     * Creates the next state url for a selected refinement.\r\n     */\r\n    createURL: CreateURL<string>;\r\n    /**\r\n     * Action to apply selected refinements.\r\n     */\r\n    refine: (value: string) => void;\r\n    /**\r\n     * Send event to insights middleware\r\n     */\r\n    sendEvent: SendEventForFacet;\r\n    /**\r\n     * Searches for values inside the list.\r\n     */\r\n    searchForItems: (query: string) => void;\r\n    /**\r\n     * `true` if the values are from an index search.\r\n     */\r\n    isFromSearch: boolean;\r\n    /**\r\n     * `true` if a refinement can be applied.\r\n     * @MAJOR: reconsider how `canRefine` is computed so it both accounts for the\r\n     * items returned in the main search and in SFFV.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * `true` if the toggleShowMore button can be activated (enough items to display more or\r\n     * already displaying more than `limit` items)\r\n     */\r\n    canToggleShowMore: boolean;\r\n    /**\r\n     * True if the menu is displaying all the menu items.\r\n     */\r\n    isShowingMore: boolean;\r\n    /**\r\n     * Toggles the number of values displayed between `limit` and `showMoreLimit`.\r\n     */\r\n    toggleShowMore: () => void;\r\n};\r\n\r\ndeclare type RefinementListSearchableCSSClasses = Partial<{\r\n    searchableRoot: string | string[];\r\n    searchableForm: string | string[];\r\n    searchableInput: string | string[];\r\n    searchableSubmit: string | string[];\r\n    searchableSubmitIcon: string | string[];\r\n    searchableReset: string | string[];\r\n    searchableResetIcon: string | string[];\r\n    searchableLoadingIndicator: string | string[];\r\n    searchableLoadingIcon: string | string[];\r\n}>;\r\n\r\ndeclare type RefinementListSearchableTemplates = Partial<{\r\n    /**\r\n     * Templates to use for search for facet values submit button.\r\n     */\r\n    searchableSubmit: SearchBoxTemplates['submit'];\r\n    /**\r\n     * Templates to use for search for facet values reset button.\r\n     */\r\n    searchableReset: SearchBoxTemplates['reset'];\r\n    /**\r\n     * Templates to use for the search for facet values loading indicator.\r\n     */\r\n    searchableLoadingIndicator: SearchBoxTemplates['loadingIndicator'];\r\n}>;\r\n\r\ndeclare type RefinementListTemplates = RefinementListOwnTemplates & RefinementListSearchableTemplates;\r\n\r\ndeclare type RefinementListWidget = WidgetFactory<RefinementListWidgetDescription & {\r\n    $$widgetType: 'ais.refinementList';\r\n}, RefinementListConnectorParams, RefinementListWidgetParams>;\r\n\r\ndeclare type RefinementListWidgetDescription = {\r\n    $$type: 'ais.refinementList';\r\n    renderState: RefinementListRenderState;\r\n    indexRenderState: {\r\n        refinementList: {\r\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        refinementList: {\r\n            [attribute: string]: string[];\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type RefinementListWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Add a search input to let the user search for more facet values. In order\r\n     * to make this feature work, you need to make the attribute searchable\r\n     * [using the API](https://www.algolia.com/doc/guides/searching/faceting/?language=js#declaring-a-searchable-attribute-for-faceting)\r\n     * or [the dashboard](https://www.algolia.com/explorer/display/)\r\n     */\r\n    searchable?: boolean;\r\n    /**\r\n     * Value of the search field placeholder.\r\n     */\r\n    searchablePlaceholder?: string;\r\n    /**\r\n     * When `false` the search field will become disabled if there are less items\r\n     * to display than the `options.limit`, otherwise the search field is always usable.\r\n     */\r\n    searchableIsAlwaysActive?: boolean;\r\n    /**\r\n     * When activated, it will escape the facet values that are returned from Algolia.\r\n     * In this case, the surrounding tags will always be `<mark></mark>`.\r\n     */\r\n    searchableEscapeFacetValues?: boolean;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: RefinementListTemplates;\r\n    /**\r\n     * CSS classes to add to the wrapping elements.\r\n     */\r\n    cssClasses?: RefinementListCSSClasses;\r\n};\r\n\r\ndeclare type RelatedProductsConnectorParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The `objectIDs` of the items to get related products from.\r\n     */\r\n    objectIDs: string[];\r\n    /**\r\n     * The number of recommendations to retrieve.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * The threshold for the recommendations confidence score (between 0 and 100).\r\n     */\r\n    threshold?: number;\r\n    /**\r\n     * List of search parameters to send.\r\n     */\r\n    fallbackParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * List of search parameters to send.\r\n     */\r\n    queryParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * Whether to escape HTML tags from items string values.\r\n     *\r\n     * @default true\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<Hit<THit>, {\r\n        results: RecommendResponse<AlgoliaHit<THit>>;\r\n    }>;\r\n};\r\n\r\ndeclare type RelatedProductsCSSClasses = Partial<RecommendClassNames>;\r\n\r\ndeclare type RelatedProductsRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The matched recommendations from the Algolia API.\r\n     */\r\n    items: Array<Hit<THit>>;\r\n    /**\r\n     * Sends an event to the Insights middleware.\r\n     */\r\n    sendEvent: SendEventForHits;\r\n};\r\n\r\ndeclare type RelatedProductsTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\r\n    /**\r\n     * Template to use when there are no results.\r\n     */\r\n    empty: Template<RecommendResponse<Hit<THit>>>;\r\n    /**\r\n     * Template to use for the header of the widget.\r\n     */\r\n    header: Template<Pick<Parameters<NonNullable<RelatedProductsProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {\r\n        cssClasses: RecommendClassNames;\r\n    }>;\r\n    /**\r\n     * Template to use for each result. This template will receive an object containing a single record.\r\n     */\r\n    item: TemplateWithBindEvent<Hit<THit>>;\r\n    /**\r\n     * Template to use to wrap all items.\r\n     */\r\n    layout: Template<Pick<Parameters<NonNullable<RelatedProductsProps<Hit<THit>>['layout']>>[0], 'items'> & {\r\n        templates: {\r\n            item: RelatedProductsProps<Hit<THit>>['itemComponent'];\r\n        };\r\n        cssClasses: Pick<RelatedProductsCSSClasses, 'list' | 'item'>;\r\n    }>;\r\n}>;\r\n\r\ndeclare type RelatedProductsWidgetParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * CSS selector or `HTMLElement` to insert the widget into.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to customize the widget.\r\n     */\r\n    templates?: RelatedProductsTemplates<THit>;\r\n    /**\r\n     * CSS classes to add to the widget elements.\r\n     */\r\n    cssClasses?: RelatedProductsCSSClasses;\r\n};\r\n\r\ndeclare const relevantSort: RelevantSortWidget;\r\n\r\ndeclare type RelevantSortConnector = Connector<RelevantSortWidgetDescription, RelevantSortConnectorParams>;\r\n\r\ndeclare type RelevantSortConnectorParams = Record<string, unknown>;\r\n\r\ndeclare type RelevantSortCSSClasses = Partial<{\r\n    root: string;\r\n    text: string;\r\n    button: string;\r\n}>;\r\n\r\ndeclare type RelevantSortRenderState = {\r\n    /**\r\n     * Indicates if it has appliedRelevancyStrictness greater than zero\r\n     */\r\n    isRelevantSorted: boolean;\r\n    /**\r\n     * Indicates if the results come from a virtual replica\r\n     */\r\n    isVirtualReplica: boolean;\r\n    /**\r\n     * Indicates if search state can be refined\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Sets the value as relevancyStrictness and trigger a new search\r\n     */\r\n    refine: Refine_2;\r\n};\r\n\r\ndeclare type RelevantSortTemplates = Partial<{\r\n    text: Template<{\r\n        isRelevantSorted: boolean;\r\n    }>;\r\n    button: Template<{\r\n        isRelevantSorted: boolean;\r\n    }>;\r\n}>;\r\n\r\ndeclare type RelevantSortWidget = WidgetFactory<RelevantSortWidgetDescription & {\r\n    $$widgetType: 'ais.relevantSort';\r\n}, RelevantSortConnectorParams, RelevantSortWidgetParams>;\r\n\r\ndeclare type RelevantSortWidgetDescription = {\r\n    $$type: 'ais.relevantSort';\r\n    renderState: RelevantSortRenderState;\r\n    indexRenderState: {\r\n        relevantSort: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        relevantSort: number;\r\n    };\r\n};\r\n\r\ndeclare type RelevantSortWidgetParams = {\r\n    container: string | HTMLElement;\r\n    cssClasses?: RelevantSortCSSClasses;\r\n    templates?: RelevantSortTemplates;\r\n};\r\n\r\n/**\r\n * The render function.\r\n */\r\ndeclare type Renderer<TRenderState, TWidgetParams> = (\r\n/**\r\n * The base render options plus the specific options of the widget.\r\n */\r\nrenderState: TRenderState & RendererOptions<TWidgetParams>, \r\n/**\r\n * If is the first run.\r\n */\r\nisFirstRender: boolean) => void;\r\n\r\n/**\r\n * The base renderer options. All render functions receive\r\n * the options below plus the specific options per connector.\r\n */\r\ndeclare type RendererOptions<TWidgetParams> = {\r\n    /**\r\n     * The original widget params. Useful as you may\r\n     * need them while using the render function.\r\n     */\r\n    widgetParams: TWidgetParams;\r\n    /**\r\n     * The current instant search instance.\r\n     */\r\n    instantSearchInstance: InstantSearch;\r\n    /**\r\n     * The original search results.\r\n     */\r\n    results?: SearchResults;\r\n    /**\r\n     * The mutable list of hits. The may change depending\r\n     * of the given transform items function.\r\n     */\r\n    hits?: Hit[];\r\n    /**\r\n     * The current insights client, if any.\r\n     */\r\n    insights?: InsightsClient;\r\n};\r\n\r\ndeclare type RenderOptions = SharedRenderOptions & {\r\n    results: SearchResults | null;\r\n};\r\n\r\ndeclare type RenderState = {\r\n    [indexId: string]: IndexRenderState;\r\n};\r\n\r\ndeclare type RenderStateLifeCycle<TWidgetDescription extends WidgetDescription & WidgetParams> = TWidgetDescription extends RequiredKeys<WidgetDescription, 'renderState' | 'indexRenderState'> & WidgetParams ? RequiredRenderStateLifeCycle<TWidgetDescription> : Partial<RequiredRenderStateLifeCycle<TWidgetDescription>>;\r\n\r\ndeclare function renderTemplate({ templates, templateKey, compileOptions, helpers, data, bindEvent, sendEvent, }: {\r\n    templates: Templates;\r\n    templateKey: string;\r\n    compileOptions?: HoganOptions;\r\n    helpers?: HoganHelpers;\r\n    data?: Record<string, any>;\r\n    bindEvent?: BindEventForHits;\r\n    sendEvent?: SendEventForHits;\r\n}): string | VNode<    {}> | VNode<    {}>[] | null;\r\n\r\ndeclare type RequiredKeys<TObject, TKeys extends keyof TObject> = Expand<Required<Pick<TObject, TKeys>> & Omit<TObject, TKeys>>;\r\n\r\ndeclare type RequiredRenderStateLifeCycle<TWidgetDescription extends WidgetDescription & WidgetParams> = {\r\n    /**\r\n     * Returns the render state of the current widget to pass to the render function.\r\n     */\r\n    getWidgetRenderState: (renderOptions: InitOptions | RenderOptions) => Expand<WidgetRenderState<TWidgetDescription['renderState'], TWidgetDescription['widgetParams']>>;\r\n    /**\r\n     * Returns IndexRenderState of the current index component tree\r\n     * to build the render state of the whole app.\r\n     */\r\n    getRenderState: (renderState: Expand<IndexRenderState & Partial<TWidgetDescription['indexRenderState']>>, renderOptions: InitOptions | RenderOptions) => IndexRenderState & TWidgetDescription['indexRenderState'];\r\n};\r\n\r\ndeclare type RequiredUiStateLifeCycle<TWidgetDescription extends WidgetDescription> = {\r\n    /**\r\n     * This function is required for a widget to be taken in account for routing.\r\n     * It will derive a uiState for this widget based on the existing uiState and\r\n     * the search parameters applied.\r\n     *\r\n     * @param uiState - Current state.\r\n     * @param widgetStateOptions - Extra information to calculate uiState.\r\n     */\r\n    getWidgetUiState: (uiState: Expand<Partial<TWidgetDescription['indexUiState'] & IndexUiState>>, widgetUiStateOptions: {\r\n        searchParameters: SearchParameters;\r\n        helper: AlgoliaSearchHelper;\r\n    }) => Partial<IndexUiState & TWidgetDescription['indexUiState']>;\r\n    /**\r\n     * This function is required for a widget to be taken in account for routing.\r\n     * It will derive a uiState for this widget based on the existing uiState and\r\n     * the search parameters applied.\r\n     *\r\n     * @deprecated Use `getWidgetUiState` instead.\r\n     * @param uiState - Current state.\r\n     * @param widgetStateOptions - Extra information to calculate uiState.\r\n     */\r\n    getWidgetState?: RequiredUiStateLifeCycle<TWidgetDescription>['getWidgetUiState'];\r\n    /**\r\n     * This function is required for a widget to behave correctly when a URL is\r\n     * loaded via e.g. Routing. It receives the current UiState and applied search\r\n     * parameters, and is expected to return a new search parameters.\r\n     *\r\n     * @param state - Applied search parameters.\r\n     * @param widgetSearchParametersOptions - Extra information to calculate next searchParameters.\r\n     */\r\n    getWidgetSearchParameters: (state: SearchParameters, widgetSearchParametersOptions: {\r\n        uiState: Expand<Partial<TWidgetDescription['indexUiState'] & IndexUiState>>;\r\n    }) => SearchParameters;\r\n};\r\n\r\ndeclare type RequiredWidgetLifeCycle<TWidgetDescription extends WidgetDescription> = {\r\n    /**\r\n     * Identifier for connectors and widgets.\r\n     */\r\n    $$type: TWidgetDescription['$$type'];\r\n    /**\r\n     * Called once before the first search.\r\n     */\r\n    init?: (options: InitOptions) => void;\r\n    /**\r\n     * Whether `render` should be called\r\n     */\r\n    shouldRender?: (options: ShouldRenderOptions) => boolean;\r\n    /**\r\n     * Called after each search response has been received.\r\n     */\r\n    render?: (options: RenderOptions) => void;\r\n    /**\r\n     * Called when this widget is unmounted. Used to remove refinements set by\r\n     * during this widget's initialization and life time.\r\n     */\r\n    dispose?: (options: DisposeOptions) => SearchParameters | RecommendParameters | void;\r\n};\r\n\r\ndeclare type RequiredWidgetType<TWidgetDescription extends WidgetDescription> = {\r\n    /**\r\n     * Identifier for widgets.\r\n     */\r\n    $$widgetType: TWidgetDescription['$$widgetType'];\r\n};\r\n\r\ndeclare function ReverseHighlight<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: ReverseHighlightProps<THit>): h.JSX.Element;\r\n\r\n/**\r\n * @deprecated use html tagged templates and the ReverseHighlight component instead\r\n */\r\ndeclare function reverseHighlight({ attribute, highlightedTagName, hit, cssClasses, }: ReverseHighlightOptions): string;\r\n\r\ndeclare type ReverseHighlightClassNames = HighlightClassNames_2;\r\n\r\ndeclare type ReverseHighlightOptions = {\r\n    attribute: string | string[];\r\n    highlightedTagName?: string;\r\n    hit: Partial<Hit>;\r\n    cssClasses?: Partial<{\r\n        highlighted: string;\r\n    }>;\r\n};\r\n\r\ndeclare type ReverseHighlightProps<THit extends Hit<BaseHit>> = {\r\n    hit: THit;\r\n    attribute: keyof THit | string[];\r\n    cssClasses?: ReverseHighlightProps_2['classNames'];\r\n} & PartialKeys<Omit<ReverseHighlightProps_2, 'parts' | 'classNames'>, 'highlightedTagName' | 'nonHighlightedTagName' | 'separator'>;\r\n\r\ndeclare type ReverseHighlightProps_2 = Omit<HighlightProps_3, 'classNames'> & {\r\n    classNames?: Partial<ReverseHighlightClassNames>;\r\n};\r\n\r\ndeclare function ReverseSnippet<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: ReverseSnippetProps<THit>): h.JSX.Element;\r\n\r\n/**\r\n * @deprecated use html tagged templates and the ReverseSnippet component instead\r\n */\r\ndeclare function reverseSnippet({ attribute, highlightedTagName, hit, cssClasses, }: ReverseSnippetOptions): string;\r\n\r\ndeclare type ReverseSnippetClassNames = HighlightClassNames_2;\r\n\r\ndeclare type ReverseSnippetOptions = {\r\n    attribute: string | string[];\r\n    highlightedTagName?: string;\r\n    hit: Partial<Hit>;\r\n    cssClasses?: Partial<{\r\n        highlighted: string;\r\n    }>;\r\n};\r\n\r\ndeclare type ReverseSnippetProps<THit extends Hit<BaseHit>> = {\r\n    hit: THit;\r\n    attribute: keyof THit | string[];\r\n    cssClasses?: ReverseSnippetProps_2['classNames'];\r\n} & PartialKeys<Omit<ReverseSnippetProps_2, 'parts' | 'classNames'>, 'highlightedTagName' | 'nonHighlightedTagName' | 'separator'>;\r\n\r\ndeclare type ReverseSnippetProps_2 = Omit<HighlightProps_3, 'classNames'> & {\r\n    classNames?: Partial<ReverseSnippetClassNames>;\r\n};\r\n\r\n/**\r\n * The router is the part that saves and reads the object from the storage.\r\n * Usually this is the URL.\r\n */\r\ndeclare type Router<TRouteState = UiState> = {\r\n    /**\r\n     * onUpdate Sets an event listener that is triggered when the storage is updated.\r\n     * The function should accept a callback to trigger when the update happens.\r\n     * In the case of the history / URL in a browser, the callback will be called\r\n     * by `onPopState`.\r\n     */\r\n    onUpdate: (callback: (route: TRouteState) => void) => void;\r\n    /**\r\n     * Reads the storage and gets a route object. It does not take parameters,\r\n     * and should return an object\r\n     */\r\n    read: () => TRouteState;\r\n    /**\r\n     * Pushes a route object into a storage. Takes the UI state mapped by the state\r\n     * mapping configured in the mapping\r\n     */\r\n    write: (route: TRouteState) => void;\r\n    /**\r\n     * Transforms a route object into a URL. It receives an object and should\r\n     * return a string. It may return an empty string.\r\n     */\r\n    createURL: (state: TRouteState) => string;\r\n    /**\r\n     * Called when InstantSearch is disposed. Used to remove subscriptions.\r\n     */\r\n    dispose: () => void;\r\n    /**\r\n     * Called when InstantSearch is started.\r\n     */\r\n    start?: () => void;\r\n    /**\r\n     * Identifier for this router. Used to differentiate between routers.\r\n     */\r\n    $$type?: string;\r\n};\r\n\r\ndeclare type RouterProps<TUiState extends UiState = UiState, TRouteState = TUiState> = {\r\n    router?: Router<TRouteState>;\r\n    stateMapping?: StateMapping<TUiState, TRouteState>;\r\n};\r\n\r\ndeclare namespace routers {\r\n    export {\r\n        historyRouter as history\r\n    }\r\n}\r\n\r\ndeclare type ScopedResult = {\r\n    indexId: string;\r\n    results: SearchResults | null;\r\n    helper: AlgoliaSearchHelper;\r\n};\r\n\r\ndeclare const searchBox: SearchBoxWidget;\r\n\r\ndeclare type SearchBoxComponentCSSClasses = ComponentCSSClasses<SearchBoxCSSClasses>;\r\n\r\ndeclare type SearchBoxConnector = Connector<SearchBoxWidgetDescription, SearchBoxConnectorParams>;\r\n\r\ndeclare type SearchBoxConnectorParams = {\r\n    /**\r\n     * A function that will be called every time\r\n     * a new value for the query is set. The first parameter is the query and the second is a\r\n     * function to actually trigger the search. The function takes the query as the parameter.\r\n     *\r\n     * This queryHook can be used to debounce the number of searches done from the searchBox.\r\n     */\r\n    queryHook?: (query: string, hook: (value: string) => void) => void;\r\n};\r\n\r\ndeclare type SearchBoxCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the wrapping `<div>`\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the form\r\n     */\r\n    form: string | string[];\r\n    /**\r\n     * CSS class to add to the input.\r\n     */\r\n    input: string | string[];\r\n    /**\r\n     * CSS classes added to the submit button.\r\n     */\r\n    submit: string | string[];\r\n    /**\r\n     * CSS classes added to the submit icon.\r\n     */\r\n    submitIcon: string | string[];\r\n    /**\r\n     * CSS classes added to the reset button.\r\n     */\r\n    reset: string | string[];\r\n    /**\r\n     * CSS classes added to the reset icon.\r\n     */\r\n    resetIcon: string | string[];\r\n    /**\r\n     * CSS classes added to the loading indicator element.\r\n     */\r\n    loadingIndicator: string | string[];\r\n    /**\r\n     * CSS classes added to the loading indicator icon.\r\n     */\r\n    loadingIcon: string | string[];\r\n}>;\r\n\r\n/**\r\n * @typedef {Object} CustomSearchBoxWidgetParams@typedef {Object} CustomSearchBoxWidgetParams\r\n * @property {function(string, function(string))} [queryHook = undefined] A function that will be called every time\r\n * a new value for the query is set. The first parameter is the query and the second is a\r\n * function to actually trigger the search. The function takes the query as the parameter.\r\n *\r\n * This queryHook can be used to debounce the number of searches done from the searchBox.\r\n */\r\ndeclare type SearchBoxRenderState = {\r\n    /**\r\n     * The query from the last search.\r\n     */\r\n    query: string;\r\n    /**\r\n     * Sets a new query and searches.\r\n     */\r\n    refine: (value: string) => void;\r\n    /**\r\n     * Remove the query and perform search.\r\n     */\r\n    clear: () => void;\r\n    /**\r\n     * `true` if the search results takes more than a certain time to come back\r\n     * from Algolia servers. This can be configured on the InstantSearch constructor with the attribute\r\n     * `stalledSearchDelay` which is 200ms, by default.\r\n     * @deprecated use `instantSearchInstance.status` instead\r\n     */\r\n    isSearchStalled: boolean;\r\n};\r\n\r\ndeclare type SearchBoxTemplates = Partial<{\r\n    /**\r\n     * Template used for displaying the submit button. Can accept a function or a Hogan string.\r\n     */\r\n    submit: Template<{\r\n        cssClasses: SearchBoxComponentCSSClasses;\r\n    }>;\r\n    /**\r\n     * Template used for displaying the reset button. Can accept a function or a Hogan string.\r\n     */\r\n    reset: Template<{\r\n        cssClasses: SearchBoxComponentCSSClasses;\r\n    }>;\r\n    /**\r\n     * Template used for displaying the loading indicator. Can accept a function or a Hogan string.\r\n     */\r\n    loadingIndicator: Template<{\r\n        cssClasses: SearchBoxComponentCSSClasses;\r\n    }>;\r\n}>;\r\n\r\n/**\r\n * The searchbox widget is used to let the user set a text based query.\r\n *\r\n * This is usually the  main entry point to start the search in an instantsearch context. For that\r\n * reason is usually placed on top, and not hidden so that the user can start searching right\r\n * away.\r\n *\r\n */\r\ndeclare type SearchBoxWidget = WidgetFactory<SearchBoxWidgetDescription & {\r\n    $$widgetType: 'ais.searchBox';\r\n}, SearchBoxConnectorParams, SearchBoxWidgetParams>;\r\n\r\ndeclare type SearchBoxWidgetDescription = {\r\n    $$type: 'ais.searchBox';\r\n    renderState: SearchBoxRenderState;\r\n    indexRenderState: {\r\n        searchBox: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        query: string;\r\n    };\r\n};\r\n\r\ndeclare type SearchBoxWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * The placeholder of the input\r\n     */\r\n    placeholder?: string;\r\n    /**\r\n     * Whether the input should be autofocused\r\n     */\r\n    autofocus?: boolean;\r\n    /**\r\n     * If set, trigger the search\r\n     * once `<Enter>` is pressed only.\r\n     */\r\n    searchAsYouType?: boolean;\r\n    /**\r\n     * Whether to update the search state in the middle of a\r\n     * composition session.\r\n     * @default false\r\n     */\r\n    ignoreCompositionEvents?: boolean;\r\n    /**\r\n     * Whether to show the reset button\r\n     */\r\n    showReset?: boolean;\r\n    /**\r\n     * Whether to show the submit button\r\n     */\r\n    showSubmit?: boolean;\r\n    /**\r\n     * Whether to show the loading indicator (replaces the submit if\r\n     * the search is stalled)\r\n     */\r\n    showLoadingIndicator?: boolean;\r\n    /**\r\n     * CSS classes to add\r\n     */\r\n    cssClasses?: SearchBoxCSSClasses;\r\n    /**\r\n     * Templates used for customizing the rendering of the searchbox\r\n     */\r\n    templates?: SearchBoxTemplates;\r\n    /**\r\n     * A function that is called every time a new search is done. You\r\n     * will get the query as the first parameter and a search (query) function to call as the second parameter.\r\n     * This `queryHook` can be used to debounce the number of searches done from the search box.\r\n     */\r\n    queryHook?: (query: string, hook: (value: string) => void) => void;\r\n};\r\n\r\ndeclare type SearchWidget<TWidgetDescription extends WidgetDescription> = {\r\n    dependsOn?: 'search';\r\n    getWidgetParameters?: (state: SearchParameters, widgetParametersOptions: {\r\n        uiState: Expand<Partial<TWidgetDescription['indexUiState'] & IndexUiState>>;\r\n    }) => SearchParameters;\r\n};\r\n\r\ndeclare type SendEvent = (...args: [InsightsEvent] | [string, string, string?]) => void;\r\n\r\ndeclare type SendEventForFacet = BuiltInSendEventForFacet & CustomSendEventForFacet;\r\n\r\ndeclare type SendEventForHits = BuiltInSendEventForHits & CustomSendEventForHits;\r\n\r\ndeclare type SendEventForToggle = BuiltInSendEventForToggle & CustomSendEventForToggle;\r\n\r\ndeclare type SharedRenderOptions = {\r\n    instantSearchInstance: InstantSearch;\r\n    parent: IndexWidget;\r\n    templatesConfig: Record<string, unknown>;\r\n    scopedResults: ScopedResult[];\r\n    state: SearchParameters;\r\n    renderState: IndexRenderState;\r\n    helper: AlgoliaSearchHelper;\r\n    /** @deprecated use `status` instead */\r\n    searchMetadata: {\r\n        /** @deprecated use `status === \"stalled\"` instead */\r\n        isSearchStalled: boolean;\r\n    };\r\n    status: InstantSearch['status'];\r\n    error: InstantSearch['error'];\r\n    createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\r\n};\r\n\r\ndeclare type ShouldRenderOptions = {\r\n    instantSearchInstance: InstantSearch;\r\n};\r\n\r\ndeclare function simpleStateMapping<TUiState extends UiState = UiState>(): StateMapping<TUiState, TUiState>;\r\n\r\ndeclare function singleIndexStateMapping<TUiState extends UiState = UiState>(indexName: keyof TUiState): StateMapping<TUiState, TUiState[typeof indexName]>;\r\n\r\ndeclare function Snippet<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: SnippetProps<THit>): h.JSX.Element;\r\n\r\n/**\r\n * @deprecated use html tagged templates and the Snippet component instead\r\n */\r\ndeclare function snippet({ attribute, highlightedTagName, hit, cssClasses, }: SnippetOptions): string;\r\n\r\ndeclare type SnippetClassNames = HighlightClassNames_2;\r\n\r\ndeclare type SnippetOptions = {\r\n    attribute: string | string[];\r\n    highlightedTagName?: string;\r\n    hit: Partial<Hit>;\r\n    cssClasses?: {\r\n        highlighted?: string;\r\n    };\r\n};\r\n\r\ndeclare type SnippetProps<THit extends Hit<BaseHit>> = {\r\n    hit: THit;\r\n    attribute: keyof THit | string[];\r\n    cssClasses?: SnippetProps_2['classNames'];\r\n} & PartialKeys<Omit<SnippetProps_2, 'parts' | 'classNames'>, 'highlightedTagName' | 'nonHighlightedTagName' | 'separator'>;\r\n\r\ndeclare type SnippetProps_2 = Omit<HighlightProps_3, 'classNames'> & {\r\n    classNames?: Partial<SnippetClassNames>;\r\n};\r\n\r\n/**\r\n * Transforms the given items.\r\n */\r\ndeclare type SortBy<TItem> = ((a: TItem, b: TItem) => number) | Array<SortByDirection<'count' | 'name' | 'isRefined'>>;\r\n\r\n/**\r\n * Sort by selector is a widget used for letting the user choose between different\r\n * indices that contains the same data with a different order / ranking formula.\r\n */\r\ndeclare const sortBy: SortByWidget;\r\n\r\ndeclare type SortByConnector = Connector<SortByWidgetDescription, SortByConnectorParams>;\r\n\r\ndeclare type SortByConnectorParams = {\r\n    /**\r\n     * Array of objects defining the different indices to choose from.\r\n     */\r\n    items: SortByItem[];\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<SortByItem>;\r\n};\r\n\r\ndeclare type SortByDirection<TCriterion extends string> = TCriterion | `${TCriterion}:asc` | `${TCriterion}:desc`;\r\n\r\ndeclare type SortByIndexDefinition = {\r\n    /**\r\n     * The name of the index to target.\r\n     */\r\n    value: string;\r\n    /**\r\n     * The label of the index to display.\r\n     */\r\n    label: string;\r\n};\r\n\r\n/**\r\n * The **SortBy** connector provides the logic to build a custom widget that will display a\r\n * list of indices. With Algolia, this is most commonly used for changing ranking strategy. This allows\r\n * a user to change how the hits are being sorted.\r\n */\r\ndeclare type SortByItem = {\r\n    /**\r\n     * The name of the index to target.\r\n     */\r\n    value: string;\r\n    /**\r\n     * The label of the index to display.\r\n     */\r\n    label: string;\r\n};\r\n\r\ndeclare type SortByRenderState = {\r\n    /**\r\n     * The initially selected index.\r\n     */\r\n    initialIndex?: string;\r\n    /**\r\n     * The currently selected index.\r\n     */\r\n    currentRefinement: string;\r\n    /**\r\n     * All the available indices\r\n     */\r\n    options: SortByItem[];\r\n    /**\r\n     * Switches indices and triggers a new search.\r\n     */\r\n    refine: (value: string) => void;\r\n    /**\r\n     * `true` if the last search contains no result.\r\n     * @deprecated Use `canRefine` instead.\r\n     */\r\n    hasNoResults: boolean;\r\n    /**\r\n     * `true` if we can refine.\r\n     */\r\n    canRefine: boolean;\r\n};\r\n\r\ndeclare type SortByWidget = WidgetFactory<SortByWidgetDescription & {\r\n    $$widgetType: 'ais.sortBy';\r\n}, SortByConnectorParams, SortByWidgetParams>;\r\n\r\ndeclare type SortByWidgetCssClasses = Partial<{\r\n    /**\r\n     * CSS classes added to the outer `<div>`.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS classes added to the parent `<select>`.\r\n     */\r\n    select: string | string[];\r\n    /**\r\n     * CSS classes added to each `<option>`.\r\n     */\r\n    option: string | string[];\r\n}>;\r\n\r\ndeclare type SortByWidgetDescription = {\r\n    $$type: 'ais.sortBy';\r\n    renderState: SortByRenderState;\r\n    indexRenderState: {\r\n        sortBy: WidgetRenderState<SortByRenderState, SortByConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        sortBy: string;\r\n    };\r\n};\r\n\r\ndeclare type SortByWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Array of objects defining the different indices to choose from.\r\n     */\r\n    items: SortByIndexDefinition[];\r\n    /**\r\n     * CSS classes to be added.\r\n     */\r\n    cssClasses?: SortByWidgetCssClasses;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<SortByItem>;\r\n};\r\n\r\ndeclare type StarRatingItems = {\r\n    /**\r\n     * Name corresponding to the number of stars.\r\n     */\r\n    name: string;\r\n    /**\r\n     * Human-readable name corresponding to the number of stars.\r\n     */\r\n    label: string;\r\n    /**\r\n     * Number of stars as string.\r\n     */\r\n    value: string;\r\n    /**\r\n     * Count of matched results corresponding to the number of stars.\r\n     */\r\n    count: number;\r\n    /**\r\n     *  Array of length of maximum rating value with stars to display or not.\r\n     */\r\n    stars: boolean[];\r\n    /**\r\n     * Indicates if star rating refinement is applied.\r\n     */\r\n    isRefined: boolean;\r\n};\r\n\r\n/**\r\n * The state mapping is a way to customize the structure before sending it to the router.\r\n * It can transform and filter out the properties. To work correctly, the following\r\n * should be valid for any UiState:\r\n * `UiState = routeToState(stateToRoute(UiState))`.\r\n */\r\ndeclare type StateMapping<TUiState = UiState, TRouteState = TUiState> = {\r\n    /**\r\n     * Transforms a UI state representation into a route object.\r\n     * It receives an object that contains the UI state of all the widgets in the page.\r\n     * It should return an object of any form as long as this form can be read by\r\n     * the `routeToState` function.\r\n     */\r\n    stateToRoute: (uiState: TUiState) => TRouteState;\r\n    /**\r\n     * Transforms route object into a UI state representation.\r\n     * It receives an object that contains the UI state stored by the router.\r\n     * The format is the output of `stateToRoute`.\r\n     */\r\n    routeToState: (routeState: TRouteState) => TUiState;\r\n    /**\r\n     * Identifier for this stateMapping. Used to differentiate between stateMappings.\r\n     */\r\n    $$type?: string;\r\n};\r\n\r\ndeclare namespace stateMappings {\r\n    export {\r\n        simpleStateMapping as simple,\r\n        singleIndexStateMapping as singleIndex\r\n    }\r\n}\r\n\r\ndeclare type StaticOptions = Places.StaticOptions;\r\n\r\n/**\r\n * The `stats` widget is used to display useful insights about the current results.\r\n *\r\n * By default, it will display the **number of hits** and the time taken to compute the\r\n * results inside the engine.\r\n */\r\ndeclare const stats: StatsWidget;\r\n\r\ndeclare type StatsConnector = Connector<StatsWidgetDescription, StatsConnectorParams>;\r\n\r\ndeclare type StatsConnectorParams = Record<string, unknown>;\r\n\r\ndeclare type StatsCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the text span element.\r\n     */\r\n    text: string | string[];\r\n}>;\r\n\r\n/**\r\n * **Stats** connector provides the logic to build a custom widget that will displays\r\n * search statistics (hits number and processing time).\r\n */\r\ndeclare type StatsRenderState = {\r\n    /**\r\n     * The maximum number of hits per page returned by Algolia.\r\n     */\r\n    hitsPerPage?: number;\r\n    /**\r\n     * The number of hits in the result set.\r\n     */\r\n    nbHits: number;\r\n    /**\r\n     * The number of sorted hits in the result set (when using Relevant sort).\r\n     */\r\n    nbSortedHits?: number;\r\n    /**\r\n     * Indicates whether the index is currently using Relevant sort and is displaying only sorted hits.\r\n     */\r\n    areHitsSorted: boolean;\r\n    /**\r\n     * The number of pages computed for the result set.\r\n     */\r\n    nbPages: number;\r\n    /**\r\n     * The current page.\r\n     */\r\n    page: number;\r\n    /**\r\n     * The time taken to compute the results inside the Algolia engine.\r\n     */\r\n    processingTimeMS: number;\r\n    /**\r\n     * The query used for the current search.\r\n     */\r\n    query: string;\r\n};\r\n\r\ndeclare type StatsTemplates = Partial<{\r\n    /**\r\n     * Text template, provided with `hasManyResults`, `hasNoResults`, `hasOneResult`, `hasNoSortedResults`, `hasOneSortedResults`, `hasManySortedResults`, `hitsPerPage`, `nbHits`, `nbSortedHits`, `nbPages`, `areHitsSorted`, `page`, `processingTimeMS`, `query`.\r\n     */\r\n    text: Template<TextTemplateProps & StatsRenderState>;\r\n}>;\r\n\r\ndeclare type StatsWidget = WidgetFactory<StatsWidgetDescription & {\r\n    $$widgetType: 'ais.stats';\r\n}, StatsConnectorParams, StatsWidgetParams>;\r\n\r\ndeclare type StatsWidgetDescription = {\r\n    $$type: 'ais.stats';\r\n    renderState: StatsRenderState;\r\n    indexRenderState: {\r\n        stats: WidgetRenderState<StatsRenderState, StatsConnectorParams>;\r\n    };\r\n};\r\n\r\ndeclare type StatsWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: StatsTemplates;\r\n    /**\r\n     * CSS classes to add.\r\n     */\r\n    cssClasses?: StatsCSSClasses;\r\n};\r\n\r\ndeclare type Status = 'initial' | 'askingPermission' | 'waiting' | 'recognizing' | 'finished' | 'error';\r\n\r\ndeclare type Template<TTemplateData = void> = string | ((data: TTemplateData, params: TemplateParams) => VNode | VNode[] | string | null);\r\n\r\ndeclare type Template_2 = (params: {\r\n    html: typeof html;\r\n}) => VNode_2 | VNode_2[] | null;\r\n\r\ndeclare type TemplateParams = {\r\n    html: typeof html;\r\n    components: {\r\n        Highlight: typeof Highlight_2;\r\n        ReverseHighlight: typeof ReverseHighlight;\r\n        Snippet: typeof Snippet;\r\n        ReverseSnippet: typeof ReverseSnippet;\r\n    };\r\n    sendEvent?: SendEventForHits;\r\n};\r\n\r\ndeclare type Templates = {\r\n    [key: string]: Template<any> | TemplateWithBindEvent<any> | undefined;\r\n};\r\n\r\ndeclare namespace templates {\r\n    export {\r\n        carousel\r\n    }\r\n}\r\n\r\ndeclare type TemplatesConfig = {\r\n    helpers?: HoganHelpers;\r\n    compileOptions?: HoganOptions;\r\n};\r\n\r\ndeclare type TemplateWithBindEvent<TTemplateData = void> = string | ((data: TTemplateData, params: TemplateWithBindEventParams) => VNode | VNode[] | string);\r\n\r\ndeclare interface TemplateWithBindEventParams extends TemplateParams {\r\n    /** @deprecated use sendEvent instead */\r\n    (...args: Parameters<BuiltInBindEventForHits>): ReturnType<BuiltInBindEventForHits>;\r\n    /** @deprecated use sendEvent instead */\r\n    (...args: Parameters<CustomBindEventForHits>): ReturnType<CustomBindEventForHits>;\r\n    sendEvent: SendEventForHits;\r\n}\r\n\r\ndeclare type TextTemplateProps = {\r\n    hasManyResults: boolean;\r\n    hasNoResults: boolean;\r\n    hasOneResult: boolean;\r\n    hasNoSortedResults: boolean;\r\n    hasOneSortedResults: boolean;\r\n    hasManySortedResults: boolean;\r\n};\r\n\r\n/**\r\n * The toggleRefinement widget lets the user either:\r\n *  - switch between two values for a single facetted attribute (free_shipping / not_free_shipping)\r\n *  - toggleRefinement a faceted value on and off (only 'canon' for brands)\r\n *\r\n * This widget is particularly useful if you have a boolean value in the records.\r\n *\r\n * @requirements\r\n * The attribute passed to `attribute` must be declared as an\r\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\r\n * in your Algolia settings.\r\n */\r\ndeclare const toggleRefinement: ToggleRefinementWidget;\r\n\r\ndeclare type ToggleRefinementConnector = Connector<ToggleRefinementWidgetDescription, ToggleRefinementConnectorParams>;\r\n\r\ndeclare type ToggleRefinementConnectorParams = {\r\n    /**\r\n     * Name of the attribute for faceting (e.g., \"free_shipping\").\r\n     */\r\n    attribute: string;\r\n    /**\r\n     * Value to filter on when toggled.\r\n     * @default \"true\"\r\n     */\r\n    on?: FacetValue | FacetValue[];\r\n    /**\r\n     * Value to filter on when not toggled.\r\n     */\r\n    off?: FacetValue | FacetValue[];\r\n};\r\n\r\ndeclare type ToggleRefinementCSSClasses = Partial<{\r\n    /**\r\n     * CSS class to add to the root element.\r\n     */\r\n    root: string | string[];\r\n    /**\r\n     * CSS class to add to the label wrapping element.\r\n     */\r\n    label: string | string[];\r\n    /**\r\n     * CSS class to add to the checkbox.\r\n     */\r\n    checkbox: string | string[];\r\n    /**\r\n     * CSS class to add to the label text.\r\n     */\r\n    labelText: string | string[];\r\n}>;\r\n\r\ndeclare type ToggleRefinementRenderState = {\r\n    /** The current toggle value */\r\n    value: {\r\n        /**\r\n         * The attribute name of this toggle.\r\n         */\r\n        name: string;\r\n        /**\r\n         * Whether the current option is \"on\" (true) or \"off\" (false)\r\n         */\r\n        isRefined: boolean;\r\n        /**\r\n         * Number of results if this option is toggled.\r\n         */\r\n        count: number | null;\r\n        /**\r\n         * Information about the \"on\" toggle.\r\n         */\r\n        onFacetValue: ToggleRefinementValue;\r\n        /**\r\n         * Information about the \"off\" toggle.\r\n         */\r\n        offFacetValue: ToggleRefinementValue;\r\n    };\r\n    /**\r\n     * Creates an URL for the next state.\r\n     */\r\n    createURL: CreateURL<void>;\r\n    /**\r\n     * Send a \"Facet Clicked\" Insights event.\r\n     */\r\n    sendEvent: SendEventForToggle;\r\n    /**\r\n     * Indicates if search state can be refined.\r\n     */\r\n    canRefine: boolean;\r\n    /**\r\n     * Updates to the next state by applying the toggle refinement.\r\n     */\r\n    refine: (value?: {\r\n        isRefined: boolean;\r\n    }) => void;\r\n};\r\n\r\ndeclare type ToggleRefinementTemplates = Partial<{\r\n    /**\r\n     * the text that describes the toggle action\r\n     */\r\n    labelText: Template<ToggleRefinementRenderState['value']>;\r\n}>;\r\n\r\ndeclare type ToggleRefinementValue = {\r\n    /**\r\n     * Whether this option is enabled.\r\n     */\r\n    isRefined: boolean;\r\n    /**\r\n     * Number of result if this option is toggled.\r\n     */\r\n    count: number | null;\r\n};\r\n\r\ndeclare type ToggleRefinementWidget = WidgetFactory<ToggleRefinementWidgetDescription & {\r\n    $$widgetType: 'ais.toggleRefinement';\r\n}, ToggleRefinementConnectorParams, ToggleRefinementWidgetParams>;\r\n\r\ndeclare type ToggleRefinementWidgetDescription = {\r\n    $$type: 'ais.toggleRefinement';\r\n    renderState: ToggleRefinementRenderState;\r\n    indexRenderState: {\r\n        toggleRefinement: {\r\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\r\n        };\r\n    };\r\n    indexUiState: {\r\n        toggle: {\r\n            [attribute: string]: boolean;\r\n        };\r\n    };\r\n};\r\n\r\ndeclare type ToggleRefinementWidgetParams = {\r\n    /**\r\n     * CSS Selector or HTMLElement to insert the widget.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to use for the widget.\r\n     */\r\n    templates?: ToggleRefinementTemplates;\r\n    /**\r\n     * CSS classes to be added.\r\n     */\r\n    cssClasses?: ToggleRefinementCSSClasses;\r\n};\r\n\r\ndeclare type TrackedFilterRefinement = string | number | boolean;\r\n\r\n/**\r\n * Transforms the given items.\r\n */\r\ndeclare type TransformItems<TItem, TMetadata = TransformItemsMetadata> = (items: TItem[], metadata: TMetadata) => TItem[];\r\n\r\ndeclare type TransformItemsMetadata = {\r\n    results: SearchResults | undefined | null;\r\n};\r\n\r\ndeclare type TransformSearchParameters = (searchParameters: SearchParameters) => PlainSearchParameters;\r\n\r\ndeclare type TrendingItemsConnectorParams<THit extends NonNullable<object> = BaseHit> = ({\r\n    /**\r\n     * The facet attribute to get recommendations for.\r\n     */\r\n    facetName: string;\r\n    /**\r\n     * The facet value to get recommendations for.\r\n     */\r\n    facetValue: string;\r\n} | {\r\n    facetName?: string;\r\n    facetValue?: string;\r\n}) & {\r\n    /**\r\n     * The number of recommendations to retrieve.\r\n     */\r\n    limit?: number;\r\n    /**\r\n     * The threshold for the recommendations confidence score (between 0 and 100).\r\n     */\r\n    threshold?: number;\r\n    /**\r\n     * List of search parameters to send.\r\n     */\r\n    fallbackParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * List of search parameters to send.\r\n     */\r\n    queryParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\r\n    /**\r\n     * Whether to escape HTML tags from items string values.\r\n     *\r\n     * @default true\r\n     */\r\n    escapeHTML?: boolean;\r\n    /**\r\n     * Function to transform the items passed to the templates.\r\n     */\r\n    transformItems?: TransformItems<Hit<THit>, {\r\n        results: RecommendResponse<AlgoliaHit<THit>>;\r\n    }>;\r\n};\r\n\r\ndeclare type TrendingItemsCSSClasses = Partial<RecommendClassNames>;\r\n\r\ndeclare type TrendingItemsRenderState<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * The matched recommendations from the Algolia API.\r\n     */\r\n    items: Array<Hit<THit>>;\r\n    /**\r\n     * Sends an event to the Insights middleware.\r\n     */\r\n    sendEvent: SendEventForHits;\r\n};\r\n\r\ndeclare type TrendingItemsTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\r\n    /**\r\n     * Template to use when there are no results.\r\n     */\r\n    empty: Template<RecommendResponse<Hit<THit>>>;\r\n    /**\r\n     * Template to use for the header of the widget.\r\n     */\r\n    header: Template<Pick<Parameters<NonNullable<TrendingItemsProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {\r\n        cssClasses: RecommendClassNames;\r\n    }>;\r\n    /**\r\n     * Template to use for each result. This template will receive an object containing a single record.\r\n     */\r\n    item: TemplateWithBindEvent<Hit<THit>>;\r\n    /**\r\n     * Template to use to wrap all items.\r\n     */\r\n    layout: Template<Pick<Parameters<NonNullable<TrendingItemsProps<Hit<THit>>['layout']>>[0], 'items'> & {\r\n        templates: {\r\n            item: TrendingItemsProps<Hit<THit>>['itemComponent'];\r\n        };\r\n        cssClasses: Pick<TrendingItemsCSSClasses, 'list' | 'item'>;\r\n    }>;\r\n}>;\r\n\r\ndeclare type TrendingItemsWidgetParams<THit extends NonNullable<object> = BaseHit> = {\r\n    /**\r\n     * CSS selector or `HTMLElement` to insert the widget into.\r\n     */\r\n    container: string | HTMLElement;\r\n    /**\r\n     * Templates to customize the widget.\r\n     */\r\n    templates?: TrendingItemsTemplates<THit>;\r\n    /**\r\n     * CSS classes to add to the widget elements.\r\n     */\r\n    cssClasses?: TrendingItemsCSSClasses;\r\n};\r\n\r\ndeclare type UiState = {\r\n    [indexId: string]: IndexUiState;\r\n};\r\n\r\ndeclare type UiStateLifeCycle<TWidgetDescription extends WidgetDescription> = TWidgetDescription extends RequiredKeys<WidgetDescription, 'indexUiState'> ? RequiredUiStateLifeCycle<TWidgetDescription> : Partial<RequiredUiStateLifeCycle<TWidgetDescription>>;\r\n\r\ndeclare type UnknownWidgetParams = NonNullable<object>;\r\n\r\n/**\r\n * The called function when unmounting a widget.\r\n */\r\ndeclare type Unmounter = () => void;\r\n\r\ndeclare type VoiceListeningState = {\r\n    status: Status;\r\n    transcript: string;\r\n    isSpeechFinal: boolean;\r\n    errorCode?: string;\r\n};\r\n\r\ndeclare const voiceSearch: VoiceSearchWidget;\r\n\r\ndeclare type VoiceSearchConnector = Connector<VoiceSearchWidgetDescription, VoiceSearchConnectorParams>;\r\n\r\ndeclare type VoiceSearchConnectorParams = {\r\n    searchAsYouSpeak?: boolean;\r\n    language?: string;\r\n    additionalQueryParameters?: (params: {\r\n        query: string;\r\n    }) => PlainSearchParameters | void;\r\n    createVoiceSearchHelper?: CreateVoiceSearchHelper;\r\n};\r\n\r\ndeclare type VoiceSearchCSSClasses = Partial<{\r\n    root: string | string[];\r\n    button: string | string[];\r\n    status: string | string[];\r\n}>;\r\n\r\ndeclare type VoiceSearchHelper = {\r\n    getState: () => VoiceListeningState;\r\n    isBrowserSupported: () => boolean;\r\n    isListening: () => boolean;\r\n    startListening: () => void;\r\n    stopListening: () => void;\r\n    dispose: () => void;\r\n};\r\n\r\ndeclare type VoiceSearchHelperParams = {\r\n    searchAsYouSpeak: boolean;\r\n    language?: string;\r\n    onQueryChange: (query: string) => void;\r\n    onStateChange: () => void;\r\n};\r\n\r\ndeclare type VoiceSearchRenderState = {\r\n    isBrowserSupported: boolean;\r\n    isListening: boolean;\r\n    toggleListening: () => void;\r\n    voiceListeningState: VoiceListeningState;\r\n};\r\n\r\ndeclare type VoiceSearchTemplateProps = {\r\n    status: string;\r\n    errorCode: string;\r\n    isListening: boolean;\r\n    transcript: string;\r\n    isSpeechFinal: boolean;\r\n    isBrowserSupported: boolean;\r\n};\r\n\r\ndeclare type VoiceSearchTemplates = Partial<{\r\n    buttonText: Template<VoiceSearchTemplateProps>;\r\n    status: Template<VoiceSearchTemplateProps>;\r\n}>;\r\n\r\ndeclare type VoiceSearchWidget = WidgetFactory<VoiceSearchWidgetDescription & {\r\n    $$type: 'ais.voiceSearch';\r\n}, VoiceSearchConnectorParams, VoiceSearchWidgetParams>;\r\n\r\ndeclare type VoiceSearchWidgetDescription = {\r\n    $$type: 'ais.voiceSearch';\r\n    renderState: VoiceSearchRenderState;\r\n    indexRenderState: {\r\n        voiceSearch: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams>;\r\n    };\r\n    indexUiState: {\r\n        query: string;\r\n    };\r\n};\r\n\r\ndeclare type VoiceSearchWidgetParams = {\r\n    container: string | HTMLElement;\r\n    cssClasses?: VoiceSearchCSSClasses;\r\n    templates?: VoiceSearchTemplates;\r\n    searchAsYouSpeak?: boolean;\r\n    language?: string;\r\n    additionalQueryParameters?: (params: {\r\n        query: string;\r\n    }) => PlainSearchParameters | void;\r\n    createVoiceSearchHelper?: CreateVoiceSearchHelper;\r\n};\r\n\r\ndeclare type Widget<TWidgetDescription extends WidgetDescription & WidgetParams = {\r\n    $$type: string;\r\n}> = Expand<RequiredWidgetLifeCycle<TWidgetDescription> & WidgetType<TWidgetDescription> & UiStateLifeCycle<TWidgetDescription> & RenderStateLifeCycle<TWidgetDescription>> & (SearchWidget<TWidgetDescription> | RecommendWidget<TWidgetDescription>);\r\n\r\ndeclare type WidgetDescription = {\r\n    $$type: string;\r\n    $$widgetType?: string;\r\n    renderState?: Record<string, unknown>;\r\n    indexRenderState?: Record<string, unknown>;\r\n    indexUiState?: Record<string, unknown>;\r\n};\r\n\r\n/**\r\n * The function that creates a new widget.\r\n */\r\ndeclare type WidgetFactory<TWidgetDescription extends WidgetDescription, TConnectorParams extends UnknownWidgetParams, TWidgetParams extends UnknownWidgetParams> = (\r\n/**\r\n * The params of the widget.\r\n */\r\nwidgetParams: TWidgetParams & TConnectorParams) => Widget<TWidgetDescription & {\r\n    widgetParams: TConnectorParams;\r\n}>;\r\n\r\ndeclare type WidgetParams = {\r\n    widgetParams?: UnknownWidgetParams;\r\n};\r\n\r\ndeclare type WidgetRenderState<TWidgetRenderState, TWidgetParams> = TWidgetRenderState & {\r\n    widgetParams: TWidgetParams;\r\n};\r\n\r\ndeclare type WidgetRenderStates = AnalyticsWidgetDescription['indexRenderState'] & PlacesWidgetDescription['indexRenderState'];\r\n\r\ndeclare namespace widgets {\r\n    export {\r\n        EXPERIMENTAL_answers,\r\n        EXPERIMENTAL_configureRelatedItems,\r\n        EXPERIMENTAL_dynamicWidgets,\r\n        dynamicWidgets,\r\n        analytics,\r\n        breadcrumb,\r\n        clearRefinements,\r\n        configure,\r\n        currentRefinements,\r\n        _default_8 as geoSearch,\r\n        hierarchicalMenu,\r\n        _default_9 as hits,\r\n        hitsPerPage,\r\n        index,\r\n        IndexWidget,\r\n        _default_10 as infiniteHits,\r\n        menu,\r\n        menuSelect,\r\n        numericMenu,\r\n        pagination,\r\n        panel,\r\n        _default_11 as places,\r\n        poweredBy,\r\n        queryRuleContext,\r\n        queryRuleCustomData,\r\n        _default_12 as relatedProducts,\r\n        rangeInput,\r\n        rangeSlider,\r\n        ratingMenu,\r\n        refinementList,\r\n        relevantSort,\r\n        searchBox,\r\n        sortBy,\r\n        stats,\r\n        toggleRefinement,\r\n        _default_13 as trendingItems,\r\n        voiceSearch,\r\n        _default_14 as frequentlyBoughtTogether,\r\n        _default_15 as lookingSimilar\r\n    }\r\n}\r\n\r\ndeclare type WidgetType<TWidgetDescription extends WidgetDescription> = TWidgetDescription extends RequiredKeys<WidgetDescription, '$$widgetType'> ? RequiredWidgetType<TWidgetDescription> : {\r\n    /**\r\n     * Identifier for widgets.\r\n     */\r\n    $$widgetType?: string;\r\n};\r\n\r\ndeclare type WidgetUiStates = PlacesWidgetDescription['indexUiState'];\r\n\r\ndeclare type Write<THit extends NonNullable<object>> = ({ state, hits, }: {\r\n    state: PlainSearchParameters;\r\n    hits: InfiniteHitsCachedHits<THit>;\r\n}) => void;\r\n\r\nexport { }\r\n"
  },
  {
    "path": "js/instantsearch.js/es/components/Answers/Answers.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { ComponentCSSClasses, Hit } from '../../types';\nimport type { AnswersCSSClasses, AnswersTemplates } from '../../widgets/answers/answers';\nexport type AnswersComponentCSSClasses = ComponentCSSClasses<AnswersCSSClasses>;\nexport type AnswersComponentTemplates = Required<AnswersTemplates>;\nexport type AnswersProps = {\n    hits: Hit[];\n    isLoading: boolean;\n    cssClasses: AnswersComponentCSSClasses;\n    templateProps: {\n        [key: string]: any;\n        templates: AnswersComponentTemplates;\n    };\n};\ndeclare const Answers: ({ hits, isLoading, cssClasses, templateProps, }: AnswersProps) => h.JSX.Element;\nexport default Answers;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/Answers/Answers.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h } from 'preact';\nimport { warning } from \"../../lib/utils/index.js\";\nimport Template from \"../Template/Template.js\";\nvar Answers = function Answers(_ref) {\n  var hits = _ref.hits,\n    isLoading = _ref.isLoading,\n    cssClasses = _ref.cssClasses,\n    templateProps = _ref.templateProps;\n  return h(\"div\", {\n    className: cx(cssClasses.root, hits.length === 0 && cssClasses.emptyRoot)\n  }, h(Template, _extends({}, templateProps, {\n    templateKey: \"header\",\n    rootProps: {\n      className: cssClasses.header\n    },\n    data: {\n      hits: hits,\n      isLoading: isLoading\n    }\n  })), isLoading ? h(Template, _extends({}, templateProps, {\n    templateKey: \"loader\",\n    rootProps: {\n      className: cssClasses.loader\n    }\n  })) : h(\"ul\", {\n    className: cssClasses.list\n  }, hits.map(function (hit, index) {\n    return h(Template, _extends({}, templateProps, {\n      templateKey: \"item\",\n      rootTagName: \"li\",\n      rootProps: {\n        className: cssClasses.item\n      },\n      key: hit.objectID,\n      data: _objectSpread(_objectSpread({}, hit), {}, {\n        get __hitIndex() {\n          process.env.NODE_ENV === 'development' ? warning(false, 'The `__hitIndex` property is deprecated. Use the absolute `__position` instead.') : void 0;\n          return index;\n        }\n      })\n    }));\n  })));\n};\nexport default Answers;"
  },
  {
    "path": "js/instantsearch.js/es/components/Breadcrumb/Breadcrumb.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { BreadcrumbConnectorParamsItem } from '../../connectors/breadcrumb/connectBreadcrumb';\nimport type { PreparedTemplateProps } from '../../lib/templating';\nimport type { ComponentCSSClasses } from '../../types';\nimport type { BreadcrumbCSSClasses, BreadcrumbTemplates } from '../../widgets/breadcrumb/breadcrumb';\nexport type BreadcrumbComponentCSSClasses = ComponentCSSClasses<BreadcrumbCSSClasses>;\nexport type BreadcrumbComponentTemplates = Required<BreadcrumbTemplates>;\nexport type BreadcrumbProps = {\n    items: BreadcrumbConnectorParamsItem[];\n    cssClasses: BreadcrumbComponentCSSClasses;\n    templateProps: PreparedTemplateProps<BreadcrumbComponentTemplates>;\n    createURL: (value: BreadcrumbConnectorParamsItem['value']) => string;\n    refine: (value: BreadcrumbConnectorParamsItem['value']) => void;\n    canRefine?: boolean;\n};\ndeclare const Breadcrumb: ({ items, cssClasses, templateProps, createURL, refine, }: BreadcrumbProps) => h.JSX.Element;\nexport default Breadcrumb;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/Breadcrumb/Breadcrumb.js",
    "content": "function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h } from 'preact';\nimport { isSpecialClick } from \"../../lib/utils/index.js\";\nimport Template from \"../Template/Template.js\";\nvar Breadcrumb = function Breadcrumb(_ref) {\n  var items = _ref.items,\n    cssClasses = _ref.cssClasses,\n    templateProps = _ref.templateProps,\n    createURL = _ref.createURL,\n    refine = _ref.refine;\n  return h(\"div\", {\n    className: cx(cssClasses.root, items.length === 0 && cssClasses.noRefinementRoot)\n  }, h(\"ul\", {\n    className: cssClasses.list\n  }, h(\"li\", {\n    className: cx(cssClasses.item, items.length === 0 && cssClasses.selectedItem)\n  }, h(Template, _extends({}, templateProps, {\n    templateKey: \"home\",\n    rootTagName: \"a\",\n    rootProps: {\n      className: cssClasses.link,\n      href: createURL(null),\n      onClick: function onClick(event) {\n        if (isSpecialClick(event)) {\n          return;\n        }\n        event.preventDefault();\n        refine(null);\n      }\n    }\n  }))), items.map(function (item, idx) {\n    var isLast = idx === items.length - 1;\n    return h(\"li\", {\n      key: item.label + idx,\n      className: cx(cssClasses.item, isLast && cssClasses.selectedItem)\n    }, h(Template, _extends({}, templateProps, {\n      templateKey: \"separator\",\n      rootTagName: \"span\",\n      rootProps: {\n        className: cssClasses.separator,\n        'aria-hidden': true\n      }\n    })), isLast ? item.label : h(\"a\", {\n      className: cssClasses.link,\n      href: createURL(item.value),\n      onClick: function onClick(event) {\n        if (isSpecialClick(event)) {\n          return;\n        }\n        event.preventDefault();\n        refine(item.value);\n      }\n    }, item.label));\n  })));\n};\nexport default Breadcrumb;"
  },
  {
    "path": "js/instantsearch.js/es/components/ClearRefinements/ClearRefinements.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { ClearRefinementsRenderState } from '../../connectors/clear-refinements/connectClearRefinements';\nimport type { PreparedTemplateProps } from '../../lib/templating';\nimport type { ComponentCSSClasses } from '../../types';\nimport type { ClearRefinementsCSSClasses, ClearRefinementsTemplates } from '../../widgets/clear-refinements/clear-refinements';\nexport type ClearRefinementsComponentCSSClasses = ComponentCSSClasses<ClearRefinementsCSSClasses>;\nexport type ClearRefinementsComponentTemplates = Required<ClearRefinementsTemplates>;\nexport type ClearRefinementsProps = {\n    refine: ClearRefinementsRenderState['refine'];\n    cssClasses: ClearRefinementsComponentCSSClasses;\n    hasRefinements: ClearRefinementsRenderState['hasRefinements'];\n    templateProps: PreparedTemplateProps<ClearRefinementsComponentTemplates>;\n};\ndeclare const ClearRefinements: ({ hasRefinements, refine, cssClasses, templateProps, }: ClearRefinementsProps) => h.JSX.Element;\nexport default ClearRefinements;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/ClearRefinements/ClearRefinements.js",
    "content": "function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h } from 'preact';\nimport Template from \"../Template/Template.js\";\nvar ClearRefinements = function ClearRefinements(_ref) {\n  var hasRefinements = _ref.hasRefinements,\n    refine = _ref.refine,\n    cssClasses = _ref.cssClasses,\n    templateProps = _ref.templateProps;\n  return h(\"div\", {\n    className: cssClasses.root\n  }, h(Template, _extends({}, templateProps, {\n    templateKey: \"resetLabel\",\n    rootTagName: \"button\",\n    rootProps: {\n      className: cx(cssClasses.button, !hasRefinements && cssClasses.disabledButton),\n      onClick: refine,\n      disabled: !hasRefinements\n    },\n    data: {\n      hasRefinements: hasRefinements\n    }\n  })));\n};\nexport default ClearRefinements;"
  },
  {
    "path": "js/instantsearch.js/es/components/CurrentRefinements/CurrentRefinements.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { CurrentRefinementsConnectorParamsItem } from '../../connectors/current-refinements/connectCurrentRefinements';\nimport type { ComponentCSSClasses } from '../../types';\nimport type { CurrentRefinementsCSSClasses } from '../../widgets/current-refinements/current-refinements';\nexport type CurrentRefinementsComponentCSSClasses = ComponentCSSClasses<CurrentRefinementsCSSClasses>;\nexport type CurrentRefinementsProps = {\n    items: CurrentRefinementsConnectorParamsItem[];\n    cssClasses: CurrentRefinementsComponentCSSClasses;\n    canRefine: boolean;\n};\ndeclare const CurrentRefinements: ({ items, cssClasses, canRefine, }: CurrentRefinementsProps) => h.JSX.Element;\nexport default CurrentRefinements;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/CurrentRefinements/CurrentRefinements.js",
    "content": "import { cx } from 'instantsearch-ui-components';\nimport { h } from 'preact';\nimport { isSpecialClick, capitalize } from \"../../lib/utils/index.js\";\nvar createItemKey = function createItemKey(_ref) {\n  var attribute = _ref.attribute,\n    value = _ref.value,\n    type = _ref.type,\n    operator = _ref.operator;\n  return [attribute, type, value, operator].map(function (key) {\n    return key;\n  }).filter(Boolean).join(':');\n};\nvar handleClick = function handleClick(callback) {\n  return function (event) {\n    if (isSpecialClick(event)) {\n      return;\n    }\n    event.preventDefault();\n    callback();\n  };\n};\nvar CurrentRefinements = function CurrentRefinements(_ref2) {\n  var items = _ref2.items,\n    cssClasses = _ref2.cssClasses,\n    canRefine = _ref2.canRefine;\n  return h(\"div\", {\n    className: cx(cssClasses.root, !canRefine && cssClasses.noRefinementRoot)\n  }, h(\"ul\", {\n    className: cssClasses.list\n  }, items.map(function (item, index) {\n    return h(\"li\", {\n      key: \"\".concat(item.indexName, \"-\").concat(item.attribute, \"-\").concat(index),\n      className: cssClasses.item\n    }, h(\"span\", {\n      className: cssClasses.label\n    }, capitalize(item.label), \": \"), item.refinements.map(function (refinement) {\n      return h(\"span\", {\n        key: createItemKey(refinement),\n        className: cssClasses.category\n      }, h(\"span\", {\n        className: cssClasses.categoryLabel\n      }, refinement.attribute === 'query' ? h(\"q\", null, refinement.label) : refinement.label), h(\"button\", {\n        className: cssClasses.delete,\n        type: \"button\",\n        onClick: handleClick(item.refine.bind(null, refinement))\n      }, \"\\u2715\"));\n    }));\n  })));\n};\nexport default CurrentRefinements;"
  },
  {
    "path": "js/instantsearch.js/es/components/GeoSearchControls/GeoSearchButton.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { ComponentChildren } from 'preact';\ntype Props = {\n    className: string;\n    onClick: (event: MouseEvent) => void;\n    children: ComponentChildren;\n    disabled?: boolean;\n};\ndeclare const GeoSearchButton: ({ className, disabled, onClick, children, }: Props) => h.JSX.Element;\nexport default GeoSearchButton;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/GeoSearchControls/GeoSearchButton.js",
    "content": "import { h } from 'preact';\nvar GeoSearchButton = function GeoSearchButton(_ref) {\n  var className = _ref.className,\n    _ref$disabled = _ref.disabled,\n    disabled = _ref$disabled === void 0 ? false : _ref$disabled,\n    onClick = _ref.onClick,\n    children = _ref.children;\n  return h(\"button\", {\n    className: className,\n    onClick: onClick,\n    disabled: disabled\n  }, children);\n};\nexport default GeoSearchButton;"
  },
  {
    "path": "js/instantsearch.js/es/components/GeoSearchControls/GeoSearchControls.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { PreparedTemplateProps } from '../../lib/templating';\nimport type { ComponentCSSClasses } from '../../types';\nimport type { GeoSearchCSSClasses, GeoSearchTemplates } from '../../widgets/geo-search/geo-search';\ntype Props = {\n    cssClasses: ComponentCSSClasses<GeoSearchCSSClasses>;\n    enableRefine: boolean;\n    enableRefineControl: boolean;\n    enableClearMapRefinement: boolean;\n    isRefineOnMapMove: boolean;\n    isRefinedWithMap: boolean;\n    hasMapMoveSinceLastRefine: boolean;\n    onRefineToggle: (event: Event) => void;\n    onRefineClick: (event: MouseEvent) => void;\n    onClearClick: (event: MouseEvent) => void;\n    templateProps: PreparedTemplateProps<GeoSearchTemplates>;\n};\ndeclare const GeoSearchControls: ({ cssClasses, enableRefine, enableRefineControl, enableClearMapRefinement, isRefineOnMapMove, isRefinedWithMap, hasMapMoveSinceLastRefine, onRefineToggle, onRefineClick, onClearClick, templateProps, }: Props) => h.JSX.Element;\nexport default GeoSearchControls;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/GeoSearchControls/GeoSearchControls.js",
    "content": "function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, Fragment } from 'preact';\nimport Template from \"../Template/Template.js\";\nimport GeoSearchButton from \"./GeoSearchButton.js\";\nimport GeoSearchToggle from \"./GeoSearchToggle.js\";\nvar GeoSearchControls = function GeoSearchControls(_ref) {\n  var cssClasses = _ref.cssClasses,\n    enableRefine = _ref.enableRefine,\n    enableRefineControl = _ref.enableRefineControl,\n    enableClearMapRefinement = _ref.enableClearMapRefinement,\n    isRefineOnMapMove = _ref.isRefineOnMapMove,\n    isRefinedWithMap = _ref.isRefinedWithMap,\n    hasMapMoveSinceLastRefine = _ref.hasMapMoveSinceLastRefine,\n    onRefineToggle = _ref.onRefineToggle,\n    onRefineClick = _ref.onRefineClick,\n    onClearClick = _ref.onClearClick,\n    templateProps = _ref.templateProps;\n  return h(Fragment, null, enableRefine && h(\"div\", null, enableRefineControl && h(\"div\", {\n    className: cssClasses.control\n  }, isRefineOnMapMove || !hasMapMoveSinceLastRefine ? h(GeoSearchToggle, {\n    classNameLabel: cx(cssClasses.label, isRefineOnMapMove && cssClasses.selectedLabel),\n    classNameInput: cssClasses.input,\n    checked: isRefineOnMapMove,\n    onToggle: onRefineToggle\n  }, h(Template, _extends({}, templateProps, {\n    templateKey: \"toggle\",\n    rootTagName: \"span\"\n  }))) : h(GeoSearchButton, {\n    className: cssClasses.redo,\n    disabled: !hasMapMoveSinceLastRefine,\n    onClick: onRefineClick\n  }, h(Template, _extends({}, templateProps, {\n    templateKey: \"redo\",\n    rootTagName: \"span\"\n  })))), !enableRefineControl && !isRefineOnMapMove && h(\"div\", {\n    className: cssClasses.control\n  }, h(GeoSearchButton, {\n    className: cx(cssClasses.redo, !hasMapMoveSinceLastRefine && cssClasses.disabledRedo),\n    disabled: !hasMapMoveSinceLastRefine,\n    onClick: onRefineClick\n  }, h(Template, _extends({}, templateProps, {\n    templateKey: \"redo\",\n    rootTagName: \"span\"\n  })))), enableClearMapRefinement && isRefinedWithMap && h(GeoSearchButton, {\n    className: cssClasses.reset,\n    onClick: onClearClick\n  }, h(Template, _extends({}, templateProps, {\n    templateKey: \"reset\",\n    rootTagName: \"span\"\n  })))));\n};\nexport default GeoSearchControls;"
  },
  {
    "path": "js/instantsearch.js/es/components/GeoSearchControls/GeoSearchToggle.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { ComponentChildren } from 'preact';\ntype Props = {\n    classNameLabel: string;\n    classNameInput: string;\n    checked: boolean;\n    onToggle: (event: Event) => void;\n    children: ComponentChildren;\n};\ndeclare const GeoSearchToggle: ({ classNameLabel, classNameInput, checked, onToggle, children, }: Props) => h.JSX.Element;\nexport default GeoSearchToggle;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/GeoSearchControls/GeoSearchToggle.js",
    "content": "import { h } from 'preact';\nvar GeoSearchToggle = function GeoSearchToggle(_ref) {\n  var classNameLabel = _ref.classNameLabel,\n    classNameInput = _ref.classNameInput,\n    checked = _ref.checked,\n    onToggle = _ref.onToggle,\n    children = _ref.children;\n  return h(\"label\", {\n    className: classNameLabel\n  }, h(\"input\", {\n    className: classNameInput,\n    type: \"checkbox\",\n    checked: checked,\n    onChange: onToggle\n  }), children);\n};\nexport default GeoSearchToggle;"
  },
  {
    "path": "js/instantsearch.js/es/components/Highlight/Highlight.d.ts",
    "content": "import { h } from 'preact';\nimport type { HighlightProps as InternalHighlightProps, HighlightClassNames as InternalHighlightClassNames } from 'instantsearch-ui-components';\nexport type HighlightClassNames = InternalHighlightClassNames;\nexport type HighlightProps = Omit<InternalHighlightProps, 'classNames'> & {\n    classNames?: Partial<HighlightClassNames>;\n};\nexport declare function Highlight({ classNames, ...props }: HighlightProps): h.JSX.Element;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/Highlight/Highlight.js",
    "content": "var _excluded = [\"classNames\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport { cx } from 'instantsearch-ui-components';\nimport { h } from 'preact';\nimport { InternalHighlight } from \"../InternalHighlight/InternalHighlight.js\";\nexport function Highlight(_ref) {\n  var _ref$classNames = _ref.classNames,\n    classNames = _ref$classNames === void 0 ? {} : _ref$classNames,\n    props = _objectWithoutProperties(_ref, _excluded);\n  return h(InternalHighlight, _extends({\n    classNames: {\n      root: cx('ais-Highlight', classNames.root),\n      highlighted: cx('ais-Highlight-highlighted', classNames.highlighted),\n      nonHighlighted: cx('ais-Highlight-nonHighlighted', classNames.nonHighlighted),\n      separator: cx('ais-Highlight-separator', classNames.separator)\n    }\n  }, props));\n}"
  },
  {
    "path": "js/instantsearch.js/es/components/Hits/Hits.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { PreparedTemplateProps } from '../../lib/templating';\nimport type { BindEventForHits, SendEventForHits } from '../../lib/utils';\nimport type { ComponentCSSClasses, Hit, InsightsClient } from '../../types';\nimport type { HitsCSSClasses, HitsTemplates } from '../../widgets/hits/hits';\nimport type { SearchResults } from 'algoliasearch-helper';\nexport type HitsComponentCSSClasses = ComponentCSSClasses<HitsCSSClasses>;\nexport type HitsComponentTemplates = Required<HitsTemplates>;\nexport type HitsProps = {\n    results: SearchResults;\n    hits: Hit[];\n    insights?: InsightsClient;\n    sendEvent: SendEventForHits;\n    bindEvent: BindEventForHits;\n    cssClasses: HitsComponentCSSClasses;\n    templateProps: PreparedTemplateProps<HitsComponentTemplates>;\n};\nexport default function Hits({ results, hits, insights, bindEvent, sendEvent, cssClasses, templateProps, }: HitsProps): h.JSX.Element;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/Hits/Hits.js",
    "content": "function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport { cx } from '@algolia/ui-components-shared';\nimport { h } from 'preact';\nimport { createInsightsEventHandler } from \"../../lib/insights/listener.js\";\nimport { warning } from \"../../lib/utils/index.js\";\nimport Template from \"../Template/Template.js\";\nexport default function Hits(_ref) {\n  var results = _ref.results,\n    hits = _ref.hits,\n    insights = _ref.insights,\n    bindEvent = _ref.bindEvent,\n    sendEvent = _ref.sendEvent,\n    cssClasses = _ref.cssClasses,\n    templateProps = _ref.templateProps;\n  var handleInsightsClick = createInsightsEventHandler({\n    insights: insights,\n    sendEvent: sendEvent\n  });\n  if (results.hits.length === 0) {\n    return h(Template, _extends({}, templateProps, {\n      templateKey: \"empty\",\n      rootProps: {\n        className: cx(cssClasses.root, cssClasses.emptyRoot),\n        onClick: handleInsightsClick\n      },\n      data: results\n    }));\n  }\n  return h(\"div\", {\n    className: cssClasses.root\n  }, h(\"ol\", {\n    className: cssClasses.list\n  }, hits.map(function (hit, index) {\n    return h(Template, _extends({}, templateProps, {\n      templateKey: \"item\",\n      rootTagName: \"li\",\n      rootProps: {\n        className: cssClasses.item,\n        onClick: function onClick(event) {\n          handleInsightsClick(event);\n          sendEvent('click:internal', hit, 'Hit Clicked');\n        },\n        onAuxClick: function onAuxClick(event) {\n          handleInsightsClick(event);\n          sendEvent('click:internal', hit, 'Hit Clicked');\n        }\n      },\n      key: hit.objectID,\n      data: _objectSpread(_objectSpread({}, hit), {}, {\n        get __hitIndex() {\n          process.env.NODE_ENV === 'development' ? warning(false, 'The `__hitIndex` property is deprecated. Use the absolute `__position` instead.') : void 0;\n          return index;\n        }\n      }),\n      bindEvent: bindEvent,\n      sendEvent: sendEvent\n    }));\n  })));\n}"
  },
  {
    "path": "js/instantsearch.js/es/components/InfiniteHits/InfiniteHits.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { SendEventForHits, BindEventForHits } from '../../lib/utils';\nimport type { ComponentCSSClasses, Hit, InsightsClient } from '../../types';\nimport type { InfiniteHitsCSSClasses, InfiniteHitsTemplates } from '../../widgets/infinite-hits/infinite-hits';\nimport type { Banner, SearchResults } from 'algoliasearch-helper';\nexport type InfiniteHitsComponentCSSClasses = ComponentCSSClasses<InfiniteHitsCSSClasses>;\nexport type InfiniteHitsComponentTemplates = InfiniteHitsTemplates;\nexport type InfiniteHitsProps = {\n    cssClasses: InfiniteHitsComponentCSSClasses;\n    hits: Hit[];\n    results: SearchResults;\n    hasShowPrevious: boolean;\n    showPrevious: () => void;\n    showMore: () => void;\n    templateProps: {\n        [key: string]: any;\n        templates: InfiniteHitsComponentTemplates;\n    };\n    isFirstPage: boolean;\n    isLastPage: boolean;\n    insights?: InsightsClient;\n    sendEvent: SendEventForHits;\n    bindEvent: BindEventForHits;\n    banner?: Banner;\n};\ndeclare const InfiniteHits: ({ results, hits, insights, bindEvent, sendEvent, hasShowPrevious, showPrevious, showMore, isFirstPage, isLastPage, cssClasses, templateProps, banner, }: InfiniteHitsProps) => h.JSX.Element;\nexport default InfiniteHits;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/InfiniteHits/InfiniteHits.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h } from 'preact';\nimport { createInsightsEventHandler } from \"../../lib/insights/listener.js\";\nimport { warning } from \"../../lib/utils/index.js\";\nimport Template from \"../Template/Template.js\";\nvar DefaultBanner = function DefaultBanner(_ref) {\n  var banner = _ref.banner,\n    classNames = _ref.classNames;\n  if (!banner.image.urls[0].url) {\n    return null;\n  }\n  return h(\"aside\", {\n    className: cx(classNames.bannerRoot)\n  }, banner.link ? h(\"a\", {\n    className: cx(classNames.bannerLink),\n    href: banner.link.url,\n    target: banner.link.target\n  }, h(\"img\", {\n    className: cx(classNames.bannerImage),\n    src: banner.image.urls[0].url,\n    alt: banner.image.title\n  })) : h(\"img\", {\n    className: cx(classNames.bannerImage),\n    src: banner.image.urls[0].url,\n    alt: banner.image.title\n  }));\n};\nvar InfiniteHits = function InfiniteHits(_ref2) {\n  var results = _ref2.results,\n    hits = _ref2.hits,\n    insights = _ref2.insights,\n    bindEvent = _ref2.bindEvent,\n    sendEvent = _ref2.sendEvent,\n    hasShowPrevious = _ref2.hasShowPrevious,\n    showPrevious = _ref2.showPrevious,\n    showMore = _ref2.showMore,\n    isFirstPage = _ref2.isFirstPage,\n    isLastPage = _ref2.isLastPage,\n    cssClasses = _ref2.cssClasses,\n    templateProps = _ref2.templateProps,\n    banner = _ref2.banner;\n  var handleInsightsClick = createInsightsEventHandler({\n    insights: insights,\n    sendEvent: sendEvent\n  });\n  if (results.hits.length === 0) {\n    return h(\"div\", {\n      className: cx(cssClasses.root, cssClasses.emptyRoot),\n      onClick: handleInsightsClick\n    }, banner && (templateProps.templates.banner ? h(Template, _extends({}, templateProps, {\n      templateKey: \"banner\",\n      rootTagName: \"fragment\",\n      data: {\n        banner: banner,\n        className: cssClasses.bannerRoot\n      }\n    })) : h(DefaultBanner, {\n      banner: banner,\n      classNames: cssClasses\n    })), h(Template, _extends({}, templateProps, {\n      templateKey: \"empty\",\n      rootTagName: \"fragment\",\n      data: results\n    })));\n  }\n  return h(\"div\", {\n    className: cssClasses.root\n  }, hasShowPrevious && h(Template, _extends({}, templateProps, {\n    templateKey: \"showPreviousText\",\n    rootTagName: \"button\",\n    rootProps: {\n      className: cx(cssClasses.loadPrevious, isFirstPage && cssClasses.disabledLoadPrevious),\n      disabled: isFirstPage,\n      onClick: showPrevious\n    }\n  })), banner && (templateProps.templates.banner ? h(Template, _extends({}, templateProps, {\n    templateKey: \"banner\",\n    rootTagName: \"fragment\",\n    data: {\n      banner: banner,\n      className: cssClasses.bannerRoot\n    }\n  })) : h(DefaultBanner, {\n    banner: banner,\n    classNames: cssClasses\n  })), h(\"ol\", {\n    className: cssClasses.list\n  }, hits.map(function (hit, index) {\n    return h(Template, _extends({}, templateProps, {\n      templateKey: \"item\",\n      rootTagName: \"li\",\n      rootProps: {\n        className: cssClasses.item,\n        onClick: function onClick(event) {\n          handleInsightsClick(event);\n          sendEvent('click:internal', hit, 'Hit Clicked');\n        },\n        onAuxClick: function onAuxClick(event) {\n          handleInsightsClick(event);\n          sendEvent('click:internal', hit, 'Hit Clicked');\n        }\n      },\n      key: hit.objectID,\n      data: _objectSpread(_objectSpread({}, hit), {}, {\n        get __hitIndex() {\n          process.env.NODE_ENV === 'development' ? warning(false, 'The `__hitIndex` property is deprecated. Use the absolute `__position` instead.') : void 0;\n          return index;\n        }\n      }),\n      bindEvent: bindEvent,\n      sendEvent: sendEvent\n    }));\n  })), h(Template, _extends({}, templateProps, {\n    templateKey: \"showMoreText\",\n    rootTagName: \"button\",\n    rootProps: {\n      className: cx(cssClasses.loadMore, isLastPage && cssClasses.disabledLoadMore),\n      disabled: isLastPage,\n      onClick: showMore\n    }\n  })));\n};\nexport default InfiniteHits;"
  },
  {
    "path": "js/instantsearch.js/es/components/InternalHighlight/InternalHighlight.d.ts",
    "content": "export declare const InternalHighlight: (userProps: import(\"instantsearch-ui-components\").HighlightProps) => JSX.Element;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/InternalHighlight/InternalHighlight.js",
    "content": "import { createHighlightComponent } from 'instantsearch-ui-components';\nimport { createElement, Fragment } from 'preact';\nexport var InternalHighlight = createHighlightComponent({\n  createElement: createElement,\n  Fragment: Fragment\n});"
  },
  {
    "path": "js/instantsearch.js/es/components/MenuSelect/MenuSelect.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { MenuRenderState } from '../../connectors/menu/connectMenu';\nimport type { ComponentCSSClasses } from '../../types';\nimport type { MenuSelectCSSClasses, MenuSelectTemplates } from '../../widgets/menu-select/menu-select';\nexport type MenuSelectComponentCSSClasses = ComponentCSSClasses<MenuSelectCSSClasses>;\nexport type MenuSelectComponentTemplates = Required<MenuSelectTemplates>;\ntype MenuItem = {\n    /**\n     * The value of the menu item.\n     **/\n    value: string;\n    /**\n     * Human-readable value of the menu item.\n     **/\n    label: string;\n    /**\n     * Number of results matched after refinement is applied.\n     **/\n    count: number;\n    /**\n     * Indicates if the refinement is applied.\n     **/\n    isRefined: boolean;\n};\ntype Props = {\n    cssClasses: MenuSelectComponentCSSClasses;\n    items: MenuItem[];\n    refine: MenuRenderState['refine'];\n    templateProps: {\n        templates: MenuSelectComponentTemplates;\n    };\n};\ndeclare function MenuSelect({ cssClasses, templateProps, items, refine }: Props): h.JSX.Element;\nexport default MenuSelect;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/MenuSelect/MenuSelect.js",
    "content": "function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h } from 'preact';\nimport { find } from \"../../lib/utils/index.js\";\nimport Template from \"../Template/Template.js\";\nfunction MenuSelect(_ref) {\n  var cssClasses = _ref.cssClasses,\n    templateProps = _ref.templateProps,\n    items = _ref.items,\n    refine = _ref.refine;\n  var _ref2 = find(items, function (item) {\n      return item.isRefined;\n    }) || {\n      value: ''\n    },\n    selectedValue = _ref2.value;\n  return h(\"div\", {\n    className: cx(cssClasses.root, items.length === 0 && cssClasses.noRefinementRoot)\n  }, h(\"select\", {\n    className: cssClasses.select,\n    value: selectedValue,\n    onChange: function onChange(event) {\n      refine(event.target.value);\n    }\n  }, h(Template, _extends({}, templateProps, {\n    templateKey: \"defaultOption\",\n    rootTagName: \"option\",\n    rootProps: {\n      value: '',\n      className: cssClasses.option\n    }\n  })), items.map(function (item) {\n    return h(Template, _extends({}, templateProps, {\n      templateKey: \"item\",\n      rootTagName: \"option\",\n      rootProps: {\n        value: item.value,\n        className: cssClasses.option\n      },\n      key: item.value,\n      data: item\n    }));\n  })));\n}\nexport default MenuSelect;"
  },
  {
    "path": "js/instantsearch.js/es/components/Pagination/Pagination.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { ComponentCSSClasses } from '../../types';\nimport type { PaginationCSSClasses, PaginationTemplates } from '../../widgets/pagination/pagination';\nexport type PaginationComponentCSSClasses = ComponentCSSClasses<PaginationCSSClasses>;\nexport type PaginationComponentTemplates = Required<PaginationTemplates>;\nexport type PaginationProps = {\n    createURL: (value: number) => string;\n    cssClasses: PaginationComponentCSSClasses;\n    templates: PaginationComponentTemplates;\n    currentPage: number;\n    nbPages: number;\n    pages: number[];\n    isFirstPage: boolean;\n    isLastPage: boolean;\n    setCurrentPage: (value: number) => void;\n    showFirst?: boolean;\n    showLast?: boolean;\n    showPrevious?: boolean;\n    showNext?: boolean;\n};\ndeclare function Pagination(props: PaginationProps): h.JSX.Element;\nexport default Pagination;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/Pagination/Pagination.js",
    "content": "import { cx } from 'instantsearch-ui-components';\nimport { h } from 'preact';\nimport { isSpecialClick } from \"../../lib/utils/index.js\";\nimport Template from \"../Template/Template.js\";\nfunction Pagination(props) {\n  function createClickHandler(pageNumber) {\n    return function (event) {\n      if (isSpecialClick(event)) {\n        // do not alter the default browser behavior\n        // if one special key is down\n        return;\n      }\n      event.preventDefault();\n      props.setCurrentPage(pageNumber);\n    };\n  }\n  return h(\"div\", {\n    className: cx(props.cssClasses.root, props.nbPages <= 1 && props.cssClasses.noRefinementRoot)\n  }, h(\"ul\", {\n    className: props.cssClasses.list\n  }, props.showFirst && h(PaginationLink, {\n    ariaLabel: \"First Page\",\n    className: props.cssClasses.firstPageItem,\n    isDisabled: props.isFirstPage,\n    templates: props.templates,\n    templateKey: \"first\",\n    pageNumber: 0,\n    createURL: props.createURL,\n    cssClasses: props.cssClasses,\n    createClickHandler: createClickHandler\n  }), props.showPrevious && h(PaginationLink, {\n    ariaLabel: \"Previous Page\",\n    className: props.cssClasses.previousPageItem,\n    isDisabled: props.isFirstPage,\n    templates: props.templates,\n    templateKey: \"previous\",\n    pageNumber: props.currentPage - 1,\n    createURL: props.createURL,\n    cssClasses: props.cssClasses,\n    createClickHandler: createClickHandler\n  }), props.pages.map(function (pageNumber) {\n    return h(PaginationLink, {\n      key: pageNumber,\n      ariaLabel: \"Page \".concat(pageNumber + 1),\n      className: props.cssClasses.pageItem,\n      isSelected: pageNumber === props.currentPage,\n      templates: props.templates,\n      templateKey: \"page\",\n      pageNumber: pageNumber,\n      createURL: props.createURL,\n      cssClasses: props.cssClasses,\n      createClickHandler: createClickHandler\n    });\n  }), props.showNext && h(PaginationLink, {\n    ariaLabel: \"Next Page\",\n    className: props.cssClasses.nextPageItem,\n    isDisabled: props.isLastPage,\n    templates: props.templates,\n    templateKey: \"next\",\n    pageNumber: props.currentPage + 1,\n    createURL: props.createURL,\n    cssClasses: props.cssClasses,\n    createClickHandler: createClickHandler\n  }), props.showLast && h(PaginationLink, {\n    ariaLabel: \"Last Page, Page \".concat(props.nbPages),\n    className: props.cssClasses.lastPageItem,\n    isDisabled: props.isLastPage,\n    templates: props.templates,\n    templateKey: \"last\",\n    pageNumber: props.nbPages - 1,\n    createURL: props.createURL,\n    cssClasses: props.cssClasses,\n    createClickHandler: createClickHandler\n  })));\n}\nfunction PaginationLink(_ref) {\n  var templates = _ref.templates,\n    templateKey = _ref.templateKey,\n    ariaLabel = _ref.ariaLabel,\n    pageNumber = _ref.pageNumber,\n    className = _ref.className,\n    _ref$isDisabled = _ref.isDisabled,\n    isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,\n    _ref$isSelected = _ref.isSelected,\n    isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,\n    cssClasses = _ref.cssClasses,\n    createURL = _ref.createURL,\n    createClickHandler = _ref.createClickHandler;\n  return h(\"li\", {\n    className: cx(cssClasses.item, isDisabled && cssClasses.disabledItem, className, isSelected && cssClasses.selectedItem)\n  }, isDisabled ? h(Template, {\n    rootTagName: \"span\",\n    rootProps: {\n      className: cssClasses.link,\n      'aria-label': ariaLabel\n    },\n    templateKey: templateKey,\n    templates: templates,\n    data: {\n      page: pageNumber + 1\n    }\n  }) : h(Template, {\n    rootTagName: \"a\",\n    rootProps: {\n      className: cssClasses.link,\n      'aria-label': ariaLabel,\n      href: createURL(pageNumber),\n      onClick: createClickHandler(pageNumber)\n    },\n    templateKey: templateKey,\n    templates: templates,\n    data: {\n      page: pageNumber + 1\n    }\n  }));\n}\nexport default Pagination;"
  },
  {
    "path": "js/instantsearch.js/es/components/Pagination/PaginationLink.js",
    "content": "/** @jsx h */\nimport { h } from 'preact';\n\nvar PaginationLink = function PaginationLink(_ref) {\n  var cssClasses = _ref.cssClasses,\n      label = _ref.label,\n      ariaLabel = _ref.ariaLabel,\n      url = _ref.url,\n      isDisabled = _ref.isDisabled,\n      handleClick = _ref.handleClick,\n      pageNumber = _ref.pageNumber;\n\n  if (isDisabled) {\n    return h(\"li\", {\n      className: cssClasses.item\n    }, h(\"span\", {\n      className: cssClasses.link,\n      dangerouslySetInnerHTML: {\n        __html: label\n      }\n    }));\n  }\n\n  return h(\"li\", {\n    className: cssClasses.item\n  }, h(\"a\", {\n    className: cssClasses.link,\n    \"aria-label\": ariaLabel,\n    href: url,\n    onClick: function onClick(event) {\n      return handleClick(pageNumber, event);\n    },\n    dangerouslySetInnerHTML: {\n      __html: label\n    }\n  }));\n};\n\nexport default PaginationLink;"
  },
  {
    "path": "js/instantsearch.js/es/components/Panel/Panel.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { ComponentCSSClasses, UnknownWidgetFactory } from '../../types';\nimport type { PanelCSSClasses, PanelSharedOptions, PanelTemplates } from '../../widgets/panel/panel';\nexport type PanelComponentCSSClasses = ComponentCSSClasses<Omit<PanelCSSClasses, 'collapseIcon'>>;\nexport type PanelComponentTemplates<TWidget extends UnknownWidgetFactory> = PanelTemplates<TWidget>;\nexport type PanelProps<TWidget extends UnknownWidgetFactory> = {\n    hidden: boolean;\n    collapsible: boolean;\n    isCollapsed: boolean;\n    data: PanelSharedOptions<TWidget>;\n    cssClasses: PanelComponentCSSClasses;\n    templates: PanelComponentTemplates<TWidget>;\n    bodyElement: HTMLElement;\n};\ndeclare function Panel<TWidget extends UnknownWidgetFactory>(props: PanelProps<TWidget>): h.JSX.Element;\nexport default Panel;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/Panel/Panel.js",
    "content": "function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nimport { cx } from 'instantsearch-ui-components';\nimport { h } from 'preact';\nimport { useState, useEffect, useRef } from 'preact/hooks';\nimport Template from \"../Template/Template.js\";\nfunction Panel(props) {\n  var _useState = useState(props.isCollapsed),\n    _useState2 = _slicedToArray(_useState, 2),\n    isCollapsed = _useState2[0],\n    setIsCollapsed = _useState2[1];\n  var _useState3 = useState(false),\n    _useState4 = _slicedToArray(_useState3, 2),\n    isControlled = _useState4[0],\n    setIsControlled = _useState4[1];\n  var bodyRef = useRef(null);\n  useEffect(function () {\n    var node = bodyRef.current;\n    if (!node) {\n      return undefined;\n    }\n    node.appendChild(props.bodyElement);\n    return function () {\n      node.removeChild(props.bodyElement);\n    };\n  }, [bodyRef, props.bodyElement]);\n  if (!isControlled && props.isCollapsed !== isCollapsed) {\n    setIsCollapsed(props.isCollapsed);\n  }\n  return h(\"div\", {\n    className: cx(props.cssClasses.root, props.hidden && props.cssClasses.noRefinementRoot, props.collapsible && props.cssClasses.collapsibleRoot, isCollapsed && props.cssClasses.collapsedRoot),\n    hidden: props.hidden\n  }, props.templates.header && h(\"div\", {\n    className: props.cssClasses.header\n  }, h(Template, {\n    templates: props.templates,\n    templateKey: \"header\",\n    rootTagName: \"span\",\n    data: props.data\n  }), props.collapsible && h(\"button\", {\n    className: props.cssClasses.collapseButton,\n    \"aria-expanded\": !isCollapsed,\n    onClick: function onClick(event) {\n      event.preventDefault();\n      setIsControlled(true);\n      setIsCollapsed(function (prevIsCollapsed) {\n        return !prevIsCollapsed;\n      });\n    }\n  }, h(Template, {\n    templates: props.templates,\n    templateKey: \"collapseButtonText\",\n    rootTagName: \"span\",\n    data: {\n      collapsed: isCollapsed\n    }\n  }))), h(\"div\", {\n    className: props.cssClasses.body,\n    ref: bodyRef\n  }), props.templates.footer && h(Template, {\n    templates: props.templates,\n    templateKey: \"footer\",\n    rootProps: {\n      className: props.cssClasses.footer\n    },\n    data: props.data\n  }));\n}\nexport default Panel;"
  },
  {
    "path": "js/instantsearch.js/es/components/PoweredBy/PoweredBy.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { ComponentCSSClasses } from '../../types';\nimport type { PoweredByCSSClasses } from '../../widgets/powered-by/powered-by';\nexport type PoweredByComponentCSSClasses = ComponentCSSClasses<PoweredByCSSClasses>;\nexport type PoweredByProps = {\n    url: string;\n    theme: string;\n    cssClasses: PoweredByComponentCSSClasses;\n};\ndeclare const PoweredBy: ({ url, theme, cssClasses }: PoweredByProps) => h.JSX.Element;\nexport default PoweredBy;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/PoweredBy/PoweredBy.js",
    "content": "import { h } from 'preact';\nvar PoweredBy = function PoweredBy(_ref) {\n  var url = _ref.url,\n    theme = _ref.theme,\n    cssClasses = _ref.cssClasses;\n  return h(\"div\", {\n    className: cssClasses.root\n  }, h(\"a\", {\n    href: url,\n    target: \"_blank\",\n    className: cssClasses.link,\n    \"aria-label\": \"Search by Algolia\",\n    rel: \"noopener noreferrer\"\n  }, h(\"svg\", {\n    height: \"1.2em\",\n    className: cssClasses.logo,\n    viewBox: \"0 0 572 64\"\n    // This style is necessary as long as it's not included in InstantSearch.css.\n    // For now, InstantSearch.css sets a maximum width of 70px.\n    ,\n    style: {\n      width: 'auto'\n    }\n  }, h(\"path\", {\n    fill: theme === 'dark' ? '#FFF' : '#36395A',\n    d: \"M16 48.3c-3.4 0-6.3-.6-8.7-1.7A12.4 12.4 0 0 1 1.9 42C.6 40 0 38 0 35.4h6.5a6.7 6.7 0 0 0 3.9 6c1.4.7 3.3 1.1 5.6 1.1 2.2 0 4-.3 5.4-1a7 7 0 0 0 3-2.4 6 6 0 0 0 1-3.4c0-1.5-.6-2.8-1.9-3.7-1.3-1-3.3-1.6-5.9-1.8l-4-.4c-3.7-.3-6.6-1.4-8.8-3.4a10 10 0 0 1-3.3-7.9c0-2.4.6-4.6 1.8-6.4a12 12 0 0 1 5-4.3c2.2-1 4.7-1.6 7.5-1.6s5.5.5 7.6 1.6a12 12 0 0 1 5 4.4c1.2 1.8 1.8 4 1.8 6.7h-6.5a6.4 6.4 0 0 0-3.5-5.9c-1-.6-2.6-1-4.4-1s-3.2.3-4.4 1c-1.1.6-2 1.4-2.6 2.4-.5 1-.8 2-.8 3.1a5 5 0 0 0 1.5 3.6c1 1 2.6 1.7 4.7 1.9l4 .3c2.8.2 5.2.8 7.2 1.8 2.1 1 3.7 2.2 4.9 3.8a9.7 9.7 0 0 1 1.7 5.8c0 2.5-.7 4.7-2 6.6a13 13 0 0 1-5.6 4.4c-2.4 1-5.2 1.6-8.4 1.6Zm35.6 0c-2.6 0-4.8-.4-6.7-1.3a13 13 0 0 1-4.7-3.5 17.1 17.1 0 0 1-3.6-10.4v-1c0-2 .3-3.8 1-5.6a13 13 0 0 1 7.3-8.3 15 15 0 0 1 6.3-1.4A13.2 13.2 0 0 1 64 24.3c1 2.2 1.6 4.6 1.6 7.2V34H39.4v-4.3h21.8l-1.8 2.2c0-2-.3-3.7-.9-5.1a7.3 7.3 0 0 0-2.7-3.4c-1.2-.7-2.7-1.1-4.6-1.1s-3.4.4-4.7 1.3a8 8 0 0 0-2.9 3.6c-.6 1.5-.9 3.3-.9 5.4 0 2 .3 3.7 1 5.3a7.9 7.9 0 0 0 2.8 3.7c1.3.8 3 1.3 5 1.3s3.8-.5 5.1-1.3c1.3-1 2.1-2 2.4-3.2h6a11.8 11.8 0 0 1-7 8.7 16 16 0 0 1-6.4 1.2ZM80 48c-2.2 0-4-.3-5.7-1a8.4 8.4 0 0 1-3.7-3.3 9.7 9.7 0 0 1-1.3-5.2c0-2 .5-3.8 1.5-5.2a9 9 0 0 1 4.3-3.1c1.8-.7 4-1 6.7-1H89v4.1h-7.5c-2 0-3.4.5-4.4 1.4-1 1-1.6 2.1-1.6 3.6s.5 2.7 1.6 3.6c1 1 2.5 1.4 4.4 1.4 1.1 0 2.2-.2 3.2-.7 1-.4 1.9-1 2.6-2 .6-1 1-2.4 1-4.2l1.7 2.1c-.2 2-.7 3.8-1.5 5.2a9 9 0 0 1-3.4 3.3 12 12 0 0 1-5.3 1Zm9.5-.7v-8.8h-1v-10c0-1.8-.5-3.2-1.4-4.1-1-1-2.4-1.4-4.2-1.4a142.9 142.9 0 0 0-10.2.4v-5.6a74.8 74.8 0 0 1 8.6-.4c3 0 5.5.4 7.5 1.2s3.4 2 4.4 3.6c1 1.7 1.4 4 1.4 6.7v18.4h-5Zm12.9 0V17.8h5v12.3h-.2c0-4.2 1-7.4 2.8-9.5a11 11 0 0 1 8.3-3.1h1v5.6h-2a9 9 0 0 0-6.3 2.2c-1.5 1.5-2.2 3.6-2.2 6.4v15.6h-6.4Zm34.4 1a15 15 0 0 1-6.6-1.3c-1.9-.9-3.4-2-4.7-3.5a15.5 15.5 0 0 1-2.7-5c-.6-1.7-1-3.6-1-5.4v-1c0-2 .4-3.8 1-5.6a15 15 0 0 1 2.8-4.9c1.3-1.5 2.8-2.6 4.6-3.5a16.4 16.4 0 0 1 13.3.2c2 1 3.5 2.3 4.8 4a12 12 0 0 1 2 6H144c-.2-1.6-1-3-2.2-4.1a7.5 7.5 0 0 0-5.2-1.7 8 8 0 0 0-4.7 1.3 8 8 0 0 0-2.8 3.6 13.8 13.8 0 0 0 0 10.3c.6 1.5 1.5 2.7 2.8 3.6s2.8 1.3 4.8 1.3c1.5 0 2.7-.2 3.8-.8a7 7 0 0 0 2.6-2c.7-1 1-2 1.2-3.2h6.2a11 11 0 0 1-2 6.2 15.1 15.1 0 0 1-11.8 5.5Zm19.7-1v-40h6.4V31h-1.3c0-3 .4-5.5 1.1-7.6a9.7 9.7 0 0 1 3.5-4.8A9.9 9.9 0 0 1 172 17h.3c3.5 0 6 1.1 7.9 3.5 1.7 2.3 2.6 5.7 2.6 10v16.8h-6.4V29.6c0-2.1-.6-3.8-1.8-5a6.4 6.4 0 0 0-4.8-1.8c-2 0-3.7.7-5 2a7.8 7.8 0 0 0-1.9 5.5v17h-6.4Zm63.8 1a12.2 12.2 0 0 1-10.9-6.2 19 19 0 0 1-1.8-7.3h1.4v12.5h-5.1v-40h6.4v19.8l-2 3.5c.2-3.1.8-5.7 1.9-7.7a11 11 0 0 1 4.4-4.5c1.8-1 3.9-1.5 6.1-1.5a13.4 13.4 0 0 1 12.8 9.1c.7 1.9 1 3.8 1 6v1c0 2.2-.3 4.1-1 6a13.6 13.6 0 0 1-13.2 9.4Zm-1.2-5.5a8.4 8.4 0 0 0 7.9-5c.7-1.5 1.1-3.3 1.1-5.3s-.4-3.8-1.1-5.3a8.7 8.7 0 0 0-3.2-3.6 9.6 9.6 0 0 0-9.2-.2 8.5 8.5 0 0 0-3.3 3.2c-.8 1.4-1.3 3-1.3 5v2.3a9 9 0 0 0 1.3 4.8 9 9 0 0 0 3.4 3c1.4.7 2.8 1 4.4 1Zm27.3 3.9-10-28.9h6.5l9.5 28.9h-6Zm-7.5 12.2v-5.7h4.9c1 0 2-.1 2.9-.4a4 4 0 0 0 2-1.4c.4-.7.9-1.6 1.2-2.7l8.6-30.9h6.2l-9.3 32.4a14 14 0 0 1-2.5 5 8.9 8.9 0 0 1-4 2.8c-1.5.6-3.4.9-5.6.9h-4.4Zm9-12.2v-5.2h6.4v5.2H248Z\"\n  }), h(\"path\", {\n    fill: theme === 'dark' ? '#FFF' : '#003DFF',\n    d: \"M534.4 9.1H528a.8.8 0 0 1-.7-.7V1.8c0-.4.2-.7.6-.8l6.5-1c.4 0 .8.2.9.6v7.8c0 .4-.4.7-.8.7zM428 35.2V.8c0-.5-.3-.8-.7-.8h-.2l-6.4 1c-.4 0-.7.4-.7.8v35c0 1.6 0 11.8 12.3 12.2.5 0 .8-.4.8-.8V43c0-.4-.3-.7-.6-.8-4.5-.5-4.5-6-4.5-7zm106.5-21.8H528c-.4 0-.7.4-.7.8v34c0 .4.3.8.7.8h6.5c.4 0 .8-.4.8-.8v-34c0-.5-.4-.8-.8-.8zm-17.7 21.8V.8c0-.5-.3-.8-.8-.8l-6.5 1c-.4 0-.7.4-.7.8v35c0 1.6 0 11.8 12.3 12.2.4 0 .8-.4.8-.8V43c0-.4-.3-.7-.7-.8-4.4-.5-4.4-6-4.4-7zm-22.2-20.6a16.5 16.5 0 0 1 8.6 9.3c.8 2.2 1.3 4.8 1.3 7.5a19.4 19.4 0 0 1-4.6 12.6 14.8 14.8 0 0 1-5.2 3.6c-2 .9-5.2 1.4-6.8 1.4a21 21 0 0 1-6.7-1.4 15.4 15.4 0 0 1-8.6-9.3 21.3 21.3 0 0 1 0-14.4 15.2 15.2 0 0 1 8.6-9.3c2-.8 4.3-1.2 6.7-1.2s4.6.4 6.7 1.2zm-6.7 27.6c2.7 0 4.7-1 6.2-3s2.2-4.3 2.2-7.8-.7-6.3-2.2-8.3-3.5-3-6.2-3-4.7 1-6.1 3c-1.5 2-2.2 4.8-2.2 8.3s.7 5.8 2.2 7.8 3.5 3 6.2 3zm-88.8-28.8c-6.2 0-11.7 3.3-14.8 8.2a18.6 18.6 0 0 0 4.8 25.2c1.8 1.2 4 1.8 6.2 1.7s.1 0 .1 0h.9c4.2-.7 8-4 9.1-8.1v7.4c0 .4.3.7.8.7h6.4a.7.7 0 0 0 .7-.7V14.2c0-.5-.3-.8-.7-.8h-13.5zm6.3 26.5a9.8 9.8 0 0 1-5.7 2h-.5a10 10 0 0 1-9.2-14c1.4-3.7 5-6.3 9-6.3h6.4v18.3zm152.3-26.5h13.5c.5 0 .8.3.8.7v33.7c0 .4-.3.7-.8.7h-6.4a.7.7 0 0 1-.8-.7v-7.4c-1.2 4-4.8 7.4-9 8h-.1a4.2 4.2 0 0 1-.5.1h-.9a10.3 10.3 0 0 1-7-2.6c-4-3.3-6.5-8.4-6.5-14.2 0-3.7 1-7.2 3-10 3-5 8.5-8.3 14.7-8.3zm.6 28.4c2.2-.1 4.2-.6 5.7-2V21.7h-6.3a9.8 9.8 0 0 0-9 6.4 10.2 10.2 0 0 0 9.1 13.9h.5zM452.8 13.4c-6.2 0-11.7 3.3-14.8 8.2a18.5 18.5 0 0 0 3.6 24.3 10.4 10.4 0 0 0 13 .6c2.2-1.5 3.8-3.7 4.5-6.1v7.8c0 2.8-.8 5-2.2 6.3-1.5 1.5-4 2.2-7.5 2.2l-6-.3c-.3 0-.7.2-.8.5l-1.6 5.5c-.1.4.1.8.5 1h.1c2.8.4 5.5.6 7 .6 6.3 0 11-1.4 14-4.1 2.7-2.5 4.2-6.3 4.5-11.4V14.2c0-.5-.4-.8-.8-.8h-13.5zm6.3 8.2v18.3a9.6 9.6 0 0 1-5.6 2h-1a10.3 10.3 0 0 1-8.8-14c1.4-3.7 5-6.3 9-6.3h6.4zM291 31.5A32 32 0 0 1 322.8 0h30.8c.6 0 1.2.5 1.2 1.2v61.5c0 1.1-1.3 1.7-2.2 1l-19.2-17a18 18 0 0 1-11 3.4 18.1 18.1 0 1 1 18.2-14.8c-.1.4-.5.7-.9.6-.1 0-.3 0-.4-.2l-3.8-3.4c-.4-.3-.6-.8-.7-1.4a12 12 0 1 0-2.4 8.3c.4-.4 1-.5 1.6-.2l14.7 13.1v-46H323a26 26 0 1 0 10 49.7c.8-.4 1.6-.2 2.3.3l3 2.7c.3.2.3.7 0 1l-.2.2a32 32 0 0 1-47.2-28.6z\"\n  }))));\n};\nexport default PoweredBy;"
  },
  {
    "path": "js/instantsearch.js/es/components/QueryRuleCustomData/QueryRuleCustomData.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { ComponentCSSClasses } from '../../types';\nimport type { QueryRuleCustomDataCSSClasses, QueryRuleCustomDataTemplates } from '../../widgets/query-rule-custom-data/query-rule-custom-data';\nexport type QueryRuleCustomDataComponentCSSClasses = ComponentCSSClasses<QueryRuleCustomDataCSSClasses>;\nexport type QueryRuleCustomDataComponentTemplates = Required<QueryRuleCustomDataTemplates>;\nexport type QueryRuleCustomDataProps = {\n    cssClasses: QueryRuleCustomDataComponentCSSClasses;\n    templates: QueryRuleCustomDataComponentTemplates;\n    items: any[];\n};\ndeclare const QueryRuleCustomData: ({ cssClasses, templates, items, }: QueryRuleCustomDataProps) => h.JSX.Element;\nexport default QueryRuleCustomData;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/QueryRuleCustomData/QueryRuleCustomData.js",
    "content": "import { h } from 'preact';\nimport Template from \"../Template/Template.js\";\nvar QueryRuleCustomData = function QueryRuleCustomData(_ref) {\n  var cssClasses = _ref.cssClasses,\n    templates = _ref.templates,\n    items = _ref.items;\n  return h(Template, {\n    templateKey: \"default\",\n    templates: templates,\n    rootProps: {\n      className: cssClasses.root\n    },\n    data: {\n      items: items\n    }\n  });\n};\nexport default QueryRuleCustomData;"
  },
  {
    "path": "js/instantsearch.js/es/components/RangeInput/RangeInput.d.ts",
    "content": "\nimport { h, Component } from 'preact';\nimport type { Range, RangeBoundaries } from '../../connectors/range/connectRange';\nimport type { ComponentCSSClasses } from '../../types';\nimport type { RangeInputCSSClasses, RangeInputTemplates } from '../../widgets/range-input/range-input';\nexport type RangeInputComponentCSSClasses = ComponentCSSClasses<RangeInputCSSClasses>;\nexport type RangeInputComponentTemplates = Required<RangeInputTemplates>;\nexport type RangeInputProps = {\n    min?: number;\n    max?: number;\n    step: number;\n    values: Partial<Range>;\n    cssClasses: RangeInputComponentCSSClasses;\n    templateProps: {\n        templates: RangeInputComponentTemplates;\n    };\n    refine: (rangeValue: RangeBoundaries) => void;\n};\ndeclare class RangeInput extends Component<RangeInputProps, {\n    min?: string;\n    max?: string;\n}> {\n    state: {\n        min: string | undefined;\n        max: string | undefined;\n    };\n    componentWillReceiveProps(nextProps: RangeInputProps): void;\n    private onInput;\n    private onSubmit;\n    render(): h.JSX.Element;\n}\nexport default RangeInput;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/RangeInput/RangeInput.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, Component } from 'preact';\nimport Template from \"../Template/Template.js\";\n// Strips leading `0` from a positive number value\nfunction stripLeadingZeroFromInput(value) {\n  return value.replace(/^(0+)\\d/, function (part) {\n    return Number(part).toString();\n  });\n}\nvar RangeInput = /*#__PURE__*/function (_Component) {\n  _inherits(RangeInput, _Component);\n  var _super = _createSuper(RangeInput);\n  function RangeInput() {\n    var _this$props$values$mi, _this$props$values$ma;\n    var _this;\n    _classCallCheck(this, RangeInput);\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    _this = _super.call.apply(_super, [this].concat(args));\n    _defineProperty(_assertThisInitialized(_this), \"state\", {\n      min: (_this$props$values$mi = _this.props.values.min) === null || _this$props$values$mi === void 0 ? void 0 : _this$props$values$mi.toString(),\n      max: (_this$props$values$ma = _this.props.values.max) === null || _this$props$values$ma === void 0 ? void 0 : _this$props$values$ma.toString()\n    });\n    _defineProperty(_assertThisInitialized(_this), \"onInput\", function (key) {\n      return function (event) {\n        var _ref = event.currentTarget,\n          value = _ref.value;\n        _this.setState(_defineProperty({}, key, value));\n      };\n    });\n    _defineProperty(_assertThisInitialized(_this), \"onSubmit\", function (event) {\n      event.preventDefault();\n      var _this$state = _this.state,\n        min = _this$state.min,\n        max = _this$state.max;\n      _this.props.refine([min ? Number(min) : undefined, max ? Number(max) : undefined]);\n    });\n    return _this;\n  }\n  _createClass(RangeInput, [{\n    key: \"componentWillReceiveProps\",\n    value: function componentWillReceiveProps(nextProps) {\n      var _nextProps$values$min, _nextProps$values$max;\n      this.setState({\n        min: (_nextProps$values$min = nextProps.values.min) === null || _nextProps$values$min === void 0 ? void 0 : _nextProps$values$min.toString(),\n        max: (_nextProps$values$max = nextProps.values.max) === null || _nextProps$values$max === void 0 ? void 0 : _nextProps$values$max.toString()\n      });\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      var _this$state2 = this.state,\n        minValue = _this$state2.min,\n        maxValue = _this$state2.max;\n      var _this$props = this.props,\n        min = _this$props.min,\n        max = _this$props.max,\n        step = _this$props.step,\n        cssClasses = _this$props.cssClasses,\n        templateProps = _this$props.templateProps;\n      var isDisabled = min && max ? min >= max : false;\n      var hasRefinements = Boolean(minValue || maxValue);\n      var rootClassNames = cx(cssClasses.root, !hasRefinements && cssClasses.noRefinement);\n      return h(\"div\", {\n        className: rootClassNames\n      }, h(\"form\", {\n        className: cssClasses.form,\n        onSubmit: this.onSubmit\n      }, h(\"label\", {\n        className: cssClasses.label\n      }, h(\"input\", {\n        className: cx(cssClasses.input, cssClasses.inputMin),\n        type: \"number\",\n        min: min,\n        max: max,\n        step: step,\n        value: stripLeadingZeroFromInput(minValue !== null && minValue !== void 0 ? minValue : ''),\n        onInput: this.onInput('min'),\n        placeholder: min === null || min === void 0 ? void 0 : min.toString(),\n        disabled: isDisabled\n      })), h(Template, _extends({}, templateProps, {\n        templateKey: \"separatorText\",\n        rootTagName: \"span\",\n        rootProps: {\n          className: cssClasses.separator\n        }\n      })), h(\"label\", {\n        className: cssClasses.label\n      }, h(\"input\", {\n        className: cx(cssClasses.input, cssClasses.inputMax),\n        type: \"number\",\n        min: min,\n        max: max,\n        step: step,\n        value: stripLeadingZeroFromInput(maxValue !== null && maxValue !== void 0 ? maxValue : ''),\n        onInput: this.onInput('max'),\n        placeholder: max === null || max === void 0 ? void 0 : max.toString(),\n        disabled: isDisabled\n      })), h(Template, _extends({}, templateProps, {\n        templateKey: \"submitText\",\n        rootTagName: \"button\",\n        rootProps: {\n          type: 'submit',\n          className: cssClasses.submit,\n          disabled: isDisabled\n        }\n      }))));\n    }\n  }]);\n  return RangeInput;\n}(Component);\nexport default RangeInput;"
  },
  {
    "path": "js/instantsearch.js/es/components/RefinementList/RefinementList.d.ts",
    "content": "\nimport { h, Component } from 'preact';\nimport type { HierarchicalMenuItem } from '../../connectors/hierarchical-menu/connectHierarchicalMenu';\nimport type { PreparedTemplateProps } from '../../lib/templating';\nimport type { ComponentCSSClasses, CreateURL, Templates } from '../../types';\nimport type { HierarchicalMenuComponentCSSClasses } from '../../widgets/hierarchical-menu/hierarchical-menu';\nimport type { RatingMenuComponentCSSClasses } from '../../widgets/rating-menu/rating-menu';\nimport type { RefinementListOwnCSSClasses } from '../../widgets/refinement-list/refinement-list';\nimport type { SearchBoxComponentCSSClasses, SearchBoxComponentTemplates } from '../SearchBox/SearchBox';\nimport type { JSX } from 'preact';\ntype RefinementListOptionalClasses = 'noResults' | 'checkbox' | 'labelText' | 'showMore' | 'disabledShowMore' | 'searchBox' | 'count';\ntype RefinementListWidgetCSSClasses = ComponentCSSClasses<RefinementListOwnCSSClasses>;\ntype RefinementListRequiredCSSClasses = Omit<RefinementListWidgetCSSClasses, RefinementListOptionalClasses> & Partial<Pick<RefinementListWidgetCSSClasses, RefinementListOptionalClasses>>;\nexport type RefinementListComponentCSSClasses = RefinementListRequiredCSSClasses & {\n    searchable?: SearchBoxComponentCSSClasses;\n} & Partial<Pick<RatingMenuComponentCSSClasses, 'disabledItem'>> & Partial<Pick<HierarchicalMenuComponentCSSClasses, 'childList' | 'parentItem'>>;\ntype FacetValue = {\n    value: string;\n    label: string;\n    highlighted?: string;\n    count?: number;\n    isRefined: boolean;\n    data?: HierarchicalMenuItem[] | null;\n};\nexport type RefinementListProps<TTemplates extends Templates> = {\n    createURL: CreateURL<string>;\n    cssClasses: RefinementListComponentCSSClasses;\n    depth?: number;\n    facetValues?: FacetValue[];\n    attribute?: string;\n    templateProps: PreparedTemplateProps<TTemplates>;\n    toggleRefinement: (value: string) => void;\n    showMore?: boolean;\n    toggleShowMore?: () => void;\n    isShowingMore?: boolean;\n    hasExhaustiveItems?: boolean;\n    canToggleShowMore?: boolean;\n    className?: string;\n    children?: JSX.Element;\n    isFromSearch?: boolean;\n    searchIsAlwaysActive?: boolean;\n    searchFacetValues?: (query: string) => void;\n    searchPlaceholder?: string;\n    searchBoxTemplateProps?: PreparedTemplateProps<SearchBoxComponentTemplates>;\n};\ndeclare const defaultProps: {\n    cssClasses: {};\n    depth: number;\n};\ntype RefinementListPropsWithDefaultProps<TTemplates extends Templates> = RefinementListProps<TTemplates> & Readonly<typeof defaultProps>;\ndeclare class RefinementList<TTemplates extends Templates> extends Component<RefinementListPropsWithDefaultProps<TTemplates>> {\n    static defaultProps: {\n        cssClasses: {};\n        depth: number;\n    };\n    private listRef;\n    private searchBox;\n    private lastRefinedValue;\n    shouldComponentUpdate(nextProps: RefinementListPropsWithDefaultProps<TTemplates>): boolean;\n    private refine;\n    private _generateFacetItem;\n    private handleItemClick;\n    componentWillReceiveProps(nextProps: RefinementListPropsWithDefaultProps<TTemplates>): void;\n    /**\n     * This sets focus on the last refined input element after a render\n     * because Preact does not perform it automatically.\n     * @see https://github.com/preactjs/preact/issues/3242\n     */\n    componentDidUpdate(): void;\n    private refineFirstValue;\n    render(): h.JSX.Element;\n}\nexport default RefinementList;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/RefinementList/RefinementList.js",
    "content": "var _excluded = [\"root\"];\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, createRef, Component } from 'preact';\nimport { isSpecialClick, isEqual } from \"../../lib/utils/index.js\";\nimport SearchBox from \"../SearchBox/SearchBox.js\";\nimport Template from \"../Template/Template.js\";\nimport RefinementListItem from \"./RefinementListItem.js\";\n\n// CSS types\n\nvar defaultProps = {\n  cssClasses: {},\n  depth: 0\n};\nfunction isHierarchicalMenuItem(facetValue) {\n  return facetValue.data !== undefined;\n}\nvar RefinementList = /*#__PURE__*/function (_Component) {\n  _inherits(RefinementList, _Component);\n  var _super = _createSuper(RefinementList);\n  function RefinementList() {\n    var _this;\n    _classCallCheck(this, RefinementList);\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    _this = _super.call.apply(_super, [this].concat(args));\n    _defineProperty(_assertThisInitialized(_this), \"listRef\", createRef());\n    _defineProperty(_assertThisInitialized(_this), \"searchBox\", createRef());\n    _defineProperty(_assertThisInitialized(_this), \"lastRefinedValue\", undefined);\n    _defineProperty(_assertThisInitialized(_this), \"_generateFacetItem\", function (facetValue) {\n      var subItems;\n      if (isHierarchicalMenuItem(facetValue) && Array.isArray(facetValue.data) && facetValue.data.length > 0) {\n        var _this$props$cssClasse = _this.props.cssClasses,\n          root = _this$props$cssClasse.root,\n          cssClasses = _objectWithoutProperties(_this$props$cssClasse, _excluded);\n        subItems = h(RefinementList, _extends({}, _this.props, {\n          // We want to keep `root` required for external usage but not for the\n          // sub items.\n          cssClasses: cssClasses,\n          depth: _this.props.depth + 1,\n          facetValues: facetValue.data,\n          showMore: false,\n          className: _this.props.cssClasses.childList\n        }));\n      }\n      var url = _this.props.createURL(facetValue.value);\n      var templateData = _objectSpread(_objectSpread({}, facetValue), {}, {\n        url: url,\n        attribute: _this.props.attribute,\n        cssClasses: _this.props.cssClasses,\n        isFromSearch: _this.props.isFromSearch\n      });\n      var key = facetValue.value;\n      if (facetValue.isRefined !== undefined) {\n        key += \"/\".concat(facetValue.isRefined);\n      }\n      if (facetValue.count !== undefined) {\n        key += \"/\".concat(facetValue.count);\n      }\n      var refinementListItemClassName = cx(_this.props.cssClasses.item, facetValue.isRefined && _this.props.cssClasses.selectedItem, !facetValue.count && _this.props.cssClasses.disabledItem, Boolean(isHierarchicalMenuItem(facetValue) && Array.isArray(facetValue.data) && facetValue.data.length > 0) && _this.props.cssClasses.parentItem);\n      return h(RefinementListItem, {\n        templateKey: \"item\",\n        key: key,\n        facetValueToRefine: facetValue.value,\n        handleClick: _this.handleItemClick,\n        isRefined: facetValue.isRefined,\n        className: refinementListItemClassName,\n        subItems: subItems,\n        templateData: templateData,\n        templateProps: _this.props.templateProps\n      });\n    });\n    // Click events on DOM tree like LABEL > INPUT will result in two click events\n    // instead of one.\n    // No matter the framework, see https://www.google.com/search?q=click+label+twice\n    //\n    // Thus making it hard to distinguish activation from deactivation because both click events\n    // are very close. Debounce is a solution but hacky.\n    //\n    // So the code here checks if the click was done on or in a LABEL. If this LABEL\n    // has a checkbox inside, we ignore the first click event because we will get another one.\n    //\n    // We also check if the click was done inside a link and then e.preventDefault() because we already\n    // handle the url\n    //\n    // Finally, we always stop propagation of the event to avoid multiple levels RefinementLists to fail: click\n    // on child would click on parent also\n    _defineProperty(_assertThisInitialized(_this), \"handleItemClick\", function (_ref) {\n      var facetValueToRefine = _ref.facetValueToRefine,\n        isRefined = _ref.isRefined,\n        originalEvent = _ref.originalEvent;\n      if (isSpecialClick(originalEvent)) {\n        // do not alter the default browser behavior\n        // if one special key is down\n        return;\n      }\n      var parent = originalEvent.target;\n      if (parent === null || parent.parentNode === null) {\n        return;\n      }\n      if (isRefined && parent.parentNode.querySelector('input[type=\"radio\"]:checked')) {\n        // Prevent refinement for being reset if the user clicks on an already checked radio button\n        return;\n      }\n      if (parent.tagName === 'INPUT') {\n        _this.refine(facetValueToRefine);\n        return;\n      }\n      while (parent !== originalEvent.currentTarget) {\n        if (parent.tagName === 'LABEL' && (parent.querySelector('input[type=\"checkbox\"]') || parent.querySelector('input[type=\"radio\"]'))) {\n          return;\n        }\n        if (parent.tagName === 'A' && parent.href) {\n          originalEvent.preventDefault();\n        }\n        parent = parent.parentNode;\n      }\n      originalEvent.stopPropagation();\n      _this.refine(facetValueToRefine);\n    });\n    return _this;\n  }\n  _createClass(RefinementList, [{\n    key: \"shouldComponentUpdate\",\n    value: function shouldComponentUpdate(nextProps) {\n      var areFacetValuesDifferent = !isEqual(this.props.facetValues, nextProps.facetValues);\n      return areFacetValuesDifferent;\n    }\n  }, {\n    key: \"refine\",\n    value: function refine(facetValueToRefine) {\n      this.lastRefinedValue = facetValueToRefine;\n      this.props.toggleRefinement(facetValueToRefine);\n    }\n  }, {\n    key: \"componentWillReceiveProps\",\n    value: function componentWillReceiveProps(nextProps) {\n      if (this.searchBox.current && !nextProps.isFromSearch) {\n        this.searchBox.current.resetInput();\n      }\n    }\n\n    /**\n     * This sets focus on the last refined input element after a render\n     * because Preact does not perform it automatically.\n     * @see https://github.com/preactjs/preact/issues/3242\n     */\n  }, {\n    key: \"componentDidUpdate\",\n    value: function componentDidUpdate() {\n      var _this$listRef$current, _this$listRef$current2, _this$lastRefinedValu;\n      (_this$listRef$current = this.listRef.current) === null || _this$listRef$current === void 0 ? void 0 : (_this$listRef$current2 = _this$listRef$current.querySelector(\"input[value=\\\"\".concat((_this$lastRefinedValu = this.lastRefinedValue) === null || _this$lastRefinedValu === void 0 ? void 0 : _this$lastRefinedValu.replace('\"', '\\\\\"'), \"\\\"]\"))) === null || _this$listRef$current2 === void 0 ? void 0 : _this$listRef$current2.focus();\n      this.lastRefinedValue = undefined;\n    }\n  }, {\n    key: \"refineFirstValue\",\n    value: function refineFirstValue() {\n      var firstValue = this.props.facetValues && this.props.facetValues[0];\n      if (firstValue) {\n        var actualValue = firstValue.value;\n        this.props.toggleRefinement(actualValue);\n      }\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      var _this2 = this;\n      var showMoreButtonClassName = cx(this.props.cssClasses.showMore, !(this.props.showMore === true && this.props.canToggleShowMore) && this.props.cssClasses.disabledShowMore);\n      var showMoreButton = this.props.showMore === true && h(Template, _extends({}, this.props.templateProps, {\n        templateKey: \"showMoreText\",\n        rootTagName: \"button\",\n        rootProps: {\n          className: showMoreButtonClassName,\n          disabled: !this.props.canToggleShowMore,\n          onClick: this.props.toggleShowMore\n        },\n        data: {\n          isShowingMore: this.props.isShowingMore\n        }\n      }));\n      var shouldDisableSearchBox = this.props.searchIsAlwaysActive !== true && !(this.props.isFromSearch || !this.props.hasExhaustiveItems);\n      var searchBox = this.props.searchFacetValues && h(\"div\", {\n        className: this.props.cssClasses.searchBox\n      }, h(SearchBox, {\n        ref: this.searchBox,\n        placeholder: this.props.searchPlaceholder,\n        disabled: shouldDisableSearchBox,\n        cssClasses: this.props.cssClasses.searchable,\n        templates: this.props.searchBoxTemplateProps.templates,\n        onChange: function onChange(event) {\n          return _this2.props.searchFacetValues(event.target.value);\n        },\n        onReset: function onReset() {\n          return _this2.props.searchFacetValues('');\n        },\n        onSubmit: function onSubmit() {\n          return _this2.refineFirstValue();\n        }\n        // This sets the search box to a controlled state because\n        // we don't rely on the `refine` prop but on `onChange`.\n        ,\n        searchAsYouType: false,\n        ariaLabel: \"Search for filters\"\n      }));\n      var facetValues = this.props.facetValues && this.props.facetValues.length > 0 && h(\"ul\", {\n        ref: this.listRef,\n        className: this.props.cssClasses.list\n      }, this.props.facetValues.map(this._generateFacetItem, this));\n      var noResults = this.props.searchFacetValues && this.props.isFromSearch && (!this.props.facetValues || this.props.facetValues.length === 0) && h(Template, _extends({}, this.props.templateProps, {\n        templateKey: \"searchableNoResults\",\n        rootProps: {\n          className: this.props.cssClasses.noResults\n        }\n      }));\n      var rootClassName = cx(this.props.cssClasses.root, (!this.props.facetValues || this.props.facetValues.length === 0) && this.props.cssClasses.noRefinementRoot, this.props.className);\n      return h(\"div\", {\n        className: rootClassName\n      }, this.props.children, searchBox, facetValues, noResults, showMoreButton);\n    }\n  }]);\n  return RefinementList;\n}(Component);\n_defineProperty(RefinementList, \"defaultProps\", defaultProps);\nexport default RefinementList;"
  },
  {
    "path": "js/instantsearch.js/es/components/RefinementList/RefinementListItem.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { JSX } from 'preact';\nexport type RefinementListItemProps = {\n    facetValueToRefine: string;\n    handleClick: (args: {\n        facetValueToRefine: string;\n        isRefined: boolean;\n        originalEvent: MouseEvent;\n    }) => void;\n    isRefined: boolean;\n    subItems?: JSX.Element;\n    templateData: Record<string, any>;\n    templateKey: string;\n    templateProps?: Record<string, any>;\n    className: string;\n};\ndeclare function RefinementListItem({ className, handleClick, facetValueToRefine, isRefined, templateProps, templateKey, templateData, subItems, }: RefinementListItemProps): h.JSX.Element;\nexport default RefinementListItem;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/RefinementList/RefinementListItem.js",
    "content": "function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport { h } from 'preact';\nimport Template from \"../Template/Template.js\";\nfunction RefinementListItem(_ref) {\n  var className = _ref.className,\n    handleClick = _ref.handleClick,\n    facetValueToRefine = _ref.facetValueToRefine,\n    isRefined = _ref.isRefined,\n    templateProps = _ref.templateProps,\n    templateKey = _ref.templateKey,\n    templateData = _ref.templateData,\n    subItems = _ref.subItems;\n  return h(\"li\", {\n    className: className,\n    onClick: function onClick(originalEvent) {\n      handleClick({\n        facetValueToRefine: facetValueToRefine,\n        isRefined: isRefined,\n        originalEvent: originalEvent\n      });\n    }\n  }, h(Template, _extends({}, templateProps, {\n    templateKey: templateKey,\n    data: templateData\n  })), subItems);\n}\nexport default RefinementListItem;"
  },
  {
    "path": "js/instantsearch.js/es/components/RelevantSort/RelevantSort.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { ComponentCSSClasses } from '../../types';\nimport type { RelevantSortCSSClasses, RelevantSortTemplates } from '../../widgets/relevant-sort/relevant-sort';\nexport type RelevantSortComponentCSSClasses = ComponentCSSClasses<RelevantSortCSSClasses>;\nexport type RelevantSortComponentTemplates = Required<RelevantSortTemplates>;\ntype RelevantSortProps = {\n    cssClasses: RelevantSortComponentCSSClasses;\n    templates: RelevantSortComponentTemplates;\n    isRelevantSorted: boolean;\n    isVirtualReplica: boolean;\n    refine: (relevancyStrictness: number | undefined) => void;\n};\ndeclare const RelevantSort: ({ cssClasses, templates, isRelevantSorted, isVirtualReplica, refine, }: RelevantSortProps) => h.JSX.Element | null;\nexport default RelevantSort;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/RelevantSort/RelevantSort.js",
    "content": "import { h } from 'preact';\nimport Template from \"../Template/Template.js\";\nvar RelevantSort = function RelevantSort(_ref) {\n  var cssClasses = _ref.cssClasses,\n    templates = _ref.templates,\n    isRelevantSorted = _ref.isRelevantSorted,\n    isVirtualReplica = _ref.isVirtualReplica,\n    refine = _ref.refine;\n  return isVirtualReplica ? h(\"div\", {\n    className: cssClasses.root\n  }, h(Template, {\n    templateKey: \"text\",\n    templates: templates,\n    rootProps: {\n      className: cssClasses.text\n    },\n    data: {\n      isRelevantSorted: isRelevantSorted\n    }\n  }), h(\"button\", {\n    type: \"button\",\n    className: cssClasses.button,\n    onClick: function onClick() {\n      if (isRelevantSorted) {\n        refine(0);\n      } else {\n        refine(undefined);\n      }\n    }\n  }, h(Template, {\n    rootTagName: \"span\",\n    templateKey: \"button\",\n    templates: templates,\n    data: {\n      isRelevantSorted: isRelevantSorted\n    }\n  }))) : null;\n};\nexport default RelevantSort;"
  },
  {
    "path": "js/instantsearch.js/es/components/ReverseHighlight/ReverseHighlight.d.ts",
    "content": "import { h } from 'preact';\nimport type { HighlightProps as InternalHighlightProps, HighlightClassNames as InternalHighlightClassNames } from 'instantsearch-ui-components';\nexport type ReverseHighlightClassNames = InternalHighlightClassNames;\nexport type ReverseHighlightProps = Omit<InternalHighlightProps, 'classNames'> & {\n    classNames?: Partial<ReverseHighlightClassNames>;\n};\nexport declare function ReverseHighlight({ classNames, ...props }: ReverseHighlightProps): h.JSX.Element;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/ReverseHighlight/ReverseHighlight.js",
    "content": "var _excluded = [\"classNames\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport { cx } from 'instantsearch-ui-components';\nimport { h } from 'preact';\nimport { InternalHighlight } from \"../InternalHighlight/InternalHighlight.js\";\nexport function ReverseHighlight(_ref) {\n  var _ref$classNames = _ref.classNames,\n    classNames = _ref$classNames === void 0 ? {} : _ref$classNames,\n    props = _objectWithoutProperties(_ref, _excluded);\n  return h(InternalHighlight, _extends({\n    classNames: {\n      root: cx('ais-ReverseHighlight', classNames.root),\n      highlighted: cx('ais-ReverseHighlight-highlighted', classNames.highlighted),\n      nonHighlighted: cx('ais-ReverseHighlight-nonHighlighted', classNames.nonHighlighted),\n      separator: cx('ais-ReverseHighlight-separator', classNames.separator)\n    }\n  }, props));\n}"
  },
  {
    "path": "js/instantsearch.js/es/components/ReverseSnippet/ReverseSnippet.d.ts",
    "content": "import { h } from 'preact';\nimport type { HighlightProps as InternalHighlightProps, HighlightClassNames as InternalHighlightClassNames } from 'instantsearch-ui-components';\nexport type ReverseSnippetClassNames = InternalHighlightClassNames;\nexport type ReverseSnippetProps = Omit<InternalHighlightProps, 'classNames'> & {\n    classNames?: Partial<ReverseSnippetClassNames>;\n};\nexport declare function ReverseSnippet({ classNames, ...props }: ReverseSnippetProps): h.JSX.Element;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/ReverseSnippet/ReverseSnippet.js",
    "content": "var _excluded = [\"classNames\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport { cx } from 'instantsearch-ui-components';\nimport { h } from 'preact';\nimport { InternalHighlight } from \"../InternalHighlight/InternalHighlight.js\";\nexport function ReverseSnippet(_ref) {\n  var _ref$classNames = _ref.classNames,\n    classNames = _ref$classNames === void 0 ? {} : _ref$classNames,\n    props = _objectWithoutProperties(_ref, _excluded);\n  return h(InternalHighlight, _extends({\n    classNames: {\n      root: cx('ais-ReverseSnippet', classNames.root),\n      highlighted: cx('ais-ReverseSnippet-highlighted', classNames.highlighted),\n      nonHighlighted: cx('ais-ReverseSnippet-nonHighlighted', classNames.nonHighlighted),\n      separator: cx('ais-ReverseSnippet-separator', classNames.separator)\n    }\n  }, props));\n}"
  },
  {
    "path": "js/instantsearch.js/es/components/SearchBox/SearchBox.d.ts",
    "content": "\nimport { h, Component } from 'preact';\nimport { noop } from '../../lib/utils';\nimport type { ComponentCSSClasses } from '../../types';\nimport type { SearchBoxCSSClasses, SearchBoxTemplates } from '../../widgets/search-box/search-box';\nexport type SearchBoxComponentCSSClasses = ComponentCSSClasses<SearchBoxCSSClasses>;\nexport type SearchBoxComponentTemplates = Required<SearchBoxTemplates>;\ntype SearchBoxProps = {\n    placeholder?: string;\n    cssClasses: SearchBoxComponentCSSClasses;\n    templates: SearchBoxComponentTemplates;\n    query?: string;\n    showSubmit?: boolean;\n    showReset?: boolean;\n    showLoadingIndicator?: boolean;\n    refine?: (value: string) => void;\n    autofocus?: boolean;\n    searchAsYouType?: boolean;\n    ignoreCompositionEvents?: boolean;\n    isSearchStalled?: boolean;\n    disabled?: boolean;\n    ariaLabel?: string;\n    onChange?: (event: Event) => void;\n    onSubmit?: (event: Event) => void;\n    onReset?: (event: Event) => void;\n};\ndeclare const defaultProps: {\n    query: string;\n    showSubmit: boolean;\n    showReset: boolean;\n    showLoadingIndicator: boolean;\n    autofocus: boolean;\n    searchAsYouType: boolean;\n    ignoreCompositionEvents: boolean;\n    isSearchStalled: boolean;\n    disabled: boolean;\n    ariaLabel: string;\n    onChange: typeof noop;\n    onSubmit: typeof noop;\n    onReset: typeof noop;\n    refine: typeof noop;\n};\ntype SearchBoxPropsWithDefaultProps = SearchBoxProps & Readonly<typeof defaultProps>;\ntype SearchBoxState = {\n    query: string;\n    focused: boolean;\n};\ndeclare class SearchBox extends Component<SearchBoxPropsWithDefaultProps, SearchBoxState> {\n    static defaultProps: {\n        query: string;\n        showSubmit: boolean;\n        showReset: boolean;\n        showLoadingIndicator: boolean;\n        autofocus: boolean;\n        searchAsYouType: boolean;\n        ignoreCompositionEvents: boolean;\n        isSearchStalled: boolean;\n        disabled: boolean;\n        ariaLabel: string;\n        onChange: typeof noop;\n        onSubmit: typeof noop;\n        onReset: typeof noop;\n        refine: typeof noop;\n    };\n    state: {\n        query: string;\n        focused: boolean;\n    };\n    private input;\n    /**\n     * This public method is used in the RefinementList SFFV search box\n     * to reset the input state when an item is selected.\n     *\n     * @see RefinementList#componentWillReceiveProps\n     * @return {undefined}\n     */\n    resetInput(): void;\n    private onInput;\n    componentWillReceiveProps(nextProps: SearchBoxPropsWithDefaultProps): void;\n    private onSubmit;\n    private onReset;\n    private onBlur;\n    private onFocus;\n    render(): h.JSX.Element;\n}\nexport default SearchBox;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/SearchBox/SearchBox.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { h, createRef, Component } from 'preact';\nimport { noop } from \"../../lib/utils/index.js\";\nimport Template from \"../Template/Template.js\";\nvar defaultProps = {\n  query: '',\n  showSubmit: true,\n  showReset: true,\n  showLoadingIndicator: true,\n  autofocus: false,\n  searchAsYouType: true,\n  ignoreCompositionEvents: false,\n  isSearchStalled: false,\n  disabled: false,\n  ariaLabel: 'Search',\n  onChange: noop,\n  onSubmit: noop,\n  onReset: noop,\n  refine: noop\n};\nvar SearchBox = /*#__PURE__*/function (_Component) {\n  _inherits(SearchBox, _Component);\n  var _super = _createSuper(SearchBox);\n  function SearchBox() {\n    var _this;\n    _classCallCheck(this, SearchBox);\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    _this = _super.call.apply(_super, [this].concat(args));\n    _defineProperty(_assertThisInitialized(_this), \"state\", {\n      query: _this.props.query,\n      focused: false\n    });\n    _defineProperty(_assertThisInitialized(_this), \"input\", createRef());\n    _defineProperty(_assertThisInitialized(_this), \"onInput\", function (event) {\n      var _this$props = _this.props,\n        searchAsYouType = _this$props.searchAsYouType,\n        refine = _this$props.refine,\n        onChange = _this$props.onChange;\n      var query = event.target.value;\n      if (!(_this.props.ignoreCompositionEvents && event.isComposing)) {\n        if (searchAsYouType) {\n          refine(query);\n        }\n        _this.setState({\n          query: query\n        });\n        onChange(event);\n      }\n    });\n    _defineProperty(_assertThisInitialized(_this), \"onSubmit\", function (event) {\n      var _this$props2 = _this.props,\n        searchAsYouType = _this$props2.searchAsYouType,\n        refine = _this$props2.refine,\n        onSubmit = _this$props2.onSubmit;\n      event.preventDefault();\n      event.stopPropagation();\n      if (_this.input.current) {\n        _this.input.current.blur();\n      }\n      if (!searchAsYouType) {\n        refine(_this.state.query);\n      }\n      onSubmit(event);\n      return false;\n    });\n    _defineProperty(_assertThisInitialized(_this), \"onReset\", function (event) {\n      var _this$props3 = _this.props,\n        refine = _this$props3.refine,\n        onReset = _this$props3.onReset;\n      var query = '';\n      if (_this.input.current) {\n        _this.input.current.focus();\n      }\n      refine(query);\n      _this.setState({\n        query: query\n      });\n      onReset(event);\n    });\n    _defineProperty(_assertThisInitialized(_this), \"onBlur\", function () {\n      _this.setState({\n        focused: false\n      });\n    });\n    _defineProperty(_assertThisInitialized(_this), \"onFocus\", function () {\n      _this.setState({\n        focused: true\n      });\n    });\n    return _this;\n  }\n  _createClass(SearchBox, [{\n    key: \"resetInput\",\n    value:\n    /**\n     * This public method is used in the RefinementList SFFV search box\n     * to reset the input state when an item is selected.\n     *\n     * @see RefinementList#componentWillReceiveProps\n     * @return {undefined}\n     */\n    function resetInput() {\n      this.setState({\n        query: ''\n      });\n    }\n  }, {\n    key: \"componentWillReceiveProps\",\n    value: function componentWillReceiveProps(nextProps) {\n      /**\n       * when the user is typing, we don't want to replace the query typed\n       * by the user (state.query) with the query exposed by the connector (props.query)\n       * see: https://github.com/algolia/instantsearch/issues/4141\n       */\n      if (!this.state.focused && nextProps.query !== this.state.query) {\n        this.setState({\n          query: nextProps.query\n        });\n      }\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      var _this$props4 = this.props,\n        cssClasses = _this$props4.cssClasses,\n        placeholder = _this$props4.placeholder,\n        autofocus = _this$props4.autofocus,\n        showSubmit = _this$props4.showSubmit,\n        showReset = _this$props4.showReset,\n        showLoadingIndicator = _this$props4.showLoadingIndicator,\n        templates = _this$props4.templates,\n        isSearchStalled = _this$props4.isSearchStalled,\n        ariaLabel = _this$props4.ariaLabel;\n      return h(\"div\", {\n        className: cssClasses.root\n      }, h(\"form\", {\n        action: \"\",\n        role: \"search\",\n        className: cssClasses.form,\n        noValidate: true,\n        onSubmit: this.onSubmit,\n        onReset: this.onReset\n      }, h(\"input\", {\n        ref: this.input,\n        value: this.state.query,\n        disabled: this.props.disabled,\n        className: cssClasses.input,\n        type: \"search\",\n        placeholder: placeholder,\n        autoFocus: autofocus,\n        autoComplete: \"off\",\n        autoCorrect: \"off\",\n        autoCapitalize: \"off\"\n        // @ts-expect-error `spellCheck` attribute is missing in preact JSX types\n        ,\n        spellCheck: \"false\",\n        maxLength: 512,\n        onInput: this.onInput\n        // see: https://github.com/preactjs/preact/issues/1978\n        // eslint-disable-next-line react/no-unknown-property\n        ,\n        oncompositionend: this.onInput,\n        onBlur: this.onBlur,\n        onFocus: this.onFocus,\n        \"aria-label\": ariaLabel\n      }), h(Template, {\n        templateKey: \"submit\",\n        rootTagName: \"button\",\n        rootProps: {\n          className: cssClasses.submit,\n          type: 'submit',\n          title: 'Submit the search query',\n          hidden: !showSubmit\n        },\n        templates: templates,\n        data: {\n          cssClasses: cssClasses\n        }\n      }), h(Template, {\n        templateKey: \"reset\",\n        rootTagName: \"button\",\n        rootProps: {\n          className: cssClasses.reset,\n          type: 'reset',\n          title: 'Clear the search query',\n          hidden: !(showReset && this.state.query.trim() && !isSearchStalled)\n        },\n        templates: templates,\n        data: {\n          cssClasses: cssClasses\n        }\n      }), showLoadingIndicator && h(Template, {\n        templateKey: \"loadingIndicator\",\n        rootTagName: \"span\",\n        rootProps: {\n          className: cssClasses.loadingIndicator,\n          hidden: !isSearchStalled\n        },\n        templates: templates,\n        data: {\n          cssClasses: cssClasses\n        }\n      })));\n    }\n  }]);\n  return SearchBox;\n}(Component);\n_defineProperty(SearchBox, \"defaultProps\", defaultProps);\nexport default SearchBox;"
  },
  {
    "path": "js/instantsearch.js/es/components/Selector/Selector.d.ts",
    "content": "\nimport { h } from 'preact';\nexport type SelectorOption = {\n    value: string | number | undefined;\n    label: string;\n};\nexport type SelectorComponentCSSClasses = {\n    root: string;\n    select: string;\n    option: string;\n};\nexport type SelectorProps = {\n    cssClasses: SelectorComponentCSSClasses;\n    currentValue?: string | number;\n    options: SelectorOption[];\n    setValue: (value: string) => void;\n    ariaLabel?: string;\n};\ndeclare function Selector({ currentValue, options, cssClasses, setValue, ariaLabel, }: SelectorProps): h.JSX.Element;\nexport default Selector;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/Selector/Selector.js",
    "content": "import { cx } from 'instantsearch-ui-components';\nimport { h } from 'preact';\nfunction Selector(_ref) {\n  var currentValue = _ref.currentValue,\n    options = _ref.options,\n    cssClasses = _ref.cssClasses,\n    setValue = _ref.setValue,\n    ariaLabel = _ref.ariaLabel;\n  return h(\"select\", {\n    className: cx(cssClasses.select),\n    onChange: function onChange(event) {\n      return setValue(event.target.value);\n    },\n    value: \"\".concat(currentValue),\n    \"aria-label\": ariaLabel\n  }, options.map(function (option) {\n    return h(\"option\", {\n      className: cx(cssClasses.option),\n      key: option.label + option.value,\n      value: \"\".concat(option.value)\n    }, option.label);\n  }));\n}\nexport default Selector;"
  },
  {
    "path": "js/instantsearch.js/es/components/Slider/Pit.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { PitProps } from './Rheostat';\ndeclare const Pit: ({ style, children }: PitProps) => h.JSX.Element;\nexport default Pit;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/Slider/Pit.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h } from 'preact';\nvar Pit = function Pit(_ref) {\n  var style = _ref.style,\n    children = _ref.children;\n  // first, end & middle\n  var positionValue = Math.round(parseFloat(style.left));\n  var shouldDisplayValue = [0, 50, 100].includes(positionValue);\n  var value = children;\n  var pitValue = Math.round(parseInt(value, 10) * 100) / 100;\n  return h(\"div\", {\n    style: _objectSpread(_objectSpread({}, style), {}, {\n      marginLeft: positionValue === 100 ? '-2px' : 0\n    }),\n    className: cx('rheostat-marker', 'rheostat-marker-horizontal', shouldDisplayValue && 'rheostat-marker-large')\n  }, shouldDisplayValue && h(\"div\", {\n    className: 'rheostat-value'\n  }, pitValue));\n};\nexport default Pit;"
  },
  {
    "path": "js/instantsearch.js/es/components/Slider/Rheostat.d.ts",
    "content": "/**\n * This is a fork of Rheostat for Preact X.\n *\n * @see https://github.com/airbnb/rheostat\n */\n\nimport { h, Component } from 'preact';\nimport type { ComponentChildren, ComponentType, JSX } from 'preact';\ntype BoundingBox = {\n    height: number;\n    left: number;\n    top: number;\n    width: number;\n};\ndeclare function Button(props: JSX.IntrinsicElements['button']): h.JSX.Element;\ntype Style = {\n    position?: 'absolute';\n    top?: number | string;\n    left?: number | string;\n    height?: string;\n    width?: string;\n};\nexport type PitProps = {\n    children: number | string;\n    style: Style;\n};\nexport type HandleProps = {\n    'aria-valuemax'?: number;\n    'aria-valuemin'?: number;\n    'aria-valuenow'?: number;\n    'aria-disabled': boolean;\n    'data-handle-key': number;\n    className: 'rheostat-handle';\n    key: string;\n    onClick: (e: MouseEvent) => void;\n    onKeyDown?: (e: KeyboardEvent) => void;\n    onMouseDown?: (e: MouseEvent) => void;\n    onTouchStart?: (e: TouchEvent) => void;\n    role: 'slider';\n    style: JSX.HTMLAttributes['style'];\n    tabIndex: number;\n};\ntype Bounds = [min: number, max: number];\ntype PublicState = {\n    max?: number;\n    min?: number;\n    values: Bounds;\n};\ntype Props = {\n    children?: ComponentChildren;\n    className?: string;\n    disabled?: boolean;\n    handle?: ComponentType<HandleProps>;\n    max?: number;\n    min?: number;\n    onClick?: () => void;\n    onChange?: (state: PublicState) => void;\n    onKeyPress?: () => void;\n    onSliderDragEnd?: () => void;\n    onSliderDragMove?: () => void;\n    onSliderDragStart?: () => void;\n    onValuesUpdated?: (state: PublicState) => void;\n    orientation?: 'horizontal' | 'vertical';\n    pitComponent?: ComponentType<PitProps>;\n    pitPoints?: number[];\n    progressBar?: ComponentType<JSX.HTMLAttributes>;\n    snap?: boolean;\n    snapPoints?: number[];\n    values?: Bounds;\n};\ntype State = {\n    className: string;\n    handlePos: Bounds;\n    handleDimensions: number;\n    mousePos: {\n        x: number;\n        y: number;\n    } | null;\n    sliderBox: Partial<BoundingBox>;\n    slidingIndex: number | null;\n    values: Bounds;\n};\ndeclare class Rheostat extends Component<Props, State> {\n    static defaultProps: {\n        className: string;\n        children: null;\n        disabled: boolean;\n        handle: typeof Button;\n        max: number;\n        min: number;\n        onClick: null;\n        onChange: null;\n        onKeyPress: null;\n        onSliderDragEnd: null;\n        onSliderDragMove: null;\n        onSliderDragStart: null;\n        onValuesUpdated: null;\n        orientation: string;\n        pitComponent: null;\n        pitPoints: never[];\n        progressBar: string;\n        snap: boolean;\n        snapPoints: never[];\n        values: number[];\n    };\n    x: number[];\n    state: State;\n    private rheostat;\n    componentWillReceiveProps: (nextProps: Required<Props>) => void;\n    private getPublicState;\n    private getSliderBoundingBox;\n    private getProgressStyle;\n    private getMinValue;\n    private getMaxValue;\n    private getHandleDimensions;\n    private getClosestSnapPoint;\n    private getSnapPosition;\n    private getNextPositionForKey;\n    private getNextState;\n    private getClosestHandle;\n    private setStartSlide;\n    private startMouseSlide;\n    private startTouchSlide;\n    private handleMouseSlide;\n    private handleTouchSlide;\n    private handleSlide;\n    private endSlide;\n    private handleClick;\n    private handleKeydown;\n    private validatePosition;\n    private validateValues;\n    canMove: (idx: number, proposedPosition: number) => boolean;\n    fireChangeEvent: () => void;\n    slideTo: (idx: number, proposedPosition: number, onAfterSet?: () => void) => void;\n    updateNewValues: (nextProps: Required<Props>) => void;\n    render: () => h.JSX.Element;\n}\nexport default Rheostat;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/Slider/Rheostat.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n/**\n * This is a fork of Rheostat for Preact X.\n *\n * @see https://github.com/airbnb/rheostat\n */import { h, Component, createRef } from 'preact';\nvar KEYS = {\n  DOWN: 40,\n  END: 35,\n  ESC: 27,\n  HOME: 36,\n  LEFT: 37,\n  PAGE_DOWN: 34,\n  PAGE_UP: 33,\n  RIGHT: 39,\n  UP: 38\n};\nvar PERCENT_EMPTY = 0;\nvar PERCENT_FULL = 100;\nfunction getPosition(value, min, max) {\n  return (value - min) / (max - min) * 100;\n}\nfunction getValue(pos, min, max) {\n  var decimal = pos / 100;\n  if (pos === 0) {\n    return min;\n  } else if (pos === 100) {\n    return max;\n  }\n  return Math.round((max - min) * decimal + min);\n}\nfunction getClassName(props) {\n  var orientation = props.orientation === 'vertical' ? 'rheostat-vertical' : 'rheostat-horizontal';\n  return ['rheostat', orientation].concat(props.className.split(' ')).join(' ');\n}\nfunction getHandleFor(ev) {\n  return Number(ev.currentTarget.getAttribute('data-handle-key'));\n}\nfunction killEvent(ev) {\n  ev.stopPropagation();\n  ev.preventDefault();\n}\nfunction Button(props) {\n  return h(\"button\", _extends({}, props, {\n    type: \"button\"\n  }));\n}\n\n// Preact doesn't have builtin types for Style, JSX.HTMLAttributes['style'] is just object\n// maybe migrate to csstype later?\nvar _ref6 = h(\"div\", {\n  className: \"rheostat-background\"\n});\nvar Rheostat = /*#__PURE__*/function (_Component) {\n  _inherits(Rheostat, _Component);\n  var _super = _createSuper(Rheostat);\n  function Rheostat() {\n    var _this;\n    _classCallCheck(this, Rheostat);\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    _this = _super.call.apply(_super, [this].concat(args));\n    _defineProperty(_assertThisInitialized(_this), \"x\", [0, 0].map(function (y) {\n      return y;\n    }));\n    _defineProperty(_assertThisInitialized(_this), \"state\", {\n      className: getClassName(_this.props),\n      // non-null thanks to defaultProps\n      handlePos: _this.props.values.map(function (value) {\n        return getPosition(value, _this.props.min, _this.props.max);\n      }),\n      handleDimensions: 0,\n      mousePos: null,\n      sliderBox: {},\n      slidingIndex: null,\n      // non-null thanks to defaultProps\n      values: _this.props.values\n    });\n    _defineProperty(_assertThisInitialized(_this), \"rheostat\", createRef());\n    _defineProperty(_assertThisInitialized(_this), \"componentWillReceiveProps\", function (nextProps) {\n      var _this$props = _this.props,\n        className = _this$props.className,\n        disabled = _this$props.disabled,\n        min = _this$props.min,\n        max = _this$props.max,\n        orientation = _this$props.orientation;\n      var _this$state = _this.state,\n        values = _this$state.values,\n        slidingIndex = _this$state.slidingIndex;\n      var minMaxChanged = nextProps.min !== min || nextProps.max !== max;\n      var valuesChanged = values.length !== nextProps.values.length || values.some(function (value, idx) {\n        return nextProps.values[idx] !== value;\n      });\n      var orientationChanged = nextProps.className !== className || nextProps.orientation !== orientation;\n      var willBeDisabled = nextProps.disabled && !disabled;\n      if (orientationChanged) {\n        _this.setState({\n          className: getClassName(nextProps)\n        });\n      }\n      if (minMaxChanged || valuesChanged) _this.updateNewValues(nextProps);\n      if (willBeDisabled && slidingIndex !== null) {\n        _this.endSlide();\n      }\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getPublicState\", function () {\n      var _this$props2 = _this.props,\n        min = _this$props2.min,\n        max = _this$props2.max;\n      var values = _this.state.values;\n      return {\n        max: max,\n        min: min,\n        values: values\n      };\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getSliderBoundingBox\", function () {\n      // only gets called after render, so it will always be defined\n      var node = _this.rheostat.current;\n      var rect = node.getBoundingClientRect();\n      return {\n        height: rect.height || node.clientHeight,\n        left: rect.left,\n        top: rect.top,\n        width: rect.width || node.clientWidth\n      };\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getProgressStyle\", function (idx) {\n      var handlePos = _this.state.handlePos;\n      var value = handlePos[idx];\n      if (idx === 0) {\n        return _this.props.orientation === 'vertical' ? {\n          height: \"\".concat(value, \"%\"),\n          top: 0\n        } : {\n          left: 0,\n          width: \"\".concat(value, \"%\")\n        };\n      }\n      var prevValue = handlePos[idx - 1];\n      var diffValue = value - prevValue;\n      return _this.props.orientation === 'vertical' ? {\n        height: \"\".concat(diffValue, \"%\"),\n        top: \"\".concat(prevValue, \"%\")\n      } : {\n        left: \"\".concat(prevValue, \"%\"),\n        width: \"\".concat(diffValue, \"%\")\n      };\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getMinValue\", function (idx) {\n      return _this.state.values[idx - 1] ? Math.max(_this.props.min, _this.state.values[idx - 1]) : _this.props.min;\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getMaxValue\", function (idx) {\n      return _this.state.values[idx + 1] ? Math.min(_this.props.max, _this.state.values[idx + 1]) : _this.props.max;\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getHandleDimensions\", function (ev, sliderBox) {\n      var handleNode = ev.currentTarget || null;\n      if (!handleNode) return 0;\n      return _this.props.orientation === 'vertical' ? handleNode.clientHeight / sliderBox.height * PERCENT_FULL / 2 : handleNode.clientWidth / sliderBox.width * PERCENT_FULL / 2;\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getClosestSnapPoint\", function (value) {\n      // non-null thanks to defaultProps\n      if (!_this.props.snapPoints.length) return value;\n      return _this.props.snapPoints.reduce(function (snapTo, snap) {\n        return Math.abs(snapTo - value) < Math.abs(snap - value) ? snapTo : snap;\n      });\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getSnapPosition\", function (positionPercent) {\n      if (!_this.props.snap) return positionPercent;\n      var _ref = _this.props,\n        max = _ref.max,\n        min = _ref.min;\n      var value = getValue(positionPercent, min, max);\n      var snapValue = _this.getClosestSnapPoint(value);\n      return getPosition(snapValue, min, max);\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getNextPositionForKey\", function (idx, keyCode) {\n      var _stepMultiplier;\n      var _this$state2 = _this.state,\n        handlePos = _this$state2.handlePos,\n        values = _this$state2.values;\n      var _ref2 = _this.props,\n        max = _ref2.max,\n        min = _ref2.min,\n        snapPoints = _ref2.snapPoints;\n      var shouldSnap = _this.props.snap;\n      var proposedValue = values[idx];\n      var proposedPercentage = handlePos[idx];\n      var originalPercentage = proposedPercentage;\n      var stepValue = 1;\n      if (max >= 100) {\n        proposedPercentage = Math.round(proposedPercentage);\n      } else {\n        stepValue = 100 / (max - min);\n      }\n      var currentIndex = null;\n      if (shouldSnap) {\n        currentIndex = snapPoints.indexOf(_this.getClosestSnapPoint(values[idx]));\n      }\n      var stepMultiplier = (_stepMultiplier = {}, _defineProperty(_stepMultiplier, KEYS.LEFT, function (v) {\n        return v * -1;\n      }), _defineProperty(_stepMultiplier, KEYS.RIGHT, function (v) {\n        return v;\n      }), _defineProperty(_stepMultiplier, KEYS.UP, function (v) {\n        return v;\n      }), _defineProperty(_stepMultiplier, KEYS.DOWN, function (v) {\n        return v * -1;\n      }), _defineProperty(_stepMultiplier, KEYS.PAGE_DOWN, function (v) {\n        return v > 1 ? -v : v * -10;\n      }), _defineProperty(_stepMultiplier, KEYS.PAGE_UP, function (v) {\n        return v > 1 ? v : v * 10;\n      }), _stepMultiplier);\n      if (Object.prototype.hasOwnProperty.call(stepMultiplier, keyCode)) {\n        proposedPercentage += stepMultiplier[keyCode](stepValue);\n        if (shouldSnap) {\n          if (!currentIndex) {\n            // nothing happens\n          } else if (proposedPercentage > originalPercentage) {\n            // move cursor right unless overflow\n            if (currentIndex < snapPoints.length - 1) {\n              proposedValue = snapPoints[currentIndex + 1];\n            }\n            // move cursor left unless there is overflow\n          } else if (currentIndex > 0) {\n            proposedValue = snapPoints[currentIndex - 1];\n          }\n        }\n      } else if (keyCode === KEYS.HOME) {\n        proposedPercentage = PERCENT_EMPTY;\n        if (shouldSnap) {\n          proposedValue = snapPoints[0];\n        }\n      } else if (keyCode === KEYS.END) {\n        proposedPercentage = PERCENT_FULL;\n        if (shouldSnap) {\n          proposedValue = snapPoints[snapPoints.length - 1];\n        }\n      } else {\n        return null;\n      }\n      return shouldSnap ? getPosition(proposedValue, min, max) : proposedPercentage;\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getNextState\", function (idx, proposedPosition) {\n      var handlePos = _this.state.handlePos;\n      var _ref3 = _this.props,\n        max = _ref3.max,\n        min = _ref3.min;\n      var actualPosition = _this.validatePosition(idx, proposedPosition);\n      var nextHandlePos = handlePos.map(function (pos, index) {\n        return index === idx ? actualPosition : pos;\n      });\n      return {\n        handlePos: nextHandlePos,\n        values: nextHandlePos.map(function (pos) {\n          return getValue(pos, min, max);\n        })\n      };\n    });\n    _defineProperty(_assertThisInitialized(_this), \"getClosestHandle\", function (positionPercent) {\n      var handlePos = _this.state.handlePos;\n      return handlePos.reduce(function (closestIdx, _node, idx) {\n        var challenger = Math.abs(handlePos[idx] - positionPercent);\n        var current = Math.abs(handlePos[closestIdx] - positionPercent);\n        return challenger < current ? idx : closestIdx;\n      }, 0);\n    });\n    _defineProperty(_assertThisInitialized(_this), \"setStartSlide\", function (ev, x, y) {\n      var sliderBox = _this.getSliderBoundingBox();\n      _this.setState({\n        handleDimensions: _this.getHandleDimensions(ev, sliderBox),\n        mousePos: {\n          x: x,\n          y: y\n        },\n        sliderBox: sliderBox,\n        slidingIndex: getHandleFor(ev)\n      });\n    });\n    _defineProperty(_assertThisInitialized(_this), \"startMouseSlide\", function (ev) {\n      _this.setStartSlide(ev, ev.clientX, ev.clientY);\n      document.addEventListener('mousemove', _this.handleMouseSlide, false);\n      document.addEventListener('mouseup', _this.endSlide, false);\n      killEvent(ev);\n    });\n    _defineProperty(_assertThisInitialized(_this), \"startTouchSlide\", function (ev) {\n      if (ev.changedTouches.length > 1) return;\n      var touch = ev.changedTouches[0];\n      _this.setStartSlide(ev, touch.clientX, touch.clientY);\n      document.addEventListener('touchmove', _this.handleTouchSlide, false);\n      document.addEventListener('touchend', _this.endSlide, false);\n      if (_this.props.onSliderDragStart) _this.props.onSliderDragStart();\n      killEvent(ev);\n    });\n    _defineProperty(_assertThisInitialized(_this), \"handleMouseSlide\", function (ev) {\n      if (_this.state.slidingIndex === null) return;\n      _this.handleSlide(ev.clientX, ev.clientY);\n      killEvent(ev);\n    });\n    _defineProperty(_assertThisInitialized(_this), \"handleTouchSlide\", function (ev) {\n      if (_this.state.slidingIndex === null) return;\n      if (ev.changedTouches.length > 1) {\n        _this.endSlide();\n        return;\n      }\n      var touch = ev.changedTouches[0];\n      _this.handleSlide(touch.clientX, touch.clientY);\n      killEvent(ev);\n    });\n    _defineProperty(_assertThisInitialized(_this), \"handleSlide\", function (x, y) {\n      var _this$state3 = _this.state,\n        idx = _this$state3.slidingIndex,\n        sliderBox = _this$state3.sliderBox;\n      var positionPercent = _this.props.orientation === 'vertical' ? (y - sliderBox.top) / sliderBox.height * PERCENT_FULL : (x - sliderBox.left) / sliderBox.width * PERCENT_FULL;\n      _this.slideTo(idx, positionPercent);\n      if (_this.canMove(idx, positionPercent)) {\n        // update mouse positions\n        _this.setState({\n          mousePos: {\n            x: x,\n            y: y\n          }\n        });\n        if (_this.props.onSliderDragMove) _this.props.onSliderDragMove();\n      }\n    });\n    _defineProperty(_assertThisInitialized(_this), \"endSlide\", function () {\n      var idx = _this.state.slidingIndex;\n      _this.setState({\n        slidingIndex: null\n      });\n      document.removeEventListener('mouseup', _this.endSlide, false);\n      document.removeEventListener('touchend', _this.endSlide, false);\n      document.removeEventListener('touchmove', _this.handleTouchSlide, false);\n      document.removeEventListener('mousemove', _this.handleMouseSlide, false);\n      if (_this.props.onSliderDragEnd) _this.props.onSliderDragEnd();\n      if (_this.props.snap) {\n        var positionPercent = _this.getSnapPosition(_this.state.handlePos[idx]);\n        _this.slideTo(idx, positionPercent, function () {\n          return _this.fireChangeEvent();\n        });\n      } else {\n        _this.fireChangeEvent();\n      }\n    });\n    _defineProperty(_assertThisInitialized(_this), \"handleClick\", function (ev) {\n      if (ev.target.getAttribute('data-handle-key')) {\n        return;\n      }\n\n      // Calculate the position of the slider on the page so we can determine\n      // the position where you click in relativity.\n      var sliderBox = _this.getSliderBoundingBox();\n      var positionDecimal = _this.props.orientation === 'vertical' ? (ev.clientY - sliderBox.top) / sliderBox.height : (ev.clientX - sliderBox.left) / sliderBox.width;\n      var positionPercent = positionDecimal * PERCENT_FULL;\n      var handleId = _this.getClosestHandle(positionPercent);\n      var validPositionPercent = _this.getSnapPosition(positionPercent);\n\n      // Move the handle there\n      _this.slideTo(handleId, validPositionPercent, function () {\n        return _this.fireChangeEvent();\n      });\n      if (_this.props.onClick) _this.props.onClick();\n    });\n    _defineProperty(_assertThisInitialized(_this), \"handleKeydown\", function (ev) {\n      var idx = getHandleFor(ev);\n      if (ev.keyCode === KEYS.ESC) {\n        ev.currentTarget.blur();\n        return;\n      }\n      var proposedPercentage = _this.getNextPositionForKey(idx, ev.keyCode);\n      if (proposedPercentage === null) return;\n      if (_this.canMove(idx, proposedPercentage)) {\n        _this.slideTo(idx, proposedPercentage, function () {\n          return _this.fireChangeEvent();\n        });\n        if (_this.props.onKeyPress) _this.props.onKeyPress();\n      }\n      killEvent(ev);\n    });\n    // Make sure the proposed position respects the bounds and\n    // does not collide with other handles too much.\n    _defineProperty(_assertThisInitialized(_this), \"validatePosition\", function (idx, proposedPosition) {\n      var _this$state4 = _this.state,\n        handlePos = _this$state4.handlePos,\n        handleDimensions = _this$state4.handleDimensions;\n      return Math.max(Math.min(proposedPosition, handlePos[idx + 1] !== undefined ? handlePos[idx + 1] - handleDimensions : PERCENT_FULL // 100% is the highest value\n      ), handlePos[idx - 1] !== undefined ? handlePos[idx - 1] + handleDimensions : PERCENT_EMPTY // 0% is the lowest value\n      );\n    });\n    _defineProperty(_assertThisInitialized(_this), \"validateValues\", function (proposedValues, props) {\n      var _ref4 = props || _this.props,\n        max = _ref4.max,\n        min = _ref4.min;\n      return proposedValues.map(function (value, idx, values) {\n        var realValue = Math.max(Math.min(value, max), min);\n        if (values.length && realValue < values[idx - 1]) {\n          return values[idx - 1];\n        }\n        return realValue;\n      });\n    });\n    _defineProperty(_assertThisInitialized(_this), \"canMove\", function (idx, proposedPosition) {\n      var _this$state5 = _this.state,\n        handlePos = _this$state5.handlePos,\n        handleDimensions = _this$state5.handleDimensions;\n      if (proposedPosition < PERCENT_EMPTY) return false;\n      if (proposedPosition > PERCENT_FULL) return false;\n      var nextHandlePosition = handlePos[idx + 1] !== undefined ? handlePos[idx + 1] - handleDimensions : Infinity;\n      if (proposedPosition > nextHandlePosition) return false;\n      var prevHandlePosition = handlePos[idx - 1] !== undefined ? handlePos[idx - 1] + handleDimensions : -Infinity;\n      if (proposedPosition < prevHandlePosition) return false;\n      return true;\n    });\n    _defineProperty(_assertThisInitialized(_this), \"fireChangeEvent\", function () {\n      var onChange = _this.props.onChange;\n      if (onChange) onChange(_this.getPublicState());\n    });\n    _defineProperty(_assertThisInitialized(_this), \"slideTo\", function (idx, proposedPosition, onAfterSet) {\n      var nextState = _this.getNextState(idx, proposedPosition);\n      _this.setState(nextState, function () {\n        var onValuesUpdated = _this.props.onValuesUpdated;\n        if (onValuesUpdated) onValuesUpdated(_this.getPublicState());\n        if (onAfterSet) onAfterSet();\n      });\n    });\n    _defineProperty(_assertThisInitialized(_this), \"updateNewValues\", function (nextProps) {\n      var slidingIndex = _this.state.slidingIndex;\n\n      // Don't update while the slider is sliding\n      if (slidingIndex !== null) {\n        return;\n      }\n      var max = nextProps.max,\n        min = nextProps.min,\n        values = nextProps.values;\n      var nextValues = _this.validateValues(values, nextProps);\n      _this.setState({\n        handlePos: nextValues.map(function (value) {\n          return getPosition(value, min, max);\n        }),\n        values: nextValues\n      }, function () {\n        return _this.fireChangeEvent();\n      });\n    });\n    _defineProperty(_assertThisInitialized(_this), \"render\", function () {\n      var _ref5 = _this.props,\n        children = _ref5.children,\n        disabled = _ref5.disabled,\n        Handle = _ref5.handle,\n        max = _ref5.max,\n        min = _ref5.min,\n        orientation = _ref5.orientation,\n        PitComponent = _ref5.pitComponent,\n        pitPoints = _ref5.pitPoints,\n        ProgressBar = _ref5.progressBar; // all required thanks to defaultProps\n      var _this$state6 = _this.state,\n        className = _this$state6.className,\n        handlePos = _this$state6.handlePos,\n        values = _this$state6.values;\n      return h(\"div\", {\n        className: className,\n        ref: _this.rheostat,\n        onClick: disabled ? undefined : _this.handleClick,\n        style: {\n          position: 'relative'\n        }\n      }, _ref6, handlePos.map(function (pos, idx) {\n        var handleStyle = orientation === 'vertical' ? {\n          top: \"\".concat(pos, \"%\"),\n          position: 'absolute'\n        } : {\n          left: \"\".concat(pos, \"%\"),\n          position: 'absolute'\n        };\n        return h(Handle, {\n          \"aria-valuemax\": _this.getMaxValue(idx),\n          \"aria-valuemin\": _this.getMinValue(idx),\n          \"aria-valuenow\": values[idx],\n          \"aria-disabled\": disabled,\n          \"data-handle-key\": idx,\n          className: \"rheostat-handle\",\n          key: \"handle-\".concat(idx),\n          onClick: killEvent,\n          onKeyDown: disabled ? undefined : _this.handleKeydown,\n          onMouseDown: disabled ? undefined : _this.startMouseSlide,\n          onTouchStart: disabled ? undefined : _this.startTouchSlide,\n          role: \"slider\",\n          style: handleStyle,\n          tabIndex: 0\n        });\n      }), handlePos.map(function (_node, idx, arr) {\n        if (idx === 0 && arr.length > 1) {\n          return null;\n        }\n        return h(ProgressBar, {\n          className: \"rheostat-progress\",\n          key: \"progress-bar-\".concat(idx),\n          style: _this.getProgressStyle(idx)\n        });\n      }), PitComponent && pitPoints.map(function (n) {\n        var pos = getPosition(n, min, max);\n        var pitStyle = orientation === 'vertical' ? {\n          top: \"\".concat(pos, \"%\"),\n          position: 'absolute'\n        } : {\n          left: \"\".concat(pos, \"%\"),\n          position: 'absolute'\n        };\n        return h(PitComponent, {\n          key: \"pit-\".concat(n),\n          style: pitStyle\n        }, n);\n      }), children);\n    });\n    return _this;\n  }\n  return _createClass(Rheostat);\n}(Component);\n_defineProperty(Rheostat, \"defaultProps\", {\n  className: '',\n  children: null,\n  disabled: false,\n  handle: Button,\n  max: PERCENT_FULL,\n  min: PERCENT_EMPTY,\n  onClick: null,\n  onChange: null,\n  onKeyPress: null,\n  onSliderDragEnd: null,\n  onSliderDragMove: null,\n  onSliderDragStart: null,\n  onValuesUpdated: null,\n  orientation: 'horizontal',\n  pitComponent: null,\n  pitPoints: [],\n  progressBar: 'div',\n  snap: false,\n  snapPoints: [],\n  values: [PERCENT_EMPTY]\n});\nexport default Rheostat;"
  },
  {
    "path": "js/instantsearch.js/es/components/Slider/Slider.d.ts",
    "content": "\nimport { h, Component } from 'preact';\nimport type { RangeBoundaries } from '../../connectors/range/connectRange';\nimport type { ComponentCSSClasses } from '../../types';\nimport type { RangeSliderCssClasses, RangeSliderWidgetParams } from '../../widgets/range-slider/range-slider';\nexport type RangeSliderComponentCSSClasses = ComponentCSSClasses<RangeSliderCssClasses>;\nexport type SliderProps = {\n    refine: (values: RangeBoundaries) => void;\n    min?: number;\n    max?: number;\n    values: RangeBoundaries;\n    pips?: boolean;\n    step?: number;\n    tooltips?: RangeSliderWidgetParams['tooltips'];\n    cssClasses: RangeSliderComponentCSSClasses;\n};\ndeclare class Slider extends Component<SliderProps> {\n    private get isDisabled();\n    private handleChange;\n    private computeDefaultPitPoints;\n    private computeSnapPoints;\n    private createHandleComponent;\n    render(): h.JSX.Element;\n}\nexport default Slider;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/Slider/Slider.js",
    "content": "function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, Component } from 'preact';\nimport { range } from \"../../lib/utils/index.js\";\nimport Pit from \"./Pit.js\";\nimport Rheostat from \"./Rheostat.js\";\nvar Slider = /*#__PURE__*/function (_Component) {\n  _inherits(Slider, _Component);\n  var _super = _createSuper(Slider);\n  function Slider() {\n    var _this;\n    _classCallCheck(this, Slider);\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    _this = _super.call.apply(_super, [this].concat(args));\n    _defineProperty(_assertThisInitialized(_this), \"handleChange\", function (_ref) {\n      var values = _ref.values;\n      if (!_this.isDisabled) {\n        _this.props.refine(values);\n      }\n    });\n    _defineProperty(_assertThisInitialized(_this), \"createHandleComponent\", function (tooltips) {\n      return function (props) {\n        // display only two decimals after comma,\n        // and apply `tooltips.format()` if any\n        var roundedValue = Math.round(\n        // have to cast as a string, as the value given to the prop is a number, but becomes a string when read\n        parseFloat(props['aria-valuenow']) * 100) / 100;\n        var value = _typeof(tooltips) === 'object' && tooltips.format ? tooltips.format(roundedValue) : roundedValue;\n        var className = cx(props.className, props['data-handle-key'] === 0 && 'rheostat-handle-lower', props['data-handle-key'] === 1 && 'rheostat-handle-upper');\n        var ariaLabel = props['data-handle-key'] === 0 ? 'Minimum Filter Handle' : 'Maximum Filter Handle';\n        return h(\"div\", _extends({}, props, {\n          className: className,\n          \"aria-label\": ariaLabel\n        }), tooltips && h(\"div\", {\n          className: \"rheostat-tooltip\"\n        }, value));\n      };\n    });\n    return _this;\n  }\n  _createClass(Slider, [{\n    key: \"isDisabled\",\n    get: function get() {\n      return this.props.min >= this.props.max;\n    }\n  }, {\n    key: \"computeDefaultPitPoints\",\n    value:\n    // creates an array number where to display a pit point on the slider\n    function computeDefaultPitPoints(_ref2) {\n      var min = _ref2.min,\n        max = _ref2.max;\n      var totalLength = max - min;\n      var steps = 34;\n      var stepsLength = totalLength / steps;\n      var pitPoints = [min].concat(_toConsumableArray(range({\n        end: steps - 1\n      }).map(function (step) {\n        return min + stepsLength * (step + 1);\n      })), [max]);\n      return pitPoints;\n    }\n\n    // creates an array of values where the slider should snap to\n  }, {\n    key: \"computeSnapPoints\",\n    value: function computeSnapPoints(_ref3) {\n      var min = _ref3.min,\n        max = _ref3.max,\n        step = _ref3.step;\n      if (!step) return undefined;\n      return [].concat(_toConsumableArray(range({\n        start: min,\n        end: max,\n        step: step\n      })), [max]);\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      var _this$props = this.props,\n        tooltips = _this$props.tooltips,\n        step = _this$props.step,\n        pips = _this$props.pips,\n        values = _this$props.values,\n        cssClasses = _this$props.cssClasses;\n\n      // @TODO: figure out why this.props needs to be non-null asserted\n      var _ref4 = this.isDisabled ? {\n          min: this.props.min,\n          max: this.props.max + 0.001\n        } : this.props,\n        min = _ref4.min,\n        max = _ref4.max;\n      var snapPoints = this.computeSnapPoints({\n        min: min,\n        max: max,\n        step: step\n      });\n      var pitPoints = pips === false ? [] : this.computeDefaultPitPoints({\n        min: min,\n        max: max\n      });\n      return h(\"div\", {\n        className: cx(cssClasses.root, this.isDisabled && cssClasses.disabledRoot)\n      }, h(Rheostat, {\n        handle: this.createHandleComponent(tooltips),\n        onChange: this.handleChange,\n        min: min,\n        max: max,\n        pitComponent: Pit,\n        pitPoints: pitPoints,\n        snap: true,\n        snapPoints: snapPoints,\n        values: this.isDisabled ? [min, max] : values,\n        disabled: this.isDisabled\n      }));\n    }\n  }]);\n  return Slider;\n}(Component);\nexport default Slider;"
  },
  {
    "path": "js/instantsearch.js/es/components/Snippet/Snippet.d.ts",
    "content": "import { h } from 'preact';\nimport type { HighlightProps as InternalHighlightProps, HighlightClassNames as InternalHighlightClassNames } from 'instantsearch-ui-components';\nexport type SnippetClassNames = InternalHighlightClassNames;\nexport type SnippetProps = Omit<InternalHighlightProps, 'classNames'> & {\n    classNames?: Partial<SnippetClassNames>;\n};\nexport declare function Snippet({ classNames, ...props }: SnippetProps): h.JSX.Element;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/Snippet/Snippet.js",
    "content": "var _excluded = [\"classNames\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport { cx } from 'instantsearch-ui-components';\nimport { h } from 'preact';\nimport { InternalHighlight } from \"../InternalHighlight/InternalHighlight.js\";\nexport function Snippet(_ref) {\n  var _ref$classNames = _ref.classNames,\n    classNames = _ref$classNames === void 0 ? {} : _ref$classNames,\n    props = _objectWithoutProperties(_ref, _excluded);\n  return h(InternalHighlight, _extends({\n    classNames: {\n      root: cx('ais-Snippet', classNames.root),\n      highlighted: cx('ais-Snippet-highlighted', classNames.highlighted),\n      nonHighlighted: cx('ais-Snippet-nonHighlighted', classNames.nonHighlighted),\n      separator: cx('ais-Snippet-separator', classNames.separator)\n    }\n  }, props));\n}"
  },
  {
    "path": "js/instantsearch.js/es/components/Stats/Stats.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { ComponentCSSClasses } from '../../types';\nimport type { StatsCSSClasses, StatsTemplates } from '../../widgets/stats/stats';\nexport type StatsComponentCSSClasses = ComponentCSSClasses<StatsCSSClasses>;\nexport type StatsComponentTemplates = Required<StatsTemplates>;\ntype StatsProps = {\n    cssClasses: StatsComponentCSSClasses;\n    templateProps: {\n        [key: string]: any;\n        templates: StatsComponentTemplates;\n    };\n    hitsPerPage: number | undefined;\n    nbHits: number;\n    nbSortedHits: number | undefined;\n    areHitsSorted: boolean;\n    nbPages: number;\n    page: number;\n    processingTimeMS: number;\n    query: string;\n};\ndeclare const Stats: ({ nbHits, nbSortedHits, cssClasses, templateProps, ...rest }: StatsProps) => h.JSX.Element;\nexport default Stats;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/Stats/Stats.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _excluded = [\"nbHits\", \"nbSortedHits\", \"cssClasses\", \"templateProps\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport { cx } from 'instantsearch-ui-components';\nimport { h } from 'preact';\nimport Template from \"../Template/Template.js\";\nvar Stats = function Stats(_ref) {\n  var nbHits = _ref.nbHits,\n    nbSortedHits = _ref.nbSortedHits,\n    cssClasses = _ref.cssClasses,\n    templateProps = _ref.templateProps,\n    rest = _objectWithoutProperties(_ref, _excluded);\n  return h(\"div\", {\n    className: cx(cssClasses.root)\n  }, h(Template, _extends({}, templateProps, {\n    templateKey: \"text\",\n    rootTagName: \"span\",\n    rootProps: {\n      className: cssClasses.text\n    },\n    data: _objectSpread({\n      hasManySortedResults: nbSortedHits && nbSortedHits > 1,\n      hasNoSortedResults: nbSortedHits === 0,\n      hasOneSortedResults: nbSortedHits === 1,\n      hasManyResults: nbHits > 1,\n      hasNoResults: nbHits === 0,\n      hasOneResult: nbHits === 1,\n      nbHits: nbHits,\n      nbSortedHits: nbSortedHits,\n      cssClasses: cssClasses\n    }, rest)\n  })));\n};\nexport default Stats;"
  },
  {
    "path": "js/instantsearch.js/es/components/Template/Template.d.ts",
    "content": "\nimport { h, Component } from 'preact';\nimport type { PreparedTemplateProps } from '../../lib/templating';\nimport type { BindEventForHits, SendEventForHits } from '../../lib/utils';\nimport type { Templates } from '../../types';\nimport type { JSX } from 'preact';\ndeclare const defaultProps: {\n    data: {};\n    rootTagName: string;\n    useCustomCompileOptions: {};\n    templates: {};\n    templatesConfig: {};\n};\nexport type TemplateProps = {\n    data?: Record<string, any>;\n    rootProps?: Record<string, any>;\n    rootTagName: keyof JSX.IntrinsicElements | 'fragment';\n    templateKey: string;\n    bindEvent?: BindEventForHits;\n    sendEvent?: SendEventForHits;\n} & PreparedTemplateProps<Templates> & Readonly<typeof defaultProps>;\ndeclare class Template extends Component<TemplateProps> {\n    static readonly defaultProps: {\n        data: {};\n        rootTagName: string;\n        useCustomCompileOptions: {};\n        templates: {};\n        templatesConfig: {};\n    };\n    shouldComponentUpdate(nextProps: TemplateProps): boolean;\n    render(): h.JSX.Element | null;\n}\nexport default Template;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/Template/Template.js",
    "content": "function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { h, Component, Fragment, createRef } from 'preact';\nimport { renderTemplate } from \"../../lib/templating/index.js\";\nimport { warning, isEqual } from \"../../lib/utils/index.js\";\nvar RawHtml = /*#__PURE__*/function (_Component) {\n  _inherits(RawHtml, _Component);\n  var _super = _createSuper(RawHtml);\n  function RawHtml() {\n    var _this;\n    _classCallCheck(this, RawHtml);\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    _this = _super.call.apply(_super, [this].concat(args));\n    _defineProperty(_assertThisInitialized(_this), \"ref\", createRef());\n    _defineProperty(_assertThisInitialized(_this), \"nodes\", []);\n    return _this;\n  }\n  _createClass(RawHtml, [{\n    key: \"componentDidMount\",\n    value: function componentDidMount() {\n      var fragment = new DocumentFragment();\n      var root = document.createElement('div');\n      root.innerHTML = this.props.content;\n      this.nodes = _toConsumableArray(root.childNodes);\n      this.nodes.forEach(function (node) {\n        return fragment.appendChild(node);\n      });\n      this.ref.current.replaceWith(fragment);\n    }\n  }, {\n    key: \"componentWillUnmount\",\n    value: function componentWillUnmount() {\n      this.nodes.forEach(function (node) {\n        if (node instanceof Element) {\n          node.outerHTML = '';\n          return;\n        }\n        node.nodeValue = '';\n      });\n      // if there is one TextNode first and one TextNode last, the\n      // last one's nodeValue will be assigned to the first.\n      if (this.nodes[0].nodeValue) {\n        this.nodes[0].nodeValue = '';\n      }\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      return h(\"div\", {\n        ref: this.ref\n      });\n    }\n  }]);\n  return RawHtml;\n}(Component);\nvar defaultProps = {\n  data: {},\n  rootTagName: 'div',\n  useCustomCompileOptions: {},\n  templates: {},\n  templatesConfig: {}\n};\n// @TODO: Template should be a generic and receive TData to pass to Templates (to avoid TTemplateData to be set as `any`)\nvar Template = /*#__PURE__*/function (_Component2) {\n  _inherits(Template, _Component2);\n  var _super2 = _createSuper(Template);\n  function Template() {\n    _classCallCheck(this, Template);\n    return _super2.apply(this, arguments);\n  }\n  _createClass(Template, [{\n    key: \"shouldComponentUpdate\",\n    value: function shouldComponentUpdate(nextProps) {\n      return !isEqual(this.props.data, nextProps.data) || this.props.templateKey !== nextProps.templateKey || !isEqual(this.props.rootProps, nextProps.rootProps);\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      var _this2 = this;\n      if (process.env.NODE_ENV === 'development') {\n        var nonFunctionTemplates = Object.keys(this.props.templates).filter(function (key) {\n          return typeof _this2.props.templates[key] !== 'function';\n        });\n        process.env.NODE_ENV === 'development' ? warning(nonFunctionTemplates.length === 0, \"Hogan.js and string-based templates are deprecated and will not be supported in InstantSearch.js 5.x.\\n\\nYou can replace them with function-form templates and use either the provided `html` function or JSX templates.\\n\\nString-based templates: \".concat(nonFunctionTemplates.join(', '), \".\\n\\nSee: https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/#upgrade-templates\")) : void 0;\n      }\n      var RootTagName = this.props.rootTagName === 'fragment' ? Fragment : this.props.rootTagName;\n      var useCustomCompileOptions = this.props.useCustomCompileOptions[this.props.templateKey];\n      var compileOptions = useCustomCompileOptions ? this.props.templatesConfig.compileOptions : {};\n      var content = renderTemplate({\n        templates: this.props.templates,\n        templateKey: this.props.templateKey,\n        compileOptions: compileOptions,\n        helpers: this.props.templatesConfig.helpers,\n        data: this.props.data,\n        bindEvent: this.props.bindEvent,\n        sendEvent: this.props.sendEvent\n      });\n      if (content === null) {\n        // Adds a noscript to the DOM but virtual DOM is null\n        // See http://facebook.github.io/react/docs/component-specs.html#render\n        return null;\n      }\n      if (_typeof(content) === 'object') {\n        return h(RootTagName, this.props.rootProps, content);\n      }\n\n      // This is to handle Hogan templates with Fragment as rootTagName\n      if (RootTagName === Fragment) {\n        return h(RawHtml, {\n          content: content,\n          key: Math.random()\n        });\n      }\n      return h(RootTagName, _extends({}, this.props.rootProps, {\n        dangerouslySetInnerHTML: {\n          __html: content\n        }\n      }));\n    }\n  }]);\n  return Template;\n}(Component);\n_defineProperty(Template, \"defaultProps\", defaultProps);\nexport default Template;"
  },
  {
    "path": "js/instantsearch.js/es/components/ToggleRefinement/ToggleRefinement.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { ToggleRefinementRenderState, ToggleRefinementValue } from '../../connectors/toggle-refinement/connectToggleRefinement';\nimport type { PreparedTemplateProps } from '../../lib/templating';\nimport type { ComponentCSSClasses } from '../../types';\nimport type { ToggleRefinementTemplates, ToggleRefinementCSSClasses } from '../../widgets/toggle-refinement/toggle-refinement';\nexport type ToggleRefinementComponentCSSClasses = ComponentCSSClasses<ToggleRefinementCSSClasses>;\nexport type ToggleRefinementComponentTemplates = Required<ToggleRefinementTemplates>;\nexport type ToggleRefinementProps = {\n    currentRefinement: ToggleRefinementValue;\n    refine: ToggleRefinementRenderState['refine'];\n    cssClasses: ToggleRefinementComponentCSSClasses;\n    templateProps: PreparedTemplateProps<ToggleRefinementComponentTemplates>;\n};\ndeclare const ToggleRefinement: ({ currentRefinement, refine, cssClasses, templateProps, }: ToggleRefinementProps) => h.JSX.Element;\nexport default ToggleRefinement;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/ToggleRefinement/ToggleRefinement.js",
    "content": "function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport { h } from 'preact';\nimport Template from \"../Template/Template.js\";\nvar ToggleRefinement = function ToggleRefinement(_ref) {\n  var currentRefinement = _ref.currentRefinement,\n    refine = _ref.refine,\n    cssClasses = _ref.cssClasses,\n    templateProps = _ref.templateProps;\n  return h(\"div\", {\n    className: cssClasses.root\n  }, h(\"label\", {\n    className: cssClasses.label\n  }, h(\"input\", {\n    className: cssClasses.checkbox,\n    type: \"checkbox\",\n    checked: currentRefinement.isRefined,\n    onChange: function onChange(event) {\n      return refine({\n        isRefined: !event.target.checked\n      });\n    }\n  }), h(Template, _extends({}, templateProps, {\n    rootTagName: \"span\",\n    rootProps: {\n      className: cssClasses.labelText\n    },\n    templateKey: \"labelText\",\n    data: currentRefinement\n  }))));\n};\nexport default ToggleRefinement;"
  },
  {
    "path": "js/instantsearch.js/es/components/VoiceSearch/VoiceSearch.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { VoiceListeningState } from '../../lib/voiceSearchHelper/types';\nimport type { ComponentCSSClasses } from '../../types';\nimport type { VoiceSearchCSSClasses, VoiceSearchTemplates } from '../../widgets/voice-search/voice-search';\nexport type VoiceSearchComponentCSSClasses = ComponentCSSClasses<VoiceSearchCSSClasses>;\nexport type VoiceSearchComponentTemplates = Required<VoiceSearchTemplates>;\nexport type VoiceSearchProps = {\n    cssClasses: VoiceSearchComponentCSSClasses;\n    isBrowserSupported: boolean;\n    isListening: boolean;\n    toggleListening: () => void;\n    voiceListeningState: VoiceListeningState;\n    templates: VoiceSearchComponentTemplates;\n};\ndeclare const VoiceSearch: ({ cssClasses, isBrowserSupported, isListening, toggleListening, voiceListeningState, templates, }: VoiceSearchProps) => h.JSX.Element;\nexport default VoiceSearch;\n"
  },
  {
    "path": "js/instantsearch.js/es/components/VoiceSearch/VoiceSearch.js",
    "content": "import { h } from 'preact';\nimport Template from \"../Template/Template.js\";\nvar VoiceSearch = function VoiceSearch(_ref) {\n  var cssClasses = _ref.cssClasses,\n    isBrowserSupported = _ref.isBrowserSupported,\n    isListening = _ref.isListening,\n    toggleListening = _ref.toggleListening,\n    voiceListeningState = _ref.voiceListeningState,\n    templates = _ref.templates;\n  var handleClick = function handleClick(event) {\n    if (event.currentTarget instanceof HTMLElement) {\n      event.currentTarget.blur();\n    }\n    toggleListening();\n  };\n  var status = voiceListeningState.status,\n    transcript = voiceListeningState.transcript,\n    isSpeechFinal = voiceListeningState.isSpeechFinal,\n    errorCode = voiceListeningState.errorCode;\n  return h(\"div\", {\n    className: cssClasses.root\n  }, h(Template, {\n    templateKey: \"buttonText\",\n    rootTagName: \"button\",\n    rootProps: {\n      className: cssClasses.button,\n      type: 'button',\n      title: \"Search by voice\".concat(isBrowserSupported ? '' : ' (not supported on this browser)'),\n      onClick: handleClick,\n      disabled: !isBrowserSupported\n    },\n    data: {\n      status: status,\n      errorCode: errorCode,\n      isListening: isListening,\n      transcript: transcript,\n      isSpeechFinal: isSpeechFinal,\n      isBrowserSupported: isBrowserSupported\n    },\n    templates: templates\n  }), h(Template, {\n    templateKey: \"status\",\n    rootProps: {\n      className: cssClasses.status\n    },\n    data: {\n      status: status,\n      errorCode: errorCode,\n      isListening: isListening,\n      transcript: transcript,\n      isSpeechFinal: isSpeechFinal,\n      isBrowserSupported: isBrowserSupported\n    },\n    templates: templates\n  }));\n};\nexport default VoiceSearch;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/answers/connectAnswers.d.ts",
    "content": "import type { Connector, Hit, FindAnswersOptions, WidgetRenderState } from '../../types';\nexport type AnswersRenderState = {\n    /**\n     * The matched hits from Algolia API.\n     */\n    hits: Hit[];\n    /**\n     * Whether it's still loading the results from the Answers API.\n     */\n    isLoading: boolean;\n};\nexport type AnswersConnectorParams = {\n    /**\n     * Attributes to use for predictions.\n     * If empty, we use all `searchableAttributes` to find answers.\n     * All your `attributesForPrediction` must be part of your `searchableAttributes`.\n     */\n    attributesForPrediction?: string[];\n    /**\n     * The languages in the query. Currently only supports `en`.\n     */\n    queryLanguages: ['en'];\n    /**\n     * Maximum number of answers to retrieve from the Answers Engine.\n     * Cannot be greater than 1000.\n     * @default 1\n     */\n    nbHits?: number;\n    /**\n     * Debounce time in milliseconds to debounce render\n     * @default 100\n     */\n    renderDebounceTime?: number;\n    /**\n     * Debounce time in milliseconds to debounce search\n     * @default 100\n     */\n    searchDebounceTime?: number;\n    /**\n     * Whether to escape HTML tags from hits string values.\n     *\n     * @default true\n     */\n    escapeHTML?: boolean;\n    /**\n     * Extra parameters to pass to findAnswers method.\n     * @default {}\n     */\n    extraParameters?: FindAnswersOptions;\n};\nexport type AnswersWidgetDescription = {\n    $$type: 'ais.answers';\n    renderState: AnswersRenderState;\n    indexRenderState: {\n        answers: WidgetRenderState<AnswersRenderState, AnswersConnectorParams>;\n    };\n};\nexport type AnswersConnector = Connector<AnswersWidgetDescription, AnswersConnectorParams>;\n/**\n * @deprecated the answers service is no longer offered, and this widget will be removed in InstantSearch.js v5\n */\ndeclare const connectAnswers: AnswersConnector;\nexport default connectAnswers;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/answers/connectAnswers.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { checkRendering, createDocumentationMessageGenerator, createConcurrentSafePromise, addQueryID, debounce, addAbsolutePosition, noop, escapeHits } from \"../../lib/utils/index.js\";\nfunction hasFindAnswersMethod(answersIndex) {\n  return typeof answersIndex.findAnswers === 'function';\n}\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'answers',\n  connector: true\n});\n/**\n * @deprecated the answers service is no longer offered, and this widget will be removed in InstantSearch.js v5\n */\nvar connectAnswers = function connectAnswers(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      queryLanguages = _ref.queryLanguages,\n      attributesForPrediction = _ref.attributesForPrediction,\n      _ref$nbHits = _ref.nbHits,\n      nbHits = _ref$nbHits === void 0 ? 1 : _ref$nbHits,\n      _ref$renderDebounceTi = _ref.renderDebounceTime,\n      renderDebounceTime = _ref$renderDebounceTi === void 0 ? 100 : _ref$renderDebounceTi,\n      _ref$searchDebounceTi = _ref.searchDebounceTime,\n      searchDebounceTime = _ref$searchDebounceTi === void 0 ? 100 : _ref$searchDebounceTi,\n      _ref$escapeHTML = _ref.escapeHTML,\n      escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,\n      _ref$extraParameters = _ref.extraParameters,\n      extraParameters = _ref$extraParameters === void 0 ? {} : _ref$extraParameters;\n\n    // @ts-expect-error checking for the wrong value\n    if (!queryLanguages || queryLanguages.length === 0) {\n      throw new Error(withUsage('The `queryLanguages` expects an array of strings.'));\n    }\n    var runConcurrentSafePromise = createConcurrentSafePromise();\n    var lastHits = [];\n    var isLoading = false;\n    var debouncedRender = debounce(renderFn, renderDebounceTime);\n    var debouncedRefine;\n    return {\n      $$type: 'ais.answers',\n      init: function init(initOptions) {\n        var state = initOptions.state,\n          instantSearchInstance = initOptions.instantSearchInstance;\n        if (typeof instantSearchInstance.client.initIndex !== 'function') {\n          throw new Error(withUsage('`algoliasearch` <5 required.'));\n        }\n        var answersIndex = instantSearchInstance.client.initIndex(state.index);\n        if (!hasFindAnswersMethod(answersIndex)) {\n          throw new Error(withUsage('`algoliasearch` >= 4.8.0 required.'));\n        }\n        debouncedRefine = debounce(answersIndex.findAnswers, searchDebounceTime);\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var _this = this;\n        var query = renderOptions.state.query;\n        if (!query) {\n          // renders nothing with empty query\n          lastHits = [];\n          isLoading = false;\n          renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: renderOptions.instantSearchInstance\n          }), false);\n          return;\n        }\n\n        // render the loader\n        lastHits = [];\n        isLoading = true;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: renderOptions.instantSearchInstance\n        }), false);\n\n        // call /answers API\n        runConcurrentSafePromise(debouncedRefine(query, queryLanguages, _objectSpread(_objectSpread({}, extraParameters), {}, {\n          nbHits: nbHits,\n          attributesForPrediction: attributesForPrediction\n        }))).then(function (result) {\n          if (!result) {\n            // It's undefined when it's debounced.\n            return;\n          }\n          if (escapeHTML && result.hits.length > 0) {\n            result.hits = escapeHits(result.hits);\n          }\n          var hitsWithAbsolutePosition = addAbsolutePosition(result.hits, 0, nbHits);\n          var hitsWithAbsolutePositionAndQueryID = addQueryID(hitsWithAbsolutePosition, result.queryID);\n          lastHits = hitsWithAbsolutePositionAndQueryID;\n          isLoading = false;\n          debouncedRender(_objectSpread(_objectSpread({}, _this.getWidgetRenderState(renderOptions)), {}, {\n            instantSearchInstance: renderOptions.instantSearchInstance\n          }), false);\n        });\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          answers: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState() {\n        return {\n          hits: lastHits,\n          isLoading: isLoading,\n          widgetParams: widgetParams\n        };\n      },\n      dispose: function dispose(_ref2) {\n        var state = _ref2.state;\n        unmountFn();\n        return state;\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(state) {\n        return state;\n      }\n    };\n  };\n};\nexport default connectAnswers;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/autocomplete/connectAutocomplete.d.ts",
    "content": "import type { SendEventForHits } from '../../lib/utils';\nimport type { Hit, Connector, WidgetRenderState } from '../../types';\nimport type { SearchResults } from 'algoliasearch-helper';\nexport type AutocompleteConnectorParams = {\n    /**\n     * Escapes HTML entities from hits string values.\n     *\n     * @default `true`\n     */\n    escapeHTML?: boolean;\n};\nexport type AutocompleteRenderState = {\n    /**\n     * The current value of the query.\n     */\n    currentRefinement: string;\n    /**\n     * The indices this widget has access to.\n     */\n    indices: Array<{\n        /**\n         * The name of the index\n         */\n        indexName: string;\n        /**\n         * The id of the index\n         */\n        indexId: string;\n        /**\n         * The resolved hits from the index matching the query.\n         */\n        hits: Hit[];\n        /**\n         * The full results object from the Algolia API.\n         */\n        results: SearchResults;\n        /**\n         * Send event to insights middleware\n         */\n        sendEvent: SendEventForHits;\n    }>;\n    /**\n     * Searches into the indices with the provided query.\n     */\n    refine: (query: string) => void;\n};\nexport type AutocompleteWidgetDescription = {\n    $$type: 'ais.autocomplete';\n    renderState: AutocompleteRenderState;\n    indexRenderState: {\n        autocomplete: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams>;\n    };\n    indexUiState: {\n        query: string;\n    };\n};\nexport type AutocompleteConnector = Connector<AutocompleteWidgetDescription, AutocompleteConnectorParams>;\ndeclare const connectAutocomplete: AutocompleteConnector;\nexport default connectAutocomplete;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/autocomplete/connectAutocomplete.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { escapeHits, TAG_PLACEHOLDER, checkRendering, createDocumentationMessageGenerator, createSendEventForHits, noop, warning } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'autocomplete',\n  connector: true\n});\nvar connectAutocomplete = function connectAutocomplete(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      _ref$escapeHTML = _ref.escapeHTML,\n      escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML;\n    process.env.NODE_ENV === 'development' ? warning(!widgetParams.indices, \"\\nThe option `indices` has been removed from the Autocomplete connector.\\n\\nThe indices to target are now inferred from the widgets tree.\\n\".concat(Array.isArray(widgetParams.indices) ? \"\\nAn alternative would be:\\n\\nconst autocomplete = connectAutocomplete(renderer);\\n\\nsearch.addWidgets([\\n  \".concat(widgetParams.indices.map(function (_ref2) {\n      var value = _ref2.value;\n      return \"index({ indexName: '\".concat(value, \"' }),\");\n    }).join('\\n  '), \"\\n  autocomplete()\\n]);\\n\") : '', \"\\n      \")) : void 0;\n    var connectorState = {};\n    return {\n      $$type: 'ais.autocomplete',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        var renderState = this.getWidgetRenderState(renderOptions);\n        renderState.indices.forEach(function (_ref3) {\n          var sendEvent = _ref3.sendEvent,\n            hits = _ref3.hits;\n          sendEvent('view:internal', hits);\n        });\n        renderFn(_objectSpread(_objectSpread({}, renderState), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          autocomplete: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref4) {\n        var _this = this;\n        var helper = _ref4.helper,\n          state = _ref4.state,\n          scopedResults = _ref4.scopedResults,\n          instantSearchInstance = _ref4.instantSearchInstance;\n        if (!connectorState.refine) {\n          connectorState.refine = function (query) {\n            helper.setQuery(query).search();\n          };\n        }\n        var indices = scopedResults.map(function (scopedResult) {\n          var _scopedResult$results, _scopedResult$results2;\n          // We need to escape the hits because highlighting\n          // exposes HTML tags to the end-user.\n          if (scopedResult.results) {\n            scopedResult.results.hits = escapeHTML ? escapeHits(scopedResult.results.hits) : scopedResult.results.hits;\n          }\n          var sendEvent = createSendEventForHits({\n            instantSearchInstance: instantSearchInstance,\n            helper: scopedResult.helper,\n            widgetType: _this.$$type\n          });\n          return {\n            indexId: scopedResult.indexId,\n            indexName: ((_scopedResult$results = scopedResult.results) === null || _scopedResult$results === void 0 ? void 0 : _scopedResult$results.index) || '',\n            hits: ((_scopedResult$results2 = scopedResult.results) === null || _scopedResult$results2 === void 0 ? void 0 : _scopedResult$results2.hits) || [],\n            results: scopedResult.results || {},\n            sendEvent: sendEvent\n          };\n        });\n        return {\n          currentRefinement: state.query || '',\n          indices: indices,\n          refine: connectorState.refine,\n          widgetParams: widgetParams\n        };\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref5) {\n        var searchParameters = _ref5.searchParameters;\n        var query = searchParameters.query || '';\n        if (query === '' || uiState && uiState.query === query) {\n          return uiState;\n        }\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          query: query\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref6) {\n        var uiState = _ref6.uiState;\n        var parameters = {\n          query: uiState.query || ''\n        };\n        if (!escapeHTML) {\n          return searchParameters.setQueryParameters(parameters);\n        }\n        return searchParameters.setQueryParameters(_objectSpread(_objectSpread({}, parameters), TAG_PLACEHOLDER));\n      },\n      dispose: function dispose(_ref7) {\n        var state = _ref7.state;\n        unmountFn();\n        var stateWithoutQuery = state.setQueryParameter('query', undefined);\n        if (!escapeHTML) {\n          return stateWithoutQuery;\n        }\n        return stateWithoutQuery.setQueryParameters(Object.keys(TAG_PLACEHOLDER).reduce(function (acc, key) {\n          return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, undefined));\n        }, {}));\n      }\n    };\n  };\n};\nexport default connectAutocomplete;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/breadcrumb/connectBreadcrumb.d.ts",
    "content": "import type { Connector, TransformItems, CreateURL, WidgetRenderState } from '../../types';\nexport type BreadcrumbConnectorParamsItem = {\n    /**\n     * Label of the category or subcategory.\n     */\n    label: string;\n    /**\n     * Value of breadcrumb item.\n     */\n    value: string | null;\n};\nexport type BreadcrumbConnectorParams = {\n    /**\n     * Attributes to use to generate the hierarchy of the breadcrumb.\n     */\n    attributes: string[];\n    /**\n     * Prefix path to use if the first level is not the root level.\n     */\n    rootPath?: string;\n    /**\n     * Function to transform the items passed to the templates.\n     */\n    transformItems?: TransformItems<BreadcrumbConnectorParamsItem>;\n    /**\n     * The level separator used in the records.\n     *\n     * @default '>'\n     */\n    separator?: string;\n};\nexport type BreadcrumbRenderState = {\n    /**\n     * Creates the URL for a single item name in the list.\n     */\n    createURL: CreateURL<BreadcrumbConnectorParamsItem['value']>;\n    /**\n     * Array of objects defining the different values and labels.\n     */\n    items: BreadcrumbConnectorParamsItem[];\n    /**\n     * Sets the path of the hierarchical filter and triggers a new search.\n     */\n    refine: (value: BreadcrumbConnectorParamsItem['value']) => void;\n    /**\n     * True if refinement can be applied.\n     */\n    canRefine: boolean;\n};\nexport type BreadcrumbWidgetDescription = {\n    $$type: 'ais.breadcrumb';\n    renderState: BreadcrumbRenderState;\n    indexRenderState: {\n        breadcrumb: {\n            [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;\n        };\n    };\n};\nexport type BreadcrumbConnector = Connector<BreadcrumbWidgetDescription, BreadcrumbConnectorParams>;\ndeclare const connectBreadcrumb: BreadcrumbConnector;\nexport default connectBreadcrumb;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/breadcrumb/connectBreadcrumb.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nimport { checkRendering, warning, createDocumentationMessageGenerator, isEqual, noop } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'breadcrumb',\n  connector: true\n});\nvar connectBreadcrumb = function connectBreadcrumb(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  var connectorState = {};\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      attributes = _ref.attributes,\n      _ref$separator = _ref.separator,\n      separator = _ref$separator === void 0 ? ' > ' : _ref$separator,\n      _ref$rootPath = _ref.rootPath,\n      rootPath = _ref$rootPath === void 0 ? null : _ref$rootPath,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    if (!attributes || !Array.isArray(attributes) || attributes.length === 0) {\n      throw new Error(withUsage('The `attributes` option expects an array of strings.'));\n    }\n    var _attributes = _slicedToArray(attributes, 1),\n      hierarchicalFacetName = _attributes[0];\n    function getRefinedState(state, facetValue) {\n      if (!facetValue) {\n        var breadcrumb = state.getHierarchicalFacetBreadcrumb(hierarchicalFacetName);\n        if (breadcrumb.length === 0) {\n          return state;\n        } else {\n          return state.resetPage().toggleFacetRefinement(hierarchicalFacetName, breadcrumb[0]);\n        }\n      }\n      return state.resetPage().toggleFacetRefinement(hierarchicalFacetName, facetValue);\n    }\n    return {\n      $$type: 'ais.breadcrumb',\n      init: function init(initOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: renderOptions.instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose() {\n        unmountFn();\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          breadcrumb: _objectSpread(_objectSpread({}, renderState.breadcrumb), {}, _defineProperty({}, hierarchicalFacetName, this.getWidgetRenderState(renderOptions)))\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref2) {\n        var _this = this;\n        var helper = _ref2.helper,\n          createURL = _ref2.createURL,\n          results = _ref2.results,\n          state = _ref2.state;\n        function getItems() {\n          // The hierarchicalFacets condition is required for flavors\n          // that render immediately with empty results, without relying\n          // on init() (like React InstantSearch).\n          if (!results || state.hierarchicalFacets.length === 0) {\n            return [];\n          }\n          var _state$hierarchicalFa = _slicedToArray(state.hierarchicalFacets, 1),\n            facetName = _state$hierarchicalFa[0].name;\n          var facetValues = results.getFacetValues(facetName, {});\n          var facetItems = facetValues && !Array.isArray(facetValues) && facetValues.data ? facetValues.data : [];\n          var items = transformItems(shiftItemsValues(prepareItems(facetItems)), {\n            results: results\n          });\n          return items;\n        }\n        var items = getItems();\n        if (!connectorState.createURL) {\n          connectorState.createURL = function (facetValue) {\n            return createURL(function (uiState) {\n              return _this.getWidgetUiState(uiState, {\n                searchParameters: getRefinedState(helper.state, facetValue),\n                helper: helper\n              });\n            });\n          };\n        }\n        if (!connectorState.refine) {\n          connectorState.refine = function (facetValue) {\n            helper.setState(getRefinedState(helper.state, facetValue)).search();\n          };\n        }\n        return {\n          canRefine: items.length > 0,\n          createURL: connectorState.createURL,\n          items: items,\n          refine: connectorState.refine,\n          widgetParams: widgetParams\n        };\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref3) {\n        var searchParameters = _ref3.searchParameters;\n        var path = searchParameters.getHierarchicalFacetBreadcrumb(hierarchicalFacetName);\n        return removeEmptyRefinementsFromUiState(_objectSpread(_objectSpread({}, uiState), {}, {\n          hierarchicalMenu: _objectSpread(_objectSpread({}, uiState.hierarchicalMenu), {}, _defineProperty({}, hierarchicalFacetName, path))\n        }), hierarchicalFacetName);\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref4) {\n        var uiState = _ref4.uiState;\n        var values = uiState.hierarchicalMenu && uiState.hierarchicalMenu[hierarchicalFacetName];\n        if (searchParameters.isConjunctiveFacet(hierarchicalFacetName) || searchParameters.isDisjunctiveFacet(hierarchicalFacetName)) {\n          process.env.NODE_ENV === 'development' ? warning(false, \"HierarchicalMenu: Attribute \\\"\".concat(hierarchicalFacetName, \"\\\" is already used by another widget applying conjunctive or disjunctive faceting.\\nAs this is not supported, please make sure to remove this other widget or this HierarchicalMenu widget will not work at all.\")) : void 0;\n          return searchParameters;\n        }\n        if (searchParameters.isHierarchicalFacet(hierarchicalFacetName)) {\n          var facet = searchParameters.getHierarchicalFacetByName(hierarchicalFacetName);\n          process.env.NODE_ENV === 'development' ? warning(isEqual(facet.attributes, attributes) && facet.separator === separator && facet.rootPath === rootPath, 'Using Breadcrumb and HierarchicalMenu on the same facet with different options overrides the configuration of the HierarchicalMenu.') : void 0;\n        }\n        var withFacetConfiguration = searchParameters.removeHierarchicalFacet(hierarchicalFacetName).addHierarchicalFacet({\n          name: hierarchicalFacetName,\n          attributes: attributes,\n          separator: separator,\n          rootPath: rootPath\n        });\n        if (!values) {\n          return withFacetConfiguration.setQueryParameters({\n            hierarchicalFacetsRefinements: _objectSpread(_objectSpread({}, withFacetConfiguration.hierarchicalFacetsRefinements), {}, _defineProperty({}, hierarchicalFacetName, []))\n          });\n        }\n        return withFacetConfiguration.addHierarchicalFacetRefinement(hierarchicalFacetName, values.join(separator));\n      }\n    };\n  };\n};\nfunction prepareItems(data) {\n  return data.reduce(function (result, currentItem) {\n    if (currentItem.isRefined) {\n      result.push({\n        label: currentItem.name,\n        value: currentItem.escapedValue\n      });\n      if (Array.isArray(currentItem.data)) {\n        result = result.concat(prepareItems(currentItem.data));\n      }\n    }\n    return result;\n  }, []);\n}\nfunction shiftItemsValues(array) {\n  return array.map(function (x, idx) {\n    return {\n      label: x.label,\n      value: idx + 1 === array.length ? null : array[idx + 1].value\n    };\n  });\n}\nfunction removeEmptyRefinementsFromUiState(indexUiState, attribute) {\n  if (!indexUiState.hierarchicalMenu) {\n    return indexUiState;\n  }\n  if (!indexUiState.hierarchicalMenu[attribute] || !indexUiState.hierarchicalMenu[attribute].length) {\n    delete indexUiState.hierarchicalMenu[attribute];\n  }\n  if (Object.keys(indexUiState.hierarchicalMenu).length === 0) {\n    delete indexUiState.hierarchicalMenu;\n  }\n  return indexUiState;\n}\nexport default connectBreadcrumb;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/clear-refinements/connectClearRefinements.d.ts",
    "content": "import type { TransformItems, CreateURL, Connector, WidgetRenderState } from '../../types';\nexport type ClearRefinementsConnectorParams = {\n    /**\n     * The attributes to include in the refinements to clear (all by default). Cannot be used with `excludedAttributes`.\n     */\n    includedAttributes?: string[];\n    /**\n     * The attributes to exclude from the refinements to clear. Cannot be used with `includedAttributes`.\n     */\n    excludedAttributes?: string[];\n    /**\n     * Function to transform the items passed to the templates.\n     */\n    transformItems?: TransformItems<string>;\n};\nexport type ClearRefinementsRenderState = {\n    /**\n     * Triggers the clear of all the currently refined values.\n     */\n    refine: () => void;\n    /**\n     * Indicates if search state is refined.\n     * @deprecated prefer reading canRefine\n     */\n    hasRefinements: boolean;\n    /**\n     * Indicates if search state can be refined.\n     */\n    canRefine: boolean;\n    /**\n     * Creates a url for the next state when refinements are cleared.\n     */\n    createURL: CreateURL<void>;\n};\nexport type ClearRefinementsWidgetDescription = {\n    $$type: 'ais.clearRefinements';\n    renderState: ClearRefinementsRenderState;\n    indexRenderState: {\n        clearRefinements: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams>;\n    };\n};\nexport type ClearRefinementsConnector = Connector<ClearRefinementsWidgetDescription, ClearRefinementsConnectorParams>;\ndeclare const connectClearRefinements: ClearRefinementsConnector;\nexport default connectClearRefinements;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/clear-refinements/connectClearRefinements.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { checkRendering, clearRefinements, getRefinements, createDocumentationMessageGenerator, noop, uniq, mergeSearchParameters } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'clear-refinements',\n  connector: true\n});\nvar connectClearRefinements = function connectClearRefinements(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      _ref$includedAttribut = _ref.includedAttributes,\n      includedAttributes = _ref$includedAttribut === void 0 ? [] : _ref$includedAttribut,\n      _ref$excludedAttribut = _ref.excludedAttributes,\n      excludedAttributes = _ref$excludedAttribut === void 0 ? ['query'] : _ref$excludedAttribut,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    if (widgetParams && widgetParams.includedAttributes && widgetParams.excludedAttributes) {\n      throw new Error(withUsage('The options `includedAttributes` and `excludedAttributes` cannot be used together.'));\n    }\n    var connectorState = {\n      refine: noop,\n      createURL: function createURL() {\n        return '';\n      },\n      attributesToClear: []\n    };\n    var cachedRefine = function cachedRefine() {\n      return connectorState.refine();\n    };\n    var cachedCreateURL = function cachedCreateURL() {\n      return connectorState.createURL();\n    };\n    return {\n      $$type: 'ais.clearRefinements',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose() {\n        unmountFn();\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          clearRefinements: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref2) {\n        var createURL = _ref2.createURL,\n          scopedResults = _ref2.scopedResults,\n          results = _ref2.results;\n        connectorState.attributesToClear = scopedResults.reduce(function (attributesToClear, scopedResult) {\n          return attributesToClear.concat(getAttributesToClear({\n            scopedResult: scopedResult,\n            includedAttributes: includedAttributes,\n            excludedAttributes: excludedAttributes,\n            transformItems: transformItems,\n            results: results\n          }));\n        }, []);\n        connectorState.refine = function () {\n          connectorState.attributesToClear.forEach(function (_ref3) {\n            var indexHelper = _ref3.helper,\n              items = _ref3.items;\n            indexHelper.setState(clearRefinements({\n              helper: indexHelper,\n              attributesToClear: items\n            })).search();\n          });\n        };\n        connectorState.createURL = function () {\n          return createURL(mergeSearchParameters.apply(void 0, _toConsumableArray(connectorState.attributesToClear.map(function (_ref4) {\n            var indexHelper = _ref4.helper,\n              items = _ref4.items;\n            return clearRefinements({\n              helper: indexHelper,\n              attributesToClear: items\n            });\n          }))));\n        };\n        var canRefine = connectorState.attributesToClear.some(function (attributeToClear) {\n          return attributeToClear.items.length > 0;\n        });\n        return {\n          canRefine: canRefine,\n          hasRefinements: canRefine,\n          refine: cachedRefine,\n          createURL: cachedCreateURL,\n          widgetParams: widgetParams\n        };\n      }\n    };\n  };\n};\nfunction getAttributesToClear(_ref5) {\n  var scopedResult = _ref5.scopedResult,\n    includedAttributes = _ref5.includedAttributes,\n    excludedAttributes = _ref5.excludedAttributes,\n    transformItems = _ref5.transformItems,\n    results = _ref5.results;\n  var includesQuery = includedAttributes.indexOf('query') !== -1 || excludedAttributes.indexOf('query') === -1;\n  return {\n    helper: scopedResult.helper,\n    items: transformItems(uniq(getRefinements(scopedResult.results, scopedResult.helper.state, includesQuery).map(function (refinement) {\n      return refinement.attribute;\n    }).filter(function (attribute) {\n      return (\n        // If the array is empty (default case), we keep all the attributes\n        includedAttributes.length === 0 ||\n        // Otherwise, only add the specified attributes\n        includedAttributes.indexOf(attribute) !== -1\n      );\n    }).filter(function (attribute) {\n      return (\n        // If the query is included, we ignore the default `excludedAttributes = ['query']`\n        attribute === 'query' && includesQuery ||\n        // Otherwise, ignore the excluded attributes\n        excludedAttributes.indexOf(attribute) === -1\n      );\n    })), {\n      results: results\n    })\n  };\n}\nexport default connectClearRefinements;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/configure/connectConfigure.d.ts",
    "content": "import type { Connector, WidgetRenderState } from '../../types';\nimport type { PlainSearchParameters } from 'algoliasearch-helper';\n/**\n * Refine the given search parameters.\n */\ntype Refine = (searchParameters: PlainSearchParameters) => void;\nexport type ConfigureConnectorParams = {\n    /**\n     * A list of [search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/)\n     * to enable when the widget mounts.\n     */\n    searchParameters: PlainSearchParameters;\n};\nexport type ConfigureRenderState = {\n    /**\n     * Refine the given search parameters.\n     */\n    refine: Refine;\n};\nexport type ConfigureWidgetDescription = {\n    $$type: 'ais.configure';\n    renderState: ConfigureRenderState;\n    indexRenderState: {\n        configure: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams>;\n    };\n    indexUiState: {\n        configure: PlainSearchParameters;\n    };\n};\nexport type ConfigureConnector = Connector<ConfigureWidgetDescription, ConfigureConnectorParams>;\ndeclare const connectConfigure: ConfigureConnector;\nexport default connectConfigure;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/configure/connectConfigure.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport algoliasearchHelper from 'algoliasearch-helper';\nimport { createDocumentationMessageGenerator, isPlainObject, mergeSearchParameters, noop } from \"../../lib/utils/index.js\";\n\n/**\n * Refine the given search parameters.\n */\n\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'configure',\n  connector: true\n});\nfunction getInitialSearchParameters(state, widgetParams) {\n  // We leverage the helper internals to remove the `widgetParams` from\n  // the state. The function `setQueryParameters` omits the values that\n  // are `undefined` on the next state.\n  return state.setQueryParameters(Object.keys(widgetParams.searchParameters).reduce(function (acc, key) {\n    return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, undefined));\n  }, {}));\n}\nvar connectConfigure = function connectConfigure() {\n  var renderFn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : noop;\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  return function (widgetParams) {\n    if (!widgetParams || !isPlainObject(widgetParams.searchParameters)) {\n      throw new Error(withUsage('The `searchParameters` option expects an object.'));\n    }\n    var connectorState = {};\n    function refine(helper) {\n      return function (searchParameters) {\n        // Merge new `searchParameters` with the ones set from other widgets\n        var actualState = getInitialSearchParameters(helper.state, widgetParams);\n        var nextSearchParameters = mergeSearchParameters(actualState, new algoliasearchHelper.SearchParameters(searchParameters));\n\n        // Update original `widgetParams.searchParameters` to the new refined one\n        widgetParams.searchParameters = searchParameters;\n\n        // Trigger a search with the resolved search parameters\n        helper.setState(nextSearchParameters).search();\n      };\n    }\n    return {\n      $$type: 'ais.configure',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref) {\n        var state = _ref.state;\n        unmountFn();\n        return getInitialSearchParameters(state, widgetParams);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        var _renderState$configur;\n        var widgetRenderState = this.getWidgetRenderState(renderOptions);\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          configure: _objectSpread(_objectSpread({}, widgetRenderState), {}, {\n            widgetParams: _objectSpread(_objectSpread({}, widgetRenderState.widgetParams), {}, {\n              searchParameters: mergeSearchParameters(new algoliasearchHelper.SearchParameters((_renderState$configur = renderState.configure) === null || _renderState$configur === void 0 ? void 0 : _renderState$configur.widgetParams.searchParameters), new algoliasearchHelper.SearchParameters(widgetRenderState.widgetParams.searchParameters)).getQueryParams()\n            })\n          })\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref2) {\n        var helper = _ref2.helper;\n        if (!connectorState.refine) {\n          connectorState.refine = refine(helper);\n        }\n        return {\n          refine: connectorState.refine,\n          widgetParams: widgetParams\n        };\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(state, _ref3) {\n        var uiState = _ref3.uiState;\n        return mergeSearchParameters(state, new algoliasearchHelper.SearchParameters(_objectSpread(_objectSpread({}, uiState.configure), widgetParams.searchParameters)));\n      },\n      getWidgetUiState: function getWidgetUiState(uiState) {\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          configure: _objectSpread(_objectSpread({}, uiState.configure), widgetParams.searchParameters)\n        });\n      }\n    };\n  };\n};\nexport default connectConfigure;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/configure-related-items/connectConfigureRelatedItems.d.ts",
    "content": "import type { AlgoliaHit, Connector } from '../../types';\nimport type { ConfigureWidgetDescription } from '../configure/connectConfigure';\nimport type { SearchParameters, PlainSearchParameters } from 'algoliasearch-helper';\nexport type MatchingPatterns = {\n    [attribute: string]: {\n        /**\n         * The score of the optional filter.\n         *\n         * @see https://www.algolia.com/doc/guides/managing-results/rules/merchandising-and-promoting/in-depth/optional-filters/\n         */\n        score: number;\n    };\n};\nexport type TransformSearchParameters = (searchParameters: SearchParameters) => PlainSearchParameters;\nexport type ConfigureRelatedItemsConnectorParams = {\n    /**\n     * The reference hit to extract the filters from.\n     */\n    hit: AlgoliaHit;\n    /**\n     * The schema to create the optional filters.\n     * Each key represents an attribute from the hit.\n     */\n    matchingPatterns: MatchingPatterns;\n    /**\n     * Function to transform the generated search parameters.\n     */\n    transformSearchParameters?: TransformSearchParameters;\n};\nexport type ConfigureRelatedItemsWidgetDescription = {\n    $$type: 'ais.configureRelatedItems';\n} & Omit<ConfigureWidgetDescription, '$$type'>;\nexport type ConfigureRelatedItemsConnector = Connector<ConfigureRelatedItemsWidgetDescription, ConfigureRelatedItemsConnectorParams>;\ndeclare const connectConfigureRelatedItems: ConfigureRelatedItemsConnector;\n/** @deprecated use connectRelatedItems instead */\nexport default connectConfigureRelatedItems;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/configure-related-items/connectConfigureRelatedItems.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nimport algoliasearchHelper from 'algoliasearch-helper';\nimport { createDocumentationMessageGenerator, getObjectType, warning, getPropertyByPath } from \"../../lib/utils/index.js\";\nimport connectConfigure from \"../configure/connectConfigure.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'configure-related-items',\n  connector: true\n});\nfunction createOptionalFilter(_ref) {\n  var attributeName = _ref.attributeName,\n    attributeValue = _ref.attributeValue,\n    attributeScore = _ref.attributeScore;\n  return \"\".concat(attributeName, \":\").concat(attributeValue, \"<score=\").concat(attributeScore || 1, \">\");\n}\nvar connectConfigureRelatedItems = function connectConfigureRelatedItems(renderFn, unmountFn) {\n  return function (widgetParams) {\n    var _ref2 = widgetParams || {},\n      hit = _ref2.hit,\n      matchingPatterns = _ref2.matchingPatterns,\n      _ref2$transformSearch = _ref2.transformSearchParameters,\n      transformSearchParameters = _ref2$transformSearch === void 0 ? function (x) {\n        return x;\n      } : _ref2$transformSearch;\n    if (!hit) {\n      throw new Error(withUsage('The `hit` option is required.'));\n    }\n    if (!matchingPatterns) {\n      throw new Error(withUsage('The `matchingPatterns` option is required.'));\n    }\n    var optionalFilters = Object.keys(matchingPatterns).reduce(function (acc, attributeName) {\n      var attribute = matchingPatterns[attributeName];\n      var attributeValue = getPropertyByPath(hit, attributeName);\n      var attributeScore = attribute.score;\n      if (Array.isArray(attributeValue)) {\n        return [].concat(_toConsumableArray(acc), [attributeValue.map(function (attributeSubValue) {\n          return createOptionalFilter({\n            attributeName: attributeName,\n            attributeValue: attributeSubValue,\n            attributeScore: attributeScore\n          });\n        })]);\n      }\n      if (typeof attributeValue === 'string') {\n        return [].concat(_toConsumableArray(acc), [createOptionalFilter({\n          attributeName: attributeName,\n          attributeValue: attributeValue,\n          attributeScore: attributeScore\n        })]);\n      }\n      process.env.NODE_ENV === 'development' ? warning(false, \"\\nThe `matchingPatterns` option returned a value of type \".concat(getObjectType(attributeValue), \" for the \\\"\").concat(attributeName, \"\\\" key. This value was not sent to Algolia because `optionalFilters` only supports strings and array of strings.\\n\\nYou can remove the \\\"\").concat(attributeName, \"\\\" key from the `matchingPatterns` option.\\n\\nSee https://www.algolia.com/doc/api-reference/api-parameters/optionalFilters/\\n            \")) : void 0;\n      return acc;\n    }, []);\n    var searchParameters = _objectSpread({}, transformSearchParameters(new algoliasearchHelper.SearchParameters({\n      sumOrFiltersScores: true,\n      facetFilters: [\"objectID:-\".concat(hit.objectID)],\n      optionalFilters: optionalFilters\n    })));\n    var makeWidget = connectConfigure(renderFn, unmountFn);\n    return _objectSpread(_objectSpread({}, makeWidget({\n      searchParameters: searchParameters\n    })), {}, {\n      $$type: 'ais.configureRelatedItems'\n    });\n  };\n};\n\n/** @deprecated use connectRelatedItems instead */\nexport default connectConfigureRelatedItems;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/current-refinements/connectCurrentRefinements.d.ts",
    "content": "import type { Connector, TransformItems, CreateURL, WidgetRenderState } from '../../types';\nexport type CurrentRefinementsConnectorParamsRefinement = {\n    /**\n     * The attribute on which the refinement is applied.\n     */\n    attribute: string;\n    /**\n     * The type of the refinement.\n     */\n    type: 'facet' | 'exclude' | 'disjunctive' | 'hierarchical' | 'numeric' | 'query' | 'tag';\n    /**\n     * The raw value of the refinement.\n     */\n    value: string | number;\n    /**\n     * The label of the refinement to display.\n     */\n    label: string;\n    /**\n     * The value of the operator (only if applicable).\n     */\n    operator?: string;\n    /**\n     * The number of found items (only if applicable).\n     */\n    count?: number;\n    /**\n     * Whether the count is exhaustive (only if applicable).\n     */\n    exhaustive?: boolean;\n};\nexport type CurrentRefinementsConnectorParamsItem = {\n    /**\n     * The index name.\n     */\n    indexName: string;\n    /**\n     * The index id as provided to the index widget.\n     */\n    indexId: string;\n    /**\n     * The attribute on which the refinement is applied.\n     */\n    attribute: string;\n    /**\n     * The textual representation of this attribute.\n     */\n    label: string;\n    /**\n     * Currently applied refinements.\n     */\n    refinements: CurrentRefinementsConnectorParamsRefinement[];\n    /**\n     * Removes the given refinement and triggers a new search.\n     */\n    refine: (refinement: CurrentRefinementsConnectorParamsRefinement) => void;\n};\nexport type CurrentRefinementsConnectorParams = {\n    /**\n     * The attributes to include in the widget (all by default).\n     * Cannot be used with `excludedAttributes`.\n     *\n     * @default `[]`\n     */\n    includedAttributes?: string[];\n    /**\n     * The attributes to exclude from the widget.\n     * Cannot be used with `includedAttributes`.\n     *\n     * @default `['query']`\n     */\n    excludedAttributes?: string[];\n    /**\n     * Function to transform the items passed to the templates.\n     */\n    transformItems?: TransformItems<CurrentRefinementsConnectorParamsItem>;\n};\nexport type CurrentRefinementsRenderState = {\n    /**\n     * All the currently refined items, grouped by attribute.\n     */\n    items: CurrentRefinementsConnectorParamsItem[];\n    /**\n     * Indicates if search state can be refined.\n     */\n    canRefine: boolean;\n    /**\n     * Removes the given refinement and triggers a new search.\n     */\n    refine: (refinement: CurrentRefinementsConnectorParamsRefinement) => void;\n    /**\n     * Generates a URL for the next state.\n     */\n    createURL: CreateURL<CurrentRefinementsConnectorParamsRefinement>;\n};\nexport type CurrentRefinementsWidgetDescription = {\n    $$type: 'ais.currentRefinements';\n    renderState: CurrentRefinementsRenderState;\n    indexRenderState: {\n        currentRefinements: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams>;\n    };\n};\nexport type CurrentRefinementsConnector = Connector<CurrentRefinementsWidgetDescription, CurrentRefinementsConnectorParams>;\ndeclare const connectCurrentRefinements: CurrentRefinementsConnector;\nexport default connectCurrentRefinements;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/current-refinements/connectCurrentRefinements.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { getRefinements, checkRendering, createDocumentationMessageGenerator, noop, warning } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'current-refinements',\n  connector: true\n});\nvar connectCurrentRefinements = function connectCurrentRefinements(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    if ((widgetParams || {}).includedAttributes && (widgetParams || {}).excludedAttributes) {\n      throw new Error(withUsage('The options `includedAttributes` and `excludedAttributes` cannot be used together.'));\n    }\n    var _ref = widgetParams || {},\n      includedAttributes = _ref.includedAttributes,\n      _ref$excludedAttribut = _ref.excludedAttributes,\n      excludedAttributes = _ref$excludedAttribut === void 0 ? ['query'] : _ref$excludedAttribut,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    return {\n      $$type: 'ais.currentRefinements',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose() {\n        unmountFn();\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          currentRefinements: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref2) {\n        var results = _ref2.results,\n          scopedResults = _ref2.scopedResults,\n          _createURL = _ref2.createURL,\n          helper = _ref2.helper;\n        function getItems() {\n          if (!results) {\n            return transformItems(getRefinementsItems({\n              results: null,\n              helper: helper,\n              indexId: helper.state.index,\n              includedAttributes: includedAttributes,\n              excludedAttributes: excludedAttributes\n            }), {\n              results: results\n            });\n          }\n          return scopedResults.reduce(function (accResults, scopedResult) {\n            return accResults.concat(transformItems(getRefinementsItems({\n              results: scopedResult.results,\n              helper: scopedResult.helper,\n              indexId: scopedResult.indexId,\n              includedAttributes: includedAttributes,\n              excludedAttributes: excludedAttributes\n            }), {\n              results: results\n            }));\n          }, []);\n        }\n        var items = getItems();\n        return {\n          items: items,\n          canRefine: items.length > 0,\n          refine: function refine(refinement) {\n            return clearRefinement(helper, refinement);\n          },\n          createURL: function createURL(refinement) {\n            return _createURL(clearRefinementFromState(helper.state, refinement));\n          },\n          widgetParams: widgetParams\n        };\n      }\n    };\n  };\n};\nfunction getRefinementsItems(_ref3) {\n  var results = _ref3.results,\n    helper = _ref3.helper,\n    indexId = _ref3.indexId,\n    includedAttributes = _ref3.includedAttributes,\n    excludedAttributes = _ref3.excludedAttributes;\n  var includesQuery = (includedAttributes || []).indexOf('query') !== -1 || (excludedAttributes || []).indexOf('query') === -1;\n  var filterFunction = includedAttributes ? function (item) {\n    return includedAttributes.indexOf(item.attribute) !== -1;\n  } : function (item) {\n    return excludedAttributes.indexOf(item.attribute) === -1;\n  };\n  var items = getRefinements(results, helper.state, includesQuery).map(normalizeRefinement).filter(filterFunction);\n  return items.reduce(function (allItems, currentItem) {\n    return [].concat(_toConsumableArray(allItems.filter(function (item) {\n      return item.attribute !== currentItem.attribute;\n    })), [{\n      indexName: helper.state.index,\n      indexId: indexId,\n      attribute: currentItem.attribute,\n      label: currentItem.attribute,\n      refinements: items.filter(function (result) {\n        return result.attribute === currentItem.attribute;\n      })\n      // We want to keep the order of refinements except the numeric ones.\n      .sort(function (a, b) {\n        return a.type === 'numeric' ? a.value - b.value : 0;\n      }),\n      refine: function refine(refinement) {\n        return clearRefinement(helper, refinement);\n      }\n    }]);\n  }, []);\n}\nfunction clearRefinementFromState(state, refinement) {\n  state = state.resetPage();\n  switch (refinement.type) {\n    case 'facet':\n      return state.removeFacetRefinement(refinement.attribute, String(refinement.value));\n    case 'disjunctive':\n      return state.removeDisjunctiveFacetRefinement(refinement.attribute, String(refinement.value));\n    case 'hierarchical':\n      return state.removeHierarchicalFacetRefinement(refinement.attribute);\n    case 'exclude':\n      return state.removeExcludeRefinement(refinement.attribute, String(refinement.value));\n    case 'numeric':\n      return state.removeNumericRefinement(refinement.attribute, refinement.operator, String(refinement.value));\n    case 'tag':\n      return state.removeTagRefinement(String(refinement.value));\n    case 'query':\n      return state.setQueryParameter('query', '');\n    default:\n      process.env.NODE_ENV === 'development' ? warning(false, \"The refinement type \\\"\".concat(refinement.type, \"\\\" does not exist and cannot be cleared from the current refinements.\")) : void 0;\n      return state;\n  }\n}\nfunction clearRefinement(helper, refinement) {\n  helper.setState(clearRefinementFromState(helper.state, refinement)).search();\n}\nfunction getOperatorSymbol(operator) {\n  switch (operator) {\n    case '>=':\n      return '≥';\n    case '<=':\n      return '≤';\n    default:\n      return operator;\n  }\n}\nfunction normalizeRefinement(refinement) {\n  var value = getValue(refinement);\n  var label = refinement.operator ? \"\".concat(getOperatorSymbol(refinement.operator), \" \").concat(refinement.name) : refinement.name;\n  var normalizedRefinement = {\n    attribute: refinement.attribute,\n    type: refinement.type,\n    value: value,\n    label: label\n  };\n  if (refinement.operator !== undefined) {\n    normalizedRefinement.operator = refinement.operator;\n  }\n  if (refinement.count !== undefined) {\n    normalizedRefinement.count = refinement.count;\n  }\n  if (refinement.exhaustive !== undefined) {\n    normalizedRefinement.exhaustive = refinement.exhaustive;\n  }\n  return normalizedRefinement;\n}\nfunction getValue(refinement) {\n  if (refinement.type === 'numeric') {\n    return Number(refinement.name);\n  }\n  if ('escapedValue' in refinement) {\n    return refinement.escapedValue;\n  }\n  return refinement.name;\n}\nexport default connectCurrentRefinements;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/dynamic-widgets/connectDynamicWidgets.d.ts",
    "content": "import type { Connector, TransformItems, TransformItemsMetadata, Widget } from '../../types';\nexport type DynamicWidgetsRenderState = {\n    attributesToRender: string[];\n};\nexport type DynamicWidgetsConnectorParams = {\n    /**\n     * An array of widgets, displayed in the order defined by `facetOrdering`.\n     */\n    widgets: Widget[];\n    /**\n     * Function to return a fallback widget when an attribute isn't found in\n     * `widgets`.\n     */\n    fallbackWidget?: (args: {\n        /** The attribute name to create a widget for. */\n        attribute: string;\n    }) => Widget;\n    /**\n     * Function to transform the items to render.\n     * The function also exposes the full search response.\n     */\n    transformItems?: TransformItems<string, Omit<TransformItemsMetadata, 'results'> & {\n        results: NonNullable<TransformItemsMetadata['results']>;\n    }>;\n    /**\n     * To prevent unneeded extra network requests when widgets mount or unmount,\n     * we request all facet values by default. If you want to only request the\n     * facet values that are needed, you can set this option to the list of\n     * attributes you want to display.\n     *\n     * If `facets` is set to `['*']`, we request all facet values.\n     *\n     * Any facets that are requested due to the `facetOrdering` result are always\n     * requested by the widget that mounted itself.\n     *\n     * Setting `facets` to a value other than `['*']` will only prevent extra\n     * requests if all potential facets are listed.\n     *\n     * @default ['*']\n     */\n    facets?: ['*'] | string[];\n    /**\n     * If you have more than 20 facet values pinned, you need to increase the\n     * maxValuesPerFacet to at least that value.\n     *\n     * @default 20\n     */\n    maxValuesPerFacet?: number;\n};\nexport type DynamicWidgetsWidgetDescription = {\n    $$type: 'ais.dynamicWidgets';\n    renderState: DynamicWidgetsRenderState;\n    indexRenderState: {\n        dynamicWidgets: DynamicWidgetsRenderState;\n    };\n};\nexport type DynamicWidgetsConnector = Connector<DynamicWidgetsWidgetDescription, DynamicWidgetsConnectorParams>;\ndeclare const connectDynamicWidgets: DynamicWidgetsConnector;\nexport default connectDynamicWidgets;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/dynamic-widgets/connectDynamicWidgets.js",
    "content": "function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nimport { checkRendering, createDocumentationMessageGenerator, getWidgetAttribute, noop, warning } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'dynamic-widgets',\n  connector: true\n});\nvar MAX_WILDCARD_FACETS = 20;\nvar connectDynamicWidgets = function connectDynamicWidgets(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var widgets = widgetParams.widgets,\n      _widgetParams$maxValu = widgetParams.maxValuesPerFacet,\n      maxValuesPerFacet = _widgetParams$maxValu === void 0 ? 20 : _widgetParams$maxValu,\n      _widgetParams$facets = widgetParams.facets,\n      facets = _widgetParams$facets === void 0 ? ['*'] : _widgetParams$facets,\n      _widgetParams$transfo = widgetParams.transformItems,\n      transformItems = _widgetParams$transfo === void 0 ? function (items) {\n        return items;\n      } : _widgetParams$transfo,\n      fallbackWidget = widgetParams.fallbackWidget;\n    if (!(widgets && Array.isArray(widgets) && widgets.every(function (widget) {\n      return _typeof(widget) === 'object';\n    }))) {\n      throw new Error(withUsage('The `widgets` option expects an array of widgets.'));\n    }\n    if (!Array.isArray(facets)) {\n      throw new Error(withUsage(\"The `facets` option only accepts an array of facets, you passed \".concat(JSON.stringify(facets))));\n    }\n    var localWidgets = new Map();\n    return {\n      $$type: 'ais.dynamicWidgets',\n      init: function init(initOptions) {\n        widgets.forEach(function (widget) {\n          var attribute = getWidgetAttribute(widget, initOptions);\n          localWidgets.set(attribute, {\n            widget: widget,\n            isMounted: false\n          });\n        });\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var parent = renderOptions.parent;\n        var renderState = this.getWidgetRenderState(renderOptions);\n        var widgetsToUnmount = [];\n        var widgetsToMount = [];\n        if (fallbackWidget) {\n          renderState.attributesToRender.forEach(function (attribute) {\n            if (!localWidgets.has(attribute)) {\n              var widget = fallbackWidget({\n                attribute: attribute\n              });\n              localWidgets.set(attribute, {\n                widget: widget,\n                isMounted: false\n              });\n            }\n          });\n        }\n        localWidgets.forEach(function (_ref, attribute) {\n          var widget = _ref.widget,\n            isMounted = _ref.isMounted;\n          var shouldMount = renderState.attributesToRender.indexOf(attribute) > -1;\n          if (!isMounted && shouldMount) {\n            widgetsToMount.push(widget);\n            localWidgets.set(attribute, {\n              widget: widget,\n              isMounted: true\n            });\n          } else if (isMounted && !shouldMount) {\n            widgetsToUnmount.push(widget);\n            localWidgets.set(attribute, {\n              widget: widget,\n              isMounted: false\n            });\n          }\n        });\n        parent.addWidgets(widgetsToMount);\n        // make sure this only happens after the regular render, otherwise it\n        // happens too quick, since render is \"deferred\" for the next microtask,\n        // so this needs to be a whole task later\n        setTimeout(function () {\n          return parent.removeWidgets(widgetsToUnmount);\n        }, 0);\n        renderFn(_objectSpread(_objectSpread({}, renderState), {}, {\n          instantSearchInstance: renderOptions.instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref2) {\n        var parent = _ref2.parent;\n        var toRemove = [];\n        localWidgets.forEach(function (_ref3) {\n          var widget = _ref3.widget,\n            isMounted = _ref3.isMounted;\n          if (isMounted) {\n            toRemove.push(widget);\n          }\n        });\n        parent.removeWidgets(toRemove);\n        unmountFn();\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(state) {\n        return facets.reduce(function (acc, curr) {\n          return acc.addFacet(curr);\n        }, state.setQueryParameters({\n          maxValuesPerFacet: Math.max(maxValuesPerFacet || 0, state.maxValuesPerFacet || 0)\n        }));\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          dynamicWidgets: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref4) {\n        var _results$renderingCon, _results$renderingCon2, _results$renderingCon3, _results$renderingCon4;\n        var results = _ref4.results,\n          state = _ref4.state;\n        if (!results) {\n          return {\n            attributesToRender: [],\n            widgetParams: widgetParams\n          };\n        }\n        var attributesToRender = transformItems((_results$renderingCon = (_results$renderingCon2 = results.renderingContent) === null || _results$renderingCon2 === void 0 ? void 0 : (_results$renderingCon3 = _results$renderingCon2.facetOrdering) === null || _results$renderingCon3 === void 0 ? void 0 : (_results$renderingCon4 = _results$renderingCon3.facets) === null || _results$renderingCon4 === void 0 ? void 0 : _results$renderingCon4.order) !== null && _results$renderingCon !== void 0 ? _results$renderingCon : [], {\n          results: results\n        });\n        if (!Array.isArray(attributesToRender)) {\n          throw new Error(withUsage('The `transformItems` option expects a function that returns an Array.'));\n        }\n        process.env.NODE_ENV === 'development' ? warning(maxValuesPerFacet >= (state.maxValuesPerFacet || 0), \"The maxValuesPerFacet set by dynamic widgets (\".concat(maxValuesPerFacet, \") is smaller than one of the limits set by a widget (\").concat(state.maxValuesPerFacet, \"). This causes a mismatch in query parameters and thus an extra network request when that widget is mounted.\")) : void 0;\n        process.env.NODE_ENV === 'development' ? warning(attributesToRender.length <= MAX_WILDCARD_FACETS || widgetParams.facets !== undefined, \"More than \".concat(MAX_WILDCARD_FACETS, \" facets are requested to be displayed without explicitly setting which facets to retrieve. This could have a performance impact. Set \\\"facets\\\" to [] to do two smaller network requests, or explicitly to ['*'] to avoid this warning.\")) : void 0;\n        return {\n          attributesToRender: attributesToRender,\n          widgetParams: widgetParams\n        };\n      }\n    };\n  };\n};\nexport default connectDynamicWidgets;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/frequently-bought-together/connectFrequentlyBoughtTogether.d.ts",
    "content": "import type { SendEventForHits } from '../../lib/utils';\nimport type { Connector, TransformItems, BaseHit, Renderer, Unmounter, UnknownWidgetParams, RecommendResponse, Hit, AlgoliaHit } from '../../types';\nimport type { PlainSearchParameters } from 'algoliasearch-helper';\nexport type FrequentlyBoughtTogetherRenderState<THit extends NonNullable<object> = BaseHit> = {\n    /**\n     * The matched recommendations from Algolia API.\n     */\n    items: Array<Hit<THit>>;\n    /**\n     * Sends an event to the Insights middleware.\n     */\n    sendEvent: SendEventForHits;\n};\nexport type FrequentlyBoughtTogetherConnectorParams<THit extends NonNullable<object> = BaseHit> = {\n    /**\n     * The objectIDs of the items to get the frequently bought together items for.\n     */\n    objectIDs: string[];\n    /**\n     * Threshold for the recommendations confidence score (between 0 and 100). Only recommendations with a greater score are returned.\n     */\n    threshold?: number;\n    /**\n     * The maximum number of recommendations to return.\n     */\n    limit?: number;\n    /**\n     * Parameters to pass to the request.\n     */\n    queryParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\n    /**\n     * Whether to escape HTML tags from items string values.\n     *\n     * @default true\n     */\n    escapeHTML?: boolean;\n    /**\n     * Function to transform the items passed to the templates.\n     */\n    transformItems?: TransformItems<Hit<THit>, {\n        results: RecommendResponse<AlgoliaHit<THit>>;\n    }>;\n};\nexport type FrequentlyBoughtTogetherWidgetDescription<THit extends NonNullable<object> = BaseHit> = {\n    $$type: 'ais.frequentlyBoughtTogether';\n    renderState: FrequentlyBoughtTogetherRenderState<THit>;\n};\nexport type FrequentlyBoughtTogetherConnector<THit extends NonNullable<object> = BaseHit> = Connector<FrequentlyBoughtTogetherWidgetDescription<THit>, FrequentlyBoughtTogetherConnectorParams<THit>>;\ndeclare const _default: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<FrequentlyBoughtTogetherRenderState, TWidgetParams & FrequentlyBoughtTogetherConnectorParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & FrequentlyBoughtTogetherConnectorParams<THit>) => {\n    dependsOn: \"recommend\";\n    $$type: \"ais.frequentlyBoughtTogether\";\n    init(initOptions: import(\"../../types\").InitOptions): void;\n    render(renderOptions: import(\"../../types\").RenderOptions): void;\n    getRenderState(renderState: {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../answers/connectAnswers\").AnswersRenderState, import(\"../answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../configure/connectConfigure\").ConfigureRenderState, import(\"../configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<import(\"../hits/connectHits\").HitsRenderState<BaseHit>, import(\"../hits/connectHits\").HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../menu/connectMenu\").MenuRenderState, import(\"../menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../pagination/connectPagination\").PaginationRenderState, import(\"../pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../range/connectRange\").RangeRenderState, import(\"../range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../search-box/connectSearchBox\").SearchBoxRenderState, import(\"../search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../sort-by/connectSortBy\").SortByRenderState, import(\"../sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../stats/connectStats\").StatsRenderState, import(\"../stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../../widgets/analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../../widgets/places/places\").PlacesWidgetParams> | undefined;\n    }): {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../answers/connectAnswers\").AnswersRenderState, import(\"../answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../configure/connectConfigure\").ConfigureRenderState, import(\"../configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<import(\"../hits/connectHits\").HitsRenderState<BaseHit>, import(\"../hits/connectHits\").HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../menu/connectMenu\").MenuRenderState, import(\"../menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../pagination/connectPagination\").PaginationRenderState, import(\"../pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../range/connectRange\").RangeRenderState, import(\"../range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../search-box/connectSearchBox\").SearchBoxRenderState, import(\"../search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../sort-by/connectSortBy\").SortByRenderState, import(\"../sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../stats/connectStats\").StatsRenderState, import(\"../stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../../widgets/analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../../widgets/places/places\").PlacesWidgetParams> | undefined;\n    };\n    getWidgetRenderState({ results, helper, instantSearchInstance }: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions | ({\n        instantSearchInstance: import(\"../../types\").InstantSearch;\n        parent: import(\"../../types\").IndexWidget;\n        templatesConfig: Record<string, unknown>;\n        scopedResults: import(\"../../types\").ScopedResult[];\n        state: import(\"algoliasearch-helper\").SearchParameters;\n        renderState: import(\"../../types\").IndexRenderState;\n        helper: import(\"algoliasearch-helper\").AlgoliaSearchHelper;\n        searchMetadata: {\n            isSearchStalled: boolean;\n        };\n        status: import(\"../../types\").InstantSearch[\"status\"];\n        error: import(\"../../types\").InstantSearch[\"error\"];\n        createURL: (nextState: import(\"algoliasearch-helper\").SearchParameters | ((state: import(\"../../types\").IndexUiState) => import(\"../../types\").IndexUiState)) => string;\n    } & {\n        results: RecommendResponse<any>;\n    })): {\n        items: Hit<THit>[];\n        widgetParams: TWidgetParams & FrequentlyBoughtTogetherConnectorParams<THit>;\n        sendEvent: SendEventForHits;\n    };\n    dispose({ recommendState }: import(\"../../types\").DisposeOptions): import(\"algoliasearch-helper\").RecommendParameters;\n    getWidgetParameters(state: import(\"algoliasearch-helper\").RecommendParameters): import(\"algoliasearch-helper\").RecommendParameters;\n};\nexport default _default;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/frequently-bought-together/connectFrequentlyBoughtTogether.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { createDocumentationMessageGenerator, checkRendering, noop, escapeHits, TAG_PLACEHOLDER, createSendEventForHits, addAbsolutePosition, addQueryID } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'frequently-bought-together',\n  connector: true\n});\nexport default (function connectFrequentlyBoughtTogether(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      _ref$escapeHTML = _ref.escapeHTML,\n      escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems,\n      objectIDs = _ref.objectIDs,\n      limit = _ref.limit,\n      threshold = _ref.threshold,\n      queryParameters = _ref.queryParameters;\n    if (!objectIDs || objectIDs.length === 0) {\n      throw new Error(withUsage('The `objectIDs` option is required.'));\n    }\n    var sendEvent;\n    return {\n      dependsOn: 'recommend',\n      $$type: 'ais.frequentlyBoughtTogether',\n      init: function init(initOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var renderState = this.getWidgetRenderState(renderOptions);\n        renderFn(_objectSpread(_objectSpread({}, renderState), {}, {\n          instantSearchInstance: renderOptions.instantSearchInstance\n        }), false);\n      },\n      getRenderState: function getRenderState(renderState) {\n        return renderState;\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref2) {\n        var results = _ref2.results,\n          helper = _ref2.helper,\n          instantSearchInstance = _ref2.instantSearchInstance;\n        if (!sendEvent) {\n          sendEvent = createSendEventForHits({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            widgetType: this.$$type\n          });\n        }\n        if (results === null || results === undefined) {\n          return {\n            items: [],\n            widgetParams: widgetParams,\n            sendEvent: sendEvent\n          };\n        }\n        if (escapeHTML && results.hits.length > 0) {\n          results.hits = escapeHits(results.hits);\n        }\n        var itemsWithAbsolutePosition = addAbsolutePosition(results.hits, 0, 1);\n        var itemsWithAbsolutePositionAndQueryID = addQueryID(itemsWithAbsolutePosition, results.queryID);\n        var transformedItems = transformItems(itemsWithAbsolutePositionAndQueryID, {\n          results: results\n        });\n        return {\n          items: transformedItems,\n          widgetParams: widgetParams,\n          sendEvent: sendEvent\n        };\n      },\n      dispose: function dispose(_ref3) {\n        var recommendState = _ref3.recommendState;\n        unmountFn();\n        return recommendState.removeParams(this.$$id);\n      },\n      getWidgetParameters: function getWidgetParameters(state) {\n        var _this = this;\n        return objectIDs.reduce(function (acc, objectID) {\n          return acc.addFrequentlyBoughtTogether({\n            objectID: objectID,\n            threshold: threshold,\n            maxRecommendations: limit,\n            queryParameters: _objectSpread(_objectSpread({}, queryParameters), escapeHTML ? TAG_PLACEHOLDER : {}),\n            $$id: _this.$$id\n          });\n        }, state.removeParams(this.$$id));\n      }\n    };\n  };\n});"
  },
  {
    "path": "js/instantsearch.js/es/connectors/geo-search/connectGeoSearch.d.ts",
    "content": "import type { SendEventForHits } from '../../lib/utils';\nimport type { BaseHit, Connector, GeoHit, GeoLoc, IndexRenderState, InitOptions, Renderer, RenderOptions, TransformItems, UnknownWidgetParams, Unmounter, WidgetRenderState } from '../../types';\nimport type { AlgoliaSearchHelper, SearchParameters } from 'algoliasearch-helper';\nexport type { GeoHit } from '../../types';\ntype Bounds = {\n    /**\n     * The top right corner of the map view.\n     */\n    northEast: GeoLoc;\n    /**\n     * The bottom left corner of the map view.\n     */\n    southWest: GeoLoc;\n};\nexport type GeoSearchRenderState<THit extends NonNullable<object> = BaseHit> = {\n    /**\n     * Reset the current bounding box refinement.\n     */\n    clearMapRefinement: () => void;\n    /**\n     * The current bounding box of the search.\n     */\n    currentRefinement?: Bounds;\n    /**\n     * Return true if the map has move since the last refinement.\n     */\n    hasMapMoveSinceLastRefine: () => boolean;\n    /**\n     * Return true if the current refinement is set with the map bounds.\n     */\n    isRefinedWithMap: () => boolean;\n    /**\n     * Return true if the user is able to refine on map move.\n     */\n    isRefineOnMapMove: () => boolean;\n    /**\n     * The matched hits from Algolia API.\n     */\n    items: Array<GeoHit<THit>>;\n    /**\n     * The current position of the search.\n     */\n    position?: GeoLoc;\n    /**\n     * Sets a bounding box to filter the results from the given map bounds.\n     */\n    refine: (bounds: Bounds) => void;\n    /**\n     * Send event to insights middleware\n     */\n    sendEvent: SendEventForHits;\n    /**\n     * Set the fact that the map has moved since the last refinement, should be\n     * called on each map move. The call to the function triggers a new rendering\n     * only when the value change.\n     */\n    setMapMoveSinceLastRefine: () => void;\n    /**\n     * Toggle the fact that the user is able to refine on map move.\n     */\n    toggleRefineOnMapMove: () => void;\n};\nexport type GeoSearchConnectorParams<THit extends GeoHit = GeoHit> = {\n    /**\n     * If true, refine will be triggered as you move the map.\n     * @default true\n     */\n    enableRefineOnMapMove?: boolean;\n    /**\n     * Function to transform the items passed to the templates.\n     * @default items => items\n     */\n    transformItems?: TransformItems<GeoHit<THit>>;\n};\nexport type GeoSearchWidgetDescription<THit extends GeoHit = GeoHit> = {\n    $$type: 'ais.geoSearch';\n    renderState: GeoSearchRenderState<THit>;\n    indexRenderState: {\n        geoSearch: WidgetRenderState<GeoSearchRenderState<THit>, GeoSearchConnectorParams<THit>>;\n    };\n    indexUiState: {\n        geoSearch: {\n            /**\n             * The rectangular area in geo coordinates.\n             * The rectangle is defined by two diagonally opposite points,\n             * hence by 4 floats separated by commas.\n             *\n             * @example '47.3165,4.9665,47.3424,5.0201'\n             */\n            boundingBox: string;\n        };\n    };\n};\nexport type GeoSearchConnector<THit extends GeoHit = GeoHit> = Connector<GeoSearchWidgetDescription<THit>, GeoSearchConnectorParams<THit>>;\n/**\n * The **GeoSearch** connector provides the logic to build a widget that will display the results on a map. It also provides a way to search for results based on their position. The connector provides functions to manage the search experience (search on map interaction or control the interaction for example).\n *\n * @requirements\n *\n * Note that the GeoSearch connector uses the [geosearch](https://www.algolia.com/doc/guides/searching/geo-search) capabilities of Algolia. Your hits **must** have a `_geoloc` attribute in order to be passed to the rendering function.\n *\n * Currently, the feature is not compatible with multiple values in the _geoloc attribute.\n */\ndeclare const _default: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<GeoSearchRenderState, TWidgetParams & GeoSearchConnectorParams>, unmountFn?: Unmounter) => <THit extends GeoHit = GeoHit>(widgetParams: TWidgetParams & GeoSearchConnectorParams<THit>) => {\n    $$type: \"ais.geoSearch\";\n    init(initArgs: InitOptions): void;\n    render(renderArgs: RenderOptions): void;\n    getWidgetRenderState(renderOptions: InitOptions | RenderOptions): {\n        items: GeoHit<THit>[];\n        position: {\n            lat: number;\n            lng: number;\n        } | undefined;\n        currentRefinement: {\n            northEast: {\n                lat: number;\n                lng: number;\n            };\n            southWest: {\n                lat: number;\n                lng: number;\n            };\n        } | undefined;\n        refine: ({ northEast: ne, southWest: sw }: Bounds) => void;\n        sendEvent: SendEventForHits;\n        clearMapRefinement: () => void;\n        isRefinedWithMap: () => boolean;\n        toggleRefineOnMapMove: () => void;\n        isRefineOnMapMove: () => boolean;\n        setMapMoveSinceLastRefine: () => void;\n        hasMapMoveSinceLastRefine: () => boolean;\n        widgetParams: TWidgetParams & GeoSearchConnectorParams<THit>;\n    };\n    getRenderState(renderState: {\n        answers?: WidgetRenderState<import(\"../answers/connectAnswers\").AnswersRenderState, import(\"../answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: WidgetRenderState<import(\"../autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: WidgetRenderState<import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: WidgetRenderState<import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: WidgetRenderState<import(\"../configure/connectConfigure\").ConfigureRenderState, import(\"../configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: WidgetRenderState<import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: WidgetRenderState<GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: WidgetRenderState<import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: WidgetRenderState<import(\"../hits/connectHits\").HitsRenderState<BaseHit>, import(\"../hits/connectHits\").HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: WidgetRenderState<import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: WidgetRenderState<import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: WidgetRenderState<import(\"../menu/connectMenu\").MenuRenderState, import(\"../menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: WidgetRenderState<import(\"../numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: WidgetRenderState<import(\"../pagination/connectPagination\").PaginationRenderState, import(\"../pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: WidgetRenderState<import(\"../powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: WidgetRenderState<import(\"../query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: WidgetRenderState<import(\"../range/connectRange\").RangeRenderState, import(\"../range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: WidgetRenderState<import(\"../rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: WidgetRenderState<import(\"../refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: WidgetRenderState<import(\"../relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: WidgetRenderState<import(\"../search-box/connectSearchBox\").SearchBoxRenderState, import(\"../search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: WidgetRenderState<import(\"../sort-by/connectSortBy\").SortByRenderState, import(\"../sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: WidgetRenderState<import(\"../stats/connectStats\").StatsRenderState, import(\"../stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: WidgetRenderState<import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: WidgetRenderState<import(\"../voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: WidgetRenderState<Record<string, unknown>, import(\"../../widgets/analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: WidgetRenderState<Record<string, unknown>, import(\"../../widgets/places/places\").PlacesWidgetParams> | undefined;\n    }, renderOptions: InitOptions | RenderOptions): IndexRenderState & GeoSearchWidgetDescription[\"indexRenderState\"];\n    dispose({ state }: import(\"../../types\").DisposeOptions): SearchParameters;\n    getWidgetUiState(uiState: {\n        geoSearch?: {\n            /**\n             * The rectangular area in geo coordinates.\n             * The rectangle is defined by two diagonally opposite points,\n             * hence by 4 floats separated by commas.\n             *\n             * @example '47.3165,4.9665,47.3424,5.0201'\n             */\n            boundingBox: string;\n        } | undefined;\n        query?: string | undefined;\n        configure?: import(\"algoliasearch-helper\").PlainSearchParameters | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: string[];\n        } | undefined;\n        hitsPerPage?: number | undefined;\n        page?: number | undefined;\n        menu?: {\n            [attribute: string]: string;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: string;\n        } | undefined;\n        range?: {\n            [attribute: string]: string;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: number | undefined;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: string[];\n        } | undefined;\n        relevantSort?: number | undefined;\n        sortBy?: string | undefined;\n        toggle?: {\n            [attribute: string]: boolean;\n        } | undefined;\n        places?: {\n            query: string;\n            position: string;\n        } | undefined;\n    }, { searchParameters }: {\n        searchParameters: SearchParameters;\n        helper: AlgoliaSearchHelper;\n    }): {\n        geoSearch?: {\n            /**\n             * The rectangular area in geo coordinates.\n             * The rectangle is defined by two diagonally opposite points,\n             * hence by 4 floats separated by commas.\n             *\n             * @example '47.3165,4.9665,47.3424,5.0201'\n             */\n            boundingBox: string;\n        } | undefined;\n        query?: string | undefined;\n        configure?: import(\"algoliasearch-helper\").PlainSearchParameters | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: string[];\n        } | undefined;\n        hitsPerPage?: number | undefined;\n        page?: number | undefined;\n        menu?: {\n            [attribute: string]: string;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: string;\n        } | undefined;\n        range?: {\n            [attribute: string]: string;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: number | undefined;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: string[];\n        } | undefined;\n        relevantSort?: number | undefined;\n        sortBy?: string | undefined;\n        toggle?: {\n            [attribute: string]: boolean;\n        } | undefined;\n        places?: {\n            query: string;\n            position: string;\n        } | undefined;\n    };\n    getWidgetSearchParameters(searchParameters: SearchParameters, { uiState }: {\n        uiState: {\n            geoSearch?: {\n                /**\n                 * The rectangular area in geo coordinates.\n                 * The rectangle is defined by two diagonally opposite points,\n                 * hence by 4 floats separated by commas.\n                 *\n                 * @example '47.3165,4.9665,47.3424,5.0201'\n                 */\n                boundingBox: string;\n            } | undefined;\n            query?: string | undefined;\n            configure?: import(\"algoliasearch-helper\").PlainSearchParameters | undefined;\n            hierarchicalMenu?: {\n                [rootAttribute: string]: string[];\n            } | undefined;\n            hitsPerPage?: number | undefined;\n            page?: number | undefined;\n            menu?: {\n                [attribute: string]: string;\n            } | undefined;\n            numericMenu?: {\n                [attribute: string]: string;\n            } | undefined;\n            range?: {\n                [attribute: string]: string;\n            } | undefined;\n            ratingMenu?: {\n                [attribute: string]: number | undefined;\n            } | undefined;\n            refinementList?: {\n                [attribute: string]: string[];\n            } | undefined;\n            relevantSort?: number | undefined;\n            sortBy?: string | undefined;\n            toggle?: {\n                [attribute: string]: boolean;\n            } | undefined;\n            places?: {\n                query: string;\n                position: string;\n            } | undefined;\n        };\n    }): SearchParameters;\n};\nexport default _default;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/geo-search/connectGeoSearch.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { checkRendering, aroundLatLngToPosition, insideBoundingBoxToBoundingBox, createDocumentationMessageGenerator, createSendEventForHits, noop } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'geo-search',\n  connector: true\n});\n\n// in this connector, we assume insideBoundingBox is only a string,\n// even though in the helper it's defined as number[][] alone.\n// This can be done, since the connector assumes \"control\" of the parameter\nfunction getBoundingBoxAsString(state) {\n  return state.insideBoundingBox || '';\n}\nfunction setBoundingBoxAsString(state, value) {\n  return state.setQueryParameter('insideBoundingBox', value);\n}\nvar $$type = 'ais.geoSearch';\n/**\n * The **GeoSearch** connector provides the logic to build a widget that will display the results on a map. It also provides a way to search for results based on their position. The connector provides functions to manage the search experience (search on map interaction or control the interaction for example).\n *\n * @requirements\n *\n * Note that the GeoSearch connector uses the [geosearch](https://www.algolia.com/doc/guides/searching/geo-search) capabilities of Algolia. Your hits **must** have a `_geoloc` attribute in order to be passed to the rendering function.\n *\n * Currently, the feature is not compatible with multiple values in the _geoloc attribute.\n */\nexport default (function connectGeoSearch(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      _ref$enableRefineOnMa = _ref.enableRefineOnMapMove,\n      enableRefineOnMapMove = _ref$enableRefineOnMa === void 0 ? true : _ref$enableRefineOnMa,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    var widgetState = {\n      isRefineOnMapMove: enableRefineOnMapMove,\n      // @MAJOR hasMapMoveSinceLastRefine -> hasMapMovedSinceLastRefine\n      hasMapMoveSinceLastRefine: false,\n      lastRefinePosition: '',\n      lastRefineBoundingBox: '',\n      internalToggleRefineOnMapMove: noop,\n      internalSetMapMoveSinceLastRefine: noop\n    };\n    var getPositionFromState = function getPositionFromState(state) {\n      return state.aroundLatLng ? aroundLatLngToPosition(state.aroundLatLng) : undefined;\n    };\n    var getCurrentRefinementFromState = function getCurrentRefinementFromState(state) {\n      return state.insideBoundingBox && insideBoundingBoxToBoundingBox(state.insideBoundingBox);\n    };\n    var refine = function refine(helper) {\n      return function (_ref2) {\n        var ne = _ref2.northEast,\n          sw = _ref2.southWest;\n        var boundingBox = [ne.lat, ne.lng, sw.lat, sw.lng].join();\n        helper.setState(setBoundingBoxAsString(helper.state, boundingBox).resetPage()).search();\n        widgetState.hasMapMoveSinceLastRefine = false;\n        widgetState.lastRefineBoundingBox = boundingBox;\n      };\n    };\n    var clearMapRefinement = function clearMapRefinement(helper) {\n      return function () {\n        helper.setQueryParameter('insideBoundingBox', undefined).search();\n      };\n    };\n    var isRefinedWithMap = function isRefinedWithMap(state) {\n      return function () {\n        return Boolean(state.insideBoundingBox);\n      };\n    };\n    var toggleRefineOnMapMove = function toggleRefineOnMapMove() {\n      return widgetState.internalToggleRefineOnMapMove();\n    };\n    var createInternalToggleRefinementOnMapMove = function createInternalToggleRefinementOnMapMove(renderOptions, render) {\n      return function () {\n        widgetState.isRefineOnMapMove = !widgetState.isRefineOnMapMove;\n        render(renderOptions);\n      };\n    };\n    var isRefineOnMapMove = function isRefineOnMapMove() {\n      return widgetState.isRefineOnMapMove;\n    };\n    var setMapMoveSinceLastRefine = function setMapMoveSinceLastRefine() {\n      return widgetState.internalSetMapMoveSinceLastRefine();\n    };\n    var createInternalSetMapMoveSinceLastRefine = function createInternalSetMapMoveSinceLastRefine(renderOptions, render) {\n      return function () {\n        var shouldTriggerRender = widgetState.hasMapMoveSinceLastRefine !== true;\n        widgetState.hasMapMoveSinceLastRefine = true;\n        if (shouldTriggerRender) {\n          render(renderOptions);\n        }\n      };\n    };\n    var hasMapMoveSinceLastRefine = function hasMapMoveSinceLastRefine() {\n      return widgetState.hasMapMoveSinceLastRefine;\n    };\n    var sendEvent;\n    return {\n      $$type: $$type,\n      init: function init(initArgs) {\n        var instantSearchInstance = initArgs.instantSearchInstance;\n        var isFirstRendering = true;\n        widgetState.internalToggleRefineOnMapMove = createInternalToggleRefinementOnMapMove(initArgs, noop);\n        widgetState.internalSetMapMoveSinceLastRefine = createInternalSetMapMoveSinceLastRefine(initArgs, noop);\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initArgs)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), isFirstRendering);\n      },\n      render: function render(renderArgs) {\n        var helper = renderArgs.helper,\n          instantSearchInstance = renderArgs.instantSearchInstance;\n        var isFirstRendering = false;\n        // We don't use the state provided by the render function because we need\n        // to be sure that the state is the latest one for the following condition\n        var state = helper.state;\n        var positionChangedSinceLastRefine = Boolean(state.aroundLatLng) && Boolean(widgetState.lastRefinePosition) && state.aroundLatLng !== widgetState.lastRefinePosition;\n        var boundingBoxChangedSinceLastRefine = !state.insideBoundingBox && Boolean(widgetState.lastRefineBoundingBox) && state.insideBoundingBox !== widgetState.lastRefineBoundingBox;\n        if (positionChangedSinceLastRefine || boundingBoxChangedSinceLastRefine) {\n          widgetState.hasMapMoveSinceLastRefine = false;\n        }\n        widgetState.lastRefinePosition = state.aroundLatLng || '';\n        widgetState.lastRefineBoundingBox = getBoundingBoxAsString(state);\n        widgetState.internalToggleRefineOnMapMove = createInternalToggleRefinementOnMapMove(renderArgs, this.render.bind(this));\n        widgetState.internalSetMapMoveSinceLastRefine = createInternalSetMapMoveSinceLastRefine(renderArgs, this.render.bind(this));\n        var widgetRenderState = this.getWidgetRenderState(renderArgs);\n        sendEvent('view:internal', widgetRenderState.items);\n        renderFn(_objectSpread(_objectSpread({}, widgetRenderState), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), isFirstRendering);\n      },\n      getWidgetRenderState: function getWidgetRenderState(renderOptions) {\n        var helper = renderOptions.helper,\n          results = renderOptions.results,\n          instantSearchInstance = renderOptions.instantSearchInstance;\n        var state = helper.state;\n        var items = results ? transformItems(results.hits.filter(function (hit) {\n          return hit._geoloc;\n        }), {\n          results: results\n        }) : [];\n        if (!sendEvent) {\n          sendEvent = createSendEventForHits({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            widgetType: $$type\n          });\n        }\n        return {\n          items: items,\n          position: getPositionFromState(state),\n          currentRefinement: getCurrentRefinementFromState(state),\n          refine: refine(helper),\n          sendEvent: sendEvent,\n          clearMapRefinement: clearMapRefinement(helper),\n          isRefinedWithMap: isRefinedWithMap(state),\n          toggleRefineOnMapMove: toggleRefineOnMapMove,\n          isRefineOnMapMove: isRefineOnMapMove,\n          setMapMoveSinceLastRefine: setMapMoveSinceLastRefine,\n          hasMapMoveSinceLastRefine: hasMapMoveSinceLastRefine,\n          widgetParams: widgetParams\n        };\n      },\n      getRenderState: function getRenderState(renderState, renderOptions\n      // Type is explicitly redefined, to avoid having the TWidgetParams type in the definition\n      ) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          geoSearch: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      dispose: function dispose(_ref3) {\n        var state = _ref3.state;\n        unmountFn();\n        return state.setQueryParameter('insideBoundingBox', undefined);\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref4) {\n        var searchParameters = _ref4.searchParameters;\n        var boundingBox = getBoundingBoxAsString(searchParameters);\n        if (!boundingBox || uiState && uiState.geoSearch && uiState.geoSearch.boundingBox === boundingBox) {\n          return uiState;\n        }\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          geoSearch: {\n            boundingBox: boundingBox\n          }\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref5) {\n        var uiState = _ref5.uiState;\n        if (!uiState || !uiState.geoSearch) {\n          return searchParameters.setQueryParameter('insideBoundingBox', undefined);\n        }\n        return setBoundingBoxAsString(searchParameters, uiState.geoSearch.boundingBox);\n      }\n    };\n  };\n});"
  },
  {
    "path": "js/instantsearch.js/es/connectors/hierarchical-menu/connectHierarchicalMenu.d.ts",
    "content": "import type { SendEventForFacet } from '../../lib/utils';\nimport type { Connector, CreateURL, TransformItems, SortBy, WidgetRenderState } from '../../types';\nimport type { SearchResults } from 'algoliasearch-helper';\nexport type HierarchicalMenuItem = {\n    /**\n     * Value of the menu item.\n     */\n    value: string;\n    /**\n     * Human-readable value of the menu item.\n     */\n    label: string;\n    /**\n     * Number of matched results after refinement is applied.\n     */\n    count: number;\n    /**\n     * Indicates if the refinement is applied.\n     */\n    isRefined: boolean;\n    /**\n     * n+1 level of items, same structure HierarchicalMenuItem\n     */\n    data: HierarchicalMenuItem[] | null;\n};\nexport type HierarchicalMenuConnectorParams = {\n    /**\n     *  Attributes to use to generate the hierarchy of the menu.\n     */\n    attributes: string[];\n    /**\n     * Separator used in the attributes to separate level values.\n     */\n    separator?: string;\n    /**\n     * Prefix path to use if the first level is not the root level.\n     */\n    rootPath?: string | null;\n    /**\n     * Show the siblings of the selected parent levels of the current refined value. This\n     * does not impact the root level.\n     */\n    showParentLevel?: boolean;\n    /**\n     * Max number of values to display.\n     */\n    limit?: number;\n    /**\n     * Whether to display the \"show more\" button.\n     */\n    showMore?: boolean;\n    /**\n     * Max number of values to display when showing more.\n     */\n    showMoreLimit?: number;\n    /**\n     * How to sort refinements. Possible values: `count|isRefined|name:asc|name:desc`.\n     * You can also use a sort function that behaves like the standard Javascript [compareFunction](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Syntax).\n     *\n     * If a facetOrdering is set in the index settings, it is used when sortBy isn't passed\n     */\n    sortBy?: SortBy<SearchResults.HierarchicalFacet>;\n    /**\n     * Function to transform the items passed to the templates.\n     */\n    transformItems?: TransformItems<HierarchicalMenuItem>;\n};\nexport type HierarchicalMenuRenderState = {\n    /**\n     * Creates an url for the next state for a clicked item.\n     */\n    createURL: CreateURL<string>;\n    /**\n     * Values to be rendered.\n     */\n    items: HierarchicalMenuItem[];\n    /**\n     * Sets the path of the hierarchical filter and triggers a new search.\n     */\n    refine: (value: string) => void;\n    /**\n     *  Indicates if search state can be refined.\n     */\n    canRefine: boolean;\n    /**\n     * True if the menu is displaying all the menu items.\n     */\n    isShowingMore: boolean;\n    /**\n     * Toggles the number of values displayed between `limit` and `showMoreLimit`.\n     */\n    toggleShowMore: () => void;\n    /**\n     * `true` if the toggleShowMore button can be activated (enough items to display more or\n     * already displaying more than `limit` items)\n     */\n    canToggleShowMore: boolean;\n    /**\n     * Send event to insights middleware\n     */\n    sendEvent: SendEventForFacet;\n};\nexport type HierarchicalMenuWidgetDescription = {\n    $$type: 'ais.hierarchicalMenu';\n    renderState: HierarchicalMenuRenderState;\n    indexRenderState: {\n        hierarchicalMenu: {\n            [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;\n        };\n    };\n    indexUiState: {\n        hierarchicalMenu: {\n            [rootAttribute: string]: string[];\n        };\n    };\n};\nexport type HierarchicalMenuConnector = Connector<HierarchicalMenuWidgetDescription, HierarchicalMenuConnectorParams>;\n/**\n * **HierarchicalMenu** connector provides the logic to build a custom widget\n * that will give the user the ability to explore facets in a tree-like structure.\n *\n * This is commonly used for multi-level categorization of products on e-commerce\n * websites. From a UX point of view, we suggest not displaying more than two\n * levels deep.\n *\n * @type {Connector}\n * @param {function(HierarchicalMenuRenderingOptions, boolean)} renderFn Rendering function for the custom **HierarchicalMenu** widget.\n * @param {function} unmountFn Unmount function called when the widget is disposed.\n * @return {function(CustomHierarchicalMenuWidgetParams)} Re-usable widget factory for a custom **HierarchicalMenu** widget.\n */\ndeclare const connectHierarchicalMenu: HierarchicalMenuConnector;\nexport default connectHierarchicalMenu;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/hierarchical-menu/connectHierarchicalMenu.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _excluded = [\"name\", \"escapedValue\", \"data\", \"path\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nimport { checkRendering, warning, createDocumentationMessageGenerator, createSendEventForFacet, isEqual, noop } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'hierarchical-menu',\n  connector: true\n});\nvar DEFAULT_SORT = ['name:asc'];\n/**\n * **HierarchicalMenu** connector provides the logic to build a custom widget\n * that will give the user the ability to explore facets in a tree-like structure.\n *\n * This is commonly used for multi-level categorization of products on e-commerce\n * websites. From a UX point of view, we suggest not displaying more than two\n * levels deep.\n *\n * @type {Connector}\n * @param {function(HierarchicalMenuRenderingOptions, boolean)} renderFn Rendering function for the custom **HierarchicalMenu** widget.\n * @param {function} unmountFn Unmount function called when the widget is disposed.\n * @return {function(CustomHierarchicalMenuWidgetParams)} Re-usable widget factory for a custom **HierarchicalMenu** widget.\n */\nvar connectHierarchicalMenu = function connectHierarchicalMenu(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      attributes = _ref.attributes,\n      _ref$separator = _ref.separator,\n      separator = _ref$separator === void 0 ? ' > ' : _ref$separator,\n      _ref$rootPath = _ref.rootPath,\n      rootPath = _ref$rootPath === void 0 ? null : _ref$rootPath,\n      _ref$showParentLevel = _ref.showParentLevel,\n      showParentLevel = _ref$showParentLevel === void 0 ? true : _ref$showParentLevel,\n      _ref$limit = _ref.limit,\n      limit = _ref$limit === void 0 ? 10 : _ref$limit,\n      _ref$showMore = _ref.showMore,\n      showMore = _ref$showMore === void 0 ? false : _ref$showMore,\n      _ref$showMoreLimit = _ref.showMoreLimit,\n      showMoreLimit = _ref$showMoreLimit === void 0 ? 20 : _ref$showMoreLimit,\n      _ref$sortBy = _ref.sortBy,\n      sortBy = _ref$sortBy === void 0 ? DEFAULT_SORT : _ref$sortBy,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    if (!attributes || !Array.isArray(attributes) || attributes.length === 0) {\n      throw new Error(withUsage('The `attributes` option expects an array of strings.'));\n    }\n    if (showMore === true && showMoreLimit <= limit) {\n      throw new Error(withUsage('The `showMoreLimit` option must be greater than `limit`.'));\n    }\n    // we need to provide a hierarchicalFacet name for the search state\n    // so that we can always map $hierarchicalFacetName => real attributes\n    // we use the first attribute name\n    var _attributes = _slicedToArray(attributes, 1),\n      hierarchicalFacetName = _attributes[0];\n    var sendEvent;\n\n    // Provide the same function to the `renderFn` so that way the user\n    // has to only bind it once when `isFirstRendering` for instance\n    var toggleShowMore = function toggleShowMore() {};\n    function cachedToggleShowMore() {\n      toggleShowMore();\n    }\n    var _refine;\n    var isShowingMore = false;\n    function createToggleShowMore(renderOptions, widget) {\n      return function () {\n        isShowingMore = !isShowingMore;\n        widget.render(renderOptions);\n      };\n    }\n    function getLimit() {\n      return isShowingMore ? showMoreLimit : limit;\n    }\n    function _prepareFacetValues(facetValues) {\n      return facetValues.slice(0, getLimit()).map(function (_ref2) {\n        var label = _ref2.name,\n          value = _ref2.escapedValue,\n          data = _ref2.data,\n          path = _ref2.path,\n          subValue = _objectWithoutProperties(_ref2, _excluded);\n        var item = _objectSpread(_objectSpread({}, subValue), {}, {\n          value: value,\n          label: label,\n          data: null\n        });\n        if (Array.isArray(data)) {\n          item.data = _prepareFacetValues(data);\n        }\n        return item;\n      });\n    }\n    return {\n      $$type: 'ais.hierarchicalMenu',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        toggleShowMore = createToggleShowMore(renderOptions, this);\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref3) {\n        var state = _ref3.state;\n        unmountFn();\n        return state.removeHierarchicalFacet(hierarchicalFacetName).setQueryParameter('maxValuesPerFacet', undefined);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          hierarchicalMenu: _objectSpread(_objectSpread({}, renderState.hierarchicalMenu), {}, _defineProperty({}, hierarchicalFacetName, this.getWidgetRenderState(renderOptions)))\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref4) {\n        var _this = this;\n        var results = _ref4.results,\n          state = _ref4.state,\n          createURL = _ref4.createURL,\n          instantSearchInstance = _ref4.instantSearchInstance,\n          helper = _ref4.helper;\n        var items = [];\n        var canToggleShowMore = false;\n\n        // Bind createURL to this specific attribute\n        var _createURL = function _createURL(facetValue) {\n          return createURL(function (uiState) {\n            return _this.getWidgetUiState(uiState, {\n              searchParameters: state.resetPage().toggleFacetRefinement(hierarchicalFacetName, facetValue),\n              helper: helper\n            });\n          });\n        };\n        if (!sendEvent) {\n          sendEvent = createSendEventForFacet({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            attribute: function attribute(facetValue) {\n              var index = facetValue.split(separator).length - 1;\n              return attributes[index];\n            },\n            widgetType: this.$$type\n          });\n        }\n        if (!_refine) {\n          _refine = function _refine(facetValue) {\n            sendEvent('click:internal', facetValue);\n            helper.toggleFacetRefinement(hierarchicalFacetName, facetValue).search();\n          };\n        }\n        if (results) {\n          var facetValues = results.getFacetValues(hierarchicalFacetName, {\n            sortBy: sortBy,\n            facetOrdering: sortBy === DEFAULT_SORT\n          });\n          var facetItems = facetValues && !Array.isArray(facetValues) && facetValues.data ? facetValues.data : [];\n\n          // If the limit is the max number of facet retrieved it is impossible to know\n          // if the facets are exhaustive. The only moment we are sure it is exhaustive\n          // is when it is strictly under the number requested unless we know that another\n          // widget has requested more values (maxValuesPerFacet > getLimit()).\n          // Because this is used for making the search of facets unable or not, it is important\n          // to be conservative here.\n          var hasExhaustiveItems = (state.maxValuesPerFacet || 0) > getLimit() ? facetItems.length <= getLimit() : facetItems.length < getLimit();\n          canToggleShowMore = showMore && (isShowingMore || !hasExhaustiveItems);\n          items = transformItems(_prepareFacetValues(facetItems), {\n            results: results\n          });\n        }\n        return {\n          items: items,\n          refine: _refine,\n          canRefine: items.length > 0,\n          createURL: _createURL,\n          sendEvent: sendEvent,\n          widgetParams: widgetParams,\n          isShowingMore: isShowingMore,\n          toggleShowMore: cachedToggleShowMore,\n          canToggleShowMore: canToggleShowMore\n        };\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref5) {\n        var searchParameters = _ref5.searchParameters;\n        var path = searchParameters.getHierarchicalFacetBreadcrumb(hierarchicalFacetName);\n        return removeEmptyRefinementsFromUiState(_objectSpread(_objectSpread({}, uiState), {}, {\n          hierarchicalMenu: _objectSpread(_objectSpread({}, uiState.hierarchicalMenu), {}, _defineProperty({}, hierarchicalFacetName, path))\n        }), hierarchicalFacetName);\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref6) {\n        var uiState = _ref6.uiState;\n        var values = uiState.hierarchicalMenu && uiState.hierarchicalMenu[hierarchicalFacetName];\n        if (searchParameters.isConjunctiveFacet(hierarchicalFacetName) || searchParameters.isDisjunctiveFacet(hierarchicalFacetName)) {\n          process.env.NODE_ENV === 'development' ? warning(false, \"HierarchicalMenu: Attribute \\\"\".concat(hierarchicalFacetName, \"\\\" is already used by another widget applying conjunctive or disjunctive faceting.\\nAs this is not supported, please make sure to remove this other widget or this HierarchicalMenu widget will not work at all.\")) : void 0;\n          return searchParameters;\n        }\n        if (searchParameters.isHierarchicalFacet(hierarchicalFacetName)) {\n          var facet = searchParameters.getHierarchicalFacetByName(hierarchicalFacetName);\n          process.env.NODE_ENV === 'development' ? warning(isEqual(facet.attributes, attributes) && facet.separator === separator && facet.rootPath === rootPath, 'Using Breadcrumb and HierarchicalMenu on the same facet with different options overrides the configuration of the HierarchicalMenu.') : void 0;\n        }\n        var withFacetConfiguration = searchParameters.removeHierarchicalFacet(hierarchicalFacetName).addHierarchicalFacet({\n          name: hierarchicalFacetName,\n          attributes: attributes,\n          separator: separator,\n          rootPath: rootPath,\n          showParentLevel: showParentLevel\n        });\n        var currentMaxValuesPerFacet = withFacetConfiguration.maxValuesPerFacet || 0;\n        var nextMaxValuesPerFacet = Math.max(currentMaxValuesPerFacet, showMore ? showMoreLimit : limit);\n        var withMaxValuesPerFacet = withFacetConfiguration.setQueryParameter('maxValuesPerFacet', nextMaxValuesPerFacet);\n        if (!values) {\n          return withMaxValuesPerFacet.setQueryParameters({\n            hierarchicalFacetsRefinements: _objectSpread(_objectSpread({}, withMaxValuesPerFacet.hierarchicalFacetsRefinements), {}, _defineProperty({}, hierarchicalFacetName, []))\n          });\n        }\n        return withMaxValuesPerFacet.addHierarchicalFacetRefinement(hierarchicalFacetName, values.join(separator));\n      }\n    };\n  };\n};\nfunction removeEmptyRefinementsFromUiState(indexUiState, attribute) {\n  if (!indexUiState.hierarchicalMenu) {\n    return indexUiState;\n  }\n  if (!indexUiState.hierarchicalMenu[attribute] || indexUiState.hierarchicalMenu[attribute].length === 0) {\n    delete indexUiState.hierarchicalMenu[attribute];\n  }\n  if (Object.keys(indexUiState.hierarchicalMenu).length === 0) {\n    delete indexUiState.hierarchicalMenu;\n  }\n  return indexUiState;\n}\nexport default connectHierarchicalMenu;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/hits/connectHits.d.ts",
    "content": "import type { SendEventForHits, BindEventForHits } from '../../lib/utils';\nimport type { TransformItems, Connector, Hit, WidgetRenderState, BaseHit, Unmounter, Renderer, IndexRenderState } from '../../types';\nimport type { Banner, SearchResults } from 'algoliasearch-helper';\nexport type HitsRenderState<THit extends NonNullable<object> = BaseHit> = {\n    /**\n     * The matched hits from Algolia API.\n     * @deprecated use `items` instead\n     */\n    hits: Array<Hit<THit>>;\n    /**\n     * The matched hits from Algolia API.\n     */\n    items: Array<Hit<THit>>;\n    /**\n     * The response from the Algolia API.\n     */\n    results?: SearchResults<Hit<THit>>;\n    /**\n     * The banner to display above the hits.\n     */\n    banner?: Banner;\n    /**\n     * Sends an event to the Insights middleware.\n     */\n    sendEvent: SendEventForHits;\n    /**\n     * Returns a string for the `data-insights-event` attribute for the Insights middleware\n     */\n    bindEvent: BindEventForHits;\n};\nexport type HitsConnectorParams<THit extends NonNullable<object> = BaseHit> = {\n    /**\n     * Whether to escape HTML tags from hits string values.\n     *\n     * @default true\n     */\n    escapeHTML?: boolean;\n    /**\n     * Function to transform the items passed to the templates.\n     */\n    transformItems?: TransformItems<Hit<THit>>;\n};\nexport type HitsWidgetDescription<THit extends NonNullable<object> = BaseHit> = {\n    $$type: 'ais.hits';\n    renderState: HitsRenderState<THit>;\n    indexRenderState: {\n        hits: WidgetRenderState<HitsRenderState<THit>, HitsConnectorParams<THit>>;\n    };\n};\nexport type HitsConnector<THit extends NonNullable<object> = BaseHit> = Connector<HitsWidgetDescription<THit>, HitsConnectorParams<THit>>;\ndeclare const _default: <TWidgetParams>(renderFn: Renderer<HitsRenderState, TWidgetParams & HitsConnectorParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & HitsConnectorParams<THit>) => {\n    $$type: \"ais.hits\";\n    init(initOptions: import(\"../../types\").InitOptions): void;\n    render(renderOptions: import(\"../../types\").RenderOptions): void;\n    getRenderState(renderState: {\n        answers?: WidgetRenderState<import(\"../answers/connectAnswers\").AnswersRenderState, import(\"../answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: WidgetRenderState<import(\"../autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: WidgetRenderState<import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: WidgetRenderState<import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: WidgetRenderState<import(\"../configure/connectConfigure\").ConfigureRenderState, import(\"../configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: WidgetRenderState<import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: WidgetRenderState<import(\"../geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: WidgetRenderState<import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: WidgetRenderState<import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: WidgetRenderState<import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: WidgetRenderState<import(\"../menu/connectMenu\").MenuRenderState, import(\"../menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: WidgetRenderState<import(\"../numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: WidgetRenderState<import(\"../pagination/connectPagination\").PaginationRenderState, import(\"../pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: WidgetRenderState<import(\"../powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: WidgetRenderState<import(\"../query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: WidgetRenderState<import(\"../range/connectRange\").RangeRenderState, import(\"../range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: WidgetRenderState<import(\"../rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: WidgetRenderState<import(\"../refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: WidgetRenderState<import(\"../relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: WidgetRenderState<import(\"../search-box/connectSearchBox\").SearchBoxRenderState, import(\"../search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: WidgetRenderState<import(\"../sort-by/connectSortBy\").SortByRenderState, import(\"../sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: WidgetRenderState<import(\"../stats/connectStats\").StatsRenderState, import(\"../stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: WidgetRenderState<import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: WidgetRenderState<import(\"../voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: WidgetRenderState<Record<string, unknown>, import(\"../../widgets/analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: WidgetRenderState<Record<string, unknown>, import(\"../../widgets/places/places\").PlacesWidgetParams> | undefined;\n    }, renderOptions: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions): IndexRenderState & HitsWidgetDescription[\"indexRenderState\"];\n    getWidgetRenderState({ results, helper, instantSearchInstance }: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions): {\n        hits: never[];\n        items: never[];\n        results: undefined;\n        banner: undefined;\n        sendEvent: SendEventForHits;\n        bindEvent: BindEventForHits;\n        widgetParams: TWidgetParams & HitsConnectorParams<THit>;\n    } | {\n        hits: Hit<BaseHit>[] | Hit<THit>[];\n        items: Hit<BaseHit>[] | Hit<THit>[];\n        results: SearchResults<any>;\n        banner: Banner | undefined;\n        sendEvent: SendEventForHits;\n        bindEvent: BindEventForHits;\n        widgetParams: TWidgetParams & HitsConnectorParams<THit>;\n    };\n    dispose({ state }: import(\"../../types\").DisposeOptions): import(\"algoliasearch-helper\").SearchParameters;\n    getWidgetSearchParameters(state: import(\"algoliasearch-helper\").SearchParameters, _uiState: {\n        uiState: {\n            query?: string | undefined;\n            configure?: import(\"algoliasearch-helper\").PlainSearchParameters | undefined;\n            geoSearch?: {\n                boundingBox: string;\n            } | undefined;\n            hierarchicalMenu?: {\n                [rootAttribute: string]: string[];\n            } | undefined;\n            hitsPerPage?: number | undefined;\n            page?: number | undefined;\n            menu?: {\n                [attribute: string]: string;\n            } | undefined;\n            numericMenu?: {\n                [attribute: string]: string;\n            } | undefined;\n            range?: {\n                [attribute: string]: string;\n            } | undefined;\n            ratingMenu?: {\n                [attribute: string]: number | undefined;\n            } | undefined;\n            refinementList?: {\n                [attribute: string]: string[];\n            } | undefined;\n            relevantSort?: number | undefined;\n            sortBy?: string | undefined;\n            toggle?: {\n                [attribute: string]: boolean;\n            } | undefined;\n            places?: {\n                query: string;\n                position: string;\n            } | undefined;\n        };\n    }): import(\"algoliasearch-helper\").SearchParameters;\n};\nexport default _default;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/hits/connectHits.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { escapeHits, TAG_PLACEHOLDER, checkRendering, createDocumentationMessageGenerator, addAbsolutePosition, addQueryID, createSendEventForHits, createBindEventForHits, noop } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'hits',\n  connector: true\n});\nexport default (function connectHits(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      _ref$escapeHTML = _ref.escapeHTML,\n      escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    var sendEvent;\n    var bindEvent;\n    return {\n      $$type: 'ais.hits',\n      init: function init(initOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var renderState = this.getWidgetRenderState(renderOptions);\n        renderFn(_objectSpread(_objectSpread({}, renderState), {}, {\n          instantSearchInstance: renderOptions.instantSearchInstance\n        }), false);\n        renderState.sendEvent('view:internal', renderState.items);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions\n      // Type is explicitly redefined, to avoid having the TWidgetParams type in the definition\n      ) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          hits: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref2) {\n        var _results$renderingCon, _results$renderingCon2, _results$renderingCon3;\n        var results = _ref2.results,\n          helper = _ref2.helper,\n          instantSearchInstance = _ref2.instantSearchInstance;\n        if (!sendEvent) {\n          sendEvent = createSendEventForHits({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            widgetType: this.$$type\n          });\n        }\n        if (!bindEvent) {\n          bindEvent = createBindEventForHits({\n            helper: helper,\n            widgetType: this.$$type,\n            instantSearchInstance: instantSearchInstance\n          });\n        }\n        if (!results) {\n          return {\n            hits: [],\n            items: [],\n            results: undefined,\n            banner: undefined,\n            sendEvent: sendEvent,\n            bindEvent: bindEvent,\n            widgetParams: widgetParams\n          };\n        }\n        if (escapeHTML && results.hits.length > 0) {\n          results.hits = escapeHits(results.hits);\n        }\n        var hitsWithAbsolutePosition = addAbsolutePosition(results.hits, results.page, results.hitsPerPage);\n        var hitsWithAbsolutePositionAndQueryID = addQueryID(hitsWithAbsolutePosition, results.queryID);\n        var items = transformItems(hitsWithAbsolutePositionAndQueryID, {\n          results: results\n        });\n        var banner = (_results$renderingCon = results.renderingContent) === null || _results$renderingCon === void 0 ? void 0 : (_results$renderingCon2 = _results$renderingCon.widgets) === null || _results$renderingCon2 === void 0 ? void 0 : (_results$renderingCon3 = _results$renderingCon2.banners) === null || _results$renderingCon3 === void 0 ? void 0 : _results$renderingCon3[0];\n        return {\n          hits: items,\n          items: items,\n          results: results,\n          banner: banner,\n          sendEvent: sendEvent,\n          bindEvent: bindEvent,\n          widgetParams: widgetParams\n        };\n      },\n      dispose: function dispose(_ref3) {\n        var state = _ref3.state;\n        unmountFn();\n        if (!escapeHTML) {\n          return state;\n        }\n        return state.setQueryParameters(Object.keys(TAG_PLACEHOLDER).reduce(function (acc, key) {\n          return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, undefined));\n        }, {}));\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(state, _uiState) {\n        if (!escapeHTML) {\n          return state;\n        }\n\n        // @MAJOR: set this globally, not in the Hits widget to allow Hits to be conditionally used\n        return state.setQueryParameters(TAG_PLACEHOLDER);\n      }\n    };\n  };\n});"
  },
  {
    "path": "js/instantsearch.js/es/connectors/hits/connectHitsWithInsights.d.ts",
    "content": "import type { HitsConnectorParams, HitsWidgetDescription } from './connectHits';\ndeclare const connectHitsWithInsights: <TWidgetParams>(renderFn: import(\"../../types\").Renderer<import(\"./connectHits\").HitsRenderState, TWidgetParams & HitsConnectorParams>, unmountFn?: import(\"../../types\").Unmounter) => <THit extends NonNullable<object> = import(\"../../types\").BaseHit>(widgetParams: TWidgetParams & HitsConnectorParams<THit>) => {\n    $$type: \"ais.hits\";\n    init(initOptions: import(\"../../types\").InitOptions): void;\n    render(renderOptions: import(\"../../types\").RenderOptions): void;\n    getRenderState(renderState: {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../answers/connectAnswers\").AnswersRenderState, import(\"../answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../configure/connectConfigure\").ConfigureRenderState, import(\"../configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<import(\"./connectHits\").HitsRenderState<import(\"../../types\").BaseHit>, HitsConnectorParams<import(\"../../types\").BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<import(\"../../types\").BaseHit>, import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<import(\"../../types\").BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../menu/connectMenu\").MenuRenderState, import(\"../menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../pagination/connectPagination\").PaginationRenderState, import(\"../pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../range/connectRange\").RangeRenderState, import(\"../range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../search-box/connectSearchBox\").SearchBoxRenderState, import(\"../search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../sort-by/connectSortBy\").SortByRenderState, import(\"../sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../stats/connectStats\").StatsRenderState, import(\"../stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../../widgets/analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../../widgets/places/places\").PlacesWidgetParams> | undefined;\n    }, renderOptions: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions): import(\"../../types\").IndexRenderState & HitsWidgetDescription[\"indexRenderState\"];\n    getWidgetRenderState({ results, helper, instantSearchInstance }: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions): {\n        hits: never[];\n        items: never[];\n        results: undefined;\n        banner: undefined;\n        sendEvent: import(\"../../lib/utils\").SendEventForHits;\n        bindEvent: import(\"../../lib/utils\").BindEventForHits;\n        widgetParams: TWidgetParams & HitsConnectorParams<THit>;\n    } | {\n        hits: import(\"../../types\").Hit<import(\"../../types\").BaseHit>[] | import(\"../../types\").Hit<THit>[];\n        items: import(\"../../types\").Hit<import(\"../../types\").BaseHit>[] | import(\"../../types\").Hit<THit>[];\n        results: import(\"algoliasearch-helper\").SearchResults<any>;\n        banner: import(\"algoliasearch-helper\").Banner | undefined;\n        sendEvent: import(\"../../lib/utils\").SendEventForHits;\n        bindEvent: import(\"../../lib/utils\").BindEventForHits;\n        widgetParams: TWidgetParams & HitsConnectorParams<THit>;\n    };\n    dispose({ state }: import(\"../../types\").DisposeOptions): import(\"algoliasearch-helper\").SearchParameters;\n    getWidgetSearchParameters(state: import(\"algoliasearch-helper\").SearchParameters, _uiState: {\n        uiState: {\n            query?: string | undefined;\n            configure?: import(\"algoliasearch-helper\").PlainSearchParameters | undefined;\n            geoSearch?: {\n                boundingBox: string;\n            } | undefined;\n            hierarchicalMenu?: {\n                [rootAttribute: string]: string[];\n            } | undefined;\n            hitsPerPage?: number | undefined;\n            page?: number | undefined;\n            menu?: {\n                [attribute: string]: string;\n            } | undefined;\n            numericMenu?: {\n                [attribute: string]: string;\n            } | undefined;\n            range?: {\n                [attribute: string]: string;\n            } | undefined;\n            ratingMenu?: {\n                [attribute: string]: number | undefined;\n            } | undefined;\n            refinementList?: {\n                [attribute: string]: string[];\n            } | undefined;\n            relevantSort?: number | undefined;\n            sortBy?: string | undefined;\n            toggle?: {\n                [attribute: string]: boolean;\n            } | undefined;\n            places?: {\n                query: string;\n                position: string;\n            } | undefined;\n        };\n    }): import(\"algoliasearch-helper\").SearchParameters;\n};\nexport default connectHitsWithInsights;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/hits/connectHitsWithInsights.js",
    "content": "import { withInsights } from \"../../lib/insights/index.js\";\nimport connectHits from \"./connectHits.js\";\n\n/**\n * Due to https://github.com/microsoft/web-build-tools/issues/1050, we need\n * Connector<...> imported in this file, even though it is only used implicitly.\n * This _uses_ Connector<...> so it is not accidentally removed by someone.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\nvar connectHitsWithInsights = withInsights(connectHits);\nexport default connectHitsWithInsights;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/hits-per-page/connectHitsPerPage.d.ts",
    "content": "import type { Connector, TransformItems, CreateURL, WidgetRenderState } from '../../types';\nexport type HitsPerPageRenderStateItem = {\n    /**\n     * Label to display in the option.\n     */\n    label: string;\n    /**\n     * Number of hits to display per page.\n     */\n    value: number;\n    /**\n     * Indicates if it's the current refined value.\n     */\n    isRefined: boolean;\n};\nexport type HitsPerPageConnectorParamsItem = {\n    /**\n     * Label to display in the option.\n     */\n    label: string;\n    /**\n     * Number of hits to display per page.\n     */\n    value: number;\n    /**\n     * The default hits per page on first search.\n     *\n     * @default false\n     */\n    default?: boolean;\n};\nexport type HitsPerPageConnectorParams = {\n    /**\n     * Array of objects defining the different values and labels.\n     */\n    items: HitsPerPageConnectorParamsItem[];\n    /**\n     * Function to transform the items passed to the templates.\n     */\n    transformItems?: TransformItems<HitsPerPageRenderStateItem>;\n};\nexport type HitsPerPageRenderState = {\n    /**\n     * Array of objects defining the different values and labels.\n     */\n    items: HitsPerPageRenderStateItem[];\n    /**\n     * Creates the URL for a single item name in the list.\n     */\n    createURL: CreateURL<HitsPerPageConnectorParamsItem['value']>;\n    /**\n     * Sets the number of hits per page and triggers a search.\n     */\n    refine: (value: number) => void;\n    /**\n     * Indicates whether or not the search has results.\n     * @deprecated Use `canRefine` instead.\n     */\n    hasNoResults: boolean;\n    /**\n     * Indicates if search state can be refined.\n     */\n    canRefine: boolean;\n};\nexport type HitsPerPageWidgetDescription = {\n    $$type: 'ais.hitsPerPage';\n    renderState: HitsPerPageRenderState;\n    indexRenderState: {\n        hitsPerPage: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams>;\n    };\n    indexUiState: {\n        hitsPerPage: number;\n    };\n};\nexport type HitsPerPageConnector = Connector<HitsPerPageWidgetDescription, HitsPerPageConnectorParams>;\ndeclare const connectHitsPerPage: HitsPerPageConnector;\nexport default connectHitsPerPage;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/hits-per-page/connectHitsPerPage.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { checkRendering, warning, createDocumentationMessageGenerator, noop } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'hits-per-page',\n  connector: true\n});\nvar connectHitsPerPage = function connectHitsPerPage(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      userItems = _ref.items,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    if (!Array.isArray(userItems)) {\n      throw new Error(withUsage('The `items` option expects an array of objects.'));\n    }\n    var items = userItems;\n    var defaultItems = items.filter(function (item) {\n      return item.default === true;\n    });\n    if (defaultItems.length === 0) {\n      throw new Error(withUsage(\"A default value must be specified in `items`.\"));\n    }\n    if (defaultItems.length > 1) {\n      throw new Error(withUsage('More than one default value is specified in `items`.'));\n    }\n    var defaultItem = defaultItems[0];\n    var normalizeItems = function normalizeItems(_ref2) {\n      var hitsPerPage = _ref2.hitsPerPage;\n      return items.map(function (item) {\n        return _objectSpread(_objectSpread({}, item), {}, {\n          isRefined: Number(item.value) === Number(hitsPerPage)\n        });\n      });\n    };\n    var connectorState = {\n      getRefine: function getRefine(helper) {\n        return function (value) {\n          return !value && value !== 0 ? helper.setQueryParameter('hitsPerPage', undefined).search() : helper.setQueryParameter('hitsPerPage', value).search();\n        };\n      },\n      createURLFactory: function createURLFactory(_ref3) {\n        var state = _ref3.state,\n          createURL = _ref3.createURL,\n          getWidgetUiState = _ref3.getWidgetUiState,\n          helper = _ref3.helper;\n        return function (value) {\n          return createURL(function (uiState) {\n            return getWidgetUiState(uiState, {\n              searchParameters: state.resetPage().setQueryParameter('hitsPerPage', !value && value !== 0 ? undefined : value),\n              helper: helper\n            });\n          });\n        };\n      }\n    };\n    return {\n      $$type: 'ais.hitsPerPage',\n      init: function init(initOptions) {\n        var state = initOptions.state,\n          instantSearchInstance = initOptions.instantSearchInstance;\n        var isCurrentInOptions = items.some(function (item) {\n          return Number(state.hitsPerPage) === Number(item.value);\n        });\n        if (!isCurrentInOptions) {\n          process.env.NODE_ENV === 'development' ? warning(state.hitsPerPage !== undefined, \"\\n`hitsPerPage` is not defined.\\nThe option `hitsPerPage` needs to be set using the `configure` widget.\\n\\nLearn more: https://www.algolia.com/doc/api-reference/widgets/hits-per-page/js/\\n            \") : void 0;\n          process.env.NODE_ENV === 'development' ? warning(false, \"\\nThe `items` option of `hitsPerPage` does not contain the \\\"hits per page\\\" value coming from the state: \".concat(state.hitsPerPage, \".\\n\\nYou may want to add another entry to the `items` option with this value.\")) : void 0;\n          items = [\n          // The helper will convert the empty string to `undefined`.\n          {\n            value: '',\n            label: ''\n          }].concat(_toConsumableArray(items));\n        }\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref4) {\n        var state = _ref4.state;\n        unmountFn();\n        return state.setQueryParameter('hitsPerPage', undefined);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          hitsPerPage: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref5) {\n        var state = _ref5.state,\n          results = _ref5.results,\n          createURL = _ref5.createURL,\n          helper = _ref5.helper;\n        var canRefine = results ? results.nbHits > 0 : false;\n        return {\n          items: transformItems(normalizeItems(state), {\n            results: results\n          }),\n          refine: connectorState.getRefine(helper),\n          createURL: connectorState.createURLFactory({\n            state: state,\n            createURL: createURL,\n            getWidgetUiState: this.getWidgetUiState,\n            helper: helper\n          }),\n          hasNoResults: !canRefine,\n          canRefine: canRefine,\n          widgetParams: widgetParams\n        };\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref6) {\n        var searchParameters = _ref6.searchParameters;\n        var hitsPerPage = searchParameters.hitsPerPage;\n        if (hitsPerPage === undefined || hitsPerPage === defaultItem.value) {\n          return uiState;\n        }\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          hitsPerPage: hitsPerPage\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref7) {\n        var uiState = _ref7.uiState;\n        return searchParameters.setQueryParameters({\n          hitsPerPage: uiState.hitsPerPage || defaultItem.value\n        });\n      }\n    };\n  };\n};\nexport default connectHitsPerPage;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/index.d.ts",
    "content": "import connectDynamicWidgets from './dynamic-widgets/connectDynamicWidgets';\n/** @deprecated answers is no longer supported */\nexport declare const EXPERIMENTAL_connectAnswers: import(\"./answers/connectAnswers\").AnswersConnector;\n/** @deprecated use connectRelatedItems instead */\nexport declare const EXPERIMENTAL_connectConfigureRelatedItems: import(\"./configure-related-items/connectConfigureRelatedItems\").ConfigureRelatedItemsConnector;\n/** @deprecated use connectDynamicWidgets */\nexport declare const EXPERIMENTAL_connectDynamicWidgets: import(\"./dynamic-widgets/connectDynamicWidgets\").DynamicWidgetsConnector;\nexport { connectDynamicWidgets };\nexport { default as connectClearRefinements } from './clear-refinements/connectClearRefinements';\nexport { default as connectCurrentRefinements } from './current-refinements/connectCurrentRefinements';\nexport { default as connectHierarchicalMenu } from './hierarchical-menu/connectHierarchicalMenu';\nexport { default as connectHits } from './hits/connectHits';\nexport { default as connectHitsWithInsights } from './hits/connectHitsWithInsights';\nexport { default as connectHitsPerPage } from './hits-per-page/connectHitsPerPage';\nexport { default as connectInfiniteHits } from './infinite-hits/connectInfiniteHits';\nexport { default as connectInfiniteHitsWithInsights } from './infinite-hits/connectInfiniteHitsWithInsights';\nexport { default as connectMenu } from './menu/connectMenu';\nexport { default as connectNumericMenu } from './numeric-menu/connectNumericMenu';\nexport { default as connectPagination } from './pagination/connectPagination';\nexport { default as connectRange } from './range/connectRange';\nexport { default as connectRefinementList } from './refinement-list/connectRefinementList';\nexport { default as connectRelatedProducts } from './related-products/connectRelatedProducts';\nexport { default as connectSearchBox } from './search-box/connectSearchBox';\nexport { default as connectSortBy } from './sort-by/connectSortBy';\nexport { default as connectRatingMenu } from './rating-menu/connectRatingMenu';\nexport { default as connectStats } from './stats/connectStats';\nexport { default as connectToggleRefinement } from './toggle-refinement/connectToggleRefinement';\nexport { default as connectTrendingItems } from './trending-items/connectTrendingItems';\nexport { default as connectBreadcrumb } from './breadcrumb/connectBreadcrumb';\nexport { default as connectGeoSearch } from './geo-search/connectGeoSearch';\nexport { default as connectPoweredBy } from './powered-by/connectPoweredBy';\nexport { default as connectConfigure } from './configure/connectConfigure';\nexport { default as connectAutocomplete } from './autocomplete/connectAutocomplete';\nexport { default as connectQueryRules } from './query-rules/connectQueryRules';\nexport { default as connectVoiceSearch } from './voice-search/connectVoiceSearch';\nexport { default as connectRelevantSort } from './relevant-sort/connectRelevantSort';\nexport { default as connectFrequentlyBoughtTogether } from './frequently-bought-together/connectFrequentlyBoughtTogether';\nexport { default as connectLookingSimilar } from './looking-similar/connectLookingSimilar';\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/index.js",
    "content": "import { deprecate } from \"../lib/utils/index.js\";\nimport connectAnswers from \"./answers/connectAnswers.js\";\nimport connectConfigureRelatedItems from \"./configure-related-items/connectConfigureRelatedItems.js\";\nimport connectDynamicWidgets from \"./dynamic-widgets/connectDynamicWidgets.js\";\n\n/** @deprecated answers is no longer supported */\nexport var EXPERIMENTAL_connectAnswers = deprecate(connectAnswers, 'answers is no longer supported');\n\n/** @deprecated use connectRelatedItems instead */\nexport var EXPERIMENTAL_connectConfigureRelatedItems = deprecate(connectConfigureRelatedItems, 'EXPERIMENTAL_connectConfigureRelatedItems is deprecated and will be removed in a next minor version of InstantSearch. Please use connectRelatedItems instead.');\n\n/** @deprecated use connectDynamicWidgets */\nexport var EXPERIMENTAL_connectDynamicWidgets = deprecate(connectDynamicWidgets, 'use connectDynamicWidgets');\nexport { connectDynamicWidgets };\nexport { default as connectClearRefinements } from \"./clear-refinements/connectClearRefinements.js\";\nexport { default as connectCurrentRefinements } from \"./current-refinements/connectCurrentRefinements.js\";\nexport { default as connectHierarchicalMenu } from \"./hierarchical-menu/connectHierarchicalMenu.js\";\nexport { default as connectHits } from \"./hits/connectHits.js\";\nexport { default as connectHitsWithInsights } from \"./hits/connectHitsWithInsights.js\";\nexport { default as connectHitsPerPage } from \"./hits-per-page/connectHitsPerPage.js\";\nexport { default as connectInfiniteHits } from \"./infinite-hits/connectInfiniteHits.js\";\nexport { default as connectInfiniteHitsWithInsights } from \"./infinite-hits/connectInfiniteHitsWithInsights.js\";\nexport { default as connectMenu } from \"./menu/connectMenu.js\";\nexport { default as connectNumericMenu } from \"./numeric-menu/connectNumericMenu.js\";\nexport { default as connectPagination } from \"./pagination/connectPagination.js\";\nexport { default as connectRange } from \"./range/connectRange.js\";\nexport { default as connectRefinementList } from \"./refinement-list/connectRefinementList.js\";\nexport { default as connectRelatedProducts } from \"./related-products/connectRelatedProducts.js\";\nexport { default as connectSearchBox } from \"./search-box/connectSearchBox.js\";\nexport { default as connectSortBy } from \"./sort-by/connectSortBy.js\";\nexport { default as connectRatingMenu } from \"./rating-menu/connectRatingMenu.js\";\nexport { default as connectStats } from \"./stats/connectStats.js\";\nexport { default as connectToggleRefinement } from \"./toggle-refinement/connectToggleRefinement.js\";\nexport { default as connectTrendingItems } from \"./trending-items/connectTrendingItems.js\";\nexport { default as connectBreadcrumb } from \"./breadcrumb/connectBreadcrumb.js\";\nexport { default as connectGeoSearch } from \"./geo-search/connectGeoSearch.js\";\nexport { default as connectPoweredBy } from \"./powered-by/connectPoweredBy.js\";\nexport { default as connectConfigure } from \"./configure/connectConfigure.js\";\nexport { default as connectAutocomplete } from \"./autocomplete/connectAutocomplete.js\";\nexport { default as connectQueryRules } from \"./query-rules/connectQueryRules.js\";\nexport { default as connectVoiceSearch } from \"./voice-search/connectVoiceSearch.js\";\nexport { default as connectRelevantSort } from \"./relevant-sort/connectRelevantSort.js\";\nexport { default as connectFrequentlyBoughtTogether } from \"./frequently-bought-together/connectFrequentlyBoughtTogether.js\";\nexport { default as connectLookingSimilar } from \"./looking-similar/connectLookingSimilar.js\";"
  },
  {
    "path": "js/instantsearch.js/es/connectors/infinite-hits/connectInfiniteHits.d.ts",
    "content": "import type { SendEventForHits, BindEventForHits } from '../../lib/utils';\nimport type { Connector, TransformItems, Hit, WidgetRenderState, BaseHit, Renderer, Unmounter, UnknownWidgetParams, IndexRenderState } from '../../types';\nimport type { Banner, AlgoliaSearchHelper as Helper, PlainSearchParameters, SearchParameters, SearchResults } from 'algoliasearch-helper';\nexport type InfiniteHitsCachedHits<THit extends NonNullable<object>> = {\n    [page: number]: Array<Hit<THit>>;\n};\ntype Read<THit extends NonNullable<object>> = ({ state, }: {\n    state: PlainSearchParameters;\n}) => InfiniteHitsCachedHits<THit> | null;\ntype Write<THit extends NonNullable<object>> = ({ state, hits, }: {\n    state: PlainSearchParameters;\n    hits: InfiniteHitsCachedHits<THit>;\n}) => void;\nexport type InfiniteHitsCache<THit extends NonNullable<object> = BaseHit> = {\n    read: Read<THit>;\n    write: Write<THit>;\n};\nexport type InfiniteHitsConnectorParams<THit extends NonNullable<object> = BaseHit> = {\n    /**\n     * Escapes HTML entities from hits string values.\n     *\n     * @default `true`\n     */\n    escapeHTML?: boolean;\n    /**\n     * Enable the button to load previous results.\n     *\n     * @default `false`\n     */\n    showPrevious?: boolean;\n    /**\n     * Receives the items, and is called before displaying them.\n     * Useful for mapping over the items to transform, and remove or reorder them.\n     */\n    transformItems?: TransformItems<Hit<THit>>;\n    /**\n     * Reads and writes hits from/to cache.\n     * When user comes back to the search page after leaving for product page,\n     * this helps restore InfiniteHits and its scroll position.\n     */\n    cache?: InfiniteHitsCache<THit>;\n};\nexport type InfiniteHitsRenderState<THit extends NonNullable<object> = BaseHit> = {\n    /**\n     * Loads the previous results.\n     */\n    showPrevious: () => void;\n    /**\n     * Loads the next page of hits.\n     */\n    showMore: () => void;\n    /**\n     * Indicates whether the first page of hits has been reached.\n     */\n    isFirstPage: boolean;\n    /**\n     * Indicates whether the last page of hits has been reached.\n     */\n    isLastPage: boolean;\n    /**\n     * Send event to insights middleware\n     */\n    sendEvent: SendEventForHits;\n    /**\n     * Returns a string of data-insights-event attribute for insights middleware\n     */\n    bindEvent: BindEventForHits;\n    /**\n     * Hits for the current page\n     */\n    currentPageHits: Array<Hit<THit>>;\n    /**\n     * Hits for current and cached pages\n     * @deprecated use `items` instead\n     */\n    hits: Array<Hit<THit>>;\n    /**\n     * Hits for current and cached pages\n     */\n    items: Array<Hit<THit>>;\n    /**\n     * The response from the Algolia API.\n     */\n    results?: SearchResults<Hit<THit>> | null;\n    /**\n     * The banner to display above the hits.\n     */\n    banner?: Banner;\n};\nexport type InfiniteHitsWidgetDescription<THit extends NonNullable<object> = BaseHit> = {\n    $$type: 'ais.infiniteHits';\n    renderState: InfiniteHitsRenderState<THit>;\n    indexRenderState: {\n        infiniteHits: WidgetRenderState<InfiniteHitsRenderState<THit>, InfiniteHitsConnectorParams<THit>>;\n    };\n    indexUiState: {\n        page: number;\n    };\n};\nexport type InfiniteHitsConnector<THit extends NonNullable<object> = BaseHit> = Connector<InfiniteHitsWidgetDescription<THit>, InfiniteHitsConnectorParams<THit>>;\ndeclare const _default: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<InfiniteHitsRenderState, TWidgetParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & InfiniteHitsConnectorParams<THit>) => {\n    $$type: \"ais.infiniteHits\";\n    init(initOptions: import(\"../../types\").InitOptions): void;\n    render(renderOptions: import(\"../../types\").RenderOptions): void;\n    getRenderState(renderState: {\n        answers?: WidgetRenderState<import(\"../answers/connectAnswers\").AnswersRenderState, import(\"../answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: WidgetRenderState<import(\"../autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: WidgetRenderState<import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: WidgetRenderState<import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: WidgetRenderState<import(\"../configure/connectConfigure\").ConfigureRenderState, import(\"../configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: WidgetRenderState<import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: WidgetRenderState<import(\"../geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: WidgetRenderState<import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: WidgetRenderState<import(\"../hits/connectHits\").HitsRenderState<BaseHit>, import(\"../hits/connectHits\").HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: WidgetRenderState<import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: WidgetRenderState<import(\"../menu/connectMenu\").MenuRenderState, import(\"../menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: WidgetRenderState<import(\"../numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: WidgetRenderState<import(\"../pagination/connectPagination\").PaginationRenderState, import(\"../pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: WidgetRenderState<import(\"../powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: WidgetRenderState<import(\"../query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: WidgetRenderState<import(\"../range/connectRange\").RangeRenderState, import(\"../range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: WidgetRenderState<import(\"../rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: WidgetRenderState<import(\"../refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: WidgetRenderState<import(\"../relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: WidgetRenderState<import(\"../search-box/connectSearchBox\").SearchBoxRenderState, import(\"../search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: WidgetRenderState<import(\"../sort-by/connectSortBy\").SortByRenderState, import(\"../sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: WidgetRenderState<import(\"../stats/connectStats\").StatsRenderState, import(\"../stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: WidgetRenderState<import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: WidgetRenderState<import(\"../voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: WidgetRenderState<Record<string, unknown>, import(\"../../widgets/analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: WidgetRenderState<Record<string, unknown>, import(\"../../widgets/places/places\").PlacesWidgetParams> | undefined;\n    }, renderOptions: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions): IndexRenderState & InfiniteHitsWidgetDescription[\"indexRenderState\"];\n    getWidgetRenderState({ results, helper, parent, state: existingState, instantSearchInstance, }: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions): {\n        hits: Hit<THit>[];\n        items: Hit<THit>[];\n        currentPageHits: Hit<THit>[];\n        sendEvent: SendEventForHits;\n        bindEvent: BindEventForHits;\n        banner: Banner | undefined;\n        results: SearchResults<any> | undefined;\n        showPrevious: () => void;\n        showMore: () => void;\n        isFirstPage: boolean;\n        isLastPage: boolean;\n        widgetParams: TWidgetParams & InfiniteHitsConnectorParams<THit>;\n    };\n    dispose({ state }: import(\"../../types\").DisposeOptions): SearchParameters;\n    getWidgetUiState(uiState: {\n        page?: number | undefined;\n        query?: string | undefined;\n        configure?: PlainSearchParameters | undefined;\n        geoSearch?: {\n            boundingBox: string;\n        } | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: string[];\n        } | undefined;\n        hitsPerPage?: number | undefined;\n        menu?: {\n            [attribute: string]: string;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: string;\n        } | undefined;\n        range?: {\n            [attribute: string]: string;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: number | undefined;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: string[];\n        } | undefined;\n        relevantSort?: number | undefined;\n        sortBy?: string | undefined;\n        toggle?: {\n            [attribute: string]: boolean;\n        } | undefined;\n        places?: {\n            query: string;\n            position: string;\n        } | undefined;\n    }, { searchParameters }: {\n        searchParameters: SearchParameters;\n        helper: Helper;\n    }): {\n        page?: number | undefined;\n        query?: string | undefined;\n        configure?: PlainSearchParameters | undefined;\n        geoSearch?: {\n            boundingBox: string;\n        } | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: string[];\n        } | undefined;\n        hitsPerPage?: number | undefined;\n        menu?: {\n            [attribute: string]: string;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: string;\n        } | undefined;\n        range?: {\n            [attribute: string]: string;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: number | undefined;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: string[];\n        } | undefined;\n        relevantSort?: number | undefined;\n        sortBy?: string | undefined;\n        toggle?: {\n            [attribute: string]: boolean;\n        } | undefined;\n        places?: {\n            query: string;\n            position: string;\n        } | undefined;\n    };\n    getWidgetSearchParameters(searchParameters: SearchParameters, { uiState }: {\n        uiState: {\n            page?: number | undefined;\n            query?: string | undefined;\n            configure?: PlainSearchParameters | undefined;\n            geoSearch?: {\n                boundingBox: string;\n            } | undefined;\n            hierarchicalMenu?: {\n                [rootAttribute: string]: string[];\n            } | undefined;\n            hitsPerPage?: number | undefined;\n            menu?: {\n                [attribute: string]: string;\n            } | undefined;\n            numericMenu?: {\n                [attribute: string]: string;\n            } | undefined;\n            range?: {\n                [attribute: string]: string;\n            } | undefined;\n            ratingMenu?: {\n                [attribute: string]: number | undefined;\n            } | undefined;\n            refinementList?: {\n                [attribute: string]: string[];\n            } | undefined;\n            relevantSort?: number | undefined;\n            sortBy?: string | undefined;\n            toggle?: {\n                [attribute: string]: boolean;\n            } | undefined;\n            places?: {\n                query: string;\n                position: string;\n            } | undefined;\n        };\n    }): SearchParameters;\n};\nexport default _default;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/infinite-hits/connectInfiniteHits.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _excluded = [\"page\"],\n  _excluded2 = [\"clickAnalytics\", \"userToken\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport { escapeHits, TAG_PLACEHOLDER, checkRendering, createDocumentationMessageGenerator, isEqual, addAbsolutePosition, addQueryID, noop, createSendEventForHits, createBindEventForHits, walkIndex } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'infinite-hits',\n  connector: true\n});\nfunction getStateWithoutPage(state) {\n  var _ref = state || {},\n    page = _ref.page,\n    rest = _objectWithoutProperties(_ref, _excluded);\n  return rest;\n}\nfunction normalizeState(state) {\n  var _ref2 = state || {},\n    clickAnalytics = _ref2.clickAnalytics,\n    userToken = _ref2.userToken,\n    rest = _objectWithoutProperties(_ref2, _excluded2);\n  return rest;\n}\nfunction getInMemoryCache() {\n  var cachedHits = null;\n  var cachedState = null;\n  return {\n    read: function read(_ref3) {\n      var state = _ref3.state;\n      return isEqual(cachedState, getStateWithoutPage(state)) ? cachedHits : null;\n    },\n    write: function write(_ref4) {\n      var state = _ref4.state,\n        hits = _ref4.hits;\n      cachedState = getStateWithoutPage(state);\n      cachedHits = hits;\n    }\n  };\n}\nfunction extractHitsFromCachedHits(cachedHits) {\n  return Object.keys(cachedHits).map(Number).sort(function (a, b) {\n    return a - b;\n  }).reduce(function (acc, page) {\n    return acc.concat(cachedHits[page]);\n  }, []);\n}\nexport default (function connectInfiniteHits(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref5 = widgetParams || {},\n      _ref5$escapeHTML = _ref5.escapeHTML,\n      escapeHTML = _ref5$escapeHTML === void 0 ? true : _ref5$escapeHTML,\n      _ref5$transformItems = _ref5.transformItems,\n      transformItems = _ref5$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref5$transformItems,\n      _ref5$cache = _ref5.cache,\n      cache = _ref5$cache === void 0 ? getInMemoryCache() : _ref5$cache;\n    var showPrevious;\n    var showMore;\n    var sendEvent;\n    var bindEvent;\n    var getFirstReceivedPage = function getFirstReceivedPage(state, cachedHits) {\n      var _state$page = state.page,\n        page = _state$page === void 0 ? 0 : _state$page;\n      var pages = Object.keys(cachedHits).map(Number);\n      if (pages.length === 0) {\n        return page;\n      } else {\n        return Math.min.apply(Math, [page].concat(_toConsumableArray(pages)));\n      }\n    };\n    var getLastReceivedPage = function getLastReceivedPage(state, cachedHits) {\n      var _state$page2 = state.page,\n        page = _state$page2 === void 0 ? 0 : _state$page2;\n      var pages = Object.keys(cachedHits).map(Number);\n      if (pages.length === 0) {\n        return page;\n      } else {\n        return Math.max.apply(Math, [page].concat(_toConsumableArray(pages)));\n      }\n    };\n    var getShowPrevious = function getShowPrevious(helper) {\n      return function () {\n        // Using the helper's `overrideStateWithoutTriggeringChangeEvent` method\n        // avoid updating the browser URL when the user displays the previous page.\n        helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread(_objectSpread({}, helper.state), {}, {\n          page: getFirstReceivedPage(helper.state, cache.read({\n            state: normalizeState(helper.state)\n          }) || {}) - 1\n        })).searchWithoutTriggeringOnStateChange();\n      };\n    };\n    var getShowMore = function getShowMore(helper) {\n      return function () {\n        helper.setPage(getLastReceivedPage(helper.state, cache.read({\n          state: normalizeState(helper.state)\n        }) || {}) + 1).search();\n      };\n    };\n    return {\n      $$type: 'ais.infiniteHits',\n      init: function init(initOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        var widgetRenderState = this.getWidgetRenderState(renderOptions);\n        renderFn(_objectSpread(_objectSpread({}, widgetRenderState), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n        sendEvent('view:internal', widgetRenderState.currentPageHits);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions\n      // Type is explicitly redefined, to avoid having the TWidgetParams type in the definition\n      ) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          infiniteHits: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref6) {\n        var _results$renderingCon, _results$renderingCon2, _results$renderingCon3;\n        var results = _ref6.results,\n          helper = _ref6.helper,\n          parent = _ref6.parent,\n          existingState = _ref6.state,\n          instantSearchInstance = _ref6.instantSearchInstance;\n        var isFirstPage;\n        var currentPageHits = [];\n        /**\n         * We bail out of optimistic UI here, as the cache is based on search\n         * parameters, and we don't want to invalidate the cache when the search\n         * is loading.\n         */\n        var state = parent.getPreviousState() || existingState;\n        var cachedHits = cache.read({\n          state: normalizeState(state)\n        }) || {};\n        var banner = results === null || results === void 0 ? void 0 : (_results$renderingCon = results.renderingContent) === null || _results$renderingCon === void 0 ? void 0 : (_results$renderingCon2 = _results$renderingCon.widgets) === null || _results$renderingCon2 === void 0 ? void 0 : (_results$renderingCon3 = _results$renderingCon2.banners) === null || _results$renderingCon3 === void 0 ? void 0 : _results$renderingCon3[0];\n        if (!results) {\n          showPrevious = getShowPrevious(helper);\n          showMore = getShowMore(helper);\n          sendEvent = createSendEventForHits({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            widgetType: this.$$type\n          });\n          bindEvent = createBindEventForHits({\n            helper: helper,\n            widgetType: this.$$type,\n            instantSearchInstance: instantSearchInstance\n          });\n          isFirstPage = state.page === undefined || getFirstReceivedPage(state, cachedHits) === 0;\n        } else {\n          var _state$disjunctiveFac, _state$hierarchicalFa;\n          var _state$page3 = state.page,\n            _page = _state$page3 === void 0 ? 0 : _state$page3;\n          if (escapeHTML && results.hits.length > 0) {\n            results.hits = escapeHits(results.hits);\n          }\n          var hitsWithAbsolutePosition = addAbsolutePosition(results.hits, results.page, results.hitsPerPage);\n          var hitsWithAbsolutePositionAndQueryID = addQueryID(hitsWithAbsolutePosition, results.queryID);\n          var transformedHits = transformItems(hitsWithAbsolutePositionAndQueryID, {\n            results: results\n          });\n\n          /*\n            With dynamic widgets, facets are not included in the state before their relevant widgets are mounted. Until then, we need to bail out of writing this incomplete state representation in cache.\n          */\n          var hasDynamicWidgets = false;\n          walkIndex(instantSearchInstance.mainIndex, function (indexWidget) {\n            if (!hasDynamicWidgets && indexWidget.getWidgets().some(function (_ref7) {\n              var $$type = _ref7.$$type;\n              return $$type === 'ais.dynamicWidgets';\n            })) {\n              hasDynamicWidgets = true;\n            }\n          });\n          var hasNoFacets = !((_state$disjunctiveFac = state.disjunctiveFacets) !== null && _state$disjunctiveFac !== void 0 && _state$disjunctiveFac.length) && !(state.facets || []).filter(function (f) {\n            return f !== '*';\n          }).length && !((_state$hierarchicalFa = state.hierarchicalFacets) !== null && _state$hierarchicalFa !== void 0 && _state$hierarchicalFa.length);\n          if (cachedHits[_page] === undefined && !results.__isArtificial && instantSearchInstance.status === 'idle' && !(hasDynamicWidgets && hasNoFacets)) {\n            cachedHits[_page] = transformedHits;\n            cache.write({\n              state: normalizeState(state),\n              hits: cachedHits\n            });\n          }\n          currentPageHits = transformedHits;\n          isFirstPage = getFirstReceivedPage(state, cachedHits) === 0;\n        }\n        var items = extractHitsFromCachedHits(cachedHits);\n        var isLastPage = results ? results.nbPages <= getLastReceivedPage(state, cachedHits) + 1 : true;\n        return {\n          hits: items,\n          items: items,\n          currentPageHits: currentPageHits,\n          sendEvent: sendEvent,\n          bindEvent: bindEvent,\n          banner: banner,\n          results: results || undefined,\n          showPrevious: showPrevious,\n          showMore: showMore,\n          isFirstPage: isFirstPage,\n          isLastPage: isLastPage,\n          widgetParams: widgetParams\n        };\n      },\n      dispose: function dispose(_ref8) {\n        var state = _ref8.state;\n        unmountFn();\n        var stateWithoutPage = state.setQueryParameter('page', undefined);\n        if (!escapeHTML) {\n          return stateWithoutPage;\n        }\n        return stateWithoutPage.setQueryParameters(Object.keys(TAG_PLACEHOLDER).reduce(function (acc, key) {\n          return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, undefined));\n        }, {}));\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref9) {\n        var searchParameters = _ref9.searchParameters;\n        var page = searchParameters.page || 0;\n        if (!page) {\n          // return without adding `page` to uiState\n          // because we don't want `page=1` in the URL\n          return uiState;\n        }\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          // The page in the UI state is incremented by one\n          // to expose the user value (not `0`).\n          page: page + 1\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref10) {\n        var uiState = _ref10.uiState;\n        var widgetSearchParameters = searchParameters;\n        if (escapeHTML) {\n          // @MAJOR: set this globally, not in the InfiniteHits widget to allow InfiniteHits to be conditionally used\n          widgetSearchParameters = searchParameters.setQueryParameters(TAG_PLACEHOLDER);\n        }\n\n        // The page in the search parameters is decremented by one\n        // to get to the actual parameter value from the UI state.\n        var page = uiState.page ? uiState.page - 1 : 0;\n        return widgetSearchParameters.setQueryParameter('page', page);\n      }\n    };\n  };\n});"
  },
  {
    "path": "js/instantsearch.js/es/connectors/infinite-hits/connectInfiniteHitsWithInsights.d.ts",
    "content": "import type { InfiniteHitsWidgetDescription, InfiniteHitsConnectorParams } from './connectInfiniteHits';\ndeclare const connectInfiniteHitsWithInsights: <TWidgetParams extends import(\"../../types\").UnknownWidgetParams>(renderFn: import(\"../../types\").Renderer<import(\"./connectInfiniteHits\").InfiniteHitsRenderState, TWidgetParams>, unmountFn?: import(\"../../types\").Unmounter) => <THit extends NonNullable<object> = import(\"../../types\").BaseHit>(widgetParams: TWidgetParams & InfiniteHitsConnectorParams<THit>) => {\n    $$type: \"ais.infiniteHits\";\n    init(initOptions: import(\"../../types\").InitOptions): void;\n    render(renderOptions: import(\"../../types\").RenderOptions): void;\n    getRenderState(renderState: {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../answers/connectAnswers\").AnswersRenderState, import(\"../answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../configure/connectConfigure\").ConfigureRenderState, import(\"../configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<import(\"../hits/connectHits\").HitsRenderState<import(\"../../types\").BaseHit>, import(\"../hits/connectHits\").HitsConnectorParams<import(\"../../types\").BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<import(\"./connectInfiniteHits\").InfiniteHitsRenderState<import(\"../../types\").BaseHit>, InfiniteHitsConnectorParams<import(\"../../types\").BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../menu/connectMenu\").MenuRenderState, import(\"../menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../pagination/connectPagination\").PaginationRenderState, import(\"../pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../range/connectRange\").RangeRenderState, import(\"../range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../search-box/connectSearchBox\").SearchBoxRenderState, import(\"../search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../sort-by/connectSortBy\").SortByRenderState, import(\"../sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../stats/connectStats\").StatsRenderState, import(\"../stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../../widgets/analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../../widgets/places/places\").PlacesWidgetParams> | undefined;\n    }, renderOptions: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions): import(\"../../types\").IndexRenderState & InfiniteHitsWidgetDescription[\"indexRenderState\"];\n    getWidgetRenderState({ results, helper, parent, state: existingState, instantSearchInstance, }: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions): {\n        hits: import(\"../../types\").Hit<THit>[];\n        items: import(\"../../types\").Hit<THit>[];\n        currentPageHits: import(\"../../types\").Hit<THit>[];\n        sendEvent: import(\"../../lib/utils\").SendEventForHits;\n        bindEvent: import(\"../../lib/utils\").BindEventForHits;\n        banner: import(\"algoliasearch-helper\").Banner | undefined;\n        results: import(\"algoliasearch-helper\").SearchResults<any> | undefined;\n        showPrevious: () => void;\n        showMore: () => void;\n        isFirstPage: boolean;\n        isLastPage: boolean;\n        widgetParams: TWidgetParams & InfiniteHitsConnectorParams<THit>;\n    };\n    dispose({ state }: import(\"../../types\").DisposeOptions): import(\"algoliasearch-helper\").SearchParameters;\n    getWidgetUiState(uiState: {\n        page?: number | undefined;\n        query?: string | undefined;\n        configure?: import(\"algoliasearch-helper\").PlainSearchParameters | undefined;\n        geoSearch?: {\n            boundingBox: string;\n        } | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: string[];\n        } | undefined;\n        hitsPerPage?: number | undefined;\n        menu?: {\n            [attribute: string]: string;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: string;\n        } | undefined;\n        range?: {\n            [attribute: string]: string;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: number | undefined;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: string[];\n        } | undefined;\n        relevantSort?: number | undefined;\n        sortBy?: string | undefined;\n        toggle?: {\n            [attribute: string]: boolean;\n        } | undefined;\n        places?: {\n            query: string;\n            position: string;\n        } | undefined;\n    }, { searchParameters }: {\n        searchParameters: import(\"algoliasearch-helper\").SearchParameters;\n        helper: import(\"algoliasearch-helper\").AlgoliaSearchHelper;\n    }): {\n        page?: number | undefined;\n        query?: string | undefined;\n        configure?: import(\"algoliasearch-helper\").PlainSearchParameters | undefined;\n        geoSearch?: {\n            boundingBox: string;\n        } | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: string[];\n        } | undefined;\n        hitsPerPage?: number | undefined;\n        menu?: {\n            [attribute: string]: string;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: string;\n        } | undefined;\n        range?: {\n            [attribute: string]: string;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: number | undefined;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: string[];\n        } | undefined;\n        relevantSort?: number | undefined;\n        sortBy?: string | undefined;\n        toggle?: {\n            [attribute: string]: boolean;\n        } | undefined;\n        places?: {\n            query: string;\n            position: string;\n        } | undefined;\n    };\n    getWidgetSearchParameters(searchParameters: import(\"algoliasearch-helper\").SearchParameters, { uiState }: {\n        uiState: {\n            page?: number | undefined;\n            query?: string | undefined;\n            configure?: import(\"algoliasearch-helper\").PlainSearchParameters | undefined;\n            geoSearch?: {\n                boundingBox: string;\n            } | undefined;\n            hierarchicalMenu?: {\n                [rootAttribute: string]: string[];\n            } | undefined;\n            hitsPerPage?: number | undefined;\n            menu?: {\n                [attribute: string]: string;\n            } | undefined;\n            numericMenu?: {\n                [attribute: string]: string;\n            } | undefined;\n            range?: {\n                [attribute: string]: string;\n            } | undefined;\n            ratingMenu?: {\n                [attribute: string]: number | undefined;\n            } | undefined;\n            refinementList?: {\n                [attribute: string]: string[];\n            } | undefined;\n            relevantSort?: number | undefined;\n            sortBy?: string | undefined;\n            toggle?: {\n                [attribute: string]: boolean;\n            } | undefined;\n            places?: {\n                query: string;\n                position: string;\n            } | undefined;\n        };\n    }): import(\"algoliasearch-helper\").SearchParameters;\n};\nexport default connectInfiniteHitsWithInsights;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/infinite-hits/connectInfiniteHitsWithInsights.js",
    "content": "import { withInsights } from \"../../lib/insights/index.js\";\nimport connectInfiniteHits from \"./connectInfiniteHits.js\";\n\n/**\n * Due to https://github.com/microsoft/web-build-tools/issues/1050, we need\n * Connector<...> imported in this file, even though it is only used implicitly.\n * This _uses_ Connector<...> so it is not accidentally removed by someone.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\nvar connectInfiniteHitsWithInsights = withInsights(connectInfiniteHits);\nexport default connectInfiniteHitsWithInsights;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/looking-similar/connectLookingSimilar.d.ts",
    "content": "import type { SendEventForHits } from '../../lib/utils';\nimport type { Connector, TransformItems, BaseHit, Renderer, Unmounter, UnknownWidgetParams, RecommendResponse, Hit, AlgoliaHit } from '../../types';\nimport type { PlainSearchParameters } from 'algoliasearch-helper';\nexport type LookingSimilarRenderState<THit extends NonNullable<object> = BaseHit> = {\n    /**\n     * The matched recommendations from the Algolia API.\n     */\n    items: Array<Hit<THit>>;\n    /**\n     * Sends an event to the Insights middleware.\n     */\n    sendEvent: SendEventForHits;\n};\nexport type LookingSimilarConnectorParams<THit extends NonNullable<object> = BaseHit> = {\n    /**\n     * The `objectIDs` of the items to get similar looking products from.\n     */\n    objectIDs: string[];\n    /**\n     * The number of recommendations to retrieve.\n     */\n    limit?: number;\n    /**\n     * The threshold for the recommendations confidence score (between 0 and 100).\n     */\n    threshold?: number;\n    /**\n     * List of search parameters to send.\n     */\n    fallbackParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\n    /**\n     * List of search parameters to send.\n     */\n    queryParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\n    /**\n     * Whether to escape HTML tags from items string values.\n     *\n     * @default true\n     */\n    escapeHTML?: boolean;\n    /**\n     * Function to transform the items passed to the templates.\n     */\n    transformItems?: TransformItems<Hit<THit>, {\n        results: RecommendResponse<AlgoliaHit<THit>>;\n    }>;\n};\nexport type LookingSimilarWidgetDescription<THit extends NonNullable<object> = BaseHit> = {\n    $$type: 'ais.lookingSimilar';\n    renderState: LookingSimilarRenderState<THit>;\n};\nexport type LookingSimilarConnector<THit extends NonNullable<object> = BaseHit> = Connector<LookingSimilarWidgetDescription<THit>, LookingSimilarConnectorParams<THit>>;\ndeclare const _default: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<LookingSimilarRenderState, TWidgetParams & LookingSimilarConnectorParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & LookingSimilarConnectorParams<THit>) => {\n    dependsOn: \"recommend\";\n    $$type: \"ais.lookingSimilar\";\n    init(initOptions: import(\"../../types\").InitOptions): void;\n    render(renderOptions: import(\"../../types\").RenderOptions): void;\n    getRenderState(renderState: {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../answers/connectAnswers\").AnswersRenderState, import(\"../answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../configure/connectConfigure\").ConfigureRenderState, import(\"../configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<import(\"../hits/connectHits\").HitsRenderState<BaseHit>, import(\"../hits/connectHits\").HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../menu/connectMenu\").MenuRenderState, import(\"../menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../pagination/connectPagination\").PaginationRenderState, import(\"../pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../range/connectRange\").RangeRenderState, import(\"../range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../search-box/connectSearchBox\").SearchBoxRenderState, import(\"../search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../sort-by/connectSortBy\").SortByRenderState, import(\"../sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../stats/connectStats\").StatsRenderState, import(\"../stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../../widgets/analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../../widgets/places/places\").PlacesWidgetParams> | undefined;\n    }): {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../answers/connectAnswers\").AnswersRenderState, import(\"../answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../configure/connectConfigure\").ConfigureRenderState, import(\"../configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<import(\"../hits/connectHits\").HitsRenderState<BaseHit>, import(\"../hits/connectHits\").HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../menu/connectMenu\").MenuRenderState, import(\"../menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../pagination/connectPagination\").PaginationRenderState, import(\"../pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../range/connectRange\").RangeRenderState, import(\"../range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../search-box/connectSearchBox\").SearchBoxRenderState, import(\"../search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../sort-by/connectSortBy\").SortByRenderState, import(\"../sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../stats/connectStats\").StatsRenderState, import(\"../stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../../widgets/analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../../widgets/places/places\").PlacesWidgetParams> | undefined;\n    };\n    getWidgetRenderState({ results, helper, instantSearchInstance }: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions | ({\n        instantSearchInstance: import(\"../../types\").InstantSearch;\n        parent: import(\"../../types\").IndexWidget;\n        templatesConfig: Record<string, unknown>;\n        scopedResults: import(\"../../types\").ScopedResult[];\n        state: import(\"algoliasearch-helper\").SearchParameters;\n        renderState: import(\"../../types\").IndexRenderState;\n        helper: import(\"algoliasearch-helper\").AlgoliaSearchHelper;\n        searchMetadata: {\n            isSearchStalled: boolean;\n        };\n        status: import(\"../../types\").InstantSearch[\"status\"];\n        error: import(\"../../types\").InstantSearch[\"error\"];\n        createURL: (nextState: import(\"algoliasearch-helper\").SearchParameters | ((state: import(\"../../types\").IndexUiState) => import(\"../../types\").IndexUiState)) => string;\n    } & {\n        results: RecommendResponse<any>;\n    })): {\n        items: Hit<THit>[];\n        widgetParams: TWidgetParams & LookingSimilarConnectorParams<THit>;\n        sendEvent: SendEventForHits;\n    };\n    dispose({ recommendState }: import(\"../../types\").DisposeOptions): import(\"algoliasearch-helper\").RecommendParameters;\n    getWidgetParameters(state: import(\"algoliasearch-helper\").RecommendParameters): import(\"algoliasearch-helper\").RecommendParameters;\n};\nexport default _default;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/looking-similar/connectLookingSimilar.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { createDocumentationMessageGenerator, checkRendering, noop, escapeHits, TAG_PLACEHOLDER, createSendEventForHits, addAbsolutePosition, addQueryID } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'looking-similar',\n  connector: true\n});\nexport default (function connectLookingSimilar(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      _ref$escapeHTML = _ref.escapeHTML,\n      escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,\n      objectIDs = _ref.objectIDs,\n      limit = _ref.limit,\n      threshold = _ref.threshold,\n      fallbackParameters = _ref.fallbackParameters,\n      queryParameters = _ref.queryParameters,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    if (!objectIDs || objectIDs.length === 0) {\n      throw new Error(withUsage('The `objectIDs` option is required.'));\n    }\n    var sendEvent;\n    return {\n      dependsOn: 'recommend',\n      $$type: 'ais.lookingSimilar',\n      init: function init(initOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var renderState = this.getWidgetRenderState(renderOptions);\n        renderFn(_objectSpread(_objectSpread({}, renderState), {}, {\n          instantSearchInstance: renderOptions.instantSearchInstance\n        }), false);\n      },\n      getRenderState: function getRenderState(renderState) {\n        return renderState;\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref2) {\n        var results = _ref2.results,\n          helper = _ref2.helper,\n          instantSearchInstance = _ref2.instantSearchInstance;\n        if (!sendEvent) {\n          sendEvent = createSendEventForHits({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            widgetType: this.$$type\n          });\n        }\n        if (results === null || results === undefined) {\n          return {\n            items: [],\n            widgetParams: widgetParams,\n            sendEvent: sendEvent\n          };\n        }\n        if (escapeHTML && results.hits.length > 0) {\n          results.hits = escapeHits(results.hits);\n        }\n        var itemsWithAbsolutePosition = addAbsolutePosition(results.hits, 0, 1);\n        var itemsWithAbsolutePositionAndQueryID = addQueryID(itemsWithAbsolutePosition, results.queryID);\n        var transformedItems = transformItems(itemsWithAbsolutePositionAndQueryID, {\n          results: results\n        });\n        return {\n          items: transformedItems,\n          widgetParams: widgetParams,\n          sendEvent: sendEvent\n        };\n      },\n      dispose: function dispose(_ref3) {\n        var recommendState = _ref3.recommendState;\n        unmountFn();\n        return recommendState.removeParams(this.$$id);\n      },\n      getWidgetParameters: function getWidgetParameters(state) {\n        var _this = this;\n        return objectIDs.reduce(function (acc, objectID) {\n          return acc.addLookingSimilar({\n            objectID: objectID,\n            maxRecommendations: limit,\n            threshold: threshold,\n            fallbackParameters: _objectSpread(_objectSpread({}, fallbackParameters), escapeHTML ? TAG_PLACEHOLDER : {}),\n            queryParameters: _objectSpread(_objectSpread({}, queryParameters), escapeHTML ? TAG_PLACEHOLDER : {}),\n            $$id: _this.$$id\n          });\n        }, state.removeParams(this.$$id));\n      }\n    };\n  };\n});"
  },
  {
    "path": "js/instantsearch.js/es/connectors/menu/connectMenu.d.ts",
    "content": "import type { SendEventForFacet } from '../../lib/utils';\nimport type { Connector, CreateURL, SortBy, TransformItems, WidgetRenderState } from '../../types';\nimport type { SearchResults } from 'algoliasearch-helper';\nexport type MenuItem = {\n    /**\n     * The value of the menu item.\n     */\n    value: string;\n    /**\n     * Human-readable value of the menu item.\n     */\n    label: string;\n    /**\n     * Number of results matched after refinement is applied.\n     */\n    count: number;\n    /**\n     * Indicates if the refinement is applied.\n     */\n    isRefined: boolean;\n};\nexport type MenuConnectorParams = {\n    /**\n     * Name of the attribute for faceting (eg. \"free_shipping\").\n     */\n    attribute: string;\n    /**\n     * How many facets values to retrieve.\n     */\n    limit?: number;\n    /**\n     * Whether to display a button that expands the number of items.\n     */\n    showMore?: boolean;\n    /**\n     * How many facets values to retrieve when `toggleShowMore` is called, this value is meant to be greater than `limit` option.\n     */\n    showMoreLimit?: number;\n    /**\n     * How to sort refinements. Possible values: `count|isRefined|name:asc|name:desc`.\n     *\n     * You can also use a sort function that behaves like the standard Javascript [compareFunction](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Syntax).\n     *\n     * If a facetOrdering is set in the index settings, it is used when sortBy isn't passed\n     */\n    sortBy?: SortBy<SearchResults.HierarchicalFacet>;\n    /**\n     * Function to transform the items passed to the templates.\n     */\n    transformItems?: TransformItems<MenuItem>;\n};\nexport type MenuRenderState = {\n    /**\n     * The elements that can be refined for the current search results.\n     */\n    items: MenuItem[];\n    /**\n     * Creates the URL for a single item name in the list.\n     */\n    createURL: CreateURL<string>;\n    /**\n     * Filter the search to item value.\n     */\n    refine: (value: string) => void;\n    /**\n     * True if refinement can be applied.\n     */\n    canRefine: boolean;\n    /**\n     * True if the menu is displaying all the menu items.\n     */\n    isShowingMore: boolean;\n    /**\n     * Toggles the number of values displayed between `limit` and `showMore.limit`.\n     */\n    toggleShowMore: () => void;\n    /**\n     * `true` if the toggleShowMore button can be activated (enough items to display more or\n     * already displaying more than `limit` items)\n     */\n    canToggleShowMore: boolean;\n    /**\n     * Send event to insights middleware\n     */\n    sendEvent: SendEventForFacet;\n};\nexport type MenuWidgetDescription = {\n    $$type: 'ais.menu';\n    renderState: MenuRenderState;\n    indexRenderState: {\n        menu: {\n            [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;\n        };\n    };\n    indexUiState: {\n        menu: {\n            [attribute: string]: string;\n        };\n    };\n};\nexport type MenuConnector = Connector<MenuWidgetDescription, MenuConnectorParams>;\n/**\n * **Menu** connector provides the logic to build a widget that will give the user the ability to choose a single value for a specific facet. The typical usage of menu is for navigation in categories.\n *\n * This connector provides a `toggleShowMore()` function to display more or less items and a `refine()`\n * function to select an item. While selecting a new element, the `refine` will also unselect the\n * one that is currently selected.\n *\n * **Requirement:** the attribute passed as `attribute` must be present in \"attributes for faceting\" on the Algolia dashboard or configured as attributesForFaceting via a set settings call to the Algolia API.\n */\ndeclare const connectMenu: MenuConnector;\nexport default connectMenu;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/menu/connectMenu.js",
    "content": "var _excluded = [\"name\", \"escapedValue\", \"path\"];\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { checkRendering, createDocumentationMessageGenerator, createSendEventForFacet, noop, warning } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'menu',\n  connector: true\n});\nvar DEFAULT_SORT = ['isRefined', 'name:asc'];\n/**\n * **Menu** connector provides the logic to build a widget that will give the user the ability to choose a single value for a specific facet. The typical usage of menu is for navigation in categories.\n *\n * This connector provides a `toggleShowMore()` function to display more or less items and a `refine()`\n * function to select an item. While selecting a new element, the `refine` will also unselect the\n * one that is currently selected.\n *\n * **Requirement:** the attribute passed as `attribute` must be present in \"attributes for faceting\" on the Algolia dashboard or configured as attributesForFaceting via a set settings call to the Algolia API.\n */\nvar connectMenu = function connectMenu(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      attribute = _ref.attribute,\n      _ref$limit = _ref.limit,\n      limit = _ref$limit === void 0 ? 10 : _ref$limit,\n      _ref$showMore = _ref.showMore,\n      showMore = _ref$showMore === void 0 ? false : _ref$showMore,\n      _ref$showMoreLimit = _ref.showMoreLimit,\n      showMoreLimit = _ref$showMoreLimit === void 0 ? 20 : _ref$showMoreLimit,\n      _ref$sortBy = _ref.sortBy,\n      sortBy = _ref$sortBy === void 0 ? DEFAULT_SORT : _ref$sortBy,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    if (!attribute) {\n      throw new Error(withUsage('The `attribute` option is required.'));\n    }\n    if (showMore === true && showMoreLimit <= limit) {\n      throw new Error(withUsage('The `showMoreLimit` option must be greater than `limit`.'));\n    }\n    var sendEvent;\n    var _createURL;\n    var _refine;\n\n    // Provide the same function to the `renderFn` so that way the user\n    // has to only bind it once when `isFirstRendering` for instance\n    var isShowingMore = false;\n    var toggleShowMore = function toggleShowMore() {};\n    function createToggleShowMore(renderOptions, widget) {\n      return function () {\n        isShowingMore = !isShowingMore;\n        widget.render(renderOptions);\n      };\n    }\n    function cachedToggleShowMore() {\n      toggleShowMore();\n    }\n    function getLimit() {\n      return isShowingMore ? showMoreLimit : limit;\n    }\n    return {\n      $$type: 'ais.menu',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref2) {\n        var state = _ref2.state;\n        unmountFn();\n        return state.removeHierarchicalFacet(attribute).setQueryParameter('maxValuesPerFacet', undefined);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          menu: _objectSpread(_objectSpread({}, renderState.menu), {}, _defineProperty({}, attribute, this.getWidgetRenderState(renderOptions)))\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(renderOptions) {\n        var _this = this;\n        var results = renderOptions.results,\n          createURL = renderOptions.createURL,\n          instantSearchInstance = renderOptions.instantSearchInstance,\n          helper = renderOptions.helper;\n        var items = [];\n        var canToggleShowMore = false;\n        if (!sendEvent) {\n          sendEvent = createSendEventForFacet({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            attribute: attribute,\n            widgetType: this.$$type\n          });\n        }\n        if (!_createURL) {\n          _createURL = function _createURL(facetValue) {\n            return createURL(function (uiState) {\n              return _this.getWidgetUiState(uiState, {\n                searchParameters: helper.state.resetPage().toggleFacetRefinement(attribute, facetValue),\n                helper: helper\n              });\n            });\n          };\n        }\n        if (!_refine) {\n          _refine = function _refine(facetValue) {\n            var _helper$getHierarchic = helper.getHierarchicalFacetBreadcrumb(attribute),\n              _helper$getHierarchic2 = _slicedToArray(_helper$getHierarchic, 1),\n              refinedItem = _helper$getHierarchic2[0];\n            sendEvent('click:internal', facetValue ? facetValue : refinedItem);\n            helper.toggleFacetRefinement(attribute, facetValue ? facetValue : refinedItem).search();\n          };\n        }\n        if (renderOptions.results) {\n          toggleShowMore = createToggleShowMore(renderOptions, this);\n        }\n        if (results) {\n          var facetValues = results.getFacetValues(attribute, {\n            sortBy: sortBy,\n            facetOrdering: sortBy === DEFAULT_SORT\n          });\n          var facetItems = facetValues && !Array.isArray(facetValues) && facetValues.data ? facetValues.data : [];\n          canToggleShowMore = showMore && (isShowingMore || facetItems.length > getLimit());\n          items = transformItems(facetItems.slice(0, getLimit()).map(function (_ref3) {\n            var label = _ref3.name,\n              value = _ref3.escapedValue,\n              path = _ref3.path,\n              item = _objectWithoutProperties(_ref3, _excluded);\n            return _objectSpread(_objectSpread({}, item), {}, {\n              label: label,\n              value: value\n            });\n          }), {\n            results: results\n          });\n        }\n        return {\n          items: items,\n          createURL: _createURL,\n          refine: _refine,\n          sendEvent: sendEvent,\n          canRefine: items.length > 0,\n          widgetParams: widgetParams,\n          isShowingMore: isShowingMore,\n          toggleShowMore: cachedToggleShowMore,\n          canToggleShowMore: canToggleShowMore\n        };\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref4) {\n        var searchParameters = _ref4.searchParameters;\n        var _searchParameters$get = searchParameters.getHierarchicalFacetBreadcrumb(attribute),\n          _searchParameters$get2 = _slicedToArray(_searchParameters$get, 1),\n          value = _searchParameters$get2[0];\n        return removeEmptyRefinementsFromUiState(_objectSpread(_objectSpread({}, uiState), {}, {\n          menu: _objectSpread(_objectSpread({}, uiState.menu), {}, _defineProperty({}, attribute, value))\n        }), attribute);\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref5) {\n        var uiState = _ref5.uiState;\n        var value = uiState.menu && uiState.menu[attribute];\n        if (searchParameters.isConjunctiveFacet(attribute) || searchParameters.isDisjunctiveFacet(attribute)) {\n          process.env.NODE_ENV === 'development' ? warning(false, \"Menu: Attribute \\\"\".concat(attribute, \"\\\" is already used by another widget applying conjunctive or disjunctive faceting.\\nAs this is not supported, please make sure to remove this other widget or this Menu widget will not work at all.\")) : void 0;\n          return searchParameters;\n        }\n        var withFacetConfiguration = searchParameters.removeHierarchicalFacet(attribute).addHierarchicalFacet({\n          name: attribute,\n          attributes: [attribute]\n        });\n        var currentMaxValuesPerFacet = withFacetConfiguration.maxValuesPerFacet || 0;\n        var nextMaxValuesPerFacet = Math.max(currentMaxValuesPerFacet, showMore ? showMoreLimit : limit);\n        var withMaxValuesPerFacet = withFacetConfiguration.setQueryParameter('maxValuesPerFacet', nextMaxValuesPerFacet);\n        if (!value) {\n          return withMaxValuesPerFacet.setQueryParameters({\n            hierarchicalFacetsRefinements: _objectSpread(_objectSpread({}, withMaxValuesPerFacet.hierarchicalFacetsRefinements), {}, _defineProperty({}, attribute, []))\n          });\n        }\n        return withMaxValuesPerFacet.addHierarchicalFacetRefinement(attribute, value);\n      }\n    };\n  };\n};\nfunction removeEmptyRefinementsFromUiState(indexUiState, attribute) {\n  if (!indexUiState.menu) {\n    return indexUiState;\n  }\n  if (indexUiState.menu[attribute] === undefined) {\n    delete indexUiState.menu[attribute];\n  }\n  if (Object.keys(indexUiState.menu).length === 0) {\n    delete indexUiState.menu;\n  }\n  return indexUiState;\n}\nexport default connectMenu;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/numeric-menu/connectNumericMenu.d.ts",
    "content": "import type { SendEventForFacet } from '../../lib/utils';\nimport type { Connector, CreateURL, TransformItems, WidgetRenderState } from '../../types';\nexport type NumericMenuConnectorParamsItem = {\n    /**\n     * Name of the option\n     */\n    label: string;\n    /**\n     * Higher bound of the option (<=)\n     */\n    start?: number;\n    /**\n     * Lower bound of the option (>=)\n     */\n    end?: number;\n};\nexport type NumericMenuRenderStateItem = {\n    /**\n     *  Name of the option.\n     */\n    label: string;\n    /**\n     * URL encoded of the bounds object with the form `{start, end}`.\n     * This value can be used verbatim in the webpage and can be read by `refine`\n     * directly. If you want to inspect the value, you can do:\n     * `JSON.parse(decodeURI(value))` to get the object.\n     */\n    value: string;\n    /**\n     * True if the value is selected\n     */\n    isRefined: boolean;\n};\nexport type NumericMenuConnectorParams = {\n    /**\n     * Name of the attribute for filtering\n     */\n    attribute: string;\n    /**\n     * List of all the items\n     */\n    items: NumericMenuConnectorParamsItem[];\n    /**\n     * Function to transform the items passed to the templates\n     */\n    transformItems?: TransformItems<NumericMenuRenderStateItem>;\n};\nexport type NumericMenuRenderState = {\n    /**\n     * The list of available choices\n     */\n    items: NumericMenuRenderStateItem[];\n    /**\n     * Creates URLs for the next state, the string is the name of the selected option\n     */\n    createURL: CreateURL<NumericMenuRenderStateItem['value']>;\n    /**\n     * `true` if the last search contains no result\n     * @deprecated Use `canRefine` instead.\n     */\n    hasNoResults: boolean;\n    /**\n     * Indicates if search state can be refined.\n     *\n     * This is `true` if the last search contains no result and\n     * \"All\" range is selected\n     */\n    canRefine: boolean;\n    /**\n     * Sets the selected value and trigger a new search\n     */\n    refine: (facetValue: string) => void;\n    /**\n     * Send event to insights middleware\n     */\n    sendEvent: SendEventForFacet;\n};\nexport type NumericMenuWidgetDescription = {\n    $$type: 'ais.numericMenu';\n    renderState: NumericMenuRenderState;\n    indexRenderState: {\n        numericMenu: {\n            [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;\n        };\n    };\n    indexUiState: {\n        numericMenu: {\n            [attribute: string]: string;\n        };\n    };\n};\nexport type NumericMenuConnector = Connector<NumericMenuWidgetDescription, NumericMenuConnectorParams>;\ndeclare const connectNumericMenu: NumericMenuConnector;\nexport default connectNumericMenu;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/numeric-menu/connectNumericMenu.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { checkRendering, createDocumentationMessageGenerator, isFiniteNumber, noop } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'numeric-menu',\n  connector: true\n});\nvar $$type = 'ais.numericMenu';\nvar createSendEvent = function createSendEvent(_ref) {\n  var instantSearchInstance = _ref.instantSearchInstance;\n  return function () {\n    if (arguments.length === 1) {\n      instantSearchInstance.sendEventToInsights(arguments.length <= 0 ? undefined : arguments[0]);\n      return;\n    }\n  };\n};\nvar connectNumericMenu = function connectNumericMenu(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref2 = widgetParams || {},\n      _ref2$attribute = _ref2.attribute,\n      attribute = _ref2$attribute === void 0 ? '' : _ref2$attribute,\n      _ref2$items = _ref2.items,\n      items = _ref2$items === void 0 ? [] : _ref2$items,\n      _ref2$transformItems = _ref2.transformItems,\n      transformItems = _ref2$transformItems === void 0 ? function (item) {\n        return item;\n      } : _ref2$transformItems;\n    if (attribute === '') {\n      throw new Error(withUsage('The `attribute` option is required.'));\n    }\n    if (!items || items.length === 0) {\n      throw new Error(withUsage('The `items` option expects an array of objects.'));\n    }\n    var prepareItems = function prepareItems(state) {\n      return items.map(function (_ref3) {\n        var start = _ref3.start,\n          end = _ref3.end,\n          label = _ref3.label;\n        return {\n          label: label,\n          value: encodeURI(JSON.stringify({\n            start: start,\n            end: end\n          })),\n          isRefined: isRefined(state, attribute, {\n            start: start,\n            end: end,\n            label: label\n          })\n        };\n      });\n    };\n    var connectorState = {};\n    return {\n      $$type: $$type,\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref4) {\n        var state = _ref4.state;\n        unmountFn();\n        return state.removeNumericRefinement(attribute);\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref5) {\n        var searchParameters = _ref5.searchParameters;\n        var values = searchParameters.getNumericRefinements(attribute);\n        var equal = values['='] && values['='][0];\n        if (equal || equal === 0) {\n          return _objectSpread(_objectSpread({}, uiState), {}, {\n            numericMenu: _objectSpread(_objectSpread({}, uiState.numericMenu), {}, _defineProperty({}, attribute, \"\".concat(values['='])))\n          });\n        }\n        var min = values['>='] && values['>='][0] || '';\n        var max = values['<='] && values['<='][0] || '';\n        return removeEmptyRefinementsFromUiState(_objectSpread(_objectSpread({}, uiState), {}, {\n          numericMenu: _objectSpread(_objectSpread({}, uiState.numericMenu), {}, _defineProperty({}, attribute, \"\".concat(min, \":\").concat(max)))\n        }), attribute);\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref6) {\n        var uiState = _ref6.uiState;\n        var value = uiState.numericMenu && uiState.numericMenu[attribute];\n        var withoutRefinements = searchParameters.setQueryParameters({\n          numericRefinements: _objectSpread(_objectSpread({}, searchParameters.numericRefinements), {}, _defineProperty({}, attribute, {}))\n        });\n        if (!value) {\n          return withoutRefinements;\n        }\n        var isExact = value.indexOf(':') === -1;\n        if (isExact) {\n          return withoutRefinements.addNumericRefinement(attribute, '=', Number(value));\n        }\n        var _value$split$map = value.split(':').map(parseFloat),\n          _value$split$map2 = _slicedToArray(_value$split$map, 2),\n          min = _value$split$map2[0],\n          max = _value$split$map2[1];\n        var withMinRefinement = isFiniteNumber(min) ? withoutRefinements.addNumericRefinement(attribute, '>=', min) : withoutRefinements;\n        var withMaxRefinement = isFiniteNumber(max) ? withMinRefinement.addNumericRefinement(attribute, '<=', max) : withMinRefinement;\n        return withMaxRefinement;\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          numericMenu: _objectSpread(_objectSpread({}, renderState.numericMenu), {}, _defineProperty({}, attribute, this.getWidgetRenderState(renderOptions)))\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref7) {\n        var _this = this;\n        var results = _ref7.results,\n          state = _ref7.state,\n          instantSearchInstance = _ref7.instantSearchInstance,\n          helper = _ref7.helper,\n          createURL = _ref7.createURL;\n        if (!connectorState.refine) {\n          connectorState.refine = function (facetValue) {\n            var refinedState = getRefinedState(helper.state, attribute, facetValue);\n            connectorState.sendEvent('click:internal', facetValue);\n            helper.setState(refinedState).search();\n          };\n        }\n        if (!connectorState.createURL) {\n          connectorState.createURL = function (newState) {\n            return function (facetValue) {\n              return createURL(function (uiState) {\n                return _this.getWidgetUiState(uiState, {\n                  searchParameters: getRefinedState(newState, attribute, facetValue),\n                  helper: helper\n                });\n              });\n            };\n          };\n        }\n        if (!connectorState.sendEvent) {\n          connectorState.sendEvent = createSendEvent({\n            instantSearchInstance: instantSearchInstance\n          });\n        }\n        var hasNoResults = results ? results.nbHits === 0 : true;\n        var preparedItems = prepareItems(state);\n        var allIsSelected = true;\n        // @TODO avoid for..of for polyfill reasons\n        // eslint-disable-next-line no-restricted-syntax\n        var _iterator = _createForOfIteratorHelper(preparedItems),\n          _step;\n        try {\n          for (_iterator.s(); !(_step = _iterator.n()).done;) {\n            var item = _step.value;\n            if (item.isRefined && decodeURI(item.value) !== '{}') {\n              allIsSelected = false;\n              break;\n            }\n          }\n        } catch (err) {\n          _iterator.e(err);\n        } finally {\n          _iterator.f();\n        }\n        return {\n          createURL: connectorState.createURL(state),\n          items: transformItems(preparedItems, {\n            results: results\n          }),\n          hasNoResults: hasNoResults,\n          canRefine: !(hasNoResults && allIsSelected),\n          refine: connectorState.refine,\n          sendEvent: connectorState.sendEvent,\n          widgetParams: widgetParams\n        };\n      }\n    };\n  };\n};\nfunction isRefined(state, attribute, option) {\n  // @TODO: same as another spot, why is this mixing arrays & elements?\n  var currentRefinements = state.getNumericRefinements(attribute);\n  if (option.start !== undefined && option.end !== undefined) {\n    if (option.start === option.end) {\n      return hasNumericRefinement(currentRefinements, '=', option.start);\n    } else {\n      return hasNumericRefinement(currentRefinements, '>=', option.start) && hasNumericRefinement(currentRefinements, '<=', option.end);\n    }\n  }\n  if (option.start !== undefined) {\n    return hasNumericRefinement(currentRefinements, '>=', option.start);\n  }\n  if (option.end !== undefined) {\n    return hasNumericRefinement(currentRefinements, '<=', option.end);\n  }\n  if (option.start === undefined && option.end === undefined) {\n    return Object.keys(currentRefinements).every(function (operator) {\n      return (currentRefinements[operator] || []).length === 0;\n    });\n  }\n  return false;\n}\nfunction getRefinedState(state, attribute, facetValue) {\n  var resolvedState = state;\n  var refinedOption = JSON.parse(decodeURI(facetValue));\n\n  // @TODO: why is array / element mixed here & hasRefinements; seems wrong?\n  var currentRefinements = resolvedState.getNumericRefinements(attribute);\n  if (refinedOption.start === undefined && refinedOption.end === undefined) {\n    return resolvedState.removeNumericRefinement(attribute);\n  }\n  if (!isRefined(resolvedState, attribute, refinedOption)) {\n    resolvedState = resolvedState.removeNumericRefinement(attribute);\n  }\n  if (refinedOption.start !== undefined && refinedOption.end !== undefined) {\n    if (refinedOption.start > refinedOption.end) {\n      throw new Error('option.start should be > to option.end');\n    }\n    if (refinedOption.start === refinedOption.end) {\n      if (hasNumericRefinement(currentRefinements, '=', refinedOption.start)) {\n        resolvedState = resolvedState.removeNumericRefinement(attribute, '=', refinedOption.start);\n      } else {\n        resolvedState = resolvedState.addNumericRefinement(attribute, '=', refinedOption.start);\n      }\n      return resolvedState;\n    }\n  }\n  if (refinedOption.start !== undefined) {\n    if (hasNumericRefinement(currentRefinements, '>=', refinedOption.start)) {\n      resolvedState = resolvedState.removeNumericRefinement(attribute, '>=', refinedOption.start);\n    }\n    resolvedState = resolvedState.addNumericRefinement(attribute, '>=', refinedOption.start);\n  }\n  if (refinedOption.end !== undefined) {\n    if (hasNumericRefinement(currentRefinements, '<=', refinedOption.end)) {\n      resolvedState = resolvedState.removeNumericRefinement(attribute, '<=', refinedOption.end);\n    }\n    resolvedState = resolvedState.addNumericRefinement(attribute, '<=', refinedOption.end);\n  }\n  if (typeof resolvedState.page === 'number') {\n    resolvedState.page = 0;\n  }\n  return resolvedState;\n}\nfunction hasNumericRefinement(currentRefinements, operator, value) {\n  return currentRefinements[operator] !== undefined && currentRefinements[operator].includes(value);\n}\nfunction removeEmptyRefinementsFromUiState(indexUiState, attribute) {\n  if (!indexUiState.numericMenu) {\n    return indexUiState;\n  }\n  if (indexUiState.numericMenu[attribute] === ':') {\n    delete indexUiState.numericMenu[attribute];\n  }\n  if (Object.keys(indexUiState.numericMenu).length === 0) {\n    delete indexUiState.numericMenu;\n  }\n  return indexUiState;\n}\nexport default connectNumericMenu;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/pagination/Paginator.d.ts",
    "content": "declare class Paginator {\n    currentPage: number;\n    total: number;\n    padding: number;\n    constructor(params: {\n        currentPage: number;\n        total: number;\n        padding: number;\n    });\n    pages(): number[];\n    nbPagesDisplayed(padding: number, total: number): number;\n    calculatePaddingLeft(current: number, padding: number, total: number, totalDisplayedPages: number): number;\n    isLastPage(): boolean;\n    isFirstPage(): boolean;\n}\nexport default Paginator;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/pagination/Paginator.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { range } from \"../../lib/utils/index.js\";\nvar Paginator = /*#__PURE__*/function () {\n  function Paginator(params) {\n    _classCallCheck(this, Paginator);\n    _defineProperty(this, \"currentPage\", void 0);\n    _defineProperty(this, \"total\", void 0);\n    _defineProperty(this, \"padding\", void 0);\n    this.currentPage = params.currentPage;\n    this.total = params.total;\n    this.padding = params.padding;\n  }\n  _createClass(Paginator, [{\n    key: \"pages\",\n    value: function pages() {\n      var total = this.total,\n        currentPage = this.currentPage,\n        padding = this.padding;\n      if (total === 0) return [0];\n      var totalDisplayedPages = this.nbPagesDisplayed(padding, total);\n      if (totalDisplayedPages === total) {\n        return range({\n          end: total\n        });\n      }\n      var paddingLeft = this.calculatePaddingLeft(currentPage, padding, total, totalDisplayedPages);\n      var paddingRight = totalDisplayedPages - paddingLeft;\n      var first = currentPage - paddingLeft;\n      var last = currentPage + paddingRight;\n      return range({\n        start: first,\n        end: last\n      });\n    }\n  }, {\n    key: \"nbPagesDisplayed\",\n    value: function nbPagesDisplayed(padding, total) {\n      return Math.min(2 * padding + 1, total);\n    }\n  }, {\n    key: \"calculatePaddingLeft\",\n    value: function calculatePaddingLeft(current, padding, total, totalDisplayedPages) {\n      if (current <= padding) {\n        return current;\n      }\n      if (current >= total - padding) {\n        return totalDisplayedPages - (total - current);\n      }\n      return padding;\n    }\n  }, {\n    key: \"isLastPage\",\n    value: function isLastPage() {\n      return this.currentPage >= this.total - 1;\n    }\n  }, {\n    key: \"isFirstPage\",\n    value: function isFirstPage() {\n      return this.currentPage <= 0;\n    }\n  }]);\n  return Paginator;\n}();\nexport default Paginator;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/pagination/connectPagination.d.ts",
    "content": "import type { Connector, CreateURL, WidgetRenderState } from '../../types';\nexport type PaginationConnectorParams = {\n    /**\n     * The total number of pages to browse.\n     */\n    totalPages?: number;\n    /**\n     * The padding of pages to show around the current page\n     * @default 3\n     */\n    padding?: number;\n};\nexport type PaginationRenderState = {\n    /** Creates URLs for the next state, the number is the page to generate the URL for. */\n    createURL: CreateURL<number>;\n    /** Sets the current page and triggers a search. */\n    refine: (page: number) => void;\n    /** true if this search returned more than one page */\n    canRefine: boolean;\n    /** The number of the page currently displayed. */\n    currentRefinement: number;\n    /** The number of hits computed for the last query (can be approximated). */\n    nbHits: number;\n    /** The number of pages for the result set. */\n    nbPages: number;\n    /** The actual pages relevant to the current situation and padding. */\n    pages: number[];\n    /** true if the current page is also the first page. */\n    isFirstPage: boolean;\n    /** true if the current page is also the last page. */\n    isLastPage: boolean;\n};\nexport type PaginationWidgetDescription = {\n    $$type: 'ais.pagination';\n    renderState: PaginationRenderState;\n    indexRenderState: {\n        pagination: WidgetRenderState<PaginationRenderState, PaginationConnectorParams>;\n    };\n    indexUiState: {\n        page: number;\n    };\n};\nexport type PaginationConnector = Connector<PaginationWidgetDescription, PaginationConnectorParams>;\n/**\n * **Pagination** connector provides the logic to build a widget that will let the user\n * choose the current page of the results.\n *\n * When using the pagination with Algolia, you should be aware that the engine won't provide you pages\n * beyond the 1000th hits by default. You can find more information on the [Algolia documentation](https://www.algolia.com/doc/guides/searching/pagination/#pagination-limitations).\n */\ndeclare const connectPagination: PaginationConnector;\nexport default connectPagination;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/pagination/connectPagination.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { checkRendering, createDocumentationMessageGenerator, noop } from \"../../lib/utils/index.js\";\nimport Paginator from \"./Paginator.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'pagination',\n  connector: true\n});\n/**\n * **Pagination** connector provides the logic to build a widget that will let the user\n * choose the current page of the results.\n *\n * When using the pagination with Algolia, you should be aware that the engine won't provide you pages\n * beyond the 1000th hits by default. You can find more information on the [Algolia documentation](https://www.algolia.com/doc/guides/searching/pagination/#pagination-limitations).\n */\nvar connectPagination = function connectPagination(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      totalPages = _ref.totalPages,\n      _ref$padding = _ref.padding,\n      padding = _ref$padding === void 0 ? 3 : _ref$padding;\n    var pager = new Paginator({\n      currentPage: 0,\n      total: 0,\n      padding: padding\n    });\n    var connectorState = {};\n    function getMaxPage(_ref2) {\n      var nbPages = _ref2.nbPages;\n      return totalPages !== undefined ? Math.min(totalPages, nbPages) : nbPages;\n    }\n    return {\n      $$type: 'ais.pagination',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref3) {\n        var state = _ref3.state;\n        unmountFn();\n        return state.setQueryParameter('page', undefined);\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref4) {\n        var searchParameters = _ref4.searchParameters;\n        var page = searchParameters.page || 0;\n        if (!page) {\n          return uiState;\n        }\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          page: page + 1\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref5) {\n        var uiState = _ref5.uiState;\n        var page = uiState.page ? uiState.page - 1 : 0;\n        return searchParameters.setQueryParameter('page', page);\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref6) {\n        var results = _ref6.results,\n          helper = _ref6.helper,\n          state = _ref6.state,\n          createURL = _ref6.createURL;\n        if (!connectorState.refine) {\n          connectorState.refine = function (page) {\n            helper.setPage(page);\n            helper.search();\n          };\n        }\n        if (!connectorState.createURL) {\n          connectorState.createURL = function (page) {\n            return createURL(function (uiState) {\n              return _objectSpread(_objectSpread({}, uiState), {}, {\n                page: page + 1\n              });\n            });\n          };\n        }\n        var page = state.page || 0;\n        var nbPages = getMaxPage(results || {\n          nbPages: 0\n        });\n        pager.currentPage = page;\n        pager.total = nbPages;\n        return {\n          createURL: connectorState.createURL,\n          refine: connectorState.refine,\n          canRefine: nbPages > 1,\n          currentRefinement: page,\n          nbHits: (results === null || results === void 0 ? void 0 : results.nbHits) || 0,\n          nbPages: nbPages,\n          pages: results ? pager.pages() : [],\n          isFirstPage: pager.isFirstPage(),\n          isLastPage: pager.isLastPage(),\n          widgetParams: widgetParams\n        };\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          pagination: this.getWidgetRenderState(renderOptions)\n        });\n      }\n    };\n  };\n};\nexport default connectPagination;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/powered-by/connectPoweredBy.d.ts",
    "content": "import type { Connector, WidgetRenderState } from '../../types';\nexport type PoweredByRenderState = {\n    /** the url to redirect to on click */\n    url: string;\n};\nexport type PoweredByConnectorParams = {\n    /** the url to redirect to on click */\n    url?: string;\n};\nexport type PoweredByWidgetDescription = {\n    $$type: 'ais.poweredBy';\n    renderState: PoweredByRenderState;\n    indexRenderState: {\n        poweredBy: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams>;\n    };\n};\nexport type PoweredByConnector = Connector<PoweredByWidgetDescription, PoweredByConnectorParams>;\n/**\n * **PoweredBy** connector provides the logic to build a custom widget that will displays\n * the logo to redirect to Algolia.\n */\ndeclare const connectPoweredBy: PoweredByConnector;\nexport default connectPoweredBy;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/powered-by/connectPoweredBy.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { safelyRunOnBrowser, checkRendering, createDocumentationMessageGenerator, noop } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'powered-by',\n  connector: true\n});\n/**\n * **PoweredBy** connector provides the logic to build a custom widget that will displays\n * the logo to redirect to Algolia.\n */\nvar connectPoweredBy = function connectPoweredBy(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  var defaultUrl = 'https://www.algolia.com/?' + 'utm_source=instantsearch.js&' + 'utm_medium=website&' + \"utm_content=\".concat(safelyRunOnBrowser(function (_ref) {\n    var _window$location;\n    var window = _ref.window;\n    return ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location.hostname) || '';\n  }, {\n    fallback: function fallback() {\n      return '';\n    }\n  }), \"&\") + 'utm_campaign=poweredby';\n  return function (widgetParams) {\n    var _ref2 = widgetParams || {},\n      _ref2$url = _ref2.url,\n      url = _ref2$url === void 0 ? defaultUrl : _ref2$url;\n    return {\n      $$type: 'ais.poweredBy',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          poweredBy: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState() {\n        return {\n          url: url,\n          widgetParams: widgetParams\n        };\n      },\n      dispose: function dispose() {\n        unmountFn();\n      }\n    };\n  };\n};\nexport default connectPoweredBy;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/query-rules/connectQueryRules.d.ts",
    "content": "import type { Connector, TransformItems, WidgetRenderState } from '../../types';\ntype TrackedFilterRefinement = string | number | boolean;\nexport type ParamTrackedFilters = {\n    [facetName: string]: (facetValues: TrackedFilterRefinement[]) => TrackedFilterRefinement[];\n};\nexport type ParamTransformRuleContexts = (ruleContexts: string[]) => string[];\nexport type QueryRulesConnectorParams = {\n    trackedFilters?: ParamTrackedFilters;\n    transformRuleContexts?: ParamTransformRuleContexts;\n    transformItems?: TransformItems<any>;\n};\nexport type QueryRulesRenderState = {\n    items: any[];\n};\nexport type QueryRulesWidgetDescription = {\n    $$type: 'ais.queryRules';\n    renderState: QueryRulesRenderState;\n    indexRenderState: {\n        queryRules: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams>;\n    };\n};\nexport type QueryRulesConnector = Connector<QueryRulesWidgetDescription, QueryRulesConnectorParams>;\ndeclare const connectQueryRules: QueryRulesConnector;\nexport default connectQueryRules;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/query-rules/connectQueryRules.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nimport { checkRendering, createDocumentationMessageGenerator, warning, getRefinements, isEqual, noop } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'query-rules',\n  connector: true\n});\nfunction hasStateRefinements(state) {\n  return [state.disjunctiveFacetsRefinements, state.facetsRefinements, state.hierarchicalFacetsRefinements, state.numericRefinements].some(function (refinement) {\n    return Boolean(refinement && Object.keys(refinement).length > 0);\n  });\n}\n\n// A context rule must consist only of alphanumeric characters, hyphens, and underscores.\n// See https://www.algolia.com/doc/guides/managing-results/refine-results/merchandising-and-promoting/in-depth/implementing-query-rules/#context\nfunction escapeRuleContext(ruleName) {\n  return ruleName.replace(/[^a-z0-9-_]+/gi, '_');\n}\nfunction getRuleContextsFromTrackedFilters(_ref) {\n  var helper = _ref.helper,\n    sharedHelperState = _ref.sharedHelperState,\n    trackedFilters = _ref.trackedFilters;\n  var ruleContexts = Object.keys(trackedFilters).reduce(function (facets, facetName) {\n    var facetRefinements = getRefinements(helper.lastResults || {}, sharedHelperState, true).filter(function (refinement) {\n      return refinement.attribute === facetName;\n    }).map(function (refinement) {\n      return refinement.numericValue || refinement.name;\n    });\n    var getTrackedFacetValues = trackedFilters[facetName];\n    var trackedFacetValues = getTrackedFacetValues(facetRefinements);\n    return [].concat(_toConsumableArray(facets), _toConsumableArray(facetRefinements.filter(function (facetRefinement) {\n      return trackedFacetValues.includes(facetRefinement);\n    }).map(function (facetValue) {\n      return escapeRuleContext(\"ais-\".concat(facetName, \"-\").concat(facetValue));\n    })));\n  }, []);\n  return ruleContexts;\n}\nfunction applyRuleContexts(event) {\n  var helper = this.helper,\n    initialRuleContexts = this.initialRuleContexts,\n    trackedFilters = this.trackedFilters,\n    transformRuleContexts = this.transformRuleContexts;\n  var sharedHelperState = event.state;\n  var previousRuleContexts = sharedHelperState.ruleContexts || [];\n  var newRuleContexts = getRuleContextsFromTrackedFilters({\n    helper: helper,\n    sharedHelperState: sharedHelperState,\n    trackedFilters: trackedFilters\n  });\n  var nextRuleContexts = [].concat(_toConsumableArray(initialRuleContexts), _toConsumableArray(newRuleContexts));\n  process.env.NODE_ENV === 'development' ? warning(nextRuleContexts.length <= 10, \"\\nThe maximum number of `ruleContexts` is 10. They have been sliced to that limit.\\nConsider using `transformRuleContexts` to minimize the number of rules sent to Algolia.\\n\") : void 0;\n  var ruleContexts = transformRuleContexts(nextRuleContexts).slice(0, 10);\n  if (!isEqual(previousRuleContexts, ruleContexts)) {\n    helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread(_objectSpread({}, sharedHelperState), {}, {\n      ruleContexts: ruleContexts\n    }));\n  }\n}\nvar connectQueryRules = function connectQueryRules(_render) {\n  var unmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(_render, withUsage());\n  return function (widgetParams) {\n    var _ref2 = widgetParams || {},\n      _ref2$trackedFilters = _ref2.trackedFilters,\n      trackedFilters = _ref2$trackedFilters === void 0 ? {} : _ref2$trackedFilters,\n      _ref2$transformRuleCo = _ref2.transformRuleContexts,\n      transformRuleContexts = _ref2$transformRuleCo === void 0 ? function (rules) {\n        return rules;\n      } : _ref2$transformRuleCo,\n      _ref2$transformItems = _ref2.transformItems,\n      transformItems = _ref2$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref2$transformItems;\n    Object.keys(trackedFilters).forEach(function (facetName) {\n      if (typeof trackedFilters[facetName] !== 'function') {\n        throw new Error(withUsage(\"'The \\\"\".concat(facetName, \"\\\" filter value in the `trackedFilters` option expects a function.\")));\n      }\n    });\n    var hasTrackedFilters = Object.keys(trackedFilters).length > 0;\n\n    // We store the initial rule contexts applied before creating the widget\n    // so that we do not override them with the rules created from `trackedFilters`.\n    var initialRuleContexts = [];\n    var onHelperChange;\n    return {\n      $$type: 'ais.queryRules',\n      init: function init(initOptions) {\n        var helper = initOptions.helper,\n          state = initOptions.state,\n          instantSearchInstance = initOptions.instantSearchInstance;\n        initialRuleContexts = state.ruleContexts || [];\n        onHelperChange = applyRuleContexts.bind({\n          helper: helper,\n          initialRuleContexts: initialRuleContexts,\n          trackedFilters: trackedFilters,\n          transformRuleContexts: transformRuleContexts\n        });\n        if (hasTrackedFilters) {\n          // We need to apply the `ruleContexts` based on the `trackedFilters`\n          // before the helper changes state in some cases:\n          //   - Some filters are applied on the first load (e.g. using `configure`)\n          //   - The `transformRuleContexts` option sets initial `ruleContexts`.\n          if (hasStateRefinements(state) || Boolean(widgetParams.transformRuleContexts)) {\n            onHelperChange({\n              state: state\n            });\n          }\n\n          // We track every change in the helper to override its state and add\n          // any `ruleContexts` needed based on the `trackedFilters`.\n          helper.on('change', onHelperChange);\n        }\n        _render(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        _render(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref3) {\n        var results = _ref3.results;\n        var _ref4 = results || {},\n          _ref4$userData = _ref4.userData,\n          userData = _ref4$userData === void 0 ? [] : _ref4$userData;\n        var items = transformItems(userData, {\n          results: results\n        });\n        return {\n          items: items,\n          widgetParams: widgetParams\n        };\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          queryRules: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      dispose: function dispose(_ref5) {\n        var helper = _ref5.helper,\n          state = _ref5.state;\n        unmount();\n        if (hasTrackedFilters) {\n          helper.removeListener('change', onHelperChange);\n          return state.setQueryParameter('ruleContexts', initialRuleContexts);\n        }\n        return state;\n      }\n    };\n  };\n};\nexport default connectQueryRules;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/range/connectRange.d.ts",
    "content": "import type { SendEventForFacet } from '../../lib/utils';\nimport type { Connector, WidgetRenderState } from '../../types';\nexport type RangeMin = number | undefined;\nexport type RangeMax = number | undefined;\nexport type RangeBoundaries = [RangeMin, RangeMax];\nexport type Range = {\n    min: RangeMin;\n    max: RangeMax;\n};\nexport type RangeRenderState = {\n    /**\n     * Sets a range to filter the results on. Both values\n     * are optional, and will default to the higher and lower bounds. You can use `undefined` to remove a\n     * previously set bound or to set an infinite bound.\n     * @param rangeValue tuple of [min, max] bounds\n     */\n    refine: (rangeValue: RangeBoundaries) => void;\n    /**\n     * Indicates whether this widget can be refined\n     */\n    canRefine: boolean;\n    /**\n     * Send an event to the insights middleware\n     */\n    sendEvent: SendEventForFacet;\n    /**\n     * Maximum range possible for this search\n     */\n    range: Range;\n    /**\n     * Current refinement of the search\n     */\n    start: RangeBoundaries;\n    /**\n     * Transform for the rendering `from` and/or `to` values.\n     * Both functions take a `number` as input and should output a `string`.\n     */\n    format: {\n        from: (fromValue: number) => string;\n        to: (toValue: number) => string;\n    };\n};\nexport type RangeConnectorParams = {\n    /**\n     * Name of the attribute for faceting.\n     */\n    attribute: string;\n    /**\n     * Minimal range value, default to automatically computed from the result set.\n     */\n    min?: number;\n    /**\n     * Maximal range value, default to automatically computed from the result set.\n     */\n    max?: number;\n    /**\n     * Number of digits after decimal point to use.\n     */\n    precision?: number;\n};\nexport type RangeWidgetDescription = {\n    $$type: 'ais.range';\n    renderState: RangeRenderState;\n    indexRenderState: {\n        range: {\n            [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;\n        };\n    };\n    indexUiState: {\n        range: {\n            [attribute: string]: string;\n        };\n    };\n};\nexport type RangeConnector = Connector<RangeWidgetDescription, RangeConnectorParams>;\n/**\n * **Range** connector provides the logic to create custom widget that will let\n * the user refine results using a numeric range.\n *\n * This connectors provides a `refine()` function that accepts bounds. It will also provide\n * information about the min and max bounds for the current result set.\n */\ndeclare const connectRange: RangeConnector;\nexport default connectRange;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/range/connectRange.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nimport { checkRendering, createDocumentationMessageGenerator, isFiniteNumber, find, noop } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'range-input',\n  connector: true\n}, {\n  name: 'range-slider',\n  connector: true\n});\nvar $$type = 'ais.range';\n\n// @MAJOR: potentially we should consolidate these types\n\nfunction toPrecision(_ref) {\n  var min = _ref.min,\n    max = _ref.max,\n    precision = _ref.precision;\n  var pow = Math.pow(10, precision);\n  return {\n    min: min ? Math.floor(min * pow) / pow : min,\n    max: max ? Math.ceil(max * pow) / pow : max\n  };\n}\n\n/**\n * **Range** connector provides the logic to create custom widget that will let\n * the user refine results using a numeric range.\n *\n * This connectors provides a `refine()` function that accepts bounds. It will also provide\n * information about the min and max bounds for the current result set.\n */\nvar connectRange = function connectRange(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref2 = widgetParams || {},\n      _ref2$attribute = _ref2.attribute,\n      attribute = _ref2$attribute === void 0 ? '' : _ref2$attribute,\n      minBound = _ref2.min,\n      maxBound = _ref2.max,\n      _ref2$precision = _ref2.precision,\n      precision = _ref2$precision === void 0 ? 0 : _ref2$precision;\n    if (!attribute) {\n      throw new Error(withUsage('The `attribute` option is required.'));\n    }\n    if (isFiniteNumber(minBound) && isFiniteNumber(maxBound) && minBound > maxBound) {\n      throw new Error(withUsage(\"The `max` option can't be lower than `min`.\"));\n    }\n    var formatToNumber = function formatToNumber(v) {\n      return Number(Number(v).toFixed(precision));\n    };\n    var rangeFormatter = {\n      from: function from(v) {\n        return v.toLocaleString();\n      },\n      to: function to(v) {\n        return formatToNumber(v).toLocaleString();\n      }\n    };\n\n    // eslint-disable-next-line complexity\n    var getRefinedState = function getRefinedState(helper, currentRange, nextMin, nextMax) {\n      var resolvedState = helper.state;\n      var currentRangeMin = currentRange.min,\n        currentRangeMax = currentRange.max;\n      var _ref3 = resolvedState.getNumericRefinement(attribute, '>=') || [],\n        _ref4 = _slicedToArray(_ref3, 1),\n        min = _ref4[0];\n      var _ref5 = resolvedState.getNumericRefinement(attribute, '<=') || [],\n        _ref6 = _slicedToArray(_ref5, 1),\n        max = _ref6[0];\n      var isResetMin = nextMin === undefined || nextMin === '';\n      var isResetMax = nextMax === undefined || nextMax === '';\n      var _toPrecision = toPrecision({\n          min: !isResetMin ? parseFloat(nextMin) : undefined,\n          max: !isResetMax ? parseFloat(nextMax) : undefined,\n          precision: precision\n        }),\n        nextMinAsNumber = _toPrecision.min,\n        nextMaxAsNumber = _toPrecision.max;\n      var newNextMin;\n      if (!isFiniteNumber(minBound) && currentRangeMin === nextMinAsNumber) {\n        newNextMin = undefined;\n      } else if (isFiniteNumber(minBound) && isResetMin) {\n        newNextMin = minBound;\n      } else {\n        newNextMin = nextMinAsNumber;\n      }\n      var newNextMax;\n      if (!isFiniteNumber(maxBound) && currentRangeMax === nextMaxAsNumber) {\n        newNextMax = undefined;\n      } else if (isFiniteNumber(maxBound) && isResetMax) {\n        newNextMax = maxBound;\n      } else {\n        newNextMax = nextMaxAsNumber;\n      }\n      var isResetNewNextMin = newNextMin === undefined;\n      var isGreaterThanCurrentRange = isFiniteNumber(currentRangeMin) && currentRangeMin <= newNextMin;\n      var isMinValid = isResetNewNextMin || isFiniteNumber(newNextMin) && (!isFiniteNumber(currentRangeMin) || isGreaterThanCurrentRange);\n      var isResetNewNextMax = newNextMax === undefined;\n      var isLowerThanRange = isFiniteNumber(newNextMax) && currentRangeMax >= newNextMax;\n      var isMaxValid = isResetNewNextMax || isFiniteNumber(newNextMax) && (!isFiniteNumber(currentRangeMax) || isLowerThanRange);\n      var hasMinChange = min !== newNextMin;\n      var hasMaxChange = max !== newNextMax;\n      if ((hasMinChange || hasMaxChange) && isMinValid && isMaxValid) {\n        resolvedState = resolvedState.removeNumericRefinement(attribute);\n        if (isFiniteNumber(newNextMin)) {\n          resolvedState = resolvedState.addNumericRefinement(attribute, '>=', newNextMin);\n        }\n        if (isFiniteNumber(newNextMax)) {\n          resolvedState = resolvedState.addNumericRefinement(attribute, '<=', newNextMax);\n        }\n        return resolvedState.resetPage();\n      }\n      return null;\n    };\n    var createSendEvent = function createSendEvent(instantSearchInstance) {\n      return function () {\n        if (arguments.length === 1) {\n          instantSearchInstance.sendEventToInsights(arguments.length <= 0 ? undefined : arguments[0]);\n          return;\n        }\n      };\n    };\n    function _getCurrentRange(stats) {\n      var min;\n      if (isFiniteNumber(minBound)) {\n        min = minBound;\n      } else if (isFiniteNumber(stats.min)) {\n        min = stats.min;\n      } else {\n        min = 0;\n      }\n      var max;\n      if (isFiniteNumber(maxBound)) {\n        max = maxBound;\n      } else if (isFiniteNumber(stats.max)) {\n        max = stats.max;\n      } else {\n        max = 0;\n      }\n      return toPrecision({\n        min: min,\n        max: max,\n        precision: precision\n      });\n    }\n    function _getCurrentRefinement(helper) {\n      var _ref7 = helper.getNumericRefinement(attribute, '>=') || [],\n        _ref8 = _slicedToArray(_ref7, 1),\n        minValue = _ref8[0];\n      var _ref9 = helper.getNumericRefinement(attribute, '<=') || [],\n        _ref10 = _slicedToArray(_ref9, 1),\n        maxValue = _ref10[0];\n      var min = isFiniteNumber(minValue) ? minValue : -Infinity;\n      var max = isFiniteNumber(maxValue) ? maxValue : Infinity;\n      return [min, max];\n    }\n    function _refine(helper, currentRange) {\n      return function () {\n        var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [undefined, undefined],\n          _ref12 = _slicedToArray(_ref11, 2),\n          nextMin = _ref12[0],\n          nextMax = _ref12[1];\n        var refinedState = getRefinedState(helper, currentRange, nextMin, nextMax);\n        if (refinedState) {\n          helper.setState(refinedState).search();\n        }\n      };\n    }\n    return {\n      $$type: $$type,\n      init: function init(initOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: renderOptions.instantSearchInstance\n        }), false);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          range: _objectSpread(_objectSpread({}, renderState.range), {}, _defineProperty({}, attribute, this.getWidgetRenderState(renderOptions)))\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref13) {\n        var results = _ref13.results,\n          helper = _ref13.helper,\n          instantSearchInstance = _ref13.instantSearchInstance;\n        var facetsFromResults = results && results.disjunctiveFacets || [];\n        var facet = find(facetsFromResults, function (facetResult) {\n          return facetResult.name === attribute;\n        });\n        var stats = facet && facet.stats || {\n          min: undefined,\n          max: undefined\n        };\n        var currentRange = _getCurrentRange(stats);\n        var start = _getCurrentRefinement(helper);\n        var refine;\n        if (!results) {\n          // On first render pass an empty range\n          // to be able to bypass the validation\n          // related to it\n          refine = _refine(helper, {\n            min: undefined,\n            max: undefined\n          });\n        } else {\n          refine = _refine(helper, currentRange);\n        }\n        return {\n          refine: refine,\n          canRefine: currentRange.min !== currentRange.max,\n          format: rangeFormatter,\n          range: currentRange,\n          sendEvent: createSendEvent(instantSearchInstance),\n          widgetParams: _objectSpread(_objectSpread({}, widgetParams), {}, {\n            precision: precision\n          }),\n          start: start\n        };\n      },\n      dispose: function dispose(_ref14) {\n        var state = _ref14.state;\n        unmountFn();\n        return state.removeDisjunctiveFacet(attribute).removeNumericRefinement(attribute);\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref15) {\n        var searchParameters = _ref15.searchParameters;\n        var _searchParameters$get = searchParameters.getNumericRefinements(attribute),\n          _searchParameters$get2 = _searchParameters$get['>='],\n          min = _searchParameters$get2 === void 0 ? [] : _searchParameters$get2,\n          _searchParameters$get3 = _searchParameters$get['<='],\n          max = _searchParameters$get3 === void 0 ? [] : _searchParameters$get3;\n        if (min.length === 0 && max.length === 0) {\n          return uiState;\n        }\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          range: _objectSpread(_objectSpread({}, uiState.range), {}, _defineProperty({}, attribute, \"\".concat(min, \":\").concat(max)))\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref16) {\n        var uiState = _ref16.uiState;\n        var widgetSearchParameters = searchParameters.addDisjunctiveFacet(attribute).setQueryParameters({\n          numericRefinements: _objectSpread(_objectSpread({}, searchParameters.numericRefinements), {}, _defineProperty({}, attribute, {}))\n        });\n        if (isFiniteNumber(minBound)) {\n          widgetSearchParameters = widgetSearchParameters.addNumericRefinement(attribute, '>=', minBound);\n        }\n        if (isFiniteNumber(maxBound)) {\n          widgetSearchParameters = widgetSearchParameters.addNumericRefinement(attribute, '<=', maxBound);\n        }\n        var value = uiState.range && uiState.range[attribute];\n        if (!value || value.indexOf(':') === -1) {\n          return widgetSearchParameters;\n        }\n        var _value$split$map = value.split(':').map(parseFloat),\n          _value$split$map2 = _slicedToArray(_value$split$map, 2),\n          lowerBound = _value$split$map2[0],\n          upperBound = _value$split$map2[1];\n        if (isFiniteNumber(lowerBound) && (!isFiniteNumber(minBound) || minBound < lowerBound)) {\n          widgetSearchParameters = widgetSearchParameters.removeNumericRefinement(attribute, '>=');\n          widgetSearchParameters = widgetSearchParameters.addNumericRefinement(attribute, '>=', lowerBound);\n        }\n        if (isFiniteNumber(upperBound) && (!isFiniteNumber(maxBound) || upperBound < maxBound)) {\n          widgetSearchParameters = widgetSearchParameters.removeNumericRefinement(attribute, '<=');\n          widgetSearchParameters = widgetSearchParameters.addNumericRefinement(attribute, '<=', upperBound);\n        }\n        return widgetSearchParameters;\n      }\n    };\n  };\n};\nexport default connectRange;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/rating-menu/connectRatingMenu.d.ts",
    "content": "import type { InsightsEvent } from '../../middlewares';\nimport type { Connector, CreateURL, WidgetRenderState } from '../../types';\ntype SendEvent = (...args: [InsightsEvent] | [string, string, string?]) => void;\ntype StarRatingItems = {\n    /**\n     * Name corresponding to the number of stars.\n     */\n    name: string;\n    /**\n     * Human-readable name corresponding to the number of stars.\n     */\n    label: string;\n    /**\n     * Number of stars as string.\n     */\n    value: string;\n    /**\n     * Count of matched results corresponding to the number of stars.\n     */\n    count: number;\n    /**\n     *  Array of length of maximum rating value with stars to display or not.\n     */\n    stars: boolean[];\n    /**\n     * Indicates if star rating refinement is applied.\n     */\n    isRefined: boolean;\n};\nexport type RatingMenuConnectorParams = {\n    /**\n     * Name of the attribute for faceting (eg. \"free_shipping\").\n     */\n    attribute: string;\n    /**\n     * The maximum rating value.\n     */\n    max?: number;\n};\nexport type RatingMenuRenderState = {\n    /**\n     * Possible star ratings the user can apply.\n     */\n    items: StarRatingItems[];\n    /**\n     * Creates an URL for the next state (takes the item value as parameter). Takes the value of an item as parameter.\n     */\n    createURL: CreateURL<string>;\n    /**\n     *  Indicates if search state can be refined.\n     */\n    canRefine: boolean;\n    /**\n     * Selects a rating to filter the results (takes the filter value as parameter). Takes the value of an item as parameter.\n     */\n    refine: (value: string) => void;\n    /**\n     * `true` if the last search contains no result.\n     *\n     * @deprecated Use `canRefine` instead.\n     */\n    hasNoResults: boolean;\n    /**\n     * Send event to insights middleware\n     */\n    sendEvent: SendEvent;\n};\nexport type RatingMenuWidgetDescription = {\n    $$type: 'ais.ratingMenu';\n    renderState: RatingMenuRenderState;\n    indexRenderState: {\n        ratingMenu: {\n            [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;\n        };\n    };\n    indexUiState: {\n        ratingMenu: {\n            [attribute: string]: number | undefined;\n        };\n    };\n};\nexport type RatingMenuConnector = Connector<RatingMenuWidgetDescription, RatingMenuConnectorParams>;\n/**\n * **StarRating** connector provides the logic to build a custom widget that will let\n * the user refine search results based on ratings.\n *\n * The connector provides to the rendering: `refine()` to select a value and\n * `items` that are the values that can be selected. `refine` should be used\n * with `items.value`.\n */\ndeclare const connectRatingMenu: RatingMenuConnector;\nexport default connectRatingMenu;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/rating-menu/connectRatingMenu.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nimport { checkRendering, createDocumentationLink, createDocumentationMessageGenerator, noop, warning } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'rating-menu',\n  connector: true\n});\nvar $$type = 'ais.ratingMenu';\nvar MAX_VALUES_PER_FACET_API_LIMIT = 1000;\nvar STEP = 1;\nvar createSendEvent = function createSendEvent(_ref) {\n  var instantSearchInstance = _ref.instantSearchInstance,\n    helper = _ref.helper,\n    getRefinedStar = _ref.getRefinedStar,\n    attribute = _ref.attribute;\n  return function () {\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    if (args.length === 1) {\n      instantSearchInstance.sendEventToInsights(args[0]);\n      return;\n    }\n    var facetValue = args[1],\n      _args$ = args[2],\n      eventName = _args$ === void 0 ? 'Filter Applied' : _args$;\n    var _args$0$split = args[0].split(':'),\n      _args$0$split2 = _slicedToArray(_args$0$split, 2),\n      eventType = _args$0$split2[0],\n      eventModifier = _args$0$split2[1];\n    if (eventType !== 'click') {\n      return;\n    }\n    var isRefined = getRefinedStar() === Number(facetValue);\n    if (!isRefined) {\n      var _helper$lastResults;\n      instantSearchInstance.sendEventToInsights({\n        insightsMethod: 'clickedFilters',\n        widgetType: $$type,\n        eventType: eventType,\n        eventModifier: eventModifier,\n        payload: {\n          eventName: eventName,\n          index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,\n          filters: [\"\".concat(attribute, \">=\").concat(facetValue)]\n        },\n        attribute: attribute\n      });\n    }\n  };\n};\n/**\n * **StarRating** connector provides the logic to build a custom widget that will let\n * the user refine search results based on ratings.\n *\n * The connector provides to the rendering: `refine()` to select a value and\n * `items` that are the values that can be selected. `refine` should be used\n * with `items.value`.\n */\nvar connectRatingMenu = function connectRatingMenu(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref2 = widgetParams || {},\n      attribute = _ref2.attribute,\n      _ref2$max = _ref2.max,\n      max = _ref2$max === void 0 ? 5 : _ref2$max;\n    var sendEvent;\n    if (!attribute) {\n      throw new Error(withUsage('The `attribute` option is required.'));\n    }\n    var _getRefinedStar = function getRefinedStar(state) {\n      var _values$;\n      var values = state.getNumericRefinements(attribute);\n      if (!((_values$ = values['>=']) !== null && _values$ !== void 0 && _values$.length)) {\n        return undefined;\n      }\n      return values['>='][0];\n    };\n    var getFacetsMaxDecimalPlaces = function getFacetsMaxDecimalPlaces(facetResults) {\n      var maxDecimalPlaces = 0;\n      facetResults.forEach(function (facetResult) {\n        var _facetResult$name$spl = facetResult.name.split('.'),\n          _facetResult$name$spl2 = _slicedToArray(_facetResult$name$spl, 2),\n          _facetResult$name$spl3 = _facetResult$name$spl2[1],\n          decimal = _facetResult$name$spl3 === void 0 ? '' : _facetResult$name$spl3;\n        maxDecimalPlaces = Math.max(maxDecimalPlaces, decimal.length);\n      });\n      return maxDecimalPlaces;\n    };\n    var getFacetValuesWarningMessage = function getFacetValuesWarningMessage(_ref3) {\n      var maxDecimalPlaces = _ref3.maxDecimalPlaces,\n        maxFacets = _ref3.maxFacets,\n        maxValuesPerFacet = _ref3.maxValuesPerFacet;\n      var maxDecimalPlacesInRange = Math.max(0, Math.floor(Math.log10(MAX_VALUES_PER_FACET_API_LIMIT / max)));\n      var maxFacetsInRange = Math.min(MAX_VALUES_PER_FACET_API_LIMIT, Math.pow(10, maxDecimalPlacesInRange) * max);\n      var solutions = [];\n      if (maxFacets > MAX_VALUES_PER_FACET_API_LIMIT) {\n        solutions.push(\"- Update your records to lower the precision of the values in the \\\"\".concat(attribute, \"\\\" attribute (for example: \").concat(5.123456789.toPrecision(maxDecimalPlaces + 1), \" to \").concat(5.123456789.toPrecision(maxDecimalPlacesInRange + 1), \")\"));\n      }\n      if (maxValuesPerFacet < maxFacetsInRange) {\n        solutions.push(\"- Increase the maximum number of facet values to \".concat(maxFacetsInRange, \" using the \\\"configure\\\" widget \").concat(createDocumentationLink({\n          name: 'configure'\n        }), \" and the \\\"maxValuesPerFacet\\\" parameter https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/\"));\n      }\n      return \"The \".concat(attribute, \" attribute can have \").concat(maxFacets, \" different values (0 to \").concat(max, \" with a maximum of \").concat(maxDecimalPlaces, \" decimals = \").concat(maxFacets, \") but you retrieved only \").concat(maxValuesPerFacet, \" facet values. Therefore the number of results that match the refinements can be incorrect.\\n    \").concat(solutions.length ? \"To resolve this problem you can:\\n\".concat(solutions.join('\\n')) : \"\");\n    };\n    function getRefinedState(state, facetValue) {\n      var isRefined = _getRefinedStar(state) === Number(facetValue);\n      var emptyState = state.resetPage().removeNumericRefinement(attribute);\n      if (!isRefined) {\n        return emptyState.addNumericRefinement(attribute, '<=', max).addNumericRefinement(attribute, '>=', Number(facetValue));\n      }\n      return emptyState;\n    }\n    var toggleRefinement = function toggleRefinement(helper, facetValue) {\n      sendEvent('click:internal', facetValue);\n      helper.setState(getRefinedState(helper.state, facetValue)).search();\n    };\n    var connectorState = {\n      toggleRefinementFactory: function toggleRefinementFactory(helper) {\n        return toggleRefinement.bind(null, helper);\n      },\n      createURLFactory: function createURLFactory(_ref4) {\n        var state = _ref4.state,\n          createURL = _ref4.createURL,\n          getWidgetUiState = _ref4.getWidgetUiState,\n          helper = _ref4.helper;\n        return function (value) {\n          return createURL(function (uiState) {\n            return getWidgetUiState(uiState, {\n              searchParameters: getRefinedState(state, value),\n              helper: helper\n            });\n          });\n        };\n      }\n    };\n    return {\n      $$type: $$type,\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          ratingMenu: _objectSpread(_objectSpread({}, renderState.ratingMenu), {}, _defineProperty({}, attribute, this.getWidgetRenderState(renderOptions)))\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref5) {\n        var helper = _ref5.helper,\n          results = _ref5.results,\n          state = _ref5.state,\n          instantSearchInstance = _ref5.instantSearchInstance,\n          createURL = _ref5.createURL;\n        var facetValues = [];\n        if (!sendEvent) {\n          sendEvent = createSendEvent({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            getRefinedStar: function getRefinedStar() {\n              return _getRefinedStar(helper.state);\n            },\n            attribute: attribute\n          });\n        }\n        var refinementIsApplied = false;\n        var totalCount = 0;\n        var facetResults = results === null || results === void 0 ? void 0 : results.getFacetValues(attribute, {});\n        if (results && facetResults) {\n          var maxValuesPerFacet = facetResults.length;\n          var maxDecimalPlaces = getFacetsMaxDecimalPlaces(facetResults);\n          var maxFacets = Math.pow(10, maxDecimalPlaces) * max;\n          process.env.NODE_ENV === 'development' ? warning(maxFacets <= maxValuesPerFacet || Boolean(results.__isArtificial), getFacetValuesWarningMessage({\n            maxDecimalPlaces: maxDecimalPlaces,\n            maxFacets: maxFacets,\n            maxValuesPerFacet: maxValuesPerFacet\n          })) : void 0;\n          var refinedStar = _getRefinedStar(state);\n          var _loop = function _loop(star) {\n            var isRefined = refinedStar === star;\n            refinementIsApplied = refinementIsApplied || isRefined;\n            var count = facetResults.filter(function (f) {\n              return Number(f.name) >= star && Number(f.name) <= max;\n            }).map(function (f) {\n              return f.count;\n            }).reduce(function (sum, current) {\n              return sum + current;\n            }, 0);\n            totalCount += count;\n            if (refinedStar && !isRefined && count === 0) {\n              // skip count==0 when at least 1 refinement is enabled\n              // eslint-disable-next-line no-continue\n              return \"continue\";\n            }\n            var stars = _toConsumableArray(new Array(Math.floor(max / STEP))).map(function (_v, i) {\n              return i * STEP < star;\n            });\n            facetValues.push({\n              stars: stars,\n              name: String(star),\n              label: String(star),\n              value: String(star),\n              count: count,\n              isRefined: isRefined\n            });\n          };\n          for (var star = STEP; star < max; star += STEP) {\n            var _ret = _loop(star);\n            if (_ret === \"continue\") continue;\n          }\n        }\n        facetValues = facetValues.reverse();\n        var hasNoResults = results ? results.nbHits === 0 : true;\n        return {\n          items: facetValues,\n          hasNoResults: hasNoResults,\n          canRefine: (!hasNoResults || refinementIsApplied) && totalCount > 0,\n          refine: connectorState.toggleRefinementFactory(helper),\n          sendEvent: sendEvent,\n          createURL: connectorState.createURLFactory({\n            state: state,\n            createURL: createURL,\n            helper: helper,\n            getWidgetUiState: this.getWidgetUiState\n          }),\n          widgetParams: widgetParams\n        };\n      },\n      dispose: function dispose(_ref6) {\n        var state = _ref6.state;\n        unmountFn();\n        return state.removeNumericRefinement(attribute);\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref7) {\n        var searchParameters = _ref7.searchParameters;\n        var value = _getRefinedStar(searchParameters);\n        return removeEmptyRefinementsFromUiState(_objectSpread(_objectSpread({}, uiState), {}, {\n          ratingMenu: _objectSpread(_objectSpread({}, uiState.ratingMenu), {}, _defineProperty({}, attribute, typeof value === 'number' ? value : undefined))\n        }), attribute);\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref8) {\n        var uiState = _ref8.uiState;\n        var value = uiState.ratingMenu && uiState.ratingMenu[attribute];\n        var withDisjunctiveFacet = searchParameters.addDisjunctiveFacet(attribute).removeNumericRefinement(attribute).removeDisjunctiveFacetRefinement(attribute);\n        if (!value) {\n          return withDisjunctiveFacet.setQueryParameters({\n            numericRefinements: _objectSpread(_objectSpread({}, withDisjunctiveFacet.numericRefinements), {}, _defineProperty({}, attribute, {}))\n          });\n        }\n        return withDisjunctiveFacet.addNumericRefinement(attribute, '<=', max).addNumericRefinement(attribute, '>=', value);\n      }\n    };\n  };\n};\nfunction removeEmptyRefinementsFromUiState(indexUiState, attribute) {\n  if (!indexUiState.ratingMenu) {\n    return indexUiState;\n  }\n  if (typeof indexUiState.ratingMenu[attribute] !== 'number') {\n    delete indexUiState.ratingMenu[attribute];\n  }\n  if (Object.keys(indexUiState.ratingMenu).length === 0) {\n    delete indexUiState.ratingMenu;\n  }\n  return indexUiState;\n}\nexport default connectRatingMenu;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/refinement-list/connectRefinementList.d.ts",
    "content": "import type { SendEventForFacet } from '../../lib/utils';\nimport type { Connector, TransformItems, SortBy, CreateURL, WidgetRenderState } from '../../types';\nimport type { SearchResults } from 'algoliasearch-helper';\nexport type RefinementListItem = {\n    /**\n     * The value of the refinement list item.\n     */\n    value: string;\n    /**\n     * Human-readable value of the refinement list item.\n     */\n    label: string;\n    /**\n     * Human-readable value of the searched refinement list item.\n     */\n    highlighted?: string;\n    /**\n     * Number of matched results after refinement is applied.\n     */\n    count: number;\n    /**\n     * Indicates if the list item is refined.\n     */\n    isRefined: boolean;\n};\nexport type RefinementListConnectorParams = {\n    /**\n     * The name of the attribute in the records.\n     */\n    attribute: string;\n    /**\n     * How the filters are combined together.\n     */\n    operator?: 'and' | 'or';\n    /**\n     * The max number of items to display when\n     * `showMoreLimit` is not set or if the widget is showing less value.\n     */\n    limit?: number;\n    /**\n     * Whether to display a button that expands the number of items.\n     */\n    showMore?: boolean;\n    /**\n     * The max number of items to display if the widget\n     * is showing more items.\n     */\n    showMoreLimit?: number;\n    /**\n     * How to sort refinements. Possible values: `count|isRefined|name:asc|name:desc`.\n     *\n     * You can also use a sort function that behaves like the standard Javascript [compareFunction](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Syntax).\n     *\n     * If a facetOrdering is set in the index settings, it is used when sortBy isn't passed\n     */\n    sortBy?: SortBy<SearchResults.FacetValue>;\n    /**\n     * Escapes the content of the facet values.\n     */\n    escapeFacetValues?: boolean;\n    /**\n     * Function to transform the items passed to the templates.\n     */\n    transformItems?: TransformItems<RefinementListItem>;\n};\nexport type RefinementListRenderState = {\n    /**\n     * The list of filtering values returned from Algolia API.\n     */\n    items: RefinementListItem[];\n    /**\n     * indicates whether the results are exhaustive (complete)\n     */\n    hasExhaustiveItems: boolean;\n    /**\n     * Creates the next state url for a selected refinement.\n     */\n    createURL: CreateURL<string>;\n    /**\n     * Action to apply selected refinements.\n     */\n    refine: (value: string) => void;\n    /**\n     * Send event to insights middleware\n     */\n    sendEvent: SendEventForFacet;\n    /**\n     * Searches for values inside the list.\n     */\n    searchForItems: (query: string) => void;\n    /**\n     * `true` if the values are from an index search.\n     */\n    isFromSearch: boolean;\n    /**\n     * `true` if a refinement can be applied.\n     * @MAJOR: reconsider how `canRefine` is computed so it both accounts for the\n     * items returned in the main search and in SFFV.\n     */\n    canRefine: boolean;\n    /**\n     * `true` if the toggleShowMore button can be activated (enough items to display more or\n     * already displaying more than `limit` items)\n     */\n    canToggleShowMore: boolean;\n    /**\n     * True if the menu is displaying all the menu items.\n     */\n    isShowingMore: boolean;\n    /**\n     * Toggles the number of values displayed between `limit` and `showMoreLimit`.\n     */\n    toggleShowMore: () => void;\n};\nexport type RefinementListWidgetDescription = {\n    $$type: 'ais.refinementList';\n    renderState: RefinementListRenderState;\n    indexRenderState: {\n        refinementList: {\n            [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;\n        };\n    };\n    indexUiState: {\n        refinementList: {\n            [attribute: string]: string[];\n        };\n    };\n};\nexport type RefinementListConnector = Connector<RefinementListWidgetDescription, RefinementListConnectorParams>;\n/**\n * **RefinementList** connector provides the logic to build a custom widget that\n * will let the user filter the results based on the values of a specific facet.\n *\n * **Requirement:** the attribute passed as `attribute` must be present in\n * attributesForFaceting of the searched index.\n *\n * This connector provides:\n * - a `refine()` function to select an item.\n * - a `toggleShowMore()` function to display more or less items\n * - a `searchForItems()` function to search within the items.\n */\ndeclare const connectRefinementList: RefinementListConnector;\nexport default connectRefinementList;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/refinement-list/connectRefinementList.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _excluded = [\"name\", \"escapedValue\"],\n  _excluded2 = [\"escapedValue\", \"value\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport { escapeFacets, TAG_PLACEHOLDER, TAG_REPLACEMENT, checkRendering, createDocumentationMessageGenerator, createSendEventForFacet, noop, warning } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'refinement-list',\n  connector: true\n});\nvar DEFAULT_SORT = ['isRefined', 'count:desc', 'name:asc'];\n/**\n * **RefinementList** connector provides the logic to build a custom widget that\n * will let the user filter the results based on the values of a specific facet.\n *\n * **Requirement:** the attribute passed as `attribute` must be present in\n * attributesForFaceting of the searched index.\n *\n * This connector provides:\n * - a `refine()` function to select an item.\n * - a `toggleShowMore()` function to display more or less items\n * - a `searchForItems()` function to search within the items.\n */\nvar connectRefinementList = function connectRefinementList(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      attribute = _ref.attribute,\n      _ref$operator = _ref.operator,\n      operator = _ref$operator === void 0 ? 'or' : _ref$operator,\n      _ref$limit = _ref.limit,\n      limit = _ref$limit === void 0 ? 10 : _ref$limit,\n      _ref$showMore = _ref.showMore,\n      showMore = _ref$showMore === void 0 ? false : _ref$showMore,\n      _ref$showMoreLimit = _ref.showMoreLimit,\n      showMoreLimit = _ref$showMoreLimit === void 0 ? 20 : _ref$showMoreLimit,\n      _ref$sortBy = _ref.sortBy,\n      sortBy = _ref$sortBy === void 0 ? DEFAULT_SORT : _ref$sortBy,\n      _ref$escapeFacetValue = _ref.escapeFacetValues,\n      escapeFacetValues = _ref$escapeFacetValue === void 0 ? true : _ref$escapeFacetValue,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    if (!attribute) {\n      throw new Error(withUsage('The `attribute` option is required.'));\n    }\n    if (!/^(and|or)$/.test(operator)) {\n      throw new Error(withUsage(\"The `operator` must one of: `\\\"and\\\"`, `\\\"or\\\"` (got \\\"\".concat(operator, \"\\\").\")));\n    }\n    if (showMore === true && showMoreLimit <= limit) {\n      throw new Error(withUsage('`showMoreLimit` should be greater than `limit`.'));\n    }\n    var formatItems = function formatItems(_ref2) {\n      var label = _ref2.name,\n        value = _ref2.escapedValue,\n        item = _objectWithoutProperties(_ref2, _excluded);\n      return _objectSpread(_objectSpread({}, item), {}, {\n        value: value,\n        label: label,\n        highlighted: label\n      });\n    };\n    var lastResultsFromMainSearch;\n    var lastItemsFromMainSearch = [];\n    var hasExhaustiveItems = true;\n    var triggerRefine;\n    var sendEvent;\n    var isShowingMore = false;\n    // Provide the same function to the `renderFn` so that way the user\n    // has to only bind it once when `isFirstRendering` for instance\n    var toggleShowMore = function toggleShowMore() {};\n    function cachedToggleShowMore() {\n      toggleShowMore();\n    }\n    function createToggleShowMore(renderOptions, widget) {\n      return function () {\n        isShowingMore = !isShowingMore;\n        widget.render(renderOptions);\n      };\n    }\n    function getLimit() {\n      return isShowingMore ? showMoreLimit : limit;\n    }\n    var searchForFacetValues = function searchForFacetValues() {\n      return function () {};\n    };\n    var createSearchForFacetValues = function createSearchForFacetValues(helper, widget) {\n      return function (renderOptions) {\n        return function (query) {\n          var instantSearchInstance = renderOptions.instantSearchInstance,\n            searchResults = renderOptions.results;\n          if (query === '' && lastItemsFromMainSearch) {\n            // render with previous data from the helper.\n            renderFn(_objectSpread(_objectSpread({}, widget.getWidgetRenderState(_objectSpread(_objectSpread({}, renderOptions), {}, {\n              results: lastResultsFromMainSearch\n            }))), {}, {\n              instantSearchInstance: instantSearchInstance\n            }), false);\n          } else {\n            var tags = {\n              highlightPreTag: escapeFacetValues ? TAG_PLACEHOLDER.highlightPreTag : TAG_REPLACEMENT.highlightPreTag,\n              highlightPostTag: escapeFacetValues ? TAG_PLACEHOLDER.highlightPostTag : TAG_REPLACEMENT.highlightPostTag\n            };\n            helper.searchForFacetValues(attribute, query,\n            // We cap the `maxFacetHits` value to 100 because the Algolia API\n            // doesn't support a greater number.\n            // See https://www.algolia.com/doc/api-reference/api-parameters/maxFacetHits/\n            Math.min(getLimit(), 100), tags).then(function (results) {\n              var facetValues = escapeFacetValues ? escapeFacets(results.facetHits) : results.facetHits;\n              var normalizedFacetValues = transformItems(facetValues.map(function (_ref3) {\n                var escapedValue = _ref3.escapedValue,\n                  value = _ref3.value,\n                  item = _objectWithoutProperties(_ref3, _excluded2);\n                return _objectSpread(_objectSpread({}, item), {}, {\n                  value: escapedValue,\n                  label: value\n                });\n              }), {\n                results: searchResults\n              });\n              renderFn(_objectSpread(_objectSpread({}, widget.getWidgetRenderState(_objectSpread(_objectSpread({}, renderOptions), {}, {\n                results: lastResultsFromMainSearch\n              }))), {}, {\n                items: normalizedFacetValues,\n                canToggleShowMore: false,\n                canRefine: true,\n                isFromSearch: true,\n                instantSearchInstance: instantSearchInstance\n              }), false);\n            });\n          }\n        };\n      };\n    };\n    return {\n      $$type: 'ais.refinementList',\n      init: function init(initOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: renderOptions.instantSearchInstance\n        }), false);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          refinementList: _objectSpread(_objectSpread({}, renderState.refinementList), {}, _defineProperty({}, attribute, this.getWidgetRenderState(renderOptions)))\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(renderOptions) {\n        var _this = this;\n        var results = renderOptions.results,\n          state = renderOptions.state,\n          _createURL = renderOptions.createURL,\n          instantSearchInstance = renderOptions.instantSearchInstance,\n          helper = renderOptions.helper;\n        var items = [];\n        var facetValues = [];\n        if (!sendEvent || !triggerRefine || !searchForFacetValues) {\n          sendEvent = createSendEventForFacet({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            attribute: attribute,\n            widgetType: this.$$type\n          });\n          triggerRefine = function triggerRefine(facetValue) {\n            sendEvent('click:internal', facetValue);\n            helper.toggleFacetRefinement(attribute, facetValue).search();\n          };\n          searchForFacetValues = createSearchForFacetValues(helper, this);\n        }\n        if (results) {\n          var values = results.getFacetValues(attribute, {\n            sortBy: sortBy,\n            facetOrdering: sortBy === DEFAULT_SORT\n          });\n          facetValues = values && Array.isArray(values) ? values : [];\n          items = transformItems(facetValues.slice(0, getLimit()).map(formatItems), {\n            results: results\n          });\n          var maxValuesPerFacetConfig = state.maxValuesPerFacet;\n          var currentLimit = getLimit();\n          // If the limit is the max number of facet retrieved it is impossible to know\n          // if the facets are exhaustive. The only moment we are sure it is exhaustive\n          // is when it is strictly under the number requested unless we know that another\n          // widget has requested more values (maxValuesPerFacet > getLimit()).\n          // Because this is used for making the search of facets unable or not, it is important\n          // to be conservative here.\n          hasExhaustiveItems = maxValuesPerFacetConfig > currentLimit ? facetValues.length <= currentLimit : facetValues.length < currentLimit;\n          lastResultsFromMainSearch = results;\n          lastItemsFromMainSearch = items;\n          if (renderOptions.results) {\n            toggleShowMore = createToggleShowMore(renderOptions, this);\n          }\n        }\n\n        // Do not mistake searchForFacetValues and searchFacetValues which is the actual search\n        // function\n        var searchFacetValues = searchForFacetValues && searchForFacetValues(renderOptions);\n        var canShowLess = isShowingMore && lastItemsFromMainSearch.length > limit;\n        var canShowMore = showMore && !hasExhaustiveItems;\n        var canToggleShowMore = canShowLess || canShowMore;\n        return {\n          createURL: function createURL(facetValue) {\n            return _createURL(function (uiState) {\n              return _this.getWidgetUiState(uiState, {\n                searchParameters: state.resetPage().toggleFacetRefinement(attribute, facetValue),\n                helper: helper\n              });\n            });\n          },\n          items: items,\n          refine: triggerRefine,\n          searchForItems: searchFacetValues,\n          isFromSearch: false,\n          canRefine: items.length > 0,\n          widgetParams: widgetParams,\n          isShowingMore: isShowingMore,\n          canToggleShowMore: canToggleShowMore,\n          toggleShowMore: cachedToggleShowMore,\n          sendEvent: sendEvent,\n          hasExhaustiveItems: hasExhaustiveItems\n        };\n      },\n      dispose: function dispose(_ref4) {\n        var state = _ref4.state;\n        unmountFn();\n        var withoutMaxValuesPerFacet = state.setQueryParameter('maxValuesPerFacet', undefined);\n        if (operator === 'and') {\n          return withoutMaxValuesPerFacet.removeFacet(attribute);\n        }\n        return withoutMaxValuesPerFacet.removeDisjunctiveFacet(attribute);\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref5) {\n        var searchParameters = _ref5.searchParameters;\n        var values = operator === 'or' ? searchParameters.getDisjunctiveRefinements(attribute) : searchParameters.getConjunctiveRefinements(attribute);\n        return removeEmptyRefinementsFromUiState(_objectSpread(_objectSpread({}, uiState), {}, {\n          refinementList: _objectSpread(_objectSpread({}, uiState.refinementList), {}, _defineProperty({}, attribute, values))\n        }), attribute);\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref6) {\n        var uiState = _ref6.uiState;\n        var isDisjunctive = operator === 'or';\n        if (searchParameters.isHierarchicalFacet(attribute)) {\n          process.env.NODE_ENV === 'development' ? warning(false, \"RefinementList: Attribute \\\"\".concat(attribute, \"\\\" is already used by another widget applying hierarchical faceting.\\nAs this is not supported, please make sure to remove this other widget or this RefinementList widget will not work at all.\")) : void 0;\n          return searchParameters;\n        }\n        if (isDisjunctive && searchParameters.isConjunctiveFacet(attribute) || !isDisjunctive && searchParameters.isDisjunctiveFacet(attribute)) {\n          process.env.NODE_ENV === 'development' ? warning(false, \"RefinementList: Attribute \\\"\".concat(attribute, \"\\\" is used by another refinement list with a different operator.\\nAs this is not supported, please make sure to only use this attribute with one of the two operators.\")) : void 0;\n          return searchParameters;\n        }\n        var values = uiState.refinementList && uiState.refinementList[attribute];\n        var withFacetConfiguration = isDisjunctive ? searchParameters.addDisjunctiveFacet(attribute).removeDisjunctiveFacetRefinement(attribute) : searchParameters.addFacet(attribute).removeFacetRefinement(attribute);\n        var currentMaxValuesPerFacet = withFacetConfiguration.maxValuesPerFacet || 0;\n        var nextMaxValuesPerFacet = Math.max(currentMaxValuesPerFacet, showMore ? showMoreLimit : limit);\n        var withMaxValuesPerFacet = withFacetConfiguration.setQueryParameter('maxValuesPerFacet', nextMaxValuesPerFacet);\n        if (!values) {\n          var key = isDisjunctive ? 'disjunctiveFacetsRefinements' : 'facetsRefinements';\n          return withMaxValuesPerFacet.setQueryParameters(_defineProperty({}, key, _objectSpread(_objectSpread({}, withMaxValuesPerFacet[key]), {}, _defineProperty({}, attribute, []))));\n        }\n        return values.reduce(function (parameters, value) {\n          return isDisjunctive ? parameters.addDisjunctiveFacetRefinement(attribute, value) : parameters.addFacetRefinement(attribute, value);\n        }, withMaxValuesPerFacet);\n      }\n    };\n  };\n};\nfunction removeEmptyRefinementsFromUiState(indexUiState, attribute) {\n  if (!indexUiState.refinementList) {\n    return indexUiState;\n  }\n  if (!indexUiState.refinementList[attribute] || indexUiState.refinementList[attribute].length === 0) {\n    delete indexUiState.refinementList[attribute];\n  }\n  if (Object.keys(indexUiState.refinementList).length === 0) {\n    delete indexUiState.refinementList;\n  }\n  return indexUiState;\n}\nexport default connectRefinementList;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/related-products/connectRelatedProducts.d.ts",
    "content": "import type { SendEventForHits } from '../../lib/utils';\nimport type { Connector, TransformItems, BaseHit, Renderer, Unmounter, UnknownWidgetParams, RecommendResponse, Hit, AlgoliaHit } from '../../types';\nimport type { PlainSearchParameters } from 'algoliasearch-helper';\nexport type RelatedProductsRenderState<THit extends NonNullable<object> = BaseHit> = {\n    /**\n     * The matched recommendations from the Algolia API.\n     */\n    items: Array<Hit<THit>>;\n    /**\n     * Sends an event to the Insights middleware.\n     */\n    sendEvent: SendEventForHits;\n};\nexport type RelatedProductsConnectorParams<THit extends NonNullable<object> = BaseHit> = {\n    /**\n     * The `objectIDs` of the items to get related products from.\n     */\n    objectIDs: string[];\n    /**\n     * The number of recommendations to retrieve.\n     */\n    limit?: number;\n    /**\n     * The threshold for the recommendations confidence score (between 0 and 100).\n     */\n    threshold?: number;\n    /**\n     * List of search parameters to send.\n     */\n    fallbackParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\n    /**\n     * List of search parameters to send.\n     */\n    queryParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\n    /**\n     * Whether to escape HTML tags from items string values.\n     *\n     * @default true\n     */\n    escapeHTML?: boolean;\n    /**\n     * Function to transform the items passed to the templates.\n     */\n    transformItems?: TransformItems<Hit<THit>, {\n        results: RecommendResponse<AlgoliaHit<THit>>;\n    }>;\n};\nexport type RelatedProductsWidgetDescription<THit extends NonNullable<object> = BaseHit> = {\n    $$type: 'ais.relatedProducts';\n    renderState: RelatedProductsRenderState<THit>;\n};\nexport type RelatedProductsConnector<THit extends NonNullable<object> = BaseHit> = Connector<RelatedProductsWidgetDescription<THit>, RelatedProductsConnectorParams<THit>>;\ndeclare const _default: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<RelatedProductsRenderState, RelatedProductsConnectorParams & TWidgetParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & RelatedProductsConnectorParams<THit>) => {\n    dependsOn: \"recommend\";\n    $$type: \"ais.relatedProducts\";\n    init(initOptions: import(\"../../types\").InitOptions): void;\n    render(renderOptions: import(\"../../types\").RenderOptions): void;\n    getRenderState(renderState: {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../answers/connectAnswers\").AnswersRenderState, import(\"../answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../configure/connectConfigure\").ConfigureRenderState, import(\"../configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<import(\"../hits/connectHits\").HitsRenderState<BaseHit>, import(\"../hits/connectHits\").HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../menu/connectMenu\").MenuRenderState, import(\"../menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../pagination/connectPagination\").PaginationRenderState, import(\"../pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../range/connectRange\").RangeRenderState, import(\"../range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../search-box/connectSearchBox\").SearchBoxRenderState, import(\"../search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../sort-by/connectSortBy\").SortByRenderState, import(\"../sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../stats/connectStats\").StatsRenderState, import(\"../stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../../widgets/analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../../widgets/places/places\").PlacesWidgetParams> | undefined;\n    }): {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../answers/connectAnswers\").AnswersRenderState, import(\"../answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../configure/connectConfigure\").ConfigureRenderState, import(\"../configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<import(\"../hits/connectHits\").HitsRenderState<BaseHit>, import(\"../hits/connectHits\").HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../menu/connectMenu\").MenuRenderState, import(\"../menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../pagination/connectPagination\").PaginationRenderState, import(\"../pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../range/connectRange\").RangeRenderState, import(\"../range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../search-box/connectSearchBox\").SearchBoxRenderState, import(\"../search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../sort-by/connectSortBy\").SortByRenderState, import(\"../sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../stats/connectStats\").StatsRenderState, import(\"../stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../../widgets/analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../../widgets/places/places\").PlacesWidgetParams> | undefined;\n    };\n    getWidgetRenderState({ results, helper, instantSearchInstance }: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions | ({\n        instantSearchInstance: import(\"../../types\").InstantSearch;\n        parent: import(\"../../types\").IndexWidget;\n        templatesConfig: Record<string, unknown>;\n        scopedResults: import(\"../../types\").ScopedResult[];\n        state: import(\"algoliasearch-helper\").SearchParameters;\n        renderState: import(\"../../types\").IndexRenderState;\n        helper: import(\"algoliasearch-helper\").AlgoliaSearchHelper;\n        searchMetadata: {\n            isSearchStalled: boolean;\n        };\n        status: import(\"../../types\").InstantSearch[\"status\"];\n        error: import(\"../../types\").InstantSearch[\"error\"];\n        createURL: (nextState: import(\"algoliasearch-helper\").SearchParameters | ((state: import(\"../../types\").IndexUiState) => import(\"../../types\").IndexUiState)) => string;\n    } & {\n        results: RecommendResponse<any>;\n    })): {\n        items: Hit<BaseHit>[] | Hit<THit>[];\n        widgetParams: TWidgetParams & RelatedProductsConnectorParams<THit>;\n        sendEvent: SendEventForHits;\n    };\n    dispose({ recommendState }: import(\"../../types\").DisposeOptions): import(\"algoliasearch-helper\").RecommendParameters;\n    getWidgetParameters(state: import(\"algoliasearch-helper\").RecommendParameters): import(\"algoliasearch-helper\").RecommendParameters;\n};\nexport default _default;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/related-products/connectRelatedProducts.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { createDocumentationMessageGenerator, checkRendering, noop, escapeHits, TAG_PLACEHOLDER, createSendEventForHits, addAbsolutePosition, addQueryID } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'related-products',\n  connector: true\n});\nexport default (function connectRelatedProducts(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      _ref$escapeHTML = _ref.escapeHTML,\n      escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,\n      objectIDs = _ref.objectIDs,\n      limit = _ref.limit,\n      threshold = _ref.threshold,\n      fallbackParameters = _ref.fallbackParameters,\n      queryParameters = _ref.queryParameters,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    if (!objectIDs || objectIDs.length === 0) {\n      throw new Error(withUsage('The `objectIDs` option is required.'));\n    }\n    var sendEvent;\n    return {\n      dependsOn: 'recommend',\n      $$type: 'ais.relatedProducts',\n      init: function init(initOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var renderState = this.getWidgetRenderState(renderOptions);\n        renderFn(_objectSpread(_objectSpread({}, renderState), {}, {\n          instantSearchInstance: renderOptions.instantSearchInstance\n        }), false);\n      },\n      getRenderState: function getRenderState(renderState) {\n        return renderState;\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref2) {\n        var results = _ref2.results,\n          helper = _ref2.helper,\n          instantSearchInstance = _ref2.instantSearchInstance;\n        if (!sendEvent) {\n          sendEvent = createSendEventForHits({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            widgetType: this.$$type\n          });\n        }\n        if (results === null || results === undefined) {\n          return {\n            items: [],\n            widgetParams: widgetParams,\n            sendEvent: sendEvent\n          };\n        }\n        if (escapeHTML && results.hits.length > 0) {\n          results.hits = escapeHits(results.hits);\n        }\n        var itemsWithAbsolutePosition = addAbsolutePosition(results.hits, 0, 1);\n        var itemsWithAbsolutePositionAndQueryID = addQueryID(itemsWithAbsolutePosition, results.queryID);\n        var transformedItems = transformItems(itemsWithAbsolutePositionAndQueryID, {\n          results: results\n        });\n        return {\n          items: transformedItems,\n          widgetParams: widgetParams,\n          sendEvent: sendEvent\n        };\n      },\n      dispose: function dispose(_ref3) {\n        var recommendState = _ref3.recommendState;\n        unmountFn();\n        return recommendState.removeParams(this.$$id);\n      },\n      getWidgetParameters: function getWidgetParameters(state) {\n        var _this = this;\n        return objectIDs.reduce(function (acc, objectID) {\n          return acc.addRelatedProducts({\n            objectID: objectID,\n            maxRecommendations: limit,\n            threshold: threshold,\n            fallbackParameters: _objectSpread(_objectSpread({}, fallbackParameters), escapeHTML ? TAG_PLACEHOLDER : {}),\n            queryParameters: _objectSpread(_objectSpread({}, queryParameters), escapeHTML ? TAG_PLACEHOLDER : {}),\n            $$id: _this.$$id\n          });\n        }, state.removeParams(this.$$id));\n      }\n    };\n  };\n});"
  },
  {
    "path": "js/instantsearch.js/es/connectors/relevant-sort/connectRelevantSort.d.ts",
    "content": "import type { Connector, WidgetRenderState } from '../../types';\nexport type RelevantSortConnectorParams = Record<string, unknown>;\ntype Refine = (relevancyStrictness: number | undefined) => void;\nexport type RelevantSortRenderState = {\n    /**\n     * Indicates if it has appliedRelevancyStrictness greater than zero\n     */\n    isRelevantSorted: boolean;\n    /**\n     * Indicates if the results come from a virtual replica\n     */\n    isVirtualReplica: boolean;\n    /**\n     * Indicates if search state can be refined\n     */\n    canRefine: boolean;\n    /**\n     * Sets the value as relevancyStrictness and trigger a new search\n     */\n    refine: Refine;\n};\nexport type RelevantSortWidgetDescription = {\n    $$type: 'ais.relevantSort';\n    renderState: RelevantSortRenderState;\n    indexRenderState: {\n        relevantSort: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams>;\n    };\n    indexUiState: {\n        relevantSort: number;\n    };\n};\nexport type RelevantSortConnector = Connector<RelevantSortWidgetDescription, RelevantSortConnectorParams>;\ndeclare const connectRelevantSort: RelevantSortConnector;\nexport default connectRelevantSort;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/relevant-sort/connectRelevantSort.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { noop } from \"../../lib/utils/index.js\";\nvar connectRelevantSort = function connectRelevantSort() {\n  var renderFn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : noop;\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  return function (widgetParams) {\n    var connectorState = {};\n    return {\n      $$type: 'ais.relevantSort',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref) {\n        var state = _ref.state;\n        unmountFn();\n        return state.setQueryParameter('relevancyStrictness', undefined);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          relevantSort: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref2) {\n        var results = _ref2.results,\n          helper = _ref2.helper;\n        if (!connectorState.refine) {\n          connectorState.refine = function (relevancyStrictness) {\n            helper.setQueryParameter('relevancyStrictness', relevancyStrictness).search();\n          };\n        }\n        var _ref3 = results || {},\n          appliedRelevancyStrictness = _ref3.appliedRelevancyStrictness;\n        var isVirtualReplica = appliedRelevancyStrictness !== undefined;\n        return {\n          isRelevantSorted: typeof appliedRelevancyStrictness !== 'undefined' && appliedRelevancyStrictness > 0,\n          isVirtualReplica: isVirtualReplica,\n          canRefine: isVirtualReplica,\n          refine: connectorState.refine,\n          widgetParams: widgetParams\n        };\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(state, _ref4) {\n        var _uiState$relevantSort;\n        var uiState = _ref4.uiState;\n        return state.setQueryParameter('relevancyStrictness', (_uiState$relevantSort = uiState.relevantSort) !== null && _uiState$relevantSort !== void 0 ? _uiState$relevantSort : state.relevancyStrictness);\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref5) {\n        var searchParameters = _ref5.searchParameters;\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          relevantSort: searchParameters.relevancyStrictness || uiState.relevantSort\n        });\n      }\n    };\n  };\n};\nexport default connectRelevantSort;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/search-box/connectSearchBox.d.ts",
    "content": "import type { Connector, WidgetRenderState } from '../../types';\nexport type SearchBoxConnectorParams = {\n    /**\n     * A function that will be called every time\n     * a new value for the query is set. The first parameter is the query and the second is a\n     * function to actually trigger the search. The function takes the query as the parameter.\n     *\n     * This queryHook can be used to debounce the number of searches done from the searchBox.\n     */\n    queryHook?: (query: string, hook: (value: string) => void) => void;\n};\n/**\n * @typedef {Object} CustomSearchBoxWidgetParams\n * @property {function(string, function(string))} [queryHook = undefined] A function that will be called every time\n * a new value for the query is set. The first parameter is the query and the second is a\n * function to actually trigger the search. The function takes the query as the parameter.\n *\n * This queryHook can be used to debounce the number of searches done from the searchBox.\n */\nexport type SearchBoxRenderState = {\n    /**\n     * The query from the last search.\n     */\n    query: string;\n    /**\n     * Sets a new query and searches.\n     */\n    refine: (value: string) => void;\n    /**\n     * Remove the query and perform search.\n     */\n    clear: () => void;\n    /**\n     * `true` if the search results takes more than a certain time to come back\n     * from Algolia servers. This can be configured on the InstantSearch constructor with the attribute\n     * `stalledSearchDelay` which is 200ms, by default.\n     * @deprecated use `instantSearchInstance.status` instead\n     */\n    isSearchStalled: boolean;\n};\nexport type SearchBoxWidgetDescription = {\n    $$type: 'ais.searchBox';\n    renderState: SearchBoxRenderState;\n    indexRenderState: {\n        searchBox: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams>;\n    };\n    indexUiState: {\n        query: string;\n    };\n};\nexport type SearchBoxConnector = Connector<SearchBoxWidgetDescription, SearchBoxConnectorParams>;\n/**\n * **SearchBox** connector provides the logic to build a widget that will let the user search for a query.\n *\n * The connector provides to the rendering: `refine()` to set the query. The behaviour of this function\n * may be impacted by the `queryHook` widget parameter.\n */\ndeclare const connectSearchBox: SearchBoxConnector;\nexport default connectSearchBox;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/search-box/connectSearchBox.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { checkRendering, createDocumentationMessageGenerator, noop } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'search-box',\n  connector: true\n});\n\n/**\n * @typedef {Object} CustomSearchBoxWidgetParams\n * @property {function(string, function(string))} [queryHook = undefined] A function that will be called every time\n * a new value for the query is set. The first parameter is the query and the second is a\n * function to actually trigger the search. The function takes the query as the parameter.\n *\n * This queryHook can be used to debounce the number of searches done from the searchBox.\n */\n\nvar defaultQueryHook = function defaultQueryHook(query, hook) {\n  return hook(query);\n};\n\n/**\n * **SearchBox** connector provides the logic to build a widget that will let the user search for a query.\n *\n * The connector provides to the rendering: `refine()` to set the query. The behaviour of this function\n * may be impacted by the `queryHook` widget parameter.\n */\nvar connectSearchBox = function connectSearchBox(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      _ref$queryHook = _ref.queryHook,\n      queryHook = _ref$queryHook === void 0 ? defaultQueryHook : _ref$queryHook;\n    var _refine;\n    var _clear;\n    return {\n      $$type: 'ais.searchBox',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref2) {\n        var state = _ref2.state;\n        unmountFn();\n        return state.setQueryParameter('query', undefined);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          searchBox: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref3) {\n        var helper = _ref3.helper,\n          instantSearchInstance = _ref3.instantSearchInstance,\n          state = _ref3.state;\n        if (!_refine) {\n          _refine = function _refine(query) {\n            queryHook(query, function (q) {\n              return helper.setQuery(q).search();\n            });\n          };\n          _clear = function _clear() {\n            helper.setQuery('').search();\n          };\n        }\n        return {\n          query: state.query || '',\n          refine: _refine,\n          clear: _clear,\n          widgetParams: widgetParams,\n          isSearchStalled: instantSearchInstance.status === 'stalled'\n        };\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref4) {\n        var searchParameters = _ref4.searchParameters;\n        var query = searchParameters.query || '';\n        if (query === '' || uiState && uiState.query === query) {\n          return uiState;\n        }\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          query: query\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref5) {\n        var uiState = _ref5.uiState;\n        return searchParameters.setQueryParameter('query', uiState.query || '');\n      }\n    };\n  };\n};\nexport default connectSearchBox;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/sort-by/connectSortBy.d.ts",
    "content": "import type { Connector, TransformItems, WidgetRenderState } from '../../types';\n/**\n * The **SortBy** connector provides the logic to build a custom widget that will display a\n * list of indices. With Algolia, this is most commonly used for changing ranking strategy. This allows\n * a user to change how the hits are being sorted.\n */\nexport type SortByItem = {\n    /**\n     * The name of the index to target.\n     */\n    value: string;\n    /**\n     * The label of the index to display.\n     */\n    label: string;\n};\nexport type SortByConnectorParams = {\n    /**\n     * Array of objects defining the different indices to choose from.\n     */\n    items: SortByItem[];\n    /**\n     * Function to transform the items passed to the templates.\n     */\n    transformItems?: TransformItems<SortByItem>;\n};\nexport type SortByRenderState = {\n    /**\n     * The initially selected index.\n     */\n    initialIndex?: string;\n    /**\n     * The currently selected index.\n     */\n    currentRefinement: string;\n    /**\n     * All the available indices\n     */\n    options: SortByItem[];\n    /**\n     * Switches indices and triggers a new search.\n     */\n    refine: (value: string) => void;\n    /**\n     * `true` if the last search contains no result.\n     * @deprecated Use `canRefine` instead.\n     */\n    hasNoResults: boolean;\n    /**\n     * `true` if we can refine.\n     */\n    canRefine: boolean;\n};\nexport type SortByWidgetDescription = {\n    $$type: 'ais.sortBy';\n    renderState: SortByRenderState;\n    indexRenderState: {\n        sortBy: WidgetRenderState<SortByRenderState, SortByConnectorParams>;\n    };\n    indexUiState: {\n        sortBy: string;\n    };\n};\nexport type SortByConnector = Connector<SortByWidgetDescription, SortByConnectorParams>;\ndeclare const connectSortBy: SortByConnector;\nexport default connectSortBy;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/sort-by/connectSortBy.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { checkRendering, createDocumentationMessageGenerator, find, warning, noop } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'sort-by',\n  connector: true\n});\n\n/**\n * The **SortBy** connector provides the logic to build a custom widget that will display a\n * list of indices. With Algolia, this is most commonly used for changing ranking strategy. This allows\n * a user to change how the hits are being sorted.\n */\n\nvar connectSortBy = function connectSortBy(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  var connectorState = {};\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      items = _ref.items,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (x) {\n        return x;\n      } : _ref$transformItems;\n    if (!Array.isArray(items)) {\n      throw new Error(withUsage('The `items` option expects an array of objects.'));\n    }\n    return {\n      $$type: 'ais.sortBy',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        var widgetRenderState = this.getWidgetRenderState(initOptions);\n        var currentIndex = widgetRenderState.currentRefinement;\n        var isCurrentIndexInItems = find(items, function (item) {\n          return item.value === currentIndex;\n        });\n        process.env.NODE_ENV === 'development' ? warning(isCurrentIndexInItems !== undefined, \"The index named \\\"\".concat(currentIndex, \"\\\" is not listed in the `items` of `sortBy`.\")) : void 0;\n        renderFn(_objectSpread(_objectSpread({}, widgetRenderState), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref2) {\n        var state = _ref2.state;\n        unmountFn();\n        return connectorState.initialIndex ? state.setIndex(connectorState.initialIndex) : state;\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          sortBy: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref3) {\n        var results = _ref3.results,\n          helper = _ref3.helper,\n          state = _ref3.state,\n          parent = _ref3.parent;\n        if (!connectorState.initialIndex && parent) {\n          connectorState.initialIndex = parent.getIndexName();\n        }\n        if (!connectorState.setIndex) {\n          connectorState.setIndex = function (indexName) {\n            helper.setIndex(indexName).search();\n          };\n        }\n        var hasNoResults = results ? results.nbHits === 0 : true;\n        return {\n          currentRefinement: state.index,\n          options: transformItems(items, {\n            results: results\n          }),\n          refine: connectorState.setIndex,\n          hasNoResults: hasNoResults,\n          canRefine: !hasNoResults && items.length > 0,\n          widgetParams: widgetParams\n        };\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref4) {\n        var searchParameters = _ref4.searchParameters;\n        var currentIndex = searchParameters.index;\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          sortBy: currentIndex !== connectorState.initialIndex ? currentIndex : undefined\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref5) {\n        var uiState = _ref5.uiState;\n        return searchParameters.setQueryParameter('index', uiState.sortBy || connectorState.initialIndex || searchParameters.index);\n      }\n    };\n  };\n};\nexport default connectSortBy;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/stats/connectStats.d.ts",
    "content": "import type { Connector, WidgetRenderState } from '../../types';\n/**\n * **Stats** connector provides the logic to build a custom widget that will displays\n * search statistics (hits number and processing time).\n */\nexport type StatsRenderState = {\n    /**\n     * The maximum number of hits per page returned by Algolia.\n     */\n    hitsPerPage?: number;\n    /**\n     * The number of hits in the result set.\n     */\n    nbHits: number;\n    /**\n     * The number of sorted hits in the result set (when using Relevant sort).\n     */\n    nbSortedHits?: number;\n    /**\n     * Indicates whether the index is currently using Relevant sort and is displaying only sorted hits.\n     */\n    areHitsSorted: boolean;\n    /**\n     * The number of pages computed for the result set.\n     */\n    nbPages: number;\n    /**\n     * The current page.\n     */\n    page: number;\n    /**\n     * The time taken to compute the results inside the Algolia engine.\n     */\n    processingTimeMS: number;\n    /**\n     * The query used for the current search.\n     */\n    query: string;\n};\nexport type StatsConnectorParams = Record<string, unknown>;\nexport type StatsWidgetDescription = {\n    $$type: 'ais.stats';\n    renderState: StatsRenderState;\n    indexRenderState: {\n        stats: WidgetRenderState<StatsRenderState, StatsConnectorParams>;\n    };\n};\nexport type StatsConnector = Connector<StatsWidgetDescription, StatsConnectorParams>;\ndeclare const connectStats: StatsConnector;\nexport default connectStats;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/stats/connectStats.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { checkRendering, createDocumentationMessageGenerator, noop } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'stats',\n  connector: true\n});\n\n/**\n * **Stats** connector provides the logic to build a custom widget that will displays\n * search statistics (hits number and processing time).\n */\n\nvar connectStats = function connectStats(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    return {\n      $$type: 'ais.stats',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose() {\n        unmountFn();\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          stats: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref) {\n        var results = _ref.results,\n          state = _ref.state;\n        if (!results) {\n          return {\n            hitsPerPage: state.hitsPerPage,\n            nbHits: 0,\n            nbSortedHits: undefined,\n            areHitsSorted: false,\n            nbPages: 0,\n            page: state.page || 0,\n            processingTimeMS: -1,\n            query: state.query || '',\n            widgetParams: widgetParams\n          };\n        }\n        return {\n          hitsPerPage: results.hitsPerPage,\n          nbHits: results.nbHits,\n          nbSortedHits: results.nbSortedHits,\n          areHitsSorted: typeof results.appliedRelevancyStrictness !== 'undefined' && results.appliedRelevancyStrictness > 0 && results.nbSortedHits !== results.nbHits,\n          nbPages: results.nbPages,\n          page: results.page,\n          processingTimeMS: results.processingTimeMS,\n          query: results.query,\n          widgetParams: widgetParams\n        };\n      }\n    };\n  };\n};\nexport default connectStats;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/toggle-refinement/connectToggleRefinement.d.ts",
    "content": "import type { Connector, CreateURL, WidgetRenderState } from '../../types';\ntype BuiltInSendEventForToggle = (eventType: string, isRefined: boolean, eventName?: string) => void;\ntype CustomSendEventForToggle = (customPayload: any) => void;\nexport type SendEventForToggle = BuiltInSendEventForToggle & CustomSendEventForToggle;\nexport type ToggleRefinementValue = {\n    /**\n     * Whether this option is enabled.\n     */\n    isRefined: boolean;\n    /**\n     * Number of result if this option is toggled.\n     */\n    count: number | null;\n};\nexport type ToggleRefinementConnectorParams = {\n    /**\n     * Name of the attribute for faceting (e.g., \"free_shipping\").\n     */\n    attribute: string;\n    /**\n     * Value to filter on when toggled.\n     * @default \"true\"\n     */\n    on?: FacetValue | FacetValue[];\n    /**\n     * Value to filter on when not toggled.\n     */\n    off?: FacetValue | FacetValue[];\n};\ntype FacetValue = string | boolean | number;\nexport type ToggleRefinementRenderState = {\n    /** The current toggle value */\n    value: {\n        /**\n         * The attribute name of this toggle.\n         */\n        name: string;\n        /**\n         * Whether the current option is \"on\" (true) or \"off\" (false)\n         */\n        isRefined: boolean;\n        /**\n         * Number of results if this option is toggled.\n         */\n        count: number | null;\n        /**\n         * Information about the \"on\" toggle.\n         */\n        onFacetValue: ToggleRefinementValue;\n        /**\n         * Information about the \"off\" toggle.\n         */\n        offFacetValue: ToggleRefinementValue;\n    };\n    /**\n     * Creates an URL for the next state.\n     */\n    createURL: CreateURL<void>;\n    /**\n     * Send a \"Facet Clicked\" Insights event.\n     */\n    sendEvent: SendEventForToggle;\n    /**\n     * Indicates if search state can be refined.\n     */\n    canRefine: boolean;\n    /**\n     * Updates to the next state by applying the toggle refinement.\n     */\n    refine: (value?: {\n        isRefined: boolean;\n    }) => void;\n};\nexport type ToggleRefinementWidgetDescription = {\n    $$type: 'ais.toggleRefinement';\n    renderState: ToggleRefinementRenderState;\n    indexRenderState: {\n        toggleRefinement: {\n            [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;\n        };\n    };\n    indexUiState: {\n        toggle: {\n            [attribute: string]: boolean;\n        };\n    };\n};\nexport type ToggleRefinementConnector = Connector<ToggleRefinementWidgetDescription, ToggleRefinementConnectorParams>;\n/**\n * **Toggle** connector provides the logic to build a custom widget that will provide\n * an on/off filtering feature based on an attribute value or values.\n *\n * Two modes are implemented in the custom widget:\n *  - with or without the value filtered\n *  - switch between two values.\n */\ndeclare const connectToggleRefinement: ToggleRefinementConnector;\nexport default connectToggleRefinement;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/toggle-refinement/connectToggleRefinement.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nimport { checkRendering, escapeFacetValue, createDocumentationMessageGenerator, find, noop, toArray, warning } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'toggle-refinement',\n  connector: true\n});\nvar $$type = 'ais.toggleRefinement';\nvar createSendEvent = function createSendEvent(_ref) {\n  var instantSearchInstance = _ref.instantSearchInstance,\n    helper = _ref.helper,\n    attribute = _ref.attribute,\n    on = _ref.on;\n  var sendEventForToggle = function sendEventForToggle() {\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    if (args.length === 1) {\n      instantSearchInstance.sendEventToInsights(args[0]);\n      return;\n    }\n    var isRefined = args[1],\n      _args$ = args[2],\n      eventName = _args$ === void 0 ? 'Filter Applied' : _args$;\n    var _args$0$split = args[0].split(':'),\n      _args$0$split2 = _slicedToArray(_args$0$split, 2),\n      eventType = _args$0$split2[0],\n      eventModifier = _args$0$split2[1];\n    if (eventType !== 'click' || on === undefined) {\n      return;\n    }\n\n    // only send an event when the refinement gets applied,\n    // not when it gets removed\n    if (!isRefined) {\n      var _helper$lastResults;\n      instantSearchInstance.sendEventToInsights({\n        insightsMethod: 'clickedFilters',\n        widgetType: $$type,\n        eventType: eventType,\n        eventModifier: eventModifier,\n        payload: {\n          eventName: eventName,\n          index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,\n          filters: on.map(function (value) {\n            return \"\".concat(attribute, \":\").concat(value);\n          })\n        },\n        attribute: attribute\n      });\n    }\n  };\n  return sendEventForToggle;\n};\n/**\n * **Toggle** connector provides the logic to build a custom widget that will provide\n * an on/off filtering feature based on an attribute value or values.\n *\n * Two modes are implemented in the custom widget:\n *  - with or without the value filtered\n *  - switch between two values.\n */\nvar connectToggleRefinement = function connectToggleRefinement(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref2 = widgetParams || {},\n      attribute = _ref2.attribute,\n      _ref2$on = _ref2.on,\n      userOn = _ref2$on === void 0 ? true : _ref2$on,\n      userOff = _ref2.off;\n    if (!attribute) {\n      throw new Error(withUsage('The `attribute` option is required.'));\n    }\n    var hasAnOffValue = userOff !== undefined;\n    // even though facet values can be numbers and boolean,\n    // the helper methods only accept string in the type\n    var on = toArray(userOn).map(escapeFacetValue);\n    var off = hasAnOffValue ? toArray(userOff).map(escapeFacetValue) : undefined;\n    var sendEvent;\n    var toggleRefinementFactory = function toggleRefinementFactory(helper) {\n      return function () {\n        var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n            isRefined: false\n          },\n          isRefined = _ref3.isRefined;\n        if (!isRefined) {\n          sendEvent('click:internal', isRefined);\n          if (hasAnOffValue) {\n            off.forEach(function (v) {\n              return helper.removeDisjunctiveFacetRefinement(attribute, v);\n            });\n          }\n          on.forEach(function (v) {\n            return helper.addDisjunctiveFacetRefinement(attribute, v);\n          });\n        } else {\n          on.forEach(function (v) {\n            return helper.removeDisjunctiveFacetRefinement(attribute, v);\n          });\n          if (hasAnOffValue) {\n            off.forEach(function (v) {\n              return helper.addDisjunctiveFacetRefinement(attribute, v);\n            });\n          }\n        }\n        helper.search();\n      };\n    };\n    var connectorState = {\n      createURLFactory: function createURLFactory(isRefined, _ref4) {\n        var state = _ref4.state,\n          createURL = _ref4.createURL,\n          getWidgetUiState = _ref4.getWidgetUiState,\n          helper = _ref4.helper;\n        return function () {\n          state = state.resetPage();\n          var valuesToRemove = isRefined ? on : off;\n          if (valuesToRemove) {\n            valuesToRemove.forEach(function (v) {\n              state = state.removeDisjunctiveFacetRefinement(attribute, v);\n            });\n          }\n          var valuesToAdd = isRefined ? off : on;\n          if (valuesToAdd) {\n            valuesToAdd.forEach(function (v) {\n              state = state.addDisjunctiveFacetRefinement(attribute, v);\n            });\n          }\n          return createURL(function (uiState) {\n            return getWidgetUiState(uiState, {\n              searchParameters: state,\n              helper: helper\n            });\n          });\n        };\n      }\n    };\n    return {\n      $$type: $$type,\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      dispose: function dispose(_ref5) {\n        var state = _ref5.state;\n        unmountFn();\n        return state.removeDisjunctiveFacet(attribute);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          toggleRefinement: _objectSpread(_objectSpread({}, renderState.toggleRefinement), {}, _defineProperty({}, attribute, this.getWidgetRenderState(renderOptions)))\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref6) {\n        var state = _ref6.state,\n          helper = _ref6.helper,\n          results = _ref6.results,\n          createURL = _ref6.createURL,\n          instantSearchInstance = _ref6.instantSearchInstance;\n        var isRefined = results ? on.every(function (v) {\n          return state.isDisjunctiveFacetRefined(attribute, v);\n        }) : on.every(function (v) {\n          return state.isDisjunctiveFacetRefined(attribute, v);\n        });\n        var onFacetValue = {\n          isRefined: isRefined,\n          count: 0\n        };\n        var offFacetValue = {\n          isRefined: hasAnOffValue && !isRefined,\n          count: 0\n        };\n        if (results) {\n          var offValue = toArray(off || false);\n          var allFacetValues = results.getFacetValues(attribute, {}) || [];\n          var onData = on.map(function (v) {\n            return find(allFacetValues, function (_ref7) {\n              var escapedValue = _ref7.escapedValue;\n              return escapedValue === escapeFacetValue(String(v));\n            });\n          }).filter(function (v) {\n            return v !== undefined;\n          });\n          var offData = hasAnOffValue ? offValue.map(function (v) {\n            return find(allFacetValues, function (_ref8) {\n              var escapedValue = _ref8.escapedValue;\n              return escapedValue === escapeFacetValue(String(v));\n            });\n          }).filter(function (v) {\n            return v !== undefined;\n          }) : [];\n          onFacetValue = {\n            isRefined: onData.length ? onData.every(function (v) {\n              return v.isRefined;\n            }) : false,\n            count: onData.reduce(function (acc, v) {\n              return acc + v.count;\n            }, 0) || null\n          };\n          offFacetValue = {\n            isRefined: offData.length ? offData.every(function (v) {\n              return v.isRefined;\n            }) : false,\n            count: offData.reduce(function (acc, v) {\n              return acc + v.count;\n            }, 0) || allFacetValues.reduce(function (total, _ref9) {\n              var count = _ref9.count;\n              return total + count;\n            }, 0)\n          };\n        }\n        if (!sendEvent) {\n          sendEvent = createSendEvent({\n            instantSearchInstance: instantSearchInstance,\n            attribute: attribute,\n            on: on,\n            helper: helper\n          });\n        }\n        var nextRefinement = isRefined ? offFacetValue : onFacetValue;\n        return {\n          value: {\n            name: attribute,\n            isRefined: isRefined,\n            count: results ? nextRefinement.count : null,\n            onFacetValue: onFacetValue,\n            offFacetValue: offFacetValue\n          },\n          createURL: connectorState.createURLFactory(isRefined, {\n            state: state,\n            createURL: createURL,\n            helper: helper,\n            getWidgetUiState: this.getWidgetUiState\n          }),\n          sendEvent: sendEvent,\n          canRefine: Boolean(results ? nextRefinement.count : null),\n          refine: toggleRefinementFactory(helper),\n          widgetParams: widgetParams\n        };\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref10) {\n        var searchParameters = _ref10.searchParameters;\n        var isRefined = on && on.every(function (v) {\n          return searchParameters.isDisjunctiveFacetRefined(attribute, v);\n        });\n        if (!isRefined) {\n          var _uiState$toggle;\n          // This needs to be done in the case `uiState` comes from `createURL`\n          (_uiState$toggle = uiState.toggle) === null || _uiState$toggle === void 0 ? true : delete _uiState$toggle[attribute];\n          return uiState;\n        }\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          toggle: _objectSpread(_objectSpread({}, uiState.toggle), {}, _defineProperty({}, attribute, isRefined))\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref11) {\n        var uiState = _ref11.uiState;\n        if (searchParameters.isHierarchicalFacet(attribute) || searchParameters.isConjunctiveFacet(attribute)) {\n          process.env.NODE_ENV === 'development' ? warning(false, \"ToggleRefinement: Attribute \\\"\".concat(attribute, \"\\\" is already used by another widget of a different type.\\nAs this is not supported, please make sure to remove this other widget or this ToggleRefinement widget will not work at all.\")) : void 0;\n          return searchParameters;\n        }\n        var withFacetConfiguration = searchParameters.addDisjunctiveFacet(attribute).removeDisjunctiveFacetRefinement(attribute);\n        var isRefined = Boolean(uiState.toggle && uiState.toggle[attribute]);\n        if (isRefined) {\n          if (on) {\n            on.forEach(function (v) {\n              withFacetConfiguration = withFacetConfiguration.addDisjunctiveFacetRefinement(attribute, v);\n            });\n          }\n          return withFacetConfiguration;\n        }\n\n        // It's not refined with an `off` value\n        if (hasAnOffValue) {\n          if (off) {\n            off.forEach(function (v) {\n              withFacetConfiguration = withFacetConfiguration.addDisjunctiveFacetRefinement(attribute, v);\n            });\n          }\n          return withFacetConfiguration;\n        }\n\n        // It's not refined without an `off` value\n        return withFacetConfiguration.setQueryParameters({\n          disjunctiveFacetsRefinements: _objectSpread(_objectSpread({}, searchParameters.disjunctiveFacetsRefinements), {}, _defineProperty({}, attribute, []))\n        });\n      }\n    };\n  };\n};\nexport default connectToggleRefinement;"
  },
  {
    "path": "js/instantsearch.js/es/connectors/toggle-refinement/types.d.ts",
    "content": "export type { \n/** @deprecated import from connectToggleRefinement directly */\nToggleRefinementConnector, \n/** @deprecated import from connectToggleRefinement directly */\nToggleRefinementWidgetDescription, } from './connectToggleRefinement';\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/toggle-refinement/types.js",
    "content": "export {};"
  },
  {
    "path": "js/instantsearch.js/es/connectors/trending-items/connectTrendingItems.d.ts",
    "content": "import type { SendEventForHits } from '../../lib/utils';\nimport type { Connector, TransformItems, BaseHit, Renderer, Unmounter, UnknownWidgetParams, RecommendResponse, Hit, AlgoliaHit } from '../../types';\nimport type { PlainSearchParameters } from 'algoliasearch-helper';\nexport type TrendingItemsRenderState<THit extends NonNullable<object> = BaseHit> = {\n    /**\n     * The matched recommendations from the Algolia API.\n     */\n    items: Array<Hit<THit>>;\n    /**\n     * Sends an event to the Insights middleware.\n     */\n    sendEvent: SendEventForHits;\n};\nexport type TrendingItemsConnectorParams<THit extends NonNullable<object> = BaseHit> = ({\n    /**\n     * The facet attribute to get recommendations for.\n     */\n    facetName: string;\n    /**\n     * The facet value to get recommendations for.\n     */\n    facetValue: string;\n} | {\n    facetName?: string;\n    facetValue?: string;\n}) & {\n    /**\n     * The number of recommendations to retrieve.\n     */\n    limit?: number;\n    /**\n     * The threshold for the recommendations confidence score (between 0 and 100).\n     */\n    threshold?: number;\n    /**\n     * List of search parameters to send.\n     */\n    fallbackParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\n    /**\n     * List of search parameters to send.\n     */\n    queryParameters?: Omit<PlainSearchParameters, 'page' | 'hitsPerPage' | 'offset' | 'length'>;\n    /**\n     * Whether to escape HTML tags from items string values.\n     *\n     * @default true\n     */\n    escapeHTML?: boolean;\n    /**\n     * Function to transform the items passed to the templates.\n     */\n    transformItems?: TransformItems<Hit<THit>, {\n        results: RecommendResponse<AlgoliaHit<THit>>;\n    }>;\n};\nexport type TrendingItemsWidgetDescription<THit extends NonNullable<object> = BaseHit> = {\n    $$type: 'ais.trendingItems';\n    renderState: TrendingItemsRenderState<THit>;\n};\nexport type TrendingItemsConnector<THit extends NonNullable<object> = BaseHit> = Connector<TrendingItemsWidgetDescription<THit>, TrendingItemsConnectorParams<THit>>;\ndeclare const _default: <TWidgetParams extends UnknownWidgetParams>(renderFn: Renderer<TrendingItemsRenderState, TWidgetParams & TrendingItemsConnectorParams>, unmountFn?: Unmounter) => <THit extends NonNullable<object> = BaseHit>(widgetParams: TWidgetParams & TrendingItemsConnectorParams<THit>) => {\n    dependsOn: \"recommend\";\n    $$type: \"ais.trendingItems\";\n    init(initOptions: import(\"../../types\").InitOptions): void;\n    render(renderOptions: import(\"../../types\").RenderOptions): void;\n    getRenderState(renderState: {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../answers/connectAnswers\").AnswersRenderState, import(\"../answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../configure/connectConfigure\").ConfigureRenderState, import(\"../configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<import(\"../hits/connectHits\").HitsRenderState<BaseHit>, import(\"../hits/connectHits\").HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../menu/connectMenu\").MenuRenderState, import(\"../menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../pagination/connectPagination\").PaginationRenderState, import(\"../pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../range/connectRange\").RangeRenderState, import(\"../range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../search-box/connectSearchBox\").SearchBoxRenderState, import(\"../search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../sort-by/connectSortBy\").SortByRenderState, import(\"../sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../stats/connectStats\").StatsRenderState, import(\"../stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../../widgets/analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../../widgets/places/places\").PlacesWidgetParams> | undefined;\n    }): {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../answers/connectAnswers\").AnswersRenderState, import(\"../answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../configure/connectConfigure\").ConfigureRenderState, import(\"../configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<import(\"../hits/connectHits\").HitsRenderState<BaseHit>, import(\"../hits/connectHits\").HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../menu/connectMenu\").MenuRenderState, import(\"../menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../pagination/connectPagination\").PaginationRenderState, import(\"../pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../range/connectRange\").RangeRenderState, import(\"../range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../search-box/connectSearchBox\").SearchBoxRenderState, import(\"../search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../sort-by/connectSortBy\").SortByRenderState, import(\"../sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../stats/connectStats\").StatsRenderState, import(\"../stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../../widgets/analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../../widgets/places/places\").PlacesWidgetParams> | undefined;\n    };\n    getWidgetRenderState({ results, helper, instantSearchInstance }: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions | ({\n        instantSearchInstance: import(\"../../types\").InstantSearch;\n        parent: import(\"../../types\").IndexWidget;\n        templatesConfig: Record<string, unknown>;\n        scopedResults: import(\"../../types\").ScopedResult[];\n        state: import(\"algoliasearch-helper\").SearchParameters;\n        renderState: import(\"../../types\").IndexRenderState;\n        helper: import(\"algoliasearch-helper\").AlgoliaSearchHelper;\n        searchMetadata: {\n            isSearchStalled: boolean;\n        };\n        status: import(\"../../types\").InstantSearch[\"status\"];\n        error: import(\"../../types\").InstantSearch[\"error\"];\n        createURL: (nextState: import(\"algoliasearch-helper\").SearchParameters | ((state: import(\"../../types\").IndexUiState) => import(\"../../types\").IndexUiState)) => string;\n    } & {\n        results: RecommendResponse<any>;\n    })): {\n        items: Hit<THit>[];\n        widgetParams: TWidgetParams & TrendingItemsConnectorParams<THit>;\n        sendEvent: SendEventForHits;\n    };\n    dispose({ recommendState }: import(\"../../types\").DisposeOptions): import(\"algoliasearch-helper\").RecommendParameters;\n    getWidgetParameters(state: import(\"algoliasearch-helper\").RecommendParameters): import(\"algoliasearch-helper\").RecommendParameters;\n};\nexport default _default;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/trending-items/connectTrendingItems.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { createDocumentationMessageGenerator, checkRendering, noop, escapeHits, TAG_PLACEHOLDER, getObjectType, createSendEventForHits, addAbsolutePosition, addQueryID } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'trending-items',\n  connector: true\n});\nexport default (function connectTrendingItems(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _ref = widgetParams || {},\n      facetName = _ref.facetName,\n      facetValue = _ref.facetValue,\n      limit = _ref.limit,\n      threshold = _ref.threshold,\n      fallbackParameters = _ref.fallbackParameters,\n      queryParameters = _ref.queryParameters,\n      _ref$escapeHTML = _ref.escapeHTML,\n      escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,\n      _ref$transformItems = _ref.transformItems,\n      transformItems = _ref$transformItems === void 0 ? function (items) {\n        return items;\n      } : _ref$transformItems;\n    if (facetName && !facetValue || !facetName && facetValue) {\n      throw new Error(withUsage(\"When you provide facetName (received type \".concat(getObjectType(facetName), \"), you must also provide facetValue (received type \").concat(getObjectType(facetValue), \").\")));\n    }\n    var sendEvent;\n    return {\n      dependsOn: 'recommend',\n      $$type: 'ais.trendingItems',\n      init: function init(initOptions) {\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: initOptions.instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var renderState = this.getWidgetRenderState(renderOptions);\n        renderFn(_objectSpread(_objectSpread({}, renderState), {}, {\n          instantSearchInstance: renderOptions.instantSearchInstance\n        }), false);\n      },\n      getRenderState: function getRenderState(renderState) {\n        return renderState;\n      },\n      getWidgetRenderState: function getWidgetRenderState(_ref2) {\n        var results = _ref2.results,\n          helper = _ref2.helper,\n          instantSearchInstance = _ref2.instantSearchInstance;\n        if (!sendEvent) {\n          sendEvent = createSendEventForHits({\n            instantSearchInstance: instantSearchInstance,\n            helper: helper,\n            widgetType: this.$$type\n          });\n        }\n        if (results === null || results === undefined) {\n          return {\n            items: [],\n            widgetParams: widgetParams,\n            sendEvent: sendEvent\n          };\n        }\n        if (escapeHTML && results.hits.length > 0) {\n          results.hits = escapeHits(results.hits);\n        }\n        var itemsWithAbsolutePosition = addAbsolutePosition(results.hits, 0, 1);\n        var itemsWithAbsolutePositionAndQueryID = addQueryID(itemsWithAbsolutePosition, results.queryID);\n        var transformedItems = transformItems(itemsWithAbsolutePositionAndQueryID, {\n          results: results\n        });\n        return {\n          items: transformedItems,\n          widgetParams: widgetParams,\n          sendEvent: sendEvent\n        };\n      },\n      dispose: function dispose(_ref3) {\n        var recommendState = _ref3.recommendState;\n        unmountFn();\n        return recommendState.removeParams(this.$$id);\n      },\n      getWidgetParameters: function getWidgetParameters(state) {\n        return state.removeParams(this.$$id).addTrendingItems({\n          facetName: facetName,\n          facetValue: facetValue,\n          maxRecommendations: limit,\n          threshold: threshold,\n          fallbackParameters: _objectSpread(_objectSpread({}, fallbackParameters), escapeHTML ? TAG_PLACEHOLDER : {}),\n          queryParameters: _objectSpread(_objectSpread({}, queryParameters), escapeHTML ? TAG_PLACEHOLDER : {}),\n          $$id: this.$$id\n        });\n      }\n    };\n  };\n});"
  },
  {
    "path": "js/instantsearch.js/es/connectors/voice-search/connectVoiceSearch.d.ts",
    "content": "import type { CreateVoiceSearchHelper, VoiceListeningState } from '../../lib/voiceSearchHelper/types';\nimport type { Connector, WidgetRenderState } from '../../types';\nimport type { PlainSearchParameters } from 'algoliasearch-helper';\nexport type VoiceSearchConnectorParams = {\n    searchAsYouSpeak?: boolean;\n    language?: string;\n    additionalQueryParameters?: (params: {\n        query: string;\n    }) => PlainSearchParameters | void;\n    createVoiceSearchHelper?: CreateVoiceSearchHelper;\n};\nexport type VoiceSearchRenderState = {\n    isBrowserSupported: boolean;\n    isListening: boolean;\n    toggleListening: () => void;\n    voiceListeningState: VoiceListeningState;\n};\nexport type VoiceSearchWidgetDescription = {\n    $$type: 'ais.voiceSearch';\n    renderState: VoiceSearchRenderState;\n    indexRenderState: {\n        voiceSearch: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams>;\n    };\n    indexUiState: {\n        query: string;\n    };\n};\nexport type VoiceSearchConnector = Connector<VoiceSearchWidgetDescription, VoiceSearchConnectorParams>;\ndeclare const connectVoiceSearch: VoiceSearchConnector;\nexport default connectVoiceSearch;\n"
  },
  {
    "path": "js/instantsearch.js/es/connectors/voice-search/connectVoiceSearch.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { checkRendering, createDocumentationMessageGenerator, noop } from \"../../lib/utils/index.js\";\nimport builtInCreateVoiceSearchHelper from \"../../lib/voiceSearchHelper/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'voice-search',\n  connector: true\n});\nvar connectVoiceSearch = function connectVoiceSearch(renderFn) {\n  var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n  checkRendering(renderFn, withUsage());\n  return function (widgetParams) {\n    var _widgetParams$searchA = widgetParams.searchAsYouSpeak,\n      searchAsYouSpeak = _widgetParams$searchA === void 0 ? false : _widgetParams$searchA,\n      language = widgetParams.language,\n      additionalQueryParameters = widgetParams.additionalQueryParameters,\n      _widgetParams$createV = widgetParams.createVoiceSearchHelper,\n      createVoiceSearchHelper = _widgetParams$createV === void 0 ? builtInCreateVoiceSearchHelper : _widgetParams$createV;\n    return {\n      $$type: 'ais.voiceSearch',\n      init: function init(initOptions) {\n        var instantSearchInstance = initOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(initOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), true);\n      },\n      render: function render(renderOptions) {\n        var instantSearchInstance = renderOptions.instantSearchInstance;\n        renderFn(_objectSpread(_objectSpread({}, this.getWidgetRenderState(renderOptions)), {}, {\n          instantSearchInstance: instantSearchInstance\n        }), false);\n      },\n      getRenderState: function getRenderState(renderState, renderOptions) {\n        return _objectSpread(_objectSpread({}, renderState), {}, {\n          voiceSearch: this.getWidgetRenderState(renderOptions)\n        });\n      },\n      getWidgetRenderState: function getWidgetRenderState(renderOptions) {\n        var _this = this;\n        var helper = renderOptions.helper,\n          instantSearchInstance = renderOptions.instantSearchInstance;\n        if (!this._refine) {\n          this._refine = function (query) {\n            if (query !== helper.state.query) {\n              var queryLanguages = language ? [language.split('-')[0]] : undefined;\n              // @ts-ignore queryLanguages is allowed to be a string, not just an array\n              helper.setQueryParameter('queryLanguages', queryLanguages);\n              if (typeof additionalQueryParameters === 'function') {\n                helper.setState(helper.state.setQueryParameters(_objectSpread({\n                  ignorePlurals: true,\n                  removeStopWords: true,\n                  // @ts-ignore optionalWords is allowed to be a string too\n                  optionalWords: query\n                }, additionalQueryParameters({\n                  query: query\n                }))));\n              }\n              helper.setQuery(query).search();\n            }\n          };\n        }\n        if (!this._voiceSearchHelper) {\n          this._voiceSearchHelper = createVoiceSearchHelper({\n            searchAsYouSpeak: searchAsYouSpeak,\n            language: language,\n            onQueryChange: function onQueryChange(query) {\n              return _this._refine(query);\n            },\n            onStateChange: function onStateChange() {\n              renderFn(_objectSpread(_objectSpread({}, _this.getWidgetRenderState(renderOptions)), {}, {\n                instantSearchInstance: instantSearchInstance\n              }), false);\n            }\n          });\n        }\n        var _voiceSearchHelper = this._voiceSearchHelper,\n          isBrowserSupported = _voiceSearchHelper.isBrowserSupported,\n          isListening = _voiceSearchHelper.isListening,\n          startListening = _voiceSearchHelper.startListening,\n          stopListening = _voiceSearchHelper.stopListening,\n          getState = _voiceSearchHelper.getState;\n        return {\n          isBrowserSupported: isBrowserSupported(),\n          isListening: isListening(),\n          toggleListening: function toggleListening() {\n            if (!isBrowserSupported()) {\n              return;\n            }\n            if (isListening()) {\n              stopListening();\n            } else {\n              startListening();\n            }\n          },\n          voiceListeningState: getState(),\n          widgetParams: widgetParams\n        };\n      },\n      dispose: function dispose(_ref) {\n        var state = _ref.state;\n        this._voiceSearchHelper.dispose();\n        unmountFn();\n        var newState = state;\n        if (typeof additionalQueryParameters === 'function') {\n          var additional = additionalQueryParameters({\n            query: ''\n          });\n          var toReset = additional ? Object.keys(additional).reduce(function (acc, current) {\n            // @ts-ignore search parameters is typed as readonly in v4\n            acc[current] = undefined;\n            return acc;\n          }, {}) : {};\n          newState = state.setQueryParameters(_objectSpread({\n            // @ts-ignore (queryLanguages is not added to algoliasearch v3)\n            queryLanguages: undefined,\n            ignorePlurals: undefined,\n            removeStopWords: undefined,\n            optionalWords: undefined\n          }, toReset));\n        }\n        return newState.setQueryParameter('query', undefined);\n      },\n      getWidgetUiState: function getWidgetUiState(uiState, _ref2) {\n        var searchParameters = _ref2.searchParameters;\n        var query = searchParameters.query || '';\n        if (!query) {\n          return uiState;\n        }\n        return _objectSpread(_objectSpread({}, uiState), {}, {\n          query: query\n        });\n      },\n      getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref3) {\n        var uiState = _ref3.uiState;\n        return searchParameters.setQueryParameter('query', uiState.query || '');\n      }\n    };\n  };\n};\nexport default connectVoiceSearch;"
  },
  {
    "path": "js/instantsearch.js/es/helpers/components/Highlight.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { HighlightProps as HighlightUiComponentProps } from '../../components/Highlight/Highlight';\nimport type { BaseHit, Hit, PartialKeys } from '../../types';\nexport type HighlightProps<THit extends Hit<BaseHit>> = {\n    hit: THit;\n    attribute: keyof THit | string[];\n    cssClasses?: HighlightUiComponentProps['classNames'];\n} & PartialKeys<Omit<HighlightUiComponentProps, 'parts' | 'classNames'>, 'highlightedTagName' | 'nonHighlightedTagName' | 'separator'>;\nexport declare function Highlight<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: HighlightProps<THit>): h.JSX.Element;\n"
  },
  {
    "path": "js/instantsearch.js/es/helpers/components/Highlight.js",
    "content": "var _excluded = [\"hit\", \"attribute\", \"cssClasses\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport { h } from 'preact';\nimport { Highlight as HighlightUiComponent } from \"../../components/Highlight/Highlight.js\";\nimport { getPropertyByPath, unescape, toArray, warning, getHighlightedParts } from \"../../lib/utils/index.js\";\nexport function Highlight(_ref) {\n  var hit = _ref.hit,\n    attribute = _ref.attribute,\n    cssClasses = _ref.cssClasses,\n    props = _objectWithoutProperties(_ref, _excluded);\n  var property = getPropertyByPath(hit._highlightResult, attribute) || [];\n  var properties = toArray(property);\n  process.env.NODE_ENV === 'development' ? warning(Boolean(properties.length), \"Could not enable highlight for \\\"\".concat(attribute.toString(), \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\\n\\nSee: https://alg.li/highlighting\\n\")) : void 0;\n  var parts = properties.map(function (_ref2) {\n    var value = _ref2.value;\n    return getHighlightedParts(unescape(value || ''));\n  });\n  return h(HighlightUiComponent, _extends({}, props, {\n    parts: parts,\n    classNames: cssClasses\n  }));\n}"
  },
  {
    "path": "js/instantsearch.js/es/helpers/components/ReverseHighlight.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { ReverseHighlightProps as ReverseHighlightUiComponentProps } from '../../components/ReverseHighlight/ReverseHighlight';\nimport type { BaseHit, Hit, PartialKeys } from '../../types';\nexport type ReverseHighlightProps<THit extends Hit<BaseHit>> = {\n    hit: THit;\n    attribute: keyof THit | string[];\n    cssClasses?: ReverseHighlightUiComponentProps['classNames'];\n} & PartialKeys<Omit<ReverseHighlightUiComponentProps, 'parts' | 'classNames'>, 'highlightedTagName' | 'nonHighlightedTagName' | 'separator'>;\nexport declare function ReverseHighlight<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: ReverseHighlightProps<THit>): h.JSX.Element;\n"
  },
  {
    "path": "js/instantsearch.js/es/helpers/components/ReverseHighlight.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _excluded = [\"hit\", \"attribute\", \"cssClasses\"],\n  _excluded2 = [\"isHighlighted\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport { h } from 'preact';\nimport { ReverseHighlight as ReverseHighlightUiComponent } from \"../../components/ReverseHighlight/ReverseHighlight.js\";\nimport { getPropertyByPath, unescape, toArray, warning, getHighlightedParts } from \"../../lib/utils/index.js\";\nexport function ReverseHighlight(_ref) {\n  var hit = _ref.hit,\n    attribute = _ref.attribute,\n    cssClasses = _ref.cssClasses,\n    props = _objectWithoutProperties(_ref, _excluded);\n  var property = getPropertyByPath(hit._highlightResult, attribute) || [];\n  var properties = toArray(property);\n  process.env.NODE_ENV === 'development' ? warning(Boolean(properties.length), \"Could not enable highlight for \\\"\".concat(attribute.toString(), \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\\n\\nSee: https://alg.li/highlighting\\n\")) : void 0;\n  var parts = properties.map(function (_ref2) {\n    var value = _ref2.value;\n    return getHighlightedParts(unescape(value || '')).map(function (_ref3) {\n      var isHighlighted = _ref3.isHighlighted,\n        rest = _objectWithoutProperties(_ref3, _excluded2);\n      return _objectSpread(_objectSpread({}, rest), {}, {\n        isHighlighted: !isHighlighted\n      });\n    });\n  });\n  return h(ReverseHighlightUiComponent, _extends({}, props, {\n    parts: parts,\n    classNames: cssClasses\n  }));\n}"
  },
  {
    "path": "js/instantsearch.js/es/helpers/components/ReverseSnippet.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { ReverseSnippetProps as ReverseSnippetUiComponentProps } from '../../components/ReverseSnippet/ReverseSnippet';\nimport type { BaseHit, Hit, PartialKeys } from '../../types';\nexport type ReverseSnippetProps<THit extends Hit<BaseHit>> = {\n    hit: THit;\n    attribute: keyof THit | string[];\n    cssClasses?: ReverseSnippetUiComponentProps['classNames'];\n} & PartialKeys<Omit<ReverseSnippetUiComponentProps, 'parts' | 'classNames'>, 'highlightedTagName' | 'nonHighlightedTagName' | 'separator'>;\nexport declare function ReverseSnippet<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: ReverseSnippetProps<THit>): h.JSX.Element;\n"
  },
  {
    "path": "js/instantsearch.js/es/helpers/components/ReverseSnippet.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _excluded = [\"hit\", \"attribute\", \"cssClasses\"],\n  _excluded2 = [\"isHighlighted\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport { h } from 'preact';\nimport { ReverseSnippet as ReverseSnippetUiComponent } from \"../../components/ReverseSnippet/ReverseSnippet.js\";\nimport { getPropertyByPath, unescape, toArray, warning, getHighlightedParts } from \"../../lib/utils/index.js\";\nexport function ReverseSnippet(_ref) {\n  var hit = _ref.hit,\n    attribute = _ref.attribute,\n    cssClasses = _ref.cssClasses,\n    props = _objectWithoutProperties(_ref, _excluded);\n  var property = getPropertyByPath(hit._snippetResult, attribute) || [];\n  var properties = toArray(property);\n  process.env.NODE_ENV === 'development' ? warning(Boolean(properties.length), \"Could not enable snippet for \\\"\".concat(attribute.toString(), \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\\n\\nSee: https://alg.li/highlighting\\n\")) : void 0;\n  var parts = properties.map(function (_ref2) {\n    var value = _ref2.value;\n    return getHighlightedParts(unescape(value || '')).map(function (_ref3) {\n      var isHighlighted = _ref3.isHighlighted,\n        rest = _objectWithoutProperties(_ref3, _excluded2);\n      return _objectSpread(_objectSpread({}, rest), {}, {\n        isHighlighted: !isHighlighted\n      });\n    });\n  });\n  return h(ReverseSnippetUiComponent, _extends({}, props, {\n    parts: parts,\n    classNames: cssClasses\n  }));\n}"
  },
  {
    "path": "js/instantsearch.js/es/helpers/components/Snippet.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { SnippetProps as SnippetUiComponentProps } from '../../components/Snippet/Snippet';\nimport type { BaseHit, Hit, PartialKeys } from '../../types';\nexport type SnippetProps<THit extends Hit<BaseHit>> = {\n    hit: THit;\n    attribute: keyof THit | string[];\n    cssClasses?: SnippetUiComponentProps['classNames'];\n} & PartialKeys<Omit<SnippetUiComponentProps, 'parts' | 'classNames'>, 'highlightedTagName' | 'nonHighlightedTagName' | 'separator'>;\nexport declare function Snippet<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: SnippetProps<THit>): h.JSX.Element;\n"
  },
  {
    "path": "js/instantsearch.js/es/helpers/components/Snippet.js",
    "content": "var _excluded = [\"hit\", \"attribute\", \"cssClasses\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport { h } from 'preact';\nimport { Snippet as SnippetUiComponent } from \"../../components/Snippet/Snippet.js\";\nimport { getPropertyByPath, unescape, toArray, warning, getHighlightedParts } from \"../../lib/utils/index.js\";\nexport function Snippet(_ref) {\n  var hit = _ref.hit,\n    attribute = _ref.attribute,\n    cssClasses = _ref.cssClasses,\n    props = _objectWithoutProperties(_ref, _excluded);\n  var property = getPropertyByPath(hit._snippetResult, attribute) || [];\n  var properties = toArray(property);\n  process.env.NODE_ENV === 'development' ? warning(Boolean(properties.length), \"Could not enable snippet for \\\"\".concat(attribute.toString(), \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\\n\\nSee: https://alg.li/highlighting\\n\")) : void 0;\n  var parts = properties.map(function (_ref2) {\n    var value = _ref2.value;\n    return getHighlightedParts(unescape(value || ''));\n  });\n  return h(SnippetUiComponent, _extends({}, props, {\n    parts: parts,\n    classNames: cssClasses\n  }));\n}"
  },
  {
    "path": "js/instantsearch.js/es/helpers/components/index.d.ts",
    "content": "export * from './Highlight';\nexport * from './ReverseHighlight';\nexport * from './ReverseSnippet';\nexport * from './Snippet';\n"
  },
  {
    "path": "js/instantsearch.js/es/helpers/components/index.js",
    "content": "export * from \"./Highlight.js\";\nexport * from \"./ReverseHighlight.js\";\nexport * from \"./ReverseSnippet.js\";\nexport * from \"./Snippet.js\";"
  },
  {
    "path": "js/instantsearch.js/es/helpers/get-insights-anonymous-user-token.d.ts",
    "content": "export declare const ANONYMOUS_TOKEN_COOKIE_KEY = \"_ALGOLIA\";\nexport declare function getInsightsAnonymousUserTokenInternal(): string | undefined;\n/**\n * @deprecated This function will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\n */\nexport default function getInsightsAnonymousUserToken(): string | undefined;\n"
  },
  {
    "path": "js/instantsearch.js/es/helpers/get-insights-anonymous-user-token.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nimport { warning } from \"../lib/utils/index.js\";\nexport var ANONYMOUS_TOKEN_COOKIE_KEY = '_ALGOLIA';\nfunction getCookie(name) {\n  if ((typeof document === \"undefined\" ? \"undefined\" : _typeof(document)) !== 'object' || typeof document.cookie !== 'string') {\n    return undefined;\n  }\n  var prefix = \"\".concat(name, \"=\");\n  var cookies = document.cookie.split(';');\n  for (var i = 0; i < cookies.length; i++) {\n    var cookie = cookies[i];\n    while (cookie.charAt(0) === ' ') {\n      cookie = cookie.substring(1);\n    }\n    if (cookie.indexOf(prefix) === 0) {\n      return cookie.substring(prefix.length, cookie.length);\n    }\n  }\n  return undefined;\n}\nexport function getInsightsAnonymousUserTokenInternal() {\n  return getCookie(ANONYMOUS_TOKEN_COOKIE_KEY);\n}\n\n/**\n * @deprecated This function will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\n */\nexport default function getInsightsAnonymousUserToken() {\n  process.env.NODE_ENV === 'development' ? warning(false, \"`getInsightsAnonymousUserToken` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `insights` middleware.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\") : void 0;\n  return getInsightsAnonymousUserTokenInternal();\n}"
  },
  {
    "path": "js/instantsearch.js/es/helpers/highlight.d.ts",
    "content": "import type { Hit } from '../types';\nexport type HighlightOptions = {\n    attribute: string | string[];\n    highlightedTagName?: string;\n    hit: Partial<Hit>;\n    cssClasses?: Partial<{\n        highlighted: string;\n    }>;\n};\n/**\n * @deprecated use html tagged templates and the Highlight component instead\n */\nexport default function highlight({ attribute, highlightedTagName, hit, cssClasses, }: HighlightOptions): string;\n"
  },
  {
    "path": "js/instantsearch.js/es/helpers/highlight.js",
    "content": "import { component } from \"../lib/suit.js\";\nimport { getPropertyByPath, TAG_REPLACEMENT, warning } from \"../lib/utils/index.js\";\nvar suit = component('Highlight');\n\n/**\n * @deprecated use html tagged templates and the Highlight component instead\n */\nexport default function highlight(_ref) {\n  var attribute = _ref.attribute,\n    _ref$highlightedTagNa = _ref.highlightedTagName,\n    highlightedTagName = _ref$highlightedTagNa === void 0 ? 'mark' : _ref$highlightedTagNa,\n    hit = _ref.hit,\n    _ref$cssClasses = _ref.cssClasses,\n    cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;\n  process.env.NODE_ENV === 'development' ? warning(false, \"`instantsearch.highlight` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `Highlight` component.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/?client=html+tagged+templates#upgrade-templates\") : void 0;\n  var highlightAttributeResult = getPropertyByPath(hit._highlightResult, attribute);\n\n  // @MAJOR fallback to attribute value if highlight is not found\n  process.env.NODE_ENV === 'development' ? warning(highlightAttributeResult, \"Could not enable highlight for \\\"\".concat(attribute, \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\\n\\nSee: https://alg.li/highlighting\\n\")) : void 0;\n  var _ref2 = highlightAttributeResult || {},\n    _ref2$value = _ref2.value,\n    attributeValue = _ref2$value === void 0 ? '' : _ref2$value;\n\n  // cx is not used, since it would be bundled as a dependency for Vue\n  var className = suit({\n    descendantName: 'highlighted'\n  }) + (cssClasses.highlighted ? \" \".concat(cssClasses.highlighted) : '');\n  return attributeValue.replace(new RegExp(TAG_REPLACEMENT.highlightPreTag, 'g'), \"<\".concat(highlightedTagName, \" class=\\\"\").concat(className, \"\\\">\")).replace(new RegExp(TAG_REPLACEMENT.highlightPostTag, 'g'), \"</\".concat(highlightedTagName, \">\"));\n}"
  },
  {
    "path": "js/instantsearch.js/es/helpers/index.d.ts",
    "content": "export * from './highlight';\nexport * from './reverseHighlight';\nexport * from './snippet';\nexport * from './reverseSnippet';\nexport { default as reverseHighlight } from './reverseHighlight';\nexport { default as reverseSnippet } from './reverseSnippet';\nexport { default as highlight } from './highlight';\nexport { default as snippet } from './snippet';\nexport { default as insights } from './insights';\nexport { default as getInsightsAnonymousUserToken, getInsightsAnonymousUserTokenInternal, } from './get-insights-anonymous-user-token';\n"
  },
  {
    "path": "js/instantsearch.js/es/helpers/index.js",
    "content": "export * from \"./highlight.js\";\nexport * from \"./reverseHighlight.js\";\nexport * from \"./snippet.js\";\nexport * from \"./reverseSnippet.js\";\nexport { default as reverseHighlight } from \"./reverseHighlight.js\";\nexport { default as reverseSnippet } from \"./reverseSnippet.js\";\nexport { default as highlight } from \"./highlight.js\";\nexport { default as snippet } from \"./snippet.js\";\nexport { default as insights } from \"./insights.js\";\nexport { default as getInsightsAnonymousUserToken, getInsightsAnonymousUserTokenInternal } from \"./get-insights-anonymous-user-token.js\";"
  },
  {
    "path": "js/instantsearch.js/es/helpers/insights.d.ts",
    "content": "import type { InsightsClientMethod, InsightsClientPayload } from '../types';\n/** @deprecated use bindEvent instead */\nexport declare function readDataAttributes(domElement: HTMLElement): {\n    method: InsightsClientMethod;\n    payload: Partial<InsightsClientPayload>;\n};\n/** @deprecated use bindEvent instead */\nexport declare function writeDataAttributes({ method, payload, }: {\n    method: InsightsClientMethod;\n    payload: Partial<InsightsClientPayload>;\n}): string;\n/**\n * @deprecated This function will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\n */\nexport default function insights(method: InsightsClientMethod, payload: Partial<InsightsClientPayload>): string;\n"
  },
  {
    "path": "js/instantsearch.js/es/helpers/insights.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nimport { warning, serializePayload, deserializePayload } from \"../lib/utils/index.js\";\n/** @deprecated use bindEvent instead */\nexport function readDataAttributes(domElement) {\n  var method = domElement.getAttribute('data-insights-method');\n  var serializedPayload = domElement.getAttribute('data-insights-payload');\n  if (typeof serializedPayload !== 'string') {\n    throw new Error('The insights helper expects `data-insights-payload` to be a base64-encoded JSON string.');\n  }\n  try {\n    var payload = deserializePayload(serializedPayload);\n    return {\n      method: method,\n      payload: payload\n    };\n  } catch (error) {\n    throw new Error('The insights helper was unable to parse `data-insights-payload`.');\n  }\n}\n\n/** @deprecated use bindEvent instead */\nexport function writeDataAttributes(_ref) {\n  var method = _ref.method,\n    payload = _ref.payload;\n  if (_typeof(payload) !== 'object') {\n    throw new Error(\"The insights helper expects the payload to be an object.\");\n  }\n  var serializedPayload;\n  try {\n    serializedPayload = serializePayload(payload);\n  } catch (error) {\n    throw new Error(\"Could not JSON serialize the payload object.\");\n  }\n  return \"data-insights-method=\\\"\".concat(method, \"\\\" data-insights-payload=\\\"\").concat(serializedPayload, \"\\\"\");\n}\n\n/**\n * @deprecated This function will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\n */\nexport default function insights(method, payload) {\n  process.env.NODE_ENV === 'development' ? warning(false, \"`insights` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `insights` middleware.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\") : void 0;\n  return writeDataAttributes({\n    method: method,\n    payload: payload\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/es/helpers/reverseHighlight.d.ts",
    "content": "import type { Hit } from '../types';\nexport type ReverseHighlightOptions = {\n    attribute: string | string[];\n    highlightedTagName?: string;\n    hit: Partial<Hit>;\n    cssClasses?: Partial<{\n        highlighted: string;\n    }>;\n};\n/**\n * @deprecated use html tagged templates and the ReverseHighlight component instead\n */\nexport default function reverseHighlight({ attribute, highlightedTagName, hit, cssClasses, }: ReverseHighlightOptions): string;\n"
  },
  {
    "path": "js/instantsearch.js/es/helpers/reverseHighlight.js",
    "content": "import { component } from \"../lib/suit.js\";\nimport { TAG_REPLACEMENT, getPropertyByPath, getHighlightedParts, reverseHighlightedParts, concatHighlightedParts, warning } from \"../lib/utils/index.js\";\nvar suit = component('ReverseHighlight');\n\n/**\n * @deprecated use html tagged templates and the ReverseHighlight component instead\n */\nexport default function reverseHighlight(_ref) {\n  var attribute = _ref.attribute,\n    _ref$highlightedTagNa = _ref.highlightedTagName,\n    highlightedTagName = _ref$highlightedTagNa === void 0 ? 'mark' : _ref$highlightedTagNa,\n    hit = _ref.hit,\n    _ref$cssClasses = _ref.cssClasses,\n    cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;\n  process.env.NODE_ENV === 'development' ? warning(false, \"`instantsearch.reverseHighlight` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `ReverseHighlight` component.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/?client=html+tagged+templates#upgrade-templates\") : void 0;\n  var highlightAttributeResult = getPropertyByPath(hit._highlightResult, attribute);\n\n  // @MAJOR fallback to attribute value if highlight is not found\n  process.env.NODE_ENV === 'development' ? warning(highlightAttributeResult, \"Could not enable reverse highlight for \\\"\".concat(attribute, \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\\n\\nSee: https://alg.li/highlighting\\n\")) : void 0;\n  var _ref2 = highlightAttributeResult || {},\n    _ref2$value = _ref2.value,\n    attributeValue = _ref2$value === void 0 ? '' : _ref2$value;\n\n  // cx is not used, since it would be bundled as a dependency for Vue\n  var className = suit({\n    descendantName: 'highlighted'\n  }) + (cssClasses.highlighted ? \" \".concat(cssClasses.highlighted) : '');\n  var reverseHighlightedValue = concatHighlightedParts(reverseHighlightedParts(getHighlightedParts(attributeValue)));\n  return reverseHighlightedValue.replace(new RegExp(TAG_REPLACEMENT.highlightPreTag, 'g'), \"<\".concat(highlightedTagName, \" class=\\\"\").concat(className, \"\\\">\")).replace(new RegExp(TAG_REPLACEMENT.highlightPostTag, 'g'), \"</\".concat(highlightedTagName, \">\"));\n}"
  },
  {
    "path": "js/instantsearch.js/es/helpers/reverseSnippet.d.ts",
    "content": "import type { Hit } from '../types';\nexport type ReverseSnippetOptions = {\n    attribute: string | string[];\n    highlightedTagName?: string;\n    hit: Partial<Hit>;\n    cssClasses?: Partial<{\n        highlighted: string;\n    }>;\n};\n/**\n * @deprecated use html tagged templates and the ReverseSnippet component instead\n */\nexport default function reverseSnippet({ attribute, highlightedTagName, hit, cssClasses, }: ReverseSnippetOptions): string;\n"
  },
  {
    "path": "js/instantsearch.js/es/helpers/reverseSnippet.js",
    "content": "import { component } from \"../lib/suit.js\";\nimport { TAG_REPLACEMENT, getPropertyByPath, getHighlightedParts, reverseHighlightedParts, concatHighlightedParts, warning } from \"../lib/utils/index.js\";\nvar suit = component('ReverseSnippet');\n\n/**\n * @deprecated use html tagged templates and the ReverseSnippet component instead\n */\nexport default function reverseSnippet(_ref) {\n  var attribute = _ref.attribute,\n    _ref$highlightedTagNa = _ref.highlightedTagName,\n    highlightedTagName = _ref$highlightedTagNa === void 0 ? 'mark' : _ref$highlightedTagNa,\n    hit = _ref.hit,\n    _ref$cssClasses = _ref.cssClasses,\n    cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;\n  process.env.NODE_ENV === 'development' ? warning(false, \"`instantsearch.reverseSnippet` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `ReverseSnippet` component.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/?client=html+tagged+templates#upgrade-templates\") : void 0;\n  var snippetAttributeResult = getPropertyByPath(hit._snippetResult, attribute);\n\n  // @MAJOR fallback to attribute value if snippet is not found\n  process.env.NODE_ENV === 'development' ? warning(snippetAttributeResult, \"Could not enable reverse snippet for \\\"\".concat(attribute, \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\\n\\nSee: https://alg.li/highlighting\\n\")) : void 0;\n  var _ref2 = snippetAttributeResult || {},\n    _ref2$value = _ref2.value,\n    attributeValue = _ref2$value === void 0 ? '' : _ref2$value;\n\n  // cx is not used, since it would be bundled as a dependency for Vue\n  var className = suit({\n    descendantName: 'highlighted'\n  }) + (cssClasses.highlighted ? \" \".concat(cssClasses.highlighted) : '');\n  var reverseHighlightedValue = concatHighlightedParts(reverseHighlightedParts(getHighlightedParts(attributeValue)));\n  return reverseHighlightedValue.replace(new RegExp(TAG_REPLACEMENT.highlightPreTag, 'g'), \"<\".concat(highlightedTagName, \" class=\\\"\").concat(className, \"\\\">\")).replace(new RegExp(TAG_REPLACEMENT.highlightPostTag, 'g'), \"</\".concat(highlightedTagName, \">\"));\n}"
  },
  {
    "path": "js/instantsearch.js/es/helpers/snippet.d.ts",
    "content": "import type { Hit } from '../types';\nexport type SnippetOptions = {\n    attribute: string | string[];\n    highlightedTagName?: string;\n    hit: Partial<Hit>;\n    cssClasses?: {\n        highlighted?: string;\n    };\n};\n/**\n * @deprecated use html tagged templates and the Snippet component instead\n */\nexport default function snippet({ attribute, highlightedTagName, hit, cssClasses, }: SnippetOptions): string;\n"
  },
  {
    "path": "js/instantsearch.js/es/helpers/snippet.js",
    "content": "import { component } from \"../lib/suit.js\";\nimport { TAG_REPLACEMENT, getPropertyByPath, warning } from \"../lib/utils/index.js\";\nvar suit = component('Snippet');\n\n/**\n * @deprecated use html tagged templates and the Snippet component instead\n */\nexport default function snippet(_ref) {\n  var attribute = _ref.attribute,\n    _ref$highlightedTagNa = _ref.highlightedTagName,\n    highlightedTagName = _ref$highlightedTagNa === void 0 ? 'mark' : _ref$highlightedTagNa,\n    hit = _ref.hit,\n    _ref$cssClasses = _ref.cssClasses,\n    cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;\n  process.env.NODE_ENV === 'development' ? warning(false, \"`instantsearch.snippet` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `Snippet` component.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/?client=html+tagged+templates#upgrade-templates\") : void 0;\n  var snippetAttributeResult = getPropertyByPath(hit._snippetResult, attribute);\n\n  // @MAJOR fallback to attribute value if snippet is not found\n  process.env.NODE_ENV === 'development' ? warning(snippetAttributeResult, \"Could not enable snippet for \\\"\".concat(attribute, \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\\n\\nSee: https://alg.li/highlighting\\n\")) : void 0;\n  var _ref2 = snippetAttributeResult || {},\n    _ref2$value = _ref2.value,\n    attributeValue = _ref2$value === void 0 ? '' : _ref2$value;\n\n  // cx is not used, since it would be bundled as a dependency for Vue\n  var className = suit({\n    descendantName: 'highlighted'\n  }) + (cssClasses.highlighted ? \" \".concat(cssClasses.highlighted) : '');\n  return attributeValue.replace(new RegExp(TAG_REPLACEMENT.highlightPreTag, 'g'), \"<\".concat(highlightedTagName, \" class=\\\"\").concat(className, \"\\\">\")).replace(new RegExp(TAG_REPLACEMENT.highlightPostTag, 'g'), \"</\".concat(highlightedTagName, \">\"));\n}"
  },
  {
    "path": "js/instantsearch.js/es/index.d.ts",
    "content": "import { snippet, reverseSnippet, highlight, reverseHighlight, insights, getInsightsAnonymousUserToken } from './helpers';\nimport { createInfiniteHitsSessionStorageCache } from './lib/infiniteHitsCache';\nimport InstantSearch from './lib/InstantSearch';\nimport type { InstantSearchOptions } from './lib/InstantSearch';\nimport type { Expand, UiState } from './types';\ntype InstantSearchModule = {\n    <TUiState = Record<string, unknown>, TRouteState = TUiState>(options: InstantSearchOptions<Expand<UiState & TUiState>, TRouteState>): InstantSearch<Expand<UiState & TUiState>, TRouteState>;\n    version: string;\n    /** @deprecated import { createInfiniteHitsSessionStorageCache } from 'instantsearch.js/es/lib/infiniteHitsCache' */\n    createInfiniteHitsSessionStorageCache: typeof createInfiniteHitsSessionStorageCache;\n    /** @deprecated import { highlight } from 'instantsearch.js/es/helpers' */\n    highlight: typeof highlight;\n    /** @deprecated import { reverseHighlight } from 'instantsearch.js/es/helpers' */\n    reverseHighlight: typeof reverseHighlight;\n    /** @deprecated import { snippet } from 'instantsearch.js/es/helpers' */\n    snippet: typeof snippet;\n    /** @deprecated import { reverseSnippet } from 'instantsearch.js/es/helpers' */\n    reverseSnippet: typeof reverseSnippet;\n    /**\n     * @deprecated use createInsightsMiddleware\n     * @link https://www.algolia.com/doc/api-reference/widgets/insights/js/\n     */\n    insights: typeof insights;\n    /**\n     * @deprecated use createInsightsMiddleware\n     * @link https://www.algolia.com/doc/api-reference/widgets/insights/js/\n     */\n    getInsightsAnonymousUserToken: typeof getInsightsAnonymousUserToken;\n};\n/**\n * InstantSearch is the main component of InstantSearch.js. This object\n * manages the widget and lets you add new ones.\n *\n * Two parameters are required to get you started with InstantSearch.js:\n *  - `indexName`: the main index that you will use for your new search UI\n *  - `searchClient`: the search client to plug to InstantSearch.js\n *\n * The [search client provided by Algolia](algolia.com/doc/api-client/getting-started/what-is-the-api-client/javascript/)\n * needs an `appId` and an `apiKey`. Those parameters can be found in your\n * [Algolia dashboard](https://www.algolia.com/api-keys).\n *\n * If you want to get up and running quickly with InstantSearch.js, have a\n * look at the [getting started](https://www.algolia.com/doc/guides/building-search-ui/getting-started/js/).\n */\ndeclare const instantsearch: InstantSearchModule;\nexport default instantsearch;\nexport * from './types';\n"
  },
  {
    "path": "js/instantsearch.js/es/index.js",
    "content": "import { snippet, reverseSnippet, highlight, reverseHighlight, insights, getInsightsAnonymousUserToken } from \"./helpers/index.js\";\nimport { createInfiniteHitsSessionStorageCache } from \"./lib/infiniteHitsCache/index.js\";\nimport InstantSearch from \"./lib/InstantSearch.js\";\nimport { deprecate } from \"./lib/utils/index.js\";\nimport version from \"./lib/version.js\";\n/**\n * InstantSearch is the main component of InstantSearch.js. This object\n * manages the widget and lets you add new ones.\n *\n * Two parameters are required to get you started with InstantSearch.js:\n *  - `indexName`: the main index that you will use for your new search UI\n *  - `searchClient`: the search client to plug to InstantSearch.js\n *\n * The [search client provided by Algolia](algolia.com/doc/api-client/getting-started/what-is-the-api-client/javascript/)\n * needs an `appId` and an `apiKey`. Those parameters can be found in your\n * [Algolia dashboard](https://www.algolia.com/api-keys).\n *\n * If you want to get up and running quickly with InstantSearch.js, have a\n * look at the [getting started](https://www.algolia.com/doc/guides/building-search-ui/getting-started/js/).\n */\nvar instantsearch = function instantsearch(options) {\n  return new InstantSearch(options);\n};\ninstantsearch.version = version;\ninstantsearch.createInfiniteHitsSessionStorageCache = deprecate(createInfiniteHitsSessionStorageCache, \"import { createInfiniteHitsSessionStorageCache } from 'instantsearch.js/es/lib/infiniteHitsCache'\");\ninstantsearch.highlight = deprecate(highlight, \"import { highlight } from 'instantsearch.js/es/helpers'\");\ninstantsearch.reverseHighlight = deprecate(reverseHighlight, \"import { reverseHighlight } from 'instantsearch.js/es/helpers'\");\ninstantsearch.snippet = deprecate(snippet, \"import { snippet } from 'instantsearch.js/es/helpers'\");\ninstantsearch.reverseSnippet = deprecate(reverseSnippet, \"import { reverseSnippet } from 'instantsearch.js/es/helpers'\");\ninstantsearch.insights = insights;\ninstantsearch.getInsightsAnonymousUserToken = getInsightsAnonymousUserToken;\nObject.defineProperty(instantsearch, 'widgets', {\n  get: function get() {\n    throw new ReferenceError(\"\\\"instantsearch.widgets\\\" are not available from the ES build.\\n\\nTo import the widgets:\\n\\nimport { searchBox } from 'instantsearch.js/es/widgets'\");\n  }\n});\nObject.defineProperty(instantsearch, 'connectors', {\n  get: function get() {\n    throw new ReferenceError(\"\\\"instantsearch.connectors\\\" are not available from the ES build.\\n\\nTo import the connectors:\\n\\nimport { connectSearchBox } from 'instantsearch.js/es/connectors'\");\n  }\n});\nObject.defineProperty(instantsearch, 'templates', {\n  get: function get() {\n    throw new ReferenceError(\"\\\"instantsearch.templates\\\" are not available from the ES build.\\n\\nTo import the templates:\\n\\nimport { carousel } from 'instantsearch.js/es/templates'\");\n  }\n});\nexport default instantsearch;\nexport * from \"./types/index.js\";\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/InstantSearch.d.ts",
    "content": "import EventEmitter from '@algolia/events';\nimport type { InsightsEvent, InsightsProps } from '../middlewares/createInsightsMiddleware';\nimport type { RouterProps } from '../middlewares/createRouterMiddleware';\nimport type { InsightsClient as AlgoliaInsightsClient, SearchClient, Widget, IndexWidget, UiState, CreateURL, Middleware, MiddlewareDefinition, RenderState, InitialResults, CompositionClient } from '../types';\nimport type { AlgoliaSearchHelper } from 'algoliasearch-helper';\ntype NoInfer<T> = T extends infer S ? S : never;\n/**\n * Global options for an InstantSearch instance.\n */\nexport type InstantSearchOptions<TUiState extends UiState = UiState, TRouteState = TUiState> = {\n    /**\n     * The name of the main index. If no indexName is provided, you have to manually add an index widget.\n     */\n    indexName?: string;\n    /**\n     * The objectID of the composition.\n     * If this is passed, the composition API will be used for search.\n     * Multi-index search is not supported with this option.\n     */\n    compositionID?: string;\n    /**\n     * The search client to plug to InstantSearch.js\n     *\n     * Usage:\n     * ```javascript\n     * // Using the default Algolia search client\n     * instantsearch({\n     *   indexName: 'indexName',\n     *   searchClient: algoliasearch('appId', 'apiKey')\n     * });\n     *\n     * // Using a custom search client\n     * instantsearch({\n     *   indexName: 'indexName',\n     *   searchClient: {\n     *     search(requests) {\n     *       // fetch response based on requests\n     *       return response;\n     *     },\n     *     searchForFacetValues(requests) {\n     *       // fetch response based on requests\n     *       return response;\n     *     }\n     *   }\n     * });\n     * ```\n     */\n    searchClient: SearchClient | CompositionClient;\n    /**\n     * The locale used to display numbers. This will be passed\n     * to `Number.prototype.toLocaleString()`\n     */\n    numberLocale?: string;\n    /**\n     * A hook that will be called each time a search needs to be done, with the\n     * helper as a parameter. It's your responsibility to call `helper.search()`.\n     * This option allows you to avoid doing searches at page load for example.\n     * @deprecated use onStateChange instead\n     */\n    searchFunction?: (helper: AlgoliaSearchHelper) => void;\n    /**\n     * Function called when the state changes.\n     *\n     * Using this function makes the instance controlled. This means that you\n     * become in charge of updating the UI state with the `setUiState` function.\n     */\n    onStateChange?: (params: {\n        uiState: TUiState;\n        setUiState: (uiState: TUiState | ((previousUiState: TUiState) => TUiState)) => void;\n    }) => void;\n    /**\n     * Injects a `uiState` to the `instantsearch` instance. You can use this option\n     * to provide an initial state to a widget. Note that the state is only used\n     * for the first search. To unconditionally pass additional parameters to the\n     * Algolia API, take a look at the `configure` widget.\n     */\n    initialUiState?: NoInfer<TUiState>;\n    /**\n     * Time before a search is considered stalled. The default is 200ms\n     */\n    stalledSearchDelay?: number;\n    /**\n     * Router configuration used to save the UI State into the URL or any other\n     * client side persistence. Passing `true` will use the default URL options.\n     */\n    routing?: RouterProps<TUiState, TRouteState> | boolean;\n    /**\n     * Enables the Insights middleware and loads the Insights library\n     * if not already loaded.\n     *\n     * The Insights middleware sends view and click events automatically, and lets\n     * you set up your own events.\n     *\n     * @default false\n     */\n    insights?: InsightsProps | boolean;\n    /**\n     * the instance of search-insights to use for sending insights events inside\n     * widgets like `hits`.\n     *\n     * @deprecated This property will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\n     */\n    insightsClient?: AlgoliaInsightsClient;\n    future?: {\n        /**\n         * Changes the way `dispose` is used in InstantSearch lifecycle.\n         *\n         * If `false` (by default), each widget unmounting will remove its state as well, even if there are multiple widgets reading that UI State.\n         *\n         * If `true`, each widget unmounting will only remove its own state if it's the last of its type. This allows for dynamically adding and removing widgets without losing their state.\n         *\n         * @default false\n         */\n        preserveSharedStateOnUnmount?: boolean;\n        /**\n         * Changes the way root levels of hierarchical facets have their count displayed.\n         *\n         * If `false` (by default), the count of the refined root level is updated to match the count of the actively refined parent level.\n         *\n         * If `true`, the count of the root level stays the same as the count of all children levels.\n         *\n         * @default false\n         */\n        persistHierarchicalRootCount?: boolean;\n    };\n};\nexport type InstantSearchStatus = 'idle' | 'loading' | 'stalled' | 'error';\nexport declare const INSTANTSEARCH_FUTURE_DEFAULTS: Required<InstantSearchOptions['future']>;\n/**\n * The actual implementation of the InstantSearch. This is\n * created using the `instantsearch` factory function.\n * It emits the 'render' event every time a search is done\n */\ndeclare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TUiState> extends EventEmitter {\n    client: InstantSearchOptions['searchClient'];\n    indexName: string;\n    compositionID?: string;\n    insightsClient: AlgoliaInsightsClient | null;\n    onStateChange: InstantSearchOptions<TUiState>['onStateChange'] | null;\n    future: NonNullable<InstantSearchOptions<TUiState>['future']>;\n    helper: AlgoliaSearchHelper | null;\n    mainHelper: AlgoliaSearchHelper | null;\n    mainIndex: IndexWidget;\n    started: boolean;\n    templatesConfig: Record<string, unknown>;\n    renderState: RenderState;\n    _stalledSearchDelay: number;\n    _searchStalledTimer: any;\n    _initialUiState: TUiState;\n    _initialResults: InitialResults | null;\n    _createURL: CreateURL<TUiState>;\n    _searchFunction?: InstantSearchOptions['searchFunction'];\n    _mainHelperSearch?: AlgoliaSearchHelper['search'];\n    _hasSearchWidget: boolean;\n    _hasRecommendWidget: boolean;\n    _insights: InstantSearchOptions['insights'];\n    middleware: Array<{\n        creator: Middleware<TUiState>;\n        instance: MiddlewareDefinition<TUiState>;\n    }>;\n    sendEventToInsights: (event: InsightsEvent) => void;\n    /**\n     * The status of the search. Can be \"idle\", \"loading\", \"stalled\", or \"error\".\n     */\n    status: InstantSearchStatus;\n    /**\n     * The last returned error from the Search API.\n     * The error gets cleared when the next valid search response is rendered.\n     */\n    error: Error | undefined;\n    /**\n     * @deprecated use `status === 'stalled'` instead\n     */\n    get _isSearchStalled(): boolean;\n    constructor(options: InstantSearchOptions<TUiState, TRouteState>);\n    /**\n     * Hooks a middleware into the InstantSearch lifecycle.\n     */\n    use(...middleware: Array<Middleware<TUiState>>): this;\n    /**\n     * Removes a middleware from the InstantSearch lifecycle.\n     */\n    unuse(...middlewareToUnuse: Array<Middleware<TUiState>>): this;\n    EXPERIMENTAL_use(...middleware: Middleware[]): this;\n    /**\n     * Adds a widget to the search instance.\n     * A widget can be added either before or after InstantSearch has started.\n     * @param widget The widget to add to InstantSearch.\n     *\n     * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `addWidgets([widget])`.\n     */\n    addWidget(widget: Widget): this;\n    /**\n     * Adds multiple widgets to the search instance.\n     * Widgets can be added either before or after InstantSearch has started.\n     * @param widgets The array of widgets to add to InstantSearch.\n     */\n    addWidgets(widgets: Array<Widget | IndexWidget>): this;\n    /**\n     * Removes a widget from the search instance.\n     * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `removeWidgets([widget])`\n     * @param widget The widget instance to remove from InstantSearch.\n     *\n     * The widget must implement a `dispose()` method to clear its state.\n     */\n    removeWidget(widget: Widget | IndexWidget): this;\n    /**\n     * Removes multiple widgets from the search instance.\n     * @param widgets Array of widgets instances to remove from InstantSearch.\n     *\n     * The widgets must implement a `dispose()` method to clear their states.\n     */\n    removeWidgets(widgets: Array<Widget | IndexWidget>): this;\n    /**\n     * Ends the initialization of InstantSearch.js and triggers the\n     * first search.\n     */\n    start(): void;\n    /**\n     * Removes all widgets without triggering a search afterwards.\n     * @return {undefined} This method does not return anything\n     */\n    dispose(): void;\n    scheduleSearch: (() => void) & {\n        wait: () => Promise<void>;\n        cancel: () => void;\n    };\n    scheduleRender: ((shouldResetStatus?: boolean) => void) & {\n        wait: () => Promise<void>;\n        cancel: () => void;\n    };\n    scheduleStalledRender(): void;\n    /**\n     * Set the UI state and trigger a search.\n     * @param uiState The next UI state or a function computing it from the current state\n     * @param callOnStateChange private parameter used to know if the method is called from a state change\n     */\n    setUiState(uiState: TUiState | ((previousUiState: TUiState) => TUiState), callOnStateChange?: boolean): void;\n    getUiState(): TUiState;\n    onInternalStateChange: (() => void) & {\n        wait: () => Promise<void>;\n        cancel: () => void;\n    };\n    createURL(nextState?: TUiState): string;\n    refresh(): void;\n}\nexport default InstantSearch;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/InstantSearch.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport EventEmitter from '@algolia/events';\nimport algoliasearchHelper from 'algoliasearch-helper';\nimport { createInsightsMiddleware } from \"../middlewares/createInsightsMiddleware.js\";\nimport { createMetadataMiddleware, isMetadataEnabled } from \"../middlewares/createMetadataMiddleware.js\";\nimport { createRouterMiddleware } from \"../middlewares/createRouterMiddleware.js\";\nimport index from \"../widgets/index/index.js\";\nimport createHelpers from \"./createHelpers.js\";\nimport { createDocumentationMessageGenerator, createDocumentationLink, defer, hydrateRecommendCache, hydrateSearchClient, noop, warning, setIndexHelperState, isIndexWidget } from \"./utils/index.js\";\nimport version from \"./version.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'instantsearch'\n});\nfunction defaultCreateURL() {\n  return '#';\n}\n\n// this purposely breaks typescript's type inference to ensure it's not used\n// as it's used for a default parameter for example\n// source: https://github.com/Microsoft/TypeScript/issues/14829#issuecomment-504042546\n\n/**\n * Global options for an InstantSearch instance.\n */\n\nexport var INSTANTSEARCH_FUTURE_DEFAULTS = {\n  preserveSharedStateOnUnmount: false,\n  persistHierarchicalRootCount: false\n};\n\n/**\n * The actual implementation of the InstantSearch. This is\n * created using the `instantsearch` factory function.\n * It emits the 'render' event every time a search is done\n */\nvar InstantSearch = /*#__PURE__*/function (_EventEmitter) {\n  _inherits(InstantSearch, _EventEmitter);\n  var _super = _createSuper(InstantSearch);\n  function InstantSearch(options) {\n    var _options$future2;\n    var _this;\n    _classCallCheck(this, InstantSearch);\n    _this = _super.call(this);\n\n    // prevent `render` event listening from causing a warning\n    _defineProperty(_assertThisInitialized(_this), \"client\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"indexName\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"compositionID\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"insightsClient\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"onStateChange\", null);\n    _defineProperty(_assertThisInitialized(_this), \"future\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"helper\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"mainHelper\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"mainIndex\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"started\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"templatesConfig\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"renderState\", {});\n    _defineProperty(_assertThisInitialized(_this), \"_stalledSearchDelay\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"_searchStalledTimer\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"_initialUiState\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"_initialResults\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"_createURL\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"_searchFunction\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"_mainHelperSearch\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"_hasSearchWidget\", false);\n    _defineProperty(_assertThisInitialized(_this), \"_hasRecommendWidget\", false);\n    _defineProperty(_assertThisInitialized(_this), \"_insights\", void 0);\n    _defineProperty(_assertThisInitialized(_this), \"middleware\", []);\n    _defineProperty(_assertThisInitialized(_this), \"sendEventToInsights\", void 0);\n    /**\n     * The status of the search. Can be \"idle\", \"loading\", \"stalled\", or \"error\".\n     */\n    _defineProperty(_assertThisInitialized(_this), \"status\", 'idle');\n    /**\n     * The last returned error from the Search API.\n     * The error gets cleared when the next valid search response is rendered.\n     */\n    _defineProperty(_assertThisInitialized(_this), \"error\", undefined);\n    _defineProperty(_assertThisInitialized(_this), \"scheduleSearch\", defer(function () {\n      if (_this.started) {\n        _this.mainHelper.search();\n      }\n    }));\n    _defineProperty(_assertThisInitialized(_this), \"scheduleRender\", defer(function () {\n      var _this$mainHelper;\n      var shouldResetStatus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n      if (!((_this$mainHelper = _this.mainHelper) !== null && _this$mainHelper !== void 0 && _this$mainHelper.hasPendingRequests())) {\n        clearTimeout(_this._searchStalledTimer);\n        _this._searchStalledTimer = null;\n        if (shouldResetStatus) {\n          _this.status = 'idle';\n          _this.error = undefined;\n        }\n      }\n      _this.mainIndex.render({\n        instantSearchInstance: _assertThisInitialized(_this)\n      });\n      _this.emit('render');\n    }));\n    _defineProperty(_assertThisInitialized(_this), \"onInternalStateChange\", defer(function () {\n      var nextUiState = _this.mainIndex.getWidgetUiState({});\n      _this.middleware.forEach(function (_ref) {\n        var instance = _ref.instance;\n        instance.onStateChange({\n          uiState: nextUiState\n        });\n      });\n    }));\n    _this.setMaxListeners(100);\n    var _options$indexName = options.indexName,\n      indexName = _options$indexName === void 0 ? '' : _options$indexName,\n      compositionID = options.compositionID,\n      numberLocale = options.numberLocale,\n      _options$initialUiSta = options.initialUiState,\n      initialUiState = _options$initialUiSta === void 0 ? {} : _options$initialUiSta,\n      _options$routing = options.routing,\n      routing = _options$routing === void 0 ? null : _options$routing,\n      _options$insights = options.insights,\n      insights = _options$insights === void 0 ? undefined : _options$insights,\n      searchFunction = options.searchFunction,\n      _options$stalledSearc = options.stalledSearchDelay,\n      stalledSearchDelay = _options$stalledSearc === void 0 ? 200 : _options$stalledSearc,\n      _options$searchClient = options.searchClient,\n      searchClient = _options$searchClient === void 0 ? null : _options$searchClient,\n      _options$insightsClie = options.insightsClient,\n      insightsClient = _options$insightsClie === void 0 ? null : _options$insightsClie,\n      _options$onStateChang = options.onStateChange,\n      onStateChange = _options$onStateChang === void 0 ? null : _options$onStateChang,\n      _options$future = options.future,\n      future = _options$future === void 0 ? _objectSpread(_objectSpread({}, INSTANTSEARCH_FUTURE_DEFAULTS), options.future || {}) : _options$future;\n    if (searchClient === null) {\n      throw new Error(withUsage('The `searchClient` option is required.'));\n    }\n    if (typeof searchClient.search !== 'function') {\n      throw new Error(\"The `searchClient` must implement a `search` method.\\n\\nSee: https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/backend-instantsearch/js/\");\n    }\n    if (typeof searchClient.addAlgoliaAgent === 'function') {\n      searchClient.addAlgoliaAgent(\"instantsearch.js (\".concat(version, \")\"));\n    }\n    process.env.NODE_ENV === 'development' ? warning(insightsClient === null, \"`insightsClient` property has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `insights` middleware.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\") : void 0;\n    if (insightsClient && typeof insightsClient !== 'function') {\n      throw new Error(withUsage('The `insightsClient` option should be a function.'));\n    }\n    process.env.NODE_ENV === 'development' ? warning(!options.searchParameters, \"The `searchParameters` option is deprecated and will not be supported in InstantSearch.js 4.x.\\n\\nYou can replace it with the `configure` widget:\\n\\n```\\nsearch.addWidgets([\\n  configure(\".concat(JSON.stringify(options.searchParameters, null, 2), \")\\n]);\\n```\\n\\nSee \").concat(createDocumentationLink({\n      name: 'configure'\n    }))) : void 0;\n    if (process.env.NODE_ENV === 'development' && ((_options$future2 = options.future) === null || _options$future2 === void 0 ? void 0 : _options$future2.preserveSharedStateOnUnmount) === undefined) {\n      // eslint-disable-next-line no-console\n      console.info(\"Starting from the next major version, InstantSearch will change how widgets state is preserved when they are removed. InstantSearch will keep the state of unmounted widgets to be usable by other widgets with the same attribute.\\n\\nWe recommend setting `future.preserveSharedStateOnUnmount` to true to adopt this change today.\\nTo stay with the current behaviour and remove this warning, set the option to false.\\n\\nSee documentation: \".concat(createDocumentationLink({\n        name: 'instantsearch'\n      }), \"#widget-param-future\\n          \"));\n    }\n    _this.client = searchClient;\n    _this.future = future;\n    _this.insightsClient = insightsClient;\n    _this.indexName = indexName;\n    _this.compositionID = compositionID;\n    _this.helper = null;\n    _this.mainHelper = null;\n    _this.mainIndex = index({\n      // we use an index widget to render compositions\n      // this only works because there's only one composition index allow for now\n      indexName: _this.compositionID || _this.indexName\n    });\n    _this.onStateChange = onStateChange;\n    _this.started = false;\n    _this.templatesConfig = {\n      helpers: createHelpers({\n        numberLocale: numberLocale\n      }),\n      compileOptions: {}\n    };\n    _this._stalledSearchDelay = stalledSearchDelay;\n    _this._searchStalledTimer = null;\n    _this._createURL = defaultCreateURL;\n    _this._initialUiState = initialUiState;\n    _this._initialResults = null;\n    _this._insights = insights;\n    if (searchFunction) {\n      process.env.NODE_ENV === 'development' ? warning(false, \"The `searchFunction` option is deprecated. Use `onStateChange` instead.\") : void 0;\n      _this._searchFunction = searchFunction;\n    }\n    _this.sendEventToInsights = noop;\n    if (routing) {\n      var routerOptions = typeof routing === 'boolean' ? {} : routing;\n      routerOptions.$$internal = true;\n      _this.use(createRouterMiddleware(routerOptions));\n    }\n\n    // This is the default Insights middleware,\n    // added when `insights` is set to true by the user.\n    // Any user-provided middleware will be added later and override this one.\n    if (insights) {\n      var insightsOptions = typeof insights === 'boolean' ? {} : insights;\n      insightsOptions.$$internal = true;\n      _this.use(createInsightsMiddleware(insightsOptions));\n    }\n    if (isMetadataEnabled()) {\n      _this.use(createMetadataMiddleware({\n        $$internal: true\n      }));\n    }\n    return _this;\n  }\n\n  /**\n   * Hooks a middleware into the InstantSearch lifecycle.\n   */\n  _createClass(InstantSearch, [{\n    key: \"_isSearchStalled\",\n    get:\n    /**\n     * @deprecated use `status === 'stalled'` instead\n     */\n    function get() {\n      process.env.NODE_ENV === 'development' ? warning(false, \"`InstantSearch._isSearchStalled` is deprecated and will be removed in InstantSearch.js 5.0.\\n\\nUse `InstantSearch.status === \\\"stalled\\\"` instead.\") : void 0;\n      return this.status === 'stalled';\n    }\n  }, {\n    key: \"use\",\n    value: function use() {\n      var _this2 = this;\n      for (var _len = arguments.length, middleware = new Array(_len), _key = 0; _key < _len; _key++) {\n        middleware[_key] = arguments[_key];\n      }\n      var newMiddlewareList = middleware.map(function (fn) {\n        var newMiddleware = _objectSpread({\n          $$type: '__unknown__',\n          $$internal: false,\n          subscribe: noop,\n          started: noop,\n          unsubscribe: noop,\n          onStateChange: noop\n        }, fn({\n          instantSearchInstance: _this2\n        }));\n        _this2.middleware.push({\n          creator: fn,\n          instance: newMiddleware\n        });\n        return newMiddleware;\n      });\n\n      // If the instance has already started, we directly subscribe the\n      // middleware so they're notified of changes.\n      if (this.started) {\n        newMiddlewareList.forEach(function (m) {\n          m.subscribe();\n          m.started();\n        });\n      }\n      return this;\n    }\n\n    /**\n     * Removes a middleware from the InstantSearch lifecycle.\n     */\n  }, {\n    key: \"unuse\",\n    value: function unuse() {\n      for (var _len2 = arguments.length, middlewareToUnuse = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n        middlewareToUnuse[_key2] = arguments[_key2];\n      }\n      this.middleware.filter(function (m) {\n        return middlewareToUnuse.includes(m.creator);\n      }).forEach(function (m) {\n        return m.instance.unsubscribe();\n      });\n      this.middleware = this.middleware.filter(function (m) {\n        return !middlewareToUnuse.includes(m.creator);\n      });\n      return this;\n    }\n\n    // @major we shipped with EXPERIMENTAL_use, but have changed that to just `use` now\n  }, {\n    key: \"EXPERIMENTAL_use\",\n    value: function EXPERIMENTAL_use() {\n      process.env.NODE_ENV === 'development' ? warning(false, 'The middleware API is now considered stable, so we recommend replacing `EXPERIMENTAL_use` with `use` before upgrading to the next major version.') : void 0;\n      return this.use.apply(this, arguments);\n    }\n\n    /**\n     * Adds a widget to the search instance.\n     * A widget can be added either before or after InstantSearch has started.\n     * @param widget The widget to add to InstantSearch.\n     *\n     * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `addWidgets([widget])`.\n     */\n  }, {\n    key: \"addWidget\",\n    value: function addWidget(widget) {\n      process.env.NODE_ENV === 'development' ? warning(false, 'addWidget will still be supported in 4.x releases, but not further. It is replaced by `addWidgets([widget])`') : void 0;\n      return this.addWidgets([widget]);\n    }\n\n    /**\n     * Adds multiple widgets to the search instance.\n     * Widgets can be added either before or after InstantSearch has started.\n     * @param widgets The array of widgets to add to InstantSearch.\n     */\n  }, {\n    key: \"addWidgets\",\n    value: function addWidgets(widgets) {\n      if (!Array.isArray(widgets)) {\n        throw new Error(withUsage('The `addWidgets` method expects an array of widgets. Please use `addWidget`.'));\n      }\n      if (widgets.some(function (widget) {\n        return typeof widget.init !== 'function' && typeof widget.render !== 'function';\n      })) {\n        throw new Error(withUsage('The widget definition expects a `render` and/or an `init` method.'));\n      }\n      if (this.compositionID && widgets.some(isIndexWidget)) {\n        throw new Error(withUsage('The `index` widget cannot be used with a composition-based InstantSearch implementation.'));\n      }\n      this.mainIndex.addWidgets(widgets);\n      return this;\n    }\n\n    /**\n     * Removes a widget from the search instance.\n     * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `removeWidgets([widget])`\n     * @param widget The widget instance to remove from InstantSearch.\n     *\n     * The widget must implement a `dispose()` method to clear its state.\n     */\n  }, {\n    key: \"removeWidget\",\n    value: function removeWidget(widget) {\n      process.env.NODE_ENV === 'development' ? warning(false, 'removeWidget will still be supported in 4.x releases, but not further. It is replaced by `removeWidgets([widget])`') : void 0;\n      return this.removeWidgets([widget]);\n    }\n\n    /**\n     * Removes multiple widgets from the search instance.\n     * @param widgets Array of widgets instances to remove from InstantSearch.\n     *\n     * The widgets must implement a `dispose()` method to clear their states.\n     */\n  }, {\n    key: \"removeWidgets\",\n    value: function removeWidgets(widgets) {\n      if (!Array.isArray(widgets)) {\n        throw new Error(withUsage('The `removeWidgets` method expects an array of widgets. Please use `removeWidget`.'));\n      }\n      if (widgets.some(function (widget) {\n        return typeof widget.dispose !== 'function';\n      })) {\n        throw new Error(withUsage('The widget definition expects a `dispose` method.'));\n      }\n      this.mainIndex.removeWidgets(widgets);\n      return this;\n    }\n\n    /**\n     * Ends the initialization of InstantSearch.js and triggers the\n     * first search.\n     */\n  }, {\n    key: \"start\",\n    value: function start() {\n      var _this3 = this;\n      if (this.started) {\n        throw new Error(withUsage('The `start` method has already been called once.'));\n      }\n\n      // This Helper is used for the queries, we don't care about its state. The\n      // states are managed at the `index` level. We use this Helper to create\n      // DerivedHelper scoped into the `index` widgets.\n      // In Vue InstantSearch' hydrate, a main helper gets set before start, so\n      // we need to respect this helper as a way to keep all listeners correct.\n      var mainHelper = this.mainHelper || algoliasearchHelper(this.client, this.indexName, undefined, {\n        persistHierarchicalRootCount: this.future.persistHierarchicalRootCount\n      });\n      if (this.compositionID) {\n        mainHelper.searchForFacetValues = mainHelper.searchForCompositionFacetValues.bind(mainHelper);\n      }\n      mainHelper.search = function () {\n        _this3.status = 'loading';\n        _this3.scheduleRender(false);\n        process.env.NODE_ENV === 'development' ? warning(Boolean(_this3.indexName) || Boolean(_this3.compositionID) || _this3.mainIndex.getWidgets().some(isIndexWidget), 'No indexName provided, nor an explicit index widget in the widgets tree. This is required to be able to display results.') : void 0;\n\n        // This solution allows us to keep the exact same API for the users but\n        // under the hood, we have a different implementation. It should be\n        // completely transparent for the rest of the codebase. Only this module\n        // is impacted.\n        if (_this3._hasSearchWidget) {\n          if (_this3.compositionID) {\n            mainHelper.searchWithComposition();\n          } else {\n            mainHelper.searchOnlyWithDerivedHelpers();\n          }\n        }\n        if (_this3._hasRecommendWidget) {\n          mainHelper.recommend();\n        }\n        return mainHelper;\n      };\n      if (this._searchFunction) {\n        // this client isn't used to actually search, but required for the helper\n        // to not throw errors\n        var fakeClient = {\n          search: function search() {\n            return new Promise(noop);\n          }\n        };\n        this._mainHelperSearch = mainHelper.search.bind(mainHelper);\n        mainHelper.search = function () {\n          var mainIndexHelper = _this3.mainIndex.getHelper();\n          var searchFunctionHelper = algoliasearchHelper(fakeClient, mainIndexHelper.state.index, mainIndexHelper.state);\n          searchFunctionHelper.once('search', function (_ref2) {\n            var state = _ref2.state;\n            mainIndexHelper.overrideStateWithoutTriggeringChangeEvent(state);\n            _this3._mainHelperSearch();\n          });\n          // Forward state changes from `searchFunctionHelper` to `mainIndexHelper`\n          searchFunctionHelper.on('change', function (_ref3) {\n            var state = _ref3.state;\n            mainIndexHelper.setState(state);\n          });\n          _this3._searchFunction(searchFunctionHelper);\n          return mainHelper;\n        };\n      }\n\n      // Only the \"main\" Helper emits the `error` event vs the one for `search`\n      // and `results` that are also emitted on the derived one.\n      mainHelper.on('error', function (_ref4) {\n        var error = _ref4.error;\n        if (!(error instanceof Error)) {\n          // typescript lies here, error is in some cases { name: string, message: string }\n          var err = error;\n          error = Object.keys(err).reduce(function (acc, key) {\n            acc[key] = err[key];\n            return acc;\n          }, new Error(err.message));\n        }\n        // If an error is emitted, it is re-thrown by events. In previous versions\n        // we emitted {error}, which is thrown as:\n        // \"Uncaught, unspecified \\\"error\\\" event. ([object Object])\"\n        // To avoid breaking changes, we make the error available in both\n        // `error` and `error.error`\n        // @MAJOR emit only error\n        error.error = error;\n        _this3.error = error;\n        _this3.status = 'error';\n        _this3.scheduleRender(false);\n\n        // This needs to execute last because it throws the error.\n        _this3.emit('error', error);\n      });\n      this.mainHelper = mainHelper;\n      this.middleware.forEach(function (_ref5) {\n        var instance = _ref5.instance;\n        instance.subscribe();\n      });\n      this.mainIndex.init({\n        instantSearchInstance: this,\n        parent: null,\n        uiState: this._initialUiState\n      });\n      if (this._initialResults) {\n        hydrateSearchClient(this.client, this._initialResults);\n        hydrateRecommendCache(this.mainHelper, this._initialResults);\n        var originalScheduleSearch = this.scheduleSearch;\n        // We don't schedule a first search when initial results are provided\n        // because we already have the results to render. This skips the initial\n        // network request on the browser on `start`.\n        this.scheduleSearch = defer(noop);\n        // We also skip the initial network request when widgets are dynamically\n        // added in the first tick (that's the case in all the framework-based flavors).\n        // When we add a widget to `index`, it calls `scheduleSearch`. We can rely\n        // on our `defer` util to restore the original `scheduleSearch` value once\n        // widgets are added to hook back to the regular lifecycle.\n        defer(function () {\n          _this3.scheduleSearch = originalScheduleSearch;\n        })();\n      }\n      // We only schedule a search when widgets have been added before `start()`\n      // because there are listeners that can use these results.\n      // This is especially useful in framework-based flavors that wait for\n      // dynamically-added widgets to trigger a network request. It avoids\n      // having to batch this initial network request with the one coming from\n      // `addWidgets()`.\n      // Later, we could also skip `index()` widgets and widgets that don't read\n      // the results, but this is an optimization that has a very low impact for now.\n      else if (this.mainIndex.getWidgets().length > 0) {\n        this.scheduleSearch();\n      }\n\n      // Keep the previous reference for legacy purpose, some pattern use\n      // the direct Helper access `search.helper` (e.g multi-index).\n      this.helper = this.mainIndex.getHelper();\n\n      // track we started the search if we add more widgets,\n      // to init them directly after add\n      this.started = true;\n      this.middleware.forEach(function (_ref6) {\n        var instance = _ref6.instance;\n        instance.started();\n      });\n\n      // This is the automatic Insights middleware,\n      // added when `insights` is unset and the initial results possess `queryID`.\n      // Any user-provided middleware will be added later and override this one.\n      if (typeof this._insights === 'undefined') {\n        mainHelper.derivedHelpers[0].once('result', function () {\n          var hasAutomaticInsights = _this3.mainIndex.getScopedResults().some(function (_ref7) {\n            var results = _ref7.results;\n            return results === null || results === void 0 ? void 0 : results._automaticInsights;\n          });\n          if (hasAutomaticInsights) {\n            _this3.use(createInsightsMiddleware({\n              $$internal: true,\n              $$automatic: true\n            }));\n          }\n        });\n      }\n    }\n\n    /**\n     * Removes all widgets without triggering a search afterwards.\n     * @return {undefined} This method does not return anything\n     */\n  }, {\n    key: \"dispose\",\n    value: function dispose() {\n      var _this$mainHelper2;\n      this.scheduleSearch.cancel();\n      this.scheduleRender.cancel();\n      clearTimeout(this._searchStalledTimer);\n      this.removeWidgets(this.mainIndex.getWidgets());\n      this.mainIndex.dispose();\n\n      // You can not start an instance two times, therefore a disposed instance\n      // needs to set started as false otherwise this can not be restarted at a\n      // later point.\n      this.started = false;\n\n      // The helper needs to be reset to perform the next search from a fresh state.\n      // If not reset, it would use the state stored before calling `dispose()`.\n      this.removeAllListeners();\n      (_this$mainHelper2 = this.mainHelper) === null || _this$mainHelper2 === void 0 ? void 0 : _this$mainHelper2.removeAllListeners();\n      this.mainHelper = null;\n      this.helper = null;\n      this.middleware.forEach(function (_ref8) {\n        var instance = _ref8.instance;\n        instance.unsubscribe();\n      });\n    }\n  }, {\n    key: \"scheduleStalledRender\",\n    value: function scheduleStalledRender() {\n      var _this4 = this;\n      if (!this._searchStalledTimer) {\n        this._searchStalledTimer = setTimeout(function () {\n          _this4.status = 'stalled';\n          _this4.scheduleRender();\n        }, this._stalledSearchDelay);\n      }\n    }\n\n    /**\n     * Set the UI state and trigger a search.\n     * @param uiState The next UI state or a function computing it from the current state\n     * @param callOnStateChange private parameter used to know if the method is called from a state change\n     */\n  }, {\n    key: \"setUiState\",\n    value: function setUiState(uiState) {\n      var _this5 = this;\n      var callOnStateChange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n      if (!this.mainHelper) {\n        throw new Error(withUsage('The `start` method needs to be called before `setUiState`.'));\n      }\n\n      // We refresh the index UI state to update the local UI state that the\n      // main index passes to the function form of `setUiState`.\n      this.mainIndex.refreshUiState();\n      var nextUiState = typeof uiState === 'function' ? uiState(this.mainIndex.getWidgetUiState({})) : uiState;\n      if (this.onStateChange && callOnStateChange) {\n        this.onStateChange({\n          uiState: nextUiState,\n          setUiState: function setUiState(finalUiState) {\n            setIndexHelperState(typeof finalUiState === 'function' ? finalUiState(nextUiState) : finalUiState, _this5.mainIndex);\n            _this5.scheduleSearch();\n            _this5.onInternalStateChange();\n          }\n        });\n      } else {\n        setIndexHelperState(nextUiState, this.mainIndex);\n        this.scheduleSearch();\n        this.onInternalStateChange();\n      }\n    }\n  }, {\n    key: \"getUiState\",\n    value: function getUiState() {\n      if (this.started) {\n        // We refresh the index UI state to make sure changes from `refine` are taken in account\n        this.mainIndex.refreshUiState();\n      }\n      return this.mainIndex.getWidgetUiState({});\n    }\n  }, {\n    key: \"createURL\",\n    value: function createURL() {\n      var nextState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n      if (!this.started) {\n        throw new Error(withUsage('The `start` method needs to be called before `createURL`.'));\n      }\n      return this._createURL(nextState);\n    }\n  }, {\n    key: \"refresh\",\n    value: function refresh() {\n      if (!this.mainHelper) {\n        throw new Error(withUsage('The `start` method needs to be called before `refresh`.'));\n      }\n      this.mainHelper.clearCache().search();\n    }\n  }]);\n  return InstantSearch;\n}(EventEmitter);\nexport default InstantSearch;"
  },
  {
    "path": "js/instantsearch.js/es/lib/createHelpers.d.ts",
    "content": "import type { HoganHelpers } from '../types';\ntype DefaultHoganHelpers = HoganHelpers<'formatNumber' | 'highlight' | 'reverseHighlight' | 'snippet' | 'reverseSnippet' | 'insights'>;\nexport default function hoganHelpers({ numberLocale, }: {\n    numberLocale?: string;\n}): DefaultHoganHelpers;\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/createHelpers.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { highlight as _highlight, reverseHighlight as _reverseHighlight, snippet as _snippet, reverseSnippet as _reverseSnippet, insights as _insights } from \"../helpers/index.js\";\nimport { formatNumber as _formatNumber } from \"./formatNumber.js\";\nexport default function hoganHelpers(_ref) {\n  var numberLocale = _ref.numberLocale;\n  return {\n    formatNumber: function formatNumber(value, render) {\n      return _formatNumber(Number(render(value)), numberLocale);\n    },\n    highlight: function highlight(options, render) {\n      try {\n        var highlightOptions = JSON.parse(options);\n        return render(_highlight(_objectSpread(_objectSpread({}, highlightOptions), {}, {\n          hit: this\n        })));\n      } catch (error) {\n        throw new Error(\"\\nThe highlight helper expects a JSON object of the format:\\n{ \\\"attribute\\\": \\\"name\\\", \\\"highlightedTagName\\\": \\\"mark\\\" }\");\n      }\n    },\n    reverseHighlight: function reverseHighlight(options, render) {\n      try {\n        var reverseHighlightOptions = JSON.parse(options);\n        return render(_reverseHighlight(_objectSpread(_objectSpread({}, reverseHighlightOptions), {}, {\n          hit: this\n        })));\n      } catch (error) {\n        throw new Error(\"\\n  The reverseHighlight helper expects a JSON object of the format:\\n  { \\\"attribute\\\": \\\"name\\\", \\\"highlightedTagName\\\": \\\"mark\\\" }\");\n      }\n    },\n    snippet: function snippet(options, render) {\n      try {\n        var snippetOptions = JSON.parse(options);\n        return render(_snippet(_objectSpread(_objectSpread({}, snippetOptions), {}, {\n          hit: this\n        })));\n      } catch (error) {\n        throw new Error(\"\\nThe snippet helper expects a JSON object of the format:\\n{ \\\"attribute\\\": \\\"name\\\", \\\"highlightedTagName\\\": \\\"mark\\\" }\");\n      }\n    },\n    reverseSnippet: function reverseSnippet(options, render) {\n      try {\n        var reverseSnippetOptions = JSON.parse(options);\n        return render(_reverseSnippet(_objectSpread(_objectSpread({}, reverseSnippetOptions), {}, {\n          hit: this\n        })));\n      } catch (error) {\n        throw new Error(\"\\n  The reverseSnippet helper expects a JSON object of the format:\\n  { \\\"attribute\\\": \\\"name\\\", \\\"highlightedTagName\\\": \\\"mark\\\" }\");\n      }\n    },\n    insights: function insights(options, render) {\n      try {\n        var _JSON$parse = JSON.parse(options),\n          method = _JSON$parse.method,\n          payload = _JSON$parse.payload;\n        return render(_insights(method, _objectSpread({\n          objectIDs: [this.objectID]\n        }, payload)));\n      } catch (error) {\n        throw new Error(\"\\nThe insights helper expects a JSON object of the format:\\n{ \\\"method\\\": \\\"method-name\\\", \\\"payload\\\": { \\\"eventName\\\": \\\"name of the event\\\" } }\");\n      }\n    }\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/formatNumber.d.ts",
    "content": "export declare function formatNumber(value: number, numberLocale?: string): string;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/formatNumber.js",
    "content": "export function formatNumber(value, numberLocale) {\n  return value.toLocaleString(numberLocale);\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/infiniteHitsCache/index.d.ts",
    "content": "export { default as createInfiniteHitsSessionStorageCache } from './sessionStorage';\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/infiniteHitsCache/index.js",
    "content": "export { default as createInfiniteHitsSessionStorageCache } from \"./sessionStorage.js\";"
  },
  {
    "path": "js/instantsearch.js/es/lib/infiniteHitsCache/sessionStorage.d.ts",
    "content": "import type { InfiniteHitsCache } from '../../connectors/infinite-hits/connectInfiniteHits';\nexport default function createInfiniteHitsSessionStorageCache({ key, }?: {\n    /**\n     * If you display multiple instances of infiniteHits on the same page,\n     * you must provide a unique key for each instance.\n     */\n    key?: string;\n}): InfiniteHitsCache;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/infiniteHitsCache/sessionStorage.js",
    "content": "var _excluded = [\"page\"];\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport { isEqual, safelyRunOnBrowser } from \"../utils/index.js\";\nfunction getStateWithoutPage(state) {\n  var _ref = state || {},\n    page = _ref.page,\n    rest = _objectWithoutProperties(_ref, _excluded);\n  return rest;\n}\nexport default function createInfiniteHitsSessionStorageCache() {\n  var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n    key = _ref2.key;\n  var KEY = ['ais.infiniteHits', key].filter(Boolean).join(':');\n  return {\n    read: function read(_ref3) {\n      var state = _ref3.state;\n      var sessionStorage = safelyRunOnBrowser(function (_ref4) {\n        var window = _ref4.window;\n        return window.sessionStorage;\n      });\n      if (!sessionStorage) {\n        return null;\n      }\n      try {\n        var cache = JSON.parse(\n        // @ts-expect-error JSON.parse() requires a string, but it actually accepts null, too.\n        sessionStorage.getItem(KEY));\n        return cache && isEqual(cache.state, getStateWithoutPage(state)) ? cache.hits : null;\n      } catch (error) {\n        if (error instanceof SyntaxError) {\n          try {\n            sessionStorage.removeItem(KEY);\n          } catch (err) {\n            // do nothing\n          }\n        }\n        return null;\n      }\n    },\n    write: function write(_ref5) {\n      var state = _ref5.state,\n        hits = _ref5.hits;\n      var sessionStorage = safelyRunOnBrowser(function (_ref6) {\n        var window = _ref6.window;\n        return window.sessionStorage;\n      });\n      if (!sessionStorage) {\n        return;\n      }\n      try {\n        sessionStorage.setItem(KEY, JSON.stringify({\n          state: getStateWithoutPage(state),\n          hits: hits\n        }));\n      } catch (error) {\n        // do nothing\n      }\n    }\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/insights/client.d.ts",
    "content": "import type { Hit, InsightsClientMethod, InsightsClientPayload, Connector } from '../../types';\nimport type { SearchResults } from 'algoliasearch-helper';\nexport declare const inferPayload: ({ method, results, hits, objectIDs, }: {\n    method: InsightsClientMethod;\n    results: SearchResults;\n    hits: Hit[];\n    objectIDs: string[];\n}) => Omit<InsightsClientPayload, \"eventName\">;\n/**\n * @deprecated This function will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\n * It passes `insights` to `HitsWithInsightsListener` and `InfiniteHitsWithInsightsListener`.\n */\nexport default function withInsights<TConnector extends Connector<any, any>>(connector: TConnector): TConnector;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/insights/client.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { uniq, find, createDocumentationMessageGenerator, warning } from \"../utils/index.js\";\nvar getSelectedHits = function getSelectedHits(hits, selectedObjectIDs) {\n  return selectedObjectIDs.map(function (objectID) {\n    var hit = find(hits, function (h) {\n      return h.objectID === objectID;\n    });\n    if (typeof hit === 'undefined') {\n      throw new Error(\"Could not find objectID \\\"\".concat(objectID, \"\\\" passed to `clickedObjectIDsAfterSearch` in the returned hits. This is necessary to infer the absolute position and the query ID.\"));\n    }\n    return hit;\n  });\n};\nvar getQueryID = function getQueryID(selectedHits) {\n  var queryIDs = uniq(selectedHits.map(function (hit) {\n    return hit.__queryID;\n  }));\n  if (queryIDs.length > 1) {\n    throw new Error('Insights currently allows a single `queryID`. The `objectIDs` provided map to multiple `queryID`s.');\n  }\n  var queryID = queryIDs[0];\n  if (typeof queryID !== 'string') {\n    throw new Error(\"Could not infer `queryID`. Ensure InstantSearch `clickAnalytics: true` was added with the Configure widget.\\n\\nSee: https://alg.li/lNiZZ7\");\n  }\n  return queryID;\n};\nvar getPositions = function getPositions(selectedHits) {\n  return selectedHits.map(function (hit) {\n    return hit.__position;\n  });\n};\nexport var inferPayload = function inferPayload(_ref) {\n  var method = _ref.method,\n    results = _ref.results,\n    hits = _ref.hits,\n    objectIDs = _ref.objectIDs;\n  var index = results.index;\n  var selectedHits = getSelectedHits(hits, objectIDs);\n  var queryID = getQueryID(selectedHits);\n  switch (method) {\n    case 'clickedObjectIDsAfterSearch':\n      {\n        var positions = getPositions(selectedHits);\n        return {\n          index: index,\n          queryID: queryID,\n          objectIDs: objectIDs,\n          positions: positions\n        };\n      }\n    case 'convertedObjectIDsAfterSearch':\n      return {\n        index: index,\n        queryID: queryID,\n        objectIDs: objectIDs\n      };\n    default:\n      throw new Error(\"Unsupported method passed to insights: \\\"\".concat(method, \"\\\".\"));\n  }\n};\nvar wrapInsightsClient = function wrapInsightsClient(aa, results, hits) {\n  return function (method) {\n    for (var _len = arguments.length, payloads = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n      payloads[_key - 1] = arguments[_key];\n    }\n    var payload = payloads[0];\n    process.env.NODE_ENV === 'development' ? warning(false, \"`insights` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `insights` middleware.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\") : void 0;\n    if (!aa) {\n      var withInstantSearchUsage = createDocumentationMessageGenerator({\n        name: 'instantsearch'\n      });\n      throw new Error(withInstantSearchUsage('The `insightsClient` option has not been provided to `instantsearch`.'));\n    }\n    if (!Array.isArray(payload.objectIDs)) {\n      throw new TypeError('Expected `objectIDs` to be an array.');\n    }\n    var inferredPayload = inferPayload({\n      method: method,\n      results: results,\n      hits: hits,\n      objectIDs: payload.objectIDs\n    });\n    aa(method, _objectSpread(_objectSpread({}, inferredPayload), payload));\n  };\n};\n\n/**\n * @deprecated This function will be still supported in 4.x releases, but not further. It is replaced by the `insights` middleware. For more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\n * It passes `insights` to `HitsWithInsightsListener` and `InfiniteHitsWithInsightsListener`.\n */\nexport default function withInsights(connector) {\n  return function (renderFn, unmountFn) {\n    return connector(function (renderOptions, isFirstRender) {\n      var results = renderOptions.results,\n        hits = renderOptions.hits,\n        instantSearchInstance = renderOptions.instantSearchInstance;\n      if (results && hits && instantSearchInstance) {\n        var insights = wrapInsightsClient(instantSearchInstance.insightsClient, results, hits);\n        return renderFn(_objectSpread(_objectSpread({}, renderOptions), {}, {\n          insights: insights\n        }), isFirstRender);\n      }\n      return renderFn(renderOptions, isFirstRender);\n    }, unmountFn);\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/insights/index.d.ts",
    "content": "export { default as withInsights, inferPayload as inferInsightsPayload, } from './client';\nexport { default as withInsightsListener } from './listener';\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/insights/index.js",
    "content": "export { default as withInsights, inferPayload as inferInsightsPayload } from \"./client.js\";\nexport { default as withInsightsListener } from \"./listener.js\";"
  },
  {
    "path": "js/instantsearch.js/es/lib/insights/listener.d.ts",
    "content": "\nimport { h } from 'preact';\nimport type { InsightsEvent } from '../../middlewares/createInsightsMiddleware';\nimport type { InsightsClient } from '../../types';\nexport type InsightsEventHandlerOptions = {\n    insights?: InsightsClient;\n    sendEvent: (event: InsightsEvent) => void;\n};\nexport declare const createInsightsEventHandler: ({ insights, sendEvent }: InsightsEventHandlerOptions) => (event: MouseEvent) => void;\n/**\n * @deprecated use `sendEvent` directly instead\n */\nexport default function withInsightsListener(BaseComponent: any): (props: {\n    [key: string]: any;\n} & InsightsEventHandlerOptions) => h.JSX.Element;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/insights/listener.js",
    "content": "import { h } from 'preact';\nimport { readDataAttributes } from \"../../helpers/insights.js\";\nimport { deserializePayload, warning } from \"../utils/index.js\";\nexport var createInsightsEventHandler = function createInsightsEventHandler(_ref) {\n  var insights = _ref.insights,\n    sendEvent = _ref.sendEvent;\n  return function (event) {\n    // new way, e.g. bindEvent(\"click\", hit, \"Hit clicked\")\n    var insightsThroughSendEvent = findInsightsTarget(event.target, event.currentTarget, function (element) {\n      return element.hasAttribute('data-insights-event');\n    });\n    if (insightsThroughSendEvent) {\n      var payload = parseInsightsEvent(insightsThroughSendEvent);\n      payload.forEach(function (single) {\n        return sendEvent(single);\n      });\n    }\n\n    // old way, e.g. instantsearch.insights(\"clickedObjectIDsAfterSearch\", { .. })\n    var insightsThroughFunction = findInsightsTarget(event.target, event.currentTarget, function (element) {\n      return element.hasAttribute('data-insights-method') && element.hasAttribute('data-insights-payload');\n    });\n    if (insightsThroughFunction) {\n      var _readDataAttributes = readDataAttributes(insightsThroughFunction),\n        method = _readDataAttributes.method,\n        _payload = _readDataAttributes.payload;\n      insights(method, _payload);\n    }\n  };\n};\nfunction findInsightsTarget(startElement, endElement, validator) {\n  var element = startElement;\n  while (element && !validator(element)) {\n    if (element === endElement) {\n      return null;\n    }\n    element = element.parentElement;\n  }\n  return element;\n}\nfunction parseInsightsEvent(element) {\n  var serializedPayload = element.getAttribute('data-insights-event');\n  if (typeof serializedPayload !== 'string') {\n    throw new Error('The insights middleware expects `data-insights-event` to be a base64-encoded JSON string.');\n  }\n  try {\n    return deserializePayload(serializedPayload);\n  } catch (error) {\n    throw new Error('The insights middleware was unable to parse `data-insights-event`.');\n  }\n}\n\n/**\n * @deprecated use `sendEvent` directly instead\n */\nexport default function withInsightsListener(BaseComponent) {\n  process.env.NODE_ENV === 'development' ? warning(false, 'The `withInsightsListener` function is deprecated and will be removed in the next major version. Please use `sendEvent` directly instead.') : void 0;\n  return function WithInsightsListener(props) {\n    var handleClick = createInsightsEventHandler(props);\n    return h(\"div\", {\n      onClick: handleClick\n    }, h(BaseComponent, props));\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/main.js",
    "content": "import InstantSearch from './InstantSearch';\nimport version from './version';\nimport * as connectors from '../connectors/index';\nimport * as widgets from '../widgets/index';\nimport * as helpers from '../helpers/index';\nimport * as middlewares from '../middlewares/index';\nimport * as routers from './routers/index';\nimport * as stateMappings from './stateMappings/index';\nimport { createInfiniteHitsSessionStorageCache } from './infiniteHitsCache/index';\n\n/**\n * InstantSearch is the main component of InstantSearch.js. This object\n * manages the widget and lets you add new ones.\n *\n * Two parameters are required to get you started with InstantSearch.js:\n *  - `indexName`: the main index that you will use for your new search UI\n *  - `searchClient`: the search client to plug to InstantSearch.js\n *\n * The [search client provided by Algolia](https://github.com/algolia/algoliasearch-client-javascript)\n * needs an `appId` and an `apiKey`. Those parameters can be found in your\n * [Algolia dashboard](https://www.algolia.com/api-keys).\n *\n * If you want to get up and running quickly with InstantSearch.js, have a\n * look at the [getting started](getting-started.html).\n * @function instantsearch\n * @param {InstantSearchOptions} options The options\n */\nvar instantsearch = function instantsearch(options) {\n  return new InstantSearch(options);\n};\n\ninstantsearch.routers = routers;\ninstantsearch.stateMappings = stateMappings;\ninstantsearch.connectors = connectors;\ninstantsearch.widgets = widgets;\ninstantsearch.version = version;\ninstantsearch.createInfiniteHitsSessionStorageCache = createInfiniteHitsSessionStorageCache;\ninstantsearch.highlight = helpers.highlight;\ninstantsearch.reverseHighlight = helpers.reverseHighlight;\ninstantsearch.snippet = helpers.snippet;\ninstantsearch.reverseSnippet = helpers.reverseSnippet;\ninstantsearch.insights = helpers.insights;\ninstantsearch.middlewares = middlewares;\nexport default instantsearch;"
  },
  {
    "path": "js/instantsearch.js/es/lib/routers/history.d.ts",
    "content": "import qs from 'qs';\nimport type { Router, UiState } from '../../types';\ntype CreateURL<TRouteState> = (args: {\n    qsModule: typeof qs;\n    routeState: TRouteState;\n    location: Location;\n}) => string;\ntype ParseURL<TRouteState> = (args: {\n    qsModule: typeof qs;\n    location: Location;\n}) => TRouteState;\nexport type BrowserHistoryArgs<TRouteState> = {\n    windowTitle?: (routeState: TRouteState) => string;\n    writeDelay: number;\n    createURL: CreateURL<TRouteState>;\n    parseURL: ParseURL<TRouteState>;\n    getLocation: () => Location;\n    start?: (onUpdate: () => void) => void;\n    dispose?: () => void;\n    push?: (url: string) => void;\n    /**\n     * Whether the URL should be cleaned up when the router is disposed.\n     * This can be useful when closing a modal containing InstantSearch, to\n     * remove active refinements from the URL.\n     * @default true\n     */\n    cleanUrlOnDispose?: boolean;\n};\ndeclare class BrowserHistory<TRouteState> implements Router<TRouteState> {\n    $$type: string;\n    /**\n     * Transforms a UI state into a title for the page.\n     */\n    private readonly windowTitle?;\n    /**\n     * Time in milliseconds before performing a write in the history.\n     * It prevents from adding too many entries in the history and\n     * makes the back button more usable.\n     *\n     * @default 400\n     */\n    private readonly writeDelay;\n    /**\n     * Creates a full URL based on the route state.\n     * The storage adaptor maps all syncable keys to the query string of the URL.\n     */\n    private readonly _createURL;\n    /**\n     * Parses the URL into a route state.\n     * It should be symmetrical to `createURL`.\n     */\n    private readonly parseURL;\n    /**\n     * Returns the location to store in the history.\n     * @default () => window.location\n     */\n    private readonly getLocation;\n    private writeTimer?;\n    private _onPopState?;\n    /**\n     * Indicates if last action was back/forward in the browser.\n     */\n    private inPopState;\n    /**\n     * Indicates whether the history router is disposed or not.\n     */\n    protected isDisposed: boolean;\n    /**\n     * Indicates the window.history.length before the last call to\n     * window.history.pushState (called in `write`).\n     * It allows to determine if a `pushState` has been triggered elsewhere,\n     * and thus to prevent the `write` method from calling `pushState`.\n     */\n    private latestAcknowledgedHistory;\n    private _start?;\n    private _dispose?;\n    private _push?;\n    private _cleanUrlOnDispose;\n    /**\n     * Initializes a new storage provider that syncs the search state to the URL\n     * using web APIs (`window.location.pushState` and `onpopstate` event).\n     */\n    constructor({ windowTitle, writeDelay, createURL, parseURL, getLocation, start, dispose, push, cleanUrlOnDispose, }: BrowserHistoryArgs<TRouteState>);\n    /**\n     * Reads the URL and returns a syncable UI search state.\n     */\n    read(): TRouteState;\n    /**\n     * Pushes a search state into the URL.\n     */\n    write(routeState: TRouteState): void;\n    /**\n     * Sets a callback on the `onpopstate` event of the history API of the current page.\n     * It enables the URL sync to keep track of the changes.\n     */\n    onUpdate(callback: (routeState: TRouteState) => void): void;\n    /**\n     * Creates a complete URL from a given syncable UI state.\n     *\n     * It always generates the full URL, not a relative one.\n     * This allows to handle cases like using a <base href>.\n     * See: https://github.com/algolia/instantsearch/issues/790\n     */\n    createURL(routeState: TRouteState): string;\n    /**\n     * Removes the event listener and cleans up the URL.\n     */\n    dispose(): void;\n    start(): void;\n    private shouldWrite;\n}\nexport default function historyRouter<TRouteState = UiState>({ createURL, parseURL, writeDelay, windowTitle, getLocation, start, dispose, push, cleanUrlOnDispose, }?: Partial<BrowserHistoryArgs<TRouteState>>): BrowserHistory<TRouteState>;\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/routers/history.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport qs from 'qs';\nimport { createDocumentationLink, safelyRunOnBrowser, warning } from \"../utils/index.js\";\nvar setWindowTitle = function setWindowTitle(title) {\n  if (title) {\n    // This function is only executed on browsers so we can disable this check.\n    // eslint-disable-next-line no-restricted-globals\n    window.document.title = title;\n  }\n};\nvar BrowserHistory = /*#__PURE__*/function () {\n  /**\n   * Initializes a new storage provider that syncs the search state to the URL\n   * using web APIs (`window.location.pushState` and `onpopstate` event).\n   */\n  function BrowserHistory(_ref) {\n    var _this = this;\n    var windowTitle = _ref.windowTitle,\n      _ref$writeDelay = _ref.writeDelay,\n      writeDelay = _ref$writeDelay === void 0 ? 400 : _ref$writeDelay,\n      createURL = _ref.createURL,\n      parseURL = _ref.parseURL,\n      getLocation = _ref.getLocation,\n      start = _ref.start,\n      dispose = _ref.dispose,\n      push = _ref.push,\n      cleanUrlOnDispose = _ref.cleanUrlOnDispose;\n    _classCallCheck(this, BrowserHistory);\n    _defineProperty(this, \"$$type\", 'ais.browser');\n    /**\n     * Transforms a UI state into a title for the page.\n     */\n    _defineProperty(this, \"windowTitle\", void 0);\n    /**\n     * Time in milliseconds before performing a write in the history.\n     * It prevents from adding too many entries in the history and\n     * makes the back button more usable.\n     *\n     * @default 400\n     */\n    _defineProperty(this, \"writeDelay\", void 0);\n    /**\n     * Creates a full URL based on the route state.\n     * The storage adaptor maps all syncable keys to the query string of the URL.\n     */\n    _defineProperty(this, \"_createURL\", void 0);\n    /**\n     * Parses the URL into a route state.\n     * It should be symmetrical to `createURL`.\n     */\n    _defineProperty(this, \"parseURL\", void 0);\n    /**\n     * Returns the location to store in the history.\n     * @default () => window.location\n     */\n    _defineProperty(this, \"getLocation\", void 0);\n    _defineProperty(this, \"writeTimer\", void 0);\n    _defineProperty(this, \"_onPopState\", void 0);\n    /**\n     * Indicates if last action was back/forward in the browser.\n     */\n    _defineProperty(this, \"inPopState\", false);\n    /**\n     * Indicates whether the history router is disposed or not.\n     */\n    _defineProperty(this, \"isDisposed\", false);\n    /**\n     * Indicates the window.history.length before the last call to\n     * window.history.pushState (called in `write`).\n     * It allows to determine if a `pushState` has been triggered elsewhere,\n     * and thus to prevent the `write` method from calling `pushState`.\n     */\n    _defineProperty(this, \"latestAcknowledgedHistory\", 0);\n    _defineProperty(this, \"_start\", void 0);\n    _defineProperty(this, \"_dispose\", void 0);\n    _defineProperty(this, \"_push\", void 0);\n    _defineProperty(this, \"_cleanUrlOnDispose\", void 0);\n    this.windowTitle = windowTitle;\n    this.writeTimer = undefined;\n    this.writeDelay = writeDelay;\n    this._createURL = createURL;\n    this.parseURL = parseURL;\n    this.getLocation = getLocation;\n    this._start = start;\n    this._dispose = dispose;\n    this._push = push;\n    this._cleanUrlOnDispose = typeof cleanUrlOnDispose === 'undefined' ? true : cleanUrlOnDispose;\n    if (process.env.NODE_ENV === 'development' && typeof cleanUrlOnDispose === 'undefined') {\n      // eslint-disable-next-line no-console\n      console.info(\"Starting from the next major version, InstantSearch will not clean up the URL from active refinements when it is disposed.\\n\\nWe recommend setting `cleanUrlOnDispose` to false to adopt this change today.\\nTo stay with the current behaviour and remove this warning, set the option to true.\\n\\nSee documentation: \".concat(createDocumentationLink({\n        name: 'history-router'\n      }), \"#widget-param-cleanurlondispose\"));\n    }\n    safelyRunOnBrowser(function (_ref2) {\n      var window = _ref2.window;\n      var title = _this.windowTitle && _this.windowTitle(_this.read());\n      setWindowTitle(title);\n      _this.latestAcknowledgedHistory = window.history.length;\n    });\n  }\n\n  /**\n   * Reads the URL and returns a syncable UI search state.\n   */\n  _createClass(BrowserHistory, [{\n    key: \"read\",\n    value: function read() {\n      return this.parseURL({\n        qsModule: qs,\n        location: this.getLocation()\n      });\n    }\n\n    /**\n     * Pushes a search state into the URL.\n     */\n  }, {\n    key: \"write\",\n    value: function write(routeState) {\n      var _this2 = this;\n      safelyRunOnBrowser(function (_ref3) {\n        var window = _ref3.window;\n        var url = _this2.createURL(routeState);\n        var title = _this2.windowTitle && _this2.windowTitle(routeState);\n        if (_this2.writeTimer) {\n          clearTimeout(_this2.writeTimer);\n        }\n        _this2.writeTimer = setTimeout(function () {\n          setWindowTitle(title);\n          if (_this2.shouldWrite(url)) {\n            if (_this2._push) {\n              _this2._push(url);\n            } else {\n              window.history.pushState(routeState, title || '', url);\n            }\n            _this2.latestAcknowledgedHistory = window.history.length;\n          }\n          _this2.inPopState = false;\n          _this2.writeTimer = undefined;\n        }, _this2.writeDelay);\n      });\n    }\n\n    /**\n     * Sets a callback on the `onpopstate` event of the history API of the current page.\n     * It enables the URL sync to keep track of the changes.\n     */\n  }, {\n    key: \"onUpdate\",\n    value: function onUpdate(callback) {\n      var _this3 = this;\n      if (this._start) {\n        this._start(function () {\n          callback(_this3.read());\n        });\n      }\n      this._onPopState = function () {\n        if (_this3.writeTimer) {\n          clearTimeout(_this3.writeTimer);\n          _this3.writeTimer = undefined;\n        }\n        _this3.inPopState = true;\n\n        // We always read the state from the URL because the state of the history\n        // can be incorect in some cases (e.g. using React Router).\n        callback(_this3.read());\n      };\n      safelyRunOnBrowser(function (_ref4) {\n        var window = _ref4.window;\n        window.addEventListener('popstate', _this3._onPopState);\n      });\n    }\n\n    /**\n     * Creates a complete URL from a given syncable UI state.\n     *\n     * It always generates the full URL, not a relative one.\n     * This allows to handle cases like using a <base href>.\n     * See: https://github.com/algolia/instantsearch/issues/790\n     */\n  }, {\n    key: \"createURL\",\n    value: function createURL(routeState) {\n      var url = this._createURL({\n        qsModule: qs,\n        routeState: routeState,\n        location: this.getLocation()\n      });\n      if (process.env.NODE_ENV === 'development') {\n        try {\n          // We just want to check if the URL is valid.\n          // eslint-disable-next-line no-new\n          new URL(url);\n        } catch (e) {\n          process.env.NODE_ENV === 'development' ? warning(false, \"The URL returned by the `createURL` function is invalid.\\nPlease make sure it returns an absolute URL to avoid issues, e.g: `https://algolia.com/search?query=iphone`.\") : void 0;\n        }\n      }\n      return url;\n    }\n\n    /**\n     * Removes the event listener and cleans up the URL.\n     */\n  }, {\n    key: \"dispose\",\n    value: function dispose() {\n      var _this4 = this;\n      if (this._dispose) {\n        this._dispose();\n      }\n      this.isDisposed = true;\n      safelyRunOnBrowser(function (_ref5) {\n        var window = _ref5.window;\n        if (_this4._onPopState) {\n          window.removeEventListener('popstate', _this4._onPopState);\n        }\n      });\n      if (this.writeTimer) {\n        clearTimeout(this.writeTimer);\n      }\n      if (this._cleanUrlOnDispose) {\n        this.write({});\n      }\n    }\n  }, {\n    key: \"start\",\n    value: function start() {\n      this.isDisposed = false;\n    }\n  }, {\n    key: \"shouldWrite\",\n    value: function shouldWrite(url) {\n      var _this5 = this;\n      return safelyRunOnBrowser(function (_ref6) {\n        var window = _ref6.window;\n        // When disposed and the cleanUrlOnDispose is set to false, we do not want to write the URL.\n        if (_this5.isDisposed && !_this5._cleanUrlOnDispose) {\n          return false;\n        }\n\n        // We do want to `pushState` if:\n        // - the router is not disposed, IS.js needs to update the URL\n        // OR\n        // - the last write was from InstantSearch.js\n        // (unlike a SPA, where it would have last written)\n        var lastPushWasByISAfterDispose = !(_this5.isDisposed && _this5.latestAcknowledgedHistory !== window.history.length);\n        return (\n          // When the last state change was through popstate, the IS.js state changes,\n          // but that should not write the URL.\n          !_this5.inPopState &&\n          // When the previous pushState after dispose was by IS.js, we want to write the URL.\n          lastPushWasByISAfterDispose &&\n          // When the URL is the same as the current one, we do not want to write it.\n          url !== window.location.href\n        );\n      });\n    }\n  }]);\n  return BrowserHistory;\n}();\nexport default function historyRouter() {\n  var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n    _ref7$createURL = _ref7.createURL,\n    createURL = _ref7$createURL === void 0 ? function (_ref8) {\n      var qsModule = _ref8.qsModule,\n        routeState = _ref8.routeState,\n        location = _ref8.location;\n      var protocol = location.protocol,\n        hostname = location.hostname,\n        _location$port = location.port,\n        port = _location$port === void 0 ? '' : _location$port,\n        pathname = location.pathname,\n        hash = location.hash;\n      var queryString = qsModule.stringify(routeState);\n      var portWithPrefix = port === '' ? '' : \":\".concat(port);\n\n      // IE <= 11 has no proper `location.origin` so we cannot rely on it.\n      if (!queryString) {\n        return \"\".concat(protocol, \"//\").concat(hostname).concat(portWithPrefix).concat(pathname).concat(hash);\n      }\n      return \"\".concat(protocol, \"//\").concat(hostname).concat(portWithPrefix).concat(pathname, \"?\").concat(queryString).concat(hash);\n    } : _ref7$createURL,\n    _ref7$parseURL = _ref7.parseURL,\n    parseURL = _ref7$parseURL === void 0 ? function (_ref9) {\n      var qsModule = _ref9.qsModule,\n        location = _ref9.location;\n      // `qs` by default converts arrays with more than 20 items to an object.\n      // We want to avoid this because the data structure manipulated can therefore vary.\n      // Setting the limit to `100` seems a good number because the engine's default is 100\n      // (it can go up to 1000 but it is very unlikely to select more than 100 items in the UI).\n      //\n      // Using an `arrayLimit` of `n` allows `n + 1` items.\n      //\n      // See:\n      //   - https://github.com/ljharb/qs#parsing-arrays\n      //   - https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/\n      return qsModule.parse(location.search.slice(1), {\n        arrayLimit: 99\n      });\n    } : _ref7$parseURL,\n    _ref7$writeDelay = _ref7.writeDelay,\n    writeDelay = _ref7$writeDelay === void 0 ? 400 : _ref7$writeDelay,\n    windowTitle = _ref7.windowTitle,\n    _ref7$getLocation = _ref7.getLocation,\n    getLocation = _ref7$getLocation === void 0 ? function () {\n      return safelyRunOnBrowser(function (_ref10) {\n        var window = _ref10.window;\n        return window.location;\n      }, {\n        fallback: function fallback() {\n          throw new Error('You need to provide `getLocation` to the `history` router in environments where `window` does not exist.');\n        }\n      });\n    } : _ref7$getLocation,\n    start = _ref7.start,\n    dispose = _ref7.dispose,\n    push = _ref7.push,\n    cleanUrlOnDispose = _ref7.cleanUrlOnDispose;\n  return new BrowserHistory({\n    createURL: createURL,\n    parseURL: parseURL,\n    writeDelay: writeDelay,\n    windowTitle: windowTitle,\n    getLocation: getLocation,\n    start: start,\n    dispose: dispose,\n    push: push,\n    cleanUrlOnDispose: cleanUrlOnDispose\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/routers/index.d.ts",
    "content": "export { default as history } from './history';\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/routers/index.js",
    "content": "export { default as history } from \"./history.js\";"
  },
  {
    "path": "js/instantsearch.js/es/lib/server.d.ts",
    "content": "import type { IndexWidget, InitialResults, InstantSearch, SearchOptions } from '../types';\n/**\n * Waits for the results from the search instance to coordinate the next steps\n * in `getServerState()`.\n */\nexport declare function waitForResults(search: InstantSearch, skipRecommend?: boolean): Promise<SearchOptions[]>;\n/**\n * Walks the InstantSearch root index to construct the initial results.\n */\nexport declare function getInitialResults(rootIndex: IndexWidget, \n/**\n * Search parameters sent to the search client,\n * returned by `waitForResults()`.\n */\nrequestParamsList?: SearchOptions[]): InitialResults;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/server.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { walkIndex } from \"./utils/index.js\";\n/**\n * Waits for the results from the search instance to coordinate the next steps\n * in `getServerState()`.\n */\nexport function waitForResults(search) {\n  var skipRecommend = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n  var helper = search.mainHelper;\n\n  // Extract search parameters from the search client to use them\n  // later during hydration.\n  var requestParamsList;\n  var client = helper.getClient();\n  if (search.compositionID) {\n    helper.setClient(_objectSpread(_objectSpread({}, client), {}, {\n      search: function search(query) {\n        requestParamsList = [query.requestBody.params];\n        return client.search(query);\n      }\n    }));\n  } else {\n    helper.setClient(_objectSpread(_objectSpread({}, client), {}, {\n      search: function search(queries) {\n        requestParamsList = queries.map(function (_ref) {\n          var params = _ref.params;\n          return params;\n        });\n        return client.search(queries);\n      }\n    }));\n  }\n  if (search._hasSearchWidget) {\n    if (search.compositionID) {\n      helper.searchWithComposition();\n    } else {\n      helper.searchOnlyWithDerivedHelpers();\n    }\n  }\n  !skipRecommend && search._hasRecommendWidget && helper.recommend();\n  return new Promise(function (resolve, reject) {\n    var searchResultsReceived = !search._hasSearchWidget;\n    var recommendResultsReceived = !search._hasRecommendWidget || skipRecommend;\n    // All derived helpers resolve in the same tick so we're safe only relying\n    // on the first one.\n    helper.derivedHelpers[0].on('result', function () {\n      searchResultsReceived = true;\n      if (recommendResultsReceived) {\n        resolve(requestParamsList);\n      }\n    });\n    helper.derivedHelpers[0].on('recommend:result', function () {\n      recommendResultsReceived = true;\n      if (searchResultsReceived) {\n        resolve(requestParamsList);\n      }\n    });\n\n    // However, we listen to errors that can happen on any derived helper because\n    // any error is critical.\n    helper.on('error', function (error) {\n      reject(error);\n    });\n    search.on('error', function (error) {\n      reject(error);\n    });\n    helper.derivedHelpers.forEach(function (derivedHelper) {\n      return derivedHelper.on('error', function (error) {\n        reject(error);\n      });\n    });\n  });\n}\n\n/**\n * Walks the InstantSearch root index to construct the initial results.\n */\nexport function getInitialResults(rootIndex,\n/**\n * Search parameters sent to the search client,\n * returned by `waitForResults()`.\n */\nrequestParamsList) {\n  var initialResults = {};\n  var requestParamsIndex = 0;\n  walkIndex(rootIndex, function (widget) {\n    var _widget$getHelper;\n    var searchResults = widget.getResults();\n    var recommendResults = (_widget$getHelper = widget.getHelper()) === null || _widget$getHelper === void 0 ? void 0 : _widget$getHelper.lastRecommendResults;\n    if (searchResults || recommendResults) {\n      var _searchResults$_rawRe, _requestParams$, _requestParams$2;\n      var resultsCount = (searchResults === null || searchResults === void 0 ? void 0 : (_searchResults$_rawRe = searchResults._rawResults) === null || _searchResults$_rawRe === void 0 ? void 0 : _searchResults$_rawRe.length) || 0;\n      var requestParams = resultsCount ? requestParamsList === null || requestParamsList === void 0 ? void 0 : requestParamsList.slice(requestParamsIndex, requestParamsIndex + resultsCount) : [];\n      requestParamsIndex += resultsCount;\n      initialResults[widget.getIndexId()] = _objectSpread(_objectSpread(_objectSpread({}, searchResults && {\n        state: _objectSpread(_objectSpread({}, searchResults._state), {}, {\n          clickAnalytics: requestParams === null || requestParams === void 0 ? void 0 : (_requestParams$ = requestParams[0]) === null || _requestParams$ === void 0 ? void 0 : _requestParams$.clickAnalytics,\n          userToken: requestParams === null || requestParams === void 0 ? void 0 : (_requestParams$2 = requestParams[0]) === null || _requestParams$2 === void 0 ? void 0 : _requestParams$2.userToken\n        }),\n        results: searchResults._rawResults\n      }), recommendResults && {\n        recommendResults: {\n          // We have to stringify + parse because of some explicitly undefined values.\n          params: JSON.parse(JSON.stringify(recommendResults._state.params)),\n          results: recommendResults._rawResults\n        }\n      }), requestParams && {\n        requestParams: requestParams\n      });\n    }\n  });\n  if (Object.keys(initialResults).length === 0) {\n    throw new Error('The root index does not have any results. Make sure you have at least one widget that provides results.');\n  }\n  return initialResults;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/stateMappings/index.d.ts",
    "content": "export { default as simple } from './simple';\nexport { default as singleIndex } from './singleIndex';\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/stateMappings/index.js",
    "content": "export { default as simple } from \"./simple.js\";\nexport { default as singleIndex } from \"./singleIndex.js\";"
  },
  {
    "path": "js/instantsearch.js/es/lib/stateMappings/simple.d.ts",
    "content": "import type { UiState, StateMapping } from '../../types';\nexport default function simpleStateMapping<TUiState extends UiState = UiState>(): StateMapping<TUiState, TUiState>;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/stateMappings/simple.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _excluded = [\"configure\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction getIndexStateWithoutConfigure(uiState) {\n  var configure = uiState.configure,\n    trackedUiState = _objectWithoutProperties(uiState, _excluded);\n  return trackedUiState;\n}\n\n// technically a URL could contain any key, since users provide it,\n// which is why the input to this function is UiState, not something\n// which excludes \"configure\" as this function does.\nexport default function simpleStateMapping() {\n  return {\n    $$type: 'ais.simple',\n    stateToRoute: function stateToRoute(uiState) {\n      return Object.keys(uiState).reduce(function (state, indexId) {\n        return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, indexId, getIndexStateWithoutConfigure(uiState[indexId])));\n      }, {});\n    },\n    routeToState: function routeToState() {\n      var routeState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n      return Object.keys(routeState).reduce(function (state, indexId) {\n        return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, indexId, getIndexStateWithoutConfigure(routeState[indexId])));\n      }, {});\n    }\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/stateMappings/singleIndex.d.ts",
    "content": "import type { StateMapping, UiState } from '../../types';\nexport default function singleIndexStateMapping<TUiState extends UiState = UiState>(indexName: keyof TUiState): StateMapping<TUiState, TUiState[typeof indexName]>;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/stateMappings/singleIndex.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _excluded = [\"configure\"];\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction getIndexStateWithoutConfigure(uiState) {\n  var configure = uiState.configure,\n    trackedUiState = _objectWithoutProperties(uiState, _excluded);\n  return trackedUiState;\n}\nexport default function singleIndexStateMapping(indexName) {\n  return {\n    $$type: 'ais.singleIndex',\n    stateToRoute: function stateToRoute(uiState) {\n      return getIndexStateWithoutConfigure(uiState[indexName] || {});\n    },\n    routeToState: function routeToState() {\n      var routeState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n      return _defineProperty({}, indexName, getIndexStateWithoutConfigure(routeState));\n    }\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/suit.d.ts",
    "content": "type SuitOptions = {\n    descendantName?: string;\n    modifierName?: string;\n};\ntype SuitSelector = (names?: SuitOptions) => string;\nexport declare const component: (componentName: string) => SuitSelector;\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/suit.js",
    "content": "var NAMESPACE = 'ais';\nexport var component = function component(componentName) {\n  return function () {\n    var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n      descendantName = _ref.descendantName,\n      modifierName = _ref.modifierName;\n    var descendent = descendantName ? \"-\".concat(descendantName) : '';\n    var modifier = modifierName ? \"--\".concat(modifierName) : '';\n    return \"\".concat(NAMESPACE, \"-\").concat(componentName).concat(descendent).concat(modifier);\n  };\n};"
  },
  {
    "path": "js/instantsearch.js/es/lib/templating/index.d.ts",
    "content": "export * from './prepareTemplateProps';\nexport * from './renderTemplate';\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/templating/index.js",
    "content": "export * from \"./prepareTemplateProps.js\";\nexport * from \"./renderTemplate.js\";"
  },
  {
    "path": "js/instantsearch.js/es/lib/templating/prepareTemplateProps.d.ts",
    "content": "import type { HoganHelpers, Templates } from '../../types';\nimport type { HoganOptions } from 'hogan.js';\ntype TemplatesConfig = {\n    helpers?: HoganHelpers;\n    compileOptions?: HoganOptions;\n};\nexport type PreparedTemplateProps<TTemplates extends Templates> = {\n    templatesConfig: TemplatesConfig;\n    templates: TTemplates;\n    useCustomCompileOptions: {\n        [TKey in keyof Partial<TTemplates>]: boolean;\n    };\n};\n/**\n * Prepares an object to be passed to the Template widget\n */\nexport declare function prepareTemplateProps<TTemplates extends Templates>({ defaultTemplates, templates, templatesConfig, }: {\n    defaultTemplates: TTemplates;\n    templates?: Partial<TTemplates>;\n    templatesConfig: TemplatesConfig;\n}): PreparedTemplateProps<TTemplates>;\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/templating/prepareTemplateProps.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nimport { uniq } from \"../utils/uniq.js\";\nfunction prepareTemplates(\n// can not use = {} here, since the template could have different constraints\ndefaultTemplates) {\n  var templates = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  var allKeys = uniq([].concat(_toConsumableArray(Object.keys(defaultTemplates || {})), _toConsumableArray(Object.keys(templates))));\n  return allKeys.reduce(function (config, key) {\n    var defaultTemplate = defaultTemplates ? defaultTemplates[key] : undefined;\n    var customTemplate = templates[key];\n    var isCustomTemplate = customTemplate !== undefined && customTemplate !== defaultTemplate;\n    config.templates[key] = isCustomTemplate ? customTemplate : defaultTemplate;\n    config.useCustomCompileOptions[key] = isCustomTemplate;\n    return config;\n  }, {\n    // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n    templates: {},\n    // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n    useCustomCompileOptions: {}\n  });\n}\n\n/**\n * Prepares an object to be passed to the Template widget\n */\nexport function prepareTemplateProps(_ref) {\n  var defaultTemplates = _ref.defaultTemplates,\n    templates = _ref.templates,\n    templatesConfig = _ref.templatesConfig;\n  var preparedTemplates = prepareTemplates(defaultTemplates, templates);\n  return _objectSpread({\n    templatesConfig: templatesConfig\n  }, preparedTemplates);\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/templating/renderTemplate.d.ts",
    "content": "import type { Templates, HoganHelpers } from '../../types';\nimport type { BindEventForHits, SendEventForHits } from '../utils/createSendEventForHits';\nimport type { HoganOptions } from 'hogan.js';\nexport declare function renderTemplate({ templates, templateKey, compileOptions, helpers, data, bindEvent, sendEvent, }: {\n    templates: Templates;\n    templateKey: string;\n    compileOptions?: HoganOptions;\n    helpers?: HoganHelpers;\n    data?: Record<string, any>;\n    bindEvent?: BindEventForHits;\n    sendEvent?: SendEventForHits;\n}): string | import(\"preact\").VNode<{}> | import(\"preact\").VNode<{}>[] | null;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/templating/renderTemplate.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport hogan from 'hogan.js';\nimport { html } from 'htm/preact';\nimport { Highlight, ReverseHighlight, ReverseSnippet, Snippet } from \"../../helpers/components/index.js\";\n// We add all our template helper methods to the template as lambdas. Note\n// that lambdas in Mustache are supposed to accept a second argument of\n// `render` to get the rendered value, not the literal `{{value}}`. But\n// this is currently broken (see https://github.com/twitter/hogan.js/issues/222).\nfunction transformHelpersToHogan() {\n  var helpers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var compileOptions = arguments.length > 1 ? arguments[1] : undefined;\n  var data = arguments.length > 2 ? arguments[2] : undefined;\n  return Object.keys(helpers).reduce(function (acc, helperKey) {\n    return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, helperKey, function () {\n      var _this = this;\n      return function (text) {\n        var render = function render(value) {\n          return hogan.compile(value, compileOptions).render(_this);\n        };\n        return helpers[helperKey].call(data, text, render);\n      };\n    }));\n  }, {});\n}\nexport function renderTemplate(_ref) {\n  var templates = _ref.templates,\n    templateKey = _ref.templateKey,\n    compileOptions = _ref.compileOptions,\n    helpers = _ref.helpers,\n    data = _ref.data,\n    bindEvent = _ref.bindEvent,\n    sendEvent = _ref.sendEvent;\n  var template = templates[templateKey];\n  if (typeof template !== 'string' && typeof template !== 'function') {\n    throw new Error(\"Template must be 'string' or 'function', was '\".concat(_typeof(template), \"' (key: \").concat(templateKey, \")\"));\n  }\n  if (typeof template === 'function') {\n    // @MAJOR no longer pass bindEvent when string templates are removed\n    var params = bindEvent || {};\n    params.html = html;\n    params.sendEvent = sendEvent;\n    params.components = {\n      Highlight: Highlight,\n      ReverseHighlight: ReverseHighlight,\n      Snippet: Snippet,\n      ReverseSnippet: ReverseSnippet\n    };\n\n    // @MAJOR remove the `as any` when string templates are removed\n    // needed because not every template receives sendEvent\n    return template(data, params);\n  }\n  var transformedHelpers = transformHelpersToHogan(helpers, compileOptions, data);\n  return hogan.compile(template, compileOptions).render(_objectSpread(_objectSpread({}, data), {}, {\n    helpers: transformedHelpers\n  })).replace(/[ \\n\\r\\t\\f\\xA0]+/g, function (spaces) {\n    return spaces.replace(/(^|\\xA0+)[^\\xA0]+/g, '$1 ');\n  }).trim();\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/addWidgetId.d.ts",
    "content": "import type { Widget } from '../../types';\nexport declare function addWidgetId(widget: Widget): void;\nexport declare function resetWidgetId(): void;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/addWidgetId.js",
    "content": "var id = 0;\nexport function addWidgetId(widget) {\n  if (widget.dependsOn !== 'recommend') {\n    return;\n  }\n  widget.$$id = id++;\n}\nexport function resetWidgetId() {\n  id = 0;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/capitalize.d.ts",
    "content": "export declare function capitalize(text: string): string;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/capitalize.js",
    "content": "export function capitalize(text) {\n  return text.toString().charAt(0).toUpperCase() + text.toString().slice(1);\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/checkIndexUiState.d.ts",
    "content": "import type { IndexUiState, IndexWidget } from '../../types';\ntype CheckIndexUiStateParams = {\n    index: IndexWidget;\n    indexUiState: IndexUiState;\n};\nexport declare function checkIndexUiState({ index, indexUiState, }: CheckIndexUiStateParams): void;\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/checkIndexUiState.js",
    "content": "function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nimport { capitalize } from \"./capitalize.js\";\nimport { warning } from \"./logger.js\";\nimport { keys } from \"./typedObject.js\";\n// Some connectors are responsible for multiple widgets so we need\n// to map them.\nfunction getWidgetNames(connectorName) {\n  switch (connectorName) {\n    case 'range':\n      return [];\n    case 'menu':\n      return ['menu', 'menuSelect'];\n    default:\n      return [connectorName];\n  }\n}\nvar stateToWidgetsMap = {\n  query: {\n    connectors: ['connectSearchBox'],\n    widgets: ['ais.searchBox', 'ais.autocomplete', 'ais.voiceSearch']\n  },\n  refinementList: {\n    connectors: ['connectRefinementList'],\n    widgets: ['ais.refinementList']\n  },\n  menu: {\n    connectors: ['connectMenu'],\n    widgets: ['ais.menu']\n  },\n  hierarchicalMenu: {\n    connectors: ['connectHierarchicalMenu'],\n    widgets: ['ais.hierarchicalMenu']\n  },\n  numericMenu: {\n    connectors: ['connectNumericMenu'],\n    widgets: ['ais.numericMenu']\n  },\n  ratingMenu: {\n    connectors: ['connectRatingMenu'],\n    widgets: ['ais.ratingMenu']\n  },\n  range: {\n    connectors: ['connectRange'],\n    widgets: ['ais.rangeInput', 'ais.rangeSlider', 'ais.range']\n  },\n  toggle: {\n    connectors: ['connectToggleRefinement'],\n    widgets: ['ais.toggleRefinement']\n  },\n  geoSearch: {\n    connectors: ['connectGeoSearch'],\n    widgets: ['ais.geoSearch']\n  },\n  sortBy: {\n    connectors: ['connectSortBy'],\n    widgets: ['ais.sortBy']\n  },\n  page: {\n    connectors: ['connectPagination'],\n    widgets: ['ais.pagination', 'ais.infiniteHits']\n  },\n  hitsPerPage: {\n    connectors: ['connectHitsPerPage'],\n    widgets: ['ais.hitsPerPage']\n  },\n  configure: {\n    connectors: ['connectConfigure'],\n    widgets: ['ais.configure']\n  },\n  places: {\n    connectors: [],\n    widgets: ['ais.places']\n  }\n};\nexport function checkIndexUiState(_ref) {\n  var index = _ref.index,\n    indexUiState = _ref.indexUiState;\n  var mountedWidgets = index.getWidgets().map(function (widget) {\n    return widget.$$type;\n  }).filter(Boolean);\n  var missingWidgets = keys(indexUiState).reduce(function (acc, parameter) {\n    var widgetUiState = stateToWidgetsMap[parameter];\n    if (!widgetUiState) {\n      return acc;\n    }\n    var requiredWidgets = widgetUiState.widgets;\n    if (requiredWidgets && !requiredWidgets.some(function (requiredWidget) {\n      return mountedWidgets.includes(requiredWidget);\n    })) {\n      acc.push([parameter, {\n        connectors: widgetUiState.connectors,\n        widgets: widgetUiState.widgets.map(function (widgetIdentifier) {\n          return widgetIdentifier.split('ais.')[1];\n        })\n      }]);\n    }\n    return acc;\n  }, []);\n  process.env.NODE_ENV === 'development' ? warning(missingWidgets.length === 0, \"The UI state for the index \\\"\".concat(index.getIndexId(), \"\\\" is not consistent with the widgets mounted.\\n\\nThis can happen when the UI state is specified via `initialUiState`, `routing` or `setUiState` but that the widgets responsible for this state were not added. This results in those query parameters not being sent to the API.\\n\\nTo fully reflect the state, some widgets need to be added to the index \\\"\").concat(index.getIndexId(), \"\\\":\\n\\n\").concat(missingWidgets.map(function (_ref2) {\n    var _ref4;\n    var _ref3 = _slicedToArray(_ref2, 2),\n      stateParameter = _ref3[0],\n      widgets = _ref3[1].widgets;\n    return \"- `\".concat(stateParameter, \"` needs one of these widgets: \").concat((_ref4 = []).concat.apply(_ref4, _toConsumableArray(widgets.map(function (name) {\n      return getWidgetNames(name);\n    }))).map(function (name) {\n      return \"\\\"\".concat(name, \"\\\"\");\n    }).join(', '));\n  }).join('\\n'), \"\\n\\nIf you do not wish to display widgets but still want to support their search parameters, you can mount \\\"virtual widgets\\\" that don't render anything:\\n\\n```\\n\").concat(missingWidgets.filter(function (_ref5) {\n    var _ref6 = _slicedToArray(_ref5, 2),\n      _stateParameter = _ref6[0],\n      connectors = _ref6[1].connectors;\n    return connectors.length > 0;\n  }).map(function (_ref7) {\n    var _ref8 = _slicedToArray(_ref7, 2),\n      _stateParameter = _ref8[0],\n      _ref8$ = _ref8[1],\n      connectors = _ref8$.connectors,\n      widgets = _ref8$.widgets;\n    var capitalizedWidget = capitalize(widgets[0]);\n    var connectorName = connectors[0];\n    return \"const virtual\".concat(capitalizedWidget, \" = \").concat(connectorName, \"(() => null);\");\n  }).join('\\n'), \"\\n\\nsearch.addWidgets([\\n  \").concat(missingWidgets.filter(function (_ref9) {\n    var _ref10 = _slicedToArray(_ref9, 2),\n      _stateParameter = _ref10[0],\n      connectors = _ref10[1].connectors;\n    return connectors.length > 0;\n  }).map(function (_ref11) {\n    var _ref12 = _slicedToArray(_ref11, 2),\n      _stateParameter = _ref12[0],\n      widgets = _ref12[1].widgets;\n    var capitalizedWidget = capitalize(widgets[0]);\n    return \"virtual\".concat(capitalizedWidget, \"({ /* ... */ })\");\n  }).join(',\\n  '), \"\\n]);\\n```\\n\\nIf you're using custom widgets that do set these query parameters, we recommend using connectors instead.\\n\\nSee https://www.algolia.com/doc/guides/building-search-ui/widgets/customize-an-existing-widget/js/#customize-the-complete-ui-of-the-widgets\")) : void 0;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/checkRendering.d.ts",
    "content": "import type { Renderer } from '../../types/connector';\nexport declare function checkRendering(rendering: any, usage: string): asserts rendering is Renderer<any, any>;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/checkRendering.js",
    "content": "import { getObjectType } from \"./getObjectType.js\";\nexport function checkRendering(rendering, usage) {\n  if (rendering === undefined || typeof rendering !== 'function') {\n    throw new Error(\"The render function is not valid (received type \".concat(getObjectType(rendering), \").\\n\\n\").concat(usage));\n  }\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/clearRefinements.d.ts",
    "content": "import type { AlgoliaSearchHelper, SearchParameters } from 'algoliasearch-helper';\n/**\n * Clears the refinements of a SearchParameters object based on rules provided.\n * The included attributes list is applied before the excluded attributes list. If the list\n * is not provided, this list of all the currently refined attributes is used as included attributes.\n * @returns search parameters with refinements cleared\n */\nexport declare function clearRefinements({ helper, attributesToClear, }: {\n    helper: AlgoliaSearchHelper;\n    attributesToClear?: string[];\n}): SearchParameters;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/clearRefinements.js",
    "content": "/**\n * Clears the refinements of a SearchParameters object based on rules provided.\n * The included attributes list is applied before the excluded attributes list. If the list\n * is not provided, this list of all the currently refined attributes is used as included attributes.\n * @returns search parameters with refinements cleared\n */\nexport function clearRefinements(_ref) {\n  var helper = _ref.helper,\n    _ref$attributesToClea = _ref.attributesToClear,\n    attributesToClear = _ref$attributesToClea === void 0 ? [] : _ref$attributesToClea;\n  var finalState = helper.state.setPage(0);\n  finalState = attributesToClear.reduce(function (state, attribute) {\n    if (finalState.isNumericRefined(attribute)) {\n      return state.removeNumericRefinement(attribute);\n    }\n    if (finalState.isHierarchicalFacet(attribute)) {\n      return state.removeHierarchicalFacetRefinement(attribute);\n    }\n    if (finalState.isDisjunctiveFacet(attribute)) {\n      return state.removeDisjunctiveFacetRefinement(attribute);\n    }\n    if (finalState.isConjunctiveFacet(attribute)) {\n      return state.removeFacetRefinement(attribute);\n    }\n    return state;\n  }, finalState);\n  if (attributesToClear.indexOf('query') !== -1) {\n    finalState = finalState.setQuery('');\n  }\n  return finalState;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/concatHighlightedParts.d.ts",
    "content": "import type { HighlightedParts } from '../../types';\nexport declare function concatHighlightedParts(parts: HighlightedParts[]): string;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/concatHighlightedParts.js",
    "content": "import { TAG_REPLACEMENT } from \"./escape-highlight.js\";\nexport function concatHighlightedParts(parts) {\n  var highlightPreTag = TAG_REPLACEMENT.highlightPreTag,\n    highlightPostTag = TAG_REPLACEMENT.highlightPostTag;\n  return parts.map(function (part) {\n    return part.isHighlighted ? highlightPreTag + part.value + highlightPostTag : part.value;\n  }).join('');\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/convertNumericRefinementsToFilters.d.ts",
    "content": "import type { SearchParameters } from 'algoliasearch-helper';\nexport declare function convertNumericRefinementsToFilters(state: SearchParameters | null, attribute: string): string[] | null;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/convertNumericRefinementsToFilters.js",
    "content": "export function convertNumericRefinementsToFilters(state, attribute) {\n  if (!state) {\n    return null;\n  }\n\n  var filtersObj = state.numericRefinements[attribute];\n  /*\n    filtersObj === {\n      \"<=\": [10],\n      \"=\": [],\n      \">=\": [5]\n    }\n  */\n\n  var filters = [];\n  Object.keys(filtersObj).filter(function (operator) {\n    return Array.isArray(filtersObj[operator]) && filtersObj[operator].length > 0;\n  }).forEach(function (operator) {\n    filtersObj[operator].forEach(function (value) {\n      filters.push(\"\".concat(attribute).concat(operator).concat(value));\n    });\n  });\n  return filters;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/createConcurrentSafePromise.d.ts",
    "content": "export type MaybePromise<TResolution> = Readonly<Promise<TResolution>> | Promise<TResolution> | TResolution;\n/**\n * Creates a runner that executes promises in a concurrent-safe way.\n *\n * This is useful to prevent older promises to resolve after a newer promise,\n * otherwise resulting in stale resolved values.\n */\nexport declare function createConcurrentSafePromise<TValue>(): (promise: MaybePromise<TValue>) => Promise<Awaited<TValue> | NonNullable<TValue>>;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/createConcurrentSafePromise.js",
    "content": "// copied from\n// https://github.com/algolia/autocomplete.js/blob/307a7acc4283e10a19cb7d067f04f1bea79dc56f/packages/autocomplete-core/src/utils/createConcurrentSafePromise.ts#L1:L1\n/**\n * Creates a runner that executes promises in a concurrent-safe way.\n *\n * This is useful to prevent older promises to resolve after a newer promise,\n * otherwise resulting in stale resolved values.\n */\nexport function createConcurrentSafePromise() {\n  var basePromiseId = -1;\n  var latestResolvedId = -1;\n  var latestResolvedValue = undefined;\n  return function runConcurrentSafePromise(promise) {\n    var currentPromiseId = ++basePromiseId;\n    return Promise.resolve(promise).then(function (x) {\n      // The promise might take too long to resolve and get outdated. This would\n      // result in resolving stale values.\n      // When this happens, we ignore the promise value and return the one\n      // coming from the latest resolved value.\n      //\n      // +----------------------------------+\n      // |        100ms                     |\n      // | run(1) +--->  R1                 |\n      // |        300ms                     |\n      // | run(2) +-------------> R2 (SKIP) |\n      // |        200ms                     |\n      // | run(3) +--------> R3             |\n      // +----------------------------------+\n      if (latestResolvedValue && currentPromiseId < latestResolvedId) {\n        return latestResolvedValue;\n      }\n      latestResolvedId = currentPromiseId;\n      latestResolvedValue = x;\n      return x;\n    });\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/createSendEventForFacet.d.ts",
    "content": "import type { InstantSearch } from '../../types';\nimport type { AlgoliaSearchHelper } from 'algoliasearch-helper';\ntype BuiltInSendEventForFacet = (eventType: string, facetValue: string, eventName?: string, additionalData?: Record<string, any>) => void;\ntype CustomSendEventForFacet = (customPayload: any) => void;\nexport type SendEventForFacet = BuiltInSendEventForFacet & CustomSendEventForFacet;\ntype CreateSendEventForFacetOptions = {\n    instantSearchInstance: InstantSearch;\n    helper: AlgoliaSearchHelper;\n    attribute: string | ((facetValue: string) => string);\n    widgetType: string;\n};\nexport declare function createSendEventForFacet({ instantSearchInstance, helper, attribute: attr, widgetType, }: CreateSendEventForFacetOptions): SendEventForFacet;\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/createSendEventForFacet.js",
    "content": "function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nimport { isFacetRefined } from \"./isFacetRefined.js\";\nexport function createSendEventForFacet(_ref) {\n  var instantSearchInstance = _ref.instantSearchInstance,\n    helper = _ref.helper,\n    attr = _ref.attribute,\n    widgetType = _ref.widgetType;\n  var sendEventForFacet = function sendEventForFacet() {\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    var facetValue = args[1],\n      _args$ = args[2],\n      eventName = _args$ === void 0 ? 'Filter Applied' : _args$,\n      _args$2 = args[3],\n      additionalData = _args$2 === void 0 ? {} : _args$2;\n    var _args$0$split = args[0].split(':'),\n      _args$0$split2 = _slicedToArray(_args$0$split, 2),\n      eventType = _args$0$split2[0],\n      eventModifier = _args$0$split2[1];\n    var attribute = typeof attr === 'string' ? attr : attr(facetValue);\n    if (args.length === 1 && _typeof(args[0]) === 'object') {\n      instantSearchInstance.sendEventToInsights(args[0]);\n    } else if (eventType === 'click' && args.length >= 2 && args.length <= 4) {\n      if (!isFacetRefined(helper, attribute, facetValue)) {\n        var _helper$lastResults;\n        // send event only when the facet is being checked \"ON\"\n        instantSearchInstance.sendEventToInsights({\n          insightsMethod: 'clickedFilters',\n          widgetType: widgetType,\n          eventType: eventType,\n          eventModifier: eventModifier,\n          payload: _objectSpread({\n            eventName: eventName,\n            index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,\n            filters: [\"\".concat(attribute, \":\").concat(facetValue)]\n          }, additionalData),\n          attribute: attribute\n        });\n      }\n    } else if (process.env.NODE_ENV === 'development') {\n      throw new Error(\"You need to pass between two and four arguments like:\\n  sendEvent('click', facetValue, eventName?, additionalData?);\\n\\nIf you want to send a custom payload, you can pass one object: sendEvent(customPayload);\\n\");\n    }\n  };\n  return sendEventForFacet;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/createSendEventForHits.d.ts",
    "content": "import type { InsightsEvent } from '../../middlewares/createInsightsMiddleware';\nimport type { InstantSearch, Hit } from '../../types';\nimport type { AlgoliaSearchHelper } from 'algoliasearch-helper';\ntype BuiltInSendEventForHits = (eventType: string, hits: Hit | Hit[], eventName?: string, additionalData?: Record<string, any>) => void;\ntype CustomSendEventForHits = (customPayload: any) => void;\nexport type SendEventForHits = BuiltInSendEventForHits & CustomSendEventForHits;\nexport type BuiltInBindEventForHits = (eventType: string, hits: Hit | Hit[], eventName?: string, additionalData?: Record<string, any>) => string;\nexport type CustomBindEventForHits = (customPayload: any) => string;\nexport type BindEventForHits = BuiltInBindEventForHits & CustomBindEventForHits;\nexport declare function _buildEventPayloadsForHits({ helper, widgetType, methodName, args, instantSearchInstance, }: {\n    widgetType: string;\n    helper: AlgoliaSearchHelper;\n    methodName: 'sendEvent' | 'bindEvent';\n    args: any[];\n    instantSearchInstance: InstantSearch;\n}): InsightsEvent[];\nexport declare function createSendEventForHits({ instantSearchInstance, helper, widgetType, }: {\n    instantSearchInstance: InstantSearch;\n    helper: AlgoliaSearchHelper;\n    widgetType: string;\n}): SendEventForHits;\nexport declare function createBindEventForHits({ helper, widgetType, instantSearchInstance, }: {\n    helper: AlgoliaSearchHelper;\n    widgetType: string;\n    instantSearchInstance: InstantSearch;\n}): BindEventForHits;\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/createSendEventForHits.js",
    "content": "function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nimport { serializePayload } from \"./serializer.js\";\nfunction chunk(arr) {\n  var chunkSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 20;\n  var chunks = [];\n  for (var i = 0; i < Math.ceil(arr.length / chunkSize); i++) {\n    chunks.push(arr.slice(i * chunkSize, (i + 1) * chunkSize));\n  }\n  return chunks;\n}\nexport function _buildEventPayloadsForHits(_ref) {\n  var helper = _ref.helper,\n    widgetType = _ref.widgetType,\n    methodName = _ref.methodName,\n    args = _ref.args,\n    instantSearchInstance = _ref.instantSearchInstance;\n  // when there's only one argument, that means it's custom\n  if (args.length === 1 && _typeof(args[0]) === 'object') {\n    return [args[0]];\n  }\n  var _args$0$split = args[0].split(':'),\n    _args$0$split2 = _slicedToArray(_args$0$split, 2),\n    eventType = _args$0$split2[0],\n    eventModifier = _args$0$split2[1];\n  var hits = args[1];\n  var eventName = args[2];\n  var additionalData = args[3] || {};\n  if (!hits) {\n    if (process.env.NODE_ENV === 'development') {\n      throw new Error(\"You need to pass hit or hits as the second argument like:\\n  \".concat(methodName, \"(eventType, hit);\\n  \"));\n    } else {\n      return [];\n    }\n  }\n  if ((eventType === 'click' || eventType === 'conversion') && !eventName) {\n    if (process.env.NODE_ENV === 'development') {\n      throw new Error(\"You need to pass eventName as the third argument for 'click' or 'conversion' events like:\\n  \".concat(methodName, \"('click', hit, 'Product Purchased');\\n\\n  To learn more about event naming: https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/in-depth/clicks-conversions-best-practices/\\n  \"));\n    } else {\n      return [];\n    }\n  }\n  var hitsArray = Array.isArray(hits) ? hits : [hits];\n  if (hitsArray.length === 0) {\n    return [];\n  }\n  var queryID = hitsArray[0].__queryID;\n  var hitsChunks = chunk(hitsArray);\n  var objectIDsByChunk = hitsChunks.map(function (batch) {\n    return batch.map(function (hit) {\n      return hit.objectID;\n    });\n  });\n  var positionsByChunk = hitsChunks.map(function (batch) {\n    return batch.map(function (hit) {\n      return hit.__position;\n    });\n  });\n  if (eventType === 'view') {\n    if (instantSearchInstance.status !== 'idle') {\n      return [];\n    }\n    return hitsChunks.map(function (batch, i) {\n      var _helper$lastResults;\n      return {\n        insightsMethod: 'viewedObjectIDs',\n        widgetType: widgetType,\n        eventType: eventType,\n        payload: _objectSpread({\n          eventName: eventName || 'Hits Viewed',\n          index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,\n          objectIDs: objectIDsByChunk[i]\n        }, additionalData),\n        hits: batch,\n        eventModifier: eventModifier\n      };\n    });\n  } else if (eventType === 'click') {\n    return hitsChunks.map(function (batch, i) {\n      var _helper$lastResults2;\n      return {\n        insightsMethod: 'clickedObjectIDsAfterSearch',\n        widgetType: widgetType,\n        eventType: eventType,\n        payload: _objectSpread({\n          eventName: eventName || 'Hit Clicked',\n          index: ((_helper$lastResults2 = helper.lastResults) === null || _helper$lastResults2 === void 0 ? void 0 : _helper$lastResults2.index) || helper.state.index,\n          queryID: queryID,\n          objectIDs: objectIDsByChunk[i],\n          positions: positionsByChunk[i]\n        }, additionalData),\n        hits: batch,\n        eventModifier: eventModifier\n      };\n    });\n  } else if (eventType === 'conversion') {\n    return hitsChunks.map(function (batch, i) {\n      var _helper$lastResults3;\n      return {\n        insightsMethod: 'convertedObjectIDsAfterSearch',\n        widgetType: widgetType,\n        eventType: eventType,\n        payload: _objectSpread({\n          eventName: eventName || 'Hit Converted',\n          index: ((_helper$lastResults3 = helper.lastResults) === null || _helper$lastResults3 === void 0 ? void 0 : _helper$lastResults3.index) || helper.state.index,\n          queryID: queryID,\n          objectIDs: objectIDsByChunk[i]\n        }, additionalData),\n        hits: batch,\n        eventModifier: eventModifier\n      };\n    });\n  } else if (process.env.NODE_ENV === 'development') {\n    throw new Error(\"eventType(\\\"\".concat(eventType, \"\\\") is not supported.\\n    If you want to send a custom payload, you can pass one object: \").concat(methodName, \"(customPayload);\\n    \"));\n  } else {\n    return [];\n  }\n}\nexport function createSendEventForHits(_ref2) {\n  var instantSearchInstance = _ref2.instantSearchInstance,\n    helper = _ref2.helper,\n    widgetType = _ref2.widgetType;\n  var sentEvents = {};\n  var timer = undefined;\n  var sendEventForHits = function sendEventForHits() {\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    var payloads = _buildEventPayloadsForHits({\n      widgetType: widgetType,\n      helper: helper,\n      methodName: 'sendEvent',\n      args: args,\n      instantSearchInstance: instantSearchInstance\n    });\n    payloads.forEach(function (payload) {\n      if (payload.eventType === 'click' && payload.eventModifier === 'internal' && sentEvents[payload.eventType]) {\n        return;\n      }\n      sentEvents[payload.eventType] = true;\n      instantSearchInstance.sendEventToInsights(payload);\n    });\n    clearTimeout(timer);\n    timer = setTimeout(function () {\n      sentEvents = {};\n    }, 0);\n  };\n  return sendEventForHits;\n}\nexport function createBindEventForHits(_ref3) {\n  var helper = _ref3.helper,\n    widgetType = _ref3.widgetType,\n    instantSearchInstance = _ref3.instantSearchInstance;\n  var bindEventForHits = function bindEventForHits() {\n    for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n      args[_key2] = arguments[_key2];\n    }\n    var payloads = _buildEventPayloadsForHits({\n      widgetType: widgetType,\n      helper: helper,\n      methodName: 'bindEvent',\n      args: args,\n      instantSearchInstance: instantSearchInstance\n    });\n    return payloads.length ? \"data-insights-event=\".concat(serializePayload(payloads)) : '';\n  };\n  return bindEventForHits;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/cx.d.ts",
    "content": "export declare function cx(cssClasses?: string | string[] | undefined): string;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/cx.js",
    "content": "export function cx(cssClasses) {\n  return Array.isArray(cssClasses) ? cssClasses.filter(Boolean).join(' ') : cssClasses || '';\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/debounce.d.ts",
    "content": "import type { Awaited } from '../../types';\ntype Func = (...args: any[]) => any;\nexport type DebouncedFunction<TFunction extends Func> = (this: ThisParameterType<TFunction>, ...args: Parameters<TFunction>) => Promise<Awaited<ReturnType<TFunction>>>;\nexport declare function debounce<TFunction extends Func>(func: TFunction, wait: number): DebouncedFunction<TFunction>;\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/debounce.js",
    "content": "// Debounce a function call to the trailing edge.\n// The debounced function returns a promise.\nexport function debounce(func, wait) {\n  var lastTimeout = null;\n  return function () {\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    return new Promise(function (resolve, reject) {\n      if (lastTimeout) {\n        clearTimeout(lastTimeout);\n      }\n      lastTimeout = setTimeout(function () {\n        lastTimeout = null;\n        Promise.resolve(func.apply(void 0, args)).then(resolve).catch(reject);\n      }, wait);\n    });\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/defer.d.ts",
    "content": "type Callback = (...args: any[]) => void;\ntype Defer = {\n    wait: () => Promise<void>;\n    cancel: () => void;\n};\nexport declare function defer<TCallback extends Callback>(callback: TCallback): TCallback & Defer;\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/defer.js",
    "content": "var nextMicroTask = Promise.resolve();\nexport function defer(callback) {\n  var progress = null;\n  var cancelled = false;\n  var fn = function fn() {\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    if (progress !== null) {\n      return;\n    }\n    progress = nextMicroTask.then(function () {\n      progress = null;\n      if (cancelled) {\n        cancelled = false;\n        return;\n      }\n      callback.apply(void 0, args);\n    });\n  };\n  fn.wait = function () {\n    if (progress === null) {\n      throw new Error('The deferred function should be called before calling `wait()`');\n    }\n    return progress;\n  };\n  fn.cancel = function () {\n    if (progress === null) {\n      return;\n    }\n    cancelled = true;\n  };\n  return fn;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/detect-insights-client.d.ts",
    "content": "export declare function hasDetectedInsightsClient(): boolean;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/detect-insights-client.js",
    "content": "import { safelyRunOnBrowser } from \"./safelyRunOnBrowser.js\";\nexport function hasDetectedInsightsClient() {\n  return safelyRunOnBrowser(function (_ref) {\n    var window = _ref.window;\n    return Boolean(window.AlgoliaAnalyticsObject);\n  }, {\n    fallback: function fallback() {\n      return false;\n    }\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/documentation.d.ts",
    "content": "type WidgetParam = {\n    name: string;\n    connector?: boolean;\n};\nexport declare function createDocumentationLink({ name, connector, }: WidgetParam): string;\ntype DocumentationMessageGenerator = (message?: string) => string;\nexport declare function createDocumentationMessageGenerator(...widgets: WidgetParam[]): DocumentationMessageGenerator;\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/documentation.js",
    "content": "export function createDocumentationLink(_ref) {\n  var name = _ref.name,\n    _ref$connector = _ref.connector,\n    connector = _ref$connector === void 0 ? false : _ref$connector;\n  return ['https://www.algolia.com/doc/api-reference/widgets/', name, '/js/', connector ? '#connector' : ''].join('');\n}\nexport function createDocumentationMessageGenerator() {\n  for (var _len = arguments.length, widgets = new Array(_len), _key = 0; _key < _len; _key++) {\n    widgets[_key] = arguments[_key];\n  }\n  var links = widgets.map(function (widget) {\n    return createDocumentationLink(widget);\n  }).join(', ');\n  return function (message) {\n    return [message, \"See documentation: \".concat(links)].filter(Boolean).join('\\n\\n');\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/escape-highlight.d.ts",
    "content": "import type { Hit, FacetHit, EscapedHits } from '../../types';\nexport declare const TAG_PLACEHOLDER: {\n    highlightPreTag: string;\n    highlightPostTag: string;\n};\nexport declare const TAG_REPLACEMENT: {\n    highlightPreTag: string;\n    highlightPostTag: string;\n};\nexport declare function escapeHits<THit extends Hit>(hits: THit[] | EscapedHits<THit>): EscapedHits<THit>;\nexport declare function escapeFacets(facetHits: FacetHit[]): FacetHit[];\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/escape-highlight.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError(\"Cannot destructure \" + obj); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { escape } from \"./escape-html.js\";\nimport { isPlainObject } from \"./isPlainObject.js\";\nexport var TAG_PLACEHOLDER = {\n  highlightPreTag: '__ais-highlight__',\n  highlightPostTag: '__/ais-highlight__'\n};\nexport var TAG_REPLACEMENT = {\n  highlightPreTag: '<mark>',\n  highlightPostTag: '</mark>'\n};\n\n// @MAJOR: in the future, this should only escape, not replace\nfunction replaceTagsAndEscape(value) {\n  return escape(value).replace(new RegExp(TAG_PLACEHOLDER.highlightPreTag, 'g'), TAG_REPLACEMENT.highlightPreTag).replace(new RegExp(TAG_PLACEHOLDER.highlightPostTag, 'g'), TAG_REPLACEMENT.highlightPostTag);\n}\nfunction recursiveEscape(input) {\n  if (isPlainObject(input) && typeof input.value !== 'string') {\n    return Object.keys(input).reduce(function (acc, key) {\n      return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, recursiveEscape(input[key])));\n    }, {});\n  }\n  if (Array.isArray(input)) {\n    return input.map(recursiveEscape);\n  }\n  return _objectSpread(_objectSpread({}, input), {}, {\n    value: replaceTagsAndEscape(input.value)\n  });\n}\nexport function escapeHits(hits) {\n  if (hits.__escaped === undefined) {\n    // We don't override the value on hit because it will mutate the raw results\n    // instead we make a shallow copy and we assign the escaped values on it.\n    hits = hits.map(function (_ref) {\n      var hit = _extends({}, (_objectDestructuringEmpty(_ref), _ref));\n      if (hit._highlightResult) {\n        hit._highlightResult = recursiveEscape(hit._highlightResult);\n      }\n      if (hit._snippetResult) {\n        hit._snippetResult = recursiveEscape(hit._snippetResult);\n      }\n      return hit;\n    });\n    hits.__escaped = true;\n  }\n  return hits;\n}\nexport function escapeFacets(facetHits) {\n  return facetHits.map(function (h) {\n    return _objectSpread(_objectSpread({}, h), {}, {\n      highlighted: replaceTagsAndEscape(h.highlighted)\n    });\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/escape-html.d.ts",
    "content": "/**\n * This implementation is taken from Lodash implementation.\n * See: https://github.com/lodash/lodash/blob/4.17.11-npm/escape.js\n */\n/**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n */\nexport declare function escape(value: string): string;\n/**\n * Converts the HTML entities \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * characters.\n */\nexport declare function unescape(value: string): string;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/escape-html.js",
    "content": "/**\n * This implementation is taken from Lodash implementation.\n * See: https://github.com/lodash/lodash/blob/4.17.11-npm/escape.js\n */\n\n// Used to map characters to HTML entities.\nvar htmlEntities = {\n  '&': '&amp;',\n  '<': '&lt;',\n  '>': '&gt;',\n  '\"': '&quot;',\n  \"'\": '&#39;'\n};\n\n// Used to match HTML entities and HTML characters.\nvar regexUnescapedHtml = /[&<>\"']/g;\nvar regexHasUnescapedHtml = RegExp(regexUnescapedHtml.source);\n\n/**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n */\nexport function escape(value) {\n  return value && regexHasUnescapedHtml.test(value) ? value.replace(regexUnescapedHtml, function (character) {\n    return htmlEntities[character];\n  }) : value;\n}\n\n/**\n * This implementation is taken from Lodash implementation.\n * See: https://github.com/lodash/lodash/blob/4.17.11-npm/unescape.js\n */\n\n// Used to map HTML entities to characters.\nvar htmlCharacters = {\n  '&amp;': '&',\n  '&lt;': '<',\n  '&gt;': '>',\n  '&quot;': '\"',\n  '&#39;': \"'\"\n};\n\n// Used to match HTML entities and HTML characters.\nvar regexEscapedHtml = /&(amp|quot|lt|gt|#39);/g;\nvar regexHasEscapedHtml = RegExp(regexEscapedHtml.source);\n\n/**\n * Converts the HTML entities \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * characters.\n */\nexport function unescape(value) {\n  return value && regexHasEscapedHtml.test(value) ? value.replace(regexEscapedHtml, function (character) {\n    return htmlCharacters[character];\n  }) : value;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/escape.d.ts",
    "content": "/**\n * This implementation is taken from Lodash implementation.\n * See: https://github.com/lodash/lodash/blob/4.17.11-npm/escape.js\n */\n/**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n */\ndeclare function escape(value: string): string;\nexport default escape;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/escape.js",
    "content": "/**\n * This implementation is taken from Lodash implementation.\n * See: https://github.com/lodash/lodash/blob/4.17.11-npm/escape.js\n */\n// Used to map characters to HTML entities.\nvar htmlEscapes = {\n  '&': '&amp;',\n  '<': '&lt;',\n  '>': '&gt;',\n  '\"': '&quot;',\n  \"'\": '&#39;'\n}; // Used to match HTML entities and HTML characters.\n\nvar regexUnescapedHtml = /[&<>\"']/g;\nvar regexHasUnescapedHtml = RegExp(regexUnescapedHtml.source);\n/**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n */\n\nfunction escape(value) {\n  return value && regexHasUnescapedHtml.test(value) ? value.replace(regexUnescapedHtml, function (character) {\n    return htmlEscapes[character];\n  }) : value;\n}\n\nexport default escape;"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/escapeFacetValue.d.ts",
    "content": "type FacetValue = string | number | boolean | undefined;\nexport declare function unescapeFacetValue<TFacetValue extends FacetValue>(value: TFacetValue): TFacetValue;\nexport declare function escapeFacetValue<TFacetValue extends FacetValue>(value: TFacetValue): TFacetValue;\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/escapeFacetValue.js",
    "content": "export function unescapeFacetValue(value) {\n  if (typeof value === 'string') {\n    return value.replace(/^\\\\-/, '-');\n  }\n  return value;\n}\nexport function escapeFacetValue(value) {\n  if (typeof value === 'number' && value < 0 || typeof value === 'string') {\n    return String(value).replace(/^-/, '\\\\-');\n  }\n  return value;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/escapeRefinement.js",
    "content": "function escapeRefinement(value) {\n  if (typeof value === 'number' && value < 0) {\n    value = String(value).replace(/^-/, '\\\\-');\n  }\n\n  return value;\n}\n\nexport default escapeRefinement;"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/find.d.ts",
    "content": "export declare function find<TItem>(items: TItem[], predicate: (value: TItem, index: number, obj: TItem[]) => boolean): TItem | undefined;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/find.js",
    "content": "// We aren't using the native `Array.prototype.find` because the refactor away from Lodash is not\n// published as a major version.\n// Relying on the `find` polyfill on user-land, which before was only required for niche use-cases,\n// was decided as too risky.\n// @MAJOR Replace with the native `Array.prototype.find` method\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\nexport function find(items, predicate) {\n  var value;\n  for (var i = 0; i < items.length; i++) {\n    value = items[i];\n    // inlined for performance: if (Call(predicate, thisArg, [value, i, list])) {\n    if (predicate(value, i, items)) {\n      return value;\n    }\n  }\n  return undefined;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/findIndex.d.ts",
    "content": "export declare function findIndex<TItem>(array: TItem[], comparator: (value: TItem) => boolean): number;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/findIndex.js",
    "content": "// We aren't using the native `Array.prototype.findIndex` because the refactor away from Lodash is not\n// published as a major version.\n// Relying on the `findIndex` polyfill on user-land, which before was only required for niche use-cases,\n// was decided as too risky.\n// @MAJOR Replace with the native `Array.prototype.findIndex` method\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex\nexport function findIndex(array, comparator) {\n  if (!Array.isArray(array)) {\n    return -1;\n  }\n  for (var i = 0; i < array.length; i++) {\n    if (comparator(array[i])) {\n      return i;\n    }\n  }\n  return -1;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/geo-search.d.ts",
    "content": "export declare function aroundLatLngToPosition(value: string): {\n    lat: number;\n    lng: number;\n};\nexport type LatLng = Array<[number, number, number, number]>;\nexport declare function insideBoundingBoxToBoundingBox(value: string | LatLng): {\n    northEast: {\n        lat: number;\n        lng: number;\n    };\n    southWest: {\n        lat: number;\n        lng: number;\n    };\n};\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/geo-search.js",
    "content": "function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nvar latLngRegExp = /^(-?\\d+(?:\\.\\d+)?),\\s*(-?\\d+(?:\\.\\d+)?)$/;\nexport function aroundLatLngToPosition(value) {\n  var pattern = value.match(latLngRegExp);\n\n  // Since the value provided is the one send with the request, the API should\n  // throw an error due to the wrong format. So throw an error should be safe.\n  if (!pattern) {\n    throw new Error(\"Invalid value for \\\"aroundLatLng\\\" parameter: \\\"\".concat(value, \"\\\"\"));\n  }\n  return {\n    lat: parseFloat(pattern[1]),\n    lng: parseFloat(pattern[2])\n  };\n}\nfunction insideBoundingBoxArrayToBoundingBox(value) {\n  var _value = _slicedToArray(value, 1),\n    _value$ = _value[0],\n    _value$2 = _value$ === void 0 ? [undefined, undefined, undefined, undefined] : _value$,\n    _value$3 = _slicedToArray(_value$2, 4),\n    neLat = _value$3[0],\n    neLng = _value$3[1],\n    swLat = _value$3[2],\n    swLng = _value$3[3];\n\n  // Since the value provided is the one send with the request, the API should\n  // throw an error due to the wrong format. So throw an error should be safe.\n  if (!neLat || !neLng || !swLat || !swLng) {\n    throw new Error(\"Invalid value for \\\"insideBoundingBox\\\" parameter: [\".concat(value, \"]\"));\n  }\n  return {\n    northEast: {\n      lat: neLat,\n      lng: neLng\n    },\n    southWest: {\n      lat: swLat,\n      lng: swLng\n    }\n  };\n}\nfunction insideBoundingBoxStringToBoundingBox(value) {\n  var _value$split$map = value.split(',').map(parseFloat),\n    _value$split$map2 = _slicedToArray(_value$split$map, 4),\n    neLat = _value$split$map2[0],\n    neLng = _value$split$map2[1],\n    swLat = _value$split$map2[2],\n    swLng = _value$split$map2[3];\n\n  // Since the value provided is the one send with the request, the API should\n  // throw an error due to the wrong format. So throw an error should be safe.\n  if (!neLat || !neLng || !swLat || !swLng) {\n    throw new Error(\"Invalid value for \\\"insideBoundingBox\\\" parameter: \\\"\".concat(value, \"\\\"\"));\n  }\n  return {\n    northEast: {\n      lat: neLat,\n      lng: neLng\n    },\n    southWest: {\n      lat: swLat,\n      lng: swLng\n    }\n  };\n}\nexport function insideBoundingBoxToBoundingBox(value) {\n  if (Array.isArray(value)) {\n    return insideBoundingBoxArrayToBoundingBox(value);\n  }\n  return insideBoundingBoxStringToBoundingBox(value);\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/getAppIdAndApiKey.d.ts",
    "content": "export declare function getAppIdAndApiKey(searchClient: any): [appId: string, apiKey: string] | [appId: undefined, apiKey: undefined];\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/getAppIdAndApiKey.js",
    "content": "// typed as any, since it accepts the _real_ js clients, not the interface we otherwise expect\nexport function getAppIdAndApiKey(searchClient) {\n  if (searchClient.appId && searchClient.apiKey) {\n    // searchClient v5\n    return [searchClient.appId, searchClient.apiKey];\n  } else if (searchClient.transporter) {\n    // searchClient v4 or v5\n    var transporter = searchClient.transporter;\n    var headers = transporter.headers || transporter.baseHeaders;\n    var queryParameters = transporter.queryParameters || transporter.baseQueryParameters;\n    var APP_ID = 'x-algolia-application-id';\n    var API_KEY = 'x-algolia-api-key';\n    var appId = headers[APP_ID] || queryParameters[APP_ID];\n    var apiKey = headers[API_KEY] || queryParameters[API_KEY];\n    return [appId, apiKey];\n  } else {\n    // searchClient v3\n    return [searchClient.applicationID, searchClient.apiKey];\n  }\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/getContainerNode.d.ts",
    "content": "/**\n * Return the container. If it's a string, it is considered a\n * css selector and retrieves the first matching element. Otherwise\n * test if it validates that it's a correct DOMElement.\n *\n * @param {string|HTMLElement} selectorOrHTMLElement CSS Selector or container node.\n * @return {HTMLElement} Container node\n * @throws Error when the type is not correct\n */\nexport declare function getContainerNode(selectorOrHTMLElement: string | HTMLElement): HTMLElement;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/getContainerNode.js",
    "content": "import { isDomElement } from \"./isDomElement.js\";\n\n/**\n * Return the container. If it's a string, it is considered a\n * css selector and retrieves the first matching element. Otherwise\n * test if it validates that it's a correct DOMElement.\n *\n * @param {string|HTMLElement} selectorOrHTMLElement CSS Selector or container node.\n * @return {HTMLElement} Container node\n * @throws Error when the type is not correct\n */\nexport function getContainerNode(selectorOrHTMLElement) {\n  var isSelectorString = typeof selectorOrHTMLElement === 'string';\n  var domElement = isSelectorString ? document.querySelector(selectorOrHTMLElement) : selectorOrHTMLElement;\n  if (!isDomElement(domElement)) {\n    var errorMessage = 'Container must be `string` or `HTMLElement`.';\n    if (isSelectorString) {\n      errorMessage += \" Unable to find \".concat(selectorOrHTMLElement);\n    }\n    throw new Error(errorMessage);\n  }\n  return domElement;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/getHighlightFromSiblings.d.ts",
    "content": "import type { HighlightedParts } from '../../types';\nexport declare function getHighlightFromSiblings(parts: HighlightedParts[], i: number): boolean;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/getHighlightFromSiblings.js",
    "content": "import { unescape } from \"./escape-html.js\";\nvar hasAlphanumeric = new RegExp(/\\w/i);\nexport function getHighlightFromSiblings(parts, i) {\n  var _parts, _parts2;\n  var current = parts[i];\n  var isNextHighlighted = ((_parts = parts[i + 1]) === null || _parts === void 0 ? void 0 : _parts.isHighlighted) || true;\n  var isPreviousHighlighted = ((_parts2 = parts[i - 1]) === null || _parts2 === void 0 ? void 0 : _parts2.isHighlighted) || true;\n  if (!hasAlphanumeric.test(unescape(current.value)) && isPreviousHighlighted === isNextHighlighted) {\n    return isPreviousHighlighted;\n  }\n  return current.isHighlighted;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/getHighlightedParts.d.ts",
    "content": "export declare function getHighlightedParts(highlightedValue: string): {\n    value: string;\n    isHighlighted: boolean;\n}[];\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/getHighlightedParts.js",
    "content": "import { TAG_REPLACEMENT } from \"./escape-highlight.js\";\nexport function getHighlightedParts(highlightedValue) {\n  // @MAJOR: this should use TAG_PLACEHOLDER\n  var highlightPostTag = TAG_REPLACEMENT.highlightPostTag,\n    highlightPreTag = TAG_REPLACEMENT.highlightPreTag;\n  var splitByPreTag = highlightedValue.split(highlightPreTag);\n  var firstValue = splitByPreTag.shift();\n  var elements = !firstValue ? [] : [{\n    value: firstValue,\n    isHighlighted: false\n  }];\n  splitByPreTag.forEach(function (split) {\n    var splitByPostTag = split.split(highlightPostTag);\n    elements.push({\n      value: splitByPostTag[0],\n      isHighlighted: true\n    });\n    if (splitByPostTag[1] !== '') {\n      elements.push({\n        value: splitByPostTag[1],\n        isHighlighted: false\n      });\n    }\n  });\n  return elements;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/getObjectType.d.ts",
    "content": "export declare function getObjectType(object: unknown): string;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/getObjectType.js",
    "content": "export function getObjectType(object) {\n  return Object.prototype.toString.call(object).slice(8, -1);\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/getPropertyByPath.d.ts",
    "content": "export declare function getPropertyByPath(object: Record<string, any> | undefined, path: string | string[]): any;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/getPropertyByPath.js",
    "content": "export function getPropertyByPath(object, path) {\n  var parts = Array.isArray(path) ? path : path.split('.');\n  return parts.reduce(function (current, key) {\n    return current && current[key];\n  }, object);\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/getRefinements.d.ts",
    "content": "import type { SearchParameters, SearchResults } from 'algoliasearch-helper';\nexport type FacetRefinement = {\n    type: 'facet' | 'disjunctive' | 'hierarchical';\n    attribute: string;\n    name: string;\n    escapedValue: string;\n    count?: number;\n    exhaustive?: boolean;\n};\nexport type TagRefinement = {\n    type: 'tag';\n    attribute: string;\n    name: string;\n};\nexport type QueryRefinement = {\n    type: 'query';\n    attribute: 'query';\n    query: string;\n    name: string;\n};\nexport type NumericRefinement = {\n    type: 'numeric';\n    numericValue: number;\n    operator: '<' | '<=' | '=' | '!=' | '>=' | '>';\n    attribute: string;\n    name: string;\n    count?: number;\n    exhaustive?: boolean;\n};\nexport type FacetExcludeRefinement = {\n    type: 'exclude';\n    exclude: boolean;\n    attribute: string;\n    name: string;\n    count?: number;\n    exhaustive?: boolean;\n};\nexport type Refinement = FacetRefinement | QueryRefinement | NumericRefinement | FacetExcludeRefinement | TagRefinement;\nexport declare function getRefinements(_results: SearchResults | Record<string, never> | null, state: SearchParameters, includesQuery?: boolean): Refinement[];\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/getRefinements.js",
    "content": "import { unescapeFacetValue, escapeFacetValue } from \"./escapeFacetValue.js\";\nimport { find } from \"./find.js\";\nfunction getRefinement(state, type, attribute, name) {\n  var resultsFacets = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];\n  var res = {\n    type: type,\n    attribute: attribute,\n    name: name,\n    escapedValue: escapeFacetValue(name)\n  };\n  var facet = find(resultsFacets, function (resultsFacet) {\n    return resultsFacet.name === attribute;\n  });\n  var count;\n  if (type === 'hierarchical') {\n    var facetDeclaration = state.getHierarchicalFacetByName(attribute);\n    var nameParts = name.split(facetDeclaration.separator);\n    var getFacetRefinement = function getFacetRefinement(facetData) {\n      return function (refinementKey) {\n        return facetData[refinementKey];\n      };\n    };\n    var _loop = function _loop(i) {\n      facet = facet && facet.data && find(Object.keys(facet.data).map(getFacetRefinement(facet.data)), function (refinement) {\n        return refinement.name === nameParts[i];\n      });\n    };\n    for (var i = 0; facet !== undefined && i < nameParts.length; ++i) {\n      _loop(i);\n    }\n    count = facet && facet.count;\n  } else {\n    count = facet && facet.data && facet.data[res.name];\n  }\n  if (count !== undefined) {\n    res.count = count;\n  }\n  if (facet && facet.exhaustive !== undefined) {\n    res.exhaustive = facet.exhaustive;\n  }\n  return res;\n}\nexport function getRefinements(_results, state) {\n  var includesQuery = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n  var results = _results || {};\n  var refinements = [];\n  var _state$facetsRefineme = state.facetsRefinements,\n    facetsRefinements = _state$facetsRefineme === void 0 ? {} : _state$facetsRefineme,\n    _state$facetsExcludes = state.facetsExcludes,\n    facetsExcludes = _state$facetsExcludes === void 0 ? {} : _state$facetsExcludes,\n    _state$disjunctiveFac = state.disjunctiveFacetsRefinements,\n    disjunctiveFacetsRefinements = _state$disjunctiveFac === void 0 ? {} : _state$disjunctiveFac,\n    _state$hierarchicalFa = state.hierarchicalFacetsRefinements,\n    hierarchicalFacetsRefinements = _state$hierarchicalFa === void 0 ? {} : _state$hierarchicalFa,\n    _state$numericRefinem = state.numericRefinements,\n    numericRefinements = _state$numericRefinem === void 0 ? {} : _state$numericRefinem,\n    _state$tagRefinements = state.tagRefinements,\n    tagRefinements = _state$tagRefinements === void 0 ? [] : _state$tagRefinements;\n  Object.keys(facetsRefinements).forEach(function (attribute) {\n    var refinementNames = facetsRefinements[attribute];\n    refinementNames.forEach(function (refinementName) {\n      refinements.push(getRefinement(state, 'facet', attribute, refinementName, results.facets));\n    });\n  });\n  Object.keys(facetsExcludes).forEach(function (attribute) {\n    var refinementNames = facetsExcludes[attribute];\n    refinementNames.forEach(function (refinementName) {\n      refinements.push({\n        type: 'exclude',\n        attribute: attribute,\n        name: refinementName,\n        exclude: true\n      });\n    });\n  });\n  Object.keys(disjunctiveFacetsRefinements).forEach(function (attribute) {\n    var refinementNames = disjunctiveFacetsRefinements[attribute];\n    refinementNames.forEach(function (refinementName) {\n      refinements.push(getRefinement(state, 'disjunctive', attribute,\n      // We unescape any disjunctive refined values with `unescapeFacetValue` because\n      // they can be escaped on negative numeric values with `escapeFacetValue`.\n      unescapeFacetValue(refinementName), results.disjunctiveFacets));\n    });\n  });\n  Object.keys(hierarchicalFacetsRefinements).forEach(function (attribute) {\n    var refinementNames = hierarchicalFacetsRefinements[attribute];\n    refinementNames.forEach(function (refinement) {\n      refinements.push(getRefinement(state, 'hierarchical', attribute, refinement, results.hierarchicalFacets));\n    });\n  });\n  Object.keys(numericRefinements).forEach(function (attribute) {\n    var operators = numericRefinements[attribute];\n    Object.keys(operators).forEach(function (operatorOriginal) {\n      var operator = operatorOriginal;\n      var valueOrValues = operators[operator];\n      var refinementNames = Array.isArray(valueOrValues) ? valueOrValues : [valueOrValues];\n      refinementNames.forEach(function (refinementName) {\n        refinements.push({\n          type: 'numeric',\n          attribute: attribute,\n          name: \"\".concat(refinementName),\n          numericValue: refinementName,\n          operator: operator\n        });\n      });\n    });\n  });\n  tagRefinements.forEach(function (refinementName) {\n    refinements.push({\n      type: 'tag',\n      attribute: '_tags',\n      name: refinementName\n    });\n  });\n  if (includesQuery && state.query && state.query.trim()) {\n    refinements.push({\n      attribute: 'query',\n      type: 'query',\n      name: state.query,\n      query: state.query\n    });\n  }\n  return refinements;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/getWidgetAttribute.d.ts",
    "content": "import type { InitOptions, Widget, IndexWidget } from '../../types';\nexport declare function getWidgetAttribute(widget: Widget | IndexWidget, initOptions: InitOptions): string;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/getWidgetAttribute.js",
    "content": "export function getWidgetAttribute(widget, initOptions) {\n  var _widget$getWidgetRend;\n  var renderState = (_widget$getWidgetRend = widget.getWidgetRenderState) === null || _widget$getWidgetRend === void 0 ? void 0 : _widget$getWidgetRend.call(widget, initOptions);\n  var attribute = null;\n  if (renderState && renderState.widgetParams) {\n    // casting as widgetParams is checked just before\n    var widgetParams = renderState.widgetParams;\n    if (widgetParams.attribute) {\n      attribute = widgetParams.attribute;\n    } else if (Array.isArray(widgetParams.attributes)) {\n      attribute = widgetParams.attributes[0];\n    }\n  }\n  if (typeof attribute !== 'string') {\n    throw new Error(\"Could not find the attribute of the widget:\\n\\n\".concat(JSON.stringify(widget), \"\\n\\nPlease check whether the widget's getWidgetRenderState returns widgetParams.attribute correctly.\"));\n  }\n  return attribute;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/hits-absolute-position.d.ts",
    "content": "import type { AlgoliaHit } from '../../types';\nexport declare function addAbsolutePosition<THit extends AlgoliaHit>(hits: THit[], page: number, hitsPerPage: number): Array<THit & {\n    __position: number;\n}>;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/hits-absolute-position.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nexport function addAbsolutePosition(hits, page, hitsPerPage) {\n  return hits.map(function (hit, idx) {\n    return _objectSpread(_objectSpread({}, hit), {}, {\n      __position: hitsPerPage * page + idx + 1\n    });\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/hits-query-id.d.ts",
    "content": "import type { AlgoliaHit } from '../../types';\nexport declare function addQueryID<THit extends AlgoliaHit>(hits: THit[], queryID?: string): Array<THit & {\n    __queryID?: string;\n}>;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/hits-query-id.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nexport function addQueryID(hits, queryID) {\n  if (!queryID) {\n    return hits;\n  }\n  return hits.map(function (hit) {\n    return _objectSpread(_objectSpread({}, hit), {}, {\n      __queryID: queryID\n    });\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/hydrateRecommendCache.d.ts",
    "content": "import type { InitialResults } from '../../types';\nimport type { AlgoliaSearchHelper } from 'algoliasearch-helper';\nexport declare function hydrateRecommendCache(helper: AlgoliaSearchHelper, initialResults: InitialResults): void;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/hydrateRecommendCache.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nexport function hydrateRecommendCache(helper, initialResults) {\n  var recommendCache = Object.keys(initialResults).reduce(function (acc, indexName) {\n    var initialResult = initialResults[indexName];\n    if (initialResult.recommendResults) {\n      // @MAJOR: Use `Object.assign` instead of spread operator\n      return _objectSpread(_objectSpread({}, acc), initialResult.recommendResults.results);\n    }\n    return acc;\n  }, {});\n  helper._recommendCache = recommendCache;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/hydrateSearchClient.d.ts",
    "content": "import type { SearchClient, InitialResults, CompositionClient } from '../../types';\nexport declare function hydrateSearchClient(client: (SearchClient | CompositionClient) & {\n    _cacheHydrated?: boolean;\n    _useCache?: boolean;\n}, results?: InitialResults): void;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/hydrateSearchClient.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nexport function hydrateSearchClient(client, results) {\n  if (!results) {\n    return;\n  }\n\n  // Disable cache hydration on:\n  // - Algoliasearch API Client < v4 with cache disabled\n  // - Third party clients (detected by the `addAlgoliaAgent` function missing)\n\n  if ((!('transporter' in client) || client._cacheHydrated) && (!client._useCache || typeof client.addAlgoliaAgent !== 'function')) {\n    return;\n  }\n  var cachedRequest = [Object.keys(results).reduce(function (acc, key) {\n    var _results$key = results[key],\n      state = _results$key.state,\n      requestParams = _results$key.requestParams,\n      serverResults = _results$key.results;\n    var mappedResults = serverResults && state ? serverResults.map(function (result, idx) {\n      return _objectSpread({\n        indexName: state.index || result.index\n      }, requestParams !== null && requestParams !== void 0 && requestParams[idx] || result.params ? {\n        params: serializeQueryParameters((requestParams === null || requestParams === void 0 ? void 0 : requestParams[idx]) || deserializeQueryParameters(result.params))\n      } : {});\n    }) : [];\n    return acc.concat(mappedResults);\n  }, [])];\n  var cachedResults = Object.keys(results).reduce(function (acc, key) {\n    var res = results[key].results;\n    if (!res) {\n      return acc;\n    }\n    return acc.concat(res);\n  }, []);\n\n  // Algoliasearch API Client >= v4\n  // To hydrate the client we need to populate the cache with the data from\n  // the server (done in `hydrateSearchClientWithMultiIndexRequest` or\n  // `hydrateSearchClientWithSingleIndexRequest`). But since there is no way\n  // for us to compute the key the same way as `algoliasearch-client` we need\n  // to populate it on a custom key and override the `search` method to\n  // search on it first.\n  if ('transporter' in client && !client._cacheHydrated) {\n    client._cacheHydrated = true;\n    var baseMethod = client.search.bind(client);\n    client.search = function (requests) {\n      for (var _len = arguments.length, methodArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n        methodArgs[_key - 1] = arguments[_key];\n      }\n      var requestsWithSerializedParams = Array.isArray(requests) ?\n      // search client\n      requests.map(function (request) {\n        return _objectSpread(_objectSpread({}, request), {}, {\n          params: serializeQueryParameters(request.params)\n        });\n      }) :\n      // composition client\n      serializeQueryParameters(requests.requestBody.params);\n      return client.transporter.responsesCache.get({\n        method: 'search',\n        args: [requestsWithSerializedParams].concat(methodArgs)\n      }, function () {\n        return baseMethod.apply(void 0, [requests].concat(methodArgs));\n      });\n    };\n    client.transporter.responsesCache.set({\n      method: 'search',\n      args: cachedRequest\n    }, {\n      results: cachedResults\n    });\n  }\n\n  // Algoliasearch API Client < v4\n  // Prior to client v4 we didn't have a proper API to hydrate the client\n  // cache from the outside. The following code populates the cache with\n  // a single-index result. You can find more information about the\n  // computation of the key inside the client (see link below).\n  // https://github.com/algolia/algoliasearch-client-javascript/blob/c27e89ff92b2a854ae6f40dc524bffe0f0cbc169/src/AlgoliaSearchCore.js#L232-L240\n  if (!('transporter' in client)) {\n    var cacheKey = \"/1/indexes/*/queries_body_\".concat(JSON.stringify({\n      requests: cachedRequest\n    }));\n    client.cache = _objectSpread(_objectSpread({}, client.cache), {}, _defineProperty({}, cacheKey, JSON.stringify({\n      results: Object.keys(results).map(function (key) {\n        return results[key].results;\n      })\n    })));\n  }\n}\nfunction deserializeQueryParameters(parameters) {\n  return parameters.split('&').reduce(function (acc, parameter) {\n    var _parameter$split = parameter.split('='),\n      _parameter$split2 = _slicedToArray(_parameter$split, 2),\n      key = _parameter$split2[0],\n      value = _parameter$split2[1];\n    acc[key] = value ? decodeURIComponent(value) : '';\n    return acc;\n  }, {});\n}\n\n// This function is copied from the algoliasearch v4 API Client. If modified,\n// consider updating it also in `serializeQueryParameters` from `@algolia/transporter`.\nfunction serializeQueryParameters(parameters) {\n  var isObjectOrArray = function isObjectOrArray(value) {\n    return Object.prototype.toString.call(value) === '[object Object]' || Object.prototype.toString.call(value) === '[object Array]';\n  };\n  var encode = function encode(format) {\n    for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n      args[_key2 - 1] = arguments[_key2];\n    }\n    var i = 0;\n    return format.replace(/%s/g, function () {\n      return encodeURIComponent(args[i++]);\n    });\n  };\n  return Object.keys(parameters).map(function (key) {\n    return encode('%s=%s', key, isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key]);\n  }).join('&');\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/index.d.ts",
    "content": "export * from './addWidgetId';\nexport * from './capitalize';\nexport * from './checkIndexUiState';\nexport * from './checkRendering';\nexport * from './clearRefinements';\nexport * from './concatHighlightedParts';\nexport * from './createConcurrentSafePromise';\nexport * from './createSendEventForFacet';\nexport * from './createSendEventForHits';\nexport * from './setIndexHelperState';\nexport * from './isIndexWidget';\nexport * from './debounce';\nexport * from './defer';\nexport * from './documentation';\nexport * from './escape-highlight';\nexport * from './escape-html';\nexport * from './escapeFacetValue';\nexport * from './find';\nexport * from './findIndex';\nexport * from './geo-search';\nexport * from './getAppIdAndApiKey';\nexport * from './getContainerNode';\nexport * from './getHighlightedParts';\nexport * from './getHighlightFromSiblings';\nexport * from './getObjectType';\nexport * from './getPropertyByPath';\nexport * from './getRefinements';\nexport * from './getWidgetAttribute';\nexport * from './hits-absolute-position';\nexport * from './hits-query-id';\nexport * from './hydrateRecommendCache';\nexport * from './hydrateSearchClient';\nexport * from './isDomElement';\nexport * from './isEqual';\nexport * from './isFacetRefined';\nexport * from './isFiniteNumber';\nexport * from './isPlainObject';\nexport * from './isSpecialClick';\nexport * from './walkIndex';\nexport * from './logger';\nexport * from './mergeSearchParameters';\nexport * from './omit';\nexport * from './noop';\nexport * from './range';\nexport * from './render-args';\nexport * from './resolveSearchParameters';\nexport * from './reverseHighlightedParts';\nexport * from './safelyRunOnBrowser';\nexport * from './serializer';\nexport * from './toArray';\nexport * from './uniq';\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/index.js",
    "content": "export * from \"./addWidgetId.js\";\nexport * from \"./capitalize.js\";\nexport * from \"./checkIndexUiState.js\";\nexport * from \"./checkRendering.js\";\nexport * from \"./clearRefinements.js\";\nexport * from \"./concatHighlightedParts.js\";\nexport * from \"./createConcurrentSafePromise.js\";\nexport * from \"./createSendEventForFacet.js\";\nexport * from \"./createSendEventForHits.js\";\nexport * from \"./setIndexHelperState.js\";\nexport * from \"./isIndexWidget.js\";\nexport * from \"./debounce.js\";\nexport * from \"./defer.js\";\nexport * from \"./documentation.js\";\nexport * from \"./escape-highlight.js\";\nexport * from \"./escape-html.js\";\nexport * from \"./escapeFacetValue.js\";\nexport * from \"./find.js\";\nexport * from \"./findIndex.js\";\nexport * from \"./geo-search.js\";\nexport * from \"./getAppIdAndApiKey.js\";\nexport * from \"./getContainerNode.js\";\nexport * from \"./getHighlightedParts.js\";\nexport * from \"./getHighlightFromSiblings.js\";\nexport * from \"./getObjectType.js\";\nexport * from \"./getPropertyByPath.js\";\nexport * from \"./getRefinements.js\";\nexport * from \"./getWidgetAttribute.js\";\nexport * from \"./hits-absolute-position.js\";\nexport * from \"./hits-query-id.js\";\nexport * from \"./hydrateRecommendCache.js\";\nexport * from \"./hydrateSearchClient.js\";\nexport * from \"./isDomElement.js\";\nexport * from \"./isEqual.js\";\nexport * from \"./isFacetRefined.js\";\nexport * from \"./isFiniteNumber.js\";\nexport * from \"./isPlainObject.js\";\nexport * from \"./isSpecialClick.js\";\nexport * from \"./walkIndex.js\";\nexport * from \"./logger.js\";\nexport * from \"./mergeSearchParameters.js\";\nexport * from \"./omit.js\";\nexport * from \"./noop.js\";\nexport * from \"./range.js\";\nexport * from \"./render-args.js\";\nexport * from \"./resolveSearchParameters.js\";\nexport * from \"./reverseHighlightedParts.js\";\nexport * from \"./safelyRunOnBrowser.js\";\nexport * from \"./serializer.js\";\nexport * from \"./toArray.js\";\nexport * from \"./uniq.js\";"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/isDomElement.d.ts",
    "content": "export declare function isDomElement(object: any): object is HTMLElement;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/isDomElement.js",
    "content": "export function isDomElement(object) {\n  return object instanceof HTMLElement || Boolean(object) && object.nodeType > 0;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/isEqual.d.ts",
    "content": "export declare function isEqual(first: any, second: any): boolean;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/isEqual.js",
    "content": "function isPrimitive(obj) {\n  return obj !== Object(obj);\n}\nexport function isEqual(first, second) {\n  if (first === second) {\n    return true;\n  }\n  if (isPrimitive(first) || isPrimitive(second) || typeof first === 'function' || typeof second === 'function') {\n    return first === second;\n  }\n  if (Object.keys(first).length !== Object.keys(second).length) {\n    return false;\n  }\n\n  // @TODO avoid for..of because of the large polyfill\n  // eslint-disable-next-line no-restricted-syntax\n  for (var _i = 0, _Object$keys = Object.keys(first); _i < _Object$keys.length; _i++) {\n    var key = _Object$keys[_i];\n    if (!(key in second)) {\n      return false;\n    }\n    if (!isEqual(first[key], second[key])) {\n      return false;\n    }\n  }\n  return true;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/isFacetRefined.d.ts",
    "content": "import type { AlgoliaSearchHelper } from 'algoliasearch-helper';\nexport declare function isFacetRefined(helper: AlgoliaSearchHelper, facet: string, value: string): boolean;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/isFacetRefined.js",
    "content": "export function isFacetRefined(helper, facet, value) {\n  if (helper.state.isHierarchicalFacet(facet)) {\n    return helper.state.isHierarchicalFacetRefined(facet, value);\n  } else if (helper.state.isConjunctiveFacet(facet)) {\n    return helper.state.isFacetRefined(facet, value);\n  } else {\n    return helper.state.isDisjunctiveFacetRefined(facet, value);\n  }\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/isFiniteNumber.d.ts",
    "content": "export declare function isFiniteNumber(value: any): value is number;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/isFiniteNumber.js",
    "content": "// This is the `Number.isFinite()` polyfill recommended by MDN.\n// We do not provide any tests for this function.\n// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#Polyfill\n// @MAJOR Replace with the native `Number.isFinite` method\nexport function isFiniteNumber(value) {\n  return typeof value === 'number' && isFinite(value);\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/isIndexWidget.d.ts",
    "content": "import type { Widget, IndexWidget } from '../../types';\nexport declare function isIndexWidget(widget: Widget | IndexWidget): widget is IndexWidget;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/isIndexWidget.js",
    "content": "export function isIndexWidget(widget) {\n  return widget.$$type === 'ais.index';\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/isPlainObject.d.ts",
    "content": "/**\n * This implementation is taken from Lodash implementation.\n * See: https://github.com/lodash/lodash/blob/master/isPlainObject.js\n */\n/**\n * Checks if `value` is a plain object.\n *\n * A plain object is an object created by the `Object`\n * constructor or with a `[[Prototype]]` of `null`.\n */\nexport declare function isPlainObject(value: any): boolean;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/isPlainObject.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n/**\n * This implementation is taken from Lodash implementation.\n * See: https://github.com/lodash/lodash/blob/master/isPlainObject.js\n */\n\nfunction getTag(value) {\n  if (value === null) {\n    return value === undefined ? '[object Undefined]' : '[object Null]';\n  }\n  return Object.prototype.toString.call(value);\n}\nfunction isObjectLike(value) {\n  return _typeof(value) === 'object' && value !== null;\n}\n\n/**\n * Checks if `value` is a plain object.\n *\n * A plain object is an object created by the `Object`\n * constructor or with a `[[Prototype]]` of `null`.\n */\nexport function isPlainObject(value) {\n  if (!isObjectLike(value) || getTag(value) !== '[object Object]') {\n    return false;\n  }\n  if (Object.getPrototypeOf(value) === null) {\n    return true;\n  }\n  var proto = value;\n  while (Object.getPrototypeOf(proto) !== null) {\n    proto = Object.getPrototypeOf(proto);\n  }\n  return Object.getPrototypeOf(value) === proto;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/isSpecialClick.d.ts",
    "content": "export declare function isSpecialClick(event: MouseEvent): boolean;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/isSpecialClick.js",
    "content": "export function isSpecialClick(event) {\n  var isMiddleClick = event.button === 1;\n  return isMiddleClick || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/logger.d.ts",
    "content": "type Warn = (message: string) => void;\ntype Warning = {\n    (condition: boolean, message: string): void;\n    cache: {\n        [message: string]: boolean;\n    };\n};\n/**\n * Logs a warning when this function is called, in development environment only.\n */\ndeclare let deprecate: <TCallback extends (...args: any[]) => any>(fn: TCallback, message: string) => TCallback;\n/**\n * Logs a warning\n * This is used to log issues in development environment only.\n */\ndeclare let warn: Warn;\n/**\n * Logs a warning if the condition is not met.\n * This is used to log issues in development environment only.\n */\ndeclare let warning: Warning;\nexport { warn, deprecate, warning };\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/logger.js",
    "content": "import { noop } from \"./noop.js\";\n/**\n * Logs a warning when this function is called, in development environment only.\n */\nvar deprecate = function deprecate(fn, message) {\n  return fn;\n};\n\n/**\n * Logs a warning\n * This is used to log issues in development environment only.\n */\nvar warn = noop;\n\n/**\n * Logs a warning if the condition is not met.\n * This is used to log issues in development environment only.\n */\nvar _warning = noop;\nif (process.env.NODE_ENV === 'development') {\n  warn = function warn(message) {\n    // eslint-disable-next-line no-console\n    console.warn(\"[InstantSearch.js]: \".concat(message.trim()));\n  };\n  deprecate = function deprecate(fn, message) {\n    var hasAlreadyPrinted = false;\n    return function () {\n      if (!hasAlreadyPrinted) {\n        hasAlreadyPrinted = true;\n        process.env.NODE_ENV === 'development' ? warn(message) : void 0;\n      }\n      return fn.apply(void 0, arguments);\n    };\n  };\n  _warning = function warning(condition, message) {\n    if (condition) {\n      return;\n    }\n    var hasAlreadyPrinted = _warning.cache[message];\n    if (!hasAlreadyPrinted) {\n      _warning.cache[message] = true;\n      process.env.NODE_ENV === 'development' ? warn(message) : void 0;\n    }\n  };\n  _warning.cache = {};\n}\nexport { warn, deprecate, _warning as warning };"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/mergeSearchParameters.d.ts",
    "content": "import type { SearchParameters } from 'algoliasearch-helper';\nexport declare const mergeSearchParameters: (...parameters: SearchParameters[]) => SearchParameters;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/mergeSearchParameters.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _excluded = [\"facets\", \"disjunctiveFacets\", \"facetsRefinements\", \"facetsExcludes\", \"disjunctiveFacetsRefinements\", \"numericRefinements\", \"tagRefinements\", \"hierarchicalFacets\", \"hierarchicalFacetsRefinements\", \"ruleContexts\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport { findIndex } from \"./findIndex.js\";\nimport { uniq } from \"./uniq.js\";\nvar mergeWithRest = function mergeWithRest(left, right) {\n  var facets = right.facets,\n    disjunctiveFacets = right.disjunctiveFacets,\n    facetsRefinements = right.facetsRefinements,\n    facetsExcludes = right.facetsExcludes,\n    disjunctiveFacetsRefinements = right.disjunctiveFacetsRefinements,\n    numericRefinements = right.numericRefinements,\n    tagRefinements = right.tagRefinements,\n    hierarchicalFacets = right.hierarchicalFacets,\n    hierarchicalFacetsRefinements = right.hierarchicalFacetsRefinements,\n    ruleContexts = right.ruleContexts,\n    rest = _objectWithoutProperties(right, _excluded);\n  return left.setQueryParameters(rest);\n};\n\n// Merge facets\nvar mergeFacets = function mergeFacets(left, right) {\n  return right.facets.reduce(function (_, name) {\n    return _.addFacet(name);\n  }, left);\n};\nvar mergeDisjunctiveFacets = function mergeDisjunctiveFacets(left, right) {\n  return right.disjunctiveFacets.reduce(function (_, name) {\n    return _.addDisjunctiveFacet(name);\n  }, left);\n};\nvar mergeHierarchicalFacets = function mergeHierarchicalFacets(left, right) {\n  return left.setQueryParameters({\n    hierarchicalFacets: right.hierarchicalFacets.reduce(function (facets, facet) {\n      var index = findIndex(facets, function (_) {\n        return _.name === facet.name;\n      });\n      if (index === -1) {\n        return facets.concat(facet);\n      }\n      var nextFacets = facets.slice();\n      nextFacets.splice(index, 1, facet);\n      return nextFacets;\n    }, left.hierarchicalFacets)\n  });\n};\n\n// Merge facet refinements\nvar mergeTagRefinements = function mergeTagRefinements(left, right) {\n  return right.tagRefinements.reduce(function (_, value) {\n    return _.addTagRefinement(value);\n  }, left);\n};\nvar mergeFacetRefinements = function mergeFacetRefinements(left, right) {\n  return left.setQueryParameters({\n    facetsRefinements: _objectSpread(_objectSpread({}, left.facetsRefinements), right.facetsRefinements)\n  });\n};\nvar mergeFacetsExcludes = function mergeFacetsExcludes(left, right) {\n  return left.setQueryParameters({\n    facetsExcludes: _objectSpread(_objectSpread({}, left.facetsExcludes), right.facetsExcludes)\n  });\n};\nvar mergeDisjunctiveFacetsRefinements = function mergeDisjunctiveFacetsRefinements(left, right) {\n  return left.setQueryParameters({\n    disjunctiveFacetsRefinements: _objectSpread(_objectSpread({}, left.disjunctiveFacetsRefinements), right.disjunctiveFacetsRefinements)\n  });\n};\nvar mergeNumericRefinements = function mergeNumericRefinements(left, right) {\n  return left.setQueryParameters({\n    numericRefinements: _objectSpread(_objectSpread({}, left.numericRefinements), right.numericRefinements)\n  });\n};\nvar mergeHierarchicalFacetsRefinements = function mergeHierarchicalFacetsRefinements(left, right) {\n  return left.setQueryParameters({\n    hierarchicalFacetsRefinements: _objectSpread(_objectSpread({}, left.hierarchicalFacetsRefinements), right.hierarchicalFacetsRefinements)\n  });\n};\nvar mergeRuleContexts = function mergeRuleContexts(left, right) {\n  var ruleContexts = uniq([].concat(left.ruleContexts).concat(right.ruleContexts).filter(Boolean));\n  if (ruleContexts.length > 0) {\n    return left.setQueryParameters({\n      ruleContexts: ruleContexts\n    });\n  }\n  return left;\n};\nexport var mergeSearchParameters = function mergeSearchParameters() {\n  for (var _len = arguments.length, parameters = new Array(_len), _key = 0; _key < _len; _key++) {\n    parameters[_key] = arguments[_key];\n  }\n  return parameters.reduce(function (left, right) {\n    var hierarchicalFacetsRefinementsMerged = mergeHierarchicalFacetsRefinements(left, right);\n    var hierarchicalFacetsMerged = mergeHierarchicalFacets(hierarchicalFacetsRefinementsMerged, right);\n    var tagRefinementsMerged = mergeTagRefinements(hierarchicalFacetsMerged, right);\n    var numericRefinementsMerged = mergeNumericRefinements(tagRefinementsMerged, right);\n    var disjunctiveFacetsRefinementsMerged = mergeDisjunctiveFacetsRefinements(numericRefinementsMerged, right);\n    var facetsExcludesMerged = mergeFacetsExcludes(disjunctiveFacetsRefinementsMerged, right);\n    var facetRefinementsMerged = mergeFacetRefinements(facetsExcludesMerged, right);\n    var disjunctiveFacetsMerged = mergeDisjunctiveFacets(facetRefinementsMerged, right);\n    var ruleContextsMerged = mergeRuleContexts(disjunctiveFacetsMerged, right);\n    var facetsMerged = mergeFacets(ruleContextsMerged, right);\n    return mergeWithRest(facetsMerged, right);\n  });\n};"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/noop.d.ts",
    "content": "export declare function noop(..._args: any[]): void;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/noop.js",
    "content": "export function noop() {}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/omit.d.ts",
    "content": "/**\n * Creates a new object with the same keys as the original object, but without the excluded keys.\n * @param source original object\n * @param excluded keys to remove from the original object\n * @returns the new object\n */\nexport declare function omit<TSource extends Record<string, unknown>, TExcluded extends keyof TSource>(source: TSource, excluded: TExcluded[]): Omit<TSource, TExcluded>;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/omit.js",
    "content": "/**\n * Creates a new object with the same keys as the original object, but without the excluded keys.\n * @param source original object\n * @param excluded keys to remove from the original object\n * @returns the new object\n */\nexport function omit(source, excluded) {\n  if (source === null || source === undefined) {\n    return source;\n  }\n  return Object.keys(source).reduce(function (target, key) {\n    if (excluded.indexOf(key) >= 0) {\n      return target;\n    }\n    var validKey = key;\n    target[validKey] = source[validKey];\n    return target;\n  }, {});\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/prepareTemplateProps.d.ts",
    "content": "import type { HoganHelpers, Templates } from '../../types';\nimport type { HoganOptions } from 'hogan.js';\ndeclare type TemplatesConfig = {\n    helpers?: HoganHelpers;\n    compileOptions?: HoganOptions;\n};\nexport declare type PreparedTemplateProps<TTemplates extends Templates> = {\n    templatesConfig: TemplatesConfig;\n    templates: TTemplates;\n    useCustomCompileOptions: {\n        [TKey in keyof Partial<TTemplates>]: boolean;\n    };\n};\n/**\n * Prepares an object to be passed to the Template widget\n */\ndeclare function prepareTemplateProps<TTemplates extends Templates>({ defaultTemplates, templates, templatesConfig, }: {\n    defaultTemplates: TTemplates;\n    templates?: Partial<TTemplates>;\n    templatesConfig: TemplatesConfig;\n}): PreparedTemplateProps<TTemplates>;\nexport default prepareTemplateProps;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/prepareTemplateProps.js",
    "content": "function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport uniq from \"./uniq.js\";\n\nfunction prepareTemplates( // can not use = {} here, since the template could have different constraints\ndefaultTemplates) {\n  var templates = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  var allKeys = uniq([].concat(_toConsumableArray(Object.keys(defaultTemplates || {})), _toConsumableArray(Object.keys(templates))));\n  return allKeys.reduce(function (config, key) {\n    var defaultTemplate = defaultTemplates ? defaultTemplates[key] : undefined;\n    var customTemplate = templates[key];\n    var isCustomTemplate = customTemplate !== undefined && customTemplate !== defaultTemplate;\n    config.templates[key] = isCustomTemplate ? customTemplate // typescript doesn't recognize that this condition asserts customTemplate is defined\n    : defaultTemplate;\n    config.useCustomCompileOptions[key] = isCustomTemplate;\n    return config;\n  }, {\n    // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n    templates: {},\n    // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n    useCustomCompileOptions: {}\n  });\n}\n/**\n * Prepares an object to be passed to the Template widget\n */\n\n\nfunction prepareTemplateProps(_ref) {\n  var defaultTemplates = _ref.defaultTemplates,\n      templates = _ref.templates,\n      templatesConfig = _ref.templatesConfig;\n  var preparedTemplates = prepareTemplates(defaultTemplates, templates);\n  return _objectSpread({\n    templatesConfig: templatesConfig\n  }, preparedTemplates);\n}\n\nexport default prepareTemplateProps;"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/range.d.ts",
    "content": "type RangeOptions = {\n    start?: number;\n    end: number;\n    step?: number;\n};\nexport declare function range({ start, end, step }: RangeOptions): number[];\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/range.js",
    "content": "function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nexport function range(_ref) {\n  var _ref$start = _ref.start,\n    start = _ref$start === void 0 ? 0 : _ref$start,\n    end = _ref.end,\n    _ref$step = _ref.step,\n    step = _ref$step === void 0 ? 1 : _ref$step;\n  // We can't divide by 0 so we re-assign the step to 1 if it happens.\n  var limitStep = step === 0 ? 1 : step;\n\n  // In some cases the array to create has a decimal length.\n  // We therefore need to round the value.\n  // Example:\n  //   { start: 1, end: 5000, step: 500 }\n  //   => Array length = (5000 - 1) / 500 = 9.998\n  var arrayLength = Math.round((end - start) / limitStep);\n  return _toConsumableArray(Array(arrayLength)).map(function (_, current) {\n    return start + current * limitStep;\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/render-args.d.ts",
    "content": "import type { InstantSearch, UiState, Widget, IndexWidget } from '../../types';\nexport declare function createInitArgs(instantSearchInstance: InstantSearch, parent: IndexWidget, uiState: UiState): {\n    uiState: UiState;\n    helper: import(\"algoliasearch-helper\").AlgoliaSearchHelper;\n    parent: IndexWidget;\n    instantSearchInstance: InstantSearch<UiState, UiState>;\n    state: import(\"algoliasearch-helper\").SearchParameters;\n    renderState: import(\"../../types\").RenderState;\n    templatesConfig: Record<string, unknown>;\n    createURL: (nextState: import(\"algoliasearch-helper\").SearchParameters | ((state: import(\"../../types\").IndexUiState) => import(\"../../types\").IndexUiState)) => string;\n    scopedResults: never[];\n    searchMetadata: {\n        isSearchStalled: boolean;\n    };\n    status: import(\"../InstantSearch\").InstantSearchStatus;\n    error: Error | undefined;\n};\nexport declare function createRenderArgs(instantSearchInstance: InstantSearch, parent: IndexWidget, widget: IndexWidget | Widget): {\n    helper: import(\"algoliasearch-helper\").AlgoliaSearchHelper;\n    parent: IndexWidget;\n    instantSearchInstance: InstantSearch<UiState, UiState>;\n    results: import(\"algoliasearch\").RecommendationsResults | import(\"algoliasearch-helper\").SearchResults<any> | null;\n    scopedResults: import(\"../../types\").ScopedResult[];\n    state: any;\n    renderState: import(\"../../types\").RenderState;\n    templatesConfig: Record<string, unknown>;\n    createURL: (nextState: import(\"algoliasearch-helper\").SearchParameters | ((state: import(\"../../types\").IndexUiState) => import(\"../../types\").IndexUiState)) => string;\n    searchMetadata: {\n        isSearchStalled: boolean;\n    };\n    status: import(\"../InstantSearch\").InstantSearchStatus;\n    error: Error | undefined;\n};\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/render-args.js",
    "content": "export function createInitArgs(instantSearchInstance, parent, uiState) {\n  var helper = parent.getHelper();\n  return {\n    uiState: uiState,\n    helper: helper,\n    parent: parent,\n    instantSearchInstance: instantSearchInstance,\n    state: helper.state,\n    renderState: instantSearchInstance.renderState,\n    templatesConfig: instantSearchInstance.templatesConfig,\n    createURL: parent.createURL,\n    scopedResults: [],\n    searchMetadata: {\n      isSearchStalled: instantSearchInstance.status === 'stalled'\n    },\n    status: instantSearchInstance.status,\n    error: instantSearchInstance.error\n  };\n}\nexport function createRenderArgs(instantSearchInstance, parent, widget) {\n  var results = parent.getResultsForWidget(widget);\n  var helper = parent.getHelper();\n  return {\n    helper: helper,\n    parent: parent,\n    instantSearchInstance: instantSearchInstance,\n    results: results,\n    scopedResults: parent.getScopedResults(),\n    state: results && '_state' in results ? results._state : helper.state,\n    renderState: instantSearchInstance.renderState,\n    templatesConfig: instantSearchInstance.templatesConfig,\n    createURL: parent.createURL,\n    searchMetadata: {\n      isSearchStalled: instantSearchInstance.status === 'stalled'\n    },\n    status: instantSearchInstance.status,\n    error: instantSearchInstance.error\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/renderTemplate.d.ts",
    "content": "import type { HoganOptions } from 'hogan.js';\nimport type { Templates, HoganHelpers } from '../../types';\nimport type { BindEventForHits } from './createSendEventForHits';\ndeclare function renderTemplate({ templates, templateKey, compileOptions, helpers, data, bindEvent, }: {\n    templates: Templates;\n    templateKey: string;\n    compileOptions?: HoganOptions;\n    helpers?: HoganHelpers;\n    data?: Record<string, any>;\n    bindEvent?: BindEventForHits;\n}): string;\nexport default renderTemplate;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/renderTemplate.js",
    "content": "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport hogan from 'hogan.js';\n\n// We add all our template helper methods to the template as lambdas. Note\n// that lambdas in Mustache are supposed to accept a second argument of\n// `render` to get the rendered value, not the literal `{{value}}`. But\n// this is currently broken (see https://github.com/twitter/hogan.js/issues/222).\nfunction transformHelpersToHogan() {\n  var helpers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var compileOptions = arguments.length > 1 ? arguments[1] : undefined;\n  var data = arguments.length > 2 ? arguments[2] : undefined;\n  return Object.keys(helpers).reduce(function (acc, helperKey) {\n    return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, helperKey, function () {\n      var _this = this;\n\n      return function (text) {\n        var render = function render(value) {\n          return hogan.compile(value, compileOptions).render(_this);\n        };\n\n        return helpers[helperKey].call(data, text, render);\n      };\n    }));\n  }, {});\n}\n\nfunction renderTemplate(_ref) {\n  var templates = _ref.templates,\n      templateKey = _ref.templateKey,\n      compileOptions = _ref.compileOptions,\n      helpers = _ref.helpers,\n      data = _ref.data,\n      bindEvent = _ref.bindEvent;\n  var template = templates[templateKey];\n\n  if (typeof template !== 'string' && typeof template !== 'function') {\n    throw new Error(\"Template must be 'string' or 'function', was '\".concat(_typeof(template), \"' (key: \").concat(templateKey, \")\"));\n  }\n\n  if (typeof template === 'function') {\n    return template(data, bindEvent);\n  }\n\n  var transformedHelpers = transformHelpersToHogan(helpers, compileOptions, data);\n  return hogan.compile(template, compileOptions).render(_objectSpread(_objectSpread({}, data), {}, {\n    helpers: transformedHelpers\n  })).replace(/[ \\n\\r\\t\\f\\xA0]+/g, function (spaces) {\n    return spaces.replace(/(^|\\xA0+)[^\\xA0]+/g, '$1 ');\n  }).trim();\n}\n\nexport default renderTemplate;"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/resolveSearchParameters.d.ts",
    "content": "import type { IndexWidget } from '../../types';\nimport type { SearchParameters } from 'algoliasearch-helper';\nexport declare function resolveSearchParameters(current: IndexWidget): SearchParameters[];\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/resolveSearchParameters.js",
    "content": "export function resolveSearchParameters(current) {\n  var parent = current.getParent();\n  var states = [current.getHelper().state];\n  while (parent !== null) {\n    states = [parent.getHelper().state].concat(states);\n    parent = parent.getParent();\n  }\n  return states;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/reverseHighlightedParts.d.ts",
    "content": "import type { HighlightedParts } from '../../types';\nexport declare function reverseHighlightedParts(parts: HighlightedParts[]): {\n    isHighlighted: boolean;\n    value: string;\n}[];\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/reverseHighlightedParts.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { getHighlightFromSiblings } from \"./getHighlightFromSiblings.js\";\nexport function reverseHighlightedParts(parts) {\n  if (!parts.some(function (part) {\n    return part.isHighlighted;\n  })) {\n    return parts.map(function (part) {\n      return _objectSpread(_objectSpread({}, part), {}, {\n        isHighlighted: false\n      });\n    });\n  }\n  return parts.map(function (part, i) {\n    return _objectSpread(_objectSpread({}, part), {}, {\n      isHighlighted: !getHighlightFromSiblings(parts, i)\n    });\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/safelyRunOnBrowser.d.ts",
    "content": "type BrowserCallback<TReturn> = (params: {\n    window: typeof window;\n}) => TReturn;\ntype SafelyRunOnBrowserOptions<TReturn> = {\n    /**\n     * Fallback to run on server environments.\n     */\n    fallback: () => TReturn;\n};\n/**\n * Runs code on browser environments safely.\n */\nexport declare function safelyRunOnBrowser<TReturn>(callback: BrowserCallback<TReturn>, { fallback }?: SafelyRunOnBrowserOptions<TReturn>): TReturn;\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/safelyRunOnBrowser.js",
    "content": "// eslint-disable-next-line no-restricted-globals\n\n/**\n * Runs code on browser environments safely.\n */\nexport function safelyRunOnBrowser(callback) {\n  var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n      fallback: function fallback() {\n        return undefined;\n      }\n    },\n    fallback = _ref.fallback;\n  // eslint-disable-next-line no-restricted-globals\n  if (typeof window === 'undefined') {\n    return fallback();\n  }\n\n  // eslint-disable-next-line no-restricted-globals\n  return callback({\n    window: window\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/serializer.d.ts",
    "content": "export declare function serializePayload<TPayload>(payload: TPayload): string;\nexport declare function deserializePayload<TPayload>(serialized: string): TPayload;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/serializer.js",
    "content": "export function serializePayload(payload) {\n  return btoa(encodeURIComponent(JSON.stringify(payload)));\n}\nexport function deserializePayload(serialized) {\n  return JSON.parse(decodeURIComponent(atob(serialized)));\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/setIndexHelperState.d.ts",
    "content": "import type { UiState, IndexWidget } from '../../types';\nexport declare function setIndexHelperState<TUiState extends UiState>(finalUiState: TUiState, indexWidget: IndexWidget): void;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/setIndexHelperState.js",
    "content": "import { checkIndexUiState } from \"./checkIndexUiState.js\";\nimport { isIndexWidget } from \"./isIndexWidget.js\";\nexport function setIndexHelperState(finalUiState, indexWidget) {\n  var nextIndexUiState = finalUiState[indexWidget.getIndexId()] || {};\n  if (process.env.NODE_ENV === 'development') {\n    checkIndexUiState({\n      index: indexWidget,\n      indexUiState: nextIndexUiState\n    });\n  }\n  indexWidget.getHelper().setState(indexWidget.getWidgetSearchParameters(indexWidget.getHelper().state, {\n    uiState: nextIndexUiState\n  }));\n  indexWidget.getWidgets().filter(isIndexWidget).forEach(function (widget) {\n    return setIndexHelperState(finalUiState, widget);\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/toArray.d.ts",
    "content": "type ToArray<T> = T extends unknown[] ? T : T[];\nexport declare function toArray<T>(value: T): ToArray<T>;\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/toArray.js",
    "content": "export function toArray(value) {\n  return Array.isArray(value) ? value : [value];\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/typedObject.d.ts",
    "content": "/**\n * A typed version of Object.keys, to use when looping over a static object\n * inspired from https://stackoverflow.com/a/65117465/3185307\n */\nexport declare const keys: <TObject extends Record<string, unknown>>(yourObject: TObject) => Array<keyof TObject>;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/typedObject.js",
    "content": "/**\n * A typed version of Object.keys, to use when looping over a static object\n * inspired from https://stackoverflow.com/a/65117465/3185307\n */\nexport var keys = Object.keys;"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/unescape.d.ts",
    "content": "/**\n * This implementation is taken from Lodash implementation.\n * See: https://github.com/lodash/lodash/blob/4.17.11-npm/unescape.js\n */\n/**\n * Converts the HTML entities \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * characters.\n */\nexport default function unescape(value: string): string;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/unescape.js",
    "content": "/**\n * This implementation is taken from Lodash implementation.\n * See: https://github.com/lodash/lodash/blob/4.17.11-npm/unescape.js\n */\n// Used to map HTML entities to characters.\nvar htmlEscapes = {\n  '&amp;': '&',\n  '&lt;': '<',\n  '&gt;': '>',\n  '&quot;': '\"',\n  '&#39;': \"'\"\n}; // Used to match HTML entities and HTML characters.\n\nvar regexEscapedHtml = /&(amp|quot|lt|gt|#39);/g;\nvar regexHasEscapedHtml = RegExp(regexEscapedHtml.source);\n/**\n * Converts the HTML entities \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * characters.\n */\n\nexport default function unescape(value) {\n  return value && regexHasEscapedHtml.test(value) ? value.replace(regexEscapedHtml, function (character) {\n    return htmlEscapes[character];\n  }) : value;\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/unescapeRefinement.js",
    "content": "function unescapeRefinement(value) {\n  return String(value).replace(/^\\\\-/, '-');\n}\n\nexport default unescapeRefinement;"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/uniq.d.ts",
    "content": "export declare function uniq<TItem>(array: TItem[]): TItem[];\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/uniq.js",
    "content": "export function uniq(array) {\n  return array.filter(function (value, index, self) {\n    return self.indexOf(value) === index;\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/uuid.d.ts",
    "content": "/**\n * Create UUID according to\n * https://www.ietf.org/rfc/rfc4122.txt.\n *\n * @returns Generated UUID.\n */\nexport declare function createUUID(): string;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/uuid.js",
    "content": "/**\n * Create UUID according to\n * https://www.ietf.org/rfc/rfc4122.txt.\n *\n * @returns Generated UUID.\n */\nexport function createUUID() {\n  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n    /* eslint-disable no-bitwise */\n    var r = Math.random() * 16 | 0;\n    var v = c === 'x' ? r : r & 0x3 | 0x8;\n    /* eslint-enable */\n    return v.toString(16);\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/walkIndex.d.ts",
    "content": "import type { IndexWidget } from '../../types';\n/**\n * Recurse over all child indices\n */\nexport declare function walkIndex(indexWidget: IndexWidget, callback: (widget: IndexWidget) => void): void;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/utils/walkIndex.js",
    "content": "import { isIndexWidget } from \"./isIndexWidget.js\";\n/**\n * Recurse over all child indices\n */\nexport function walkIndex(indexWidget, callback) {\n  callback(indexWidget);\n  indexWidget.getWidgets().forEach(function (widget) {\n    if (isIndexWidget(widget)) {\n      walkIndex(widget, callback);\n    }\n  });\n}"
  },
  {
    "path": "js/instantsearch.js/es/lib/version.d.ts",
    "content": "declare const _default: \"4.78.3\";\nexport default _default;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/version.js",
    "content": "export default '4.78.3';"
  },
  {
    "path": "js/instantsearch.js/es/lib/voiceSearchHelper/index.d.ts",
    "content": "import type { CreateVoiceSearchHelper } from './types';\ndeclare const createVoiceSearchHelper: CreateVoiceSearchHelper;\nexport default createVoiceSearchHelper;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/voiceSearchHelper/index.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n// `SpeechRecognition` is an API used on the browser so we can safely disable\n// the `window` check.\n/* eslint-disable no-restricted-globals */\n/* global SpeechRecognition SpeechRecognitionEvent */\n\nvar createVoiceSearchHelper = function createVoiceSearchHelper(_ref) {\n  var searchAsYouSpeak = _ref.searchAsYouSpeak,\n    language = _ref.language,\n    onQueryChange = _ref.onQueryChange,\n    onStateChange = _ref.onStateChange;\n  var SpeechRecognitionAPI = window.webkitSpeechRecognition || window.SpeechRecognition;\n  var getDefaultState = function getDefaultState(status) {\n    return {\n      status: status,\n      transcript: '',\n      isSpeechFinal: false,\n      errorCode: undefined\n    };\n  };\n  var state = getDefaultState('initial');\n  var recognition;\n  var isBrowserSupported = function isBrowserSupported() {\n    return Boolean(SpeechRecognitionAPI);\n  };\n  var isListening = function isListening() {\n    return state.status === 'askingPermission' || state.status === 'waiting' || state.status === 'recognizing';\n  };\n  var setState = function setState() {\n    var newState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    state = _objectSpread(_objectSpread({}, state), newState);\n    onStateChange();\n  };\n  var getState = function getState() {\n    return state;\n  };\n  var resetState = function resetState() {\n    var status = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'initial';\n    setState(getDefaultState(status));\n  };\n  var onStart = function onStart() {\n    setState({\n      status: 'waiting'\n    });\n  };\n  var onError = function onError(event) {\n    setState({\n      status: 'error',\n      errorCode: event.error\n    });\n  };\n  var onResult = function onResult(event) {\n    setState({\n      status: 'recognizing',\n      transcript: event.results[0] && event.results[0][0] && event.results[0][0].transcript || '',\n      isSpeechFinal: event.results[0] && event.results[0].isFinal\n    });\n    if (searchAsYouSpeak && state.transcript) {\n      onQueryChange(state.transcript);\n    }\n  };\n  var onEnd = function onEnd() {\n    if (!state.errorCode && state.transcript && !searchAsYouSpeak) {\n      onQueryChange(state.transcript);\n    }\n    if (state.status !== 'error') {\n      setState({\n        status: 'finished'\n      });\n    }\n  };\n  var startListening = function startListening() {\n    recognition = new SpeechRecognitionAPI();\n    if (!recognition) {\n      return;\n    }\n    resetState('askingPermission');\n    recognition.interimResults = true;\n    if (language) {\n      recognition.lang = language;\n    }\n    recognition.addEventListener('start', onStart);\n    recognition.addEventListener('error', onError);\n    recognition.addEventListener('result', onResult);\n    recognition.addEventListener('end', onEnd);\n    recognition.start();\n  };\n  var dispose = function dispose() {\n    if (!recognition) {\n      return;\n    }\n    recognition.stop();\n    recognition.removeEventListener('start', onStart);\n    recognition.removeEventListener('error', onError);\n    recognition.removeEventListener('result', onResult);\n    recognition.removeEventListener('end', onEnd);\n    recognition = undefined;\n  };\n  var stopListening = function stopListening() {\n    dispose();\n    // Because `dispose` removes event listeners, `end` listener is not called.\n    // So we're setting the `status` as `finished` here.\n    // If we don't do it, it will be still `waiting` or `recognizing`.\n    resetState('finished');\n  };\n  return {\n    getState: getState,\n    isBrowserSupported: isBrowserSupported,\n    isListening: isListening,\n    startListening: startListening,\n    stopListening: stopListening,\n    dispose: dispose\n  };\n};\nexport default createVoiceSearchHelper;"
  },
  {
    "path": "js/instantsearch.js/es/lib/voiceSearchHelper/types.d.ts",
    "content": "export type Status = 'initial' | 'askingPermission' | 'waiting' | 'recognizing' | 'finished' | 'error';\nexport type VoiceListeningState = {\n    status: Status;\n    transcript: string;\n    isSpeechFinal: boolean;\n    errorCode?: string;\n};\nexport type VoiceSearchHelperParams = {\n    searchAsYouSpeak: boolean;\n    language?: string;\n    onQueryChange: (query: string) => void;\n    onStateChange: () => void;\n};\nexport type VoiceSearchHelper = {\n    getState: () => VoiceListeningState;\n    isBrowserSupported: () => boolean;\n    isListening: () => boolean;\n    startListening: () => void;\n    stopListening: () => void;\n    dispose: () => void;\n};\nexport type CreateVoiceSearchHelper = (params: VoiceSearchHelperParams) => VoiceSearchHelper;\n"
  },
  {
    "path": "js/instantsearch.js/es/lib/voiceSearchHelper/types.js",
    "content": "export {};"
  },
  {
    "path": "js/instantsearch.js/es/middlewares/createInsightsMiddleware.d.ts",
    "content": "import type { InsightsClient, InsightsEvent as _InsightsEvent, InsightsMethod, InsightsMethodMap, InternalMiddleware } from '../types';\ntype ProvidedInsightsClient = InsightsClient | null | undefined;\nexport type InsightsEvent<TMethod extends InsightsMethod = InsightsMethod> = _InsightsEvent<TMethod>;\nexport type InsightsProps<TInsightsClient extends ProvidedInsightsClient = ProvidedInsightsClient> = {\n    insightsClient?: TInsightsClient;\n    insightsInitParams?: Partial<InsightsMethodMap['init'][0][0]>;\n    onEvent?: (event: InsightsEvent, insightsClient: TInsightsClient) => void;\n};\nexport type InsightsClientWithGlobals = InsightsClient & {\n    shouldAddScript?: boolean;\n    version?: string;\n};\nexport type CreateInsightsMiddleware = typeof createInsightsMiddleware;\nexport declare function createInsightsMiddleware<TInsightsClient extends ProvidedInsightsClient>(props?: InsightsProps<TInsightsClient>): InternalMiddleware;\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/middlewares/createInsightsMiddleware.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nimport { getInsightsAnonymousUserTokenInternal } from \"../helpers/index.js\";\nimport { warning, noop, getAppIdAndApiKey, find, safelyRunOnBrowser } from \"../lib/utils/index.js\";\nimport { createUUID } from \"../lib/utils/uuid.js\";\nvar ALGOLIA_INSIGHTS_VERSION = '2.17.2';\nvar ALGOLIA_INSIGHTS_SRC = \"https://cdn.jsdelivr.net/npm/search-insights@\".concat(ALGOLIA_INSIGHTS_VERSION, \"/dist/search-insights.min.js\");\nexport function createInsightsMiddleware() {\n  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var _insightsClient = props.insightsClient,\n    insightsInitParams = props.insightsInitParams,\n    onEvent = props.onEvent,\n    _props$$$internal = props.$$internal,\n    $$internal = _props$$$internal === void 0 ? false : _props$$$internal,\n    _props$$$automatic = props.$$automatic,\n    $$automatic = _props$$$automatic === void 0 ? false : _props$$$automatic;\n  var potentialInsightsClient = _insightsClient;\n  if (!_insightsClient && _insightsClient !== null) {\n    safelyRunOnBrowser(function (_ref) {\n      var window = _ref.window;\n      var pointer = window.AlgoliaAnalyticsObject || 'aa';\n      if (typeof pointer === 'string') {\n        potentialInsightsClient = window[pointer];\n      }\n      if (!potentialInsightsClient) {\n        window.AlgoliaAnalyticsObject = pointer;\n        if (!window[pointer]) {\n          window[pointer] = function () {\n            if (!window[pointer].queue) {\n              window[pointer].queue = [];\n            }\n            for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n              args[_key] = arguments[_key];\n            }\n            window[pointer].queue.push(args);\n          };\n          window[pointer].version = ALGOLIA_INSIGHTS_VERSION;\n          window[pointer].shouldAddScript = true;\n        }\n        potentialInsightsClient = window[pointer];\n      }\n    });\n  }\n  // if still no insightsClient was found, we use a noop\n  var insightsClient = potentialInsightsClient || noop;\n  return function (_ref2) {\n    var instantSearchInstance = _ref2.instantSearchInstance;\n    // remove existing default insights middleware\n    // user-provided insights middleware takes precedence\n    var existingInsightsMiddlewares = instantSearchInstance.middleware.filter(function (m) {\n      return m.instance.$$type === 'ais.insights' && m.instance.$$internal;\n    }).map(function (m) {\n      return m.creator;\n    });\n    instantSearchInstance.unuse.apply(instantSearchInstance, _toConsumableArray(existingInsightsMiddlewares));\n    var _getAppIdAndApiKey = getAppIdAndApiKey(instantSearchInstance.client),\n      _getAppIdAndApiKey2 = _slicedToArray(_getAppIdAndApiKey, 2),\n      appId = _getAppIdAndApiKey2[0],\n      apiKey = _getAppIdAndApiKey2[1];\n\n    // search-insights.js also throws an error so dev-only clarification is sufficient\n    process.env.NODE_ENV === 'development' ? warning(Boolean(appId && apiKey), 'could not extract Algolia credentials from searchClient in insights middleware.') : void 0;\n    var queuedInitParams = undefined;\n    var queuedUserToken = undefined;\n    var userTokenBeforeInit = undefined;\n    var queue = insightsClient.queue;\n    if (Array.isArray(queue)) {\n      // Context: The umd build of search-insights is asynchronously loaded by the snippet.\n      //\n      // When user calls `aa('setUserToken', 'my-user-token')` before `search-insights` is loaded,\n      // ['setUserToken', 'my-user-token'] gets stored in `aa.queue`.\n      // Whenever `search-insights` is finally loaded, it will process the queue.\n      //\n      // But here's the reason why we handle it here:\n      // At this point, even though `search-insights` is not loaded yet,\n      // we still want to read the token from the queue.\n      // Otherwise, the first search call will be fired without the token.\n      var _map = ['setUserToken', 'init'].map(function (key) {\n        var _ref3 = find(queue.slice().reverse(), function (_ref5) {\n            var _ref6 = _slicedToArray(_ref5, 1),\n              method = _ref6[0];\n            return method === key;\n          }) || [],\n          _ref4 = _slicedToArray(_ref3, 2),\n          value = _ref4[1];\n        return value;\n      });\n      var _map2 = _slicedToArray(_map, 2);\n      queuedUserToken = _map2[0];\n      queuedInitParams = _map2[1];\n    }\n\n    // If user called `aa('setUserToken')` before creating the Insights middleware,\n    // we temporarily store the token and set it later on.\n    //\n    // Otherwise, the `init` call might override them with anonymous user token.\n    insightsClient('getUserToken', null, function (_error, userToken) {\n      userTokenBeforeInit = normalizeUserToken(userToken);\n    });\n\n    // Only `init` if the `insightsInitParams` option is passed or\n    // if the `insightsClient` version doesn't supports optional `init` calling.\n    if (insightsInitParams || !isModernInsightsClient(insightsClient)) {\n      insightsClient('init', _objectSpread({\n        appId: appId,\n        apiKey: apiKey,\n        partial: true\n      }, insightsInitParams));\n    }\n    var initialParameters;\n    var helper;\n    return {\n      $$type: 'ais.insights',\n      $$internal: $$internal,\n      $$automatic: $$automatic,\n      onStateChange: function onStateChange() {},\n      subscribe: function subscribe() {\n        if (!insightsClient.shouldAddScript) return;\n        var errorMessage = '[insights middleware]: could not load search-insights.js. Please load it manually following https://alg.li/insights-init';\n        try {\n          var script = document.createElement('script');\n          script.async = true;\n          script.src = ALGOLIA_INSIGHTS_SRC;\n          script.onerror = function () {\n            instantSearchInstance.emit('error', new Error(errorMessage));\n          };\n          document.body.appendChild(script);\n          insightsClient.shouldAddScript = false;\n        } catch (cause) {\n          insightsClient.shouldAddScript = false;\n          instantSearchInstance.emit('error', new Error(errorMessage));\n        }\n      },\n      started: function started() {\n        insightsClient('addAlgoliaAgent', 'insights-middleware');\n        helper = instantSearchInstance.mainHelper;\n        var queueAtStart = insightsClient.queue;\n        if (Array.isArray(queueAtStart)) {\n          var _map3 = ['setUserToken', 'init'].map(function (key) {\n            var _ref7 = find(queueAtStart.slice().reverse(), function (_ref9) {\n                var _ref10 = _slicedToArray(_ref9, 1),\n                  method = _ref10[0];\n                return method === key;\n              }) || [],\n              _ref8 = _slicedToArray(_ref7, 2),\n              value = _ref8[1];\n            return value;\n          });\n          var _map4 = _slicedToArray(_map3, 2);\n          queuedUserToken = _map4[0];\n          queuedInitParams = _map4[1];\n        }\n        initialParameters = getInitialParameters(instantSearchInstance);\n\n        // We don't want to force clickAnalytics when the insights is enabled from the search response.\n        // This means we don't enable insights for indices that don't opt in\n        if (!$$automatic) {\n          helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread(_objectSpread({}, helper.state), {}, {\n            clickAnalytics: true\n          }));\n        }\n        if (!$$internal) {\n          instantSearchInstance.scheduleSearch();\n        }\n        var setUserTokenToSearch = function setUserTokenToSearch(userToken) {\n          var immediate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n          var normalizedUserToken = normalizeUserToken(userToken);\n          if (!normalizedUserToken) {\n            return;\n          }\n          var existingToken = helper.state.userToken;\n          function applyToken() {\n            helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread(_objectSpread({}, helper.state), {}, {\n              userToken: normalizedUserToken\n            }));\n            if (existingToken && existingToken !== userToken) {\n              instantSearchInstance.scheduleSearch();\n            }\n          }\n\n          // Delay the token application to the next render cycle\n          if (!immediate) {\n            setTimeout(applyToken, 0);\n          } else {\n            applyToken();\n          }\n        };\n        function setUserToken(token) {\n          setUserTokenToSearch(token, true);\n          insightsClient('setUserToken', token);\n        }\n        var anonymousUserToken = undefined;\n        var anonymousTokenFromInsights = getInsightsAnonymousUserTokenInternal();\n        if (anonymousTokenFromInsights) {\n          // When `aa('init', { ... })` is called, it creates an anonymous user token in cookie.\n          // We can set it as userToken on instantsearch and insights. If it's not set as an insights\n          // userToken before a sendEvent, insights automatically generates a new anonymous token,\n          // causing a state change and an unnecessary query on instantsearch.\n          anonymousUserToken = anonymousTokenFromInsights;\n        } else {\n          var token = \"anonymous-\".concat(createUUID());\n          anonymousUserToken = token;\n        }\n        var userTokenFromInit;\n\n        // With SSR, the token could be be set on the state. We make sure\n        // that insights is in sync with that token since, there is no\n        // insights lib on the server.\n        var tokenFromSearchParameters = initialParameters.userToken;\n\n        // When the first query is sent, the token is possibly not yet set by\n        // the insights onChange callbacks (if insights isn't yet loaded).\n        // It is explicitly being set here so that the first query has the\n        // initial tokens set and ensure a second query isn't automatically\n        // made when the onChange callback actually changes the state.\n        if (insightsInitParams !== null && insightsInitParams !== void 0 && insightsInitParams.userToken) {\n          userTokenFromInit = insightsInitParams.userToken;\n        }\n        if (userTokenFromInit) {\n          setUserToken(userTokenFromInit);\n        } else if (tokenFromSearchParameters) {\n          setUserToken(tokenFromSearchParameters);\n        } else if (userTokenBeforeInit) {\n          setUserToken(userTokenBeforeInit);\n        } else if (queuedUserToken) {\n          setUserToken(queuedUserToken);\n        } else if (anonymousUserToken) {\n          var _queuedInitParams;\n          setUserToken(anonymousUserToken);\n          if (insightsInitParams !== null && insightsInitParams !== void 0 && insightsInitParams.useCookie || (_queuedInitParams = queuedInitParams) !== null && _queuedInitParams !== void 0 && _queuedInitParams.useCookie) {\n            var _queuedInitParams2;\n            saveTokenAsCookie(anonymousUserToken, (insightsInitParams === null || insightsInitParams === void 0 ? void 0 : insightsInitParams.cookieDuration) || ((_queuedInitParams2 = queuedInitParams) === null || _queuedInitParams2 === void 0 ? void 0 : _queuedInitParams2.cookieDuration));\n          }\n        }\n\n        // This updates userToken which is set explicitly by `aa('setUserToken', userToken)`\n        insightsClient('onUserTokenChange', function (token) {\n          return setUserTokenToSearch(token, true);\n        }, {\n          immediate: true\n        });\n        var insightsClientWithLocalCredentials = insightsClient;\n        if (isModernInsightsClient(insightsClient)) {\n          insightsClientWithLocalCredentials = function insightsClientWithLocalCredentials(method, payload) {\n            var _getAppIdAndApiKey3 = getAppIdAndApiKey(instantSearchInstance.client),\n              _getAppIdAndApiKey4 = _slicedToArray(_getAppIdAndApiKey3, 2),\n              latestAppId = _getAppIdAndApiKey4[0],\n              latestApiKey = _getAppIdAndApiKey4[1];\n            var extraParams = {\n              headers: {\n                'X-Algolia-Application-Id': latestAppId,\n                'X-Algolia-API-Key': latestApiKey\n              }\n            };\n\n            // @ts-ignore we are calling this only when we know that the client actually is correct\n            return insightsClient(method, payload, extraParams);\n          };\n        }\n        var viewedObjectIDs = new Set();\n        var lastQueryId;\n        instantSearchInstance.mainHelper.derivedHelpers[0].on('result', function (_ref11) {\n          var results = _ref11.results;\n          if (results && (!results.queryID || results.queryID !== lastQueryId)) {\n            lastQueryId = results.queryID;\n            viewedObjectIDs.clear();\n          }\n        });\n        instantSearchInstance.sendEventToInsights = function (event) {\n          if (onEvent) {\n            onEvent(event, insightsClientWithLocalCredentials);\n          } else if (event.insightsMethod) {\n            if (event.insightsMethod === 'viewedObjectIDs') {\n              var _payload = event.payload;\n              var difference = _payload.objectIDs.filter(function (objectID) {\n                return !viewedObjectIDs.has(objectID);\n              });\n              if (difference.length === 0) {\n                return;\n              }\n              difference.forEach(function (objectID) {\n                return viewedObjectIDs.add(objectID);\n              });\n              _payload.objectIDs = difference;\n            }\n\n            // Source is used to differentiate events sent by instantsearch from those sent manually.\n            event.payload.algoliaSource = ['instantsearch'];\n            if ($$automatic) {\n              event.payload.algoliaSource.push('instantsearch-automatic');\n            }\n            if (event.eventModifier === 'internal') {\n              event.payload.algoliaSource.push('instantsearch-internal');\n            }\n            insightsClientWithLocalCredentials(event.insightsMethod, event.payload);\n            process.env.NODE_ENV === 'development' ? warning(Boolean(helper.state.userToken), \"\\nCannot send event to Algolia Insights because `userToken` is not set.\\n\\nSee documentation: https://www.algolia.com/doc/guides/building-search-ui/going-further/send-insights-events/js/#setting-the-usertoken\\n\") : void 0;\n          } else {\n            process.env.NODE_ENV === 'development' ? warning(false, 'Cannot send event to Algolia Insights because `insightsMethod` option is missing.') : void 0;\n          }\n        };\n      },\n      unsubscribe: function unsubscribe() {\n        insightsClient('onUserTokenChange', undefined);\n        instantSearchInstance.sendEventToInsights = noop;\n        if (helper && initialParameters) {\n          helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread(_objectSpread({}, helper.state), initialParameters));\n          instantSearchInstance.scheduleSearch();\n        }\n      }\n    };\n  };\n}\nfunction getInitialParameters(instantSearchInstance) {\n  var _instantSearchInstanc, _instantSearchInstanc2;\n  // in SSR, the initial state we use in this domain is set on the main index\n  var stateFromInitialResults = ((_instantSearchInstanc = instantSearchInstance._initialResults) === null || _instantSearchInstanc === void 0 ? void 0 : (_instantSearchInstanc2 = _instantSearchInstanc[instantSearchInstance.indexName]) === null || _instantSearchInstanc2 === void 0 ? void 0 : _instantSearchInstanc2.state) || {};\n  var stateFromHelper = instantSearchInstance.mainHelper.state;\n  return {\n    userToken: stateFromInitialResults.userToken || stateFromHelper.userToken,\n    clickAnalytics: stateFromInitialResults.clickAnalytics || stateFromHelper.clickAnalytics\n  };\n}\nfunction saveTokenAsCookie(token, cookieDuration) {\n  var MONTH = 30 * 24 * 60 * 60 * 1000;\n  var d = new Date();\n  d.setTime(d.getTime() + (cookieDuration || MONTH * 6));\n  var expires = \"expires=\".concat(d.toUTCString());\n  document.cookie = \"_ALGOLIA=\".concat(token, \";\").concat(expires, \";path=/\");\n}\n\n/**\n * Determines if a given insights `client` supports the optional call to `init`\n * and the ability to set credentials via extra parameters when sending events.\n */\nfunction isModernInsightsClient(client) {\n  var _split$map = (client.version || '').split('.').map(Number),\n    _split$map2 = _slicedToArray(_split$map, 2),\n    major = _split$map2[0],\n    minor = _split$map2[1];\n\n  /* eslint-disable @typescript-eslint/naming-convention */\n  var v3 = major >= 3;\n  var v2_6 = major === 2 && minor >= 6;\n  var v1_10 = major === 1 && minor >= 10;\n  /* eslint-enable @typescript-eslint/naming-convention */\n\n  return v3 || v2_6 || v1_10;\n}\n\n/**\n * While `search-insights` supports both string and number user tokens,\n * the Search API only accepts strings. This function normalizes the user token.\n */\nfunction normalizeUserToken(userToken) {\n  if (!userToken) {\n    return undefined;\n  }\n  return typeof userToken === 'number' ? userToken.toString() : userToken;\n}"
  },
  {
    "path": "js/instantsearch.js/es/middlewares/createMetadataMiddleware.d.ts",
    "content": "import type { InternalMiddleware } from '../types';\nexport declare function isMetadataEnabled(): boolean;\n/**\n * Exposes the metadata of mounted widgets in a custom\n * `<meta name=\"instantsearch:widgets\" />` tag. The metadata per widget is:\n * - applied parameters\n * - widget name\n * - connector name\n */\nexport declare function createMetadataMiddleware({ $$internal, }?: {\n    $$internal?: boolean;\n}): InternalMiddleware;\n"
  },
  {
    "path": "js/instantsearch.js/es/middlewares/createMetadataMiddleware.js",
    "content": "import { createInitArgs, safelyRunOnBrowser } from \"../lib/utils/index.js\";\nfunction extractWidgetPayload(widgets, instantSearchInstance, payload) {\n  var initOptions = createInitArgs(instantSearchInstance, instantSearchInstance.mainIndex, instantSearchInstance._initialUiState);\n  widgets.forEach(function (widget) {\n    var widgetParams = {};\n    if (widget.getWidgetRenderState) {\n      var renderState = widget.getWidgetRenderState(initOptions);\n      if (renderState && renderState.widgetParams) {\n        // casting, as we just earlier checked widgetParams exists, and thus an object\n        widgetParams = renderState.widgetParams;\n      }\n    }\n\n    // since we destructure in all widgets, the parameters with defaults are set to \"undefined\"\n    var params = Object.keys(widgetParams).filter(function (key) {\n      return widgetParams[key] !== undefined;\n    });\n    payload.widgets.push({\n      type: widget.$$type,\n      widgetType: widget.$$widgetType,\n      params: params\n    });\n    if (widget.$$type === 'ais.index') {\n      extractWidgetPayload(widget.getWidgets(), instantSearchInstance, payload);\n    }\n  });\n}\nexport function isMetadataEnabled() {\n  return safelyRunOnBrowser(function (_ref) {\n    var _window$navigator, _window$navigator$use;\n    var window = _ref.window;\n    return ((_window$navigator = window.navigator) === null || _window$navigator === void 0 ? void 0 : (_window$navigator$use = _window$navigator.userAgent) === null || _window$navigator$use === void 0 ? void 0 : _window$navigator$use.indexOf('Algolia Crawler')) > -1;\n  }, {\n    fallback: function fallback() {\n      return false;\n    }\n  });\n}\n\n/**\n * Exposes the metadata of mounted widgets in a custom\n * `<meta name=\"instantsearch:widgets\" />` tag. The metadata per widget is:\n * - applied parameters\n * - widget name\n * - connector name\n */\nexport function createMetadataMiddleware() {\n  var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n    _ref2$$$internal = _ref2.$$internal,\n    $$internal = _ref2$$$internal === void 0 ? false : _ref2$$$internal;\n  return function (_ref3) {\n    var instantSearchInstance = _ref3.instantSearchInstance;\n    var payload = {\n      widgets: []\n    };\n    var payloadContainer = document.createElement('meta');\n    var refNode = document.querySelector('head');\n    payloadContainer.name = 'instantsearch:widgets';\n    return {\n      $$type: 'ais.metadata',\n      $$internal: $$internal,\n      onStateChange: function onStateChange() {},\n      subscribe: function subscribe() {\n        // using setTimeout here to delay extraction until widgets have been added in a tick (e.g. Vue)\n        setTimeout(function () {\n          var client = instantSearchInstance.client;\n          payload.ua = client.transporter && client.transporter.userAgent ? client.transporter.userAgent.value : client._ua;\n          extractWidgetPayload(instantSearchInstance.mainIndex.getWidgets(), instantSearchInstance, payload);\n          instantSearchInstance.middleware.forEach(function (middleware) {\n            return payload.widgets.push({\n              middleware: true,\n              type: middleware.instance.$$type,\n              internal: middleware.instance.$$internal\n            });\n          });\n          payloadContainer.content = JSON.stringify(payload);\n          refNode.appendChild(payloadContainer);\n        }, 0);\n      },\n      started: function started() {},\n      unsubscribe: function unsubscribe() {\n        payloadContainer.remove();\n      }\n    };\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/es/middlewares/createRouterMiddleware.d.ts",
    "content": "import type { Router, StateMapping, UiState, InternalMiddleware } from '../types';\nexport type RouterProps<TUiState extends UiState = UiState, TRouteState = TUiState> = {\n    router?: Router<TRouteState>;\n    stateMapping?: StateMapping<TUiState, TRouteState>;\n};\nexport declare const createRouterMiddleware: <TUiState extends UiState = UiState, TRouteState = TUiState>(props?: RouterProps<TUiState, TRouteState>) => InternalMiddleware<TUiState>;\n"
  },
  {
    "path": "js/instantsearch.js/es/middlewares/createRouterMiddleware.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport historyRouter from \"../lib/routers/history.js\";\nimport simpleStateMapping from \"../lib/stateMappings/simple.js\";\nimport { isEqual, warning } from \"../lib/utils/index.js\";\nexport var createRouterMiddleware = function createRouterMiddleware() {\n  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var _props$router = props.router,\n    router = _props$router === void 0 ? historyRouter() : _props$router,\n    _props$stateMapping = props.stateMapping,\n    stateMapping = _props$stateMapping === void 0 ? simpleStateMapping() : _props$stateMapping,\n    _props$$$internal = props.$$internal,\n    $$internal = _props$$$internal === void 0 ? false : _props$$$internal;\n  return function (_ref) {\n    var instantSearchInstance = _ref.instantSearchInstance;\n    function topLevelCreateURL(nextState) {\n      var previousUiState =\n      // If only the mainIndex is initialized, we don't yet know what other\n      // index widgets are used. Therefore we fall back to the initialUiState.\n      // We can't indiscriminately use the initialUiState because then we\n      // reintroduce state that was changed by the user.\n      // When there are no widgets, we are sure the user can't yet have made\n      // any changes.\n      instantSearchInstance.mainIndex.getWidgets().length === 0 ? instantSearchInstance._initialUiState : instantSearchInstance.mainIndex.getWidgetUiState({});\n      var uiState = Object.keys(nextState).reduce(function (acc, indexId) {\n        return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, indexId, nextState[indexId]));\n      }, previousUiState);\n      var route = stateMapping.stateToRoute(uiState);\n      return router.createURL(route);\n    }\n\n    // casting to UiState here to keep createURL unaware of custom UiState\n    // (as long as it's an object, it's ok)\n    instantSearchInstance._createURL = topLevelCreateURL;\n    var lastRouteState = undefined;\n    var initialUiState = instantSearchInstance._initialUiState;\n    return {\n      $$type: \"ais.router({router:\".concat(router.$$type || '__unknown__', \", stateMapping:\").concat(stateMapping.$$type || '__unknown__', \"})\"),\n      $$internal: $$internal,\n      onStateChange: function onStateChange(_ref2) {\n        var uiState = _ref2.uiState;\n        var routeState = stateMapping.stateToRoute(uiState);\n        if (lastRouteState === undefined || !isEqual(lastRouteState, routeState)) {\n          router.write(routeState);\n          lastRouteState = routeState;\n        }\n      },\n      subscribe: function subscribe() {\n        process.env.NODE_ENV === 'development' ? warning(Object.keys(initialUiState).length === 0, 'Using `initialUiState` together with routing is not recommended. The `initialUiState` will be overwritten by the URL parameters.') : void 0;\n        instantSearchInstance._initialUiState = _objectSpread(_objectSpread({}, initialUiState), stateMapping.routeToState(router.read()));\n        router.onUpdate(function (route) {\n          if (instantSearchInstance.mainIndex.getWidgets().length > 0) {\n            instantSearchInstance.setUiState(stateMapping.routeToState(route));\n          }\n        });\n      },\n      started: function started() {\n        var _router$start;\n        (_router$start = router.start) === null || _router$start === void 0 ? void 0 : _router$start.call(router);\n      },\n      unsubscribe: function unsubscribe() {\n        router.dispose();\n      }\n    };\n  };\n};"
  },
  {
    "path": "js/instantsearch.js/es/middlewares/index.d.ts",
    "content": "export * from './createInsightsMiddleware';\nexport * from './createRouterMiddleware';\nexport * from './createMetadataMiddleware';\n"
  },
  {
    "path": "js/instantsearch.js/es/middlewares/index.js",
    "content": "export * from \"./createInsightsMiddleware.js\";\nexport * from \"./createRouterMiddleware.js\";\nexport * from \"./createMetadataMiddleware.js\";"
  },
  {
    "path": "js/instantsearch.js/es/package.json",
    "content": "{\"type\":\"module\",\"sideEffects\":false}\n"
  },
  {
    "path": "js/instantsearch.js/es/templates/carousel/carousel.d.ts",
    "content": "\nimport { html } from 'htm/preact';\nimport { h } from 'preact';\nimport type { CarouselProps as CarouselUiProps, VNode } from 'instantsearch-ui-components';\ntype Template = (params: {\n    html: typeof html;\n}) => VNode | VNode[] | null;\ntype CreateCarouselTemplateProps<TObject extends Record<string, unknown>> = {\n    templates?: Partial<{\n        previous: Exclude<Template, string>;\n        next: Exclude<Template, string>;\n    }>;\n    cssClasses?: Partial<CarouselUiProps<TObject>['classNames']>;\n};\ntype CarouselTemplateProps<TObject extends Record<string, unknown>> = Pick<CarouselUiProps<TObject>, 'items'> & {\n    templates: {\n        item?: CarouselUiProps<TObject>['itemComponent'];\n    };\n    cssClasses?: Partial<CarouselUiProps<TObject>['classNames']>;\n} & {\n    sendEvent?: CarouselUiProps<TObject>['sendEvent'];\n};\nexport declare function carousel<TObject extends Record<string, unknown>>({ cssClasses, templates, }?: CreateCarouselTemplateProps<TObject>): ({ items, templates: widgetTemplates, cssClasses: widgetCssClasses, sendEvent, }: CarouselTemplateProps<TObject>) => h.JSX.Element;\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/templates/carousel/carousel.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport { html } from 'htm/preact';\nimport { createCarouselComponent, cx, generateCarouselId } from 'instantsearch-ui-components';\nimport { Fragment, h } from 'preact';\nimport { useRef } from 'preact/hooks';\nvar Carousel = createCarouselComponent({\n  createElement: h,\n  Fragment: Fragment\n});\nfunction CarouselWithRefs(props) {\n  var carouselRefs = {\n    listRef: useRef(null),\n    nextButtonRef: useRef(null),\n    previousButtonRef: useRef(null),\n    carouselIdRef: useRef(generateCarouselId())\n  };\n  return h(Carousel, _extends({}, carouselRefs, props));\n}\nexport function carousel() {\n  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n    cssClasses = _ref.cssClasses,\n    _ref$templates = _ref.templates,\n    templates = _ref$templates === void 0 ? {} : _ref$templates;\n  return function CarouselTemplate(_ref2) {\n    var items = _ref2.items,\n      widgetTemplates = _ref2.templates,\n      _ref2$cssClasses = _ref2.cssClasses,\n      widgetCssClasses = _ref2$cssClasses === void 0 ? {} : _ref2$cssClasses,\n      _ref2$sendEvent = _ref2.sendEvent,\n      sendEvent = _ref2$sendEvent === void 0 ? function () {} : _ref2$sendEvent;\n    var previous = templates.previous,\n      next = templates.next;\n    return h(CarouselWithRefs, {\n      items: items,\n      sendEvent: sendEvent,\n      itemComponent: widgetTemplates.item,\n      previousIconComponent: previous ? function () {\n        return previous({\n          html: html\n        });\n      } : undefined,\n      nextIconComponent: next ? function () {\n        return next({\n          html: html\n        });\n      } : undefined,\n      classNames: _objectSpread(_objectSpread({}, cssClasses), {\n        list: cx(cssClasses === null || cssClasses === void 0 ? void 0 : cssClasses.list, widgetCssClasses === null || widgetCssClasses === void 0 ? void 0 : widgetCssClasses.list),\n        item: cx(cssClasses === null || cssClasses === void 0 ? void 0 : cssClasses.item, widgetCssClasses === null || widgetCssClasses === void 0 ? void 0 : widgetCssClasses.item)\n      })\n    });\n  };\n}"
  },
  {
    "path": "js/instantsearch.js/es/templates/index.d.ts",
    "content": "export * from './carousel/carousel';\n"
  },
  {
    "path": "js/instantsearch.js/es/templates/index.js",
    "content": "export * from \"./carousel/carousel.js\";"
  },
  {
    "path": "js/instantsearch.js/es/types/algoliasearch.d.ts",
    "content": "export * from 'algoliasearch-helper/types/algoliasearch.js';\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/types/algoliasearch.js",
    "content": "// eslint-disable-next-line import/extensions\nexport * from 'algoliasearch-helper/types/algoliasearch.js';\nexport {};"
  },
  {
    "path": "js/instantsearch.js/es/types/component.d.ts",
    "content": "export type ComponentCSSClasses<TCSSClasses> = Required<{\n    [className in keyof TCSSClasses]: string;\n}>;\n"
  },
  {
    "path": "js/instantsearch.js/es/types/component.js",
    "content": "export {};"
  },
  {
    "path": "js/instantsearch.js/es/types/connector.d.ts",
    "content": "import type { InsightsClient } from './insights';\nimport type { InstantSearch } from './instantsearch';\nimport type { Hit } from './results';\nimport type { UnknownWidgetParams, Widget, WidgetDescription } from './widget';\nimport type { SearchResults } from 'algoliasearch-helper';\n/**\n * The base renderer options. All render functions receive\n * the options below plus the specific options per connector.\n */\nexport type RendererOptions<TWidgetParams> = {\n    /**\n     * The original widget params. Useful as you may\n     * need them while using the render function.\n     */\n    widgetParams: TWidgetParams;\n    /**\n     * The current instant search instance.\n     */\n    instantSearchInstance: InstantSearch;\n    /**\n     * The original search results.\n     */\n    results?: SearchResults;\n    /**\n     * The mutable list of hits. The may change depending\n     * of the given transform items function.\n     */\n    hits?: Hit[];\n    /**\n     * The current insights client, if any.\n     */\n    insights?: InsightsClient;\n};\n/**\n * The render function.\n */\nexport type Renderer<TRenderState, TWidgetParams> = (\n/**\n * The base render options plus the specific options of the widget.\n */\nrenderState: TRenderState & RendererOptions<TWidgetParams>, \n/**\n * If is the first run.\n */\nisFirstRender: boolean) => void;\n/**\n * The called function when unmounting a widget.\n */\nexport type Unmounter = () => void;\n/**\n * The connector handles the business logic and exposes\n * a simplified API to the rendering function.\n */\nexport type Connector<TWidgetDescription extends WidgetDescription, TConnectorParams extends UnknownWidgetParams> = <TWidgetParams extends UnknownWidgetParams>(\n/**\n * The render function.\n */\nrenderFn: Renderer<TWidgetDescription['renderState'], TConnectorParams & TWidgetParams>, \n/**\n * The called function when unmounting a widget.\n */\nunmountFn?: Unmounter) => (widgetParams: TConnectorParams & TWidgetParams) => Widget<TWidgetDescription & {\n    widgetParams: typeof widgetParams;\n}>;\n"
  },
  {
    "path": "js/instantsearch.js/es/types/connector.js",
    "content": "export {};"
  },
  {
    "path": "js/instantsearch.js/es/types/index.d.ts",
    "content": "export * from './utils';\nexport * from './algoliasearch';\nexport * from './results';\nexport * from './component';\nexport * from './instantsearch';\nexport * from './middleware';\nexport * from './router';\nexport * from './insights';\nexport * from './connector';\nexport * from './widget-factory';\nexport * from './widget';\nexport * from './ui-state';\nexport * from './render-state';\nexport * from './templates';\n"
  },
  {
    "path": "js/instantsearch.js/es/types/index.js",
    "content": "// internal\nexport * from \"./utils.js\";\n\n// Algolia-related\n// eslint-disable-next-line import/export\nexport * from \"./algoliasearch.js\";\nexport * from \"./results.js\";\n\n// component-related\nexport * from \"./component.js\";\n\n// instantsearch-related\nexport * from \"./instantsearch.js\";\nexport * from \"./middleware.js\";\nexport * from \"./router.js\";\nexport * from \"./insights.js\";\n\n// widget-related\nexport * from \"./connector.js\";\nexport * from \"./widget-factory.js\";\nexport * from \"./widget.js\";\nexport * from \"./ui-state.js\";\nexport * from \"./render-state.js\";\nexport * from \"./templates.js\";"
  },
  {
    "path": "js/instantsearch.js/es/types/insights.d.ts",
    "content": "import type { Hit } from './results';\nimport type { InsightsMethodMap as _InsightsMethodMap, InsightsClient as _InsightsClient } from 'search-insights';\nexport type { Init as InsightsInit, AddAlgoliaAgent as InsightsAddAlgoliaAgent, SetUserToken as InsightsSetUserToken, GetUserToken as InsightsGetUserToken, OnUserTokenChange as InsightsOnUserTokenChange, } from 'search-insights';\nexport type InsightsMethodMap = _InsightsMethodMap;\nexport type InsightsClientMethod = keyof InsightsMethodMap;\n/**\n * Method allowed by the insights middleware.\n */\nexport type InsightsMethod = 'clickedObjectIDsAfterSearch' | 'clickedObjectIDs' | 'clickedFilters' | 'convertedObjectIDsAfterSearch' | 'convertedObjectIDs' | 'convertedFilters' | 'viewedObjectIDs' | 'viewedFilters';\n/**\n * The event sent to the insights middleware.\n */\nexport type InsightsEvent<TMethod extends InsightsMethod = InsightsMethod> = {\n    insightsMethod?: TMethod;\n    payload: InsightsMethodMap[TMethod][0][0];\n    widgetType: string;\n    eventType: string;\n    eventModifier?: string;\n    hits?: Hit[];\n    attribute?: string;\n};\nexport type InsightsClientPayload = {\n    eventName: string;\n    queryID: string;\n    index: string;\n    objectIDs: string[];\n    positions?: number[];\n};\ntype QueueItemMap = {\n    [MethodName in keyof InsightsMethodMap]: [\n        methodName: MethodName,\n        ...args: InsightsMethodMap[MethodName][0][0]\n    ];\n};\nexport type QueueItem = QueueItemMap[keyof QueueItemMap];\nexport type InsightsClient = _InsightsClient & {\n    queue?: QueueItem[];\n};\n"
  },
  {
    "path": "js/instantsearch.js/es/types/insights.js",
    "content": "export {};"
  },
  {
    "path": "js/instantsearch.js/es/types/instantsearch.d.ts",
    "content": "export type { default as InstantSearch, InstantSearchOptions, InstantSearchStatus, } from '../lib/InstantSearch';\n"
  },
  {
    "path": "js/instantsearch.js/es/types/instantsearch.js",
    "content": "export {};"
  },
  {
    "path": "js/instantsearch.js/es/types/middleware.d.ts",
    "content": "import type InstantSearch from '../lib/InstantSearch';\nimport type { UiState } from './ui-state';\nimport type { AtLeastOne } from './utils';\nexport type MiddlewareDefinition<TUiState extends UiState = UiState> = {\n    /**\n     * string to identify the middleware\n     */\n    $$type: string;\n    /**\n     * Change handler called on every UiState change\n     */\n    onStateChange: (options: {\n        uiState: TUiState;\n    }) => void;\n    /**\n     * Called when the middleware is added to InstantSearch\n     */\n    subscribe: () => void;\n    /**\n     * Called when InstantSearch is started\n     */\n    started: () => void;\n    /**\n     * Called when the middleware is removed from InstantSearch\n     */\n    unsubscribe: () => void;\n};\nexport type MiddlewareOptions = {\n    instantSearchInstance: InstantSearch;\n};\nexport type InternalMiddleware<TUiState extends UiState = UiState> = (options: MiddlewareOptions) => MiddlewareDefinition<TUiState>;\nexport type Middleware<TUiState extends UiState = UiState> = (options: MiddlewareOptions) => AtLeastOne<MiddlewareDefinition<TUiState>>;\n"
  },
  {
    "path": "js/instantsearch.js/es/types/middleware.js",
    "content": "export {};"
  },
  {
    "path": "js/instantsearch.js/es/types/render-state.d.ts",
    "content": "import type { AnswersWidgetDescription } from '../connectors/answers/connectAnswers';\nimport type { AutocompleteWidgetDescription } from '../connectors/autocomplete/connectAutocomplete';\nimport type { BreadcrumbWidgetDescription } from '../connectors/breadcrumb/connectBreadcrumb';\nimport type { ClearRefinementsWidgetDescription } from '../connectors/clear-refinements/connectClearRefinements';\nimport type { ConfigureWidgetDescription } from '../connectors/configure/connectConfigure';\nimport type { CurrentRefinementsWidgetDescription } from '../connectors/current-refinements/connectCurrentRefinements';\nimport type { GeoSearchWidgetDescription } from '../connectors/geo-search/connectGeoSearch';\nimport type { HierarchicalMenuWidgetDescription } from '../connectors/hierarchical-menu/connectHierarchicalMenu';\nimport type { HitsPerPageWidgetDescription } from '../connectors/hits-per-page/connectHitsPerPage';\nimport type { HitsWidgetDescription } from '../connectors/hits/connectHits';\nimport type { InfiniteHitsWidgetDescription } from '../connectors/infinite-hits/connectInfiniteHits';\nimport type { MenuWidgetDescription } from '../connectors/menu/connectMenu';\nimport type { NumericMenuWidgetDescription } from '../connectors/numeric-menu/connectNumericMenu';\nimport type { PaginationWidgetDescription } from '../connectors/pagination/connectPagination';\nimport type { PoweredByWidgetDescription } from '../connectors/powered-by/connectPoweredBy';\nimport type { QueryRulesWidgetDescription } from '../connectors/query-rules/connectQueryRules';\nimport type { RangeWidgetDescription } from '../connectors/range/connectRange';\nimport type { RatingMenuWidgetDescription } from '../connectors/rating-menu/connectRatingMenu';\nimport type { RefinementListWidgetDescription } from '../connectors/refinement-list/connectRefinementList';\nimport type { RelevantSortWidgetDescription } from '../connectors/relevant-sort/connectRelevantSort';\nimport type { SearchBoxWidgetDescription } from '../connectors/search-box/connectSearchBox';\nimport type { SortByWidgetDescription } from '../connectors/sort-by/connectSortBy';\nimport type { StatsWidgetDescription } from '../connectors/stats/connectStats';\nimport type { ToggleRefinementWidgetDescription } from '../connectors/toggle-refinement/connectToggleRefinement';\nimport type { VoiceSearchWidgetDescription } from '../connectors/voice-search/connectVoiceSearch';\nimport type { AnalyticsWidgetDescription } from '../widgets/analytics/analytics';\nimport type { PlacesWidgetDescription } from '../widgets/places/places';\ntype ConnectorRenderStates = AnswersWidgetDescription['indexRenderState'] & AutocompleteWidgetDescription['indexRenderState'] & BreadcrumbWidgetDescription['indexRenderState'] & ClearRefinementsWidgetDescription['indexRenderState'] & ConfigureWidgetDescription['indexRenderState'] & CurrentRefinementsWidgetDescription['indexRenderState'] & GeoSearchWidgetDescription['indexRenderState'] & HierarchicalMenuWidgetDescription['indexRenderState'] & HitsWidgetDescription['indexRenderState'] & HitsPerPageWidgetDescription['indexRenderState'] & InfiniteHitsWidgetDescription['indexRenderState'] & MenuWidgetDescription['indexRenderState'] & NumericMenuWidgetDescription['indexRenderState'] & PaginationWidgetDescription['indexRenderState'] & PoweredByWidgetDescription['indexRenderState'] & QueryRulesWidgetDescription['indexRenderState'] & RangeWidgetDescription['indexRenderState'] & RatingMenuWidgetDescription['indexRenderState'] & RefinementListWidgetDescription['indexRenderState'] & RelevantSortWidgetDescription['indexRenderState'] & SearchBoxWidgetDescription['indexRenderState'] & SortByWidgetDescription['indexRenderState'] & StatsWidgetDescription['indexRenderState'] & ToggleRefinementWidgetDescription['indexRenderState'] & VoiceSearchWidgetDescription['indexRenderState'];\ntype WidgetRenderStates = AnalyticsWidgetDescription['indexRenderState'] & PlacesWidgetDescription['indexRenderState'];\nexport type IndexRenderState = Partial<ConnectorRenderStates & WidgetRenderStates>;\nexport type RenderState = {\n    [indexId: string]: IndexRenderState;\n};\nexport type WidgetRenderState<TWidgetRenderState, TWidgetParams> = TWidgetRenderState & {\n    widgetParams: TWidgetParams;\n};\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/types/render-state.js",
    "content": "export {};"
  },
  {
    "path": "js/instantsearch.js/es/types/results.d.ts",
    "content": "import type { SearchOptions } from './algoliasearch';\nimport type { PlainSearchParameters, RecommendParametersOptions, RecommendResults, SearchForFacetValues, SearchResults } from 'algoliasearch-helper';\nexport type HitAttributeHighlightResult = {\n    value: string;\n    matchLevel: 'none' | 'partial' | 'full';\n    matchedWords: string[];\n    fullyHighlighted?: boolean;\n};\nexport type HitHighlightResult = {\n    [attribute: string]: HitAttributeHighlightResult | HitAttributeHighlightResult[] | HitHighlightResult[] | HitHighlightResult;\n};\nexport type HitAttributeSnippetResult = Pick<HitAttributeHighlightResult, 'value' | 'matchLevel'>;\nexport type HitSnippetResult = {\n    [attribute: string]: HitAttributeSnippetResult[] | HitSnippetResult[] | HitAttributeSnippetResult | HitSnippetResult;\n};\nexport type GeoLoc = {\n    lat: number;\n    lng: number;\n};\nexport type AlgoliaHit<THit extends NonNullable<object> = Record<string, any>> = {\n    objectID: string;\n    _highlightResult?: HitHighlightResult;\n    _snippetResult?: HitSnippetResult;\n    _rankingInfo?: {\n        promoted: boolean;\n        nbTypos: number;\n        firstMatchedWord: number;\n        proximityDistance?: number;\n        geoDistance: number;\n        geoPrecision?: number;\n        nbExactWords: number;\n        words: number;\n        filters: number;\n        userScore: number;\n        matchedGeoLocation?: {\n            lat: number;\n            lng: number;\n            distance: number;\n        };\n    };\n    _distinctSeqID?: number;\n    _geoloc?: GeoLoc;\n} & THit;\nexport type BaseHit = Record<string, any>;\nexport type Hit<THit extends NonNullable<object> = Record<string, any>> = {\n    __position: number;\n    __queryID?: string;\n} & AlgoliaHit<THit>;\nexport type GeoHit<THit extends NonNullable<object> = BaseHit> = Hit<THit> & Required<Pick<Hit, '_geoloc'>>;\n/**\n * @deprecated use Hit[] directly instead\n */\nexport type Hits = Hit[];\nexport type EscapedHits<THit = Hit> = THit[] & {\n    __escaped: boolean;\n};\nexport type FacetHit = SearchForFacetValues.Hit;\nexport type FacetRefinement = {\n    value: string;\n    type: 'conjunctive' | 'disjunctive' | 'exclude';\n};\nexport type NumericRefinement = {\n    value: number[];\n    type: 'numeric';\n    operator: string;\n};\nexport type Refinement = FacetRefinement | NumericRefinement;\ntype InitialResult = {\n    state?: PlainSearchParameters;\n    results?: SearchResults['_rawResults'];\n    recommendResults?: {\n        params: NonNullable<RecommendParametersOptions['params']>;\n        results: RecommendResults['_rawResults'];\n    };\n    requestParams?: SearchOptions[];\n};\nexport type InitialResults = Record<string, InitialResult>;\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/types/results.js",
    "content": "export {};"
  },
  {
    "path": "js/instantsearch.js/es/types/router.d.ts",
    "content": "import type { UiState } from './ui-state';\n/**\n * The router is the part that saves and reads the object from the storage.\n * Usually this is the URL.\n */\nexport type Router<TRouteState = UiState> = {\n    /**\n     * onUpdate Sets an event listener that is triggered when the storage is updated.\n     * The function should accept a callback to trigger when the update happens.\n     * In the case of the history / URL in a browser, the callback will be called\n     * by `onPopState`.\n     */\n    onUpdate: (callback: (route: TRouteState) => void) => void;\n    /**\n     * Reads the storage and gets a route object. It does not take parameters,\n     * and should return an object\n     */\n    read: () => TRouteState;\n    /**\n     * Pushes a route object into a storage. Takes the UI state mapped by the state\n     * mapping configured in the mapping\n     */\n    write: (route: TRouteState) => void;\n    /**\n     * Transforms a route object into a URL. It receives an object and should\n     * return a string. It may return an empty string.\n     */\n    createURL: (state: TRouteState) => string;\n    /**\n     * Called when InstantSearch is disposed. Used to remove subscriptions.\n     */\n    dispose: () => void;\n    /**\n     * Called when InstantSearch is started.\n     */\n    start?: () => void;\n    /**\n     * Identifier for this router. Used to differentiate between routers.\n     */\n    $$type?: string;\n};\n/**\n * The state mapping is a way to customize the structure before sending it to the router.\n * It can transform and filter out the properties. To work correctly, the following\n * should be valid for any UiState:\n * `UiState = routeToState(stateToRoute(UiState))`.\n */\nexport type StateMapping<TUiState = UiState, TRouteState = TUiState> = {\n    /**\n     * Transforms a UI state representation into a route object.\n     * It receives an object that contains the UI state of all the widgets in the page.\n     * It should return an object of any form as long as this form can be read by\n     * the `routeToState` function.\n     */\n    stateToRoute: (uiState: TUiState) => TRouteState;\n    /**\n     * Transforms route object into a UI state representation.\n     * It receives an object that contains the UI state stored by the router.\n     * The format is the output of `stateToRoute`.\n     */\n    routeToState: (routeState: TRouteState) => TUiState;\n    /**\n     * Identifier for this stateMapping. Used to differentiate between stateMappings.\n     */\n    $$type?: string;\n};\n"
  },
  {
    "path": "js/instantsearch.js/es/types/router.js",
    "content": "export {};"
  },
  {
    "path": "js/instantsearch.js/es/types/templates.d.ts",
    "content": "import type { Highlight, ReverseHighlight, ReverseSnippet, Snippet } from '../helpers/components';\nimport type { BuiltInBindEventForHits, CustomBindEventForHits, SendEventForHits } from '../lib/utils';\nimport type { html } from 'htm/preact';\nimport type { VNode } from 'preact';\nexport type Template<TTemplateData = void> = string | ((data: TTemplateData, params: TemplateParams) => VNode | VNode[] | string | null);\nexport type TemplateParams = {\n    html: typeof html;\n    components: {\n        Highlight: typeof Highlight;\n        ReverseHighlight: typeof ReverseHighlight;\n        Snippet: typeof Snippet;\n        ReverseSnippet: typeof ReverseSnippet;\n    };\n    sendEvent?: SendEventForHits;\n};\ninterface TemplateWithBindEventParams extends TemplateParams {\n    /** @deprecated use sendEvent instead */\n    (...args: Parameters<BuiltInBindEventForHits>): ReturnType<BuiltInBindEventForHits>;\n    /** @deprecated use sendEvent instead */\n    (...args: Parameters<CustomBindEventForHits>): ReturnType<CustomBindEventForHits>;\n    sendEvent: SendEventForHits;\n}\nexport type TemplateWithBindEvent<TTemplateData = void> = string | ((data: TTemplateData, params: TemplateWithBindEventParams) => VNode | VNode[] | string);\nexport type Templates = {\n    [key: string]: Template<any> | TemplateWithBindEvent<any> | undefined;\n};\nexport type HoganHelpers<TKeys extends string = string> = Record<TKeys, (text: string, render: (value: string) => string) => string>;\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/types/templates.js",
    "content": "export {};"
  },
  {
    "path": "js/instantsearch.js/es/types/ui-state.d.ts",
    "content": "import type { AutocompleteWidgetDescription } from '../connectors/autocomplete/connectAutocomplete';\nimport type { ConfigureWidgetDescription } from '../connectors/configure/connectConfigure';\nimport type { GeoSearchWidgetDescription } from '../connectors/geo-search/connectGeoSearch';\nimport type { HierarchicalMenuWidgetDescription } from '../connectors/hierarchical-menu/connectHierarchicalMenu';\nimport type { HitsPerPageWidgetDescription } from '../connectors/hits-per-page/connectHitsPerPage';\nimport type { InfiniteHitsWidgetDescription } from '../connectors/infinite-hits/connectInfiniteHits';\nimport type { MenuWidgetDescription } from '../connectors/menu/connectMenu';\nimport type { NumericMenuWidgetDescription } from '../connectors/numeric-menu/connectNumericMenu';\nimport type { PaginationWidgetDescription } from '../connectors/pagination/connectPagination';\nimport type { RangeWidgetDescription } from '../connectors/range/connectRange';\nimport type { RatingMenuWidgetDescription } from '../connectors/rating-menu/connectRatingMenu';\nimport type { RefinementListWidgetDescription } from '../connectors/refinement-list/connectRefinementList';\nimport type { RelevantSortWidgetDescription } from '../connectors/relevant-sort/connectRelevantSort';\nimport type { SearchBoxWidgetDescription } from '../connectors/search-box/connectSearchBox';\nimport type { SortByWidgetDescription } from '../connectors/sort-by/connectSortBy';\nimport type { ToggleRefinementWidgetDescription } from '../connectors/toggle-refinement/connectToggleRefinement';\nimport type { VoiceSearchWidgetDescription } from '../connectors/voice-search/connectVoiceSearch';\nimport type { PlacesWidgetDescription } from '../widgets/places/places';\ntype ConnectorUiStates = AutocompleteWidgetDescription['indexUiState'] & ConfigureWidgetDescription['indexUiState'] & GeoSearchWidgetDescription['indexUiState'] & HierarchicalMenuWidgetDescription['indexUiState'] & HitsPerPageWidgetDescription['indexUiState'] & InfiniteHitsWidgetDescription['indexUiState'] & MenuWidgetDescription['indexUiState'] & NumericMenuWidgetDescription['indexUiState'] & PaginationWidgetDescription['indexUiState'] & RangeWidgetDescription['indexUiState'] & RatingMenuWidgetDescription['indexUiState'] & RefinementListWidgetDescription['indexUiState'] & RelevantSortWidgetDescription['indexUiState'] & SearchBoxWidgetDescription['indexUiState'] & SortByWidgetDescription['indexUiState'] & ToggleRefinementWidgetDescription['indexUiState'] & VoiceSearchWidgetDescription['indexUiState'];\ntype WidgetUiStates = PlacesWidgetDescription['indexUiState'];\nexport type IndexUiState = Partial<ConnectorUiStates & WidgetUiStates>;\nexport type UiState = {\n    [indexId: string]: IndexUiState;\n};\nexport {};\n"
  },
  {
    "path": "js/instantsearch.js/es/types/ui-state.js",
    "content": "export {};"
  },
  {
    "path": "js/instantsearch.js/es/types/utils.d.ts",
    "content": "export type HighlightedParts = {\n    value: string;\n    isHighlighted: boolean;\n};\nexport type AtLeastOne<TTarget, TMapped = {\n    [Key in keyof TTarget]: Pick<TTarget, Key>;\n}> = Partial<TTarget> & TMapped[keyof TMapped];\nexport type Expand<T> = T extends infer O ? {\n    [K in keyof O]: O[K];\n} : never;\nexport type RequiredKeys<TObject, TKeys extends keyof TObject> = Expand<Required<Pick<TObject, TKeys>> & Omit<TObject, TKeys>>;\nexport type Awaited<T> = T extends PromiseLike<infer U> ? Awaited<U> : T;\n/**\n * Make certain keys of an object optional.\n */\nexport type PartialKeys<TObj, TKeys extends keyof TObj> = Omit<TObj, TKeys> & Partial<Pick<TObj, TKeys>>;\n"
  },
  {
    "path": "js/instantsearch.js/es/types/utils.js",
    "content": "export {};"
  },
  {
    "path": "js/instantsearch.js/es/types/widget-factory.d.ts",
    "content": "import type { UnknownWidgetParams, Widget, WidgetDescription } from './widget';\n/**\n * The function that creates a new widget.\n */\nexport type WidgetFactory<TWidgetDescription extends WidgetDescription, TConnectorParams extends UnknownWidgetParams, TWidgetParams extends UnknownWidgetParams> = (\n/**\n * The params of the widget.\n */\nwidgetParams: TWidgetParams & TConnectorParams) => Widget<TWidgetDescription & {\n    widgetParams: TConnectorParams;\n}>;\nexport type UnknownWidgetFactory = WidgetFactory<{\n    $$type: string;\n}, any, any>;\n"
  },
  {
    "path": "js/instantsearch.js/es/types/widget-factory.js",
    "content": "export {};"
  },
  {
    "path": "js/instantsearch.js/es/types/widget.d.ts",
    "content": "import type { IndexWidget } from '../widgets';\nimport type { RecommendResponse } from './algoliasearch';\nimport type { InstantSearch } from './instantsearch';\nimport type { IndexRenderState, WidgetRenderState } from './render-state';\nimport type { IndexUiState, UiState } from './ui-state';\nimport type { Expand, RequiredKeys } from './utils';\nimport type { AlgoliaSearchHelper as Helper, SearchParameters, SearchResults, RecommendParameters } from 'algoliasearch-helper';\nexport type ScopedResult = {\n    indexId: string;\n    results: SearchResults | null;\n    helper: Helper;\n};\ntype SharedRenderOptions = {\n    instantSearchInstance: InstantSearch;\n    parent: IndexWidget;\n    templatesConfig: Record<string, unknown>;\n    scopedResults: ScopedResult[];\n    state: SearchParameters;\n    renderState: IndexRenderState;\n    helper: Helper;\n    /** @deprecated use `status` instead */\n    searchMetadata: {\n        /** @deprecated use `status === \"stalled\"` instead */\n        isSearchStalled: boolean;\n    };\n    status: InstantSearch['status'];\n    error: InstantSearch['error'];\n    createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\n};\nexport type InitOptions = SharedRenderOptions & {\n    uiState: UiState;\n    results?: undefined;\n};\nexport type ShouldRenderOptions = {\n    instantSearchInstance: InstantSearch;\n};\nexport type RenderOptions = SharedRenderOptions & {\n    results: SearchResults | null;\n};\nexport type DisposeOptions = {\n    helper: Helper;\n    state: SearchParameters;\n    recommendState: RecommendParameters;\n    parent: IndexWidget;\n};\nexport type BuiltinTypes = 'ais.analytics' | 'ais.answers' | 'ais.autocomplete' | 'ais.breadcrumb' | 'ais.clearRefinements' | 'ais.configure' | 'ais.configureRelatedItems' | 'ais.currentRefinements' | 'ais.dynamicWidgets' | 'ais.frequentlyBoughtTogether' | 'ais.geoSearch' | 'ais.hierarchicalMenu' | 'ais.hits' | 'ais.hitsPerPage' | 'ais.index' | 'ais.infiniteHits' | 'ais.lookingSimilar' | 'ais.menu' | 'ais.numericMenu' | 'ais.pagination' | 'ais.places' | 'ais.poweredBy' | 'ais.queryRules' | 'ais.range' | 'ais.rangeSlider' | 'ais.rangeInput' | 'ais.ratingMenu' | 'ais.refinementList' | 'ais.relatedProducts' | 'ais.searchBox' | 'ais.relevantSort' | 'ais.sortBy' | 'ais.stats' | 'ais.toggleRefinement' | 'ais.trendingItems' | 'ais.voiceSearch';\nexport type BuiltinWidgetTypes = 'ais.analytics' | 'ais.answers' | 'ais.autocomplete' | 'ais.breadcrumb' | 'ais.clearRefinements' | 'ais.configure' | 'ais.configureRelatedItems' | 'ais.currentRefinements' | 'ais.dynamicWidgets' | 'ais.frequentlyBoughtTogether' | 'ais.geoSearch' | 'ais.hierarchicalMenu' | 'ais.hits' | 'ais.hitsPerPage' | 'ais.index' | 'ais.infiniteHits' | 'ais.lookingSimilar' | 'ais.menu' | 'ais.menuSelect' | 'ais.numericMenu' | 'ais.pagination' | 'ais.places' | 'ais.poweredBy' | 'ais.queryRuleCustomData' | 'ais.queryRuleContext' | 'ais.rangeInput' | 'ais.rangeSlider' | 'ais.ratingMenu' | 'ais.refinementList' | 'ais.relatedProducts' | 'ais.searchBox' | 'ais.relevantSort' | 'ais.sortBy' | 'ais.stats' | 'ais.toggleRefinement' | 'ais.trendingItems' | 'ais.voiceSearch';\nexport type UnknownWidgetParams = NonNullable<object>;\nexport type WidgetParams = {\n    widgetParams?: UnknownWidgetParams;\n};\nexport type WidgetDescription = {\n    $$type: string;\n    $$widgetType?: string;\n    renderState?: Record<string, unknown>;\n    indexRenderState?: Record<string, unknown>;\n    indexUiState?: Record<string, unknown>;\n};\ntype SearchWidget<TWidgetDescription extends WidgetDescription> = {\n    dependsOn?: 'search';\n    getWidgetParameters?: (state: SearchParameters, widgetParametersOptions: {\n        uiState: Expand<Partial<TWidgetDescription['indexUiState'] & IndexUiState>>;\n    }) => SearchParameters;\n};\ntype RecommendRenderOptions = SharedRenderOptions & {\n    results: RecommendResponse<any>;\n};\ntype RecommendWidget<TWidgetDescription extends WidgetDescription & WidgetParams> = {\n    dependsOn: 'recommend';\n    $$id?: number;\n    getWidgetParameters: (state: RecommendParameters, widgetParametersOptions: {\n        uiState: Expand<Partial<TWidgetDescription['indexUiState'] & IndexUiState>>;\n    }) => RecommendParameters;\n    getRenderState: (renderState: Expand<IndexRenderState & Partial<TWidgetDescription['indexRenderState']>>, renderOptions: InitOptions | RecommendRenderOptions) => IndexRenderState & TWidgetDescription['indexRenderState'];\n    getWidgetRenderState: (renderOptions: InitOptions | RecommendRenderOptions) => Expand<WidgetRenderState<TWidgetDescription['renderState'], TWidgetDescription['widgetParams']>>;\n};\ntype RequiredWidgetLifeCycle<TWidgetDescription extends WidgetDescription> = {\n    /**\n     * Identifier for connectors and widgets.\n     */\n    $$type: TWidgetDescription['$$type'];\n    /**\n     * Called once before the first search.\n     */\n    init?: (options: InitOptions) => void;\n    /**\n     * Whether `render` should be called\n     */\n    shouldRender?: (options: ShouldRenderOptions) => boolean;\n    /**\n     * Called after each search response has been received.\n     */\n    render?: (options: RenderOptions) => void;\n    /**\n     * Called when this widget is unmounted. Used to remove refinements set by\n     * during this widget's initialization and life time.\n     */\n    dispose?: (options: DisposeOptions) => SearchParameters | RecommendParameters | void;\n};\ntype RequiredWidgetType<TWidgetDescription extends WidgetDescription> = {\n    /**\n     * Identifier for widgets.\n     */\n    $$widgetType: TWidgetDescription['$$widgetType'];\n};\ntype WidgetType<TWidgetDescription extends WidgetDescription> = TWidgetDescription extends RequiredKeys<WidgetDescription, '$$widgetType'> ? RequiredWidgetType<TWidgetDescription> : {\n    /**\n     * Identifier for widgets.\n     */\n    $$widgetType?: string;\n};\ntype RequiredUiStateLifeCycle<TWidgetDescription extends WidgetDescription> = {\n    /**\n     * This function is required for a widget to be taken in account for routing.\n     * It will derive a uiState for this widget based on the existing uiState and\n     * the search parameters applied.\n     *\n     * @param uiState - Current state.\n     * @param widgetStateOptions - Extra information to calculate uiState.\n     */\n    getWidgetUiState: (uiState: Expand<Partial<TWidgetDescription['indexUiState'] & IndexUiState>>, widgetUiStateOptions: {\n        searchParameters: SearchParameters;\n        helper: Helper;\n    }) => Partial<IndexUiState & TWidgetDescription['indexUiState']>;\n    /**\n     * This function is required for a widget to be taken in account for routing.\n     * It will derive a uiState for this widget based on the existing uiState and\n     * the search parameters applied.\n     *\n     * @deprecated Use `getWidgetUiState` instead.\n     * @param uiState - Current state.\n     * @param widgetStateOptions - Extra information to calculate uiState.\n     */\n    getWidgetState?: RequiredUiStateLifeCycle<TWidgetDescription>['getWidgetUiState'];\n    /**\n     * This function is required for a widget to behave correctly when a URL is\n     * loaded via e.g. Routing. It receives the current UiState and applied search\n     * parameters, and is expected to return a new search parameters.\n     *\n     * @param state - Applied search parameters.\n     * @param widgetSearchParametersOptions - Extra information to calculate next searchParameters.\n     */\n    getWidgetSearchParameters: (state: SearchParameters, widgetSearchParametersOptions: {\n        uiState: Expand<Partial<TWidgetDescription['indexUiState'] & IndexUiState>>;\n    }) => SearchParameters;\n};\ntype UiStateLifeCycle<TWidgetDescription extends WidgetDescription> = TWidgetDescription extends RequiredKeys<WidgetDescription, 'indexUiState'> ? RequiredUiStateLifeCycle<TWidgetDescription> : Partial<RequiredUiStateLifeCycle<TWidgetDescription>>;\ntype RequiredRenderStateLifeCycle<TWidgetDescription extends WidgetDescription & WidgetParams> = {\n    /**\n     * Returns the render state of the current widget to pass to the render function.\n     */\n    getWidgetRenderState: (renderOptions: InitOptions | RenderOptions) => Expand<WidgetRenderState<TWidgetDescription['renderState'], TWidgetDescription['widgetParams']>>;\n    /**\n     * Returns IndexRenderState of the current index component tree\n     * to build the render state of the whole app.\n     */\n    getRenderState: (renderState: Expand<IndexRenderState & Partial<TWidgetDescription['indexRenderState']>>, renderOptions: InitOptions | RenderOptions) => IndexRenderState & TWidgetDescription['indexRenderState'];\n};\ntype RenderStateLifeCycle<TWidgetDescription extends WidgetDescription & WidgetParams> = TWidgetDescription extends RequiredKeys<WidgetDescription, 'renderState' | 'indexRenderState'> & WidgetParams ? RequiredRenderStateLifeCycle<TWidgetDescription> : Partial<RequiredRenderStateLifeCycle<TWidgetDescription>>;\nexport type Widget<TWidgetDescription extends WidgetDescription & WidgetParams = {\n    $$type: string;\n}> = Expand<RequiredWidgetLifeCycle<TWidgetDescription> & WidgetType<TWidgetDescription> & UiStateLifeCycle<TWidgetDescription> & RenderStateLifeCycle<TWidgetDescription>> & (SearchWidget<TWidgetDescription> | RecommendWidget<TWidgetDescription>);\nexport type { IndexWidget } from '../widgets';\nexport type TransformItemsMetadata = {\n    results: SearchResults | undefined | null;\n};\n/**\n * Transforms the given items.\n */\nexport type TransformItems<TItem, TMetadata = TransformItemsMetadata> = (items: TItem[], metadata: TMetadata) => TItem[];\ntype SortByDirection<TCriterion extends string> = TCriterion | `${TCriterion}:asc` | `${TCriterion}:desc`;\n/**\n * Transforms the given items.\n */\nexport type SortBy<TItem> = ((a: TItem, b: TItem) => number) | Array<SortByDirection<'count' | 'name' | 'isRefined'>>;\n/**\n * Creates the URL for the given value.\n */\nexport type CreateURL<TValue> = (value: TValue) => string;\n"
  },
  {
    "path": "js/instantsearch.js/es/types/widget.js",
    "content": "export {};"
  },
  {
    "path": "js/instantsearch.js/es/widgets/analytics/analytics.d.ts",
    "content": "import type { WidgetFactory, WidgetRenderState } from '../../types';\nimport type { SearchParameters, SearchResults } from 'algoliasearch-helper';\nexport type AnalyticsWidgetParamsPushFunction = (\n/**\n * Contains the search parameters, serialized as a query string.\n */\nformattedParameters: string, \n/**\n * Contains the whole search state.\n */\nstate: SearchParameters, \n/**\n * The last received results.\n */\nresults: SearchResults) => void;\nexport type AnalyticsWidgetParams = {\n    /**\n     * A function that is called every time the query or refinements changes. You\n     * need to add the logic to push the data to your analytics platform.\n     */\n    pushFunction: AnalyticsWidgetParamsPushFunction;\n    /**\n     * The number of milliseconds between the last search keystroke and calling `pushFunction`.\n     *\n     * @default 3000\n     */\n    delay?: number;\n    /**\n     * Triggers `pushFunction` after click on page or redirecting the page. This is useful if\n     * you want the pushFunction to be called for the last actions before the user leaves the\n     * current page, even if the delay wasn’t reached.\n     *\n     * @default false\n     */\n    triggerOnUIInteraction?: boolean;\n    /**\n     * Triggers `pushFunction` when InstantSearch is initialized. This means\n     * the `pushFunction` might be called even though the user didn’t perfom\n     * any search-related action.\n     *\n     * @default true\n     */\n    pushInitialSearch?: boolean;\n    /**\n     * Triggers `pushFunction` when the page changes, either through the UI or programmatically.\n     *\n     * @default false\n     */\n    pushPagination?: boolean;\n};\nexport type AnalyticsWidgetDescription = {\n    $$type: 'ais.analytics';\n    $$widgetType: 'ais.analytics';\n    renderState: Record<string, unknown>;\n    indexRenderState: {\n        analytics: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams>;\n    };\n};\nexport type AnalyticsWidget = WidgetFactory<AnalyticsWidgetDescription, AnalyticsWidgetParams, AnalyticsWidgetParams>;\ndeclare const analytics: AnalyticsWidget;\nexport default analytics;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/analytics/analytics.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { createDocumentationMessageGenerator, warning } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'analytics'\n});\n// @major this widget will be removed from the next major version.\nvar analytics = function analytics(widgetParams) {\n  var _ref = widgetParams || {},\n    pushFunction = _ref.pushFunction,\n    _ref$delay = _ref.delay,\n    delay = _ref$delay === void 0 ? 3000 : _ref$delay,\n    _ref$triggerOnUIInter = _ref.triggerOnUIInteraction,\n    triggerOnUIInteraction = _ref$triggerOnUIInter === void 0 ? false : _ref$triggerOnUIInter,\n    _ref$pushInitialSearc = _ref.pushInitialSearch,\n    pushInitialSearch = _ref$pushInitialSearc === void 0 ? true : _ref$pushInitialSearc,\n    _ref$pushPagination = _ref.pushPagination,\n    pushPagination = _ref$pushPagination === void 0 ? false : _ref$pushPagination;\n  if (!pushFunction) {\n    throw new Error(withUsage('The `pushFunction` option is required.'));\n  }\n  process.env.NODE_ENV === 'development' ? warning(false, \"`analytics` widget has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `insights` middleware.\\n\\nFor the migration, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/#analytics-widget\") : void 0;\n  var cachedState = null;\n  var serializeRefinements = function serializeRefinements(parameters) {\n    var refinements = [];\n\n    // eslint-disable-next-line no-restricted-syntax\n    for (var parameter in parameters) {\n      if (parameters.hasOwnProperty(parameter)) {\n        var values = parameters[parameter].join('+');\n        refinements.push(\"\".concat(encodeURIComponent(parameter), \"=\").concat(encodeURIComponent(parameter), \"_\").concat(encodeURIComponent(values)));\n      }\n    }\n    return refinements.join('&');\n  };\n  var serializeNumericRefinements = function serializeNumericRefinements(numericRefinements) {\n    var refinements = [];\n\n    // eslint-disable-next-line no-restricted-syntax\n    for (var attribute in numericRefinements) {\n      if (numericRefinements.hasOwnProperty(attribute)) {\n        var filter = numericRefinements[attribute];\n        if (filter.hasOwnProperty('>=') && filter.hasOwnProperty('<=')) {\n          if (filter['>='] && filter['>='][0] === filter['<='] && filter['<='][0]) {\n            refinements.push(\"\".concat(attribute, \"=\").concat(attribute, \"_\").concat(filter['>=']));\n          } else {\n            refinements.push(\"\".concat(attribute, \"=\").concat(attribute, \"_\").concat(filter['>='], \"to\").concat(filter['<=']));\n          }\n        } else if (filter.hasOwnProperty('>=')) {\n          refinements.push(\"\".concat(attribute, \"=\").concat(attribute, \"_from\").concat(filter['>=']));\n        } else if (filter.hasOwnProperty('<=')) {\n          refinements.push(\"\".concat(attribute, \"=\").concat(attribute, \"_to\").concat(filter['<=']));\n        } else if (filter.hasOwnProperty('=')) {\n          var equals = [];\n\n          // eslint-disable-next-line no-restricted-syntax\n          for (var equal in filter['=']) {\n            // eslint-disable-next-line max-depth\n            if (filter['='].hasOwnProperty(equal)) {\n              // @ts-ignore somehow 'equal' is a string, even though it's a number?\n              equals.push(filter['='][equal]);\n            }\n          }\n          refinements.push(\"\".concat(attribute, \"=\").concat(attribute, \"_\").concat(equals.join('-')));\n        }\n      }\n    }\n    return refinements.join('&');\n  };\n  var lastSentData = '';\n  var sendAnalytics = function sendAnalytics(analyticsState) {\n    if (analyticsState === null) {\n      return;\n    }\n    var serializedParams = [];\n    var serializedRefinements = serializeRefinements(_objectSpread(_objectSpread(_objectSpread({}, analyticsState.state.disjunctiveFacetsRefinements), analyticsState.state.facetsRefinements), analyticsState.state.hierarchicalFacetsRefinements));\n    var serializedNumericRefinements = serializeNumericRefinements(analyticsState.state.numericRefinements);\n    if (serializedRefinements !== '') {\n      serializedParams.push(serializedRefinements);\n    }\n    if (serializedNumericRefinements !== '') {\n      serializedParams.push(serializedNumericRefinements);\n    }\n    var stringifiedParams = serializedParams.join('&');\n    var dataToSend = \"Query: \".concat(analyticsState.state.query || '', \", \").concat(stringifiedParams);\n    if (pushPagination === true) {\n      dataToSend += \", Page: \".concat(analyticsState.state.page || 0);\n    }\n    if (lastSentData !== dataToSend) {\n      pushFunction(stringifiedParams, analyticsState.state, analyticsState.results);\n      lastSentData = dataToSend;\n    }\n  };\n  var pushTimeout;\n  var isInitialSearch = true;\n  if (pushInitialSearch === true) {\n    isInitialSearch = false;\n  }\n  var onClick = function onClick() {\n    sendAnalytics(cachedState);\n  };\n  var onUnload = function onUnload() {\n    sendAnalytics(cachedState);\n  };\n  return {\n    $$type: 'ais.analytics',\n    $$widgetType: 'ais.analytics',\n    init: function init() {\n      if (triggerOnUIInteraction === true) {\n        document.addEventListener('click', onClick);\n        window.addEventListener('beforeunload', onUnload);\n      }\n    },\n    render: function render(_ref2) {\n      var results = _ref2.results,\n        state = _ref2.state;\n      if (!results) {\n        return;\n      }\n      if (isInitialSearch === true) {\n        isInitialSearch = false;\n        return;\n      }\n      cachedState = {\n        results: results,\n        state: state\n      };\n      if (pushTimeout) {\n        clearTimeout(pushTimeout);\n      }\n      pushTimeout = window.setTimeout(function () {\n        return sendAnalytics(cachedState);\n      }, delay);\n    },\n    dispose: function dispose() {\n      if (triggerOnUIInteraction === true) {\n        document.removeEventListener('click', onClick);\n        window.removeEventListener('beforeunload', onUnload);\n      }\n    },\n    getRenderState: function getRenderState(renderState, renderOptions) {\n      return _objectSpread(_objectSpread({}, renderState), {}, {\n        analytics: this.getWidgetRenderState(renderOptions)\n      });\n    },\n    getWidgetRenderState: function getWidgetRenderState() {\n      return {\n        widgetParams: widgetParams\n      };\n    }\n  };\n};\nexport default analytics;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/answers/answers.d.ts",
    "content": "\nimport type { AnswersConnectorParams, AnswersWidgetDescription } from '../../connectors/answers/connectAnswers';\nimport type { WidgetFactory, Template, Hit } from '../../types';\nexport type AnswersTemplates = Partial<{\n    /**\n     * Template to use for the header. This template will receive an object containing `hits` and `isLoading`.\n     */\n    header: Template<{\n        hits: Hit[];\n        isLoading: boolean;\n    }>;\n    /**\n     * Template to use for the loader.\n     */\n    loader: Template;\n    /**\n     * Template to use for each result. This template will receive an object containing a single record.\n     */\n    item: Template<Hit>;\n}>;\nexport type AnswersCSSClasses = Partial<{\n    /**\n     * CSS class to add to the root element of the widget.\n     */\n    root: string | string[];\n    /**\n     * CSS class to add to the wrapping element when no results.\n     */\n    emptyRoot: string | string[];\n    /**\n     * CSS classes to add to the header.\n     */\n    header: string | string[];\n    /**\n     * CSS classes to add to the loader.\n     */\n    loader: string | string[];\n    /**\n     * CSS class to add to the list of results.\n     */\n    list: string | string[];\n    /**\n     * CSS class to add to each result.\n     */\n    item: string | string[];\n}>;\nexport type AnswersWidgetParams = {\n    /**\n     * CSS Selector or HTMLElement to insert the widget.\n     */\n    container: string | HTMLElement;\n    /**\n     * The templates to use for the widget.\n     */\n    templates?: AnswersTemplates;\n    /**\n     * The CSS classes to override.\n     */\n    cssClasses?: AnswersCSSClasses;\n};\nexport type AnswersWidget = WidgetFactory<AnswersWidgetDescription & {\n    $$widgetType: 'ais.answers';\n}, AnswersConnectorParams, AnswersWidgetParams>;\ndeclare const _default: AnswersWidget;\nexport default _default;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/answers/answers.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport Answers from \"../../components/Answers/Answers.js\";\nimport connectAnswers from \"../../connectors/answers/connectAnswers.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { prepareTemplateProps } from \"../../lib/templating/index.js\";\nimport { createDocumentationMessageGenerator, deprecate, getContainerNode } from \"../../lib/utils/index.js\";\nimport defaultTemplates from \"./defaultTemplates.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'answers'\n});\nvar suit = component('Answers');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    renderState = _ref.renderState,\n    templates = _ref.templates;\n  return function (_ref2, isFirstRendering) {\n    var hits = _ref2.hits,\n      isLoading = _ref2.isLoading,\n      instantSearchInstance = _ref2.instantSearchInstance;\n    if (isFirstRendering) {\n      renderState.templateProps = prepareTemplateProps({\n        defaultTemplates: defaultTemplates,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    render(h(Answers, {\n      cssClasses: cssClasses,\n      hits: hits,\n      isLoading: isLoading,\n      templateProps: renderState.templateProps\n    }), containerNode);\n  };\n};\n/**\n * @deprecated the answers service is no longer offered, and this widget will be removed in InstantSearch.js v5\n */\nvar answersWidget = function answersWidget(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    attributesForPrediction = _ref3.attributesForPrediction,\n    queryLanguages = _ref3.queryLanguages,\n    nbHits = _ref3.nbHits,\n    searchDebounceTime = _ref3.searchDebounceTime,\n    renderDebounceTime = _ref3.renderDebounceTime,\n    escapeHTML = _ref3.escapeHTML,\n    extraParameters = _ref3.extraParameters,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    emptyRoot: cx(suit({\n      modifierName: 'empty'\n    }), userCssClasses.emptyRoot),\n    header: cx(suit({\n      descendantName: 'header'\n    }), userCssClasses.header),\n    loader: cx(suit({\n      descendantName: 'loader'\n    }), userCssClasses.loader),\n    list: cx(suit({\n      descendantName: 'list'\n    }), userCssClasses.list),\n    item: cx(suit({\n      descendantName: 'item'\n    }), userCssClasses.item)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    templates: templates,\n    renderState: {}\n  });\n  var makeWidget = connectAnswers(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attributesForPrediction: attributesForPrediction,\n    queryLanguages: queryLanguages,\n    nbHits: nbHits,\n    searchDebounceTime: searchDebounceTime,\n    renderDebounceTime: renderDebounceTime,\n    escapeHTML: escapeHTML,\n    extraParameters: extraParameters\n  })), {}, {\n    $$widgetType: 'ais.answers'\n  });\n};\nexport default deprecate(answersWidget, 'The answers widget is deprecated and will be removed in InstantSearch.js 5.0');"
  },
  {
    "path": "js/instantsearch.js/es/widgets/answers/defaultTemplates.d.ts",
    "content": "import type { AnswersComponentTemplates } from '../../components/Answers/Answers';\ndeclare const defaultTemplates: AnswersComponentTemplates;\nexport default defaultTemplates;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/answers/defaultTemplates.js",
    "content": "var defaultTemplates = {\n  header: function header() {\n    return '';\n  },\n  loader: function loader() {\n    return '';\n  },\n  item: function item(_item) {\n    return JSON.stringify(_item);\n  }\n};\nexport default defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/breadcrumb/breadcrumb.d.ts",
    "content": "\nimport type { BreadcrumbWidgetDescription, BreadcrumbConnectorParams } from '../../connectors/breadcrumb/connectBreadcrumb';\nimport type { WidgetFactory, Template } from '../../types';\nexport type BreadcrumbCSSClasses = Partial<{\n    /**\n     * CSS class to add to the root element of the widget.\n     */\n    root: string | string[];\n    /**\n     * CSS class to add to the root element of the widget if there are no refinements.\n     */\n    noRefinementRoot: string | string[];\n    /**\n     * CSS class to add to the list element.\n     */\n    list: string | string[];\n    /**\n     * CSS class to add to the items of the list. The items contains the link and the separator.\n     */\n    item: string | string[];\n    /**\n     * CSS class to add to the selected item in the list: the last one or the home if there are no refinements.\n     */\n    selectedItem: string | string[];\n    /**\n     * CSS class to add to the separator.\n     */\n    separator: string | string[];\n    /**\n     * CSS class to add to the links in the items.\n     */\n    link: string | string[];\n}>;\nexport type BreadcrumbTemplates = Partial<{\n    /**\n     * Label of the breadcrumb's first element.\n     */\n    home: Template;\n    /**\n     * Symbol used to separate the elements of the breadcrumb.\n     */\n    separator: Template;\n}>;\nexport type BreadcrumbWidgetParams = {\n    /**\n     * CSS Selector or HTMLElement to insert the widget.\n     */\n    container: string | HTMLElement;\n    /**\n     * Templates to use for the widget.\n     */\n    templates?: BreadcrumbTemplates;\n    /**\n     * CSS classes to add to the wrapping elements.\n     */\n    cssClasses?: BreadcrumbCSSClasses;\n};\nexport type BreadcrumbWidget = WidgetFactory<BreadcrumbWidgetDescription & {\n    $$widgetType: 'ais.breadcrumb';\n}, BreadcrumbConnectorParams, BreadcrumbWidgetParams>;\ndeclare const breadcrumb: BreadcrumbWidget;\nexport default breadcrumb;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/breadcrumb/breadcrumb.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport Breadcrumb from \"../../components/Breadcrumb/Breadcrumb.js\";\nimport connectBreadcrumb from \"../../connectors/breadcrumb/connectBreadcrumb.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { prepareTemplateProps } from \"../../lib/templating/index.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nimport defaultTemplates from \"./defaultTemplates.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'breadcrumb'\n});\nvar suit = component('Breadcrumb');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    renderState = _ref.renderState,\n    templates = _ref.templates;\n  return function (_ref2, isFirstRendering) {\n    var canRefine = _ref2.canRefine,\n      createURL = _ref2.createURL,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      items = _ref2.items,\n      refine = _ref2.refine;\n    if (isFirstRendering) {\n      renderState.templateProps = prepareTemplateProps({\n        defaultTemplates: defaultTemplates,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    render(h(Breadcrumb, {\n      canRefine: canRefine,\n      cssClasses: cssClasses,\n      createURL: createURL,\n      items: items,\n      refine: refine,\n      templateProps: renderState.templateProps\n    }), containerNode);\n  };\n};\nvar breadcrumb = function breadcrumb(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    attributes = _ref3.attributes,\n    separator = _ref3.separator,\n    rootPath = _ref3.rootPath,\n    transformItems = _ref3.transformItems,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    noRefinementRoot: cx(suit({\n      modifierName: 'noRefinement'\n    }), userCssClasses.noRefinementRoot),\n    list: cx(suit({\n      descendantName: 'list'\n    }), userCssClasses.list),\n    item: cx(suit({\n      descendantName: 'item'\n    }), userCssClasses.item),\n    selectedItem: cx(suit({\n      descendantName: 'item',\n      modifierName: 'selected'\n    }), userCssClasses.selectedItem),\n    separator: cx(suit({\n      descendantName: 'separator'\n    }), userCssClasses.separator),\n    link: cx(suit({\n      descendantName: 'link'\n    }), userCssClasses.link)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = connectBreadcrumb(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attributes: attributes,\n    separator: separator,\n    rootPath: rootPath,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.breadcrumb'\n  });\n};\nexport default breadcrumb;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/breadcrumb/defaultTemplates.d.ts",
    "content": "import type { BreadcrumbComponentTemplates } from '../../components/Breadcrumb/Breadcrumb';\ndeclare const defaultTemplates: BreadcrumbComponentTemplates;\nexport default defaultTemplates;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/breadcrumb/defaultTemplates.js",
    "content": "var defaultTemplates = {\n  home: function home() {\n    return 'Home';\n  },\n  separator: function separator() {\n    return '>';\n  }\n};\nexport default defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/clear-refinements/clear-refinements.d.ts",
    "content": "\nimport type { ClearRefinementsConnectorParams, ClearRefinementsWidgetDescription } from '../../connectors/clear-refinements/connectClearRefinements';\nimport type { WidgetFactory, Template } from '../../types';\nexport type ClearRefinementsCSSClasses = Partial<{\n    /**\n     * CSS class to add to the wrapper element.\n     */\n    root: string | string[];\n    /**\n     * CSS class to add to the button of the widget.\n     */\n    button: string | string[];\n    /**\n     * CSS class to add to the button when there are no refinements.\n     */\n    disabledButton: string | string[];\n}>;\nexport type ClearRefinementsTemplates = Partial<{\n    /**\n     * Template for the content of the button\n     */\n    resetLabel: Template<{\n        hasRefinements: boolean;\n    }>;\n}>;\nexport type ClearRefinementsWidgetParams = {\n    /**\n     * CSS Selector or HTMLElement to insert the widget.\n     */\n    container: string | HTMLElement;\n    /**\n     * Templates to use for the widget.\n     */\n    templates?: ClearRefinementsTemplates;\n    /**\n     * CSS classes to be added.\n     */\n    cssClasses?: ClearRefinementsCSSClasses;\n};\nexport type ClearRefinementsWidget = WidgetFactory<ClearRefinementsWidgetDescription & {\n    $$widgetType: 'ais.clearRefinements';\n}, ClearRefinementsConnectorParams, ClearRefinementsWidgetParams>;\ndeclare const clearRefinements: ClearRefinementsWidget;\nexport default clearRefinements;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/clear-refinements/clear-refinements.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport ClearRefinements from \"../../components/ClearRefinements/ClearRefinements.js\";\nimport connectClearRefinements from \"../../connectors/clear-refinements/connectClearRefinements.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { prepareTemplateProps } from \"../../lib/templating/index.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nimport defaultTemplates from \"./defaultTemplates.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'clear-refinements'\n});\nvar suit = component('ClearRefinements');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    renderState = _ref.renderState,\n    templates = _ref.templates;\n  return function (_ref2, isFirstRendering) {\n    var refine = _ref2.refine,\n      canRefine = _ref2.canRefine,\n      instantSearchInstance = _ref2.instantSearchInstance;\n    if (isFirstRendering) {\n      renderState.templateProps = prepareTemplateProps({\n        defaultTemplates: defaultTemplates,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    render(h(ClearRefinements, {\n      refine: refine,\n      cssClasses: cssClasses,\n      hasRefinements: canRefine,\n      templateProps: renderState.templateProps\n    }), containerNode);\n  };\n};\nvar clearRefinements = function clearRefinements(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    includedAttributes = _ref3.includedAttributes,\n    excludedAttributes = _ref3.excludedAttributes,\n    transformItems = _ref3.transformItems,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    button: cx(suit({\n      descendantName: 'button'\n    }), userCssClasses.button),\n    disabledButton: cx(suit({\n      descendantName: 'button',\n      modifierName: 'disabled'\n    }), userCssClasses.disabledButton)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = connectClearRefinements(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    includedAttributes: includedAttributes,\n    excludedAttributes: excludedAttributes,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.clearRefinements'\n  });\n};\nexport default clearRefinements;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/clear-refinements/defaultTemplates.d.ts",
    "content": "import type { ClearRefinementsComponentTemplates } from '../../components/ClearRefinements/ClearRefinements';\ndeclare const defaultTemplates: ClearRefinementsComponentTemplates;\nexport default defaultTemplates;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/clear-refinements/defaultTemplates.js",
    "content": "var defaultTemplates = {\n  resetLabel: function resetLabel() {\n    return 'Clear refinements';\n  }\n};\nexport default defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/configure/configure.d.ts",
    "content": "import type { ConfigureConnectorParams, ConfigureWidgetDescription } from '../../connectors/configure/connectConfigure';\nimport type { Widget } from '../../types';\n/**\n * A list of [search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/)\n * to enable when the widget mounts.\n */\nexport type ConfigureWidgetParams = ConfigureConnectorParams['searchParameters'];\nexport type ConfigureWidget = (widgetParams: ConfigureWidgetParams) => Widget<ConfigureWidgetDescription & {\n    $$widgetType: 'ais.configure';\n    widgetParams: ConfigureConnectorParams;\n}>;\ndeclare const configure: ConfigureWidget;\nexport default configure;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/configure/configure.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport connectConfigure from \"../../connectors/configure/connectConfigure.js\";\nimport { noop } from \"../../lib/utils/index.js\";\n\n/**\n * A list of [search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/)\n * to enable when the widget mounts.\n */\n\nvar configure = function configure(widgetParams) {\n  // This is a renderless widget that falls back to the connector's\n  // noop render and unmount functions.\n  var makeWidget = connectConfigure(noop);\n  return _objectSpread(_objectSpread({}, makeWidget({\n    searchParameters: widgetParams\n  })), {}, {\n    $$widgetType: 'ais.configure'\n  });\n};\nexport default configure;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/configure-related-items/configure-related-items.d.ts",
    "content": "import type { ConfigureRelatedItemsConnectorParams, ConfigureRelatedItemsWidgetDescription } from '../../connectors/configure-related-items/connectConfigureRelatedItems';\nimport type { WidgetFactory } from '../../types';\nimport type { PlainSearchParameters } from 'algoliasearch-helper';\nexport type ConfigureRelatedItemsWidget = WidgetFactory<ConfigureRelatedItemsWidgetDescription & {\n    $$widgetType: 'ais.configureRelatedItems';\n}, ConfigureRelatedItemsConnectorParams, ConfigureRelatedItemsWidgetParams>;\nexport type ConfigureRelatedItemsWidgetParams = PlainSearchParameters;\ndeclare const configureRelatedItems: ConfigureRelatedItemsWidget;\n/** @deprecated use relatedItems instead */\nexport default configureRelatedItems;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/configure-related-items/configure-related-items.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport connectConfigureRelatedItems from \"../../connectors/configure-related-items/connectConfigureRelatedItems.js\";\nimport { noop } from \"../../lib/utils/index.js\";\nvar configureRelatedItems = function configureRelatedItems(widgetParams) {\n  var makeWidget = connectConfigureRelatedItems(noop);\n  return _objectSpread(_objectSpread({}, makeWidget(widgetParams)), {}, {\n    $$widgetType: 'ais.configureRelatedItems'\n  });\n};\n\n/** @deprecated use relatedItems instead */\nexport default configureRelatedItems;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/current-refinements/current-refinements.d.ts",
    "content": "\nimport type { CurrentRefinementsConnectorParams, CurrentRefinementsWidgetDescription } from '../../connectors/current-refinements/connectCurrentRefinements';\nimport type { WidgetFactory } from '../../types';\nexport type CurrentRefinementsCSSClasses = Partial<{\n    /**\n     * CSS class to add to the root element.\n     */\n    root: string | string[];\n    /**\n     * CSS class to add to the root element when no refinements.\n     */\n    noRefinementRoot: string | string[];\n    /**\n     * CSS class to add to the list element.\n     */\n    list: string | string[];\n    /**\n     * CSS class to add to the each item element.\n     */\n    item: string | string[];\n    /**\n     * CSS class to add to the label element.\n     */\n    label: string | string[];\n    /**\n     * CSS class to add to the category element.\n     */\n    category: string | string[];\n    /**\n     * CSS class to add to the categoryLabel element.\n     */\n    categoryLabel: string | string[];\n    /**\n     * CSS class to add to the delete element.\n     */\n    delete: string | string[];\n}>;\nexport type CurrentRefinementsWidgetParams = {\n    /**\n     * The CSS Selector or `HTMLElement` to insert the widget into.\n     */\n    container: string | HTMLElement;\n    /**\n     * The CSS classes to override.\n     */\n    cssClasses?: CurrentRefinementsCSSClasses;\n};\nexport type CurrentRefinementsWidget = WidgetFactory<CurrentRefinementsWidgetDescription & {\n    $$widgetType: 'ais.currentRefinements';\n}, CurrentRefinementsConnectorParams, CurrentRefinementsWidgetParams>;\ndeclare const currentRefinements: CurrentRefinementsWidget;\nexport default currentRefinements;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/current-refinements/current-refinements.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport CurrentRefinements from \"../../components/CurrentRefinements/CurrentRefinements.js\";\nimport connectCurrentRefinements from \"../../connectors/current-refinements/connectCurrentRefinements.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'current-refinements'\n});\nvar suit = component('CurrentRefinements');\nvar renderer = function renderer(_ref, isFirstRender) {\n  var items = _ref.items,\n    widgetParams = _ref.widgetParams,\n    canRefine = _ref.canRefine;\n  if (isFirstRender) {\n    return;\n  }\n  var _ref2 = widgetParams,\n    container = _ref2.container,\n    cssClasses = _ref2.cssClasses;\n  render(h(CurrentRefinements, {\n    cssClasses: cssClasses,\n    items: items,\n    canRefine: canRefine\n  }), container);\n};\nvar currentRefinements = function currentRefinements(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    includedAttributes = _ref3.includedAttributes,\n    excludedAttributes = _ref3.excludedAttributes,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    transformItems = _ref3.transformItems;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    noRefinementRoot: cx(suit({\n      modifierName: 'noRefinement'\n    }), userCssClasses.noRefinementRoot),\n    list: cx(suit({\n      descendantName: 'list'\n    }), userCssClasses.list),\n    item: cx(suit({\n      descendantName: 'item'\n    }), userCssClasses.item),\n    label: cx(suit({\n      descendantName: 'label'\n    }), userCssClasses.label),\n    category: cx(suit({\n      descendantName: 'category'\n    }), userCssClasses.category),\n    categoryLabel: cx(suit({\n      descendantName: 'categoryLabel'\n    }), userCssClasses.categoryLabel),\n    delete: cx(suit({\n      descendantName: 'delete'\n    }), userCssClasses.delete)\n  };\n  var makeWidget = connectCurrentRefinements(renderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    container: containerNode,\n    cssClasses: cssClasses,\n    includedAttributes: includedAttributes,\n    excludedAttributes: excludedAttributes,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.currentRefinements'\n  });\n};\nexport default currentRefinements;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/dynamic-widgets/dynamic-widgets.d.ts",
    "content": "import type { DynamicWidgetsConnectorParams, DynamicWidgetsWidgetDescription } from '../../connectors/dynamic-widgets/connectDynamicWidgets';\nimport type { Widget, WidgetFactory } from '../../types';\nexport type DynamicWidgetsWidgetParams = {\n    /**\n     * CSS Selector or HTMLElement to insert the widget.\n     */\n    container: string | HTMLElement;\n    /**\n     * An array of widget creator functions, displayed in the order defined by\n     * `facetOrdering`.\n     */\n    widgets: Array<(container: HTMLElement) => Widget>;\n    /**\n     * Function to return a fallback widget when an attribute isn't found in\n     * `widgets`.\n     */\n    fallbackWidget?: (args: {\n        /** The attribute name to create a widget for. */\n        attribute: string;\n        /** CSS Selector or HTMLElement to insert the widget */\n        container: HTMLElement;\n    }) => Widget;\n};\nexport type DynamicWidgetsWidget = WidgetFactory<DynamicWidgetsWidgetDescription & {\n    $$widgetType: 'ais.dynamicWidgets';\n}, Omit<DynamicWidgetsConnectorParams, 'widgets' | 'fallbackWidget'>, DynamicWidgetsWidgetParams>;\ndeclare const dynamicWidgets: DynamicWidgetsWidget;\nexport default dynamicWidgets;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/dynamic-widgets/dynamic-widgets.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _excluded = [\"container\", \"widgets\", \"fallbackWidget\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport connectDynamicWidgets from \"../../connectors/dynamic-widgets/connectDynamicWidgets.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { createDocumentationMessageGenerator, getContainerNode, getWidgetAttribute } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'dynamic-widgets'\n});\nvar suit = component('DynamicWidgets');\nfunction createContainer(rootContainer) {\n  var container = document.createElement('div');\n  container.className = suit({\n    descendantName: 'widget'\n  });\n  rootContainer.appendChild(container);\n  return container;\n}\nvar dynamicWidgets = function dynamicWidgets(widgetParams) {\n  var _ref = widgetParams || {},\n    containerSelector = _ref.container,\n    widgets = _ref.widgets,\n    fallbackWidget = _ref.fallbackWidget,\n    otherWidgetParams = _objectWithoutProperties(_ref, _excluded);\n  if (!containerSelector) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  if (!(widgets && Array.isArray(widgets) && widgets.every(function (widget) {\n    return typeof widget === 'function';\n  }))) {\n    throw new Error(withUsage('The `widgets` option expects an array of callbacks.'));\n  }\n  var userContainer = getContainerNode(containerSelector);\n  var rootContainer = document.createElement('div');\n  rootContainer.className = suit();\n  var containers = new Map();\n  var connectorWidgets = [];\n  var makeWidget = connectDynamicWidgets(function (_ref2, isFirstRender) {\n    var attributesToRender = _ref2.attributesToRender;\n    if (isFirstRender) {\n      userContainer.appendChild(rootContainer);\n    }\n    attributesToRender.forEach(function (attribute) {\n      if (!containers.has(attribute)) {\n        return;\n      }\n      var container = containers.get(attribute);\n      rootContainer.appendChild(container);\n    });\n  }, function () {\n    userContainer.removeChild(rootContainer);\n  });\n  var widget = makeWidget(_objectSpread(_objectSpread({}, otherWidgetParams), {}, {\n    widgets: connectorWidgets,\n    fallbackWidget: typeof fallbackWidget === 'function' ? function (_ref3) {\n      var attribute = _ref3.attribute;\n      var container = createContainer(rootContainer);\n      containers.set(attribute, container);\n      return fallbackWidget({\n        attribute: attribute,\n        container: container\n      });\n    } : undefined\n  }));\n  return _objectSpread(_objectSpread({}, widget), {}, {\n    init: function init(initOptions) {\n      widgets.forEach(function (cb) {\n        var container = createContainer(rootContainer);\n        var childWidget = cb(container);\n        var attribute = getWidgetAttribute(childWidget, initOptions);\n        containers.set(attribute, container);\n        connectorWidgets.push(childWidget);\n      });\n      widget.init(initOptions);\n    },\n    $$widgetType: 'ais.dynamicWidgets'\n  });\n};\nexport default dynamicWidgets;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/frequently-bought-together/frequently-bought-together.d.ts",
    "content": "\nimport type { FrequentlyBoughtTogetherWidgetDescription, FrequentlyBoughtTogetherConnectorParams } from '../../connectors/frequently-bought-together/connectFrequentlyBoughtTogether';\nimport type { Template, WidgetFactory, BaseHit, RecommendResponse, Hit, TemplateWithBindEvent } from '../../types';\nimport type { RecommendClassNames, FrequentlyBoughtTogetherProps as FrequentlyBoughtTogetherUiProps } from 'instantsearch-ui-components';\nexport type FrequentlyBoughtTogetherCSSClasses = Partial<RecommendClassNames>;\nexport type FrequentlyBoughtTogetherTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\n    /**\n     * Template to use when there are no results.\n     */\n    empty: Template<RecommendResponse<Hit<THit>>>;\n    /**\n     * Template to use for the header of the widget.\n     */\n    header: Template<Pick<Parameters<NonNullable<FrequentlyBoughtTogetherUiProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {\n        cssClasses: RecommendClassNames;\n    }>;\n    /**\n     * Template to use for each result. This template will receive an object containing a single record.\n     */\n    item: TemplateWithBindEvent<Hit<THit>>;\n    /**\n     * Template to use to wrap all items.\n     */\n    layout: Template<Pick<Parameters<NonNullable<FrequentlyBoughtTogetherUiProps<Hit<THit>>['layout']>>[0], 'items'> & {\n        templates: {\n            item: FrequentlyBoughtTogetherUiProps<Hit<THit>>['itemComponent'];\n        };\n        cssClasses: Pick<FrequentlyBoughtTogetherCSSClasses, 'list' | 'item'>;\n    }>;\n}>;\ntype FrequentlyBoughtTogetherWidgetParams<THit extends NonNullable<object> = BaseHit> = {\n    /**\n     * CSS Selector or HTMLElement to insert the widget.\n     */\n    container: string | HTMLElement;\n    /**\n     * Templates to use for the widget.\n     */\n    templates?: FrequentlyBoughtTogetherTemplates<THit>;\n    /**\n     * CSS classes to add.\n     */\n    cssClasses?: FrequentlyBoughtTogetherCSSClasses;\n};\nexport type FrequentlyBoughtTogetherWidget = WidgetFactory<FrequentlyBoughtTogetherWidgetDescription & {\n    $$widgetType: 'ais.frequentlyBoughtTogether';\n}, FrequentlyBoughtTogetherConnectorParams, FrequentlyBoughtTogetherWidgetParams>;\ndeclare const _default: <THit extends NonNullable<object> = BaseHit>(widgetParams: FrequentlyBoughtTogetherWidgetParams<THit> & FrequentlyBoughtTogetherConnectorParams<THit>) => {\n    $$widgetType: \"ais.frequentlyBoughtTogether\";\n    dependsOn: \"recommend\";\n    $$type: \"ais.frequentlyBoughtTogether\";\n    init(initOptions: import(\"../../types\").InitOptions): void;\n    render(renderOptions: import(\"../../types\").RenderOptions): void;\n    getRenderState(renderState: {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/answers/connectAnswers\").AnswersRenderState, import(\"../../connectors/answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/configure/connectConfigure\").ConfigureRenderState, import(\"../../connectors/configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits/connectHits\").HitsRenderState<BaseHit>, import(\"../../connectors/hits/connectHits\").HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/menu/connectMenu\").MenuRenderState, import(\"../../connectors/menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/pagination/connectPagination\").PaginationRenderState, import(\"../../connectors/pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/range/connectRange\").RangeRenderState, import(\"../../connectors/range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/search-box/connectSearchBox\").SearchBoxRenderState, import(\"../../connectors/search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/sort-by/connectSortBy\").SortByRenderState, import(\"../../connectors/sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/stats/connectStats\").StatsRenderState, import(\"../../connectors/stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../places/places\").PlacesWidgetParams> | undefined;\n    }): {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/answers/connectAnswers\").AnswersRenderState, import(\"../../connectors/answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/configure/connectConfigure\").ConfigureRenderState, import(\"../../connectors/configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits/connectHits\").HitsRenderState<BaseHit>, import(\"../../connectors/hits/connectHits\").HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/menu/connectMenu\").MenuRenderState, import(\"../../connectors/menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/pagination/connectPagination\").PaginationRenderState, import(\"../../connectors/pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/range/connectRange\").RangeRenderState, import(\"../../connectors/range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/search-box/connectSearchBox\").SearchBoxRenderState, import(\"../../connectors/search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/sort-by/connectSortBy\").SortByRenderState, import(\"../../connectors/sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/stats/connectStats\").StatsRenderState, import(\"../../connectors/stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../places/places\").PlacesWidgetParams> | undefined;\n    };\n    getWidgetRenderState({ results, helper, instantSearchInstance }: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions | ({\n        instantSearchInstance: import(\"../../types\").InstantSearch;\n        parent: import(\"../index\").IndexWidget;\n        templatesConfig: Record<string, unknown>;\n        scopedResults: import(\"../../types\").ScopedResult[];\n        state: import(\"algoliasearch-helper\").SearchParameters;\n        renderState: Partial<{\n            answers: import(\"../../types\").WidgetRenderState<import(\"../../connectors/answers/connectAnswers\").AnswersRenderState, import(\"../../connectors/answers/connectAnswers\").AnswersConnectorParams>;\n        } & {\n            autocomplete: import(\"../../types\").WidgetRenderState<import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteConnectorParams>;\n        } & {\n            breadcrumb: {\n                [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n            };\n        } & {\n            clearRefinements: import(\"../../types\").WidgetRenderState<import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams>;\n        } & {\n            configure: import(\"../../types\").WidgetRenderState<import(\"../../connectors/configure/connectConfigure\").ConfigureRenderState, import(\"../../connectors/configure/connectConfigure\").ConfigureConnectorParams>;\n        } & {\n            currentRefinements: import(\"../../types\").WidgetRenderState<import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams>;\n        } & {\n            geoSearch: import(\"../../types\").WidgetRenderState<import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>>;\n        } & {\n            hierarchicalMenu: {\n                [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n            };\n        } & {\n            hits: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits/connectHits\").HitsRenderState<BaseHit>, import(\"../../connectors/hits/connectHits\").HitsConnectorParams<BaseHit>>;\n        } & {\n            hitsPerPage: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams>;\n        } & {\n            infiniteHits: import(\"../../types\").WidgetRenderState<import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>>;\n        } & {\n            menu: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/menu/connectMenu\").MenuRenderState, import(\"../../connectors/menu/connectMenu\").MenuConnectorParams>;\n            };\n        } & {\n            numericMenu: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n            };\n        } & {\n            pagination: import(\"../../types\").WidgetRenderState<import(\"../../connectors/pagination/connectPagination\").PaginationRenderState, import(\"../../connectors/pagination/connectPagination\").PaginationConnectorParams>;\n        } & {\n            poweredBy: import(\"../../types\").WidgetRenderState<import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByConnectorParams>;\n        } & {\n            queryRules: import(\"../../types\").WidgetRenderState<import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesConnectorParams>;\n        } & {\n            range: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/range/connectRange\").RangeRenderState, import(\"../../connectors/range/connectRange\").RangeConnectorParams>;\n            };\n        } & {\n            ratingMenu: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n            };\n        } & {\n            refinementList: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n            };\n        } & {\n            relevantSort: import(\"../../types\").WidgetRenderState<import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortConnectorParams>;\n        } & {\n            searchBox: import(\"../../types\").WidgetRenderState<import(\"../../connectors/search-box/connectSearchBox\").SearchBoxRenderState, import(\"../../connectors/search-box/connectSearchBox\").SearchBoxConnectorParams>;\n        } & {\n            sortBy: import(\"../../types\").WidgetRenderState<import(\"../../connectors/sort-by/connectSortBy\").SortByRenderState, import(\"../../connectors/sort-by/connectSortBy\").SortByConnectorParams>;\n        } & {\n            stats: import(\"../../types\").WidgetRenderState<import(\"../../connectors/stats/connectStats\").StatsRenderState, import(\"../../connectors/stats/connectStats\").StatsConnectorParams>;\n        } & {\n            toggleRefinement: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n            };\n        } & {\n            voiceSearch: import(\"../../types\").WidgetRenderState<import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchConnectorParams>;\n        } & {\n            analytics: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../analytics/analytics\").AnalyticsWidgetParams>;\n        } & {\n            places: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../places/places\").PlacesWidgetParams>;\n        }>;\n        helper: import(\"algoliasearch-helper\").AlgoliaSearchHelper;\n        searchMetadata: {\n            isSearchStalled: boolean;\n        };\n        status: import(\"../../types\").InstantSearch[\"status\"];\n        error: import(\"../../types\").InstantSearch[\"error\"];\n        createURL: (nextState: import(\"algoliasearch-helper\").SearchParameters | ((state: import(\"../../types\").IndexUiState) => import(\"../../types\").IndexUiState)) => string;\n    } & {\n        results: RecommendResponse<any>;\n    })): {\n        items: Hit<THit>[];\n        widgetParams: Partial<FrequentlyBoughtTogetherWidgetParams<BaseHit>> & FrequentlyBoughtTogetherConnectorParams<THit>;\n        sendEvent: import(\"../../lib/utils\").SendEventForHits;\n    };\n    dispose({ recommendState }: import(\"../../types\").DisposeOptions): import(\"algoliasearch-helper\").RecommendParameters;\n    getWidgetParameters(state: import(\"algoliasearch-helper\").RecommendParameters): import(\"algoliasearch-helper\").RecommendParameters;\n};\nexport default _default;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/frequently-bought-together/frequently-bought-together.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _excluded = [\"item\", \"sendEvent\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport { createFrequentlyBoughtTogetherComponent } from 'instantsearch-ui-components';\nimport { Fragment, h, render } from 'preact';\nimport TemplateComponent from \"../../components/Template/Template.js\";\nimport connectFrequentlyBoughtTogether from \"../../connectors/frequently-bought-together/connectFrequentlyBoughtTogether.js\";\nimport { prepareTemplateProps } from \"../../lib/templating/index.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'frequently-bought-together'\n});\nvar FrequentlyBoughtTogether = createFrequentlyBoughtTogetherComponent({\n  createElement: h,\n  Fragment: Fragment\n});\nvar renderer = function renderer(_ref) {\n  var renderState = _ref.renderState,\n    cssClasses = _ref.cssClasses,\n    containerNode = _ref.containerNode,\n    templates = _ref.templates;\n  return function (_ref2, isFirstRendering) {\n    var items = _ref2.items,\n      results = _ref2.results,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      sendEvent = _ref2.sendEvent;\n    if (isFirstRendering) {\n      renderState.templateProps = prepareTemplateProps({\n        defaultTemplates: {},\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    var headerComponent = templates.header ? function (data) {\n      return h(TemplateComponent, _extends({}, renderState.templateProps, {\n        templateKey: \"header\",\n        rootTagName: \"fragment\",\n        data: {\n          cssClasses: data.classNames,\n          items: data.items\n        }\n      }));\n    } : undefined;\n    var itemComponent = templates.item ? function (_ref3) {\n      var item = _ref3.item,\n        _sendEvent = _ref3.sendEvent,\n        rootProps = _objectWithoutProperties(_ref3, _excluded);\n      return h(TemplateComponent, _extends({}, renderState.templateProps, {\n        templateKey: \"item\",\n        rootTagName: \"fragment\",\n        data: item,\n        sendEvent: _sendEvent,\n        rootProps: _objectSpread({}, rootProps)\n      }));\n    } : undefined;\n    var emptyComponent = templates.empty ? function () {\n      return h(TemplateComponent, _extends({}, renderState.templateProps, {\n        templateKey: \"empty\",\n        rootTagName: \"fragment\",\n        data: results\n      }));\n    } : undefined;\n    var layoutComponent = templates.layout ? function (data) {\n      return h(TemplateComponent, _extends({}, renderState.templateProps, {\n        templateKey: \"layout\",\n        rootTagName: \"fragment\",\n        data: {\n          sendEvent: sendEvent,\n          items: data.items,\n          templates: {\n            item: templates.item ? function (_ref4) {\n              var item = _ref4.item;\n              return h(TemplateComponent, _extends({}, renderState.templateProps, {\n                templateKey: \"item\",\n                rootTagName: \"fragment\",\n                data: item,\n                sendEvent: sendEvent\n              }));\n            } : undefined\n          },\n          cssClasses: {\n            list: data.classNames.list,\n            item: data.classNames.item\n          }\n        },\n        sendEvent: sendEvent\n      }));\n    } : undefined;\n    render(h(FrequentlyBoughtTogether, {\n      items: items,\n      headerComponent: headerComponent,\n      itemComponent: itemComponent,\n      sendEvent: sendEvent,\n      classNames: cssClasses,\n      emptyComponent: emptyComponent,\n      layout: layoutComponent,\n      status: instantSearchInstance.status\n    }), containerNode);\n  };\n};\nexport default (function frequentlyBoughtTogether(widgetParams) {\n  var _ref5 = widgetParams || {},\n    container = _ref5.container,\n    objectIDs = _ref5.objectIDs,\n    limit = _ref5.limit,\n    queryParameters = _ref5.queryParameters,\n    threshold = _ref5.threshold,\n    escapeHTML = _ref5.escapeHTML,\n    transformItems = _ref5.transformItems,\n    _ref5$templates = _ref5.templates,\n    templates = _ref5$templates === void 0 ? {} : _ref5$templates,\n    _ref5$cssClasses = _ref5.cssClasses,\n    cssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = connectFrequentlyBoughtTogether(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    objectIDs: objectIDs,\n    limit: limit,\n    queryParameters: queryParameters,\n    threshold: threshold,\n    escapeHTML: escapeHTML,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.frequentlyBoughtTogether'\n  });\n});"
  },
  {
    "path": "js/instantsearch.js/es/widgets/geo-search/GeoSearchRenderer.d.js",
    "content": "export {};"
  },
  {
    "path": "js/instantsearch.js/es/widgets/geo-search/GeoSearchRenderer.d.ts",
    "content": "export default renderer;\ndeclare function renderer({ items, position, currentRefinement, refine, clearMapRefinement, toggleRefineOnMapMove, isRefineOnMapMove, setMapMoveSinceLastRefine, hasMapMoveSinceLastRefine, isRefinedWithMap, widgetParams, instantSearchInstance, }: {\n    items: any;\n    position: any;\n    currentRefinement: any;\n    refine: any;\n    clearMapRefinement: any;\n    toggleRefineOnMapMove: any;\n    isRefineOnMapMove: any;\n    setMapMoveSinceLastRefine: any;\n    hasMapMoveSinceLastRefine: any;\n    isRefinedWithMap: any;\n    widgetParams: any;\n    instantSearchInstance: any;\n}, isFirstRendering: any): void;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/geo-search/GeoSearchRenderer.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nimport { h, render } from 'preact';\nimport GeoSearchControls from \"../../components/GeoSearchControls/GeoSearchControls.js\";\nimport { prepareTemplateProps } from \"../../lib/templating/index.js\";\nvar refineWithMap = function refineWithMap(_ref) {\n  var refine = _ref.refine,\n    mapInstance = _ref.mapInstance;\n  return refine({\n    northEast: mapInstance.getBounds().getNorthEast().toJSON(),\n    southWest: mapInstance.getBounds().getSouthWest().toJSON()\n  });\n};\nvar collectMarkersForNextRender = function collectMarkersForNextRender(markers, nextIds) {\n  return markers.reduce(function (_ref2, marker) {\n    var _ref3 = _slicedToArray(_ref2, 2),\n      update = _ref3[0],\n      exit = _ref3[1];\n    var persist = nextIds.includes(marker.__id);\n    return persist ? [update.concat(marker), exit] : [update, exit.concat(marker)];\n  }, [[], []]);\n};\nvar createBoundingBoxFromMarkers = function createBoundingBoxFromMarkers(google, markers) {\n  var latLngBounds = markers.reduce(function (acc, marker) {\n    return acc.extend(marker.getPosition());\n  }, new google.maps.LatLngBounds());\n  return {\n    northEast: latLngBounds.getNorthEast().toJSON(),\n    southWest: latLngBounds.getSouthWest().toJSON()\n  };\n};\nvar lockUserInteraction = function lockUserInteraction(renderState, functionThatAltersTheMapPosition) {\n  renderState.isUserInteraction = false;\n  functionThatAltersTheMapPosition();\n  renderState.isUserInteraction = true;\n};\nvar renderer = function renderer(_ref4, isFirstRendering) {\n  var items = _ref4.items,\n    position = _ref4.position,\n    currentRefinement = _ref4.currentRefinement,\n    refine = _ref4.refine,\n    clearMapRefinement = _ref4.clearMapRefinement,\n    toggleRefineOnMapMove = _ref4.toggleRefineOnMapMove,\n    isRefineOnMapMove = _ref4.isRefineOnMapMove,\n    setMapMoveSinceLastRefine = _ref4.setMapMoveSinceLastRefine,\n    hasMapMoveSinceLastRefine = _ref4.hasMapMoveSinceLastRefine,\n    isRefinedWithMap = _ref4.isRefinedWithMap,\n    widgetParams = _ref4.widgetParams,\n    instantSearchInstance = _ref4.instantSearchInstance;\n  var container = widgetParams.container,\n    googleReference = widgetParams.googleReference,\n    cssClasses = widgetParams.cssClasses,\n    templates = widgetParams.templates,\n    initialZoom = widgetParams.initialZoom,\n    initialPosition = widgetParams.initialPosition,\n    enableRefine = widgetParams.enableRefine,\n    enableClearMapRefinement = widgetParams.enableClearMapRefinement,\n    enableRefineControl = widgetParams.enableRefineControl,\n    mapOptions = widgetParams.mapOptions,\n    createMarker = widgetParams.createMarker,\n    markerOptions = widgetParams.markerOptions,\n    renderState = widgetParams.renderState;\n  if (isFirstRendering) {\n    renderState.isUserInteraction = true;\n    renderState.isPendingRefine = false;\n    renderState.markers = [];\n    var rootElement = document.createElement('div');\n    rootElement.className = cssClasses.root;\n    container.appendChild(rootElement);\n    var mapElement = document.createElement('div');\n    mapElement.className = cssClasses.map;\n    rootElement.appendChild(mapElement);\n    var treeElement = document.createElement('div');\n    treeElement.className = cssClasses.tree;\n    rootElement.appendChild(treeElement);\n    renderState.mapInstance = new googleReference.maps.Map(mapElement, _objectSpread({\n      mapTypeControl: false,\n      fullscreenControl: false,\n      streetViewControl: false,\n      clickableIcons: false,\n      zoomControlOptions: {\n        position: googleReference.maps.ControlPosition.LEFT_TOP\n      }\n    }, mapOptions));\n    var setupListenersWhenMapIsReady = function setupListenersWhenMapIsReady() {\n      var onChange = function onChange() {\n        if (renderState.isUserInteraction && enableRefine) {\n          setMapMoveSinceLastRefine();\n          if (isRefineOnMapMove()) {\n            renderState.isPendingRefine = true;\n          }\n        }\n      };\n      renderState.mapInstance.addListener('center_changed', onChange);\n      renderState.mapInstance.addListener('zoom_changed', onChange);\n      renderState.mapInstance.addListener('dragstart', onChange);\n      renderState.mapInstance.addListener('idle', function () {\n        if (renderState.isUserInteraction && renderState.isPendingRefine) {\n          renderState.isPendingRefine = false;\n          refineWithMap({\n            mapInstance: renderState.mapInstance,\n            refine: refine\n          });\n        }\n      });\n    };\n    googleReference.maps.event.addListenerOnce(renderState.mapInstance, 'idle', setupListenersWhenMapIsReady);\n    renderState.templateProps = prepareTemplateProps({\n      templatesConfig: instantSearchInstance.templatesConfig,\n      templates: templates\n    });\n    return;\n  }\n\n  // Collect markers that need to be updated or removed\n  var nextItemsIds = items.map(function (_) {\n    return _.objectID;\n  });\n  var _collectMarkersForNex = collectMarkersForNextRender(renderState.markers, nextItemsIds),\n    _collectMarkersForNex2 = _slicedToArray(_collectMarkersForNex, 2),\n    updateMarkers = _collectMarkersForNex2[0],\n    exitMarkers = _collectMarkersForNex2[1];\n\n  // Collect items that will be added\n  var updateMarkerIds = updateMarkers.map(function (_) {\n    return _.__id;\n  });\n  var nextPendingItems = items.filter(function (item) {\n    return !updateMarkerIds.includes(item.objectID);\n  });\n\n  // Remove all markers that need to be removed\n  exitMarkers.forEach(function (marker) {\n    return marker.setMap(null);\n  });\n\n  // Create the markers from the items\n  renderState.markers = updateMarkers.concat(nextPendingItems.map(function (item) {\n    var marker = createMarker({\n      map: renderState.mapInstance,\n      item: item\n    });\n    Object.keys(markerOptions.events).forEach(function (eventName) {\n      marker.addListener(eventName, function (event) {\n        markerOptions.events[eventName]({\n          map: renderState.mapInstance,\n          event: event,\n          item: item,\n          marker: marker\n        });\n      });\n    });\n    return marker;\n  }));\n  var shouldUpdate = !hasMapMoveSinceLastRefine();\n\n  // We use this value for differentiate the padding to apply during\n  // fitBounds. When we don't have a currenRefinement (boundingBox)\n  // we let Google Maps compute the automatic padding. But when we\n  // provide the currentRefinement we explicitly set the padding\n  // to `0` otherwise the map will decrease the zoom on each refine.\n  var boundingBoxPadding = currentRefinement ? 0 : null;\n  var boundingBox = !currentRefinement && Boolean(renderState.markers.length) ? createBoundingBoxFromMarkers(googleReference, renderState.markers) : currentRefinement;\n  if (boundingBox && shouldUpdate) {\n    lockUserInteraction(renderState, function () {\n      renderState.mapInstance.fitBounds(new googleReference.maps.LatLngBounds(boundingBox.southWest, boundingBox.northEast), boundingBoxPadding);\n    });\n  } else if (shouldUpdate) {\n    lockUserInteraction(renderState, function () {\n      renderState.mapInstance.setCenter(position || initialPosition);\n      renderState.mapInstance.setZoom(initialZoom);\n    });\n  }\n  render(h(GeoSearchControls, {\n    cssClasses: cssClasses,\n    enableRefine: enableRefine,\n    enableRefineControl: enableRefineControl,\n    enableClearMapRefinement: enableClearMapRefinement,\n    isRefineOnMapMove: isRefineOnMapMove(),\n    isRefinedWithMap: isRefinedWithMap(),\n    hasMapMoveSinceLastRefine: hasMapMoveSinceLastRefine(),\n    onRefineToggle: toggleRefineOnMapMove,\n    onRefineClick: function onRefineClick() {\n      return refineWithMap({\n        mapInstance: renderState.mapInstance,\n        refine: refine\n      });\n    },\n    onClearClick: clearMapRefinement,\n    templateProps: renderState.templateProps\n  }), container.querySelector(\".\".concat(cssClasses.tree)));\n};\nexport default renderer;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/geo-search/createHTMLMarker.d.ts",
    "content": "import type { renderTemplate } from '../../lib/templating';\nexport type HTMLMarkerArguments = {\n    __id: string;\n    position: google.maps.LatLngLiteral;\n    map: google.maps.Map;\n    template: ReturnType<typeof renderTemplate>;\n    title?: string;\n    className: string;\n    anchor?: {\n        x: number;\n        y: number;\n    };\n};\ninterface Marker {\n    __id: string;\n    anchor: {\n        x: number;\n        y: number;\n    };\n    offset?: {\n        x: number;\n        y: number;\n    };\n    listeners: {\n        [key: string]: EventListener;\n    };\n    latLng: google.maps.LatLng;\n    element: HTMLDivElement;\n    getPosition: () => google.maps.LatLng;\n}\ndeclare const createHTMLMarker: (googleReference: typeof google) => new (args: HTMLMarkerArguments) => google.maps.OverlayView & Marker;\nexport default createHTMLMarker;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/geo-search/createHTMLMarker.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n/* global google EventListener */\nimport { render } from 'preact';\nvar createHTMLMarker = function createHTMLMarker(googleReference) {\n  var HTMLMarker = /*#__PURE__*/function (_googleReference$maps) {\n    _inherits(HTMLMarker, _googleReference$maps);\n    var _super = _createSuper(HTMLMarker);\n    function HTMLMarker(_ref) {\n      var _this;\n      var __id = _ref.__id,\n        position = _ref.position,\n        map = _ref.map,\n        template = _ref.template,\n        className = _ref.className,\n        _ref$anchor = _ref.anchor,\n        anchor = _ref$anchor === void 0 ? {\n          x: 0,\n          y: 0\n        } : _ref$anchor;\n      _classCallCheck(this, HTMLMarker);\n      _this = _super.call(this);\n      _defineProperty(_assertThisInitialized(_this), \"__id\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"anchor\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"offset\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"listeners\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"latLng\", void 0);\n      _defineProperty(_assertThisInitialized(_this), \"element\", void 0);\n      _this.__id = __id;\n      _this.anchor = anchor;\n      _this.listeners = {};\n      _this.latLng = new googleReference.maps.LatLng(position);\n      _this.element = document.createElement('div');\n      _this.element.className = className;\n      _this.element.style.position = 'absolute';\n      if (_typeof(template) === 'object') {\n        render(template, _this.element);\n      } else {\n        _this.element.innerHTML = template;\n      }\n      _this.setMap(map);\n      return _this;\n    }\n    _createClass(HTMLMarker, [{\n      key: \"onAdd\",\n      value: function onAdd() {\n        // Append the element to the map\n        this.getPanes().overlayMouseTarget.appendChild(this.element);\n\n        // Compute the offset onAdd & cache it because afterwards\n        // it won't retrieve the correct values, we also avoid\n        // to read the values on every draw\n        var bbBox = this.element.getBoundingClientRect();\n        this.offset = {\n          x: this.anchor.x + bbBox.width / 2,\n          y: this.anchor.y + bbBox.height\n        };\n\n        // Force the width of the element will avoid the\n        // content to collapse when we move the map\n        this.element.style.width = \"\".concat(bbBox.width, \"px\");\n      }\n    }, {\n      key: \"draw\",\n      value: function draw() {\n        var position = this.getProjection().fromLatLngToDivPixel(this.latLng);\n        this.element.style.left = \"\".concat(Math.round(position.x - this.offset.x), \"px\");\n        this.element.style.top = \"\".concat(Math.round(position.y - this.offset.y), \"px\");\n\n        // Markers to the south are in front of markers to the north\n        // This is the default behaviour of Google Maps\n        this.element.style.zIndex = String(parseInt(this.element.style.top, 10));\n      }\n    }, {\n      key: \"onRemove\",\n      value: function onRemove() {\n        var _this2 = this;\n        if (this.element) {\n          this.element.parentNode.removeChild(this.element);\n          Object.keys(this.listeners).forEach(function (eventName) {\n            _this2.element.removeEventListener(eventName, _this2.listeners[eventName]);\n          });\n\n          // after onRemove the class is no longer used, thus it can be deleted\n          // @ts-expect-error\n          delete this.element;\n          // @ts-expect-error\n          delete this.listeners;\n        }\n      }\n    }, {\n      key: \"addListener\",\n      value: function addListener(eventName, listener) {\n        this.listeners[eventName] = listener;\n        var element = this.element;\n        element.addEventListener(eventName, listener);\n        return {\n          remove: function remove() {\n            return element.removeEventListener(eventName, listener);\n          }\n        };\n      }\n    }, {\n      key: \"getPosition\",\n      value: function getPosition() {\n        return this.latLng;\n      }\n    }]);\n    return HTMLMarker;\n  }(googleReference.maps.OverlayView);\n  return HTMLMarker;\n};\nexport default createHTMLMarker;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/geo-search/defaultTemplates.d.ts",
    "content": "\nimport type { GeoSearchComponentTemplates } from './geo-search';\ndeclare const defaultTemplates: GeoSearchComponentTemplates;\nexport default defaultTemplates;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/geo-search/defaultTemplates.js",
    "content": "import { h } from 'preact';\nvar _ref = h(\"p\", null, \"Your custom HTML Marker\");\nvar defaultTemplates = {\n  HTMLMarker: function HTMLMarker() {\n    return _ref;\n  },\n  reset: function reset() {\n    return 'Clear the map refinement';\n  },\n  toggle: function toggle() {\n    return 'Search as I move the map';\n  },\n  redo: function redo() {\n    return 'Redo search here';\n  }\n};\nexport default defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/geo-search/geo-search.d.ts",
    "content": "import type { GeoSearchConnectorParams, GeoSearchWidgetDescription, GeoHit } from '../../connectors/geo-search/connectGeoSearch';\nimport type { GeoLoc, Template, WidgetFactory } from '../../types';\nimport type { HTMLMarkerArguments } from './createHTMLMarker';\nexport type CreateMarker = (args: {\n    item: GeoHit;\n    map: google.maps.Map;\n}) => google.maps.OverlayView | google.maps.Marker;\nexport type GeoSearchTemplates<THit extends GeoHit = GeoHit> = Partial<{\n    /** Template to use for the marker. */\n    HTMLMarker: Template<THit>;\n    /** Template for the reset button. */\n    reset: Template;\n    /** Template for the toggle label. */\n    toggle: Template;\n    /** Template for the redo button. */\n    redo: Template;\n}>;\nexport type GeoSearchComponentTemplates = Required<GeoSearchTemplates>;\nexport type GeoSearchCSSClasses = Partial<{\n    /** The root div of the widget. */\n    root: string | string[];\n    /** The map container of the widget. */\n    map: string | string[];\n    /** The control element of the widget. */\n    control: string | string[];\n    /** The label of the control element. */\n    label: string | string[];\n    /** The selected label of the control element. */\n    selectedLabel: string | string[];\n    /** The input of the control element. */\n    input: string | string[];\n    /** The redo search button. */\n    redo: string | string[];\n    /** The disabled redo search button. */\n    disabledRedo: string | string[];\n    /** The reset refinement button. */\n    reset: string | string[];\n}>;\nexport type GeoSearchMarker<TOptions, THit extends GeoHit = GeoHit> = {\n    /**\n     * Function used to create the options passed to the Google Maps marker.\n     * See the documentation for more information:\n     * https://developers.google.com/maps/documentation/javascript/reference/3/#MarkerOptions\n     */\n    createOptions?: (item: THit) => TOptions;\n    /**\n     * Object that takes an event type (ex: `click`, `mouseover`) as key and a\n     * listener as value. The listener is provided with an object that contains:\n     * `event`, `item`, `marker`, `map`.\n     */\n    events: {\n        [key: string]: (event: {\n            item: any;\n            marker: any;\n            map: any;\n            event: any;\n        }) => void;\n    };\n};\nexport type GeoSearchWidgetParams<THit extends GeoHit = GeoHit> = {\n    /**\n     * By default the map will set the zoom accordingly to the markers displayed on it.\n     * When we refine it may happen that the results are empty. For those situations we\n     * need to provide a zoom to render the map.\n     * @default 1\n     */\n    initialZoom?: number;\n    /**\n     * By default the map will set the position accordingly to the markers displayed on it.\n     * When we refine it may happen that the results are empty. For those situations we need\n     * to provide a position to render the map. This option is ignored when the `position`\n     * is provided.\n     * @default { lat: 0, lng: 0 }\n     */\n    initialPosition?: GeoLoc;\n    /** Templates to use for the widget. */\n    templates?: GeoSearchTemplates<THit>;\n    /** CSS classes to add to the wrapping elements. */\n    cssClasses?: GeoSearchCSSClasses;\n    /**\n     * Options for customize the built-in Google Maps marker. This option is\n     * ignored when the `customHTMLMarker` is provided.\n     */\n    builtInMarker?: Partial<GeoSearchMarker<google.maps.MarkerOptions>>;\n    /**\n     * Options to customize the HTML marker. We provide an alternative to the\n     * built-in Google Maps marker in order to have a full control of the marker\n     * rendering. You can use plain HTML to build your marker.\n     */\n    customHTMLMarker?: Partial<GeoSearchMarker<Partial<HTMLMarkerArguments>>> | boolean;\n    /**\n     * If true, the map is used to search - otherwise it's for display purposes only.\n     * @default true\n     */\n    enableRefine?: boolean;\n    /**\n     * If true, a button is displayed on the map when the refinement is coming from\n     * the map in order to remove it.\n     * @default true\n     */\n    enableClearMapRefinement?: boolean;\n    /**\n     * If true, the user can toggle the option `enableRefineOnMapMove` directly from the map.\n     * @default true\n     */\n    enableRefineControl?: boolean;\n    /**\n     * Option forwarded to the Google Maps constructor.\n     * See the documentation for more information:\n     * https://developers.google.com/maps/documentation/javascript/reference/3/#MapOptions\n     */\n    mapOptions?: google.maps.MapOptions;\n    /**\n     * CSS Selector or HTMLElement to insert the widget.\n     */\n    container: string | HTMLElement;\n    /**\n     * Reference to the global `window.google` object.\n     * See [the documentation](https://developers.google.com/maps/documentation/javascript/tutorial) for more information.\n     */\n    googleReference: typeof window['google'];\n};\nexport type GeoSearchWidget = WidgetFactory<GeoSearchWidgetDescription & {\n    $$widgetType: 'ais.geoSearch';\n}, GeoSearchConnectorParams, GeoSearchWidgetParams>;\n/**\n * The **GeoSearch** widget displays the list of results from the search on a Google Maps. It also provides a way to search for results based on their position. The widget also provide some of the common GeoSearch patterns like search on map interaction.\n *\n * @requirements\n *\n * Note that the GeoSearch widget uses the [geosearch](https://www.algolia.com/doc/guides/searching/geo-search) capabilities of Algolia. Your hits **must** have a `_geoloc` attribute in order to be displayed on the map.\n *\n * Currently, the feature is not compatible with multiple values in the _geoloc attribute.\n *\n * You are also responsible for loading the Google Maps library, it's not shipped with InstantSearch. You need to load the Google Maps library and pass a reference to the widget. You can find more information about how to install the library in [the Google Maps documentation](https://developers.google.com/maps/documentation/javascript/tutorial).\n *\n * Don't forget to explicitly set the `height` of the map container (default class `.ais-geo-search--map`), otherwise it won't be shown (it's a requirement of Google Maps).\n */\ndeclare const _default: <THit extends GeoHit = GeoHit>(widgetParams: GeoSearchWidgetParams<THit> & GeoSearchConnectorParams<THit>) => {\n    $$widgetType: \"ais.geoSearch\";\n    $$type: \"ais.geoSearch\";\n    init(initArgs: import(\"../../types\").InitOptions): void;\n    render(renderArgs: import(\"../../types\").RenderOptions): void;\n    getWidgetRenderState(renderOptions: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions): {\n        items: GeoHit<THit>[];\n        position: {\n            lat: number;\n            lng: number;\n        } | undefined;\n        currentRefinement: {\n            northEast: {\n                lat: number;\n                lng: number;\n            };\n            southWest: {\n                lat: number;\n                lng: number;\n            };\n        } | undefined;\n        refine: ({ northEast: ne, southWest: sw }: {\n            northEast: GeoLoc;\n            southWest: GeoLoc;\n        }) => void;\n        sendEvent: import(\"../../lib/utils\").SendEventForHits;\n        clearMapRefinement: () => void;\n        isRefinedWithMap: () => boolean;\n        toggleRefineOnMapMove: () => void;\n        isRefineOnMapMove: () => boolean;\n        setMapMoveSinceLastRefine: () => void;\n        hasMapMoveSinceLastRefine: () => boolean;\n        widgetParams: {\n            renderState: {\n                templateProps?: import(\"../../lib/templating\").PreparedTemplateProps<GeoSearchTemplates>;\n                isUserInteraction?: boolean;\n                isPendingRefine?: boolean;\n                markers?: any[];\n            };\n            container: HTMLElement;\n            googleReference: GeoSearchWidgetParams[\"googleReference\"];\n            initialZoom: GeoSearchWidgetParams[\"initialZoom\"];\n            initialPosition: GeoSearchWidgetParams[\"initialPosition\"];\n            templates: Partial<{\n                /** Template to use for the marker. */\n                HTMLMarker: Template<GeoHit>;\n                /** Template for the reset button. */\n                reset: Template;\n                /** Template for the toggle label. */\n                toggle: Template;\n                /** Template for the redo button. */\n                redo: Template;\n            }>;\n            cssClasses: import(\"../../types\").ComponentCSSClasses<Partial<{\n                /** The root div of the widget. */\n                root: string | string[];\n                /** The map container of the widget. */\n                map: string | string[];\n                /** The control element of the widget. */\n                control: string | string[];\n                /** The label of the control element. */\n                label: string | string[];\n                /** The selected label of the control element. */\n                selectedLabel: string | string[];\n                /** The input of the control element. */\n                input: string | string[];\n                /** The redo search button. */\n                redo: string | string[];\n                /** The disabled redo search button. */\n                disabledRedo: string | string[];\n                /** The reset refinement button. */\n                reset: string | string[];\n            }> | undefined>;\n            createMarker: CreateMarker;\n            markerOptions: GeoSearchMarker<google.maps.MarkerOptions | Partial<HTMLMarkerArguments>>;\n            enableRefine: GeoSearchWidgetParams[\"enableRefine\"];\n            enableClearMapRefinement: GeoSearchWidgetParams[\"enableClearMapRefinement\"];\n            enableRefineControl: GeoSearchWidgetParams[\"enableRefineControl\"];\n        } & GeoSearchConnectorParams<THit>;\n    };\n    getRenderState(renderState: {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/answers/connectAnswers\").AnswersRenderState, import(\"../../connectors/answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/configure/connectConfigure\").ConfigureRenderState, import(\"../../connectors/configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchRenderState<GeoHit>, GeoSearchConnectorParams<GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits/connectHits\").HitsRenderState<import(\"../../types\").BaseHit>, import(\"../../connectors/hits/connectHits\").HitsConnectorParams<import(\"../../types\").BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<import(\"../../types\").BaseHit>, import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<import(\"../../types\").BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/menu/connectMenu\").MenuRenderState, import(\"../../connectors/menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/pagination/connectPagination\").PaginationRenderState, import(\"../../connectors/pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/range/connectRange\").RangeRenderState, import(\"../../connectors/range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/search-box/connectSearchBox\").SearchBoxRenderState, import(\"../../connectors/search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/sort-by/connectSortBy\").SortByRenderState, import(\"../../connectors/sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/stats/connectStats\").StatsRenderState, import(\"../../connectors/stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../places/places\").PlacesWidgetParams> | undefined;\n    }, renderOptions: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions): import(\"../../types\").IndexRenderState & GeoSearchWidgetDescription[\"indexRenderState\"];\n    dispose({ state }: import(\"../../types\").DisposeOptions): import(\"algoliasearch-helper\").SearchParameters;\n    getWidgetUiState(uiState: {\n        geoSearch?: {\n            boundingBox: string;\n        } | undefined;\n        query?: string | undefined;\n        configure?: import(\"algoliasearch-helper\").PlainSearchParameters | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: string[];\n        } | undefined;\n        hitsPerPage?: number | undefined;\n        page?: number | undefined;\n        menu?: {\n            [attribute: string]: string;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: string;\n        } | undefined;\n        range?: {\n            [attribute: string]: string;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: number | undefined;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: string[];\n        } | undefined;\n        relevantSort?: number | undefined;\n        sortBy?: string | undefined;\n        toggle?: {\n            [attribute: string]: boolean;\n        } | undefined;\n        places?: {\n            query: string;\n            position: string;\n        } | undefined;\n    }, { searchParameters }: {\n        searchParameters: import(\"algoliasearch-helper\").SearchParameters;\n        helper: import(\"algoliasearch-helper\").AlgoliaSearchHelper;\n    }): {\n        geoSearch?: {\n            boundingBox: string;\n        } | undefined;\n        query?: string | undefined;\n        configure?: import(\"algoliasearch-helper\").PlainSearchParameters | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: string[];\n        } | undefined;\n        hitsPerPage?: number | undefined;\n        page?: number | undefined;\n        menu?: {\n            [attribute: string]: string;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: string;\n        } | undefined;\n        range?: {\n            [attribute: string]: string;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: number | undefined;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: string[];\n        } | undefined;\n        relevantSort?: number | undefined;\n        sortBy?: string | undefined;\n        toggle?: {\n            [attribute: string]: boolean;\n        } | undefined;\n        places?: {\n            query: string;\n            position: string;\n        } | undefined;\n    };\n    getWidgetSearchParameters(searchParameters: import(\"algoliasearch-helper\").SearchParameters, { uiState }: {\n        uiState: {\n            geoSearch?: {\n                boundingBox: string;\n            } | undefined;\n            query?: string | undefined;\n            configure?: import(\"algoliasearch-helper\").PlainSearchParameters | undefined;\n            hierarchicalMenu?: {\n                [rootAttribute: string]: string[];\n            } | undefined;\n            hitsPerPage?: number | undefined;\n            page?: number | undefined;\n            menu?: {\n                [attribute: string]: string;\n            } | undefined;\n            numericMenu?: {\n                [attribute: string]: string;\n            } | undefined;\n            range?: {\n                [attribute: string]: string;\n            } | undefined;\n            ratingMenu?: {\n                [attribute: string]: number | undefined;\n            } | undefined;\n            refinementList?: {\n                [attribute: string]: string[];\n            } | undefined;\n            relevantSort?: number | undefined;\n            sortBy?: string | undefined;\n            toggle?: {\n                [attribute: string]: boolean;\n            } | undefined;\n            places?: {\n                query: string;\n                position: string;\n            } | undefined;\n        };\n    }): import(\"algoliasearch-helper\").SearchParameters;\n};\nexport default _default;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/geo-search/geo-search.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _excluded = [\"initialZoom\", \"initialPosition\", \"templates\", \"cssClasses\", \"builtInMarker\", \"customHTMLMarker\", \"enableRefine\", \"enableClearMapRefinement\", \"enableRefineControl\", \"container\", \"googleReference\"],\n  _excluded2 = [\"item\"],\n  _excluded3 = [\"item\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n// global for TypeScript alone\n/* global google */\nimport { cx } from 'instantsearch-ui-components';\nimport { render } from 'preact';\nimport connectGeoSearch from \"../../connectors/geo-search/connectGeoSearch.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { renderTemplate } from \"../../lib/templating/index.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nimport createHTMLMarker from \"./createHTMLMarker.js\";\nimport defaultTemplates from \"./defaultTemplates.js\";\nimport renderer from \"./GeoSearchRenderer.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'geo-search'\n});\nvar suit = component('GeoSearch');\n/**\n * The **GeoSearch** widget displays the list of results from the search on a Google Maps. It also provides a way to search for results based on their position. The widget also provide some of the common GeoSearch patterns like search on map interaction.\n *\n * @requirements\n *\n * Note that the GeoSearch widget uses the [geosearch](https://www.algolia.com/doc/guides/searching/geo-search) capabilities of Algolia. Your hits **must** have a `_geoloc` attribute in order to be displayed on the map.\n *\n * Currently, the feature is not compatible with multiple values in the _geoloc attribute.\n *\n * You are also responsible for loading the Google Maps library, it's not shipped with InstantSearch. You need to load the Google Maps library and pass a reference to the widget. You can find more information about how to install the library in [the Google Maps documentation](https://developers.google.com/maps/documentation/javascript/tutorial).\n *\n * Don't forget to explicitly set the `height` of the map container (default class `.ais-geo-search--map`), otherwise it won't be shown (it's a requirement of Google Maps).\n */\nexport default (function geoSearch(widgetParams) {\n  var _ref = widgetParams || {},\n    _ref$initialZoom = _ref.initialZoom,\n    initialZoom = _ref$initialZoom === void 0 ? 1 : _ref$initialZoom,\n    _ref$initialPosition = _ref.initialPosition,\n    initialPosition = _ref$initialPosition === void 0 ? {\n      lat: 0,\n      lng: 0\n    } : _ref$initialPosition,\n    _ref$templates = _ref.templates,\n    userTemplates = _ref$templates === void 0 ? {} : _ref$templates,\n    _ref$cssClasses = _ref.cssClasses,\n    userCssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses,\n    _ref$builtInMarker = _ref.builtInMarker,\n    userBuiltInMarker = _ref$builtInMarker === void 0 ? {} : _ref$builtInMarker,\n    userCustomHTMLMarker = _ref.customHTMLMarker,\n    _ref$enableRefine = _ref.enableRefine,\n    enableRefine = _ref$enableRefine === void 0 ? true : _ref$enableRefine,\n    _ref$enableClearMapRe = _ref.enableClearMapRefinement,\n    enableClearMapRefinement = _ref$enableClearMapRe === void 0 ? true : _ref$enableClearMapRe,\n    _ref$enableRefineCont = _ref.enableRefineControl,\n    enableRefineControl = _ref$enableRefineCont === void 0 ? true : _ref$enableRefineCont,\n    container = _ref.container,\n    googleReference = _ref.googleReference,\n    otherWidgetParams = _objectWithoutProperties(_ref, _excluded);\n  var defaultBuiltInMarker = {\n    createOptions: function createOptions() {\n      return {};\n    },\n    events: {}\n  };\n  var defaultCustomHTMLMarker = {\n    createOptions: function createOptions() {\n      return {};\n    },\n    events: {}\n  };\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  if (!googleReference) {\n    throw new Error(withUsage('The `googleReference` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    // Required only to mount / unmount the Preact tree\n    tree: suit({\n      descendantName: 'tree'\n    }),\n    map: cx(suit({\n      descendantName: 'map'\n    }), userCssClasses.map),\n    control: cx(suit({\n      descendantName: 'control'\n    }), userCssClasses.control),\n    label: cx(suit({\n      descendantName: 'label'\n    }), userCssClasses.label),\n    selectedLabel: cx(suit({\n      descendantName: 'label',\n      modifierName: 'selected'\n    }), userCssClasses.selectedLabel),\n    input: cx(suit({\n      descendantName: 'input'\n    }), userCssClasses.input),\n    redo: cx(suit({\n      descendantName: 'redo'\n    }), userCssClasses.redo),\n    disabledRedo: cx(suit({\n      descendantName: 'redo',\n      modifierName: 'disabled'\n    }), userCssClasses.disabledRedo),\n    reset: cx(suit({\n      descendantName: 'reset'\n    }), userCssClasses.reset)\n  };\n  var templates = _objectSpread(_objectSpread({}, defaultTemplates), userTemplates);\n  var builtInMarker = _objectSpread(_objectSpread({}, defaultBuiltInMarker), userBuiltInMarker);\n  var isCustomHTMLMarker = Boolean(userCustomHTMLMarker) || Boolean(userTemplates.HTMLMarker);\n  var customHTMLMarker = isCustomHTMLMarker && _objectSpread(_objectSpread({}, defaultCustomHTMLMarker), userCustomHTMLMarker);\n  var createBuiltInMarker = function createBuiltInMarker(_ref2) {\n    var item = _ref2.item,\n      rest = _objectWithoutProperties(_ref2, _excluded2);\n    return new googleReference.maps.Marker(_objectSpread(_objectSpread(_objectSpread({}, builtInMarker.createOptions(item)), rest), {}, {\n      // @ts-expect-error @types/googlemaps doesn't document this\n      __id: item.objectID,\n      position: item._geoloc\n    }));\n  };\n  var HTMLMarker = createHTMLMarker(googleReference);\n  var createCustomHTMLMarker = function createCustomHTMLMarker(_ref3) {\n    var item = _ref3.item,\n      rest = _objectWithoutProperties(_ref3, _excluded3);\n    return new HTMLMarker(_objectSpread(_objectSpread(_objectSpread({}, customHTMLMarker.createOptions(item)), rest), {}, {\n      __id: item.objectID,\n      position: item._geoloc,\n      className: cx(suit({\n        descendantName: 'marker'\n      })),\n      template: renderTemplate({\n        templateKey: 'HTMLMarker',\n        templates: templates,\n        data: item\n      })\n    }));\n  };\n  var createMarker = !customHTMLMarker ? createBuiltInMarker : createCustomHTMLMarker;\n  var markerOptions = !customHTMLMarker ? builtInMarker : customHTMLMarker;\n  var makeWidget = connectGeoSearch(renderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget(_objectSpread(_objectSpread({}, otherWidgetParams), {}, {\n    // @TODO: this type doesn't preserve the generic correctly,\n    // (but as they're internal only it's not a big problem)\n    templates: templates,\n    renderState: {},\n    container: containerNode,\n    googleReference: googleReference,\n    initialZoom: initialZoom,\n    initialPosition: initialPosition,\n    cssClasses: cssClasses,\n    createMarker: createMarker,\n    markerOptions: markerOptions,\n    enableRefine: enableRefine,\n    enableClearMapRefinement: enableClearMapRefinement,\n    enableRefineControl: enableRefineControl\n  }))), {}, {\n    $$widgetType: 'ais.geoSearch'\n  });\n});"
  },
  {
    "path": "js/instantsearch.js/es/widgets/hierarchical-menu/defaultTemplates.d.ts",
    "content": "import type { HierarchicalMenuComponentTemplates } from './hierarchical-menu';\ndeclare const defaultTemplates: HierarchicalMenuComponentTemplates;\nexport default defaultTemplates;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/hierarchical-menu/defaultTemplates.js",
    "content": "import { cx } from 'instantsearch-ui-components';\nimport { h } from 'preact';\nimport { formatNumber } from \"../../lib/formatNumber.js\";\nvar defaultTemplates = {\n  item: function item(_ref) {\n    var url = _ref.url,\n      label = _ref.label,\n      count = _ref.count,\n      cssClasses = _ref.cssClasses,\n      isRefined = _ref.isRefined;\n    return h(\"a\", {\n      className: cx(cx(cssClasses.link), cx(isRefined ? cssClasses.selectedItemLink : undefined)),\n      href: url\n    }, h(\"span\", {\n      className: cx(cssClasses.label)\n    }, label), h(\"span\", {\n      className: cx(cssClasses.count)\n    }, formatNumber(count)));\n  },\n  showMoreText: function showMoreText(_ref2) {\n    var isShowingMore = _ref2.isShowingMore;\n    return isShowingMore ? 'Show less' : 'Show more';\n  }\n};\nexport default defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/hierarchical-menu/hierarchical-menu.d.ts",
    "content": "\nimport type { HierarchicalMenuItem, HierarchicalMenuConnectorParams, HierarchicalMenuWidgetDescription } from '../../connectors/hierarchical-menu/connectHierarchicalMenu';\nimport type { TransformItems, Template, WidgetFactory, SortBy, ComponentCSSClasses } from '../../types';\ntype HierarchicalMenuTemplates = Partial<{\n    /**\n     * Item template, provided with `name`, `count`, `isRefined`, `url` data properties.\n     */\n    item: Template<{\n        name: string;\n        count: number;\n        isRefined: boolean;\n        url: string;\n        label: string;\n        cssClasses: HierarchicalMenuCSSClasses;\n    }>;\n    /**\n     * Template used for the show more text, provided with `isShowingMore` data property.\n     */\n    showMoreText: Template<{\n        isShowingMore: boolean;\n    }>;\n}>;\nexport type HierarchicalMenuCSSClasses = Partial<{\n    /**\n     * CSS class to add to the root element.\n     */\n    root: string | string[];\n    /**\n     * CSS class to add to the root element when no refinements.\n     */\n    noRefinementRoot: string | string[];\n    /**\n     * CSS class to add to the list element.\n     */\n    list: string | string[];\n    /**\n     * CSS class to add to the child list element.\n     */\n    childList: string | string[];\n    /**\n     * CSS class to add to each item element.\n     */\n    item: string | string[];\n    /**\n     * CSS class to add to each selected item element.\n     */\n    selectedItem: string | string[];\n    /**\n     * CSS class to add to each parent item element.\n     */\n    parentItem: string | string[];\n    /**\n     * CSS class to add to each link (when using the default template).\n     */\n    link: string | string[];\n    /**\n     * CSS class to add to the link of each selected item element (when using the default template).\n     */\n    selectedItemLink: string | string[];\n    /**\n     * CSS class to add to each label (when using the default template).\n     */\n    label: string | string[];\n    /**\n     * CSS class to add to each count element (when using the default template).\n     */\n    count: string | string[];\n    /**\n     * CSS class to add to the show more element.\n     */\n    showMore: string | string[];\n    /**\n     * CSS class to add to the disabled show more element.\n     */\n    disabledShowMore: string | string[];\n}>;\nexport type HierarchicalMenuComponentCSSClasses = ComponentCSSClasses<HierarchicalMenuCSSClasses>;\nexport type HierarchicalMenuComponentTemplates = Required<HierarchicalMenuTemplates>;\nexport type HierarchicalMenuWidgetParams = {\n    /**\n     * CSS Selector or HTMLElement to insert the widget.\n     */\n    container: string | HTMLElement;\n    /**\n     * Array of attributes to use to generate the hierarchy of the menu.\n     */\n    attributes: string[];\n    /**\n     * Separator used in the attributes to separate level values.\n     */\n    separator?: string;\n    /**\n     * Prefix path to use if the first level is not the root level.\n     */\n    rootPath?: string;\n    /**\n     * Show the siblings of the selected parent level of the current refined value.\n     *\n     * With `showParentLevel` set to `true` (default):\n     * - Parent lvl0\n     *   - **lvl1**\n     *     - **lvl2**\n     *     - lvl2\n     *     - lvl2\n     *   - lvl 1\n     *   - lvl 1\n     * - Parent lvl0\n     * - Parent lvl0\n     *\n     * With `showParentLevel` set to `false`:\n     * - Parent lvl0\n     *   - **lvl1**\n     *     - **lvl2**\n     * - Parent lvl0\n     * - Parent lvl0\n     */\n    showParentLevel?: boolean;\n    /**\n     * Max number of values to display.\n     */\n    limit?: number;\n    /**\n     * Whether to display the \"show more\" button.\n     */\n    showMore?: boolean;\n    /**\n     * Max number of values to display when showing more.\n     * does not impact the root level.\n     */\n    showMoreLimit?: number;\n    /**\n     * How to sort refinements. Possible values: `count|isRefined|name:asc|name:desc`.\n     * You can also use a sort function that behaves like the standard Javascript [compareFunction](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Syntax).\n     */\n    sortBy?: SortBy<HierarchicalMenuItem>;\n    /**\n     * Function to transform the items passed to the templates.\n     */\n    transformItems?: TransformItems<HierarchicalMenuItem>;\n    /**\n     * Templates to use for the widget.\n     */\n    templates?: HierarchicalMenuTemplates;\n    /**\n     * CSS classes to add to the wrapping elements.\n     */\n    cssClasses?: HierarchicalMenuCSSClasses;\n};\n/**\n * The hierarchical menu widget is used to create a navigation based on a hierarchy of facet attributes.\n *\n * It is commonly used for categories with subcategories.\n *\n * All attributes (lvl0, lvl1 here) must be declared as [attributes for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting) in your\n * Algolia settings.\n *\n * By default, the separator we expect is ` > ` (with spaces) but you can use\n * a different one by using the `separator` option.\n * @requirements\n * Your objects must be formatted in a specific way to be\n * able to display hierarchical menus. Here's an example:\n *\n * ```javascript\n * {\n *   \"objectID\": \"123\",\n *   \"name\": \"orange\",\n *   \"categories\": {\n *     \"lvl0\": \"fruits\",\n *     \"lvl1\": \"fruits > citrus\"\n *   }\n * }\n * ```\n *\n * Every level must be specified entirely.\n * It's also possible to have multiple values per level, for example:\n *\n * ```javascript\n * {\n *   \"objectID\": \"123\",\n *   \"name\": \"orange\",\n *   \"categories\": {\n *     \"lvl0\": [\"fruits\", \"vitamins\"],\n *     \"lvl1\": [\"fruits > citrus\", \"vitamins > C\"]\n *   }\n * }\n * ```\n * @type {WidgetFactory}\n * @devNovel HierarchicalMenu\n * @category filter\n * @param {HierarchicalMenuWidgetParams} widgetParams The HierarchicalMenu widget options.\n * @return {Widget} A new HierarchicalMenu widget instance.\n * @example\n * search.addWidgets([\n *   instantsearch.widgets.hierarchicalMenu({\n *     container: '#hierarchical-categories',\n *     attributes: ['hierarchicalCategories.lvl0', 'hierarchicalCategories.lvl1', 'hierarchicalCategories.lvl2'],\n *   })\n * ]);\n */\nexport type HierarchicalMenuWidget = WidgetFactory<HierarchicalMenuWidgetDescription & {\n    $$widgetType: 'ais.hierarchicalMenu';\n}, HierarchicalMenuConnectorParams, HierarchicalMenuWidgetParams>;\ndeclare const hierarchicalMenu: HierarchicalMenuWidget;\nexport default hierarchicalMenu;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/hierarchical-menu/hierarchical-menu.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport RefinementList from \"../../components/RefinementList/RefinementList.js\";\nimport connectHierarchicalMenu from \"../../connectors/hierarchical-menu/connectHierarchicalMenu.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { prepareTemplateProps } from \"../../lib/templating/index.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nimport defaultTemplates from \"./defaultTemplates.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'hierarchical-menu'\n});\nvar suit = component('HierarchicalMenu');\nvar renderer = function renderer(_ref) {\n  var cssClasses = _ref.cssClasses,\n    containerNode = _ref.containerNode,\n    showMore = _ref.showMore,\n    templates = _ref.templates,\n    renderState = _ref.renderState;\n  return function (_ref2, isFirstRendering) {\n    var createURL = _ref2.createURL,\n      items = _ref2.items,\n      refine = _ref2.refine,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      isShowingMore = _ref2.isShowingMore,\n      toggleShowMore = _ref2.toggleShowMore,\n      canToggleShowMore = _ref2.canToggleShowMore;\n    if (isFirstRendering) {\n      renderState.templateProps = prepareTemplateProps({\n        defaultTemplates: defaultTemplates,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    render(h(RefinementList, {\n      createURL: createURL,\n      cssClasses: cssClasses,\n      facetValues: items,\n      templateProps: renderState.templateProps,\n      toggleRefinement: refine,\n      showMore: showMore,\n      toggleShowMore: toggleShowMore,\n      isShowingMore: isShowingMore,\n      canToggleShowMore: canToggleShowMore\n    }), containerNode);\n  };\n};\n\n/**\n * The hierarchical menu widget is used to create a navigation based on a hierarchy of facet attributes.\n *\n * It is commonly used for categories with subcategories.\n *\n * All attributes (lvl0, lvl1 here) must be declared as [attributes for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting) in your\n * Algolia settings.\n *\n * By default, the separator we expect is ` > ` (with spaces) but you can use\n * a different one by using the `separator` option.\n * @requirements\n * Your objects must be formatted in a specific way to be\n * able to display hierarchical menus. Here's an example:\n *\n * ```javascript\n * {\n *   \"objectID\": \"123\",\n *   \"name\": \"orange\",\n *   \"categories\": {\n *     \"lvl0\": \"fruits\",\n *     \"lvl1\": \"fruits > citrus\"\n *   }\n * }\n * ```\n *\n * Every level must be specified entirely.\n * It's also possible to have multiple values per level, for example:\n *\n * ```javascript\n * {\n *   \"objectID\": \"123\",\n *   \"name\": \"orange\",\n *   \"categories\": {\n *     \"lvl0\": [\"fruits\", \"vitamins\"],\n *     \"lvl1\": [\"fruits > citrus\", \"vitamins > C\"]\n *   }\n * }\n * ```\n * @type {WidgetFactory}\n * @devNovel HierarchicalMenu\n * @category filter\n * @param {HierarchicalMenuWidgetParams} widgetParams The HierarchicalMenu widget options.\n * @return {Widget} A new HierarchicalMenu widget instance.\n * @example\n * search.addWidgets([\n *   instantsearch.widgets.hierarchicalMenu({\n *     container: '#hierarchical-categories',\n *     attributes: ['hierarchicalCategories.lvl0', 'hierarchicalCategories.lvl1', 'hierarchicalCategories.lvl2'],\n *   })\n * ]);\n */\n\nvar hierarchicalMenu = function hierarchicalMenu(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    attributes = _ref3.attributes,\n    separator = _ref3.separator,\n    rootPath = _ref3.rootPath,\n    showParentLevel = _ref3.showParentLevel,\n    limit = _ref3.limit,\n    _ref3$showMore = _ref3.showMore,\n    showMore = _ref3$showMore === void 0 ? false : _ref3$showMore,\n    showMoreLimit = _ref3.showMoreLimit,\n    sortBy = _ref3.sortBy,\n    transformItems = _ref3.transformItems,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    noRefinementRoot: cx(suit({\n      modifierName: 'noRefinement'\n    }), userCssClasses.noRefinementRoot),\n    list: cx(suit({\n      descendantName: 'list'\n    }), userCssClasses.list),\n    childList: cx(suit({\n      descendantName: 'list',\n      modifierName: 'child'\n    }), userCssClasses.childList),\n    item: cx(suit({\n      descendantName: 'item'\n    }), userCssClasses.item),\n    selectedItem: cx(suit({\n      descendantName: 'item',\n      modifierName: 'selected'\n    }), userCssClasses.selectedItem),\n    parentItem: cx(suit({\n      descendantName: 'item',\n      modifierName: 'parent'\n    }), userCssClasses.parentItem),\n    link: cx(suit({\n      descendantName: 'link'\n    }), userCssClasses.link),\n    selectedItemLink: cx(suit({\n      descendantName: 'link',\n      modifierName: 'selected'\n    }), userCssClasses.selectedItemLink),\n    label: cx(suit({\n      descendantName: 'label'\n    }), userCssClasses.label),\n    count: cx(suit({\n      descendantName: 'count'\n    }), userCssClasses.count),\n    showMore: cx(suit({\n      descendantName: 'showMore'\n    }), userCssClasses.showMore),\n    disabledShowMore: cx(suit({\n      descendantName: 'showMore',\n      modifierName: 'disabled'\n    }), userCssClasses.disabledShowMore)\n  };\n  var specializedRenderer = renderer({\n    cssClasses: cssClasses,\n    containerNode: containerNode,\n    templates: templates,\n    showMore: showMore,\n    renderState: {}\n  });\n  var makeWidget = connectHierarchicalMenu(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attributes: attributes,\n    separator: separator,\n    rootPath: rootPath,\n    showParentLevel: showParentLevel,\n    limit: limit,\n    showMore: showMore,\n    showMoreLimit: showMoreLimit,\n    sortBy: sortBy,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.hierarchicalMenu'\n  });\n};\nexport default hierarchicalMenu;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/hits/defaultTemplates.d.ts",
    "content": "declare const defaultTemplates: {\n    empty(): string;\n    item(data: {\n        __position: number;\n        __queryID?: string;\n    } & {\n        objectID: string;\n        _highlightResult?: import(\"../../types\").HitHighlightResult;\n        _snippetResult?: import(\"../../types\").HitSnippetResult;\n        _rankingInfo?: {\n            promoted: boolean;\n            nbTypos: number;\n            firstMatchedWord: number;\n            proximityDistance?: number;\n            geoDistance: number;\n            geoPrecision?: number;\n            nbExactWords: number;\n            words: number;\n            filters: number;\n            userScore: number;\n            matchedGeoLocation?: {\n                lat: number;\n                lng: number;\n                distance: number;\n            };\n        };\n        _distinctSeqID?: number;\n        _geoloc?: import(\"../../types\").GeoLoc;\n    } & import(\"../../types\").BaseHit & {\n        __hitIndex: number;\n    }): string;\n};\nexport default defaultTemplates;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/hits/defaultTemplates.js",
    "content": "import { omit } from \"../../lib/utils/index.js\";\n\n// false positive lint error\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\n\nvar defaultTemplates = {\n  empty: function empty() {\n    return 'No results';\n  },\n  item: function item(data) {\n    return JSON.stringify(omit(data, ['__hitIndex']), null, 2);\n  }\n};\nexport default defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/hits/hits.d.ts",
    "content": "\nimport type { HitsConnectorParams, HitsRenderState, HitsWidgetDescription } from '../../connectors/hits/connectHits';\nimport type { Template, TemplateWithBindEvent, Hit, WidgetFactory, BaseHit } from '../../types';\nimport type { SearchResults } from 'algoliasearch-helper';\nimport type { HitsClassNames as HitsUiComponentClassNames } from 'instantsearch-ui-components';\nexport type HitsCSSClasses = Partial<HitsUiComponentClassNames>;\nexport type HitsTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\n    /**\n     * Template to use when there are no results.\n     *\n     * @default 'No Results'\n     */\n    empty: Template<SearchResults<THit>>;\n    /**\n     * Template to use for each result. This template will receive an object containing a single record.\n     *\n     * @default ''\n     */\n    item: TemplateWithBindEvent<Hit<THit> & {\n        /** @deprecated the index in the hits array, use __position instead, which is the absolute position */\n        __hitIndex: number;\n    }>;\n    /**\n     * Template to use for the banner.\n     */\n    banner: Template<{\n        banner: Required<HitsRenderState['banner']>;\n        className: string;\n    }>;\n}>;\nexport type HitsWidgetParams<THit extends NonNullable<object> = BaseHit> = {\n    /**\n     * CSS Selector or HTMLElement to insert the widget.\n     */\n    container: string | HTMLElement;\n    /**\n     * Templates to use for the widget.\n     */\n    templates?: HitsTemplates<THit>;\n    /**\n     * CSS classes to add.\n     */\n    cssClasses?: HitsCSSClasses;\n};\nexport type HitsWidget = WidgetFactory<HitsWidgetDescription & {\n    $$widgetType: 'ais.hits';\n}, HitsConnectorParams, HitsWidgetParams>;\ndeclare const _default: <THit extends NonNullable<object> = BaseHit>(widgetParams: HitsWidgetParams<THit> & HitsConnectorParams<THit>) => {\n    $$widgetType: \"ais.hits\";\n    $$type: \"ais.hits\";\n    init(initOptions: import(\"../../types\").InitOptions): void;\n    render(renderOptions: import(\"../../types\").RenderOptions): void;\n    getRenderState(renderState: {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/answers/connectAnswers\").AnswersRenderState, import(\"../../connectors/answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/configure/connectConfigure\").ConfigureRenderState, import(\"../../connectors/configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<HitsRenderState<BaseHit>, HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/menu/connectMenu\").MenuRenderState, import(\"../../connectors/menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/pagination/connectPagination\").PaginationRenderState, import(\"../../connectors/pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/range/connectRange\").RangeRenderState, import(\"../../connectors/range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/search-box/connectSearchBox\").SearchBoxRenderState, import(\"../../connectors/search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/sort-by/connectSortBy\").SortByRenderState, import(\"../../connectors/sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/stats/connectStats\").StatsRenderState, import(\"../../connectors/stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../places/places\").PlacesWidgetParams> | undefined;\n    }, renderOptions: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions): import(\"../../types\").IndexRenderState & HitsWidgetDescription[\"indexRenderState\"];\n    getWidgetRenderState({ results, helper, instantSearchInstance }: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions): {\n        hits: never[];\n        items: never[];\n        results: undefined;\n        banner: undefined;\n        sendEvent: import(\"../../lib/utils\").SendEventForHits;\n        bindEvent: import(\"../../lib/utils\").BindEventForHits;\n        widgetParams: Partial<HitsWidgetParams<BaseHit>> & HitsConnectorParams<THit>;\n    } | {\n        hits: Hit<BaseHit>[] | Hit<THit>[];\n        items: Hit<BaseHit>[] | Hit<THit>[];\n        results: SearchResults<any>;\n        banner: import(\"algoliasearch-helper\").Banner | undefined;\n        sendEvent: import(\"../../lib/utils\").SendEventForHits;\n        bindEvent: import(\"../../lib/utils\").BindEventForHits;\n        widgetParams: Partial<HitsWidgetParams<BaseHit>> & HitsConnectorParams<THit>;\n    };\n    dispose({ state }: import(\"../../types\").DisposeOptions): import(\"algoliasearch-helper\").SearchParameters;\n    getWidgetSearchParameters(state: import(\"algoliasearch-helper\").SearchParameters, _uiState: {\n        uiState: {\n            query?: string | undefined;\n            configure?: import(\"algoliasearch-helper\").PlainSearchParameters | undefined;\n            geoSearch?: {\n                boundingBox: string;\n            } | undefined;\n            hierarchicalMenu?: {\n                [rootAttribute: string]: string[];\n            } | undefined;\n            hitsPerPage?: number | undefined;\n            page?: number | undefined;\n            menu?: {\n                [attribute: string]: string;\n            } | undefined;\n            numericMenu?: {\n                [attribute: string]: string;\n            } | undefined;\n            range?: {\n                [attribute: string]: string;\n            } | undefined;\n            ratingMenu?: {\n                [attribute: string]: number | undefined;\n            } | undefined;\n            refinementList?: {\n                [attribute: string]: string[];\n            } | undefined;\n            relevantSort?: number | undefined;\n            sortBy?: string | undefined;\n            toggle?: {\n                [attribute: string]: boolean;\n            } | undefined;\n            places?: {\n                query: string;\n                position: string;\n            } | undefined;\n        };\n    }): import(\"algoliasearch-helper\").SearchParameters;\n};\nexport default _default;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/hits/hits.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _excluded = [\"hit\", \"index\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError(\"Cannot destructure \" + obj); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport { createHitsComponent } from 'instantsearch-ui-components';\nimport { Fragment, h, render } from 'preact';\nimport TemplateComponent from \"../../components/Template/Template.js\";\nimport connectHits from \"../../connectors/hits/connectHits.js\";\nimport { withInsights } from \"../../lib/insights/index.js\";\nimport { createInsightsEventHandler } from \"../../lib/insights/listener.js\";\nimport { prepareTemplateProps } from \"../../lib/templating/index.js\";\nimport { getContainerNode, createDocumentationMessageGenerator, warning } from \"../../lib/utils/index.js\";\nimport defaultTemplates from \"./defaultTemplates.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'hits'\n});\nvar Hits = createHitsComponent({\n  createElement: h,\n  Fragment: Fragment\n});\nvar renderer = function renderer(_ref) {\n  var renderState = _ref.renderState,\n    cssClasses = _ref.cssClasses,\n    containerNode = _ref.containerNode,\n    templates = _ref.templates;\n  return function (_ref2, isFirstRendering) {\n    var items = _ref2.items,\n      results = _ref2.results,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      insights = _ref2.insights,\n      bindEvent = _ref2.bindEvent,\n      sendEvent = _ref2.sendEvent,\n      banner = _ref2.banner;\n    if (isFirstRendering) {\n      renderState.templateProps = prepareTemplateProps({\n        defaultTemplates: defaultTemplates,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    var handleInsightsClick = createInsightsEventHandler({\n      insights: insights,\n      sendEvent: sendEvent\n    });\n    var emptyComponent = function emptyComponent(_ref3) {\n      var rootProps = _extends({}, (_objectDestructuringEmpty(_ref3), _ref3));\n      return h(TemplateComponent, _extends({}, renderState.templateProps, {\n        rootProps: rootProps,\n        templateKey: \"empty\",\n        data: results,\n        rootTagName: \"fragment\"\n      }));\n    };\n\n    // @MAJOR: Move default hit component back to the UI library\n    // once flavour specificities are erased\n    var itemComponent = function itemComponent(_ref4) {\n      var hit = _ref4.hit,\n        index = _ref4.index,\n        rootProps = _objectWithoutProperties(_ref4, _excluded);\n      return h(TemplateComponent, _extends({}, renderState.templateProps, {\n        templateKey: \"item\",\n        rootTagName: \"li\",\n        rootProps: _objectSpread(_objectSpread({}, rootProps), {}, {\n          onClick: function onClick(event) {\n            handleInsightsClick(event);\n            rootProps.onClick();\n          },\n          onAuxClick: function onAuxClick(event) {\n            handleInsightsClick(event);\n            rootProps.onAuxClick();\n          }\n        }),\n        data: _objectSpread(_objectSpread({}, hit), {}, {\n          get __hitIndex() {\n            process.env.NODE_ENV === 'development' ? warning(false, 'The `__hitIndex` property is deprecated. Use the absolute `__position` instead.') : void 0;\n            return index;\n          }\n        }),\n        bindEvent: bindEvent,\n        sendEvent: sendEvent\n      }));\n    };\n    var bannerComponent = function bannerComponent(props) {\n      return h(TemplateComponent, _extends({}, renderState.templateProps, {\n        templateKey: \"banner\",\n        data: props,\n        rootTagName: \"fragment\"\n      }));\n    };\n    render(h(Hits, {\n      hits: items,\n      itemComponent: itemComponent,\n      sendEvent: sendEvent,\n      classNames: cssClasses,\n      emptyComponent: emptyComponent,\n      banner: banner,\n      bannerComponent: templates.banner ? bannerComponent : undefined\n    }), containerNode);\n  };\n};\nexport default (function hits(widgetParams) {\n  var _ref5 = widgetParams || {},\n    container = _ref5.container,\n    escapeHTML = _ref5.escapeHTML,\n    transformItems = _ref5.transformItems,\n    _ref5$templates = _ref5.templates,\n    templates = _ref5$templates === void 0 ? {} : _ref5$templates,\n    _ref5$cssClasses = _ref5.cssClasses,\n    cssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = withInsights(connectHits)(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    escapeHTML: escapeHTML,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.hits'\n  });\n});"
  },
  {
    "path": "js/instantsearch.js/es/widgets/hits-per-page/hits-per-page.d.ts",
    "content": "\nimport type { HitsPerPageConnectorParams, HitsPerPageWidgetDescription } from '../../connectors/hits-per-page/connectHitsPerPage';\nimport type { WidgetFactory } from '../../types';\nexport type HitsPerPageCSSClasses = Partial<{\n    /**\n     * CSS classes added to the outer `<div>`.\n     */\n    root: string | string[];\n    /**\n     * CSS classes added to the parent `<select>`.\n     */\n    select: string | string[];\n    /**\n     * CSS classes added to each `<option>`.\n     */\n    option: string | string[];\n}>;\nexport type HitsPerPageWidgetParams = {\n    /**\n     * CSS Selector or HTMLElement to insert the widget.\n     */\n    container: string | HTMLElement;\n    /**\n     * CSS classes to be added.\n     */\n    cssClasses?: HitsPerPageCSSClasses;\n};\nexport type HitsPerPageWidget = WidgetFactory<HitsPerPageWidgetDescription & {\n    $$widgetType: 'ais.hitsPerPage';\n}, HitsPerPageConnectorParams, HitsPerPageWidgetParams>;\ndeclare const hitsPerPage: HitsPerPageWidget;\nexport default hitsPerPage;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/hits-per-page/hits-per-page.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport Selector from \"../../components/Selector/Selector.js\";\nimport connectHitsPerPage from \"../../connectors/hits-per-page/connectHitsPerPage.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { getContainerNode, createDocumentationMessageGenerator, find } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'hits-per-page'\n});\nvar suit = component('HitsPerPage');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses;\n  return function (_ref2, isFirstRendering) {\n    var items = _ref2.items,\n      refine = _ref2.refine;\n    if (isFirstRendering) return;\n    var _ref3 = find(items, function (_ref4) {\n        var isRefined = _ref4.isRefined;\n        return isRefined;\n      }) || {},\n      currentValue = _ref3.value;\n    render(h(\"div\", {\n      className: cssClasses.root\n    }, h(Selector, {\n      cssClasses: cssClasses,\n      currentValue: currentValue,\n      options: items\n      // @ts-expect-error: the refine function expects a number, but setValue will call it with a string. We don't want to change the type of the refine function because it's part of the connector API.\n      ,\n      setValue: refine\n    })), containerNode);\n  };\n};\nvar hitsPerPage = function hitsPerPage(widgetParams) {\n  var _ref5 = widgetParams || {},\n    container = _ref5.container,\n    items = _ref5.items,\n    _ref5$cssClasses = _ref5.cssClasses,\n    userCssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses,\n    transformItems = _ref5.transformItems;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    select: cx(suit({\n      descendantName: 'select'\n    }), userCssClasses.select),\n    option: cx(suit({\n      descendantName: 'option'\n    }), userCssClasses.option)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses\n  });\n  var makeWidget = connectHitsPerPage(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    items: items,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.hitsPerPage'\n  });\n};\nexport default hitsPerPage;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/index/index.d.ts",
    "content": "import type { InstantSearch, UiState, IndexUiState, Widget, ScopedResult, RecommendResponse } from '../../types';\nimport type { AlgoliaSearchHelper as Helper, SearchParameters, SearchResults } from 'algoliasearch-helper';\nexport type IndexWidgetParams = {\n    indexName: string;\n    indexId?: string;\n};\nexport type IndexInitOptions = {\n    instantSearchInstance: InstantSearch;\n    parent: IndexWidget | null;\n    uiState: UiState;\n};\nexport type IndexRenderOptions = {\n    instantSearchInstance: InstantSearch;\n};\nexport type IndexWidgetDescription = {\n    $$type: 'ais.index';\n    $$widgetType: 'ais.index';\n};\nexport type IndexWidget<TUiState extends UiState = UiState> = Omit<Widget<IndexWidgetDescription & {\n    widgetParams: IndexWidgetParams;\n}>, 'getWidgetUiState' | 'getWidgetState'> & {\n    getIndexName: () => string;\n    getIndexId: () => string;\n    getHelper: () => Helper | null;\n    getResults: () => SearchResults | null;\n    getResultsForWidget: (widget: IndexWidget | Widget) => SearchResults | RecommendResponse<any> | null;\n    getPreviousState: () => SearchParameters | null;\n    getScopedResults: () => ScopedResult[];\n    getParent: () => IndexWidget | null;\n    getWidgets: () => Array<Widget | IndexWidget>;\n    createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;\n    addWidgets: (widgets: Array<Widget | IndexWidget>) => IndexWidget;\n    removeWidgets: (widgets: Array<Widget | IndexWidget>) => IndexWidget;\n    init: (options: IndexInitOptions) => void;\n    render: (options: IndexRenderOptions) => void;\n    dispose: () => void;\n    /**\n     * @deprecated\n     */\n    getWidgetState: (uiState: UiState) => UiState;\n    getWidgetUiState: <TSpecificUiState extends UiState = TUiState>(uiState: TSpecificUiState) => TSpecificUiState;\n    getWidgetSearchParameters: (searchParameters: SearchParameters, searchParametersOptions: {\n        uiState: IndexUiState;\n    }) => SearchParameters;\n    /**\n     * Set this index' UI state back to the state defined by the widgets.\n     * Can only be called after `init`.\n     */\n    refreshUiState: () => void;\n    /**\n     * Set this index' UI state and search. This is the equivalent of calling\n     * a spread `setUiState` on the InstantSearch instance.\n     * Can only be called after `init`.\n     */\n    setIndexUiState: (indexUiState: TUiState[string] | ((previousIndexUiState: TUiState[string]) => TUiState[string])) => void;\n};\ndeclare const index: (widgetParams: IndexWidgetParams) => IndexWidget;\nexport default index;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/index/index.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _excluded = [\"initialSearchParameters\"],\n  _excluded2 = [\"initialRecommendParameters\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport algoliasearchHelper from 'algoliasearch-helper';\nimport { checkIndexUiState, createDocumentationMessageGenerator, resolveSearchParameters, mergeSearchParameters, warning, isIndexWidget, createInitArgs, createRenderArgs } from \"../../lib/utils/index.js\";\nimport { addWidgetId } from \"../../lib/utils/addWidgetId.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'index-widget'\n});\n/**\n * This is the same content as helper._change / setState, but allowing for extra\n * UiState to be synchronized.\n * see: https://github.com/algolia/algoliasearch-helper-js/blob/6b835ffd07742f2d6b314022cce6848f5cfecd4a/src/algoliasearch.helper.js#L1311-L1324\n */\nfunction privateHelperSetState(helper, _ref) {\n  var state = _ref.state,\n    recommendState = _ref.recommendState,\n    isPageReset = _ref.isPageReset,\n    _uiState = _ref._uiState;\n  if (state !== helper.state) {\n    helper.state = state;\n    helper.emit('change', {\n      state: helper.state,\n      results: helper.lastResults,\n      isPageReset: isPageReset,\n      _uiState: _uiState\n    });\n  }\n  if (recommendState !== helper.recommendState) {\n    helper.recommendState = recommendState;\n\n    // eslint-disable-next-line no-warning-comments\n    // TODO: emit \"change\" event when events for Recommend are implemented\n  }\n}\nfunction getLocalWidgetsUiState(widgets, widgetStateOptions) {\n  var initialUiState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n  return widgets.reduce(function (uiState, widget) {\n    if (isIndexWidget(widget)) {\n      return uiState;\n    }\n    if (!widget.getWidgetUiState && !widget.getWidgetState) {\n      return uiState;\n    }\n    if (widget.getWidgetUiState) {\n      return widget.getWidgetUiState(uiState, widgetStateOptions);\n    }\n    return widget.getWidgetState(uiState, widgetStateOptions);\n  }, initialUiState);\n}\nfunction getLocalWidgetsSearchParameters(widgets, widgetSearchParametersOptions) {\n  var initialSearchParameters = widgetSearchParametersOptions.initialSearchParameters,\n    rest = _objectWithoutProperties(widgetSearchParametersOptions, _excluded);\n  return widgets.reduce(function (state, widget) {\n    if (!widget.getWidgetSearchParameters || isIndexWidget(widget)) {\n      return state;\n    }\n    if (widget.dependsOn === 'search' && widget.getWidgetParameters) {\n      return widget.getWidgetParameters(state, rest);\n    }\n    return widget.getWidgetSearchParameters(state, rest);\n  }, initialSearchParameters);\n}\nfunction getLocalWidgetsRecommendParameters(widgets, widgetRecommendParametersOptions) {\n  var initialRecommendParameters = widgetRecommendParametersOptions.initialRecommendParameters,\n    rest = _objectWithoutProperties(widgetRecommendParametersOptions, _excluded2);\n  return widgets.reduce(function (state, widget) {\n    if (!isIndexWidget(widget) && widget.dependsOn === 'recommend' && widget.getWidgetParameters) {\n      return widget.getWidgetParameters(state, rest);\n    }\n    return state;\n  }, initialRecommendParameters);\n}\nfunction resetPageFromWidgets(widgets) {\n  var indexWidgets = widgets.filter(isIndexWidget);\n  if (indexWidgets.length === 0) {\n    return;\n  }\n  indexWidgets.forEach(function (widget) {\n    var widgetHelper = widget.getHelper();\n    privateHelperSetState(widgetHelper, {\n      state: widgetHelper.state.resetPage(),\n      recommendState: widgetHelper.recommendState,\n      isPageReset: true\n    });\n    resetPageFromWidgets(widget.getWidgets());\n  });\n}\nfunction resolveScopedResultsFromWidgets(widgets) {\n  var indexWidgets = widgets.filter(isIndexWidget);\n  return indexWidgets.reduce(function (scopedResults, current) {\n    return scopedResults.concat.apply(scopedResults, [{\n      indexId: current.getIndexId(),\n      results: current.getResults(),\n      helper: current.getHelper()\n    }].concat(_toConsumableArray(resolveScopedResultsFromWidgets(current.getWidgets()))));\n  }, []);\n}\nvar index = function index(widgetParams) {\n  if (widgetParams === undefined || widgetParams.indexName === undefined) {\n    throw new Error(withUsage('The `indexName` option is required.'));\n  }\n  var indexName = widgetParams.indexName,\n    _widgetParams$indexId = widgetParams.indexId,\n    indexId = _widgetParams$indexId === void 0 ? indexName : _widgetParams$indexId;\n  var localWidgets = [];\n  var localUiState = {};\n  var localInstantSearchInstance = null;\n  var localParent = null;\n  var helper = null;\n  var derivedHelper = null;\n  var lastValidSearchParameters = null;\n  var hasRecommendWidget = false;\n  var hasSearchWidget = false;\n  return {\n    $$type: 'ais.index',\n    $$widgetType: 'ais.index',\n    getIndexName: function getIndexName() {\n      return indexName;\n    },\n    getIndexId: function getIndexId() {\n      return indexId;\n    },\n    getHelper: function getHelper() {\n      return helper;\n    },\n    getResults: function getResults() {\n      var _derivedHelper;\n      if (!((_derivedHelper = derivedHelper) !== null && _derivedHelper !== void 0 && _derivedHelper.lastResults)) return null;\n\n      // To make the UI optimistic, we patch the state to display to the current\n      // one instead of the one associated with the latest results.\n      // This means user-driven UI changes (e.g., checked checkbox) are reflected\n      // immediately instead of waiting for Algolia to respond, regardless of\n      // the status of the network request.\n      derivedHelper.lastResults._state = helper.state;\n      return derivedHelper.lastResults;\n    },\n    getResultsForWidget: function getResultsForWidget(widget) {\n      var _helper;\n      if (widget.dependsOn !== 'recommend' || isIndexWidget(widget) || widget.$$id === undefined) {\n        return this.getResults();\n      }\n      if (!((_helper = helper) !== null && _helper !== void 0 && _helper.lastRecommendResults)) {\n        return null;\n      }\n      return helper.lastRecommendResults[widget.$$id];\n    },\n    getPreviousState: function getPreviousState() {\n      return lastValidSearchParameters;\n    },\n    getScopedResults: function getScopedResults() {\n      var widgetParent = this.getParent();\n      var widgetSiblings;\n      if (widgetParent) {\n        widgetSiblings = widgetParent.getWidgets();\n      } else if (indexName.length === 0) {\n        // The widget is the root but has no index name:\n        // we resolve results from its children index widgets\n        widgetSiblings = this.getWidgets();\n      } else {\n        // The widget is the root and has an index name:\n        // we consider itself as the only sibling\n        widgetSiblings = [this];\n      }\n      return resolveScopedResultsFromWidgets(widgetSiblings);\n    },\n    getParent: function getParent() {\n      return localParent;\n    },\n    createURL: function createURL(nextState) {\n      if (typeof nextState === 'function') {\n        return localInstantSearchInstance._createURL(_defineProperty({}, indexId, nextState(localUiState)));\n      }\n      return localInstantSearchInstance._createURL(_defineProperty({}, indexId, getLocalWidgetsUiState(localWidgets, {\n        searchParameters: nextState,\n        helper: helper\n      })));\n    },\n    getWidgets: function getWidgets() {\n      return localWidgets;\n    },\n    addWidgets: function addWidgets(widgets) {\n      var _this = this;\n      if (!Array.isArray(widgets)) {\n        throw new Error(withUsage('The `addWidgets` method expects an array of widgets.'));\n      }\n      if (widgets.some(function (widget) {\n        return typeof widget.init !== 'function' && typeof widget.render !== 'function';\n      })) {\n        throw new Error(withUsage('The widget definition expects a `render` and/or an `init` method.'));\n      }\n      widgets.forEach(function (widget) {\n        if (isIndexWidget(widget)) {\n          return;\n        }\n        if (localInstantSearchInstance && widget.dependsOn === 'recommend') {\n          localInstantSearchInstance._hasRecommendWidget = true;\n        } else if (localInstantSearchInstance) {\n          localInstantSearchInstance._hasSearchWidget = true;\n        } else if (widget.dependsOn === 'recommend') {\n          hasRecommendWidget = true;\n        } else {\n          hasSearchWidget = true;\n        }\n        addWidgetId(widget);\n      });\n      localWidgets = localWidgets.concat(widgets);\n      if (localInstantSearchInstance && Boolean(widgets.length)) {\n        privateHelperSetState(helper, {\n          state: getLocalWidgetsSearchParameters(localWidgets, {\n            uiState: localUiState,\n            initialSearchParameters: helper.state\n          }),\n          recommendState: getLocalWidgetsRecommendParameters(localWidgets, {\n            uiState: localUiState,\n            initialRecommendParameters: helper.recommendState\n          }),\n          _uiState: localUiState\n        });\n\n        // We compute the render state before calling `init` in a separate loop\n        // to construct the whole render state object that is then passed to\n        // `init`.\n        widgets.forEach(function (widget) {\n          if (widget.getRenderState) {\n            var renderState = widget.getRenderState(localInstantSearchInstance.renderState[_this.getIndexId()] || {}, createInitArgs(localInstantSearchInstance, _this, localInstantSearchInstance._initialUiState));\n            storeRenderState({\n              renderState: renderState,\n              instantSearchInstance: localInstantSearchInstance,\n              parent: _this\n            });\n          }\n        });\n        widgets.forEach(function (widget) {\n          if (widget.init) {\n            widget.init(createInitArgs(localInstantSearchInstance, _this, localInstantSearchInstance._initialUiState));\n          }\n        });\n        localInstantSearchInstance.scheduleSearch();\n      }\n      return this;\n    },\n    removeWidgets: function removeWidgets(widgets) {\n      var _this2 = this;\n      if (!Array.isArray(widgets)) {\n        throw new Error(withUsage('The `removeWidgets` method expects an array of widgets.'));\n      }\n      if (widgets.some(function (widget) {\n        return typeof widget.dispose !== 'function';\n      })) {\n        throw new Error(withUsage('The widget definition expects a `dispose` method.'));\n      }\n      localWidgets = localWidgets.filter(function (widget) {\n        return widgets.indexOf(widget) === -1;\n      });\n      localWidgets.forEach(function (widget) {\n        if (isIndexWidget(widget)) {\n          return;\n        }\n        if (localInstantSearchInstance && widget.dependsOn === 'recommend') {\n          localInstantSearchInstance._hasRecommendWidget = true;\n        } else if (localInstantSearchInstance) {\n          localInstantSearchInstance._hasSearchWidget = true;\n        } else if (widget.dependsOn === 'recommend') {\n          hasRecommendWidget = true;\n        } else {\n          hasSearchWidget = true;\n        }\n      });\n      if (localInstantSearchInstance && Boolean(widgets.length)) {\n        var _widgets$reduce = widgets.reduce(function (states, widget) {\n            // the `dispose` method exists at this point we already assert it\n            var next = widget.dispose({\n              helper: helper,\n              state: states.cleanedSearchState,\n              recommendState: states.cleanedRecommendState,\n              parent: _this2\n            });\n            if (next instanceof algoliasearchHelper.RecommendParameters) {\n              states.cleanedRecommendState = next;\n            } else if (next) {\n              states.cleanedSearchState = next;\n            }\n            return states;\n          }, {\n            cleanedSearchState: helper.state,\n            cleanedRecommendState: helper.recommendState\n          }),\n          cleanedSearchState = _widgets$reduce.cleanedSearchState,\n          cleanedRecommendState = _widgets$reduce.cleanedRecommendState;\n        var newState = localInstantSearchInstance.future.preserveSharedStateOnUnmount ? getLocalWidgetsSearchParameters(localWidgets, {\n          uiState: localUiState,\n          initialSearchParameters: new algoliasearchHelper.SearchParameters({\n            index: this.getIndexName()\n          })\n        }) : getLocalWidgetsSearchParameters(localWidgets, {\n          uiState: getLocalWidgetsUiState(localWidgets, {\n            searchParameters: cleanedSearchState,\n            helper: helper\n          }),\n          initialSearchParameters: cleanedSearchState\n        });\n        localUiState = getLocalWidgetsUiState(localWidgets, {\n          searchParameters: newState,\n          helper: helper\n        });\n        helper.setState(newState);\n        helper.recommendState = cleanedRecommendState;\n        if (localWidgets.length) {\n          localInstantSearchInstance.scheduleSearch();\n        }\n      }\n      return this;\n    },\n    init: function init(_ref2) {\n      var _this3 = this,\n        _instantSearchInstanc;\n      var instantSearchInstance = _ref2.instantSearchInstance,\n        parent = _ref2.parent,\n        uiState = _ref2.uiState;\n      if (helper !== null) {\n        // helper is already initialized, therefore we do not need to set up\n        // any listeners\n        return;\n      }\n      localInstantSearchInstance = instantSearchInstance;\n      localParent = parent;\n      localUiState = uiState[indexId] || {};\n\n      // The `mainHelper` is already defined at this point. The instance is created\n      // inside InstantSearch at the `start` method, which occurs before the `init`\n      // step.\n      var mainHelper = instantSearchInstance.mainHelper;\n      var parameters = getLocalWidgetsSearchParameters(localWidgets, {\n        uiState: localUiState,\n        initialSearchParameters: new algoliasearchHelper.SearchParameters({\n          index: indexName\n        })\n      });\n      var recommendParameters = getLocalWidgetsRecommendParameters(localWidgets, {\n        uiState: localUiState,\n        initialRecommendParameters: new algoliasearchHelper.RecommendParameters()\n      });\n\n      // This Helper is only used for state management we do not care about the\n      // `searchClient`. Only the \"main\" Helper created at the `InstantSearch`\n      // level is aware of the client.\n      helper = algoliasearchHelper({}, parameters.index, parameters);\n      helper.recommendState = recommendParameters;\n\n      // We forward the call to `search` to the \"main\" instance of the Helper\n      // which is responsible for managing the queries (it's the only one that is\n      // aware of the `searchClient`).\n      helper.search = function () {\n        if (instantSearchInstance.onStateChange) {\n          instantSearchInstance.onStateChange({\n            uiState: instantSearchInstance.mainIndex.getWidgetUiState({}),\n            setUiState: function setUiState(nextState) {\n              return instantSearchInstance.setUiState(nextState, false);\n            }\n          });\n\n          // We don't trigger a search when controlled because it becomes the\n          // responsibility of `setUiState`.\n          return mainHelper;\n        }\n        return mainHelper.search();\n      };\n      helper.searchWithoutTriggeringOnStateChange = function () {\n        return mainHelper.search();\n      };\n\n      // We use the same pattern for the `searchForFacetValues`.\n      helper.searchForFacetValues = function (facetName, facetValue, maxFacetHits, userState) {\n        var state = helper.state.setQueryParameters(userState);\n        return mainHelper.searchForFacetValues(facetName, facetValue, maxFacetHits, state);\n      };\n      derivedHelper = mainHelper.derive(function () {\n        return mergeSearchParameters.apply(void 0, [mainHelper.state].concat(_toConsumableArray(resolveSearchParameters(_this3))));\n      }, function () {\n        return _this3.getHelper().recommendState;\n      });\n      var indexInitialResults = (_instantSearchInstanc = instantSearchInstance._initialResults) === null || _instantSearchInstanc === void 0 ? void 0 : _instantSearchInstanc[this.getIndexId()];\n      if (indexInitialResults !== null && indexInitialResults !== void 0 && indexInitialResults.results) {\n        // We restore the shape of the results provided to the instance to respect\n        // the helper's structure.\n        var results = new algoliasearchHelper.SearchResults(new algoliasearchHelper.SearchParameters(indexInitialResults.state), indexInitialResults.results);\n        derivedHelper.lastResults = results;\n        helper.lastResults = results;\n      }\n      if (indexInitialResults !== null && indexInitialResults !== void 0 && indexInitialResults.recommendResults) {\n        var recommendResults = new algoliasearchHelper.RecommendResults(new algoliasearchHelper.RecommendParameters({\n          params: indexInitialResults.recommendResults.params\n        }), indexInitialResults.recommendResults.results);\n        derivedHelper.lastRecommendResults = recommendResults;\n        helper.lastRecommendResults = recommendResults;\n      }\n\n      // Subscribe to the Helper state changes for the page before widgets\n      // are initialized. This behavior mimics the original one of the Helper.\n      // It makes sense to replicate it at the `init` step. We have another\n      // listener on `change` below, once `init` is done.\n      helper.on('change', function (_ref3) {\n        var isPageReset = _ref3.isPageReset;\n        if (isPageReset) {\n          resetPageFromWidgets(localWidgets);\n        }\n      });\n      derivedHelper.on('search', function () {\n        // The index does not manage the \"staleness\" of the search. This is the\n        // responsibility of the main instance. It does not make sense to manage\n        // it at the index level because it's either: all of them or none of them\n        // that are stalled. The queries are performed into a single network request.\n        instantSearchInstance.scheduleStalledRender();\n        if (process.env.NODE_ENV === 'development') {\n          checkIndexUiState({\n            index: _this3,\n            indexUiState: localUiState\n          });\n        }\n      });\n      derivedHelper.on('result', function (_ref4) {\n        var results = _ref4.results;\n        // The index does not render the results it schedules a new render\n        // to let all the other indices emit their own results. It allows us to\n        // run the render process in one pass.\n        instantSearchInstance.scheduleRender();\n\n        // the derived helper is the one which actually searches, but the helper\n        // which is exposed e.g. via instance.helper, doesn't search, and thus\n        // does not have access to lastResults, which it used to in pre-federated\n        // search behavior.\n        helper.lastResults = results;\n        lastValidSearchParameters = results === null || results === void 0 ? void 0 : results._state;\n      });\n\n      // eslint-disable-next-line no-warning-comments\n      // TODO: listen to \"result\" event when events for Recommend are implemented\n      derivedHelper.on('recommend:result', function (_ref5) {\n        var recommend = _ref5.recommend;\n        // The index does not render the results it schedules a new render\n        // to let all the other indices emit their own results. It allows us to\n        // run the render process in one pass.\n        instantSearchInstance.scheduleRender();\n\n        // the derived helper is the one which actually searches, but the helper\n        // which is exposed e.g. via instance.helper, doesn't search, and thus\n        // does not have access to lastRecommendResults.\n        helper.lastRecommendResults = recommend.results;\n      });\n\n      // We compute the render state before calling `init` in a separate loop\n      // to construct the whole render state object that is then passed to\n      // `init`.\n      localWidgets.forEach(function (widget) {\n        if (widget.getRenderState) {\n          var renderState = widget.getRenderState(instantSearchInstance.renderState[_this3.getIndexId()] || {}, createInitArgs(instantSearchInstance, _this3, uiState));\n          storeRenderState({\n            renderState: renderState,\n            instantSearchInstance: instantSearchInstance,\n            parent: _this3\n          });\n        }\n      });\n      localWidgets.forEach(function (widget) {\n        process.env.NODE_ENV === 'development' ? warning(\n        // if it has NO getWidgetState or if it has getWidgetUiState, we don't warn\n        // aka we warn if there's _only_ getWidgetState\n        !widget.getWidgetState || Boolean(widget.getWidgetUiState), 'The `getWidgetState` method is renamed `getWidgetUiState` and will no longer exist under that name in InstantSearch.js 5.x. Please use `getWidgetUiState` instead.') : void 0;\n        if (widget.init) {\n          widget.init(createInitArgs(instantSearchInstance, _this3, uiState));\n        }\n      });\n\n      // Subscribe to the Helper state changes for the `uiState` once widgets\n      // are initialized. Until the first render, state changes are part of the\n      // configuration step. This is mainly for backward compatibility with custom\n      // widgets. When the subscription happens before the `init` step, the (static)\n      // configuration of the widget is pushed in the URL. That's what we want to avoid.\n      // https://github.com/algolia/instantsearch/pull/994/commits/4a672ae3fd78809e213de0368549ef12e9dc9454\n      helper.on('change', function (event) {\n        var state = event.state;\n        var _uiState = event._uiState;\n        localUiState = getLocalWidgetsUiState(localWidgets, {\n          searchParameters: state,\n          helper: helper\n        }, _uiState || {});\n\n        // We don't trigger an internal change when controlled because it\n        // becomes the responsibility of `setUiState`.\n        if (!instantSearchInstance.onStateChange) {\n          instantSearchInstance.onInternalStateChange();\n        }\n      });\n      if (indexInitialResults) {\n        // If there are initial results, we're not notified of the next results\n        // because we don't trigger an initial search. We therefore need to directly\n        // schedule a render that will render the results injected on the helper.\n        instantSearchInstance.scheduleRender();\n      }\n      if (hasRecommendWidget) {\n        instantSearchInstance._hasRecommendWidget = true;\n      }\n      if (hasSearchWidget) {\n        instantSearchInstance._hasSearchWidget = true;\n      }\n    },\n    render: function render(_ref6) {\n      var _derivedHelper2,\n        _this4 = this;\n      var instantSearchInstance = _ref6.instantSearchInstance;\n      // we can't attach a listener to the error event of search, as the error\n      // then would no longer be thrown for global handlers.\n      if (instantSearchInstance.status === 'error' && !instantSearchInstance.mainHelper.hasPendingRequests() && lastValidSearchParameters) {\n        helper.setState(lastValidSearchParameters);\n      }\n\n      // We only render index widgets if there are no results.\n      // This makes sure `render` is never called with `results` being `null`.\n      var widgetsToRender = this.getResults() || (_derivedHelper2 = derivedHelper) !== null && _derivedHelper2 !== void 0 && _derivedHelper2.lastRecommendResults ? localWidgets : localWidgets.filter(isIndexWidget);\n      widgetsToRender = widgetsToRender.filter(function (widget) {\n        if (!widget.shouldRender) {\n          return true;\n        }\n        return widget.shouldRender({\n          instantSearchInstance: instantSearchInstance\n        });\n      });\n      widgetsToRender.forEach(function (widget) {\n        if (widget.getRenderState) {\n          var renderState = widget.getRenderState(instantSearchInstance.renderState[_this4.getIndexId()] || {}, createRenderArgs(instantSearchInstance, _this4, widget));\n          storeRenderState({\n            renderState: renderState,\n            instantSearchInstance: instantSearchInstance,\n            parent: _this4\n          });\n        }\n      });\n      widgetsToRender.forEach(function (widget) {\n        // At this point, all the variables used below are set. Both `helper`\n        // and `derivedHelper` have been created at the `init` step. The attribute\n        // `lastResults` might be `null` though. It's possible that a stalled render\n        // happens before the result e.g with a dynamically added index the request might\n        // be delayed. The render is triggered for the complete tree but some parts do\n        // not have results yet.\n\n        if (widget.render) {\n          widget.render(createRenderArgs(instantSearchInstance, _this4, widget));\n        }\n      });\n    },\n    dispose: function dispose() {\n      var _this5 = this,\n        _helper2,\n        _derivedHelper3;\n      localWidgets.forEach(function (widget) {\n        if (widget.dispose && helper) {\n          // The dispose function is always called once the instance is started\n          // (it's an effect of `removeWidgets`). The index is initialized and\n          // the Helper is available. We don't care about the return value of\n          // `dispose` because the index is removed. We can't call `removeWidgets`\n          // because we want to keep the widgets on the instance, to allow idempotent\n          // operations on `add` & `remove`.\n          widget.dispose({\n            helper: helper,\n            state: helper.state,\n            recommendState: helper.recommendState,\n            parent: _this5\n          });\n        }\n      });\n      localInstantSearchInstance = null;\n      localParent = null;\n      (_helper2 = helper) === null || _helper2 === void 0 ? void 0 : _helper2.removeAllListeners();\n      helper = null;\n      (_derivedHelper3 = derivedHelper) === null || _derivedHelper3 === void 0 ? void 0 : _derivedHelper3.detach();\n      derivedHelper = null;\n    },\n    getWidgetUiState: function getWidgetUiState(uiState) {\n      return localWidgets.filter(isIndexWidget).reduce(function (previousUiState, innerIndex) {\n        return innerIndex.getWidgetUiState(previousUiState);\n      }, _objectSpread(_objectSpread({}, uiState), {}, _defineProperty({}, indexId, _objectSpread(_objectSpread({}, uiState[indexId]), localUiState))));\n    },\n    getWidgetState: function getWidgetState(uiState) {\n      process.env.NODE_ENV === 'development' ? warning(false, 'The `getWidgetState` method is renamed `getWidgetUiState` and will no longer exist under that name in InstantSearch.js 5.x. Please use `getWidgetUiState` instead.') : void 0;\n      return this.getWidgetUiState(uiState);\n    },\n    getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref7) {\n      var uiState = _ref7.uiState;\n      return getLocalWidgetsSearchParameters(localWidgets, {\n        uiState: uiState,\n        initialSearchParameters: searchParameters\n      });\n    },\n    refreshUiState: function refreshUiState() {\n      localUiState = getLocalWidgetsUiState(localWidgets, {\n        searchParameters: this.getHelper().state,\n        helper: this.getHelper()\n      }, localUiState);\n    },\n    setIndexUiState: function setIndexUiState(indexUiState) {\n      var nextIndexUiState = typeof indexUiState === 'function' ? indexUiState(localUiState) : indexUiState;\n      localInstantSearchInstance.setUiState(function (state) {\n        return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, indexId, nextIndexUiState));\n      });\n    }\n  };\n};\nexport default index;\nfunction storeRenderState(_ref8) {\n  var renderState = _ref8.renderState,\n    instantSearchInstance = _ref8.instantSearchInstance,\n    parent = _ref8.parent;\n  var parentIndexName = parent ? parent.getIndexId() : instantSearchInstance.mainIndex.getIndexId();\n  instantSearchInstance.renderState = _objectSpread(_objectSpread({}, instantSearchInstance.renderState), {}, _defineProperty({}, parentIndexName, _objectSpread(_objectSpread({}, instantSearchInstance.renderState[parentIndexName]), renderState)));\n}"
  },
  {
    "path": "js/instantsearch.js/es/widgets/index.d.ts",
    "content": "import dynamicWidgets from './dynamic-widgets/dynamic-widgets';\n/** @deprecated answers is no longer supported */\nexport declare const EXPERIMENTAL_answers: import(\"./answers/answers\").AnswersWidget;\n/** @deprecated use relatedItems instead */\nexport declare const EXPERIMENTAL_configureRelatedItems: import(\"./configure-related-items/configure-related-items\").ConfigureRelatedItemsWidget;\n/** @deprecated use dynamicWidgets */\nexport declare const EXPERIMENTAL_dynamicWidgets: import(\"./dynamic-widgets/dynamic-widgets\").DynamicWidgetsWidget;\nexport { dynamicWidgets };\nexport { default as analytics } from './analytics/analytics';\nexport { default as breadcrumb } from './breadcrumb/breadcrumb';\nexport { default as clearRefinements } from './clear-refinements/clear-refinements';\nexport { default as configure } from './configure/configure';\nexport { default as currentRefinements } from './current-refinements/current-refinements';\nexport { default as geoSearch } from './geo-search/geo-search';\nexport { default as hierarchicalMenu } from './hierarchical-menu/hierarchical-menu';\nexport { default as hits } from './hits/hits';\nexport { default as hitsPerPage } from './hits-per-page/hits-per-page';\nexport { default as index } from './index/index';\nexport type { IndexWidget } from './index/index';\nexport { default as infiniteHits } from './infinite-hits/infinite-hits';\nexport { default as menu } from './menu/menu';\nexport { default as menuSelect } from './menu-select/menu-select';\nexport { default as numericMenu } from './numeric-menu/numeric-menu';\nexport { default as pagination } from './pagination/pagination';\nexport { default as panel } from './panel/panel';\nexport { default as places } from './places/places';\nexport { default as poweredBy } from './powered-by/powered-by';\nexport { default as queryRuleContext } from './query-rule-context/query-rule-context';\nexport { default as queryRuleCustomData } from './query-rule-custom-data/query-rule-custom-data';\nexport { default as relatedProducts } from './related-products/related-products';\nexport { default as rangeInput } from './range-input/range-input';\nexport { default as rangeSlider } from './range-slider/range-slider';\nexport { default as ratingMenu } from './rating-menu/rating-menu';\nexport { default as refinementList } from './refinement-list/refinement-list';\nexport { default as relevantSort } from './relevant-sort/relevant-sort';\nexport { default as searchBox } from './search-box/search-box';\nexport { default as sortBy } from './sort-by/sort-by';\nexport { default as stats } from './stats/stats';\nexport { default as toggleRefinement } from './toggle-refinement/toggle-refinement';\nexport { default as trendingItems } from './trending-items/trending-items';\nexport { default as voiceSearch } from './voice-search/voice-search';\nexport { default as frequentlyBoughtTogether } from './frequently-bought-together/frequently-bought-together';\nexport { default as lookingSimilar } from './looking-similar/looking-similar';\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/index.js",
    "content": "import { deprecate } from \"../lib/utils/index.js\";\nimport answers from \"./answers/answers.js\";\nimport configureRelatedItems from \"./configure-related-items/configure-related-items.js\";\nimport dynamicWidgets from \"./dynamic-widgets/dynamic-widgets.js\";\n\n/** @deprecated answers is no longer supported */\nexport var EXPERIMENTAL_answers = deprecate(answers, 'answers is no longer supported');\n\n/** @deprecated use relatedItems instead */\nexport var EXPERIMENTAL_configureRelatedItems = deprecate(configureRelatedItems, 'EXPERIMENTAL_configureRelatedItems is deprecated and will be removed in a next minor version of InstantSearch. Please use relatedItems instead.');\n\n/** @deprecated use dynamicWidgets */\nexport var EXPERIMENTAL_dynamicWidgets = deprecate(dynamicWidgets, 'use dynamicWidgets');\nexport { dynamicWidgets };\nexport { default as analytics } from \"./analytics/analytics.js\";\nexport { default as breadcrumb } from \"./breadcrumb/breadcrumb.js\";\nexport { default as clearRefinements } from \"./clear-refinements/clear-refinements.js\";\nexport { default as configure } from \"./configure/configure.js\";\nexport { default as currentRefinements } from \"./current-refinements/current-refinements.js\";\nexport { default as geoSearch } from \"./geo-search/geo-search.js\";\nexport { default as hierarchicalMenu } from \"./hierarchical-menu/hierarchical-menu.js\";\nexport { default as hits } from \"./hits/hits.js\";\nexport { default as hitsPerPage } from \"./hits-per-page/hits-per-page.js\";\nexport { default as index } from \"./index/index.js\";\nexport { default as infiniteHits } from \"./infinite-hits/infinite-hits.js\";\nexport { default as menu } from \"./menu/menu.js\";\nexport { default as menuSelect } from \"./menu-select/menu-select.js\";\nexport { default as numericMenu } from \"./numeric-menu/numeric-menu.js\";\nexport { default as pagination } from \"./pagination/pagination.js\";\nexport { default as panel } from \"./panel/panel.js\";\nexport { default as places } from \"./places/places.js\";\nexport { default as poweredBy } from \"./powered-by/powered-by.js\";\nexport { default as queryRuleContext } from \"./query-rule-context/query-rule-context.js\";\nexport { default as queryRuleCustomData } from \"./query-rule-custom-data/query-rule-custom-data.js\";\nexport { default as relatedProducts } from \"./related-products/related-products.js\";\nexport { default as rangeInput } from \"./range-input/range-input.js\";\nexport { default as rangeSlider } from \"./range-slider/range-slider.js\";\nexport { default as ratingMenu } from \"./rating-menu/rating-menu.js\";\nexport { default as refinementList } from \"./refinement-list/refinement-list.js\";\nexport { default as relevantSort } from \"./relevant-sort/relevant-sort.js\";\nexport { default as searchBox } from \"./search-box/search-box.js\";\nexport { default as sortBy } from \"./sort-by/sort-by.js\";\nexport { default as stats } from \"./stats/stats.js\";\nexport { default as toggleRefinement } from \"./toggle-refinement/toggle-refinement.js\";\nexport { default as trendingItems } from \"./trending-items/trending-items.js\";\nexport { default as voiceSearch } from \"./voice-search/voice-search.js\";\nexport { default as frequentlyBoughtTogether } from \"./frequently-bought-together/frequently-bought-together.js\";\nexport { default as lookingSimilar } from \"./looking-similar/looking-similar.js\";"
  },
  {
    "path": "js/instantsearch.js/es/widgets/infinite-hits/defaultTemplates.d.ts",
    "content": "import type { InfiniteHitsComponentTemplates } from '../../components/InfiniteHits/InfiniteHits';\ndeclare const defaultTemplates: InfiniteHitsComponentTemplates;\nexport default defaultTemplates;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/infinite-hits/defaultTemplates.js",
    "content": "import { omit } from \"../../lib/utils/index.js\";\nvar defaultTemplates = {\n  empty: function empty() {\n    return 'No results';\n  },\n  showPreviousText: function showPreviousText() {\n    return 'Show previous results';\n  },\n  showMoreText: function showMoreText() {\n    return 'Show more results';\n  },\n  item: function item(data) {\n    return JSON.stringify(omit(data, ['__hitIndex']), null, 2);\n  }\n};\nexport default defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/infinite-hits/infinite-hits.d.ts",
    "content": "\nimport type { InfiniteHitsConnectorParams, InfiniteHitsRenderState, InfiniteHitsCache, InfiniteHitsWidgetDescription } from '../../connectors/infinite-hits/connectInfiniteHits';\nimport type { WidgetFactory, Template, TemplateWithBindEvent, BaseHit, Hit } from '../../types';\nimport type { SearchResults } from 'algoliasearch-helper';\nexport type InfiniteHitsCSSClasses = Partial<{\n    /**\n     * The root element of the widget.\n     */\n    root: string | string[];\n    /**\n     * The root container without results.\n     */\n    emptyRoot: string | string[];\n    /**\n     * The list of results.\n     */\n    list: string | string[];\n    /**\n     * The list item.\n     */\n    item: string | string[];\n    /**\n     * The “Show previous” button.\n     */\n    loadPrevious: string | string[];\n    /**\n     * The disabled “Show previous” button.\n     */\n    disabledLoadPrevious: string | string[];\n    /**\n     * The “Show more” button.\n     */\n    loadMore: string | string[];\n    /**\n     * The disabled “Show more” button.\n     */\n    disabledLoadMore: string | string[];\n    /**\n     * Class names to apply to the banner element\n     */\n    bannerRoot: string | string[];\n    /**\n     * Class names to apply to the banner image element\n     */\n    bannerImage: string | string[];\n    /**\n     * Class names to apply to the banner link element\n     */\n    bannerLink: string | string[];\n}>;\nexport type InfiniteHitsTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\n    /**\n     * The template to use when there are no results.\n     */\n    empty: Template<SearchResults<THit>>;\n    /**\n     * The template to use for the “Show previous” label.\n     */\n    showPreviousText: Template;\n    /**\n     * The template to use for the “Show more” label.\n     */\n    showMoreText: Template;\n    /**\n     * The template to use for each result.\n     */\n    item: TemplateWithBindEvent<Hit<THit> & {\n        /** @deprecated the index in the hits array, use __position instead, which is the absolute position */\n        __hitIndex: number;\n    }>;\n    /**\n     * Template to use for the banner.\n     */\n    banner: Template<{\n        banner: Required<InfiniteHitsRenderState['banner']>;\n        className: string;\n    }>;\n}>;\nexport type InfiniteHitsWidgetParams<THit extends NonNullable<object> = BaseHit> = {\n    /**\n     * The CSS Selector or `HTMLElement` to insert the widget into.\n     */\n    container: string | HTMLElement;\n    /**\n     * The CSS classes to override.\n     */\n    cssClasses?: InfiniteHitsCSSClasses;\n    /**\n     * The templates to use for the widget.\n     */\n    templates?: InfiniteHitsTemplates<THit>;\n    /**\n     * Reads and writes hits from/to cache.\n     * When user comes back to the search page after leaving for product page,\n     * this helps restore InfiniteHits and its scroll position.\n     */\n    cache?: InfiniteHitsCache;\n};\nexport type InfiniteHitsWidget = WidgetFactory<InfiniteHitsWidgetDescription & {\n    $$widgetType: 'ais.infiniteHits';\n}, InfiniteHitsConnectorParams, InfiniteHitsWidgetParams>;\ndeclare const _default: <THit extends NonNullable<object> = BaseHit>(widgetParams: InfiniteHitsWidgetParams<THit> & InfiniteHitsConnectorParams<THit>) => {\n    $$widgetType: \"ais.infiniteHits\";\n    $$type: \"ais.infiniteHits\";\n    init(initOptions: import(\"../../types\").InitOptions): void;\n    render(renderOptions: import(\"../../types\").RenderOptions): void;\n    getRenderState(renderState: {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/answers/connectAnswers\").AnswersRenderState, import(\"../../connectors/answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/configure/connectConfigure\").ConfigureRenderState, import(\"../../connectors/configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits/connectHits\").HitsRenderState<BaseHit>, import(\"../../connectors/hits/connectHits\").HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<InfiniteHitsRenderState<BaseHit>, InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/menu/connectMenu\").MenuRenderState, import(\"../../connectors/menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/pagination/connectPagination\").PaginationRenderState, import(\"../../connectors/pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/range/connectRange\").RangeRenderState, import(\"../../connectors/range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/search-box/connectSearchBox\").SearchBoxRenderState, import(\"../../connectors/search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/sort-by/connectSortBy\").SortByRenderState, import(\"../../connectors/sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/stats/connectStats\").StatsRenderState, import(\"../../connectors/stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../places/places\").PlacesWidgetParams> | undefined;\n    }, renderOptions: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions): import(\"../../types\").IndexRenderState & InfiniteHitsWidgetDescription[\"indexRenderState\"];\n    getWidgetRenderState({ results, helper, parent, state: existingState, instantSearchInstance, }: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions): {\n        hits: Hit<THit>[];\n        items: Hit<THit>[];\n        currentPageHits: Hit<THit>[];\n        sendEvent: import(\"../../lib/utils\").SendEventForHits;\n        bindEvent: import(\"../../lib/utils\").BindEventForHits;\n        banner: import(\"algoliasearch-helper\").Banner | undefined;\n        results: SearchResults<any> | undefined;\n        showPrevious: () => void;\n        showMore: () => void;\n        isFirstPage: boolean;\n        isLastPage: boolean;\n        widgetParams: Partial<InfiniteHitsWidgetParams<BaseHit>> & InfiniteHitsConnectorParams<THit>;\n    };\n    dispose({ state }: import(\"../../types\").DisposeOptions): import(\"algoliasearch-helper\").SearchParameters;\n    getWidgetUiState(uiState: {\n        page?: number | undefined;\n        query?: string | undefined;\n        configure?: import(\"algoliasearch-helper\").PlainSearchParameters | undefined;\n        geoSearch?: {\n            boundingBox: string;\n        } | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: string[];\n        } | undefined;\n        hitsPerPage?: number | undefined;\n        menu?: {\n            [attribute: string]: string;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: string;\n        } | undefined;\n        range?: {\n            [attribute: string]: string;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: number | undefined;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: string[];\n        } | undefined;\n        relevantSort?: number | undefined;\n        sortBy?: string | undefined;\n        toggle?: {\n            [attribute: string]: boolean;\n        } | undefined;\n        places?: {\n            query: string;\n            position: string;\n        } | undefined;\n    }, { searchParameters }: {\n        searchParameters: import(\"algoliasearch-helper\").SearchParameters;\n        helper: import(\"algoliasearch-helper\").AlgoliaSearchHelper;\n    }): {\n        page?: number | undefined;\n        query?: string | undefined;\n        configure?: import(\"algoliasearch-helper\").PlainSearchParameters | undefined;\n        geoSearch?: {\n            boundingBox: string;\n        } | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: string[];\n        } | undefined;\n        hitsPerPage?: number | undefined;\n        menu?: {\n            [attribute: string]: string;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: string;\n        } | undefined;\n        range?: {\n            [attribute: string]: string;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: number | undefined;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: string[];\n        } | undefined;\n        relevantSort?: number | undefined;\n        sortBy?: string | undefined;\n        toggle?: {\n            [attribute: string]: boolean;\n        } | undefined;\n        places?: {\n            query: string;\n            position: string;\n        } | undefined;\n    };\n    getWidgetSearchParameters(searchParameters: import(\"algoliasearch-helper\").SearchParameters, { uiState }: {\n        uiState: {\n            page?: number | undefined;\n            query?: string | undefined;\n            configure?: import(\"algoliasearch-helper\").PlainSearchParameters | undefined;\n            geoSearch?: {\n                boundingBox: string;\n            } | undefined;\n            hierarchicalMenu?: {\n                [rootAttribute: string]: string[];\n            } | undefined;\n            hitsPerPage?: number | undefined;\n            menu?: {\n                [attribute: string]: string;\n            } | undefined;\n            numericMenu?: {\n                [attribute: string]: string;\n            } | undefined;\n            range?: {\n                [attribute: string]: string;\n            } | undefined;\n            ratingMenu?: {\n                [attribute: string]: number | undefined;\n            } | undefined;\n            refinementList?: {\n                [attribute: string]: string[];\n            } | undefined;\n            relevantSort?: number | undefined;\n            sortBy?: string | undefined;\n            toggle?: {\n                [attribute: string]: boolean;\n            } | undefined;\n            places?: {\n                query: string;\n                position: string;\n            } | undefined;\n        };\n    }): import(\"algoliasearch-helper\").SearchParameters;\n};\nexport default _default;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/infinite-hits/infinite-hits.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport InfiniteHits from \"../../components/InfiniteHits/InfiniteHits.js\";\nimport connectInfiniteHits from \"../../connectors/infinite-hits/connectInfiniteHits.js\";\nimport { withInsights } from \"../../lib/insights/index.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { prepareTemplateProps } from \"../../lib/templating/index.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nimport defaultTemplates from \"./defaultTemplates.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'infinite-hits'\n});\nvar suit = component('InfiniteHits');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    renderState = _ref.renderState,\n    templates = _ref.templates,\n    hasShowPrevious = _ref.showPrevious;\n  return function (_ref2, isFirstRendering) {\n    var items = _ref2.items,\n      results = _ref2.results,\n      showMore = _ref2.showMore,\n      showPrevious = _ref2.showPrevious,\n      isFirstPage = _ref2.isFirstPage,\n      isLastPage = _ref2.isLastPage,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      insights = _ref2.insights,\n      bindEvent = _ref2.bindEvent,\n      sendEvent = _ref2.sendEvent,\n      banner = _ref2.banner;\n    if (isFirstRendering) {\n      renderState.templateProps = prepareTemplateProps({\n        defaultTemplates: defaultTemplates,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    render(h(InfiniteHits, {\n      cssClasses: cssClasses,\n      hits: items,\n      results: results,\n      hasShowPrevious: hasShowPrevious,\n      showPrevious: showPrevious,\n      showMore: showMore,\n      templateProps: renderState.templateProps,\n      isFirstPage: isFirstPage,\n      isLastPage: isLastPage,\n      insights: insights,\n      sendEvent: sendEvent,\n      bindEvent: bindEvent,\n      banner: banner\n    }), containerNode);\n  };\n};\nexport default (function infiniteHits(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    escapeHTML = _ref3.escapeHTML,\n    transformItems = _ref3.transformItems,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    showPrevious = _ref3.showPrevious,\n    cache = _ref3.cache;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    emptyRoot: cx(suit({\n      modifierName: 'empty'\n    }), userCssClasses.emptyRoot),\n    item: cx(suit({\n      descendantName: 'item'\n    }), userCssClasses.item),\n    list: cx(suit({\n      descendantName: 'list'\n    }), userCssClasses.list),\n    loadPrevious: cx(suit({\n      descendantName: 'loadPrevious'\n    }), userCssClasses.loadPrevious),\n    disabledLoadPrevious: cx(suit({\n      descendantName: 'loadPrevious',\n      modifierName: 'disabled'\n    }), userCssClasses.disabledLoadPrevious),\n    loadMore: cx(suit({\n      descendantName: 'loadMore'\n    }), userCssClasses.loadMore),\n    disabledLoadMore: cx(suit({\n      descendantName: 'loadMore',\n      modifierName: 'disabled'\n    }), userCssClasses.disabledLoadMore),\n    bannerRoot: cx(suit({\n      descendantName: 'banner'\n    }), userCssClasses.bannerRoot),\n    bannerImage: cx(suit({\n      descendantName: 'banner-image'\n    }), userCssClasses.bannerImage),\n    bannerLink: cx(suit({\n      descendantName: 'banner-link'\n    }), userCssClasses.bannerLink)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    templates: templates,\n    showPrevious: showPrevious,\n    renderState: {}\n  });\n  var makeWidget = withInsights(connectInfiniteHits)(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    escapeHTML: escapeHTML,\n    transformItems: transformItems,\n    showPrevious: showPrevious,\n    cache: cache\n  })), {}, {\n    $$widgetType: 'ais.infiniteHits'\n  });\n});"
  },
  {
    "path": "js/instantsearch.js/es/widgets/looking-similar/looking-similar.d.ts",
    "content": "\nimport type { LookingSimilarWidgetDescription, LookingSimilarConnectorParams } from '../../connectors/looking-similar/connectLookingSimilar';\nimport type { Template, WidgetFactory, BaseHit, RecommendResponse, Hit, TemplateWithBindEvent } from '../../types';\nimport type { RecommendClassNames, LookingSimilarProps as LookingSimilarUiProps } from 'instantsearch-ui-components';\nexport type LookingSimilarCSSClasses = Partial<RecommendClassNames>;\nexport type LookingSimilarTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\n    /**\n     * Template to use when there are no results.\n     */\n    empty: Template<RecommendResponse<Hit<THit>>>;\n    /**\n     * Template to use for the header of the widget.\n     */\n    header: Template<Pick<Parameters<NonNullable<LookingSimilarUiProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {\n        cssClasses: RecommendClassNames;\n    }>;\n    /**\n     * Template to use for each result. This template will receive an object containing a single record.\n     */\n    item: TemplateWithBindEvent<Hit<THit>>;\n    /**\n     * Template to use to wrap all items.\n     */\n    layout: Template<Pick<Parameters<NonNullable<LookingSimilarUiProps<Hit<THit>>['layout']>>[0], 'items'> & {\n        templates: {\n            item: LookingSimilarUiProps<Hit<THit>>['itemComponent'];\n        };\n        cssClasses: Pick<LookingSimilarCSSClasses, 'list' | 'item'>;\n    }>;\n}>;\ntype LookingSimilarWidgetParams<THit extends NonNullable<object> = BaseHit> = {\n    /**\n     * CSS Selector or HTMLElement to insert the widget.\n     */\n    container: string | HTMLElement;\n    /**\n     * Templates to use for the widget.\n     */\n    templates?: LookingSimilarTemplates<THit>;\n    /**\n     * CSS classes to add.\n     */\n    cssClasses?: LookingSimilarCSSClasses;\n};\nexport type LookingSimilarWidget = WidgetFactory<LookingSimilarWidgetDescription & {\n    $$widgetType: 'ais.lookingSimilar';\n}, LookingSimilarConnectorParams, LookingSimilarWidgetParams>;\ndeclare const _default: <THit extends NonNullable<object> = BaseHit>(widgetParams: LookingSimilarWidgetParams<THit> & LookingSimilarConnectorParams<THit>) => {\n    $$widgetType: \"ais.lookingSimilar\";\n    dependsOn: \"recommend\";\n    $$type: \"ais.lookingSimilar\";\n    init(initOptions: import(\"../../types\").InitOptions): void;\n    render(renderOptions: import(\"../../types\").RenderOptions): void;\n    getRenderState(renderState: {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/answers/connectAnswers\").AnswersRenderState, import(\"../../connectors/answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/configure/connectConfigure\").ConfigureRenderState, import(\"../../connectors/configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits/connectHits\").HitsRenderState<BaseHit>, import(\"../../connectors/hits/connectHits\").HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/menu/connectMenu\").MenuRenderState, import(\"../../connectors/menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/pagination/connectPagination\").PaginationRenderState, import(\"../../connectors/pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/range/connectRange\").RangeRenderState, import(\"../../connectors/range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/search-box/connectSearchBox\").SearchBoxRenderState, import(\"../../connectors/search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/sort-by/connectSortBy\").SortByRenderState, import(\"../../connectors/sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/stats/connectStats\").StatsRenderState, import(\"../../connectors/stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../places/places\").PlacesWidgetParams> | undefined;\n    }): {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/answers/connectAnswers\").AnswersRenderState, import(\"../../connectors/answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/configure/connectConfigure\").ConfigureRenderState, import(\"../../connectors/configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits/connectHits\").HitsRenderState<BaseHit>, import(\"../../connectors/hits/connectHits\").HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/menu/connectMenu\").MenuRenderState, import(\"../../connectors/menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/pagination/connectPagination\").PaginationRenderState, import(\"../../connectors/pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/range/connectRange\").RangeRenderState, import(\"../../connectors/range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/search-box/connectSearchBox\").SearchBoxRenderState, import(\"../../connectors/search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/sort-by/connectSortBy\").SortByRenderState, import(\"../../connectors/sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/stats/connectStats\").StatsRenderState, import(\"../../connectors/stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../places/places\").PlacesWidgetParams> | undefined;\n    };\n    getWidgetRenderState({ results, helper, instantSearchInstance }: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions | ({\n        instantSearchInstance: import(\"../../types\").InstantSearch;\n        parent: import(\"../index\").IndexWidget;\n        templatesConfig: Record<string, unknown>;\n        scopedResults: import(\"../../types\").ScopedResult[];\n        state: import(\"algoliasearch-helper\").SearchParameters;\n        renderState: Partial<{\n            answers: import(\"../../types\").WidgetRenderState<import(\"../../connectors/answers/connectAnswers\").AnswersRenderState, import(\"../../connectors/answers/connectAnswers\").AnswersConnectorParams>;\n        } & {\n            autocomplete: import(\"../../types\").WidgetRenderState<import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteConnectorParams>;\n        } & {\n            breadcrumb: {\n                [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n            };\n        } & {\n            clearRefinements: import(\"../../types\").WidgetRenderState<import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams>;\n        } & {\n            configure: import(\"../../types\").WidgetRenderState<import(\"../../connectors/configure/connectConfigure\").ConfigureRenderState, import(\"../../connectors/configure/connectConfigure\").ConfigureConnectorParams>;\n        } & {\n            currentRefinements: import(\"../../types\").WidgetRenderState<import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams>;\n        } & {\n            geoSearch: import(\"../../types\").WidgetRenderState<import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>>;\n        } & {\n            hierarchicalMenu: {\n                [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n            };\n        } & {\n            hits: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits/connectHits\").HitsRenderState<BaseHit>, import(\"../../connectors/hits/connectHits\").HitsConnectorParams<BaseHit>>;\n        } & {\n            hitsPerPage: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams>;\n        } & {\n            infiniteHits: import(\"../../types\").WidgetRenderState<import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>>;\n        } & {\n            menu: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/menu/connectMenu\").MenuRenderState, import(\"../../connectors/menu/connectMenu\").MenuConnectorParams>;\n            };\n        } & {\n            numericMenu: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n            };\n        } & {\n            pagination: import(\"../../types\").WidgetRenderState<import(\"../../connectors/pagination/connectPagination\").PaginationRenderState, import(\"../../connectors/pagination/connectPagination\").PaginationConnectorParams>;\n        } & {\n            poweredBy: import(\"../../types\").WidgetRenderState<import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByConnectorParams>;\n        } & {\n            queryRules: import(\"../../types\").WidgetRenderState<import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesConnectorParams>;\n        } & {\n            range: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/range/connectRange\").RangeRenderState, import(\"../../connectors/range/connectRange\").RangeConnectorParams>;\n            };\n        } & {\n            ratingMenu: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n            };\n        } & {\n            refinementList: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n            };\n        } & {\n            relevantSort: import(\"../../types\").WidgetRenderState<import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortConnectorParams>;\n        } & {\n            searchBox: import(\"../../types\").WidgetRenderState<import(\"../../connectors/search-box/connectSearchBox\").SearchBoxRenderState, import(\"../../connectors/search-box/connectSearchBox\").SearchBoxConnectorParams>;\n        } & {\n            sortBy: import(\"../../types\").WidgetRenderState<import(\"../../connectors/sort-by/connectSortBy\").SortByRenderState, import(\"../../connectors/sort-by/connectSortBy\").SortByConnectorParams>;\n        } & {\n            stats: import(\"../../types\").WidgetRenderState<import(\"../../connectors/stats/connectStats\").StatsRenderState, import(\"../../connectors/stats/connectStats\").StatsConnectorParams>;\n        } & {\n            toggleRefinement: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n            };\n        } & {\n            voiceSearch: import(\"../../types\").WidgetRenderState<import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchConnectorParams>;\n        } & {\n            analytics: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../analytics/analytics\").AnalyticsWidgetParams>;\n        } & {\n            places: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../places/places\").PlacesWidgetParams>;\n        }>;\n        helper: import(\"algoliasearch-helper\").AlgoliaSearchHelper;\n        searchMetadata: {\n            isSearchStalled: boolean;\n        };\n        status: import(\"../../types\").InstantSearch[\"status\"];\n        error: import(\"../../types\").InstantSearch[\"error\"];\n        createURL: (nextState: import(\"algoliasearch-helper\").SearchParameters | ((state: import(\"../../types\").IndexUiState) => import(\"../../types\").IndexUiState)) => string;\n    } & {\n        results: RecommendResponse<any>;\n    })): {\n        items: Hit<THit>[];\n        widgetParams: Partial<LookingSimilarWidgetParams<BaseHit>> & LookingSimilarConnectorParams<THit>;\n        sendEvent: import(\"../../lib/utils\").SendEventForHits;\n    };\n    dispose({ recommendState }: import(\"../../types\").DisposeOptions): import(\"algoliasearch-helper\").RecommendParameters;\n    getWidgetParameters(state: import(\"algoliasearch-helper\").RecommendParameters): import(\"algoliasearch-helper\").RecommendParameters;\n};\nexport default _default;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/looking-similar/looking-similar.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _excluded = [\"item\", \"sendEvent\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport { createLookingSimilarComponent } from 'instantsearch-ui-components';\nimport { Fragment, h, render } from 'preact';\nimport TemplateComponent from \"../../components/Template/Template.js\";\nimport connectLookingSimilar from \"../../connectors/looking-similar/connectLookingSimilar.js\";\nimport { prepareTemplateProps } from \"../../lib/templating/index.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'looking-similar'\n});\nvar LookingSimilar = createLookingSimilarComponent({\n  createElement: h,\n  Fragment: Fragment\n});\nfunction createRenderer(_ref) {\n  var renderState = _ref.renderState,\n    cssClasses = _ref.cssClasses,\n    containerNode = _ref.containerNode,\n    templates = _ref.templates;\n  return function (_ref2, isFirstRendering) {\n    var items = _ref2.items,\n      results = _ref2.results,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      sendEvent = _ref2.sendEvent;\n    if (isFirstRendering) {\n      renderState.templateProps = prepareTemplateProps({\n        defaultTemplates: {},\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    var headerComponent = templates.header ? function (data) {\n      return h(TemplateComponent, _extends({}, renderState.templateProps, {\n        templateKey: \"header\",\n        rootTagName: \"fragment\",\n        data: {\n          cssClasses: data.classNames,\n          items: data.items\n        }\n      }));\n    } : undefined;\n    var itemComponent = templates.item ? function (_ref3) {\n      var item = _ref3.item,\n        _sendEvent = _ref3.sendEvent,\n        rootProps = _objectWithoutProperties(_ref3, _excluded);\n      return h(TemplateComponent, _extends({}, renderState.templateProps, {\n        templateKey: \"item\",\n        rootTagName: \"fragment\",\n        data: item,\n        sendEvent: _sendEvent,\n        rootProps: _objectSpread({}, rootProps)\n      }));\n    } : undefined;\n    var emptyComponent = templates.empty ? function () {\n      return h(TemplateComponent, _extends({}, renderState.templateProps, {\n        templateKey: \"empty\",\n        rootTagName: \"fragment\",\n        data: results\n      }));\n    } : undefined;\n    var layoutComponent = templates.layout ? function (data) {\n      return h(TemplateComponent, _extends({}, renderState.templateProps, {\n        templateKey: \"layout\",\n        rootTagName: \"fragment\",\n        data: {\n          sendEvent: sendEvent,\n          items: data.items,\n          templates: {\n            item: templates.item ? function (_ref4) {\n              var item = _ref4.item;\n              return h(TemplateComponent, _extends({}, renderState.templateProps, {\n                templateKey: \"item\",\n                rootTagName: \"fragment\",\n                data: item,\n                sendEvent: sendEvent\n              }));\n            } : undefined\n          },\n          cssClasses: {\n            list: data.classNames.list,\n            item: data.classNames.item\n          }\n        },\n        sendEvent: sendEvent\n      }));\n    } : undefined;\n    render(h(LookingSimilar, {\n      items: items,\n      headerComponent: headerComponent,\n      itemComponent: itemComponent,\n      sendEvent: function sendEvent() {},\n      classNames: cssClasses,\n      emptyComponent: emptyComponent,\n      layout: layoutComponent,\n      status: instantSearchInstance.status\n    }), containerNode);\n  };\n}\nexport default (function lookingSimilar(widgetParams) {\n  var _ref5 = widgetParams || {},\n    container = _ref5.container,\n    objectIDs = _ref5.objectIDs,\n    limit = _ref5.limit,\n    queryParameters = _ref5.queryParameters,\n    fallbackParameters = _ref5.fallbackParameters,\n    threshold = _ref5.threshold,\n    escapeHTML = _ref5.escapeHTML,\n    transformItems = _ref5.transformItems,\n    _ref5$templates = _ref5.templates,\n    templates = _ref5$templates === void 0 ? {} : _ref5$templates,\n    _ref5$cssClasses = _ref5.cssClasses,\n    cssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var specializedRenderer = createRenderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = connectLookingSimilar(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    objectIDs: objectIDs,\n    limit: limit,\n    queryParameters: queryParameters,\n    fallbackParameters: fallbackParameters,\n    threshold: threshold,\n    escapeHTML: escapeHTML,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.lookingSimilar'\n  });\n});"
  },
  {
    "path": "js/instantsearch.js/es/widgets/menu/defaultTemplates.d.ts",
    "content": "import type { MenuComponentTemplates } from './menu';\ndeclare const defaultTemplates: MenuComponentTemplates;\nexport default defaultTemplates;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/menu/defaultTemplates.js",
    "content": "import { cx } from 'instantsearch-ui-components';\nimport { h } from 'preact';\nimport { formatNumber } from \"../../lib/formatNumber.js\";\nvar defaultTemplates = {\n  item: function item(_ref) {\n    var cssClasses = _ref.cssClasses,\n      url = _ref.url,\n      label = _ref.label,\n      count = _ref.count;\n    return h(\"a\", {\n      className: cx(cssClasses.link),\n      href: url\n    }, h(\"span\", {\n      className: cx(cssClasses.label)\n    }, label), h(\"span\", {\n      className: cx(cssClasses.count)\n    }, formatNumber(count)));\n  },\n  showMoreText: function showMoreText(_ref2) {\n    var isShowingMore = _ref2.isShowingMore;\n    return isShowingMore ? 'Show less' : 'Show more';\n  }\n};\nexport default defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/menu/menu.d.ts",
    "content": "\nimport type { MenuConnectorParams, MenuWidgetDescription } from '../../connectors/menu/connectMenu';\nimport type { ComponentCSSClasses, Template, WidgetFactory } from '../../types';\nexport type MenuCSSClasses = Partial<{\n    /**\n     * CSS class to add to the root element.\n     */\n    root: string | string[];\n    /**\n     * CSS class to add to the root element when no refinements.\n     */\n    noRefinementRoot: string | string[];\n    /**\n     * CSS class to add to the list element.\n     */\n    list: string | string[];\n    /**\n     * CSS class to add to each item element.\n     */\n    item: string | string[];\n    /**\n     * CSS class to add to each selected item element.\n     */\n    selectedItem: string | string[];\n    /**\n     * CSS class to add to each link (when using the default template).\n     */\n    link: string | string[];\n    /**\n     * CSS class to add to each label (when using the default template).\n     */\n    label: string | string[];\n    /**\n     * CSS class to add to each count element (when using the default template).\n     */\n    count: string | string[];\n    /**\n     * CSS class to add to the show more button.\n     */\n    showMore: string | string[];\n    /**\n     * CSS class to add to the disabled show more button.\n     */\n    disabledShowMore: string | string[];\n}>;\nexport type MenuTemplates = Partial<{\n    /**\n     * Item template. The string template gets the same values as the function.\n     */\n    item: Template<{\n        count: number;\n        cssClasses: MenuCSSClasses;\n        isRefined: boolean;\n        label: string;\n        url: string;\n        value: string;\n    }>;\n    /**\n     * Template used for the show more text, provided with `isShowingMore` data property.\n     */\n    showMoreText: Template<{\n        isShowingMore: boolean;\n    }>;\n}>;\nexport type MenuComponentCSSClasses = ComponentCSSClasses<MenuCSSClasses>;\nexport type MenuComponentTemplates = Required<MenuTemplates>;\nexport type MenuWidgetParams = {\n    /**\n     * CSS Selector or HTMLElement to insert the widget.\n     */\n    container: string | HTMLElement;\n    /**\n     * Customize the output through templating.\n     */\n    templates?: MenuTemplates;\n    /**\n     * CSS classes to add to the wrapping elements.\n     */\n    cssClasses?: MenuCSSClasses;\n};\nexport type MenuWidget = WidgetFactory<MenuWidgetDescription & {\n    $$widgetType: 'ais.menu';\n}, MenuConnectorParams, MenuWidgetParams>;\ndeclare const menu: MenuWidget;\nexport default menu;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/menu/menu.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport RefinementList from \"../../components/RefinementList/RefinementList.js\";\nimport connectMenu from \"../../connectors/menu/connectMenu.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { prepareTemplateProps } from \"../../lib/templating/index.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nimport defaultTemplates from \"./defaultTemplates.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'menu'\n});\nvar suit = component('Menu');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    renderState = _ref.renderState,\n    templates = _ref.templates,\n    showMore = _ref.showMore;\n  return function (_ref2, isFirstRendering) {\n    var refine = _ref2.refine,\n      items = _ref2.items,\n      createURL = _ref2.createURL,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      isShowingMore = _ref2.isShowingMore,\n      toggleShowMore = _ref2.toggleShowMore,\n      canToggleShowMore = _ref2.canToggleShowMore;\n    if (isFirstRendering) {\n      renderState.templateProps = prepareTemplateProps({\n        defaultTemplates: defaultTemplates,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    var facetValues = items.map(function (facetValue) {\n      return _objectSpread(_objectSpread({}, facetValue), {}, {\n        url: createURL(facetValue.value)\n      });\n    });\n    render(h(RefinementList, {\n      createURL: createURL,\n      cssClasses: cssClasses,\n      facetValues: facetValues,\n      showMore: showMore,\n      templateProps: renderState.templateProps,\n      toggleRefinement: refine,\n      toggleShowMore: toggleShowMore,\n      isShowingMore: isShowingMore,\n      canToggleShowMore: canToggleShowMore\n    }), containerNode);\n  };\n};\nvar menu = function menu(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    attribute = _ref3.attribute,\n    sortBy = _ref3.sortBy,\n    limit = _ref3.limit,\n    showMore = _ref3.showMore,\n    showMoreLimit = _ref3.showMoreLimit,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    transformItems = _ref3.transformItems;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    noRefinementRoot: cx(suit({\n      modifierName: 'noRefinement'\n    }), userCssClasses.noRefinementRoot),\n    list: cx(suit({\n      descendantName: 'list'\n    }), userCssClasses.list),\n    item: cx(suit({\n      descendantName: 'item'\n    }), userCssClasses.item),\n    selectedItem: cx(suit({\n      descendantName: 'item',\n      modifierName: 'selected'\n    }), userCssClasses.selectedItem),\n    link: cx(suit({\n      descendantName: 'link'\n    }), userCssClasses.link),\n    label: cx(suit({\n      descendantName: 'label'\n    }), userCssClasses.label),\n    count: cx(suit({\n      descendantName: 'count'\n    }), userCssClasses.count),\n    showMore: cx(suit({\n      descendantName: 'showMore'\n    }), userCssClasses.showMore),\n    disabledShowMore: cx(suit({\n      descendantName: 'showMore',\n      modifierName: 'disabled'\n    }), userCssClasses.disabledShowMore)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates,\n    showMore: showMore\n  });\n  var makeWidget = connectMenu(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attribute: attribute,\n    limit: limit,\n    showMore: showMore,\n    showMoreLimit: showMoreLimit,\n    sortBy: sortBy,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.menu'\n  });\n};\nexport default menu;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/menu-select/defaultTemplates.d.ts",
    "content": "import type { MenuSelectComponentTemplates } from '../../components/MenuSelect/MenuSelect';\ndeclare const defaultTemplates: MenuSelectComponentTemplates;\nexport default defaultTemplates;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/menu-select/defaultTemplates.js",
    "content": "import { formatNumber } from \"../../lib/formatNumber.js\";\nvar defaultTemplates = {\n  item: function item(_ref) {\n    var label = _ref.label,\n      count = _ref.count;\n    return \"\".concat(label, \" (\").concat(formatNumber(count), \")\");\n  },\n  defaultOption: function defaultOption() {\n    return 'See all';\n  }\n};\nexport default defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/menu-select/menu-select.d.ts",
    "content": "\nimport type { MenuConnectorParams, MenuWidgetDescription } from '../../connectors/menu/connectMenu';\nimport type { Template, WidgetFactory } from '../../types';\nexport type MenuSelectCSSClasses = Partial<{\n    /**\n     * CSS class to add to the root element.\n     */\n    root: string | string[];\n    /**\n     * CSS class to add to the root when there are no items to display\n     */\n    noRefinementRoot: string | string[];\n    /**\n     * CSS class to add to the select element.\n     */\n    select: string | string[];\n    /**\n     * CSS class to add to the option element.\n     */\n    option: string | string[];\n}>;\nexport type MenuSelectTemplates = Partial<{\n    /**\n     * Item template, provided with `label`, `count`, `isRefined` and `value` data properties.\n     */\n    item: Template<{\n        label: string;\n        value: string;\n        count: number;\n        isRefined: boolean;\n    }>;\n    /**\n     * Label of the \"see all\" option in the select.\n     */\n    defaultOption: Template;\n}>;\nexport type MenuSelectWidgetParams = {\n    /**\n     * CSS Selector or HTMLElement to insert the widget.\n     */\n    container: string | HTMLElement;\n    /**\n     * Customize the output through templating.\n     */\n    templates?: MenuSelectTemplates;\n    /**\n     * CSS classes to add to the wrapping elements.\n     */\n    cssClasses?: MenuSelectCSSClasses;\n};\nexport type MenuSelectWidget = WidgetFactory<MenuWidgetDescription & {\n    $$widgetType: 'ais.menuSelect';\n}, MenuConnectorParams, MenuSelectWidgetParams>;\ndeclare const menuSelect: MenuSelectWidget;\nexport default menuSelect;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/menu-select/menu-select.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport MenuSelect from \"../../components/MenuSelect/MenuSelect.js\";\nimport connectMenu from \"../../connectors/menu/connectMenu.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { prepareTemplateProps } from \"../../lib/templating/index.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nimport defaultTemplates from \"./defaultTemplates.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'menu-select'\n});\nvar suit = component('MenuSelect');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    renderState = _ref.renderState,\n    templates = _ref.templates;\n  return function (_ref2, isFirstRendering) {\n    var refine = _ref2.refine,\n      items = _ref2.items,\n      instantSearchInstance = _ref2.instantSearchInstance;\n    if (isFirstRendering) {\n      renderState.templateProps = prepareTemplateProps({\n        defaultTemplates: defaultTemplates,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    render(h(MenuSelect, {\n      cssClasses: cssClasses,\n      items: items,\n      refine: refine,\n      templateProps: renderState.templateProps\n    }), containerNode);\n  };\n};\nvar menuSelect = function menuSelect(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    attribute = _ref3.attribute,\n    _ref3$sortBy = _ref3.sortBy,\n    sortBy = _ref3$sortBy === void 0 ? ['name:asc'] : _ref3$sortBy,\n    _ref3$limit = _ref3.limit,\n    limit = _ref3$limit === void 0 ? 10 : _ref3$limit,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    transformItems = _ref3.transformItems;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    noRefinementRoot: cx(suit({\n      modifierName: 'noRefinement'\n    }), userCssClasses.noRefinementRoot),\n    select: cx(suit({\n      descendantName: 'select'\n    }), userCssClasses.select),\n    option: cx(suit({\n      descendantName: 'option'\n    }), userCssClasses.option)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = connectMenu(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attribute: attribute,\n    limit: limit,\n    sortBy: sortBy,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.menuSelect'\n  });\n};\nexport default menuSelect;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/numeric-menu/defaultTemplates.d.ts",
    "content": "import type { NumericMenuComponentTemplates } from './numeric-menu';\ndeclare const defaultTemplates: NumericMenuComponentTemplates;\nexport default defaultTemplates;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/numeric-menu/defaultTemplates.js",
    "content": "import { h } from 'preact';\nvar defaultTemplates = {\n  item: function item(_ref) {\n    var cssClasses = _ref.cssClasses,\n      attribute = _ref.attribute,\n      label = _ref.label,\n      isRefined = _ref.isRefined;\n    return h(\"label\", {\n      className: cssClasses.label\n    }, h(\"input\", {\n      type: \"radio\",\n      className: cssClasses.radio,\n      name: attribute,\n      defaultChecked: isRefined\n    }), h(\"span\", {\n      className: cssClasses.labelText\n    }, label));\n  }\n};\nexport default defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/numeric-menu/numeric-menu.d.ts",
    "content": "\nimport type { NumericMenuConnectorParams, NumericMenuWidgetDescription } from '../../connectors/numeric-menu/connectNumericMenu';\nimport type { ComponentCSSClasses, Template, WidgetFactory } from '../../types';\nexport type NumericMenuCSSClasses = Partial<{\n    /**\n     * CSS class to add to the root element.\n     */\n    root: string | string[];\n    /**\n     * CSS class to add to the root element when no refinements.\n     */\n    noRefinementRoot: string | string[];\n    /**\n     * CSS class to add to the list element.\n     */\n    list: string | string[];\n    /**\n     * CSS class to add to each item element.\n     */\n    item: string | string[];\n    /**\n     * CSS class to add to each selected item element.\n     */\n    selectedItem: string | string[];\n    /**\n     * CSS class to add to each label element.\n     */\n    label: string | string[];\n    /**\n     * CSS class to add to each label text element.\n     */\n    labelText: string | string[];\n    /**\n     * CSS class to add to each radio element (when using the default template).\n     */\n    radio: string | string[];\n}>;\nexport type NumericMenuComponentCSSClasses = ComponentCSSClasses<NumericMenuCSSClasses>;\nexport type NumericMenuTemplates = Partial<{\n    /**\n     * Item template, provided with `label` (the name in the configuration), `isRefined`, `url`, `value` (the setting for the filter) data properties.\n     */\n    item: Template<{\n        /**\n         * The name of the attribute.\n         */\n        attribute: string;\n        /**\n         * The label for the option.\n         */\n        label: string;\n        /**\n         * The encoded URL of the bounds object with a {start, end} form. This\n         * value can be used verbatim in the webpage and can be read by refine\n         * directly. If you want to inspect the value, you can do JSON.parse(window.decodeURI(value))\n         * to get the object.\n         */\n        value: string;\n        /**\n         *  Whether or not the refinement is selected.\n         */\n        isRefined: boolean;\n        /**\n         * The URL with the applied refinement.\n         */\n        url: string;\n        /**\n         * The CSS classes provided to the widget.\n         */\n        cssClasses: NumericMenuComponentCSSClasses;\n    }>;\n}>;\nexport type NumericMenuComponentTemplates = Required<NumericMenuTemplates>;\nexport type NumericMenuWidgetParams = {\n    /**\n     * CSS Selector or HTMLElement to insert the widget.\n     */\n    container: string | HTMLElement;\n    /**\n     * Templates to use for the widget.\n     */\n    templates?: NumericMenuTemplates;\n    /**\n     * CSS classes to add to the wrapping elements.\n     */\n    cssClasses?: NumericMenuCSSClasses;\n};\nexport type NumericMenuWidget = WidgetFactory<NumericMenuWidgetDescription & {\n    $$widgetType: 'ais.numericMenu';\n}, NumericMenuConnectorParams, NumericMenuWidgetParams>;\ndeclare const numericMenu: NumericMenuWidget;\nexport default numericMenu;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/numeric-menu/numeric-menu.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport RefinementList from \"../../components/RefinementList/RefinementList.js\";\nimport connectNumericMenu from \"../../connectors/numeric-menu/connectNumericMenu.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { prepareTemplateProps } from \"../../lib/templating/index.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nimport defaultTemplates from \"./defaultTemplates.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'numeric-menu'\n});\nvar suit = component('NumericMenu');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    attribute = _ref.attribute,\n    cssClasses = _ref.cssClasses,\n    renderState = _ref.renderState,\n    templates = _ref.templates;\n  return function (_ref2, isFirstRendering) {\n    var createURL = _ref2.createURL,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      refine = _ref2.refine,\n      items = _ref2.items;\n    if (isFirstRendering) {\n      renderState.templateProps = prepareTemplateProps({\n        defaultTemplates: defaultTemplates,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    render(h(RefinementList, {\n      createURL: createURL,\n      cssClasses: cssClasses,\n      facetValues: items,\n      templateProps: renderState.templateProps,\n      toggleRefinement: refine,\n      attribute: attribute\n    }), containerNode);\n  };\n};\nvar numericMenu = function numericMenu(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    attribute = _ref3.attribute,\n    items = _ref3.items,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    transformItems = _ref3.transformItems;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    noRefinementRoot: cx(suit({\n      modifierName: 'noRefinement'\n    }), userCssClasses.noRefinementRoot),\n    list: cx(suit({\n      descendantName: 'list'\n    }), userCssClasses.list),\n    item: cx(suit({\n      descendantName: 'item'\n    }), userCssClasses.item),\n    selectedItem: cx(suit({\n      descendantName: 'item',\n      modifierName: 'selected'\n    }), userCssClasses.selectedItem),\n    label: cx(suit({\n      descendantName: 'label'\n    }), userCssClasses.label),\n    radio: cx(suit({\n      descendantName: 'radio'\n    }), userCssClasses.radio),\n    labelText: cx(suit({\n      descendantName: 'labelText'\n    }), userCssClasses.labelText)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    attribute: attribute,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = connectNumericMenu(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attribute: attribute,\n    items: items,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.numericMenu'\n  });\n};\nexport default numericMenu;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/pagination/pagination.d.ts",
    "content": "\nimport type { PaginationConnectorParams, PaginationWidgetDescription } from '../../connectors/pagination/connectPagination';\nimport type { Template, WidgetFactory } from '../../types';\nexport type PaginationCSSClasses = Partial<{\n    /**\n     * CSS classes added to the root element of the widget.\n     */\n    root: string | string[];\n    /**\n     * CSS class to add to the root element of the widget if there are no refinements.\n     */\n    noRefinementRoot: string | string[];\n    /**\n     * CSS classes added to the wrapping `<ul>`.\n     */\n    list: string | string[];\n    /**\n     * CSS classes added to each `<li>`.\n     */\n    item: string | string[];\n    /**\n     * CSS classes added to the first `<li>`.\n     */\n    firstPageItem: string | string[];\n    /**\n     * CSS classes added to the last `<li>`.\n     */\n    lastPageItem: string | string[];\n    /**\n     * CSS classes added to the previous `<li>`.\n     */\n    previousPageItem: string | string[];\n    /**\n     * CSS classes added to the next `<li>`.\n     */\n    nextPageItem: string | string[];\n    /**\n     * CSS classes added to page `<li>`.\n     */\n    pageItem: string | string[];\n    /**\n     * CSS classes added to the selected `<li>`.\n     */\n    selectedItem: string | string[];\n    /**\n     * CSS classes added to the disabled `<li>`.\n     */\n    disabledItem: string | string[];\n    /**\n     * CSS classes added to each link.\n     */\n    link: string | string[];\n}>;\nexport type PaginationTemplates = Partial<{\n    /**\n     * Label for the Previous link.\n     */\n    previous: Template;\n    /**\n     * Label for the Next link.\n     */\n    next: Template;\n    /**\n     * Label for the link of a certain page\n     * Page is one-based, so `page` will be `1` for the first page.\n     */\n    page: Template<{\n        page: number;\n    }>;\n    /**\n     * Label for the First link.\n     */\n    first: Template;\n    /**\n     * Label for the Last link.\n     */\n    last: Template;\n}>;\nexport type PaginationWidgetParams = {\n    /**\n     * CSS Selector or HTMLElement to insert the widget.\n     */\n    container: string | HTMLElement;\n    /**\n     * The max number of pages to browse.\n     */\n    totalPages?: number;\n    /**\n     * The number of pages to display on each side of the current page.\n     * @default 3\n     */\n    padding?: number;\n    /**\n     * Where to scroll after a click, set to `false` to disable.\n     * @default body\n     */\n    scrollTo?: string | HTMLElement | boolean;\n    /**\n     * Whether to show the \"first page\" control\n     * @default true\n     */\n    showFirst?: boolean;\n    /**\n     * Whether to show the \"last page\" control\n     * @default true\n     */\n    showLast?: boolean;\n    /**\n     * Whether to show the \"next page\" control\n     * @default true\n     */\n    showNext?: boolean;\n    /**\n     * Whether to show the \"previous page\" control\n     * @default true\n     */\n    showPrevious?: boolean;\n    /**\n     * Text to display in the links.\n     */\n    templates?: PaginationTemplates;\n    /**\n     * CSS classes to be added.\n     */\n    cssClasses?: PaginationCSSClasses;\n};\nexport type PaginationWidget = WidgetFactory<PaginationWidgetDescription & {\n    $$widgetType: 'ais.pagination';\n}, PaginationConnectorParams, PaginationWidgetParams>;\ndeclare const pagination: PaginationWidget;\nexport default pagination;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/pagination/pagination.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport Pagination from \"../../components/Pagination/Pagination.js\";\nimport connectPagination from \"../../connectors/pagination/connectPagination.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nvar suit = component('Pagination');\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'pagination'\n});\nvar defaultTemplates = {\n  previous: function previous() {\n    return '‹';\n  },\n  next: function next() {\n    return '›';\n  },\n  page: function page(_ref) {\n    var _page = _ref.page;\n    return \"\".concat(_page);\n  },\n  first: function first() {\n    return '«';\n  },\n  last: function last() {\n    return '»';\n  }\n};\nvar renderer = function renderer(_ref2) {\n  var containerNode = _ref2.containerNode,\n    cssClasses = _ref2.cssClasses,\n    templates = _ref2.templates,\n    showFirst = _ref2.showFirst,\n    showLast = _ref2.showLast,\n    showPrevious = _ref2.showPrevious,\n    showNext = _ref2.showNext,\n    scrollToNode = _ref2.scrollToNode;\n  return function (_ref3, isFirstRendering) {\n    var createURL = _ref3.createURL,\n      currentRefinement = _ref3.currentRefinement,\n      nbPages = _ref3.nbPages,\n      pages = _ref3.pages,\n      isFirstPage = _ref3.isFirstPage,\n      isLastPage = _ref3.isLastPage,\n      refine = _ref3.refine;\n    if (isFirstRendering) return;\n    var setCurrentPage = function setCurrentPage(pageNumber) {\n      refine(pageNumber);\n      if (scrollToNode !== false) {\n        scrollToNode.scrollIntoView();\n      }\n    };\n    render(h(Pagination, {\n      createURL: createURL,\n      cssClasses: cssClasses,\n      currentPage: currentRefinement,\n      templates: templates,\n      nbPages: nbPages,\n      pages: pages,\n      isFirstPage: isFirstPage,\n      isLastPage: isLastPage,\n      setCurrentPage: setCurrentPage,\n      showFirst: showFirst,\n      showLast: showLast,\n      showPrevious: showPrevious,\n      showNext: showNext\n    }), containerNode);\n  };\n};\nvar pagination = function pagination(widgetParams) {\n  var _ref4 = widgetParams || {},\n    container = _ref4.container,\n    _ref4$templates = _ref4.templates,\n    userTemplates = _ref4$templates === void 0 ? {} : _ref4$templates,\n    _ref4$cssClasses = _ref4.cssClasses,\n    userCssClasses = _ref4$cssClasses === void 0 ? {} : _ref4$cssClasses,\n    totalPages = _ref4.totalPages,\n    padding = _ref4.padding,\n    _ref4$showFirst = _ref4.showFirst,\n    showFirst = _ref4$showFirst === void 0 ? true : _ref4$showFirst,\n    _ref4$showLast = _ref4.showLast,\n    showLast = _ref4$showLast === void 0 ? true : _ref4$showLast,\n    _ref4$showPrevious = _ref4.showPrevious,\n    showPrevious = _ref4$showPrevious === void 0 ? true : _ref4$showPrevious,\n    _ref4$showNext = _ref4.showNext,\n    showNext = _ref4$showNext === void 0 ? true : _ref4$showNext,\n    _ref4$scrollTo = _ref4.scrollTo,\n    userScrollTo = _ref4$scrollTo === void 0 ? 'body' : _ref4$scrollTo;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var scrollTo = userScrollTo === true ? 'body' : userScrollTo;\n  var scrollToNode = scrollTo !== false ? getContainerNode(scrollTo) : false;\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    noRefinementRoot: cx(suit({\n      modifierName: 'noRefinement'\n    }), userCssClasses.noRefinementRoot),\n    list: cx(suit({\n      descendantName: 'list'\n    }), userCssClasses.list),\n    item: cx(suit({\n      descendantName: 'item'\n    }), userCssClasses.item),\n    firstPageItem: cx(suit({\n      descendantName: 'item',\n      modifierName: 'firstPage'\n    }), userCssClasses.firstPageItem),\n    lastPageItem: cx(suit({\n      descendantName: 'item',\n      modifierName: 'lastPage'\n    }), userCssClasses.lastPageItem),\n    previousPageItem: cx(suit({\n      descendantName: 'item',\n      modifierName: 'previousPage'\n    }), userCssClasses.previousPageItem),\n    nextPageItem: cx(suit({\n      descendantName: 'item',\n      modifierName: 'nextPage'\n    }), userCssClasses.nextPageItem),\n    pageItem: cx(suit({\n      descendantName: 'item',\n      modifierName: 'page'\n    }), userCssClasses.pageItem),\n    selectedItem: cx(suit({\n      descendantName: 'item',\n      modifierName: 'selected'\n    }), userCssClasses.selectedItem),\n    disabledItem: cx(suit({\n      descendantName: 'item',\n      modifierName: 'disabled'\n    }), userCssClasses.disabledItem),\n    link: cx(suit({\n      descendantName: 'link'\n    }), userCssClasses.link)\n  };\n  var templates = _objectSpread(_objectSpread({}, defaultTemplates), userTemplates);\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    templates: templates,\n    showFirst: showFirst,\n    showLast: showLast,\n    showPrevious: showPrevious,\n    showNext: showNext,\n    scrollToNode: scrollToNode\n  });\n  var makeWidget = connectPagination(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    totalPages: totalPages,\n    padding: padding\n  })), {}, {\n    $$widgetType: 'ais.pagination'\n  });\n};\nexport default pagination;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/panel/panel.d.ts",
    "content": "\nimport type { Template, RenderOptions, WidgetFactory, InitOptions, Widget } from '../../types';\nexport type PanelCSSClasses = Partial<{\n    /**\n     * CSS classes to add to the root element of the widget.\n     */\n    root: string | string[];\n    /**\n     * CSS classes to add to the root element of the widget when there's no refinements.\n     */\n    noRefinementRoot: string | string[];\n    /**\n     * CSS classes to add to the root element when collapsible (`collapse` is defined).\n     */\n    collapsibleRoot: string | string[];\n    /**\n     * CSS classes to add to the root element when collapsed.\n     */\n    collapsedRoot: string | string[];\n    /**\n     * CSS classes to add to the collapse button element.\n     */\n    collapseButton: string | string[];\n    /**\n     * CSS classes to add to the collapse icon of the button.\n     */\n    collapseIcon: string | string[];\n    /**\n     * CSS classes to add to the header.\n     */\n    header: string | string[];\n    /**\n     * CSS classes to add to the body.\n     */\n    body: string | string[];\n    /**\n     * CSS classes to add to the footer.\n     */\n    footer: string | string[];\n}>;\ntype AnyWidgetFactory = WidgetFactory<{\n    $$type: string;\n}, Record<string, any>, any>;\nexport type PanelTemplates<TWidget extends AnyWidgetFactory> = Partial<{\n    /**\n     * Template to use for the header.\n     */\n    header: Template<PanelRenderOptions<TWidget>>;\n    /**\n     * Template to use for the footer.\n     */\n    footer: Template<PanelRenderOptions<TWidget>>;\n    /**\n     * Template to use for collapse button.\n     */\n    collapseButtonText: Template<{\n        collapsed: boolean;\n    }>;\n}>;\ntype GetWidgetRenderState<TWidgetFactory extends AnyWidgetFactory> = ReturnType<TWidgetFactory>['getWidgetRenderState'] extends (renderOptions: any) => infer TRenderState ? TRenderState extends Record<string, unknown> ? TRenderState : never : Record<string, unknown>;\nexport type PanelRenderOptions<TWidgetFactory extends AnyWidgetFactory> = RenderOptions & GetWidgetRenderState<TWidgetFactory>;\nexport type PanelSharedOptions<TWidgetFactory extends AnyWidgetFactory> = (InitOptions | RenderOptions) & GetWidgetRenderState<TWidgetFactory>;\nexport type PanelWidgetParams<TWidgetFactory extends AnyWidgetFactory> = {\n    /**\n     * A function that is called on each render to determine if the\n     * panel should be hidden based on the render options.\n     */\n    hidden?: (options: PanelRenderOptions<TWidgetFactory>) => boolean;\n    /**\n     * A function that is called on each render to determine if the\n     * panel should be collapsed based on the render options.\n     */\n    collapsed?: (options: PanelRenderOptions<TWidgetFactory>) => boolean;\n    /**\n     * The templates to use for the widget.\n     */\n    templates?: PanelTemplates<TWidgetFactory>;\n    /**\n     * The CSS classes to override.\n     */\n    cssClasses?: PanelCSSClasses;\n};\ntype AugmentedWidget<TWidgetFactory extends AnyWidgetFactory, TOverriddenKeys extends keyof Widget = 'init' | 'render' | 'dispose'> = Omit<ReturnType<TWidgetFactory>, TOverriddenKeys | 'dependsOn' | 'getWidgetParameters'> & Pick<Required<Widget>, TOverriddenKeys>;\nexport type PanelWidget = <TWidgetFactory extends AnyWidgetFactory>(panelWidgetParams?: PanelWidgetParams<TWidgetFactory>) => (widgetFactory: TWidgetFactory) => (widgetParams: Parameters<TWidgetFactory>[0]) => AugmentedWidget<TWidgetFactory>;\n/**\n * The panel widget wraps other widgets in a consistent panel design.\n * It also reacts, indicates and sets CSS classes when widgets are no longer relevant for refining.\n */\ndeclare const panel: PanelWidget;\nexport default panel;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/panel/panel.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport Panel from \"../../components/Panel/Panel.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { createDocumentationMessageGenerator, getContainerNode, getObjectType, warning } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'panel'\n});\nvar suit = component('Panel');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    bodyContainerNode = _ref.bodyContainerNode,\n    cssClasses = _ref.cssClasses,\n    templates = _ref.templates;\n  return function (_ref2) {\n    var options = _ref2.options,\n      hidden = _ref2.hidden,\n      collapsible = _ref2.collapsible,\n      collapsed = _ref2.collapsed;\n    render(h(Panel, {\n      cssClasses: cssClasses,\n      hidden: hidden,\n      collapsible: collapsible,\n      isCollapsed: collapsed,\n      templates: templates,\n      data: options,\n      bodyElement: bodyContainerNode\n    }), containerNode);\n  };\n};\n/**\n * The panel widget wraps other widgets in a consistent panel design.\n * It also reacts, indicates and sets CSS classes when widgets are no longer relevant for refining.\n */\nvar panel = function panel(panelWidgetParams) {\n  var _ref3 = panelWidgetParams || {},\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    _ref3$hidden = _ref3.hidden,\n    hidden = _ref3$hidden === void 0 ? function () {\n      return false;\n    } : _ref3$hidden,\n    collapsed = _ref3.collapsed,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses;\n  process.env.NODE_ENV === 'development' ? warning(typeof hidden === 'function', \"The `hidden` option in the \\\"panel\\\" widget expects a function returning a boolean (received type \".concat(getObjectType(hidden), \").\")) : void 0;\n  process.env.NODE_ENV === 'development' ? warning(typeof collapsed === 'undefined' || typeof collapsed === 'function', \"The `collapsed` option in the \\\"panel\\\" widget expects a function returning a boolean (received type \".concat(getObjectType(collapsed), \").\")) : void 0;\n  var bodyContainerNode = document.createElement('div');\n  var collapsible = Boolean(collapsed);\n  var collapsedFn = typeof collapsed === 'function' ? collapsed : function () {\n    return false;\n  };\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    noRefinementRoot: cx(suit({\n      modifierName: 'noRefinement'\n    }), userCssClasses.noRefinementRoot),\n    collapsibleRoot: cx(suit({\n      modifierName: 'collapsible'\n    }), userCssClasses.collapsibleRoot),\n    collapsedRoot: cx(suit({\n      modifierName: 'collapsed'\n    }), userCssClasses.collapsedRoot),\n    collapseButton: cx(suit({\n      descendantName: 'collapseButton'\n    }), userCssClasses.collapseButton),\n    collapseIcon: cx(suit({\n      descendantName: 'collapseIcon'\n    }), userCssClasses.collapseIcon),\n    body: cx(suit({\n      descendantName: 'body'\n    }), userCssClasses.body),\n    header: cx(suit({\n      descendantName: 'header'\n    }), userCssClasses.header),\n    footer: cx(suit({\n      descendantName: 'footer'\n    }), userCssClasses.footer)\n  };\n  return function (widgetFactory) {\n    return function (widgetParams) {\n      if (!(widgetParams && widgetParams.container)) {\n        throw new Error(withUsage(\"The `container` option is required in the widget within the panel.\"));\n      }\n      var containerNode = getContainerNode(widgetParams.container);\n      var defaultTemplates = {\n        collapseButtonText: function collapseButtonText(_ref4) {\n          var isCollapsed = _ref4.collapsed;\n          return \"<svg\\n          class=\\\"\".concat(cssClasses.collapseIcon, \"\\\"\\n          style=\\\"width: 1em; height: 1em;\\\"\\n          viewBox=\\\"0 0 500 500\\\"\\n        >\\n        <path d=\\\"\").concat(isCollapsed ? 'M100 250l300-150v300z' : 'M250 400l150-300H100z', \"\\\" fill=\\\"currentColor\\\" />\\n        </svg>\");\n        }\n      };\n      var renderPanel = renderer({\n        containerNode: containerNode,\n        bodyContainerNode: bodyContainerNode,\n        cssClasses: cssClasses,\n        templates: _objectSpread(_objectSpread({}, defaultTemplates), templates)\n      });\n      var widget = widgetFactory(_objectSpread(_objectSpread({}, widgetParams), {}, {\n        container: bodyContainerNode\n      }));\n\n      // TypeScript somehow loses track of the ...widget type, since it's\n      // not directly returned. Eventually the \"as AugmentedWidget<typeof widgetFactory>\"\n      // will not be needed anymore.\n      // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n      return _objectSpread(_objectSpread({}, widget), {}, {\n        init: function init() {\n          for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n            args[_key] = arguments[_key];\n          }\n          var renderOptions = args[0];\n          var options = _objectSpread(_objectSpread({}, widget.getWidgetRenderState ? widget.getWidgetRenderState(renderOptions) : {}), renderOptions);\n          renderPanel({\n            options: options,\n            hidden: true,\n            collapsible: collapsible,\n            collapsed: false\n          });\n          if (typeof widget.init === 'function') {\n            var _widget$init;\n            (_widget$init = widget.init).call.apply(_widget$init, [this].concat(args));\n          }\n        },\n        render: function render() {\n          for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n            args[_key2] = arguments[_key2];\n          }\n          var renderOptions = args[0];\n          var options = _objectSpread(_objectSpread({}, widget.getWidgetRenderState ? widget.getWidgetRenderState(renderOptions) : {}), renderOptions);\n          renderPanel({\n            options: options,\n            hidden: Boolean(hidden(options)),\n            collapsible: collapsible,\n            collapsed: Boolean(collapsedFn(options))\n          });\n          if (typeof widget.render === 'function') {\n            var _widget$render;\n            (_widget$render = widget.render).call.apply(_widget$render, [this].concat(args));\n          }\n        },\n        dispose: function dispose() {\n          render(null, containerNode);\n          if (typeof widget.dispose === 'function') {\n            var _widget$dispose;\n            for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n              args[_key3] = arguments[_key3];\n            }\n            return (_widget$dispose = widget.dispose).call.apply(_widget$dispose, [this].concat(args));\n          }\n          return undefined;\n        }\n      });\n    };\n  };\n};\nexport default panel;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/places/places.d.ts",
    "content": "import type { WidgetFactory, WidgetRenderState } from '../../types';\n// @ts-ignore\nimport type * as Places from 'places.js';\ntype StaticOptions = Places.StaticOptions;\ntype PlacesInstance = Places.PlacesInstance;\ntype ReconfigurableOptions = Places.ReconfigurableOptions;\nexport type PlacesWidgetParams = {\n    /**\n     * The Algolia Places reference to use.\n     *\n     * @see https://github.com/algolia/places\n     */\n    placesReference: (options: StaticOptions & ReconfigurableOptions) => PlacesInstance;\n    /**\n     * The default position when the input is empty.\n     */\n    defaultPosition?: string[];\n} & StaticOptions;\nexport type PlacesWidgetDescription = {\n    $$type: 'ais.places';\n    $$widgetType: 'ais.places';\n    renderState: Record<string, unknown>;\n    indexRenderState: {\n        places: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams>;\n    };\n    indexUiState: {\n        places: {\n            query: string;\n            position: string;\n        };\n    };\n};\nexport type PlacesWidget = WidgetFactory<PlacesWidgetDescription, PlacesWidgetParams, PlacesWidgetParams>;\ndeclare const _default: PlacesWidget;\nexport default _default;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/places/places.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _excluded = [\"placesReference\", \"defaultPosition\"],\n  _excluded2 = [\"places\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport { deprecate } from \"../../lib/utils/index.js\";\n\n/* Places.js is an optional dependency, no error should be reported if the package is missing */\n/** @ts-ignore */\n\n// using the type like this requires only one ts-ignore\n\n/**\n * This widget sets the geolocation value for the search based on the selected\n * result in the Algolia Places autocomplete.\n * @deprecated the places service is no longer offered, and this widget will be removed in InstantSearch.js v5\n */\nvar placesWidget = function placesWidget(widgetParams) {\n  var _ref = widgetParams || {},\n    placesReference = _ref.placesReference,\n    _ref$defaultPosition = _ref.defaultPosition,\n    defaultPosition = _ref$defaultPosition === void 0 ? [] : _ref$defaultPosition,\n    placesOptions = _objectWithoutProperties(_ref, _excluded);\n  if (typeof placesReference !== 'function') {\n    throw new Error('The `placesReference` option requires a valid Places.js reference.');\n  }\n  var placesAutocomplete = placesReference(placesOptions);\n  var state = {\n    query: '',\n    initialLatLngViaIP: undefined,\n    isInitialLatLngViaIPSet: false\n  };\n  return {\n    $$type: 'ais.places',\n    $$widgetType: 'ais.places',\n    init: function init(_ref2) {\n      var helper = _ref2.helper;\n      placesAutocomplete.on('change', function (eventOptions) {\n        var _eventOptions$suggest = eventOptions.suggestion,\n          value = _eventOptions$suggest.value,\n          _eventOptions$suggest2 = _eventOptions$suggest.latlng,\n          lat = _eventOptions$suggest2.lat,\n          lng = _eventOptions$suggest2.lng;\n        state.query = value;\n        helper.setQueryParameter('insideBoundingBox', undefined).setQueryParameter('aroundLatLngViaIP', false).setQueryParameter('aroundLatLng', \"\".concat(lat, \",\").concat(lng)).search();\n      });\n      placesAutocomplete.on('clear', function () {\n        state.query = '';\n        helper.setQueryParameter('insideBoundingBox', undefined);\n        if (defaultPosition.length > 1) {\n          helper.setQueryParameter('aroundLatLngViaIP', false).setQueryParameter('aroundLatLng', defaultPosition.join(','));\n        } else {\n          helper.setQueryParameter('aroundLatLngViaIP', state.initialLatLngViaIP).setQueryParameter('aroundLatLng', undefined);\n        }\n        helper.search();\n      });\n    },\n    getWidgetUiState: function getWidgetUiState(uiState, _ref3) {\n      var searchParameters = _ref3.searchParameters;\n      var position = searchParameters.aroundLatLng || defaultPosition.join(',');\n      var hasPositionSet = position !== defaultPosition.join(',');\n      if (!hasPositionSet && !state.query) {\n        var places = uiState.places,\n          uiStateWithoutPlaces = _objectWithoutProperties(uiState, _excluded2);\n        return uiStateWithoutPlaces;\n      }\n      return _objectSpread(_objectSpread({}, uiState), {}, {\n        places: {\n          query: state.query,\n          position: position\n        }\n      });\n    },\n    getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref4) {\n      var uiState = _ref4.uiState;\n      var _ref5 = uiState.places || {},\n        _ref5$query = _ref5.query,\n        query = _ref5$query === void 0 ? '' : _ref5$query,\n        _ref5$position = _ref5.position,\n        position = _ref5$position === void 0 ? defaultPosition.join(',') : _ref5$position;\n      state.query = query;\n      if (!state.isInitialLatLngViaIPSet) {\n        state.isInitialLatLngViaIPSet = true;\n        state.initialLatLngViaIP = searchParameters.aroundLatLngViaIP;\n      }\n      placesAutocomplete.setVal(query);\n      placesAutocomplete.close();\n      return searchParameters.setQueryParameter('insideBoundingBox', undefined).setQueryParameter('aroundLatLngViaIP', false).setQueryParameter('aroundLatLng', position || undefined);\n    },\n    getRenderState: function getRenderState(renderState, renderOptions) {\n      return _objectSpread(_objectSpread({}, renderState), {}, {\n        places: this.getWidgetRenderState(renderOptions)\n      });\n    },\n    getWidgetRenderState: function getWidgetRenderState() {\n      return {\n        widgetParams: widgetParams\n      };\n    }\n  };\n};\nexport default deprecate(placesWidget, 'The places widget is deprecated and will be removed in InstantSearch.js 5.0.');"
  },
  {
    "path": "js/instantsearch.js/es/widgets/powered-by/powered-by.d.ts",
    "content": "\nimport type { PoweredByConnectorParams, PoweredByWidgetDescription } from '../../connectors/powered-by/connectPoweredBy';\nimport type { WidgetFactory } from '../../types';\nexport type PoweredByCSSClasses = Partial<{\n    /**\n     * CSS class to add to the wrapping element.\n     */\n    root: string | string[];\n    /**\n     * CSS class to add to the link.\n     */\n    link: string | string[];\n    /**\n     * CSS class to add to the SVG logo.\n     */\n    logo: string | string[];\n}>;\nexport type PoweredByWidgetParams = {\n    /**\n     * CSS Selector or HTMLElement to insert the widget.\n     */\n    container: string | HTMLElement;\n    /**\n     * The theme of the logo.\n     * @default 'light'\n     */\n    theme?: 'light' | 'dark';\n    /**\n     * CSS classes to add.\n     */\n    cssClasses?: PoweredByCSSClasses;\n};\nexport type PoweredByWidget = WidgetFactory<PoweredByWidgetDescription & {\n    $$widgetType: 'ais.poweredBy';\n}, PoweredByConnectorParams, PoweredByWidgetParams>;\ndeclare const poweredBy: PoweredByWidget;\nexport default poweredBy;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/powered-by/powered-by.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport PoweredBy from \"../../components/PoweredBy/PoweredBy.js\";\nimport connectPoweredBy from \"../../connectors/powered-by/connectPoweredBy.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nvar suit = component('PoweredBy');\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'powered-by'\n});\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses;\n  return function (_ref2, isFirstRendering) {\n    var url = _ref2.url,\n      widgetParams = _ref2.widgetParams;\n    if (isFirstRendering) {\n      var _widgetParams$theme = widgetParams.theme,\n        theme = _widgetParams$theme === void 0 ? 'light' : _widgetParams$theme;\n      render(h(PoweredBy, {\n        cssClasses: cssClasses,\n        url: url,\n        theme: theme\n      }), containerNode);\n      return;\n    }\n  };\n};\nvar poweredBy = function poweredBy(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    _ref3$theme = _ref3.theme,\n    theme = _ref3$theme === void 0 ? 'light' : _ref3$theme;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), suit({\n      modifierName: theme === 'dark' ? 'dark' : 'light'\n    }), userCssClasses.root),\n    link: cx(suit({\n      descendantName: 'link'\n    }), userCssClasses.link),\n    logo: cx(suit({\n      descendantName: 'logo'\n    }), userCssClasses.logo)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses\n  });\n  var makeWidget = connectPoweredBy(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    theme: theme\n  })), {}, {\n    $$widgetType: 'ais.poweredBy'\n  });\n};\nexport default poweredBy;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/query-rule-context/query-rule-context.d.ts",
    "content": "import type { ParamTrackedFilters, ParamTransformRuleContexts, QueryRulesConnectorParams, QueryRulesWidgetDescription } from '../../connectors/query-rules/connectQueryRules';\nimport type { WidgetFactory } from '../../types';\nexport type QueryRuleContextWidgetParams = {\n    trackedFilters: ParamTrackedFilters;\n    transformRuleContexts?: ParamTransformRuleContexts;\n};\nexport type QueryRuleContextWidget = WidgetFactory<QueryRulesWidgetDescription & {\n    $$widgetType: 'ais.queryRuleContext';\n}, QueryRulesConnectorParams, QueryRuleContextWidgetParams>;\ndeclare const queryRuleContext: QueryRuleContextWidget;\nexport default queryRuleContext;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/query-rule-context/query-rule-context.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport connectQueryRules from \"../../connectors/query-rules/connectQueryRules.js\";\nimport { createDocumentationMessageGenerator, noop } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'query-rule-context'\n});\nvar queryRuleContext = function queryRuleContext() {\n  var widgetParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  if (!widgetParams.trackedFilters) {\n    throw new Error(withUsage('The `trackedFilters` option is required.'));\n  }\n  return _objectSpread(_objectSpread({}, connectQueryRules(noop)(widgetParams)), {}, {\n    $$widgetType: 'ais.queryRuleContext'\n  });\n};\nexport default queryRuleContext;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/query-rule-custom-data/query-rule-custom-data.d.ts",
    "content": "\nimport type { QueryRuleCustomDataComponentTemplates } from '../../components/QueryRuleCustomData/QueryRuleCustomData';\nimport type { QueryRulesConnectorParams, QueryRulesWidgetDescription } from '../../connectors/query-rules/connectQueryRules';\nimport type { WidgetFactory, Template } from '../../types';\nexport type QueryRuleCustomDataCSSClasses = Partial<{\n    root: string | string[];\n}>;\nexport type QueryRuleCustomDataTemplates = Partial<{\n    default: Template<{\n        items: any[];\n    }>;\n}>;\nexport type QueryRuleCustomDataWidgetParams = {\n    container: string | HTMLElement;\n    cssClasses?: QueryRuleCustomDataCSSClasses;\n    templates?: QueryRuleCustomDataTemplates;\n};\nexport type QueryRuleCustomDataWidget = WidgetFactory<QueryRulesWidgetDescription & {\n    $$widgetType: 'ais.queryRuleCustomData';\n}, QueryRulesConnectorParams, QueryRuleCustomDataWidgetParams>;\nexport declare const defaultTemplates: QueryRuleCustomDataComponentTemplates;\ndeclare const queryRuleCustomData: QueryRuleCustomDataWidget;\nexport default queryRuleCustomData;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/query-rule-custom-data/query-rule-custom-data.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport CustomData from \"../../components/QueryRuleCustomData/QueryRuleCustomData.js\";\nimport connectQueryRules from \"../../connectors/query-rules/connectQueryRules.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nexport var defaultTemplates = {\n  default: function _default(_ref) {\n    var items = _ref.items;\n    return JSON.stringify(items, null, 2);\n  }\n};\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'query-rule-custom-data'\n});\nvar suit = component('QueryRuleCustomData');\nvar renderer = function renderer(_ref2) {\n  var containerNode = _ref2.containerNode,\n    cssClasses = _ref2.cssClasses,\n    templates = _ref2.templates;\n  return function (_ref3) {\n    var items = _ref3.items;\n    render(h(CustomData, {\n      cssClasses: cssClasses,\n      templates: templates,\n      items: items\n    }), containerNode);\n  };\n};\nvar queryRuleCustomData = function queryRuleCustomData(widgetParams) {\n  var _ref4 = widgetParams || {},\n    container = _ref4.container,\n    _ref4$cssClasses = _ref4.cssClasses,\n    userCssClasses = _ref4$cssClasses === void 0 ? {} : _ref4$cssClasses,\n    _ref4$templates = _ref4.templates,\n    userTemplates = _ref4$templates === void 0 ? {} : _ref4$templates,\n    _ref4$transformItems = _ref4.transformItems,\n    transformItems = _ref4$transformItems === void 0 ? function (items) {\n      return items;\n    } : _ref4$transformItems;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root)\n  };\n  var containerNode = getContainerNode(container);\n  var templates = _objectSpread(_objectSpread({}, defaultTemplates), userTemplates);\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = connectQueryRules(specializedRenderer, function () {\n    render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.queryRuleCustomData'\n  });\n};\nexport default queryRuleCustomData;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/range-input/range-input.d.ts",
    "content": "\nimport type { RangeConnectorParams, RangeWidgetDescription } from '../../connectors/range/connectRange';\nimport type { Template, WidgetFactory } from '../../types';\nexport type RangeInputTemplates = Partial<{\n    /**\n     * The label of the separator, between min and max.\n     * @default \"to\"\n     */\n    separatorText: Template;\n    /**\n     * The label of the submit button\n     * @default \"Go\"\n     */\n    submitText: Template;\n}>;\nexport type RangeInputCSSClasses = Partial<{\n    /**\n     * CSS class to add to the root element.\n     */\n    root: string | string[];\n    /**\n     * CSS class to add to the root element when there's no refinements.\n     */\n    noRefinement: string | string[];\n    /**\n     * CSS class to add to the form element.\n     */\n    form: string | string[];\n    /**\n     * CSS class to add to the label element.\n     */\n    label: string | string[];\n    /**\n     * CSS class to add to the input element.\n     */\n    input: string | string[];\n    /**\n     * CSS class to add to the min input element.\n     */\n    inputMin: string | string[];\n    /**\n     * CSS class to add to the max input element.\n     */\n    separator: string | string[];\n    /**\n     * CSS class to add to the separator of the form.\n     */\n    inputMax: string | string[];\n    /**\n     * CSS class to add to the submit button of the form.\n     */\n    submit: string | string[];\n}>;\nexport type RangeInputWidgetParams = {\n    /**\n     * Valid CSS Selector as a string or DOMElement.\n     */\n    container: string | HTMLElement;\n    /**\n     * Name of the attribute for faceting.\n     */\n    attribute: string;\n    /**\n     * Minimal slider value, default to automatically computed from the result set.\n     */\n    min?: number;\n    /**\n     * Maximal slider value, defaults to automatically computed from the result set.\n     */\n    max?: number;\n    /**\n     * Number of digits after decimal point to use.\n     * @default 0\n     */\n    precision?: number;\n    /**\n     * Labels to use for the widget.\n     */\n    templates?: RangeInputTemplates;\n    /**\n     * CSS classes to add.\n     */\n    cssClasses?: RangeInputCSSClasses;\n};\nexport type RangeInputWidget = WidgetFactory<Omit<RangeWidgetDescription, '$$type'> & {\n    $$widgetType: 'ais.rangeInput';\n    $$type: 'ais.rangeInput';\n}, RangeConnectorParams, RangeInputWidgetParams>;\ndeclare const rangeInput: RangeInputWidget;\nexport default rangeInput;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/range-input/range-input.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport RangeInput from \"../../components/RangeInput/RangeInput.js\";\nimport connectRange from \"../../connectors/range/connectRange.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { prepareTemplateProps } from \"../../lib/templating/index.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'range-input'\n});\nvar suit = component('RangeInput');\nvar defaultTemplates = {\n  separatorText: function separatorText() {\n    return 'to';\n  },\n  submitText: function submitText() {\n    return 'Go';\n  }\n};\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    renderState = _ref.renderState,\n    templates = _ref.templates;\n  return function (_ref2, isFirstRendering) {\n    var refine = _ref2.refine,\n      range = _ref2.range,\n      start = _ref2.start,\n      widgetParams = _ref2.widgetParams,\n      instantSearchInstance = _ref2.instantSearchInstance;\n    if (isFirstRendering) {\n      renderState.templateProps = prepareTemplateProps({\n        defaultTemplates: defaultTemplates,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    var rangeMin = range.min,\n      rangeMax = range.max;\n    var _start = _slicedToArray(start, 2),\n      minValue = _start[0],\n      maxValue = _start[1];\n    var step = 1 / Math.pow(10, widgetParams.precision || 0);\n    var values = {\n      min: minValue !== -Infinity && minValue !== rangeMin ? minValue : undefined,\n      max: maxValue !== Infinity && maxValue !== rangeMax ? maxValue : undefined\n    };\n    render(h(RangeInput, {\n      min: rangeMin,\n      max: rangeMax,\n      step: step,\n      values: values,\n      cssClasses: cssClasses,\n      refine: refine,\n      templateProps: renderState.templateProps\n    }), containerNode);\n  };\n};\nvar rangeInput = function rangeInput(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    attribute = _ref3.attribute,\n    min = _ref3.min,\n    max = _ref3.max,\n    _ref3$precision = _ref3.precision,\n    precision = _ref3$precision === void 0 ? 0 : _ref3$precision,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    noRefinement: cx(suit({\n      modifierName: 'noRefinement'\n    })),\n    form: cx(suit({\n      descendantName: 'form'\n    }), userCssClasses.form),\n    label: cx(suit({\n      descendantName: 'label'\n    }), userCssClasses.label),\n    input: cx(suit({\n      descendantName: 'input'\n    }), userCssClasses.input),\n    inputMin: cx(suit({\n      descendantName: 'input',\n      modifierName: 'min'\n    }), userCssClasses.inputMin),\n    inputMax: cx(suit({\n      descendantName: 'input',\n      modifierName: 'max'\n    }), userCssClasses.inputMax),\n    separator: cx(suit({\n      descendantName: 'separator'\n    }), userCssClasses.separator),\n    submit: cx(suit({\n      descendantName: 'submit'\n    }), userCssClasses.submit)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    templates: templates,\n    renderState: {}\n  });\n  var makeWidget = connectRange(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attribute: attribute,\n    min: min,\n    max: max,\n    precision: precision\n  })), {}, {\n    $$type: 'ais.rangeInput',\n    $$widgetType: 'ais.rangeInput'\n  });\n};\nexport default rangeInput;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/range-slider/range-slider.d.ts",
    "content": "\nimport type { RangeConnectorParams, RangeWidgetDescription } from '../../connectors/range/connectRange';\nimport type { WidgetFactory } from '../../types';\nexport type RangeSliderCssClasses = Partial<{\n    /**\n     * CSS class to add to the root element.\n     */\n    root: string | string[];\n    /**\n     * CSS class to add to the disabled root element.\n     */\n    disabledRoot: string | string[];\n}>;\ntype RangeSliderTooltipOptions = {\n    /**\n     * The function takes the raw value as input, and should return\n     * a string for the label that should be used for this value.\n     * @example\n     * { format(rawValue) {return '$' + Math.round(rawValue).toLocaleString() } }\n     */\n    format: (value: number) => string;\n};\nexport type RangeSliderWidgetParams = {\n    /**\n     * CSS Selector or DOMElement to insert the widget.\n     */\n    container: string | HTMLElement;\n    /**\n     * Name of the attribute for faceting.;\n     */\n    attribute: string;\n    /**\n     * Should we show tooltips or not.\n     * The default tooltip will show the raw value.\n     * You can also provide an object with a format function as an attribute.\n     * So that you can format the tooltip display value as you want.\n     * @default true\n     */\n    tooltips?: boolean | RangeSliderTooltipOptions;\n    /**\n     * CSS classes to add to the wrapping elements.\n     */\n    cssClasses?: RangeSliderCssClasses;\n    /**\n     * Show slider pips.\n     * @default true\n     */\n    pips?: boolean;\n    /**\n     * Number of digits after decimal point to use.\n     * @default 0\n     */\n    precision?: number;\n    /**\n     * Every handle move will jump that number of steps.\n     */\n    step?: number;\n    /**\n     * Minimal slider value, default to automatically computed from the result set.\n     */\n    min?: number;\n    /**\n     * Maximal slider value, defaults to automatically computed from the result set.\n     */\n    max?: number;\n};\nexport type RangeSliderWidget = WidgetFactory<Omit<RangeWidgetDescription, '$$type'> & {\n    $$widgetType: 'ais.rangeSlider';\n    $$type: 'ais.rangeSlider';\n}, RangeConnectorParams, RangeSliderWidgetParams>;\n/**\n * The range slider is a widget which provides a user-friendly way to filter the\n * results based on a single numeric range.\n *\n * @requirements\n * The attribute passed to `attribute` must be declared as an\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\n * in your Algolia settings.\n *\n * The values inside this attribute must be JavaScript numbers (not strings).\n */\ndeclare const rangeSlider: RangeSliderWidget;\nexport default rangeSlider;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/range-slider/range-slider.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport Slider from \"../../components/Slider/Slider.js\";\nimport connectRange from \"../../connectors/range/connectRange.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'range-slider'\n});\nvar suit = component('RangeSlider');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    pips = _ref.pips,\n    step = _ref.step,\n    tooltips = _ref.tooltips;\n  return function (_ref2, isFirstRendering) {\n    var refine = _ref2.refine,\n      range = _ref2.range,\n      start = _ref2.start;\n    if (isFirstRendering) {\n      // There's no information at this point, let's render nothing.\n      return;\n    }\n    var minRange = range.min,\n      maxRange = range.max;\n    var _start = _slicedToArray(start, 2),\n      minStart = _start[0],\n      maxStart = _start[1];\n    var minFinite = minStart === -Infinity ? minRange : minStart;\n    var maxFinite = maxStart === Infinity ? maxRange : maxStart;\n\n    // Clamp values to the range for avoid extra rendering & refinement\n    // Should probably be done on the connector side, but we need to stay\n    // backward compatible so we still need to pass [-Infinity, Infinity]\n    var values = [minFinite > maxRange ? maxRange : minFinite, maxFinite < minRange ? minRange : maxFinite];\n    render(h(Slider, {\n      cssClasses: cssClasses,\n      refine: refine,\n      min: minRange,\n      max: maxRange,\n      values: values,\n      tooltips: tooltips,\n      step: step,\n      pips: pips\n    }), containerNode);\n  };\n};\n/**\n * The range slider is a widget which provides a user-friendly way to filter the\n * results based on a single numeric range.\n *\n * @requirements\n * The attribute passed to `attribute` must be declared as an\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\n * in your Algolia settings.\n *\n * The values inside this attribute must be JavaScript numbers (not strings).\n */\nvar rangeSlider = function rangeSlider(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    attribute = _ref3.attribute,\n    min = _ref3.min,\n    max = _ref3.max,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    step = _ref3.step,\n    _ref3$pips = _ref3.pips,\n    pips = _ref3$pips === void 0 ? true : _ref3$pips,\n    _ref3$precision = _ref3.precision,\n    precision = _ref3$precision === void 0 ? 0 : _ref3$precision,\n    _ref3$tooltips = _ref3.tooltips,\n    tooltips = _ref3$tooltips === void 0 ? true : _ref3$tooltips;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    disabledRoot: cx(suit({\n      modifierName: 'disabled'\n    }), userCssClasses.disabledRoot)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    step: step,\n    pips: pips,\n    tooltips: tooltips,\n    cssClasses: cssClasses\n  });\n  var makeWidget = connectRange(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attribute: attribute,\n    min: min,\n    max: max,\n    precision: precision\n  })), {}, {\n    $$type: 'ais.rangeSlider',\n    $$widgetType: 'ais.rangeSlider'\n  });\n};\nexport default rangeSlider;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/rating-menu/defaultTemplates.d.ts",
    "content": "import type { RatingMenuComponentTemplates } from './rating-menu';\ndeclare const defaultTemplates: RatingMenuComponentTemplates;\nexport default defaultTemplates;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/rating-menu/defaultTemplates.js",
    "content": "import { cx } from 'instantsearch-ui-components';\nimport { h } from 'preact';\nimport { formatNumber } from \"../../lib/formatNumber.js\";\nfunction ItemWrapper(_ref) {\n  var children = _ref.children,\n    count = _ref.count,\n    value = _ref.value,\n    url = _ref.url,\n    cssClasses = _ref.cssClasses;\n  if (count) {\n    return h(\"a\", {\n      className: cx(cssClasses.link),\n      \"aria-label\": \"\".concat(value, \" & up\"),\n      href: url\n    }, children);\n  }\n  return h(\"div\", {\n    className: cx(cssClasses.link),\n    \"aria-label\": \"\".concat(value, \" & up\"),\n    disabled: true\n  }, children);\n}\nvar defaultTemplates = {\n  item: function item(_ref2) {\n    var count = _ref2.count,\n      value = _ref2.value,\n      url = _ref2.url,\n      stars = _ref2.stars,\n      cssClasses = _ref2.cssClasses;\n    return h(ItemWrapper, {\n      count: count,\n      value: value,\n      url: url,\n      cssClasses: cssClasses\n    }, stars.map(function (isFull, index) {\n      return h(\"svg\", {\n        key: index,\n        className: cx(cssClasses.starIcon, isFull ? cssClasses.fullStarIcon : cssClasses.emptyStarIcon),\n        \"aria-hidden\": \"true\",\n        width: \"24\",\n        height: \"24\"\n      }, h(\"use\", {\n        xlinkHref: isFull ? '#ais-RatingMenu-starSymbol' : '#ais-RatingMenu-starEmptySymbol'\n      }));\n    }), h(\"span\", {\n      \"aria-hidden\": \"true\",\n      className: cx(cssClasses.label)\n    }, \"& Up\"), count && h(\"span\", {\n      className: cx(cssClasses.count)\n    }, formatNumber(count)));\n  }\n};\nexport default defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/rating-menu/rating-menu.d.ts",
    "content": "\nimport type { RatingMenuWidgetDescription, RatingMenuConnectorParams } from '../../connectors/rating-menu/connectRatingMenu';\nimport type { ComponentCSSClasses, Template, WidgetFactory } from '../../types';\nexport type RatingMenuTemplates = Partial<{\n    /**\n     * Item template, provided with `name`, `count`, `isRefined`, `url` data properties.\n     */\n    item: Template<{\n        name: string;\n        label: string;\n        value: string;\n        count: number;\n        isRefined: boolean;\n        url: string;\n        stars: [boolean, boolean, boolean, boolean, boolean];\n        cssClasses: RatingMenuCSSClasses;\n        attribute?: string;\n        isFromSearch?: boolean;\n    }>;\n}>;\nexport type RatingMenuCSSClasses = Partial<{\n    /**\n     * CSS class to add to the root element.\n     */\n    root: string | string[];\n    /**\n     * CSS class to add to the root element when there's no refinements.\n     */\n    noRefinementRoot: string | string[];\n    /**\n     * CSS class to add to the list element.\n     */\n    list: string | string[];\n    /**\n     * CSS class to add to each item element.\n     */\n    item: string | string[];\n    /**\n     * CSS class to add the selected item element.\n     */\n    selectedItem: string | string[];\n    /**\n     * CSS class to add a disabled item element.\n     */\n    disabledItem: string | string[];\n    /**\n     * CSS class to add to each link element.\n     */\n    link: string | string[];\n    /**\n     * CSS class to add to each star element (when using the default template).\n     */\n    starIcon: string | string[];\n    /**\n     * CSS class to add to each full star element (when using the default template).\n     */\n    fullStarIcon: string | string[];\n    /**\n     * CSS class to add to each empty star element (when using the default template).\n     */\n    emptyStarIcon: string | string[];\n    /**\n     * CSS class to add to each label.\n     */\n    label: string | string[];\n    /**\n     * CSS class to add to each counter.\n     */\n    count: string | string[];\n}>;\nexport type RatingMenuComponentCSSClasses = ComponentCSSClasses<RatingMenuCSSClasses>;\nexport type RatingMenuComponentTemplates = Required<RatingMenuTemplates>;\nexport type RatingMenuWidgetParams = {\n    /**\n     * Place where to insert the widget in your webpage.\n     */\n    container: string | HTMLElement;\n    /**\n     * Name of the attribute in your records that contains the ratings.\n     */\n    attribute: string;\n    /**\n     * The maximum rating value.\n     */\n    max?: number;\n    /**\n     * Templates to use for the widget.\n     */\n    templates?: RatingMenuTemplates;\n    /**\n     * CSS classes to add.\n     */\n    cssClasses?: RatingMenuCSSClasses;\n};\n/**\n * Rating menu is used for displaying grade like filters. The values are normalized within boundaries.\n *\n * The maximum value can be set (with `max`), the minimum is always 0.\n *\n * @requirements\n * The attribute passed to `attribute` must be declared as an\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\n * in your Algolia settings.\n *\n * The values inside this attribute must be JavaScript numbers (not strings).\n *\n * @type {WidgetFactory}\n * @devNovel RatingMenu\n * @category filter\n * @param {RatingMenuWidgetParams} widgetParams RatingMenu widget options.\n * @return {Widget} A new RatingMenu widget instance.\n * @example\n * search.addWidgets([\n *   instantsearch.widgets.ratingMenu({\n *     container: '#stars',\n *     attribute: 'rating',\n *     max: 5,\n *   })\n * ]);\n */\nexport type RatingMenuWidget = WidgetFactory<RatingMenuWidgetDescription & {\n    $$widgetType: 'ais.ratingMenu';\n}, RatingMenuConnectorParams, RatingMenuWidgetParams>;\ndeclare const ratingMenu: RatingMenuWidget;\nexport default ratingMenu;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/rating-menu/rating-menu.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport RefinementList from \"../../components/RefinementList/RefinementList.js\";\nimport connectRatingMenu from \"../../connectors/rating-menu/connectRatingMenu.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { prepareTemplateProps } from \"../../lib/templating/index.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nimport defaultTemplates from \"./defaultTemplates.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'rating-menu'\n});\nvar suit = component('RatingMenu');\nvar _ref3 = h(\"path\", {\n  d: \"M12 .288l2.833 8.718h9.167l-7.417 5.389 2.833 8.718-7.416-5.388-7.417 5.388 2.833-8.718-7.416-5.389h9.167z\"\n});\nvar _ref4 = h(\"path\", {\n  d: \"M12 6.76l1.379 4.246h4.465l-3.612 2.625 1.379 4.246-3.611-2.625-3.612 2.625 1.379-4.246-3.612-2.625h4.465l1.38-4.246zm0-6.472l-2.833 8.718h-9.167l7.416 5.389-2.833 8.718 7.417-5.388 7.416 5.388-2.833-8.718 7.417-5.389h-9.167l-2.833-8.718z\"\n});\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    templates = _ref.templates,\n    renderState = _ref.renderState;\n  return function (_ref2, isFirstRendering) {\n    var refine = _ref2.refine,\n      items = _ref2.items,\n      createURL = _ref2.createURL,\n      instantSearchInstance = _ref2.instantSearchInstance;\n    if (isFirstRendering) {\n      renderState.templateProps = prepareTemplateProps({\n        defaultTemplates: defaultTemplates,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    render(h(RefinementList, {\n      createURL: createURL,\n      cssClasses: cssClasses,\n      facetValues: items,\n      templateProps: renderState.templateProps,\n      toggleRefinement: refine\n    }, h(\"svg\", {\n      style: \"display:none;\"\n    }, h(\"symbol\", {\n      id: suit({\n        descendantName: 'starSymbol'\n      }),\n      viewBox: \"0 0 24 24\"\n    }, _ref3), h(\"symbol\", {\n      id: suit({\n        descendantName: 'starEmptySymbol'\n      }),\n      viewBox: \"0 0 24 24\"\n    }, _ref4))), containerNode);\n  };\n};\n\n/**\n * Rating menu is used for displaying grade like filters. The values are normalized within boundaries.\n *\n * The maximum value can be set (with `max`), the minimum is always 0.\n *\n * @requirements\n * The attribute passed to `attribute` must be declared as an\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\n * in your Algolia settings.\n *\n * The values inside this attribute must be JavaScript numbers (not strings).\n *\n * @type {WidgetFactory}\n * @devNovel RatingMenu\n * @category filter\n * @param {RatingMenuWidgetParams} widgetParams RatingMenu widget options.\n * @return {Widget} A new RatingMenu widget instance.\n * @example\n * search.addWidgets([\n *   instantsearch.widgets.ratingMenu({\n *     container: '#stars',\n *     attribute: 'rating',\n *     max: 5,\n *   })\n * ]);\n */\n\nvar ratingMenu = function ratingMenu(widgetParams) {\n  var _ref5 = widgetParams || {},\n    container = _ref5.container,\n    attribute = _ref5.attribute,\n    _ref5$max = _ref5.max,\n    max = _ref5$max === void 0 ? 5 : _ref5$max,\n    _ref5$cssClasses = _ref5.cssClasses,\n    userCssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses,\n    _ref5$templates = _ref5.templates,\n    templates = _ref5$templates === void 0 ? {} : _ref5$templates;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    noRefinementRoot: cx(suit({\n      modifierName: 'noRefinement'\n    }), userCssClasses.noRefinementRoot),\n    list: cx(suit({\n      descendantName: 'list'\n    }), userCssClasses.list),\n    item: cx(suit({\n      descendantName: 'item'\n    }), userCssClasses.item),\n    selectedItem: cx(suit({\n      descendantName: 'item',\n      modifierName: 'selected'\n    }), userCssClasses.selectedItem),\n    disabledItem: cx(suit({\n      descendantName: 'item',\n      modifierName: 'disabled'\n    }), userCssClasses.disabledItem),\n    link: cx(suit({\n      descendantName: 'link'\n    }), userCssClasses.link),\n    starIcon: cx(suit({\n      descendantName: 'starIcon'\n    }), userCssClasses.starIcon),\n    fullStarIcon: cx(suit({\n      descendantName: 'starIcon',\n      modifierName: 'full'\n    }), userCssClasses.fullStarIcon),\n    emptyStarIcon: cx(suit({\n      descendantName: 'starIcon',\n      modifierName: 'empty'\n    }), userCssClasses.emptyStarIcon),\n    label: cx(suit({\n      descendantName: 'label'\n    }), userCssClasses.label),\n    count: cx(suit({\n      descendantName: 'count'\n    }), userCssClasses.count)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = connectRatingMenu(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attribute: attribute,\n    max: max\n  })), {}, {\n    $$widgetType: 'ais.ratingMenu'\n  });\n};\nexport default ratingMenu;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/refinement-list/defaultTemplates.d.ts",
    "content": "import type { RefinementListComponentTemplates } from './refinement-list';\ndeclare const defaultTemplates: RefinementListComponentTemplates;\nexport default defaultTemplates;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/refinement-list/defaultTemplates.js",
    "content": "import { cx } from 'instantsearch-ui-components';\nimport { h } from 'preact';\nimport { formatNumber } from \"../../lib/formatNumber.js\";\nvar defaultTemplates = {\n  item: function item(_ref) {\n    var cssClasses = _ref.cssClasses,\n      count = _ref.count,\n      value = _ref.value,\n      highlighted = _ref.highlighted,\n      isRefined = _ref.isRefined,\n      isFromSearch = _ref.isFromSearch;\n    return h(\"label\", {\n      className: cx(cssClasses.label)\n    }, h(\"input\", {\n      type: \"checkbox\",\n      className: cx(cssClasses.checkbox),\n      value: value,\n      defaultChecked: isRefined\n    }), h(\"span\", {\n      className: cx(cssClasses.labelText),\n      dangerouslySetInnerHTML: isFromSearch ? {\n        __html: highlighted\n      } : undefined\n    }, !isFromSearch && highlighted), h(\"span\", {\n      className: cx(cssClasses.count)\n    }, formatNumber(count)));\n  },\n  showMoreText: function showMoreText(_ref2) {\n    var isShowingMore = _ref2.isShowingMore;\n    return isShowingMore ? 'Show less' : 'Show more';\n  },\n  searchableNoResults: function searchableNoResults() {\n    return 'No results';\n  }\n};\nexport default defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/refinement-list/refinement-list.d.ts",
    "content": "\nimport type { RefinementListConnectorParams, RefinementListWidgetDescription } from '../../connectors/refinement-list/connectRefinementList';\nimport type { Template, WidgetFactory } from '../../types';\nimport type { SearchBoxTemplates } from '../search-box/search-box';\nexport type RefinementListOwnCSSClasses = Partial<{\n    /**\n     * CSS class to add to the root element.\n     */\n    root: string | string[];\n    /**\n     * CSS class to add to the root element when no refinements.\n     */\n    noRefinementRoot: string | string[];\n    /**\n     * CSS class to add to the root element with no results.\n     */\n    noResults: string | string[];\n    /**\n     * CSS class to add to the list element.\n     */\n    list: string | string[];\n    /**\n     * CSS class to add to each item element.\n     */\n    item: string | string[];\n    /**\n     * CSS class to add to each selected element.\n     */\n    selectedItem: string | string[];\n    /**\n     * CSS class to add to each label element (when using the default template).\n     */\n    label: string | string[];\n    /**\n     * CSS class to add to each checkbox element (when using the default template).\n     */\n    checkbox: string | string[];\n    /**\n     * CSS class to add to each label text element.\n     */\n    labelText: string | string[];\n    /**\n     * CSS class to add to the show more element\n     */\n    showMore: string | string[];\n    /**\n     * CSS class to add to the disabled show more element\n     */\n    disabledShowMore: string | string[];\n    /**\n     * CSS class to add to each count element (when using the default template).\n     */\n    count: string | string[];\n    /**\n     * CSS class to add to the searchable container.\n     */\n    searchBox: string | string[];\n}>;\ntype RefinementListSearchableCSSClasses = Partial<{\n    searchableRoot: string | string[];\n    searchableForm: string | string[];\n    searchableInput: string | string[];\n    searchableSubmit: string | string[];\n    searchableSubmitIcon: string | string[];\n    searchableReset: string | string[];\n    searchableResetIcon: string | string[];\n    searchableLoadingIndicator: string | string[];\n    searchableLoadingIcon: string | string[];\n}>;\nexport type RefinementListCSSClasses = RefinementListOwnCSSClasses & RefinementListSearchableCSSClasses;\nexport type RefinementListItemData = {\n    /**\n     * The number of occurrences of the facet in the result set.\n     */\n    count: number;\n    /**\n     * True if the value is selected.\n     */\n    isRefined: boolean;\n    /**\n     * The label to display.\n     */\n    label: string;\n    /**\n     * The value used for refining.\n     */\n    value: string;\n    /**\n     * The label highlighted (when using search for facet values). This value is displayed in the default template.\n     */\n    highlighted: string;\n    /**\n     * The url with this refinement selected.\n     */\n    url: string;\n    /**\n     * Object containing all the classes computed for the item.\n     */\n    cssClasses: RefinementListCSSClasses;\n    /**\n     * Whether the `items` prop contains facet values from the global search or from the search inside the items.\n     */\n    isFromSearch: boolean;\n};\nexport type RefinementListOwnTemplates = Partial<{\n    /**\n     * Item template, provided with `label`, `highlighted`, `value`, `count`, `isRefined`, `url` data properties.\n     */\n    item: Template<RefinementListItemData>;\n    /**\n     * Template used for the show more text, provided with `isShowingMore` data property.\n     */\n    showMoreText: Template<{\n        isShowingMore: boolean;\n    }>;\n    /**\n     * Templates to use for search for facet values when there are no results.\n     */\n    searchableNoResults: Template;\n}>;\ntype RefinementListSearchableTemplates = Partial<{\n    /**\n     * Templates to use for search for facet values submit button.\n     */\n    searchableSubmit: SearchBoxTemplates['submit'];\n    /**\n     * Templates to use for search for facet values reset button.\n     */\n    searchableReset: SearchBoxTemplates['reset'];\n    /**\n     * Templates to use for the search for facet values loading indicator.\n     */\n    searchableLoadingIndicator: SearchBoxTemplates['loadingIndicator'];\n}>;\nexport type RefinementListTemplates = RefinementListOwnTemplates & RefinementListSearchableTemplates;\nexport type RefinementListComponentTemplates = Required<RefinementListOwnTemplates>;\nexport type RefinementListWidgetParams = {\n    /**\n     * CSS Selector or HTMLElement to insert the widget.\n     */\n    container: string | HTMLElement;\n    /**\n     * Add a search input to let the user search for more facet values. In order\n     * to make this feature work, you need to make the attribute searchable\n     * [using the API](https://www.algolia.com/doc/guides/searching/faceting/?language=js#declaring-a-searchable-attribute-for-faceting)\n     * or [the dashboard](https://www.algolia.com/explorer/display/)\n     */\n    searchable?: boolean;\n    /**\n     * Value of the search field placeholder.\n     */\n    searchablePlaceholder?: string;\n    /**\n     * When `false` the search field will become disabled if there are less items\n     * to display than the `options.limit`, otherwise the search field is always usable.\n     */\n    searchableIsAlwaysActive?: boolean;\n    /**\n     * When activated, it will escape the facet values that are returned from Algolia.\n     * In this case, the surrounding tags will always be `<mark></mark>`.\n     */\n    searchableEscapeFacetValues?: boolean;\n    /**\n     * Templates to use for the widget.\n     */\n    templates?: RefinementListTemplates;\n    /**\n     * CSS classes to add to the wrapping elements.\n     */\n    cssClasses?: RefinementListCSSClasses;\n};\nexport type RefinementListWidget = WidgetFactory<RefinementListWidgetDescription & {\n    $$widgetType: 'ais.refinementList';\n}, RefinementListConnectorParams, RefinementListWidgetParams>;\n/**\n * The refinement list widget is one of the most common widget that you can find\n * in a search UI. With this widget, the user can filter the dataset based on facets.\n *\n * The refinement list displays only the most relevant facets for the current search\n * context. The sort option only affects the facet that are returned by the engine,\n * not which facets are returned.\n *\n * This widget also implements search for facet values, which is a mini search inside the\n * values of the facets. This makes easy to deal with uncommon facet values.\n *\n * @requirements\n *\n * The attribute passed to `attribute` must be declared as an\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\n * in your Algolia settings.\n *\n * If you also want to use search for facet values on this attribute, you need to make it searchable using the [dashboard](https://www.algolia.com/explorer/display/) or using the [API](https://www.algolia.com/doc/guides/searching/faceting/#search-for-facet-values).\n */\ndeclare const refinementList: RefinementListWidget;\nexport default refinementList;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/refinement-list/refinement-list.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport RefinementList from \"../../components/RefinementList/RefinementList.js\";\nimport connectRefinementList from \"../../connectors/refinement-list/connectRefinementList.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { prepareTemplateProps } from \"../../lib/templating/index.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nimport searchBoxDefaultTemplates from \"../search-box/defaultTemplates.js\";\nimport defaultTemplates from \"./defaultTemplates.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'refinement-list'\n});\nvar suit = component('RefinementList');\nvar searchBoxSuit = component('SearchBox');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    templates = _ref.templates,\n    searchBoxTemplates = _ref.searchBoxTemplates,\n    renderState = _ref.renderState,\n    showMore = _ref.showMore,\n    searchable = _ref.searchable,\n    searchablePlaceholder = _ref.searchablePlaceholder,\n    searchableIsAlwaysActive = _ref.searchableIsAlwaysActive;\n  return function (_ref2, isFirstRendering) {\n    var refine = _ref2.refine,\n      items = _ref2.items,\n      createURL = _ref2.createURL,\n      searchForItems = _ref2.searchForItems,\n      isFromSearch = _ref2.isFromSearch,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      toggleShowMore = _ref2.toggleShowMore,\n      isShowingMore = _ref2.isShowingMore,\n      hasExhaustiveItems = _ref2.hasExhaustiveItems,\n      canToggleShowMore = _ref2.canToggleShowMore;\n    if (isFirstRendering) {\n      renderState.templateProps = prepareTemplateProps({\n        defaultTemplates: defaultTemplates,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      renderState.searchBoxTemplateProps = prepareTemplateProps({\n        defaultTemplates: searchBoxDefaultTemplates,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: searchBoxTemplates\n      });\n      return;\n    }\n    render(h(RefinementList, {\n      createURL: createURL,\n      cssClasses: cssClasses,\n      facetValues: items,\n      templateProps: renderState.templateProps,\n      searchBoxTemplateProps: renderState.searchBoxTemplateProps,\n      toggleRefinement: refine,\n      searchFacetValues: searchable ? searchForItems : undefined,\n      searchPlaceholder: searchablePlaceholder,\n      searchIsAlwaysActive: searchableIsAlwaysActive,\n      isFromSearch: isFromSearch,\n      showMore: showMore && !isFromSearch && items.length > 0,\n      toggleShowMore: toggleShowMore,\n      isShowingMore: isShowingMore,\n      hasExhaustiveItems: hasExhaustiveItems,\n      canToggleShowMore: canToggleShowMore\n    }), containerNode);\n  };\n};\n/**\n * The refinement list widget is one of the most common widget that you can find\n * in a search UI. With this widget, the user can filter the dataset based on facets.\n *\n * The refinement list displays only the most relevant facets for the current search\n * context. The sort option only affects the facet that are returned by the engine,\n * not which facets are returned.\n *\n * This widget also implements search for facet values, which is a mini search inside the\n * values of the facets. This makes easy to deal with uncommon facet values.\n *\n * @requirements\n *\n * The attribute passed to `attribute` must be declared as an\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\n * in your Algolia settings.\n *\n * If you also want to use search for facet values on this attribute, you need to make it searchable using the [dashboard](https://www.algolia.com/explorer/display/) or using the [API](https://www.algolia.com/doc/guides/searching/faceting/#search-for-facet-values).\n */\nvar refinementList = function refinementList(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    attribute = _ref3.attribute,\n    operator = _ref3.operator,\n    sortBy = _ref3.sortBy,\n    limit = _ref3.limit,\n    showMore = _ref3.showMore,\n    showMoreLimit = _ref3.showMoreLimit,\n    _ref3$searchable = _ref3.searchable,\n    searchable = _ref3$searchable === void 0 ? false : _ref3$searchable,\n    _ref3$searchablePlace = _ref3.searchablePlaceholder,\n    searchablePlaceholder = _ref3$searchablePlace === void 0 ? 'Search...' : _ref3$searchablePlace,\n    _ref3$searchableEscap = _ref3.searchableEscapeFacetValues,\n    searchableEscapeFacetValues = _ref3$searchableEscap === void 0 ? true : _ref3$searchableEscap,\n    _ref3$searchableIsAlw = _ref3.searchableIsAlwaysActive,\n    searchableIsAlwaysActive = _ref3$searchableIsAlw === void 0 ? true : _ref3$searchableIsAlw,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    transformItems = _ref3.transformItems;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var escapeFacetValues = searchable ? Boolean(searchableEscapeFacetValues) : false;\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    noRefinementRoot: cx(suit({\n      modifierName: 'noRefinement'\n    }), userCssClasses.noRefinementRoot),\n    list: cx(suit({\n      descendantName: 'list'\n    }), userCssClasses.list),\n    item: cx(suit({\n      descendantName: 'item'\n    }), userCssClasses.item),\n    selectedItem: cx(suit({\n      descendantName: 'item',\n      modifierName: 'selected'\n    }), userCssClasses.selectedItem),\n    searchBox: cx(suit({\n      descendantName: 'searchBox'\n    }), userCssClasses.searchBox),\n    label: cx(suit({\n      descendantName: 'label'\n    }), userCssClasses.label),\n    checkbox: cx(suit({\n      descendantName: 'checkbox'\n    }), userCssClasses.checkbox),\n    labelText: cx(suit({\n      descendantName: 'labelText'\n    }), userCssClasses.labelText),\n    count: cx(suit({\n      descendantName: 'count'\n    }), userCssClasses.count),\n    noResults: cx(suit({\n      descendantName: 'noResults'\n    }), userCssClasses.noResults),\n    showMore: cx(suit({\n      descendantName: 'showMore'\n    }), userCssClasses.showMore),\n    disabledShowMore: cx(suit({\n      descendantName: 'showMore',\n      modifierName: 'disabled'\n    }), userCssClasses.disabledShowMore),\n    searchable: {\n      root: cx(searchBoxSuit(), userCssClasses.searchableRoot),\n      form: cx(searchBoxSuit({\n        descendantName: 'form'\n      }), userCssClasses.searchableForm),\n      input: cx(searchBoxSuit({\n        descendantName: 'input'\n      }), userCssClasses.searchableInput),\n      submit: cx(searchBoxSuit({\n        descendantName: 'submit'\n      }), userCssClasses.searchableSubmit),\n      submitIcon: cx(searchBoxSuit({\n        descendantName: 'submitIcon'\n      }), userCssClasses.searchableSubmitIcon),\n      reset: cx(searchBoxSuit({\n        descendantName: 'reset'\n      }), userCssClasses.searchableReset),\n      resetIcon: cx(searchBoxSuit({\n        descendantName: 'resetIcon'\n      }), userCssClasses.searchableResetIcon),\n      loadingIndicator: cx(searchBoxSuit({\n        descendantName: 'loadingIndicator'\n      }), userCssClasses.searchableLoadingIndicator),\n      loadingIcon: cx(searchBoxSuit({\n        descendantName: 'loadingIcon'\n      }), userCssClasses.searchableLoadingIcon)\n    }\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    templates: templates,\n    searchBoxTemplates: {\n      submit: templates.searchableSubmit,\n      reset: templates.searchableReset,\n      loadingIndicator: templates.searchableLoadingIndicator\n    },\n    renderState: {},\n    searchable: searchable,\n    searchablePlaceholder: searchablePlaceholder,\n    searchableIsAlwaysActive: searchableIsAlwaysActive,\n    showMore: showMore\n  });\n  var makeWidget = connectRefinementList(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attribute: attribute,\n    operator: operator,\n    limit: limit,\n    showMore: showMore,\n    showMoreLimit: showMoreLimit,\n    sortBy: sortBy,\n    escapeFacetValues: escapeFacetValues,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.refinementList'\n  });\n};\nexport default refinementList;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/related-products/related-products.d.ts",
    "content": "\nimport type { RelatedProductsWidgetDescription, RelatedProductsConnectorParams } from '../../connectors/related-products/connectRelatedProducts';\nimport type { Template, WidgetFactory, Hit, BaseHit, RecommendResponse, TemplateWithBindEvent } from '../../types';\nimport type { RecommendClassNames, RelatedProductsProps as RelatedProductsUiProps } from 'instantsearch-ui-components';\nexport type RelatedProductsCSSClasses = Partial<RecommendClassNames>;\nexport type RelatedProductsTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\n    /**\n     * Template to use when there are no results.\n     */\n    empty: Template<RecommendResponse<Hit<THit>>>;\n    /**\n     * Template to use for the header of the widget.\n     */\n    header: Template<Pick<Parameters<NonNullable<RelatedProductsUiProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {\n        cssClasses: RecommendClassNames;\n    }>;\n    /**\n     * Template to use for each result. This template will receive an object containing a single record.\n     */\n    item: TemplateWithBindEvent<Hit<THit>>;\n    /**\n     * Template to use to wrap all items.\n     */\n    layout: Template<Pick<Parameters<NonNullable<RelatedProductsUiProps<Hit<THit>>['layout']>>[0], 'items'> & {\n        templates: {\n            item: RelatedProductsUiProps<Hit<THit>>['itemComponent'];\n        };\n        cssClasses: Pick<RelatedProductsCSSClasses, 'list' | 'item'>;\n    }>;\n}>;\ntype RelatedProductsWidgetParams<THit extends NonNullable<object> = BaseHit> = {\n    /**\n     * CSS selector or `HTMLElement` to insert the widget into.\n     */\n    container: string | HTMLElement;\n    /**\n     * Templates to customize the widget.\n     */\n    templates?: RelatedProductsTemplates<THit>;\n    /**\n     * CSS classes to add to the widget elements.\n     */\n    cssClasses?: RelatedProductsCSSClasses;\n};\nexport type RelatedProductsWidget = WidgetFactory<RelatedProductsWidgetDescription & {\n    $$widgetType: 'ais.relatedProducts';\n}, RelatedProductsConnectorParams, RelatedProductsWidgetParams>;\ndeclare const _default: <THit extends NonNullable<object> = BaseHit>(widgetParams: RelatedProductsWidgetParams<THit> & RelatedProductsConnectorParams<THit>) => {\n    $$widgetType: \"ais.relatedProducts\";\n    dependsOn: \"recommend\";\n    $$type: \"ais.relatedProducts\";\n    init(initOptions: import(\"../../types\").InitOptions): void;\n    render(renderOptions: import(\"../../types\").RenderOptions): void;\n    getRenderState(renderState: {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/answers/connectAnswers\").AnswersRenderState, import(\"../../connectors/answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/configure/connectConfigure\").ConfigureRenderState, import(\"../../connectors/configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits/connectHits\").HitsRenderState<BaseHit>, import(\"../../connectors/hits/connectHits\").HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/menu/connectMenu\").MenuRenderState, import(\"../../connectors/menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/pagination/connectPagination\").PaginationRenderState, import(\"../../connectors/pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/range/connectRange\").RangeRenderState, import(\"../../connectors/range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/search-box/connectSearchBox\").SearchBoxRenderState, import(\"../../connectors/search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/sort-by/connectSortBy\").SortByRenderState, import(\"../../connectors/sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/stats/connectStats\").StatsRenderState, import(\"../../connectors/stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../places/places\").PlacesWidgetParams> | undefined;\n    }): {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/answers/connectAnswers\").AnswersRenderState, import(\"../../connectors/answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/configure/connectConfigure\").ConfigureRenderState, import(\"../../connectors/configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits/connectHits\").HitsRenderState<BaseHit>, import(\"../../connectors/hits/connectHits\").HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/menu/connectMenu\").MenuRenderState, import(\"../../connectors/menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/pagination/connectPagination\").PaginationRenderState, import(\"../../connectors/pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/range/connectRange\").RangeRenderState, import(\"../../connectors/range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/search-box/connectSearchBox\").SearchBoxRenderState, import(\"../../connectors/search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/sort-by/connectSortBy\").SortByRenderState, import(\"../../connectors/sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/stats/connectStats\").StatsRenderState, import(\"../../connectors/stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../places/places\").PlacesWidgetParams> | undefined;\n    };\n    getWidgetRenderState({ results, helper, instantSearchInstance }: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions | ({\n        instantSearchInstance: import(\"../../types\").InstantSearch;\n        parent: import(\"../index\").IndexWidget;\n        templatesConfig: Record<string, unknown>;\n        scopedResults: import(\"../../types\").ScopedResult[];\n        state: import(\"algoliasearch-helper\").SearchParameters;\n        renderState: Partial<{\n            answers: import(\"../../types\").WidgetRenderState<import(\"../../connectors/answers/connectAnswers\").AnswersRenderState, import(\"../../connectors/answers/connectAnswers\").AnswersConnectorParams>;\n        } & {\n            autocomplete: import(\"../../types\").WidgetRenderState<import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteConnectorParams>;\n        } & {\n            breadcrumb: {\n                [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n            };\n        } & {\n            clearRefinements: import(\"../../types\").WidgetRenderState<import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams>;\n        } & {\n            configure: import(\"../../types\").WidgetRenderState<import(\"../../connectors/configure/connectConfigure\").ConfigureRenderState, import(\"../../connectors/configure/connectConfigure\").ConfigureConnectorParams>;\n        } & {\n            currentRefinements: import(\"../../types\").WidgetRenderState<import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams>;\n        } & {\n            geoSearch: import(\"../../types\").WidgetRenderState<import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>>;\n        } & {\n            hierarchicalMenu: {\n                [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n            };\n        } & {\n            hits: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits/connectHits\").HitsRenderState<BaseHit>, import(\"../../connectors/hits/connectHits\").HitsConnectorParams<BaseHit>>;\n        } & {\n            hitsPerPage: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams>;\n        } & {\n            infiniteHits: import(\"../../types\").WidgetRenderState<import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>>;\n        } & {\n            menu: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/menu/connectMenu\").MenuRenderState, import(\"../../connectors/menu/connectMenu\").MenuConnectorParams>;\n            };\n        } & {\n            numericMenu: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n            };\n        } & {\n            pagination: import(\"../../types\").WidgetRenderState<import(\"../../connectors/pagination/connectPagination\").PaginationRenderState, import(\"../../connectors/pagination/connectPagination\").PaginationConnectorParams>;\n        } & {\n            poweredBy: import(\"../../types\").WidgetRenderState<import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByConnectorParams>;\n        } & {\n            queryRules: import(\"../../types\").WidgetRenderState<import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesConnectorParams>;\n        } & {\n            range: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/range/connectRange\").RangeRenderState, import(\"../../connectors/range/connectRange\").RangeConnectorParams>;\n            };\n        } & {\n            ratingMenu: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n            };\n        } & {\n            refinementList: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n            };\n        } & {\n            relevantSort: import(\"../../types\").WidgetRenderState<import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortConnectorParams>;\n        } & {\n            searchBox: import(\"../../types\").WidgetRenderState<import(\"../../connectors/search-box/connectSearchBox\").SearchBoxRenderState, import(\"../../connectors/search-box/connectSearchBox\").SearchBoxConnectorParams>;\n        } & {\n            sortBy: import(\"../../types\").WidgetRenderState<import(\"../../connectors/sort-by/connectSortBy\").SortByRenderState, import(\"../../connectors/sort-by/connectSortBy\").SortByConnectorParams>;\n        } & {\n            stats: import(\"../../types\").WidgetRenderState<import(\"../../connectors/stats/connectStats\").StatsRenderState, import(\"../../connectors/stats/connectStats\").StatsConnectorParams>;\n        } & {\n            toggleRefinement: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n            };\n        } & {\n            voiceSearch: import(\"../../types\").WidgetRenderState<import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchConnectorParams>;\n        } & {\n            analytics: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../analytics/analytics\").AnalyticsWidgetParams>;\n        } & {\n            places: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../places/places\").PlacesWidgetParams>;\n        }>;\n        helper: import(\"algoliasearch-helper\").AlgoliaSearchHelper;\n        searchMetadata: {\n            isSearchStalled: boolean;\n        };\n        status: import(\"../../types\").InstantSearch[\"status\"];\n        error: import(\"../../types\").InstantSearch[\"error\"];\n        createURL: (nextState: import(\"algoliasearch-helper\").SearchParameters | ((state: import(\"../../types\").IndexUiState) => import(\"../../types\").IndexUiState)) => string;\n    } & {\n        results: RecommendResponse<any>;\n    })): {\n        items: Hit<BaseHit>[] | Hit<THit>[];\n        widgetParams: Partial<RelatedProductsWidgetParams<BaseHit>> & RelatedProductsConnectorParams<THit>;\n        sendEvent: import(\"../../lib/utils\").SendEventForHits;\n    };\n    dispose({ recommendState }: import(\"../../types\").DisposeOptions): import(\"algoliasearch-helper\").RecommendParameters;\n    getWidgetParameters(state: import(\"algoliasearch-helper\").RecommendParameters): import(\"algoliasearch-helper\").RecommendParameters;\n};\nexport default _default;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/related-products/related-products.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _excluded = [\"item\", \"sendEvent\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport { createRelatedProductsComponent } from 'instantsearch-ui-components';\nimport { Fragment, h, render } from 'preact';\nimport TemplateComponent from \"../../components/Template/Template.js\";\nimport connectRelatedProducts from \"../../connectors/related-products/connectRelatedProducts.js\";\nimport { prepareTemplateProps } from \"../../lib/templating/index.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'related-products'\n});\nvar RelatedProducts = createRelatedProductsComponent({\n  createElement: h,\n  Fragment: Fragment\n});\nfunction createRenderer(_ref) {\n  var renderState = _ref.renderState,\n    cssClasses = _ref.cssClasses,\n    containerNode = _ref.containerNode,\n    templates = _ref.templates;\n  return function renderer(_ref2, isFirstRendering) {\n    var items = _ref2.items,\n      results = _ref2.results,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      sendEvent = _ref2.sendEvent;\n    if (isFirstRendering) {\n      renderState.templateProps = prepareTemplateProps({\n        defaultTemplates: {},\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    var headerComponent = templates.header ? function (data) {\n      return h(TemplateComponent, _extends({}, renderState.templateProps, {\n        templateKey: \"header\",\n        rootTagName: \"fragment\",\n        data: {\n          cssClasses: data.classNames,\n          items: data.items\n        }\n      }));\n    } : undefined;\n    var itemComponent = templates.item ? function (_ref3) {\n      var item = _ref3.item,\n        _sendEvent = _ref3.sendEvent,\n        rootProps = _objectWithoutProperties(_ref3, _excluded);\n      return h(TemplateComponent, _extends({}, renderState.templateProps, {\n        templateKey: \"item\",\n        rootTagName: \"fragment\",\n        data: item,\n        sendEvent: _sendEvent,\n        rootProps: _objectSpread({}, rootProps)\n      }));\n    } : undefined;\n    var emptyComponent = templates.empty ? function () {\n      return h(TemplateComponent, _extends({}, renderState.templateProps, {\n        templateKey: \"empty\",\n        rootTagName: \"fragment\",\n        data: results\n      }));\n    } : undefined;\n    var layoutComponent = templates.layout ? function (data) {\n      return h(TemplateComponent, _extends({}, renderState.templateProps, {\n        templateKey: \"layout\",\n        rootTagName: \"fragment\",\n        data: {\n          sendEvent: sendEvent,\n          items: data.items,\n          templates: {\n            item: templates.item ? function (_ref4) {\n              var item = _ref4.item;\n              return h(TemplateComponent, _extends({}, renderState.templateProps, {\n                templateKey: \"item\",\n                rootTagName: \"fragment\",\n                data: item,\n                sendEvent: sendEvent\n              }));\n            } : undefined\n          },\n          cssClasses: {\n            list: data.classNames.list,\n            item: data.classNames.item\n          }\n        },\n        sendEvent: sendEvent\n      }));\n    } : undefined;\n    render(h(RelatedProducts, {\n      items: items,\n      sendEvent: sendEvent,\n      classNames: cssClasses,\n      headerComponent: headerComponent,\n      itemComponent: itemComponent,\n      emptyComponent: emptyComponent,\n      layout: layoutComponent,\n      status: instantSearchInstance.status\n    }), containerNode);\n  };\n}\nexport default (function relatedProducts(widgetParams) {\n  var _ref5 = widgetParams || {},\n    container = _ref5.container,\n    objectIDs = _ref5.objectIDs,\n    limit = _ref5.limit,\n    queryParameters = _ref5.queryParameters,\n    fallbackParameters = _ref5.fallbackParameters,\n    threshold = _ref5.threshold,\n    escapeHTML = _ref5.escapeHTML,\n    transformItems = _ref5.transformItems,\n    _ref5$templates = _ref5.templates,\n    templates = _ref5$templates === void 0 ? {} : _ref5$templates,\n    _ref5$cssClasses = _ref5.cssClasses,\n    cssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var specializedRenderer = createRenderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = connectRelatedProducts(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    objectIDs: objectIDs,\n    limit: limit,\n    queryParameters: queryParameters,\n    fallbackParameters: fallbackParameters,\n    threshold: threshold,\n    escapeHTML: escapeHTML,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.relatedProducts'\n  });\n});"
  },
  {
    "path": "js/instantsearch.js/es/widgets/relevant-sort/defaultTemplates.d.ts",
    "content": "import type { RelevantSortComponentTemplates } from '../../components/RelevantSort/RelevantSort';\ndeclare const defaultTemplates: RelevantSortComponentTemplates;\nexport default defaultTemplates;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/relevant-sort/defaultTemplates.js",
    "content": "var defaultTemplates = {\n  text: function text() {\n    return '';\n  },\n  button: function button(_ref) {\n    var isRelevantSorted = _ref.isRelevantSorted;\n    return isRelevantSorted ? 'See all results' : 'See relevant results';\n  }\n};\nexport default defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/relevant-sort/relevant-sort.d.ts",
    "content": "\nimport type { RelevantSortConnectorParams, RelevantSortWidgetDescription } from '../../connectors/relevant-sort/connectRelevantSort';\nimport type { WidgetFactory, Template } from '../../types';\nexport type RelevantSortCSSClasses = Partial<{\n    root: string;\n    text: string;\n    button: string;\n}>;\nexport type RelevantSortTemplates = Partial<{\n    text: Template<{\n        isRelevantSorted: boolean;\n    }>;\n    button: Template<{\n        isRelevantSorted: boolean;\n    }>;\n}>;\nexport type RelevantSortWidgetParams = {\n    container: string | HTMLElement;\n    cssClasses?: RelevantSortCSSClasses;\n    templates?: RelevantSortTemplates;\n};\nexport type RelevantSortWidget = WidgetFactory<RelevantSortWidgetDescription & {\n    $$widgetType: 'ais.relevantSort';\n}, RelevantSortConnectorParams, RelevantSortWidgetParams>;\ndeclare const relevantSort: RelevantSortWidget;\nexport default relevantSort;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/relevant-sort/relevant-sort.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport RelevantSort from \"../../components/RelevantSort/RelevantSort.js\";\nimport connectRelevantSort from \"../../connectors/relevant-sort/connectRelevantSort.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nimport defaultTemplates from \"./defaultTemplates.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'relevant-sort'\n});\nvar suit = component('RelevantSort');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    templates = _ref.templates;\n  return function (_ref2) {\n    var isRelevantSorted = _ref2.isRelevantSorted,\n      isVirtualReplica = _ref2.isVirtualReplica,\n      refine = _ref2.refine;\n    render(h(RelevantSort, {\n      cssClasses: cssClasses,\n      templates: templates,\n      isRelevantSorted: isRelevantSorted,\n      isVirtualReplica: isVirtualReplica,\n      refine: refine\n    }), containerNode);\n  };\n};\nvar relevantSort = function relevantSort(widgetParams) {\n  var container = widgetParams.container,\n    _widgetParams$templat = widgetParams.templates,\n    userTemplates = _widgetParams$templat === void 0 ? {} : _widgetParams$templat,\n    _widgetParams$cssClas = widgetParams.cssClasses,\n    userCssClasses = _widgetParams$cssClas === void 0 ? {} : _widgetParams$cssClas;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    text: cx(suit({\n      descendantName: 'text'\n    }), userCssClasses.text),\n    button: cx(suit({\n      descendantName: 'button'\n    }), userCssClasses.button)\n  };\n  var templates = _objectSpread(_objectSpread({}, defaultTemplates), userTemplates);\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = connectRelevantSort(specializedRenderer, function () {\n    render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({})), {}, {\n    $$widgetType: 'ais.relevantSort'\n  });\n};\nexport default relevantSort;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/search-box/defaultTemplates.d.ts",
    "content": "import type { SearchBoxComponentTemplates } from '../../components/SearchBox/SearchBox';\ndeclare const defaultTemplate: SearchBoxComponentTemplates;\nexport default defaultTemplate;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/search-box/defaultTemplates.js",
    "content": "import { h } from 'preact';\nvar _ref2 = h(\"path\", {\n  d: \"M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z\"\n});\nvar _ref4 = h(\"path\", {\n  d: \"M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z\"\n});\nvar _ref6 = h(\"g\", {\n  fill: \"none\",\n  \"fill-rule\": \"evenodd\"\n}, h(\"g\", {\n  transform: \"translate(1 1)\",\n  \"stroke-width\": \"2\"\n}, h(\"circle\", {\n  \"stroke-opacity\": \".5\",\n  cx: \"18\",\n  cy: \"18\",\n  r: \"18\"\n}), h(\"path\", {\n  d: \"M36 18c0-9.94-8.06-18-18-18\"\n}, h(\"animateTransform\", {\n  attributeName: \"transform\",\n  type: \"rotate\",\n  from: \"0 18 18\",\n  to: \"360 18 18\",\n  dur: \"1s\",\n  repeatCount: \"indefinite\"\n}))));\nvar defaultTemplate = {\n  reset: function reset(_ref) {\n    var cssClasses = _ref.cssClasses;\n    return h(\"svg\", {\n      className: cssClasses.resetIcon,\n      viewBox: \"0 0 20 20\",\n      width: \"10\",\n      height: \"10\",\n      \"aria-hidden\": \"true\"\n    }, _ref2);\n  },\n  submit: function submit(_ref3) {\n    var cssClasses = _ref3.cssClasses;\n    return h(\"svg\", {\n      className: cssClasses.submitIcon,\n      width: \"10\",\n      height: \"10\",\n      viewBox: \"0 0 40 40\",\n      \"aria-hidden\": \"true\"\n    }, _ref4);\n  },\n  loadingIndicator: function loadingIndicator(_ref5) {\n    var cssClasses = _ref5.cssClasses;\n    /* eslint-disable react/no-unknown-property */\n    // Preact supports kebab case attributes, and using camel case would\n    // require using `preact/compat`.\n    // @TODO: reconsider using the `react` ESLint preset\n    return h(\"svg\", {\n      \"aria-label\": \"Results are loading\",\n      className: cssClasses.loadingIcon,\n      width: \"16\",\n      height: \"16\",\n      viewBox: \"0 0 38 38\",\n      stroke: \"#444\",\n      \"aria-hidden\": \"true\"\n    }, _ref6);\n    /* eslint-enable react/no-unknown-property */\n  }\n};\nexport default defaultTemplate;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/search-box/search-box.d.ts",
    "content": "\nimport type { SearchBoxComponentCSSClasses } from '../../components/SearchBox/SearchBox';\nimport type { SearchBoxConnectorParams, SearchBoxWidgetDescription } from '../../connectors/search-box/connectSearchBox';\nimport type { WidgetFactory, Template } from '../../types';\nexport type SearchBoxTemplates = Partial<{\n    /**\n     * Template used for displaying the submit button. Can accept a function or a Hogan string.\n     */\n    submit: Template<{\n        cssClasses: SearchBoxComponentCSSClasses;\n    }>;\n    /**\n     * Template used for displaying the reset button. Can accept a function or a Hogan string.\n     */\n    reset: Template<{\n        cssClasses: SearchBoxComponentCSSClasses;\n    }>;\n    /**\n     * Template used for displaying the loading indicator. Can accept a function or a Hogan string.\n     */\n    loadingIndicator: Template<{\n        cssClasses: SearchBoxComponentCSSClasses;\n    }>;\n}>;\nexport type SearchBoxCSSClasses = Partial<{\n    /**\n     * CSS class to add to the wrapping `<div>`\n     */\n    root: string | string[];\n    /**\n     * CSS class to add to the form\n     */\n    form: string | string[];\n    /**\n     * CSS class to add to the input.\n     */\n    input: string | string[];\n    /**\n     * CSS classes added to the submit button.\n     */\n    submit: string | string[];\n    /**\n     * CSS classes added to the submit icon.\n     */\n    submitIcon: string | string[];\n    /**\n     * CSS classes added to the reset button.\n     */\n    reset: string | string[];\n    /**\n     * CSS classes added to the reset icon.\n     */\n    resetIcon: string | string[];\n    /**\n     * CSS classes added to the loading indicator element.\n     */\n    loadingIndicator: string | string[];\n    /**\n     * CSS classes added to the loading indicator icon.\n     */\n    loadingIcon: string | string[];\n}>;\nexport type SearchBoxWidgetParams = {\n    /**\n     * CSS Selector or HTMLElement to insert the widget\n     */\n    container: string | HTMLElement;\n    /**\n     * The placeholder of the input\n     */\n    placeholder?: string;\n    /**\n     * Whether the input should be autofocused\n     */\n    autofocus?: boolean;\n    /**\n     * If set, trigger the search\n     * once `<Enter>` is pressed only.\n     */\n    searchAsYouType?: boolean;\n    /**\n     * Whether to update the search state in the middle of a\n     * composition session.\n     * @default false\n     */\n    ignoreCompositionEvents?: boolean;\n    /**\n     * Whether to show the reset button\n     */\n    showReset?: boolean;\n    /**\n     * Whether to show the submit button\n     */\n    showSubmit?: boolean;\n    /**\n     * Whether to show the loading indicator (replaces the submit if\n     * the search is stalled)\n     */\n    showLoadingIndicator?: boolean;\n    /**\n     * CSS classes to add\n     */\n    cssClasses?: SearchBoxCSSClasses;\n    /**\n     * Templates used for customizing the rendering of the searchbox\n     */\n    templates?: SearchBoxTemplates;\n    /**\n     * A function that is called every time a new search is done. You\n     * will get the query as the first parameter and a search (query) function to call as the second parameter.\n     * This `queryHook` can be used to debounce the number of searches done from the search box.\n     */\n    queryHook?: (query: string, hook: (value: string) => void) => void;\n};\n/**\n * The searchbox widget is used to let the user set a text based query.\n *\n * This is usually the  main entry point to start the search in an instantsearch context. For that\n * reason is usually placed on top, and not hidden so that the user can start searching right\n * away.\n *\n */\nexport type SearchBoxWidget = WidgetFactory<SearchBoxWidgetDescription & {\n    $$widgetType: 'ais.searchBox';\n}, SearchBoxConnectorParams, SearchBoxWidgetParams>;\ndeclare const searchBox: SearchBoxWidget;\nexport default searchBox;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/search-box/search-box.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport SearchBox from \"../../components/SearchBox/SearchBox.js\";\nimport connectSearchBox from \"../../connectors/search-box/connectSearchBox.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nimport defaultTemplates from \"./defaultTemplates.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'search-box'\n});\nvar suit = component('SearchBox');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    placeholder = _ref.placeholder,\n    templates = _ref.templates,\n    autofocus = _ref.autofocus,\n    searchAsYouType = _ref.searchAsYouType,\n    ignoreCompositionEvents = _ref.ignoreCompositionEvents,\n    showReset = _ref.showReset,\n    showSubmit = _ref.showSubmit,\n    showLoadingIndicator = _ref.showLoadingIndicator;\n  return function (_ref2) {\n    var refine = _ref2.refine,\n      query = _ref2.query,\n      isSearchStalled = _ref2.isSearchStalled;\n    render(h(SearchBox, {\n      query: query,\n      placeholder: placeholder,\n      autofocus: autofocus,\n      refine: refine,\n      searchAsYouType: searchAsYouType,\n      ignoreCompositionEvents: ignoreCompositionEvents,\n      templates: templates,\n      showSubmit: showSubmit,\n      showReset: showReset,\n      showLoadingIndicator: showLoadingIndicator,\n      isSearchStalled: isSearchStalled,\n      cssClasses: cssClasses\n    }), containerNode);\n  };\n};\n\n/**\n * The searchbox widget is used to let the user set a text based query.\n *\n * This is usually the  main entry point to start the search in an instantsearch context. For that\n * reason is usually placed on top, and not hidden so that the user can start searching right\n * away.\n *\n */\n\nvar searchBox = function searchBox(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    _ref3$placeholder = _ref3.placeholder,\n    placeholder = _ref3$placeholder === void 0 ? '' : _ref3$placeholder,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    _ref3$autofocus = _ref3.autofocus,\n    autofocus = _ref3$autofocus === void 0 ? false : _ref3$autofocus,\n    _ref3$searchAsYouType = _ref3.searchAsYouType,\n    searchAsYouType = _ref3$searchAsYouType === void 0 ? true : _ref3$searchAsYouType,\n    _ref3$ignoreCompositi = _ref3.ignoreCompositionEvents,\n    ignoreCompositionEvents = _ref3$ignoreCompositi === void 0 ? false : _ref3$ignoreCompositi,\n    _ref3$showReset = _ref3.showReset,\n    showReset = _ref3$showReset === void 0 ? true : _ref3$showReset,\n    _ref3$showSubmit = _ref3.showSubmit,\n    showSubmit = _ref3$showSubmit === void 0 ? true : _ref3$showSubmit,\n    _ref3$showLoadingIndi = _ref3.showLoadingIndicator,\n    showLoadingIndicator = _ref3$showLoadingIndi === void 0 ? true : _ref3$showLoadingIndi,\n    queryHook = _ref3.queryHook,\n    _ref3$templates = _ref3.templates,\n    userTemplates = _ref3$templates === void 0 ? {} : _ref3$templates;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    form: cx(suit({\n      descendantName: 'form'\n    }), userCssClasses.form),\n    input: cx(suit({\n      descendantName: 'input'\n    }), userCssClasses.input),\n    submit: cx(suit({\n      descendantName: 'submit'\n    }), userCssClasses.submit),\n    submitIcon: cx(suit({\n      descendantName: 'submitIcon'\n    }), userCssClasses.submitIcon),\n    reset: cx(suit({\n      descendantName: 'reset'\n    }), userCssClasses.reset),\n    resetIcon: cx(suit({\n      descendantName: 'resetIcon'\n    }), userCssClasses.resetIcon),\n    loadingIndicator: cx(suit({\n      descendantName: 'loadingIndicator'\n    }), userCssClasses.loadingIndicator),\n    loadingIcon: cx(suit({\n      descendantName: 'loadingIcon'\n    }), userCssClasses.loadingIcon)\n  };\n  var templates = _objectSpread(_objectSpread({}, defaultTemplates), userTemplates);\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    placeholder: placeholder,\n    templates: templates,\n    autofocus: autofocus,\n    searchAsYouType: searchAsYouType,\n    ignoreCompositionEvents: ignoreCompositionEvents,\n    showReset: showReset,\n    showSubmit: showSubmit,\n    showLoadingIndicator: showLoadingIndicator\n  });\n  var makeWidget = connectSearchBox(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    queryHook: queryHook\n  })), {}, {\n    $$widgetType: 'ais.searchBox'\n  });\n};\nexport default searchBox;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/sort-by/sort-by.d.ts",
    "content": "\nimport type { SortByConnectorParams, SortByItem, SortByWidgetDescription } from '../../connectors/sort-by/connectSortBy';\nimport type { TransformItems, WidgetFactory } from '../../types';\nexport type SortByWidgetCssClasses = Partial<{\n    /**\n     * CSS classes added to the outer `<div>`.\n     */\n    root: string | string[];\n    /**\n     * CSS classes added to the parent `<select>`.\n     */\n    select: string | string[];\n    /**\n     * CSS classes added to each `<option>`.\n     */\n    option: string | string[];\n}>;\nexport type SortByIndexDefinition = {\n    /**\n     * The name of the index to target.\n     */\n    value: string;\n    /**\n     * The label of the index to display.\n     */\n    label: string;\n};\nexport type SortByWidgetParams = {\n    /**\n     * CSS Selector or HTMLElement to insert the widget.\n     */\n    container: string | HTMLElement;\n    /**\n     * Array of objects defining the different indices to choose from.\n     */\n    items: SortByIndexDefinition[];\n    /**\n     * CSS classes to be added.\n     */\n    cssClasses?: SortByWidgetCssClasses;\n    /**\n     * Function to transform the items passed to the templates.\n     */\n    transformItems?: TransformItems<SortByItem>;\n};\nexport type SortByWidget = WidgetFactory<SortByWidgetDescription & {\n    $$widgetType: 'ais.sortBy';\n}, SortByConnectorParams, SortByWidgetParams>;\n/**\n * Sort by selector is a widget used for letting the user choose between different\n * indices that contains the same data with a different order / ranking formula.\n */\ndeclare const sortBy: SortByWidget;\nexport default sortBy;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/sort-by/sort-by.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport Selector from \"../../components/Selector/Selector.js\";\nimport connectSortBy from \"../../connectors/sort-by/connectSortBy.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'sort-by'\n});\nvar suit = component('SortBy');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses;\n  return function (_ref2, isFirstRendering) {\n    var currentRefinement = _ref2.currentRefinement,\n      options = _ref2.options,\n      refine = _ref2.refine;\n    if (isFirstRendering) {\n      return;\n    }\n    render(h(\"div\", {\n      className: cssClasses.root\n    }, h(Selector, {\n      cssClasses: cssClasses,\n      currentValue: currentRefinement,\n      options: options,\n      setValue: refine,\n      ariaLabel: \"Sort results by\"\n    })), containerNode);\n  };\n};\n\n/**\n * Sort by selector is a widget used for letting the user choose between different\n * indices that contains the same data with a different order / ranking formula.\n */\nvar sortBy = function sortBy(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    items = _ref3.items,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    transformItems = _ref3.transformItems;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    select: cx(suit({\n      descendantName: 'select'\n    }), userCssClasses.select),\n    option: cx(suit({\n      descendantName: 'option'\n    }), userCssClasses.option)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses\n  });\n  var makeWidget = connectSortBy(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    container: containerNode,\n    items: items,\n    transformItems: transformItems\n  })), {}, {\n    $$widgetType: 'ais.sortBy'\n  });\n};\nexport default sortBy;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/stats/defaultTemplates.d.ts",
    "content": "export { defaultTemplates as default } from './stats';\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/stats/defaultTemplates.js",
    "content": "export { defaultTemplates as default } from \"./stats.js\";"
  },
  {
    "path": "js/instantsearch.js/es/widgets/stats/stats.d.ts",
    "content": "\nimport type { StatsComponentTemplates } from '../../components/Stats/Stats';\nimport type { StatsConnectorParams, StatsRenderState, StatsWidgetDescription } from '../../connectors/stats/connectStats';\nimport type { Template, WidgetFactory } from '../../types';\ntype TextTemplateProps = {\n    hasManyResults: boolean;\n    hasNoResults: boolean;\n    hasOneResult: boolean;\n    hasNoSortedResults: boolean;\n    hasOneSortedResults: boolean;\n    hasManySortedResults: boolean;\n};\nexport type StatsCSSClasses = Partial<{\n    /**\n     * CSS class to add to the root element.\n     */\n    root: string | string[];\n    /**\n     * CSS class to add to the text span element.\n     */\n    text: string | string[];\n}>;\nexport type StatsTemplates = Partial<{\n    /**\n     * Text template, provided with `hasManyResults`, `hasNoResults`, `hasOneResult`, `hasNoSortedResults`, `hasOneSortedResults`, `hasManySortedResults`, `hitsPerPage`, `nbHits`, `nbSortedHits`, `nbPages`, `areHitsSorted`, `page`, `processingTimeMS`, `query`.\n     */\n    text: Template<TextTemplateProps & StatsRenderState>;\n}>;\nexport type StatsWidgetParams = {\n    /**\n     * CSS Selector or HTMLElement to insert the widget.\n     */\n    container: string | HTMLElement;\n    /**\n     * Templates to use for the widget.\n     */\n    templates?: StatsTemplates;\n    /**\n     * CSS classes to add.\n     */\n    cssClasses?: StatsCSSClasses;\n};\nexport type StatsWidget = WidgetFactory<StatsWidgetDescription & {\n    $$widgetType: 'ais.stats';\n}, StatsConnectorParams, StatsWidgetParams>;\nexport declare const defaultTemplates: StatsComponentTemplates;\n/**\n * The `stats` widget is used to display useful insights about the current results.\n *\n * By default, it will display the **number of hits** and the time taken to compute the\n * results inside the engine.\n */\ndeclare const stats: StatsWidget;\nexport default stats;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/stats/stats.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport Stats from \"../../components/Stats/Stats.js\";\nimport connectStats from \"../../connectors/stats/connectStats.js\";\nimport { formatNumber } from \"../../lib/formatNumber.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { prepareTemplateProps } from \"../../lib/templating/index.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'stats'\n});\nvar suit = component('Stats');\nexport var defaultTemplates = {\n  text: function text(props) {\n    return \"\".concat(props.areHitsSorted ? getSortedResultsSentence(props) : getResultsSentence(props), \" found in \").concat(props.processingTimeMS, \"ms\");\n  }\n};\nfunction getSortedResultsSentence(_ref) {\n  var nbHits = _ref.nbHits,\n    hasNoSortedResults = _ref.hasNoSortedResults,\n    hasOneSortedResults = _ref.hasOneSortedResults,\n    hasManySortedResults = _ref.hasManySortedResults,\n    nbSortedHits = _ref.nbSortedHits;\n  var suffix = \"sorted out of \".concat(formatNumber(nbHits));\n  if (hasNoSortedResults) {\n    return \"No relevant results \".concat(suffix);\n  }\n  if (hasOneSortedResults) {\n    return \"1 relevant result \".concat(suffix);\n  }\n  if (hasManySortedResults) {\n    return \"\".concat(formatNumber(nbSortedHits || 0), \" relevant results \").concat(suffix);\n  }\n  return '';\n}\nfunction getResultsSentence(_ref2) {\n  var nbHits = _ref2.nbHits,\n    hasNoResults = _ref2.hasNoResults,\n    hasOneResult = _ref2.hasOneResult,\n    hasManyResults = _ref2.hasManyResults;\n  if (hasNoResults) {\n    return 'No results';\n  }\n  if (hasOneResult) {\n    return '1 result';\n  }\n  if (hasManyResults) {\n    return \"\".concat(formatNumber(nbHits), \" results\");\n  }\n  return '';\n}\nvar renderer = function renderer(_ref3) {\n  var renderState = _ref3.renderState,\n    cssClasses = _ref3.cssClasses,\n    containerNode = _ref3.containerNode,\n    templates = _ref3.templates;\n  return function (_ref4, isFirstRendering) {\n    var hitsPerPage = _ref4.hitsPerPage,\n      nbHits = _ref4.nbHits,\n      nbSortedHits = _ref4.nbSortedHits,\n      areHitsSorted = _ref4.areHitsSorted,\n      nbPages = _ref4.nbPages,\n      page = _ref4.page,\n      processingTimeMS = _ref4.processingTimeMS,\n      query = _ref4.query,\n      instantSearchInstance = _ref4.instantSearchInstance;\n    if (isFirstRendering) {\n      renderState.templateProps = prepareTemplateProps({\n        defaultTemplates: defaultTemplates,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    render(h(Stats, {\n      cssClasses: cssClasses,\n      hitsPerPage: hitsPerPage,\n      nbHits: nbHits,\n      nbSortedHits: nbSortedHits,\n      areHitsSorted: areHitsSorted,\n      nbPages: nbPages,\n      page: page,\n      processingTimeMS: processingTimeMS,\n      query: query,\n      templateProps: renderState.templateProps\n    }), containerNode);\n  };\n};\n\n/**\n * The `stats` widget is used to display useful insights about the current results.\n *\n * By default, it will display the **number of hits** and the time taken to compute the\n * results inside the engine.\n */\nvar stats = function stats(widgetParams) {\n  var _ref5 = widgetParams || {},\n    container = _ref5.container,\n    _ref5$cssClasses = _ref5.cssClasses,\n    userCssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses,\n    _ref5$templates = _ref5.templates,\n    templates = _ref5$templates === void 0 ? {} : _ref5$templates;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    text: cx(suit({\n      descendantName: 'text'\n    }), userCssClasses.text)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    templates: templates,\n    renderState: {}\n  });\n  var makeWidget = connectStats(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({})), {}, {\n    $$widgetType: 'ais.stats'\n  });\n};\nexport default stats;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/toggle-refinement/defaultTemplates.d.ts",
    "content": "import type { ToggleRefinementComponentTemplates } from '../../components/ToggleRefinement/ToggleRefinement';\ndeclare const defaultTemplates: ToggleRefinementComponentTemplates;\nexport default defaultTemplates;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/toggle-refinement/defaultTemplates.js",
    "content": "var defaultTemplates = {\n  labelText: function labelText(_ref) {\n    var name = _ref.name;\n    return name;\n  }\n};\nexport default defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/toggle-refinement/toggle-refinement.d.ts",
    "content": "\nimport type { ToggleRefinementConnectorParams, ToggleRefinementWidgetDescription, ToggleRefinementRenderState } from '../../connectors/toggle-refinement/connectToggleRefinement';\nimport type { Template, WidgetFactory } from '../../types';\nexport type ToggleRefinementCSSClasses = Partial<{\n    /**\n     * CSS class to add to the root element.\n     */\n    root: string | string[];\n    /**\n     * CSS class to add to the label wrapping element.\n     */\n    label: string | string[];\n    /**\n     * CSS class to add to the checkbox.\n     */\n    checkbox: string | string[];\n    /**\n     * CSS class to add to the label text.\n     */\n    labelText: string | string[];\n}>;\nexport type ToggleRefinementTemplates = Partial<{\n    /**\n     * the text that describes the toggle action\n     */\n    labelText: Template<ToggleRefinementRenderState['value']>;\n}>;\nexport type ToggleRefinementWidgetParams = {\n    /**\n     * CSS Selector or HTMLElement to insert the widget.\n     */\n    container: string | HTMLElement;\n    /**\n     * Templates to use for the widget.\n     */\n    templates?: ToggleRefinementTemplates;\n    /**\n     * CSS classes to be added.\n     */\n    cssClasses?: ToggleRefinementCSSClasses;\n};\nexport type ToggleRefinementWidget = WidgetFactory<ToggleRefinementWidgetDescription & {\n    $$widgetType: 'ais.toggleRefinement';\n}, ToggleRefinementConnectorParams, ToggleRefinementWidgetParams>;\n/**\n * The toggleRefinement widget lets the user either:\n *  - switch between two values for a single facetted attribute (free_shipping / not_free_shipping)\n *  - toggleRefinement a faceted value on and off (only 'canon' for brands)\n *\n * This widget is particularly useful if you have a boolean value in the records.\n *\n * @requirements\n * The attribute passed to `attribute` must be declared as an\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\n * in your Algolia settings.\n */\ndeclare const toggleRefinement: ToggleRefinementWidget;\nexport default toggleRefinement;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/toggle-refinement/toggle-refinement.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport ToggleRefinement from \"../../components/ToggleRefinement/ToggleRefinement.js\";\nimport connectToggleRefinement from \"../../connectors/toggle-refinement/connectToggleRefinement.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { prepareTemplateProps } from \"../../lib/templating/index.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nimport defaultTemplates from \"./defaultTemplates.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'toggle-refinement'\n});\nvar suit = component('ToggleRefinement');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    renderState = _ref.renderState,\n    templates = _ref.templates;\n  return function (_ref2, isFirstRendering) {\n    var value = _ref2.value,\n      refine = _ref2.refine,\n      instantSearchInstance = _ref2.instantSearchInstance;\n    if (isFirstRendering) {\n      renderState.templateProps = prepareTemplateProps({\n        defaultTemplates: defaultTemplates,\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    render(h(ToggleRefinement, {\n      cssClasses: cssClasses,\n      currentRefinement: value,\n      templateProps: renderState.templateProps,\n      refine: refine\n    }), containerNode);\n  };\n};\n/**\n * The toggleRefinement widget lets the user either:\n *  - switch between two values for a single facetted attribute (free_shipping / not_free_shipping)\n *  - toggleRefinement a faceted value on and off (only 'canon' for brands)\n *\n * This widget is particularly useful if you have a boolean value in the records.\n *\n * @requirements\n * The attribute passed to `attribute` must be declared as an\n * [attribute for faceting](https://www.algolia.com/doc/guides/searching/faceting/#declaring-attributes-for-faceting)\n * in your Algolia settings.\n */\nvar toggleRefinement = function toggleRefinement(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    attribute = _ref3.attribute,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    _ref3$templates = _ref3.templates,\n    templates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    _ref3$on = _ref3.on,\n    on = _ref3$on === void 0 ? true : _ref3$on,\n    off = _ref3.off;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    label: cx(suit({\n      descendantName: 'label'\n    }), userCssClasses.label),\n    checkbox: cx(suit({\n      descendantName: 'checkbox'\n    }), userCssClasses.checkbox),\n    labelText: cx(suit({\n      descendantName: 'labelText'\n    }), userCssClasses.labelText)\n  };\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = connectToggleRefinement(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    attribute: attribute,\n    on: on,\n    off: off\n  })), {}, {\n    $$widgetType: 'ais.toggleRefinement'\n  });\n};\nexport default toggleRefinement;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/trending-items/trending-items.d.ts",
    "content": "\nimport type { TrendingItemsWidgetDescription, TrendingItemsConnectorParams } from '../../connectors/trending-items/connectTrendingItems';\nimport type { Template, WidgetFactory, BaseHit, RecommendResponse, Hit, TemplateWithBindEvent } from '../../types';\nimport type { RecommendClassNames, TrendingItemsProps as TrendingItemsUiProps } from 'instantsearch-ui-components';\nexport type TrendingItemsCSSClasses = Partial<RecommendClassNames>;\nexport type TrendingItemsTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{\n    /**\n     * Template to use when there are no results.\n     */\n    empty: Template<RecommendResponse<Hit<THit>>>;\n    /**\n     * Template to use for the header of the widget.\n     */\n    header: Template<Pick<Parameters<NonNullable<TrendingItemsUiProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {\n        cssClasses: RecommendClassNames;\n    }>;\n    /**\n     * Template to use for each result. This template will receive an object containing a single record.\n     */\n    item: TemplateWithBindEvent<Hit<THit>>;\n    /**\n     * Template to use to wrap all items.\n     */\n    layout: Template<Pick<Parameters<NonNullable<TrendingItemsUiProps<Hit<THit>>['layout']>>[0], 'items'> & {\n        templates: {\n            item: TrendingItemsUiProps<Hit<THit>>['itemComponent'];\n        };\n        cssClasses: Pick<TrendingItemsCSSClasses, 'list' | 'item'>;\n    }>;\n}>;\ntype TrendingItemsWidgetParams<THit extends NonNullable<object> = BaseHit> = {\n    /**\n     * CSS selector or `HTMLElement` to insert the widget into.\n     */\n    container: string | HTMLElement;\n    /**\n     * Templates to customize the widget.\n     */\n    templates?: TrendingItemsTemplates<THit>;\n    /**\n     * CSS classes to add to the widget elements.\n     */\n    cssClasses?: TrendingItemsCSSClasses;\n};\nexport type TrendingItemsWidget = WidgetFactory<TrendingItemsWidgetDescription & {\n    $$widgetType: 'ais.trendingItems';\n}, TrendingItemsConnectorParams, TrendingItemsWidgetParams>;\ndeclare const _default: <THit extends NonNullable<object> = BaseHit>(widgetParams: TrendingItemsWidgetParams<THit> & TrendingItemsConnectorParams<THit>) => {\n    $$widgetType: \"ais.trendingItems\";\n    dependsOn: \"recommend\";\n    $$type: \"ais.trendingItems\";\n    init(initOptions: import(\"../../types\").InitOptions): void;\n    render(renderOptions: import(\"../../types\").RenderOptions): void;\n    getRenderState(renderState: {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/answers/connectAnswers\").AnswersRenderState, import(\"../../connectors/answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/configure/connectConfigure\").ConfigureRenderState, import(\"../../connectors/configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits/connectHits\").HitsRenderState<BaseHit>, import(\"../../connectors/hits/connectHits\").HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/menu/connectMenu\").MenuRenderState, import(\"../../connectors/menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/pagination/connectPagination\").PaginationRenderState, import(\"../../connectors/pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/range/connectRange\").RangeRenderState, import(\"../../connectors/range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/search-box/connectSearchBox\").SearchBoxRenderState, import(\"../../connectors/search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/sort-by/connectSortBy\").SortByRenderState, import(\"../../connectors/sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/stats/connectStats\").StatsRenderState, import(\"../../connectors/stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../places/places\").PlacesWidgetParams> | undefined;\n    }): {\n        answers?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/answers/connectAnswers\").AnswersRenderState, import(\"../../connectors/answers/connectAnswers\").AnswersConnectorParams> | undefined;\n        autocomplete?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteConnectorParams> | undefined;\n        breadcrumb?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n        } | undefined;\n        clearRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams> | undefined;\n        configure?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/configure/connectConfigure\").ConfigureRenderState, import(\"../../connectors/configure/connectConfigure\").ConfigureConnectorParams> | undefined;\n        currentRefinements?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams> | undefined;\n        geoSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>> | undefined;\n        hierarchicalMenu?: {\n            [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n        } | undefined;\n        hits?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits/connectHits\").HitsRenderState<BaseHit>, import(\"../../connectors/hits/connectHits\").HitsConnectorParams<BaseHit>> | undefined;\n        hitsPerPage?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams> | undefined;\n        infiniteHits?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>> | undefined;\n        menu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/menu/connectMenu\").MenuRenderState, import(\"../../connectors/menu/connectMenu\").MenuConnectorParams>;\n        } | undefined;\n        numericMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n        } | undefined;\n        pagination?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/pagination/connectPagination\").PaginationRenderState, import(\"../../connectors/pagination/connectPagination\").PaginationConnectorParams> | undefined;\n        poweredBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByConnectorParams> | undefined;\n        queryRules?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesConnectorParams> | undefined;\n        range?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/range/connectRange\").RangeRenderState, import(\"../../connectors/range/connectRange\").RangeConnectorParams>;\n        } | undefined;\n        ratingMenu?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n        } | undefined;\n        refinementList?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n        } | undefined;\n        relevantSort?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortConnectorParams> | undefined;\n        searchBox?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/search-box/connectSearchBox\").SearchBoxRenderState, import(\"../../connectors/search-box/connectSearchBox\").SearchBoxConnectorParams> | undefined;\n        sortBy?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/sort-by/connectSortBy\").SortByRenderState, import(\"../../connectors/sort-by/connectSortBy\").SortByConnectorParams> | undefined;\n        stats?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/stats/connectStats\").StatsRenderState, import(\"../../connectors/stats/connectStats\").StatsConnectorParams> | undefined;\n        toggleRefinement?: {\n            [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n        } | undefined;\n        voiceSearch?: import(\"../../types\").WidgetRenderState<import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchConnectorParams> | undefined;\n        analytics?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../analytics/analytics\").AnalyticsWidgetParams> | undefined;\n        places?: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../places/places\").PlacesWidgetParams> | undefined;\n    };\n    getWidgetRenderState({ results, helper, instantSearchInstance }: import(\"../../types\").InitOptions | import(\"../../types\").RenderOptions | ({\n        instantSearchInstance: import(\"../../types\").InstantSearch;\n        parent: import(\"../index\").IndexWidget;\n        templatesConfig: Record<string, unknown>;\n        scopedResults: import(\"../../types\").ScopedResult[];\n        state: import(\"algoliasearch-helper\").SearchParameters;\n        renderState: Partial<{\n            answers: import(\"../../types\").WidgetRenderState<import(\"../../connectors/answers/connectAnswers\").AnswersRenderState, import(\"../../connectors/answers/connectAnswers\").AnswersConnectorParams>;\n        } & {\n            autocomplete: import(\"../../types\").WidgetRenderState<import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteRenderState, import(\"../../connectors/autocomplete/connectAutocomplete\").AutocompleteConnectorParams>;\n        } & {\n            breadcrumb: {\n                [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbRenderState, import(\"../../connectors/breadcrumb/connectBreadcrumb\").BreadcrumbConnectorParams>;\n            };\n        } & {\n            clearRefinements: import(\"../../types\").WidgetRenderState<import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsRenderState, import(\"../../connectors/clear-refinements/connectClearRefinements\").ClearRefinementsConnectorParams>;\n        } & {\n            configure: import(\"../../types\").WidgetRenderState<import(\"../../connectors/configure/connectConfigure\").ConfigureRenderState, import(\"../../connectors/configure/connectConfigure\").ConfigureConnectorParams>;\n        } & {\n            currentRefinements: import(\"../../types\").WidgetRenderState<import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsRenderState, import(\"../../connectors/current-refinements/connectCurrentRefinements\").CurrentRefinementsConnectorParams>;\n        } & {\n            geoSearch: import(\"../../types\").WidgetRenderState<import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchRenderState<import(\"../../types\").GeoHit>, import(\"../../connectors/geo-search/connectGeoSearch\").GeoSearchConnectorParams<import(\"../../types\").GeoHit>>;\n        } & {\n            hierarchicalMenu: {\n                [rootAttribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuRenderState, import(\"../../connectors/hierarchical-menu/connectHierarchicalMenu\").HierarchicalMenuConnectorParams>;\n            };\n        } & {\n            hits: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits/connectHits\").HitsRenderState<BaseHit>, import(\"../../connectors/hits/connectHits\").HitsConnectorParams<BaseHit>>;\n        } & {\n            hitsPerPage: import(\"../../types\").WidgetRenderState<import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageRenderState, import(\"../../connectors/hits-per-page/connectHitsPerPage\").HitsPerPageConnectorParams>;\n        } & {\n            infiniteHits: import(\"../../types\").WidgetRenderState<import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsRenderState<BaseHit>, import(\"../../connectors/infinite-hits/connectInfiniteHits\").InfiniteHitsConnectorParams<BaseHit>>;\n        } & {\n            menu: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/menu/connectMenu\").MenuRenderState, import(\"../../connectors/menu/connectMenu\").MenuConnectorParams>;\n            };\n        } & {\n            numericMenu: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuRenderState, import(\"../../connectors/numeric-menu/connectNumericMenu\").NumericMenuConnectorParams>;\n            };\n        } & {\n            pagination: import(\"../../types\").WidgetRenderState<import(\"../../connectors/pagination/connectPagination\").PaginationRenderState, import(\"../../connectors/pagination/connectPagination\").PaginationConnectorParams>;\n        } & {\n            poweredBy: import(\"../../types\").WidgetRenderState<import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByRenderState, import(\"../../connectors/powered-by/connectPoweredBy\").PoweredByConnectorParams>;\n        } & {\n            queryRules: import(\"../../types\").WidgetRenderState<import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesRenderState, import(\"../../connectors/query-rules/connectQueryRules\").QueryRulesConnectorParams>;\n        } & {\n            range: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/range/connectRange\").RangeRenderState, import(\"../../connectors/range/connectRange\").RangeConnectorParams>;\n            };\n        } & {\n            ratingMenu: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuRenderState, import(\"../../connectors/rating-menu/connectRatingMenu\").RatingMenuConnectorParams>;\n            };\n        } & {\n            refinementList: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListRenderState, import(\"../../connectors/refinement-list/connectRefinementList\").RefinementListConnectorParams>;\n            };\n        } & {\n            relevantSort: import(\"../../types\").WidgetRenderState<import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortRenderState, import(\"../../connectors/relevant-sort/connectRelevantSort\").RelevantSortConnectorParams>;\n        } & {\n            searchBox: import(\"../../types\").WidgetRenderState<import(\"../../connectors/search-box/connectSearchBox\").SearchBoxRenderState, import(\"../../connectors/search-box/connectSearchBox\").SearchBoxConnectorParams>;\n        } & {\n            sortBy: import(\"../../types\").WidgetRenderState<import(\"../../connectors/sort-by/connectSortBy\").SortByRenderState, import(\"../../connectors/sort-by/connectSortBy\").SortByConnectorParams>;\n        } & {\n            stats: import(\"../../types\").WidgetRenderState<import(\"../../connectors/stats/connectStats\").StatsRenderState, import(\"../../connectors/stats/connectStats\").StatsConnectorParams>;\n        } & {\n            toggleRefinement: {\n                [attribute: string]: import(\"../../types\").WidgetRenderState<import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementRenderState, import(\"../../connectors/toggle-refinement/connectToggleRefinement\").ToggleRefinementConnectorParams>;\n            };\n        } & {\n            voiceSearch: import(\"../../types\").WidgetRenderState<import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchRenderState, import(\"../../connectors/voice-search/connectVoiceSearch\").VoiceSearchConnectorParams>;\n        } & {\n            analytics: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../analytics/analytics\").AnalyticsWidgetParams>;\n        } & {\n            places: import(\"../../types\").WidgetRenderState<Record<string, unknown>, import(\"../places/places\").PlacesWidgetParams>;\n        }>;\n        helper: import(\"algoliasearch-helper\").AlgoliaSearchHelper;\n        searchMetadata: {\n            isSearchStalled: boolean;\n        };\n        status: import(\"../../types\").InstantSearch[\"status\"];\n        error: import(\"../../types\").InstantSearch[\"error\"];\n        createURL: (nextState: import(\"algoliasearch-helper\").SearchParameters | ((state: import(\"../../types\").IndexUiState) => import(\"../../types\").IndexUiState)) => string;\n    } & {\n        results: RecommendResponse<any>;\n    })): {\n        items: Hit<THit>[];\n        widgetParams: Partial<TrendingItemsWidgetParams<BaseHit>> & TrendingItemsConnectorParams<THit>;\n        sendEvent: import(\"../../lib/utils\").SendEventForHits;\n    };\n    dispose({ recommendState }: import(\"../../types\").DisposeOptions): import(\"algoliasearch-helper\").RecommendParameters;\n    getWidgetParameters(state: import(\"algoliasearch-helper\").RecommendParameters): import(\"algoliasearch-helper\").RecommendParameters;\n};\nexport default _default;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/trending-items/trending-items.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _excluded = [\"item\", \"sendEvent\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport { createTrendingItemsComponent } from 'instantsearch-ui-components';\nimport { Fragment, h, render } from 'preact';\nimport TemplateComponent from \"../../components/Template/Template.js\";\nimport connectTrendingItems from \"../../connectors/trending-items/connectTrendingItems.js\";\nimport { prepareTemplateProps } from \"../../lib/templating/index.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'trending-items'\n});\nvar TrendingItems = createTrendingItemsComponent({\n  createElement: h,\n  Fragment: Fragment\n});\nfunction createRenderer(_ref) {\n  var renderState = _ref.renderState,\n    cssClasses = _ref.cssClasses,\n    containerNode = _ref.containerNode,\n    templates = _ref.templates;\n  return function renderer(_ref2, isFirstRendering) {\n    var items = _ref2.items,\n      results = _ref2.results,\n      instantSearchInstance = _ref2.instantSearchInstance,\n      sendEvent = _ref2.sendEvent;\n    if (isFirstRendering) {\n      renderState.templateProps = prepareTemplateProps({\n        defaultTemplates: {},\n        templatesConfig: instantSearchInstance.templatesConfig,\n        templates: templates\n      });\n      return;\n    }\n    var headerComponent = templates.header ? function (data) {\n      return h(TemplateComponent, _extends({}, renderState.templateProps, {\n        templateKey: \"header\",\n        rootTagName: \"fragment\",\n        data: {\n          cssClasses: data.classNames,\n          items: data.items\n        }\n      }));\n    } : undefined;\n    var itemComponent = templates.item ? function (_ref3) {\n      var item = _ref3.item,\n        _sendEvent = _ref3.sendEvent,\n        rootProps = _objectWithoutProperties(_ref3, _excluded);\n      return h(TemplateComponent, _extends({}, renderState.templateProps, {\n        templateKey: \"item\",\n        rootTagName: \"fragment\",\n        data: item,\n        sendEvent: _sendEvent,\n        rootProps: _objectSpread({}, rootProps)\n      }));\n    } : undefined;\n    var emptyComponent = templates.empty ? function () {\n      return h(TemplateComponent, _extends({}, renderState.templateProps, {\n        templateKey: \"empty\",\n        rootTagName: \"fragment\",\n        data: results\n      }));\n    } : undefined;\n    var layoutComponent = templates.layout ? function (data) {\n      return h(TemplateComponent, _extends({}, renderState.templateProps, {\n        templateKey: \"layout\",\n        rootTagName: \"fragment\",\n        data: {\n          sendEvent: sendEvent,\n          items: data.items,\n          templates: {\n            item: templates.item ? function (_ref4) {\n              var item = _ref4.item;\n              return h(TemplateComponent, _extends({}, renderState.templateProps, {\n                templateKey: \"item\",\n                rootTagName: \"fragment\",\n                data: item,\n                sendEvent: sendEvent\n              }));\n            } : undefined\n          },\n          cssClasses: {\n            list: data.classNames.list,\n            item: data.classNames.item\n          }\n        },\n        sendEvent: sendEvent\n      }));\n    } : undefined;\n    render(h(TrendingItems, {\n      items: items,\n      sendEvent: sendEvent,\n      classNames: cssClasses,\n      headerComponent: headerComponent,\n      itemComponent: itemComponent,\n      emptyComponent: emptyComponent,\n      layout: layoutComponent,\n      status: instantSearchInstance.status\n    }), containerNode);\n  };\n}\nexport default (function trendingItems(widgetParams) {\n  var _ref5 = widgetParams || {},\n    container = _ref5.container,\n    facetName = _ref5.facetName,\n    facetValue = _ref5.facetValue,\n    limit = _ref5.limit,\n    queryParameters = _ref5.queryParameters,\n    fallbackParameters = _ref5.fallbackParameters,\n    threshold = _ref5.threshold,\n    escapeHTML = _ref5.escapeHTML,\n    transformItems = _ref5.transformItems,\n    _ref5$templates = _ref5.templates,\n    templates = _ref5$templates === void 0 ? {} : _ref5$templates,\n    _ref5$cssClasses = _ref5.cssClasses,\n    cssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var specializedRenderer = createRenderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    renderState: {},\n    templates: templates\n  });\n  var makeWidget = connectTrendingItems(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  var facetParameters = facetName && facetValue ? {\n    facetName: facetName,\n    facetValue: facetValue\n  } : {};\n  return _objectSpread(_objectSpread({}, makeWidget(_objectSpread(_objectSpread({}, facetParameters), {}, {\n    limit: limit,\n    queryParameters: queryParameters,\n    fallbackParameters: fallbackParameters,\n    threshold: threshold,\n    escapeHTML: escapeHTML,\n    transformItems: transformItems\n  }))), {}, {\n    $$widgetType: 'ais.trendingItems'\n  });\n});"
  },
  {
    "path": "js/instantsearch.js/es/widgets/voice-search/defaultTemplates.d.ts",
    "content": "import type { VoiceSearchComponentTemplates } from '../../components/VoiceSearch/VoiceSearch';\ndeclare const defaultTemplates: VoiceSearchComponentTemplates;\nexport default defaultTemplates;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/voice-search/defaultTemplates.js",
    "content": "import { Fragment, h } from 'preact';\nvar _ref2 = h(Fragment, null, h(\"line\", {\n  x1: \"1\",\n  y1: \"1\",\n  x2: \"23\",\n  y2: \"23\"\n}), h(\"path\", {\n  d: \"M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6\"\n}), h(\"path\", {\n  d: \"M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23\"\n}), h(\"line\", {\n  x1: \"12\",\n  y1: \"19\",\n  x2: \"12\",\n  y2: \"23\"\n}), h(\"line\", {\n  x1: \"8\",\n  y1: \"23\",\n  x2: \"16\",\n  y2: \"23\"\n}));\nvar _ref3 = h(\"path\", {\n  d: \"M19 10v2a7 7 0 0 1-14 0v-2\"\n});\nvar _ref4 = h(\"line\", {\n  x1: \"12\",\n  y1: \"19\",\n  x2: \"12\",\n  y2: \"23\"\n});\nvar _ref5 = h(\"line\", {\n  x1: \"8\",\n  y1: \"23\",\n  x2: \"16\",\n  y2: \"23\"\n});\nvar ButtonInnerElement = function ButtonInnerElement(_ref) {\n  var status = _ref.status,\n    errorCode = _ref.errorCode,\n    isListening = _ref.isListening;\n  if (status === 'error' && errorCode === 'not-allowed') {\n    return _ref2;\n  }\n  return h(Fragment, null, h(\"path\", {\n    d: \"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z\",\n    fill: isListening ? 'currentColor' : 'none'\n  }), _ref3, _ref4, _ref5);\n};\nvar defaultTemplates = {\n  buttonText: function buttonText(_ref6) {\n    var status = _ref6.status,\n      errorCode = _ref6.errorCode,\n      isListening = _ref6.isListening;\n    return h(\"svg\", {\n      width: \"16\",\n      height: \"16\",\n      viewBox: \"0 0 24 24\",\n      fill: \"none\",\n      stroke: \"currentColor\"\n      /* eslint-disable react/no-unknown-property */\n      // Preact supports kebab case attributes, and using camel case would\n      // require using `preact/compat`.\n      // @TODO: reconsider using the `react` ESLint preset\n      ,\n      \"stroke-width\": \"2\",\n      \"stroke-linecap\": \"round\",\n      \"stroke-linejoin\": \"round\"\n      /* eslint-enable react/no-unknown-property */\n    }, h(ButtonInnerElement, {\n      status: status,\n      errorCode: errorCode,\n      isListening: isListening\n    }));\n  },\n  status: function status(_ref7) {\n    var transcript = _ref7.transcript;\n    return h(\"p\", null, transcript);\n  }\n};\nexport default defaultTemplates;"
  },
  {
    "path": "js/instantsearch.js/es/widgets/voice-search/voice-search.d.ts",
    "content": "\nimport type { VoiceSearchConnectorParams, VoiceSearchWidgetDescription } from '../../connectors/voice-search/connectVoiceSearch';\nimport type { CreateVoiceSearchHelper } from '../../lib/voiceSearchHelper/types';\nimport type { WidgetFactory, Template } from '../../types';\nimport type { PlainSearchParameters } from 'algoliasearch-helper';\nexport type VoiceSearchCSSClasses = Partial<{\n    root: string | string[];\n    button: string | string[];\n    status: string | string[];\n}>;\ntype VoiceSearchTemplateProps = {\n    status: string;\n    errorCode: string;\n    isListening: boolean;\n    transcript: string;\n    isSpeechFinal: boolean;\n    isBrowserSupported: boolean;\n};\nexport type VoiceSearchTemplates = Partial<{\n    buttonText: Template<VoiceSearchTemplateProps>;\n    status: Template<VoiceSearchTemplateProps>;\n}>;\nexport type VoiceSearchWidgetParams = {\n    container: string | HTMLElement;\n    cssClasses?: VoiceSearchCSSClasses;\n    templates?: VoiceSearchTemplates;\n    searchAsYouSpeak?: boolean;\n    language?: string;\n    additionalQueryParameters?: (params: {\n        query: string;\n    }) => PlainSearchParameters | void;\n    createVoiceSearchHelper?: CreateVoiceSearchHelper;\n};\nexport type VoiceSearchWidget = WidgetFactory<VoiceSearchWidgetDescription & {\n    $$type: 'ais.voiceSearch';\n}, VoiceSearchConnectorParams, VoiceSearchWidgetParams>;\ndeclare const voiceSearch: VoiceSearchWidget;\nexport default voiceSearch;\n"
  },
  {
    "path": "js/instantsearch.js/es/widgets/voice-search/voice-search.js",
    "content": "function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { cx } from 'instantsearch-ui-components';\nimport { h, render } from 'preact';\nimport VoiceSearchComponent from \"../../components/VoiceSearch/VoiceSearch.js\";\nimport connectVoiceSearch from \"../../connectors/voice-search/connectVoiceSearch.js\";\nimport { component } from \"../../lib/suit.js\";\nimport { getContainerNode, createDocumentationMessageGenerator } from \"../../lib/utils/index.js\";\nimport defaultTemplates from \"./defaultTemplates.js\";\nvar withUsage = createDocumentationMessageGenerator({\n  name: 'voice-search'\n});\nvar suit = component('VoiceSearch');\nvar renderer = function renderer(_ref) {\n  var containerNode = _ref.containerNode,\n    cssClasses = _ref.cssClasses,\n    templates = _ref.templates;\n  return function (_ref2) {\n    var isBrowserSupported = _ref2.isBrowserSupported,\n      isListening = _ref2.isListening,\n      toggleListening = _ref2.toggleListening,\n      voiceListeningState = _ref2.voiceListeningState;\n    render(h(VoiceSearchComponent, {\n      cssClasses: cssClasses,\n      templates: templates,\n      isBrowserSupported: isBrowserSupported,\n      isListening: isListening,\n      toggleListening: toggleListening,\n      voiceListeningState: voiceListeningState\n    }), containerNode);\n  };\n};\nvar voiceSearch = function voiceSearch(widgetParams) {\n  var _ref3 = widgetParams || {},\n    container = _ref3.container,\n    _ref3$cssClasses = _ref3.cssClasses,\n    userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,\n    _ref3$templates = _ref3.templates,\n    userTemplates = _ref3$templates === void 0 ? {} : _ref3$templates,\n    _ref3$searchAsYouSpea = _ref3.searchAsYouSpeak,\n    searchAsYouSpeak = _ref3$searchAsYouSpea === void 0 ? false : _ref3$searchAsYouSpea,\n    language = _ref3.language,\n    additionalQueryParameters = _ref3.additionalQueryParameters,\n    createVoiceSearchHelper = _ref3.createVoiceSearchHelper;\n  if (!container) {\n    throw new Error(withUsage('The `container` option is required.'));\n  }\n  var containerNode = getContainerNode(container);\n  var cssClasses = {\n    root: cx(suit(), userCssClasses.root),\n    button: cx(suit({\n      descendantName: 'button'\n    }), userCssClasses.button),\n    status: cx(suit({\n      descendantName: 'status'\n    }), userCssClasses.status)\n  };\n  var templates = _objectSpread(_objectSpread({}, defaultTemplates), userTemplates);\n  var specializedRenderer = renderer({\n    containerNode: containerNode,\n    cssClasses: cssClasses,\n    templates: templates\n  });\n  var makeWidget = connectVoiceSearch(specializedRenderer, function () {\n    return render(null, containerNode);\n  });\n  return _objectSpread(_objectSpread({}, makeWidget({\n    container: containerNode,\n    cssClasses: cssClasses,\n    templates: templates,\n    searchAsYouSpeak: searchAsYouSpeak,\n    language: language,\n    additionalQueryParameters: additionalQueryParameters,\n    createVoiceSearchHelper: createVoiceSearchHelper\n  })), {}, {\n    $$widgetType: 'ais.voiceSearch'\n  });\n};\nexport default voiceSearch;"
  },
  {
    "path": "js/instantsearch.js/package.json",
    "content": "{\n  \"name\": \"instantsearch.js\",\n  \"version\": \"4.78.3\",\n  \"description\": \"InstantSearch.js is a JavaScript library for building performant and instant search experiences with Algolia.\",\n  \"homepage\": \"https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/\",\n  \"types\": \"es/index.d.ts\",\n  \"keywords\": [\n    \"algolia\",\n    \"instantsearch\",\n    \"search\",\n    \"widget\",\n    \"vanilla\"\n  ],\n  \"author\": \"Algolia <support@algolia.com>\",\n  \"license\": \"MIT\",\n  \"repository\": \"algolia/instantsearch\",\n  \"main\": \"cjs/index.js\",\n  \"module\": \"es/index.js\",\n  \"jsdelivr\": \"dist/instantsearch.production.min.js\",\n  \"unpkg\": \"dist/instantsearch.production.min.js\",\n  \"sideEffects\": false,\n  \"files\": [\n    \"dist\",\n    \"cjs\",\n    \"es\",\n    \"scripts/transforms\"\n  ],\n  \"dependencies\": {\n    \"@algolia/events\": \"^4.0.1\",\n    \"@types/dom-speech-recognition\": \"^0.0.1\",\n    \"@types/google.maps\": \"^3.55.12\",\n    \"@types/hogan.js\": \"^3.0.0\",\n    \"@types/qs\": \"^6.5.3\",\n    \"algoliasearch-helper\": \"3.25.0\",\n    \"hogan.js\": \"^3.0.2\",\n    \"htm\": \"^3.0.0\",\n    \"instantsearch-ui-components\": \"0.11.1\",\n    \"preact\": \"^10.10.0\",\n    \"qs\": \"^6.5.1 < 6.10\",\n    \"search-insights\": \"^2.17.2\"\n  },\n  \"peerDependencies\": {\n    \"algoliasearch\": \">= 3.1 < 6\"\n  },\n  \"scripts\": {\n    \"build\": \"yarn run build:cjs && yarn run build:es && yarn run build:umd && yarn run build:types\",\n    \"build:umd\": \"rm -rf dist && BABEL_ENV=umd rollup --config ./scripts/rollup/rollup.config.js\",\n    \"build:cjs\": \"rm -rf cjs && BABEL_ENV=cjs babel --root-mode upward src --extensions '.js,.ts,.tsx' --out-dir cjs/ --ignore 'src/index.es.ts','**/__tests__','**/__mocks__' --quiet\",\n    \"build:es:base\": \"BABEL_ENV=es babel --root-mode upward src --extensions '.js,.ts,.tsx' --out-dir es/ --ignore 'src/index.es.ts','**/__tests__','**/__mocks__'\",\n    \"build:es\": \"rm -rf es && yarn build:es:base --quiet && BABEL_ENV=es babel --root-mode upward src/index.es.ts --out-file es/index.js --quiet && echo '{\\\"type\\\":\\\"module\\\",\\\"sideEffects\\\":false}' > es/package.json\",\n    \"build:types\": \"scripts/typescript/extract.js\",\n    \"storybook\": \"NODE_OPTIONS=--openssl-legacy-provider start-storybook --quiet --port 6006 --ci --static-dir .storybook/static\",\n    \"storybook:build\": \"NODE_OPTIONS=--openssl-legacy-provider build-storybook --quiet --output-dir ../../website/stories/js --static-dir .storybook/static\",\n    \"test:exports\": \"node test/module/is-es-module.mjs && node test/module/is-cjs-module.cjs\",\n    \"version\": \"./scripts/version/update-version.js\",\n    \"watch:es\": \"yarn --silent build:es:base --watch\"\n  },\n  \"devDependencies\": {\n    \"@instantsearch/mocks\": \"1.74.0\",\n    \"@instantsearch/tests\": \"1.74.0\",\n    \"@instantsearch/testutils\": \"1.63.0\",\n    \"@storybook/html\": \"5.3.9\",\n    \"@types/scriptjs\": \"0.0.2\",\n    \"algoliasearch\": \"5.1.1\",\n    \"places.js\": \"1.17.1\",\n    \"scriptjs\": \"2.5.9\",\n    \"webpack\": \"4.47.0\"\n  },\n  \"gitHead\": \"68e29e1c4836d258ec373abe50f3d1f7f5132017\"\n}\n"
  },
  {
    "path": "js/instantsearch.js/scripts/transforms/README.md",
    "content": "## Codemods\n\nThese codemods (code transformers) can be ran with [jscodeshift]((https://github.com/facebook/jscodeshift).\n\n### `addWidget-to-addWidgets`\n\nThis will replace calls of `addWidget(widget)` to `addWidgets([widget])`, as well as `removeWidget(widget) to `removeWidgets([widget])`.\n\n```\nnpx @codeshift/cli --packages 'instantsearch-codemods#addWidget-to-addWidgets' <path>\n```\n\n### Notes\n\nIf you are using Prettier or ESLint, make sure to run its autofixing after this transformation, since code can be formatted differently after it has been transformed. For example, in our repository, the Prettier command would be:\n\n```\nyarn prettier --write '{examples,stories,.storybook}/**/*.{js,ts,tsx}'\n```\n"
  },
  {
    "path": "js/instantsearch.js/scripts/transforms/__testfixtures__/addWidget-to-addWidgets/global.input.js",
    "content": "/* global instantsearch */\n\nconst search = instantsearch();\n\nsearch.addWidget(instantsearch.widgets.hits({}));\nsearch.addWidget(instantsearch.widgets.hits({}));\n"
  },
  {
    "path": "js/instantsearch.js/scripts/transforms/__testfixtures__/addWidget-to-addWidgets/global.output.js",
    "content": "/* global instantsearch */\n\nconst search = instantsearch();\n\nsearch.addWidgets([instantsearch.widgets.hits({})]);\nsearch.addWidgets([instantsearch.widgets.hits({})]);\n"
  },
  {
    "path": "js/instantsearch.js/scripts/transforms/__testfixtures__/addWidget-to-addWidgets/imported.input.js",
    "content": "import instantsearch from 'instantsearch.js';\n\nconst search = instantsearch();\n\nsearch.addWidget(instantsearch.widgets.hits({}));\nsearch.addWidget(instantsearch.widgets.hits({}));\n"
  },
  {
    "path": "js/instantsearch.js/scripts/transforms/__testfixtures__/addWidget-to-addWidgets/imported.output.js",
    "content": "import instantsearch from 'instantsearch.js';\n\nconst search = instantsearch();\n\nsearch.addWidgets([instantsearch.widgets.hits({})]);\nsearch.addWidgets([instantsearch.widgets.hits({})]);\n"
  },
  {
    "path": "js/instantsearch.js/scripts/transforms/__testfixtures__/addWidget-to-addWidgets/mixed.input.js",
    "content": "/* global instantsearch */\n\nconst search = instantsearch();\n\nfunction someRandomFunction() {}\n\nsearch.addWidget(instantsearch.widgets.hits({}));\n\nsomeRandomFunction();\n\nsearch.addWidget(instantsearch.widgets.hits({}));\n\nsearch.addWidgets([instantsearch.widgets.hits({})]);\n\nsearch.addWidget(instantsearch.widgets.hits({}));\n"
  },
  {
    "path": "js/instantsearch.js/scripts/transforms/__testfixtures__/addWidget-to-addWidgets/mixed.output.js",
    "content": "/* global instantsearch */\n\nconst search = instantsearch();\n\nfunction someRandomFunction() {}\n\nsearch.addWidgets([instantsearch.widgets.hits({})]);\n\nsomeRandomFunction();\n\nsearch.addWidgets([instantsearch.widgets.hits({})]);\n\nsearch.addWidgets([instantsearch.widgets.hits({})]);\n\nsearch.addWidgets([instantsearch.widgets.hits({})]);\n"
  },
  {
    "path": "js/instantsearch.js/scripts/transforms/__testfixtures__/addWidget-to-addWidgets/remove.input.js",
    "content": "/* global instantsearch */\n\nconst search = instantsearch();\n\nconst hits = instantsearch.widgets.hits({});\n\nsearch.addWidget(hits);\n\nsearch.removeWidget(hits);\n\nsearch.addWidget(hits);\n"
  },
  {
    "path": "js/instantsearch.js/scripts/transforms/__testfixtures__/addWidget-to-addWidgets/remove.output.js",
    "content": "/* global instantsearch */\n\nconst search = instantsearch();\n\nconst hits = instantsearch.widgets.hits({});\n\nsearch.addWidgets([hits]);\n\nsearch.removeWidgets([hits]);\n\nsearch.addWidgets([hits]);\n"
  },
  {
    "path": "js/instantsearch.js/scripts/transforms/__tests__/addWidget-to-addWidgets.test.js",
    "content": "/* eslint-disable import/no-commonjs */\nconst defineTest = require('jscodeshift/dist/testUtils').defineTest;\n\ndefineTest(\n  __dirname,\n  'addWidget-to-addWidgets',\n  null,\n  'addWidget-to-addWidgets/global'\n);\n\ndefineTest(\n  __dirname,\n  'addWidget-to-addWidgets',\n  null,\n  'addWidget-to-addWidgets/imported'\n);\n\ndefineTest(\n  __dirname,\n  'addWidget-to-addWidgets',\n  null,\n  'addWidget-to-addWidgets/mixed'\n);\n\ndefineTest(\n  __dirname,\n  'addWidget-to-addWidgets',\n  null,\n  'addWidget-to-addWidgets/remove'\n);\n"
  },
  {
    "path": "js/instantsearch.js/scripts/transforms/addWidget-to-addWidgets.js",
    "content": "/* eslint-disable no-console, import/no-commonjs */\n\n// @MAJOR: remove this file and only keep only the `instantsearch-codemods` one\n// also ensure this is removed from package.json\nconsole.warn(\n  \"This file is deprecated. Please use `npx @codeshift/cli --packages 'instantsearch-codemods#addWidget-to-addWidgets' <path>` instead.\"\n);\n\nmodule.exports = require('instantsearch-codemods/src/addWidget-to-addWidgets');\n"
  },
  {
    "path": "languages/index.php",
    "content": "<?php // Silence is golden"
  },
  {
    "path": "languages/wp-search-with-algolia-it_IT.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: WP Search with Algolia\\n\"\n\"POT-Creation-Date: 2021-07-23 19:44-0500\\n\"\n\"PO-Revision-Date: 2021-07-23 19:47-0500\\n\"\n\"Last-Translator: Richard Aber <richard.aber@webdevstudios.com>\\n\"\n\"Language-Team: \\n\"\n\"Language: it_IT\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"Plural-Forms: nplurals=2; plural=(n != 1);\\n\"\n\"X-Generator: Poedit 3.0\\n\"\n\"X-Poedit-Basepath: ..\\n\"\n\"X-Poedit-Flags-xgettext: --add-comments=translators:\\n\"\n\"X-Poedit-WPHeader: algolia.php\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;\"\n\"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;\"\n\"_nx_noop:3c,1,2;__ngettext_noop:1,2\\n\"\n\"X-Poedit-SearchPath-0: .\\n\"\n\"X-Poedit-SearchPathExcluded-0: *.min.js\\n\"\n\n#. translators: placeholder 1 is minimum required PHP version, placeholder 2 is installed PHP version.\n#: algolia.php:88\n#, php-format\nmsgid \"Algolia plugin requires PHP %1$s or higher. You’re still on %2$s.\"\nmsgstr \"\"\n\"Il plugin Algolia richiede PHP %1$s o superiore. Tu sei ancora sulla \"\n\"versione %2$s.\"\n\n#. translators: placeholder 1 is minimum required WordPress version, placeholder 2 is installed WordPress version.\n#: algolia.php:97\n#, php-format\nmsgid \"\"\n\"Algolia plugin requires at least WordPress in version %1$s, You are on %2$s.\"\nmsgstr \"\"\n\"Il plugin Algolia richiede almeno la versione %1$s di Wordpress. Tu sei \"\n\"ancora sulla versione %2$s.\"\n\n#: includes/admin/class-algolia-admin-page-autocomplete.php:106\n#: includes/admin/class-algolia-admin-page-settings.php:120\nmsgid \"Algolia Search\"\nmsgstr \"Ricerca Algolia\"\n\n#: includes/admin/class-algolia-admin-page-autocomplete.php:114\n#: includes/admin/class-algolia-admin-page-autocomplete.php:115\nmsgid \"Autocomplete\"\nmsgstr \"Autocompletamento\"\n\n#: includes/admin/class-algolia-admin-page-autocomplete.php:138\nmsgid \"Enable autocomplete\"\nmsgstr \"Abilita autocompletamento\"\n\n#: includes/admin/class-algolia-admin-page-autocomplete.php:146\nmsgid \"Configuration\"\nmsgstr \"Configurazione\"\n\n#: includes/admin/class-algolia-admin-page-autocomplete.php:187\nmsgid \"\"\n\"Autocomplete configuration has been saved. Make sure to hit the \\\"re-index\\\" \"\n\"buttons of the different indices that are not indexed yet.\"\nmsgstr \"\"\n\"La configurazione di autocompletamento è stata salvata. Assicurati di \"\n\"premere i pulsanti di \\\"ri-indicizzazione\\\" sui differenti indici che non \"\n\"sono stati ancora indicizzati.\"\n\n#. translators: placeholder contains the URL to the autocomplete configuration page.\n#: includes/admin/class-algolia-admin-page-autocomplete.php:250\n#, php-format\nmsgid \"\"\n\"Please select one or multiple indices on the <a href=\\\"%s\\\">Algolia: \"\n\"Autocomplete configuration page</a>.\"\nmsgstr \"\"\n\"Seleziona uno o più indici nella  <a href=\\\"%s\\\">Algolia: pagina di \"\n\"configurazione autocompletamento</a>.\"\n\n#: includes/admin/class-algolia-admin-page-autocomplete.php:252\nmsgid \"\"\n\"You have enabled the Algolia Autocomplete feature but did not choose any \"\n\"index to search in.\"\nmsgstr \"\"\n\"Hai abilita la funzione di autocompletamento di Algolia ma non hai ancora \"\n\"selezionato nessun indice in cui cercare.\"\n\n#: includes/admin/class-algolia-admin-page-autocomplete.php:265\nmsgid \"\"\n\"The autocomplete feature adds a find-as-you-type dropdown menu to your \"\n\"search bar(s).\"\nmsgstr \"\"\n\"L'autocompletamento aggiunge un menu a discesa trova-mentre-scrivi alla tua \"\n\"barra di ricerca.\"\n\n#: includes/admin/class-algolia-admin-page-native-search.php:93\n#: includes/admin/class-algolia-admin-page-native-search.php:94\nmsgid \"Search Page\"\nmsgstr \"Pagina di ricerca\"\n\n#: includes/admin/class-algolia-admin-page-native-search.php:117\nmsgid \"Search results\"\nmsgstr \"Risultati di ricerca\"\n\n#: includes/admin/class-algolia-admin-page-native-search.php:154\nmsgid \"WordPress search is now based on Algolia!\"\nmsgstr \"La ricerca di Wordpress adesso è basato su  Angolia!\"\n\n#: includes/admin/class-algolia-admin-page-native-search.php:161\nmsgid \"WordPress search is now based on Algolia instantsearch.js!\"\nmsgstr \"La ricerca di Wordpress adesso è basata su Algolia instantsearch.js!\"\n\n#: includes/admin/class-algolia-admin-page-native-search.php:169\nmsgid \"\"\n\"You chose to keep the WordPress native search instead of Algolia. If you are \"\n\"using the autocomplete feature of the plugin we highly recommend you turn \"\n\"Algolia search on instead of the WordPress native search.\"\nmsgstr \"\"\n\"Hai scelto di mantenere la funzione di ricerca nativa di Wordpress invece di \"\n\"usare Algolia. Se stai usando la funzione di autocompletamento del plugin ti \"\n\"raccomandiamo caldamente di attivare la ricerca di Algolia al post della \"\n\"ricerca nativa di Wordpress.\"\n\n#. translators: placeholder contains the link to the indexing page.\n#: includes/admin/class-algolia-admin-page-native-search.php:213\n#, php-format\nmsgid \"\"\n\"Searchable posts index needs to be checked on the <a href=\\\"%s\\\">Algolia: \"\n\"Indexing page</a> for the search results to be powered by Algolia.\"\nmsgstr \"\"\n\"L'indice degli articoli ricercabili ha bisogno di essere selezionato nella \"\n\"<a href=\\\"%s\\\">Algolia: Pagina di indicizzazione</a> affinchè i risultati di \"\n\"ricerca siano offerti da Algolia.\"\n\n#: includes/admin/class-algolia-admin-page-native-search.php:227\nmsgid \"\"\n\"By enabling this plugin to override the native WordPress search, your search \"\n\"results will be powered by Algolia's typo-tolerant & relevant search \"\n\"algorithms.\"\nmsgstr \"\"\n\"Abilitando questo plugin verrà sovrascritta la ricerca nativa di Wordpress, \"\n\"i tuoi risultati di ricerca saranno offerti dagli algoritmi di Algolia.\"\n\n#: includes/admin/class-algolia-admin-page-native-search.php:239\nmsgid \"\"\n\"You have no index containing only posts yet. Please index some content on \"\n\"the `Indexing` page.\"\nmsgstr \"\"\n\"Non hai ancora nessun indice contenente solo articoli. Indicizza un pò di \"\n\"contenuto nella pagina 'Indicizzazione'.\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:101\n#: includes/admin/class-algolia-admin-page-settings.php:130\n#: includes/admin/class-algolia-admin-page-settings.php:131\nmsgid \"Settings\"\nmsgstr \"Impostazioni\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:154\nmsgid \"Application ID\"\nmsgstr \"ID applicazione\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:162\nmsgid \"Search-only API key\"\nmsgstr \"Chiave API solo ricerca\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:170\nmsgid \"Admin API key\"\nmsgstr \"Chiave API Admin\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:178\nmsgid \"Index name prefix\"\nmsgstr \"Prefisso nome indice\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:186\nmsgid \"Remove Algolia powered by logo\"\nmsgstr \"Rimuovi il luogo powered by Algolia\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:212\nmsgid \"Your Algolia Application ID.\"\nmsgstr \"Il tuo application ID Algolia.\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:229\nmsgid \"Your Algolia Search-only API key (public).\"\nmsgstr \"La tua chiave di sola ricerca Algolia (pubblica).\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:245\nmsgid \"Your Algolia ADMIN API key (kept private).\"\nmsgstr \"La tua chiave API ADMIN di Algolia ( mantinenila segreta).\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:261\nmsgid \"This prefix will be prepended to your index names.\"\nmsgstr \"Questo prefisso verrà anteposto ai nomi dei tuoi indici.\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:278\nmsgid \"\"\n\"This will remove the Algolia logo from the autocomplete and the search page. \"\n\"We require that you keep the Algolia logo if you are using a free plan.\"\nmsgstr \"\"\n\"Questo permetterà di rimuovere il logo di Algolia dall'autocompletamento e \"\n\"dalla pagina di ricerca. E' richiesto mantenere il logo se si sta usando un \"\n\"piano gratuito.\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:301\nmsgid \"Application ID should not be empty.\"\nmsgstr \"Il campo ID applicazione non può essere vuoto.\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:329\nmsgid \"Search-only API key should not be empty.\"\nmsgstr \"Il campo API solo ricerca non può essere vuoto.\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:356\nmsgid \"API key should not be empty\"\nmsgstr \"Il campo chiave API non può essere vuoto\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:386\nmsgid \"\"\n\"We were unable to authenticate you against the Algolia servers with the \"\n\"provided information. Please ensure that you used a valid Application ID and \"\n\"Admin API key.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:397\nmsgid \"\"\n\"It looks like your search API key is wrong. Ensure that the key you entered \"\n\"has only the search capability and nothing else. Also ensure that the key \"\n\"has no limited time validity.\"\nmsgstr \"\"\n\"Sembra che la chiave API di ricerca sia sbagliata. Assicuratevi che la \"\n\"chiave inserita abbia solo la capacità di ricerca e nient'altro. Assicurarsi \"\n\"inoltre che la chiave non abbia una validità limitata nel tempo.\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:406\nmsgid \"\"\n\"We succesfully managed to connect to the Algolia servers with the provided \"\n\"information. Your search API key has also been checked and is OK.\"\nmsgstr \"\"\n\"Abbiamo gestito correttamente il collegamento ai server Algolia con le \"\n\"informazioni fornite. La tua chiave API di ricerca è stata controllata ed è \"\n\"OK.\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:454\nmsgid \"\"\n\"Indices prefix can only contain alphanumeric characters and underscores.\"\nmsgstr \"\"\n\"Il prefisso degli indici può contenere solo caratteri alfanumerici e \"\n\"sottolineature.\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:503\nmsgid \"\"\n\"Configure your Algolia account credentials. You can find them in the \\\"API \"\n\"Keys\\\" section of your Algolia dashboard.\"\nmsgstr \"\"\n\"Configura qui le tua credenziali di Algolia. Le puoi trovare nella sezione \"\n\"\\\"Chiavi API\\\" della dashboard di Algolia.\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:504\nmsgid \"\"\n\"Once you provide your Algolia Application ID and API key, this plugin will \"\n\"be able to securely communicate with Algolia servers.\"\nmsgstr \"\"\n\"Una volta che avrai inserito il tuo ID applicazione e la chiave API di \"\n\"Algolia, questo plugin sarà in grado di comunicare in modo sicuro con i \"\n\"server di Algolia.\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:504\nmsgid \"\"\n\"We ensure your information is correct by testing them against the Algolia \"\n\"servers upon save.\"\nmsgstr \"\"\n\"Ci assicuriamo che le tue informazioni siano corrette confrontandole con \"\n\"quelle dei server di Algolia al momento del salvataggio.\"\n\n#. translators: the placeholder contains the URL to Algolia's website.\n#: includes/admin/class-algolia-admin-page-settings.php:506\n#, php-format\nmsgid \"\"\n\"No Algolia account yet? <a href=\\\"%s\\\">Follow this link</a> to create one \"\n\"for free in a couple of minutes!\"\nmsgstr \"\"\n\"Non hai ancora un account Algolia? <a href=\\\"%s\\\"> Segui questo link </a> \"\n\"per crearne uno in pochi minuti!\"\n\n#: includes/admin/class-algolia-admin-template-notices.php:65\n#, php-format\nmsgid \"\"\n\"Your custom WP Search With Algolia template file, %1$s, version %2$s is out \"\n\"of date. The core version is %3$s\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-template-notices.php:69\nmsgid \"unknown\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin.php:113\nmsgid \"\"\n\"Algolia Search requires the \\\"mbstring\\\" PHP extension to be enabled. Please \"\n\"contact your hosting provider.\"\nmsgstr \"\"\n\"Algolia Search richiede che l'estensione PHP \\\"mbstring\\\" sia abilitata. \"\n\"Contatta il tuo fornitore dell'hosting.\"\n\n#: includes/admin/class-algolia-admin.php:117\nmsgid \"\"\n\"Algolia needs \\\"mbregex\\\" NOT to be disabled. Please contact your hosting \"\n\"provider.\"\nmsgstr \"\"\n\"Algolia ha bisogno che \\\"mbregex\\\" NON sia disabilitato. Contatta il tuo \"\n\"fornitore dell'hosting.\"\n\n#: includes/admin/class-algolia-admin.php:123\nmsgid \"\"\n\"Algolia Search requires the \\\"cURL\\\" PHP extension to be enabled. Please \"\n\"contact your hosting provider.\"\nmsgstr \"\"\n\"Algolia Search richiede che l'estensione PHP \\\"cURL\\\" sia abilitata. \"\n\"Contatta il tuo fornitore dell'hosting.\"\n\n#. translators: placeholder contains the URL to the caching plugin's config page.\n#: includes/admin/class-algolia-admin.php:151\n#, php-format\nmsgid \"\"\n\"In order for <strong>database caching</strong> to work with Algolia you must \"\n\"add <code>algolia_</code> to the \\\"Ignored Query Stems\\\" option in W3 Total \"\n\"Cache settings <a href=\\\"%s\\\">here</a>.\"\nmsgstr \"\"\n\"Affinché il <strong>database caching</strong> funzioni con Algolia devi \"\n\"aggiungere <code>algolia_</code> nell'opzione \\\"Ignored Query Stems\\\" nelle \"\n\"impostazioni di W3 Total Cache <a href=\\\"%s\\\">qui</a>.\"\n\n#: includes/admin/class-algolia-admin.php:188\n#, php-format\nmsgid \"\"\n\"For Algolia search to work properly, you need to index: <strong>%1$s</strong>\"\nmsgstr \"\"\n\"Affinché la ricerca in Algolia funzioni correttamente, è necessario \"\n\"indicizzare: <strong>%1$s</strong>\"\n\n#: includes/admin/class-algolia-admin.php:197\nmsgid \"Index now\"\nmsgstr \"Indice ora\"\n\n#: includes/admin/partials/form-override-search-option.php:17\nmsgid \"Do not use Algolia\"\nmsgstr \"Non usare Algolia\"\n\n#: includes/admin/partials/form-override-search-option.php:23\nmsgid \"\"\n\"Do not use Algolia for searching at all.<br/>This is only a valid option if \"\n\"you wish to search on your content from another website.\"\nmsgstr \"\"\n\"Non utilizzare Algolia per la ricerca.<br/>Questa è un'opzione valida solo \"\n\"se si desidera cercare il contenuto di un altro sito web.\"\n\n#: includes/admin/partials/form-override-search-option.php:36\nmsgid \"Use Algolia in the backend\"\nmsgstr \"Usa Algolia nel backend\"\n\n#: includes/admin/partials/form-override-search-option.php:42\nmsgid \"\"\n\"With this option WordPress search will be powered by Algolia behind the \"\n\"scenes.<br/>This will allow your search results to be typo tolerant.<br/\"\n\"><b>This option does not support filtering and displaying instant search \"\n\"results but has the advantage to play nicely with any theme.</b>\"\nmsgstr \"\"\n\"Con questa opzione la ricerca WordPress sarà alimentata dall'Algolia dietro \"\n\"le quinte.<br/>In questo modo i risultati della tua ricerca saranno \"\n\"tolleranti al tipo di digitazione.<br/><b>Questa opzione non supporta il \"\n\"filtraggio e la visualizzazione dei risultati della ricerca istantanea, ma \"\n\"ha il vantaggio di giocare bene con qualsiasi tema.</b>\"\n\n#: includes/admin/partials/form-override-search-option.php:56\nmsgid \"Use Algolia with Instantsearch.js\"\nmsgstr \"Usa Algolia con instantsearch.js\"\n\n#: includes/admin/partials/form-override-search-option.php:62\nmsgid \"\"\n\"This will replace the search page with an instant search experience powered \"\n\"by Algolia.<br/>By default you will be able to filter by post type, \"\n\"categories, tags and authors.<br/>Please note that the plugin is shipped \"\n\"with some sensible default styling rules<br/>but it could require some CSS \"\n\"adjustments to provide an optimal search experience.\"\nmsgstr \"\"\n\"Questo sostituirà la pagina di ricerca con un'esperienza di ricerca \"\n\"istantanea powered by Algolia.<br/>Per impostazione predefinita è possibile \"\n\"filtrare per tipo di messaggio, categorie, tag e autori.<br/>Si prega di \"\n\"notare che il plugin viene fornito con alcune ragionevoli regole di stile \"\n\"predefinito,<br/>ma potrebbe richiedere alcune modifiche ai CSS per fornire \"\n\"un'esperienza di ricerca ottimale.\"\n\n#: includes/admin/partials/page-autocomplete-config.php:17\nmsgid \"Enable\"\nmsgstr \"Abilita\"\n\n#: includes/admin/partials/page-autocomplete-config.php:18\nmsgid \"Index\"\nmsgstr \"Indice\"\n\n#: includes/admin/partials/page-autocomplete-config.php:19\nmsgid \"Label\"\nmsgstr \"Etichetta\"\n\n#: includes/admin/partials/page-autocomplete-config.php:20\nmsgid \"Max. Suggestions\"\nmsgstr \"Suggerimenti Massimi\"\n\n#: includes/admin/partials/page-autocomplete-config.php:21\nmsgid \"Actions\"\nmsgstr \"Azioni\"\n\n#. translators: placeholder is the name of an Algolia search index.\n#: includes/admin/partials/page-autocomplete-config.php:40\n#, php-format\nmsgid \"Index name: %s\"\nmsgstr \"Nome indice: %s\"\n\n#: includes/admin/partials/page-autocomplete-config.php:53\nmsgid \"Re-index\"\nmsgstr \"Ri-indicizza\"\n\n#: includes/admin/partials/page-autocomplete-config.php:54\n#: includes/admin/partials/page-search.php:20\nmsgid \"Push Settings\"\nmsgstr \"Invia impostazioni\"\n\n#: includes/admin/partials/page-autocomplete-config.php:61\nmsgid \"Configure here the indices you want to display in the dropdown menu.\"\nmsgstr \"Configura qui gli indici che vuoi visualizzare nel menu a discesa.\"\n\n#: includes/admin/partials/page-autocomplete-config.php:63\nmsgid \"\"\n\"Use the `Max. Suggestions` column to configure the number of entries that \"\n\"will be displayed by section.\"\nmsgstr \"\"\n\"Usa la colonna 'Suggerimenti Massimi' per configurare il numero di voci che \"\n\"verranno visualizzate per sezione.\"\n\n#: includes/admin/partials/page-autocomplete-config.php:65\nmsgid \"\"\n\"Use the `Position` column to reflect the order of the sections in the \"\n\"dropdown menu.\"\nmsgstr \"\"\n\"Usa la colonna 'Posizione' per riflette l'ordine delle sezioni nel menu a \"\n\"discesa.\"\n\n#: includes/admin/partials/page-search.php:17\nmsgid \"Re-index search page records\"\nmsgstr \"Ri-indicizza le voci della pagina di ricerca\"\n\n#. translators: the placeholder will contain the name of the index.\n#: includes/class-algolia-cli.php:117\n#, php-format\nmsgid \"About to clear index %s...\"\nmsgstr \"Pulizia dell'indice %s...\"\n\n#. translators: the placeholder will contain the name of the index.\n#: includes/class-algolia-cli.php:120\n#, php-format\nmsgid \"Correctly cleared index \\\"%s\\\".\"\nmsgstr \"Indice \\\"%s\\\" pulito correttamente.\"\n\n#: includes/indices/class-algolia-searchable-posts-index.php:78\nmsgid \"All posts\"\nmsgstr \"Tutti gli articoli\"\n\n#: includes/indices/class-algolia-users-index.php:37\n#: templates/instantsearch.php:41\nmsgid \"Users\"\nmsgstr \"Utenti\"\n\n#. translators: placeholder 1 is current plugin version, placeholder 2 is the available update version.\n#: includes/utilities/class-algolia-update-messages.php:92\n#, php-format\nmsgid \"\"\n\"This is a major version update, from %1$s to %2$s, which may contain \"\n\"backwards incompatible changes.\"\nmsgstr \"\"\n\n#: templates/autocomplete.php:91\nmsgid \"No results matched your query \"\nmsgstr \"Nessun risultato corrisponde alla tua ricerca \"\n\n#: templates/instantsearch.php:29\nmsgid \"Post Types\"\nmsgstr \"\"\n\n#: templates/instantsearch.php:33\nmsgid \"Categories\"\nmsgstr \"Categorie\"\n\n#: templates/instantsearch.php:37\nmsgid \"Tags\"\nmsgstr \"\"\n\n#. Plugin Name of the plugin/theme\nmsgid \"WP Search with Algolia\"\nmsgstr \"\"\n\n#. Plugin URI of the plugin/theme\nmsgid \"https://github.com/WebDevStudios/wp-search-with-algolia\"\nmsgstr \"\"\n\n#. Description of the plugin/theme\nmsgid \"Integrate the powerful Algolia search service with WordPress\"\nmsgstr \"\"\n\n#. Author of the plugin/theme\nmsgid \"WebDevStudios\"\nmsgstr \"\"\n\n#. Author URI of the plugin/theme\nmsgid \"https://webdevstudios.com\"\nmsgstr \"\"\n\n#~ msgid \"\"\n#~ \"We were unable to authenticate you against the Algolia servers with the \"\n#~ \"provided information. Please ensure that you used an the Admin API key \"\n#~ \"and a valid Application ID.\"\n#~ msgstr \"\"\n#~ \"Non siamo stati in grado di autenticarvi contro i server dell'Algolia con \"\n#~ \"le informazioni fornite. Assicurati di aver utilizzato una chiave API di \"\n#~ \"amministrazione e un ID applicazione valido.\"\n"
  },
  {
    "path": "languages/wp-search-with-algolia.pot",
    "content": "#, fuzzy\nmsgid \"\"\nmsgstr \"\"\n\"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\\n\"\n\"Project-Id-Version: WP Search with Algolia\\n\"\n\"POT-Creation-Date: 2021-07-23 19:44-0500\\n\"\n\"PO-Revision-Date: 2021-07-23 19:44-0500\\n\"\n\"Last-Translator: Richard Aber <richard.aber@webdevstudios.com>\\n\"\n\"Language-Team: Richard Aber <richard.aber@webdevstudios.com>\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Generator: Poedit 3.0\\n\"\n\"X-Poedit-Basepath: ..\\n\"\n\"X-Poedit-Flags-xgettext: --add-comments=translators:\\n\"\n\"X-Poedit-WPHeader: algolia.php\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;\"\n\"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;\"\n\"_nx_noop:3c,1,2;__ngettext_noop:1,2\\n\"\n\"X-Poedit-SearchPath-0: .\\n\"\n\"X-Poedit-SearchPathExcluded-0: *.min.js\\n\"\n\"X-Poedit-SearchPathExcluded-1: vendor\\n\"\n\"X-Poedit-SearchPathExcluded-2: node_modules\\n\"\n\n#. translators: placeholder 1 is minimum required PHP version, placeholder 2 is installed PHP version.\n#: algolia.php:88\n#, php-format\nmsgid \"Algolia plugin requires PHP %1$s or higher. You’re still on %2$s.\"\nmsgstr \"\"\n\n#. translators: placeholder 1 is minimum required WordPress version, placeholder 2 is installed WordPress version.\n#: algolia.php:97\n#, php-format\nmsgid \"\"\n\"Algolia plugin requires at least WordPress in version %1$s, You are on %2$s.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-autocomplete.php:106\n#: includes/admin/class-algolia-admin-page-settings.php:120\nmsgid \"Algolia Search\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-autocomplete.php:114\n#: includes/admin/class-algolia-admin-page-autocomplete.php:115\nmsgid \"Autocomplete\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-autocomplete.php:138\nmsgid \"Enable autocomplete\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-autocomplete.php:146\nmsgid \"Configuration\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-autocomplete.php:187\nmsgid \"\"\n\"Autocomplete configuration has been saved. Make sure to hit the \\\"re-index\\\" \"\n\"buttons of the different indices that are not indexed yet.\"\nmsgstr \"\"\n\n#. translators: placeholder contains the URL to the autocomplete configuration page.\n#: includes/admin/class-algolia-admin-page-autocomplete.php:250\n#, php-format\nmsgid \"\"\n\"Please select one or multiple indices on the <a href=\\\"%s\\\">Algolia: \"\n\"Autocomplete configuration page</a>.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-autocomplete.php:252\nmsgid \"\"\n\"You have enabled the Algolia Autocomplete feature but did not choose any \"\n\"index to search in.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-autocomplete.php:265\nmsgid \"\"\n\"The autocomplete feature adds a find-as-you-type dropdown menu to your \"\n\"search bar(s).\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-native-search.php:93\n#: includes/admin/class-algolia-admin-page-native-search.php:94\nmsgid \"Search Page\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-native-search.php:117\nmsgid \"Search results\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-native-search.php:154\nmsgid \"WordPress search is now based on Algolia!\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-native-search.php:161\nmsgid \"WordPress search is now based on Algolia instantsearch.js!\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-native-search.php:169\nmsgid \"\"\n\"You chose to keep the WordPress native search instead of Algolia. If you are \"\n\"using the autocomplete feature of the plugin we highly recommend you turn \"\n\"Algolia search on instead of the WordPress native search.\"\nmsgstr \"\"\n\n#. translators: placeholder contains the link to the indexing page.\n#: includes/admin/class-algolia-admin-page-native-search.php:213\n#, php-format\nmsgid \"\"\n\"Searchable posts index needs to be checked on the <a href=\\\"%s\\\">Algolia: \"\n\"Indexing page</a> for the search results to be powered by Algolia.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-native-search.php:227\nmsgid \"\"\n\"By enabling this plugin to override the native WordPress search, your search \"\n\"results will be powered by Algolia's typo-tolerant & relevant search \"\n\"algorithms.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-native-search.php:239\nmsgid \"\"\n\"You have no index containing only posts yet. Please index some content on \"\n\"the `Indexing` page.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:101\n#: includes/admin/class-algolia-admin-page-settings.php:130\n#: includes/admin/class-algolia-admin-page-settings.php:131\nmsgid \"Settings\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:154\nmsgid \"Application ID\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:162\nmsgid \"Search-only API key\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:170\nmsgid \"Admin API key\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:178\nmsgid \"Index name prefix\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:186\nmsgid \"Remove Algolia powered by logo\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:212\nmsgid \"Your Algolia Application ID.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:229\nmsgid \"Your Algolia Search-only API key (public).\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:245\nmsgid \"Your Algolia ADMIN API key (kept private).\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:261\nmsgid \"This prefix will be prepended to your index names.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:278\nmsgid \"\"\n\"This will remove the Algolia logo from the autocomplete and the search page. \"\n\"We require that you keep the Algolia logo if you are using a free plan.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:301\nmsgid \"Application ID should not be empty.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:329\nmsgid \"Search-only API key should not be empty.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:356\nmsgid \"API key should not be empty\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:386\nmsgid \"\"\n\"We were unable to authenticate you against the Algolia servers with the \"\n\"provided information. Please ensure that you used a valid Application ID and \"\n\"Admin API key.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:397\nmsgid \"\"\n\"It looks like your search API key is wrong. Ensure that the key you entered \"\n\"has only the search capability and nothing else. Also ensure that the key \"\n\"has no limited time validity.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:406\nmsgid \"\"\n\"We succesfully managed to connect to the Algolia servers with the provided \"\n\"information. Your search API key has also been checked and is OK.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:454\nmsgid \"\"\n\"Indices prefix can only contain alphanumeric characters and underscores.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:503\nmsgid \"\"\n\"Configure your Algolia account credentials. You can find them in the \\\"API \"\n\"Keys\\\" section of your Algolia dashboard.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:504\nmsgid \"\"\n\"Once you provide your Algolia Application ID and API key, this plugin will \"\n\"be able to securely communicate with Algolia servers.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-page-settings.php:504\nmsgid \"\"\n\"We ensure your information is correct by testing them against the Algolia \"\n\"servers upon save.\"\nmsgstr \"\"\n\n#. translators: the placeholder contains the URL to Algolia's website.\n#: includes/admin/class-algolia-admin-page-settings.php:506\n#, php-format\nmsgid \"\"\n\"No Algolia account yet? <a href=\\\"%s\\\">Follow this link</a> to create one \"\n\"for free in a couple of minutes!\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-template-notices.php:65\n#, php-format\nmsgid \"\"\n\"Your custom WP Search With Algolia template file, %1$s, version %2$s is out \"\n\"of date. The core version is %3$s\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin-template-notices.php:69\nmsgid \"unknown\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin.php:113\nmsgid \"\"\n\"Algolia Search requires the \\\"mbstring\\\" PHP extension to be enabled. Please \"\n\"contact your hosting provider.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin.php:117\nmsgid \"\"\n\"Algolia needs \\\"mbregex\\\" NOT to be disabled. Please contact your hosting \"\n\"provider.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin.php:123\nmsgid \"\"\n\"Algolia Search requires the \\\"cURL\\\" PHP extension to be enabled. Please \"\n\"contact your hosting provider.\"\nmsgstr \"\"\n\n#. translators: placeholder contains the URL to the caching plugin's config page.\n#: includes/admin/class-algolia-admin.php:151\n#, php-format\nmsgid \"\"\n\"In order for <strong>database caching</strong> to work with Algolia you must \"\n\"add <code>algolia_</code> to the \\\"Ignored Query Stems\\\" option in W3 Total \"\n\"Cache settings <a href=\\\"%s\\\">here</a>.\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin.php:188\n#, php-format\nmsgid \"\"\n\"For Algolia search to work properly, you need to index: <strong>%1$s</strong>\"\nmsgstr \"\"\n\n#: includes/admin/class-algolia-admin.php:197\nmsgid \"Index now\"\nmsgstr \"\"\n\n#: includes/admin/partials/form-override-search-option.php:17\nmsgid \"Do not use Algolia\"\nmsgstr \"\"\n\n#: includes/admin/partials/form-override-search-option.php:23\nmsgid \"\"\n\"Do not use Algolia for searching at all.<br/>This is only a valid option if \"\n\"you wish to search on your content from another website.\"\nmsgstr \"\"\n\n#: includes/admin/partials/form-override-search-option.php:36\nmsgid \"Use Algolia in the backend\"\nmsgstr \"\"\n\n#: includes/admin/partials/form-override-search-option.php:42\nmsgid \"\"\n\"With this option WordPress search will be powered by Algolia behind the \"\n\"scenes.<br/>This will allow your search results to be typo tolerant.<br/\"\n\"><b>This option does not support filtering and displaying instant search \"\n\"results but has the advantage to play nicely with any theme.</b>\"\nmsgstr \"\"\n\n#: includes/admin/partials/form-override-search-option.php:56\nmsgid \"Use Algolia with Instantsearch.js\"\nmsgstr \"\"\n\n#: includes/admin/partials/form-override-search-option.php:62\nmsgid \"\"\n\"This will replace the search page with an instant search experience powered \"\n\"by Algolia.<br/>By default you will be able to filter by post type, \"\n\"categories, tags and authors.<br/>Please note that the plugin is shipped \"\n\"with some sensible default styling rules<br/>but it could require some CSS \"\n\"adjustments to provide an optimal search experience.\"\nmsgstr \"\"\n\n#: includes/admin/partials/page-autocomplete-config.php:17\nmsgid \"Enable\"\nmsgstr \"\"\n\n#: includes/admin/partials/page-autocomplete-config.php:18\nmsgid \"Index\"\nmsgstr \"\"\n\n#: includes/admin/partials/page-autocomplete-config.php:19\nmsgid \"Label\"\nmsgstr \"\"\n\n#: includes/admin/partials/page-autocomplete-config.php:20\nmsgid \"Max. Suggestions\"\nmsgstr \"\"\n\n#: includes/admin/partials/page-autocomplete-config.php:21\nmsgid \"Actions\"\nmsgstr \"\"\n\n#. translators: placeholder is the name of an Algolia search index.\n#: includes/admin/partials/page-autocomplete-config.php:40\n#, php-format\nmsgid \"Index name: %s\"\nmsgstr \"\"\n\n#: includes/admin/partials/page-autocomplete-config.php:53\nmsgid \"Re-index\"\nmsgstr \"\"\n\n#: includes/admin/partials/page-autocomplete-config.php:54\n#: includes/admin/partials/page-search.php:20\nmsgid \"Push Settings\"\nmsgstr \"\"\n\n#: includes/admin/partials/page-autocomplete-config.php:61\nmsgid \"Configure here the indices you want to display in the dropdown menu.\"\nmsgstr \"\"\n\n#: includes/admin/partials/page-autocomplete-config.php:63\nmsgid \"\"\n\"Use the `Max. Suggestions` column to configure the number of entries that \"\n\"will be displayed by section.\"\nmsgstr \"\"\n\n#: includes/admin/partials/page-autocomplete-config.php:65\nmsgid \"\"\n\"Use the `Position` column to reflect the order of the sections in the \"\n\"dropdown menu.\"\nmsgstr \"\"\n\n#: includes/admin/partials/page-search.php:17\nmsgid \"Re-index search page records\"\nmsgstr \"\"\n\n#. translators: the placeholder will contain the name of the index.\n#: includes/class-algolia-cli.php:117\n#, php-format\nmsgid \"About to clear index %s...\"\nmsgstr \"\"\n\n#. translators: the placeholder will contain the name of the index.\n#: includes/class-algolia-cli.php:120\n#, php-format\nmsgid \"Correctly cleared index \\\"%s\\\".\"\nmsgstr \"\"\n\n#: includes/indices/class-algolia-searchable-posts-index.php:78\nmsgid \"All posts\"\nmsgstr \"\"\n\n#: includes/indices/class-algolia-users-index.php:37\n#: templates/instantsearch.php:41\nmsgid \"Users\"\nmsgstr \"\"\n\n#. translators: placeholder 1 is current plugin version, placeholder 2 is the available update version.\n#: includes/utilities/class-algolia-update-messages.php:92\n#, php-format\nmsgid \"\"\n\"This is a major version update, from %1$s to %2$s, which may contain \"\n\"backwards incompatible changes.\"\nmsgstr \"\"\n\n#: templates/autocomplete.php:91\nmsgid \"No results matched your query \"\nmsgstr \"\"\n\n#: templates/instantsearch.php:29\nmsgid \"Post Types\"\nmsgstr \"\"\n\n#: templates/instantsearch.php:33\nmsgid \"Categories\"\nmsgstr \"\"\n\n#: templates/instantsearch.php:37\nmsgid \"Tags\"\nmsgstr \"\"\n\n#. Plugin Name of the plugin/theme\nmsgid \"WP Search with Algolia\"\nmsgstr \"\"\n\n#. Plugin URI of the plugin/theme\nmsgid \"https://github.com/WebDevStudios/wp-search-with-algolia\"\nmsgstr \"\"\n\n#. Description of the plugin/theme\nmsgid \"Integrate the powerful Algolia search service with WordPress\"\nmsgstr \"\"\n\n#. Author of the plugin/theme\nmsgid \"WebDevStudios\"\nmsgstr \"\"\n\n#. Author URI of the plugin/theme\nmsgid \"https://webdevstudios.com\"\nmsgstr \"\"\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"wp-search-with-algolia\",\n  \"version\": \"2.11.3\",\n  \"description\": \"Integrate the powerful Algolia search service with WordPress.\",\n  \"author\": \"WebDevStudios\",\n  \"license\": \"GPL-3.0\",\n  \"keywords\": [\n    \"algolia\"\n  ],\n  \"homepage\": \"https://github.com/WebDevStudios/wp-search-with-algolia\",\n  \"engines\": {\n    \"node\": \"^12.0.0\",\n    \"npm\": \"^6.0.0\"\n  },\n  \"dependencies\": {\n    \"algoliasearch\": \"^4.18.0\",\n    \"autocomplete.js\": \"^0.38.0\",\n    \"instantsearch.js\": \"^4.78.3\"\n  },\n  \"devDependencies\": {\n    \"frontend-dependencies\": \"^2.0.0\"\n  },\n  \"frontendDependencies\": {\n    \"target\": \"js/\",\n    \"packages\": {\n      \"algoliasearch\": \"^4.18.0\",\n      \"autocomplete.js\": \"^0.38.0\",\n      \"instantsearch.js\": \"^4.78.3\"\n    }\n  },\n  \"scripts\": {\n    \"postinstall\": \"node ./node_modules/frontend-dependencies/index.js\"\n  }\n}\n"
  },
  {
    "path": "phpcs.xml",
    "content": "<?xml version=\"1.0\"?>\n<ruleset name=\"WP Search With Algolia Coding Standards\">\n\n\t<exclude name=\"Squiz.Commenting.FunctionCommentThrowTag.WrongNumber\"/>\n\n\t<description>\n\t\tCoding standards configuration for WP Search With Algolia.\n\t</description>\n\n\t<!-- Only scan PHP files. -->\n\t<arg name=\"extensions\" value=\"php\"/>\n\n\t<!-- Whenever possible, cache the scan results and re-use those for unchanged files on the next scan. -->\n\t<arg name=\"cache\"/>\n\n\t<!-- Set the memory limit to 256M.\n\t\tFor most standard PHP configurations, this means the memory limit will temporarily be raised.\n\t\tRef: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#specifying-phpini-settings\n\t-->\n\t<ini name=\"memory_limit\" value=\"256M\"/>\n\n\t<!-- Strip the file paths down to the relevant bit. -->\n\t<arg name=\"basepath\" value=\"./\"/>\n\n\t<!-- Show sniff codes in all reports. -->\n\t<arg value=\"ps\"/>\n\n\t<!-- What to scan. -->\n\t<file>.</file>\n\n\t<!-- What not to scan. -->\n\t<exclude-pattern>/index.php</exclude-pattern>\n\t<exclude-pattern>/.github/</exclude-pattern>\n\t<exclude-pattern>/bin/</exclude-pattern>\n\t<exclude-pattern>/config/</exclude-pattern>\n\t<exclude-pattern>/includes/libraries/</exclude-pattern>\n\t<exclude-pattern>/vendor/</exclude-pattern>\n\t<exclude-pattern>/vendor_prefixed/</exclude-pattern>\n\t<exclude-pattern>/node_modules/</exclude-pattern>\n\t<exclude-pattern>/tests/</exclude-pattern>\n\n\t<!-- Use WordPress \"Extra\" Coding Standards. -->\n\t<rule ref=\"WordPress-Extra\">\n\t\t<!-- Allow array short syntax. -->\n\t\t<exclude name=\"Generic.Arrays.DisallowShortArraySyntax\" />\n\t\t<!-- Allow short prefixes. -->\n\t\t<exclude name=\"WordPress.NamingConventions.PrefixAllGlobals.ShortPrefixPassed\"/>\n\t</rule>\n\n\t<!-- Use WordPress \"Docs\" Coding Standards. -->\n\t<rule ref=\"WordPress-Docs\" />\n\n\t<!--\n\t\tWP Search With Algolia currently supports WP 5.0+.\n\t\thttps://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#minimum-wp-version-to-check-for-usage-of-deprecated-functions-classes-and-function-parameters\n\t-->\n\t<config name=\"minimum_supported_wp_version\" value=\"5.0\"/>\n\n\t<!--\n\t\tConfigure global prefixes/namespaces.\n\t\thttps://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#naming-conventions-prefix-everything-in-the-global-namespace\n\t-->\n\t<rule ref=\"WordPress.NamingConventions.PrefixAllGlobals\">\n\t\t<properties>\n\t\t\t<!-- Value: replace the function, class, and variable prefixes used. Separate multiple prefixes with a comma. -->\n\t\t\t<property name=\"prefixes\" type=\"array\" value=\"webdevstudios,wds,wpswa,algolia\"/>\n\t\t</properties>\n\t</rule>\n\n\t<!--\n\t\tConfigure text_domain for I18n.\n\t\thttps://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#properties-strongly-recommended-to-be-set\n\t-->\n\t<rule ref=\"WordPress.WP.I18n\">\n\t\t<properties>\n\t\t\t<!-- Value: replace the text domain used. -->\n\t\t\t<property name=\"text_domain\" type=\"array\" value=\"wp-search-with-algolia\"/>\n\t\t</properties>\n\t</rule>\n\n\t<!--\n\t\tPrecision alignment should be fine in HTML.\n\t\thttps://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#precision-alignment-exempt-certain-tokens\n\t-->\n\t<rule ref=\"WordPress.WhiteSpace.PrecisionAlignment\">\n\t\t<properties>\n\t\t\t<property name=\"ignoreAlignmentTokens\" type=\"array\">\n\t\t\t\t<element value=\"T_COMMENT\"/>\n\t\t\t\t<element value=\"T_INLINE_HTML\"/>\n\t\t\t</property>\n\t\t</properties>\n\t</rule>\n\n\t<!--\n\t\tWe're PSR-4 autoloading, skip the \"class-whatever\" naming convention.\n\t\thttps://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#disregard-class-file-name-rules\n\t-->\n\t<rule ref=\"WordPress.Files.FileName\">\n\t\t<properties>\n\t\t\t<property name=\"strict_class_file_names\" value=\"false\"/>\n\t\t</properties>\n\t</rule>\n\n\t<!-- Use WordPress PHP Compatibility. -->\n\t<rule ref=\"PHPCompatibilityWP\"/>\n\n\t<!-- WPSWA currently supports PHP 7.4+. -->\n\t<config name=\"testVersion\" value=\"7.4-\"/>\n\n</ruleset>\n"
  },
  {
    "path": "templates/autocomplete.php",
    "content": "<?php\n/**\n * WP Search With Algolia autocomplete template file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @version 2.5.3\n * @package WebDevStudios\\WPSWA\n */\n\n?>\n\n<script type=\"text/html\" id=\"tmpl-autocomplete-header\">\n\t<div class=\"autocomplete-header\">\n\t\t<div class=\"autocomplete-header-title\">{{{ data.label }}}</div>\n\t\t<div class=\"clear\"></div>\n\t</div>\n</script>\n\n<script type=\"text/html\" id=\"tmpl-autocomplete-post-suggestion\">\n\t<a class=\"suggestion-link\" href=\"{{ data.permalink }}\" title=\"{{ data.post_title }}\">\n\t\t<# if ( data.images.thumbnail ) { #>\n\t\t\t<img class=\"suggestion-post-thumbnail\" src=\"{{ data.images.thumbnail.url }}\" alt=\"{{ data.post_title }}\">\n\t\t<# } #>\n\t\t<div class=\"suggestion-post-attributes\">\n\t\t\t<span class=\"suggestion-post-title\">{{{ data._highlightResult.post_title.value }}}</span>\n\t\t\t<# if ( data._snippetResult['content'] ) { #>\n\t\t\t\t<span class=\"suggestion-post-content\">{{{ data._snippetResult['content'].value }}}</span>\n\t\t\t<# } #>\n\t\t</div>\n\t\t<?php\n\t\tdo_action( 'algolia_autocomplete_after_hit' );\n\t\t?>\n\t</a>\n</script>\n\n<script type=\"text/html\" id=\"tmpl-autocomplete-term-suggestion\">\n\t<a class=\"suggestion-link\" href=\"{{ data.permalink }}\" title=\"{{ data.name }}\">\n\t\t<svg viewBox=\"0 0 21 21\" width=\"21\" height=\"21\">\n\t\t\t<svg width=\"21\" height=\"21\" viewBox=\"0 0 21 21\">\n\t\t\t\t<path\n\t\t\t\t\td=\"M4.662 8.72l-1.23 1.23c-.682.682-.68 1.792.004 2.477l5.135 5.135c.7.693 1.8.688 2.48.005l1.23-1.23 5.35-5.346c.31-.31.54-.92.51-1.36l-.32-4.29c-.09-1.09-1.05-2.06-2.15-2.14l-4.3-.33c-.43-.03-1.05.2-1.36.51l-.79.8-2.27 2.28-2.28 2.27zm9.826-.98c.69 0 1.25-.56 1.25-1.25s-.56-1.25-1.25-1.25-1.25.56-1.25 1.25.56 1.25 1.25 1.25z\"\n\t\t\t\t\tfill-rule=\"evenodd\"></path>\n\t\t\t</svg>\n\t\t</svg>\n\t\t<span class=\"suggestion-post-title\">{{{ data._highlightResult.name.value }}}</span>\n\t</a>\n</script>\n\n<script type=\"text/html\" id=\"tmpl-autocomplete-user-suggestion\">\n\t<a class=\"suggestion-link user-suggestion-link\" href=\"{{ data.posts_url }}\" title=\"{{ data.display_name }}\">\n\t\t<# if ( data.avatar_url ) { #>\n\t\t\t<img class=\"suggestion-user-thumbnail\" src=\"{{ data.avatar_url }}\" alt=\"{{ data.display_name }}\">\n\t\t<# } #>\n\t\t<span class=\"suggestion-post-title\">{{{ data._highlightResult.display_name.value }}}</span>\n\t</a>\n</script>\n\n<script type=\"text/html\" id=\"tmpl-autocomplete-footer\">\n\t<div class=\"autocomplete-footer\">\n\t\t<div class=\"autocomplete-footer-branding\">\n\t\t\t<a href=\"#\" class=\"algolia-powered-by-link\" title=\"Algolia\">\n\t\t\t\t<svg width=\"150px\" height=\"25px\" viewBox=\"0 0 572 64\"><path fill=\"#36395A\" d=\"M16 48.3c-3.4 0-6.3-.6-8.7-1.7A12.4 12.4 0 0 1 1.9 42C.6 40 0 38 0 35.4h6.5a6.7 6.7 0 0 0 3.9 6c1.4.7 3.3 1.1 5.6 1.1 2.2 0 4-.3 5.4-1a7 7 0 0 0 3-2.4 6 6 0 0 0 1-3.4c0-1.5-.6-2.8-1.9-3.7-1.3-1-3.3-1.6-5.9-1.8l-4-.4c-3.7-.3-6.6-1.4-8.8-3.4a10 10 0 0 1-3.3-7.9c0-2.4.6-4.6 1.8-6.4a12 12 0 0 1 5-4.3c2.2-1 4.7-1.6 7.5-1.6s5.5.5 7.6 1.6a12 12 0 0 1 5 4.4c1.2 1.8 1.8 4 1.8 6.7h-6.5a6.4 6.4 0 0 0-3.5-5.9c-1-.6-2.6-1-4.4-1s-3.2.3-4.4 1c-1.1.6-2 1.4-2.6 2.4-.5 1-.8 2-.8 3.1a5 5 0 0 0 1.5 3.6c1 1 2.6 1.7 4.7 1.9l4 .3c2.8.2 5.2.8 7.2 1.8 2.1 1 3.7 2.2 4.9 3.8a9.7 9.7 0 0 1 1.7 5.8c0 2.5-.7 4.7-2 6.6a13 13 0 0 1-5.6 4.4c-2.4 1-5.2 1.6-8.4 1.6Zm35.6 0c-2.6 0-4.8-.4-6.7-1.3a13 13 0 0 1-4.7-3.5 17.1 17.1 0 0 1-3.6-10.4v-1c0-2 .3-3.8 1-5.6a13 13 0 0 1 7.3-8.3 15 15 0 0 1 6.3-1.4A13.2 13.2 0 0 1 64 24.3c1 2.2 1.6 4.6 1.6 7.2V34H39.4v-4.3h21.8l-1.8 2.2c0-2-.3-3.7-.9-5.1a7.3 7.3 0 0 0-2.7-3.4c-1.2-.7-2.7-1.1-4.6-1.1s-3.4.4-4.7 1.3a8 8 0 0 0-2.9 3.6c-.6 1.5-.9 3.3-.9 5.4 0 2 .3 3.7 1 5.3a7.9 7.9 0 0 0 2.8 3.7c1.3.8 3 1.3 5 1.3s3.8-.5 5.1-1.3c1.3-1 2.1-2 2.4-3.2h6a11.8 11.8 0 0 1-7 8.7 16 16 0 0 1-6.4 1.2ZM80 48c-2.2 0-4-.3-5.7-1a8.4 8.4 0 0 1-3.7-3.3 9.7 9.7 0 0 1-1.3-5.2c0-2 .5-3.8 1.5-5.2a9 9 0 0 1 4.3-3.1c1.8-.7 4-1 6.7-1H89v4.1h-7.5c-2 0-3.4.5-4.4 1.4-1 1-1.6 2.1-1.6 3.6s.5 2.7 1.6 3.6c1 1 2.5 1.4 4.4 1.4 1.1 0 2.2-.2 3.2-.7 1-.4 1.9-1 2.6-2 .6-1 1-2.4 1-4.2l1.7 2.1c-.2 2-.7 3.8-1.5 5.2a9 9 0 0 1-3.4 3.3 12 12 0 0 1-5.3 1Zm9.5-.7v-8.8h-1v-10c0-1.8-.5-3.2-1.4-4.1-1-1-2.4-1.4-4.2-1.4a142.9 142.9 0 0 0-10.2.4v-5.6a74.8 74.8 0 0 1 8.6-.4c3 0 5.5.4 7.5 1.2s3.4 2 4.4 3.6c1 1.7 1.4 4 1.4 6.7v18.4h-5Zm12.9 0V17.8h5v12.3h-.2c0-4.2 1-7.4 2.8-9.5a11 11 0 0 1 8.3-3.1h1v5.6h-2a9 9 0 0 0-6.3 2.2c-1.5 1.5-2.2 3.6-2.2 6.4v15.6h-6.4Zm34.4 1a15 15 0 0 1-6.6-1.3c-1.9-.9-3.4-2-4.7-3.5a15.5 15.5 0 0 1-2.7-5c-.6-1.7-1-3.6-1-5.4v-1c0-2 .4-3.8 1-5.6a15 15 0 0 1 2.8-4.9c1.3-1.5 2.8-2.6 4.6-3.5a16.4 16.4 0 0 1 13.3.2c2 1 3.5 2.3 4.8 4a12 12 0 0 1 2 6H144c-.2-1.6-1-3-2.2-4.1a7.5 7.5 0 0 0-5.2-1.7 8 8 0 0 0-4.7 1.3 8 8 0 0 0-2.8 3.6 13.8 13.8 0 0 0 0 10.3c.6 1.5 1.5 2.7 2.8 3.6s2.8 1.3 4.8 1.3c1.5 0 2.7-.2 3.8-.8a7 7 0 0 0 2.6-2c.7-1 1-2 1.2-3.2h6.2a11 11 0 0 1-2 6.2 15.1 15.1 0 0 1-11.8 5.5Zm19.7-1v-40h6.4V31h-1.3c0-3 .4-5.5 1.1-7.6a9.7 9.7 0 0 1 3.5-4.8A9.9 9.9 0 0 1 172 17h.3c3.5 0 6 1.1 7.9 3.5 1.7 2.3 2.6 5.7 2.6 10v16.8h-6.4V29.6c0-2.1-.6-3.8-1.8-5a6.4 6.4 0 0 0-4.8-1.8c-2 0-3.7.7-5 2a7.8 7.8 0 0 0-1.9 5.5v17h-6.4Zm63.8 1a12.2 12.2 0 0 1-10.9-6.2 19 19 0 0 1-1.8-7.3h1.4v12.5h-5.1v-40h6.4v19.8l-2 3.5c.2-3.1.8-5.7 1.9-7.7a11 11 0 0 1 4.4-4.5c1.8-1 3.9-1.5 6.1-1.5a13.4 13.4 0 0 1 12.8 9.1c.7 1.9 1 3.8 1 6v1c0 2.2-.3 4.1-1 6a13.6 13.6 0 0 1-13.2 9.4Zm-1.2-5.5a8.4 8.4 0 0 0 7.9-5c.7-1.5 1.1-3.3 1.1-5.3s-.4-3.8-1.1-5.3a8.7 8.7 0 0 0-3.2-3.6 9.6 9.6 0 0 0-9.2-.2 8.5 8.5 0 0 0-3.3 3.2c-.8 1.4-1.3 3-1.3 5v2.3a9 9 0 0 0 1.3 4.8 9 9 0 0 0 3.4 3c1.4.7 2.8 1 4.4 1Zm27.3 3.9-10-28.9h6.5l9.5 28.9h-6Zm-7.5 12.2v-5.7h4.9c1 0 2-.1 2.9-.4a4 4 0 0 0 2-1.4c.4-.7.9-1.6 1.2-2.7l8.6-30.9h6.2l-9.3 32.4a14 14 0 0 1-2.5 5 8.9 8.9 0 0 1-4 2.8c-1.5.6-3.4.9-5.6.9h-4.4Zm9-12.2v-5.2h6.4v5.2H248Z\"></path><path fill=\"#003DFF\" d=\"M534.4 9.1H528a.8.8 0 0 1-.7-.7V1.8c0-.4.2-.7.6-.8l6.5-1c.4 0 .8.2.9.6v7.8c0 .4-.4.7-.8.7zM428 35.2V.8c0-.5-.3-.8-.7-.8h-.2l-6.4 1c-.4 0-.7.4-.7.8v35c0 1.6 0 11.8 12.3 12.2.5 0 .8-.4.8-.8V43c0-.4-.3-.7-.6-.8-4.5-.5-4.5-6-4.5-7zm106.5-21.8H528c-.4 0-.7.4-.7.8v34c0 .4.3.8.7.8h6.5c.4 0 .8-.4.8-.8v-34c0-.5-.4-.8-.8-.8zm-17.7 21.8V.8c0-.5-.3-.8-.8-.8l-6.5 1c-.4 0-.7.4-.7.8v35c0 1.6 0 11.8 12.3 12.2.4 0 .8-.4.8-.8V43c0-.4-.3-.7-.7-.8-4.4-.5-4.4-6-4.4-7zm-22.2-20.6a16.5 16.5 0 0 1 8.6 9.3c.8 2.2 1.3 4.8 1.3 7.5a19.4 19.4 0 0 1-4.6 12.6 14.8 14.8 0 0 1-5.2 3.6c-2 .9-5.2 1.4-6.8 1.4a21 21 0 0 1-6.7-1.4 15.4 15.4 0 0 1-8.6-9.3 21.3 21.3 0 0 1 0-14.4 15.2 15.2 0 0 1 8.6-9.3c2-.8 4.3-1.2 6.7-1.2s4.6.4 6.7 1.2zm-6.7 27.6c2.7 0 4.7-1 6.2-3s2.2-4.3 2.2-7.8-.7-6.3-2.2-8.3-3.5-3-6.2-3-4.7 1-6.1 3c-1.5 2-2.2 4.8-2.2 8.3s.7 5.8 2.2 7.8 3.5 3 6.2 3zm-88.8-28.8c-6.2 0-11.7 3.3-14.8 8.2a18.6 18.6 0 0 0 4.8 25.2c1.8 1.2 4 1.8 6.2 1.7s.1 0 .1 0h.9c4.2-.7 8-4 9.1-8.1v7.4c0 .4.3.7.8.7h6.4a.7.7 0 0 0 .7-.7V14.2c0-.5-.3-.8-.7-.8h-13.5zm6.3 26.5a9.8 9.8 0 0 1-5.7 2h-.5a10 10 0 0 1-9.2-14c1.4-3.7 5-6.3 9-6.3h6.4v18.3zm152.3-26.5h13.5c.5 0 .8.3.8.7v33.7c0 .4-.3.7-.8.7h-6.4a.7.7 0 0 1-.8-.7v-7.4c-1.2 4-4.8 7.4-9 8h-.1a4.2 4.2 0 0 1-.5.1h-.9a10.3 10.3 0 0 1-7-2.6c-4-3.3-6.5-8.4-6.5-14.2 0-3.7 1-7.2 3-10 3-5 8.5-8.3 14.7-8.3zm.6 28.4c2.2-.1 4.2-.6 5.7-2V21.7h-6.3a9.8 9.8 0 0 0-9 6.4 10.2 10.2 0 0 0 9.1 13.9h.5zM452.8 13.4c-6.2 0-11.7 3.3-14.8 8.2a18.5 18.5 0 0 0 3.6 24.3 10.4 10.4 0 0 0 13 .6c2.2-1.5 3.8-3.7 4.5-6.1v7.8c0 2.8-.8 5-2.2 6.3-1.5 1.5-4 2.2-7.5 2.2l-6-.3c-.3 0-.7.2-.8.5l-1.6 5.5c-.1.4.1.8.5 1h.1c2.8.4 5.5.6 7 .6 6.3 0 11-1.4 14-4.1 2.7-2.5 4.2-6.3 4.5-11.4V14.2c0-.5-.4-.8-.8-.8h-13.5zm6.3 8.2v18.3a9.6 9.6 0 0 1-5.6 2h-1a10.3 10.3 0 0 1-8.8-14c1.4-3.7 5-6.3 9-6.3h6.4zM291 31.5A32 32 0 0 1 322.8 0h30.8c.6 0 1.2.5 1.2 1.2v61.5c0 1.1-1.3 1.7-2.2 1l-19.2-17a18 18 0 0 1-11 3.4 18.1 18.1 0 1 1 18.2-14.8c-.1.4-.5.7-.9.6-.1 0-.3 0-.4-.2l-3.8-3.4c-.4-.3-.6-.8-.7-1.4a12 12 0 1 0-2.4 8.3c.4-.4 1-.5 1.6-.2l14.7 13.1v-46H323a26 26 0 1 0 10 49.7c.8-.4 1.6-.2 2.3.3l3 2.7c.3.2.3.7 0 1l-.2.2a32 32 0 0 1-47.2-28.6z\"></path></svg>\n\t\t\t</a>\n\t\t</div>\n\t</div>\n</script>\n\n<script type=\"text/html\" id=\"tmpl-autocomplete-empty\">\n\t<div class=\"autocomplete-empty\">\n\t\t<?php esc_html_e( 'No results matched your query ', 'wp-search-with-algolia' ); ?>\n\t\t<span class=\"empty-query\">\"{{ data.query }}\"</span>\n\t</div>\n</script>\n\n<script type=\"text/javascript\">\n\twindow.addEventListener('load', function () {\n\n\t\t/* Initialize Algolia client */\n\t\tvar client = algoliasearch( algolia.application_id, algolia.search_api_key );\n\n\t\t/**\n\t\t * Algolia hits source method.\n\t\t *\n\t\t * This method defines a custom source to use with autocomplete.js.\n\t\t *\n\t\t * @param object $index Algolia index object.\n\t\t * @param object $params Options object to use in search.\n\t\t */\n\t\tvar algoliaHitsSource = function( index, params ) {\n\t\t\treturn function( query, callback ) {\n\t\t\t\tindex\n\t\t\t\t\t.search( query, params )\n\t\t\t\t\t.then( function( response ) {\n\t\t\t\t\t\tcallback( response.hits, response );\n\t\t\t\t\t})\n\t\t\t\t\t.catch( function( error ) {\n\t\t\t\t\t\tcallback( [] );\n\t\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t/* Setup autocomplete.js sources */\n\t\tvar sources = [];\n\t\talgolia.autocomplete.sources.forEach( function( config, i ) {\n\t\t\tvar suggestion_template = wp.template( config[ 'tmpl_suggestion' ] );\n\t\t\tsources.push( {\n\t\t\t\tsource: algoliaHitsSource( client.initIndex( config[ 'index_name' ] ), {\n\t\t\t\t\thitsPerPage: config[ 'max_suggestions' ],\n\t\t\t\t\tattributesToSnippet: [\n\t\t\t\t\t\t'content:10'\n\t\t\t\t\t],\n\t\t\t\t\thighlightPreTag: '__ais-highlight__',\n\t\t\t\t\thighlightPostTag: '__/ais-highlight__'\n\t\t\t\t} ),\n\t\t\t\tdebounce: config['debounce'],\n\t\t\t\ttemplates: {\n\t\t\t\t\theader: function () {\n\t\t\t\t\t\treturn wp.template( 'autocomplete-header' )( {\n\t\t\t\t\t\t\tlabel: _.escape( config[ 'label' ] )\n\t\t\t\t\t\t} );\n\t\t\t\t\t},\n\t\t\t\t\tsuggestion: function ( hit ) {\n\t\t\t\t\t\tif ( hit.escaped === true ) {\n\t\t\t\t\t\t\treturn suggestion_template( hit );\n\t\t\t\t\t\t}\n\t\t\t\t\t\thit.escaped = true;\n\n\t\t\t\t\t\tfor ( var key in hit._highlightResult ) {\n\t\t\t\t\t\t\t/* We do not deal with arrays. */\n\t\t\t\t\t\t\tif ( typeof hit._highlightResult[ key ].value !== 'string' ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thit._highlightResult[ key ].value = _.escape( hit._highlightResult[ key ].value );\n\t\t\t\t\t\t\thit._highlightResult[ key ].value = hit._highlightResult[ key ].value.replace( /__ais-highlight__/g, '<em>' ).replace( /__\\/ais-highlight__/g, '</em>' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor ( var key in hit._snippetResult ) {\n\t\t\t\t\t\t\t/* We do not deal with arrays. */\n\t\t\t\t\t\t\tif ( typeof hit._snippetResult[ key ].value !== 'string' ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\thit._snippetResult[ key ].value = _.escape( hit._snippetResult[ key ].value );\n\t\t\t\t\t\t\thit._snippetResult[ key ].value = hit._snippetResult[ key ].value.replace( /__ais-highlight__/g, '<em>' ).replace( /__\\/ais-highlight__/g, '</em>' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn suggestion_template( hit );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\n\t\t} );\n\n\t\t/* Setup dropdown menus */\n\t\tdocument.querySelectorAll( algolia.autocomplete.input_selector ).forEach( function( element ) {\n\n\t\t\tvar config = {\n\t\t\t\tdebug: algolia.debug,\n\t\t\t\thint: false,\n\t\t\t\topenOnFocus: true,\n\t\t\t\tappendTo: 'body',\n\t\t\t\ttemplates: {\n\t\t\t\t\tempty: wp.template( 'autocomplete-empty' )\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif ( algolia.powered_by_enabled ) {\n\t\t\t\tconfig.templates.footer = wp.template( 'autocomplete-footer' );\n\t\t\t}\n\n\t\t\t/* Instantiate autocomplete.js */\n\t\t\tvar autocomplete = algoliaAutocomplete( element, config, sources )\n\t\t\t\t.on( 'autocomplete:selected', function ( e, suggestion ) {\n\t\t\t\t\t/* Redirect the user when we detect a suggestion selection. */\n\t\t\t\t\twindow.location.href = suggestion.permalink ?? suggestion.posts_url; // Users use the `posts_url` property instead of `permalink`.\n\t\t\t\t} );\n\n\t\t\t/* Force the dropdown to be re-drawn on scroll to handle fixed containers. */\n\t\t\twindow.addEventListener( 'scroll', function() {\n\t\t\t\tif ( autocomplete.autocomplete.getWrapper().style.display === \"block\" ) {\n\t\t\t\t\tautocomplete.autocomplete.close();\n\t\t\t\t\tautocomplete.autocomplete.open();\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\n\t\tvar algoliaPoweredLink = document.querySelector( '.algolia-powered-by-link' );\n\t\tif ( algoliaPoweredLink ) {\n\t\t\talgoliaPoweredLink.addEventListener( 'click', function( e ) {\n\t\t\t\te.preventDefault();\n\t\t\t\twindow.location = \"https://www.algolia.com/?utm_source=WordPress&utm_medium=extension&utm_content=\" + window.location.hostname + \"&utm_campaign=poweredby\";\n\t\t\t} );\n\t\t}\n\t});\n</script>\n"
  },
  {
    "path": "templates/instantsearch-modern.php",
    "content": "<?php\n/**\n * WP Search With Algolia instantsearch template file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @version 2.10.2\n * @package WebDevStudios\\WPSWA\n */\n\nget_header();\n\n?>\n\n\t<div id=\"ais-wrapper\">\n\t\t<main id=\"ais-main\">\n\t\t\t<div class=\"algolia-search-box-wrapper\">\n\t\t\t\t<div id=\"algolia-search-box\"></div>\n\t\t\t\t<svg class=\"search-icon\" width=\"25\" height=\"25\" viewBox=\"0 0 40 40\" xmlns=\"https://www.w3.org/2000/svg\"><path d=\"M24.828 31.657a16.76 16.76 0 0 1-7.992 2.015C7.538 33.672 0 26.134 0 16.836 0 7.538 7.538 0 16.836 0c9.298 0 16.836 7.538 16.836 16.836 0 3.22-.905 6.23-2.475 8.79.288.18.56.395.81.645l5.985 5.986A4.54 4.54 0 0 1 38 38.673a4.535 4.535 0 0 1-6.417-.007l-5.986-5.986a4.545 4.545 0 0 1-.77-1.023zm-7.992-4.046c5.95 0 10.775-4.823 10.775-10.774 0-5.95-4.823-10.775-10.774-10.775-5.95 0-10.775 4.825-10.775 10.776 0 5.95 4.825 10.775 10.776 10.775z\" fill-rule=\"evenodd\"></path></svg>\n\t\t\t\t<div id=\"algolia-stats\"></div>\n\t\t\t\t<div id=\"algolia-powered-by\"></div>\n\t\t\t</div>\n\t\t\t<div id=\"algolia-hits\"></div>\n\t\t\t<div id=\"algolia-pagination\"></div>\n\t\t</main>\n\t\t<aside id=\"ais-facets\">\n\t\t\t<div>\n\t\t\t\t<h3 class=\"widgettitle\"><?php esc_html_e( 'Post Types', 'wp-search-with-algolia' ); ?></h3>\n\t\t\t\t<section class=\"ais-facets\" id=\"facet-post-types\"></section>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<h3 class=\"widgettitle\"><?php esc_html_e( 'Categories', 'wp-search-with-algolia' ); ?></h3>\n\t\t\t\t<section class=\"ais-facets\" id=\"facet-categories\"></section>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<h3 class=\"widgettitle\"><?php esc_html_e( 'Tags', 'wp-search-with-algolia' ); ?></h3>\n\t\t\t\t<section class=\"ais-facets\" id=\"facet-tags\"></section>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<h3 class=\"widgettitle\"><?php esc_html_e( 'Users', 'wp-search-with-algolia' ); ?></h3>\n\t\t\t\t<section class=\"ais-facets\" id=\"facet-users\"></section>\n\t\t\t</div>\n\t\t</aside>\n\t</div>\n\n\t<script type=\"text/javascript\">\n\t\twindow.addEventListener('load', function() {\n\t\t\t// Set a custom user token if you enable insights and don't want the anonymous token.\n\t\t\t// window.aa('setUserToken', 'some-user-id');\n\t\t\tif ( document.getElementById(\"algolia-search-box\") ) {\n\t\t\t\tif ( algolia.indices.searchable_posts === undefined && document.getElementsByClassName(\"admin-bar\").length > 0 ) {\n\t\t\t\t\talert('<?php esc_html_e( 'It looks like you have not indexed the searchable posts index. Please head to the Indexing page of the Algolia Search plugin and index it.', 'wp-search-with-algolia' ); ?>');\n\t\t\t\t}\n\n\t\t\t\t/* Instantiate instantsearch.js */\n\t\t\t\tconst search = instantsearch({\n\t\t\t\t\tindexName: algolia.indices.searchable_posts.name,\n\t\t\t\t\tsearchClient: algoliasearch( algolia.application_id, algolia.search_api_key ),\n\t\t\t\t\trouting: {\n\t\t\t\t\t\trouter: instantsearch.routers.history({ writeDelay: 1000 }),\n\t\t\t\t\t\tstateMapping: {\n\t\t\t\t\t\t\tstateToRoute( indexUiState ) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\ts: indexUiState[ algolia.indices.searchable_posts.name ].query,\n\t\t\t\t\t\t\t\t\tpage: indexUiState[ algolia.indices.searchable_posts.name ].page\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\trouteToState( routeState ) {\n\t\t\t\t\t\t\t\tconst indexUiState = {};\n\t\t\t\t\t\t\t\tindexUiState[ algolia.indices.searchable_posts.name ] = {\n\t\t\t\t\t\t\t\t\tquery: routeState.s,\n\t\t\t\t\t\t\t\t\tpage: routeState.page\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\treturn indexUiState;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t// https://www.algolia.com/doc/guides/building-search-ui/events/js/\n\t\t\t\t\tinsights: algolia.insights_enabled,\n\t\t\t\t\t/*\n\t\t\t\t\tinsights: {\n\t\t\t\t\t\tinsightsInitParams: {\n\t\t\t\t\t\t\tuseCookie: true\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t */\n\t\t\t\t});\n\n\t\t\t\tsearch.addWidgets([\n\n\t\t\t\t\t// Search box widget\n\t\t\t\t\t// https://www.algolia.com/doc/api-reference/widgets/search-box/js/\n\t\t\t\t\tinstantsearch.widgets.searchBox({\n\t\t\t\t\t\tcontainer: '#algolia-search-box',\n\t\t\t\t\t\tplaceholder: 'Search for...',\n\t\t\t\t\t\tshowReset: false,\n\t\t\t\t\t\tshowSubmit: false,\n\t\t\t\t\t\tshowLoadingIndicator: false,\n\t\t\t\t\t}),\n\n\t\t\t\t\t// Stats widget\n\t\t\t\t\t// https://www.algolia.com/doc/api-reference/widgets/stats/js/\n\t\t\t\t\tinstantsearch.widgets.stats({\n\t\t\t\t\t\tcontainer: '#algolia-stats'\n\t\t\t\t\t}),\n\n\t\t\t\t\t// Configure widget\n\t\t\t\t\t// https://www.algolia.com/doc/api-reference/widgets/configure/js/\n\t\t\t\t\tinstantsearch.widgets.configure({\n\t\t\t\t\t\thitsPerPage: algolia.search_hits_per_page,\n\t\t\t\t\t}),\n\n\t\t\t\t\t// Hits widget\n\t\t\t\t\t// https://www.algolia.com/doc/api-reference/widgets/hits/js/\n\t\t\t\t\tinstantsearch.widgets.hits({\n\t\t\t\t\t\tcontainer: '#algolia-hits',\n\t\t\t\t\t\ttemplates: {\n\t\t\t\t\t\t\tempty(results, {html} ) {\n\t\t\t\t\t\t\t\treturn html `No results were found for \"<strong>${results.query}</strong>\".`;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\titem(hit, { html, components }) {\n\t\t\t\t\t\t\t\tlet thumbnail = '';\n\t\t\t\t\t\t\t\tif ( hit.images.thumbnail ) {\n\t\t\t\t\t\t\t\t\tthumbnail = html`\n\t\t\t\t\t\t\t\t\t<div class=\"ais-hits--thumbnail\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"${hit.permalink}\" title=\"${hit.post_title }\" class=\"ais-hits--thumbnail-link\">\n\t\t\t\t\t\t\t\t\t\t\t<img src=\"${hit.images.thumbnail.url }\" alt=\"${hit.post_title }\" title=\"${hit.post_title }\" itemprop=\"image\" />\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</div>`;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tlet content_snippet = '';\n\t\t\t\t\t\t\t\tif (hit._snippetResult['content']) {\n\t\t\t\t\t\t\t\t\tcontent_snippet = html`<span class=\"suggestion-post-content ais-hits--content-snippet\">${components.Snippet({hit, attribute: 'content'})}</span>`;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn html`\n\t\t\t\t\t\t\t\t\t<article itemtype=\"https://schema.org/Article\">\n\t\t\t\t\t\t\t\t\t\t${thumbnail}\n\t\t\t\t\t\t\t\t\t\t<div class=\"ais-hits--content\">\n\t\t\t\t\t\t\t\t\t\t\t<h2 itemprop=\"name headline\"><a href=\"${hit.permalink}\" title=\"${hit.post_title}\" class=\"ais-hits--title-link\" itemprop=\"url\">${components.Highlight({hit, attribute: 'post_title'})}</a></h2>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"excerpt\">\n\t\t\t\t\t\t\t\t\t\t\t\t<p>${content_snippet}</p>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"ais-clearfix\"></div>\n\t\t\t\t\t\t\t\t\t</article>`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttransformData: {\n\t\t\t\t\t\t\titem: function (hit) {\n\n\t\t\t\t\t\t\t\tfunction replace_highlights_recursive (item) {\n\t\t\t\t\t\t\t\t\tif (item instanceof Object && item.hasOwnProperty('value')) {\n\t\t\t\t\t\t\t\t\t\titem.value = _.escape(item.value);\n\t\t\t\t\t\t\t\t\t\titem.value = item.value.replace(/__ais-highlight__/g, '<em>').replace(/__\\/ais-highlight__/g, '</em>');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tfor (let key in item) {\n\t\t\t\t\t\t\t\t\t\t\titem[key] = replace_highlights_recursive(item[key]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn item;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\thit._highlightResult = replace_highlights_recursive(hit._highlightResult);\n\t\t\t\t\t\t\t\thit._snippetResult = replace_highlights_recursive(hit._snippetResult);\n\n\t\t\t\t\t\t\t\treturn hit;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\n\t\t\t\t\t// Pagination widget\n\t\t\t\t\t// https://www.algolia.com/doc/api-reference/widgets/pagination/js/\n\t\t\t\t\tinstantsearch.widgets.pagination({\n\t\t\t\t\t\tcontainer: '#algolia-pagination'\n\t\t\t\t\t}),\n\n\t\t\t\t\t// Post types refinement widget\n\t\t\t\t\t// https://www.algolia.com/doc/api-reference/widgets/menu/js/\n\t\t\t\t\tinstantsearch.widgets.menu({\n\t\t\t\t\t\tcontainer: '#facet-post-types',\n\t\t\t\t\t\tattribute: 'post_type_label',\n\t\t\t\t\t\tsortBy: ['isRefined:desc', 'count:desc', 'name:asc'],\n\t\t\t\t\t\tlimit: 10,\n\t\t\t\t\t}),\n\n\t\t\t\t\t// Categories refinement widget\n\t\t\t\t\t// https://www.algolia.com/doc/api-reference/widgets/hierarchical-menu/js/\n\t\t\t\t\tinstantsearch.widgets.hierarchicalMenu({\n\t\t\t\t\t\tcontainer: '#facet-categories',\n\t\t\t\t\t\tseparator: ' > ',\n\t\t\t\t\t\tsortBy: ['count'],\n\t\t\t\t\t\tattributes: ['taxonomies_hierarchical.category.lvl0', 'taxonomies_hierarchical.category.lvl1', 'taxonomies_hierarchical.category.lvl2'],\n\t\t\t\t\t}),\n\n\t\t\t\t\t// Tags refinement widget\n\t\t\t\t\t// https://www.algolia.com/doc/api-reference/widgets/refinement-list/js/\n\t\t\t\t\tinstantsearch.widgets.refinementList({\n\t\t\t\t\t\tcontainer: '#facet-tags',\n\t\t\t\t\t\tattribute: 'taxonomies.post_tag',\n\t\t\t\t\t\toperator: 'and',\n\t\t\t\t\t\tlimit: 15,\n\t\t\t\t\t\tsortBy: ['isRefined:desc', 'count:desc', 'name:asc'],\n\t\t\t\t\t}),\n\n\t\t\t\t\t// Users refinement widget\n\t\t\t\t\t// https://www.algolia.com/doc/api-reference/widgets/menu/js/\n\t\t\t\t\tinstantsearch.widgets.menu({\n\t\t\t\t\t\tcontainer: '#facet-users',\n\t\t\t\t\t\tattribute: 'post_author.display_name',\n\t\t\t\t\t\tsortBy: ['isRefined:desc', 'count:desc', 'name:asc'],\n\t\t\t\t\t\tlimit: 10,\n\t\t\t\t\t})\n\t\t\t\t]);\n\n\t\t\t\tif ( algolia.powered_by_enabled ) {\n\t\t\t\t\t// Search powered-by widget\n\t\t\t\t\t// https://www.algolia.com/doc/api-reference/widgets/powered-by/js/\n\t\t\t\t\tsearch.addWidgets([\n\t\t\t\t\t\t/* Search powered-by widget */\n\t\t\t\t\t\tinstantsearch.widgets.poweredBy({\n\t\t\t\t\t\t\tcontainer: '#algolia-powered-by'\n\t\t\t\t\t\t}),\n\t\t\t\t\t])\n\t\t\t\t}\n\n\t\t\t\t/* Start */\n\t\t\t\tsearch.start();\n\n\t\t\t\t// This needs work\n\t\t\t\tdocument.querySelector(\"#algolia-search-box input[type='search']\").select()\n\t\t\t}\n\t\t});\n\t</script>\n\n<?php\n\nget_footer();\n"
  },
  {
    "path": "templates/instantsearch.php",
    "content": "<?php\n/**\n * WP Search With Algolia instantsearch template file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @version 2.10.2\n * @package WebDevStudios\\WPSWA\n */\n\nget_header();\n\n?>\n\n\t<div id=\"ais-wrapper\">\n\t\t<main id=\"ais-main\">\n\t\t\t<div class=\"algolia-search-box-wrapper\">\n\t\t\t\t<div id=\"algolia-search-box\"></div>\n\t\t\t\t<svg class=\"search-icon\" width=\"25\" height=\"25\" viewBox=\"0 0 40 40\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M24.828 31.657a16.76 16.76 0 0 1-7.992 2.015C7.538 33.672 0 26.134 0 16.836 0 7.538 7.538 0 16.836 0c9.298 0 16.836 7.538 16.836 16.836 0 3.22-.905 6.23-2.475 8.79.288.18.56.395.81.645l5.985 5.986A4.54 4.54 0 0 1 38 38.673a4.535 4.535 0 0 1-6.417-.007l-5.986-5.986a4.545 4.545 0 0 1-.77-1.023zm-7.992-4.046c5.95 0 10.775-4.823 10.775-10.774 0-5.95-4.823-10.775-10.774-10.775-5.95 0-10.775 4.825-10.775 10.776 0 5.95 4.825 10.775 10.776 10.775z\" fill-rule=\"evenodd\"></path></svg>\n\t\t\t\t<div id=\"algolia-stats\"></div>\n\t\t\t\t<div id=\"algolia-powered-by\"></div>\n\t\t\t</div>\n\t\t\t<div id=\"algolia-hits\"></div>\n\t\t\t<div id=\"algolia-pagination\"></div>\n\t\t</main>\n\t\t<aside id=\"ais-facets\">\n\t\t\t<div>\n\t\t\t\t<h3 class=\"widgettitle\"><?php esc_html_e( 'Post Types', 'wp-search-with-algolia' ); ?></h3>\n\t\t\t\t<section class=\"ais-facets\" id=\"facet-post-types\"></section>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<h3 class=\"widgettitle\"><?php esc_html_e( 'Categories', 'wp-search-with-algolia' ); ?></h3>\n\t\t\t\t<section class=\"ais-facets\" id=\"facet-categories\"></section>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<h3 class=\"widgettitle\"><?php esc_html_e( 'Tags', 'wp-search-with-algolia' ); ?></h3>\n\t\t\t\t<section class=\"ais-facets\" id=\"facet-tags\"></section>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<h3 class=\"widgettitle\"><?php esc_html_e( 'Users', 'wp-search-with-algolia' ); ?></h3>\n\t\t\t\t<section class=\"ais-facets\" id=\"facet-users\"></section>\n\t\t\t</div>\n\t\t</aside>\n\t</div>\n\n\t<script type=\"text/html\" id=\"tmpl-instantsearch-hit\">\n\t\t<article itemtype=\"http://schema.org/Article\">\n\t\t\t<# if ( data.images.thumbnail ) { #>\n\t\t\t\t<div class=\"ais-hits--thumbnail\">\n\t\t\t\t\t<a href=\"{{ data.permalink }}\" title=\"{{ data.post_title }}\" class=\"ais-hits--thumbnail-link\">\n\t\t\t\t\t\t<img src=\"{{ data.images.thumbnail.url }}\" alt=\"{{ data.post_title }}\" title=\"{{ data.post_title }}\" itemprop=\"image\" />\n\t\t\t\t\t</a>\n\t\t\t\t</div>\n\t\t\t<# } #>\n\n\t\t\t<div class=\"ais-hits--content\">\n\t\t\t\t<h2 itemprop=\"name headline\"><a href=\"{{ data.permalink }}\" title=\"{{ data.post_title }}\" class=\"ais-hits--title-link\" itemprop=\"url\">{{{ data._highlightResult.post_title.value }}}</a></h2>\n\t\t\t\t<div class=\"excerpt\">\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<# if ( data._snippetResult['content'] ) { #>\n\t\t\t\t\t\t\t<span class=\"suggestion-post-content ais-hits--content-snippet\">{{{ data._snippetResult['content'].value }}}</span>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t\tdo_action( 'algolia_instantsearch_after_hit' );\n\t\t\t\t?>\n\t\t\t</div>\n\t\t\t<div class=\"ais-clearfix\"></div>\n\t\t</article>\n\t</script>\n\n\n\t<script type=\"text/javascript\">\n\t\twindow.addEventListener('load', function() {\n\t\t\tif ( document.getElementById(\"algolia-search-box\") ) {\n\t\t\t\tif ( algolia.indices.searchable_posts === undefined && document.getElementsByClassName(\"admin-bar\").length > 0) {\n\t\t\t\t\talert('It looks like you haven\\'t indexed the searchable posts index. Please head to the Indexing page of the Algolia Search plugin and index it.');\n\t\t\t\t}\n\n\t\t\t\t/* Instantiate instantsearch.js */\n\t\t\t\tvar search = instantsearch({\n\t\t\t\t\tindexName: algolia.indices.searchable_posts.name,\n\t\t\t\t\tsearchClient: algoliasearch( algolia.application_id, algolia.search_api_key ),\n\t\t\t\t\trouting: {\n\t\t\t\t\t\trouter: instantsearch.routers.history({ writeDelay: 1000 }),\n\t\t\t\t\t\tstateMapping: {\n\t\t\t\t\t\t\tstateToRoute( indexUiState ) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\ts: indexUiState[ algolia.indices.searchable_posts.name ].query,\n\t\t\t\t\t\t\t\t\tpage: indexUiState[ algolia.indices.searchable_posts.name ].page\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\trouteToState( routeState ) {\n\t\t\t\t\t\t\t\tconst indexUiState = {};\n\t\t\t\t\t\t\t\tindexUiState[ algolia.indices.searchable_posts.name ] = {\n\t\t\t\t\t\t\t\t\tquery: routeState.s,\n\t\t\t\t\t\t\t\t\tpage: routeState.page\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\treturn indexUiState;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t// https://www.algolia.com/doc/guides/building-search-ui/events/js/\n\t\t\t\t\tinsights: algolia.insights_enabled,\n\t\t\t\t});\n\n\t\t\t\tsearch.addWidgets([\n\n\t\t\t\t\t/* Search box widget */\n\t\t\t\t\tinstantsearch.widgets.searchBox({\n\t\t\t\t\t\tcontainer: '#algolia-search-box',\n\t\t\t\t\t\tplaceholder: 'Search for...',\n\t\t\t\t\t\tshowReset: false,\n\t\t\t\t\t\tshowSubmit: false,\n\t\t\t\t\t\tshowLoadingIndicator: false,\n\t\t\t\t\t}),\n\n\t\t\t\t\t/* Stats widget */\n\t\t\t\t\tinstantsearch.widgets.stats({\n\t\t\t\t\t\tcontainer: '#algolia-stats'\n\t\t\t\t\t}),\n\n\t\t\t\t\tinstantsearch.widgets.configure({\n\t\t\t\t\t\thitsPerPage: algolia.search_hits_per_page,\n\t\t\t\t\t}),\n\n\t\t\t\t\t/* Hits widget */\n\t\t\t\t\tinstantsearch.widgets.hits({\n\t\t\t\t\t\tcontainer: '#algolia-hits',\n\t\t\t\t\t\ttemplates: {\n\t\t\t\t\t\t\tempty: 'No results were found for \"<strong>{{query}}</strong>\".',\n\t\t\t\t\t\t\titem: wp.template('instantsearch-hit')\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttransformData: {\n\t\t\t\t\t\t\titem: function (hit) {\n\n\t\t\t\t\t\t\t\tfunction replace_highlights_recursive (item) {\n\t\t\t\t\t\t\t\t\tif (item instanceof Object && item.hasOwnProperty('value')) {\n\t\t\t\t\t\t\t\t\t\titem.value = _.escape(item.value);\n\t\t\t\t\t\t\t\t\t\titem.value = item.value.replace(/__ais-highlight__/g, '<em>').replace(/__\\/ais-highlight__/g, '</em>');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tfor (var key in item) {\n\t\t\t\t\t\t\t\t\t\t\titem[key] = replace_highlights_recursive(item[key]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn item;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\thit._highlightResult = replace_highlights_recursive(hit._highlightResult);\n\t\t\t\t\t\t\t\thit._snippetResult = replace_highlights_recursive(hit._snippetResult);\n\n\t\t\t\t\t\t\t\treturn hit;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\n\t\t\t\t\t/* Pagination widget */\n\t\t\t\t\tinstantsearch.widgets.pagination({\n\t\t\t\t\t\tcontainer: '#algolia-pagination'\n\t\t\t\t\t}),\n\n\t\t\t\t\t/* Post types refinement widget */\n\t\t\t\t\tinstantsearch.widgets.menu({\n\t\t\t\t\t\tcontainer: '#facet-post-types',\n\t\t\t\t\t\tattribute: 'post_type_label',\n\t\t\t\t\t\tsortBy: ['isRefined:desc', 'count:desc', 'name:asc'],\n\t\t\t\t\t\tlimit: 10,\n\t\t\t\t\t}),\n\n\t\t\t\t\t/* Categories refinement widget */\n\t\t\t\t\tinstantsearch.widgets.hierarchicalMenu({\n\t\t\t\t\t\tcontainer: '#facet-categories',\n\t\t\t\t\t\tseparator: ' > ',\n\t\t\t\t\t\tsortBy: ['count'],\n\t\t\t\t\t\tattributes: ['taxonomies_hierarchical.category.lvl0', 'taxonomies_hierarchical.category.lvl1', 'taxonomies_hierarchical.category.lvl2'],\n\t\t\t\t\t}),\n\n\t\t\t\t\t/* Tags refinement widget */\n\t\t\t\t\tinstantsearch.widgets.refinementList({\n\t\t\t\t\t\tcontainer: '#facet-tags',\n\t\t\t\t\t\tattribute: 'taxonomies.post_tag',\n\t\t\t\t\t\toperator: 'and',\n\t\t\t\t\t\tlimit: 15,\n\t\t\t\t\t\tsortBy: ['isRefined:desc', 'count:desc', 'name:asc'],\n\t\t\t\t\t}),\n\n\t\t\t\t\t/* Users refinement widget */\n\t\t\t\t\tinstantsearch.widgets.menu({\n\t\t\t\t\t\tcontainer: '#facet-users',\n\t\t\t\t\t\tattribute: 'post_author.display_name',\n\t\t\t\t\t\tsortBy: ['isRefined:desc', 'count:desc', 'name:asc'],\n\t\t\t\t\t\tlimit: 10,\n\t\t\t\t\t}),\n\t\t\t\t]);\n\n\t\t\t\tif ( algolia.powered_by_enabled ) {\n\t\t\t\t\tsearch.addWidgets([\n\t\t\t\t\t\t/* Search powered-by widget */\n\t\t\t\t\t\tinstantsearch.widgets.poweredBy({\n\t\t\t\t\t\t\tcontainer: '#algolia-powered-by'\n\t\t\t\t\t\t}),\n\t\t\t\t\t]);\n\t\t\t\t}\n\n\t\t\t\t/* Start */\n\t\t\t\tsearch.start();\n\n\t\t\t\t// This needs work\n\t\t\t\tdocument.querySelector(\"#algolia-search-box input[type='search']\").select()\n\t\t\t}\n\t\t});\n\t</script>\n\n<?php\n\nget_footer();\n"
  },
  {
    "path": "uninstall.php",
    "content": "<?php\n/**\n * WP Search With Algolia uninstall file.\n *\n * @author  WebDevStudios <contact@webdevstudios.com>\n * @since   1.0.0\n *\n * @package WebDevStudios\\WPSWA\n */\n\nif ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {\n\t// If uninstall not called from WordPress, then exit.\n\texit;\n}\n"
  },
  {
    "path": "vendor_prefixed/.gitignore",
    "content": "# Do not commit prefixed vendor libs to git.\n!.gitignore\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2014-Present Algolia\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/AccountClient.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\NotFoundException;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\MultiResponse;\n\nfinal class AccountClient\n{\n    public static function copyIndex(SearchIndex $srcIndex, SearchIndex $destIndex, $requestOptions = [])\n    {\n        if ($srcIndex->getAppId() === $destIndex->getAppId()) {\n            throw new \\InvalidArgumentException('If both index are on the same app, please use SearchClient::copyIndex method instead.');\n        }\n\n        try {\n            $destIndex->getSettings();\n\n            throw new \\InvalidArgumentException('Destination index already exists. Please delete it before copying index across applications.');\n        } catch (NotFoundException $e) {\n            // All good\n        }\n\n        $allResponses = [];\n\n        $settings = $srcIndex->getSettings();\n        $allResponses[] = $destIndex->setSettings($settings);\n\n        $synonymsIterator = $srcIndex->browseSynonyms();\n        $allResponses[] = $destIndex->saveSynonyms($synonymsIterator);\n\n        $objectsIterator = $srcIndex->browseObjects();\n        $allResponses[] = $destIndex->saveObjects($objectsIterator);\n\n        $rulesIterator = $srcIndex->browseRules();\n        $allResponses[] = $destIndex->saveRules($rulesIterator);\n\n        return new MultiResponse($allResponses);\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Algolia.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Cache\\NullCacheDriver;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\HttpClientInterface;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Log\\DebugLogger;\nuse WebDevStudios\\WPSWA\\Psr\\Log\\LoggerInterface;\nuse WebDevStudios\\WPSWA\\Psr\\SimpleCache\\CacheInterface;\n\nfinal class Algolia\n{\n    const VERSION = '3.4.2';\n\n    /**\n     * Holds an instance of the simple cache repository (PSR-16).\n     *\n     * @var \\WebDevStudios\\WPSWA\\Psr\\SimpleCache\\CacheInterface|null\n     */\n    private static $cache;\n\n    /**\n     * Holds an instance of the logger (PSR-3).\n     *\n     * @var \\WebDevStudios\\WPSWA\\Psr\\Log\\LoggerInterface|null\n     */\n    private static $logger;\n\n    /**\n     * @var \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\HttpClientInterface\n     */\n    private static $httpClient;\n\n    public static function isCacheEnabled()\n    {\n        if (null === self::$cache) {\n            return false;\n        }\n\n        return !self::getCache() instanceof NullCacheDriver;\n    }\n\n    /**\n     * Gets the cache instance.\n     *\n     * @return \\WebDevStudios\\WPSWA\\Psr\\SimpleCache\\CacheInterface\n     */\n    public static function getCache()\n    {\n        if (null === self::$cache) {\n            self::setCache(new NullCacheDriver());\n        }\n\n        return self::$cache;\n    }\n\n    /**\n     * Sets the cache instance.\n     */\n    public static function setCache(CacheInterface $cache)\n    {\n        self::$cache = $cache;\n    }\n\n    /**\n     * Gets the logger instance.\n     *\n     * @return \\WebDevStudios\\WPSWA\\Psr\\Log\\LoggerInterface\n     */\n    public static function getLogger()\n    {\n        if (null === self::$logger) {\n            self::setLogger(new DebugLogger());\n        }\n\n        return self::$logger;\n    }\n\n    /**\n     * Sets the logger instance.\n     */\n    public static function setLogger(LoggerInterface $logger)\n    {\n        self::$logger = $logger;\n    }\n\n    public static function getHttpClient()\n    {\n        $guzzleVersion = null;\n        if (interface_exists('\\GuzzleHttp\\ClientInterface')) {\n            if (defined('\\GuzzleHttp\\ClientInterface::VERSION')) {\n                $guzzleVersion = (int) substr(\\GuzzleHttp\\Client::VERSION, 0, 1);\n            } else {\n                $guzzleVersion = \\GuzzleHttp\\ClientInterface::MAJOR_VERSION;\n            }\n        }\n\n        if (null === self::$httpClient) {\n            if (class_exists('\\GuzzleHttp\\Client') && 6 <= $guzzleVersion) {\n                self::setHttpClient(new \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\GuzzleHttpClient());\n            } else {\n                self::setHttpClient(new \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\CurlHttpClient());\n            }\n        }\n\n        return self::$httpClient;\n    }\n\n    public static function setHttpClient(HttpClientInterface $httpClient)\n    {\n        self::$httpClient = $httpClient;\n    }\n\n    public static function resetHttpClient()\n    {\n        self::$httpClient = null;\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/AnalyticsClient.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\AnalyticsConfig;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\AlgoliaException;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ApiWrapper;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ApiWrapperInterface;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ClusterHosts;\n\nfinal class AnalyticsClient\n{\n    /**\n     * @var ApiWrapperInterface\n     */\n    private $api;\n\n    /**\n     * @var AnalyticsConfig\n     */\n    private $config;\n\n    public function __construct(ApiWrapperInterface $api, AnalyticsConfig $config)\n    {\n        $this->api = $api;\n        $this->config = $config;\n    }\n\n    public static function create($appId = null, $apiKey = null, $region = null)\n    {\n        return static::createWithConfig(AnalyticsConfig::create($appId, $apiKey, $region));\n    }\n\n    public static function createWithConfig(AnalyticsConfig $config)\n    {\n        $config = clone $config;\n\n        if ($hosts = $config->getHosts()) {\n            $clusterHosts = ClusterHosts::create($hosts);\n        } else {\n            $clusterHosts = ClusterHosts::createForAnalytics($config->getRegion());\n        }\n\n        $apiWrapper = new ApiWrapper(\n            Algolia::getHttpClient(),\n            $config,\n            $clusterHosts\n        );\n\n        return new static($apiWrapper, $config);\n    }\n\n    /**\n     * Get a paginated list of AB Test from the API.\n     *\n     * @param array|\\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions\\RequestOptions $requestOptions\n     *\n     * @return array\n     */\n    public function getABTests($requestOptions = [])\n    {\n        return $this->api->read('GET', api_path('/2/abtests'), $requestOptions);\n    }\n\n    /**\n     * Get an AB Test.\n     *\n     * @param int                                                        $abTestID       Id of the AB Test to retrieve\n     * @param array|\\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions\\RequestOptions $requestOptions\n     *\n     * @return array\n     *\n     * @throws \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\AlgoliaException\n     */\n    public function getABTest($abTestID, $requestOptions = [])\n    {\n        if (!$abTestID) {\n            throw new AlgoliaException('Cannot retrieve ABTest because the abtestID is invalid.');\n        }\n\n        return $this->api->read('GET', api_path('/2/abtests/%s', $abTestID));\n    }\n\n    /**\n     * Create new AB Test.\n     *\n     * @param array                                                      $abTest\n     * @param array|\\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions\\RequestOptions $requestOptions\n     *\n     * @return array Information about the creation like TaskID and date\n     */\n    public function addABTest($abTest, $requestOptions = [])\n    {\n        return $this->api->write('POST', api_path('/2/abtests'), $abTest, $requestOptions);\n    }\n\n    /**\n     * Stop a running AB Test.\n     *\n     * @param int                                                        $abTestID\n     * @param array|\\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions\\RequestOptions $requestOptions\n     *\n     * @return array\n     *\n     * @throws \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\AlgoliaException\n     */\n    public function stopABTest($abTestID, $requestOptions = [])\n    {\n        if (!$abTestID) {\n            throw new AlgoliaException('Cannot retrieve ABTest because the abtestID is invalid.');\n        }\n\n        return $this->api->write('POST', api_path('/2/abtests/%s/stop', $abTestID), [], $requestOptions);\n    }\n\n    /**\n     * Delete an AB Test.\n     *\n     * @param int                                                        $abTestID\n     * @param array|\\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions\\RequestOptions $requestOptions\n     *\n     * @return array\n     *\n     * @throws \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\AlgoliaException\n     */\n    public function deleteABTest($abTestID, $requestOptions = [])\n    {\n        if (!$abTestID) {\n            throw new AlgoliaException('Cannot retrieve ABTest because the abtestID is invalid.');\n        }\n\n        return $this->api->write('DELETE', api_path('/2/abtests/%s', $abTestID), [], $requestOptions);\n    }\n\n    public function custom($method, $path, $requestOptions = [], $hosts = null)\n    {\n        return $this->api->send($method, $path, $requestOptions, $hosts);\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Cache/FileCacheDriver.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Cache;\n\nuse WebDevStudios\\WPSWA\\Psr\\SimpleCache\\CacheInterface;\n\nfinal class FileCacheDriver implements CacheInterface\n{\n    const PREFIX = 'algolia-client-';\n\n    private $directory;\n\n    public function __construct($directory)\n    {\n        $this->directory = rtrim($directory, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function get($key, $default = null)\n    {\n        if (!$this->has($key)) {\n            return $default;\n        }\n\n        return file_get_contents($this->getFilenameFromKey($key));\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function set($key, $value, $ttl = null)\n    {\n        return file_put_contents($this->getFilenameFromKey($key), $value);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function delete($key)\n    {\n        return @unlink($this->getFilenameFromKey($key));\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function clear()\n    {\n        $result = true;\n        foreach (glob($this->directory.self::PREFIX.'*') as $file) {\n            $result &= @unlink($file);\n        }\n\n        return $result;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getMultiple($keys, $default = null)\n    {\n        $result = [];\n        foreach ($keys as $key) {\n            $result[$key] = $this->get($key, $default);\n        }\n\n        return $result;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function setMultiple($values, $ttl = null)\n    {\n        $result = true;\n        foreach ($values as $key => $value) {\n            $result &= $this->set($key, $value, $ttl);\n        }\n\n        return $result;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function deleteMultiple($keys)\n    {\n        $result = true;\n        foreach ($keys as $key) {\n            $result &= $this->delete($key);\n        }\n\n        return $result;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function has($key)\n    {\n        return file_exists($this->getFilenameFromKey($key));\n    }\n\n    /**\n     * @param string $key\n     *\n     * @return string\n     */\n    private function getFilenameFromKey($key)\n    {\n        $name = $this->directory.self::PREFIX.$key;\n\n        return str_replace('\\\\', '-', $name);\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Cache/NullCacheDriver.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Cache;\n\nuse WebDevStudios\\WPSWA\\Psr\\SimpleCache\\CacheInterface;\n\nfinal class NullCacheDriver implements CacheInterface\n{\n    /**\n     * {@inheritdoc}\n     */\n    public function get($key, $default = null)\n    {\n        return $default;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function set($key, $value, $ttl = null)\n    {\n        return true;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function delete($key)\n    {\n        return true;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function clear()\n    {\n        return true;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getMultiple($keys, $default = null)\n    {\n        $return = [];\n\n        foreach ($keys as $key) {\n            $return[$key] = $default;\n        }\n\n        return $return;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function setMultiple($values, $ttl = null)\n    {\n        return true;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function deleteMultiple($keys)\n    {\n        return true;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function has($key)\n    {\n        return false;\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Config/AbstractConfig.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config;\n\nabstract class AbstractConfig\n{\n    protected $config;\n\n    protected $defaultReadTimeout = 5;\n\n    protected $defaultWriteTimeout = 30;\n\n    protected $defaultConnectTimeout = 2;\n\n    public function __construct(array $config = [])\n    {\n        $config += $this->getDefaultConfig();\n\n        $this->config = $config;\n    }\n\n    public function getDefaultConfig()\n    {\n        return [\n            'appId' => '',\n            'apiKey' => '',\n            'hosts' => null,\n            'readTimeout' => $this->defaultReadTimeout,\n            'writeTimeout' => $this->defaultWriteTimeout,\n            'connectTimeout' => $this->defaultConnectTimeout,\n            'defaultHeaders' => [],\n        ];\n    }\n\n    public function getAppId()\n    {\n        return $this->config['appId'];\n    }\n\n    public function setAppId($appId)\n    {\n        $this->config['appId'] = $appId;\n\n        return $this;\n    }\n\n    public function getApiKey()\n    {\n        return $this->config['apiKey'];\n    }\n\n    public function setApiKey($apiKey)\n    {\n        $this->config['apiKey'] = $apiKey;\n\n        return $this;\n    }\n\n    public function getHosts()\n    {\n        return $this->config['hosts'];\n    }\n\n    public function setHosts($hosts)\n    {\n        $this->config['hosts'] = $hosts;\n\n        return $this;\n    }\n\n    public function getReadTimeout()\n    {\n        return $this->config['readTimeout'];\n    }\n\n    public function setReadTimeout($readTimeout)\n    {\n        $this->config['readTimeout'] = $readTimeout;\n\n        return $this;\n    }\n\n    public function getWriteTimeout()\n    {\n        return $this->config['writeTimeout'];\n    }\n\n    public function setWriteTimeout($writeTimeout)\n    {\n        $this->config['writeTimeout'] = $writeTimeout;\n\n        return $this;\n    }\n\n    public function getConnectTimeout()\n    {\n        return $this->config['connectTimeout'];\n    }\n\n    public function setConnectTimeout($connectTimeout)\n    {\n        $this->config['connectTimeout'] = $connectTimeout;\n\n        return $this;\n    }\n\n    public function getDefaultHeaders()\n    {\n        return $this->config['defaultHeaders'];\n    }\n\n    public function setDefaultHeaders(array $defaultHeaders)\n    {\n        $this->config['defaultHeaders'] = $defaultHeaders;\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Config/AnalyticsConfig.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config;\n\nfinal class AnalyticsConfig extends AbstractConfig\n{\n    public static function create($appId = null, $apiKey = null, $region = null)\n    {\n        $config = [\n            'appId' => null !== $appId ? $appId : getenv('ALGOLIA_APP_ID'),\n            'apiKey' => null !== $apiKey ? $apiKey : getenv('ALGOLIA_API_KEY'),\n            'region' => null !== $region ? $region : 'us',\n        ];\n\n        return new static($config);\n    }\n\n    public function setRegion($region)\n    {\n        $this->config['region'] = $region;\n\n        return $this;\n    }\n\n    public function getRegion()\n    {\n        return $this->config['region'];\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Config/InsightsConfig.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config;\n\nfinal class InsightsConfig extends AbstractConfig\n{\n    public static function create($appId = null, $apiKey = null, $region = null)\n    {\n        $config = [\n            'appId' => null !== $appId ? $appId : getenv('ALGOLIA_APP_ID'),\n            'apiKey' => null !== $apiKey ? $apiKey : getenv('ALGOLIA_API_KEY'),\n            'region' => null !== $region ? $region : 'us',\n        ];\n\n        return new static($config);\n    }\n\n    public function setRegion($region)\n    {\n        $this->config['region'] = $region;\n\n        return $this;\n    }\n\n    public function getRegion()\n    {\n        return $this->config['region'];\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Config/PersonalizationConfig.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config;\n\nfinal class PersonalizationConfig extends AbstractConfig\n{\n    /**\n     * @param string|null $appId\n     * @param string|null $apiKey\n     * @param string|null $region\n     *\n     * @return PersonalizationConfig\n     */\n    public static function create($appId = null, $apiKey = null, $region = null)\n    {\n        $config = [\n            'appId' => null !== $appId ? $appId : getenv('ALGOLIA_APP_ID'),\n            'apiKey' => null !== $apiKey ? $apiKey : getenv('ALGOLIA_API_KEY'),\n            'region' => null !== $region ? $region : 'us',\n        ];\n\n        return new self($config);\n    }\n\n    public function getRegion()\n    {\n        return $this->config['region'];\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Config/PlacesConfig.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config;\n\nfinal class PlacesConfig extends AbstractConfig\n{\n    public static function create($appId, $apiKey)\n    {\n        $config = [\n            'appId' => $appId,\n            'apiKey' => $apiKey,\n        ];\n\n        return new static($config);\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Config/RecommendConfig.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config;\n\nfinal class RecommendConfig extends AbstractConfig\n{\n    public static function create($appId = null, $apiKey = null, $region = null)\n    {\n        $config = [\n            'appId' => null !== $appId ? $appId : getenv('ALGOLIA_APP_ID'),\n            'apiKey' => null !== $apiKey ? $apiKey : getenv('ALGOLIA_API_KEY'),\n            'region' => null !== $region ? $region : 'us',\n        ];\n\n        return new static($config);\n    }\n\n    public function setRegion($region)\n    {\n        $this->config['region'] = $region;\n\n        return $this;\n    }\n\n    public function getRegion()\n    {\n        return $this->config['region'];\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Config/RecommendationConfig.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config;\n\n/**\n * @deprecated Please use WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\PersonalizationConfig instead\n */\nfinal class RecommendationConfig extends AbstractConfig\n{\n    /**\n     * @param string|null $appId\n     * @param string|null $apiKey\n     * @param string|null $region\n     *\n     * @return RecommendationConfig\n     */\n    public static function create($appId = null, $apiKey = null, $region = null)\n    {\n        $config = [\n            'appId' => null !== $appId ? $appId : getenv('ALGOLIA_APP_ID'),\n            'apiKey' => null !== $apiKey ? $apiKey : getenv('ALGOLIA_API_KEY'),\n            'region' => null !== $region ? $region : 'us',\n        ];\n\n        return new self($config);\n    }\n\n    public function getRegion()\n    {\n        return $this->config['region'];\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Config/SearchConfig.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config;\n\nclass SearchConfig extends AbstractConfig\n{\n    private $defaultWaitTaskTimeBeforeRetry = 100000;\n\n    public static function create($appId = null, $apiKey = null)\n    {\n        $config = [\n            'appId' => null !== $appId ? $appId : getenv('ALGOLIA_APP_ID'),\n            'apiKey' => null !== $apiKey ? $apiKey : getenv('ALGOLIA_API_KEY'),\n        ];\n\n        return new static($config);\n    }\n\n    public function getDefaultConfig()\n    {\n        return [\n            'appId' => '',\n            'apiKey' => '',\n            'hosts' => null,\n            'readTimeout' => $this->defaultReadTimeout,\n            'writeTimeout' => $this->defaultWriteTimeout,\n            'connectTimeout' => $this->defaultConnectTimeout,\n            'waitTaskTimeBeforeRetry' => $this->defaultWaitTaskTimeBeforeRetry,\n            'defaultHeaders' => [],\n            'defaultForwardToReplicas' => null,\n            'batchSize' => 1000,\n        ];\n    }\n\n    public function getWaitTaskTimeBeforeRetry()\n    {\n        return $this->config['waitTaskTimeBeforeRetry'];\n    }\n\n    public function setWaitTaskTimeBeforeRetry($time)\n    {\n        if (!is_numeric($time)) {\n            throw new \\InvalidArgumentException('Time before retry must be a numeric value');\n        }\n\n        $this->config['waitTaskTimeBeforeRetry'] = $time;\n\n        return $this;\n    }\n\n    public function getDefaultForwardToReplicas()\n    {\n        return $this->config['defaultForwardToReplicas'];\n    }\n\n    public function setDefaultForwardToReplicas($default)\n    {\n        if (!is_bool($default)) {\n            throw new \\InvalidArgumentException('Default configuration for ForwardToReplicas must be a boolean');\n        }\n\n        $this->config['defaultForwardToReplicas'] = $default;\n\n        return $this;\n    }\n\n    public function getBatchSize()\n    {\n        return $this->config['batchSize'];\n    }\n\n    public function setBatchSize($batchSize)\n    {\n        if (!is_int($batchSize) || $batchSize < 1) {\n            throw new \\InvalidArgumentException('Batch size must be an integer greater than 0');\n        }\n\n        $this->config['batchSize'] = $batchSize;\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Exceptions/AlgoliaException.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions;\n\nclass AlgoliaException extends \\Exception\n{\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Exceptions/BadRequestException.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions;\n\nclass BadRequestException extends RequestException\n{\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Exceptions/CannotWaitException.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions;\n\nfinal class CannotWaitException extends AlgoliaException\n{\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Exceptions/MissingObjectId.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions;\n\nclass MissingObjectId extends AlgoliaException\n{\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Exceptions/NotFoundException.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions;\n\nfinal class NotFoundException extends BadRequestException\n{\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Exceptions/ObjectNotFoundException.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions;\n\nfinal class ObjectNotFoundException extends AlgoliaException\n{\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Exceptions/RequestException.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions;\n\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\RequestInterface;\n\nclass RequestException extends AlgoliaException\n{\n    private $request;\n\n    public function setRequest(RequestInterface $request)\n    {\n        $this->request = $request;\n\n        return $this;\n    }\n\n    public function getRequest()\n    {\n        return $this->request;\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Exceptions/RetriableException.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions;\n\nfinal class RetriableException extends RequestException\n{\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Exceptions/UnreachableException.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions;\n\nfinal class UnreachableException extends AlgoliaException\n{\n    public function __construct($message = '', $code = 0, $previous = null)\n    {\n        if (!$message) {\n            $message = 'Impossible to connect, please check your Algolia Application Id.';\n        }\n\n        parent::__construct($message, $code, $previous);\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Exceptions/ValidUntilNotFoundException.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions;\n\nfinal class ValidUntilNotFoundException extends AlgoliaException\n{\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Http/CurlHttpClient.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\Psr7\\Response;\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\RequestInterface;\n\nfinal class CurlHttpClient implements HttpClientInterface\n{\n    private $curlMHandle;\n\n    private $curlOptions;\n\n    public function __construct($curlOptions = [])\n    {\n        $this->curlOptions = $curlOptions;\n    }\n\n    public function sendRequest(RequestInterface $request, $timeout, $connectTimeout)\n    {\n        $curlHandle = curl_init();\n\n        // set curl options\n        try {\n            foreach ($this->curlOptions as $curlOption => $optionValue) {\n                curl_setopt($curlHandle, constant($curlOption), $optionValue);\n            }\n        } catch (\\Exception $e) {\n            $this->invalidOptions($this->curlOptions, $e->getMessage());\n        }\n\n        $curlHeaders = [];\n        foreach ($request->getHeaders() as $key => $values) {\n            $curlHeaders[] = $key.': '.implode(',', $values);\n        }\n\n        curl_setopt($curlHandle, CURLOPT_HTTPHEADER, $curlHeaders);\n\n        curl_setopt($curlHandle, CURLOPT_USERAGENT, implode(',', $request->getHeader('User-Agent')));\n        //Return the output instead of printing it\n        curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);\n        curl_setopt($curlHandle, CURLOPT_FAILONERROR, true);\n        curl_setopt($curlHandle, CURLOPT_ENCODING, '');\n        curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, true);\n        curl_setopt($curlHandle, CURLOPT_SSL_VERIFYHOST, 2);\n        // TODO: look into cert\n//        curl_setopt($curlHandle, CURLOPT_CAINFO, $this->caInfoPath);\n\n        curl_setopt($curlHandle, CURLOPT_URL, (string) $request->getUri());\n        $version = curl_version();\n        if (version_compare($version['version'], '7.16.2', '>=') && $connectTimeout < 1) {\n            curl_setopt($curlHandle, CURLOPT_CONNECTTIMEOUT_MS, $connectTimeout * 1000);\n            curl_setopt($curlHandle, CURLOPT_TIMEOUT_MS, $timeout * 1000);\n        } else {\n            curl_setopt($curlHandle, CURLOPT_CONNECTTIMEOUT, $connectTimeout);\n            curl_setopt($curlHandle, CURLOPT_TIMEOUT, $timeout);\n        }\n\n        // The problem is that on (Li|U)nix, when libcurl uses the standard name resolver,\n        // a SIGALRM is raised during name resolution which libcurl thinks is the timeout alarm.\n        curl_setopt($curlHandle, CURLOPT_NOSIGNAL, 1);\n        curl_setopt($curlHandle, CURLOPT_FAILONERROR, false);\n\n        $method = $request->getMethod();\n        if ('GET' === $method) {\n            curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'GET');\n            curl_setopt($curlHandle, CURLOPT_HTTPGET, true);\n            curl_setopt($curlHandle, CURLOPT_POST, false);\n        } else {\n            if ('POST' === $method) {\n                $body = (string) $request->getBody();\n                curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'POST');\n                curl_setopt($curlHandle, CURLOPT_POST, true);\n                curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $body);\n            } elseif ('DELETE' === $method) {\n                curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'DELETE');\n                curl_setopt($curlHandle, CURLOPT_POST, false);\n            } elseif ('PUT' === $method) {\n                $body = (string) $request->getBody();\n                curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'PUT');\n                curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $body);\n                curl_setopt($curlHandle, CURLOPT_POST, true);\n            }\n        }\n        $mhandle = $this->getMHandle($curlHandle);\n\n        // Do all the processing.\n        $running = null;\n        do {\n            $mrc = curl_multi_exec($mhandle, $running);\n        } while (CURLM_CALL_MULTI_PERFORM == $mrc);\n\n        while ($running && CURLM_OK == $mrc) {\n            if (-1 == curl_multi_select($mhandle, 0.1)) {\n                usleep(100);\n            }\n            do {\n                $mrc = curl_multi_exec($mhandle, $running);\n            } while (CURLM_CALL_MULTI_PERFORM == $mrc);\n        }\n\n        $statusCode = (int) curl_getinfo($curlHandle, CURLINFO_HTTP_CODE);\n        $responseBody = curl_multi_getcontent($curlHandle);\n        $error = curl_error($curlHandle);\n\n        $this->releaseMHandle($curlHandle);\n        curl_close($curlHandle);\n\n        return new Response($statusCode, [], $responseBody, '1.1', $error);\n    }\n\n    private function getMHandle($curlHandle)\n    {\n        if (!is_resource($this->curlMHandle)) {\n            $this->curlMHandle = curl_multi_init();\n        }\n        curl_multi_add_handle($this->curlMHandle, $curlHandle);\n\n        return $this->curlMHandle;\n    }\n\n    private function releaseMHandle($curlHandle)\n    {\n        curl_multi_remove_handle($this->curlMHandle, $curlHandle);\n    }\n\n    private function invalidOptions(array $curlOptions = [], $errorMsg = '')\n    {\n        throw new \\OutOfBoundsException(sprintf('AlgoliaSearch curloptions options keys are invalid. %s given. error message : %s', json_encode($curlOptions), $errorMsg));\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Http/GuzzleHttpClient.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\Psr7\\Response;\nuse GuzzleHttp\\Client as GuzzleClient;\nuse GuzzleHttp\\Exception\\ConnectException;\nuse GuzzleHttp\\Exception\\RequestException;\nuse GuzzleHttp\\HandlerStack;\nuse GuzzleHttp\\Middleware;\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\RequestInterface;\n\nfinal class GuzzleHttpClient implements HttpClientInterface\n{\n    private $client;\n\n    public function __construct(?GuzzleClient $client = null)\n    {\n        $this->client = $client ?: static::buildClient();\n    }\n\n    public function sendRequest(RequestInterface $request, $timeout, $connectTimeout)\n    {\n        try {\n            $response = $this->client->send($request, [\n                'timeout' => $timeout,\n                'connect_timeout' => $connectTimeout,\n            ]);\n        } catch (RequestException $e) {\n            if ($e->hasResponse()) {\n                return $e->getResponse();\n            } else {\n                return new Response(\n                    0,\n                    [],\n                    null,\n                    '1.1',\n                    $e->getMessage()\n                );\n            }\n        } catch (ConnectException $e) {\n            return new Response(\n                0,\n                [],\n                null,\n                '1.1',\n                $e->getMessage()\n            );\n        }\n\n        return $response;\n    }\n\n    private static function buildClient(array $config = [])\n    {\n        $handlerStack = new HandlerStack(\\GuzzleHttp\\choose_handler());\n        $handlerStack->push(Middleware::prepareBody(), 'prepare_body');\n        $config = array_merge(['handler' => $handlerStack], $config);\n\n        return new GuzzleClient($config);\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Http/HttpClientInterface.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http;\n\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\RequestInterface;\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\ResponseInterface;\n\ninterface HttpClientInterface\n{\n    /**\n     * The method takes a PSR request and 2 timeouts, dispatch\n     * the call and must return a PSR Response.\n     *\n     * If the HTTP layer throws exception in case of error 4xx or 5xx\n     * for instance, they must be converted to a Response to keep\n     * the retry strategy working as expected.\n     *\n     * @param int $timeout\n     * @param int $connectTimeout\n     *\n     * @return ResponseInterface\n     */\n    public function sendRequest(RequestInterface $request, $timeout, $connectTimeout);\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Http/Psr7/BufferStream.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\Psr7;\n\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\StreamInterface;\n\n/**\n * Provides a buffer stream that can be written to to fill a buffer, and read\n * from to remove bytes from the buffer.\n *\n * This stream returns a \"hwm\" metadata value that tells upstream consumers\n * what the configured high water mark of the stream is, or the maximum\n * preferred size of the buffer.\n *\n * @internal\n */\nclass BufferStream implements StreamInterface\n{\n    private $hwm;\n\n    private $buffer = '';\n\n    /**\n     * @param int $hwm High water mark, representing the preferred maximum\n     *                 buffer size. If the size of the buffer exceeds the high\n     *                 water mark, then calls to write will continue to succeed\n     *                 but will return false to inform writers to slow down\n     *                 until the buffer has been drained by reading from it.\n     */\n    public function __construct($hwm = 16384)\n    {\n        $this->hwm = $hwm;\n    }\n\n    public function __toString(): string\n    {\n        return $this->getContents();\n    }\n\n    public function getContents(): string\n    {\n        $buffer = $this->buffer;\n        $this->buffer = '';\n\n        return $buffer;\n    }\n\n    public function close(): void\n    {\n        $this->buffer = '';\n    }\n\n    public function detach()\n    {\n        $this->close();\n    }\n\n    public function getSize(): ?int\n    {\n        return strlen($this->buffer);\n    }\n\n    public function isReadable(): bool\n    {\n        return true;\n    }\n\n    public function isWritable(): bool\n    {\n        return true;\n    }\n\n    public function isSeekable(): bool\n    {\n        return false;\n    }\n\n    public function rewind(): void\n    {\n        $this->seek(0);\n    }\n\n    public function seek(int $offset, int $whence = SEEK_SET): void\n    {\n        throw new \\RuntimeException('Cannot seek a BufferStream');\n    }\n\n    public function eof(): bool\n    {\n        return 0 === strlen($this->buffer);\n    }\n\n    public function tell(): int\n    {\n        throw new \\RuntimeException('Cannot determine the position of a BufferStream');\n    }\n\n    /**\n     * Reads data from the buffer.\n     */\n    public function read(int $length): string\n    {\n        $currentLength = strlen($this->buffer);\n\n        if ($length >= $currentLength) {\n            // No need to slice the buffer because we don't have enough data.\n            $result = $this->buffer;\n            $this->buffer = '';\n        } else {\n            // Slice up the result to provide a subset of the buffer.\n            $result = substr($this->buffer, 0, $length);\n            $this->buffer = substr($this->buffer, $length);\n        }\n\n        return $result;\n    }\n\n    /**\n     * Writes data to the buffer.\n     */\n    public function write(string $string): int\n    {\n        $this->buffer .= $string;\n\n        // TODO: What should happen here?\n        if (strlen($this->buffer) >= $this->hwm) {\n            return false;\n        }\n\n        return strlen($string);\n    }\n\n    public function getMetadata(?string $key = null)\n    {\n        if ('hwm' == $key) {\n            return $this->hwm;\n        }\n\n        return $key ? null : [];\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Http/Psr7/PumpStream.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\Psr7;\n\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\StreamInterface;\n\n/**\n * Provides a read only stream that pumps data from a PHP callable.\n *\n * When invoking the provided callable, the PumpStream will pass the amount of\n * data requested to read to the callable. The callable can choose to ignore\n * this value and return fewer or more bytes than requested. Any extra data\n * returned by the provided callable is buffered internally until drained using\n * the read() function of the PumpStream. The provided callable MUST return\n * false when there is no more data to read.\n *\n * @internal\n */\nclass PumpStream implements StreamInterface\n{\n    /** @var callable */\n    private $source;\n\n    /** @var int */\n    private $size;\n\n    /** @var int */\n    private $tellPos = 0;\n\n    /** @var array */\n    private $metadata;\n\n    /** @var BufferStream */\n    private $buffer;\n\n    /**\n     * @param callable $source  Source of the stream data. The callable MAY\n     *                          accept an integer argument used to control the\n     *                          amount of data to return. The callable MUST\n     *                          return a string when called, or false on error\n     *                          or EOF.\n     * @param array    $options stream options:\n     *                          - metadata: Hash of metadata to use with stream.\n     *                          - size: Size of the stream, if known\n     */\n    public function __construct(callable $source, array $options = [])\n    {\n        $this->source = $source;\n        $this->size = isset($options['size']) ? $options['size'] : null;\n        $this->metadata = isset($options['metadata']) ? $options['metadata'] : [];\n        $this->buffer = new BufferStream();\n    }\n\n    public function __toString(): string\n    {\n        try {\n            return copy_to_string($this);\n        } catch (\\Exception $e) {\n            return '';\n        }\n    }\n\n    public function close(): void\n    {\n        $this->detach();\n    }\n\n    public function detach()\n    {\n        $this->tellPos = false;\n        $this->source = null;\n    }\n\n    public function getSize(): ?int\n    {\n        return $this->size;\n    }\n\n    public function tell(): int\n    {\n        return $this->tellPos;\n    }\n\n    public function eof(): bool\n    {\n        return !$this->source;\n    }\n\n    public function isSeekable(): bool\n    {\n        return false;\n    }\n\n    public function rewind(): void\n    {\n        $this->seek(0);\n    }\n\n    public function seek(int $offset, int $whence = SEEK_SET): void\n    {\n        throw new \\RuntimeException('Cannot seek a PumpStream');\n    }\n\n    public function isWritable(): bool\n    {\n        return false;\n    }\n\n    public function write(string $string): int\n    {\n        throw new \\RuntimeException('Cannot write to a PumpStream');\n    }\n\n    public function isReadable(): bool\n    {\n        return true;\n    }\n\n    public function read(int $length): string\n    {\n        $data = $this->buffer->read($length);\n        $readLen = strlen($data);\n        $this->tellPos += $readLen;\n        $remaining = $length - $readLen;\n\n        if ($remaining) {\n            $this->pump($remaining);\n            $data .= $this->buffer->read($remaining);\n            $this->tellPos += strlen($data) - $readLen;\n        }\n\n        return $data;\n    }\n\n    public function getContents(): string\n    {\n        $result = '';\n        while (!$this->eof()) {\n            $result .= $this->read(1000000);\n        }\n\n        return $result;\n    }\n\n    public function getMetadata(?string $key = null)\n    {\n        if (!$key) {\n            return $this->metadata;\n        }\n\n        return $this->metadata[$key] ?? null;\n    }\n\n    private function pump($length)\n    {\n        if ($this->source) {\n            do {\n                $data = call_user_func($this->source, $length);\n                if (false === $data || null === $data) {\n                    $this->source = null;\n\n                    return;\n                }\n                $this->buffer->write($data);\n                $length -= strlen($data);\n            } while ($length > 0);\n        }\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Http/Psr7/Request.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\Psr7;\n\nuse InvalidArgumentException;\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\MessageInterface;\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\RequestInterface;\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\StreamInterface;\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\UriInterface;\n\n/**\n * PSR-7 request implementation.\n *\n * @internal\n */\nclass Request implements RequestInterface\n{\n    /** @var string */\n    private $method;\n\n    /** @var string|null */\n    private $requestTarget;\n\n    /** @var UriInterface */\n    private $uri;\n\n    /** @var array Map of all registered headers, as original name => array of values */\n    private $headers = [];\n\n    /** @var array Map of lowercase header name => original name at registration */\n    private $headerNames = [];\n\n    /** @var string */\n    private $protocol = '1.1';\n\n    /** @var StreamInterface */\n    private $stream;\n\n    /**\n     * @param string                               $method  HTTP method\n     * @param string|UriInterface                  $uri     URI\n     * @param array                                $headers Request headers\n     * @param string|resource|StreamInterface|null $body    Request body\n     * @param string                               $version Protocol version\n     */\n    public function __construct(\n        $method,\n        $uri,\n        array $headers = [],\n        $body = null,\n        $version = '1.1'\n    ) {\n        if (!($uri instanceof UriInterface)) {\n            $uri = new Uri($uri);\n        }\n\n        $this->method = strtoupper($method);\n        $this->uri = $uri;\n        $this->setHeaders($headers);\n        $this->protocol = $version;\n\n        if (!$this->hasHeader('Host')) {\n            $this->updateHostFromUri();\n        }\n\n        if ('' !== $body && null !== $body) {\n            $this->stream = stream_for($body);\n        }\n    }\n\n    /**\n     * @return string|null\n     */\n    public function getRequestTarget(): string\n    {\n        if (null !== $this->requestTarget) {\n            return $this->requestTarget;\n        }\n\n        $target = $this->uri->getPath();\n        if ('' == $target) {\n            $target = '/';\n        }\n        if ('' != $this->uri->getQuery()) {\n            $target .= '?'.$this->uri->getQuery();\n        }\n\n        return $target;\n    }\n\n    /**\n     * @return Request\n     */\n    public function withRequestTarget($requestTarget): RequestInterface\n    {\n        if (preg_match('#\\s#', $requestTarget)) {\n            throw new InvalidArgumentException('Invalid request target provided; cannot contain whitespace');\n        }\n\n        $new = clone $this;\n        $new->requestTarget = $requestTarget;\n\n        return $new;\n    }\n\n    public function getMethod(): string\n    {\n        return $this->method;\n    }\n\n    /**\n     * @return Request\n     */\n    public function withMethod(string $method): RequestInterface\n    {\n        $new = clone $this;\n        $new->method = strtoupper($method);\n\n        return $new;\n    }\n\n    /**\n     * @return Uri|UriInterface|string\n     */\n    public function getUri(): UriInterface\n    {\n        return $this->uri;\n    }\n\n    /**\n     * @return Request\n     */\n    public function withUri(UriInterface $uri, $preserveHost = false): RequestInterface\n    {\n        if ($uri === $this->uri) {\n            return $this;\n        }\n\n        $new = clone $this;\n        $new->uri = $uri;\n\n        if (!$preserveHost) {\n            $new->updateHostFromUri();\n        }\n\n        return $new;\n    }\n\n    /**\n     * @return void\n     */\n    private function updateHostFromUri()\n    {\n        $host = $this->uri->getHost();\n\n        if ('' == $host) {\n            return;\n        }\n\n        if (null !== ($port = $this->uri->getPort())) {\n            $host .= ':'.$port;\n        }\n\n        if (isset($this->headerNames['host'])) {\n            $header = $this->headerNames['host'];\n        } else {\n            $header = 'Host';\n            $this->headerNames['host'] = 'Host';\n        }\n        // Ensure Host is the first header.\n        // See: http://tools.ietf.org/html/rfc7230#section-5.4\n        $this->headers = [$header => [$host]] + $this->headers;\n    }\n\n    public function getProtocolVersion(): string\n    {\n        return $this->protocol;\n    }\n\n    /**\n     * @return Request\n     */\n    public function withProtocolVersion(string $version): MessageInterface\n    {\n        if ($this->protocol === $version) {\n            return $this;\n        }\n        $new = clone $this;\n        $new->protocol = $version;\n\n        return $new;\n    }\n\n    public function getHeaders(): array\n    {\n        return $this->headers;\n    }\n\n    public function hasHeader(string $name): bool\n    {\n        return isset($this->headerNames[strtolower($name)]);\n    }\n\n    /**\n     * @return array|mixed\n     */\n    public function getHeader(string $name): array\n    {\n        $name = strtolower($name);\n        if (!isset($this->headerNames[$name])) {\n            return [];\n        }\n        $name = $this->headerNames[$name];\n\n        return $this->headers[$name];\n    }\n\n    public function getHeaderLine(string $name): string\n    {\n        return implode(', ', $this->getHeader($name));\n    }\n\n    public function withHeader(string $name, $value): MessageInterface\n    {\n        if (!is_array($value)) {\n            $value = [$value];\n        }\n        $value = $this->trimHeaderValues($value);\n        $normalized = strtolower($name);\n        $new = clone $this;\n        if (isset($new->headerNames[$normalized])) {\n            unset($new->headers[$new->headerNames[$normalized]]);\n        }\n        $new->headerNames[$normalized] = $name;\n        $new->headers[$name] = $value;\n\n        return $new;\n    }\n\n    /**\n     * @return Request\n     */\n    public function withAddedHeader(string $name, $value): MessageInterface\n    {\n        if (!is_array($value)) {\n            $value = [$value];\n        }\n        $value = $this->trimHeaderValues($value);\n        $normalized = strtolower($name);\n        $new = clone $this;\n        if (isset($new->headerNames[$normalized])) {\n            $name = $this->headerNames[$normalized];\n            $new->headers[$name] = array_merge($this->headers[$name], $value);\n        } else {\n            $new->headerNames[$normalized] = $name;\n            $new->headers[$name] = $value;\n        }\n\n        return $new;\n    }\n\n    /**\n     * @return Request\n     */\n    public function withoutHeader(string $name): MessageInterface\n    {\n        $normalized = strtolower($name);\n        if (!isset($this->headerNames[$normalized])) {\n            return $this;\n        }\n        $name = $this->headerNames[$normalized];\n        $new = clone $this;\n        unset($new->headers[$name], $new->headerNames[$normalized]);\n\n        return $new;\n    }\n\n    /**\n     * @return PumpStream|Stream|StreamInterface\n     */\n    public function getBody(): StreamInterface\n    {\n        if (!$this->stream) {\n            $this->stream = stream_for('');\n        }\n\n        return $this->stream;\n    }\n\n    /**\n     * @return Request\n     */\n    public function withBody(StreamInterface $body): MessageInterface\n    {\n        if ($body === $this->stream) {\n            return $this;\n        }\n        $new = clone $this;\n        $new->stream = $body;\n\n        return $new;\n    }\n\n    /**\n     * @return void\n     */\n    private function setHeaders(array $headers)\n    {\n        $this->headerNames = $this->headers = [];\n        foreach ($headers as $header => $value) {\n            if (!is_array($value)) {\n                $value = [$value];\n            }\n            $value = $this->trimHeaderValues($value);\n            $normalized = strtolower($header);\n            if (isset($this->headerNames[$normalized])) {\n                $header = $this->headerNames[$normalized];\n                $this->headers[$header] = array_merge($this->headers[$header], $value);\n            } else {\n                $this->headerNames[$normalized] = $header;\n                $this->headers[$header] = $value;\n            }\n        }\n    }\n\n    /**\n     * Trims whitespace from the header values.\n     *\n     * Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field.\n     *\n     * header-field = field-name \":\" OWS field-value OWS\n     * OWS          = *( SP / HTAB )\n     *\n     * @param string[] $values Header values\n     *\n     * @return string[] Trimmed header values\n     *\n     * @see https://tools.ietf.org/html/rfc7230#section-3.2.4\n     */\n    private function trimHeaderValues(array $values)\n    {\n        return array_map(function ($value) {\n            return trim($value, \" \\t\");\n        }, $values);\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Http/Psr7/Response.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\Psr7;\n\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\MessageInterface;\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\ResponseInterface;\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\StreamInterface;\n\n/**\n * PSR-7 response implementation.\n *\n * This class was modified to support PHP 5.3,\n * same for all the classes under PSR7 folder.\n *\n * @internal\n */\nclass Response implements ResponseInterface\n{\n    /** @var array Map of all registered headers, as original name => array of values */\n    private $headers = [];\n\n    /** @var array Map of lowercase header name => original name at registration */\n    private $headerNames = [];\n\n    /** @var string */\n    private $protocol = '1.1';\n\n    /** @var StreamInterface */\n    private $stream;\n\n    /** @var array Map of standard HTTP status code/reason phrases */\n    private static $phrases = [\n        100 => 'Continue',\n        101 => 'Switching Protocols',\n        102 => 'Processing',\n        200 => 'OK',\n        201 => 'Created',\n        202 => 'Accepted',\n        203 => 'Non-Authoritative Information',\n        204 => 'No Content',\n        205 => 'Reset Content',\n        206 => 'Partial Content',\n        207 => 'Multi-status',\n        208 => 'Already Reported',\n        300 => 'Multiple Choices',\n        301 => 'Moved Permanently',\n        302 => 'Found',\n        303 => 'See Other',\n        304 => 'Not Modified',\n        305 => 'Use Proxy',\n        306 => 'Switch Proxy',\n        307 => 'Temporary Redirect',\n        400 => 'Bad Request',\n        401 => 'Unauthorized',\n        402 => 'Payment Required',\n        403 => 'Forbidden',\n        404 => 'Not Found',\n        405 => 'Method Not Allowed',\n        406 => 'Not Acceptable',\n        407 => 'Proxy Authentication Required',\n        408 => 'Request Time-out',\n        409 => 'Conflict',\n        410 => 'Gone',\n        411 => 'Length Required',\n        412 => 'Precondition Failed',\n        413 => 'Request Entity Too Large',\n        414 => 'Request-URI Too Large',\n        415 => 'Unsupported Media Type',\n        416 => 'Requested range not satisfiable',\n        417 => 'Expectation Failed',\n        418 => 'I\\'m a teapot',\n        422 => 'Unprocessable Entity',\n        423 => 'Locked',\n        424 => 'Failed Dependency',\n        425 => 'Unordered Collection',\n        426 => 'Upgrade Required',\n        428 => 'Precondition Required',\n        429 => 'Too Many Requests',\n        431 => 'Request Header Fields Too Large',\n        451 => 'Unavailable For Legal Reasons',\n        500 => 'Internal Server Error',\n        501 => 'Not Implemented',\n        502 => 'Bad Gateway',\n        503 => 'Service Unavailable',\n        504 => 'Gateway Time-out',\n        505 => 'HTTP Version not supported',\n        506 => 'Variant Also Negotiates',\n        507 => 'Insufficient Storage',\n        508 => 'Loop Detected',\n        511 => 'Network Authentication Required',\n    ];\n\n    /** @var string */\n    private $reasonPhrase = '';\n\n    /** @var int */\n    private $statusCode = 200;\n\n    /**\n     * @param int                                  $status  Status code\n     * @param array                                $headers Response headers\n     * @param string|resource|StreamInterface|null $body    Response body\n     * @param string                               $version Protocol version\n     * @param string|null                          $reason  Reason phrase (when empty a default will be used based on the status code)\n     */\n    public function __construct(\n        $status = 200,\n        array $headers = [],\n        $body = null,\n        $version = '1.1',\n        $reason = null\n    ) {\n        $this->statusCode = (int) $status;\n\n        if ('' !== $body && null !== $body) {\n            $this->stream = stream_for($body);\n        }\n\n        $this->setHeaders($headers);\n        if ('' == $reason && isset(self::$phrases[$this->statusCode])) {\n            $this->reasonPhrase = self::$phrases[$this->statusCode];\n        } else {\n            $this->reasonPhrase = (string) $reason;\n        }\n\n        $this->protocol = $version;\n    }\n\n    public function getStatusCode(): int\n    {\n        return $this->statusCode;\n    }\n\n    public function getReasonPhrase(): string\n    {\n        return $this->reasonPhrase;\n    }\n\n    /**\n     * @return static\n     */\n    public function withStatus(int $code, string $reasonPhrase = ''): ResponseInterface\n    {\n        $new = clone $this;\n        $new->statusCode = (int) $code;\n        if ('' == $reasonPhrase && isset(self::$phrases[$new->statusCode])) {\n            $reasonPhrase = self::$phrases[$new->statusCode];\n        }\n        $new->reasonPhrase = $reasonPhrase;\n\n        return $new;\n    }\n\n    public function getProtocolVersion(): string\n    {\n        return $this->protocol;\n    }\n\n    /**\n     * @return static\n     */\n    public function withProtocolVersion(string $version): MessageInterface\n    {\n        if ($this->protocol === $version) {\n            return $this;\n        }\n\n        $new = clone $this;\n        $new->protocol = $version;\n\n        return $new;\n    }\n\n    public function getHeaders(): array\n    {\n        return $this->headers;\n    }\n\n    public function hasHeader(string $name): bool\n    {\n        return isset($this->headerNames[strtolower($name)]);\n    }\n\n    public function getHeader(string $name): array\n    {\n        $name = strtolower($name);\n\n        if (!isset($this->headerNames[$name])) {\n            return [];\n        }\n\n        $name = $this->headerNames[$name];\n\n        return $this->headers[$name];\n    }\n\n    public function getHeaderLine(string $name): string\n    {\n        return implode(', ', $this->getHeader($name));\n    }\n\n    /**\n     * @return static\n     */\n    public function withHeader(string $name, $value): MessageInterface\n    {\n        if (!is_array($value)) {\n            $value = [$value];\n        }\n\n        $value = $this->trimHeaderValues($value);\n        $normalized = strtolower($name);\n\n        $new = clone $this;\n        if (isset($new->headerNames[$normalized])) {\n            unset($new->headers[$new->headerNames[$normalized]]);\n        }\n        $new->headerNames[$normalized] = $name;\n        $new->headers[$name] = $value;\n\n        return $new;\n    }\n\n    /**\n     * @return static\n     */\n    public function withAddedHeader(string $name, $value): MessageInterface\n    {\n        if (!is_array($value)) {\n            $value = [$value];\n        }\n\n        $value = $this->trimHeaderValues($value);\n        $normalized = strtolower($name);\n\n        $new = clone $this;\n        if (isset($new->headerNames[$normalized])) {\n            $name = $this->headerNames[$normalized];\n            $new->headers[$name] = array_merge($this->headers[$name], $value);\n        } else {\n            $new->headerNames[$normalized] = $name;\n            $new->headers[$name] = $value;\n        }\n\n        return $new;\n    }\n\n    /**\n     * @return static\n     */\n    public function withoutHeader(string $name): MessageInterface\n    {\n        $normalized = strtolower($name);\n\n        if (!isset($this->headerNames[$normalized])) {\n            return $this;\n        }\n\n        $name = $this->headerNames[$normalized];\n\n        $new = clone $this;\n        unset($new->headers[$name], $new->headerNames[$normalized]);\n\n        return $new;\n    }\n\n    public function getBody(): StreamInterface\n    {\n        if (!$this->stream) {\n            $this->stream = stream_for('');\n        }\n\n        return $this->stream;\n    }\n\n    /**\n     * @return static\n     */\n    public function withBody(StreamInterface $body): MessageInterface\n    {\n        if ($body === $this->stream) {\n            return $this;\n        }\n\n        $new = clone $this;\n        $new->stream = $body;\n\n        return $new;\n    }\n\n    private function setHeaders(array $headers)\n    {\n        $this->headerNames = $this->headers = [];\n        foreach ($headers as $header => $value) {\n            if (!is_array($value)) {\n                $value = [$value];\n            }\n\n            $value = $this->trimHeaderValues($value);\n            $normalized = strtolower($header);\n            if (isset($this->headerNames[$normalized])) {\n                $header = $this->headerNames[$normalized];\n                $this->headers[$header] = array_merge($this->headers[$header], $value);\n            } else {\n                $this->headerNames[$normalized] = $header;\n                $this->headers[$header] = $value;\n            }\n        }\n    }\n\n    /**\n     * Trims whitespace from the header values.\n     *\n     * Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field.\n     *\n     * header-field = field-name \":\" OWS field-value OWS\n     * OWS          = *( SP / HTAB )\n     *\n     * @param string[] $values Header values\n     *\n     * @return string[] Trimmed header values\n     *\n     * @see https://tools.ietf.org/html/rfc7230#section-3.2.4\n     */\n    private function trimHeaderValues(array $values)\n    {\n        return array_map(function ($value) {\n            return trim($value, \" \\t\");\n        }, $values);\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Http/Psr7/Stream.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\Psr7;\n\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\StreamInterface;\n\n/**\n * PHP stream implementation.\n *\n * @internal\n */\nclass Stream implements StreamInterface\n{\n    private $stream;\n\n    private $size;\n\n    private $seekable;\n\n    private $readable;\n\n    private $writable;\n\n    private $uri;\n\n    private $customMetadata;\n\n    /** @var array Hash of readable and writable stream types */\n    private static $readWriteHash = [\n        'read' => [\n            'r' => true, 'w+' => true, 'r+' => true, 'x+' => true, 'c+' => true,\n            'rb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true,\n            'c+b' => true, 'rt' => true, 'w+t' => true, 'r+t' => true,\n            'x+t' => true, 'c+t' => true, 'a+' => true,\n        ],\n        'write' => [\n            'w' => true, 'w+' => true, 'rw' => true, 'r+' => true, 'x+' => true,\n            'c+' => true, 'wb' => true, 'w+b' => true, 'r+b' => true,\n            'x+b' => true, 'c+b' => true, 'w+t' => true, 'r+t' => true,\n            'x+t' => true, 'c+t' => true, 'a' => true, 'a+' => true,\n        ],\n    ];\n\n    /**\n     * This constructor accepts an associative array of options.\n     *\n     * - size: (int) If a read stream would otherwise have an indeterminate\n     *   size, but the size is known due to foreknowledge, then you can\n     *   provide that size, in bytes.\n     * - metadata: (array) Any additional metadata to return when the metadata\n     *   of the stream is accessed.\n     *\n     * @param resource $stream  stream resource to wrap\n     * @param array    $options associative array of options\n     *\n     * @throws \\InvalidArgumentException if the stream is not a stream resource\n     */\n    public function __construct($stream, $options = [])\n    {\n        if (!is_resource($stream)) {\n            throw new \\InvalidArgumentException('Stream must be a resource');\n        }\n\n        if (isset($options['size'])) {\n            $this->size = $options['size'];\n        }\n\n        $this->customMetadata = isset($options['metadata'])\n            ? $options['metadata']\n            : [];\n\n        $this->stream = $stream;\n        $meta = stream_get_meta_data($this->stream);\n        $this->seekable = $meta['seekable'];\n        $this->readable = isset(self::$readWriteHash['read'][$meta['mode']]);\n        $this->writable = isset(self::$readWriteHash['write'][$meta['mode']]);\n        $this->uri = $this->getMetadata('uri');\n    }\n\n    /**\n     * Closes the stream when the destructed.\n     */\n    public function __destruct()\n    {\n        $this->close();\n    }\n\n    public function __toString(): string\n    {\n        try {\n            $this->seek(0);\n\n            return (string) stream_get_contents($this->stream);\n        } catch (\\Exception $e) {\n            return '';\n        }\n    }\n\n    public function getContents(): string\n    {\n        if (!isset($this->stream)) {\n            throw new \\RuntimeException('Stream is detached');\n        }\n\n        $contents = stream_get_contents($this->stream);\n\n        if (false === $contents) {\n            throw new \\RuntimeException('Unable to read stream contents');\n        }\n\n        return $contents;\n    }\n\n    public function close(): void\n    {\n        if (isset($this->stream)) {\n            if (is_resource($this->stream)) {\n                fclose($this->stream);\n            }\n            $this->detach();\n        }\n    }\n\n    /**\n     * @return resource|null\n     */\n    public function detach()\n    {\n        if (!isset($this->stream)) {\n            return null;\n        }\n\n        $result = $this->stream;\n        unset($this->stream);\n        $this->size = $this->uri = null;\n        $this->readable = $this->writable = $this->seekable = false;\n\n        return $result;\n    }\n\n    /**\n     * @return mixed|null\n     */\n    public function getSize(): ?int\n    {\n        if (null !== $this->size) {\n            return $this->size;\n        }\n\n        if (!isset($this->stream)) {\n            return null;\n        }\n\n        // Clear the stat cache if the stream has a URI\n        if ($this->uri) {\n            clearstatcache(true, $this->uri);\n        }\n\n        $stats = fstat($this->stream);\n        if (isset($stats['size'])) {\n            $this->size = $stats['size'];\n\n            return $this->size;\n        }\n\n        return null;\n    }\n\n    public function isReadable(): bool\n    {\n        return $this->readable;\n    }\n\n    public function isWritable(): bool\n    {\n        return $this->writable;\n    }\n\n    /**\n     * @return bool|mixed\n     */\n    public function isSeekable(): bool\n    {\n        return $this->seekable;\n    }\n\n    public function eof(): bool\n    {\n        if (!isset($this->stream)) {\n            throw new \\RuntimeException('Stream is detached');\n        }\n\n        return feof($this->stream);\n    }\n\n    public function tell(): int\n    {\n        if (!isset($this->stream)) {\n            throw new \\RuntimeException('Stream is detached');\n        }\n\n        $result = ftell($this->stream);\n\n        if (false === $result) {\n            throw new \\RuntimeException('Unable to determine stream position');\n        }\n\n        return $result;\n    }\n\n    public function rewind(): void\n    {\n        $this->seek(0);\n    }\n\n    public function seek(int $offset, int $whence = SEEK_SET): void\n    {\n        if (!isset($this->stream)) {\n            throw new \\RuntimeException('Stream is detached');\n        }\n        if (!$this->seekable) {\n            throw new \\RuntimeException('Stream is not seekable');\n        }\n        if (-1 === fseek($this->stream, $offset, $whence)) {\n            throw new \\RuntimeException('Unable to seek to stream position '.$offset.' with whence '.var_export($whence, true));\n        }\n    }\n\n    public function read(int $length): string\n    {\n        if (!isset($this->stream)) {\n            throw new \\RuntimeException('Stream is detached');\n        }\n        if (!$this->readable) {\n            throw new \\RuntimeException('Cannot read from non-readable stream');\n        }\n        if ($length < 0) {\n            throw new \\RuntimeException('Length parameter cannot be negative');\n        }\n\n        if (0 === $length) {\n            return '';\n        }\n\n        $string = fread($this->stream, $length);\n        if (false === $string) {\n            throw new \\RuntimeException('Unable to read from stream');\n        }\n\n        return $string;\n    }\n\n    public function write(string $string): int\n    {\n        if (!isset($this->stream)) {\n            throw new \\RuntimeException('Stream is detached');\n        }\n        if (!$this->writable) {\n            throw new \\RuntimeException('Cannot write to a non-writable stream');\n        }\n\n        // We can't know the size after writing anything\n        $this->size = null;\n        $result = fwrite($this->stream, $string);\n\n        if (false === $result) {\n            throw new \\RuntimeException('Unable to write to stream');\n        }\n\n        return $result;\n    }\n\n    /**\n     * @return array|mixed|null\n     */\n    public function getMetadata(?string $key = null)\n    {\n        if (!isset($this->stream)) {\n            return $key ? null : [];\n        } elseif (!$key) {\n            return $this->customMetadata + stream_get_meta_data($this->stream);\n        } elseif (isset($this->customMetadata[$key])) {\n            return $this->customMetadata[$key];\n        }\n\n        $meta = stream_get_meta_data($this->stream);\n\n        return $meta[$key] ?? null;\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Http/Psr7/Uri.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\Psr7;\n\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\UriInterface;\n\n/**\n * PSR-7 URI implementation based on the work of:.\n *\n * @author Michael Dowling\n * @author Tobias Schultze\n * @author Matthew Weier O'Phinney\n *\n * Adapted for PHP 5.3 by Algolia.\n *\n * @internal\n */\nclass Uri implements UriInterface\n{\n    /**\n     * Absolute http and https URIs require a host per RFC 7230 Section 2.7\n     * but in generic URIs the host can be empty. So for http(s) URIs\n     * we apply this default host when no host is given yet to form a\n     * valid URI.\n     */\n    const HTTP_DEFAULT_HOST = 'localhost';\n\n    private static $defaultPorts = [\n        'http' => 80,\n        'https' => 443,\n        'ftp' => 21,\n        'gopher' => 70,\n        'nntp' => 119,\n        'news' => 119,\n        'telnet' => 23,\n        'tn3270' => 23,\n        'imap' => 143,\n        'pop' => 110,\n        'ldap' => 389,\n    ];\n\n    private static $charUnreserved = 'a-zA-Z0-9_\\-\\.~';\n\n    private static $charSubDelims = '!\\$&\\'\\(\\)\\*\\+,;=';\n\n    private static $replaceQuery = ['=' => '%3D', '&' => '%26'];\n\n    /** @var string Uri scheme. */\n    private $scheme = '';\n\n    /** @var string Uri user info. */\n    private $userInfo = '';\n\n    /** @var string Uri host. */\n    private $host = '';\n\n    /** @var int|null Uri port. */\n    private $port;\n\n    /** @var string Uri path. */\n    private $path = '';\n\n    /** @var string Uri query string. */\n    private $query = '';\n\n    /** @var string Uri fragment. */\n    private $fragment = '';\n\n    /**\n     * @param string $uri URI to parse\n     */\n    public function __construct($uri = '')\n    {\n        // weak type check to also accept null until we can add scalar type hints\n        if ('' != $uri) {\n            $parts = parse_url($uri);\n            if (false === $parts) {\n                throw new \\InvalidArgumentException(\"Unable to parse URI: $uri\");\n            }\n            $this->applyParts($parts);\n        }\n    }\n\n    public function __toString(): string\n    {\n        return self::composeComponents(\n            $this->scheme,\n            $this->getAuthority(),\n            $this->path,\n            $this->query,\n            $this->fragment\n        );\n    }\n\n    /**\n     * Composes a URI reference string from its various components.\n     *\n     * Usually this method does not need to be called manually but instead is used indirectly via\n     * `Psr\\Http\\Message\\UriInterface::__toString`.\n     *\n     * PSR-7 UriInterface treats an empty component the same as a missing component as\n     * getQuery(), getFragment() etc. always return a string. This explains the slight\n     * difference to RFC 3986 Section 5.3.\n     *\n     * Another adjustment is that the authority separator is added even when the authority is missing/empty\n     * for the \"file\" scheme. This is because PHP stream functions like `file_get_contents` only work with\n     * `file:///myfile` but not with `file:/myfile` although they are equivalent according to RFC 3986. But\n     * `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to\n     * that format).\n     *\n     * @param string $scheme\n     * @param string $authority\n     * @param string $path\n     * @param string $query\n     * @param string $fragment\n     *\n     * @return string\n     *\n     * @see https://tools.ietf.org/html/rfc3986#section-5.3\n     */\n    public static function composeComponents($scheme, $authority, $path, $query, $fragment)\n    {\n        $uri = '';\n\n        // weak type checks to also accept null until we can add scalar type hints\n        if ('' != $scheme) {\n            $uri .= $scheme.':';\n        }\n\n        if ('' != $authority || 'file' === $scheme) {\n            $uri .= '//'.$authority;\n        }\n\n        $uri .= $path;\n\n        if ('' != $query) {\n            $uri .= '?'.$query;\n        }\n\n        if ('' != $fragment) {\n            $uri .= '#'.$fragment;\n        }\n\n        return $uri;\n    }\n\n    /**\n     * Whether the URI has the default port of the current scheme.\n     *\n     * `Psr\\Http\\Message\\UriInterface::getPort` may return null or the standard port. This method can be used\n     * independently of the implementation.\n     *\n     * @return bool\n     */\n    public static function isDefaultPort(UriInterface $uri)\n    {\n        return null === $uri->getPort()\n            || (isset(self::$defaultPorts[$uri->getScheme()]) && $uri->getPort() === self::$defaultPorts[$uri->getScheme()]);\n    }\n\n    /**\n     * Whether the URI is absolute, i.e. it has a scheme.\n     *\n     * An instance of UriInterface can either be an absolute URI or a relative reference. This method returns true\n     * if it is the former. An absolute URI has a scheme. A relative reference is used to express a URI relative\n     * to another URI, the base URI. Relative references can be divided into several forms:\n     * - network-path references, e.g. '//example.com/path'\n     * - absolute-path references, e.g. '/path'\n     * - relative-path references, e.g. 'subpath'\n     *\n     * @return bool\n     *\n     * @see Uri::isNetworkPathReference\n     * @see Uri::isAbsolutePathReference\n     * @see Uri::isRelativePathReference\n     * @see https://tools.ietf.org/html/rfc3986#section-4\n     */\n    public static function isAbsolute(UriInterface $uri)\n    {\n        return '' !== $uri->getScheme();\n    }\n\n    /**\n     * Whether the URI is a network-path reference.\n     *\n     * A relative reference that begins with two slash characters is termed an network-path reference.\n     *\n     * @return bool\n     *\n     * @see https://tools.ietf.org/html/rfc3986#section-4.2\n     */\n    public static function isNetworkPathReference(UriInterface $uri)\n    {\n        return '' === $uri->getScheme() && '' !== $uri->getAuthority();\n    }\n\n    /**\n     * Whether the URI is a absolute-path reference.\n     *\n     * A relative reference that begins with a single slash character is termed an absolute-path reference.\n     *\n     * @return bool\n     *\n     * @see https://tools.ietf.org/html/rfc3986#section-4.2\n     */\n    public static function isAbsolutePathReference(UriInterface $uri)\n    {\n        $path = $uri->getPath();\n\n        return '' === $uri->getScheme()\n            && '' === $uri->getAuthority()\n            && isset($path[0])\n            && '/' === $path[0];\n    }\n\n    /**\n     * Whether the URI is a relative-path reference.\n     *\n     * A relative reference that does not begin with a slash character is termed a relative-path reference.\n     *\n     * @return bool\n     *\n     * @see https://tools.ietf.org/html/rfc3986#section-4.2\n     */\n    public static function isRelativePathReference(UriInterface $uri)\n    {\n        $path = $uri->getPath();\n\n        return '' === $uri->getScheme()\n            && '' === $uri->getAuthority()\n            && (!isset($path[0]) || '/' !== $path[0]);\n    }\n\n    /**\n     * Whether the URI is a same-document reference.\n     *\n     * A same-document reference refers to a URI that is, aside from its fragment\n     * component, identical to the base URI. When no base URI is given, only an empty\n     * URI reference (apart from its fragment) is considered a same-document reference.\n     *\n     * @param UriInterface      $uri  The URI to check\n     * @param UriInterface|null $base An optional base URI to compare against\n     *\n     * @return bool\n     *\n     * @see https://tools.ietf.org/html/rfc3986#section-4.4\n     */\n    public static function isSameDocumentReference(UriInterface $uri, ?UriInterface $base = null)\n    {\n        if (null !== $base) {\n            $uri = UriResolver::resolve($base, $uri);\n\n            return ($uri->getScheme() === $base->getScheme())\n                && ($uri->getAuthority() === $base->getAuthority())\n                && ($uri->getPath() === $base->getPath())\n                && ($uri->getQuery() === $base->getQuery());\n        }\n\n        return '' === $uri->getScheme() && '' === $uri->getAuthority() && '' === $uri->getPath() && '' === $uri->getQuery();\n    }\n\n    /**\n     * Removes dot segments from a path and returns the new path.\n     *\n     * @param string $path\n     *\n     * @return string\n     *\n     * @deprecated since version 1.4. Use UriResolver::removeDotSegments instead.\n     * @see UriResolver::removeDotSegments\n     */\n    public static function removeDotSegments($path)\n    {\n        return UriResolver::removeDotSegments($path);\n    }\n\n    /**\n     * Converts the relative URI into a new URI that is resolved against the base URI.\n     *\n     * @param UriInterface        $base Base URI\n     * @param string|UriInterface $rel  Relative URI\n     *\n     * @return UriInterface\n     *\n     * @deprecated since version 1.4. Use UriResolver::resolve instead.\n     * @see UriResolver::resolve\n     */\n    public static function resolve(UriInterface $base, $rel)\n    {\n        if (!($rel instanceof UriInterface)) {\n            $rel = new self($rel);\n        }\n\n        return UriResolver::resolve($base, $rel);\n    }\n\n    /**\n     * Creates a new URI with a specific query string value removed.\n     *\n     * Any existing query string values that exactly match the provided key are\n     * removed.\n     *\n     * @param uriInterface $uri URI to use as a base\n     * @param string       $key query string key to remove\n     *\n     * @return UriInterface\n     */\n    public static function withoutQueryValue(UriInterface $uri, $key)\n    {\n        $current = $uri->getQuery();\n        if ('' === $current) {\n            return $uri;\n        }\n\n        $decodedKey = rawurldecode($key);\n        $result = array_filter(explode('&', $current), function ($part) use ($decodedKey) {\n            $parts = explode('=', $part);\n\n            return rawurldecode($parts[0]) !== $decodedKey;\n        });\n\n        return $uri->withQuery(implode('&', $result));\n    }\n\n    /**\n     * Creates a new URI with a specific query string value.\n     *\n     * Any existing query string values that exactly match the provided key are\n     * removed and replaced with the given key value pair.\n     *\n     * A value of null will set the query string key without a value, e.g. \"key\"\n     * instead of \"key=value\".\n     *\n     * @param UriInterface $uri   URI to use as a base\n     * @param string       $key   key to set\n     * @param string|null  $value Value to set\n     *\n     * @return UriInterface\n     */\n    public static function withQueryValue(UriInterface $uri, $key, $value)\n    {\n        $current = $uri->getQuery();\n\n        if ('' === $current) {\n            $result = [];\n        } else {\n            $decodedKey = rawurldecode($key);\n            $result = array_filter(explode('&', $current), function ($part) use ($decodedKey) {\n                $parts = explode('=', $part);\n\n                return rawurldecode($parts[0]) !== $decodedKey;\n            });\n        }\n\n        // Query string separators (\"=\", \"&\") within the key or value need to be encoded\n        // (while preventing double-encoding) before setting the query string. All other\n        // chars that need percent-encoding will be encoded by withQuery().\n        $key = strtr($key, self::$replaceQuery);\n\n        if (null !== $value) {\n            $result[] = $key.'='.strtr($value, self::$replaceQuery);\n        } else {\n            $result[] = $key;\n        }\n\n        return $uri->withQuery(implode('&', $result));\n    }\n\n    /**\n     * Creates a URI from a hash of `parse_url` components.\n     *\n     * @return UriInterface\n     *\n     * @see http://php.net/manual/en/function.parse-url.php\n     *\n     * @throws \\InvalidArgumentException if the components do not form a valid URI\n     */\n    public static function fromParts(array $parts)\n    {\n        $uri = new self();\n        $uri->applyParts($parts);\n        $uri->validateState();\n\n        return $uri;\n    }\n\n    public function getScheme(): string\n    {\n        return $this->scheme;\n    }\n\n    public function getAuthority(): string\n    {\n        $authority = $this->host;\n        if ('' !== $this->userInfo) {\n            $authority = $this->userInfo.'@'.$authority;\n        }\n\n        if (null !== $this->port) {\n            $authority .= ':'.$this->port;\n        }\n\n        return $authority;\n    }\n\n    public function getUserInfo(): string\n    {\n        return $this->userInfo;\n    }\n\n    public function getHost(): string\n    {\n        return $this->host;\n    }\n\n    public function getPort(): ?int\n    {\n        return $this->port;\n    }\n\n    public function getPath(): string\n    {\n        return $this->path;\n    }\n\n    public function getQuery(): string\n    {\n        return $this->query;\n    }\n\n    public function getFragment(): string\n    {\n        return $this->fragment;\n    }\n\n    /**\n     * @return Uri\n     */\n    public function withScheme(string $scheme): UriInterface\n    {\n        $scheme = $this->filterScheme($scheme);\n\n        if ($this->scheme === $scheme) {\n            return $this;\n        }\n\n        $new = clone $this;\n        $new->scheme = $scheme;\n        $new->removeDefaultPort();\n        $new->validateState();\n\n        return $new;\n    }\n\n    /**\n     * @return Uri\n     */\n    public function withUserInfo(string $user, ?string $password = null): UriInterface\n    {\n        $info = $user;\n        if ('' != $password) {\n            $info .= ':'.$password;\n        }\n\n        if ($this->userInfo === $info) {\n            return $this;\n        }\n\n        $new = clone $this;\n        $new->userInfo = $info;\n        $new->validateState();\n\n        return $new;\n    }\n\n    /**\n     * @return Uri\n     */\n    public function withHost(string $host): UriInterface\n    {\n        $host = $this->filterHost($host);\n\n        if ($this->host === $host) {\n            return $this;\n        }\n\n        $new = clone $this;\n        $new->host = $host;\n        $new->validateState();\n\n        return $new;\n    }\n\n    /**\n     * @return Uri\n     */\n    public function withPort(?int $port): UriInterface\n    {\n        $port = $this->filterPort($port);\n\n        if ($this->port === $port) {\n            return $this;\n        }\n\n        $new = clone $this;\n        $new->port = $port;\n        $new->removeDefaultPort();\n        $new->validateState();\n\n        return $new;\n    }\n\n    /**\n     * @return Uri\n     */\n    public function withPath(string $path): UriInterface\n    {\n        $path = $this->filterPath($path);\n\n        if ($this->path === $path) {\n            return $this;\n        }\n\n        $new = clone $this;\n        $new->path = $path;\n        $new->validateState();\n\n        return $new;\n    }\n\n    /**\n     * @return Uri\n     */\n    public function withQuery(string $query): UriInterface\n    {\n        $query = $this->filterQueryAndFragment($query);\n\n        if ($this->query === $query) {\n            return $this;\n        }\n\n        $new = clone $this;\n        $new->query = $query;\n\n        return $new;\n    }\n\n    /**\n     * @return Uri\n     */\n    public function withFragment(string $fragment): UriInterface\n    {\n        $fragment = $this->filterQueryAndFragment($fragment);\n\n        if ($this->fragment === $fragment) {\n            return $this;\n        }\n\n        $new = clone $this;\n        $new->fragment = $fragment;\n\n        return $new;\n    }\n\n    /**\n     * Apply parse_url parts to a URI.\n     *\n     * @param array $parts array of parse_url parts to apply\n     */\n    private function applyParts(array $parts)\n    {\n        $this->scheme = isset($parts['scheme'])\n            ? $this->filterScheme($parts['scheme'])\n            : '';\n        $this->userInfo = isset($parts['user']) ? $parts['user'] : '';\n        $this->host = isset($parts['host'])\n            ? $this->filterHost($parts['host'])\n            : '';\n        $this->port = isset($parts['port'])\n            ? $this->filterPort($parts['port'])\n            : null;\n        $this->path = isset($parts['path'])\n            ? $this->filterPath($parts['path'])\n            : '';\n        $this->query = isset($parts['query'])\n            ? $this->filterQueryAndFragment($parts['query'])\n            : '';\n        $this->fragment = isset($parts['fragment'])\n            ? $this->filterQueryAndFragment($parts['fragment'])\n            : '';\n        if (isset($parts['pass'])) {\n            $this->userInfo .= ':'.$parts['pass'];\n        }\n\n        $this->removeDefaultPort();\n    }\n\n    /**\n     * @param string $scheme\n     *\n     * @return string\n     *\n     * @throws \\InvalidArgumentException if the scheme is invalid\n     */\n    private function filterScheme($scheme)\n    {\n        if (!is_string($scheme)) {\n            throw new \\InvalidArgumentException('Scheme must be a string');\n        }\n\n        return strtolower($scheme);\n    }\n\n    /**\n     * @param string $host\n     *\n     * @return string\n     *\n     * @throws \\InvalidArgumentException if the host is invalid\n     */\n    private function filterHost($host)\n    {\n        if (!is_string($host)) {\n            throw new \\InvalidArgumentException('Host must be a string');\n        }\n\n        return strtolower($host);\n    }\n\n    /**\n     * @param int|null $port\n     *\n     * @return int|null\n     *\n     * @throws \\InvalidArgumentException if the port is invalid\n     */\n    private function filterPort($port)\n    {\n        if (null === $port) {\n            return null;\n        }\n\n        $port = (int) $port;\n        if (1 > $port || 0xffff < $port) {\n            throw new \\InvalidArgumentException(sprintf('Invalid port: %d. Must be between 1 and 65535', $port));\n        }\n\n        return $port;\n    }\n\n    private function removeDefaultPort()\n    {\n        if (null !== $this->port && self::isDefaultPort($this)) {\n            $this->port = null;\n        }\n    }\n\n    /**\n     * Filters the path of a URI.\n     *\n     * @param string $path\n     *\n     * @return string\n     *\n     * @throws \\InvalidArgumentException if the path is invalid\n     */\n    private function filterPath($path)\n    {\n        if (!is_string($path)) {\n            throw new \\InvalidArgumentException('Path must be a string');\n        }\n\n        return preg_replace_callback(\n            '/(?:[^'.self::$charUnreserved.self::$charSubDelims.'%:@\\/]++|%(?![A-Fa-f0-9]{2}))/',\n            [$this, 'rawurlencodeMatchZero'],\n            $path\n        );\n    }\n\n    /**\n     * Filters the query string or fragment of a URI.\n     *\n     * @param string $str\n     *\n     * @return string\n     *\n     * @throws \\InvalidArgumentException if the query or fragment is invalid\n     */\n    private function filterQueryAndFragment($str)\n    {\n        if (!is_string($str)) {\n            throw new \\InvalidArgumentException('Query and fragment must be a string');\n        }\n\n        return preg_replace_callback(\n            '/(?:[^'.self::$charUnreserved.self::$charSubDelims.'%:@\\/\\?]++|%(?![A-Fa-f0-9]{2}))/',\n            [$this, 'rawurlencodeMatchZero'],\n            $str\n        );\n    }\n\n    private function rawurlencodeMatchZero(array $match)\n    {\n        return rawurlencode($match[0]);\n    }\n\n    private function validateState()\n    {\n        if ('' === $this->host && ('http' === $this->scheme || 'https' === $this->scheme)) {\n            $this->host = self::HTTP_DEFAULT_HOST;\n        }\n\n        if ('' === $this->getAuthority()) {\n            if (0 === strpos($this->path, '//')) {\n                throw new \\InvalidArgumentException('The path of a URI without an authority must not start with two slashes \"//\"');\n            }\n            $parts = explode('/', $this->path, 2);\n            if ('' === $this->scheme && false !== strpos($parts[0], ':')) {\n                throw new \\InvalidArgumentException('A relative URI must not have a path beginning with a segment containing a colon');\n            }\n        } elseif (isset($this->path[0]) && '/' !== $this->path[0]) {\n            @trigger_error(\n                'The path of a URI with an authority must start with a slash \"/\" or be empty. Automagically fixing the URI '.\n                'by adding a leading slash to the path is deprecated since version 1.4 and will throw an exception instead.',\n                E_USER_DEPRECATED\n            );\n            $this->path = '/'.$this->path;\n            //throw new \\InvalidArgumentException('The path of a URI with an authority must start with a slash \"/\" or be empty');\n        }\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Http/Psr7/UriResolver.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\Psr7;\n\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\UriInterface;\n\n/**\n * Resolves a URI reference in the context of a base URI and the opposite way.\n *\n * @author Tobias Schultze\n *\n * @see https://tools.ietf.org/html/rfc3986#section-5\n *\n * @internal\n */\nfinal class UriResolver\n{\n    /**\n     * Removes dot segments from a path and returns the new path.\n     *\n     * @param string $path\n     *\n     * @return string\n     *\n     * @see http://tools.ietf.org/html/rfc3986#section-5.2.4\n     */\n    public static function removeDotSegments($path)\n    {\n        if ('' === $path || '/' === $path) {\n            return $path;\n        }\n\n        $results = [];\n        $segments = explode('/', $path);\n        $segment = null;\n        foreach ($segments as $segment) {\n            if ('..' === $segment) {\n                array_pop($results);\n            } elseif ('.' !== $segment) {\n                $results[] = $segment;\n            }\n        }\n\n        $newPath = implode('/', $results);\n\n        if ('/' === $path[0] && (!isset($newPath[0]) || '/' !== $newPath[0])) {\n            // Re-add the leading slash if necessary for cases like \"/..\"\n            $newPath = '/'.$newPath;\n        } elseif ('' !== $newPath && ('.' === $segment || '..' === $segment)) {\n            // Add the trailing slash if necessary\n            // If newPath is not empty, then $segment must be set and is the last segment from the foreach\n            $newPath .= '/';\n        }\n\n        return $newPath;\n    }\n\n    /**\n     * Converts the relative URI into a new URI that is resolved against the base URI.\n     *\n     * @param UriInterface $base Base URI\n     * @param UriInterface $rel  Relative URI\n     *\n     * @return UriInterface\n     *\n     * @see http://tools.ietf.org/html/rfc3986#section-5.2\n     */\n    public static function resolve(UriInterface $base, UriInterface $rel)\n    {\n        if ('' === (string) $rel) {\n            // we can simply return the same base URI instance for this same-document reference\n            return $base;\n        }\n\n        if ('' != $rel->getScheme()) {\n            return $rel->withPath(self::removeDotSegments($rel->getPath()));\n        }\n\n        if ('' != $rel->getAuthority()) {\n            $targetAuthority = $rel->getAuthority();\n            $targetPath = self::removeDotSegments($rel->getPath());\n            $targetQuery = $rel->getQuery();\n        } else {\n            $targetAuthority = $base->getAuthority();\n            if ('' === $rel->getPath()) {\n                $targetPath = $base->getPath();\n                $targetQuery = '' != $rel->getQuery() ? $rel->getQuery() : $base->getQuery();\n            } else {\n                $path = $rel->getPath();\n                if ('/' === $path[0]) {\n                    $targetPath = $rel->getPath();\n                } else {\n                    if ('' != $targetAuthority && '' === $base->getPath()) {\n                        $targetPath = '/'.$rel->getPath();\n                    } else {\n                        $lastSlashPos = strrpos($base->getPath(), '/');\n                        if (false === $lastSlashPos) {\n                            $targetPath = $rel->getPath();\n                        } else {\n                            $targetPath = substr($base->getPath(), 0, $lastSlashPos + 1).$rel->getPath();\n                        }\n                    }\n                }\n                $targetPath = self::removeDotSegments($targetPath);\n                $targetQuery = $rel->getQuery();\n            }\n        }\n\n        return new Uri(Uri::composeComponents(\n            $base->getScheme(),\n            $targetAuthority,\n            $targetPath,\n            $targetQuery,\n            $rel->getFragment()\n        ));\n    }\n\n    /**\n     * Returns the target URI as a relative reference from the base URI.\n     *\n     * This method is the counterpart to resolve():\n     *\n     *    (string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target))\n     *\n     * One use-case is to use the current request URI as base URI and then generate relative links in your documents\n     * to reduce the document size or offer self-contained downloadable document archives.\n     *\n     *    $base = new Uri('http://example.com/a/b/');\n     *    echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c'));  // prints 'c'.\n     *    echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y'));  // prints '../x/y'.\n     *    echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'.\n     *    echo UriResolver::relativize($base, new Uri('http://example.org/a/b/'));   // prints '//example.org/a/b/'.\n     *\n     * This method also accepts a target that is already relative and will try to relativize it further. Only a\n     * relative-path reference will be returned as-is.\n     *\n     *    echo UriResolver::relativize($base, new Uri('/a/b/c'));  // prints 'c' as well\n     *\n     * @param UriInterface $base   Base URI\n     * @param UriInterface $target Target URI\n     *\n     * @return UriInterface The relative URI reference\n     */\n    public static function relativize(UriInterface $base, UriInterface $target)\n    {\n        if ('' !== $target->getScheme() &&\n            ($base->getScheme() !== $target->getScheme() || '' === $target->getAuthority() && '' !== $base->getAuthority())\n        ) {\n            return $target;\n        }\n\n        if (Uri::isRelativePathReference($target)) {\n            // As the target is already highly relative we return it as-is. It would be possible to resolve\n            // the target with `$target = self::resolve($base, $target);` and then try make it more relative\n            // by removing a duplicate query. But let's not do that automatically.\n            return $target;\n        }\n\n        if ('' !== $target->getAuthority() && $base->getAuthority() !== $target->getAuthority()) {\n            return $target->withScheme('');\n        }\n\n        // We must remove the path before removing the authority because if the path starts with two slashes, the URI\n        // would turn invalid. And we also cannot set a relative path before removing the authority, as that is also\n        // invalid.\n        $emptyPathUri = $target->withScheme('')->withPath('')->withUserInfo('')->withPort(null)->withHost('');\n\n        if ($base->getPath() !== $target->getPath()) {\n            return $emptyPathUri->withPath(self::getRelativePath($base, $target));\n        }\n\n        if ($base->getQuery() === $target->getQuery()) {\n            // Only the target fragment is left. And it must be returned even if base and target fragment are the same.\n            return $emptyPathUri->withQuery('');\n        }\n\n        // If the base URI has a query but the target has none, we cannot return an empty path reference as it would\n        // inherit the base query component when resolving.\n        if ('' === $target->getQuery()) {\n            $segments = explode('/', $target->getPath());\n            $lastSegment = end($segments);\n\n            return $emptyPathUri->withPath('' === $lastSegment ? './' : $lastSegment);\n        }\n\n        return $emptyPathUri;\n    }\n\n    private static function getRelativePath(UriInterface $base, UriInterface $target)\n    {\n        $sourceSegments = explode('/', $base->getPath());\n        $targetSegments = explode('/', $target->getPath());\n        array_pop($sourceSegments);\n        $targetLastSegment = array_pop($targetSegments);\n        foreach ($sourceSegments as $i => $segment) {\n            if (isset($targetSegments[$i]) && $segment === $targetSegments[$i]) {\n                unset($sourceSegments[$i], $targetSegments[$i]);\n            } else {\n                break;\n            }\n        }\n        $targetSegments[] = $targetLastSegment;\n        $relativePath = str_repeat('../', count($sourceSegments)).implode('/', $targetSegments);\n\n        // A reference to am empty last segment or an empty first sub-segment must be prefixed with \"./\".\n        // This also applies to a segment with a colon character (e.g., \"file:colon\") that cannot be used\n        // as the first segment of a relative-path reference, as it would be mistaken for a scheme name.\n        $pathParts = explode('/', $relativePath, 2);\n        if ('' === $relativePath || false !== strpos($pathParts[0], ':')) {\n            $relativePath = \"./$relativePath\";\n        } elseif ('/' === $relativePath[0]) {\n            if ('' != $base->getAuthority() && '' === $base->getPath()) {\n                // In this case an extra slash is added by resolve() automatically. So we must not add one here.\n                $relativePath = \".$relativePath\";\n            } else {\n                $relativePath = \"./$relativePath\";\n            }\n        }\n\n        return $relativePath;\n    }\n\n    private function __construct()\n    {\n        // cannot be instantiated\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Http/Psr7/functions.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\Psr7;\n\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\StreamInterface;\n\n/**\n * @internal\n */\nfunction stream_for($resource = '', array $options = [])\n{\n    if (is_scalar($resource)) {\n        $stream = fopen('php://temp', 'r+');\n        if ('' !== $resource) {\n            fwrite($stream, $resource);\n            fseek($stream, 0);\n        }\n\n        return new Stream($stream, $options);\n    }\n    switch (gettype($resource)) {\n        case 'resource':\n            return new Stream($resource, $options);\n        case 'object':\n            if ($resource instanceof StreamInterface) {\n                return $resource;\n            } elseif ($resource instanceof \\Iterator) {\n                return new PumpStream(function () use ($resource) {\n                    if (!$resource->valid()) {\n                        return false;\n                    }\n                    $result = $resource->current();\n                    $resource->next();\n\n                    return $result;\n                }, $options);\n            } elseif (method_exists($resource, '__toString')) {\n                return stream_for((string) $resource, $options);\n            }\n\n            break;\n        case 'NULL':\n            return new Stream(fopen('php://temp', 'r+'), $options);\n    }\n    if (is_callable($resource)) {\n        return new PumpStream($resource, $options);\n    }\n\n    throw new \\InvalidArgumentException('Invalid resource type: '.gettype($resource));\n}\n\n/**\n * @internal\n */\nfunction copy_to_string(StreamInterface $stream, $maxLen = -1)\n{\n    $buffer = '';\n    if (-1 === $maxLen) {\n        while (!$stream->eof()) {\n            $buf = $stream->read(1048576);\n            // Using a loose equality here to match on '' and false.\n            if (null == $buf) {\n                break;\n            }\n            $buffer .= $buf;\n        }\n\n        return $buffer;\n    }\n    $len = 0;\n    while (!$stream->eof() && $len < $maxLen) {\n        $buf = $stream->read($maxLen - $len);\n        // Using a loose equality here to match on '' and false.\n        if (null == $buf) {\n            break;\n        }\n        $buffer .= $buf;\n        $len = strlen($buffer);\n    }\n\n    return $buffer;\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Insights/UserInsightsClient.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Insights;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\InsightsClient;\n\nfinal class UserInsightsClient\n{\n    /**\n     * @var \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\InsightsClient\n     */\n    private $client;\n\n    private $userToken;\n\n    public function __construct(InsightsClient $client, $userToken)\n    {\n        $this->client = $client;\n        $this->userToken = $userToken;\n    }\n\n    public function clickedFilters($eventName, $indexName, $filters, $requestOptions = [])\n    {\n        return $this->clicked(['filters' => $filters], $eventName, $indexName, $requestOptions);\n    }\n\n    public function clickedObjectIDs($eventName, $indexName, $objectIDs, $requestOptions = [])\n    {\n        return $this->clicked(['objectIDs' => $objectIDs], $eventName, $indexName, $requestOptions);\n    }\n\n    public function clickedObjectIDsAfterSearch($eventName, $indexName, $objectIDs, $positions, $queryID, $requestOptions = [])\n    {\n        $event = [\n            'objectIDs' => $objectIDs,\n            'positions' => $positions,\n            'queryID' => $queryID,\n        ];\n\n        return $this->clicked($event, $eventName, $indexName, $requestOptions);\n    }\n\n    private function clicked($event, $eventName, $indexName, $requestOptions)\n    {\n        $event = array_merge($event, [\n            'eventType' => 'click',\n            'eventName' => $eventName,\n            'index' => $indexName,\n        ]);\n\n        return $this->sendEvent($event, $requestOptions);\n    }\n\n    public function convertedFilters($eventName, $indexName, $filters, $requestOptions = [])\n    {\n        return $this->converted(['filters' => $filters], $eventName, $indexName, $requestOptions);\n    }\n\n    public function convertedObjectIDs($eventName, $indexName, $objectIDs, $requestOptions = [])\n    {\n        return $this->converted(['objectIDs' => $objectIDs], $eventName, $indexName, $requestOptions);\n    }\n\n    public function convertedObjectIDsAfterSearch($eventName, $indexName, $objectIDs, $queryID, $requestOptions = [])\n    {\n        $event = [\n            'objectIDs' => $objectIDs,\n            'queryID' => $queryID,\n        ];\n\n        return $this->converted($event, $eventName, $indexName, $requestOptions);\n    }\n\n    private function converted($event, $eventName, $indexName, $requestOptions)\n    {\n        $event = array_merge($event, [\n            'eventType' => 'conversion',\n            'eventName' => $eventName,\n            'index' => $indexName,\n        ]);\n\n        return $this->sendEvent($event, $requestOptions);\n    }\n\n    public function viewedFilters($eventName, $indexName, $filters, $requestOptions = [])\n    {\n        $event = [\n            'filters' => $filters,\n        ];\n\n        return $this->viewed($event, $eventName, $indexName, $requestOptions);\n    }\n\n    public function viewedObjectIDs($eventName, $indexName, $objectIDs, $requestOptions = [])\n    {\n        $event = [\n            'objectIDs' => $objectIDs,\n        ];\n\n        return $this->viewed($event, $eventName, $indexName, $requestOptions);\n    }\n\n    private function viewed($event, $eventName, $indexName, $requestOptions)\n    {\n        $event = array_merge($event, [\n            'eventType' => 'view',\n            'eventName' => $eventName,\n            'index' => $indexName,\n        ]);\n\n        return $this->sendEvent($event, $requestOptions);\n    }\n\n    private function sendEvent($event, $requestOptions = [])\n    {\n        return $this->client->sendEvent($this->reformatEvent($event), $requestOptions);\n    }\n\n    private function reformatEvent($e)\n    {\n        if (isset($e['objectIDs']) && !is_array($e['objectIDs'])) {\n            $e['objectIDs'] = [$e['objectIDs']];\n        }\n\n        if (isset($e['filters']) && !is_array($e['filters'])) {\n            $e['filters'] = [$e['filters']];\n        }\n\n        if (isset($e['positions']) && !is_array($e['positions'])) {\n            $e['positions'] = [$e['positions']];\n        }\n\n        $e['userToken'] = $this->userToken;\n\n        return $e;\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/InsightsClient.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\InsightsConfig;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Insights\\UserInsightsClient;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ApiWrapper;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ApiWrapperInterface;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ClusterHosts;\n\nfinal class InsightsClient\n{\n    /**\n     * @var ApiWrapperInterface\n     */\n    private $api;\n\n    /**\n     * @var \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\InsightsConfig\n     */\n    private $config;\n\n    public function __construct(ApiWrapperInterface $api, InsightsConfig $config)\n    {\n        $this->api = $api;\n        $this->config = $config;\n    }\n\n    public static function create($appId = null, $apiKey = null, $region = null)\n    {\n        $config = InsightsConfig::create($appId, $apiKey, $region);\n\n        return static::createWithConfig($config);\n    }\n\n    public static function createWithConfig(InsightsConfig $config)\n    {\n        $config = clone $config;\n\n        if ($hosts = $config->getHosts()) {\n            // If a list of hosts was passed, we ignore the cache\n            $clusterHosts = ClusterHosts::create($hosts);\n        } else {\n            $clusterHosts = ClusterHosts::createForInsights($config->getRegion());\n        }\n\n        $apiWrapper = new ApiWrapper(\n            Algolia::getHttpClient(),\n            $config,\n            $clusterHosts\n        );\n\n        return new static($apiWrapper, $config);\n    }\n\n    public function user($userToken)\n    {\n        return new UserInsightsClient($this, $userToken);\n    }\n\n    public function sendEvent($event, $requestOptions = [])\n    {\n        return $this->sendEvents([$event], $requestOptions);\n    }\n\n    public function sendEvents($events, $requestOptions = [])\n    {\n        $payload = ['events' => $events];\n\n        return $this->api->write('POST', api_path('/1/events'), $payload, $requestOptions);\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Iterators/AbstractAlgoliaIterator.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Iterators;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ApiWrapper;\n\nabstract class AbstractAlgoliaIterator implements \\Iterator\n{\n    protected $indexName;\n\n    /**\n     * @var ApiWrapper\n     */\n    protected $api;\n\n    /**\n     * @var array RequestOptions passed when getting new batch from Algolia\n     */\n    protected $requestOptions;\n\n    /**\n     * @var int\n     */\n    protected $key = 0;\n\n    /**\n     * @var int\n     */\n    protected $batchKey = 0;\n\n    /**\n     * @var int\n     */\n    protected $page = 0;\n\n    /**\n     * @var array response from the last Algolia API call,\n     *            this contains the results for the current page\n     */\n    protected $response;\n\n    /**\n     * Call Algolia' API to get new result batch.\n     */\n    abstract protected function fetchNextPage();\n\n    /**\n     * Sometimes the Iterator is using search internally, this method\n     * is used to clean the results, like remove the highlight.\n     *\n     * @return array formatted synonym array\n     */\n    abstract protected function formatHit(array $hit);\n\n    public function __construct($indexName, ApiWrapper $api, $requestOptions = [])\n    {\n        $this->indexName = $indexName;\n        $this->api = $api;\n        $this->requestOptions = $requestOptions + [\n            'hitsPerPage' => 1000,\n        ];\n\n        $this->fetchNextPage();\n    }\n\n    /**\n     * Return the current element.\n     *\n     * @return array\n     */\n    #[\\ReturnTypeWillChange]\n    public function current()\n    {\n        $hit = $this->response['hits'][$this->batchKey];\n\n        return $this->formatHit($hit);\n    }\n\n    /**\n     * Move forward to next element.\n     */\n    #[\\ReturnTypeWillChange]\n    public function next()\n    {\n        $this->key++;\n        $this->batchKey++;\n        if ($this->valid()) {\n            return;\n        }\n\n        $this->fetchNextPage();\n    }\n\n    /**\n     * Return the key of the current element.\n     *\n     * @return int\n     */\n    #[\\ReturnTypeWillChange]\n    public function key()\n    {\n        return $this->key;\n    }\n\n    /**\n     * Checks if current position is valid. If the current position\n     * is not valid, we call Algolia' API to load more results\n     * until it's the last page.\n     *\n     * @return bool the return value will be casted to boolean and then evaluated.\n     *              Returns true on success or false on failure\n     */\n    #[\\ReturnTypeWillChange]\n    public function valid()\n    {\n        return isset($this->response['hits'][$this->batchKey]);\n    }\n\n    /**\n     * Rewind the Iterator to the first element.\n     */\n    #[\\ReturnTypeWillChange]\n    public function rewind()\n    {\n        if (0 !== $this->key) {\n            $this->key = 0;\n            $this->batchKey = 0;\n            $this->page = 0;\n            $this->response = null;\n            $this->fetchNextPage();\n        }\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Iterators/ObjectIterator.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Iterators;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Support\\Helpers;\n\nfinal class ObjectIterator extends AbstractAlgoliaIterator\n{\n    public function getCursor()\n    {\n        return isset($this->response['cursor']) ? $this->response['cursor'] : null;\n    }\n\n    /**\n     * Exporting objects (records) doesn't use the search function but the\n     * browse method, no client-side formatting is required.\n     *\n     * @return array the exact same $hit\n     */\n    protected function formatHit(array $hit)\n    {\n        return $hit;\n    }\n\n    protected function fetchNextPage()\n    {\n        if (is_array($this->response) && !isset($this->response['cursor'])) {\n            return;\n        }\n\n        $cursor = [];\n        if (isset($this->response['cursor'])) {\n            $cursor['cursor'] = $this->response['cursor'];\n        }\n\n        $this->response = $this->api->read(\n            'POST',\n            Helpers::apiPath('/1/indexes/%s/browse', $this->indexName),\n            array_merge(\n                $this->requestOptions,\n                $cursor\n            )\n        );\n\n        $this->batchKey = 0;\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Iterators/RuleIterator.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Iterators;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Support\\Helpers;\n\nfinal class RuleIterator extends AbstractAlgoliaIterator\n{\n    protected function formatHit(array $hit)\n    {\n        unset($hit['_highlightResult']);\n\n        return $hit;\n    }\n\n    protected function fetchNextPage()\n    {\n        if (is_array($this->response) && $this->key >= $this->response['nbHits']) {\n            return;\n        }\n\n        $this->response = $this->api->read(\n            'POST',\n            Helpers::apiPath('/1/indexes/%s/rules/search', $this->indexName),\n            array_merge(\n                $this->requestOptions,\n                ['page' => $this->page]\n            )\n        );\n\n        $this->batchKey = 0;\n        $this->page++;\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Iterators/SynonymIterator.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Iterators;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Support\\Helpers;\n\nfinal class SynonymIterator extends AbstractAlgoliaIterator\n{\n    protected function formatHit(array $hit)\n    {\n        unset($hit['_highlightResult']);\n\n        return $hit;\n    }\n\n    protected function fetchNextPage()\n    {\n        if (is_array($this->response) && $this->key >= $this->response['nbHits']) {\n            return;\n        }\n\n        $this->response = $this->api->read(\n            'POST',\n            Helpers::apiPath('/1/indexes/%s/synonyms/search', $this->indexName),\n            array_merge(\n                $this->requestOptions,\n                ['page' => $this->page]\n            )\n        );\n\n        $this->batchKey = 0;\n        $this->page++;\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Log/DebugLogger.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Log;\n\nuse WebDevStudios\\WPSWA\\Psr\\Log\\AbstractLogger;\n\n/**\n * This logger is only meant to be used in development, in order\n * to easily debug your Algolia calls. Don't use it on production!\n *\n * @internal\n */\nfinal class DebugLogger extends AbstractLogger\n{\n    /**\n     * Whether the logger is enabled or not.\n     *\n     * @var bool\n     */\n    private static $isEnabled = false;\n\n    /**\n     * Disables the logger.\n     */\n    public static function disable()\n    {\n        self::$isEnabled = false;\n    }\n\n    /**\n     * Enables the logger.\n     */\n    public static function enable()\n    {\n        self::$isEnabled = true;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function log($level, $message, array $context = []): void\n    {\n        if (self::$isEnabled) {\n            $logMessage = [\n                'level' => $level,\n                'message' => $message,\n                'context' => $context,\n            ];\n\n            if (function_exists('dump')) {\n                dump($logMessage);\n            } else {\n                var_dump($logMessage);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/PersonalizationClient.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\PersonalizationConfig;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions\\RequestOptions;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ApiWrapper;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ApiWrapperInterface;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ClusterHosts;\n\nfinal class PersonalizationClient\n{\n    /**\n     * @var ApiWrapperInterface\n     */\n    private $api;\n\n    /**\n     * @var \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\PersonalizationConfig\n     */\n    private $config;\n\n    /**\n     * RecommendationClient constructor.\n     */\n    public function __construct(ApiWrapperInterface $api, PersonalizationConfig $config)\n    {\n        $this->api = $api;\n        $this->config = $config;\n    }\n\n    /**\n     * @param string|null $appId\n     * @param string|null $apiKey\n     * @param string|null $region\n     *\n     * @return PersonalizationClient\n     */\n    public static function create($appId = null, $apiKey = null, $region = null)\n    {\n        $config = PersonalizationConfig::create($appId, $apiKey, $region);\n\n        return static::createWithConfig($config);\n    }\n\n    /**\n     * @return PersonalizationClient\n     */\n    public static function createWithConfig(PersonalizationConfig $config)\n    {\n        $config = clone $config;\n\n        if ($hosts = $config->getHosts()) {\n            // If a list of hosts was passed, we ignore the cache\n            $clusterHosts = ClusterHosts::create($hosts);\n        } else {\n            $clusterHosts = ClusterHosts::createForRecommendation($config->getRegion());\n        }\n\n        $apiWrapper = new ApiWrapper(\n            Algolia::getHttpClient(),\n            $config,\n            $clusterHosts\n        );\n\n        return new self($apiWrapper, $config);\n    }\n\n    /**\n     * @param array<string, int|string|array>|RequestOptions $requestOptions\n     *\n     * @return array<string, int|array>\n     */\n    public function getPersonalizationStrategy($requestOptions = [])\n    {\n        return $this->api->read('GET', api_path('/1/strategies/personalization'), $requestOptions);\n    }\n\n    /**\n     * @param array<string, int|array>                       $strategy\n     * @param array<string, int|string|array>|RequestOptions $requestOptions\n     *\n     * @return array<string, int|string>\n     */\n    public function setPersonalizationStrategy($strategy, $requestOptions = [])\n    {\n        return $this->api->write('POST', api_path('/1/strategies/personalization'), $strategy, $requestOptions);\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/PlacesClient.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\PlacesConfig;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions\\RequestOptions;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ApiWrapper;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ApiWrapperInterface;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ClusterHosts;\n\nfinal class PlacesClient\n{\n    /**\n     * @var ApiWrapperInterface\n     */\n    private $api;\n\n    /**\n     * @var PlacesConfig\n     */\n    private $config;\n\n    public function __construct(ApiWrapperInterface $api, PlacesConfig $config)\n    {\n        $this->api = $api;\n        $this->config = $config;\n    }\n\n    public static function create($appId = null, $apiKey = null)\n    {\n        $config = PlacesConfig::create($appId, $apiKey);\n\n        return static::createWithConfig($config);\n    }\n\n    public static function createWithConfig(PlacesConfig $config)\n    {\n        $config = clone $config;\n\n        $cacheKey = sprintf('%s-clusterHosts-%s', __CLASS__, $config->getAppId());\n\n        if ($hosts = $config->getHosts()) {\n            // If a list of hosts was passed, we ignore the cache\n            $clusterHosts = ClusterHosts::create($hosts);\n        } elseif (false === ($clusterHosts = ClusterHosts::createFromCache($cacheKey))) {\n            // We'll try to restore the ClusterHost from cache, if we cannot\n            // we create a new instance and set the cache key\n            $clusterHosts = ClusterHosts::createForPlaces()\n                ->setCacheKey($cacheKey);\n        }\n\n        $apiWrapper = new ApiWrapper(\n            Algolia::getHttpClient(),\n            $config,\n            $clusterHosts\n        );\n\n        return new static($apiWrapper, $config);\n    }\n\n    public function search($query, $requestOptions = [])\n    {\n        $query = (string) $query;\n\n        if (is_array($requestOptions)) {\n            $requestOptions['query'] = $query;\n        } elseif ($requestOptions instanceof RequestOptions) {\n            $requestOptions->addBodyParameter('query', $query);\n        }\n\n        return $this->api->read('POST', api_path('/1/places/query'), $requestOptions);\n    }\n\n    public function getObject($objectID, $requestOptions = [])\n    {\n        return $this->api->read('GET', api_path('/1/places/%s', $objectID), $requestOptions);\n    }\n\n    public function custom($method, $path, $requestOptions = [], $hosts = null)\n    {\n        return $this->api->send($method, $path, $requestOptions, $hosts);\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/RecommendClient.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\RecommendConfig;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\AlgoliaException;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions\\RequestOptions;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ApiWrapper;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ApiWrapperInterface;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ClusterHosts;\n\nfinal class RecommendClient\n{\n    const RELATED_PRODUCTS = 'related-products';\n    const BOUGHT_TOGETHER = 'bought-together';\n\n    /**\n     * @var ApiWrapperInterface\n     */\n    private $api;\n\n    /**\n     * @var RecommendConfig\n     */\n    private $config;\n\n    public function __construct(ApiWrapperInterface $api, RecommendConfig $config)\n    {\n        $this->api = $api;\n        $this->config = $config;\n    }\n\n    public static function create($appId = null, $apiKey = null, $region = null)\n    {\n        $config = RecommendConfig::create($appId, $apiKey, $region);\n\n        return static::createWithConfig($config);\n    }\n\n    public static function createWithConfig(RecommendConfig $config)\n    {\n        $config = clone $config;\n\n        if ($hosts = $config->getHosts()) {\n            // If a list of hosts was passed, we ignore the cache\n            $clusterHosts = ClusterHosts::create($hosts);\n        } else {\n            $clusterHosts = ClusterHosts::createFromAppId($config->getAppId());\n        }\n\n        $apiWrapper = new ApiWrapper(\n            Algolia::getHttpClient(),\n            $config,\n            $clusterHosts\n        );\n\n        return new static($apiWrapper, $config);\n    }\n\n    /**\n     * Get recommendations.\n     *\n     * @param array|RequestOptions $requestOptions\n     *\n     * @return array\n     */\n    public function getRecommendations(array $queries, $requestOptions = [])\n    {\n        foreach ($queries as $key => $query) {\n            // The `threshold` param is required by the endpoint to make it easier to provide a default value later,\n            // so we default it in the client so that users don't have to provide a value.\n            if (!isset($query['threshold'])) {\n                $queries[$key]['threshold'] = 0;\n            }\n            // Unset fallbackParameters if the model is 'bought-together'\n            if (self::BOUGHT_TOGETHER === $query['model'] && isset($query['fallbackParameters'])) {\n                unset($queries[$key]['fallbackParameters']);\n            }\n        }\n\n        $requests = [\n            'requests' => $queries,\n        ];\n\n        return $this->api->write(\n            'POST',\n            api_path('/1/indexes/*/recommendations'),\n            $requests,\n            $requestOptions\n        );\n    }\n\n    /**\n     * Get Related products.\n     *\n     * @param array|RequestOptions $requestOptions\n     *\n     * @return array\n     *\n     * @throws AlgoliaException\n     */\n    public function getRelatedProducts(array $queries, $requestOptions = [])\n    {\n        $queries = $this->setModel($queries, self::RELATED_PRODUCTS);\n\n        return $this->getRecommendations($queries, $requestOptions);\n    }\n\n    /**\n     * Get product frequently bought together.\n     *\n     * @param array|RequestOptions $requestOptions\n     *\n     * @return array\n     *\n     * @throws AlgoliaException\n     */\n    public function getFrequentlyBoughtTogether(array $queries, $requestOptions = [])\n    {\n        $queries = $this->setModel($queries, self::BOUGHT_TOGETHER);\n\n        return $this->getRecommendations($queries, $requestOptions);\n    }\n\n    /**\n     * Add the model for related products and product frequently bought together.\n     *\n     * @param string $model can be either 'related-products' or 'bought-together'\n     *\n     * @return array\n     *\n     * @throws AlgoliaException\n     */\n    private function setModel(array $queries, $model)\n    {\n        foreach ($queries as $key => $query) {\n            $queries[$key]['model'] = $model;\n        }\n\n        return $queries;\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/RecommendationClient.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\RecommendationConfig;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions\\RequestOptions;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ApiWrapper;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ApiWrapperInterface;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ClusterHosts;\n\n/**\n * @deprecated Please use WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\PersonalizationClient instead\n */\nfinal class RecommendationClient\n{\n    /**\n     * @var ApiWrapperInterface\n     */\n    private $api;\n\n    /**\n     * @var \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\RecommendationConfig\n     */\n    private $config;\n\n    /**\n     * RecommendationClient constructor.\n     */\n    public function __construct(ApiWrapperInterface $api, RecommendationConfig $config)\n    {\n        $this->api = $api;\n        $this->config = $config;\n    }\n\n    /**\n     * @param string|null $appId\n     * @param string|null $apiKey\n     * @param string|null $region\n     *\n     * @return RecommendationClient\n     */\n    public static function create($appId = null, $apiKey = null, $region = null)\n    {\n        $config = RecommendationConfig::create($appId, $apiKey, $region);\n\n        return static::createWithConfig($config);\n    }\n\n    /**\n     * @return RecommendationClient\n     */\n    public static function createWithConfig(RecommendationConfig $config)\n    {\n        $config = clone $config;\n\n        if ($hosts = $config->getHosts()) {\n            // If a list of hosts was passed, we ignore the cache\n            $clusterHosts = ClusterHosts::create($hosts);\n        } else {\n            $clusterHosts = ClusterHosts::createForRecommendation($config->getRegion());\n        }\n\n        $apiWrapper = new ApiWrapper(\n            Algolia::getHttpClient(),\n            $config,\n            $clusterHosts\n        );\n\n        return new self($apiWrapper, $config);\n    }\n\n    /**\n     * @param array<string, int|string|array>|RequestOptions $requestOptions\n     *\n     * @return array<string, int|array>\n     */\n    public function getPersonalizationStrategy($requestOptions = [])\n    {\n        return $this->api->read('GET', api_path('/1/strategies/personalization'), $requestOptions);\n    }\n\n    /**\n     * @param array<string, int|array>                       $strategy\n     * @param array<string, int|string|array>|RequestOptions $requestOptions\n     *\n     * @return array<string, int|string>\n     */\n    public function setPersonalizationStrategy($strategy, $requestOptions = [])\n    {\n        return $this->api->write('POST', api_path('/1/strategies/personalization'), $strategy, $requestOptions);\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/RequestOptions/RequestOptions.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Support\\Helpers;\n\nfinal class RequestOptions\n{\n    private $headers = [];\n\n    private $query = [];\n\n    private $body = [];\n\n    private $readTimeout;\n\n    private $writeTimeout;\n\n    private $connectTimeout;\n\n    public function __construct(array $options = [])\n    {\n        foreach (['headers', 'query', 'body'] as $name) {\n            if (isset($options[$name]) && !empty($options[$name])) {\n                $this->{$name} = $options[$name];\n            }\n        }\n\n        $this->readTimeout = $options['readTimeout'];\n        $this->writeTimeout = $options['writeTimeout'];\n        $this->connectTimeout = $options['connectTimeout'];\n    }\n\n    /**\n     * Get the HTTP headers to add to the request.\n     *\n     * @return array List of name/value pairs\n     */\n    public function getHeaders()\n    {\n        return $this->headers;\n    }\n\n    /**\n     * Add a header to the list. If a value already exists for that name, it will be overwritten.\n     *\n     * @param string $name  Name of the header\n     * @param string $value Value of the header\n     *\n     * @return $this\n     */\n    public function addHeader($name, $value)\n    {\n        $this->headers[$name] = $value;\n\n        return $this;\n    }\n\n    /**\n     * @param $headers\n     *\n     * @return $this\n     */\n    public function addHeaders($headers)\n    {\n        $this->headers = array_merge($this->headers, $headers);\n\n        return $this;\n    }\n\n    /**\n     * Add a new header to the list if there is no value already set.\n     *\n     * @param string $name  Name of the header\n     * @param string $value Value of the header\n     *\n     * @return $this\n     */\n    public function addDefaultHeader($name, $value)\n    {\n        if (!isset($this->headers[$name])) {\n            $this->headers[$name] = $value;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Add the headers passed if the value isn't already set.\n     *\n     * @param array $headers List of header name/value pairs\n     *\n     * @return $this\n     */\n    public function addDefaultHeaders($headers)\n    {\n        foreach ($headers as $name => $value) {\n            $this->addDefaultHeader($name, $value);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Replace all existing headers with the given name/value pairs.\n     *\n     * @param array $headers List of header name/value pairs\n     *\n     * @return $this\n     */\n    public function setHeaders($headers)\n    {\n        $this->headers = $headers;\n\n        return $this;\n    }\n\n    /**\n     * @return array List of name/value query parameters\n     */\n    public function getQueryParameters()\n    {\n        return $this->query;\n    }\n\n    /**\n     * @return string URL-encoded query string\n     */\n    public function getBuiltQueryParameters()\n    {\n        return Helpers::buildQuery($this->query);\n    }\n\n    /**\n     * Add a query parameter. If a value already exists for that name, it will be overwritten.\n     *\n     * @param string $name\n     * @param string $value\n     *\n     * @return $this\n     */\n    public function addQueryParameter($name, $value)\n    {\n        $this->query[$name] = $value;\n\n        return $this;\n    }\n\n    /**\n     * Add a list of query parameters name/value pairs.\n     * If a value already exists for a name, it will be overwritten.\n     *\n     * @param $parameters\n     *\n     * @return $this\n     */\n    public function addQueryParameters($parameters)\n    {\n        $this->query = array_merge($this->query, $parameters);\n\n        return $this;\n    }\n\n    /**\n     * Add a query parameter if it isn't already set.\n     *\n     * @param string $name  Name of the query parameter\n     * @param string $value Value of the query parameter\n     *\n     * @return $this\n     */\n    public function addDefaultQueryParameter($name, $value)\n    {\n        if (!isset($this->query[$name])) {\n            $this->query[$name] = $value;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Add parameters if they aren't already set.\n     *\n     * @param array $queryParameters Query parameters name/value pairs\n     *\n     * @return $this\n     */\n    public function addDefaultQueryParameters($queryParameters)\n    {\n        foreach ($queryParameters as $name => $value) {\n            $this->addDefaultQueryParameter($name, $value);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Replace all existing query parameters with the given name/value pairs.\n     *\n     * @param array $queryParameters\n     *\n     * @return $this\n     */\n    public function setQueryParameters($queryParameters)\n    {\n        $this->query = $queryParameters;\n\n        return $this;\n    }\n\n    /**\n     * Get HTTP body to add.\n     *\n     * @return array\n     */\n    public function getBody()\n    {\n        return $this->body;\n    }\n\n    /**\n     * Add a body parameter. If a value already exists for that name, it will be overwritten.\n     *\n     * @param string $name\n     * @param mixed  $value\n     *\n     * @return $this\n     */\n    public function addBodyParameter($name, $value)\n    {\n        $this->body[$name] = $value;\n\n        return $this;\n    }\n\n    /**\n     * Add parameters if they aren't already set.\n     *\n     * @param array $parameters Body parameters name/value pairs\n     *\n     * @return $this\n     */\n    public function addBodyParameters($parameters)\n    {\n        $this->body = array_merge($this->body, $parameters);\n\n        return $this;\n    }\n\n    /**\n     * Add a body parameter if it isn't already set.\n     *\n     * @param string $name  Name of the query parameter\n     * @param string $value Value of the query parameter\n     *\n     * @return $this\n     */\n    public function addDefaultBodyParameter($name, $value)\n    {\n        if (!isset($this->body[$name])) {\n            $this->body[$name] = $value;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Add parameters if they aren't already set.\n     *\n     * @param array $parameters Body parameters name/value pairs\n     *\n     * @return $this\n     */\n    public function addDefaultBodyParameters($parameters)\n    {\n        foreach ($parameters as $name => $value) {\n            $this->addDefaultBodyParameter($name, $value);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Replace all existing body parameters with the given name/value pairs.\n     *\n     * @param $body\n     *\n     * @return $this\n     */\n    public function setBody($body)\n    {\n        $this->body = $body;\n\n        return $this;\n    }\n\n    /**\n     * Get timeout for read operations.\n     *\n     * @return int Timeout in seconds\n     */\n    public function getReadTimeout()\n    {\n        return $this->readTimeout;\n    }\n\n    /**\n     * Set timeout for read operations.\n     *\n     * @param int $readTimeout Timeout in seconds\n     *\n     * @return $this\n     */\n    public function setReadTimeout($readTimeout)\n    {\n        $this->readTimeout = $readTimeout;\n\n        return $this;\n    }\n\n    /**\n     * Get timeout for write operations.\n     *\n     * @return int Timeout in seconds\n     */\n    public function getWriteTimeout()\n    {\n        return $this->writeTimeout;\n    }\n\n    /**\n     * Set timeout for write operations.\n     *\n     * @param int $writeTimeout Timeout in seconds\n     *\n     * @return $this\n     */\n    public function setWriteTimeout($writeTimeout)\n    {\n        $this->writeTimeout = $writeTimeout;\n\n        return $this;\n    }\n\n    /**\n     * Get connect timeout.\n     *\n     * @return int Connect timeout in seconds\n     */\n    public function getConnectTimeout()\n    {\n        return $this->connectTimeout;\n    }\n\n    /**\n     * Set connect timeout.\n     *\n     * @param $connectTimeout Connect timeout in seconds\n     *\n     * @return $this\n     */\n    public function setConnectTimeout($connectTimeout)\n    {\n        $this->connectTimeout = $connectTimeout;\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/RequestOptions/RequestOptionsFactory.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\AbstractConfig;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Support\\UserAgent;\n\nfinal class RequestOptionsFactory\n{\n    private $config;\n\n    private $validQueryParameters = [\n        'forwardToReplicas',\n        'replaceExistingSynonyms',\n        'clearExistingRules',\n        'getVersion',\n    ];\n\n    private $validHeaders = [\n        'Content-type',\n        'User-Agent',\n        'createIfNotExists',\n    ];\n\n    public function __construct(AbstractConfig $config)\n    {\n        $this->config = $config;\n    }\n\n    /**\n     * @param \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions\\RequestOptions|array $options\n     * @param array                                                      $defaults\n     *\n     * @return \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions\\RequestOptions\n     */\n    public function create($options, $defaults = [])\n    {\n        if (is_array($options)) {\n            $options += $defaults;\n            $options = $this->format($options);\n            $options = $this->normalize($options);\n\n            $options = new RequestOptions($options);\n        } elseif ($options instanceof RequestOptions) {\n            $defaults = $this->create($defaults);\n            $options->addDefaultHeaders($defaults->getHeaders());\n            $options->addDefaultQueryParameters($defaults->getQueryParameters());\n            $options->addDefaultBodyParameters($defaults->getBody());\n        } else {\n            throw new \\InvalidArgumentException('RequestOptions can only be created from array or from RequestOptions object');\n        }\n\n        return $options->addDefaultHeaders($this->config->getDefaultHeaders());\n    }\n\n    public function createBodyLess($options, $defaults = [])\n    {\n        $options = $this->create($options, $defaults);\n\n        return $options\n            ->addQueryParameters($options->getBody())\n            ->setBody([]);\n    }\n\n    private function normalize($options)\n    {\n        $normalized = [\n            'headers' => [\n                'X-Algolia-Application-Id' => $this->config->getAppId(),\n                'X-Algolia-API-Key' => $this->config->getApiKey(),\n                'User-Agent' => UserAgent::get(),\n                'Content-Type' => 'application/json',\n            ],\n            'query' => [],\n            'body' => [],\n            'readTimeout' => $this->config->getReadTimeout(),\n            'writeTimeout' => $this->config->getWriteTimeout(),\n            'connectTimeout' => $this->config->getConnectTimeout(),\n        ];\n\n        foreach ($options as $optionName => $value) {\n            $type = $this->getOptionType($optionName);\n\n            if (in_array($type, ['readTimeout', 'writeTimeout', 'connectTimeout'])) {\n                $normalized[$type] = $value;\n            } else {\n                $normalized[$type][$optionName] = $value;\n            }\n        }\n\n        return $normalized;\n    }\n\n    private function format($options)\n    {\n        foreach ($options as $name => $value) {\n            if (in_array($name, ['attributesToRetrieve', 'type'], true)) {\n                if (is_array($value)) {\n                    $options[$name] = implode(',', $value);\n                }\n            }\n        }\n\n        return $options;\n    }\n\n    private function getOptionType($optionName)\n    {\n        if ($this->isValidHeaderName($optionName)) {\n            return 'headers';\n        } elseif (in_array($optionName, $this->validQueryParameters, true)) {\n            return 'query';\n        } elseif (in_array($optionName, ['connectTimeout', 'readTimeout', 'writeTimeout'], true)) {\n            return $optionName;\n        } else {\n            return 'body';\n        }\n    }\n\n    private function isValidHeaderName($name)\n    {\n        if (preg_match('/^X-[a-zA-Z-]+/', $name)) {\n            return true;\n        }\n\n        if (in_array($name, $this->validHeaders, true)) {\n            return true;\n        }\n\n        return false;\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Response/AbstractResponse.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response;\n\nabstract class AbstractResponse implements \\ArrayAccess\n{\n    /**\n     * @var array Full response from Algolia API\n     */\n    protected $apiResponse;\n\n    abstract public function wait($requestOptions = []);\n\n    /**\n     * @return array The actual response from Algolia API\n     */\n    public function getBody()\n    {\n        return $this->apiResponse;\n    }\n\n    /**\n     * {@inheritdoc}\n     *\n     * @return bool\n     */\n    #[\\ReturnTypeWillChange]\n    public function offsetExists($offset)\n    {\n        return isset($this->apiResponse[$offset]);\n    }\n\n    /**\n     * {@inheritdoc}\n     *\n     * @return mixed\n     */\n    #[\\ReturnTypeWillChange]\n    public function offsetGet($offset)\n    {\n        return $this->apiResponse[$offset];\n    }\n\n    /**\n     * {@inheritdoc}\n     *\n     * @return void\n     */\n    #[\\ReturnTypeWillChange]\n    public function offsetSet($offset, $value)\n    {\n        $this->apiResponse[$offset] = $value;\n    }\n\n    /**\n     * {@inheritdoc}\n     *\n     * @return void\n     */\n    #[\\ReturnTypeWillChange]\n    public function offsetUnset($offset)\n    {\n        unset($this->apiResponse[$offset]);\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Response/AddApiKeyResponse.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\SearchConfig;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\NotFoundException;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchClient;\n\nfinal class AddApiKeyResponse extends AbstractResponse\n{\n    /**\n     * @var \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchClient\n     */\n    private $client;\n\n    /**\n     * @var \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\SearchConfig\n     */\n    private $config;\n\n    public function __construct(array $apiResponse, SearchClient $client, SearchConfig $config)\n    {\n        $this->apiResponse = $apiResponse;\n        $this->client = $client;\n        $this->config = $config;\n    }\n\n    public function wait($requestOptions = [])\n    {\n        if (!isset($this->client)) {\n            return $this;\n        }\n\n        $key = $this->apiResponse['key'];\n        $retry = 1;\n        $time = $this->config->getWaitTaskTimeBeforeRetry();\n\n        do {\n            try {\n                $this->client->getApiKey($key, $requestOptions);\n\n                unset($this->client, $this->config);\n\n                return $this;\n            } catch (NotFoundException $e) {\n                // Try again\n            }\n\n            $retry++;\n            $factor = ceil($retry / 10);\n            usleep($factor * $time); // 0.1 second\n        } while (true);\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Response/BatchIndexingResponse.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchIndex;\n\nfinal class BatchIndexingResponse extends AbstractResponse implements \\Iterator, \\Countable\n{\n    /**\n     * @var \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchIndex\n     */\n    private $index;\n\n    /**\n     * @var int Current index when class used as an iterator\n     */\n    private $key = 0;\n\n    public function __construct(array $apiResponse, SearchIndex $index)\n    {\n        $this->apiResponse = array_values($apiResponse); // Ensure there aren't any keys\n        $this->index = $index;\n    }\n\n    public function wait($requestOptions = [])\n    {\n        if (isset($this->index)) {\n            foreach ($this->apiResponse as $response) {\n                $this->index->waitTask($response['taskID'], $requestOptions);\n            }\n            unset($this->index);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Count response for the operations. Because indexing objects\n     * is always split in batches, the apiResponse property and an\n     * array of response from the API.\n     *\n     * @return number of response from the API (number of batches sent)\n     */\n    #[\\ReturnTypeWillChange]\n    public function count()\n    {\n        return count($this->apiResponse);\n    }\n\n    /**\n     * @return mixed\n     */\n    #[\\ReturnTypeWillChange]\n    public function current()\n    {\n        return $this->apiResponse[$this->key];\n    }\n\n    /**\n     * @return void\n     */\n    #[\\ReturnTypeWillChange]\n    public function next()\n    {\n        $this->key++;\n    }\n\n    /**\n     * @return bool|float|int|mixed|string|null\n     */\n    #[\\ReturnTypeWillChange]\n    public function key()\n    {\n        return $this->key;\n    }\n\n    /**\n     * @return bool\n     */\n    #[\\ReturnTypeWillChange]\n    public function valid()\n    {\n        return isset($this->apiResponse[$this->key]);\n    }\n\n    /**\n     * @return void\n     */\n    #[\\ReturnTypeWillChange]\n    public function rewind()\n    {\n        $this->key = 0;\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Response/DeleteApiKeyResponse.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\SearchConfig;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\NotFoundException;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchClient;\n\nfinal class DeleteApiKeyResponse extends AbstractResponse\n{\n    /**\n     * @var \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchClient\n     */\n    private $client;\n\n    /**\n     * @var \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\SearchConfig\n     */\n    private $config;\n\n    /**\n     * @var string API Key to be deleted\n     */\n    private $key;\n\n    public function __construct(array $apiResponse, SearchClient $client, SearchConfig $config, $key)\n    {\n        $this->apiResponse = $apiResponse;\n        $this->client = $client;\n        $this->config = $config;\n        $this->key = $key;\n    }\n\n    public function wait($requestOptions = [])\n    {\n        if (!isset($this->client)) {\n            return $this;\n        }\n\n        $retry = 1;\n        $time = $this->config->getWaitTaskTimeBeforeRetry();\n\n        do {\n            try {\n                $this->client->getApiKey($this->key, $requestOptions);\n            } catch (NotFoundException $e) {\n                unset($this->client, $this->config);\n\n                return $this;\n            }\n\n            $retry++;\n            $factor = ceil($retry / 10);\n            usleep($factor * $time); // 0.1 second\n        } while (true);\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Response/DictionaryResponse.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\SearchConfig;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions\\RequestOptions;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchClient;\n\nfinal class DictionaryResponse extends AbstractResponse\n{\n    /* @var \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchClient */\n    private $client;\n\n    /* @var \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\SearchConfig */\n    private $config;\n\n    /* @var bool */\n    private $done = false;\n\n    /**\n     * DictionaryResponse constructor.\n     */\n    public function __construct(array $apiResponse, SearchClient $client, SearchConfig $config)\n    {\n        $this->apiResponse = $apiResponse;\n        $this->client = $client;\n        $this->config = $config;\n    }\n\n    /**\n     * Wait for the task from this response to finish.\n     *\n     * @param array|RequestOptions $requestOptions\n     *\n     * @return $this\n     */\n    public function wait($requestOptions = [])\n    {\n        $retryCount = 1;\n        $time = $this->config->getWaitTaskTimeBeforeRetry();\n\n        while (!$this->done) {\n            $res = $this->getTask($this->apiResponse['taskID'], $requestOptions);\n\n            if ('published' === $res['status']) {\n                $this->done = true;\n                break;\n            }\n\n            $retryCount++;\n            $factor = ceil($retryCount / 10);\n            usleep($factor * $time); // 0.1 second\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get the task details.\n     *\n     * @param int|string           $taskId\n     * @param array|RequestOptions $requestOptions\n     *\n     * @return mixed\n     */\n    private function getTask($taskId, $requestOptions = [])\n    {\n        if (!$taskId) {\n            throw new \\InvalidArgumentException('taskID cannot be empty');\n        }\n\n        return $this->client->custom(\n            'GET',\n            \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\api_path('/1/task/%s', $taskId),\n            $requestOptions\n        );\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Response/IndexingResponse.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchIndex;\n\nfinal class IndexingResponse extends AbstractResponse\n{\n    /**\n     * @var \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchIndex\n     */\n    private $index;\n\n    public function __construct(array $apiResponse, SearchIndex $index)\n    {\n        $this->apiResponse = $apiResponse;\n        $this->index = $index;\n    }\n\n    public function wait($requestOptions = [])\n    {\n        if (isset($this->index)) {\n            $this->index->waitTask($this->apiResponse['taskID'], $requestOptions);\n            unset($this->index);\n        }\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Response/MultiResponse.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response;\n\nclass MultiResponse extends AbstractResponse implements \\Iterator, \\Countable\n{\n    protected $key = 0;\n\n    public function __construct($responses)\n    {\n        $this->apiResponse = $responses;\n    }\n\n    public function wait($requestOptions = [])\n    {\n        foreach ($this->apiResponse as $response) {\n            $response->wait();\n        }\n\n        return $this;\n    }\n\n    /**\n     * @return int\n     */\n    #[\\ReturnTypeWillChange]\n    public function count()\n    {\n        return count($this->apiResponse);\n    }\n\n    /**\n     * @return mixed\n     */\n    #[\\ReturnTypeWillChange]\n    public function current()\n    {\n        return $this->apiResponse[$this->key];\n    }\n\n    /**\n     * @return void\n     */\n    #[\\ReturnTypeWillChange]\n    public function next()\n    {\n        $this->key++;\n    }\n\n    /**\n     * @return bool|float|int|mixed|string|null\n     */\n    #[\\ReturnTypeWillChange]\n    public function key()\n    {\n        return $this->key;\n    }\n\n    /**\n     * @return bool\n     */\n    #[\\ReturnTypeWillChange]\n    public function valid()\n    {\n        return isset($this->apiResponse[$this->key]);\n    }\n\n    /**\n     * @return void\n     */\n    #[\\ReturnTypeWillChange]\n    public function rewind()\n    {\n        $this->key = 0;\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Response/MultipleIndexBatchIndexingResponse.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchClient;\n\nfinal class MultipleIndexBatchIndexingResponse extends AbstractResponse\n{\n    /**\n     * @var \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchClient\n     */\n    private $client;\n\n    public function __construct(array $apiResponse, SearchClient $client)\n    {\n        $this->apiResponse = $apiResponse;\n        $this->client = $client;\n    }\n\n    public function wait($requestOptions = [])\n    {\n        if (!isset($this->client)) {\n            return $this;\n        }\n\n        foreach ($this->apiResponse['taskID'] as $indexName => $taskId) {\n            $this->client->waitTask($indexName, $taskId, $requestOptions);\n        }\n\n        unset($this->client);\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Response/NullResponse.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response;\n\nfinal class NullResponse extends AbstractResponse\n{\n    public function __construct()\n    {\n        $this->apiResponse = [];\n    }\n\n    public function wait($requestOptions = [])\n    {\n        return $this;\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Response/RestoreApiKeyResponse.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\SearchConfig;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\NotFoundException;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchClient;\n\nfinal class RestoreApiKeyResponse extends AbstractResponse\n{\n    /**\n     * @var \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchClient\n     */\n    private $client;\n\n    /**\n     * @var \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\SearchConfig\n     */\n    private $config;\n\n    /**\n     * @var string API Key to be deleted\n     */\n    private $key;\n\n    /**\n     * RestoreApiKeyResponse constructor.\n     *\n     * @param string $key\n     */\n    public function __construct(array $apiResponse, SearchClient $client, SearchConfig $config, $key)\n    {\n        $this->apiResponse = $apiResponse;\n        $this->client = $client;\n        $this->config = $config;\n        $this->key = $key;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function wait($requestOptions = [])\n    {\n        if (!isset($this->client)) {\n            return $this;\n        }\n\n        $retry = 1;\n        $time = $this->config->getWaitTaskTimeBeforeRetry();\n\n        do {\n            try {\n                $this->client->getApiKey($this->key, $requestOptions);\n\n                unset($this->client, $this->config);\n\n                return $this;\n            } catch (NotFoundException $e) {\n                // Try again\n            }\n\n            $retry++;\n            $factor = ceil($retry / 10);\n            usleep($factor * $time); // 0.1 second\n        } while (true);\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Response/UpdateApiKeyResponse.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\SearchConfig;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\NotFoundException;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchClient;\n\nfinal class UpdateApiKeyResponse extends AbstractResponse\n{\n    /**\n     * @var \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchClient\n     */\n    private $client;\n\n    /**\n     * @var \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\SearchConfig\n     */\n    private $config;\n\n    private $keyParams;\n\n    public function __construct(\n        array $apiResponse,\n        SearchClient $client,\n        SearchConfig $config,\n        $requestOptions\n    ) {\n        $this->apiResponse = $apiResponse;\n        $this->client = $client;\n        $this->config = $config;\n        $this->keyParams = $this->filterOnlyKeyParams($requestOptions);\n    }\n\n    public function wait($requestOptions = [])\n    {\n        if (!isset($this->client)) {\n            return $this;\n        }\n\n        $key = $this->apiResponse['key'];\n        $retry = 1;\n        $time = $this->config->getWaitTaskTimeBeforeRetry();\n\n        do {\n            try {\n                $this->client->getApiKey($key, $requestOptions);\n\n                if ($this->isKeyUpdated($key, $this->keyParams)) {\n                    unset($this->client, $this->config);\n\n                    return $this;\n                }\n            } catch (NotFoundException $e) {\n                // Try again\n            }\n\n            $retry++;\n            $factor = ceil($retry / 10);\n            usleep($factor * $time); // 0.1 second\n        } while (true);\n    }\n\n    private function isKeyUpdated($key, $keyParams)\n    {\n        $upToDate = true;\n        foreach ($keyParams as $param => $value) {\n            if (isset($key[$param])) {\n                $upToDate &= ($key[$param] == $value);\n            }\n        }\n\n        return $upToDate;\n    }\n\n    private function filterOnlyKeyParams($requestOptions)\n    {\n        $validKeyParams = [\n            'acl',  'indexes',  'referers',\n            'restrictSources', 'queryParameters',  'description',\n            'validity',  'maxQueriesPerIPPerHour',  'maxHitsPerQuery',\n        ];\n\n        return array_intersect_key($requestOptions, array_flip($validKeyParams));\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/RetryStrategy/ApiWrapper.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Algolia;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\AbstractConfig;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\AlgoliaException;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\BadRequestException;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\NotFoundException;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\RetriableException;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\UnreachableException;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\HttpClientInterface;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\Psr7\\Request;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\Psr7\\Uri;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions\\RequestOptions;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions\\RequestOptionsFactory;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Support\\Helpers;\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\RequestInterface;\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\ResponseInterface;\nuse WebDevStudios\\WPSWA\\Psr\\Http\\Message\\UriInterface;\nuse WebDevStudios\\WPSWA\\Psr\\Log\\LoggerInterface;\nuse WebDevStudios\\WPSWA\\Psr\\Log\\LogLevel;\n\nfinal class ApiWrapper implements ApiWrapperInterface\n{\n    /**\n     * @var HttpClientInterface\n     */\n    private $http;\n\n    /**\n     * @var AbstractConfig\n     */\n    private $config;\n\n    /**\n     * @var \\WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ClusterHosts\n     */\n    private $clusterHosts;\n\n    /**\n     * @var RequestOptionsFactory\n     */\n    private $requestOptionsFactory;\n\n    /**\n     * @var LoggerInterface\n     */\n    private $logger;\n\n    /**\n     * @var int\n     */\n    private $jsonOptions = 0;\n\n    public function __construct(\n        HttpClientInterface $http,\n        AbstractConfig $config,\n        ClusterHosts $clusterHosts,\n        ?RequestOptionsFactory $RqstOptsFactory = null,\n        ?LoggerInterface $logger = null\n    ) {\n        $this->http = $http;\n        $this->config = $config;\n        $this->clusterHosts = $clusterHosts;\n        $this->requestOptionsFactory = $RqstOptsFactory ?: new RequestOptionsFactory($config);\n        $this->logger = $logger ?: Algolia::getLogger();\n        if (defined('JSON_UNESCAPED_UNICODE')) {\n            // `JSON_UNESCAPED_UNICODE` is introduced in PHP 5.4.0\n            $this->jsonOptions = JSON_UNESCAPED_UNICODE;\n        }\n    }\n\n    public function read($method, $path, $requestOptions = [], $defaultRequestOptions = [])\n    {\n        if ('GET' === strtoupper($method)) {\n            $requestOptions = $this->requestOptionsFactory->createBodyLess($requestOptions, $defaultRequestOptions);\n        } else {\n            $requestOptions = $this->requestOptionsFactory->create($requestOptions, $defaultRequestOptions);\n        }\n\n        return $this->request(\n            $method,\n            $path,\n            $requestOptions,\n            $this->clusterHosts->read(),\n            $requestOptions->getReadTimeout()\n        );\n    }\n\n    public function write($method, $path, $data = [], $requestOptions = [], $defaultRequestOptions = [])\n    {\n        if ('DELETE' === strtoupper($method)) {\n            $requestOptions = $this->requestOptionsFactory->createBodyLess($requestOptions, $defaultRequestOptions);\n            $data = [];\n        } else {\n            $requestOptions = $this->requestOptionsFactory->create($requestOptions, $defaultRequestOptions);\n        }\n\n        return $this->request(\n            $method,\n            $path,\n            $requestOptions,\n            $this->clusterHosts->write(),\n            $requestOptions->getWriteTimeout(),\n            $data\n        );\n    }\n\n    public function send($method, $path, $requestOptions = [], $hosts = null)\n    {\n        $requestOptions = $this->requestOptionsFactory->create($requestOptions);\n\n        if (null === $hosts) {\n            $hosts = $this->clusterHosts->write();\n        } elseif (!is_array($hosts)) {\n            $hosts = [$hosts];\n        }\n\n        return $this->request(\n            $method,\n            $path,\n            $requestOptions,\n            $hosts,\n            $requestOptions->getWriteTimeout()\n        );\n    }\n\n    private function request($method, $path, RequestOptions $requestOptions, $hosts, $timeout, $data = [])\n    {\n        $uri = $this->createUri($path)\n            ->withQuery($requestOptions->getBuiltQueryParameters())\n            ->withScheme('https');\n\n        $body = array_merge($data, $requestOptions->getBody());\n\n        $logParams = [\n            'body' => $body,\n            'headers' => $requestOptions->getHeaders(),\n            'method' => $method,\n            'query' => $requestOptions->getQueryParameters(),\n        ];\n\n        $retry = 1;\n        foreach ($hosts as $host) {\n            $uri = $uri->withHost($host);\n            $request = null;\n            $logParams['retryNumber'] = $retry;\n            $logParams['host'] = (string) $uri;\n\n            try {\n                $request = $this->createRequest(\n                    $method,\n                    $uri,\n                    $requestOptions->getHeaders(),\n                    $body\n                );\n\n                $this->log(LogLevel::DEBUG, 'Sending request.', $logParams);\n\n                $response = $this->http->sendRequest(\n                    $request,\n                    $timeout * $retry,\n                    $requestOptions->getConnectTimeout() * $retry\n                );\n\n                $responseBody = $this->handleResponse($response, $request);\n\n                $logParams['response'] = $responseBody;\n                $this->log(LogLevel::DEBUG, 'Response received.', $logParams);\n\n                return $responseBody;\n            } catch (RetriableException $e) {\n                $this->log(LogLevel::DEBUG, 'Host failed.', array_merge($logParams, [\n                    'description' => $e->getMessage(),\n                ]));\n\n                $this->clusterHosts->failed($host);\n            } catch (BadRequestException $e) {\n                unset($logParams['body'], $logParams['headers']);\n                $logParams['description'] = $e->getMessage();\n                $this->log(LogLevel::WARNING, 'Bad request.', $logParams);\n\n                throw $e;\n            } catch (\\Exception $e) {\n                unset($logParams['body'], $logParams['headers']);\n                $logParams['description'] = $e->getMessage();\n                $this->log(LogLevel::ERROR, 'Generic error.', $logParams);\n\n                throw $e;\n            }\n\n            $retry++;\n        }\n\n        throw new UnreachableException();\n    }\n\n    private function handleResponse(ResponseInterface $response, RequestInterface $request)\n    {\n        $body = (string) $response->getBody();\n        $statusCode = $response->getStatusCode();\n\n        if (0 === $statusCode || ($statusCode >= 100 && $statusCode < 200) || $statusCode >= 500) {\n            $reason = $response->getReasonPhrase();\n\n            if (null === $response->getReasonPhrase() || '' === $response->getReasonPhrase()) {\n                $reason = $statusCode >= 500 ? 'Internal Server Error' : 'Unreachable Host';\n            }\n\n            throw new RetriableException('Retriable failure on '.$request->getUri()->getHost().': '.$reason, $statusCode);\n        }\n\n        $responseArray = Helpers::json_decode($body, true);\n\n        if (404 == $statusCode) {\n            throw new NotFoundException($responseArray['message'], $statusCode);\n        } elseif ($statusCode >= 400) {\n            throw new BadRequestException($responseArray['message'], $statusCode);\n        } elseif (2 != (int) ($statusCode / 100)) {\n            throw new AlgoliaException($statusCode.': '.$body, $statusCode);\n        }\n\n        return $responseArray;\n    }\n\n    private function createUri($uri)\n    {\n        if ($uri instanceof UriInterface) {\n            return $uri;\n        } elseif (is_string($uri)) {\n            return new Uri($uri);\n        }\n\n        throw new \\InvalidArgumentException('URI must be a string or UriInterface');\n    }\n\n    private function createRequest(\n        $method,\n        $uri,\n        array $headers = [],\n        $body = null,\n        $protocolVersion = '1.1'\n    ) {\n        if (is_array($body)) {\n            // Send an empty body instead of \"[]\" in case there are\n            // no content/params to send\n            if (empty($body)) {\n                $body = '';\n            } else {\n                $body = \\json_encode($body, $this->jsonOptions);\n                if (JSON_ERROR_NONE !== json_last_error()) {\n                    throw new \\InvalidArgumentException('json_encode error: '.json_last_error_msg());\n                }\n            }\n        }\n\n        return new Request($method, $uri, $headers, $body, $protocolVersion);\n    }\n\n    /**\n     * @param string $level\n     * @param string $message\n     */\n    private function log($level, $message, array $context = [])\n    {\n        $this->logger->log($level, 'Algolia API client: '.$message, $context);\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/RetryStrategy/ApiWrapperInterface.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy;\n\ninterface ApiWrapperInterface\n{\n    public function read($method, $path, $requestOptions = [], $defaultRequestOptions = []);\n\n    public function write($method, $path, $data = [], $requestOptions = [], $defaultRequestOptions = []);\n\n    public function send($method, $path, $requestOptions = [], $hosts = null);\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/RetryStrategy/ClusterHosts.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Algolia;\n\n/**\n * @internal\n */\nfinal class ClusterHosts\n{\n    private $read;\n\n    private $write;\n\n    private $cacheKey;\n\n    private $lastReadHash;\n\n    private $lastWriteHash;\n\n    public function __construct(HostCollection $read, HostCollection $write)\n    {\n        $this->read = $read;\n        $this->write = $write;\n    }\n\n    public static function create($read, $write = null)\n    {\n        if (null === $write) {\n            $write = $read;\n        }\n\n        if (is_string($read)) {\n            $read = [$read => 0];\n        }\n\n        if (is_string($write)) {\n            $write = [$write => 0];\n        }\n\n        if (array_values($read) === $read) {\n            $read = array_fill_keys($read, 0);\n        }\n\n        if (array_values($write) === $write) {\n            $write = array_fill_keys($write, 0);\n        }\n\n        return new static(HostCollection::create($read), HostCollection::create($write));\n    }\n\n    public static function createFromAppId($applicationId)\n    {\n        $read = $write = [\n            $applicationId.'-1.algolianet.com' => 0,\n            $applicationId.'-2.algolianet.com' => 0,\n            $applicationId.'-3.algolianet.com' => 0,\n        ];\n\n        $read[$applicationId.'-dsn.algolia.net'] = 10;\n        $write[$applicationId.'.algolia.net'] = 10;\n\n        return static::create($read, $write);\n    }\n\n    public static function createForPlaces()\n    {\n        $read = $write = [\n            'places-1.algolianet.com' => 0,\n            'places-2.algolianet.com' => 0,\n            'places-3.algolianet.com' => 0,\n        ];\n\n        $read['places-dsn.algolia.net'] = 10;\n        $write['places.algolia.net'] = 10;\n\n        return static::create($read, $write);\n    }\n\n    public static function createForAnalytics($region)\n    {\n        return static::create('analytics.'.$region.'.algolia.com');\n    }\n\n    public static function createForInsights($region)\n    {\n        return static::create('insights.'.$region.'.algolia.io');\n    }\n\n    public static function createForRecommendation($region)\n    {\n        return static::create('recommendation.'.$region.'.algolia.com');\n    }\n\n    public static function createFromCache($cacheKey)\n    {\n        if (!Algolia::isCacheEnabled()) {\n            return false;\n        }\n\n        if (!Algolia::getCache()->has($cacheKey)) {\n            return false;\n        }\n\n        return @unserialize(Algolia::getCache()->get($cacheKey));\n    }\n\n    public function read()\n    {\n        return $this->getUrls('read');\n    }\n\n    public function write()\n    {\n        return $this->getUrls('write');\n    }\n\n    public function failed($host)\n    {\n        $this->read->markAsDown($host);\n        $this->write->markAsDown($host);\n\n        $this->updateCache();\n\n        return $this;\n    }\n\n    public function reset()\n    {\n        $this->read->reset();\n        $this->write->reset();\n\n        return $this;\n    }\n\n    public function shuffle()\n    {\n        $this->read->shuffle();\n        $this->write->shuffle();\n\n        return $this;\n    }\n\n    /**\n     * Sets the cache key to save the state of the ClusterHosts.\n     *\n     * @param string $cacheKey\n     *\n     * @return $this\n     */\n    public function setCacheKey($cacheKey)\n    {\n        $this->cacheKey = $cacheKey;\n\n        return $this;\n    }\n\n    private function getUrls($type)\n    {\n        $urls = $this->{$type}->getUrls();\n        $lashHashName = 'last'.ucfirst($type).'Hash';\n\n        if (Algolia::isCacheEnabled()) {\n            $hash = sha1(implode('-', $urls));\n            if ($hash !== $this->{$lashHashName}) {\n                $this->updateCache();\n            }\n            $this->{$lashHashName} = $hash;\n        }\n\n        return $urls;\n    }\n\n    private function updateCache()\n    {\n        if (null !== $this->cacheKey && Algolia::isCacheEnabled()) {\n            Algolia::getCache()->set($this->cacheKey, serialize($this));\n        }\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/RetryStrategy/Host.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy;\n\n/**\n * @internal\n */\nfinal class Host\n{\n    private $url;\n\n    private $priority;\n\n    private $up = true;\n\n    private $lastCheck;\n\n    const TTL = 300; // 5 minutes\n\n    public function __construct($url, $priority = 0)\n    {\n        $this->url = $url;\n        $this->priority = $priority;\n    }\n\n    public function getUrl()\n    {\n        return $this->url;\n    }\n\n    public function getPriority()\n    {\n        return $this->priority;\n    }\n\n    public function isUp()\n    {\n        if (!$this->up) {\n            $this->resetIfExpired();\n        }\n\n        return $this->up;\n    }\n\n    public function markAsDown()\n    {\n        $this->up = false;\n        $this->lastCheck = time();\n    }\n\n    public function reset()\n    {\n        $this->up = true;\n        $this->lastCheck = null;\n    }\n\n    private function resetIfExpired()\n    {\n        $expired = $this->lastCheck + self::TTL < time();\n\n        if ($expired) {\n            $this->reset();\n        }\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/RetryStrategy/HostCollection.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy;\n\n/**\n * @internal\n */\nfinal class HostCollection\n{\n    private $hosts;\n\n    public function __construct(array $hosts)\n    {\n        $this->hosts = $hosts;\n\n        $this->shuffle();\n    }\n\n    public static function create(array $urlsWithPriority)\n    {\n        $hosts = [];\n        foreach ($urlsWithPriority as $url => $priority) {\n            $hosts[] = new Host($url, $priority);\n        }\n\n        return new static($hosts);\n    }\n\n    public function get()\n    {\n        // We pass the result through array_values because sometimes\n        // we need to make sure you can access the first element\n        // via $result[0]\n        return array_values(array_filter($this->hosts, function (Host $host) {\n            return $host->isUp();\n        }));\n    }\n\n    public function getUrls()\n    {\n        return array_map(function (Host $host) {\n            return $host->getUrl();\n        }, $this->get());\n    }\n\n    public function markAsDown($hostKey)\n    {\n        array_map(function (Host $host) use ($hostKey) {\n            if ($host->getUrl() === $hostKey) {\n                $host->markAsDown();\n            }\n        }, $this->hosts);\n    }\n\n    public function shuffle()\n    {\n        if (shuffle($this->hosts)) {\n            $this->sort();\n        }\n\n        return $this;\n    }\n\n    public function reset()\n    {\n        foreach ($this->hosts as $host) {\n            $host->reset();\n        }\n\n        return $this;\n    }\n\n    private function sort()\n    {\n        usort($this->hosts, function (Host $a, Host $b) {\n            $prioA = $a->getPriority();\n            $prioB = $b->getPriority();\n            if ($prioA == $prioB) {\n                return 0;\n            }\n\n            return ($prioA > $prioB) ? -1 : 1;\n        });\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/SearchClient.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\SearchConfig;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\ValidUntilNotFoundException;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions\\RequestOptions;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\AddApiKeyResponse;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\DeleteApiKeyResponse;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\DictionaryResponse;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\IndexingResponse;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\MultipleIndexBatchIndexingResponse;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\RestoreApiKeyResponse;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\UpdateApiKeyResponse;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ApiWrapper;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ApiWrapperInterface;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ClusterHosts;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Support\\Helpers;\n\nclass SearchClient\n{\n    /**\n     * @var ApiWrapperInterface\n     */\n    protected $api;\n\n    /**\n     * @var SearchConfig\n     */\n    protected $config;\n\n    protected static $client;\n\n    public function __construct(ApiWrapperInterface $apiWrapper, SearchConfig $config)\n    {\n        $this->api = $apiWrapper;\n        $this->config = $config;\n    }\n\n    public static function get()\n    {\n        if (!static::$client) {\n            static::$client = static::create();\n        }\n\n        return static::$client;\n    }\n\n    public static function create($appId = null, $apiKey = null)\n    {\n        return static::createWithConfig(SearchConfig::create($appId, $apiKey));\n    }\n\n    public static function createWithConfig(SearchConfig $config)\n    {\n        $config = clone $config;\n\n        $cacheKey = sprintf('%s-clusterHosts-%s', __CLASS__, $config->getAppId());\n\n        if ($hosts = $config->getHosts()) {\n            // If a list of hosts was passed, we ignore the cache\n            $clusterHosts = ClusterHosts::create($hosts);\n        } elseif (false === ($clusterHosts = ClusterHosts::createFromCache($cacheKey))) {\n            // We'll try to restore the ClusterHost from cache, if we cannot\n            // we create a new instance and set the cache key\n            $clusterHosts = ClusterHosts::createFromAppId($config->getAppId())\n                ->setCacheKey($cacheKey);\n        }\n\n        $apiWrapper = new ApiWrapper(\n            Algolia::getHttpClient(),\n            $config,\n            $clusterHosts\n        );\n\n        return new static($apiWrapper, $config);\n    }\n\n    public function initIndex($indexName)\n    {\n        return new SearchIndex($indexName, $this->api, $this->config);\n    }\n\n    public function getAppId()\n    {\n        return $this->config->getAppId();\n    }\n\n    public function moveIndex($srcIndexName, $newIndexName, $requestOptions = [])\n    {\n        $response = $this->api->write(\n            'POST',\n            api_path('/1/indexes/%s/operation', $srcIndexName),\n            [\n                'operation' => 'move',\n                'destination' => $newIndexName,\n            ],\n            $requestOptions\n        );\n\n        return new IndexingResponse($response, $this->initIndex($srcIndexName));\n    }\n\n    public function copyIndex($srcIndexName, $destIndexName, $requestOptions = [])\n    {\n        $response = $this->api->write(\n            'POST',\n            api_path('/1/indexes/%s/operation', $srcIndexName),\n            [\n                'operation' => 'copy',\n                'destination' => $destIndexName,\n            ],\n            $requestOptions\n        );\n\n        return new IndexingResponse($response, $this->initIndex($srcIndexName));\n    }\n\n    public function copySettings($srcIndexName, $destIndexName, $requestOptions = [])\n    {\n        if (is_array($requestOptions)) {\n            $requestOptions['scope'] = ['settings'];\n        } elseif ($requestOptions instanceof RequestOptions) {\n            $requestOptions->addBodyParameter('scope', ['settings']);\n        }\n\n        return $this->copyIndex($srcIndexName, $destIndexName, $requestOptions);\n    }\n\n    public function copySynonyms($srcIndexName, $destIndexName, $requestOptions = [])\n    {\n        if (is_array($requestOptions)) {\n            $requestOptions['scope'] = ['synonyms'];\n        } elseif ($requestOptions instanceof RequestOptions) {\n            $requestOptions->addBodyParameter('scope', ['synonyms']);\n        }\n\n        return $this->copyIndex($srcIndexName, $destIndexName, $requestOptions);\n    }\n\n    public function copyRules($srcIndexName, $destIndexName, $requestOptions = [])\n    {\n        if (is_array($requestOptions)) {\n            $requestOptions['scope'] = ['rules'];\n        } elseif ($requestOptions instanceof RequestOptions) {\n            $requestOptions->addBodyParameter('scope', ['rules']);\n        }\n\n        return $this->copyIndex($srcIndexName, $destIndexName, $requestOptions);\n    }\n\n    public function isAlive($requestOptions = [])\n    {\n        return $this->api->read('GET', api_path('/1/isalive'), $requestOptions);\n    }\n\n    public function search($queries, $requestOptions = [])\n    {\n        return $this->multipleQueries($queries, $requestOptions);\n    }\n\n    public function multipleQueries($queries, $requestOptions = [])\n    {\n        $queries = array_map(function ($query) {\n            $query['params'] = isset($query['params']) ?\n                Helpers::serializeQueryParameters($query['params']) :\n                Helpers::serializeQueryParameters([]);\n\n            return $query;\n        }, $queries);\n\n        if (is_array($requestOptions)) {\n            $requestOptions['requests'] = $queries;\n        } elseif ($requestOptions instanceof RequestOptions) {\n            $requestOptions->addBodyParameter('requests', $queries);\n        }\n\n        return $this->api->read(\n            'POST',\n            api_path('/1/indexes/*/queries'),\n            $requestOptions\n        );\n    }\n\n    public function multipleBatch($operations, $requestOptions = [])\n    {\n        $response = $this->api->write(\n            'POST',\n            api_path('/1/indexes/*/batch'),\n            ['requests' => $operations],\n            $requestOptions\n        );\n\n        return new MultipleIndexBatchIndexingResponse($response, $this);\n    }\n\n    public function multipleGetObjects($requests, $requestOptions = [])\n    {\n        if (is_array($requestOptions)) {\n            $requestOptions['requests'] = $requests;\n        } elseif ($requestOptions instanceof RequestOptions) {\n            $requestOptions->addBodyParameter('requests', $requests);\n        }\n\n        return $this->api->read(\n            'POST',\n            api_path('/1/indexes/*/objects'),\n            $requestOptions\n        );\n    }\n\n    public function listIndices($requestOptions = [])\n    {\n        return $this->api->read('GET', api_path('/1/indexes/'), $requestOptions);\n    }\n\n    public function listApiKeys($requestOptions = [])\n    {\n        return $this->api->read('GET', api_path('/1/keys'), $requestOptions);\n    }\n\n    public function getApiKey($key, $requestOptions = [])\n    {\n        return $this->api->read('GET', api_path('/1/keys/%s', $key), $requestOptions);\n    }\n\n    public function addApiKey($acl, $requestOptions = [])\n    {\n        $acl = ['acl' => $acl];\n\n        $response = $this->api->write('POST', api_path('/1/keys'), $acl, $requestOptions);\n\n        return new AddApiKeyResponse($response, $this, $this->config);\n    }\n\n    public function updateApiKey($key, $requestOptions = [])\n    {\n        $response = $this->api->write('PUT', api_path('/1/keys/%s', $key), [], $requestOptions);\n\n        return new UpdateApiKeyResponse($response, $this, $this->config, $requestOptions);\n    }\n\n    public function deleteApiKey($key, $requestOptions = [])\n    {\n        $response = $this->api->write('DELETE', api_path('/1/keys/%s', $key), [], $requestOptions);\n\n        return new DeleteApiKeyResponse($response, $this, $this->config, $key);\n    }\n\n    public function restoreApiKey($key, $requestOptions = [])\n    {\n        $response = $this->api->write('POST', api_path('/1/keys/%s/restore', $key), [], $requestOptions);\n\n        return new RestoreApiKeyResponse($response, $this, $this->config, $key);\n    }\n\n    public static function generateSecuredApiKey($parentApiKey, $restrictions)\n    {\n        $urlEncodedRestrictions = Helpers::buildQuery($restrictions);\n\n        $content = hash_hmac('sha256', $urlEncodedRestrictions, $parentApiKey).$urlEncodedRestrictions;\n\n        return base64_encode($content);\n    }\n\n    /**\n     * @deprecated endpoint will be deprecated\n     * @see PersonalizationClient\n     */\n    public function getPersonalizationStrategy($requestOptions = [])\n    {\n        return $this->api->read('GET', api_path('/1/recommendation/personalization/strategy'), $requestOptions);\n    }\n\n    /**\n     * @deprecated endpoint will be deprecated\n     * @see PersonalizationClient\n     */\n    public function setPersonalizationStrategy($strategy, $requestOptions = [])\n    {\n        $apiResponse = $this->api->write(\n            'POST',\n            api_path('1/recommendation/personalization/strategy'),\n            $strategy,\n            $requestOptions\n        );\n\n        return $apiResponse;\n    }\n\n    public function searchUserIds($query, $requestOptions = [])\n    {\n        $query = (string) $query;\n\n        if (is_array($requestOptions)) {\n            $requestOptions['query'] = $query;\n        } elseif ($requestOptions instanceof RequestOptions) {\n            $requestOptions->addBodyParameter('query', $query);\n        }\n\n        return $this->api->read('POST', api_path('/1/clusters/mapping/search'), $requestOptions);\n    }\n\n    public function listClusters($requestOptions = [])\n    {\n        return $this->api->read('GET', api_path('/1/clusters'), $requestOptions);\n    }\n\n    public function listUserIds($requestOptions = [])\n    {\n        return $this->api->read('GET', api_path('/1/clusters/mapping'), $requestOptions);\n    }\n\n    public function getUserId($userId, $requestOptions = [])\n    {\n        return $this->api->read('GET', api_path('/1/clusters/mapping/%s', $userId), $requestOptions);\n    }\n\n    /**\n     * @deprecated since 2.6.1, use getTopUserIds instead.\n     */\n    public function getTopUserId($requestOptions = [])\n    {\n        return $this->getTopUserIds($requestOptions);\n    }\n\n    /**\n     * Get the top 10 userIDs with the highest number of records per cluster.\n     *\n     * @param array $requestOptions\n     *\n     * @return array<string, mixed>\n     */\n    public function getTopUserIds($requestOptions = [])\n    {\n        return $this->api->read('GET', api_path('/1/clusters/mapping/top'), $requestOptions);\n    }\n\n    public function assignUserId($userId, $clusterName, $requestOptions = [])\n    {\n        if (is_array($requestOptions)) {\n            $requestOptions['X-Algolia-User-ID'] = $userId;\n        } elseif ($requestOptions instanceof RequestOptions) {\n            $requestOptions->addHeader('X-Algolia-User-ID', $userId);\n        }\n\n        return $this->api->write(\n            'POST',\n            api_path('/1/clusters/mapping'),\n            [\n                'cluster' => $clusterName,\n            ],\n            $requestOptions\n        );\n    }\n\n    /**\n     * Assign multiple userIds to the given cluster name.\n     *\n     * @param array<int, int> $userIds\n     * @param string          $clusterName\n     * @param array           $requestOptions\n     *\n     * @return array<string, mixed>\n     */\n    public function assignUserIds($userIds, $clusterName, $requestOptions = [])\n    {\n        return $this->api->write(\n             'POST',\n             api_path('/1/clusters/mapping/batch'),\n             [\n                 'users' => $userIds,\n                 'cluster' => $clusterName,\n             ],\n             $requestOptions\n         );\n    }\n\n    public function removeUserId($userId, $requestOptions = [])\n    {\n        if (is_array($requestOptions)) {\n            $requestOptions['X-Algolia-User-ID'] = $userId;\n        } elseif ($requestOptions instanceof RequestOptions) {\n            $requestOptions->addHeader('X-Algolia-User-ID', $userId);\n        }\n\n        return $this->api->write(\n            'DELETE',\n            api_path('/1/clusters/mapping'),\n            [],\n            $requestOptions\n        );\n    }\n\n    public function getLogs($requestOptions = [])\n    {\n        return $this->api->read('GET', api_path('/1/logs'), $requestOptions);\n    }\n\n    public function getTask($indexName, $taskId, $requestOptions = [])\n    {\n        $index = $this->initIndex($indexName);\n\n        return $index->getTask($taskId, $requestOptions);\n    }\n\n    public function waitTask($indexName, $taskId, $requestOptions = [])\n    {\n        $index = $this->initIndex($indexName);\n\n        $index->waitTask($taskId, $requestOptions);\n    }\n\n    public function custom($method, $path, $requestOptions = [], $hosts = null)\n    {\n        return $this->api->send($method, $path, $requestOptions, $hosts);\n    }\n\n    /**\n     * Returns the time the given securedAPIKey remains valid in seconds.\n     *\n     * @param string $securedAPIKey the key to check\n     *\n     * @return int remaining validity in seconds\n     *\n     * @throws ValidUntilNotFoundException\n     */\n    public static function getSecuredApiKeyRemainingValidity($securedAPIKey)\n    {\n        $decodedKey = base64_decode($securedAPIKey);\n        $regex = '/validUntil=(\\d+)/';\n        preg_match($regex, $decodedKey, $matches);\n\n        if (0 === count($matches)) {\n            throw new ValidUntilNotFoundException(\"The SecuredAPIKey doesn't have a validUntil parameter.\");\n        }\n\n        $validUntil = (int) $matches[1];\n\n        return $validUntil - time();\n    }\n\n    /**\n     * Get cluster pending (migrating, creating, deleting) mapping state. Query cluster pending mapping status and get cluster mappings.\n     *\n     * @param array<string, mixed> $requestOptions\n     *\n     * @return array<string, boolean|array>\n     */\n    public function hasPendingMappings($requestOptions = [])\n    {\n        if (isset($requestOptions['retrieveMappings'])\n            && true === $requestOptions['retrieveMappings']) {\n            if (is_array($requestOptions)) {\n                $requestOptions['getClusters'] = true;\n            } elseif ($requestOptions instanceof RequestOptions) {\n                $requestOptions->addQueryParameter('getClusters', true);\n            }\n        }\n\n        return $this->api->read(\n            'GET',\n            api_path('/1/clusters/mapping/pending'),\n            $requestOptions\n        );\n    }\n\n    /**\n     * Save entries to the given dictionary.\n     *\n     * @param string                      $dictionary\n     * @param array<array<string, mixed>> $entries\n     * @param array|RequestOptions        $requestOptions\n     *\n     * @return DictionaryResponse\n     */\n    public function saveDictionaryEntries($dictionary, $entries, $requestOptions = [])\n    {\n        $response = $this->api->write(\n            'POST',\n            api_path('/1/dictionaries/%s/batch', $dictionary),\n            [\n                'clearExistingDictionaryEntries' => false,\n                'requests' => Helpers::buildBatch($entries, 'addEntry'),\n            ],\n            $requestOptions\n        );\n\n        return new DictionaryResponse($response, $this, $this->config);\n    }\n\n    /**\n     * Replace all dictionary entries.\n     *\n     * @param string                      $dictionary\n     * @param array<array<string, mixed>> $entries\n     * @param array                       $requestOptions\n     *\n     * @return DictionaryResponse\n     */\n    public function replaceDictionaryEntries($dictionary, $entries, $requestOptions = [])\n    {\n        $response = $this->api->write(\n            'POST',\n            api_path('/1/dictionaries/%s/batch', $dictionary),\n            [\n                'clearExistingDictionaryEntries' => true,\n                'requests' => Helpers::buildBatch($entries, 'addEntry'),\n            ],\n            $requestOptions\n        );\n\n        return new DictionaryResponse($response, $this, $this->config);\n    }\n\n    /**\n     * Delete dictionary entries by their objectID.\n     *\n     * @param string        $dictionary\n     * @param array<string> $objectIDs\n     * @param array         $requestOptions\n     *\n     * @return DictionaryResponse\n     */\n    public function deleteDictionaryEntries($dictionary, $objectIDs, $requestOptions = [])\n    {\n        $entries = array_map(function ($objectID) {\n            return ['objectID' => $objectID];\n        }, $objectIDs);\n\n        $response = $this->api->write(\n            'POST',\n            api_path('/1/dictionaries/%s/batch', $dictionary),\n            [\n                'clearExistingDictionaryEntries' => false,\n                'requests' => Helpers::buildBatch($entries, 'deleteEntry'),\n            ],\n            $requestOptions\n        );\n\n        return new DictionaryResponse($response, $this, $this->config);\n    }\n\n    /**\n     * Clear all entries in the given dictionary.\n     *\n     * @param string               $dictionary\n     * @param array|RequestOptions $requestOptions\n     *\n     * @return DictionaryResponse\n     */\n    public function clearDictionaryEntries($dictionary, $requestOptions = [])\n    {\n        return $this->replaceDictionaryEntries($dictionary, [], $requestOptions);\n    }\n\n    /**\n     * Search the dictionary for entries.\n     *\n     * @param string               $dictionary\n     * @param string               $query\n     * @param array|RequestOptions $requestOptions\n     *\n     * @return mixed\n     */\n    public function searchDictionaryEntries($dictionary, $query, $requestOptions = [])\n    {\n        return $this->api->read(\n            'POST',\n            api_path('/1/dictionaries/%s/search', $dictionary),\n            ['query' => $query],\n            $requestOptions\n        );\n    }\n\n    /**\n     * Update the settings for all dictionaries.\n     *\n     * @param array<mixed> $dictionarySettings\n     * @param array        $requestOptions\n     *\n     * @return DictionaryResponse\n     */\n    public function setDictionarySettings($dictionarySettings, $requestOptions = [])\n    {\n        $response = $this->api->write(\n            'PUT',\n            api_path('/1/dictionaries/*/settings'),\n            $dictionarySettings,\n            $requestOptions\n        );\n\n        return new DictionaryResponse($response, $this, $this->config);\n    }\n\n    /**\n     * Get the settings for all dictionaries.\n     *\n     * @param array|RequestOptions $requestOptions\n     *\n     * @return mixed\n     */\n    public function getDictionarySettings($requestOptions = [])\n    {\n        return $this->api->read(\n            'GET',\n            api_path('/1/dictionaries/*/settings'),\n            [],\n            $requestOptions\n        );\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/SearchIndex.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\SearchConfig;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\MissingObjectId;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\NotFoundException;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\ObjectNotFoundException;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Iterators\\ObjectIterator;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Iterators\\RuleIterator;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Iterators\\SynonymIterator;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions\\RequestOptions;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions\\RequestOptionsFactory;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\BatchIndexingResponse;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\IndexingResponse;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\MultiResponse;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\NullResponse;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ApiWrapperInterface;\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Support\\Helpers;\n\nclass SearchIndex\n{\n    private $indexName;\n\n    /**\n     * @var ApiWrapperInterface\n     */\n    protected $api;\n\n    /**\n     * @var SearchConfig\n     */\n    protected $config;\n\n    public function __construct($indexName, ApiWrapperInterface $apiWrapper, SearchConfig $config)\n    {\n        $this->indexName = $indexName;\n        $this->api = $apiWrapper;\n        $this->config = $config;\n    }\n\n    public function getIndexName()\n    {\n        return $this->indexName;\n    }\n\n    public function getAppId()\n    {\n        return $this->config->getAppId();\n    }\n\n    public function search($query, $requestOptions = [])\n    {\n        $query = (string) $query;\n\n        if (is_array($requestOptions)) {\n            $requestOptions['query'] = $query;\n        } elseif ($requestOptions instanceof RequestOptions) {\n            $requestOptions->addBodyParameter('query', $query);\n        }\n\n        return $this->api->read('POST', api_path('/1/indexes/%s/query', $this->indexName), $requestOptions);\n    }\n\n    /**\n     * @deprecated Please use searchForFacetValues instead\n     */\n    public function searchForFacetValue($facetName, $facetQuery, $requestOptions = [])\n    {\n        return $this->searchForFacetValues($facetName, $facetQuery, $requestOptions);\n    }\n\n    public function searchForFacetValues($facetName, $facetQuery, $requestOptions = [])\n    {\n        if (is_array($requestOptions)) {\n            $requestOptions['facetQuery'] = $facetQuery;\n        } elseif ($requestOptions instanceof RequestOptions) {\n            $requestOptions->addBodyParameter('facetQuery', $facetQuery);\n        }\n\n        return $this->api->read(\n            'POST',\n            api_path('/1/indexes/%s/facets/%s/query', $this->indexName, $facetName),\n            $requestOptions\n        );\n    }\n\n    public function getSettings($requestOptions = [])\n    {\n        if (is_array($requestOptions)) {\n            $requestOptions['getVersion'] = 2;\n        } elseif ($requestOptions instanceof RequestOptions) {\n            $requestOptions->addQueryParameter('getVersion', 2);\n        }\n\n        return $this->api->read(\n            'GET',\n            api_path('/1/indexes/%s/settings', $this->indexName),\n            $requestOptions\n        );\n    }\n\n    public function setSettings($settings, $requestOptions = [])\n    {\n        $default = [];\n        if (is_bool($fwd = $this->config->getDefaultForwardToReplicas())) {\n            $default['forwardToReplicas'] = $fwd;\n        }\n\n        $response = $this->api->write(\n            'PUT',\n            api_path('/1/indexes/%s/settings', $this->indexName),\n            $settings,\n            $requestOptions,\n            $default\n        );\n\n        return new IndexingResponse($response, $this);\n    }\n\n    public function getObject($objectId, $requestOptions = [])\n    {\n        return $this->api->read(\n            'GET',\n            api_path('/1/indexes/%s/%s', $this->indexName, $objectId),\n            $requestOptions\n        );\n    }\n\n    public function getObjects($objectIds, $requestOptions = [])\n    {\n        if (is_array($requestOptions)) {\n            $attributesToRetrieve = '';\n            if (isset($requestOptions['attributesToRetrieve'])) {\n                $attributesToRetrieve = $requestOptions['attributesToRetrieve'];\n                unset($requestOptions['attributesToRetrieve']);\n            }\n\n            $request = [];\n            foreach ($objectIds as $id) {\n                $req = [\n                    'indexName' => $this->indexName,\n                    'objectID' => (string) $id,\n                ];\n\n                if ($attributesToRetrieve) {\n                    $req['attributesToRetrieve'] = $attributesToRetrieve;\n                }\n\n                $request[] = $req;\n            }\n\n            $requestOptions['requests'] = $request;\n        }\n\n        return $this->api->read(\n            'POST',\n            api_path('/1/indexes/*/objects'),\n            $requestOptions\n        );\n    }\n\n    public function saveObject($object, $requestOptions = [])\n    {\n        return $this->saveObjects([$object], $requestOptions);\n    }\n\n    public function saveObjects($objects, $requestOptions = [])\n    {\n        if (isset($requestOptions['autoGenerateObjectIDIfNotExist'])\n            && $requestOptions['autoGenerateObjectIDIfNotExist']) {\n            unset($requestOptions['autoGenerateObjectIDIfNotExist']);\n\n            return $this->addObjects($objects, $requestOptions);\n        }\n\n        if (isset($requestOptions['objectIDKey']) && $requestOptions['objectIDKey']) {\n            $objects = Helpers::mapObjectIDs($requestOptions['objectIDKey'], $objects);\n            unset($requestOptions['objectIDKey']);\n        }\n\n        try {\n            return $this->splitIntoBatches('updateObject', $objects, $requestOptions);\n        } catch (MissingObjectId $e) {\n            $message = \"\\nAll objects must have an unique objectID (like a primary key) to be valid.\\n\\n\";\n            $message .= \"If your batch has a unique identifier but isn't called objectID,\\n\";\n            $message .= \"you can map it automatically using `saveObjects(\\$objects, ['objectIDKey' => 'primary'])`\\n\\n\";\n            $message .= \"Algolia is also able to generate objectIDs automatically but *it's not recommended*.\\n\";\n            $message .= \"To do it, use `['autoGenerateObjectIDIfNotExist' => true] on the request options parameter`\\n\\n\";\n\n            throw new MissingObjectId($message);\n        }\n    }\n\n    protected function addObjects($objects, $requestOptions = [])\n    {\n        return $this->splitIntoBatches('addObject', $objects, $requestOptions);\n    }\n\n    public function partialUpdateObject($object, $requestOptions = [])\n    {\n        return $this->partialUpdateObjects([$object], $requestOptions);\n    }\n\n    public function partialUpdateObjects($objects, $requestOptions = [])\n    {\n        $action = 'partialUpdateObjectNoCreate';\n\n        if (isset($requestOptions['createIfNotExists']) && $requestOptions['createIfNotExists']) {\n            $action = 'partialUpdateObject';\n            unset($requestOptions['createIfNotExists']);\n        }\n\n        return $this->splitIntoBatches($action, $objects, $requestOptions);\n    }\n\n    public function replaceAllObjects($objects, $requestOptions = [])\n    {\n        $safe = isset($requestOptions['safe']) && $requestOptions['safe'];\n        unset($requestOptions['safe']);\n\n        $tmpName = $this->indexName.'_tmp_'.uniqid('php_', true);\n        $tmpIndex = new static($tmpName, $this->api, $this->config);\n\n        // Copy all index resources from production index\n        $copyResponse = $this->copyTo($tmpIndex->getIndexName(), [\n            'scope' => ['settings', 'synonyms', 'rules'],\n        ]);\n\n        if ($safe) {\n            $copyResponse->wait();\n        }\n\n        // Send records (batched automatically)\n        $batchResponse = $tmpIndex->saveObjects($objects, $requestOptions);\n\n        if ($safe) {\n            $batchResponse->wait();\n        }\n\n        // Move temporary index to production\n        $moveResponse = $this->moveFrom($tmpName);\n\n        if ($safe) {\n            $moveResponse->wait();\n        }\n\n        return new MultiResponse([$copyResponse, $batchResponse, $moveResponse]);\n    }\n\n    public function deleteObject($objectId, $requestOptions = [])\n    {\n        return $this->deleteObjects([$objectId], $requestOptions);\n    }\n\n    public function deleteObjects($objectIds, $requestOptions = [])\n    {\n        $objects = array_map(function ($id) {\n            return ['objectID' => $id];\n        }, $objectIds);\n\n        return $this->splitIntoBatches('deleteObject', $objects, $requestOptions);\n    }\n\n    public function deleteBy($filters, $requestOptions = [])\n    {\n        $response = $this->api->write(\n            'POST',\n            api_path('/1/indexes/%s/deleteByQuery', $this->indexName),\n            $filters,\n            $requestOptions\n        );\n\n        return new IndexingResponse($response, $this);\n    }\n\n    public function clearObjects($requestOptions = [])\n    {\n        $response = $this->api->write(\n            'POST',\n            api_path('/1/indexes/%s/clear', $this->indexName),\n            [],\n            $requestOptions\n        );\n\n        return new IndexingResponse($response, $this);\n    }\n\n    public function batch($requests, $requestOptions = [])\n    {\n        $response = $this->rawBatch($requests, $requestOptions);\n\n        return new IndexingResponse($response, $this);\n    }\n\n    protected function rawBatch($requests, $requestOptions = [])\n    {\n        return $this->api->write(\n            'POST',\n            api_path('/1/indexes/%s/batch', $this->indexName),\n            ['requests' => $requests],\n            $requestOptions\n        );\n    }\n\n    protected function splitIntoBatches($action, $objects, $requestOptions = [])\n    {\n        $allResponses = [];\n        $batch = [];\n        $batchSize = $this->config->getBatchSize();\n        $count = 0;\n\n        foreach ($objects as $object) {\n            $batch[] = $object;\n            $count++;\n\n            if ($count === $batchSize) {\n                if ('addObject' !== $action) {\n                    Helpers::ensureObjectID($batch, 'All objects must have an unique objectID (like a primary key) to be valid.');\n                }\n                $allResponses[] = $this->rawBatch(Helpers::buildBatch($batch, $action), $requestOptions);\n                $batch = [];\n                $count = 0;\n            }\n        }\n\n        if ('addObject' !== $action) {\n            Helpers::ensureObjectID($batch, 'All objects must have an unique objectID (like a primary key) to be valid.');\n        }\n\n        // If not calls were made previously, not objects are passed\n        // so we return a NullResponse\n        // If there are already responses and something left in the\n        // batch, we send it.\n        if (empty($allResponses) && empty($batch)) {\n            return new NullResponse();\n        } elseif (!empty($batch)) {\n            $allResponses[] = $this->rawBatch(Helpers::buildBatch($batch, $action), $requestOptions);\n        }\n\n        return new BatchIndexingResponse($allResponses, $this);\n    }\n\n    public function browseObjects($requestOptions = [])\n    {\n        return new ObjectIterator($this->indexName, $this->api, $requestOptions);\n    }\n\n    public function searchSynonyms($query, $requestOptions = [])\n    {\n        $query = (string) $query;\n\n        if (is_array($requestOptions)) {\n            $requestOptions['query'] = $query;\n        } elseif ($requestOptions instanceof RequestOptions) {\n            $requestOptions->addBodyParameter('query', $query);\n        }\n\n        return $this->api->read(\n            'POST',\n            api_path('/1/indexes/%s/synonyms/search', $this->indexName),\n            $requestOptions\n        );\n    }\n\n    public function getSynonym($objectId, $requestOptions = [])\n    {\n        return $this->api->read(\n            'GET',\n            api_path('/1/indexes/%s/synonyms/%s', $this->indexName, $objectId),\n            $requestOptions\n        );\n    }\n\n    public function saveSynonym($synonym, $requestOptions = [])\n    {\n        return $this->saveSynonyms([$synonym], $requestOptions);\n    }\n\n    public function saveSynonyms($synonyms, $requestOptions = [])\n    {\n        $default = [];\n        if (is_bool($fwd = $this->config->getDefaultForwardToReplicas())) {\n            $default['forwardToReplicas'] = $fwd;\n        }\n\n        if ($synonyms instanceof \\Iterator) {\n            $iteratedOver = [];\n            foreach ($synonyms as $r) {\n                $iteratedOver[] = $r;\n            }\n            $synonyms = $iteratedOver;\n        }\n\n        if (empty($synonyms)) {\n            return new NullResponse();\n        }\n\n        Helpers::ensureObjectID($synonyms, 'All synonyms must have an unique objectID to be valid');\n\n        $response = $this->api->write(\n            'POST',\n            api_path('/1/indexes/%s/synonyms/batch', $this->indexName),\n            $synonyms,\n            $requestOptions,\n            $default\n        );\n\n        return new IndexingResponse($response, $this);\n    }\n\n    public function replaceAllSynonyms($synonyms, $requestOptions = [])\n    {\n        if (is_array($requestOptions)) {\n            $requestOptions['replaceExistingSynonyms'] = true;\n        } elseif ($requestOptions instanceof RequestOptions) {\n            $requestOptions->addQueryParameter('replaceExistingSynonyms', true);\n        }\n\n        return $this->saveSynonyms($synonyms, $requestOptions);\n    }\n\n    public function deleteSynonym($objectId, $requestOptions = [])\n    {\n        $default = [];\n        if (is_bool($fwd = $this->config->getDefaultForwardToReplicas())) {\n            $default['forwardToReplicas'] = $fwd;\n        }\n\n        $response = $this->api->write(\n            'DELETE',\n            api_path('/1/indexes/%s/synonyms/%s', $this->indexName, $objectId),\n            [],\n            $requestOptions,\n            $default\n        );\n\n        return new IndexingResponse($response, $this);\n    }\n\n    public function clearSynonyms($requestOptions = [])\n    {\n        $default = [];\n        if (is_bool($fwd = $this->config->getDefaultForwardToReplicas())) {\n            $default['forwardToReplicas'] = $fwd;\n        }\n\n        $response = $this->api->write(\n            'POST',\n            api_path('/1/indexes/%s/synonyms/clear', $this->indexName),\n            [],\n            $requestOptions,\n            $default\n        );\n\n        return new IndexingResponse($response, $this);\n    }\n\n    public function browseSynonyms($requestOptions = [])\n    {\n        return new SynonymIterator($this->indexName, $this->api, $requestOptions);\n    }\n\n    public function searchRules($query, $requestOptions = [])\n    {\n        $query = (string) $query;\n\n        if (is_array($requestOptions)) {\n            $requestOptions['query'] = $query;\n        } elseif ($requestOptions instanceof RequestOptions) {\n            $requestOptions->addBodyParameter('query', $query);\n        }\n\n        return $this->api->read(\n            'POST',\n            api_path('/1/indexes/%s/rules/search', $this->indexName),\n            $requestOptions\n        );\n    }\n\n    public function getRule($objectId, $requestOptions = [])\n    {\n        return $this->api->read(\n            'GET',\n            api_path('/1/indexes/%s/rules/%s', $this->indexName, $objectId),\n            $requestOptions\n        );\n    }\n\n    public function saveRule($rule, $requestOptions = [])\n    {\n        return $this->saveRules([$rule], $requestOptions);\n    }\n\n    public function saveRules($rules, $requestOptions = [])\n    {\n        $default = [];\n        if (is_bool($fwd = $this->config->getDefaultForwardToReplicas())) {\n            $default['forwardToReplicas'] = $fwd;\n        }\n\n        if ($rules instanceof \\Iterator) {\n            $iteratedOver = [];\n            foreach ($rules as $r) {\n                $iteratedOver[] = $r;\n            }\n            $rules = $iteratedOver;\n        }\n\n        if (empty($rules)) {\n            return new NullResponse();\n        }\n\n        Helpers::ensureObjectID($rules, 'All rules must have an unique objectID to be valid');\n\n        /*\n         * If consequence `params` is an array without keys, we are going to remove it\n         * from the payload of the rule. Otherwise the transporter layer will serialize\n         * `params` to an empty array [] instead of an empty object {} making an invalid\n         * rule on the engine side.\n         */\n        foreach ($rules as $key => $rule) {\n            if (isset($rule['consequence']) && empty($rule['consequence']['params'])) {\n                unset($rules[$key]['consequence']['params']);\n            }\n        }\n\n        $response = $this->api->write(\n            'POST',\n            api_path('/1/indexes/%s/rules/batch', $this->indexName),\n            $rules,\n            $requestOptions,\n            $default\n        );\n\n        return new IndexingResponse($response, $this);\n    }\n\n    public function replaceAllRules($rules, $requestOptions = [])\n    {\n        if (is_array($requestOptions)) {\n            $requestOptions['clearExistingRules'] = true;\n        } elseif ($requestOptions instanceof RequestOptions) {\n            $requestOptions->addQueryParameter('clearExistingRules', true);\n        }\n\n        return $this->saveRules($rules, $requestOptions);\n    }\n\n    public function deleteRule($objectId, $requestOptions = [])\n    {\n        $default = [];\n        if (is_bool($fwd = $this->config->getDefaultForwardToReplicas())) {\n            $default['forwardToReplicas'] = $fwd;\n        }\n\n        $response = $this->api->write(\n            'DELETE',\n            api_path('/1/indexes/%s/rules/%s', $this->indexName, $objectId),\n            [],\n            $requestOptions,\n            $default\n        );\n\n        return new IndexingResponse($response, $this);\n    }\n\n    public function clearRules($requestOptions = [])\n    {\n        $default = [];\n        if (is_bool($fwd = $this->config->getDefaultForwardToReplicas())) {\n            $default['forwardToReplicas'] = $fwd;\n        }\n\n        $response = $this->api->write(\n            'POST',\n            api_path('/1/indexes/%s/rules/clear', $this->indexName),\n            [],\n            $requestOptions,\n            $default\n        );\n\n        return new IndexingResponse($response, $this);\n    }\n\n    public function browseRules($requestOptions = [])\n    {\n        return new RuleIterator($this->indexName, $this->api, $requestOptions);\n    }\n\n    public function getTask($taskId, $requestOptions = [])\n    {\n        if (!$taskId) {\n            throw new \\InvalidArgumentException('taskID cannot be empty');\n        }\n\n        return $this->api->read(\n            'GET',\n            api_path('/1/indexes/%s/task/%s', $this->indexName, $taskId),\n            $requestOptions\n        );\n    }\n\n    public function waitTask($taskId, $requestOptions = [])\n    {\n        $retry = 1;\n        $time = $this->config->getWaitTaskTimeBeforeRetry();\n\n        do {\n            $res = $this->getTask($taskId, $requestOptions);\n\n            if ('published' === $res['status']) {\n                return;\n            }\n\n            $retry++;\n            $factor = ceil($retry / 10);\n            usleep($factor * $time); // 0.1 second\n        } while (true);\n    }\n\n    public function custom($method, $path, $requestOptions = [], $hosts = null)\n    {\n        return $this->api->send($method, $path, $requestOptions, $hosts);\n    }\n\n    public function delete($requestOptions = [])\n    {\n        $response = $this->api->write(\n            'DELETE',\n            api_path('/1/indexes/%s', $this->indexName),\n            [],\n            $requestOptions\n        );\n\n        return new IndexingResponse($response, $this);\n    }\n\n    /**\n     * Check whether an index exists or not.\n     *\n     * @param array<string, int|string|array>|RequestOptions $requestOptions array of options or RequestOptions object\n     *\n     * @return bool\n     */\n    public function exists($requestOptions = [])\n    {\n        try {\n            $this->getSettings($requestOptions);\n        } catch (NotFoundException $exception) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Find object by the given $callback.\n     * Options can be passed in $requestOptions body:\n     *  - query (string): pass a query\n     *  - paginate (bool): choose if you want to iterate through all the\n     * documents (true) or only the first page (false). Default is true.\n     *\n     * Usage:\n     *\n     * $index->findObject(\n     *  function($object) { return $object['objectID'] === 'foo'; },\n     *  array(\n     *      'query' => 'bar',\n     *      'paginate' => false,\n     *      'hitsPerPage' => 50,\n     *  )\n     * );\n     *\n     * @param callable                                       $callback       The callback used to find the object\n     *                                                                       Takes an array as parameter and returns a boolean\n     * @param array<string, int|string|array>|RequestOptions $requestOptions array of options or RequestOptions object\n     *\n     * @return array<string, int|string|array>\n     *\n     * @throws ObjectNotFoundException\n     */\n    public function findObject($callback, $requestOptions = [])\n    {\n        $query = '';\n        $paginate = true;\n        $page = 0;\n        $requestOptionsFactory = new RequestOptionsFactory($this->config);\n\n        if (is_array($requestOptions)) {\n            if (array_key_exists('query', $requestOptions)) {\n                $query = $requestOptions['query'];\n                unset($requestOptions['query']);\n            }\n\n            if (array_key_exists('paginate', $requestOptions)) {\n                $paginate = $requestOptions['paginate'];\n                unset($requestOptions['paginate']);\n            }\n        }\n\n        $requestOptions = $requestOptionsFactory->create($requestOptions);\n\n        while (true) {\n            $requestOptions->addBodyParameter('page', $page);\n\n            $result = $this->search($query, $requestOptions);\n            foreach ($result['hits'] as $key => $hit) {\n                if ($callback($hit)) {\n                    return [\n                        'object' => $hit,\n                        'position' => $key,\n                        'page' => $page,\n                    ];\n                }\n            }\n\n            $hasNextPage = $page + 1 < $result['nbPages'];\n            if (!$paginate || !$hasNextPage) {\n                throw new ObjectNotFoundException('Object not found');\n            }\n\n            $page++;\n        }\n    }\n\n    /**\n     * Retrieve the given object position in a set of results.\n     *\n     * @param array<string, array|string|int> $result   The set of results you want to iterate in\n     * @param string                          $objectID The objectID you want to find\n     *\n     * @return int\n     */\n    public static function getObjectPosition($result, $objectID)\n    {\n        foreach ($result['hits'] as $key => $hit) {\n            if ($hit['objectID'] === $objectID) {\n                return $key;\n            }\n        }\n\n        return -1;\n    }\n\n    private function copyTo($tmpIndexName, $requestOptions = [])\n    {\n        $apiResponse = $this->api->write(\n            'POST',\n            api_path('/1/indexes/%s/operation', $this->indexName),\n            [\n                'operation' => 'copy',\n                'destination' => $tmpIndexName,\n            ],\n            $requestOptions\n        );\n\n        return new IndexingResponse($apiResponse, $this);\n    }\n\n    private function moveFrom($tmpIndexName, $requestOptions = [])\n    {\n        $apiResponse = $this->api->write(\n            'POST',\n            api_path('/1/indexes/%s/operation', $tmpIndexName),\n            [\n                'operation' => 'move',\n                'destination' => $this->indexName,\n            ],\n            $requestOptions\n        );\n\n        return new IndexingResponse($apiResponse, $this);\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Support/Helpers.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Support;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\MissingObjectId;\n\nfinal class Helpers\n{\n    /**\n     * Use this function to generate API path. It will ensure\n     * that all parameters are properly urlencoded.\n     * The function will not double encode if the params are\n     * already urlencoded\n     * Signature is the same `sprintf`.\n     *\n     * Examples:\n     *      - api_path('1/indexes/%s/search', $indexName)\n     *      - api_path('/1/indexes/%s/synonyms/%s', $indexName, $objectID)\n     *\n     * @param string $pathFormat\n     * @param mixed  $args\n     * @param mixed  $_\n     *\n     * @return mixed\n     */\n    public static function apiPath($pathFormat, $args = null, $_ = null)\n    {\n        $arguments = array_slice(func_get_args(), 1);\n        foreach ($arguments as &$arg) {\n            $arg = urlencode(urldecode($arg));\n        }\n        array_unshift($arguments, $pathFormat);\n\n        return call_user_func_array('sprintf', $arguments);\n    }\n\n    /**\n     * When building a query string, array values must be json_encoded.\n     * This function can be used to turn any array into a Algolia-valid query string.\n     *\n     * Do not use a typical implementation where ['key' => ['one', 'two']] is\n     * turned into key[1]=one&key[2]=two. Algolia will not understand key[x].\n     * It should be turned into key=['one','two'] (before being url_encoded).\n     *\n     * @return string The urlencoded query string to send to Algolia\n     */\n    public static function buildQuery(array $args)\n    {\n        if (!$args) {\n            return '';\n        }\n\n        $args = array_map(function ($value) {\n            if (is_array($value)) {\n                return json_encode($value);\n            } elseif (is_bool($value)) {\n                return $value ? 'true' : 'false';\n            } else {\n                return $value;\n            }\n        }, $args);\n\n        return http_build_query($args);\n    }\n\n    public static function buildBatch($items, $action)\n    {\n        return array_map(function ($item) use ($action) {\n            return [\n                'action' => $action,\n                'body' => $item,\n            ];\n        }, $items);\n    }\n\n    public static function ensureObjectID($objects, $message = 'ObjectID is required to add a record, a synonym or a query rule.')\n    {\n        // In case a single objects is passed\n        if (isset($objects['objectID'])) {\n            return;\n        }\n\n        // In case multiple objects are passed\n        foreach ($objects as $object) {\n            if (!isset($object['objectID']) && !isset($object['body']['objectID'])) {\n                throw new MissingObjectId($message);\n            }\n        }\n    }\n\n    /**\n     * Wrapper for json_decode that throws when an error occurs.\n     *\n     * This function is extracted from Guzzlehttp/Guzzle package which is not\n     * compatible with PHP 5.3 so the client cannot always use it.\n     *\n     * @param string $json  JSON data to parse\n     * @param bool   $assoc when true, returned objects will be converted\n     *                      into associative arrays\n     * @param int    $depth user specified recursion depth\n     *\n     * @return mixed\n     *\n     * @throws \\InvalidArgumentException if the JSON cannot be decoded\n     *\n     * @see http://www.php.net/manual/en/function.json-decode.php\n     */\n    public static function json_decode($json, $assoc = false, $depth = 512)\n    {\n        $data = \\json_decode($json, $assoc, $depth);\n        if (JSON_ERROR_NONE !== json_last_error()) {\n            throw new \\InvalidArgumentException(sprintf(<<<'EXCEPTION'\njson_decode_error: %s\ninput string: %s\nEXCEPTION, json_last_error_msg(), $json));\n        }\n\n        return $data;\n    }\n\n    public static function mapObjectIDs($objectIDKey, $objects)\n    {\n        return array_map(function ($object) use ($objectIDKey) {\n            if (!isset($object[$objectIDKey])) {\n                throw new MissingObjectId(\"At least one object is missing the required $objectIDKey key: \".json_encode($object));\n            }\n            $object['objectID'] = $object[$objectIDKey];\n\n            return $object;\n        }, $objects);\n    }\n\n    public static function serializeQueryParameters($parameters)\n    {\n        if (is_string($parameters)) {\n            return $parameters;\n        }\n\n        foreach ($parameters as $key => $value) {\n            if (is_array($value)) {\n                $parameters[$key] = json_encode($value, JSON_THROW_ON_ERROR);\n            }\n        }\n\n        return http_build_query($parameters);\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/Support/UserAgent.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Support;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Algolia;\n\nfinal class UserAgent\n{\n    private static $value;\n\n    private static $customSegments = [];\n\n    public static function get()\n    {\n        if (null === self::$value) {\n            self::$value = self::getComputedValue();\n        }\n\n        return self::$value;\n    }\n\n    public static function addCustomUserAgent($segment, $version)\n    {\n        self::$value = null;\n        self::$customSegments[trim($segment, ' ')] = trim($version, ' ');\n    }\n\n    private static function getComputedValue()\n    {\n        $ua = [];\n        $segments = array_merge(self::getDefaultSegments(), self::$customSegments);\n\n        foreach ($segments as $segment => $version) {\n            $ua[] = $segment.' ('.$version.')';\n        }\n\n        return implode('; ', $ua);\n    }\n\n    private static function getDefaultSegments()\n    {\n        $segments = [];\n\n        $segments['Algolia for PHP'] = Algolia::VERSION;\n        $segments['PHP'] = rtrim(str_replace(PHP_EXTRA_VERSION, '', PHP_VERSION), '-');\n        if (defined('HHVM_VERSION')) {\n            $segments['HHVM'] = HHVM_VERSION;\n        }\n        if (interface_exists('\\GuzzleHttp\\ClientInterface')) {\n            if (defined('\\GuzzleHttp\\ClientInterface::VERSION')) {\n                $segments['Guzzle'] = \\GuzzleHttp\\ClientInterface::VERSION;\n            } else {\n                $segments['Guzzle'] = \\GuzzleHttp\\ClientInterface::MAJOR_VERSION;\n            }\n        }\n\n        return $segments;\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/algolia/algoliasearch-client-php/src/functions.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch;\n\nuse WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Support\\Helpers;\n\nfunction api_path($pathFormat, $args = null, $_ = null)\n{\n    return call_user_func_array([Helpers::class, 'apiPath'], func_get_args());\n}\n"
  },
  {
    "path": "vendor_prefixed/autoload-classmap.php",
    "content": "<?php\n\n// autoload-classmap.php @generated by Strauss\n\n$vendorprefixed = dirname(__FILE__);\n\nreturn array(\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Algolia' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Algolia.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Insights\\UserInsightsClient' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Insights/UserInsightsClient.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions\\RequestOptionsFactory' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/RequestOptions/RequestOptionsFactory.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RequestOptions\\RequestOptions' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/RequestOptions/RequestOptions.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\IndexingResponse' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Response/IndexingResponse.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\MultiResponse' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Response/MultiResponse.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\DictionaryResponse' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Response/DictionaryResponse.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\RestoreApiKeyResponse' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Response/RestoreApiKeyResponse.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\BatchIndexingResponse' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Response/BatchIndexingResponse.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\AbstractResponse' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Response/AbstractResponse.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\MultipleIndexBatchIndexingResponse' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Response/MultipleIndexBatchIndexingResponse.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\DeleteApiKeyResponse' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Response/DeleteApiKeyResponse.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\AddApiKeyResponse' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Response/AddApiKeyResponse.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\UpdateApiKeyResponse' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Response/UpdateApiKeyResponse.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Response\\NullResponse' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Response/NullResponse.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Cache\\NullCacheDriver' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Cache/NullCacheDriver.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Cache\\FileCacheDriver' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Cache/FileCacheDriver.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchIndex' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/SearchIndex.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\RecommendationConfig' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Config/RecommendationConfig.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\SearchConfig' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Config/SearchConfig.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\PersonalizationConfig' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Config/PersonalizationConfig.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\AbstractConfig' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Config/AbstractConfig.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\PlacesConfig' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Config/PlacesConfig.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\RecommendConfig' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Config/RecommendConfig.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\InsightsConfig' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Config/InsightsConfig.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Config\\AnalyticsConfig' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Config/AnalyticsConfig.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\PlacesClient' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/PlacesClient.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\InsightsClient' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/InsightsClient.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RecommendClient' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/RecommendClient.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\AccountClient' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/AccountClient.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\Host' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/RetryStrategy/Host.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\HostCollection' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/RetryStrategy/HostCollection.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ClusterHosts' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/RetryStrategy/ClusterHosts.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ApiWrapperInterface' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/RetryStrategy/ApiWrapperInterface.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RetryStrategy\\ApiWrapper' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/RetryStrategy/ApiWrapper.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\AnalyticsClient' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/AnalyticsClient.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\CannotWaitException' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Exceptions/CannotWaitException.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\UnreachableException' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Exceptions/UnreachableException.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\NotFoundException' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Exceptions/NotFoundException.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\RetriableException' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Exceptions/RetriableException.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\ValidUntilNotFoundException' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Exceptions/ValidUntilNotFoundException.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\MissingObjectId' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Exceptions/MissingObjectId.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\BadRequestException' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Exceptions/BadRequestException.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\ObjectNotFoundException' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Exceptions/ObjectNotFoundException.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\AlgoliaException' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Exceptions/AlgoliaException.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Exceptions\\RequestException' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Exceptions/RequestException.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Support\\Helpers' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Support/Helpers.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Support\\UserAgent' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Support/UserAgent.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\HttpClientInterface' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Http/HttpClientInterface.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\CurlHttpClient' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Http/CurlHttpClient.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\GuzzleHttpClient' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Http/GuzzleHttpClient.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\Psr7\\PumpStream' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Http/Psr7/PumpStream.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\Psr7\\Response' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Http/Psr7/Response.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\Psr7\\Stream' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Http/Psr7/Stream.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\Psr7\\Request' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Http/Psr7/Request.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\Psr7\\BufferStream' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Http/Psr7/BufferStream.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\Psr7\\Uri' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Http/Psr7/Uri.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Http\\Psr7\\UriResolver' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Http/Psr7/UriResolver.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Log\\DebugLogger' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Log/DebugLogger.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\RecommendationClient' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/RecommendationClient.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\PersonalizationClient' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/PersonalizationClient.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\SearchClient' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/SearchClient.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Iterators\\SynonymIterator' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Iterators/SynonymIterator.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Iterators\\AbstractAlgoliaIterator' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Iterators/AbstractAlgoliaIterator.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Iterators\\RuleIterator' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Iterators/RuleIterator.php',\n   'WebDevStudios\\WPSWA\\Algolia\\AlgoliaSearch\\Iterators\\ObjectIterator' => $vendorprefixed . '/algolia/algoliasearch-client-php/src/Iterators/ObjectIterator.php',\n   'WebDevStudios\\WPSWA\\Psr\\Http\\Message\\ServerRequestInterface' => $vendorprefixed . '/psr/http-message/src/ServerRequestInterface.php',\n   'WebDevStudios\\WPSWA\\Psr\\Http\\Message\\UriInterface' => $vendorprefixed . '/psr/http-message/src/UriInterface.php',\n   'WebDevStudios\\WPSWA\\Psr\\Http\\Message\\StreamInterface' => $vendorprefixed . '/psr/http-message/src/StreamInterface.php',\n   'WebDevStudios\\WPSWA\\Psr\\Http\\Message\\UploadedFileInterface' => $vendorprefixed . '/psr/http-message/src/UploadedFileInterface.php',\n   'WebDevStudios\\WPSWA\\Psr\\Http\\Message\\RequestInterface' => $vendorprefixed . '/psr/http-message/src/RequestInterface.php',\n   'WebDevStudios\\WPSWA\\Psr\\Http\\Message\\ResponseInterface' => $vendorprefixed . '/psr/http-message/src/ResponseInterface.php',\n   'WebDevStudios\\WPSWA\\Psr\\Http\\Message\\MessageInterface' => $vendorprefixed . '/psr/http-message/src/MessageInterface.php',\n   'WebDevStudios\\WPSWA\\Psr\\Log\\LoggerAwareInterface' => $vendorprefixed . '/psr/log/Psr/Log/LoggerAwareInterface.php',\n   'WebDevStudios\\WPSWA\\Psr\\Log\\LogLevel' => $vendorprefixed . '/psr/log/Psr/Log/LogLevel.php',\n   'WebDevStudios\\WPSWA\\Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorprefixed . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',\n   'WebDevStudios\\WPSWA\\Psr\\Log\\Test\\TestLogger' => $vendorprefixed . '/psr/log/Psr/Log/Test/TestLogger.php',\n   'WebDevStudios\\WPSWA\\Psr\\Log\\Test\\DummyTest' => $vendorprefixed . '/psr/log/Psr/Log/Test/DummyTest.php',\n   'WebDevStudios\\WPSWA\\Psr\\Log\\LoggerAwareTrait' => $vendorprefixed . '/psr/log/Psr/Log/LoggerAwareTrait.php',\n   'WebDevStudios\\WPSWA\\Psr\\Log\\InvalidArgumentException' => $vendorprefixed . '/psr/log/Psr/Log/InvalidArgumentException.php',\n   'WebDevStudios\\WPSWA\\Psr\\Log\\NullLogger' => $vendorprefixed . '/psr/log/Psr/Log/NullLogger.php',\n   'WebDevStudios\\WPSWA\\Psr\\Log\\LoggerInterface' => $vendorprefixed . '/psr/log/Psr/Log/LoggerInterface.php',\n   'WebDevStudios\\WPSWA\\Psr\\Log\\LoggerTrait' => $vendorprefixed . '/psr/log/Psr/Log/LoggerTrait.php',\n   'WebDevStudios\\WPSWA\\Psr\\Log\\AbstractLogger' => $vendorprefixed . '/psr/log/Psr/Log/AbstractLogger.php',\n   'WebDevStudios\\WPSWA\\Psr\\SimpleCache\\CacheInterface' => $vendorprefixed . '/psr/simple-cache/src/CacheInterface.php',\n   'WebDevStudios\\WPSWA\\Psr\\SimpleCache\\InvalidArgumentException' => $vendorprefixed . '/psr/simple-cache/src/InvalidArgumentException.php',\n   'WebDevStudios\\WPSWA\\Psr\\SimpleCache\\CacheException' => $vendorprefixed . '/psr/simple-cache/src/CacheException.php',\n);"
  },
  {
    "path": "vendor_prefixed/autoload-files.php",
    "content": "<?php\n\n// autoload-files.php @generated by Strauss\n// @see https://github.com/BrianHenryIE/strauss/\n\nrequire_once __DIR__ . '/algolia/algoliasearch-client-php/src/Http/Psr7/functions.php';\nrequire_once __DIR__ . '/algolia/algoliasearch-client-php/src/functions.php';\n"
  },
  {
    "path": "vendor_prefixed/autoload.php",
    "content": "<?php\n// autoload.php @generated by Strauss\n\nif ( file_exists( __DIR__ . '/autoload-classmap.php' ) ) {\n    $class_map = include __DIR__ . '/autoload-classmap.php';\n    if ( is_array( $class_map ) ) {\n        spl_autoload_register(\n            function ( $classname ) use ( $class_map ) {\n                if ( isset( $class_map[ $classname ] ) && file_exists( $class_map[ $classname ] ) ) {\n                    require_once $class_map[ $classname ];\n                }\n            }\n        );\n    }\n    unset( $class_map );\n}\n\nif ( file_exists( __DIR__ . '/autoload-files.php' ) ) {\n    require_once __DIR__ . '/autoload-files.php';\n}"
  },
  {
    "path": "vendor_prefixed/psr/http-message/LICENSE",
    "content": "Copyright (c) 2014 PHP Framework Interoperability Group\n\nPermission is hereby granted, free of charge, to any person obtaining a copy \nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights \nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell \ncopies of the Software, and to permit persons to whom the Software is \nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in \nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "vendor_prefixed/psr/http-message/src/MessageInterface.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\ndeclare(strict_types=1);\n\nnamespace WebDevStudios\\WPSWA\\Psr\\Http\\Message;\n\n/**\n * HTTP messages consist of requests from a client to a server and responses\n * from a server to a client. This interface defines the methods common to\n * each.\n *\n * Messages are considered immutable; all methods that might change state MUST\n * be implemented such that they retain the internal state of the current\n * message and return an instance that contains the changed state.\n *\n * @link http://www.ietf.org/rfc/rfc7230.txt\n * @link http://www.ietf.org/rfc/rfc7231.txt\n */\ninterface MessageInterface\n{\n    /**\n     * Retrieves the HTTP protocol version as a string.\n     *\n     * The string MUST contain only the HTTP version number (e.g., \"1.1\", \"1.0\").\n     *\n     * @return string HTTP protocol version.\n     */\n    public function getProtocolVersion();\n\n    /**\n     * Return an instance with the specified HTTP protocol version.\n     *\n     * The version string MUST contain only the HTTP version number (e.g.,\n     * \"1.1\", \"1.0\").\n     *\n     * This method MUST be implemented in such a way as to retain the\n     * immutability of the message, and MUST return an instance that has the\n     * new protocol version.\n     *\n     * @param string $version HTTP protocol version\n     * @return static\n     */\n    public function withProtocolVersion(string $version);\n\n    /**\n     * Retrieves all message header values.\n     *\n     * The keys represent the header name as it will be sent over the wire, and\n     * each value is an array of strings associated with the header.\n     *\n     *     // Represent the headers as a string\n     *     foreach ($message->getHeaders() as $name => $values) {\n     *         echo $name . \": \" . implode(\", \", $values);\n     *     }\n     *\n     *     // Emit headers iteratively:\n     *     foreach ($message->getHeaders() as $name => $values) {\n     *         foreach ($values as $value) {\n     *             header(sprintf('%s: %s', $name, $value), false);\n     *         }\n     *     }\n     *\n     * While header names are not case-sensitive, getHeaders() will preserve the\n     * exact case in which headers were originally specified.\n     *\n     * @return string[][] Returns an associative array of the message's headers. Each\n     *     key MUST be a header name, and each value MUST be an array of strings\n     *     for that header.\n     */\n    public function getHeaders();\n\n    /**\n     * Checks if a header exists by the given case-insensitive name.\n     *\n     * @param string $name Case-insensitive header field name.\n     * @return bool Returns true if any header names match the given header\n     *     name using a case-insensitive string comparison. Returns false if\n     *     no matching header name is found in the message.\n     */\n    public function hasHeader(string $name);\n\n    /**\n     * Retrieves a message header value by the given case-insensitive name.\n     *\n     * This method returns an array of all the header values of the given\n     * case-insensitive header name.\n     *\n     * If the header does not appear in the message, this method MUST return an\n     * empty array.\n     *\n     * @param string $name Case-insensitive header field name.\n     * @return string[] An array of string values as provided for the given\n     *    header. If the header does not appear in the message, this method MUST\n     *    return an empty array.\n     */\n    public function getHeader(string $name);\n\n    /**\n     * Retrieves a comma-separated string of the values for a single header.\n     *\n     * This method returns all of the header values of the given\n     * case-insensitive header name as a string concatenated together using\n     * a comma.\n     *\n     * NOTE: Not all header values may be appropriately represented using\n     * comma concatenation. For such headers, use getHeader() instead\n     * and supply your own delimiter when concatenating.\n     *\n     * If the header does not appear in the message, this method MUST return\n     * an empty string.\n     *\n     * @param string $name Case-insensitive header field name.\n     * @return string A string of values as provided for the given header\n     *    concatenated together using a comma. If the header does not appear in\n     *    the message, this method MUST return an empty string.\n     */\n    public function getHeaderLine(string $name);\n\n    /**\n     * Return an instance with the provided value replacing the specified header.\n     *\n     * While header names are case-insensitive, the casing of the header will\n     * be preserved by this function, and returned from getHeaders().\n     *\n     * This method MUST be implemented in such a way as to retain the\n     * immutability of the message, and MUST return an instance that has the\n     * new and/or updated header and value.\n     *\n     * @param string $name Case-insensitive header field name.\n     * @param string|string[] $value Header value(s).\n     * @return static\n     * @throws \\InvalidArgumentException for invalid header names or values.\n     */\n    public function withHeader(string $name, $value);\n\n    /**\n     * Return an instance with the specified header appended with the given value.\n     *\n     * Existing values for the specified header will be maintained. The new\n     * value(s) will be appended to the existing list. If the header did not\n     * exist previously, it will be added.\n     *\n     * This method MUST be implemented in such a way as to retain the\n     * immutability of the message, and MUST return an instance that has the\n     * new header and/or value.\n     *\n     * @param string $name Case-insensitive header field name to add.\n     * @param string|string[] $value Header value(s).\n     * @return static\n     * @throws \\InvalidArgumentException for invalid header names or values.\n     */\n    public function withAddedHeader(string $name, $value);\n\n    /**\n     * Return an instance without the specified header.\n     *\n     * Header resolution MUST be done without case-sensitivity.\n     *\n     * This method MUST be implemented in such a way as to retain the\n     * immutability of the message, and MUST return an instance that removes\n     * the named header.\n     *\n     * @param string $name Case-insensitive header field name to remove.\n     * @return static\n     */\n    public function withoutHeader(string $name);\n\n    /**\n     * Gets the body of the message.\n     *\n     * @return StreamInterface Returns the body as a stream.\n     */\n    public function getBody();\n\n    /**\n     * Return an instance with the specified message body.\n     *\n     * The body MUST be a StreamInterface object.\n     *\n     * This method MUST be implemented in such a way as to retain the\n     * immutability of the message, and MUST return a new instance that has the\n     * new body stream.\n     *\n     * @param StreamInterface $body Body.\n     * @return static\n     * @throws \\InvalidArgumentException When the body is not valid.\n     */\n    public function withBody(StreamInterface $body);\n}\n"
  },
  {
    "path": "vendor_prefixed/psr/http-message/src/RequestInterface.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\ndeclare(strict_types=1);\n\nnamespace WebDevStudios\\WPSWA\\Psr\\Http\\Message;\n\n/**\n * Representation of an outgoing, client-side request.\n *\n * Per the HTTP specification, this interface includes properties for\n * each of the following:\n *\n * - Protocol version\n * - HTTP method\n * - URI\n * - Headers\n * - Message body\n *\n * During construction, implementations MUST attempt to set the Host header from\n * a provided URI if no Host header is provided.\n *\n * Requests are considered immutable; all methods that might change state MUST\n * be implemented such that they retain the internal state of the current\n * message and return an instance that contains the changed state.\n */\ninterface RequestInterface extends MessageInterface\n{\n    /**\n     * Retrieves the message's request target.\n     *\n     * Retrieves the message's request-target either as it will appear (for\n     * clients), as it appeared at request (for servers), or as it was\n     * specified for the instance (see withRequestTarget()).\n     *\n     * In most cases, this will be the origin-form of the composed URI,\n     * unless a value was provided to the concrete implementation (see\n     * withRequestTarget() below).\n     *\n     * If no URI is available, and no request-target has been specifically\n     * provided, this method MUST return the string \"/\".\n     *\n     * @return string\n     */\n    public function getRequestTarget();\n\n    /**\n     * Return an instance with the specific request-target.\n     *\n     * If the request needs a non-origin-form request-target — e.g., for\n     * specifying an absolute-form, authority-form, or asterisk-form —\n     * this method may be used to create an instance with the specified\n     * request-target, verbatim.\n     *\n     * This method MUST be implemented in such a way as to retain the\n     * immutability of the message, and MUST return an instance that has the\n     * changed request target.\n     *\n     * @link http://tools.ietf.org/html/rfc7230#section-5.3 (for the various\n     *     request-target forms allowed in request messages)\n     * @param string $requestTarget\n     * @return static\n     */\n    public function withRequestTarget(string $requestTarget);\n\n    /**\n     * Retrieves the HTTP method of the request.\n     *\n     * @return string Returns the request method.\n     */\n    public function getMethod();\n\n    /**\n     * Return an instance with the provided HTTP method.\n     *\n     * While HTTP method names are typically all uppercase characters, HTTP\n     * method names are case-sensitive and thus implementations SHOULD NOT\n     * modify the given string.\n     *\n     * This method MUST be implemented in such a way as to retain the\n     * immutability of the message, and MUST return an instance that has the\n     * changed request method.\n     *\n     * @param string $method Case-sensitive method.\n     * @return static\n     * @throws \\InvalidArgumentException for invalid HTTP methods.\n     */\n    public function withMethod(string $method);\n\n    /**\n     * Retrieves the URI instance.\n     *\n     * This method MUST return a UriInterface instance.\n     *\n     * @link http://tools.ietf.org/html/rfc3986#section-4.3\n     * @return UriInterface Returns a UriInterface instance\n     *     representing the URI of the request.\n     */\n    public function getUri();\n\n    /**\n     * Returns an instance with the provided URI.\n     *\n     * This method MUST update the Host header of the returned request by\n     * default if the URI contains a host component. If the URI does not\n     * contain a host component, any pre-existing Host header MUST be carried\n     * over to the returned request.\n     *\n     * You can opt-in to preserving the original state of the Host header by\n     * setting `$preserveHost` to `true`. When `$preserveHost` is set to\n     * `true`, this method interacts with the Host header in the following ways:\n     *\n     * - If the Host header is missing or empty, and the new URI contains\n     *   a host component, this method MUST update the Host header in the returned\n     *   request.\n     * - If the Host header is missing or empty, and the new URI does not contain a\n     *   host component, this method MUST NOT update the Host header in the returned\n     *   request.\n     * - If a Host header is present and non-empty, this method MUST NOT update\n     *   the Host header in the returned request.\n     *\n     * This method MUST be implemented in such a way as to retain the\n     * immutability of the message, and MUST return an instance that has the\n     * new UriInterface instance.\n     *\n     * @link http://tools.ietf.org/html/rfc3986#section-4.3\n     * @param UriInterface $uri New request URI to use.\n     * @param bool $preserveHost Preserve the original state of the Host header.\n     * @return static\n     */\n    public function withUri(UriInterface $uri, bool $preserveHost = false);\n}\n"
  },
  {
    "path": "vendor_prefixed/psr/http-message/src/ResponseInterface.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\ndeclare(strict_types=1);\n\nnamespace WebDevStudios\\WPSWA\\Psr\\Http\\Message;\n\n/**\n * Representation of an outgoing, server-side response.\n *\n * Per the HTTP specification, this interface includes properties for\n * each of the following:\n *\n * - Protocol version\n * - Status code and reason phrase\n * - Headers\n * - Message body\n *\n * Responses are considered immutable; all methods that might change state MUST\n * be implemented such that they retain the internal state of the current\n * message and return an instance that contains the changed state.\n */\ninterface ResponseInterface extends MessageInterface\n{\n    /**\n     * Gets the response status code.\n     *\n     * The status code is a 3-digit integer result code of the server's attempt\n     * to understand and satisfy the request.\n     *\n     * @return int Status code.\n     */\n    public function getStatusCode();\n\n    /**\n     * Return an instance with the specified status code and, optionally, reason phrase.\n     *\n     * If no reason phrase is specified, implementations MAY choose to default\n     * to the RFC 7231 or IANA recommended reason phrase for the response's\n     * status code.\n     *\n     * This method MUST be implemented in such a way as to retain the\n     * immutability of the message, and MUST return an instance that has the\n     * updated status and reason phrase.\n     *\n     * @link http://tools.ietf.org/html/rfc7231#section-6\n     * @link http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml\n     * @param int $code The 3-digit integer result code to set.\n     * @param string $reasonPhrase The reason phrase to use with the\n     *     provided status code; if none is provided, implementations MAY\n     *     use the defaults as suggested in the HTTP specification.\n     * @return static\n     * @throws \\InvalidArgumentException For invalid status code arguments.\n     */\n    public function withStatus(int $code, string $reasonPhrase = '');\n\n    /**\n     * Gets the response reason phrase associated with the status code.\n     *\n     * Because a reason phrase is not a required element in a response\n     * status line, the reason phrase value MAY be null. Implementations MAY\n     * choose to return the default RFC 7231 recommended reason phrase (or those\n     * listed in the IANA HTTP Status Code Registry) for the response's\n     * status code.\n     *\n     * @link http://tools.ietf.org/html/rfc7231#section-6\n     * @link http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml\n     * @return string Reason phrase; must return an empty string if none present.\n     */\n    public function getReasonPhrase();\n}\n"
  },
  {
    "path": "vendor_prefixed/psr/http-message/src/ServerRequestInterface.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\ndeclare(strict_types=1);\n\nnamespace WebDevStudios\\WPSWA\\Psr\\Http\\Message;\n\n/**\n * Representation of an incoming, server-side HTTP request.\n *\n * Per the HTTP specification, this interface includes properties for\n * each of the following:\n *\n * - Protocol version\n * - HTTP method\n * - URI\n * - Headers\n * - Message body\n *\n * Additionally, it encapsulates all data as it has arrived to the\n * application from the CGI and/or PHP environment, including:\n *\n * - The values represented in $_SERVER.\n * - Any cookies provided (generally via $_COOKIE)\n * - Query string arguments (generally via $_GET, or as parsed via parse_str())\n * - Upload files, if any (as represented by $_FILES)\n * - Deserialized body parameters (generally from $_POST)\n *\n * $_SERVER values MUST be treated as immutable, as they represent application\n * state at the time of request; as such, no methods are provided to allow\n * modification of those values. The other values provide such methods, as they\n * can be restored from $_SERVER or the request body, and may need treatment\n * during the application (e.g., body parameters may be deserialized based on\n * content type).\n *\n * Additionally, this interface recognizes the utility of introspecting a\n * request to derive and match additional parameters (e.g., via URI path\n * matching, decrypting cookie values, deserializing non-form-encoded body\n * content, matching authorization headers to users, etc). These parameters\n * are stored in an \"attributes\" property.\n *\n * Requests are considered immutable; all methods that might change state MUST\n * be implemented such that they retain the internal state of the current\n * message and return an instance that contains the changed state.\n */\ninterface ServerRequestInterface extends RequestInterface\n{\n    /**\n     * Retrieve server parameters.\n     *\n     * Retrieves data related to the incoming request environment,\n     * typically derived from PHP's $_SERVER superglobal. The data IS NOT\n     * REQUIRED to originate from $_SERVER.\n     *\n     * @return array\n     */\n    public function getServerParams();\n\n    /**\n     * Retrieve cookies.\n     *\n     * Retrieves cookies sent by the client to the server.\n     *\n     * The data MUST be compatible with the structure of the $_COOKIE\n     * superglobal.\n     *\n     * @return array\n     */\n    public function getCookieParams();\n\n    /**\n     * Return an instance with the specified cookies.\n     *\n     * The data IS NOT REQUIRED to come from the $_COOKIE superglobal, but MUST\n     * be compatible with the structure of $_COOKIE. Typically, this data will\n     * be injected at instantiation.\n     *\n     * This method MUST NOT update the related Cookie header of the request\n     * instance, nor related values in the server params.\n     *\n     * This method MUST be implemented in such a way as to retain the\n     * immutability of the message, and MUST return an instance that has the\n     * updated cookie values.\n     *\n     * @param array $cookies Array of key/value pairs representing cookies.\n     * @return static\n     */\n    public function withCookieParams(array $cookies);\n\n    /**\n     * Retrieve query string arguments.\n     *\n     * Retrieves the deserialized query string arguments, if any.\n     *\n     * Note: the query params might not be in sync with the URI or server\n     * params. If you need to ensure you are only getting the original\n     * values, you may need to parse the query string from `getUri()->getQuery()`\n     * or from the `QUERY_STRING` server param.\n     *\n     * @return array\n     */\n    public function getQueryParams();\n\n    /**\n     * Return an instance with the specified query string arguments.\n     *\n     * These values SHOULD remain immutable over the course of the incoming\n     * request. They MAY be injected during instantiation, such as from PHP's\n     * $_GET superglobal, or MAY be derived from some other value such as the\n     * URI. In cases where the arguments are parsed from the URI, the data\n     * MUST be compatible with what PHP's parse_str() would return for\n     * purposes of how duplicate query parameters are handled, and how nested\n     * sets are handled.\n     *\n     * Setting query string arguments MUST NOT change the URI stored by the\n     * request, nor the values in the server params.\n     *\n     * This method MUST be implemented in such a way as to retain the\n     * immutability of the message, and MUST return an instance that has the\n     * updated query string arguments.\n     *\n     * @param array $query Array of query string arguments, typically from\n     *     $_GET.\n     * @return static\n     */\n    public function withQueryParams(array $query);\n\n    /**\n     * Retrieve normalized file upload data.\n     *\n     * This method returns upload metadata in a normalized tree, with each leaf\n     * an instance of Psr\\Http\\Message\\UploadedFileInterface.\n     *\n     * These values MAY be prepared from $_FILES or the message body during\n     * instantiation, or MAY be injected via withUploadedFiles().\n     *\n     * @return array An array tree of UploadedFileInterface instances; an empty\n     *     array MUST be returned if no data is present.\n     */\n    public function getUploadedFiles();\n\n    /**\n     * Create a new instance with the specified uploaded files.\n     *\n     * This method MUST be implemented in such a way as to retain the\n     * immutability of the message, and MUST return an instance that has the\n     * updated body parameters.\n     *\n     * @param array $uploadedFiles An array tree of UploadedFileInterface instances.\n     * @return static\n     * @throws \\InvalidArgumentException if an invalid structure is provided.\n     */\n    public function withUploadedFiles(array $uploadedFiles);\n\n    /**\n     * Retrieve any parameters provided in the request body.\n     *\n     * If the request Content-Type is either application/x-www-form-urlencoded\n     * or multipart/form-data, and the request method is POST, this method MUST\n     * return the contents of $_POST.\n     *\n     * Otherwise, this method may return any results of deserializing\n     * the request body content; as parsing returns structured content, the\n     * potential types MUST be arrays or objects only. A null value indicates\n     * the absence of body content.\n     *\n     * @return null|array|object The deserialized body parameters, if any.\n     *     These will typically be an array or object.\n     */\n    public function getParsedBody();\n\n    /**\n     * Return an instance with the specified body parameters.\n     *\n     * These MAY be injected during instantiation.\n     *\n     * If the request Content-Type is either application/x-www-form-urlencoded\n     * or multipart/form-data, and the request method is POST, use this method\n     * ONLY to inject the contents of $_POST.\n     *\n     * The data IS NOT REQUIRED to come from $_POST, but MUST be the results of\n     * deserializing the request body content. Deserialization/parsing returns\n     * structured data, and, as such, this method ONLY accepts arrays or objects,\n     * or a null value if nothing was available to parse.\n     *\n     * As an example, if content negotiation determines that the request data\n     * is a JSON payload, this method could be used to create a request\n     * instance with the deserialized parameters.\n     *\n     * This method MUST be implemented in such a way as to retain the\n     * immutability of the message, and MUST return an instance that has the\n     * updated body parameters.\n     *\n     * @param null|array|object $data The deserialized body data. This will\n     *     typically be in an array or object.\n     * @return static\n     * @throws \\InvalidArgumentException if an unsupported argument type is\n     *     provided.\n     */\n    public function withParsedBody($data);\n\n    /**\n     * Retrieve attributes derived from the request.\n     *\n     * The request \"attributes\" may be used to allow injection of any\n     * parameters derived from the request: e.g., the results of path\n     * match operations; the results of decrypting cookies; the results of\n     * deserializing non-form-encoded message bodies; etc. Attributes\n     * will be application and request specific, and CAN be mutable.\n     *\n     * @return array Attributes derived from the request.\n     */\n    public function getAttributes();\n\n    /**\n     * Retrieve a single derived request attribute.\n     *\n     * Retrieves a single derived request attribute as described in\n     * getAttributes(). If the attribute has not been previously set, returns\n     * the default value as provided.\n     *\n     * This method obviates the need for a hasAttribute() method, as it allows\n     * specifying a default value to return if the attribute is not found.\n     *\n     * @see getAttributes()\n     * @param string $name The attribute name.\n     * @param mixed $default Default value to return if the attribute does not exist.\n     * @return mixed\n     */\n    public function getAttribute(string $name, $default = null);\n\n    /**\n     * Return an instance with the specified derived request attribute.\n     *\n     * This method allows setting a single derived request attribute as\n     * described in getAttributes().\n     *\n     * This method MUST be implemented in such a way as to retain the\n     * immutability of the message, and MUST return an instance that has the\n     * updated attribute.\n     *\n     * @see getAttributes()\n     * @param string $name The attribute name.\n     * @param mixed $value The value of the attribute.\n     * @return static\n     */\n    public function withAttribute(string $name, $value);\n\n    /**\n     * Return an instance that removes the specified derived request attribute.\n     *\n     * This method allows removing a single derived request attribute as\n     * described in getAttributes().\n     *\n     * This method MUST be implemented in such a way as to retain the\n     * immutability of the message, and MUST return an instance that removes\n     * the attribute.\n     *\n     * @see getAttributes()\n     * @param string $name The attribute name.\n     * @return static\n     */\n    public function withoutAttribute(string $name);\n}\n"
  },
  {
    "path": "vendor_prefixed/psr/http-message/src/StreamInterface.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\ndeclare(strict_types=1);\n\nnamespace WebDevStudios\\WPSWA\\Psr\\Http\\Message;\n\n/**\n * Describes a data stream.\n *\n * Typically, an instance will wrap a PHP stream; this interface provides\n * a wrapper around the most common operations, including serialization of\n * the entire stream to a string.\n */\ninterface StreamInterface\n{\n    /**\n     * Reads all data from the stream into a string, from the beginning to end.\n     *\n     * This method MUST attempt to seek to the beginning of the stream before\n     * reading data and read the stream until the end is reached.\n     *\n     * Warning: This could attempt to load a large amount of data into memory.\n     *\n     * This method MUST NOT raise an exception in order to conform with PHP's\n     * string casting operations.\n     *\n     * @see http://php.net/manual/en/language.oop5.magic.php#object.tostring\n     * @return string\n     */\n    public function __toString();\n\n    /**\n     * Closes the stream and any underlying resources.\n     *\n     * @return void\n     */\n    public function close();\n\n    /**\n     * Separates any underlying resources from the stream.\n     *\n     * After the stream has been detached, the stream is in an unusable state.\n     *\n     * @return resource|null Underlying PHP stream, if any\n     */\n    public function detach();\n\n    /**\n     * Get the size of the stream if known.\n     *\n     * @return int|null Returns the size in bytes if known, or null if unknown.\n     */\n    public function getSize();\n\n    /**\n     * Returns the current position of the file read/write pointer\n     *\n     * @return int Position of the file pointer\n     * @throws \\RuntimeException on error.\n     */\n    public function tell();\n\n    /**\n     * Returns true if the stream is at the end of the stream.\n     *\n     * @return bool\n     */\n    public function eof();\n\n    /**\n     * Returns whether or not the stream is seekable.\n     *\n     * @return bool\n     */\n    public function isSeekable();\n\n    /**\n     * Seek to a position in the stream.\n     *\n     * @link http://www.php.net/manual/en/function.fseek.php\n     * @param int $offset Stream offset\n     * @param int $whence Specifies how the cursor position will be calculated\n     *     based on the seek offset. Valid values are identical to the built-in\n     *     PHP $whence values for `fseek()`.  SEEK_SET: Set position equal to\n     *     offset bytes SEEK_CUR: Set position to current location plus offset\n     *     SEEK_END: Set position to end-of-stream plus offset.\n     * @throws \\RuntimeException on failure.\n     */\n    public function seek(int $offset, int $whence = SEEK_SET);\n\n    /**\n     * Seek to the beginning of the stream.\n     *\n     * If the stream is not seekable, this method will raise an exception;\n     * otherwise, it will perform a seek(0).\n     *\n     * @see seek()\n     * @link http://www.php.net/manual/en/function.fseek.php\n     * @throws \\RuntimeException on failure.\n     */\n    public function rewind();\n\n    /**\n     * Returns whether or not the stream is writable.\n     *\n     * @return bool\n     */\n    public function isWritable();\n\n    /**\n     * Write data to the stream.\n     *\n     * @param string $string The string that is to be written.\n     * @return int Returns the number of bytes written to the stream.\n     * @throws \\RuntimeException on failure.\n     */\n    public function write(string $string);\n\n    /**\n     * Returns whether or not the stream is readable.\n     *\n     * @return bool\n     */\n    public function isReadable();\n\n    /**\n     * Read data from the stream.\n     *\n     * @param int $length Read up to $length bytes from the object and return\n     *     them. Fewer than $length bytes may be returned if underlying stream\n     *     call returns fewer bytes.\n     * @return string Returns the data read from the stream, or an empty string\n     *     if no bytes are available.\n     * @throws \\RuntimeException if an error occurs.\n     */\n    public function read(int $length);\n\n    /**\n     * Returns the remaining contents in a string\n     *\n     * @return string\n     * @throws \\RuntimeException if unable to read or an error occurs while\n     *     reading.\n     */\n    public function getContents();\n\n    /**\n     * Get stream metadata as an associative array or retrieve a specific key.\n     *\n     * The keys returned are identical to the keys returned from PHP's\n     * stream_get_meta_data() function.\n     *\n     * @link http://php.net/manual/en/function.stream-get-meta-data.php\n     * @param string|null $key Specific metadata to retrieve.\n     * @return array|mixed|null Returns an associative array if no key is\n     *     provided. Returns a specific key value if a key is provided and the\n     *     value is found, or null if the key is not found.\n     */\n    public function getMetadata(?string $key = null);\n}\n"
  },
  {
    "path": "vendor_prefixed/psr/http-message/src/UploadedFileInterface.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\ndeclare(strict_types=1);\n\nnamespace WebDevStudios\\WPSWA\\Psr\\Http\\Message;\n\n/**\n * Value object representing a file uploaded through an HTTP request.\n *\n * Instances of this interface are considered immutable; all methods that\n * might change state MUST be implemented such that they retain the internal\n * state of the current instance and return an instance that contains the\n * changed state.\n */\ninterface UploadedFileInterface\n{\n    /**\n     * Retrieve a stream representing the uploaded file.\n     *\n     * This method MUST return a StreamInterface instance, representing the\n     * uploaded file. The purpose of this method is to allow utilizing native PHP\n     * stream functionality to manipulate the file upload, such as\n     * stream_copy_to_stream() (though the result will need to be decorated in a\n     * native PHP stream wrapper to work with such functions).\n     *\n     * If the moveTo() method has been called previously, this method MUST raise\n     * an exception.\n     *\n     * @return StreamInterface Stream representation of the uploaded file.\n     * @throws \\RuntimeException in cases when no stream is available or can be\n     *     created.\n     */\n    public function getStream();\n\n    /**\n     * Move the uploaded file to a new location.\n     *\n     * Use this method as an alternative to move_uploaded_file(). This method is\n     * guaranteed to work in both SAPI and non-SAPI environments.\n     * Implementations must determine which environment they are in, and use the\n     * appropriate method (move_uploaded_file(), rename(), or a stream\n     * operation) to perform the operation.\n     *\n     * $targetPath may be an absolute path, or a relative path. If it is a\n     * relative path, resolution should be the same as used by PHP's rename()\n     * function.\n     *\n     * The original file or stream MUST be removed on completion.\n     *\n     * If this method is called more than once, any subsequent calls MUST raise\n     * an exception.\n     *\n     * When used in an SAPI environment where $_FILES is populated, when writing\n     * files via moveTo(), is_uploaded_file() and move_uploaded_file() SHOULD be\n     * used to ensure permissions and upload status are verified correctly.\n     *\n     * If you wish to move to a stream, use getStream(), as SAPI operations\n     * cannot guarantee writing to stream destinations.\n     *\n     * @see http://php.net/is_uploaded_file\n     * @see http://php.net/move_uploaded_file\n     * @param string $targetPath Path to which to move the uploaded file.\n     * @throws \\InvalidArgumentException if the $targetPath specified is invalid.\n     * @throws \\RuntimeException on any error during the move operation, or on\n     *     the second or subsequent call to the method.\n     */\n    public function moveTo(string $targetPath);\n    \n    /**\n     * Retrieve the file size.\n     *\n     * Implementations SHOULD return the value stored in the \"size\" key of\n     * the file in the $_FILES array if available, as PHP calculates this based\n     * on the actual size transmitted.\n     *\n     * @return int|null The file size in bytes or null if unknown.\n     */\n    public function getSize();\n    \n    /**\n     * Retrieve the error associated with the uploaded file.\n     *\n     * The return value MUST be one of PHP's UPLOAD_ERR_XXX constants.\n     *\n     * If the file was uploaded successfully, this method MUST return\n     * UPLOAD_ERR_OK.\n     *\n     * Implementations SHOULD return the value stored in the \"error\" key of\n     * the file in the $_FILES array.\n     *\n     * @see http://php.net/manual/en/features.file-upload.errors.php\n     * @return int One of PHP's UPLOAD_ERR_XXX constants.\n     */\n    public function getError();\n    \n    /**\n     * Retrieve the filename sent by the client.\n     *\n     * Do not trust the value returned by this method. A client could send\n     * a malicious filename with the intention to corrupt or hack your\n     * application.\n     *\n     * Implementations SHOULD return the value stored in the \"name\" key of\n     * the file in the $_FILES array.\n     *\n     * @return string|null The filename sent by the client or null if none\n     *     was provided.\n     */\n    public function getClientFilename();\n    \n    /**\n     * Retrieve the media type sent by the client.\n     *\n     * Do not trust the value returned by this method. A client could send\n     * a malicious media type with the intention to corrupt or hack your\n     * application.\n     *\n     * Implementations SHOULD return the value stored in the \"type\" key of\n     * the file in the $_FILES array.\n     *\n     * @return string|null The media type sent by the client or null if none\n     *     was provided.\n     */\n    public function getClientMediaType();\n}\n"
  },
  {
    "path": "vendor_prefixed/psr/http-message/src/UriInterface.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\ndeclare(strict_types=1);\n\nnamespace WebDevStudios\\WPSWA\\Psr\\Http\\Message;\n\n/**\n * Value object representing a URI.\n *\n * This interface is meant to represent URIs according to RFC 3986 and to\n * provide methods for most common operations. Additional functionality for\n * working with URIs can be provided on top of the interface or externally.\n * Its primary use is for HTTP requests, but may also be used in other\n * contexts.\n *\n * Instances of this interface are considered immutable; all methods that\n * might change state MUST be implemented such that they retain the internal\n * state of the current instance and return an instance that contains the\n * changed state.\n *\n * Typically the Host header will be also be present in the request message.\n * For server-side requests, the scheme will typically be discoverable in the\n * server parameters.\n *\n * @link http://tools.ietf.org/html/rfc3986 (the URI specification)\n */\ninterface UriInterface\n{\n    /**\n     * Retrieve the scheme component of the URI.\n     *\n     * If no scheme is present, this method MUST return an empty string.\n     *\n     * The value returned MUST be normalized to lowercase, per RFC 3986\n     * Section 3.1.\n     *\n     * The trailing \":\" character is not part of the scheme and MUST NOT be\n     * added.\n     *\n     * @see https://tools.ietf.org/html/rfc3986#section-3.1\n     * @return string The URI scheme.\n     */\n    public function getScheme();\n\n    /**\n     * Retrieve the authority component of the URI.\n     *\n     * If no authority information is present, this method MUST return an empty\n     * string.\n     *\n     * The authority syntax of the URI is:\n     *\n     * <pre>\n     * [user-info@]host[:port]\n     * </pre>\n     *\n     * If the port component is not set or is the standard port for the current\n     * scheme, it SHOULD NOT be included.\n     *\n     * @see https://tools.ietf.org/html/rfc3986#section-3.2\n     * @return string The URI authority, in \"[user-info@]host[:port]\" format.\n     */\n    public function getAuthority();\n\n    /**\n     * Retrieve the user information component of the URI.\n     *\n     * If no user information is present, this method MUST return an empty\n     * string.\n     *\n     * If a user is present in the URI, this will return that value;\n     * additionally, if the password is also present, it will be appended to the\n     * user value, with a colon (\":\") separating the values.\n     *\n     * The trailing \"@\" character is not part of the user information and MUST\n     * NOT be added.\n     *\n     * @return string The URI user information, in \"username[:password]\" format.\n     */\n    public function getUserInfo();\n\n    /**\n     * Retrieve the host component of the URI.\n     *\n     * If no host is present, this method MUST return an empty string.\n     *\n     * The value returned MUST be normalized to lowercase, per RFC 3986\n     * Section 3.2.2.\n     *\n     * @see http://tools.ietf.org/html/rfc3986#section-3.2.2\n     * @return string The URI host.\n     */\n    public function getHost();\n\n    /**\n     * Retrieve the port component of the URI.\n     *\n     * If a port is present, and it is non-standard for the current scheme,\n     * this method MUST return it as an integer. If the port is the standard port\n     * used with the current scheme, this method SHOULD return null.\n     *\n     * If no port is present, and no scheme is present, this method MUST return\n     * a null value.\n     *\n     * If no port is present, but a scheme is present, this method MAY return\n     * the standard port for that scheme, but SHOULD return null.\n     *\n     * @return null|int The URI port.\n     */\n    public function getPort();\n\n    /**\n     * Retrieve the path component of the URI.\n     *\n     * The path can either be empty or absolute (starting with a slash) or\n     * rootless (not starting with a slash). Implementations MUST support all\n     * three syntaxes.\n     *\n     * Normally, the empty path \"\" and absolute path \"/\" are considered equal as\n     * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically\n     * do this normalization because in contexts with a trimmed base path, e.g.\n     * the front controller, this difference becomes significant. It's the task\n     * of the user to handle both \"\" and \"/\".\n     *\n     * The value returned MUST be percent-encoded, but MUST NOT double-encode\n     * any characters. To determine what characters to encode, please refer to\n     * RFC 3986, Sections 2 and 3.3.\n     *\n     * As an example, if the value should include a slash (\"/\") not intended as\n     * delimiter between path segments, that value MUST be passed in encoded\n     * form (e.g., \"%2F\") to the instance.\n     *\n     * @see https://tools.ietf.org/html/rfc3986#section-2\n     * @see https://tools.ietf.org/html/rfc3986#section-3.3\n     * @return string The URI path.\n     */\n    public function getPath();\n\n    /**\n     * Retrieve the query string of the URI.\n     *\n     * If no query string is present, this method MUST return an empty string.\n     *\n     * The leading \"?\" character is not part of the query and MUST NOT be\n     * added.\n     *\n     * The value returned MUST be percent-encoded, but MUST NOT double-encode\n     * any characters. To determine what characters to encode, please refer to\n     * RFC 3986, Sections 2 and 3.4.\n     *\n     * As an example, if a value in a key/value pair of the query string should\n     * include an ampersand (\"&\") not intended as a delimiter between values,\n     * that value MUST be passed in encoded form (e.g., \"%26\") to the instance.\n     *\n     * @see https://tools.ietf.org/html/rfc3986#section-2\n     * @see https://tools.ietf.org/html/rfc3986#section-3.4\n     * @return string The URI query string.\n     */\n    public function getQuery();\n\n    /**\n     * Retrieve the fragment component of the URI.\n     *\n     * If no fragment is present, this method MUST return an empty string.\n     *\n     * The leading \"#\" character is not part of the fragment and MUST NOT be\n     * added.\n     *\n     * The value returned MUST be percent-encoded, but MUST NOT double-encode\n     * any characters. To determine what characters to encode, please refer to\n     * RFC 3986, Sections 2 and 3.5.\n     *\n     * @see https://tools.ietf.org/html/rfc3986#section-2\n     * @see https://tools.ietf.org/html/rfc3986#section-3.5\n     * @return string The URI fragment.\n     */\n    public function getFragment();\n\n    /**\n     * Return an instance with the specified scheme.\n     *\n     * This method MUST retain the state of the current instance, and return\n     * an instance that contains the specified scheme.\n     *\n     * Implementations MUST support the schemes \"http\" and \"https\" case\n     * insensitively, and MAY accommodate other schemes if required.\n     *\n     * An empty scheme is equivalent to removing the scheme.\n     *\n     * @param string $scheme The scheme to use with the new instance.\n     * @return static A new instance with the specified scheme.\n     * @throws \\InvalidArgumentException for invalid or unsupported schemes.\n     */\n    public function withScheme(string $scheme);\n\n    /**\n     * Return an instance with the specified user information.\n     *\n     * This method MUST retain the state of the current instance, and return\n     * an instance that contains the specified user information.\n     *\n     * Password is optional, but the user information MUST include the\n     * user; an empty string for the user is equivalent to removing user\n     * information.\n     *\n     * @param string $user The user name to use for authority.\n     * @param null|string $password The password associated with $user.\n     * @return static A new instance with the specified user information.\n     */\n    public function withUserInfo(string $user, ?string $password = null);\n\n    /**\n     * Return an instance with the specified host.\n     *\n     * This method MUST retain the state of the current instance, and return\n     * an instance that contains the specified host.\n     *\n     * An empty host value is equivalent to removing the host.\n     *\n     * @param string $host The hostname to use with the new instance.\n     * @return static A new instance with the specified host.\n     * @throws \\InvalidArgumentException for invalid hostnames.\n     */\n    public function withHost(string $host);\n\n    /**\n     * Return an instance with the specified port.\n     *\n     * This method MUST retain the state of the current instance, and return\n     * an instance that contains the specified port.\n     *\n     * Implementations MUST raise an exception for ports outside the\n     * established TCP and UDP port ranges.\n     *\n     * A null value provided for the port is equivalent to removing the port\n     * information.\n     *\n     * @param null|int $port The port to use with the new instance; a null value\n     *     removes the port information.\n     * @return static A new instance with the specified port.\n     * @throws \\InvalidArgumentException for invalid ports.\n     */\n    public function withPort(?int $port);\n\n    /**\n     * Return an instance with the specified path.\n     *\n     * This method MUST retain the state of the current instance, and return\n     * an instance that contains the specified path.\n     *\n     * The path can either be empty or absolute (starting with a slash) or\n     * rootless (not starting with a slash). Implementations MUST support all\n     * three syntaxes.\n     *\n     * If the path is intended to be domain-relative rather than path relative then\n     * it must begin with a slash (\"/\"). Paths not starting with a slash (\"/\")\n     * are assumed to be relative to some base path known to the application or\n     * consumer.\n     *\n     * Users can provide both encoded and decoded path characters.\n     * Implementations ensure the correct encoding as outlined in getPath().\n     *\n     * @param string $path The path to use with the new instance.\n     * @return static A new instance with the specified path.\n     * @throws \\InvalidArgumentException for invalid paths.\n     */\n    public function withPath(string $path);\n\n    /**\n     * Return an instance with the specified query string.\n     *\n     * This method MUST retain the state of the current instance, and return\n     * an instance that contains the specified query string.\n     *\n     * Users can provide both encoded and decoded query characters.\n     * Implementations ensure the correct encoding as outlined in getQuery().\n     *\n     * An empty query string value is equivalent to removing the query string.\n     *\n     * @param string $query The query string to use with the new instance.\n     * @return static A new instance with the specified query string.\n     * @throws \\InvalidArgumentException for invalid query strings.\n     */\n    public function withQuery(string $query);\n\n    /**\n     * Return an instance with the specified URI fragment.\n     *\n     * This method MUST retain the state of the current instance, and return\n     * an instance that contains the specified URI fragment.\n     *\n     * Users can provide both encoded and decoded fragment characters.\n     * Implementations ensure the correct encoding as outlined in getFragment().\n     *\n     * An empty fragment value is equivalent to removing the fragment.\n     *\n     * @param string $fragment The fragment to use with the new instance.\n     * @return static A new instance with the specified fragment.\n     */\n    public function withFragment(string $fragment);\n\n    /**\n     * Return the string representation as a URI reference.\n     *\n     * Depending on which components of the URI are present, the resulting\n     * string is either a full URI or relative reference according to RFC 3986,\n     * Section 4.1. The method concatenates the various components of the URI,\n     * using the appropriate delimiters:\n     *\n     * - If a scheme is present, it MUST be suffixed by \":\".\n     * - If an authority is present, it MUST be prefixed by \"//\".\n     * - The path can be concatenated without delimiters. But there are two\n     *   cases where the path has to be adjusted to make the URI reference\n     *   valid as PHP does not allow to throw an exception in __toString():\n     *     - If the path is rootless and an authority is present, the path MUST\n     *       be prefixed by \"/\".\n     *     - If the path is starting with more than one \"/\" and no authority is\n     *       present, the starting slashes MUST be reduced to one.\n     * - If a query is present, it MUST be prefixed by \"?\".\n     * - If a fragment is present, it MUST be prefixed by \"#\".\n     *\n     * @see http://tools.ietf.org/html/rfc3986#section-4.1\n     * @return string\n     */\n    public function __toString();\n}\n"
  },
  {
    "path": "vendor_prefixed/psr/log/LICENSE",
    "content": "Copyright (c) 2012 PHP Framework Interoperability Group\n\nPermission is hereby granted, free of charge, to any person obtaining a copy \nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights \nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell \ncopies of the Software, and to permit persons to whom the Software is \nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in \nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "vendor_prefixed/psr/log/Psr/Log/AbstractLogger.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Psr\\Log;\n\n/**\n * This is a simple Logger implementation that other Loggers can inherit from.\n *\n * It simply delegates all log-level-specific methods to the `log` method to\n * reduce boilerplate code that a simple Logger that does the same thing with\n * messages regardless of the error level has to implement.\n */\nabstract class AbstractLogger implements LoggerInterface\n{\n    /**\n     * System is unusable.\n     *\n     * @param string  $message\n     * @param mixed[] $context\n     *\n     * @return void\n     */\n    public function emergency($message, array $context = array())\n    {\n        $this->log(LogLevel::EMERGENCY, $message, $context);\n    }\n\n    /**\n     * Action must be taken immediately.\n     *\n     * Example: Entire website down, database unavailable, etc. This should\n     * trigger the SMS alerts and wake you up.\n     *\n     * @param string  $message\n     * @param mixed[] $context\n     *\n     * @return void\n     */\n    public function alert($message, array $context = array())\n    {\n        $this->log(LogLevel::ALERT, $message, $context);\n    }\n\n    /**\n     * Critical conditions.\n     *\n     * Example: Application component unavailable, unexpected exception.\n     *\n     * @param string  $message\n     * @param mixed[] $context\n     *\n     * @return void\n     */\n    public function critical($message, array $context = array())\n    {\n        $this->log(LogLevel::CRITICAL, $message, $context);\n    }\n\n    /**\n     * Runtime errors that do not require immediate action but should typically\n     * be logged and monitored.\n     *\n     * @param string  $message\n     * @param mixed[] $context\n     *\n     * @return void\n     */\n    public function error($message, array $context = array())\n    {\n        $this->log(LogLevel::ERROR, $message, $context);\n    }\n\n    /**\n     * Exceptional occurrences that are not errors.\n     *\n     * Example: Use of deprecated APIs, poor use of an API, undesirable things\n     * that are not necessarily wrong.\n     *\n     * @param string  $message\n     * @param mixed[] $context\n     *\n     * @return void\n     */\n    public function warning($message, array $context = array())\n    {\n        $this->log(LogLevel::WARNING, $message, $context);\n    }\n\n    /**\n     * Normal but significant events.\n     *\n     * @param string  $message\n     * @param mixed[] $context\n     *\n     * @return void\n     */\n    public function notice($message, array $context = array())\n    {\n        $this->log(LogLevel::NOTICE, $message, $context);\n    }\n\n    /**\n     * Interesting events.\n     *\n     * Example: User logs in, SQL logs.\n     *\n     * @param string  $message\n     * @param mixed[] $context\n     *\n     * @return void\n     */\n    public function info($message, array $context = array())\n    {\n        $this->log(LogLevel::INFO, $message, $context);\n    }\n\n    /**\n     * Detailed debug information.\n     *\n     * @param string  $message\n     * @param mixed[] $context\n     *\n     * @return void\n     */\n    public function debug($message, array $context = array())\n    {\n        $this->log(LogLevel::DEBUG, $message, $context);\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/psr/log/Psr/Log/InvalidArgumentException.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Psr\\Log;\n\nclass InvalidArgumentException extends \\InvalidArgumentException\n{\n}\n"
  },
  {
    "path": "vendor_prefixed/psr/log/Psr/Log/LogLevel.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Psr\\Log;\n\n/**\n * Describes log levels.\n */\nclass LogLevel\n{\n    const EMERGENCY = 'emergency';\n    const ALERT     = 'alert';\n    const CRITICAL  = 'critical';\n    const ERROR     = 'error';\n    const WARNING   = 'warning';\n    const NOTICE    = 'notice';\n    const INFO      = 'info';\n    const DEBUG     = 'debug';\n}\n"
  },
  {
    "path": "vendor_prefixed/psr/log/Psr/Log/LoggerAwareInterface.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Psr\\Log;\n\n/**\n * Describes a logger-aware instance.\n */\ninterface LoggerAwareInterface\n{\n    /**\n     * Sets a logger instance on the object.\n     *\n     * @param LoggerInterface $logger\n     *\n     * @return void\n     */\n    public function setLogger(LoggerInterface $logger);\n}\n"
  },
  {
    "path": "vendor_prefixed/psr/log/Psr/Log/LoggerAwareTrait.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Psr\\Log;\n\n/**\n * Basic Implementation of LoggerAwareInterface.\n */\ntrait LoggerAwareTrait\n{\n    /**\n     * The logger instance.\n     *\n     * @var LoggerInterface|null\n     */\n    protected $logger;\n\n    /**\n     * Sets a logger.\n     *\n     * @param LoggerInterface $logger\n     */\n    public function setLogger(LoggerInterface $logger)\n    {\n        $this->logger = $logger;\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/psr/log/Psr/Log/LoggerInterface.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Psr\\Log;\n\n/**\n * Describes a logger instance.\n *\n * The message MUST be a string or object implementing __toString().\n *\n * The message MAY contain placeholders in the form: {foo} where foo\n * will be replaced by the context data in key \"foo\".\n *\n * The context array can contain arbitrary data. The only assumption that\n * can be made by implementors is that if an Exception instance is given\n * to produce a stack trace, it MUST be in a key named \"exception\".\n *\n * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md\n * for the full interface specification.\n */\ninterface LoggerInterface\n{\n    /**\n     * System is unusable.\n     *\n     * @param string  $message\n     * @param mixed[] $context\n     *\n     * @return void\n     */\n    public function emergency($message, array $context = array());\n\n    /**\n     * Action must be taken immediately.\n     *\n     * Example: Entire website down, database unavailable, etc. This should\n     * trigger the SMS alerts and wake you up.\n     *\n     * @param string  $message\n     * @param mixed[] $context\n     *\n     * @return void\n     */\n    public function alert($message, array $context = array());\n\n    /**\n     * Critical conditions.\n     *\n     * Example: Application component unavailable, unexpected exception.\n     *\n     * @param string  $message\n     * @param mixed[] $context\n     *\n     * @return void\n     */\n    public function critical($message, array $context = array());\n\n    /**\n     * Runtime errors that do not require immediate action but should typically\n     * be logged and monitored.\n     *\n     * @param string  $message\n     * @param mixed[] $context\n     *\n     * @return void\n     */\n    public function error($message, array $context = array());\n\n    /**\n     * Exceptional occurrences that are not errors.\n     *\n     * Example: Use of deprecated APIs, poor use of an API, undesirable things\n     * that are not necessarily wrong.\n     *\n     * @param string  $message\n     * @param mixed[] $context\n     *\n     * @return void\n     */\n    public function warning($message, array $context = array());\n\n    /**\n     * Normal but significant events.\n     *\n     * @param string  $message\n     * @param mixed[] $context\n     *\n     * @return void\n     */\n    public function notice($message, array $context = array());\n\n    /**\n     * Interesting events.\n     *\n     * Example: User logs in, SQL logs.\n     *\n     * @param string  $message\n     * @param mixed[] $context\n     *\n     * @return void\n     */\n    public function info($message, array $context = array());\n\n    /**\n     * Detailed debug information.\n     *\n     * @param string  $message\n     * @param mixed[] $context\n     *\n     * @return void\n     */\n    public function debug($message, array $context = array());\n\n    /**\n     * Logs with an arbitrary level.\n     *\n     * @param mixed   $level\n     * @param string  $message\n     * @param mixed[] $context\n     *\n     * @return void\n     *\n     * @throws \\WebDevStudios\\WPSWA\\Psr\\Log\\InvalidArgumentException\n     */\n    public function log($level, $message, array $context = array());\n}\n"
  },
  {
    "path": "vendor_prefixed/psr/log/Psr/Log/LoggerTrait.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Psr\\Log;\n\n/**\n * This is a simple Logger trait that classes unable to extend AbstractLogger\n * (because they extend another class, etc) can include.\n *\n * It simply delegates all log-level-specific methods to the `log` method to\n * reduce boilerplate code that a simple Logger that does the same thing with\n * messages regardless of the error level has to implement.\n */\ntrait LoggerTrait\n{\n    /**\n     * System is unusable.\n     *\n     * @param string $message\n     * @param array  $context\n     *\n     * @return void\n     */\n    public function emergency($message, array $context = array())\n    {\n        $this->log(LogLevel::EMERGENCY, $message, $context);\n    }\n\n    /**\n     * Action must be taken immediately.\n     *\n     * Example: Entire website down, database unavailable, etc. This should\n     * trigger the SMS alerts and wake you up.\n     *\n     * @param string $message\n     * @param array  $context\n     *\n     * @return void\n     */\n    public function alert($message, array $context = array())\n    {\n        $this->log(LogLevel::ALERT, $message, $context);\n    }\n\n    /**\n     * Critical conditions.\n     *\n     * Example: Application component unavailable, unexpected exception.\n     *\n     * @param string $message\n     * @param array  $context\n     *\n     * @return void\n     */\n    public function critical($message, array $context = array())\n    {\n        $this->log(LogLevel::CRITICAL, $message, $context);\n    }\n\n    /**\n     * Runtime errors that do not require immediate action but should typically\n     * be logged and monitored.\n     *\n     * @param string $message\n     * @param array  $context\n     *\n     * @return void\n     */\n    public function error($message, array $context = array())\n    {\n        $this->log(LogLevel::ERROR, $message, $context);\n    }\n\n    /**\n     * Exceptional occurrences that are not errors.\n     *\n     * Example: Use of deprecated APIs, poor use of an API, undesirable things\n     * that are not necessarily wrong.\n     *\n     * @param string $message\n     * @param array  $context\n     *\n     * @return void\n     */\n    public function warning($message, array $context = array())\n    {\n        $this->log(LogLevel::WARNING, $message, $context);\n    }\n\n    /**\n     * Normal but significant events.\n     *\n     * @param string $message\n     * @param array  $context\n     *\n     * @return void\n     */\n    public function notice($message, array $context = array())\n    {\n        $this->log(LogLevel::NOTICE, $message, $context);\n    }\n\n    /**\n     * Interesting events.\n     *\n     * Example: User logs in, SQL logs.\n     *\n     * @param string $message\n     * @param array  $context\n     *\n     * @return void\n     */\n    public function info($message, array $context = array())\n    {\n        $this->log(LogLevel::INFO, $message, $context);\n    }\n\n    /**\n     * Detailed debug information.\n     *\n     * @param string $message\n     * @param array  $context\n     *\n     * @return void\n     */\n    public function debug($message, array $context = array())\n    {\n        $this->log(LogLevel::DEBUG, $message, $context);\n    }\n\n    /**\n     * Logs with an arbitrary level.\n     *\n     * @param mixed  $level\n     * @param string $message\n     * @param array  $context\n     *\n     * @return void\n     *\n     * @throws \\WebDevStudios\\WPSWA\\Psr\\Log\\InvalidArgumentException\n     */\n    abstract public function log($level, $message, array $context = array());\n}\n"
  },
  {
    "path": "vendor_prefixed/psr/log/Psr/Log/NullLogger.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Psr\\Log;\n\n/**\n * This Logger can be used to avoid conditional log calls.\n *\n * Logging should always be optional, and if no logger is provided to your\n * library creating a NullLogger instance to have something to throw logs at\n * is a good way to avoid littering your code with `if ($this->logger) { }`\n * blocks.\n */\nclass NullLogger extends AbstractLogger\n{\n    /**\n     * Logs with an arbitrary level.\n     *\n     * @param mixed  $level\n     * @param string $message\n     * @param array  $context\n     *\n     * @return void\n     *\n     * @throws \\WebDevStudios\\WPSWA\\Psr\\Log\\InvalidArgumentException\n     */\n    public function log($level, $message, array $context = array())\n    {\n        // noop\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/psr/log/Psr/Log/Test/DummyTest.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Psr\\Log\\Test;\n\n/**\n * This class is internal and does not follow the BC promise.\n *\n * Do NOT use this class in any way.\n *\n * @internal\n */\nclass DummyTest\n{\n    public function __toString()\n    {\n        return 'DummyTest';\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/psr/log/Psr/Log/Test/LoggerInterfaceTest.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Psr\\Log\\Test;\n\nuse WebDevStudios\\WPSWA\\Psr\\Log\\LoggerInterface;\nuse WebDevStudios\\WPSWA\\Psr\\Log\\LogLevel;\nuse PHPUnit\\Framework\\TestCase;\n\n/**\n * Provides a base test class for ensuring compliance with the LoggerInterface.\n *\n * Implementors can extend the class and implement abstract methods to run this\n * as part of their test suite.\n */\nabstract class LoggerInterfaceTest extends TestCase\n{\n    /**\n     * @return LoggerInterface\n     */\n    abstract public function getLogger();\n\n    /**\n     * This must return the log messages in order.\n     *\n     * The simple formatting of the messages is: \"<LOG LEVEL> <MESSAGE>\".\n     *\n     * Example ->error('Foo') would yield \"error Foo\".\n     *\n     * @return string[]\n     */\n    abstract public function getLogs();\n\n    public function testImplements()\n    {\n        $this->assertInstanceOf('WebDevStudios\\WPSWA\\Psr\\Log\\LoggerInterface', $this->getLogger());\n    }\n\n    /**\n     * @dataProvider provideLevelsAndMessages\n     */\n    public function testLogsAtAllLevels($level, $message)\n    {\n        $logger = $this->getLogger();\n        $logger->{$level}($message, array('user' => 'Bob'));\n        $logger->log($level, $message, array('user' => 'Bob'));\n\n        $expected = array(\n            $level.' message of level '.$level.' with context: Bob',\n            $level.' message of level '.$level.' with context: Bob',\n        );\n        $this->assertEquals($expected, $this->getLogs());\n    }\n\n    public function provideLevelsAndMessages()\n    {\n        return array(\n            LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'),\n            LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'),\n            LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'),\n            LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'),\n            LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'),\n            LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'),\n            LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'),\n            LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'),\n        );\n    }\n\n    /**\n     * @expectedException \\WebDevStudios\\WPSWA\\Psr\\Log\\InvalidArgumentException\n     */\n    public function testThrowsOnInvalidLevel()\n    {\n        $logger = $this->getLogger();\n        $logger->log('invalid level', 'Foo');\n    }\n\n    public function testContextReplacement()\n    {\n        $logger = $this->getLogger();\n        $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar'));\n\n        $expected = array('info {Message {nothing} Bob Bar a}');\n        $this->assertEquals($expected, $this->getLogs());\n    }\n\n    public function testObjectCastToString()\n    {\n        if (method_exists($this, 'createPartialMock')) {\n            $dummy = $this->createPartialMock('WebDevStudios\\WPSWA\\Psr\\Log\\Test\\DummyTest', array('__toString'));\n        } else {\n            $dummy = $this->getMock('WebDevStudios\\WPSWA\\Psr\\Log\\Test\\DummyTest', array('__toString'));\n        }\n        $dummy->expects($this->once())\n            ->method('__toString')\n            ->will($this->returnValue('DUMMY'));\n\n        $this->getLogger()->warning($dummy);\n\n        $expected = array('warning DUMMY');\n        $this->assertEquals($expected, $this->getLogs());\n    }\n\n    public function testContextCanContainAnything()\n    {\n        $closed = fopen('php://memory', 'r');\n        fclose($closed);\n\n        $context = array(\n            'bool' => true,\n            'null' => null,\n            'string' => 'Foo',\n            'int' => 0,\n            'float' => 0.5,\n            'nested' => array('with object' => new DummyTest),\n            'object' => new \\DateTime,\n            'resource' => fopen('php://memory', 'r'),\n            'closed' => $closed,\n        );\n\n        $this->getLogger()->warning('Crazy context data', $context);\n\n        $expected = array('warning Crazy context data');\n        $this->assertEquals($expected, $this->getLogs());\n    }\n\n    public function testContextExceptionKeyCanBeExceptionOrOtherValues()\n    {\n        $logger = $this->getLogger();\n        $logger->warning('Random message', array('exception' => 'oops'));\n        $logger->critical('Uncaught Exception!', array('exception' => new \\LogicException('Fail')));\n\n        $expected = array(\n            'warning Random message',\n            'critical Uncaught Exception!'\n        );\n        $this->assertEquals($expected, $this->getLogs());\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/psr/log/Psr/Log/Test/TestLogger.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Psr\\Log\\Test;\n\nuse WebDevStudios\\WPSWA\\Psr\\Log\\AbstractLogger;\n\n/**\n * Used for testing purposes.\n *\n * It records all records and gives you access to them for verification.\n *\n * @method bool hasEmergency($record)\n * @method bool hasAlert($record)\n * @method bool hasCritical($record)\n * @method bool hasError($record)\n * @method bool hasWarning($record)\n * @method bool hasNotice($record)\n * @method bool hasInfo($record)\n * @method bool hasDebug($record)\n *\n * @method bool hasEmergencyRecords()\n * @method bool hasAlertRecords()\n * @method bool hasCriticalRecords()\n * @method bool hasErrorRecords()\n * @method bool hasWarningRecords()\n * @method bool hasNoticeRecords()\n * @method bool hasInfoRecords()\n * @method bool hasDebugRecords()\n *\n * @method bool hasEmergencyThatContains($message)\n * @method bool hasAlertThatContains($message)\n * @method bool hasCriticalThatContains($message)\n * @method bool hasErrorThatContains($message)\n * @method bool hasWarningThatContains($message)\n * @method bool hasNoticeThatContains($message)\n * @method bool hasInfoThatContains($message)\n * @method bool hasDebugThatContains($message)\n *\n * @method bool hasEmergencyThatMatches($message)\n * @method bool hasAlertThatMatches($message)\n * @method bool hasCriticalThatMatches($message)\n * @method bool hasErrorThatMatches($message)\n * @method bool hasWarningThatMatches($message)\n * @method bool hasNoticeThatMatches($message)\n * @method bool hasInfoThatMatches($message)\n * @method bool hasDebugThatMatches($message)\n *\n * @method bool hasEmergencyThatPasses($message)\n * @method bool hasAlertThatPasses($message)\n * @method bool hasCriticalThatPasses($message)\n * @method bool hasErrorThatPasses($message)\n * @method bool hasWarningThatPasses($message)\n * @method bool hasNoticeThatPasses($message)\n * @method bool hasInfoThatPasses($message)\n * @method bool hasDebugThatPasses($message)\n */\nclass TestLogger extends AbstractLogger\n{\n    /**\n     * @var array\n     */\n    public $records = [];\n\n    public $recordsByLevel = [];\n\n    /**\n     * @inheritdoc\n     */\n    public function log($level, $message, array $context = [])\n    {\n        $record = [\n            'level' => $level,\n            'message' => $message,\n            'context' => $context,\n        ];\n\n        $this->recordsByLevel[$record['level']][] = $record;\n        $this->records[] = $record;\n    }\n\n    public function hasRecords($level)\n    {\n        return isset($this->recordsByLevel[$level]);\n    }\n\n    public function hasRecord($record, $level)\n    {\n        if (is_string($record)) {\n            $record = ['message' => $record];\n        }\n        return $this->hasRecordThatPasses(function ($rec) use ($record) {\n            if ($rec['message'] !== $record['message']) {\n                return false;\n            }\n            if (isset($record['context']) && $rec['context'] !== $record['context']) {\n                return false;\n            }\n            return true;\n        }, $level);\n    }\n\n    public function hasRecordThatContains($message, $level)\n    {\n        return $this->hasRecordThatPasses(function ($rec) use ($message) {\n            return strpos($rec['message'], $message) !== false;\n        }, $level);\n    }\n\n    public function hasRecordThatMatches($regex, $level)\n    {\n        return $this->hasRecordThatPasses(function ($rec) use ($regex) {\n            return preg_match($regex, $rec['message']) > 0;\n        }, $level);\n    }\n\n    public function hasRecordThatPasses(callable $predicate, $level)\n    {\n        if (!isset($this->recordsByLevel[$level])) {\n            return false;\n        }\n        foreach ($this->recordsByLevel[$level] as $i => $rec) {\n            if (call_user_func($predicate, $rec, $i)) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    public function __call($method, $args)\n    {\n        if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) {\n            $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3];\n            $level = strtolower($matches[2]);\n            if (method_exists($this, $genericMethod)) {\n                $args[] = $level;\n                return call_user_func_array([$this, $genericMethod], $args);\n            }\n        }\n        throw new \\BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()');\n    }\n\n    public function reset()\n    {\n        $this->records = [];\n        $this->recordsByLevel = [];\n    }\n}\n"
  },
  {
    "path": "vendor_prefixed/psr/simple-cache/LICENSE.md",
    "content": "# The MIT License (MIT)\n\nCopyright (c) 2016 PHP Framework Interoperability Group\n\n> Permission is hereby granted, free of charge, to any person obtaining a copy\n> of this software and associated documentation files (the \"Software\"), to deal\n> in the Software without restriction, including without limitation the rights\n> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n> copies of the Software, and to permit persons to whom the Software is\n> furnished to do so, subject to the following conditions:\n>\n> The above copyright notice and this permission notice shall be included in\n> all copies or substantial portions of the Software.\n>\n> THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n> THE SOFTWARE.\n"
  },
  {
    "path": "vendor_prefixed/psr/simple-cache/src/CacheException.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Psr\\SimpleCache;\n\n/**\n * Interface used for all types of exceptions thrown by the implementing library.\n */\ninterface CacheException\n{\n}\n"
  },
  {
    "path": "vendor_prefixed/psr/simple-cache/src/CacheInterface.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Psr\\SimpleCache;\n\ninterface CacheInterface\n{\n    /**\n     * Fetches a value from the cache.\n     *\n     * @param string $key     The unique key of this item in the cache.\n     * @param mixed  $default Default value to return if the key does not exist.\n     *\n     * @return mixed The value of the item from the cache, or $default in case of cache miss.\n     *\n     * @throws \\WebDevStudios\\WPSWA\\Psr\\SimpleCache\\InvalidArgumentException\n     *   MUST be thrown if the $key string is not a legal value.\n     */\n    public function get($key, $default = null);\n\n    /**\n     * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time.\n     *\n     * @param string                 $key   The key of the item to store.\n     * @param mixed                  $value The value of the item to store, must be serializable.\n     * @param null|int|\\DateInterval $ttl   Optional. The TTL value of this item. If no value is sent and\n     *                                      the driver supports TTL then the library may set a default value\n     *                                      for it or let the driver take care of that.\n     *\n     * @return bool True on success and false on failure.\n     *\n     * @throws \\WebDevStudios\\WPSWA\\Psr\\SimpleCache\\InvalidArgumentException\n     *   MUST be thrown if the $key string is not a legal value.\n     */\n    public function set($key, $value, $ttl = null);\n\n    /**\n     * Delete an item from the cache by its unique key.\n     *\n     * @param string $key The unique cache key of the item to delete.\n     *\n     * @return bool True if the item was successfully removed. False if there was an error.\n     *\n     * @throws \\WebDevStudios\\WPSWA\\Psr\\SimpleCache\\InvalidArgumentException\n     *   MUST be thrown if the $key string is not a legal value.\n     */\n    public function delete($key);\n\n    /**\n     * Wipes clean the entire cache's keys.\n     *\n     * @return bool True on success and false on failure.\n     */\n    public function clear();\n\n    /**\n     * Obtains multiple cache items by their unique keys.\n     *\n     * @param iterable $keys    A list of keys that can obtained in a single operation.\n     * @param mixed    $default Default value to return for keys that do not exist.\n     *\n     * @return iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value.\n     *\n     * @throws \\WebDevStudios\\WPSWA\\Psr\\SimpleCache\\InvalidArgumentException\n     *   MUST be thrown if $keys is neither an array nor a Traversable,\n     *   or if any of the $keys are not a legal value.\n     */\n    public function getMultiple($keys, $default = null);\n\n    /**\n     * Persists a set of key => value pairs in the cache, with an optional TTL.\n     *\n     * @param iterable               $values A list of key => value pairs for a multiple-set operation.\n     * @param null|int|\\DateInterval $ttl    Optional. The TTL value of this item. If no value is sent and\n     *                                       the driver supports TTL then the library may set a default value\n     *                                       for it or let the driver take care of that.\n     *\n     * @return bool True on success and false on failure.\n     *\n     * @throws \\WebDevStudios\\WPSWA\\Psr\\SimpleCache\\InvalidArgumentException\n     *   MUST be thrown if $values is neither an array nor a Traversable,\n     *   or if any of the $values are not a legal value.\n     */\n    public function setMultiple($values, $ttl = null);\n\n    /**\n     * Deletes multiple cache items in a single operation.\n     *\n     * @param iterable $keys A list of string-based keys to be deleted.\n     *\n     * @return bool True if the items were successfully removed. False if there was an error.\n     *\n     * @throws \\WebDevStudios\\WPSWA\\Psr\\SimpleCache\\InvalidArgumentException\n     *   MUST be thrown if $keys is neither an array nor a Traversable,\n     *   or if any of the $keys are not a legal value.\n     */\n    public function deleteMultiple($keys);\n\n    /**\n     * Determines whether an item is present in the cache.\n     *\n     * NOTE: It is recommended that has() is only to be used for cache warming type purposes\n     * and not to be used within your live applications operations for get/set, as this method\n     * is subject to a race condition where your has() will return true and immediately after,\n     * another script can remove it making the state of your app out of date.\n     *\n     * @param string $key The cache item key.\n     *\n     * @return bool\n     *\n     * @throws \\WebDevStudios\\WPSWA\\Psr\\SimpleCache\\InvalidArgumentException\n     *   MUST be thrown if the $key string is not a legal value.\n     */\n    public function has($key);\n}\n"
  },
  {
    "path": "vendor_prefixed/psr/simple-cache/src/InvalidArgumentException.php",
    "content": "<?php\n/**\n * @license MIT\n *\n * Modified by WebDevStudios on 01-July-2025 using Strauss.\n * @see https://github.com/BrianHenryIE/strauss\n */\n\nnamespace WebDevStudios\\WPSWA\\Psr\\SimpleCache;\n\n/**\n * Exception interface for invalid cache arguments.\n *\n * When an invalid argument is passed it must throw an exception which implements\n * this interface\n */\ninterface InvalidArgumentException extends CacheException\n{\n}\n"
  },
  {
    "path": "wordfence-vendor.txt",
    "content": "r1zgvlchxxpubtv5mz6h0b2g3zsxyx7h"
  }
]