Liferay.Loader.define("commerce-frontend-taglib@19.1.14/add_organizations_modal/OrganizationListItem.es",["module","exports","require","frontend-js-metal-web$metal-component","frontend-js-metal-web$metal-soy","./OrganizationListItem.soy","../add_to_tick_item/AddToTickItem.es","../autocomplete_item/AutocompleteItem.es"],(function(e,t,i){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.OrganizationListItem=void 0;var n=_interopRequireDefault(i("frontend-js-metal-web$metal-component")),r=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=n?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(i,r,o):i[r]=e[r]}i.default=e,t&&t.set(e,i);return i}(i("frontend-js-metal-web$metal-soy")),o=_interopRequireDefault(i("./OrganizationListItem.soy"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}i("../add_to_tick_item/AddToTickItem.es"),i("../autocomplete_item/AutocompleteItem.es");class OrganizationListItem extends n.default{syncSelectedOrganizations(){return this._selected=this.selectedOrganizations.reduce(((e,t)=>e||t.id===this.id),!1),this._selected}_handleToggleItem(e){return e.preventDefault(),this.emit("toggleItem",{id:this.id,name:this.name})}}t.OrganizationListItem=OrganizationListItem,r.default.register(OrganizationListItem,o.default),OrganizationListItem.STATE={_selected:r.Config.bool().value(!1),colorId:r.Config.number(),id:r.Config.oneOfType([r.Config.number(),r.Config.string()]),name:r.Config.string().required(),query:r.Config.string(),selectedOrganizations:r.Config.array(r.Config.shapeOf({id:r.Config.oneOfType([r.Config.number(),r.Config.string()]),name:r.Config.string()})).value([])};var a=OrganizationListItem;t.default=a}}));
//# sourceMappingURL=OrganizationListItem.es.js.map