Liferay.Loader.define("@liferay/object-web@1.0.153/js/components/ObjectDetails/ScopeContainer",["module","exports","require","@frontend-taglib-clay$clayui/panel","@liferay/object-js-components-web","liferay!frontend-js-react-web$react","./ObjectDetails.scss"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.ScopeContainer=function ScopeContainer({companyKeyValuePair:t,errors:a,hasUpdateObjectDefinitionPermission:o,isApproved:i,setValues:u,siteKeyValuePair:c,values:s}){var d;const[f,y]=(0,l.useState)(""),[p,g]=(0,l.useState)(""),b=(0,l.useMemo)((()=>(0,n.filterArrayByQuery)({array:"company"===s.scope?t:c,creationLanguageId:s.defaultLanguageId,query:f,str:"value"})),[s.defaultLanguageId,s.scope,t,c,f]);return(0,l.useEffect)((()=>{((e,t)=>{const a=e.find((e=>e.key===t));a&&g(a.value)})("company"===s.scope?t:c,s.panelCategoryKey)}),[s.scope,t,c]),l.default.createElement(r.default,{collapsable:!0,defaultExpanded:!0,displayTitle:Liferay.Language.get("scope"),displayType:"unstyled"},l.default.createElement(r.default.Body,null,l.default.createElement(n.SingleSelect,{disabled:i||!o,error:a.titleObjectFieldId,label:Liferay.Language.get("scope"),onChange:({value:e})=>{u({panelCategoryKey:"",scope:e}),g("")},options:e,value:null===(d=e.find((e=>e.value===s.scope)))||void 0===d?void 0:d.label}),l.default.createElement(n.AutoComplete,{creationLanguageId:s.defaultLanguageId,disabled:s.system||!o,emptyStateMessage:Liferay.Language.get("no-options-were-found"),error:a.titleObjectFieldId,items:b,label:Liferay.Language.get("panel-category-key"),onChangeQuery:y,onSelectItem:({key:e,value:t})=>{u({panelCategoryKey:e}),g(t)},query:f,value:p},(({value:e})=>l.default.createElement("div",{className:"d-flex justify-content-between"},l.default.createElement("div",null,e))))))};var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(a("@frontend-taglib-clay$clayui/panel")),n=a("@liferay/object-js-components-web"),l=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 a={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var l=r?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(a,n,l):a[n]=e[n]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}a("./ObjectDetails.scss");const e=[{label:Liferay.Language.get("company"),value:"company"},{label:Liferay.Language.get("site"),value:"site"}]}}));
//# sourceMappingURL=ScopeContainer.js.map