Liferay.Loader.define("@liferay/object-web@1.0.181/js/components/ObjectDetails/ScopeContainer",["module","exports","require","@liferay/object-js-components-web","liferay!frontend-js-react-web$react"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.ScopeContainer=function ScopeContainer({companyKeyValuePair:t,errors:a,hasUpdateObjectDefinitionPermission:l,isApproved:o,setValues:i,siteKeyValuePair:u,values:c}){var s;const[f,d]=(0,n.useState)(""),[y,p]=(0,n.useState)(""),g=(0,n.useMemo)((()=>(0,r.filterArrayByQuery)({array:"company"===c.scope?t:u,creationLanguageId:c.defaultLanguageId,query:f,str:"value"})),[c.defaultLanguageId,c.scope,t,u,f]);return(0,n.useEffect)((()=>{((e,t)=>{const a=e.find((e=>e.key===t));a&&p(a.value)})("company"===c.scope?t:u,c.panelCategoryKey)}),[c.scope,t,u]),n.default.createElement(n.default.Fragment,null,n.default.createElement(r.SingleSelect,{disabled:o||!l||"salesforce"===c.storageType,error:a.titleObjectFieldId,label:Liferay.Language.get("scope"),onChange:({value:e})=>{i({panelCategoryKey:"",scope:e}),p("")},options:e,value:null===(s=e.find((e=>e.value===c.scope)))||void 0===s?void 0:s.label}),n.default.createElement(r.AutoComplete,{disabled:(Liferay.FeatureFlags["LPS-167253"]?!c.modifiable&&c.system:c.system)||!l,emptyStateMessage:Liferay.Language.get("no-options-were-found"),error:a.titleObjectFieldId,items:g,label:Liferay.Language.get("panel-link"),onActive:e=>y===e.value,onChangeQuery:d,onSelectItem:({key:e,value:t})=>{i({panelCategoryKey:e}),p(t)},query:f,value:y},(({value:e})=>n.default.createElement("div",{className:"d-flex justify-content-between"},n.default.createElement("div",null,e)))))};var r=a("@liferay/object-js-components-web"),n=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}const e=[{label:Liferay.Language.get("company"),value:"company"},{label:Liferay.Language.get("site"),value:"site"}]}}));
//# sourceMappingURL=ScopeContainer.js.map