Liferay.Loader.define("commerce-product-content-web@4.0.80/js/CategorySelector.es",["module","exports","require","frontend-js-metal-web$metal-component","frontend-js-metal-web$metal-soy","frontend-js-metal-web$metal-state","./CategorySelector.soy"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CategorySelector=void 0;var o=_interopRequireDefault(r("frontend-js-metal-web$metal-component")),a=_interopRequireDefault(r("frontend-js-metal-web$metal-soy")),s=r("frontend-js-metal-web$metal-state"),n=_interopRequireDefault(r("./CategorySelector.soy"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}class CategorySelector extends o.default{onEntriesChanged_(){this.rule.categoryIdsTitles=this.categoriesSelector_.entries.values.map((e=>e.value)),this.rule.queryValues=this.categoriesSelector_.entries.keys.join(",")}rendered(){AUI().use("liferay-commerce-frontend-asset-categories-selector",(()=>{const e={categoryIds:this.rule.queryValues||"",categoryTitles:this.rule.categoryIdsTitles||[],contentBox:this.element,eventName:this.eventName,groupIds:this.groupIds,hiddenInput:"#".concat(this.refs.hiddenInput.getAttribute("id")),portletURL:this.categorySelectorURL,vocabularyIds:this.vocabularyIds};this.categoriesSelector_=new Liferay.AssetTaglibCategoriesSelector(e);const t=this.categoriesSelector_.entries;t.after("add",this.onEntriesChanged_,this),t.after("remove",this.onEntriesChanged_,this),this.categoriesSelector_.render(),this.element.parentNode.removeAttribute("tabindex")}))}}t.CategorySelector=CategorySelector,CategorySelector.STATE={categorySelectorURL:s.Config.string().value(""),eventName:s.Config.string().value(""),groupIds:s.Config.string().value(""),hiddenInput:s.Config.string().value(""),index:s.Config.number().value(0),namespace:s.Config.string().value(""),rule:s.Config.object().value({}),vocabularyIds:s.Config.string().value("")},a.default.register(CategorySelector,n.default);var i=CategorySelector;t.default=i}}));
//# sourceMappingURL=CategorySelector.es.js.map