{"version":3,"file":"default/js/search.js","sources":["webpack://rws/./dependencies/plugin_productcompare/cartridges/plugin_productcompare/cartridge/client/default/js/product/compare.js","webpack://rws/./dependencies/storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/search/search.js","webpack://rws/./dependencies/storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/util.js","webpack://rws/./cartridges/app_rws/cartridge/client/default/js/components/toolTip.js","webpack://rws/./cartridges/app_rws/cartridge/client/default/js/search/search.js","webpack://rws/./cartridges/app_rws/cartridge/client/default/js/search.js"],"sourcesContent":["'use strict';\n\nvar $compareBar = $('.compare-bar-wrapper');\nvar maxSlots = parseInt($('.compare-bar').data('max-slots'), 10);\nvar productsForComparison = [];\nvar compareButtonText = $('button.compare').text();\n\nvar lastKnownUrl = location.href;\n\n\n/**\n * @typedef ProductComparisonList\n * @type Object\n * @property {string} pid - ID for product to compare\n * @property {string} imgSrc - Image URL for selected product\n */\n\n/**\n * Compiles the HTML for a single slot\n *\n * @param {ProductComparisonList} product - Selected product to compare\n * @param {number} idx - Slot number (zero-based)\n * @return {string} - HTML for a single slot\n */\nfunction compileSlot(product, idx) {\n var pid = product.pid;\n var name = 'pid' + idx;\n\n return '' +\n '
' +\n '
' +\n '' +\n '
' +\n '' +\n '
' +\n '
' +\n '' +\n '
\\n';\n}\n\n/**\n * Draw and render the Compare Bar product slots\n *\n * @param {ProductComparisonList []} productsToCompare - List of ID's of the products to compare\n */\nfunction redrawCompareSlots(productsToCompare) {\n var html = productsToCompare.map(function (product, idx) {\n return compileSlot(product, idx);\n }).join('');\n\n // Render empty slots\n if (productsToCompare.length < maxSlots) {\n var numAvailableSlots = maxSlots - productsToCompare.length;\n\n for (var i = 0; i < numAvailableSlots; i++) {\n if (i === 0 && productsToCompare.length < 2) {\n html += '
' +\n '
' + $('.compare-bar').data('min-products-msg') +\n '
';\n } else {\n html += '
';\n }\n }\n }\n\n $('.compare-bar .product-slots').empty().append(html);\n}\n\n/**\n * Enables/disables the Compare button, depending on whether at least two products have been\n * selected for comparison\n *\n * @param {number} numProducts - Number of products selected for comparison\n */\nfunction setCompareButton(numProducts) {\n if (numProducts > 0) {\n $('button.compare').text(compareButtonText + '(' + numProducts + ')');\n } else {\n $('button.compare').text(compareButtonText);\n }\n if (numProducts < 2) {\n $('button.compare').attr('disabled', true);\n } else {\n $('button.compare').removeAttr('disabled');\n }\n}\n\n/**\n * Returns a copy of a list of products to compare\n *\n * @param {ProductComparisonList []} productsToCompare - List of ID's of the products to compare\n * @return {ProductComparisonList []} List of ID's of the products to compare\n */\nfunction copyProducts(productsToCompare) {\n return productsToCompare.map(function (product) {\n var proxy = {};\n\n Object.keys(product).forEach(function (key) {\n proxy[key] = product[key];\n });\n\n return proxy;\n });\n}\n\n/**\n * Handles the selection of a product for comparison\n *\n * @param {ProductComparisonList []} products - List of ID's of the products to compare\n * @param {string} pid - ID for product to compare\n * @param {string} imgSrc - Image URL for selected product\n * @return {ProductComparisonList []} List of ID's of the products to compare\n */\nfunction selectProduct(products, pid, imgSrc) {\n var productsToCompare = copyProducts(products) || [];\n\n if (productsToCompare.length < maxSlots) {\n productsToCompare.push({\n pid: pid,\n imgSrc: imgSrc\n });\n\n if (productsToCompare.length === maxSlots) {\n $('input[type=checkbox]:not(:checked)').attr('disabled', true);\n }\n\n redrawCompareSlots(productsToCompare);\n setCompareButton(productsToCompare.length);\n $compareBar.show();\n }\n\n return productsToCompare;\n}\n\n/**\n * Handles the deselection of a product\n *\n * @param {ProductComparisonList []} products - List of ID's of the products to compare\n * @param {string} pid - ID for product to compare\n * @return {ProductComparisonList []} List of ID's of the products to compare\n */\nfunction deselectProduct(products, pid) {\n var productsToCompare = copyProducts(products) || [];\n\n productsToCompare = productsToCompare.filter(function (product) {\n return product.pid !== pid;\n });\n\n if (productsToCompare.length === 0) {\n $compareBar.hide();\n }\n\n $('input#' + pid).prop('checked', false);\n $('input[type=checkbox]:not(:checked)').removeAttr('disabled');\n\n redrawCompareSlots(productsToCompare);\n setCompareButton(productsToCompare.length);\n return productsToCompare;\n}\n\n/**\n * Clears the Compare Bar and hides it\n * @return {undefined}\n */\nfunction clearCompareBar() {\n productsForComparison.forEach(function (product) {\n $(this).trigger('compare:deselected', { pid: product.pid });\n });\n\n productsForComparison = [];\n $('.compare input').prop('checked', false);\n $('.compare input[type=checkbox]:not(:checked)').removeAttr('disabled');\n $compareBar.hide();\n}\n\n/**\n * Update form action url to not have query string\n * @returns {undefined}\n */\nfunction updateSubmitUrl() {\n var form = $('.compare-products-form');\n var targetUrl = form.attr('action');\n var urlParts = targetUrl.split('?');\n if (urlParts[1]) {\n urlParts[1].split('&').forEach(function (keyValue) {\n var splittedValues = keyValue.split('=');\n var key = decodeURIComponent(splittedValues[0]);\n var value = decodeURIComponent(splittedValues[1]);\n if (key && value) {\n if (form.find('[name=\"' + key + '\"]').length === 0) {\n form.append('');\n }\n }\n });\n form.attr('action', urlParts[0]);\n }\n}\n\nmodule.exports = {\n /**\n * Handles Compare checkbox click\n */\n handleCompareClick: function () {\n $('div.page').on('click', '.compare input[type=checkbox]', function () {\n var pid = $(this).attr('id');\n var checked = $(this).is(':checked');\n var imgSrc = $(this).closest('.product-tile')\n .find('.tile-image')\n .prop('src');\n\n if (checked) {\n productsForComparison = selectProduct(productsForComparison, pid, imgSrc);\n $(this).trigger('compare:selected', { pid: pid });\n } else {\n productsForComparison = deselectProduct(productsForComparison, pid);\n $(this).trigger('compare:deselected', { pid: pid });\n }\n });\n },\n\n /**\n * Handles the Clear All link\n */\n handleClearAll: function () {\n $('.compare-bar a.clear-all').on('click', function (e) {\n e.preventDefault();\n clearCompareBar();\n });\n },\n\n /**\n * Handles deselection of a product on the Compare Bar\n */\n deselectProductOnCompareBar: function () {\n $('.compare-bar').on('click', '.close', function () {\n var pid = $(this).closest('.slot').data('pid').toString();\n productsForComparison = deselectProduct(productsForComparison, pid);\n $(this).trigger('compare:deselected', { pid: pid });\n });\n },\n\n /**\n * Selects products for comparison based on the checked status of the Compare checkboxes in\n * each product tile. Used when user goes back from the Compare Products page.\n */\n selectCheckedProducts: function () {\n $('.product-grid').ready(function () {\n if (location.hash) {\n location.hash.replace('#', '').split(',').forEach(function (id) {\n $('input#' + id).prop('checked', 'checked');\n });\n }\n $('.compare input:checked').each(function () {\n var pid = $(this).prop('id');\n var imgSrc = $(this).closest('.product-tile')\n .find('img.tile-image')\n .prop('src');\n productsForComparison = selectProduct(productsForComparison, pid, imgSrc);\n $(this).trigger('compare:selected', { pid: pid });\n });\n });\n },\n\n /**\n * Sets the \"backUrl\" property to the last attribute selected URL to ensure that when the user\n * goes back from the Compare Products page, the previously selected attributes are still\n * selected and applied to the previous search.\n */\n setBackUrl: function () {\n $('.search-results').on('click', '.refinements a', function () {\n $('input[name=\"backUrl\"]').val($(this).prop('href'));\n });\n },\n\n /**\n * Sets the history.pushState for history.back() to work from the Compare Products page.\n */\n setPushState: function () {\n $('.compare-products-form').on('submit', function () {\n updateSubmitUrl();\n var selectedProducts = $('.compare input:checked').map(function () {\n return this.id;\n }).get().join(',');\n history.pushState({}, document.title, lastKnownUrl + '#' + selectedProducts);\n location.hash = selectedProducts;\n\n $(this).find('input[name=\"cgid\"]').attr('value', $('input.category-id').val());\n });\n },\n catchFilterChange: function () {\n $('.container').on('click', '.refinements li a, .refinement-bar a.reset', function (e) {\n e.preventDefault();\n clearCompareBar();\n });\n },\n listenToFilterChange: function () {\n $('body').on('search:filter', function (e, data) {\n lastKnownUrl = data.currentTarget.href;\n });\n }\n};\n","'use strict';\n\n/**\n * Update DOM elements with Ajax results\n *\n * @param {Object} $results - jQuery DOM element\n * @param {string} selector - DOM element to look up in the $results\n * @return {undefined}\n */\nfunction updateDom($results, selector) {\n var $updates = $results.find(selector);\n $(selector).empty().html($updates.html());\n}\n\n/**\n * Keep refinement panes expanded/collapsed after Ajax refresh\n *\n * @param {Object} $results - jQuery DOM element\n * @return {undefined}\n */\nfunction handleRefinements($results) {\n $('.refinement.active').each(function () {\n $(this).removeClass('active');\n var activeDiv = $results.find('.' + $(this)[0].className.replace(/ /g, '.'));\n activeDiv.addClass('active');\n activeDiv.find('button.title').attr('aria-expanded', 'true');\n });\n\n updateDom($results, '.refinements');\n}\n\n/**\n * Parse Ajax results and updated select DOM elements\n *\n * @param {string} response - Ajax response HTML code\n * @return {undefined}\n */\nfunction parseResults(response) {\n var $results = $(response);\n var specialHandlers = {\n '.refinements': handleRefinements\n };\n\n // Update DOM elements that do not require special handling\n [\n '.grid-header',\n '.header-bar',\n '.header.page-title',\n '.product-grid',\n '.show-more',\n '.filter-bar'\n ].forEach(function (selector) {\n updateDom($results, selector);\n });\n\n Object.keys(specialHandlers).forEach(function (selector) {\n specialHandlers[selector]($results);\n });\n}\n\n/**\n * This function retrieves another page of content to display in the content search grid\n * @param {JQuery} $element - the jquery element that has the click event attached\n * @param {JQuery} $target - the jquery element that will receive the response\n * @return {undefined}\n */\nfunction getContent($element, $target) {\n var showMoreUrl = $element.data('url');\n $.spinner().start();\n $.ajax({\n url: showMoreUrl,\n method: 'GET',\n success: function (response) {\n $target.append(response);\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n}\n\n/**\n * Update sort option URLs from Ajax response\n *\n * @param {string} response - Ajax response HTML code\n * @return {undefined}\n */\nfunction updateSortOptions(response) {\n var $tempDom = $('
').append($(response));\n var sortOptions = $tempDom.find('.grid-footer').data('sort-options').options;\n sortOptions.forEach(function (option) {\n $('option.' + option.id).val(option.url);\n });\n}\n\nmodule.exports = {\n filter: function () {\n // Display refinements bar when Menu icon clicked\n $('.container').on('click', 'button.filter-results', function () {\n $('.refinement-bar, .modal-background').show();\n $('.refinement-bar').siblings().attr('aria-hidden', true);\n $('.refinement-bar').closest('.row').siblings().attr('aria-hidden', true);\n $('.refinement-bar').closest('.tab-pane.active').siblings().attr('aria-hidden', true);\n $('.refinement-bar').closest('.container.search-results').siblings().attr('aria-hidden', true);\n $('.refinement-bar .close').focus();\n });\n },\n\n closeRefinements: function () {\n // Refinements close button\n $('.container').on('click', '.refinement-bar button.close, .modal-background', function () {\n $('.refinement-bar, .modal-background').hide();\n $('.refinement-bar').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.row').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.tab-pane.active').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.container.search-results').siblings().attr('aria-hidden', false);\n $('.btn.filter-results').focus();\n });\n },\n\n resize: function () {\n // Close refinement bar and hide modal background if user resizes browser\n $(window).resize(function () {\n $('.refinement-bar, .modal-background').hide();\n $('.refinement-bar').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.row').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.tab-pane.active').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.container.search-results').siblings().attr('aria-hidden', false);\n });\n },\n\n sort: function () {\n // Handle sort order menu selection\n $('.container').on('change', '[name=sort-order]', function (e) {\n e.preventDefault();\n\n $.spinner().start();\n $(this).trigger('search:sort', this.value);\n $.ajax({\n url: this.value,\n data: { selectedUrl: this.value },\n method: 'GET',\n success: function (response) {\n $('.product-grid').empty().html(response);\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n },\n\n showMore: function () {\n // Show more products\n $('.container').on('click', '.show-more button', function (e) {\n e.stopPropagation();\n var showMoreUrl = $(this).data('url');\n e.preventDefault();\n\n $.spinner().start();\n $(this).trigger('search:showMore', e);\n $.ajax({\n url: showMoreUrl,\n data: { selectedUrl: showMoreUrl },\n method: 'GET',\n success: function (response) {\n $('.grid-footer').replaceWith(response);\n updateSortOptions(response);\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n },\n\n applyFilter: function () {\n // Handle refinement value selection and reset click\n $('.container').on(\n 'click',\n '.refinements li button, .refinement-bar button.reset, .filter-value button, .swatch-filter button',\n function (e) {\n e.preventDefault();\n e.stopPropagation();\n\n $.spinner().start();\n $(this).trigger('search:filter', e);\n var attributeId = '#' + $(this).find('span').last().attr('id');\n $.ajax({\n url: $(this).data('href'),\n data: {\n page: $('.grid-footer').data('page-number'),\n selectedUrl: $(this).data('href')\n },\n method: 'GET',\n success: function (response) {\n parseResults(response);\n $.spinner().stop();\n $(attributeId).parent('button').focus();\n },\n error: function () {\n $.spinner().stop();\n $(attributeId).parent('button').focus();\n }\n });\n });\n },\n\n showContentTab: function () {\n // Display content results from the search\n $('.container').on('click', '.content-search', function () {\n if ($('#content-search-results').html() === '') {\n getContent($(this), $('#content-search-results'));\n }\n });\n\n // Display the next page of content results from the search\n $('.container').on('click', '.show-more-content button', function () {\n getContent($(this), $('#content-search-results'));\n $('.show-more-content').remove();\n });\n }\n};\n","'use strict';\n\nmodule.exports = function (include) {\n if (typeof include === 'function') {\n include();\n } else if (typeof include === 'object') {\n Object.keys(include).forEach(function (key) {\n if (typeof include[key] === 'function') {\n include[key]();\n }\n });\n }\n};\n","'use strict';\n\nmodule.exports = {\n init: function () {\n $('.info-icon').on('mouseenter focusin', function () {\n $(this).find('.tooltip').removeClass('d-none');\n });\n\n $('.info-icon').on('mouseleave focusout', function () {\n $(this).find('.tooltip').addClass('d-none');\n });\n }\n};\n","'use strict';\n\nvar tooltip = require('app_rws/components/toolTip');\nvar baseSearch = require('base/search/search');\n\n/**\n* Update url to match current search and paging state\n* @return {undefined}\n*/\nfunction updateSearchUrl() {\n const permalink = document.querySelector('.permalink');\n if (permalink && /^https?:\\/\\//.test(permalink.value)) {\n history.replaceState(null, null, permalink.value);\n }\n}\n\n/**\n * Update DOM elements with Ajax results\n *\n * Additionaly reinitialize tooltips\n * @param {Object} $results - jQuery DOM element\n * @param {string} selector - DOM element to look up in the $results\n * @return {undefined}\n */\nfunction updateDom($results, selector) {\n var $updates = $results.find(selector);\n $(selector).empty().html($updates.html());\n tooltip.init();\n}\n\n/**\n * Keep refinement panes expanded/collapsed after Ajax refresh\n *\n * @param {Object} $results - jQuery DOM element\n * @return {undefined}\n */\nfunction handleRefinements($results) {\n $('.refinement.active').each(function () {\n $(this).removeClass('active');\n\n $results\n .find('.' + $(this)[0].className.replace(/ /g, '.'))\n .addClass('active');\n });\n\n updateDom($results, '.refinements');\n}\n\n/**\n *\n * @param {Object} $results - jQuery DOM element\n * @return {undefined}\n */\nfunction handleGridHeader($results) {\n updateDom($results, '.grid-header');\n}\n\n/**\n * Parse Ajax results and updated select DOM elements\n *\n * @param {string} response - Ajax response HTML code\n * @return {undefined}\n */\nfunction parseResults(response) {\n var $results = $(response);\n var specialHandlers = {\n '.refinements': handleRefinements,\n '.grid-header': handleGridHeader\n };\n\n // Update DOM elements that do not require special handling\n [\n '.header-bar',\n '.header.page-title',\n '.product-grid',\n '.show-more',\n '.filter-bar',\n '.js-sort-order'\n ].forEach(function (selector) {\n updateDom($results, selector);\n });\n\n Object.keys(specialHandlers).forEach(function (selector) {\n specialHandlers[selector]($results);\n });\n}\n\n/**\n * Add more tiles and add focus to next tile\n *\n * @param {string} response - Ajax response HTML code\n * @return {undefined}\n */\nfunction addTiles(response) {\n var $newHtml = $($.parseHTML(response));\n var firstItemLink = $newHtml.filter('.st-product-grid__item').first().find('.c-product-tile__image-container a');\n setTimeout(function () {\n $(firstItemLink).focus();\n }, 500);\n $('.grid-footer').replaceWith($newHtml);\n}\n\n/**\n * Update sort option URLs from Ajax response\n *\n * @param {string} response - Ajax response HTML code\n * @return {undefined}\n */\nfunction updateSortOptions(response) {\n var $tempDom = $('
').append($(response));\n var sortOptions = $tempDom.find('.grid-footer').data('sort-options').options;\n sortOptions.forEach(function (option) {\n $('option.' + option.id).val(option.url);\n });\n}\n\nif (typeof Object.assign !== 'function') {\n Object.assign = function (target, varArgs) {\n if (target == null) { // TypeError if undefined or null\n throw new TypeError('Cannot convert undefined or null to object');\n }\n\n var to = Object(target);\n\n for (var index = 1; index < arguments.length; index++) {\n var nextSource = arguments[index];\n\n if (nextSource != null) { // Skip over if undefined or null\n for (var nextKey in nextSource) { //eslint-disable-line\n // Avoid bugs when hasOwnProperty is shadowed\n if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n }\n return to;\n };\n}\n\nfunction loadArticles() {\n var $tabs = $('.js-nav-tabs-wrapper');\n if ($tabs.length && $tabs.data('has-content') === true) {\n $('.js-tab-link-content').trigger('click');\n }\n}\n\nmodule.exports = Object.assign(baseSearch, {\n showMore: function () {\n // Show more products\n $('.container').on('click', '.show-more button', function (e) {\n e.stopPropagation();\n var showMoreUrl = $(this).data('url');\n e.preventDefault();\n\n $.spinner().start();\n $(this).trigger('search:showMore', e);\n $.ajax({\n url: showMoreUrl,\n data: { selectedUrl: showMoreUrl },\n method: 'GET',\n success: function (response) {\n // Customization: Added focus to first item\n addTiles(response);\n updateSortOptions(response);\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n },\n\n applyFilter: function () {\n // Handle refinement value selection and reset click\n $('.container').on(\n 'click',\n '.refinements li a, .refinements li button, .refinement-bar .reset, .filter-value a, .swatch-filter a',\n function (e) { //eslint-disable-line\n var attributeId = '#' + $(this).find('span').last().attr('id');\n var $this = $(this);\n var url = $this.data('href');\n if ($(this).hasClass('category')) {\n window.location = $(this).attr('href');\n return true;\n }\n e.preventDefault();\n e.stopPropagation();\n\n $.spinner().start();\n $(this).trigger('search:filter', e);\n $.ajax({\n url: url,\n data: {\n page: $('.grid-footer').data('page-number')\n },\n method: 'GET',\n success: function (response) {\n parseResults(response);\n updateSearchUrl();\n $.spinner().stop();\n $(attributeId).parent('button').focus();\n },\n error: function () {\n $.spinner().stop();\n $(attributeId).parent('button').focus();\n }\n });\n });\n },\n\n sort: function () {\n // Handle sort order menu selection\n $('.container').on('change', '[name=sort-order]', function (e) {\n e.preventDefault();\n\n $.spinner().start();\n $(this).trigger('search:sort', this.value);\n $.ajax({\n url: this.value,\n data: { selectedUrl: this.value },\n method: 'GET',\n success: function (response) {\n $('.product-grid').empty().html(response);\n // reinit tooltips\n tooltip.init();\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n },\n\n loadArticles: loadArticles\n});\n","'use strict';\n\nvar processInclude = require('base/util');\n\n$(document).ready(function () {\n processInclude(require('./search/search'));\n processInclude(require('plugin_productcompare/product/compare'));\n});\n"],"names":["module","$","tooltip","require","baseSearch","updateSearchUrl","permalink","document","history","updateDom","$results","selector","$updates","handleRefinements","handleGridHeader","parseResults","response","specialHandlers","Object","addTiles","$newHtml","firstItemLink","setTimeout","updateSortOptions","$tempDom","sortOptions","option","target","varArgs","TypeError","to","index","arguments","nextSource","nextKey","loadArticles","$tabs","e","showMoreUrl","attributeId","$this","url","window","processInclude"],"mappings":";;;;AAAa;;AAEb;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB;;AAEA;AACA;AACA;AACA,WAAW,uBAAuB;AAClC,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,0BAA0B;AACrC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,0BAA0B;AACrC,YAAY,0BAA0B;AACtC;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;;AAET;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,0BAA0B;AACrC,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY,0BAA0B;AACtC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,0BAA0B;AACrC,WAAW,QAAQ;AACnB,YAAY,0BAA0B;AACtC;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA,gDAAgD,kBAAkB;AAClE,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sDAAsD,UAAU;AAChE,cAAc;AACd;AACA,wDAAwD,UAAU;AAClE;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,UAAU;AAC9D,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,UAAU;AAChE,aAAa;AACb,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,gCAAgC;AAChC;;AAEA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;AC5Sa;;AAEb;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAwB,yBAAyB;AACjD;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAwB,0BAA0B;AAClD;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;A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