{"version":3,"file":"pfe-autocomplete.min.js","sources":["../_temp/pfe-autocomplete.js"],"sourcesContent":["/*!\n * PatternFly Elements: PfeAutocomplete 1.12.3\n * @license\n * Copyright 2021 Red Hat, Inc.\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 THE\n * SOFTWARE.\n * \n*/\n\nimport PFElement from \"../../pfelement/dist/pfelement.js\";\nimport \"../../pfe-button/dist/pfe-button.js\";\n\nconst KEYCODE = {\n ENTER: 13,\n DOWN: 40,\n UP: 38,\n ESC: 27,\n};\n\n// use this variable to debounce api call when user types very fast\nlet throttle = false;\n\nclass PfeAutocomplete extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.12.3\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
\n
\n \n \n\n \n \n\n \n \n\n \n \n
\n \n
\n\n\n`;\n }\n\n // @TODO: Deprecating in 1.0 release\n // Injected at build-time\n static get schemaProperties() {\n return {\"debounce_timer\":{\"title\":\"Debounce\",\"description\":\"The amount of time that should pass before the next API call is made\",\"type\":\"string\",\"prefixed\":false},\"init_value\":{\"title\":\"Initial value\",\"description\":\"An initial value to show in the input field\",\"type\":\"string\",\"prefixed\":false},\"is_disabled\":{\"title\":\"Is disabled\",\"description\":\"Disable the input\",\"type\":\"boolean\",\"prefixed\":false},\"button-text\":{\"title\":\"Button text\",\"description\":\"Add button with text next to input field\",\"type\":\"string\",\"prefixed\":false}};\n }\n\n // Injected at build-time\n static get slots() {\n return {\"content\":{\"title\":\"Content\",\"type\":\"array\",\"namedSlot\":false,\"items\":{\"oneOf\":[{\"$ref\":\"input\"}]},\"required\":true}};\n }\n\n static get tag() {\n return \"pfe-autocomplete\";\n }\n\n get schemaUrl() {\n return \"pfe-autocomplete.json\";\n }\n\n get templateUrl() {\n return \"pfe-autocomplete.html\";\n }\n\n get styleUrl() {\n return \"pfe-autocomplete.scss\";\n }\n\n static get properties() {\n return {\n initValue: {\n title: \"Initial Value\",\n type: String,\n observer: \"_initValueChanged\",\n },\n loading: {\n title: \"Loading\",\n type: Boolean,\n default: false,\n observer: \"_loadingChanged\",\n },\n isDisabled: {\n title: \"Is disabled\",\n type: Boolean,\n default: false,\n observer: \"_isDisabledChanged\",\n },\n debounce: {\n title: \"Debounce\",\n type: Number,\n default: 300,\n },\n selectedValue: {\n title: \"Selected value\",\n type: String,\n },\n buttonText: {\n title: \"Button text\",\n type: String,\n observer: \"_buttonTextChanged\",\n },\n };\n }\n\n static get events() {\n return {\n search: `${this.tag}:search-event`,\n select: `${this.tag}:option-selected`,\n optionsShown: `${this.tag}:options-shown`,\n optionCleared: `${this.tag}:option-cleared`,\n slotchange: `slotchange`,\n };\n }\n\n constructor() {\n super(PfeAutocomplete);\n\n this._inputInit();\n\n this._slotchangeHandler = this._slotchangeHandler.bind(this);\n\n this._slot = this.shadowRoot.querySelector(\"slot\");\n this._slot.addEventListener(PfeAutocomplete.events.slotchange, this._slotchangeHandler);\n\n // @TODO: Confirm this is translatable\n this._ariaAnnounceTemplate = \"There are ${numOptions} suggestions. Use the up and down arrows to browse.\";\n\n // clear button\n this._clearBtn = this.shadowRoot.querySelector(\".clear-search\");\n this._clearBtn.addEventListener(\"click\", this._clear.bind(this));\n\n // search button\n this._searchBtn = this.shadowRoot.querySelector(\".search-button\");\n this._searchBtn.addEventListener(\"click\", this._search.bind(this));\n\n // textual search button\n this._searchBtnTextual = this.shadowRoot.querySelector(\".search-button--textual\");\n this._searchBtnText = this.shadowRoot.querySelector(\".search-button__text\");\n this._searchBtnTextual.addEventListener(\"click\", this._search.bind(this));\n\n this._dropdown = this.shadowRoot.querySelector(\"#dropdown\");\n this._dropdown.data = [];\n\n this.activeIndex = null;\n\n this.addEventListener(\"keyup\", this._inputKeyUp.bind(this));\n\n // these two events, fire search\n this.addEventListener(PfeAutocomplete.events.search, this._closeDroplist.bind(this));\n this.addEventListener(PfeAutocomplete.events.select, this._optionSelected.bind(this));\n }\n\n _inputInit() {\n // input box\n let slotNodes = this.shadowRoot.querySelector(\"slot\").assignedNodes();\n let slotElems = slotNodes.filter((n) => n.nodeType === Node.ELEMENT_NODE);\n if (slotElems.length === 0) {\n console.error(`${PfeAutocomplete.tag}: There must be a input tag in the light DOM`);\n return;\n }\n this._input = slotElems[0];\n\n if (this._input.tagName.toLowerCase() !== \"input\") {\n console.error(`${PfeAutocomplete.tag}: The only child in the light DOM must be an input tag`);\n\n return;\n }\n\n this._input.addEventListener(\"input\", this._inputChanged.bind(this));\n this._input.addEventListener(\"blur\", this._closeDroplist.bind(this));\n\n this._input.setAttribute(\"role\", \"combobox\");\n\n if (!this._input.hasAttribute(\"aria-label\")) {\n this._input.setAttribute(\"aria-label\", \"Search\");\n }\n\n this._input.setAttribute(\"aria-autocomplete\", \"list\");\n this._input.setAttribute(\"aria-haspopup\", \"true\");\n this._input.setAttribute(\"aria-owns\", \"droplist-items\");\n this._input.setAttribute(\"aria-controls\", \"droplist-items\");\n this._input.setAttribute(\"aria-expanded\", \"false\");\n this._input.setAttribute(\"type\", \"search\");\n this._input.setAttribute(\"autocomplete\", \"off\");\n this._input.setAttribute(\"autocorrect\", \"off\");\n this._input.setAttribute(\"autocapitalize\", \"off\");\n this._input.setAttribute(\"spellcheck\", \"false\");\n\n this._input.setAttribute(\n \"style\",\n `input[type=search]::-ms-clear { display: none; width : 0; height: 0; }input[type = search]:: -ms - reveal { display: none; width: 0; height: 0; }\" nput[type=\"search\"]::-webkit-search-decoration, input[type=\"search\"]::-webkit-search-cancel-button, input[type=\"search\"]::-webkit-search-results-button, input[type=\"search\"]::-webkit-search-results-decoration { display: none; }`\n );\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(\"keyup\", this._inputKeyUp);\n\n this.removeEventListener(PfeAutocomplete.events.search, this._closeDroplist);\n this.removeEventListener(PfeAutocomplete.events.select, this._optionSelected);\n this._slot.removeEventListener(PfeAutocomplete.events.slotchange, this._slotchangeHandler);\n if (this._input) {\n this._input.removeEventListener(\"input\", this._inputChanged);\n this._input.removeEventListener(\"blur\", this._closeDroplist);\n }\n\n this._clearBtn.removeEventListener(\"click\", this._clear);\n this._searchBtn.removeEventListener(\"click\", this._search);\n this._searchBtnTextual.removeEventListener(\"click\", this._search);\n }\n\n _initValueChanged(oldVal, newVal) {\n if (newVal) {\n // set inputbox and buttons in the inner component\n this._input.value = newVal;\n if (newVal !== \"\" && !this.isDisabled) {\n this._searchBtn.removeAttribute(\"disabled\");\n this._searchBtnTextual.removeAttribute(\"disabled\");\n this._clearBtn.removeAttribute(\"hidden\");\n } else {\n this._searchBtn.setAttribute(\"disabled\", \"\");\n this._searchBtnTextual.setAttribute(\"disabled\", \"\");\n this._clearBtn.setAttribute(\"hidden\", \"\");\n }\n }\n }\n\n _loadingChanged() {\n if (!this.loading || this._input.value === \"\") {\n this.shadowRoot.querySelector(\".loading\").setAttribute(\"hidden\", \"\");\n } else {\n this.shadowRoot.querySelector(\".loading\").removeAttribute(\"hidden\");\n }\n }\n\n _isDisabledChanged() {\n if (this.isDisabled) {\n this._clearBtn.setAttribute(\"disabled\", \"\");\n this._searchBtn.setAttribute(\"disabled\", \"\");\n this._searchBtnTextual.setAttribute(\"disabled\", \"\");\n this._input.setAttribute(\"disabled\", \"\");\n } else {\n this._clearBtn.removeAttribute(\"disabled\");\n this._searchBtn.removeAttribute(\"disabled\");\n this._searchBtnTextual.removeAttribute(\"disabled\");\n this._input.removeAttribute(\"disabled\");\n }\n }\n\n _buttonTextChanged(oldVal, newVal) {\n if (oldVal === null) {\n this._searchBtn.setAttribute(\"hidden\", \"\");\n this._searchBtnText.innerHTML = newVal || \"Search\";\n this._searchBtnTextual.removeAttribute(\"hidden\");\n } else if (newVal === null || newVal === \"\") {\n this._searchBtnTextual.setAttribute(\"hidden\", \"\");\n this._searchBtn.removeAttribute(\"hidden\");\n } else {\n this._searchBtnText.innerHTML = newVal || \"Search\";\n }\n }\n\n _slotchangeHandler() {\n this._inputInit();\n this._dropdown._ariaAnnounceTemplate = this.getAttribute(\"aria-announce-template\") || this._ariaAnnounceTemplate;\n }\n\n _inputChanged() {\n if (this._input.value === \"\") {\n this._searchBtn.setAttribute(\"disabled\", \"\");\n this._searchBtnTextual.setAttribute(\"disabled\", \"\");\n this._clearBtn.setAttribute(\"hidden\", \"\");\n\n this._reset();\n return;\n } else {\n if (!this._input.hasAttribute(\"disabled\")) {\n this._searchBtn.removeAttribute(\"disabled\");\n this._searchBtnTextual.removeAttribute(\"disabled\");\n }\n this._clearBtn.removeAttribute(\"hidden\");\n }\n\n if (throttle === false) {\n throttle = true;\n\n window.setTimeout(() => {\n this._sendAutocompleteRequest(this._input.value);\n throttle = false;\n }, this.debounce);\n }\n }\n\n _clear() {\n this._input.value = \"\";\n this._clearBtn.setAttribute(\"hidden\", \"\");\n this._searchBtn.setAttribute(\"disabled\", \"\");\n this._searchBtnTextual.setAttribute(\"disabled\", \"\");\n this._input.focus();\n this.emitEvent(PfeAutocomplete.events.optionCleared, {\n bubbles: true,\n composed: true,\n detail: { searchValue: \"\" },\n });\n }\n\n _search() {\n this._doSearch(this._input.value);\n }\n\n _closeDroplist() {\n this._dropdown.open = null;\n this._dropdown.removeAttribute(\"active-index\");\n this._input.setAttribute(\"aria-expanded\", \"false\");\n }\n\n _openDroplist() {\n this.activeIndex = null;\n this._dropdown.open = true;\n this._dropdown.setAttribute(\"active-index\", null);\n this.emitEvent(PfeAutocomplete.events.optionsShown, {\n composed: true,\n });\n this._input.setAttribute(\"aria-expanded\", \"true\");\n }\n\n _optionSelected(e) {\n let selectedValue = e.detail.optionValue;\n\n // update input box with selected value from options list\n this._input.value = selectedValue;\n\n // send search request\n this._doSearch(selectedValue);\n }\n\n _doSearch(searchQuery) {\n this.emitEvent(PfeAutocomplete.events.search, {\n detail: { searchValue: searchQuery },\n composed: true,\n });\n this._reset();\n this.selectedValue = searchQuery;\n }\n\n _sendAutocompleteRequest(input) {\n if (!this.autocompleteRequest) return;\n\n this.autocompleteRequest({ query: input }, this._autocompleteCallback.bind(this));\n }\n\n _autocompleteCallback(response) {\n this._dropdown.data = response;\n this._dropdown.reflow = true;\n response.length !== 0 ? this._openDroplist() : this._closeDroplist();\n }\n\n _reset() {\n this._dropdown.activeIndex = null;\n this._input.setAttribute(\"aria-activedescendant\", \"\");\n this._dropdown.data = [];\n this._closeDroplist();\n }\n\n /**\n * Returns the HTML of the active element\n * @param {number} activeIndex Index of an element in the droplist\n * @return {string} The HTML inside of the given index as a string\n */\n _activeOption(activeIndex) {\n if (activeIndex === null || activeIndex === \"null\") return;\n return this._dropdown.shadowRoot.querySelector(\"li:nth-child(\" + (parseInt(activeIndex, 10) + 1) + \")\").innerHTML;\n }\n\n /**\n * Handle keyboard input, we care about arrow keys, enter, and escape\n * @param {object} e - keypress event\n */\n _inputKeyUp(e) {\n let key = e.keyCode;\n\n // Check to see if it's a key we care about\n if (\n this._dropdown.data.length === 0 &&\n key !== KEYCODE.DOWN &&\n key !== KEYCODE.UP &&\n key !== KEYCODE.ENTER &&\n key !== KEYCODE.ESC\n )\n return;\n\n let activeIndex = this._dropdown.activeIndex;\n let optionsLength = this._dropdown.data.length;\n\n if (key == KEYCODE.ESC) {\n this._closeDroplist();\n } else if (key === KEYCODE.UP) {\n if (!this._dropdown.open) {\n return;\n }\n\n activeIndex = activeIndex === null || activeIndex === \"null\" ? optionsLength : parseInt(activeIndex, 10);\n\n activeIndex -= 1;\n\n // Go to the last item if we're at -1 index\n if (activeIndex < 0) {\n activeIndex = optionsLength - 1;\n }\n\n // Get the HTML of the active element\n this._input.value = this._activeOption(activeIndex);\n } else if (key === KEYCODE.DOWN) {\n if (!this._dropdown.open) {\n return;\n }\n\n activeIndex = activeIndex === null || activeIndex === \"null\" ? -1 : parseInt(activeIndex, 10);\n activeIndex += 1;\n\n if (activeIndex > optionsLength - 1) {\n activeIndex = 0;\n }\n\n // Go to the last item if we're at -1 index\n this._input.value = this._activeOption(activeIndex);\n } else if (key === KEYCODE.ENTER) {\n if (this._activeOption(activeIndex)) {\n this.emitEvent(PfeAutocomplete.events.select, {\n detail: { optionValue: this._activeOption(activeIndex) },\n composed: true,\n });\n\n return;\n }\n\n let selectedValue = this._input.value;\n this._doSearch(selectedValue);\n return;\n }\n\n if (activeIndex !== null && activeIndex !== \"null\") {\n this._input.setAttribute(\"aria-activedescendant\", \"option-\" + activeIndex);\n } else {\n this._input.setAttribute(\"aria-activedescendant\", \"\");\n }\n\n this.activeIndex = activeIndex;\n this._dropdown.activeIndex = activeIndex;\n }\n}\n\n/*\n* - Attributes ------------------------------------\n* open | Set when the combo box dropdown is open\n* active-index | Set selected option\n* reflow | Re-renders the dropdown\n\n* - Events ----------------------------------------\n* pfe-autocomplete:option-selected | Fires when an option is selected.\n event.details.optionValue contains the selected value.\n*/\n\nclass PfeSearchDroplist extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.12.3\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
\n
\n \n
`;\n }\n\n static get tag() {\n return \"pfe-search-droplist\";\n }\n\n get templateUrl() {\n return \"pfe-search-droplist.html\";\n }\n\n get styleUrl() {\n return \"pfe-search-droplist.scss\";\n }\n\n static get properties() {\n return {\n open: {\n title: \"Open\",\n type: Boolean,\n },\n reflow: {\n title: \"Reflow\",\n type: Boolean,\n observer: \"_renderOptions\",\n },\n activeIndex: {\n title: \"Active index\",\n type: Number,\n observer: \"_activeIndexChanged\",\n },\n };\n }\n\n constructor() {\n super(PfeSearchDroplist);\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n this._ariaAnnounce = this.shadowRoot.querySelector(\".suggestions-aria-help\");\n\n this.activeIndex = null;\n this._ul = this.shadowRoot.querySelector(\"ul\");\n this._ul.addEventListener(\"mousedown\", this._optionSelected.bind(this));\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._ul.removeEventListener(\"mousedown\", this._optionSelected);\n }\n\n _optionSelected(e) {\n if (e.target.tagName === \"LI\") {\n this.emitEvent(PfeAutocomplete.events.select, {\n detail: { optionValue: e.target.innerText },\n composed: true,\n });\n }\n }\n\n _renderOptions() {\n let options = this.data;\n let ariaAnnounceText = \"\";\n\n if (this._ariaAnnounceTemplate) {\n ariaAnnounceText = this._ariaAnnounceTemplate.replace(\"${numOptions}\", options.length);\n }\n\n this._ariaAnnounce.textContent = ariaAnnounceText;\n this._ariaAnnounce.setAttribute(\"aria-live\", \"polite\");\n\n this._ul.innerHTML = `${options\n .map((item, index) => {\n return `
  • ${item}
  • `;\n })\n .join(\"\")}`;\n }\n\n /**\n * Handle state changes when active droplist item has been changed\n */\n _activeIndexChanged() {\n // Make a quick exit if necessary\n if (!this.data || this.data.length === 0 || this.activeIndex === null || this.activeIndex === \"null\") return;\n\n // Previous element may not exist\n const previouslyActiveElement = this._ul.querySelector(\".active\");\n const activeOption = this._ul.querySelector(\"li:nth-child(\" + (parseInt(this.activeIndex, 10) + 1) + \")\");\n\n // Handle any element that should no longer be selected\n if (previouslyActiveElement) {\n previouslyActiveElement.classList.remove(\"active\");\n previouslyActiveElement.removeAttribute(\"aria-selected\");\n }\n\n // Update newly selected element to have proper attributes and settings\n activeOption.classList.add(\"active\");\n // @note Set aria-selected on the active list item, should only occur on the list item that is being referenced\n // by the aria-activedescendant attribute. This attribute is required when creating a listbox autocomplete\n // component. It helps ensure that the screen reader user knows what element is active when moving through the\n // list of items with the arrow keys\n activeOption.setAttribute(\"aria-selected\", \"true\");\n\n // scroll to selected element when selected item with keyboard is out of view\n let ulWrapper = this.shadowRoot.querySelector(\".droplist\");\n let activeOptionHeight = activeOption.offsetHeight;\n activeOptionHeight += parseInt(window.getComputedStyle(activeOption).getPropertyValue(\"margin-bottom\"), 10);\n ulWrapper.scrollTop = activeOption.offsetTop - ulWrapper.offsetHeight + activeOptionHeight;\n\n return activeOption;\n }\n}\n\nPFElement.create(PfeSearchDroplist);\nPFElement.create(PfeAutocomplete);\n\nexport default PfeAutocomplete;\n"],"names":["KEYCODE","throttle","PfeAutocomplete","PFElement","version","html","schemaProperties","debounce_timer","title","description","type","prefixed","init_value","is_disabled","button-text","slots","content","namedSlot","items","oneOf","$ref","required","tag","schemaUrl","templateUrl","styleUrl","properties","initValue","String","observer","loading","Boolean","default","isDisabled","debounce","Number","selectedValue","buttonText","events","search","this","select","optionsShown","optionCleared","slotchange","[object Object]","super","_inputInit","_slotchangeHandler","bind","_slot","shadowRoot","querySelector","addEventListener","_ariaAnnounceTemplate","_clearBtn","_clear","_searchBtn","_search","_searchBtnTextual","_searchBtnText","_dropdown","data","activeIndex","_inputKeyUp","_closeDroplist","_optionSelected","slotElems","assignedNodes","filter","n","nodeType","Node","ELEMENT_NODE","length","_input","tagName","toLowerCase","_inputChanged","setAttribute","hasAttribute","console","error","disconnectedCallback","removeEventListener","oldVal","newVal","value","removeAttribute","innerHTML","getAttribute","_reset","window","setTimeout","_sendAutocompleteRequest","focus","emitEvent","bubbles","composed","detail","searchValue","_doSearch","open","e","optionValue","searchQuery","input","autocompleteRequest","query","_autocompleteCallback","response","reflow","_openDroplist","parseInt","key","keyCode","optionsLength","_activeOption","PfeSearchDroplist","connectedCallback","_ariaAnnounce","_ul","target","innerText","options","ariaAnnounceText","replace","textContent","map","item","index","join","previouslyActiveElement","activeOption","classList","remove","add","ulWrapper","activeOptionHeight","offsetHeight","getComputedStyle","getPropertyValue","scrollTop","offsetTop","create"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EA4BA,MAAMA,EACG,GADHA,EAEE,GAFFA,EAGA,GAHAA,EAIC,GAIP,IAAIC,GAAW,EAEf,MAAMC,UAAwBC,EAG5BC,qBACE,MAAO,SAITC,WACE,MAAO,y9TAoDTC,8BACE,MAAO,CAACC,eAAiB,CAACC,MAAQ,WAAWC,YAAc,uEAAuEC,KAAO,SAASC,UAAW,GAAOC,WAAa,CAACJ,MAAQ,gBAAgBC,YAAc,8CAA8CC,KAAO,SAASC,UAAW,GAAOE,YAAc,CAACL,MAAQ,cAAcC,YAAc,oBAAoBC,KAAO,UAAUC,UAAW,GAAOG,cAAc,CAACN,MAAQ,cAAcC,YAAc,2CAA2CC,KAAO,SAASC,UAAW,IAI7gBI,mBACE,MAAO,CAACC,QAAU,CAACR,MAAQ,UAAUE,KAAO,QAAQO,WAAY,EAAMC,MAAQ,CAACC,MAAQ,CAAC,CAACC,KAAO,WAAWC,UAAW,IAGxHC,iBACE,MAAO,mBAGTC,gBACE,MAAO,wBAGTC,kBACE,MAAO,wBAGTC,eACE,MAAO,wBAGTC,wBACE,MAAO,CACLC,UAAW,CACTnB,MAAO,gBACPE,KAAMkB,OACNC,SAAU,qBAEZC,QAAS,CACPtB,MAAO,UACPE,KAAMqB,QACNC,SAAS,EACTH,SAAU,mBAEZI,WAAY,CACVzB,MAAO,cACPE,KAAMqB,QACNC,SAAS,EACTH,SAAU,sBAEZK,SAAU,CACR1B,MAAO,WACPE,KAAMyB,OACNH,QAAS,KAEXI,cAAe,CACb5B,MAAO,iBACPE,KAAMkB,QAERS,WAAY,CACV7B,MAAO,cACPE,KAAMkB,OACNC,SAAU,uBAKhBS,oBACE,MAAO,CACLC,OAAWC,KAAKlB,IAAR,gBACRmB,OAAWD,KAAKlB,IAAR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