@reltio/segmentation 1.4.31 → 1.4.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/564.bundle.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_reltio_segmentation=self.webpackChunk_reltio_segmentation||[]).push([[564],{73564:(e,t,r)=>{r.r(t),r.d(t,{ConfigureColumnsButton:()=>Dd,DEFAULT_SEARCH_SELECT:()=>$.Tv,EntitiesTableWithConfigurableColumns:()=>my,EntityAvatar:()=>w,ROWS_PER_PAGE_OPTIONS:()=>$.Tu,buildQueryForAdvancedSearchGroups:()=>Ma.Jk,buildSelectFromColumns:()=>Do.vw,collectSpecialColumns:()=>Do.oX,createRecentSearch:()=>Os,default:()=>$q,getActiveEntityTypeTab:()=>Po.tB,getAdditionalColumns:()=>Do.oq,getDataTenant:()=>so.lF,getEntityTypeLabel:()=>O.getEntityTypeLabel,getEntityTypeTab:()=>Po.o4,getModule:()=>gp,getPage:()=>so.fx,getRowsPerPage:()=>so.Uz,getSearchResultsMode:()=>Po.XM,getSearchUrlQuery:()=>Ti.Cc,getSerializedSearchState:()=>xi.Z,getTotal:()=>so.NU,needRequestAfterColumnsChanges:()=>Do.tU,parseSearchState:()=>As.Z,queryBuilderHelpers:()=>n,queryBuilderSagas:()=>a,replaceSearchResultsColumns:()=>As.f,showMoreResultsForEntityTypeAction:()=>Xa,showSavedSearchesDialogAction:()=>vo});var n={};r.r(n),r.d(n,{PROP_NAME_FILTER:()=>Ot,PROP_NAME_OPERATOR:()=>vt,PROP_NAME_VALUES:()=>Tt,addAttributeAfter:()=>Pt,changeAttributeData:()=>kt,createGetAttributeIndex:()=>_t,createGetAttributeLens:()=>It,createGetAttributeProp:()=>Dt,createGetAttributesLens:()=>Rt,createGetGroupLens:()=>At,createSetAttributeProp:()=>Nt,defaultFindGroupPath:()=>wt,deleteAttribute:()=>Ut,duplicateAttribute:()=>jt,getAttributeData:()=>St,getAttributeObject:()=>Ct,getEmptyAttributeObject:()=>xt,setAttributeOperator:()=>Lt,setFilter:()=>Ft,setValues:()=>Mt});var a={};r.r(a),r.d(a,{toggleQueryBuilderAttributeSelect:()=>al});var o={};r.r(o),r.d(o,{addAttributes:()=>Ab,addDefaultValuesAction:()=>Rb,addNextPageOfAttributeValues:()=>Nb,modifyAttribute:()=>_b,processNextPageOfAttributeValues:()=>Db,profileSaved:()=>Ub,removeAttribute:()=>Ib,requestNextPageOfAttributeValues:()=>Pb,saveDraft:()=>Lb,saveProfile:()=>kb,validateProfile:()=>jb});var i={};r.r(i),r.d(i,{dependentLookupsEditorTouched:()=>zb,dependentLookupsEditorsBlocked:()=>Bb,dependentLookupsInitedTypeUrisAdded:()=>Vb,dependentLookupsStructureSet:()=>Mb});var l={};r.r(l),r.d(l,{activityFilterUpdated:()=>lv,globalFilterUpdated:()=>sv,keywordUpdated:()=>av,saveState:()=>iv,searchResultsSet:()=>nv,setSearchNavigationData:()=>dv,setSearchOptionsConfig:()=>uv,setSearchProviderData:()=>pv,updateSearchNavigationDataFields:()=>mv,updateSearchNavigationDataOnMerge:()=>yv,updateSearchOptions:()=>cv,updateState:()=>ov});var s={};r.r(s),r.d(s,{addDashboardExternalView:()=>tT,autocloseIntervalLoaded:()=>Uv,clearNotifications:()=>Iv,closeNotification:()=>_v,dateMaskUpdated:()=>Hv,dateTimeMaskUpdated:()=>Yv,documentationSet:()=>eT,entityDeletionFinished:()=>wv,errorSet:()=>Jv,keysSet:()=>Xv,localeAttributePresentationLoaded:()=>Lv,localizationLoaded:()=>zv,navigateTo:()=>Kv,newEntityShown:()=>Sv,newUiConfigLoaded:()=>kv,numberFormatUpdated:()=>Fv,openAppFromChocolateBar:()=>Vv,openConsoleApp:()=>Mv,openDashboard:()=>Gv,openEntity:()=>Cv,openGraph:()=>Bv,openHistoryEvent:()=>qv,openNewEntityWithAuthoring:()=>Zv,openPerspective:()=>Av,openPivotingPerspective:()=>Qv,openPreviousPage:()=>$v,openSearch:()=>Wv,pathsSet:()=>Nv,setPreferReact:()=>jv,setUseSharedPreferences:()=>rT,showNotification:()=>Rv,uiConfigLoaded:()=>Pv,uiPathSet:()=>Dv});var c={};r.r(c),r.d(c,{getAbsoluteImagePath:()=>iC,getActiveErrorsForAttributesPager:()=>lx,getActivityFilter:()=>Mx,getAdminToolsPath:()=>yx,getAiAssistantEnabled:()=>Dx,getAiAssistantHistoryBufferSize:()=>Lx,getAiAssistantLimitPerDay:()=>Px,getAiAssistantSkills:()=>kx,getAllRelationsToAddAndEdit:()=>tC,getAllRelationsToSave:()=>rC,getAllServicesPaths:()=>AC,getAllTreesEditingConnections:()=>gC,getApiPath:()=>cx,getAttributeTypeErrors:()=>ox,getAttributesErrors:()=>ix,getAttributesPresentation:()=>gx,getAttributesSortingStrategy:()=>FS,getAuthoringByEntityType:()=>VS,getAutoCloseInterval:()=>Ex,getCanUserCreateWorkflowConfigJar:()=>LC,getCanUserCreateWorkflowEnvironmentConfigJar:()=>UC,getCanUserDeleteProfiles:()=>aS,getCanUserExecuteWorkflowJobs:()=>jC,getCanUserExecuteWorkflowJobsSyncBusinessProcessData:()=>FC,getCanUserExecuteWorkflowJobsTerminateProcessInstance:()=>MC,getCanUserExecuteWorkflowJobsUpdateTasks:()=>VC,getCanUserExecuteWorkflowJobsValidateTasks:()=>BC,getCanUserGetDQStatistic:()=>iS,getCanUserImportEntitiesFromDT:()=>eS,getCanUserMakeActivitiesExport:()=>JC,getCanUserMakeBulkUpdate:()=>nS,getCanUserMakeExport:()=>QC,getCanUserManageWorkflowDefinition:()=>zC,getCanUserManageWorkflowEnvironmentDefinition:()=>HC,getCanUserOpenDataLoader:()=>oS,getCanUserReadDVF:()=>lS,getCanUserReadEntitiesFromDT:()=>tS,getCanUserReadWorkflowDataTask:()=>YC,getCanUserRegisterConfigEnvironments:()=>kC,getCanUserStartProcessFromQuery:()=>rS,getCanUserUpdateProcessInstance:()=>WC,getCanUserUpdateWorkflowDataTask:()=>GC,getCanUserViewProcessInstanceSearchQuery:()=>qC,getCanUserViewWorkflowConfigJar:()=>ZC,getCanUserViewWorkflowDefinition:()=>$C,getCanUserViewWorkflowEnvironmentConfigJar:()=>KC,getCanUserViewWorkflowJobs:()=>XC,getCheckIfCanAddRelations:()=>CS,getCleanseByEntityType:()=>BS,getCollaborationPath:()=>IC,getConnectionsByViewId:()=>VO,getConnectionsTemporaryUrisForCreation:()=>WO,getConnectionsWithDraftsByViewId:()=>HO,getDBConnectorSideViews:()=>fS,getDVFPath:()=>NC,getDataTenants:()=>RO,getDateMask:()=>bx,getDateTimeMask:()=>vx,getDependentLookupEditorState:()=>OS,getDependentLookupEditorsState:()=>TS,getDependentLookups:()=>hS,getDependentLookupsInitedTypeUris:()=>vS,getDependentLookupsStructure:()=>ES,getDependentLookupsStructureNode:()=>bS,getDocReleaseNotes:()=>PS,getDraftsForSaveByViewId:()=>YO,getDtssPath:()=>CC,getEditingOrAddingConnectionByViewIdAndRelationUri:()=>BO,getEditingOrAddingConnectionRelationObjectByViewIdAndRelationUri:()=>zO,getEntity:()=>jO,getEntityRelatedAttributesByAttributeTypeUri:()=>ax,getEntityUri:()=>FO,getEntityUriWithDataTenant:()=>MO,getEntityWithDiff:()=>SS,getEntityWithoutDiff:()=>wS,getEnvironment:()=>OC,getEnvironmentAlias:()=>xC,getEnvironmentObject:()=>DO,getExportDQPath:()=>SC,getExportPath:()=>ux,getGlobalFilter:()=>Wx,getGlobalFilterQuery:()=>Gx,getGlobalFilterSavedSearchesUris:()=>qx,getGlobalSearchRequestOptions:()=>Hx,getGoogleMapKey:()=>wx,getHeaderColor:()=>LS,getHiddenAttributes:()=>YS,getHistoryDiff:()=>KO,getHistoryEvent:()=>XO,getHistoryMode:()=>ex,getHistorySlice:()=>QO,getIcpLicenseKey:()=>Ax,getImageAttributesFieldsOrder:()=>Cx,getImagePath:()=>sx,getImageServicePath:()=>mx,getInitialConnection:()=>aC,getInitialConnectionTempEntity:()=>nC,getIsAuthoringMode:()=>zS,getIsEditableMode:()=>$x,getIsHistoryModeEnabled:()=>JO,getIsSuggestMode:()=>Xx,getIsViewMode:()=>Kx,getLogo:()=>kS,getLookupAutocomplete:()=>Sx,getLookups:()=>qO,getMaxValuesInResponse:()=>hx,getMetadata:()=>IO,getMlDqPath:()=>PC,getMode:()=>Zx,getModifiedEntities:()=>nx,getModifiedEntity:()=>tx,getModifiedEntityDefaultProfilePic:()=>rx,getNotifications:()=>Ox,getPivotingAttributes:()=>xx,getProfile:()=>LO,getProfileCancelNeedConfirm:()=>bC,getProfileCheckUpdate:()=>MS,getProfileErrors:()=>ZO,getProfileLastLoadedTime:()=>fC,getProfileOperation:()=>hC,getProfileViews:()=>EC,getQueryEstimatorEnabled:()=>HS,getRelationToAddByViewId:()=>Jx,getRelations:()=>Qx,getRelationsToEditByViewId:()=>eC,getRelationsViewIds:()=>$O,getReleaseVersion:()=>DS,getReltioPath:()=>dx,getRequestProviderConfiguration:()=>Tx,getSearch:()=>UO,getSearchKeyword:()=>Fx,getSearchNavigationData:()=>zx,getSearchOptions:()=>Vx,getSearchProviderData:()=>Bx,getSearchResults:()=>jx,getServicesPath:()=>AS,getSharedPreferencesEnabled:()=>Ux,getShowAttributeDescription:()=>jS,getShowEntityId:()=>NS,getShowSearchByOv:()=>US,getStringifiedSearchOptions:()=>Yx,getTenant:()=>vC,getTenantName:()=>TC,getTenantObject:()=>NO,getTenants:()=>_O,getTotalByViewId:()=>GO,getTree:()=>uC,getTreeCommands:()=>mC,getTreeEditingConnection:()=>yC,getTreeRoot:()=>pC,getTreeTotal:()=>dC,getTrees:()=>cC,getUIConfig:()=>RS,getUIConfigLayout:()=>_S,getUIConfigProfile:()=>IS,getUIPath:()=>px,getUi:()=>kO,getUiError:()=>xS,getUiNumberFormat:()=>fx,getUser:()=>PO,getUserName:()=>lC,getUserRoles:()=>sC,getValidateReadMode:()=>_x,getValidateReferenceEntityInReadMode:()=>Nx,getValidateRelations:()=>Ix,getValidationServicePath:()=>DC,getValidationServiceSeverityLevels:()=>Rx,getViewIdsForOpenRelation:()=>oC,getWorkflowConfigurationEnabled:()=>_C,getWorkflowEnvironmentUrl:()=>RC,getWorkflowPath:()=>wC,isCollaborationEnabled:()=>sS,isCollaborationSideViewEnabled:()=>mS,isDBConnectorSideViewEnabled:()=>gS,isHistorySideViewEnabled:()=>yS,isWorkflowEnabled:()=>cS,isWorkflowSideViewEnabled:()=>dS});var u={};r.r(u),r.d(u,{authoringDraftEntitiesLoaded:()=>vw,clearEntity:()=>xw,entityCloneRequested:()=>Ow,entityCreationRequested:()=>Ew,entityCreationWithAuthoringRequested:()=>bw,entityLoaded:()=>gw,entityRemoveRequested:()=>Tw,loadEntity:()=>hw,setDefaultProfilePic:()=>fw});var p={};r.r(p),r.d(p,{errorDeactivated:()=>Iw,errorsSet:()=>Nw});var d={};r.r(d),r.d(d,{clearHistoryDiff:()=>jw,clearHistoryEvent:()=>Mw,setHistoryDiff:()=>Uw,setHistoryEvent:()=>Fw,setHistoryMode:()=>Bw,setHistorySlice:()=>Vw});var m={};r.r(m),r.d(m,{lookupsForTypeResolved:()=>Zw,lookupsListResolved:()=>$w,lookupsLoaded:()=>qw});var y={};r.r(y),r.d(y,{modeCancelEditing:()=>eA,modeEditingCanceled:()=>tA,modeUpdated:()=>Jw});var g={};r.r(g),r.d(g,{cleanseLoading:()=>uA,entityCreated:()=>iA,entityDeleted:()=>lA,modifiedEntitiesReset:()=>cA,setDefaultProfilePic:()=>sA});var f={};r.r(f),r.d(f,{addRelation:()=>SA,closeRelationEditor:()=>RA,editRelation:()=>wA,ignoreRelation:()=>CA,openRelationEditor:()=>AA,relationsLoaded:()=>TA,removeRelation:()=>xA,secondLevelRelationsLoaded:()=>OA,setInitialInfo:()=>NA,setRelationEntity:()=>IA,setRelationType:()=>_A});var h={};r.r(h),r.d(h,{hiddenAttributesReset:()=>bI,hiddenAttributesUpdated:()=>EI}),r(69448);var E=r(8156),b=r.n(E),v=r(78310),T=r.n(v),O=r(2396),x=r(55743),C=r.n(x),S=r(79358);const w=e=>{let{entity:t,avatarClassName:r,imageClassName:n}=e;const a=(0,S.AH)(),o=(0,S.$H)()||"",i=(0,O.getEntityImage)(a,o,t),l=(0,O.getAbsoluteImageUrl)(o,(0,O.getEntityTypeImage)(a,t.type)),s=e=>{e.target.onError=null,e.target.src=(0,O.svg2Url)('\n<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Group</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Group" fill-rule="nonzero">\n <rect id="Rectangle" fill="#DFE5E9" x="0" y="0" width="400" height="400"></rect>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M5.68434189e-14,387.023257 L5.68434189e-14,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 5.68434189e-14,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n </g>\n </g>\n</svg>\n')};return b().createElement(C(),{className:T()(r,n),src:i,imgProps:{onError:s}},b().createElement("img",{className:n,src:l,alt:"fallback entity avatar",onError:s}))};var A=r(75580),R=r(73288),_=r(62391),I=r(9400),N=r(8523),D=r(42308),P=r.n(D),k=r(61882),L=r(26040),U=r(5950);function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){F(e,t,r[t])}))}return e}function F(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const M={facetsConfigs:[],facetsData:{},recommendedFacets:[],addedFacets:[]},V=(0,_.Ic)("facetsConfigs"),B=(0,_.Ic)("facetsData"),z=(0,_.Ic)("recommendedFacets"),H=(0,_.Ic)("addedFacets"),Y=(e,t,r)=>Object.keys(e).reduce(((t,n)=>(0,R.prop)(n,t)?(0,_.ET)(n,r).set(t,e[n]):t),j({},t)),W=e=>{let{state:t,facetsConfigs:r,addToEnd:n=!1,facetsData:a={}}=e;const o=r.filter((e=>e.fieldName)),i=V.get(t),l=V.set(t,n?i.concat(o):o.concat(i)),s=B.get(t),c=o.reduce(((e,t)=>j({},e,{[t.fieldName]:(0,I.DV)(t.fieldName,a[t.fieldName])})),j({},s));return B.set(l,c)},G=(e,t)=>{const r=B.get(e),n=V.get(e),a=j({},r);t.forEach((e=>{delete a[e]}));const o=B.set(e,a);return V.set(o,n.filter((e=>!t.includes(e.fieldName))))},q=e=>{let{facetFieldName:t,values:r,state:n}=e;const a=[...(0,N.jK)(t),"values"];return(0,_.ET)(...a).set(n,r)},Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case k.k.CREATE_FACETS:{const{facetsConfigs:r,addToEnd:n}=t.payload;return W({state:e,facetsConfigs:r,addToEnd:n})}case D.search.constants.UPDATE_STATE:{const{facetsConfigs:e=[],facetsData:r={}}=t.payload.facets||{facetsConfigs:[]};return W({state:M,facetsConfigs:e,facetsData:r})}case k.k.DESTROY_FACETS:{const r=t.payload||[];return G(e,r)}case k.k.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;return q({facetFieldName:r,values:n,state:e})}case k.k.SHOW_MORE_ENTITY_TYPES:{const{show:r}=t.payload,n="type",a=(0,N.jK)(n);if(r)return(0,_.ET)(...a,"showAllItems").set(e,r);{const t=(0,_.ET)(...a);return t.set(e,(0,R.omit)(["showAllItems"],t.get(e)))}}case k.k.CLEAR_ALL_VALUES:case L.Z.CLEAR_ALL:{const t=B.get(e),r=Object.keys(t).reduce(((e,t)=>j({},e,{[t]:[]})),{}),n=Y(r,t,"values");return B.set(e,n)}case k.k.UPDATE_DATA:{const r=t.payload||{},n=B.get(e),a=Y(r,n,"data");return B.set(e,a)}case k.k.UPDATE_FILTERED_DATA:{const r=t.payload||{},n=B.get(e),a=Y(r,n,"filteredData");return B.set(e,a)}case k.k.DESTROY_FILTERED_DATA:{const r=t.payload||{},n=(0,N.jK)(r);if((0,R.path)(n,e)){const t=(0,_.ET)(...n),r=j({},t.get(e));if(r.filteredData)return delete r.filteredData,t.set(e,r)}break}case k.k.SET_RECOMMENDED_FACETS_LIST:return z.set(e,t.payload||[]);case k.k.HIGHLIGHT_ADDED_FACETS:return H.set(e,t.payload);case k.k.CLEAR_HIGHLIGHT_ADDED_FACETS:return H.set(e,[]);case"UI_RESET":return j({},M);case L.Z.CHANGE_CURRENT_TENANT:{const{isDataTenant:r,tenantObject:n}=t.payload;if(r){const t=V.get(e),r=B.get(e),a=(0,U.ci)(n,t),o=(0,R.pluck)("fieldName",a),i=(0,R.pipe)((0,R.pick)(o),(0,U.AZ)(n))(r);return B.set(V.set(e,a),i)}return e}}return e};var $=r(71403);function K(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){X(e,t,r[t])}))}return e}function X(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Q={searchResults:null,searchResultsByEntityTypes:{},total:0,page:0,sortField:null,sortOrder:null,rowsPerPage:$.Tu[0],loading:!1,searchParams:{searchBoxInput:{fieldName:"attributes",filter:"containsWordStartingWith"},mapSearch:{fieldName:"geoLocation",type:"geoLocation",filter:"range",values:[]}},currentTenant:null},J=(0,_.Ic)("searchResults"),ee=(0,_.Ic)("total"),te=(0,_.Ic)("page"),re=(0,_.Ic)("rowsPerPage"),ne=(0,_.Ic)("sortField"),ae=(0,_.Ic)("sortOrder"),oe=(0,_.Ic)("loading"),ie=(0,_.ET)("searchParams","mapSearch","values"),le=(0,_.ET)("searchParams","mapSearch","type"),se=(0,_.ET)("searchParams","mapSearch","fieldName"),ce=(0,_.Ic)("searchResultsByEntityTypes"),ue=e=>ce.compose((0,_.ET)(e,"page")),pe=(e,t)=>{let{entityTypeUri:r,field:n,order:a}=e;if(r){const e=ce.compose((0,_.ET)(r,"sortField")),o=ce.compose((0,_.ET)(r,"sortOrder")),i=e.set(t,n);return o.set(i,a)}{const e=ne.set(t,n);return ae.set(e,a)}},de=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Q,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case L.Z.UPDATE_ENTITIES:{const{searchResults:r,entityTypeUri:n}=t.payload;return n?ce.compose((0,_.ET)(n,"searchResults")).set(e,r):J.set(e,r)}case L.Z.UPDATE_TOTAL:return ee.set(e,t.payload);case L.Z.CHANGE_PAGE:{const{entityTypeUri:r,pageNumber:n}=t.payload;return r?ue(r).set(e,n):te.set(e,n)}case L.Z.RESET_PAGE:{const{entityTypeUri:r}=t.payload,n=te.set(e,0);return r?ue(r).set(n,0):n}case L.Z.CHANGE_ROWS_PER_PAGE:{const{entityTypeUri:r,number:n}=t.payload;if(r){const t=ce.compose((0,_.ET)(r,"rowsPerPage")),a=ue(r).set(e,0);return t.set(a,n)}{const t=te.set(e,0);return re.set(t,n)}}case L.Z.CHANGE_SORT:return pe(t.payload,e);case L.Z.CHANGE_LOADING:return oe.set(e,t.payload);case D.search.constants.UPDATE_STATE:{const{values:r=[],searchType:n=O.MAP_SEARCH_TYPES.geoPolygon}=t.payload.map||{};let a=ie.set(Q,r);if(a=le.set(a,n),a=se.set(a,(0,O.mapSearchTypeToFieldName)(n)),t.payload.view){const{entityTypeTab:e,sortField:r,sortOrder:n}=t.payload.view;a=pe({entityTypeUri:e,field:r,order:n},a)}return K({},a,{currentTenant:t.payload.currentTenant||e.currentTenant,searchOptions:t.payload.searchOptions||e.searchOptions})}case"UI_RESET":return K({},Q);case L.Z.MAP_CHANGE_VALUE:{const{value:r,searchType:n}=t.payload;let a=le.set(e,n);return a=se.set(a,(0,O.mapSearchTypeToFieldName)(n)),ie.set(a,r?[r]:[])}case L.Z.CLEAR_RESULTS:{const r=t.payload;if(r){let t=J.set(e,void 0);const n=ce.get(e);return ce.set(t,{[r]:n[r]})}return ce.set(e,{})}case L.Z.CLEAR_ALL:return ie.set(e,[]);case L.Z.CHANGE_CURRENT_TENANT:return K({},e,{currentTenant:t.payload.tenantObject.id})}return e},me="UI_SHOW_MORE_FACETS_POPUP",ye="UI_SHOW_SAVED_SEARCHES_DIALOG",ge="UI_SHOW_SAVE_SEARCH_DIALOG",fe="UI_SHOW_ADVANCED_SEARCH",he="UI_SHOW_BULK_UPDATE",Ee="UI_SET_MARKER",be="UI_SET_HOVERED_ENTITY_URI",ve="UI_SET_ACTIVE_ADDITIONAL_SEARCH",Te="UI_SET_SEARCH_RESULTS_COLUMNS",Oe="UI_CHANGE_SEARCH_RESULTS_COLUMNS",xe="UI_SET_ENTITY_TYPE_TAB",Ce="UI_UPDATE_TABLE_VIEW_TABS",Se="UI_CHANGE_ORDER_SEARCH_RESULTS_COLUMNS",we="UI_CHANGE_SIZES_SEARCH_RESULTS_COLUMNS",Ae="UI_SET_LOADING",Re="UI_CLEAR_NOTIFICATION",_e="UI_SET_NOTIFICATION",Ie="UI_SET_SEARCH_RESULTS_MODE",Ne="UI_SET_PREVIEW_PANEL_MODE",De={showMoreFacetsPopup:!1,showSavedSearchesDialog:!1,showAdvancedSearch:!1,showSaveSearchDialog:!1,showBulkUpdate:!1,activeAdditionalSearch:null,activeMarker:null,hoveredEntityUri:null,searchResultsMode:null,previewPanelMode:null,searchResultsColumns:{},entityTypeTab:null,tableViewTabs:[],notification:null},Pe=(0,_.Ic)("showMoreFacetsPopup"),ke=(0,_.Ic)("showSavedSearchesDialog"),Le=(0,_.Ic)("showSaveSearchDialog"),Ue=(0,_.Ic)("showAdvancedSearch"),je=(0,_.Ic)("showBulkUpdate"),Fe=(0,_.Ic)("activeAdditionalSearch"),Me=(0,_.Ic)("activeMarker"),Ve=(0,_.Ic)("hoveredEntityUri"),Be=(0,_.Ic)("searchResultsMode"),ze=(0,_.Ic)("previewPanelMode"),He=(0,_.Ic)("searchResultsColumns"),Ye=(0,_.Ic)("entityTypeTab"),We=(0,_.Ic)("tableViewTabs"),Ge=(0,_.Ic)("loading"),qe=(0,_.Ic)("notification"),Ze=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:De,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case me:return Pe.set(e,t.payload);case ye:return ke.set(e,t.payload);case ge:return Le.set(e,t.payload.show);case fe:return Ue.set(e,t.payload);case he:return je.set(e,t.payload);case ve:{const r=Fe.get(e)===t.payload?null:t.payload;return Fe.set(e,r)}case Ee:return Me.set(e,t.payload);case be:return Ve.set(e,t.payload);case Ie:return Be.set(e,t.payload);case Te:return He.set(e,t.payload);case Oe:{const{entityTypeUri:r,columns:n}=t.payload;return He.compose((0,_.Ic)(r)).set(e,n)}case we:{const{entityTypeUri:r,columns:n}=t.payload;return He.compose((0,_.Ic)(r)).set(e,n)}case Se:{const{entityTypeUri:r,columns:n}=t.payload;return He.compose((0,_.Ic)(r)).set(e,n)}case Ne:return ze.set(e,t.payload);case xe:return Ye.set(e,t.payload.entityTypeUri);case Ce:return We.set(e,t.payload);case k.k.UPDATE_DATA:if((0,R.has)("type",t.payload))return We.set(e,t.payload.type);break;case k.k.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;if("type"===r&&n.length){const t=Ye.get(e);if(!n.includes(t))return Ye.set(e,n[0])}break}case"UI_RESET":return De;case Ae:return Ge.set(e,t.payload);case _e:return qe.set(e,t.payload);case Re:return qe.set(e,null);case D.search.constants.UPDATE_STATE:{let r=Ue.set(e,(0,R.has)("advanced",t.payload));if(t.payload.view){const{searchResultsMode:e,entityTypeTab:n,searchResultsColumns:a,previewPanelMode:o}=t.payload.view;r=Be.set(r,e),r=Ye.set(r,n),(0,O.isEmptyValue)(a)||(r=He.set(r,a)),r=ze.set(r,o)}return t.payload.showSavedSearchesDialog&&(r=ke.set(r,t.payload.showSavedSearchesDialog)),r}}return e};var $e=r(37164);const Ke="ADVANCED_SEARCH_SET_GROUP_ENTITY_TYPES",Xe="ADVANCED_SEARCH_VERIFY_GROUP_ENTITY_TYPES",Qe="ADVANCED_SEARCH_SET_GROUP_OPERATOR",Je="ADVANCED_SEARCH_DELETE_GROUP",et="ADVANCED_SEARCH_ADD_GROUP",tt="ADVANCED_SEARCH_DUPLICATE_GROUP",rt="ADVANCED_SEARCH_ADD_ATTRIBUTE_AFTER",nt="ADVANCED_SEARCH_CHANGE_ATTRIBUTE_DATA",at="ADVANCED_SEARCH_TOGGLE_ATTRIBUTE_SELECT",ot="ADVANCED_SEARCH_SET_ATTRIBUTE_OPERATOR",it="ADVANCED_SEARCH_DELETE_ATTRIBUTE",lt="ADVANCED_DELETE_ATTRIBUTE_AND_VERIFY_GROUP_ENTITY_TYPES",st="ADVANCED_SEARCH_DUPLICATE_ATTRIBUTE",ct="ADVANCED_SEARCH_SET_FILTER",ut="ADVANCED_SEARCH_SET_VALUES",pt="ADVANCED_SEARCH_ATTRIBUTE_SET_VALUES",dt="ADVANCED_SEARCH_ATTRIBUTE_FILTER_VALUES",mt="ADVANCED_SEARCH_ATTRIBUTE_SET_FILTERED_VALUES",yt="ADVANCED_SEARCH_ATTRIBUTE_UPDATE_VALUES",gt="ADVANCED_SEARCH_UPDATE",ft="ADVANCED_SEARCH_CONVERT_FROM_FACETS";var ht=r(81253);function Et(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){bt(e,t,r[t])}))}return e}function bt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vt="operator",Tt="values",Ot="filter",xt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,$e.x0)();return{[vt]:$.YL.value,id:e}},Ct=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,$e.x0)();const r=St(e);return{data:r,[vt]:$.YL.value,[Ot]:(0,R.pathOr)("",["filterOptions",0],r),id:t}},St=e=>Et({},e,{filterOptions:e.enforcedFilterOptions||(0,O.getFilterOptionsForQueryBuilder)(e.attrType,e.fieldName)}),wt=(0,R.curry)(((e,t)=>{const r=t.findIndex((t=>t.id===e));return r>-1?[r]:null})),At=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wt;return(r,n)=>{const a=(0,_.ET)(...e).get(r),o=t(n,a);return!!o&&(0,_.ET)(...e,...o)}},Rt=(e,t)=>(r,n)=>{const a=e(r,n);return a&&a.compose((0,_.Ic)(t))},_t=e=>(t,r,n)=>{const a=e(t,r);return a?a.get(t).findIndex((e=>e.id===n)):-1},It=e=>(t,r,n)=>{const a=e(t,r),o=_t(e)(t,r,n);return-1!==o?a.compose((0,_.ET)(o)):null},Nt=e=>(t,r,n,a,o)=>{const i=e(t,r,n);if(i){const e=Et({},i.get(t));return e[a]=o,i.set(t,e)}return t},Dt=e=>(t,r,n,a)=>{const o=e(t,r,n);if(o)return o.get(t)[a]},Pt=e=>{let{state:t,groupId:r,attributeId:n,attribute:a,getAttributesLens:o,getAttributeIndex:i}=e;const l=o(t,r);if(l){let e=[...l.get(t)];const o=i(t,r,n),s=!e[o+1];return-1!==o&&s?e.splice(o+1,0,a):-1!==o?(e.splice(o+1,0,Et({},a,{operator:e[o].operator})),e[o]=Et({},e[o],{operator:$.YL.value})):e.push(a),l.set(t,e)}return t},kt=e=>{let{state:t,groupId:r,attributeId:n,attributeData:a,setAttributeProp:o,getAttributeLens:i}=e,l=t;if(a)return((e,t,r,n,a)=>{const o=a(e,t,r);let i;return o&&(i=o.get(e).filter),n.filterOptions.length&&(!i||!n.filterOptions.includes(i))})(t,r,n,a,i)&&(l=o(t,r,n,Ot,a.filterOptions[0])),l=o(l,r,n,Tt,[]),o(l,r,n,"data",a);{const e=i(t,r,n);return e&&(l=e.set(l,xt(n))),l}},Lt=e=>{let{state:t,groupId:r,attributeId:n,operator:a,setAttributeProp:o}=e;return o(t,r,n,vt,a)},Ut=e=>{let{state:t,groupId:r,attributeId:n,getAttributesLens:a}=e;const o=a(t,r);if(o){const e=[...o.get(t)],r=e.findIndex((e=>e.id===n));if(r>-1){const n=(0,R.remove)(r,1,e),a=n[r-1],i=e[r];return a&&(n[r-1]=Et({},a,{operator:i.operator})),o.set(t,n)}}return t},jt=e=>{let{state:t,groupId:r,attributeId:n,id:a,getAttributesLens:o}=e;const i=o(t,r);if(i){const e=[...i.get(t)],r=e.findIndex((e=>e.id===n));if(r>-1)return e.push(Et({},e[r],{id:a})),i.set(t,e)}return t},Ft=e=>{let{state:t,groupId:r,attributeId:n,filter:a,getAttributeProp:o,setAttributeProp:i}=e;const l=o(t,r,n,Ot),s=(0,O.isCompatibleFilters)(l,a)?t:i(t,r,n,Tt,[]);return i(s,r,n,Ot,a)},Mt=e=>{let{state:t,groupId:r,attributeId:n,values:a,setAttributeProp:o}=e;return o(t,r,n,Tt,a)};function Vt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Bt(e,t,r[t])}))}return e}function Bt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zt={searchParams:{groups:[]},attributesData:{}},Ht="entityTypes",Yt="attributes",Wt="autoAddedEntityTypes",Gt=["groups"],qt=(0,_.ET)(...Gt),Zt=At(Gt),$t=Rt(Zt,Yt),Kt=_t($t),Xt=It($t),Qt=Nt(Xt),Jt=Dt(Xt),er=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(0,$e.x0)();return{[Yt]:e.map((e=>Ct(e))),[vt]:$.qx.value,[Ht]:t,id:r}},tr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zt.attributesData,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case mt:{const{groupId:r,attributeId:n,values:a}=t.payload;return(0,R.assocPath)([r,n,"filtered"],a,e)}case Je:{const{groupId:r}=t.payload;return(0,R.dissoc)(r,e)}case it:{const{groupId:r,attributeId:n}=t.payload;return(0,R.dissocPath)([r,n],e)}case tt:{const{groupId:r,id:n}=t.payload,a=e[r];return a?(0,R.assoc)(n,a,e):e}case st:{const{groupId:r,attributeId:n,id:a}=t.payload,o=(0,R.path)([r,n],e);return o?(0,R.assocPath)([r,a],o,e):e}case L.Z.CLEAR_ALL:case D.search.constants.UPDATE_STATE:return zt.attributesData;default:return e}},rr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zt.searchParams,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case et:{const{group:r}=t.payload,n=[...qt.get(e)];return n.push(r),qt.set(e,n)}case Qe:{const{groupId:r,operator:n}=t.payload,a=Zt(e,r);if(a){const t=Vt({},a.get(e));return t[vt]=n,a.set(e,t)}return e}case Ke:{const{groupId:r,entityTypes:n}=t.payload,a=Zt(e,r);if(a){const t=Vt({},a.get(e));return t.entityTypes=n,t.autoAddedEntityTypes=[],t.attributes=[],a.set(e,t)}return e}case Xe:{const{groupId:r}=t.payload,n=Zt(e,r);if(n){const t=n.get(e),{entityTypes:r,autoAddedEntityTypes:a}=(0,ht.tg)((0,ht.r8)(t.attributes||[]),t.entityTypes,t.autoAddedEntityTypes);return n.set(e,Vt({},t,{[Ht]:r,[Wt]:a}))}return e}case Je:{const{groupId:r}=t.payload,n=[...qt.get(e)],a=n.findIndex((e=>e.id===r));if(a>-1){const t=(0,R.remove)(a,1,n),r=t[a-1],o=n[a];return r&&(t[a-1]=Vt({},r,{operator:o.operator})),qt.set(e,t)}return e}case tt:{const{groupId:r,id:n}=t.payload,a=[...qt.get(e)],o=a.findIndex((e=>e.id===r));return o>-1?(a.push(Vt({},a[o],{id:n})),qt.set(e,a)):e}case rt:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return Pt({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:$t,getAttributeIndex:Kt})}case nt:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return kt({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:Qt,getAttributeLens:Xt})}case ot:{const{groupId:r,attributeId:n,operator:a}=t.payload;return Lt({state:e,groupId:r,attributeId:n,operator:a,setAttributeProp:Qt})}case it:{const{groupId:r,attributeId:n}=t.payload;return Ut({state:e,groupId:r,attributeId:n,getAttributesLens:$t})}case st:{const{groupId:r,attributeId:n,id:a}=t.payload;return jt({state:e,groupId:r,attributeId:n,id:a,getAttributesLens:$t})}case ct:{const{groupId:r,attributeId:n,filter:a}=t.payload;return Ft({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:Jt,setAttributeProp:Qt})}case ut:{const{groupId:r,attributeId:n,values:a}=t.payload;return Mt({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:Qt})}case L.Z.CLEAR_ALL:return zt.searchParams;case D.search.constants.UPDATE_STATE:{const{advanced:e=[]}=t.payload;return qt.set(zt.searchParams,e)}default:return e}},nr=(e,t)=>{const r=((e,t)=>{if(t.type===pt){var r;const{groupId:n,attributeId:a,values:o}=t.payload;return((null===(r=[...qt.get(e.searchParams)].find((e=>e.id===n)))||void 0===r?void 0:r.attributes)||[]).some((e=>{let{id:t}=e;return t===a}))?(0,R.assocPath)(["attributesData",n,a,"default"],o,e):e}return e})((0,A.combineReducers)({searchParams:rr,attributesData:tr})(e,t),t);return r},ar="SAVED_SEARCHES_CREATE",or="SAVED_SEARCHES_SET_CURRENT",ir="SAVED_SEARCHES_SET_CHANGE_INDICATOR",lr="SAVED_SEARCHES_UPDATE",sr="SAVED_SEARCHES_LOAD",cr="SAVED_SEARCHES_SET_TOTAL",ur="SAVED_SEARCHES_SET_ITEMS",pr="SAVED_SEARCHES_SET_ITEM_TOTAL",dr="SAVED_SEARCHES_SET_PAGE",mr="SAVED_SEARCHES_SET_ROWS_PER_PAGE",yr="SAVED_SEARCHES_SET_FILTERS",gr="SAVED_SEARCHES_SELECT_ITEM",fr="SAVED_SEARCHES_SELECT_ALL_ITEMS",hr="SAVED_SEARCHES_DESELECT_ALL_ITEMS",Er="SAVED_SEARCHES_MARK_PUBLIC_REQUEST",br="SAVED_SEARCHES_MARK_PUBLIC",vr="SAVED_SEARCHES_MARK_FAVORITE_REQUEST",Tr="SAVED_SEARCHES_MARK_FAVORITE",Or="SAVED_SEARCHES_MARK_GLOBAL_FILTER_REQUEST",xr="SAVED_SEARCHES_CHANGE_ITEM_NAME_REQUEST",Cr="SAVED_SEARCHES_CHANGE_ITEM_NAME",Sr="SAVED_SEARCHES_SET_EDITING",wr="SAVED_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",Ar="SAVED_SEARCHES_DELETE_ITEM_REQUEST",Rr="SAVED_SEARCHES_DELETE_ITEMS",_r="SAVED_SEARCHES_SET_LOADING",Ir="SAVED_SEARCHES_SET_SEARCH_VALUE",Nr="SAVED_SEARCHES_APPLY_ITEM",Dr="SAVED_SEARCHES_SET_TOTAL_LOADING",Pr="SAVED_SEARCHES_LOAD_TOTAL",kr="SAVED_SEARCHES_TOGGLE_SORT",Lr="RECENT_SEARCHES_CREATE",Ur="RECENT_SEARCHES_LOAD",jr="RECENT_SEARCHES_SET_ITEMS",Fr="RECENT_SEARCHES_SET_ITEM_TOTAL",Mr="RECENT_SEARCHES_SELECT_ITEM",Vr="RECENT_SEARCHES_SELECT_ALL_ITEMS",Br="RECENT_SEARCHES_DESELECT_ALL_ITEMS",zr="RECENT_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",Hr="RECENT_SEARCHES_DELETE_ITEMS",Yr="RECENT_SEARCHES_DELETE_ITEM_REQUEST",Wr="RECENT_SEARCHES_SET_LOADING",Gr="RECENT_SEARCHES_SET_SEARCH_VALUE",qr="RECENT_SEARCHES_SET_LAST_SAVED",Zr="RECENT_SEARCHES_SET_TOTAL_LOADING",$r="RECENT_SEARCHES_LOAD_TOTAL",Kr="RECENT_SEARCHES_APPLY_ITEM";function Xr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Qr(e,t,r[t])}))}return e}function Qr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Jr={currentSearch:null,postSavingAction:null,changeIndicator:!1,items:[],loading:!1,total:0,page:0,rowsPerPage:$.Tu[0],searchValue:"",findPublic:!0,favoriteOnly:!1,sorting:{order:$.rX.DESC,field:$.KY.updateDate}},en=(0,_.Ic)("changeIndicator"),tn=(0,_.Ic)("items"),rn=(0,_.Ic)("total"),nn=(0,_.Ic)("page"),an=(0,_.Ic)("loading"),on=(0,_.Ic)("postSavingAction"),ln=(0,_.Ic)("sorting"),sn=(e,t,r)=>{const n=tn.get(r).findIndex((e=>e.uri===t)),a=tn.compose((0,_.ET)([n])),o=a.get(r);return a.set(r,e(o))},cn=e=>e===$.rX.DESC?$.rX.ASC:$.rX.DESC,un=(e,t,r)=>(0,R.evolve)({page:(0,R.always)(0),[e]:(0,R.always)(t)},r),pn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Jr,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case or:return(0,R.evolve)({currentSearch:(0,R.always)(t.payload),changeIndicator:null===t.payload?(0,R.always)(!1):R.identity},e);case L.Z.CLEAR_ALL:return(0,R.evolve)({currentSearch:(0,R.always)(null),changeIndicator:(0,R.always)(!1)},e);case ir:return en.set(e,t.payload);case cr:return rn.set(e,t.payload);case dr:return nn.set(e,t.payload);case mr:return un("rowsPerPage",t.payload,e);case yr:{const{findPublic:r,favoriteOnly:n}=t.payload;return(0,R.evolve)({page:(0,R.always)(0),findPublic:(0,R.always)(r),favoriteOnly:(0,R.always)(n)},e)}case ur:return tn.set(e,t.payload);case gr:{const{uri:r,checked:n}=t.payload;return sn((e=>Xr({},e,{checked:n})),r,e)}case hr:{const t=tn.get(e);return tn.set(e,t.map((0,R.omit)(["checked"])))}case fr:{const t=tn.get(e);return tn.set(e,t.map((0,R.ifElse)((0,R.prop)("isOwnSearch"),(0,R.assoc)("checked",!0),R.identity)))}case Rr:{const r=t.payload,n=tn.get(e),a=rn.set(e,rn.get(e)-r.length);return tn.set(a,n.filter((e=>!r.includes(e.uri))))}case br:{const{uri:r,isPublic:n}=t.payload;return sn((e=>Xr({},e,{isPublic:n})),r,e)}case Tr:{const{uri:r,isFavorite:n}=t.payload;return sn((e=>Xr({},e,{isFavorite:n})),r,e)}case pr:{const{uri:r,total:n}=t.payload;return sn((e=>Xr({},e,{total:n})),r,e)}case Sr:{const{uri:r,isEditing:n}=t.payload;return sn((e=>Xr({},e,{isEditing:n})),r,e)}case xr:{const{uri:r}=t.payload;return sn((0,R.omit)(["isEditing"]),r,e)}case Cr:{const{uri:r,name:n}=t.payload;return sn((e=>Xr({},e,{name:n})),r,e)}case _r:return an.set(e,t.payload);case Gr:case Ir:return un("searchValue",t.payload,e);case sr:return Xr({},e,{page:0,findPublic:!0,favoriteOnly:!1});case kr:{const r=t.payload,n=(0,R.path)(["sorting","field"],e),a=(0,R.path)(["sorting","order"],e);return ln.set(e,{field:r,order:cn(r===n?a:null)})}case Dr:{const{uri:r,isLoading:n}=t.payload;return sn((e=>Xr({},e,{isTotalLoading:n})),r,e)}case ge:return on.set(e,t.payload.postSavingAction);case ye:return un("searchValue",Jr.searchValue,e)}return e};function dn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){mn(e,t,r[t])}))}return e}function mn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yn={items:[],filterWord:null,loading:!1,lastSavedRecentSearch:null},gn=(0,_.Ic)("items"),fn=(0,_.Ic)("loading"),hn=(0,_.Ic)("filterWord"),En=(0,_.Ic)("lastSavedRecentSearch"),bn=(e,t,r)=>{const n=gn.get(r).findIndex((e=>e.createdDate===t)),a=gn.compose((0,_.ET)([n])),o=a.get(r);return a.set(r,e(o))},vn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:yn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ir:case Gr:return hn.set(e,t.payload);case jr:return gn.set(e,t.payload);case Mr:{const{searchCreatedDate:r,checked:n}=t.payload;return bn((e=>dn({},e,{checked:n})),r,e)}case Br:{const t=gn.get(e);return gn.set(e,t.map((0,R.omit)(["checked"])))}case Vr:{const t=gn.get(e);return gn.set(e,t.map((0,R.assoc)("checked",!0)))}case Hr:{const r=(t.payload||[]).map((0,R.prop)("createdDate")),n=gn.get(e);return gn.set(e,n.filter((e=>!r.includes(e.createdDate))))}case Fr:{const{searchCreatedDate:r,total:n}=t.payload;return bn((e=>dn({},e,{total:n})),r,e)}case Wr:return fn.set(e,t.payload);case qr:return En.set(e,t.payload);case Zr:{const{searchCreatedDate:r,isLoading:n}=t.payload;return bn((e=>dn({},e,{isTotalLoading:n})),r,e)}case ye:return hn.set(e,yn.filterWord)}return e},Tn="ENTITY_SET_LOADING",On="ENTITY_LOAD_ENTITY_REQUEST",xn="ENTITY_SET_SELECTED_ENTITY_URI",Cn="ENTITY_SET_ENTITY",Sn={loading:!1,selectedEntityUri:null,entity:null},wn=(0,_.Ic)("loading"),An=(0,_.Ic)("selectedEntityUri"),Rn=(0,_.Ic)("entity"),_n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Sn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Tn:return wn.set(e,t.payload);case xn:return An.set(e,t.payload);case Cn:return Rn.set(e,t.payload);case D.profile.constants.ProfileActions.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:o}=t.payload,i=(0,O.getAttributeSource)(a);if(e.entity&&r===e.entity.uri){const t=(0,R.lensPath)(["entity",i,n]);return(0,R.over)(t,(0,R.pipe)((0,R.defaultTo)([]),(0,R.concat)(R.__,o)),e)}return e}case D.search.constants.SEARCH_RESULTS_SET:if((0,O.isEmptyValue)(t.payload)){const t=Rn.set(e,Sn.entity);return An.set(t,Sn.selectedEntityUri)}return e}return e},In="BULK_UPDATE_SET_ACTIVE_STEP",Nn="BULK_UPDATE_INIT",Dn="BULK_UPDATE_TOGGLE_SELECTION_MODE",Pn="BULK_UPDATE_SELECT_ENTITY",kn="BULK_UPDATE_SELECT_ALL_ENTITIES_ON_PAGE",Ln="BULK_UPDATE_SET_LOADING",Un="BULK_UPDATE_CHANGE_ROWS_PER_PAGE",jn="BULK_UPDATE_CHANGE_PAGE",Fn="BULK_UPDATE_CHANGE_SORT",Mn="BULK_UPDATE_CHANGE_COLUMNS",Vn="BULK_UPDATE_UPDATE_ENTITIES",Bn="BULK_UPDATE_SET_FILTER_TEXT",zn="BULK_UPDATE_SET_TOTAL",Hn="UPDATE_BULK_UPDATE_CURRENT_ENTITIES",Yn="BULK_UPDATE_SET_OPERATION",Wn="BULK_UPDATE_SET_ACTION_ATTRIBUTE",Gn="BULK_UPDATE_SET_ACTION_OPERATION",qn="BULK_UPDATE_ADD_OPERATION_PARAMETERS",Zn="BULK_UPDATE_DELETE_ACTION",$n="BULK_UPDATE_TOGGLE_CONDITIONS",Kn="BULK_UPDATE_ADD_CONDITION_AFTER",Xn="BULK_UPDATE_CHANGE_CONDITION_DATA",Qn="BULK_UPDATE_TOGGLE_CONDITION_SELECT",Jn="BULK_UPDATE_DELETE_CONDITION",ea="BULK_UPDATE_SET_CONDITION_FILTER",ta="BULK_UPDATE_SET_CONDITION_VALUES",ra="BULK_UPDATE_TOGGLE_ACTION_PIN",na="BULK_UPDATE_TOGGLE_ACTION_ADD_NESTED",aa="BULK_UPDATE_CONFIRM",oa="BULK_UPDATE_SET_REQUEST_PENDING";function ia(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){la(e,t,r[t])}))}return e}function la(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sa={objects:{selectionMode:$.v6.exclude,selectedEntities:[],entities:[],total:0,page:0,rowsPerPage:$.Tu[0],filterText:"",sortOrder:null,sortField:null,selectedColumns:[]},actions:[],operation:null,activeStep:0,loading:!1,requestPending:!1},ca=(0,_.Ic)("activeStep"),ua=(0,_.Ic)("operation"),pa=(0,_.Ic)("loading"),da=(0,_.Ic)("requestPending"),ma=(0,_.ET)("objects","total"),ya=(0,_.ET)("objects","page"),ga=(0,_.ET)("objects","rowsPerPage"),fa=(0,_.ET)("objects","selectionMode"),ha=(0,_.ET)("objects","entities"),Ea=(0,_.ET)("objects","selectedEntities"),ba=(0,_.ET)("objects","filterText"),va=e=>fa.get(e)===$.v6.include,Ta=(0,_.ET)("objects","sortOrder"),Oa=(0,_.ET)("objects","sortField"),xa=(0,_.ET)("objects","selectedColumns"),Ca=["actions"],Sa=(0,_.ET)(...Ca),wa=e=>{let{groupId:t,state:r}=e;if(t){const e=Sa.get(r).findIndex((e=>e.id===t));if(-1!==e)return[...Ca,e,"actions"]}return Ca},Aa=(e,t)=>({id:(0,$e.x0)(),operation:e,operationParameters:t}),Ra=e=>((0,R.path)(["attributeTypeData","fieldName"],e)||[]).split(".").slice(0,2).join("."),_a=(e,t)=>({id:(0,$e.x0)(),fieldName:Ra(t),actions:[Aa(e,t)]}),Ia=e=>{let{state:t,id:r,groupId:n,operation:a,operationParameters:o,togglePin:i,toggleAddNested:l}=e;const s=wa({state:t,groupId:n}),c=(0,_.ET)(...s).get(t),u=!n&&(0,R.prop)("attributeTypeData",o)&&(e=>{let{attributeType:t,fieldName:r=""}=e;return(0,O.isComplexAttribute)(t)||r.split(".").length>2})(o.attributeTypeData);if(r){const e=c.findIndex((e=>e.id===r)),n=(0,_.ET)(...s,e),d=ia({},n.get(t));if(a&&d.operation!==a){if(d.operationParameters){const e=[d.operation,a].includes($.Vh.RepointReference)?[]:$.KJ[a];d.operationParameters=(0,R.omit)((0,R.without)(e,["attributeValue","attributeValueToFind"]),d.operationParameters)}d.operation=a}return o&&(d.operationParameters=(0,R.reject)(R.isNil,ia({},d.operationParameters,o))),i&&(d.operationParameters=ia({},d.operationParameters,{pin:!(0,R.path)(["operationParameters","pin"],d)})),l&&(d.operationParameters=ia({},d.operationParameters,{addNestedAttribute:!(0,R.path)(["operationParameters","addNestedAttribute"],d)})),n.set(t,u?_a((p=d).operation,p.operationParameters):d)}{const e=(0,R.reject)(R.isNil,o),r=u?_a(a,e):Aa(a,e);return(0,_.ET)(...s,c.length).set(t,r)}var p},Na=At(Ca),Da=Rt(Na,"conditions"),Pa=_t(Da),ka=It(Da),La=Nt(ka),Ua=Dt(ka),ja=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:sa,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case In:return ca.set(e,t.payload);case Nn:return ia({},sa,{objects:ia({},sa.objects,t.payload)});case Vn:return ha.set(e,t.payload);case Dn:{const t=fa.set(e,va(e)?$.v6.exclude:$.v6.include);return Ea.set(t,[])}case Pn:{const{uri:r,checked:n}=t.payload,a=Ea.get(e),o=va(e);return Ea.set(e,!!n==!!o?(0,R.uniq)(a.concat(r)):(0,R.without)(r,a))}case kn:{const r=t.payload,n=va(e),a=Ea.get(e),o=ha.get(e).map((0,R.prop)("uri"));return Ea.set(e,!!r==!!n?(0,R.uniq)(a.concat(o)):(0,R.without)(o,a))}case Ln:return pa.set(e,t.payload);case jn:return ya.set(e,t.payload);case Un:{const r=ya.set(e,0);return ga.set(r,t.payload)}case Fn:{const{order:r,field:n}=t.payload,a=Oa.set(e,n);return Ta.set(a,r)}case Mn:return xa.set(e,t.payload);case zn:return ma.set(e,t.payload);case Bn:{const{filterText:r}=t.payload;return ba.set(e,r)}case Yn:return ua.set(e,t.payload);case Wn:{const{id:r,groupId:n,attribute:a}=t.payload;return Ia({state:e,id:r,groupId:n,operationParameters:{attributeTypeData:a,attributeValue:null,attributeValueToFind:null,pin:null,addNestedAttribute:null}})}case Gn:{const{id:r,groupId:n,operation:a}=t.payload;return Ia({state:e,id:r,groupId:n,operation:a})}case qn:{const{id:r,groupId:n,operationParameters:a}=t.payload;return Ia({state:e,id:r,groupId:n,operationParameters:a})}case ra:{const{id:r,groupId:n}=t.payload;return Ia({state:e,id:r,groupId:n,togglePin:!0})}case na:{const{id:r,groupId:n}=t.payload;return Ia({state:e,id:r,groupId:n,toggleAddNested:!0})}case Zn:{const{id:r,groupId:n}=t.payload,a=wa({state:e,groupId:n}),o=(0,_.ET)(...a),i=o.get(e);return o.set(e,i.filter((e=>e.id!==r)))}case $n:{const r=t.payload,n=Sa.get(e).findIndex((e=>e.id===r)),a=(0,_.ET)(...Ca,n),o=a.get(e);return a.set(e,o.conditions?(0,R.omit)(["conditions"],o):(0,R.assoc)("conditions",[],o))}case Kn:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return Pt({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:Da,getAttributeIndex:Pa})}case Xn:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return kt({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:La,getAttributeLens:ka})}case Jn:{const{groupId:r,attributeId:n}=t.payload;return Ut({state:e,groupId:r,attributeId:n,getAttributesLens:Da})}case ea:{const{groupId:r,attributeId:n,filter:a}=t.payload;return Ft({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:Ua,setAttributeProp:La})}case ta:{const{groupId:r,attributeId:n,values:a}=t.payload;return Mt({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:La})}case oa:return da.set(e,t.payload)}return e};var Fa=r(85383),Ma=r(82349),Va=r(12848),Ba=r(33192),za=r.n(Ba),Ha=r(17848);const Ya=(e,t,r)=>{const n=Wa(t);if(n.length){const o=qa(e,t,r),i=Ga(e,t,r),l=i.every((e=>(0,O.isTypeSearchGroupAttribute)({data:e})||o.some((0,R.eqProps)("fieldName",e)))),s=(0,O.areAllOperatorsAnd)(t),c=(0,O.areAllOperatorsAnd)(n),u=n.every((e=>{let{filter:t,data:{attrType:r={}}}=e;return[O.FilterOptions.EQUALS,O.FilterOptions.IN_RANGE,O.FilterOptions.FULL_TEXT,O.FilterOptions.ON,O.FilterOptions.WITHIN].includes(t)||O.FilterOptions.EXISTS===t&&(0,O.isBooleanType)(r.type)})),p=(a=n,!Object.values(a.reduce(((e,t)=>{let{data:{fieldName:r},filter:n,values:a}=t;return n===O.FilterOptions.EQUALS&&(0,R.path)([0,"length"],a)&&(e[r]=e[r]&&e[r]+1||1),e}),{})).some((e=>e>1)));return i.length&&s&&c&&u&&n.every((e=>e.data.attrType.faceted))&&l&&p}var a;return!0},Wa=e=>e.flatMap((e=>e.attributes)).filter((0,R.has)("data")),Ga=(e,t,r)=>{const n=Wa(t).map((e=>{let{data:{fieldName:t,entityTypeUri:r},filter:n,values:a}=e;return{entityTypeUri:r,fieldName:t,filter:n,values:a}})).reduce(((t,n)=>{let{entityTypeUri:a,fieldName:o,filter:i,values:l}=n;const{attrType:s}=a?(0,I.eC)(e,[a],[],r).find((e=>e.fieldName===o))||{}:(0,Ha.zH)(o,r)||{},c=!(0,R.isNil)(s)&&s.faceted?((e,t,r,n)=>{if(![O.FilterOptions.EQUALS,O.FilterOptions.IN_RANGE].includes(t)&&![O.FilterOptions.ON,O.FilterOptions.WITHIN].includes(t)||!Array.isArray(e)||(0,O.isEmptyValue)(e[0]))return(0,O.isBooleanType)(n)&&t===O.FilterOptions.EXISTS?[!0,!1]:e&&!(0,O.isEmptyValue)(e[0])?[e[0]]:[];switch(r){case O.FACET_TYPES.NUMERIC_RANGE_FACET:return((e,t)=>{switch(t){case O.FilterOptions.EQUALS:return e.map((e=>[e,e]));case O.FilterOptions.IN_RANGE:return e.some(O.isEmptyValue)?[]:[e]}})(e[0],t);case O.FACET_TYPES.DATE_RANGE_FACET:return((e,t)=>{switch(t){case O.FilterOptions.ON:{const t=za()(e),r=!(0,O.isTimestampBasedType)(n);return[[O.utils.dates.getStartOfDay(t,r),O.utils.dates.getEndOfDay(t,r)]]}case O.FilterOptions.WITHIN:return(0,O.isDateRangeValue)(e)?[(0,O.getDateRangeByValue)(e)]:e.some(O.isEmptyValue)?[]:[e]}})(e[0],t);default:return e[0]}})(l,i,(0,O.getFacetTypeForAttrType)(s),s.type):l;return(0,R.isNil)(c)||(t[o]=(0,R.uniq)((t[o]||[]).concat(c))),t}),{}),a=Object.keys(n).map((e=>({fieldName:e,values:n[e]})));return a.some((e=>{let{values:t}=e;return t&&Array.isArray(t[0])&&t.length>1}))?[]:a},qa=(e,t,r)=>{const n=(0,ht.VO)(t);return(0,I.eC)(e,n,[],r)},Za=(e,t)=>({type:L.Z.UPDATE_ENTITIES,payload:{searchResults:e,entityTypeUri:t}}),$a=()=>({type:L.Z.REFRESH_DISPLAYED_ENTITIES}),Ka=e=>{let{silent:t}=e;return{type:L.Z.CLEAR_ALL,payload:{silent:t}}},Xa=e=>{let{entityTypeUri:t,keywordValue:r}=e;return{type:L.Z.SHOW_MORE_RESULTS_FOR_ENTITY_TYPE,payload:{entityTypeUri:t,keywordValue:r}}},Qa=e=>({type:L.Z.UPDATE_TOTAL,payload:e}),Ja=e=>({type:L.Z.CHANGE_LOADING,payload:e}),eo=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:L.Z.MAP_CHANGE_VALUE,payload:{value:e,searchType:t,silent:r}}},to=(e,t)=>({type:k.k.CREATE_FACETS,payload:{facetsConfigs:e,addToEnd:t}}),ro=e=>({type:k.k.DESTROY_FACETS,payload:e}),no=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:k.k.CHANGE_VALUES,payload:{facetFieldName:e,values:t,silent:r}}},ao=e=>({type:k.k.UPDATE_DATA,payload:e}),oo=e=>({type:k.k.UPDATE_FILTERED_DATA,payload:e}),io=e=>{let{facetsToAdd:t,fieldNamesToDelete:r,changedEntityTypes:n,addToEnd:a}=e;return{type:k.k.HANDLE_CONFIGS_CHANGES,payload:{facetsToAdd:t,fieldNamesToDelete:r,changedEntityTypes:n,addToEnd:a}}};var lo=r(5236),so=r(54145),co=r(49656),uo=r(65751),po=r.n(uo);const mo=e=>{(0,co.U)(e,{title:po().text("Server Error"),defaultMessage:po().text("Something went wrong...")})};var yo=r(69021);const go=(e,t,r)=>`${e}/recommend/${r}/${t}`,fo=e=>e&&1===e.length?e[0]:null,ho=e=>[e].filter((0,R.complement)(O.isComplexAttribute)).map((0,R.compose)(Ma.$9,(0,R.prop)("uri"))).concat((e.children||[]).map(ho)).flat(1/0);function*Eo(){const e=yield(0,Fa.RE)($l),t=yield(0,Fa.Ys)(P().selectors.getTenant),r=yield(0,Fa.Ys)(P().selectors.getEnvironment),n=((e,t,r,n,a)=>{const o=e.map((e=>{let{fieldName:t,values:r}=e;return{fieldName:t,values:r.map((e=>Array.isArray(e)?JSON.stringify(e):e))}})),i={facets:(0,Ma._e)(o).reduce(((e,t)=>{const r=(t.children||[]).map((e=>JSON.stringify(e)));return e[t.fieldName]=r.length>0?r:t.values.slice().sort(),e}),{}),max:5};return{url:go(r,n,a),options:{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}}}})(e,0,yield(0,Fa.Ys)(P().selectors.getServicesPath),t,r);let a;try{a=yield(0,Fa.RE)(O.rawRequest,n.url,n.options),a=a.filter((e=>"type"!==e)).slice(0,5)}catch(e){a=[]}const o=yield(0,Fa.Ys)(P().selectors.getMetadata),i=yield(0,Fa.Ys)(N.DX);a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=fo(arguments.length>2?arguments[2]:void 0),n=r&&(0,O.getEntityType)(e,r),a=(0,yo.vf)(e,n||{}).map(ho).flat(1/0);return t.filter((e=>r||!e.startsWith("attributes."))).filter((e=>!e.startsWith("attributes.")||a.includes(e)))}(o,a,i);const l=((e,t,r,n)=>{const a=e=>!t.includes(e);let o=[];const i=Math.max(0,5-t.length);if(i){const t=fo(n);if(t){const r=((0,O.getEntityType)(e,t).defaultFacetedAttributes||[]).map((r=>(0,O.findAttributeTypeByUri)(e,r,t))).filter((e=>e&&(0,O.isReadableAttribute)(e)&&!(0,O.isComplexAttribute)(e))).map((0,R.prop)("uri")).map(Ma.$9).filter(a);o=o.concat(r)}if(o.length<i){const e=(0,I.Xk)().map((e=>e.fieldName)).filter(a);o=o.concat(e)}}return o.slice(0,i)})(o,a,0,i);var s;a=a.concat(l),yield(0,Fa.gz)((s=a,{type:k.k.SET_RECOMMENDED_FACETS_LIST,payload:s}))}const bo=e=>({type:me,payload:e}),vo=e=>({type:ye,payload:e}),To=(e,t)=>({type:ge,payload:{show:e,postSavingAction:t}}),Oo=e=>({type:fe,payload:e}),xo=(e,t,r)=>({type:Oe,payload:{entityTypeUri:e,columns:t,prevColumns:r}}),Co=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:xe,payload:{entityTypeUri:e,silent:t}}},So=e=>({type:Ce,payload:e}),wo=()=>({type:Re}),Ao=e=>({type:_e,payload:e}),Ro=e=>Ao({payload:{message:e,action:null},type:$.GT.info}),_o=e=>{let{message:t,actionLabel:r,actionToDispatch:n,autoHideDuration:a}=e;return Ao({payload:{message:t,action:{actionLabel:r,actionToDispatch:n},autoHideDuration:a},type:$.GT.info})},Io=e=>({type:Ne,payload:e}),No=e=>({type:he,payload:e});var Do=r(90503),Po=r(82877);const ko=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(e).filter((r=>O.utils.strings.search(r,t)||O.utils.strings.search(e[r].displayName,t)))},Lo=new class{constructor(){this._lookupsCodesResolveTasks=Object.create(null)}addTask(e,t){this._lookupsCodesResolveTasks[e]=t}deleteTask(e){delete this._lookupsCodesResolveTasks[e]}getRunningTask(e){return this._lookupsCodesResolveTasks[e]}clearTasks(){this._lookupsCodesResolveTasks=Object.create(null)}},Uo=(e,t)=>e===t,jo=new class{constructor(){this.isLookupValueResolveTaskRunning=(0,R.curry)(((e,t)=>(0,R.hasPath)([e,t],this._lookupValuesResolveTasks))),this._lookupValuesResolveTasks=Object.create(null)}addTask(e,t){e.forEach((e=>{let{type:r,codeValues:n}=e;!this._lookupValuesResolveTasks[r]&&(this._lookupValuesResolveTasks[r]={}),n.forEach((e=>{this._lookupValuesResolveTasks[r][e]=t}))}))}deleteTask(e){e.forEach((e=>{let{type:t,codeValues:r}=e;this._lookupValuesResolveTasks[t]&&r.forEach((e=>{delete this._lookupValuesResolveTasks[t][e]})),(0,R.isEmpty)(this._lookupValuesResolveTasks[t])&&delete this._lookupValuesResolveTasks[t]}))}getRunningTasks(e){const t=e.flatMap((e=>{let{type:t,codeValues:r}=e;return this._lookupValuesResolveTasks[t]?r.reduce(((e,r)=>{const n=this._lookupValuesResolveTasks[t][r];return n&&e.push(n),e}),[]):[]}));return(0,R.uniqWith)(Uo,t)}clearTasks(){this._lookupValuesResolveTasks=Object.create(null)}};function*Fo(e){const t=jo.getRunningTasks(e);t.length>0&&(yield(0,Fa.v_)(t))}function*Mo(e){try{const t=e.flatMap((e=>{let{type:t,codeValues:r}=e;return r.map((e=>({type:t,codeValue:e})))})),r=yield(0,Fa.rM)(O.resolveLookupsList,t);jo.addTask(e,r);const n=(yield(0,Fa.v_)(r)).reduce(((e,t)=>{const[r]=Object.keys(t),[n]=Object.keys(t[r]),a=(0,R.lensPath)([r,n]),o=(0,R.path)([r,n],t);return(0,R.set)(a,o,e)}),{});for(const e in n)yield(0,Fa.gz)(D.profile.lookups.actions.lookupsForTypeResolved({type:e,values:n[e]}))}catch(e){console.warn(e)}finally{jo.deleteTask(e)}}function*Vo(e){if((0,R.isEmpty)(e))return;const t=e.map((e=>{let{type:t,codeValues:r}=e;const n=jo.isLookupValueResolveTaskRunning(t);return{type:t,codeValues:r.filter((0,R.complement)(n))}})).filter((e=>{let{codeValues:t}=e;return t.length>0}));t.length>0&&(yield(0,Fa.RE)(Mo,t)),yield(0,Fa.RE)(Fo,e)}function*Bo(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:$.cu,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const a=!t&&1===n,o=`${e}${r}`,i=a&&Lo.getRunningTask(o);if(i)yield(0,Fa.v_)(i);else try{const i=yield(0,Fa.rM)(O.getDependentLookups,{type:e,displayNamePrefix:t,max:r,offset:r*(n-1)});a&&Lo.addTask(o,i);const l=yield(0,Fa.v_)(i);yield(0,Fa.gz)(D.profile.lookups.actions.lookupsForTypeResolved({type:e,values:l.codeValues[e]}))}catch(e){console.warn(e)}finally{a&&Lo.deleteTask(o)}}const zo=(e,t,r)=>e.slice((r-1)*t,t*r);function*Ho(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const a=yield(0,Fa.Ys)(P().selectors.getLookups),o=ko(a[e],t);if(o.length>=r*n)return zo(o,r,n);yield(0,Fa.RE)(Bo,e,t,r,n);const i=yield(0,Fa.Ys)(P().selectors.getLookups);return zo(ko(i[e],t),r,n)}const Yo=(e,t)=>Object.keys(e).filter((e=>(0,Va.iL)(e,t))).reduce(((r,n)=>(r[(0,Va.iL)(n,t).fieldName]=e[n],r)),{});function Wo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Go(e,t,r[t])}))}return e}function Go(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*qo(e,t,r){if((0,R.isEmpty)(e))return;const n=yield(0,Fa.Ys)(P().selectors.getLookups),a=yield(0,Fa.Ys)(P().selectors.getMetadata),o=Yo(r,e),i=yield(0,Fa.Ys)(Po.Xf);yield(0,Fa.gz)(t((0,Va.HC)(a,o,e,n,{allowedEntityTypes:i})))}function*Zo(e,t,r){try{const n=yield(0,Fa.RE)(Ll,e.url,e.options),[a,o]=(0,R.partition)(I._H,t);yield(0,Fa.rM)(qo,o,r,n),yield(0,Fa.RE)(ei,a,n),yield(0,Fa.RE)(qo,a,r,n)}catch(e){console.warn(e)}}function*$o(e,t,r){e=Wo({},e,{includeFilter:[]});const n=yield(0,Fa.Ys)(P().selectors.getGlobalSearchRequestOptions),a=(0,Ma.aw)([e],t,[e.fieldName],n);yield(0,Fa.RE)(Zo,a,[e],r)}const Ko=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.filter((t=>{let{label:r}=t;return O.utils.strings.search(r,e)}))},Xo=(e,t)=>Ko(t,e).map((0,R.prop)("value"));function*Qo(e,t,r,n){const a=Wo({},e),o=[...t];if((0,I._H)(a)){const t=(0,O.getAttrTypeLookupCode)(e.attrType);a.includeFilter=yield(0,Fa.RE)(Ho,t,r,(0,R.propOr)($.cu,"pageSize",a),a.pageNumber)}else if("sourceSystems"===a.fieldName){const{sources:e}=yield(0,Fa.Ys)(P().selectors.getMetadata);a.includeFilter=((e,t)=>Ko(t,e).map((e=>{let{uri:t}=e;return(0,O.getLastUriPart)(t)})))(e,r)}else if((0,I.S9)(a)){const t=yield(0,Fa.Ys)(P().selectors.getMetadata),n=(0,O.getEntityType)(t,a.entityTypeUri)||{},o=(0,R.pipe)((0,R.propOr)([],"displayedItems"),(0,R.filter)((0,R.propEq)("isRaw",!0)))(e);a.includeFilter=[...(i=n.matchGroups,l=r,Ko(l,i).map((0,R.prop)("uri"))),...Xo(o,r)]}else a.disableIncludeFilter=!0,o.push({values:[r],fieldName:e.fieldName,filter:"containsWordStartingWith",forceInclude:!0});var i,l;const s=yield(0,Fa.Ys)(P().selectors.getGlobalSearchRequestOptions),c=(0,Ma.aw)([a],o,[e.fieldName],s);yield(0,Fa.RE)(Jo,c,e,a.includeFilter,n)}function*Jo(e,t,r,n){try{const a=yield(0,Fa.RE)(Ll,e.url,e.options),o=yield(0,Fa.Ys)(P().selectors.getLookups),i=Yo(a,[t]);if(r){const e=t.fieldName;i[e]=(0,Va.AX)(i[e],r)}const l=yield(0,Fa.Ys)(P().selectors.getMetadata),s=yield(0,Fa.Ys)(Po.Xf);yield(0,Fa.gz)(n((0,Va.HC)(l,i,[t],o,{allowedEntityTypes:s})))}catch(e){console.warn(e)}}function*ei(e,t){const r=yield(0,Fa.Ys)(P().selectors.getLookups),n=(0,Va.U4)(e,r),a=((e,t,r)=>{const n=((e,t)=>(0,R.pipe)(Object.entries,(0,R.reduce)(((e,r)=>{let[n,a]=r;const o=t.find((0,R.propEq)("fieldName",n));if(!o)return e;const{attrType:i}=o,l=(0,O.getAttrTypeLookupCode)(i);return e[l]={type:l,codeValues:(0,R.uniq)([...(0,R.pathOr)([],[l,"codeValues"],e),...Object.keys(a)])},e}),{}),R.values)(e))(e,t);return(0,O.getUnresolvedLookupsList)(r,n)})(t,e,r),o=(0,O.mergeLookupsLists)(n,a);o.length&&(yield(0,Fa.RE)(Vo,o))}var ti=r(59295);function ri(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ni(e,t,r[t])}))}return e}function ni(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*ai(){const e=yield(0,Fa.Ys)(P().selectors.getMetadata),t=yield(0,Fa.Ys)(Po.Xf),r=yield(0,Fa.Ys)(Po.sl);return(0,Do.wM)(e,t,r)}const oi=e=>t=>{let{value:r}=t;return!e.length||e.includes(r)};function*ii(e){e=e||(yield(0,Fa.Ys)(so.FR));const t=yield(0,Fa.Ys)(Po.XM);if((0,Do.gj)(t)){const t=yield(0,Fa.Ys)(P().selectors.getMetadata),r=yield(0,Fa.Ys)(ti.V6),n=(0,I.$t)(t),a=yield(0,Fa.Ys)(P().selectors.getGlobalSearchRequestOptions),o=(0,Ma.aw)([n],e,[n.fieldName],a),i=e=>{let{type:t=[]}=e;const n=t.filter(oi(r));return So(n)};yield(0,Fa.RE)(Zo,o,[n],i)}else yield(0,Fa.gz)(So([]))}function*li(){const e=yield(0,Fa.Ys)(P().selectors.getMetadata),t=yield(0,Fa.Ys)(Po.Xf),r=yield(0,Fa.Ys)(ti.V6);return(0,Va.wW)(e,{},t).filter(oi(r))}function*si(){const e=yield(0,Fa.Ys)(P().selectors.getMetadata),t=yield(0,Fa.RE)(ai),r=yield(0,Fa.Ys)(Po.uJ),n=(0,Do.oX)().map((0,R.prop)("id")),a=(0,R.pipe)((0,R.map)((0,R.filter)((0,R.pipe)((0,R.prop)("id"),(0,R.cond)([[(0,R.includes)("."),R.T],[(0,R.includes)(R.__,n),R.T],[R.T,R.F]])))),R.toPairs,(0,R.map)((t=>{let[r,n]=t;return[r,(0,Do.Wh)(e,r,(0,R.map)((0,R.prop)("id"),n)).map(((e,t)=>{const r=n.find((0,R.propEq)("id",e.id)),{size:a,autoResize:o=0!==t&&!a}=r||{};return(0,R.reject)(R.isNil,ri({},e,{size:a,autoResize:o}))}))]})),R.fromPairs)(r),o=!(0,R.equals)(r,a),i=Object.keys(t),l=Object.keys(a);var s;!o&&(0,R.equals)(new Set(i),new Set(l))||(yield(0,Fa.gz)((s=ri({},t,(0,R.pick)(i,a)),{type:Te,payload:s})))}function*ci(){const e=yield(0,Fa.Ys)(P().selectors.getMetadata),t=yield(0,Fa.Ys)(N.DX),r=(yield(0,Fa.Ys)(Po.IJ))?yield(0,Fa.RE)(li):yield(0,Fa.RE)(is),n=(0,Do.nx)(e,r,t).map((0,R.prop)("value")),a=yield(0,Fa.Ys)(Po.o4);n.includes(a)||(yield(0,Fa.gz)(Co(n[0],!0)))}function*ui(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{silent:t}=e.payload||{};if(!t){const e=yield(0,Fa.Ys)(Po.tB),t=yield(0,Fa.Ys)(so.t9);if((0,O.isAvailableEntityTypeForDataTenant)(t,e)){const t=yield(0,Fa.Ys)(so.BP,{entityTypeUri:e});(0,R.isNil)(t)&&(yield(0,Fa.gz)($a()))}else yield(0,Fa.gz)(Za([],e))}}function*pi(e){const t=e.payload;yield(0,Fa.RE)(ui,e);const r=yield(0,Fa.Ys)(Po.gu);if((0,Do.gj)(t)&&0===r.length){const e=yield(0,Fa.RE)(li);yield(0,Fa.gz)(So(e)),yield(0,Fa.RE)(ii)}}function*di(){const e=yield(0,Fa.Ys)(Po.qx),t=yield(0,Fa.Ys)(so.Qy);e!==$.om.MAP&&t.length&&(yield(0,Fa.gz)(eo(null)))}function*mi(e){const t=(0,O.removeDtssPrefixFromEntityUri)(e.payload.uri),r=yield(0,Fa.Ys)(Po.tB),n=((yield(0,Fa.Ys)(so.BP,{entityTypeUri:r}))||[]).map((0,R.prop)("uri")),a=(yield(0,Fa.Ys)(so.fx,{entityTypeUri:r}))||0,o=(yield(0,Fa.Ys)(so.Uz,{entityTypeUri:r}))||$.Tu[0],i=n.indexOf(t)+a*o,l=yield(0,Fa.Ys)(so.NU,{entityTypeUri:r}),s=yield(0,Fa.Ys)(P().selectors.getTenant),c=yield(0,Fa.Ys)(so.lF);yield(0,Fa.gz)(D.search.actions.setSearchNavigationData({uri:t,index:i,total:l,tenant:c||s,cache:n}))}const yi=[function*(){yield(0,Fa.Fm)(xe,ui)},function*(){yield(0,Fa.Fm)(Ie,pi)},function*(){yield(0,Fa.Fm)([Ke,Xe,Je],ci)},function*(){yield(0,Fa.Fm)(Ne,di)},function*(){yield(0,Fa.Fm)(D.ui.constants.UIActions.OPEN_ENTITY,mi)}],gi=e=>({type:or,payload:e}),fi=e=>({type:ir,payload:e}),hi=()=>({type:hr}),Ei=e=>({type:Rr,payload:e}),bi=e=>({type:_r,payload:e}),vi=(e,t)=>({type:Dr,payload:{uri:e,isLoading:t}});var Ti=r(90533),Oi=r(86374),xi=r(4898);function Ci(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Si(e,t,r[t])}))}return e}function Si(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*wi(){yield(0,Fa.gz)(bi(!0));try{const t=yield(0,Fa.Ys)(P().selectors.getUserName),r=e=>Ci({},e,{isOwnSearch:t===e.owner}),n=yield(0,Fa.RE)(Ai),{result:a=[],total:o}=yield(0,Fa.RE)(O.getSavedSearches,n);yield(0,Fa.gz)((e=>({type:cr,payload:e}))(o));const i=yield(0,Fa.Ys)(P().selectors.getMetadata),l=yield(0,Fa.Ys)(P().selectors.getDataTenants),s=yield(0,Fa.Ys)(P().selectors.getCanUserReadWorkflowDataTask);yield(0,Fa.gz)((e=a.map(r).map((0,Oi.z7)(i,l,s)),{type:ur,payload:e})),yield(0,Fa.gz)(bi(!1)),yield(0,Fa.RE)(Ii,a)}catch(e){yield(0,Fa.gz)(bi(!1))}var e}function*Ai(){const e=yield(0,Fa.Ys)(Ti.s6),t=yield(0,Fa.Ys)(Ti.wH),r=yield(0,Fa.Ys)(Ti.U3),n=yield(0,Fa.Ys)(Ti.VS),a=yield(0,Fa.Ys)(Ti.kU),{field:o,order:i}=yield(0,Fa.Ys)(Ti.rT);return{offset:e*t,max:e,containsWordStartingWith:r,favoriteOnly:n,findPublic:a,countResults:!1,sortBy:$.PW[o],sortOrder:i}}function*Ri(e){const t=yield(0,Fa.Ys)(Ti.EH,e.payload);yield(0,Fa.RE)(_i,t)}function*_i(e,t){yield(0,Fa.gz)(vi(e.uri,!0));try{const{total:r}=yield(0,Fa.RE)(O.getTotalsForQuery,(0,O.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,Fa.gz)(((e,t)=>({type:pr,payload:{uri:e,total:t}}))(e.uri,r))}catch(e){mo(e)}yield(0,Fa.gz)(vi(e.uri,!1))}function*Ii(e){const t=yield(0,Fa.Ys)(P().selectors.getQueryEstimatorEnabled);return yield(0,Fa.$6)(e.map((e=>(0,Fa.RE)(_i,e,t))))}function*Ni(e){const{uri:t,isPublic:r}=e.payload,n=yield(0,Fa.Ys)(Ti.EH,t);if(n){yield(0,Fa.gz)(bi(!0));try{yield(0,Fa.RE)(O.markSavedSearchAsPublic,(0,Oi.Tp)(n),r),yield(0,Fa.gz)(((e,t)=>({type:br,payload:{uri:e,isPublic:t}}))(t,r))}catch(e){mo(e)}yield(0,Fa.gz)(bi(!1))}}function*Di(e){const{uri:t,isFavorite:r}=e.payload,n=yield(0,Fa.Ys)(Ti.EH,t);if(n){yield(0,Fa.gz)(bi(!0));try{yield(0,Fa.RE)(O.markSavedSearchAsFavorite,(0,Oi.Tp)(n),r),yield(0,Fa.gz)(((e,t)=>({type:Tr,payload:{uri:e,isFavorite:t}}))(t,r))}catch(e){mo(e)}yield(0,Fa.gz)(bi(!1))}}function*Pi(e){const{uri:t,isGlobalFilter:r}=e.payload,n=yield(0,Fa.Ys)(Ti.EH,t);if(n){const e=(0,Oi.V2)(n),{uiState:t}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["uiState"]);(0,O.isObject)("2.0"===t.version?t:t.state)||!r?yield(0,Fa.gz)(((e,t)=>({type:"SAVED_SEARCHES_MARK_GLOBAL_FILTER",payload:{savedSearch:e,isGlobalFilter:t}}))(Ci({},a,{uiState:t,query:(0,O.replacePlaceholdersInQuery)((0,R.propOr)("","query",a))}),r)):(0,co.U)({errorMessage:"Saved Search is incorrect"},{title:po().text("Saved Search can't be mark as global")})}}function*ki(e){const{uri:t,name:r}=e.payload,n=yield(0,Fa.Ys)(Ti.EH,t);if(n&&r!==n.name){yield(0,Fa.gz)(bi(!0));try{yield(0,Fa.RE)(O.updateSavedSearch,Ci({},(0,Oi.Tp)(n),{name:r})),yield(0,Fa.gz)(((e,t)=>({type:Cr,payload:{uri:e,name:t}}))(t,r))}catch(e){mo(e)}yield(0,Fa.gz)(bi(!1))}}function*Li(){const e=yield(0,Fa.Ys)(Ti.Kh);yield(0,Fa.gz)(bi(!0));try{yield(0,Fa.$6)(e.map((e=>(0,Fa.RE)(O.deleteSavedSearch,e)))),yield(0,Fa.gz)(Ei(e.map((0,R.prop)("uri"))))}catch(e){mo(e)}yield(0,Fa.gz)(bi(!1))}function*Ui(e){const t=e.payload;yield(0,Fa.gz)(bi(!0));try{yield(0,Fa.RE)(O.deleteSavedSearch,{uri:t}),yield(0,Fa.gz)(Ei([t]))}catch(e){mo(e)}yield(0,Fa.gz)(bi(!1))}function*ji(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=yield(0,Fa.Ys)(Ti.Cc,e),n=yield(0,Fa.Ys)(xi.Z,t);return{query:r,uiState:n}}function*Fi(e){let{payload:{name:t,share:r}}=e;const{query:n,uiState:a}=yield(0,Fa.RE)(ji,!0),o={isFavorite:!1,isPublic:r===$.ib.public,name:t,query:n,uiState:a},i=yield(0,Fa.Ys)(Ti.tp);yield(0,Fa.gz)(To(!1));try{yield(0,Fa.gz)(Ro(po().text("Saving search...")));const e=yield(0,Fa.RE)(O.createSavedSearch,[o]);e[0].successful?(yield(0,Fa.gz)(gi(e[0].object)),yield(0,Fa.gz)(fi(!1)),yield(0,Fa.gz)(Ro(po().text("Search saved successfully"))),i&&(yield(0,Fa.gz)(i))):mo(e)}catch(e){mo(e)}}function*Mi(e){const{uri:t,debounceTime:r}=e.payload;yield(0,Fa.gz)(vo(!1));const n=yield(0,Fa.Ys)(Ti.EH,t),a=(0,Ti.In)(n)||{},{errors:o}=a;o&&o.length?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,co.U)(e,{message:po().text("Saved Search can't be applied")})}(o):(yield(0,Fa.gz)(gi(n)),(yield(0,Fa.Ys)(so.lF))&&(a.currentTenant=yield(0,Fa.Ys)(P().selectors.getTenant)),yield(0,Fa.gz)(D.search.actions.updateState(Ci({},a,{debounceTime:r}))),yield(0,Fa.qn)(L.Z.STATE_UPDATED))}const Vi=[function*(){yield(0,Fa.Fm)([sr,dr,mr,Ir,yr,kr],wi)},function*(){const e={[Er]:Ni,[vr]:Di,[Ar]:Ui,[wr]:Li,[xr]:ki,[Or]:Pi},t=yield(0,Fa.ZO)(Object.keys(e));for(;;){const r=yield(0,Fa.qn)(t);yield(0,Fa.RE)(e[r.type],r)}},function*(){yield(0,Fa.Fm)([ar],Fi)},function*(){yield(0,Fa.Fm)([Nr],Mi)},function*(){yield(0,Fa.ib)([Pr],Ri)}];function*Bi(e){try{yield(0,Fa.RE)(O.createActivity,{label:O.ACTIVITY_TYPES.userSearch,description:JSON.stringify({activity:e,version:"2.0"})})}catch(e){console.warn(e)}}const zi=e=>({type:Xe,payload:{groupId:e}}),Hi=(e,t)=>({type:rt,payload:{groupId:e,attributeId:t,attribute:xt()}}),Yi=(e,t,r)=>({type:rt,payload:{groupId:e,attributeId:t,attribute:Ct(r)}}),Wi=(e,t,r)=>({type:nt,payload:{groupId:e,attributeId:t,attributeData:St(r)}}),Gi=(e,t)=>({type:nt,payload:{groupId:e,attributeId:t,attributeData:null}}),qi=(e,t,r)=>({type:at,payload:{groupId:e,attributeId:t,selectInfo:r}}),Zi=(e,t,r)=>({type:ot,payload:{groupId:e,attributeId:t,operator:r}}),$i=(e,t)=>({type:it,payload:{groupId:e,attributeId:t}}),Ki=(e,t)=>({type:lt,payload:{groupId:e,attributeId:t}}),Xi=(e,t)=>({type:st,payload:{groupId:e,attributeId:t,id:(0,$e.x0)()}}),Qi=(e,t,r)=>({type:ct,payload:{groupId:e,attributeId:t,filter:r}}),Ji=(e,t,r)=>({type:ut,payload:{groupId:e,attributeId:t,values:r}}),el=(e,t)=>{let{attribute:r,value:n,debounceTime:a=0,pageNumber:o=1,currentOptions:i}=t;return{type:dt,payload:{groupId:e,attribute:r,value:n,debounceTime:a,pageNumber:o,currentOptions:i}}},tl=(e,t,r)=>({type:mt,payload:{groupId:e,attributeId:t,values:r}}),rl=(e,t)=>({type:yt,payload:{groupId:e,attribute:t}});var nl=r(44006);function*al(e){let{groups:t,findGroupPath:r=wt,attributesPropName:n,groupId:a,attributeId:o,selectInfo:i,actions:l}=e;const{checked:s,attribute:c,index:u,selectedAttributes:p}=i,{addAttributeAfter:d,changeAttribute:m,clearAttribute:y,deleteAttribute:g}=l,f=(0,R.pipe)(r(a),(0,R.path)(R.__,t),(0,R.propOr)([],n))(t),h=e=>(0,R.path)([e,"id"],f),E=f.findIndex((0,R.propEq)("id",o));if(o&&0===u)if(s)yield(0,Fa.gz)(m(a,o,c));else{let e=p[u+1];e?(yield(0,Fa.gz)(m(a,o,e)),yield(0,Fa.gz)(g(a,h(E+1)))):yield(0,Fa.gz)(y(a,o))}else{const e=p.length-u,t=o?E+u:f.length-e;s?yield(0,Fa.gz)(d(a,h(t-1),c)):yield(0,Fa.gz)(g(a,h(t)))}}function ol(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){il(e,t,r[t])}))}return e}function il(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*ll(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,Fa.Ys)(ti.go),o={addAttributeAfter:Yi,changeAttribute:Wi,clearAttribute:Gi,deleteAttribute:$i};yield(0,Fa.RE)(al,{groups:a,attributesPropName:"attributes",groupId:t,attributeId:r,selectInfo:n,actions:o}),yield(0,Fa.gz)(zi(t))}function*sl(e){const{attribute:t,groupId:r}=e.payload,n=yield(0,Fa.Ys)(ti._7,r),a=yield(0,Fa.Ys)(P().selectors.getGlobalSearchRequestOptions),{data:{fieldName:o},values:i}=t,l=yield(0,Fa.Ys)(so.L7,n,o),s=ol({},t.data,{values:i?(0,R.flatten)(i):void 0,pageSize:t.data.pageSize+1}),c=(0,Ma.aw)([s],l,[],a);yield(0,Fa.RE)(Zo,c,[s],(e=>((e,t,r)=>({type:pt,payload:{groupId:e,attributeId:t,values:r}}))(r,t.id,e[o])))}function*cl(e){const{attribute:t,value:r,pageNumber:n=1,debounceTime:a,groupId:o,currentOptions:i=[]}=e.payload,{entityTypeUri:l,fieldName:s}=t.data;if(""===r&&1===n)yield(0,Fa.gz)(tl(o,t.id,void 0));else{a&&(yield(0,Fa.gw)(a));const e=yield(0,Fa.Ys)(ti.ad,o,t.id),c=e=>tl(o,t.id,i.concat(e[s]));if(r){const a=l?[{values:[l],fieldName:"type",filter:"equals"}]:[],o=yield(0,Fa.Ys)(so.L7,a,s);yield(0,Fa.rM)(Qo,ol({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),o,r,c)}else{const r=yield(0,Fa.Ys)(ti._7,o),a=yield(0,Fa.Ys)(so.L7,r,s);yield(0,Fa.rM)($o,ol({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),a,c)}}}function*ul(){const e=yield(0,Fa.Ys)(P().selectors.getSearchKeyword),t=yield(0,Fa.Ys)(so.vH),r=yield(0,Fa.RE)($l),n=yield(0,Fa.Ys)(P().selectors.getMetadata),a=yield(0,Fa.Ys)(P().selectors.getDataTenants),o=(0,nl.h)(n,a,r);yield(0,Fa.gz)(D.search.actions.updateState({advanced:o,keyword:e,map:t}))}function*pl(e){const{groupId:t,attributeId:r}=e.payload;yield(0,Fa.gz)($i(t,r)),yield(0,Fa.gz)(zi(t))}function*dl(){if(yield(0,Fa.Ys)(Po.IJ)){const e=yield(0,Fa.Ys)(ti.go),t=yield(0,Fa.Ys)(Po.Xf);for(const r of e){const e=r.entityTypes||[];if((t?e.filter((e=>t.includes(e))):e).length!==e.length){yield(0,Fa.gz)(Ka({silent:!0}));break}}}}const ml=[function*(){yield(0,Fa.ib)([at],ll)},function*(){yield(0,Fa.Fm)([dt],cl)},function*(){yield(0,Fa.ib)(ft,ul)},function*(){yield(0,Fa.ib)(yt,sl)},function*(){yield(0,Fa.ib)([lt],pl)}];function yl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gl(e,t,r[t])}))}return e}function gl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*fl(){const e=yield(0,Fa.Ys)(so.FR);yield(0,Fa.RE)(El);const t=yield(0,Fa.Ys)(Po.tB);var r;yield(0,Fa.gz)((r=t,{type:L.Z.RESET_PAGE,payload:{entityTypeUri:r}})),yield(0,Fa.rM)(Kl,e),yield(0,Fa.rM)(Sl,e),(yield(0,Fa.Ys)(Po.IJ))?yield(0,Fa.rM)(ii,e):yield(0,Fa.rM)(Eo)}function*hl(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,Fa.gw)(t));const r=yield(0,Fa.Ys)(so.FR);yield(0,Fa.rM)(bl,r)}function*El(){const e=yield(0,Fa.Ys)(Po.tB);var t;yield(0,Fa.gz)((t=e,{type:L.Z.CLEAR_RESULTS,payload:t}))}function*bl(e){const t=yield(0,Fa.Ys)(P().selectors.getMetadata),r=yield(0,Fa.Ys)(Po.tB),n=yield(0,Fa.Ys)(so.fx,{entityTypeUri:r}),a=yield(0,Fa.Ys)(so.Uz,{entityTypeUri:r}),o=yield(0,Fa.Ys)(so.L9,{entityTypeUri:r}),i=yield(0,Fa.Ys)(so.NW,{entityTypeUri:r});let l,s=e,c=[];if(r){const n={fieldName:"type",filter:"equals",values:[r]};s=e.filter((e=>"type"!==e.fieldName)).concat(n);const a=yield(0,Fa.RE)(Cl,r);c=(0,R.uniq)(c.concat(a).concat((0,Ma.kx)(t,s,[Ma.cI]))),l=!0}else c=(0,R.uniq)(c.concat((0,Ma.kx)(t,s,[Ma.Bo,Ma.cI]))),l=!1;const u=yl({page:n,rowsPerPage:a,sortOrder:o,sortField:i,forceOvOnly:l},yield(0,Fa.Ys)(P().selectors.getGlobalSearchRequestOptions),{select:c}),p=(0,Ma.XP)(s,u),d=yield(0,Fa.Ys)(so.lF);yield(0,Fa.gz)(Ja(!0));try{let e;if(d){const t=(0,Ma.kH)(s,u);e=yield(0,Fa.RE)(Ll,t)}else{const t=(0,Ma.Lv)(s,u);e=yield(0,Fa.RE)(Ll,$.NV,t)}Array.isArray(e)||(e=[]),yield(0,Fa.RE)(vl,(0,R.reject)(R.isNil,{query:p,sortField:i,sortOrder:o,dataTenant:d})),e=yield(0,Fa.RE)(kl,e),yield(0,Fa.gz)(Za(e,r))}catch(e){yield(0,Fa.gz)(Za([],r))}yield(0,Fa.gz)(Ja(!1))}function*vl(e){var t;yield(0,Fa.gz)((t=e.query,{type:L.Z.UPDATE_URL,payload:t}));const r=yield(0,Fa.Ys)(P().selectors.getSearchProviderData);(0,R.equals)(null==r?void 0:r.data,e)||(yield(0,Fa.gz)(D.search.actions.setSearchNavigationData(null))),yield(0,Fa.gz)(D.search.actions.setSearchProviderData({type:"search",data:e}))}function*Tl(e){const{columns:t,prevColumns:r}=e.payload;if((0,Do.tU)(t,r)){const e=yield(0,Fa.Ys)(Po.o4),t=(yield(0,Fa.Ys)(so.BP,{entityTypeUri:e})).map((e=>e.uri)),r=yield(0,Fa.RE)(Cl,e),n=yield(0,Fa.Ys)(so.FR),a=yield(0,Fa.Ys)(P().selectors.getGlobalSearchRequestOptions),o=(0,Ma.aG)(t,n,yl({select:r},a));yield(0,Fa.gz)(Ja(!0));try{let t=yield(0,Fa.RE)(Ll,o.url,o.options);t=yield(0,Fa.RE)(kl,t),yield(0,Fa.gz)(Za(t,e))}catch(t){yield(0,Fa.gz)(Za([],e)),mo(t)}yield(0,Fa.gz)(Ja(!1))}}function*Ol(){const e=yield(0,Fa.Ys)(Po.tB),t=yield(0,Fa.Ys)(so.BP,{entityTypeUri:e});t&&(yield(0,Fa.gz)(D.search.actions.searchResultsSet(t)))}function*xl(e){const{entityTypeUri:t,keywordValue:r}=e.payload;yield(0,Fa.gz)(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return{type:k.k.CLEAR_ALL_VALUES,payload:{silent:e}}}(!0)),yield(0,Fa.gz)(no("type",[t],!0)),yield(0,Fa.gz)(D.search.actions.keywordUpdated({value:r,isRawFilter:!1}))}function*Cl(e){const t=yield(0,Fa.Ys)(Po.Gv,e);return(0,Do.vw)(t)}function*Sl(e){const t=yield(0,Fa.Ys)(P().selectors.getGlobalSearchRequestOptions),r=(0,Ma.Vg)(e,[],t);try{const e=yield(0,Fa.RE)(Ll,$.jS,{method:"POST",body:JSON.stringify(r)});yield(0,Fa.gz)(Qa(e.total))}catch(e){yield(0,Fa.gz)(Qa(0))}}function*wl(){yield(0,Fa.RE)(Rl);const e=yield(0,Fa.RE)(ji,!0);(0,R.isEmpty)(e.query)||(yield(0,Fa.RE)(Bi,e))}const Al=[pt];function*Rl(){for(;yield(0,Fa.Ys)(ti.UM);)yield(0,Fa.qn)(Al)}function*_l(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,Fa.gw)(t)),(0,Va.$L)(e)&&(yield(0,Fa.RE)(rs)),(0,R.pathOr)(!1,["payload","silent"],e)||(yield(0,Fa.RE)(fl),yield(0,Fa.RE)(wl))}function*Il(e){var t;const r=(0,R.path)(["payload","searchOptions"],e),n=(0,R.path)(["payload","errors"],e),a=(0,R.pathOr)(0,["payload","debounceTime"],e);n&&n.length&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,co.U)(e,{message:po().text("Can't apply search state")})}(n),!(null!==(t=yield(0,Fa.Ys)(P().selectors.getShowSearchByOv))&&void 0!==t?t:yield(0,Fa.Ys)(Po.cC))&&r&&r.searchByOv&&(yield(0,Fa.gz)(D.search.actions.updateSearchOptions({searchByOv:!1,ovOnly:!1}))),yield(0,Fa.RE)(os),yield(0,Fa.RE)(dl),yield(0,Fa.RE)(si),yield(0,Fa.RE)(ci),yield(0,Fa.RE)(Nl),yield(0,Fa.gz)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{type:L.Z.STATE_UPDATED,payload:{debounceTime:e}}}(a))}function*Nl(){const e=yield(0,Fa.Ys)(Po.d7),t=yield(0,Fa.Ys)(so.Qy);!e&&t.length&&(yield(0,Fa.gz)(eo(null,null,!0)))}function*Dl(){const e=yield(0,Fa.Ys)(so.A7),{activityFilter:t,globalFilter:r}=yield(0,Fa.Ys)(P().selectors.getGlobalSearchRequestOptions),n=yield(0,Fa.Ys)(P().selectors.getSearchOptions),a=n&&n.searchByOv,o=[(0,Ma.s4)(e,[],{globalFilter:r})];a&&o.push("options=searchByOv"),t&&o.push(`activeness=${t}`);const i=o.filter(R.identity).join("&"),l=new URLSearchParams(i);if(yield(0,Fa.Ys)(P().selectors.getSharedPreferencesEnabled)){const e=yield(0,Fa.Ys)(P().selectors.getServicesPath),t=yield(0,Fa.Ys)(P().selectors.getTenant),r=yield(0,Fa.Ys)(P().selectors.getEnvironment),n=yield(0,Fa.Ys)(P().selectors.getUserName),a=yield(0,Fa.Ys)(Po.XM),o=yield(0,Fa.Ys)(Po.uJ),i=(0,R.pipe)((0,R.map)((0,R.pipe)((0,R.map)((0,R.path)(["attrType","uri"])),(0,R.reject)(O.isEmptyValue))),(0,R.reject)(R.isEmpty)),s="searchExportData",c={name:s,tenant:t,environment:r,user:n,servicesPath:e,value:{searchResultsColumnsUris:(0,Do.gj)(a)?i(o):void 0}};try{yield(0,Fa.RE)(O.setSharedPreferences,c),l.set("sharedPreferenceName",s)}catch(e){mo(e)}}yield(0,Fa.gz)(D.ui.actions.openConsoleApp("Export","entities",l.toString()))}function*Pl(){yield(0,Fa.gz)(D.ui.actions.openConsoleApp("Data Loader","projects"))}function*kl(e){const t=yield(0,Fa.Ys)(so.lF);return e&&t?e.map((0,O.enrichEntityWithDataTenant)(t)):e}function*Ll(e,t){const r=yield(0,Fa.Ys)(P().selectors.getTenant),n=yield(0,Fa.Ys)(so.lF),a=yield(0,Fa.Ys)(P().selectors.getDtssPath);return yield(0,Fa.RE)(Ma.Es,{url:e,options:t,customerTenant:r,dataTenant:n,dtssPath:a})}const Ul=[k.k.CHANGE_VALUES,D.search.constants.KEYWORD_UPDATED,L.Z.REFRESH,k.k.CLEAR_ALL_VALUES,L.Z.MAP_CHANGE_VALUE,L.Z.CLEAR_ALL,L.Z.STATE_UPDATED,gt,D.search.constants.SEARCH_OPTIONS_UPDATED,D.search.constants.ACTIVITY_FILTER_UPDATED,D.search.constants.GLOBAL_FILTER_UPDATED,L.Z.CHANGE_CURRENT_TENANT],jl=[function*(){yield(0,Fa.Fm)(Ul,_l)},function*(){yield(0,Fa.Fm)([L.Z.CHANGE_PAGE,L.Z.RESET_PAGE,L.Z.CHANGE_ROWS_PER_PAGE,L.Z.REFRESH_DISPLAYED_ENTITIES,L.Z.CHANGE_SORT],hl)},function*(){yield(0,Fa.Fm)(Oe,Tl)},function*(){yield(0,Fa.Fm)([L.Z.UPDATE_ENTITIES,xe,Ie],Ol)},function*(){yield(0,Fa.Fm)(L.Z.SHOW_MORE_RESULTS_FOR_ENTITY_TYPE,xl)},function*(){yield(0,Fa.Fm)(D.search.constants.UPDATE_STATE,Il)},function*(){yield(0,Fa.Fm)(L.Z.EXPORT_RESULTS,Dl)},function*(){yield(0,Fa.Fm)(L.Z.OPEN_DATA_LOADER,Pl)}];var Fl=r(56906);function Ml(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Vl(e,t){try{const[r,n]=yield(0,Fa.RE)(Bl,e,[]);if((0,R.isNil)(r)||(0,R.isNil)(n))yield(0,Fa.gz)(ao({[e.fieldName]:[]}));else{const[a,o]=(0,Va.dG)(e.type),i=(0,Va.q7)(a,r),l=(0,Va.q7)(o,n),s=(0,lo.Oz)(e.attrType&&e.attrType.type),[c,u]=s.greaterThan(i,l)?[l,i]:[i,l],p=yield(0,Fa.RE)(zl,e,c,u,t),d={[e.fieldName]:p};yield(0,Fa.gz)(ao(d))}}catch(e){console.warn(e)}}function*Bl(e,t){const r=yield(0,Fa.Ys)(P().selectors.getGlobalSearchRequestOptions),n=(0,Ma.rN)(e,t,[e.fieldName],r),a=yield(0,Fa.RE)(Ll,n.url,n.options),o=Yo(a,[e]),{min:i,max:l,count:s}=(0,Va.Kn)(o,[e])[e.fieldName];return s?[(0,I.bB)(e)?0:i,l]:[]}function*zl(e,t,r,n){const a=e.attrType&&e.attrType.type,o=(0,Fl.C)(a),i=o.getInterval(t,r,50),l=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ml(e,t,r[t])}))}return e}({interval:i,offset:t},yield(0,Fa.Ys)(P().selectors.getGlobalSearchRequestOptions)),s=(0,Ma.ti)(e,n,[e.fieldName],l),c=yield(0,Fa.RE)(Ll,s.url,s.options),u=yield(0,Fa.Ys)(P().selectors.getMetadata),p=Yo(c,[e]),d=(0,Va.HC)(u,p,[e]);return o.addRanges(d[e.fieldName],t,r,i).map(((e,t,n)=>({value:[e.value,t<n.length-1?n[t+1].value:r],number:e.number})))}function Hl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Yl={matches:Ma.dW,"dtPotentialMatches.matches":Ma.dW,"potentialMatches.matchScore":Ma._9};function*Wl(e,t){try{const[r,n]=yield(0,Fa.RE)(Bl,e,[]);if((0,R.isNil)(r)||(0,R.isNil)(n))yield(0,Fa.gz)(ao({[e.fieldName]:[]}));else{const[a,o]=(0,Va.dG)(e.type),i=(0,Va.q7)(a,r),l=(0,Va.q7)(o,n),s=yield(0,Fa.RE)(Gl,e,i,l,t),c={[e.fieldName]:s};yield(0,Fa.gz)(ao(c))}}catch(e){console.warn(e)}}function*Gl(e,t,r,n){const a=yield(0,Fa.Ys)(P().selectors.getGlobalSearchRequestOptions),o=Math.min(5,r-t+1),i=yield(0,Fa.RE)(O.rawRequest,Yl[e.fieldNameForRequest||e.fieldName](t,r,o,n,[e.fieldName],function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Hl(e,t,r[t])}))}return e}({},a,{dataTenant:e.dataTenant})));return i.map((e=>({number:e.count,value:[e.from,e.to]})))}function ql(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Zl(e,t,r[t])}))}return e}function Zl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*$l(){const e=yield(0,Fa.Ys)(N.X0),t=yield(0,Fa.Ys)(N.Mp);return Object.values((0,Va.t8)(e,t))}function*Kl(e){const t=yield(0,Fa.RE)($l),[r,n]=(0,R.partition)(I.bB,t);let[a,o]=(0,R.partition)(O.isRangeFacet,n);for(let t=0;t<r.length;t++)yield(0,Fa.rM)(Wl,r[t],e);for(let t=0;t<a.length;t++)yield(0,Fa.rM)(Vl,a[t],e);const[i,l]=(0,R.partition)((e=>e.values&&e.values.length),o);for(let t=0;t<i.length;t++)yield(0,Fa.rM)(Ql,i[t],e);const[s,c]=(0,R.partition)(I.DT,l);for(const t of s)yield(0,Fa.rM)(Jl,[t],e);c.length&&(yield(0,Fa.rM)(Jl,c,e))}function*Xl(e){const t=yield(0,Fa.Ys)(so.FR),[r,n]=(0,R.partition)(I.bB,e.payload),[a,o]=(0,R.partition)(O.isRangeFacet,n),[i,l]=(0,R.partition)(I.DT,o);for(let e=0;e<r.length;e++)yield(0,Fa.rM)(Wl,r[e],t);for(let e=0;e<a.length;e++)yield(0,Fa.rM)(Vl,a[e],t);for(const e of i)yield(0,Fa.rM)(Jl,[e],t);l.length&&(yield(0,Fa.rM)(Jl,l,t))}function*Ql(e,t,r){const n=yield(0,Fa.Ys)(P().selectors.getGlobalSearchRequestOptions),a=(0,Ma.aw)([ql({},e,{pageSize:e.pageSize+1})],t,[e.fieldName],n,r);yield(0,Fa.RE)(es,a,[e])}function*Jl(e,t,r){const n=yield(0,Fa.Ys)(P().selectors.getGlobalSearchRequestOptions),a=(0,Ma.aw)(e.map((e=>ql({},e,{pageSize:e.pageSize+1}))),t,[],n,r);yield(0,Fa.RE)(es,a,e)}function*es(e,t){yield(0,Fa.RE)(Zo,e,t,ao)}function*ts(e){const{facetFieldName:t,value:r,debounceTime:n,pageNumber:a=1,currentOptions:o=[]}=e.payload;if(""===r&&1===a)yield(0,Fa.gz)((e=>({type:k.k.DESTROY_FILTERED_DATA,payload:e}))(t));else{const e=yield(0,Fa.Ys)(N.X0),i=yield(0,Fa.Ys)(N.Mp),l=ql({},(0,Va.t8)(e,i)[t]);if("type"===t){const e={[t]:[...l.data.filter((e=>e.label.toLowerCase().includes(r.toLowerCase())))]};yield(0,Fa.gz)(oo(e))}else{n&&(yield(0,Fa.gw)(n));const e=yield(0,Fa.Ys)(so.FR),i=yield(0,Fa.Ys)(N.rM,t),s=e=>oo({[t]:o.concat(e[t])});r?yield(0,Fa.rM)(Qo,ql({},l,{displayedItems:i,pageNumber:a,pageSize:l.pageSize+1}),e,r,s):yield(0,Fa.rM)($o,ql({},l,{pageNumber:a,pageSize:l.pageSize+1}),e,s)}}}function*rs(){const e=yield(0,Fa.Ys)(N.DX),t=t=>t.entityTypeUri&&t.entityTypeUri!==e[0],r=yield(0,Fa.Ys)(N.Mp);if(1!==e.length||r.some(t)){const n=r.filter((r=>1!==e.length&&!!r.entityTypeUri||1===e.length&&t(r))).map((e=>e.fieldName));n.length&&(yield(0,Fa.gz)(ro(n)))}}function*ns(e){const{facetsToAdd:t=[],fieldNamesToDelete:r=[],changedEntityTypes:n,addToEnd:a=!1}=e.payload;if(t.length||r.length){t.length&&(yield(0,Fa.gz)(to(t,a)));const e=yield(0,Fa.RE)($l);let i=!1;if(r.length){const t=e.filter((e=>e.values&&e.values.length));i=r.some((e=>t.some((t=>t.fieldName.startsWith(e))))),yield(0,Fa.gz)(ro(r))}if(null!=n)yield(0,Fa.gz)(no("type",n));else if(i)yield(0,Fa.gz)(function(){let{debounceTime:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:L.Z.REFRESH,payload:{debounceTime:e}}}());else if(t.length){const r=e.filter((e=>t.some((t=>e.fieldName.startsWith(t.fieldName)))));yield(0,Fa.gz)((o=r,{type:k.k.REQUEST_GIVEN_FACETS_DATA,payload:o}))}}var o}function*as(){const e=yield(0,Fa.Ys)(P().selectors.getSearchKeyword),t=yield(0,Fa.Ys)(so.vH),r=yield(0,Fa.Ys)(ti.go),n=yield(0,Fa.Ys)(P().selectors.getMetadata),a=yield(0,Fa.Ys)(P().selectors.getDataTenants);if(Ya(n,r,a)){const o=((e,t,r)=>{const n=qa(e,t,r),a=Ga(e,t,r),o=(0,R.pipe)(R.flatten,R.uniq)((0,ht.VO)(t)),i=(0,I.$t)(e);return a.reduce(((e,t)=>{let{fieldName:r,values:a}=t;const o=n.find((e=>e.fieldName===r));return o&&(e.facetsConfigs.push(o),e.facetsData[r]={values:a}),e}),{facetsConfigs:[i],facetsData:{[i.fieldName]:(l=o,(0,Va.Kk)({values:l})?{values:l,showAllItems:!0}:{values:l})}});var l})(n,r,a);yield(0,Fa.gz)(D.search.actions.updateState({facets:o,keyword:e,map:t}))}}function*os(){if(!(yield(0,Fa.Ys)(Po.IJ))){const e=yield(0,Fa.Ys)(P().selectors.getMetadata);if((yield(0,Fa.Ys)(N.Mp)).some(O.isTypeFacet)){const e=yield(0,Fa.Ys)(Po.Xf),t=yield(0,Fa.Ys)(N.DX);(e?t.filter((t=>e.includes(t))):t).length!==t.length&&(yield(0,Fa.gz)(Ka({silent:!0})))}else{const t=[(0,I.$t)(e)];yield(0,Fa.gz)(to(t))}}}function*is(){const e=yield(0,Fa.Ys)(P().selectors.getMetadata),t=yield(0,Fa.Ys)(N.X0),r=(0,Va.t8)({type:t.type},[(0,I.$t)(e)]).type.data.reduce(((e,t)=>(e[(0,O.getLastUriPart)(t.value)]=t.number,e)),{}),n=yield(0,Fa.Ys)(Po.Xf);return(0,Va.wW)(e,r,n)}const ls=[function*(){yield(0,Fa.Fm)([k.k.FILTER_FACET_DATA],ts)},function*(){yield(0,Fa.ib)(k.k.REQUEST_GIVEN_FACETS_DATA,Xl)},function*(){yield(0,Fa.ib)(k.k.HANDLE_CONFIGS_CHANGES,ns)},function*(){yield(0,Fa.ib)(k.k.CONVERT_FROM_ADVANCED_SEARCH,as)}];function ss(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cs=e=>{const t=["view","searchResultsColumns"],r=(0,R.pathOr)({},t,e),n=(0,R.map)((0,R.map)((0,R.pipe)((0,R.omit)(["size"]),(e=>e.attrType?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ss(e,t,r[t])}))}return e}({},e,{attrType:{uri:(0,R.pathOr)("",["attrType","uri"],e)}}):e))),r),a=(0,R.lensPath)(t),o=(0,R.omit)(["sortField","sortOrder","entityTypeTab"],e.view),i=(0,R.lensPath)(["view"]),l=["keyword"],s=(0,R.pathOr)("",l,e),c=(0,R.lensPath)(l),u=["map"],p=(0,R.pathOr)("",u,e),d=(0,R.lensPath)(u);return(0,R.pipe)((0,R.omit)(["searchOptions"]),(0,R.set)(i,o),(0,R.set)(a,n),(0,R.set)(c,s),(0,R.set)(d,p))(e)};function us(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ps(e,t,r[t])}))}return e}function ps(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*ds(e){let{payload:{share:t}}=e;const{query:r,uiState:n}=yield(0,Fa.RE)(ji,!0),a=us({},yield(0,Fa.Ys)(Ti.LA),{isPublic:t===$.ib.public,query:r,uiState:n}),o=yield(0,Fa.Ys)(Ti.tp);yield(0,Fa.gz)(To(!1));try{yield(0,Fa.gz)(Ro(po().text("Updating search..."))),yield(0,Fa.RE)(O.updateSavedSearch,a),yield(0,Fa.gz)(fi(!1)),yield(0,Fa.gz)(Ro(po().text("Search updated successfully"))),o&&(yield(0,Fa.gz)(o))}catch(e){mo(e)}}function*ms(){const e=yield(0,Fa.Ys)(Ti.LA);if(!e)return void(yield(0,Fa.gz)(fi(!1)));const t=yield(0,Fa.Ys)(P().selectors.getMetadata),r=yield(0,Fa.Ys)(P().selectors.getDataTenants),n=yield(0,Fa.Ys)(P().selectors.getCanUserReadWorkflowDataTask),{uiState:a}=(0,Oi.z7)(t,r,n,yield(0,Fa.RE)(ji)),o=(e=>{let{savedUiState:t,actualUiState:r}=e;const n=cs(t),a=cs(r);if(!(0,R.equals)(n,a))return!1;if((0,R.path)(["view","searchResultsMode"],t)===$.ll.TABLE){const e=["view","sortField"],n=["view","sortOrder"],a=["view","entityTypeTab"],o=(0,R.path)(e,t),i=(0,R.path)(e,r),l=(0,R.path)(n,t),s=(0,R.path)(n,r),c=(0,R.path)(a,t),u=(0,R.path)(a,r);if(!(0,R.equals)(o,i)||!(0,R.equals)(l,s)||!(0,R.equals)(c,u))return!1}const o=["searchOptions"],i=(0,R.pathOr)(null,o,t),l=(0,R.pathOr)(null,o,r);return!!((0,R.isNil)(i)||(0,R.isNil)(l)||(0,R.equals)(i,l))})({savedUiState:e.uiState,actualUiState:a});yield(0,Fa.gz)(fi(!o))}function*ys(e){const t=yield(0,Fa.Ys)(Ti.LA);if(t)switch(e.type){case Cr:case br:case Tr:t.uri===e.payload.uri&&(yield(0,Fa.gz)(gi(us({},t,e.payload))));break;case Rr:(0,R.includes)(t.uri,e.payload)&&(yield(0,Fa.gz)(gi(null)));break;case lr:yield(0,Fa.gz)(gi(us({},t,{isPublic:e.payload.share===$.ib.public})));break;default:(yield(0,Fa.Ys)(so.kw))&&(yield(0,Fa.gz)(gi(null)))}}function*gs(e){const t=yield(0,Fa.Ys)(Ti.EH,e);if(t)return t;const r=yield(0,Fa.Ys)(P().selectors.getMetadata),n=yield(0,Fa.Ys)(P().selectors.getDataTenants),a=yield(0,Fa.Ys)(P().selectors.getCanUserReadWorkflowDataTask);try{const t=yield(0,Fa.RE)(O.getSavedSearch,(0,Oi.tk)(e));return(0,Oi.z7)(r,n,a,t)}catch(e){return mo(e),null}}function*fs(e){const t=(0,R.path)(["payload","currentSavedSearchUri"],e);if(!t)return;const r=yield(0,Fa.Ys)(Ti.LA);if((0,R.prop)("uri",r)===t)return;const n=yield(0,Fa.RE)(gs,t);n&&(yield(0,Fa.gz)(gi(n)),yield(0,Fa.RE)(ms))}const hs=[...Ul,xe,L.Z.CHANGE_SORT,Ie,Oe,we,Se,Ne,k.k.CREATE_FACETS,k.k.DESTROY_FACETS,k.k.SHOW_MORE_ENTITY_TYPES],Es=[function*(){yield(0,Fa.Fm)(hs,ms)},function*(){yield(0,Fa.Fm)([lr],ds)},function*(){yield(0,Fa.Fm)([Cr,br,Tr,Rr,lr,...Ul],ys)},function*(){yield(0,Fa.Fm)(D.search.constants.UPDATE_STATE,fs)}];function bs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*vs(){yield(0,Fa.gw)(500);const{uiState:e,query:t}=yield(0,Fa.RE)(ji,!1,!0),r=yield(0,Fa.Ys)(Ti.LA);yield(0,Fa.gz)(D.search.actions.saveState(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){bs(e,t,r[t])}))}return e}({},e,{query:t,currentSavedSearchUri:(0,R.path)(["uri"],r)})))}function*Ts(){yield(0,Fa.qn)(D.search.constants.UPDATE_STATE);const e=(0,R.reject)((0,R.includes)(R.__,[L.Z.REFRESH]),hs);yield(0,Fa.Fm)([or,...e],vs)}const Os=e=>({type:Lr,payload:e}),xs=()=>({type:Br}),Cs=e=>({type:Hr,payload:e}),Ss=e=>({type:Wr,payload:e}),ws=(e,t)=>({type:Zr,payload:{searchCreatedDate:e,isLoading:t}});var As=r(97010),Rs=r(73667);const _s=(0,R.path)([$.Jf,"recentSearches"]),Is=e=>_s(e).items,Ns=e=>_s(e).filterWord,Ds=(0,R.curry)(((e,t)=>!e||t&&t.name.toLocaleLowerCase().includes(e.toLocaleLowerCase()))),Ps=e=>(0,R.pipe)(Is,(0,R.filter)(Ds(Ns(e))))(e),ks=e=>_s(e).loading,Ls=(0,Rs.Rm)(Is),Us=(0,Rs.d1)(Is),js=(0,Rs.Ky)(Is),Fs=(0,Rs.$y)(Is),Ms=e=>_s(e).lastSavedRecentSearch,Vs=(e,t)=>Is(e).find((0,R.propEq)("createdDate",t)),Bs=(0,R.path)(["advancedSearch","searchParams","groups"]),zs=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,R.chain)((0,R.prop)("attributes")),r=(0,R.filter)((0,R.has)("values")),n=(0,R.pipe)(Bs,t,r),a=(0,R.pipe)((0,R.prop)("values"),(0,R.map)((0,R.prop)("label")),(0,R.join)(", ")),o=(0,R.path)(["data","title"]),i=(0,R.pathEq)(["data","fieldName"],"type"),l=(0,R.find)(i),s=(0,R.pipe)(l,(0,R.when)(R.identity,a)),c=(0,R.pipe)((0,R.reject)(i),(0,R.map)(o),(0,R.reject)(R.isNil),(0,R.join)(", ")),u=e=>[s(e),c(e)].filter(R.identity).join(" - ");return u(n(e))},Hs=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,R.prop)("facets"),r=(0,R.prop)("facetsData"),n=(0,R.prop)("facetsConfigs"),a=(0,R.prop)("values"),o=(0,R.prop)("label"),i=(0,R.prop)("title"),l=(0,R.pipe)(a,(e=>e&&e.length>0)),s=e=>(0,R.pipe)((0,R.propOr)([],"data"),(0,R.find)((0,R.propEq)("value",e)),(0,R.defaultTo)({}),o),c=(0,R.curry)(((e,r)=>(0,R.pipe)(t,n,(0,R.find)((0,R.propEq)("fieldName",r)),(0,R.defaultTo)({}),i)(e))),u=(0,Va.XK)(e),p=[];u&&p.push(a(u).map(s).map((e=>e(u))).join(", "));const d=(0,R.pipe)(t,r,R.values,(0,R.reject)(O.isTypeFacet),(0,R.filter)(l),(0,R.map)((0,R.prop)("fieldName"))),m=(0,R.pipe)(d,(0,R.map)(c(e))),y=m(e);return y.length>0&&p.push(y.join(", ")),p.filter(R.identity).join(" - ")};function Ys(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ws(e,t,r[t])}))}return e}function Ws(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Gs(){yield(0,Fa.gz)(Ss(!0));try{const t=yield(0,Fa.Ys)(P().selectors.getTenant),r=yield(0,Fa.Ys)(P().selectors.getEnvironment),n=yield(0,Fa.Ys)(P().selectors.getServicesPath),{result:a=[]}=yield(0,Fa.RE)(O.getRecentSearches,{environment:r,tenant:t,servicesPath:n}),o=(0,R.sort)((0,R.descend)((0,R.prop)("createdDate")))(a);yield(0,Fa.gz)((e=o,{type:jr,payload:e})),yield(0,Fa.gz)(Ss(!1)),yield(0,Fa.RE)($s,o)}catch(e){mo(e),yield(0,Fa.gz)(Ss(!1))}var e}function*qs(e){const t=yield(0,Fa.Ys)(Vs,e.payload);yield(0,Fa.RE)(Zs,t)}function*Zs(e,t){yield(0,Fa.gz)(ws(e.createdDate,!0));try{const{total:r}=yield(0,Fa.RE)(O.getTotalsForQuery,(0,O.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,Fa.gz)(((e,t)=>({type:Fr,payload:{searchCreatedDate:e,total:t}}))(e.createdDate,r))}catch(e){mo(e)}yield(0,Fa.gz)(ws(e.createdDate,!1))}function*$s(e){const t=yield(0,Fa.Ys)(P().selectors.getQueryEstimatorEnabled);return yield(0,Fa.$6)(e.map((e=>(0,Fa.RE)(Zs,e,t))))}function*Ks(){const e=yield(0,Fa.Ys)(Fs),t=yield(0,Fa.Ys)(P().selectors.getServicesPath);yield(0,Fa.gz)(Ss(!0));try{yield(0,Fa.$6)(e.map((e=>(0,Fa.RE)(O.deleteRecentSearch,Ys({},e,{servicesPath:t}))))),yield(0,Fa.gz)(Cs(e))}catch(e){mo(e)}yield(0,Fa.gz)(Ss(!1))}function*Xs(e){const t=e.payload,r=yield(0,Fa.Ys)(P().selectors.getServicesPath);yield(0,Fa.gz)(Ss(!0));try{yield(0,Fa.RE)(O.deleteRecentSearch,Ys({},t,{servicesPath:r})),yield(0,Fa.gz)(Cs([t]))}catch(e){mo(e)}yield(0,Fa.gz)(Ss(!1))}function*Qs(){const{query:e,uiState:t}=yield(0,Fa.RE)(ji,!0),r=yield(0,Fa.Ys)(Po.$s),n=yield(0,Fa.Ys)(Ms),a=yield(0,Fa.Ys)(so.kw),o=yield(0,Fa.Ys)(P().selectors.getTenant),i=yield(0,Fa.Ys)(P().selectors.getEnvironment),l=yield(0,Fa.Ys)(P().selectors.getServicesPath),s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Bs(e);return t&&t.length>0?zs(e):Hs(e)}(r),c=(0,O.getHash)(e),u={query:e,state:t,name:s,environment:i,tenant:o};try{if(n!==c&&!a){const e=yield(0,Fa.RE)(O.createRecentSearch,u,l);e.success?yield(0,Fa.gz)((e=>({type:qr,payload:e}))(c)):mo(e)}}catch(e){mo(e)}}function*Js(e){const{search:t,debounceTime:r}=e.payload;yield(0,Fa.gz)(vo(!1));const n=yield(0,Fa.Ys)(P().selectors.getMetadata),a=yield(0,Fa.Ys)(P().selectors.getDataTenants),o=yield(0,Fa.Ys)(P().selectors.getCanUserReadWorkflowDataTask);let i={};try{i=(0,R.pipe)(As.Z,(0,As.f)(null))(n,JSON.parse(t.state),{},a,o)}catch(e){i={}}(yield(0,Fa.Ys)(so.lF))&&(i.currentTenant=yield(0,Fa.Ys)(P().selectors.getTenant)),yield(0,Fa.gz)(D.search.actions.updateState(Ys({},i,{debounceTime:r})))}const ec=e=>{let{type:t,payload:r={}}=e;return t===D.search.constants.KEYWORD_UPDATED&&!(null==r||!r.saveToRecent)},tc=[function*(){yield(0,Fa.Fm)([Ur],Gs)},function*(){yield(0,Fa.ib)(zr,Ks)},function*(){yield(0,Fa.Fm)([D.ui.constants.UIActions.OPEN_ENTITY,ar,lr,Lr,L.Z.CHANGE_PAGE,L.Z.CHANGE_ROWS_PER_PAGE,L.Z.EXPORT_RESULTS,ec],Qs)},function*(){yield(0,Fa.Fm)([Kr],Js)},function*(){yield(0,Fa.ib)([$r],qs)},function*(){yield(0,Fa.ib)(Yr,Xs)}],rc=e=>e[$.Jf].entity.loading,nc=e=>e[$.Jf].entity.selectedEntityUri,ac=e=>e[$.Jf].entity.entity,oc=e=>({type:Tn,payload:e}),ic=e=>({type:On,payload:e}),lc=e=>({type:xn,payload:e}),sc=e=>({type:Cn,payload:e});function*cc(e){if(yield(0,Fa.Ys)(so.lF)){const t=yield(0,Fa.RE)(Ll,(0,O.getDtssEntityUrl)(e));return(yield(0,Fa.RE)(kl,t))[0]}return yield(0,Fa.RE)(O.getEntity,e)}function*uc(e){const t=e.payload;(yield(0,Fa.Ys)(nc))!==t&&(yield(0,Fa.gz)(lc(t)));const r=yield(0,Fa.Ys)(ac);if(yield(0,Fa.gz)(oc(!0)),(0,R.isNil)(t))yield(0,Fa.gz)(sc(null));else if(!r||r.uri!==t)try{const e=yield(0,Fa.RE)(cc,t);yield(0,Fa.gz)(sc(e))}catch(e){n=e,(0,co.U)(n,{defaultMessage:po().text("Can't load entity")}),yield(0,Fa.gz)(sc(null))}var n;yield(0,Fa.gz)(oc(!1))}const pc=[function*(){yield(0,Fa.Fm)(On,uc)}];function*dc(e){const t="type"===(0,R.path)(["payload","facetFieldName"],e),r=(0,R.path)(["payload","values"],e);if(!t||1!==(0,R.length)(r))return;const n=yield(0,Fa.Ys)(P().selectors.getMetadata),a=(0,O.getEntityType)(n,r[0]),o=a.defaultFacetedAttributes||[];if(o.length>0){const e=yield(0,Fa.Ys)(N.Mp),t=t=>{let{fieldName:r}=t;return(0,R.none)((0,R.propEq)("fieldName",r),e)},r=(0,yo.vf)(n,a).map((e=>(0,yo.NG)(n,e,a.uri,"",I.u7))),i=o.reduce(((e,n)=>{const a=(0,O.attributeUriToSearchUri)(n),o=(0,I.zy)(r,a);return o&&t(o)?e.concat(o.children?(0,yo.jj)(o).filter(t):o):e}),[]);i.length>0&&(yield(0,Fa.gz)(to(i,!0)))}}const mc=[function*(){yield(0,Fa.Fm)(k.k.CHANGE_VALUES,dc)}],yc=e=>({type:Vn,payload:e}),gc=()=>({type:Hn}),fc=()=>({type:Dn}),hc=e=>({type:Ln,payload:e}),Ec=e=>({type:jn,payload:e}),bc=e=>({type:Mn,payload:e}),vc=e=>({type:zn,payload:e}),Tc=e=>({type:Yn,payload:e}),Oc=e=>{let{id:t,groupId:r}=e;return{type:Zn,payload:{id:t,groupId:r}}},xc=e=>{let{id:t,groupId:r,operationParameters:n}=e;return{type:qn,payload:{id:t,groupId:r,operationParameters:n}}},Cc=(e,t,r)=>({type:Kn,payload:{groupId:e,attributeId:t,attribute:Ct(r)}}),Sc=(e,t,r)=>({type:Xn,payload:{groupId:e,attributeId:t,attributeData:St(r)}}),wc=(e,t)=>({type:Xn,payload:{groupId:e,attributeId:t,attributeData:null}}),Ac=(e,t,r)=>({type:Qn,payload:{groupId:e,attributeId:t,selectInfo:r}}),Rc=(e,t)=>({type:Jn,payload:{groupId:e,attributeId:t}}),_c=(e,t,r)=>({type:ea,payload:{groupId:e,attributeId:t,filter:r}}),Ic=(e,t,r)=>({type:ta,payload:{groupId:e,attributeId:t,values:r}}),Nc=e=>({type:oa,payload:e});var Dc=r(97698);const Pc=(0,R.has)("actions"),kc=e=>e.actions.map((0,R.assocPath)(["operationParameters","conditions"],e.conditions)),Lc=(0,R.path)(["operationParameters","attributeTypeData","attributeType"]),Uc=(0,R.path)(["operationParameters","attributeTypeData","fieldName"]),jc=(0,R.path)(["operationParameters","pin"]),Fc=(0,R.path)(["operationParameters","addNestedAttribute"]),Mc=(0,R.path)(["operationParameters","attributeValue"]),Vc=(0,R.path)(["operationParameters","attributeValueToFind"]),Bc=(0,R.anyPass)([(0,R.equals)($.Vh.AddNew),(0,R.equals)($.Vh.ReplaceAllWith)]),zc=(0,R.anyPass)([(0,R.equals)($.Vh.AddNew),(0,R.equals)($.Vh.ReplaceAllWith),(0,R.equals)($.Vh.FindAndReplace)]),Hc=(0,R.equals)($.Vh.AddNew),Yc=(0,R.both)((0,R.pipe)(Lc,O.isNested),(0,R.pipe)((0,R.prop)("operation"),Bc)),Wc=(0,R.both)((0,R.pipe)(Lc,O.isReference),(0,R.pipe)((0,R.prop)("operation"),Hc)),Gc=(0,R.both)((0,R.pipe)(Mc,O.isLookupAttrType),(0,R.pipe)((0,R.prop)("operation"),zc));function qc(e){switch(e){case $.Vh.AddNew:case $.Vh.RepointReference:case $.Vh.ReplaceAllWith:return["attributeValue"];case $.Vh.FindAndReplace:return["attributeValueToFind","attributeValue"];case $.Vh.FindAndRemove:return["attributeValueToFind"];default:return[]}}const Zc=e=>{if(!e.operation||!e.operationParameters)return!1;const t=Yc(e),r=Wc(e),n=qc(e.operation);for(let a of n){const n=e.operationParameters[a];if((0,O.isEmptyValue)(n)||r&&(0,O.isEmptyValue)((0,O.getReferencedEntityFromAttrValue)(n))||t&&(0,O.isEmptyValue)((0,O.cleanAttributesWith)({deleteEmptyComplex:!0})(n.value)))return!1}return!0},$c=e=>{const t=Yc(e),r=Wc(e);return t||r?qc(e.operation).reduce(((e,t)=>{const r=["operationParameters",t,"value"];if((0,R.path)(r,e)){const t=(0,R.lensPath)(r);return(0,R.over)(t,(0,O.cleanAttributesWith)({deleteEmptyComplex:!0}),e)}return e}),e):e},Kc=e=>e[$.Jf].bulkUpdate.operation,Xc=e=>e[$.Jf].bulkUpdate.activeStep,Qc=e=>e[$.Jf].bulkUpdate.loading,Jc=e=>{const t=(0,Po.IJ)(e)?(0,ti.V6)(e):(0,N.DX)(e),r=(0,Po.tB)(e);return r||1===t.length?r||t[0]:null},eu=(0,R.path)([$.Jf,"bulkUpdate","objects"]),tu=e=>eu(e).total,ru=e=>eu(e).selectionMode,nu=e=>eu(e).entities,au=e=>eu(e).selectedEntities,ou=e=>eu(e).page,iu=e=>eu(e).rowsPerPage,lu=e=>eu(e).sortField,su=e=>eu(e).sortOrder,cu=e=>eu(e).selectedColumns,uu=e=>eu(e).filterText,pu=(0,R.pipe)(ru,(0,R.equals)($.v6.include)),du=(0,R.ifElse)(pu,(0,R.pipe)(au,R.length),(e=>{const t=au(e).length;return(0,so.hX)(e)-t})),mu=(0,R.pipe)(du,(0,R.gt)(R.__,0)),yu=e=>e[$.Jf].bulkUpdate.actions,gu=(0,Dc.createSelector)(yu,(0,R.pipe)((0,R.map)((0,R.ifElse)(Pc,(0,R.evolve)({actions:(0,R.pipe)((0,R.map)($c),(0,R.filter)(Zc))}),$c)),(0,R.filter)((0,R.ifElse)(Pc,(0,R.pipe)((0,R.path)(["actions","length"]),(0,R.gt)(R.__,0)),Zc)))),fu=(0,Dc.createSelector)(yu,(0,R.pipe)((0,R.map)((0,R.when)(Pc,(0,R.prop)("actions"))),R.flatten)),hu=e=>{const t=fu(e);return 0!==t.length&&t.every(Zc)},Eu=e=>e[$.Jf].bulkUpdate.requestPending,bu=(0,O.getUrisForSaving)((e=>(0,R.equals)(e.slice(-3),["operationParameters","attributeValue","entityUri"]))),vu=(0,R.curry)(((e,t,r)=>{const n=(0,R.pipe)(bu,(0,R.find)((t=>(0,R.pathSatisfies)((t=>t===e),t,r))))(r);return n?(0,R.set)((0,R.lensPath)(n),t,r):r})),Tu=(e,t,r)=>(0,R.pipe)(vu(e,t),(0,R.when)((e=>e===r),(0,O.replaceTemporaryRefEntityURI)(e,t)))(r),Ou=(0,R.pathEq)(["data","fieldName"],$.E_),xu=(0,R.pipe)((0,R.path)(["values",0,"entityUri"]),(0,R.objOf)("uri"),O.getEntityId,O.wrapInQuotes),Cu=e=>[{attributes:e,operator:"or"}],Su=(0,R.curry)(((e,t,r)=>r.map((r=>{const{data:{fieldName:n}}=r,a=n.split(".");let[o,i]=((e,t)=>{let r=0;for(;r<Math.min(e.length,t.length)&&e[r]===t[r];r++);return[e.slice(r),t.slice(r)]})(a,e.split(".")),l=i.length;t===$.Vp.AddAttribute&&l--,o.length||(o=a.slice(-1),l++);const s=`${(0,R.repeat)("parent.",Math.max(0,l)).join("")}attributes.${o.join(".")}`;return(0,R.assocPath)(["data","fieldName"],s,r)})))),wu=(0,R.curry)(((e,t,r)=>{const n=((e,t,r)=>{const[n,a]=(0,R.partition)(Ou,e),o=(0,R.pipe)(Su(t,r),Cu,Ma.Jk)(a),i=n.length?(e=>`in(${$.E_}, ${e.map(xu).join(",")})`)(n):"";return o&&i?`${o} and ${i}`:o||i})(e,t,r.operation);return(0,R.isEmpty)(n)?r:(0,R.ifElse)((0,R.pipe)((0,R.path)(["operationParameters","valueFilter"]),O.isEmptyValue),(0,R.assocPath)(["operationParameters","valueFilter"],n),(0,R.evolve)({operationParameters:{valueFilter:(0,R.concat)(R.__,` and (${n})`)}}))(r)}));var Au=r(9828);function Ru(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){_u(e,t,r[t])}))}return e}function _u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Iu=e=>{const t=(0,R.pipe)((0,R.pick)(["pin"]),(0,R.assoc)("value",Nu(e)))(e);return(0,Au.Kn)(t.value)?Object.keys(t.value).reduce(((e,r)=>(e.value=Ru({},e.value,{[r]:t.value[r].map(Iu)}),e)),t):t},Nu=(0,R.when)(Au.Kn,(0,R.ifElse)((0,R.has)("lookupCode"),(0,R.prop)("lookupCode"),(0,R.prop)("value"))),Du=(0,R.cond)([[Yc,(0,R.pipe)(Mc,Iu)],[Wc,(0,R.pipe)(Mc,(e=>{const{refEntity:t=[],refRelation:r=[]}=e;return Ru({refEntity:(0,R.pipe)(R.head,(0,R.pick)(["objectURI"]))(t),refRelation:(0,R.pipe)(R.head,(0,R.pick)(["type"]))(r)},Iu(e))}))],[Gc,(0,R.pipe)(Mc,Nu)],[R.T,Mc]]),Pu=(0,R.pipe)(Du,(0,R.assocPath)(["operationParameters","attributeValue"])),ku=(0,R.ifElse)(jc,(()=>(0,R.assocPath)(["operationParameters","pin"],!0)),(()=>R.identity)),Lu=(0,R.ifElse)(Fc,(()=>(0,R.assocPath)(["operationParameters","addNestedAttribute"],!0)),(()=>R.identity)),Uu=(0,R.pipe)(Vc,(0,R.ifElse)(R.isNil,(()=>R.identity),(0,R.pipe)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return`equals(value, '${Nu(e)}')`}),(0,R.assocPath)(["operationParameters","valueFilter"])))),ju=(0,R.pipe)(Mc,(0,R.prop)("entityUri"),(0,R.assocPath)(["operationParameters","referencedEntity","uri"])),Fu=(e,t)=>({operationParameters:{attributeURI:e},operation:t}),Mu=(e,t)=>(0,R.pipe)(Fu,Pu(e),ku(e),Lu(e))(t,$.Vp.AddAttribute),Vu=(e,t)=>(0,R.pipe)(Fu,Uu(e))(t,$.Vp.DeleteAttribute),Bu=(e,t)=>(0,R.pipe)(Fu,Pu(e),ku(e),Uu(e))(t,$.Vp.UpdateAttribute),zu=(e,t)=>(0,R.pipe)(Fu,ju(e))(t,$.Vp.RepointReferencedEntity),Hu=(e,t)=>(0,R.reject)(R.isNil,{operationParameters:e,operation:t}),Yu=e=>Hu({tags:[Mc(e)]},$.Vp.AddTags),Wu=e=>Hu({newValue:Mc(e),oldValue:Vc(e)},$.Vp.ReplaceTag),Gu=e=>Hu({tags:[Vc(e)]},$.Vp.DeleteTags),qu=()=>Hu(null,$.Vp.ClearTags),Zu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{selectionMode:n,selectedEntities:a=[]}=e,{searchOptions:o,activityFilter:i,globalFilter:l}=r;return n===$.v6.include?{list:a,activeness:i}:{filter:(0,R.pipe)(Ma.XP,(0,O.addGlobalFilterToQuery)(l))(t),excludeList:a,options:o,activeness:i}},$u=(0,R.curry)(((e,t)=>(0,R.chain)((0,R.ifElse)(Pc,(0,R.pipe)(kc,$u(e)),Ku(e)))(t))),Ku=(0,R.curry)(((e,t)=>{const r=(0,R.pathOr)([],["operationParameters","conditions"],t),n=Uc(t);return(0,R.pipe)(Qu(e),(0,R.map)(wu(r,n)))(t)})),Xu=(0,R.curry)((e=>(0,R.propEq)("operation",e))),Qu=(0,R.curry)(((e,t)=>{const r=Uc(t),n=r.includes(".")?(0,O.searchUriToAttrUri)(r,e):r,a=r===O.EntityAttrTypes.tags.uri;return(0,R.cond)([[(0,R.both)((0,R.always)(a),Xu($.Vh.AddNew)),()=>[Yu(t)]],[(0,R.both)((0,R.always)(a),Xu($.Vh.Clear)),()=>[qu()]],[(0,R.both)((0,R.always)(a),Xu($.Vh.ReplaceAllWith)),()=>[qu(),Yu(t)]],[(0,R.both)((0,R.always)(a),Xu($.Vh.FindAndReplace)),()=>[Wu(t)]],[(0,R.both)((0,R.always)(a),Xu($.Vh.FindAndRemove)),()=>[Gu(t)]],[Xu($.Vh.AddNew),()=>[Mu(t,n)]],[Xu($.Vh.Clear),()=>[Vu(t,n)]],[Xu($.Vh.ReplaceAllWith),()=>[Vu(t,n),Mu(t,n)]],[Xu($.Vh.FindAndReplace),()=>[Bu(t,n)]],[Xu($.Vh.FindAndRemove),()=>[Vu(t,n)]],[Xu($.Vh.RepointReference),()=>[zu(t,n)]]])(t)}));function Ju(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ep(e,t,r[t])}))}return e}function ep(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*tp(e){if(e.payload){const e=yield(0,Fa.Ys)(Po.tB);let r;do{if(r=yield(0,Fa.Ys)(so.BP,{entityTypeUri:e}),r)break;yield(0,Fa.qn)(L.Z.UPDATE_ENTITIES)}while(!r);const n=yield(0,Fa.Ys)(Jc),a=yield(0,Fa.Ys)(so.fx,{entityTypeUri:e}),o=yield(0,Fa.Ys)(so.Uz,{entityTypeUri:e}),i=(yield(0,Fa.Ys)(so.L9,{entityTypeUri:e}))||void 0,l=yield(0,Fa.Ys)(so.NW,{entityTypeUri:e}),s=(yield(0,Fa.RE)(ai))[n].filter((0,R.pipe)((0,R.prop)("id"),O.isAttributeSearchUri,R.not)),c=e?yield(0,Fa.Ys)(Po.Gv,e):s,u=yield(0,Fa.Ys)(so.NU,{entityTypeUri:e});yield(0,Fa.gz)((t={page:a,rowsPerPage:o,sortOrder:i,sortField:l,selectedColumns:c,total:u,entities:r},{type:Nn,payload:t}))}var t}function*rp(e){const t=yield(0,Fa.Ys)(P().selectors.getMetadata),r=yield(0,Fa.Ys)(ou),n=yield(0,Fa.Ys)(iu),a=yield(0,Fa.Ys)(su),o=yield(0,Fa.Ys)(lu),i=yield(0,Fa.RE)(dp),l=(0,R.uniq)(i.concat((0,Ma.kx)(t,e))),s=Ju({page:r,rowsPerPage:n,sortOrder:a,sortField:o,forceOvOnly:!0},yield(0,Fa.Ys)(P().selectors.getGlobalSearchRequestOptions),{select:l}),c=(0,Ma.Lv)(e,s);yield(0,Fa.gz)(hc(!0));try{const e=yield(0,Fa.RE)(O.rawRequest,$.NV,c);yield(0,Fa.gz)(yc(e))}catch(e){console.warn(e),yield(0,Fa.gz)(yc([]))}yield(0,Fa.gz)(hc(!1))}function*np(){const e=yield(0,Fa.Ys)(uu),t=yield(0,Fa.RE)(pp,e);yield(0,Fa.rM)(rp,t)}function*ap(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{debounceTime:t}=e.payload||{};t&&(yield(0,Fa.gw)(t));const r=yield(0,Fa.Ys)(uu),n=yield(0,Fa.RE)(pp,r);yield(0,Fa.gz)(Ec(0)),yield(0,Fa.rM)(op,n)}function*op(e){const t=yield(0,Fa.Ys)(P().selectors.getGlobalSearchRequestOptions),r=(0,Ma.Vg)(e,[],t);try{const e=yield(0,Fa.RE)(O.rawRequest,$.jS,{method:"POST",body:JSON.stringify(r)});yield(0,Fa.gz)(vc(e.total))}catch(e){console.warn(e),yield(0,Fa.gz)(vc(0))}}function*ip(){const e=(yield(0,Fa.Ys)(nu)).map((e=>e.uri)),t=yield(0,Fa.RE)(dp),r=yield(0,Fa.Ys)(uu),n=yield(0,Fa.RE)(pp,r),a=yield(0,Fa.Ys)(P().selectors.getGlobalSearchRequestOptions),o=(0,Ma.aG)(e,n,Ju({select:t},a));yield(0,Fa.gz)(hc(!0));try{const e=yield(0,Fa.RE)(O.rawRequest,o.url,o.options);yield(0,Fa.gz)(yc(e))}catch(e){console.warn(e),yield(0,Fa.gz)(yc([]))}yield(0,Fa.gz)(hc(!1))}function*lp(e){try{yield(0,Fa.RE)(O.rawRequest,e.url,e.options),yield(0,Fa.gz)(No(!1)),yield(0,Fa.gz)(_o({message:po().text("Bulk update is currently in progress. You'll receive an email notification once completed.\nGo to Tenant Management to view the status."),actionLabel:po().text("Tenant Management"),actionToDispatch:D.ui.actions.openConsoleApp("Tenant Management","jobs/pending"),autoHideDuration:1e4}))}catch(e){let r=e;e&&"object"==typeof e&&(r="errorCode"in e&&441===e.errorCode?po().text("You already have a bulk update job in progress. You can start a new job when the current job is finished.\nWe will send you an update via email once the current job is finished."):e.errorMessage||e.error_description||po().text("Something went wrong...")),yield(0,Fa.gz)((t=r,Ao({payload:{message:t,action:{actionToDispatch:wo()}},type:$.GT.error})))}var t}function*sp(){const e=yield(0,Fa.Ys)(Kc);e===$.dV.UpdateProfiles?yield(0,Fa.RE)(cp):e===$.dV.DeleteProfiles&&(yield(0,Fa.RE)(up))}function*cp(){yield(0,Fa.gz)(Nc(!0));const e=yield(0,Fa.Ys)(Jc),t=yield(0,Fa.Ys)(eu);let r=yield(0,Fa.Ys)(gu);const n=yield(0,Fa.RE)(pp),a=yield(0,Fa.Ys)(P().selectors.getGlobalSearchRequestOptions),o=yield(0,Fa.Ys)(P().selectors.getModifiedEntities),i=((e,t)=>{const r=(0,O.findAllTemporaryRefEntityURI)(t),n=(a=t,(0,R.pipe)(bu,(0,O.getPathsWithTempUri)(a),(0,R.map)((e=>(0,R.path)(e,a))))(a));var a;return r.concat(n).filter((t=>e[t]))})(o,r);if(i.length>0){const e=yield(0,Fa.RE)(O.saveTemporaryEntities,o,i);for(const[t,n]of Object.entries(e))r=Tu(t,n,r)}const l=function(e,t,r,n,a){const o=function(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return{objects:Zu(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],arguments.length>4&&void 0!==arguments[4]?arguments[4]:{}),actions:$u(e,t)}}(e,t,r,n,a);return{url:"/entities/_update?sendMail=true",options:{method:"POST",body:JSON.stringify(o),headers:{"Content-Type":"application/json"}}}}(e,t,r,n,a);yield(0,Fa.RE)(lp,l),yield(0,Fa.gz)(Nc(!1))}function*up(){yield(0,Fa.gz)(Nc(!0));const e=function(e,t,r){const n={objects:Zu(e,t,r)};return{url:"/entities/_delete?sendMail=true",options:{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}}}(yield(0,Fa.Ys)(eu),yield(0,Fa.RE)(pp),yield(0,Fa.Ys)(P().selectors.getGlobalSearchRequestOptions));yield(0,Fa.RE)(lp,e),yield(0,Fa.gz)(Nc(!1))}function*pp(e){const t=yield(0,Fa.Ys)(so.FR),r={fieldName:"type",filter:"equals",values:[yield(0,Fa.Ys)(Jc)]};let n=t.filter((e=>"type"!==e.fieldName)).concat(r);return e&&(n=n.concat({fieldName:"attributes",filter:"containsWordStartingWith",values:[e]})),n}function*dp(){const e=yield(0,Fa.Ys)(cu);return(0,Do.vw)(e)}function*mp(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,Fa.Ys)(yu),o={addAttributeAfter:Cc,changeAttribute:Sc,clearAttribute:wc,deleteAttribute:Rc};yield(0,Fa.RE)(al,{groups:a,attributesPropName:"conditions",groupId:t,attributeId:r,selectInfo:n,actions:o})}const yp=[function*(){yield(0,Fa.Fm)(he,tp)},function*(){yield(0,Fa.Fm)([jn,Un,Fn],np)},function*(){yield(0,Fa.Fm)(Bn,ap)},function*(){yield(0,Fa.Fm)(Hn,ip)},function*(){yield(0,Fa.ib)(Qn,mp)},function*(){yield(0,Fa.ib)(aa,sp)}],gp=()=>({id:$.Jf,reducerMap:{[$.Jf]:(0,A.combineReducers)({ui:Ze,search:de,facets:Z,advancedSearch:nr,savedSearches:pn,recentSearches:vn,entity:_n,bulkUpdate:ja})},sagas:[...jl,...ls,...yi,...ml,...Vi,...tc,...Es,Ts,...pc,...mc,...yp]});var fp=r(95099),hp=r.n(fp),Ep=r(34756),bp=r(79573),vp=r(23625),Tp=r.n(vp),Op=r(42950);const xp=(0,Op.Z)((()=>({container:e=>{let{containerHeight:t=553,containerWidth:r}=e;return{display:"flex",flexDirection:"column",height:t,width:r,flexGrow:1}},header:{marginLeft:"16px",marginTop:"16px",marginBottom:"12px",fontSize:"16px",fontWeight:500,letterSpacing:"0.15px",lineHeight:"24px"},searchInputContainer:{margin:"0 16px 12px 16px",flexShrink:"0"},list:{flexGrow:1,height:0,overflow:"hidden",width:"100%",position:"relative","& ul":{paddingBottom:0,paddingTop:0}}})));var Cp=r(53732),Sp=r.n(Cp),wp=r(88214),Ap=r.n(wp),Rp=r(14294),_p=r.n(Rp),Ip=r(4501),Np=r.n(Ip),Dp=r(18538);const Pp=(0,Op.Z)((()=>({container:e=>{let{height:t=36}=e;return{height:t,borderRadius:"2px",alignItems:"center",backgroundColor:"rgba(0,0,0,0.03)",minWidth:"100px"}},icon:{opacity:.67,marginLeft:"10px",marginRight:"6px"},input:{fontSize:"13px",width:"100%"},clearButton:{marginRight:"10px"},white:{backgroundColor:"rgb(255, 255, 255)",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.24)"}})));function kp(){return kp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kp.apply(this,arguments)}function Lp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Up(e,t,r[t])}))}return e}function Up(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jp=(0,E.memo)((e=>{let{value:t,autofocus:r,onSearch:n=bp.ZT,rootRef:a,classes:o={},height:i,placeholder:l=po().text("Search")}=e,s=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","autofocus","onSearch","rootRef","classes","height","placeholder"]);const c=Pp({height:i}),[u,p]=(0,E.useState)(""),d=(0,R.pipe)((0,R.tap)(n),p),m=(0,R.isNil)(t)?u:t;return b().createElement(Sp(),kp({startAdornment:b().createElement(Ap(),{position:"start"},b().createElement(Np(),{className:c.icon})),endAdornment:b().createElement(Ap(),{position:"end"},m.length>0&&b().createElement(Dp.T,{icon:_p(),className:c.clearButton,onClick:()=>d("")})),autoFocus:r,classes:Lp({},o,{input:T()(c.input,o.input),root:T()(c.container,o.root)}),placeholder:l,value:m,onChange:(0,R.pipe)(bp.NA,d),disableUnderline:!0,ref:a},s))}));function Fp(){return Fp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fp.apply(this,arguments)}const Mp=e=>{let{title:t,className:r,onSearch:n,hideTitle:a,hideSearchInput:o,headerPlacement:i="top",containerWidth:l,containerHeight:s,searchInputOnKeyDown:c,children:u,searchInputRef:p,anchorOrigin:d={vertical:"top",horizontal:"right"},transformOrigin:m={vertical:"top",horizontal:"right"}}=e,y=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["title","className","onSearch","hideTitle","hideSearchInput","headerPlacement","containerWidth","containerHeight","searchInputOnKeyDown","children","searchInputRef","anchorOrigin","transformOrigin"]);const g=xp({containerWidth:l,containerHeight:s}),f=b().createElement(b().Fragment,null,!a&&b().createElement("div",{className:g.header},t),!o&&b().createElement(jp,{onSearch:n,autofocus:!0,onKeyDown:c,inputRef:p,classes:{root:g.searchInputContainer},placeholder:po().text("Search & add attributes"),height:40}));return b().createElement(Tp(),Fp({anchorOrigin:d,transformOrigin:m},y),b().createElement("div",{className:T()(g.container,r),style:{width:l}},"top"===i&&f,b().createElement("div",{className:g.list},u),"bottom"===i&&f))},Vp=e=>{const t=e=>(0,R.flatten)(e.map((e=>[e].concat(e.items?t(e.items):[]))));let r=null;return t(e).map(((e,t)=>(e&&e.items&&(r=t),{item:e,index:t,titleItemIndex:r})))};var Bp=r(50166),zp=r(88267);const Hp=(0,Op.Z)({stickyTitlesWrapper:{position:"absolute",top:0,"& > div":{zIndex:1,position:"absolute",top:0,width:"100%",visibility:"hidden"}}}),Yp=e=>e.titleItemIndex===e.index,Wp=e=>{let{items:t,getItemSize:r,renderItem:n,renderGroupTitle:a,width:o="100%",height:i,fixedTitle:l=!0,itemKey:s=(e=>e),disableHorizontalScrollbar:c,hideSubtitles:u,focusIndex:p=null,onInnerContainerResize:d}=e;const m=Hp(),y=(0,E.useRef)(null),g=(0,E.useRef)(null),f=(0,E.useRef)(null),h=(0,E.useRef)([0]),v={topMargin:0},T=(0,E.useMemo)((()=>!u||(t||[]).some((e=>null!==e.titleItemIndex))),[t,u]),O=(0,E.useCallback)((e=>{const n=h.current.length;let a=0;t.slice(n-1,e+1).forEach(((e,t)=>{const o=n+t-1;t>0&&(h.current[o]=h.current[o-1]+a),a=r(o,e.item)}))}),[r,t]),x=(0,E.useCallback)((e=>t[e].titleItemIndex),[t]),C=(0,E.useCallback)((e=>t[e]),[t]);(0,E.useEffect)((()=>{requestAnimationFrame((()=>{y.current&&y.current.scrollTo(0)}))}),[t.length]),(0,E.useEffect)((()=>{y.current&&y.current.resetAfterIndex(0),S();const e=(e=>{const t=e.findIndex((e=>e.item.moveTo));if(t>-1){O(t);const e=x(t);return{offset:h.current[t],titleHeight:r(e,C(e).item)}}})(t);if(e&&e.offset&&y.current){const{titleHeight:t}=e,r=e.offset-t;(r<y.current.state.scrollOffset||r>y.current.state.scrollOffset+i)&&requestAnimationFrame((()=>{y.current&&y.current.scrollTo(r-(i-t)/2)}))}}),[O,C,r,x,i,h,t,y]);const S=()=>{f.current&&g.current&&(f.current.style.width=g.current.offsetWidth+"px")},w=(0,E.useCallback)((e=>{let r=null,n=0;return t.some(((t,a)=>{O(a+10);const o=h.current[a+1];return e>=n&&e<o&&(r={index:a,offset:n,listItem:t}),n=o,r})),r}),[O,h,t]),A=(0,E.useCallback)((e=>r(e,C(e).item)),[C,r]),R=(0,E.useCallback)((e=>{let{index:t,style:r,data:o}=e;const i=C(t);return i.item&&(Yp(i)&&a(r,i.item)||n(r,i.item,t,o))}),[C,a,n]),{handleOnItemsRendered:_}=(e=>{let{focusIndex:t,listRef:r,items:n}=e;const a=(0,E.useRef)(null),o=(0,E.useRef)(null),i=(0,E.useCallback)((e=>{let{visibleStartIndex:t,visibleStopIndex:r}=e;a.current=t,o.current=r}),[]);return(0,E.useEffect)((()=>{r.current&&null!==t&&0!==n.length&&(t<Math.max(a.current+3,0)?r.current.scrollToItem(Math.max(t-3,0),"start"):t>Math.min(o.current-3,n.length-1)&&r.current.scrollToItem(Math.min(t+3,n.length-1),"end"))}),[t,n.length,r]),{handleOnItemsRendered:i}})({items:t,focusIndex:p,listRef:y}),I=(0,E.useCallback)((()=>t.filter((e=>Yp(e))).map((e=>(e=>b().createElement("div",{className:"stickyTitleItem",style:{visibility:"hidden"},"data-index":e.index,key:e.index},a({height:r(e.index,e.item)},e.item)))(e)))),[r,t,a]);return b().createElement(b().Fragment,null,b().createElement("div",{ref:f,className:m.stickyTitlesWrapper},l&&I()),d&&g.current&&b().createElement(zp.Z,{handleHeight:!0,onResize:d,targetDomEl:g.current}),b().createElement(Bp.VariableSizeList,{ref:y,itemCount:t.length,itemSize:A,width:o,height:i,itemKey:s,innerRef:g,onScroll:e=>{let{scrollOffset:n,scrollDirection:a}=e;if(!l||!T)return;const o=w(n),i=o&&x(o.index);var s;null!==i&&(s=i,f.current&&[...f.current.querySelectorAll(".stickyTitleItem")].forEach((e=>{e.dataset.index===s.toString()?(e.style.visibility="visible",v.index=s):e.style.visibility="hidden"}))),S();const c=null!==i&&r(i,C(i).item),u=w(n+c+v.topMargin);let p=0;if(u){switch(a){case"forward":u.offset-n>0&&Yp(u.listItem)&&(p=c-(u.offset-n));break;case"backward":{const e=i>-1&&(d=i,t.findIndex(((e,t)=>Yp(e)&&d<t))),r=(e=>(O(e),h.current[e]))(e);e>-1&&n<r&&c>=r-n&&(p=c-(r-n))}}(e=>{f.current&&(v.topMargin=-e,f.current.style.top=-e+"px")})(p)}var d},style:c?{overflowX:"hidden"}:void 0,overscanCount:5,onItemsRendered:_},R))};Wp.propTypes={items:hp().arrayOf(hp().object).isRequired,getItemSize:hp().func.isRequired,renderItem:hp().func.isRequired,width:hp().oneOfType([hp().number,hp().string]),height:hp().number.isRequired,renderGroupTitle:hp().func,fixedTitle:hp().bool,hideSubtitles:hp().bool,itemKey:hp().func,disableHorizontalScrollbar:hp().bool,focusIndex:hp().number,onInnerContainerResize:hp().func};const Gp=Wp,qp=e=>{let{items:t,open:r,onSelectFocusedItem:n,selectedItems:a,onClose:o}=e;const[i,l]=(0,E.useState)(null),s=(0,E.useRef)(!1),c=(0,E.useCallback)((e=>{let r=null===e?c(-1):e;for(;null!==e&&r<t.length&&(r<=e||r>=0&&Yp(t[r]));)r+=1;return r!==t.length?r:c(-1)}),[t]),u=(0,E.useCallback)((e=>{let r=null===e?t.length-1:e;for(;null!==e&&r>=0&&(r>=e||Yp(t[r]));)r-=1;return r<0?t.length-1:r}),[t]),p=(0,E.useCallback)((()=>{if(!(0,R.isNil)(i)){const e=t[i].item;!e.item.notSelectable&&n({item:e.item,groupData:e})}}),[n,t,i]),d=(0,E.useCallback)((e=>{if(0!==t.length)switch(e.key){case"Down":case"ArrowDown":return l(c),e.preventDefault(),!1;case"Up":case"ArrowUp":return l(u),e.preventDefault(),!1;case"Enter":s.current=!0,p();break;case"Tab":o&&o(e);break;default:return}}),[t,c,u,p,o]);return(0,E.useEffect)((()=>{if(s.current){s.current=!1;const e=t.findIndex((e=>e.item.moveTo));e>-1&&l(e)}else l(null)}),[t,r,a]),{focusIndex:i,handleKeyDown:d}};var Zp=r(85746),$p=r.n(Zp),Kp=r(22811),Xp=r.n(Kp),Qp=r(93222),Jp=r.n(Qp);function ed(){return ed=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ed.apply(this,arguments)}function td(){return td=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},td.apply(this,arguments)}const rd=e=>b().createElement("svg",td({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b().createElement("path",{d:"M14 11v-1a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-1h-3v1a1 1 0 01-1 1H6a1 1 0 01-1-1v-4a1 1 0 011-1h4a1 1 0 011 1v1h3z",fill:"#000",stroke:"none",strokeWidth:1,fillRule:"evenodd"}));function nd(){return nd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nd.apply(this,arguments)}const ad=e=>b().createElement("svg",nd({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b().createElement("path",{d:"M10 18h3v-1a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-1H8V8H6a1 1 0 01-1-1V3a1 1 0 011-1h6a1 1 0 011 1v4a1 1 0 01-1 1h-2v3h3v-1a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-1h-3v5z",fill:"#000",stroke:"none",strokeWidth:1,fillRule:"evenodd"}));function od(){return od=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},od.apply(this,arguments)}const id=e=>b().createElement("svg",od({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b().createElement("rect",{fill:"#000",x:9,y:9,width:6,height:6,rx:1,stroke:"none",strokeWidth:1,fillRule:"evenodd"})),ld=(0,Op.Z)({icon:{opacity:.29,width:"16px",height:"16px",flexShrink:0,marginRight:"6px",marginLeft:"8px"}}),sd=e=>{let{attrType:t={}}=e;const r=ld(),n=(e=>{switch(e.type){case O.DataTypes.TYPE_IMAGE:case O.DataTypes.TYPE_NESTED:return rd;case O.DataTypes.TYPE_REFERENCE:return ad;default:return id}})(t);return b().createElement(n,{className:r.icon})},cd=(0,Op.Z)({mark:{color:"red"}}),ud=()=>{const e=cd();return b().createElement("span",{className:e.mark},"*")},pd=e=>{let{margin:t,level:r,className:n,children:a}=e;return null!=r?b().createElement("div",{style:{marginLeft:r*t},className:n},a):a};var dd=r(1063),md=r(85740);const yd=(0,Op.Z)({container:{"& > $marginWrapper:first-child":{paddingLeft:"4px"}},listItem:{paddingLeft:"1px",paddingTop:"2px",paddingBottom:"2px",transition:"none","&:hover":{"& $itemAfter":{background:"linear-gradient(to right, rgba(235, 235, 235, 0.2), rgba(235, 235, 235, 1) 100%)"}},"&$listItemFocus":{"& $itemAfter":{background:"linear-gradient(to right, rgba(219, 219, 219, 0.2), rgba(219, 219, 219, 1) 100%)"}},"&:focus":{outline:"none"}},listItemFocus:{},recommendedIcon:{width:"18px",height:"18px",marginRight:"5px",marginLeft:"7px",flexShrink:0},logoIcon:{width:"18px",height:"18px",flexShrink:0,marginRight:"4px"},itemAfter:{position:"absolute",right:0,top:0,width:"40px",height:"100%",pointerEvents:"none",background:"linear-gradient(to right, rgba(255, 255, 255, 0.2), #fff 100%)"},itemText:{padding:"0",margin:0,"& span":{fontSize:"0.8125rem",letterSpacing:"normal",whiteSpace:"nowrap"}},checkbox:{opacity:.34,padding:0,marginLeft:"14px","&$checked":{opacity:1,background:"none"}},checked:{},marginWrapper:{display:"flex",alignItems:"center"},defaultCursor:{cursor:"default"},itemTooltip:{margin:"4px 0"},marginText:{marginLeft:"21px"},itemTextWrapper:{display:"flex",alignItems:"center"}}),gd=(0,md.T)((e=>b().createElement("svg",ed({width:13,height:18,viewBox:"0 0 13 18",xmlns:"http://www.w3.org/2000/svg"},e),b().createElement("g",{transform:"translate(-3 -1)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},b().createElement("path",{fill:"#FF4081",d:"M5.833 10h3.75v6.667l-3.75 1.666z"}),b().createElement("path",{fill:"#CE0C4E",d:"M13.333 10v8.333l-3.75-1.666V10z"}),b().createElement("circle",{fill:"#FFC058",cx:9.583,cy:7.917,r:6.25}),b().createElement("circle",{fill:"#FFCD7B",cx:9.583,cy:7.917,r:5.417}),b().createElement("path",{fill:"#FFFBB5",d:"M8.333 11.667L5 8.462l.933-.898 2.4 2.308L13.4 5l.933.897z"}))))),fd=e=>{let{groupId:t,data:r,checked:n=!1,isFocused:a=!1,isRequired:o=!1,label:i,labelInText:l,level:s,onClick:c=bp.ZT,hideCheckBox:u=!1,hideIcon:p=!1,notSelectable:d=!1,disableHorizontalScrollbar:m=!1,style:y={},subItemMargin:g=20,LogoIcon:f,className:h,disableNonSelectable:E,disableGutters:v}=e;const x=yd(),{attrType:C}=r||{},S=!(u&&(0,O.isNested)(C)||d),w=!!f;return b().createElement(dd.Y,{value:l||i,className:x.itemTooltip,placement:"bottom-end"},b().createElement(Jp(),{className:T()(x.container,x.listItem,{[x.defaultCursor]:!S},h),onClick:S?()=>c(r,!n,t):void 0,style:y,dense:!0,disabled:E&&d,classes:{focusVisible:x.listItemFocus,selected:x.listItemFocus},selected:a,tabIndex:-1,disableGutters:v},!u&&b().createElement(Xp(),{checked:n,disableRipple:!0,disabled:!S,className:T()(x.checkbox,{[x.checked]:n}),tabIndex:-1}),b().createElement(pd,{margin:g,level:s,className:x.marginWrapper},b().createElement(b().Fragment,null,!p&&(e=>"recommended"===t?b().createElement(gd,{className:x.recommendedIcon,tooltipTitle:po().text("Recommended"),showForDisabled:!0}):b().createElement(sd,{attrType:e}))(C),b().createElement("div",{className:T()(x.itemTextWrapper,{[x.marginText]:p})},w&&b().createElement(f,{className:x.logoIcon}),b().createElement($p(),{primary:b().createElement(b().Fragment,null,i,o&&b().createElement(ud,null)),className:x.itemText})))),S&&m&&b().createElement("div",{className:x.itemAfter})))};fd.defaultName="AttributeListItem";const hd=(0,E.memo)(fd);var Ed=r(49940);const bd=(0,Op.Z)({popupContainer:{},container:{"&$popupContainer":{height:"408px",minWidth:"200px"}}});function vd(){return vd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vd.apply(this,arguments)}function Td(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Od(e,t,r[t])}))}return e}function Od(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xd=e=>{let{open:t,anchorEl:r,data:n,onSearch:a,onClose:o,titleText:i,filterText:l,onListItemClick:s,selected:c,hideCheckBox:u,renderGroupTitle:p}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["open","anchorEl","data","onSearch","onClose","titleText","filterText","onListItemClick","selected","hideCheckBox","renderGroupTitle"]);const m=(0,E.useCallback)((e=>e.label.toLowerCase().includes(l.toLowerCase())),[l]),y=(0,E.useCallback)((e=>m(e)||(e.children||[]).some(y)),[m]),g=(0,E.useMemo)((()=>{const e=(0,R.curry)(((e,r,n,a)=>[{item:Td({},r,{filterText:l}),level:e,groupId:n,groupName:a},...t(r.children||[],n,a,e+1)])),t=function(t,r,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const o=t=>e(a,t,r,n),i=t.filter(y);return(p?R.map:R.chain)(o,i)};return t}),[l,p,y]),f=(0,E.useCallback)((e=>e.map((e=>({item:e,items:g(e.attributes,e.id,e.label)}))).filter((e=>e.items.length))),[g]),h=(0,E.useCallback)((e=>{let{item:t}=e;s(t,!c.find((e=>e.id===t.id||e.id.includes(`${t.id}.`))))}),[s,c]),v=(0,E.useMemo)((()=>(p?f:g)(n)),[n,p,f,g]),x=(0,E.useMemo)((()=>Vp(v)),[v]),{focusIndex:C,handleKeyDown:S}=qp({items:x,open:t,onSelectFocusedItem:h,selectedItems:c}),w=(0,E.useRef)(null);w.current=C;const A=(0,E.useCallback)(((e,t,r)=>{let{item:n,level:a=0}=t;const o=!!c.find((e=>e.id===n.id||e.id.includes(`${n.id}.`))),i=w.current===r;return b().createElement(hd,{key:n.id,onClick:s,checked:o,level:a,data:n,label:b().createElement(Ed.o,{text:n.label,highlight:n.filterText}),labelInText:n.label,style:e,hideCheckBox:u,isFocused:i,notSelectable:n.notSelectable,LogoIcon:n.LogoIcon})}),[u,s,c]),_=(0,O.getMaxItemWidth)("label")(v)||308,I=bd();return b().createElement(Mp,vd({open:t,className:T()(I.container,I.popupContainer),anchorEl:r,onClose:o,onSearch:a,title:i,containerWidth:_,searchInputOnKeyDown:S},d),b().createElement(Gp,{height:300,renderItem:A,items:x,hideSubtitles:!0,getItemSize:()=>32,containerWidth:_,focusIndex:C,renderGroupTitle:p}))};xd.propTypes={open:hp().bool,hideCheckBox:hp().bool,anchorEl:hp().any,selected:hp().array,data:hp().array,filterText:hp().string,titleText:hp().string,onClose:hp().func,onListItemClick:hp().func,onSearch:hp().func,renderGroupTitle:hp().func},xd.defaultProps={data:[],selected:[],titleText:po().text("Show/hide columns"),filterText:""};var Cd=r(97179);function Sd(){return Sd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sd.apply(this,arguments)}const wd=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return b().createElement("svg",Sd({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},r),b().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",opacity:".54"},b().createElement("path",{d:"M19 11.24V10h-4v1.24a8.417 8.417 0 00-2 .768V10H9v6h.29a8.497 8.497 0 00-.15.358l-.29.733.29.733.07.176H5c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2h14c1.1 0 2 .9 2 2v6.008a8.417 8.417 0 00-2-.768zM7 16v-6H5v6h2zm0-8V6H5v2h2zm6 0V6H9v2h4zm6 0V6h-4v2h4zm-2 5a6.451 6.451 0 00-6 4.09 6.451 6.451 0 006 4.092 6.451 6.451 0 006-4.091A6.451 6.451 0 0017 13zm0 6.818a2.728 2.728 0 010-5.454 2.728 2.728 0 010 5.454zm0-4.363c-.905 0-1.636.73-1.636 1.636 0 .905.73 1.636 1.636 1.636.905 0 1.636-.73 1.636-1.636 0-.906-.73-1.636-1.636-1.636z",fill:"#000",fillRule:"nonzero"})))},Ad="Headers-styles-container--Zbdka",Rd="Headers-styles-actionsBar--RXMy4",_d="Headers-styles-previewSwitcher--Ppqem";function Id(){return Id=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Id.apply(this,arguments)}const Nd=e=>{let{entityTypeUri:t,headColumns:r=[],onSelectColumns:n=bp.ZT}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entityTypeUri","headColumns","onSelectColumns"]);const[o,i]=(0,E.useState)(null),[l,s]=(0,E.useState)(""),c=(0,Ep.useSelector)(P().selectors.getMetadata),u=()=>{i(null),s("")},p=(0,E.useCallback)(((e,a)=>{const o=(0,Do.kF)(c,t),i=(0,Do.m5)(o,e.id);let l;l=i.length?a?r.concat(i):r.filter((e=>!i.find((t=>t.id===e.id)))):a?r.concat(e):r.filter((t=>t.id!==e.id)),n(l)}),[c,t,r,n]);return b().createElement(b().Fragment,null,b().createElement(Cd.k,Id({tooltipTitle:po().text("Show/hide columns"),size:"M",icon:wd,onClick:e=>i(e.currentTarget),className:"Headers-styles-headerIcon--c2qe7"},a)),(()=>{const e=(0,Do.kF)(c,t);return b().createElement(xd,{open:!!o,anchorEl:o,data:e,onListItemClick:p,selected:r,filterText:l,onClose:u,onSearch:s})})())};Nd.propTypes={entityTypeUri:hp().string,headColumns:hp().array,onSelectColumns:hp().func};const Dd=Nd;var Pd=r(45053),kd=r(29722),Ld=r(27618),Ud=r.n(Ld),jd=r(98515),Fd=r.n(jd),Md=r(29289);const Vd=e=>{let{headCellData:t,headIndex:r,sortOrder:n,sortField:a,sortHandler:o,canCheck:i,onCheck:l,headerCheckboxState:s,openConfigColumnPopup:c}=e;return b().createElement("div",{className:T()("HeadCellRenderer-styles-headCellContentWrapper--L6RrQ",(0,R.path)(["wrapperClassName"],t))},t&&i&&b().createElement(Xp(),{className:"HeadCellRenderer-styles-checkbox--qQEHg",checked:s||!1,indeterminate:null===s,onChange:()=>l()}),b().createElement("div",{className:"HeadCellRenderer-styles-labelWrapper--cmclk"},t&&(t.sortable?b().createElement(Ud(),{active:Boolean(n&&a===t.id),direction:n,onClick:o,classes:{root:"HeadCellRenderer-styles-sortLabel--NZx3o"},component:"div"},t.label):t.label)),c&&b().createElement("div",{className:"HeadCellRenderer-styles-menuButtonWrapper--aBNeR"},b().createElement(Dp.T,{icon:Fd(),onClick:c,size:"S","data-column-index":r})))};Vd.propTypes={headCellData:hp().shape({id:hp().string,label:hp().oneOfType([hp().string,hp().node]),sortable:hp().bool}),headIndex:hp().number,sortOrder:hp().string,sortField:hp().string,sortHandler:hp().func,canCheck:hp().bool,onCheck:hp().func,headerCheckboxState:hp().oneOf([!0,!1,null]),openConfigColumnPopup:hp().func};const Bd=(0,Md.q)((0,R.pick)(["openConfigColumnPopup"]))(Vd),zd=(0,Md.q)((0,R.pick)(["openConfigColumnPopup","canCheck","onCheck","headerCheckboxState"]))(Vd),Hd=b().createContext({generateEntityUrl:O.generateEntityUrlForOldMode,generatePivotingUrl:O.generatePivotingUrlForOldMode,generateTagUrl:O.generateTagUrlForOldMode});function Yd(){return Yd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yd.apply(this,arguments)}Hd.displayName="UrlGeneratorsContext";const Wd=(0,E.forwardRef)(((e,t)=>{let{value:r,children:n,screen:a,className:o,shouldOpenInNewTab:i=!1}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","children","screen","className","shouldOpenInNewTab"]);const{generateEntityUrl:s}=(0,E.useContext)(Hd),c=(0,S.ax)("openEntity"),u=(0,S.Qh)(),p=(0,E.useCallback)((e=>{(0,bp.rR)(e)||(c({uri:r,screen:a}),e.preventDefault()),e.stopPropagation()}),[c,a,r]);return b().createElement("a",Yd({ref:t,href:(d=r,s({uiPath:u,uri:d,screen:a})),onClick:i?void 0:p,target:i?"_blank":"_self",rel:"noreferrer",className:o},l),n);var d}));Wd.displayName="EntityUriLink";const Gd={popupBackdrop:"EntitiesTable-styles-popupBackdrop--nEX1F",popupContent:"EntitiesTable-styles-popupContent--PLSPL",complexPopupContent:"EntitiesTable-styles-complexPopupContent--wqOGI",highlighted:"EntitiesTable-styles-highlighted--GHk6T",highlightAnimate:"EntitiesTable-styles-highlightAnimate--oR7ki",inactiveBackground:"EntitiesTable-styles-inactiveBackground--nAfS3",inactiveHoverBackground:"EntitiesTable-styles-inactiveHoverBackground--qe__Y",inactiveSelectedBackground:"EntitiesTable-styles-inactiveSelectedBackground--WkWtD",inactiveSelectedHoverBackground:"EntitiesTable-styles-inactiveSelectedHoverBackground--oFAbX",textOverflow:"EntitiesTable-styles-textOverflow--AAABW",textOverflowInactive:"EntitiesTable-styles-textOverflowInactive--eU4xE",link:"EntitiesTable-styles-link--JNCz5",defaultWrapper:"EntitiesTable-styles-defaultWrapper--EP4tA",table:"EntitiesTable-styles-table--jmlbo",imageWrapper:"EntitiesTable-styles-imageWrapper--xmq8R",blobWrapper:"EntitiesTable-styles-blobWrapper--ruHVs",highlightAnimateForEllipsis:"EntitiesTable-styles-highlightAnimateForEllipsis--r1Fmq",referenceWrapper:"EntitiesTable-styles-referenceWrapper--Q5RqZ",referenceContent:"EntitiesTable-styles-referenceContent--wkahK",referenceIcon:"EntitiesTable-styles-referenceIcon--b8M3n",nestedCellWrapper:"EntitiesTable-styles-nestedCellWrapper--I4J6A",nestedAttributeWrapper:"EntitiesTable-styles-nestedAttributeWrapper--dvfn3",profileWrapper:"EntitiesTable-styles-profileWrapper--lGPma",entityAvatar:"EntitiesTable-styles-entityAvatar--GiuUS",entityAvatarImage:"EntitiesTable-styles-entityAvatarImage--UHIRm",entityLabel:"EntitiesTable-styles-entityLabel--OyjLV",scores:"EntitiesTable-styles-scores--RqsDU",dragColumnHead:"EntitiesTable-styles-dragColumnHead--oDlFz",dragColumnBody:"EntitiesTable-styles-dragColumnBody--_HZDV",draggableHeadCell:"EntitiesTable-styles-draggableHeadCell--DbfHi",cellWrapper:"EntitiesTable-styles-cellWrapper--dUWGQ",entityButtons:"EntitiesTable-styles-entityButtons--tYSvC",selectedEntityButtons:"EntitiesTable-styles-selectedEntityButtons--mZJfv",justImportedEntityButtons:"EntitiesTable-styles-justImportedEntityButtons--q5bPw",highlightedEntityButtons:"EntitiesTable-styles-highlightedEntityButtons--PvzNM"},qd=e=>{let{value:t={}}=e;const r=(0,O.getLabel)(t.label);return b().createElement("div",{className:T()(Gd.defaultWrapper,Gd.profileWrapper)},b().createElement(w,{avatarClassName:Gd.entityAvatar,imageClassName:Gd.entityAvatarImage,entity:t}),b().createElement(Wd,{value:(0,O.getEntityUriForLink)(t),className:Gd.entityLabel},r))};qd.propTypes={value:hp().object};const Zd=qd;var $d=r(56755);const Kd=e=>{let{value:t,columnData:{dataTypeDefinition:r}}=e;return b().createElement("div",{className:Gd.defaultWrapper},r?b().createElement($d.x,{value:t,dataTypeDefinition:r}):t)};Kd.propTypes={value:hp().any,columnData:hp().object};const Xd=Kd,Qd=(e,t,r)=>{const n=(0,O.getEntityTypeGraphIcon)(e,{type:t});return(0,O.getAbsoluteImageUrl)(r,n)};let Jd=function(e){return e[e.ICON_MODE=0]="ICON_MODE",e[e.TEXT_MODE=1]="TEXT_MODE",e[e.ERROR_MODE=2]="ERROR_MODE",e}({});function em(){return em=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},em.apply(this,arguments)}const tm=e=>{let{className:t,icon:r,avatarText:n,rootClasses:a}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","icon","avatarText","rootClasses"]);const[i,l]=(0,E.useState)(null);(0,E.useEffect)((()=>{l(r?Jd.ICON_MODE:Jd.TEXT_MODE)}),[r,n]);const s=()=>{l(Jd.ERROR_MODE)};switch(i){case Jd.ICON_MODE:return b().createElement(C(),em({className:T()(t,null==a?void 0:a.iconRoot),src:r,onError:s},o));case Jd.TEXT_MODE:case Jd.ERROR_MODE:return b().createElement(C(),em({className:T()(t,null==a?void 0:a.textRoot)},o),n);default:return null}},rm=e=>{let{value:t}=e;const r=(0,Ep.useSelector)(P().selectors.getMetadata),n=(0,Ep.useSelector)(P().selectors.getApiPath),a=(0,Ep.useSelector)(P().selectors.getImagePath);return t&&b().createElement("div",{className:T()(Gd.defaultWrapper,Gd.referenceWrapper)},b().createElement(tm,{className:Gd.referenceIcon,icon:Qd(r,t.refEntity.type,a||n)}),b().createElement(Wd,{value:t.refEntity.objectURI,className:Gd.referenceContent},(0,O.getLabel)(t.label)))};rm.propTypes={value:hp().object};const nm=rm,am=e=>{e.stopPropagation()},om=e=>{const{value:t}=e;return b().createElement("div",{className:Gd.blobWrapper,onScroll:am},t)};om.propTypes={value:hp().any};const im=om,lm=e=>{let{value:t}=e;const r=(0,O.getImageAttributeOvThumbnailUrl)({value:t});return r&&b().createElement("div",{className:Gd.imageWrapper},b().createElement("img",{src:r}))};lm.propTypes={value:hp().object};const sm=lm,cm=e=>{if("label"===e.id)return Zd;switch((0,R.path)(["attrType","type"],e)){case"Reference":return nm;case"Blob":return im;case"Image":return sm}return Xd};function um(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){pm(e,t,r[t])}))}return e}function pm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dm(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const mm=(0,R.split)("."),ym=["entityId"],gm=e=>!ym.includes(e.id),fm=e=>{if((0,O.isAttributeSearchUri)(e)){const[,...t]=mm(e);return t.length>1?t.slice(0,-1):null}return null};var hm=r(57526),Em=r.n(hm),bm=r(18567),vm=r.n(bm),Tm=r(99272),Om=r.n(Tm);const xm=(0,Op.Z)({root:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px"},check:{color:"#8CC152"}});let Cm=function(e){return e[e.INIT=1]="INIT",e[e.PROGRESS=2]="PROGRESS",e[e.SUCCESS=3]="SUCCESS",e[e.DONE=4]="DONE",e}({});const Sm=e=>{let{classes:t={},tooltip:r="",onClick:n=bp.ZT,mode:a=Cm.INIT}=e;const o=xm();return b().createElement("div",{className:T()(o.root,t.root)},(()=>{switch(a){case Cm.INIT:return b().createElement(Cd.k,{className:t.button,size:"M",tooltipTitle:r,icon:vm(),onClick:n});case Cm.PROGRESS:return b().createElement(Em(),{className:t.spinner,size:24});case Cm.SUCCESS:return b().createElement(Om(),{className:T()(o.check,t.check)});default:return null}})())};function wm(){return wm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wm.apply(this,arguments)}const Am=e=>{let{entity:t,importStatus:r,onImportStatusChange:n,hideDelay:a=3e3}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","importStatus","onImportStatusChange","hideDelay"]);const i=(0,Ep.useSelector)(P().selectors.getDtssPath),l=(0,Ep.useSelector)(P().selectors.getTenant);return b().createElement(Sm,wm({},o,{mode:r,tooltip:po().text("Import this record"),onClick:e=>{e.stopPropagation(),n(Cm.PROGRESS),(0,O.importEntityFromDataTenant)({dtssPath:i,customerTenant:l,entity:t}).then((e=>{let{success:r,uris:o}=e;if(!r)throw new Error("Failed to import entity");t.ctSubscribedUris=o,n(Cm.SUCCESS),setTimeout((()=>n(Cm.DONE)),a)})).catch((()=>{n(Cm.INIT),(0,co.U)(undefined,{title:po().text("Import Error"),message:po().text("Record can't be imported")})}))}}))};Am.propTypes={entity:O.EntityType,importStatus:hp().oneOf((0,R.values)(Cm)),onImportStatusChange:hp().func,hideDelay:hp().number};const Rm=Am,_m=(0,Op.Z)({importButtonPlaceholder:{display:"flex",alignItems:"center",padding:"0 10px",width:"24px",flexShrink:0,position:"relative"}}),Im=e=>{let{entity:t,entityImportStatus:r,onEntityImportStatusChange:n}=e;const a=_m(),o=(0,Ep.useSelector)(P().selectors.getMetadata),i=(0,Ep.useSelector)(P().selectors.getCanUserImportEntitiesFromDT),l=(0,O.isDataTenantEntity)(t)&&i,s=(0,O.getEntityType)(o,t.type),c=(0,O.checkCanImportEntityOfType)(s)&&!(0,O.isEntityImportedToCT)(t),u=r&&r!==Cm.DONE||c;return b().createElement(b().Fragment,null,l&&b().createElement("div",{className:a.importButtonPlaceholder},u&&b().createElement(Rm,{entity:t,importStatus:r,onImportStatusChange:e=>n(t.uri,e)})))},Nm=e=>{let{entity:t,isSelectedEntity:r,isHighlightedEntity:n,entityImportStatus:a,onEntityImportStatusChange:o}=e;return b().createElement("div",{className:T()(Gd.entityButtons,{[Gd.selectedEntityButtons]:r,[Gd.justImportedEntityButtons]:a===Cm.SUCCESS,[Gd.highlightedEntityButtons]:n})},b().createElement(Im,{entity:t,entityImportStatus:a,onEntityImportStatusChange:o}))};Nm.propTypes={entity:hp().object,isSelectedEntity:hp().bool,isHighlightedEntity:hp().bool,entityImportStatus:hp().oneOf(Object.values(Cm)),onEntityImportStatusChange:hp().func};const Dm=(0,Md.q)(((e,t)=>{let{entitiesImportStatus:r,onEntityImportStatusChange:n,selectedEntityUri:a,highlightedEntityIndex:o}=e,{entity:i,rowIndex:l}=t;return{entityImportStatus:i&&r[i.uri],onEntityImportStatusChange:n,isSelectedEntity:a===i.uri,isHighlightedEntity:o===l}}))(Nm);var Pm=r(72326),km=r(67655);function Lm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Um(e,t,r[t])}))}return e}function Um(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jm={height:"100%",display:"flex",flexDirection:"column"},Fm=(0,Op.Z)((e=>({inactiveCell:Lm({background:e.inactiveBackground},jm,{"&$selectedRowCell":{background:e.inactiveSelectedBackground}}),selectedRowCell:Lm({background:(0,km.lighten)(e.palette.primary.main,.88)},jm),clickable:Lm({cursor:"pointer"},jm),justImported:Lm({backgroundColor:"#FFFBEB !important"},jm)}))),Mm={entity:hp().object,isSelected:hp().bool,onEntityClick:hp().func,isJustImported:hp().bool},Vm=(0,Op.Z)({checkboxWrapper:{display:"flex",alignItems:"center"},checkbox:{marginRight:"-8px",marginLeft:"11px"}});const Bm={onCheck:hp().func,isChecked:hp().bool,hasCheckbox:hp().bool},zm=(0,Op.Z)({collapser:{marginLeft:"-2px"}});var Hm=r(18021),Ym=r(8835),Wm=r.n(Ym);const Gm=(0,Op.Z)({collapseButton:{cursor:"pointer"},expandLess:{transform:"rotate( -180deg )"}});function qm(){return qm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qm.apply(this,arguments)}const Zm=e=>{let{isOpen:t=!1,tooltipTitle:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isOpen","tooltipTitle"]);const a=Gm(),o={icon:Wm(),className:a.collapseButton,iconClassName:T()({[a.expandLess]:t})},i={tooltipTitle:r};return b().createElement(Cd.k,qm({"data-reltio-id":"collapse-button"},o,i,n))},$m=(0,Op.Z)((()=>({hidden:{visibility:"hidden"}}))),Km=e=>{let{rowIndex:t,rowValue:r,className:n}=e;const a=$m(),{toggleRowCollapse:o,getIsRowCollapsible:i,getIsRowCollapsed:l}=(0,E.useContext)(Hm.x),s=i(r),c=l(t);return b().createElement(Zm,{className:T()(n,{[a.hidden]:!s}),isOpen:!c,onClick:e=>{o(t),e.stopPropagation()}})};const Xm={hasCollapseButton:hp().bool},Qm=(0,R.pipe)((e=>{const t=t=>{const r=zm(),{hasCollapseButton:n}=t,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["hasCollapseButton"]),{rowValue:o,rowIndex:i}=a;return n?b().createElement("div",{className:"cellWithCollapser"},b().createElement(Km,{className:r.collapser,rowIndex:i,rowValue:o}),b().createElement(e,a)):b().createElement(e,a)};return t.propTypes=Xm,t}),(e=>{const t=t=>{const r=Vm(),{onCheck:n,isChecked:a,hasCheckbox:o}=t,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["onCheck","isChecked","hasCheckbox"]),{rowValue:{rawValue:l}}=i;return o?b().createElement("div",{className:T()(r.checkboxWrapper,"cellWithCheckbox")},b().createElement(Xp(),{className:r.checkbox,checked:a,onClick:e=>e.stopPropagation(),onChange:e=>n(l.uri,e.target.checked)}),b().createElement(e,i)):b().createElement(e,i)};return t.propTypes=Bm,t}),(e=>{const t=t=>{const r=Fm(),{rowValue:{rawValue:n},isSelected:a,onEntityClick:o,isJustImported:i}=t,l=o?()=>o(n.uri):void 0,s=n&&!(0,O.isActiveObject)(n);return l||s||a||i?b().createElement("div",{className:T()({[r.inactiveCell]:s},{inactiveCell:s},{[r.selectedRowCell]:a},{selectedRowCell:a},{[r.clickable]:!!l},{[r.justImported]:i},{justImported:i}),onClick:l},b().createElement(e,t)):b().createElement(e,t)};return t.propTypes=Mm,t}),(0,Md.q)(((e,t)=>{let{onEntityClick:r,selectedEntityUri:n,entitiesImportStatus:a,canCheck:o,onCheck:i,checkedEntitiesUris:l}=e,{rowValue:s,columnIndex:c}=t;const{rawValue:u}=s,p=0===c;return{onCheck:i,isChecked:l&&l.includes(u.uri),hasCheckbox:o&&p,hasCollapseButton:p,isSelected:n===u.uri,isJustImported:a[u.uri]===Cm.SUCCESS,onEntityClick:r}})))(Pm.DN),Jm=e=>{let{columnData:t,cell:r}=e;const n=r.values.length,a=28*Math.max(n,1)+20;if(!n)return a;switch((0,R.path)(["dataTypeDefinition","type"],t)){case"Reference":return 28*n+17;case"Blob":return 100*n;case"Image":return 76*n+17;default:return a}},ey=(0,E.forwardRef)(((e,t)=>{let{headColumns:r,entities:n,entityToHighlight:a,selectedEntityUri:o,onReorderingColumn:i,dndColumnReorderingEnabled:l,columnsSize:s,onChangeColumnsSize:c,onScroll:u,onSort:p,sortField:d,sortOrder:m,onEntityHover:y,onEntityClick:g,entitiesImportStatus:f,onEntityImportStatusChange:h,logger:v,canCheck:T,checkedEntitiesUris:x,headerCheckboxState:C,onCheck:S,openConfigColumnPopup:w,resizeDebounceDelay:A}=e;const _=(0,E.useMemo)((()=>({highlightRow:"highlightedSelector",dragColumnHead:Gd.dragColumnHead,dragColumnBody:Gd.dragColumnBody,draggableHeadCell:Gd.draggableHeadCell,cellWrapper:Gd.cellWrapper})),[]),I=(0,Ep.useSelector)(P().selectors.getMetadata),[N,D]=(0,E.useState)(null),k=(0,E.useCallback)((e=>{D(e),y&&y((0,R.path)([e,"uri"],n))}),[y,n]),L=(0,E.useRef)();(0,E.useImperativeHandle)(t,(()=>({resetScrollbarPosition:()=>{L.current&&L.current.resetScrollbarPosition({resetLeft:!1})}})));const U=(0,E.useCallback)((e=>{m&&e===d?m===Pd.oy?p({field:e,order:Pd.U9}):p({field:e}):p({field:e,order:Pd.oy})}),[p,d,m]),j=(0,E.useCallback)((e=>{const t=(0,R.prop)(e,n);return t?b().createElement(Dm,{entity:t,rowIndex:e}):null}),[n]),F=(0,E.useCallback)((e=>b().createElement(Qm,e)),[]),M=!!y,V=!!p,B=(0,E.useMemo)((()=>function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.map(((e,r)=>{var n;let{attrType:a}=e,o=dm(e,["attrType"]);const i=0===r;return um({},o,{dataTypeDefinition:a&&(0,O.getAttrDataTypeDefinition)(a),resizable:!0,autoResize:null!==(n=o.autoResize)&&void 0!==n?n:!i,draggable:!i,sortable:t&&gm(o),nestedPath:fm(o.id),headCellRenderer:i?zd:Bd,rowCellValueRenderer:cm(um({},o,{attrType:a}))})}))}(r,V)),[r,V]),z=(0,E.useMemo)((()=>((e,t,r)=>(r||[]).map((e=>(0,R.pipe)((0,R.reduce)(((t,r)=>(0,R.assoc)(r.id,((e,t,r)=>{switch(t.id){case"label":return r;case"entityId":return(0,O.getEntityId)(r);default:{const[e,...n]=mm(t.id);return(0,R.pipe)((0,R.prop)(e),(0,O.getOvAttributeValuesByPath)(n))(r)}}})(0,r,e),t)),{}),(0,R.assoc)("rawValue",e))(t))))(0,r,n)),[I,r,n]),H=a?n.findIndex((0,R.propEq)("uri",a)):-1,Y=(0,E.useMemo)((()=>({onEntityClick:g,selectedEntityUri:o,highlightedEntityIndex:H,entitiesImportStatus:f,onEntityImportStatusChange:h,canCheck:T,checkedEntitiesUris:x,headerCheckboxState:C,onCheck:S,openConfigColumnPopup:w})),[x,f,C,H,T,S,g,h,o,w]);return b().createElement(kd.M,{fixFirstColumn:!0,onScroll:u,rowsData:z,columnsData:B,onSort:U,highlightRow:-1!==H?H:null,ref:L,sortFieldClassName:Gd.sortableCell,containerClassName:Gd.table,classes:_,defaultColumnWidth:250,headRowHeight:50,defaultColumnMinWidth:100,defaultRowHeight:48,sorting:{field:d,order:m},dndColumnReorderingHandler:i,dndColumnReorderingEnabled:l,onChangeColumnsSize:c,columnsSize:s,resizeDebounceDelay:null!=A?A:150,onRowHover:M?k:void 0,hoverStateEnabled:M,hoverRowIndex:N,renderRowOverlay:j,logger:v,context:Y,maxRowValuesCount:2,renderRowCell:F,getRowCellHeight:Jm})}));ey.propTypes={entities:hp().array,entityToHighlight:hp().string,selectedEntityUri:hp().string,headColumns:hp().array,columnsSize:hp().array,onScroll:hp().func,onSort:hp().func,onReorderingColumn:hp().func,onChangeColumnsSize:hp().func,dndColumnReorderingEnabled:hp().bool,onEntityClick:hp().func,onEntityHover:hp().func,sortField:hp().string,sortOrder:hp().oneOf([Pd.oy,Pd.U9]),entitiesImportStatus:hp().object,onEntityImportStatusChange:hp().func,logger:hp().func,canCheck:hp().bool,checkedEntitiesUris:hp().arrayOf(hp().string),headerCheckboxState:hp().oneOf([!0,!1,null]),onCheck:hp().func,openConfigColumnPopup:hp().func,resizeDebounceDelay:hp().number},ey.defaultProps={entities:[],headColumns:[]},ey.displayName="EntitiesTable";const ty=(0,E.memo)(ey);var ry=r(4437),ny=r.n(ry),ay=r(5106),oy=r.n(ay);const iy="left",ly="right",sy="hide",cy={[iy]:po().text("Insert 1 left"),[ly]:po().text("Insert 1 right"),[sy]:po().text("Hide column")},uy=e=>{let{open:t,anchorEl:r,onClick:n,onClose:a,actions:o}=e;return b().createElement(Tp(),{open:t,anchorEl:r,onClose:a},b().createElement(ny(),{component:"div"},o.map(((e,t)=>((e,t,r)=>b().createElement(oy(),{button:!0,component:"div",key:r,onClick:t},b().createElement($p(),{primary:cy[e],primaryTypographyProps:{variant:"body2"}})))(e,(e=>()=>{n(e)})(e),t)))))};uy.propTypes={open:hp().bool,anchorEl:hp().any,onClick:hp().func,onClose:hp().func,actions:hp().array};const py=uy;class dy extends b().PureComponent{constructor(){super(...arguments),this.state={addColumnPopupOpen:!1,configColumnPopupOpen:!1,configurableColumnIndex:!1,popupAnchor:null,filterText:""},this.addColumnHandler=e=>{const{newColumnPlaceIndex:t}=this.state,{onChangeColumnsList:r,headColumns:n}=this.props,a=n.slice();a.splice(t,0,e),r({columns:a}),this.closeAddColumnPopup()},this.openAddColumnPopup=e=>{let{newColumnPlaceIndex:t}=e;this.setState({newColumnPlaceIndex:t,configColumnPopupOpen:!1,addColumnPopupOpen:!0})},this.closeAddColumnPopup=()=>{this.setState({popupAnchor:null,addColumnPopupOpen:!1,filterText:""})},this.setFilterText=e=>{this.setState({filterText:e})},this.openConfigColumnPopup=e=>{this.setState({popupAnchor:e.currentTarget,configColumnPopupOpen:!0,configurableColumnIndex:parseInt(e.currentTarget.getAttribute("data-column-index"))})},this.closeConfigColumnPopup=()=>{this.setState({configColumnPopupOpen:!1})},this.configColumnHandler=e=>{const{configurableColumnIndex:t}=this.state;switch(e){case iy:this.openAddColumnPopup({newColumnPlaceIndex:t});break;case ly:this.openAddColumnPopup({newColumnPlaceIndex:t+1});break;case sy:this.hideCurrentConfigColumn()}},this.hideCurrentConfigColumn=()=>{const{configurableColumnIndex:e}=this.state,{onChangeColumnsList:t,headColumns:r}=this.props,n=r.slice();n.splice(e,1),t({columns:n}),this.closeConfigColumnPopup()},this.memoizedGetColumnSize=(0,O.memoizeWith)(dy.getMemoIdForColumnSize,dy.getColumnSizeFromHeadColumns)}static getColumnSizeFromHeadColumns(e){return e.map((e=>({id:e.id,size:e.size})))}static getMemoIdForColumnSize(e,t){return`${t}${(0,R.toString)(e.map((e=>(0,R.pick)(["id","size"],e))))}`}render(){const{entities:e,entityToHighlight:t,selectedEntityUri:r,onScroll:n,headColumns:a,sortField:o,sortOrder:i,dndColumnReorderingEnabled:l,onEntityClick:s,onEntityHover:c,entitiesTableRef:u,additionalColumns:p,onChangeColumnsList:d,onReorderingColumn:m,onSort:y,onChangeColumnsSize:g,entityTypeUri:f,entitiesImportStatus:h={},onEntityImportStatusChange:E,logger:v,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:x,onCheck:C,resizeDebounceDelay:S}=this.props,{addColumnPopupOpen:w,configColumnPopupOpen:A,popupAnchor:R,filterText:_,configurableColumnIndex:I}=this.state,N=this.memoizedGetColumnSize(a,f);return b().createElement(b().Fragment,null,b().createElement(ty,{entities:e,entityToHighlight:t,selectedEntityUri:r,onScroll:n,onSort:y,onEntityClick:s,onEntityHover:c,headColumns:a,sortField:o,sortOrder:i,onReorderingColumn:m,ref:u,onChangeColumnsList:d,dndColumnReorderingEnabled:l,onChangeColumnsSize:g,columnsSize:N,entitiesImportStatus:h,onEntityImportStatusChange:E,logger:v,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:x,onCheck:C,openConfigColumnPopup:this.openConfigColumnPopup,resizeDebounceDelay:S}),b().createElement(xd,{open:w,anchorEl:R,data:p,onListItemClick:this.addColumnHandler,filterText:_,onClose:this.closeAddColumnPopup,onSearch:this.setFilterText,hideCheckBox:!0,titleText:uo.text("Add column")}),b().createElement(py,{onClick:this.configColumnHandler,onClose:this.closeConfigColumnPopup,anchorEl:R,open:A,actions:I>0?[iy,ly,sy]:[ly]}))}}dy.propTypes={entities:hp().array,entityToHighlight:hp().string,selectedEntityUri:hp().string,entityTypeUri:hp().string,headColumns:hp().array,dndColumnReorderingEnabled:hp().bool,onScroll:hp().func,onSort:hp().func,onReorderingColumn:hp().func,onChangeColumnsSize:hp().func,onChangeColumnsList:hp().func,onEntityClick:hp().func,onEntityHover:hp().func,sortField:hp().string,sortOrder:hp().oneOf([Pd.oy,Pd.U9]),entitiesTableRef:hp().shape({current:hp().shape({resetScrollbarPosition:hp().func})}),additionalColumns:hp().arrayOf(hp().shape({id:hp().string,label:hp().string})),entitiesImportStatus:hp().object,onEntityImportStatusChange:hp().func,logger:hp().func,canCheck:hp().bool,checkedEntitiesUris:hp().arrayOf(hp().string),headerCheckboxState:hp().oneOf([!0,!1,null]),onCheck:hp().func};const my=dy;var yy=r(66780),gy=r(9366),fy=r(41633),hy=r(79881),Ey=r.n(hy),by=r(93962),vy=r.n(by),Ty=r(45995),Oy=r.n(Ty);function xy(){return xy=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xy.apply(this,arguments)}const Cy=e=>{let{open:t=!0,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["open","children"]);const[a,o]=(0,E.useState)(t),i=(0,km.useTheme)().transitions.duration.leavingScreen;return(0,E.useEffect)((()=>{if(t!==a){if(!t){const e=setTimeout((()=>{o(!1)}),i);return()=>clearTimeout(e)}o(!0)}}),[t,i,a]),b().createElement(Oy(),xy({open:t},n),a&&r)};Cy.displayName="Drawer";var Sy=r(418),wy=r(18759),Ay=r.n(wy),Ry=r(30122),_y=r.n(Ry),Iy=r(43410),Ny=r.n(Iy),Dy=r(93416),Py=r.n(Dy);function ky(){return ky=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ky.apply(this,arguments)}const Ly=(e,t)=>{const r=r=>{let{dispatch:n}=r,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(r,["dispatch"]);return b().createElement(e,ky({config:t,onChange:(o=t.fieldName,e=>{n(no(o,e))}),onClose:t.showDeleteButton?(e=>()=>{n(io({fieldNamesToDelete:[e]}))})(t.fieldName):()=>{},onSearch:(e=>t=>{let{value:r,pageNumber:a,currentOptions:o}=t;n((e=>{let{facetFieldName:t,value:r,debounceTime:n=0,pageNumber:a=1,currentOptions:o}=e;return{type:k.k.FILTER_FACET_DATA,payload:{facetFieldName:t,value:r,debounceTime:n,pageNumber:a,currentOptions:o}}})({facetFieldName:e,value:r,debounceTime:250,pageNumber:a,currentOptions:o}))})(t.fieldName)},a));var o};return r.propTypes={dispatch:hp().func,isRecommended:hp().bool},r};var Uy=r(52004),jy=r.n(Uy),Fy=r(58282),My=r.n(Fy);const Vy=(0,Op.Z)((()=>({viewMoreLessLink:{display:"flex",alignItems:"center",cursor:"pointer"},arrow:{marginRight:"8px",marginLeft:"-2px",transform:"rotate(0deg)",transition:"transform 0.35s ease"},rotated:{transform:"rotate(-180deg)"}}))),By=e=>{let{active:t,onClick:r,className:n}=e;const a=Vy();return b().createElement(jy(),{className:T()(a.viewMoreLessLink,n),onClick:r,underline:"none"},b().createElement(My(),{className:T()(a.arrow,{[a.rotated]:t})}),t?po().text("View less"):po().text("View more"))};By.propTypes={active:hp().bool,onClick:hp().func,className:hp().string};const zy=By;var Hy=r(50592),Yy=r(23888),Wy=r.n(Yy);const Gy=(0,Op.Z)((e=>({bar:{backgroundColor:e.palette.secondary.main,opacity:.12,position:"absolute",minHeight:"20px",minWidth:"5px",borderRadius:"2px",top:0,left:0,height:"100%"}}))),qy=e=>(0,R.is)(Number,e),Zy=e=>{let{className:t,width:r=0,maxWidth:n}=e;const a=Gy(),o=(0,E.useCallback)((e=>(n?100*e/n:0)+"%"),[n]);return r?b().createElement("div",{className:T()(a.bar,t),style:{width:qy(r)?o(r):r}}):null},$y=(0,Op.Z)((e=>({listContainer:{display:"flex",flexDirection:"column",paddingLeft:18,"& $disabled":{pointerEvents:"none",opacity:.4}},disabled:{},item:{display:"flex",flexGrow:1,flexShrink:0,flexDirection:"row",marginRight:10,marginTop:2,marginBottom:2},info:{display:"flex",flexGrow:1,position:"relative",minWidth:0,marginTop:2,marginBottom:2,"&:hover":{cursor:"pointer","& $buttonONLY":{display:"block"}}},buttonONLY:{display:"none",position:"absolute",height:24,width:59,borderRadius:3,backgroundColor:"#DFDFDF",fontSize:14,fontWeight:600,lineHeight:"16px",color:"rgba(0,0,0,0.54)",boxShadow:"none",top:0,right:0,zIndex:3},avatar:{marginRight:8,height:24,width:24},checkbox:{marginRight:14,padding:0,"& $checked":{opacity:1}},checked:{},textInfo:{display:"flex",flexGrow:1,lineHeight:"16px",backgroundColor:"transparent",minWidth:0,alignItems:"center",zIndex:2},text:{flexGrow:1,marginLeft:7,marginRight:4,color:e.palette.text.primary,width:"100%",maxHeight:"32px",wordBreak:"break-word",wordWrap:"break-word",overflow:"hidden"},count:{flexShrink:0,fontSize:12,color:e.palette.text.secondary,textAlign:"right",marginRight:4},toggleContainer:{height:28,padding:"2px 2px",display:"flex",alignItems:"center",justifyContent:"flex-start",margin:"0",background:e.palette.background.default},toggleButton:{padding:"0",minWidth:"28",height:"28",border:"0","&:last-child":{paddingLeft:"0"}},checkedBar:{opacity:.4}})));function Ky(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xy={showColorBar:!0,hasOnlyButton:!1},Qy=e=>{let{config:t,data:r=[],values:n=[],onChange:a=lo.ZT}=e;const o=$y();t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ky(e,t,r[t])}))}return e}({},Xy,t);const i=e=>()=>{const t=n.includes(e)?n.filter((t=>t!==e)):n.concat(e);a(t)},l=Math.max(...r.map((e=>e.number)));return b().createElement("div",{className:o.listContainer},r.map((e=>b().createElement("div",{key:e.value,className:T()(o.item,{[o.disabled]:!e.number&&!n.includes(e.value)}),"data-reltio-id":"search-facets-list-row"},(e=>b().createElement(Xp(),{className:T()(o.checkbox,{[o.checked]:n.includes(e.value)}),checked:n.includes(e.value),onChange:i(e.value),value:e.value,color:"primary"}))(e),b().createElement("div",{className:o.info,onClick:i(e.value)},(e=>b().createElement(Zy,{className:T()({[o.checkedBar]:n.includes(e.value)}),width:e.number,maxWidth:l}))(e),b().createElement("div",{className:T()(o.textInfo)},b().createElement("div",{className:o.text},e.label),b().createElement("div",{className:o.count},void 0===e.number?po().text("N/A"):(0,lo.k7)(e.number,5e3))),t.hasOnlyButton&&(e=>{return b().createElement(Wy(),{className:o.buttonONLY,onClick:(t=e.value,e=>{e.stopPropagation(),a([t])})},po().text("ONLY"));var t})(e))))))};var Jy=r(1441);const eg=(0,Op.Z)((()=>({container:{overflow:"hidden",display:"flex",flexGrow:1,flexDirection:"column",fontSize:"13px"},noData:{marginLeft:"16px"},viewMoreLess:{paddingLeft:"20px"}}))),tg=e=>{let{config:t,data:r=[],values:n=[],onChange:a}=e;const o=eg(),i=(0,Ep.useDispatch)(),l=(0,E.useCallback)((e=>{let{show:t}=e;i((e=>{let{show:t,silent:r}=e;return{type:k.k.SHOW_MORE_ENTITY_TYPES,payload:{show:t,silent:r}}})({show:t}))}),[i]),s=(0,Ep.useSelector)((e=>(0,N.jC)(t,e))),c=(0,Ep.useSelector)(so.t9),u=r.length>$.wP,p=(0,E.useCallback)((()=>{l({show:!s})}),[l,s]),d=(0,E.useMemo)((()=>{const e=s?r:r.slice(0,$.wP);return(0,Jy.ZK)(e,c)}),[r,s,c]);return b().createElement("div",{className:o.container},r.length>0?b().createElement(b().Fragment,null,b().createElement(Qy,{data:d,values:n,onChange:a,config:t}),u&&b().createElement(zy,{active:s,onClick:p,className:o.viewMoreLess})):b().createElement(Hy.K,{variant:"noData",className:o.noData}))};var rg=r(70347),ng=r(52935);const ag=(0,ng.Z)(rg.ZP);var og=r(81697),ig=r(27308);const lg=(0,ng.Z)(ig.ZP);function sg(){return sg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sg.apply(this,arguments)}function cg(e){const{innerProps:t,innerRef:r,children:n,isFocused:a,isSelected:o,selectProps:{classes:i},label:l}=e;return b().createElement(Jp(),sg({className:T()(i.option,{[i["option--selected"]]:o}),ref:r,selected:a,component:"div"},t),b().createElement(Xp(),{color:"primary",checked:o}),b().createElement(dd.Y,{value:l},b().createElement("div",{className:i["option--item"]},n)))}cg.propTypes={children:hp().node,innerProps:hp().shape({id:hp().string.isRequired,key:hp().string,onClick:hp().func.isRequired,onMouseMove:hp().func.isRequired,onMouseOver:hp().func.isRequired,tabIndex:hp().number.isRequired}).isRequired,innerRef:hp().oneOfType([hp().oneOf([null]),hp().func,hp().shape({current:hp().any.isRequired})]),isFocused:hp().bool.isRequired,isSelected:hp().bool.isRequired,label:hp().string,selectProps:hp().shape({classes:hp().shape({option:hp().string})})};const ug={Option:cg};var pg=r(62127);const dg=e=>{let t=null==e?void 0:e.parentElement;for(;t;){if(t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null},mg=(e,t,r,n)=>e&&t<e&&n.getBoundingClientRect().bottom>r.getBoundingClientRect().bottom;function yg(){return yg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yg.apply(this,arguments)}function gg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){fg(e,t,r[t])}))}return e}function fg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hg=(0,Op.Z)((e=>({label:{top:6,left:16},placeholder:e=>({display:!e.placeholder||e.label?"none":void 0}),"option--selected":{fontWeight:400},clearIndicator:{padding:e.spacing(1),margin:e.spacing(.25,.5)},dropdownIndicator:{padding:e.spacing(1),margin:e.spacing(.25,.5)}})));let Eg=0;function bg(e){const{label:t,creatable:r,getOptions:n,loadingIndicator:a,components:o,classes:i,styles:l,onChange:s,onInputChange:c,menuPlacement:u="auto"}=e,p=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","creatable","getOptions","loadingIndicator","components","classes","styles","onChange","onInputChange","menuPlacement"]),d=r?ag:n?lg:og.Z,[m,y]=(0,E.useState)(""),g=hg((0,R.omit)(["classes"],e)),f="custom-select-"+Eg++,h=(0,E.useRef)();!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;const r=(0,pg.D)(null==e?void 0:e.length);(0,E.useEffect)((()=>{const n=setTimeout((()=>{const n=dg(null==t?void 0:t.current);var a;n&&mg(null==e?void 0:e.length,r,n,t.current)&&(null===(a=t.current)||void 0===a||a.scrollIntoView(!1))}),0);return()=>{clearTimeout(n)}}),[null==e?void 0:e.length])}(e.value,(e=>{const t={};return e.current&&(t.current=(0,R.either)((0,R.path)(["select","controlRef"]),(0,R.path)(["select","select","controlRef"]))(e.current)),t})(h));const v=gg({},ug,o),T=(0,bp.ze)(g,i),O=gg({indicatorSeparator:e=>gg({},e,{margin:"10px 0"}),loadingIndicator:e=>gg({},e,{display:a?e.display:"none"}),loadingMessage:e=>gg({},e,{fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif'})},l),x=t?{inputId:f,TextFieldProps:gg({label:t,InputLabelProps:{htmlFor:f,shrink:!(!e.value||!e.value.length)||void 0,className:T.label}},e.TextFieldProps)}:{};return b().createElement(d,yg({isMulti:!0,inputId:f,inputValue:m,onChange:function(e,t){s(e,t),"create-option"===t.action&&(y(""),c("",{action:"input-change"}))},onInputChange:function(e,t){let{action:r}=t;c(e,{action:r}),"set-value"!==r&&y(e)},closeMenuOnSelect:!1,hideSelectedOptions:!1,classes:T,components:v,styles:O,menuPlacement:u,loadOptions:n,innerRef:h},x,p))}bg.defaultProps={creatable:!1,cacheOptions:!0,components:{},classes:{},placeholder:"",loadingIndicator:!1,onInputChange:()=>{},onChange:()=>{}},bg.propTypes={creatable:hp().bool,cacheOptions:hp().bool,defaultOptions:hp().bool,value:hp().arrayOf(hp().shape({label:hp().string.isRequired,value:hp().any})),options:hp().arrayOf(hp().shape({label:hp().string.isRequired,value:hp().any})),onChange:hp().func,onInputChange:hp().func,placeholder:hp().string,label:hp().string,loadingIndicator:hp().bool,components:hp().shape({ClearIndicator:hp().func,Control:hp().func,DropdownIndicator:hp().func,DownChevron:hp().func,CrossIcon:hp().func,Group:hp().func,GroupHeading:hp().func,IndicatorsContainer:hp().func,IndicatorSeparator:hp().func,Input:hp().func,LoadingIndicator:hp().func,Menu:hp().func,MenuList:hp().func,MenuPortal:hp().func,LoadingMessage:hp().func,NoOptionsMessage:hp().func,MultiValue:hp().func,MultiValueContainer:hp().func,MultiValueLabel:hp().func,MultiValueRemove:hp().func,Option:hp().func,Placeholder:hp().func,SelectContainer:hp().func,SingleValue:hp().func,ValueContainer:hp().func}),classes:hp().shape({control:hp().string,valueContainer:hp().string,multiValue:hp().string,noOptionsMessage:hp().string,singleValue:hp().string,placeholder:hp().string,menu:hp().string,clearIndicator:hp().string,dropdownIndicator:hp().string,option:hp().string,"option--selected":hp().string,label:hp().string}),styles:hp().shape({clearIndicator:hp().func,container:hp().func,control:hp().func,dropdownIndicator:hp().func,group:hp().func,groupHeading:hp().func,indicatorsContainer:hp().func,indicatorSeparator:hp().func,input:hp().func,loadingIndicator:hp().func,loadingMessage:hp().func,menu:hp().func,menuList:hp().func,menuPortal:hp().func,multiValue:hp().func,multiValueLabel:hp().func,multiValueRemove:hp().func,noOptionsMessage:hp().func,option:hp().func,placeholder:hp().func,singleValue:hp().func,valueContainer:hp().func}),TextFieldProps:hp().object,getOptions:hp().func,menuPlacement:hp().string,menuPortalTarget:hp().object,menuShouldBlockScroll:hp().bool,captureMenuScroll:hp().bool,getOptionValue:hp().func,isSearchable:hp().bool,inputRef:hp().shape({current:hp().object})};const vg=bg;var Tg=r(80959),Og=r(88640),xg=r(25386),Cg=r(59428),Sg=r(47823);const wg=(0,Op.Z)({item:{display:"flex",minHeight:"28px",flexGrow:1,flexDirection:"row",alignItems:"center",borderRadius:"1px",padding:0,opacity:1},checkbox:{marginRight:"14px",marginLeft:"18px",padding:0},infobox:{display:"flex",flexGrow:1,alignItems:"center",position:"relative",height:"20px",margin:"2px 10px 2px 0",minWidth:0},textbox:{display:"flex",flexDirection:"row",alignItems:"center",flexGrow:1,minWidth:0,zIndex:2},text:{flexGrow:1,width:0,height:"15px",color:"rgba(0,0,0,0.87)",fontSize:"13px",lineHeight:"16px",letterSpacing:0,fontWeight:"normal",paddingLeft:"7px",paddingRight:"8px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",minWidth:0},number:{flexGrow:0,flexShrink:0,height:"16px",color:"rgba(0,0,0,0.6)",fontSize:"12px",lineHeight:"16px",textAlign:"right",paddingRight:"4px"},colorBar:{height:"20px"},selectedColorBar:{opacity:.4},itemSelected:{backgroundColor:"rgba(0, 0, 0, 0.04) !important"}});function Ag(){return Ag=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ag.apply(this,arguments)}const Rg=e=>{const{innerProps:t,innerRef:r,data:n,isSelected:a,isFocused:o,selectProps:{classes:i}}=e,l=wg(),s=(0,R.has)("width",n),c=(0,R.has)("number",n);return b().createElement(Jp(),Ag({className:i.option,classes:{root:l.item,selected:l.itemSelected},ref:r,component:"div",selected:o,disableGutters:!0},t),b().createElement(Xp(),{checked:a,color:"primary",disableRipple:!0,classes:{root:l.checkbox}}),b().createElement("div",{className:l.infobox},b().createElement("div",{className:l.textbox},b().createElement(dd.Y,{value:n.label},b().createElement("div",{className:l.text},n.label)),c&&b().createElement("div",{className:l.number},(0,lo.k7)(n.number,5e3))),s&&b().createElement(Zy,{className:T()(l.colorBar,{[l.selectedColorBar]:a}),width:n.width})))};Rg.propTypes={innerProps:hp().shape({id:hp().string.isRequired,key:hp().string,onClick:hp().func.isRequired,onMouseMove:hp().func.isRequired,onMouseOver:hp().func.isRequired,tabIndex:hp().number.isRequired}).isRequired,innerRef:hp().oneOfType([hp().oneOf([null]),hp().func,hp().shape({current:hp().any.isRequired})]),isSelected:hp().bool.isRequired,isFocused:hp().bool.isRequired,selectProps:hp().shape({classes:hp().shape({option:hp().string})}),data:hp().shape({value:hp().string,label:hp().string.isRequired,number:hp().number}).isRequired};const _g=Rg,Ig=e=>{const{selectProps:{classes:t}}=e;return b().createElement(Hy.K,{variant:"noData",className:t.noOptionsMessage})};Ig.propTypes={selectProps:hp().object.isRequired};const Ng=Ig;function Dg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Pg(e,t,r[t])}))}return e}function Pg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kg={container:e=>Dg({},e,{width:"100%"}),menuList:e=>Dg({},e,{maxHeight:"240px",padding:"8px 0"}),menu:e=>Dg({},e,{maxHeight:"240px"})},Lg=(0,Op.Z)((()=>({control:{minHeight:"46px",backgroundColor:"rgba(0,0,0, 0.0267)",height:"auto",padding:0},option:{minHeight:"28px",display:"flex",flexGrow:1,flexShrink:0,flexDirection:"row",padding:0},noOptionsMessage:{padding:"0 16px 0 18px"},multiValue:{backgroundColor:"rgba(43, 152, 240, 0.12)"}})));var Ug=r(53862);const jg=hp().shape({value:hp().string.isRequired,label:hp().string.isRequired,number:hp().number}),Fg=(hp().shape({default:hp().array,filtered:hp().array}),hp().shape({values:hp().array,searchType:hp().oneOf(Object.values(O.MAP_SEARCH_TYPES))})),Mg={id:hp().string,operation:hp().string,operationParameters:hp().shape({attributeTypeData:hp().shape({pathToTitle:hp().arrayOf(hp().string),title:hp().string,attributeType:O.AttributeTypeType}),attributeValue:hp().oneOfType([hp().string,O.LookupValueType,O.NestedAttributeValueType,O.ReferenceAttributeValueType]),attributeValueToFind:hp().oneOfType([hp().string,O.LookupValueType]),pin:hp().bool,addNestedAttribute:hp().bool})},Vg={id:hp().string,fieldName:hp().string,conditions:hp().arrayOf(Ug.Xw),actions:hp().arrayOf(hp().shape(Mg))};function Bg(){return Bg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bg.apply(this,arguments)}function zg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Hg=e=>{let{values:t=[],defaultOptions:r=[],filteredOptions:n,onChange:a=R.identity,getSuggestions:o,showBar:i=!0,showNumberInValue:l=!1,classes:s={},styles:c={},canLoadMore:u=!0,max:p=$.cu}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","defaultOptions","filteredOptions","onChange","getSuggestions","showBar","showNumberInValue","classes","styles","canLoadMore","max"]);const m=Lg(),[y,g]=(0,E.useState)(""),[f,h]=(0,E.useState)(1),[v,T]=(0,E.useState)(!1),x=(0,E.useRef)(null),C=(0,E.useRef)(!1),S=(0,E.useRef)(!1),w=(n||[]).concat(r),A=e=>w.find((t=>t.value===e))||{value:e,label:e},_=e=>l&&(0,R.has)("number",e)?(0,R.assoc)("formattedNumber",(0,O.formatNumberAsMetric)((0,R.prop)("number",e),5e3),e):e,I=(0,R.pipe)((e=>{if(i&&e.length&&(0,R.has)("number",e[0])){const t=Math.max(...e.map((e=>e.number)));return e.map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zg(e,t,r[t])}))}return e}({},e,{width:N(e.number,t)})))}return e}),(0,R.uniqBy)((0,R.prop)("value"))),N=(e,t)=>(t?100*e/t:0)+"%",D=(0,O.debounce)(((e,t)=>{let{action:r}=t;e!==y&&"set-value"!==r&&(g(e),h(1),C.current=!1,T(!0),o({value:e,pageNumber:1}))}),250),P=n||r,k=(0,E.useCallback)((()=>{T(!0),o({value:y,pageNumber:f+1,currentOptions:P}),C.current=!0}),[y,f,o,P]);(0,E.useEffect)((()=>{T(!1),C.current&&(h((e=>e+1)),C.current=!1)}),[n]),(0,E.useEffect)((()=>{S.current||(T(!1),h(1),C.current=!1,o({value:"",pageNumber:1})),S.current=!1}),[r]);const L=(0,E.useMemo)((()=>P.slice(0,f*p)),[P,f,p]),U=u&&P.length>L.length;return b().createElement(vg,Bg({filterOption:(e,t)=>{let{label:r,value:n}=e;return O.utils.strings.search(r,t)||O.utils.strings.search(n,t)},value:(e=>(0,O.wrapInArrayIfNeeded)(e).map(A).map(_))(t),onChange:(0,R.pipe)((0,R.tap)((()=>{S.current=!0})),(0,R.defaultTo)([]),(0,R.pluck)("value"),a),options:I(L),onInputChange:D,classes:(0,R.mergeRight)(m,s),styles:(0,R.mergeRight)(kg,c),TextFieldProps:{InputProps:{disableUnderline:!0},ref:x},inputRef:x,components:{Option:_g,NoOptionsMessage:Ng,Menu:Tg.h,DropdownIndicator:Og.K,MultiValue:xg._,MenuList:Cg.d},menuPlacement:"bottom",menuListFooter:U&&b().createElement(Sg.X,{loading:v,onClick:k})},d))};Hg.propTypes={values:hp().array,defaultOptions:hp().arrayOf(jg),filteredOptions:hp().arrayOf(jg),onChange:hp().func.isRequired,getSuggestions:hp().func.isRequired,showBar:hp().bool,showNumberInValue:hp().bool,classes:hp().object,styles:hp().object,canLoadMore:hp().bool,max:hp().number};const Yg=(0,E.memo)(Hg);var Wg=r(43627),Gg=r.n(Wg);function qg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Zg(e,t,r[t])}))}return e}function Zg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $g=(0,R.range)(2,10).reduce(((e,t)=>qg({},e,{[`&:nth-child(${t})`]:{paddingLeft:`calc(1em * (${t} - 2))`,"&::before":{content:'"└"',display:"inline-block",fontSize:"1em",marginRight:"5px",color:"rgba(255, 255, 255, 0.28)"}}})),{}),Kg=(0,Op.Z)((e=>({tooltip:e.tooltip,tooltipContent:{minWidth:"165px",padding:"4px 2px 2px","& p":{fontSize:"11px",lineHeight:"13px",fontWeight:500,margin:0,color:"white"},"& ul":{listStyleType:"none",padding:0,margin:0,"& li":qg({fontSize:"10px",lineHeight:"11px",fontWeight:500,color:"rgba(255, 255, 255, 0.7)",marginTop:"4px"},$g,{"&:last-child":{color:"white"}}),"& li + li":{marginTop:"2px"}}}})));function Xg(){return Xg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xg.apply(this,arguments)}const Qg=e=>{let{pathToTitle:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["pathToTitle","children"]);const a=Kg(),o=null!=t&&t.length?b().createElement("div",{className:a.tooltipContent},b().createElement("p",null,(0,R.last)(t)),t.length>2&&b().createElement("ul",null,t.map((e=>b().createElement("li",{key:e},e))))):"";return b().createElement(Gg(),Xg({title:o,disableFocusListener:!0,classes:{tooltip:a.tooltip}},n),r)};var Jg=r(96091),ef=r.n(Jg),tf=r(35635),rf=r.n(tf);const nf=(0,Op.Z)({root:{boxSizing:"border-box",height:"18px",border:"1px solid rgba(0,0,0,0.12)",borderRadius:"16px",backgroundColor:"transparent","& $deleteIcon":{margin:"0",height:"12px",width:"12px",color:"rgba(0,0,0,0.38)"}},outlined:{"& $deleteIcon":{marginRight:2}},deleteIcon:{},label:{color:"rgba(0,0,0,0.38)",fontSize:"12px",fontWeight:500,lineHeight:"16px",paddingLeft:"4px",paddingRight:"4px"}});function af(){return af=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},af.apply(this,arguments)}const of=(0,md.T)(rf()),lf=e=>{let{label:t,onDelete:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","onDelete"]);const a=nf();return b().createElement(ef(),af({className:a.root,label:po().number(t),onDelete:r,variant:"outlined",classes:{root:a.root,outlined:a.outlined,deleteIcon:a.deleteIcon,label:a.label},deleteIcon:b().createElement(of,{tooltipTitle:po().text("Clear")})},n))},sf=(0,Op.Z)((e=>({container:{display:"flex",flexDirection:"column",flexGrow:1,justifyContent:"center",height:"100%",minWidth:0,cursor:"pointer"},parent:{color:e.palette.text.secondary,fontSize:"13px",lineHeight:"15px",letterSpacing:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},titleContainer:{display:"flex",flexDirection:"row",overflow:"hidden",alignItems:"flex-end",height:"18px",width:"100%"},title:{color:e.palette.text.primary,fontSize:"14px",lineHeight:"16px",fontWeight:500,letterSpacing:"0.24px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},chip:{display:"inline",marginLeft:"6px"}})));function cf(){return cf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cf.apply(this,arguments)}const uf=e=>{let{title:t="",chipLabel:r=0,onDelete:n,pathToTitle:a,onClick:o}=e;const i=sf(),l=Boolean(a&&a.length>2),s=l?Qg:dd.Y,c=l?{pathToTitle:a}:{value:t};return b().createElement("div",{className:i.container,onClick:o},l&&b().createElement(Qg,cf({placement:"bottom-start"},c),b().createElement("div",{className:i.parent},a[a.length-2])),b().createElement("div",{className:i.titleContainer},b().createElement(s,cf({placement:"bottom-start"},c),b().createElement("span",{className:i.title},t)),0!==r&&b().createElement("div",{className:i.chip},b().createElement(lf,{label:r,onDelete:n}))))};function pf(){return pf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pf.apply(this,arguments)}const df=(0,Op.Z)((()=>({facetContainer:{display:"flex",flexGrow:1,flexShrink:0,flexDirection:"column",padding:"0 16px",borderRadius:"1px",position:"relative",borderBottom:"solid 1px rgba(0,0,0, 0.33)","&:last-child":{borderBottom:"solid 1px rgb(255,255,255)"}},openedFacetContainer:{paddingBottom:"15px"},closedFacetContainer:{paddingBottom:"5px"},iconButton:{"&:first-child":{marginLeft:"-16px",height:24,width:24},visibility:"hidden"},recommendedIcon:{width:"18px",height:"18px",marginRight:"6px",flexShrink:0},titleContainer:{display:"flex",flexDirection:"row",flexShrink:0,alignItems:"center",height:"42px",borderRadius:"1px","&:hover $iconButton":{visibility:"visible"},marginLeft:"-16px",paddingLeft:"16px"},expandIcon:{transition:"transform .15s ease",margin:"0 2px",color:"rgba(0, 0, 0, 0.54)"},expanded:{transform:"rotate(180deg)"},"@keyframes animate":{from:{background:"#FFFBEB"},"66%":{background:"#FFFBEB"},"100%":{background:"transparent"}},highlighted:{animationName:"$animate",animationDuration:"3s",animationIterationCount:1}}))),mf=(0,md.T)((e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return b().createElement("svg",pf({width:"13",height:"18",viewBox:"0 0 13 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},r),b().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},b().createElement("g",null,b().createElement("g",null,b().createElement("g",null,b().createElement("g",{transform:"translate(-3 -1)"},b().createElement("g",null,b().createElement("path",{fill:"#FF4081",d:"M5.833 10h3.75v6.667l-3.75 1.666z"}),b().createElement("path",{fill:"#CE0C4E",d:"M13.333 10v8.333l-3.75-1.666V10z"})),b().createElement("circle",{fill:"#FFC058",cx:"9.583",cy:"7.917",r:"6.25"}),b().createElement("circle",{fill:"#FFCD7B",cx:"9.583",cy:"7.917",r:"5.417"}),b().createElement("path",{fill:"#FFFBB5",d:"M8.333 11.667L5 8.462l.933-.898 2.4 2.308L13.4 5l.933.897z"})))))))})),yf=e=>{let{title:t,chipLabel:r,onDeleteChip:n,pathToTitle:a,onClose:o,children:i,isOpenByDefault:l=!0,isHighlighted:s=!1,isRecommended:c=!1}=e;const u=df(),[p,d]=(0,E.useState)(l),m=()=>{d(!p)};return b().createElement("div",{className:T()(u.facetContainer,{[u.openedFacetContainer]:p,[u.closedFacetContainer]:!p,[u.highlighted]:s}),"data-reltio-id":`search-facet-container-${t}`},b().createElement("div",{className:u.titleContainer},b().createElement(Cd.k,{tooltipTitle:po().text("Remove"),icon:_p(),onClick:o,className:u.iconButton,size:"XXS"}),c&&b().createElement(mf,{className:u.recommendedIcon,tooltipTitle:po().text("Recommended"),showForDisabled:!0}),b().createElement(uf,{title:t,pathToTitle:a,chipLabel:r,onDelete:n,onClick:m}),b().createElement(Zm,{onClick:m,isOpen:p,className:u.iconButton,size:"S",tooltipTitle:p?po().text("Collapse attribute"):po().text("Expand attribute"),tooltipPlacement:"bottom-end"})),p?i:null)},gf=(0,Op.Z)((()=>({control:{minHeight:"40px",backgroundColor:"rgba(0, 0, 0, 0.03)",height:"auto",padding:0},valueContainer:{margin:"4px 6px"},placeholder:{color:"rgba(0,0,0,0.6)",fontSize:"13px",letterSpacing:0,lineHeight:"15px",left:"16px",bottom:"14px"},dropdownIndicator:{margin:"0px 2px 0px 0px"}}))),ff=e=>{let{config:t,data:r=[],filteredData:n,values:a=[],isHighlighted:o,isRecommended:i,onSearch:l=R.identity,onChange:s,onClose:c}=e;const u=gf();return b().createElement(yf,{title:t.title,pathToTitle:t.pathToTitle,onClose:c,chipLabel:a.length,onDeleteChip:()=>s([]),isHighlighted:o,isRecommended:i},b().createElement(Yg,{values:a,defaultOptions:r,filteredOptions:n,onChange:s,getSuggestions:l,isClearable:!1,showBar:!1,showNumberInValue:!0,classes:u,placeholder:po().text("All values"),canLoadMore:!(0,Va.tW)(t)}))};var hf=r(19014),Ef=r(15608),bf=r.n(Ef);const vf=(0,Op.Z)((e=>({root:{borderRadius:4,padding:"15px 0"},rail:{backgroundColor:(0,km.alpha)(e.palette.primary.main,.12),borderRadius:4},thumb:{width:"14px",height:"14px",border:"1px solid #FFFFFF","&$focusVisible,&:hover":{boxShadow:`0px 0px 0px 9px ${(0,km.alpha)(e.palette.primary.main,.12)}`,"@media (hover: none)":{boxShadow:"none"}},"&$active":{boxShadow:`0px 0px 0px 9px ${(0,km.alpha)(e.palette.primary.main,.12)}`},"&::after":{left:-10,top:-10,right:-10,bottom:-10}},focusVisible:{},active:{},track:{borderRadius:4}}))),Tf=(0,Op.Z)((e=>({tooltipPlacementTop:{margin:"3px 0"},tooltip:{color:"#FFFFFF",fontSize:"9px",letterSpacing:0,lineHeight:"10px",textAlign:"right",padding:"3px 4px",backgroundColor:e.palette.primary.main,borderRadius:"4px"}}))),Of=e=>{let{children:t,open:r,value:n}=e;const a=Tf();return b().createElement(Gg(),{open:r,enterTouchDelay:0,placement:"top",title:n,classes:{tooltipPlacementTop:a.tooltipPlacementTop,tooltip:a.tooltip}},t)};function xf(){return xf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xf.apply(this,arguments)}Of.propTypes={children:hp().element.isRequired,open:hp().bool.isRequired,value:hp().string.isRequired};const Cf=e=>{let{min:t,max:r,range:n,onChange:a,onAfterChange:o,className:i}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["min","max","range","onChange","onAfterChange","className"]);const s=vf();return b().createElement("div",{className:i},b().createElement(bf(),xf({min:t,max:r,value:n,classes:{root:s.root,rail:s.rail,track:s.track,thumb:s.thumb},onChange:(e,t)=>{a&&a(t)},onChangeCommitted:(e,t)=>{o&&o(t)},valueLabelDisplay:"auto","aria-labelledby":"range-slider",components:{ValueLabel:Of},size:"small",component:"div"},l)))};Cf.propTypes={min:hp().oneOfType([hp().number,hp().string]).isRequired,max:hp().oneOfType([hp().number,hp().string]).isRequired,range:hp().array.isRequired,onChange:hp().func,onAfterChange:hp().func,className:hp().string};const Sf=Cf;var wf=r(18205),Af=r(19406),Rf=r(55484),_f=r(25556),If=r(3131),Nf=r(27741),Df=r(42400),Pf=r(11011);const kf=(0,Op.Z)((()=>({tooltip:{borderRadius:"1px",backgroundColor:"rgba(97,97,97,0.9)",padding:"8px"},number:{color:"#FFFFFF",fontSize:"11px",fontWeight:500,letterSpacing:0,lineHeight:"13px"},value:{opacity:.7,color:"#FFFFFF",fontSize:"10px",letterSpacing:0,lineHeight:"11px",marginTop:"4px"}}))),Lf=e=>{let{payload:t,formatter:r,active:n}=e;const a=kf();if(n){const{payload:{label:e},value:n}=t[0];return b().createElement("div",{className:a.tooltip},b().createElement("div",{className:a.number},r(n)),b().createElement("div",{className:a.value},e))}return null},Uf=(0,Op.Z)((()=>({barChart:{"& text":{stroke:"none",fill:"rgba(0, 0, 0, 0.54)",textAnchor:"end"},"& .recharts-yAxis":{fontSize:"10px",fill:"rgba(0, 0, 0, 0.54)",textAnchor:"end"},"& .recharts-xAxis .recharts-cartesian-axis-tick:first-child text":{fontSize:"10px",fill:"rgba(0, 0, 0, 0.54)",textAnchor:"start"},"& .recharts-xAxis .recharts-cartesian-axis-tick:last-child text":{fontSize:"10px",fill:"rgba(0, 0, 0, 0.54)",textAnchor:"end"},"& .recharts-cartesian-axis-line":{stroke:"rgba(0, 0, 0, 0.54)"}}})));function jf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ff=e=>{let{data:t=[],range:r=[],domain:n,color:a=O.theme.palette.primary.main,tickFormatterX:o,tickFormatterY:i}=e;const l=Uf(),[s,c]=(0,E.useState)(null),u=(e,t)=>(s===t?.2:0)+((e=>{let{value:t}=e;return t[0]>=r[0]&&t[1]<=r[1]})(e)?.6:.2),p=t.map(((e,t,r)=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jf(e,t,r[t])}))}return e}({},e,{value:t<r.length-1?e.value[0]:e.value[1]}))),d=e=>{e.isTooltipActive?c(e.activeTooltipIndex):c(null)};return b().createElement(wf.h,null,b().createElement(Af.v,{data:p,margin:{top:12,right:0,left:0,bottom:0},onMouseEnter:d,onMouseLeave:d,onMouseMove:d,className:l.barChart},b().createElement(Rf.q,{vertical:!1,stroke:"#f2f2f2"}),b().createElement(_f.K,{dataKey:"value",interval:0,padding:{left:4,right:4},height:15,tickLine:!1,ticks:n,tick:e=>{const{x:t,y:r,index:n,payload:{value:a,offset:i}}=e;return b().createElement("text",{x:0===n?t-i:t+i,y:r+4,textAnchor:0===n?"start":"end"},`${o(a)}`)}}),b().createElement(If.B,{width:38,domain:[0,"auto"],axisLine:!1,tickLine:!1,tickSize:0,tickMargin:4,tickCount:6,tickFormatter:i}),b().createElement(Nf.u,{cursor:{fill:"rgb(255,255,255)"},content:b().createElement(Lf,{formatter:i}),isAnimationActive:!1}),b().createElement(Df.$,{dataKey:"number",isAnimationActive:!1},t.map(((e,t)=>b().createElement(Pf.b,{key:`cell-${t}`,fill:a,fillOpacity:u(e,t)}))))))},Mf="NumericRangeFacet-styles-numberEditorInputRoot--djW3k",Vf="NumericRangeFacet-styles-numberEditorRoot--DVXqx",Bf="NumericRangeFacet-styles-input--Nl2tx";function zf(){return zf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zf.apply(this,arguments)}class Hf extends E.PureComponent{constructor(){super(...arguments),this.state={range:[],data:[],values:[],lowerBound:0,upperBound:0},this.handleOnChangeValue=e=>{if(!this.props.onChange)return;const{data:t,values:r}=this.props,{rangeService:n}=this.state,[a,o]=n.getBarDomain(t),i=n.adjustRange(e,a,o);0!==r.length&&n.equals(i[0],(0,R.path)([0,0],r))&&n.equals(i[1],(0,R.path)([0,1],r))||this.props.onChange([i])},this.onLowerBoundChanged=e=>{const{range:t,NumMath:r,isFloating:n}=this.state;this.setState({lowerBound:n?e:r.toFixed(e,0)},(()=>{const a=(0,R.head)(this.props.data).value[0],o=""===e||isNaN(e)?a:e,i=r.clamp(a,t[1],n?o:r.floor(o));this.setState((e=>({lowerBound:i.toString(),range:[i,e.range[1]]}))),this.handleOnChangeValue([i,t[1]])}))},this.onUpperBoundChanged=e=>{const{range:t,NumMath:r,isFloating:n}=this.state;this.setState({upperBound:n?e:r.toFixed(e,0)},(()=>{const a=(0,R.last)(this.props.data).value[1],o=""===e||isNaN(e)?a:e,i=r.clamp(t[0],a,n?o:r.ceil(o));this.setState((e=>({upperBound:i.toString(),range:[e.range[0],i]}))),this.handleOnChangeValue([t[0],i])}))},this.onChangeRange=e=>{const{isFloating:t,NumMath:r}=this.state,n=e.map((e=>t?e:r.toFixed(this.revertScale(e),0)));this.setState({range:n,lowerBound:n[0],upperBound:n[1]})},this.onRevertedChange=e=>{const{isFloating:t,NumMath:r}=this.state,n=e.map((e=>t?e:r.toFixed(this.revertScale(e),0)));this.handleOnChangeValue(n)},this.applyScale=e=>{const{isScaled:t,scale:r,rangeService:n}=this.state;return t?n.applyScale(e,r):e},this.revertScale=e=>{const{isScaled:t,scale:r,rangeService:n}=this.state;return t?n.revertScale(e,r):e},this.onFocus=e=>e.target.select()}static getDerivedStateFromProps(e,t){if(e.data!==t.data||e.values!==t.values){const{config:t,values:r,data:n}=e,a=t.attrType&&t.attrType.type,o="Long"===a,i=(0,Fl.C)(a),l=(0,lo.Oz)(a),s=i.getRange(r,n);return{range:s,data:n,values:r,lowerBound:s.length>0?s[0].toString():0,upperBound:s.length>0?s[1].toString():0,NumMath:l,rangeService:i,isScaled:o,isFloating:(0,O.isFloatingType)(a),scale:n.length>0?i.calcScale(...i.getBarDomain(n)):{ratio:1,offset:0}}}return null}render(){const{config:e,data:t,isHighlighted:r,isRecommended:n,onClose:a,numberFormat:o}=this.props,{isScaled:i,scale:l,range:s,lowerBound:c,upperBound:u,rangeService:p,isFloating:d}=this.state,m=i?p.bigNumbersTickFormatterX(p.formatNumberForRangeFacet,l):p.formatNumberForRangeFacet,y=t.map((e=>({value:e.value.map(this.applyScale),label:e.value.map(p.formatNumberForRangeFacet).join(" - "),number:e.number}))),g=s.map((e=>+this.applyScale(e))),[f,h]=p.getBarDomain(t).map((e=>this.applyScale(e)));return b().createElement(yf,{title:e.title,pathToTitle:e.pathToTitle,onClose:a,isHighlighted:r,isRecommended:n},b().createElement("div",{className:"NumericRangeFacet-styles-data--kL9q5"},y.length>0?b().createElement(b().Fragment,null,b().createElement("div",{className:"NumericRangeFacet-styles-barChartContainer--t9NkG","data-reltio-id":"search-bar-chart-with-selection"},b().createElement(Ff,{data:y,range:g,tickFormatterX:m,tickFormatterY:p.formatNumberForRangeFacet,domain:[f,h]})),b().createElement(Sf,{min:f,max:h,range:g,onAfterChange:this.onRevertedChange,onChange:this.onChangeRange,className:"NumericRangeFacet-styles-slider--XbmKe",valueLabelFormat:m,step:d?(h-f)/200:1}),b().createElement("div",{className:"NumericRangeFacet-styles-inputsContainer--mU0_m"},b().createElement(hf.c,{value:c,onChange:this.onLowerBoundChanged,onFocus:this.onFocus,integer:!d,format:o,variant:"filled",classes:{root:Vf},InputProps:{classes:{root:Mf,input:Bf}}}),b().createElement(hf.c,{value:u,onChange:this.onUpperBoundChanged,onFocus:this.onFocus,integer:!d,format:o,variant:"filled",classes:{root:Vf},InputProps:{classes:{root:Mf,input:Bf}}}))):b().createElement(Hy.K,{variant:"noData"})))}}Hf.propTypes={data:hp().array,values:hp().array,config:hp().object,isHighlighted:hp().bool,isRecommended:hp().bool,onClose:hp().func,onChange:hp().func,numberFormat:hp().shape({decimalSeparator:hp().string,thousandSeparator:hp().string,prefix:hp().string,suffix:hp().string,decimalScale:hp().number})},Hf.defaultProps={config:{},data:[],values:[]};const Yf=(0,Ep.connect)((e=>({numberFormat:P().selectors.getUiNumberFormat(e)})))((e=>{const t=t=>{let{config:r,values:n,data:a,onChange:o,numberFormat:i}=t,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["config","values","data","onChange","numberFormat"]);const s=(0,Ep.useSelector)(P().selectors.getAttributesPresentation),{strategy:c}=(0,O.getNumberFormat)((0,O.getAttrDataTypeDefinition)(r.attrType),s,O.intl.getLocale()),u=(0,E.useMemo)((()=>null==a?void 0:a.map((0,R.evolve)({value:(0,R.map)((0,O.applyPresentationStrategyToValue)(c))}))),[a,c]),p=(0,E.useMemo)((()=>null==n?void 0:n.map((0,O.mapFilterValue)((0,O.applyPresentationStrategyToValue)(c)))),[n,c]),d=(0,E.useCallback)((e=>{const t=null==e?void 0:e.map((0,O.mapFilterValue)((0,O.revertPresentationStrategyForValue)(c)));o(t)}),[c,o]);return b().createElement(e,zf({data:u,values:p,onChange:d,config:r,numberFormat:i&&(0,R.omit)(["strategy",i])},l))};return t.displayName="WithCustomizedData",t})(Hf));var Wf=r(21669);const Gf=(0,Op.Z)((()=>({container:{display:"flex",flexGrow:1,whiteSpace:"nowrap",cursor:"default",width:"100%"},dateEditor:{margin:0,width:"50%",whiteSpace:"normal","&:first-child":{marginRight:"4px"},"& .MuiInputAdornment-root":{paddingRight:0}}})));function qf(){return qf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qf.apply(this,arguments)}const Zf=(e,t)=>(0,R.pathOr)(null,[t],e),$f=e=>e&&new Date(e),Kf=e=>e&&e.getTime(),Xf=e=>{let{values:t,minDate:r,maxDate:n,onChange:a}=e;const[o,i]=(0,E.useState)(null),[l,s]=(0,E.useState)(null),c=(0,E.useRef)((0,$e.x0)()),u=(0,E.useRef)((0,$e.x0)()),p=Gf();b().useEffect((()=>{i(Zf(t,0)),s(Zf(t,1))}),[t]);const d=(e,t)=>{(0,R.isNil)(e)||(0,R.isNil)(t)||a(e>t?[[t,e]]:[[e,t]])},m={minDate:$f(r),maxDate:$f(n)};return b().createElement("div",{className:p.container},b().createElement(Wf.Q,qf({label:po().text("Start Date"),value:$f(o),onChange:e=>{const t=Kf(e);i(t),d(t,l)},slotProps:{textField:{id:c.current,className:p.dateEditor}}},m)),b().createElement(Wf.Q,qf({label:po().text("End Date"),value:$f(l),onChange:e=>{const t=Kf(e);s(t),d(o,t)},slotProps:{textField:{id:u.current,className:p.dateEditor},popper:{placement:"bottom-end"}}},m)))};function Qf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Jf=e=>t=>e===O.DataTypes.TYPE_DATE?O.utils.dates.toLocalDate(t).getTime():t,eh=(0,Op.Z)({barChartContainer:{position:"relative",height:"190px",paddingTop:"6px",width:"100%",overflow:"hidden"},dateRangeChooserWrapper:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"12px",width:"100%"}}),th=(0,Fl.C)(),rh=e=>{let{data:t=[],values:r=[],config:n,onChange:a,isHighlighted:o,isRecommended:i,onClose:l}=e;const s=eh(),c=(0,R.path)(["attrType","type"],n),u=(0,E.useCallback)((e=>{const n=e.map((0,O.mapFilterValue)((o=c,e=>o===O.DataTypes.TYPE_DATE?O.utils.dates.toUtcDate(e).getTime():e)));var o;if(!(0,R.equals)(r,n)){const[e,r]=th.getBarDomain(t),o=c===O.DataTypes.TYPE_DATE,i=n.map((e=>[O.utils.dates.getStartOfDay(e[0],o),O.utils.dates.getEndOfDay(e[1],o)])),l=th.getRange(i,t);a([l.length?l:[e,r]])}}),[t,a,c,r]),p=(0,E.useMemo)((()=>{return t.map((e=c,t=>{if(Array.isArray(t.value)){const r=t.value.map(Jf(e));return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Qf(e,t,r[t])}))}return e}({},t,{value:r,label:r.map(O.formatDate).join(" - ")})}}));var e}),[t,c]),[d,m]=(0,E.useMemo)((()=>[th.getBarDomain(p),th.getRange(r.map((0,O.mapFilterValue)(Jf(c))),p)]),[p,c,r]);return b().createElement(yf,{title:n.title,pathToTitle:n.pathToTitle,onClose:l,isHighlighted:o,isRecommended:i},t.length>0?b().createElement(b().Fragment,null,b().createElement("div",{className:s.barChartContainer},b().createElement(Ff,{data:p,range:m,tickFormatterX:O.formatDate,tickFormatterY:th.formatNumberForRangeFacet,domain:d})),b().createElement("div",{className:s.dateRangeChooserWrapper},b().createElement(Xf,{values:m,onChange:u}))):b().createElement(Hy.K,{variant:"noData"}))};function nh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class ah{static getWidget(e){switch(e.type){case O.FACET_TYPES.ENTITY_TYPE_FACET:return tg;case O.FACET_TYPES.WITH_DROPDOWN_CHECKBOXES_FACET:return ff;case O.FACET_TYPES.NUMERIC_RANGE_FACET:return Yf;case O.FACET_TYPES.DATE_RANGE_FACET:return rh;default:return null}}static build(e){const t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){nh(e,t,r[t])}))}return e}({},ah.getDefaultConfig(),e),r=ah.getWidget(t);return r?(e=>{const r=Ly(e,t);return ah.connectData(r,t)})(r):null}}ah.getDefaultConfig=()=>({autofocus:!1,showDeleteButton:!0}),ah.connectData=(e,t)=>(0,Ep.connect)((e=>({data:(0,N.X7)(t,e),values:(0,N.N1)(t,e),filteredData:(0,N.VP)(t,e),isHighlighted:(0,N.$t)(t.fieldName,e),isRecommended:(0,N.TH)(t.fieldName,e)})))(e);const oh=(0,R.allPass)([(0,R.propSatisfies)(R.isEmpty,"configs"),(0,R.pathEq)(["group","hasCollapseButton"],!0)]),ih=(0,R.reject)(oh);var lh=r(66825),sh=r.n(lh);const ch=(0,Op.Z)({titleBox:{display:"flex",flexDirection:"row",flexShrink:0,lineHeight:"24px",paddingTop:"12px",paddingBottom:"8px",alignItems:"center",justifyContent:"space-between"},title:{color:"rgba(0,0,0,0.87)",display:"flex",flexGrow:1,alignItems:"center",fontSize:16,fontWeight:500,paddingLeft:16,letterSpacing:"0.15px",overflow:"hidden"},text:{},avatar:{marginRight:12,width:"32px",height:"32px"},collapseIcon:{marginRight:8},leftIcon:{flexShrink:0,marginRight:"20px"}}),uh=e=>{let{title:t="",iconSrc:r="",isOpen:n=!0,hasCollapseButton:a=!0,leftIcon:o,onCollapse:i}=e;const l=ch();return b().createElement("div",{className:l.titleBox},b().createElement("div",{className:l.title},o&&b().createElement("div",{className:l.leftIcon},o),r&&b().createElement(C(),{src:r,className:l.avatar}),b().createElement(dd.Y,{value:t},b().createElement("span",{className:l.text},t))),a&&b().createElement(Zm,{isOpen:n,onClick:i,className:l.collapseIcon,size:"S"}))};var ph=r(36631),dh=r(1230),mh=r.n(dh);const yh=e=>{let{facet:t,selectedFacets:r}=e;return!!r.find((e=>e.fieldName===t.fieldName||e.fieldName.includes(`${t.fieldName}.`)))},gh=e=>{let{facet:t,selectedFacets:r}=e;return yh({facet:t,selectedFacets:r})||(0,I.OP)(t)&&t.children&&t.children.some((e=>yh({facet:e,selectedFacets:r})))},fh=(0,Op.Z)({icon:{maxHeight:"25px",maxWidth:"25px",marginRight:"16px"}}),hh=e=>{let{group:t,metadata:r}=e;const n=fh(),a=(0,S.$H)(),o=(0,O.getEntityTypeGraphIcon)(r,{type:t.id}),i=(0,O.getAbsoluteImageUrl)(a,o);return b().createElement(tm,{className:n.icon,icon:i,avatarText:t.title[0]})};function Eh(){return Eh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Eh.apply(this,arguments)}const bh=e=>{let{onListItemClick:t,focusIndex:r,selectedFacets:n,metadata:a}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onListItemClick","focusIndex","selectedFacets","metadata"]);const i=(0,E.useRef)(null);i.current=n;const l=(0,E.useRef)(null);l.current=r;const s=(0,E.useCallback)(((e,r,n)=>{let{item:a,level:o,groupId:s}=r;const c=gh({facet:a,selectedFacets:i.current}),u=l.current===n;return b().createElement(hd,{key:`item-${s}-${a.fieldName}`,onClick:t,data:a,label:b().createElement(Ed.o,{text:a.title,highlight:a.filterText}),labelInText:a.title,level:o,style:e,index:n,checked:c,isFocused:u,groupId:s,LogoIcon:a.LogoIcon})}),[t]),c=(0,E.useCallback)(((e,t)=>b().createElement(oy(),{component:"div",className:"MoreFacetsPopup-styles-subHeader--h1vGz",style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&b().createElement(hh,{metadata:a,group:t.item}),t.item.title)),[a]),u=(0,E.useCallback)(((e,t)=>t.items?40:28),[]);return b().createElement(Gp,Eh({getItemSize:u,renderGroupTitle:c,renderItem:s,focusIndex:r},o,{disableHorizontalScrollbar:!0}))};bh.propTypes={focusIndex:hp().number,selectedFacets:hp().array,onListItemClick:hp().func,metadata:O.MetadataType};const vh=bh;function Th(){return Th=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Th.apply(this,arguments)}const Oh=574,xh=e=>{let{metadata:t,open:r,selectedFacets:n,data:a=[],onListItemClick:o,lastFacetClicked:i={},width:l,height:s=Oh}=e,c=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["metadata","open","selectedFacets","data","onListItemClick","lastFacetClicked","width","height"]);const[u,p]=(0,E.useState)(464),d=s-110;(0,E.useEffect)((()=>{p(d)}),[d]);const m=(0,E.useCallback)(((e,t)=>p((0,R.clamp)(56,d,t))),[d]),y=(0,E.useRef)();(0,E.useEffect)((()=>{const e=(0,R.path)(["current","updatePosition"],y);e&&e()}),[u]);const g=(0,E.useCallback)((function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return[{type:"item",item:e,moveTo:(0,R.has)("facetConfig")(i)&&i.facetConfig.fieldName===e.fieldName&&t===i.groupId,level:r,groupId:t}].concat(e.children?e.children.flatMap((e=>g(e,t,r+1))):[]).flat().filter((e=>!e.item.hide))}),[i]),f=(0,E.useCallback)((e=>e.map((e=>({type:"group",item:e,items:e.facets.filter((e=>!e.hide)).map((t=>g(t,e.id)))}))).filter((e=>e.items.length))),[g]),h=(0,E.useMemo)((()=>f(a)),[a,f]),v=(0,E.useMemo)((()=>(0,yo.LG)(h)),[h]),T=(0,E.useCallback)((e=>{let{item:t,groupData:r}=e;o(t,!gh({facet:t,selectedFacets:n}),r.groupId)}),[o,n]),{focusIndex:x,handleKeyDown:C}=qp({items:v,open:r,onSelectFocusedItem:T,selectedItems:n}),S=Math.max(l||(0,O.getMaxItemWidth)("title")(h),240);return b().createElement(Mp,Th({open:r,action:y,title:po().text("Select attribute"),containerWidth:S,searchInputOnKeyDown:C,containerHeight:110+u},c),b().createElement(vh,{focusIndex:x,selectedFacets:n,onListItemClick:o,metadata:t,containerWidth:S,items:v,height:u,onInnerContainerResize:m}),0===v.length&&b().createElement("div",{className:"MoreFacetsPopup-styles-noResultsCaptionContainer--ChfND"},b().createElement(Ay(),{variant:"caption",display:"block",gutterBottom:!0},po().text("No results found"))))};xh.propTypes={metadata:O.MetadataType,open:hp().bool,selectedFacets:hp().array,data:hp().array,onListItemClick:hp().func,lastFacetClicked:hp().shape({facetConfig:hp().object,groupId:hp().string}),width:hp().number,height:hp().number};const Ch=xh;function Sh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){wh(e,t,r[t])}))}return e}function wh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Ah extends E.PureComponent{constructor(e){super(e),this.state={filterText:"",lastFacetClicked:{},addedFacets:[]},this.showSearchInput=()=>this.searchInputRootRef.current.scrollIntoView(!0),this.openPopup=()=>this.props.dispatch(bo(!0)),this.closePopup=()=>{this.props.dispatch(bo(!1)),this.props.dispatch(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:k.k.HIGHLIGHT_ADDED_FACETS,payload:e}}(this.state.addedFacets)),this.setState({addedFacets:[]}),setTimeout((()=>{this.props.dispatch({type:k.k.CLEAR_HIGHLIGHT_ADDED_FACETS})}),3e3)},this.setFilterText=e=>this.setState({filterText:e,lastFacetClicked:{}}),this.clearFilterText=()=>this.setFilterText(""),this.setLastFacetClicked=e=>this.setState({lastFacetClicked:e}),this.resetLastFacetClicked=()=>this.setLastFacetClicked({}),this.filterItem=e=>{const{filterText:t=""}=this.state;return e.title.toLowerCase().includes(t.toLowerCase())},this.filterItemsTree=e=>this.filterItem(e)||(e.children||[]).some(this.filterItemsTree),this.getFilteredFacets=e=>(e||[]).map((e=>Sh({},e,{hide:!this.filterItemsTree(e),filterText:this.state.filterText}))).map((e=>{const t=this.getFilteredFacets(e.children);return(0,R.isEmpty)(t)?e:Sh({},e,{children:t})})),this.filterItemsInGroups=e=>e.map((e=>Sh({},e,{facets:this.getFilteredFacets(e.facets)}))),this.rejectNotAllowedEntityTypes=e=>t=>t.filter((t=>{let{id:r}=t;return!(0,O.isEntityTypeUri)(r)||e.includes(r)})),this.toggleSelectedFacet=(e,t)=>{const{facetsConfigs:r,selectedEntityTypes:n,dispatch:a}=this.props,o=(0,yo.jj)(e),i=t?r.concat(e).concat(o):r.filter((t=>t.fieldName!==e.fieldName)).filter((e=>!o.find((t=>t.fieldName===e.fieldName)))),l=(0,R.uniq)(i.filter((e=>e.entityTypeUri)).map((e=>e.entityTypeUri)).concat(n)),s=i.filter((0,R.complement)(I.OP)),c=s.filter((e=>!r.find((t=>t.fieldName===e.fieldName)))),u=r.filter((e=>!s.find((t=>e.fieldName===t.fieldName)))).map((e=>e.fieldName));(c.length||u.length)&&(this.setAddedFacets(c.map((0,R.prop)("fieldName")),u),a(io({facetsToAdd:c,fieldNamesToDelete:u,changedEntityTypes:(0,R.equals)(l,n)?null:l})))},this.setAddedFacets=(e,t)=>{const r=this.state.addedFacets.concat(e).filter((e=>!t.includes(e)));this.setState({addedFacets:r})},this.handleItemClick=(e,t,r)=>{this.setLastFacetClicked({facetConfig:e,groupId:r}),this.toggleSelectedFacet(e,t)},this.handlePopupClose=()=>{this.closePopup(),this.clearFilterText(),this.resetLastFacetClicked()},this.memoizedCollectFacetsList=(0,ph.Z)(I.tI),this.handleInputFocus=()=>{this.showSearchInput(),this.openPopup()},this.searchInputRootRef=b().createRef()}get inputWidth(){return this.searchInputRootRef.current?this.searchInputRootRef.current.getBoundingClientRect().width:0}render(){const{filterText:e,lastFacetClicked:t}=this.state,{open:r,recommendedFacets:n,classes:a,metadata:o,selectedEntityTypes:i,facetsConfigs:l,dataTenantObject:s,allowedEntityTypes:c,dataTenants:u}=this.props,p=l.map((e=>({fieldName:e.fieldName,uri:e.uri}))),d=this.memoizedCollectFacetsList(o,i,n,u),m=(0,R.pipe)((0,R.when)((0,R.always)(e),this.filterItemsInGroups),(0,R.when)((0,R.always)(c),this.rejectNotAllowedEntityTypes(c)),(0,U.Eb)(s))(d),{verticalOrigin:y,popupHeight:g}=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,n="top";if(e){const a=e.getBoundingClientRect(),o=r,i=window.innerHeight-r;if(a.top+t>i)if(a.bottom-t<o){const e=a.bottom-o,r=i-a.top;t=Math.max(e,r),n=e>r?"bottom":"top"}else n="bottom"}return{verticalOrigin:n,popupHeight:t}}(this.searchInputRootRef.current,Oh),f={vertical:y,horizontal:"right"};return b().createElement(E.Fragment,null,b().createElement(jp,{classes:{root:a.inputContainer},onSearch:this.setFilterText,onFocus:this.handleInputFocus,rootRef:this.searchInputRootRef,value:e,placeholder:po().text("Search & add attributes"),height:40,"data-reltio-id":"reltio-search-more-facets-search-input"}),b().createElement(Ch,{open:r,anchorEl:this.searchInputRootRef.current,metadata:o,selectedFacets:p,data:m,onClose:this.handlePopupClose,onListItemClick:this.handleItemClick,lastFacetClicked:t,width:this.inputWidth,height:g,onSearch:this.setFilterText,headerPlacement:"bottom"===y?"bottom":"top",anchorOrigin:f,transformOrigin:f,disableRestoreFocus:!0}))}}Ah.propTypes={metadata:O.MetadataType,open:hp().bool,facetsConfigs:hp().array,recommendedFacets:hp().array,selectedEntityTypes:hp().array,dispatch:hp().func,classes:hp().object,dataTenantObject:O.DataTenantType,allowedEntityTypes:hp().array,dataTenants:hp().arrayOf(O.DataTenantType)},Ah.defaultProps={selectedEntityTypes:[],facetsConfigs:[]};const Rh=(0,Ep.connect)((e=>({metadata:P().selectors.getMetadata(e),open:(0,Po.ds)(e),facetsConfigs:(0,N.Mp)(e),recommendedFacets:(0,N.ER)(e),selectedEntityTypes:(0,N.DX)(e),dataTenantObject:(0,so.t9)(e),allowedEntityTypes:(0,Po.Xf)(e),dataTenants:P().selectors.getDataTenants(e)})))(mh()((()=>({inputContainer:{margin:"4px 16px 16px",flexShrink:"0"}})))(Ah)),_h=(0,Op.Z)({facetGroupContainer:{display:"flex",flexShrink:0,flexDirection:"column","& + hr":{marginTop:8},"& + &":{marginTop:"8px"}}});function Ih(){return Ih=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ih.apply(this,arguments)}const Nh=e=>{let{hasSearchAttributesField:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["hasSearchAttributesField","children"]);const a=_h(),[o,i]=(0,E.useState)(!0);return b().createElement("div",{className:a.facetGroupContainer},b().createElement(uh,Ih({isOpen:o,onCollapse:e=>{i(!o)}},n)),t&&b().createElement(b().Fragment,null,b().createElement(Rh,null),b().createElement(sh(),null)),o&&r)},Dh=(0,Op.Z)({root:{display:"flex",flexShrink:0,flexDirection:"row",overflow:"hidden",alignItems:"center",marginBottom:"4px"},labelRoot:{fontSize:"13px",paddingLeft:"3px",cursor:"pointer",letterSpacing:"normal",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginRight:"16px"},checkboxRoot:{padding:"0",margin:"0 18px"},checkboxRootQueryGroups:{marginRight:9}}),Ph=e=>{let{variant:t="facetsPanel",searchOptions:r={},dispatch:n}=e;const{root:a,labelRoot:o,checkboxRoot:i,checkboxRootQueryGroups:l}=Dh(),s=r.searchByOv,c=(0,E.useCallback)((()=>{n(D.search.actions.updateSearchOptions({searchByOv:!s,ovOnly:!s}))}),[s,n]),u=po().text("Search by OV only");return b().createElement("div",{className:a,onClick:c},b().createElement(Xp(),{classes:{root:T()(i,{[l]:"queryGroups"===t})},checked:s,color:"primary"}),b().createElement(dd.Y,{value:u},b().createElement(Ay(),{variant:"body2",classes:{root:o}},u)))};Ph.propTypes={searchOptions:hp().shape({searchByOv:hp().bool,ovOnly:hp().bool}),variant:hp().oneOf(["facetsPanel","queryGroups"]),dispatch:hp().func};const kh=(0,Ep.connect)((e=>({searchOptions:P().selectors.getSearchOptions(e)})))(Ph);var Lh=r(8007),Uh=r(64927),jh=r.n(Uh),Fh=r(73707),Mh=r.n(Fh),Vh=r(93463),Bh=r.n(Vh);const zh=(0,Op.Z)((()=>({tenantFacet:{flexShrink:0},radioGroup:{padding:"0 15px 10px 20px",overflow:"hidden"},radioLabelRoot:{overflow:"hidden"},radioLabel:{paddingLeft:"12px",fontSize:"13px",lineHeight:"16px",overflowWrap:"break-word",wordWrap:"break-word",overflow:"hidden"},radioButton:{padding:"0 9px"},tenantContainer:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",marginBottom:"5px"},total:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"16px"}})));var Hh=r(19701);const Yh=e=>{let{tenantObject:t,isDataTenant:r,className:n}=e;const a=(e=>{let{tenantObject:t,isDataTenant:r}=e;const n=(0,Hh._)(),[a,o]=(0,E.useState)(0),i=(0,Ep.useSelector)(P().selectors.getGlobalSearchRequestOptions),l=r?t:null,s=(0,Ep.useSelector)((e=>(0,so.E2)(e,[],l))),c=JSON.stringify((0,Ma.Vg)(s,[],i)),u=(0,Ep.useSelector)(P().selectors.getDtssPath),p=(0,Ep.useSelector)(P().selectors.getTenant);return(0,E.useEffect)((()=>{n((0,Ma.Es)({url:$.jS,options:{method:"POST",body:c},customerTenant:p,dataTenant:(0,R.prop)("id",l),dtssPath:u})).then((e=>{let{total:t}=e;o(t)})).catch((e=>{console.warn(e)}))}),[l,p,u,c]),a})({tenantObject:t,isDataTenant:r});return b().createElement("div",{className:n},(0,lo.k7)(a))};Yh.propTypes={className:hp().string,tenantObject:hp().object.isRequired,isDataTenant:hp().bool};const Wh=Yh;function Gh(){return Gh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gh.apply(this,arguments)}const qh=e=>{let{customerTenantObject:t,currentTenant:r,dataTenants:n,changeCurrentTenant:a,openAdvancedSearch:o}=e;const i=zh(),l=(0,R.pipe)((0,R.map)((e=>{let{id:t,label:r}=e;return{value:t,label:r}})),(0,R.prepend)({value:t.id,label:t.name}))(n),s=e=>{const r=e!==t.id;return{isDataTenant:r,tenantObject:r?n.find((0,R.propEq)("id",e)):t}},c=r||t.id;return b().createElement("div",{className:i.tenantFacet},b().createElement(uh,{title:po().text("Tenants"),hasCollapseButton:!1}),b().createElement(Mh(),{className:i.radioGroup,value:c,onChange:(0,R.pipe)(bp.NA,s,a)},l.map((e=>{let{value:t,label:r}=e;return b().createElement("div",{className:i.tenantContainer,key:t},b().createElement(Bh(),{classes:{root:i.radioLabelRoot,label:i.radioLabel},value:t,label:r||t,control:b().createElement(jh(),{className:i.radioButton,color:"primary"})}),!o&&b().createElement(Wh,Gh({className:i.total},s(t))))}))))};qh.propTypes={customerTenantObject:hp().shape({id:hp().string,name:hp().string}),currentTenant:hp().string,dataTenants:hp().arrayOf(O.DataTenantType),changeCurrentTenant:hp().func,openAdvancedSearch:hp().bool};const Zh={changeCurrentTenant:e=>{let{tenantObject:t,isDataTenant:r}=e;return{type:L.Z.CHANGE_CURRENT_TENANT,payload:{tenantObject:t,isDataTenant:r}}}},$h=(0,Ep.connect)((e=>({dataTenants:P().selectors.getDataTenants(e),customerTenantObject:P().selectors.getTenantObject(e),currentTenant:(0,so.RO)(e),openAdvancedSearch:(0,Po.IJ)(e)})),Zh)(qh),Kh=(0,Op.Z)({root:{display:"flex",flexDirection:"column",overflow:"auto",height:"100%"}});function Xh(){return Xh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xh.apply(this,arguments)}const Qh=(0,O.memoizeWith)((e=>e.fieldName),ah.build),Jh=e=>{let{group:t,configs:r}=e;return b().createElement(Nh,Xh({},t,{key:t.title}),(e=>e.map((e=>({Facet:Qh(e),id:e.fieldName}))).filter((e=>{let{Facet:t}=e;return t})).map((e=>{let{Facet:t,id:r}=e;return b().createElement(t,{key:r})})))(r))};Jh.propTypes={group:hp().object,configs:hp().array};const eE=e=>{let{facetsConfigs:t=[],metadata:r,onScroll:n,uiConfigShowSearchByOv:a,showTenantFacet:o}=e;const{root:i}=Kh(),l=(0,E.useRef)(null),s=(0,E.useCallback)((e=>{n(l.current.scrollTop,e)}),[n]),c=((e,t)=>{const[r,n]=(0,R.partition)(O.isTypeFacet,t),a=[{group:{title:po().text("Entity types"),hasCollapseButton:!1},configs:r},{group:{title:po().text("Attributes"),hasCollapseButton:!1,hasSearchAttributesField:!0},configs:n}];return ih(a)})(0,t),u=(0,R.head)(c),p=(0,R.tail)(c),d=l.current,m=(0,E.useMemo)((()=>({element:d,priority:["top","bottom"]})),[d]);return b().createElement("div",{ref:l,className:i,onScroll:s},b().createElement(Lh.p.Provider,{value:m},a&&b().createElement(kh,null),o&&b().createElement(b().Fragment,null,b().createElement($h,null),b().createElement(sh(),null)),u&&Jh(u),b().createElement(sh(),null),p.map(((e,t)=>b().createElement(Jh,Xh({},e,{key:t}))))))};eE.propTypes={metadata:O.MetadataType,facetsConfigs:hp().array,onScroll:hp().func,dispatch:hp().func,uiConfigShowSearchByOv:hp().bool,showTenantFacet:hp().bool};const tE=(0,Ep.connect)((e=>{var t;const r=P().selectors.getDataTenants(e);return{metadata:P().selectors.getMetadata(e),facetsConfigs:(0,N.Mp)(e),uiConfigShowSearchByOv:null!==(t=P().selectors.getShowSearchByOv(e))&&void 0!==t?t:(0,Po.cC)(e),showTenantFacet:r&&r.length>0,tenant:P().selectors.getTenant(e)}}))(eE),rE=e=>{let{children:t,className:r}=e;return b().createElement("div",{className:T()("MainContent-styles-mainContent--Ha5me",r)},t)};rE.propTypes={children:hp().node,className:hp().string};const nE=rE;var aE=r(33788);const oE=(0,Op.Z)({container:{backgroundColor:"#fff",opacity:.37,position:"fixed",width:"100%",height:"100%",top:0,left:0,display:"flex",justifyContent:"center",alignItems:"center"}}),iE=()=>{const e=(0,Ep.useSelector)(Po.Kv),{container:t}=oE();return e?b().createElement("div",{className:t},b().createElement(aE.Z,{size:160})):null};var lE=r(54596),sE=r.n(lE),cE=r(49233),uE=r.n(cE),pE=r(35206),dE=r.n(pE),mE=r(81733),yE=r.n(mE),gE=r(68290),fE=r.n(gE);const hE=(0,Op.Z)((e=>({snackbar:{display:"flex",flexWrap:"nowrap",backgroundColor:"rgba(0,0,0,0.87)",boxShadow:"0 2px 4px 0 rgba(0,0,0,0.25)",padding:"8px 16px",minHeight:"48px","&:after":{content:'""',minHeight:"inherit",fontSize:0}},anchorSnackBar:{zIndex:11e3,"@media (min-width: 960px)":{bottom:8}},message:{color:"#FFFFFF",fontSize:14,fontWeight:500,lineHeight:"16px",display:"flex",alignItems:"center",flex:1},messageContent:{display:"flex",alignItems:"center",whiteSpace:"pre"},icon:{opacity:.9,marginRight:"12px"},[$.GT.error]:{backgroundColor:e.palette.error.dark}})));function EE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bE=()=>{const e=(0,Ep.useDispatch)(),t=(0,Ep.useSelector)(Po.v6),r=(0,Ep.useSelector)(P().selectors.getAutoCloseInterval),n=t&&t.payload.autoHideDuration||r&&1e3*r||5e3,a=hE(),o=(0,E.useRef)(null),i=(0,E.useCallback)((()=>{e(wo())}),[e]);t&&(o.current=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){EE(e,t,r[t])}))}return e}({},t));const{type:l,payload:s}=o.current||{},{message:c,action:u}=s||{},p=u&&u.actionToDispatch,d=(0,E.useCallback)((()=>{p&&e(p)}),[p,e]),m=(0,E.useMemo)((()=>l===$.GT.error?b().createElement(uE(),{key:"close","aria-label":"Close",color:"inherit",className:a.close,onClick:d,size:"large"},b().createElement(_p(),null)):u?b().createElement(dE(),{color:"primary",size:"small",onClick:d},u.actionLabel):null),[a,l,u,d]);return b().createElement(yE(),{container:document.body},b().createElement(sE(),{key:c+l,anchorOrigin:{vertical:"bottom",horizontal:"center"},autoHideDuration:n,open:Boolean(t),onClose:i,ContentProps:{classes:{root:T()(a.snackbar,a[l]),message:a.message}},message:b().createElement("div",{className:a.messageContent},l===$.GT.error&&b().createElement(fE(),{className:a.icon}),c),classes:{anchorOriginBottomCenter:a.anchorSnackBar},action:m}))},vE=(0,Op.Z)((()=>({resizablePanesWrapper:{flex:"1 0 0px"},pane:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",overflow:"hidden"},divider:{height:"1px"}})));var TE=r(31396);const OE=(0,Op.Z)((()=>({container:{position:"relative","& .Resizer":{zIndex:1,boxSizing:"border-box",backgroundClip:"padding-box","&.disabled":{cursor:"initial",height:0,margin:0},"&.horizontal":{height:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"100% 1px",backgroundPosition:"top",width:"100%",marginBottom:"-10px","&.disabled":{background:"transparent"},"&:not(.disabled):hover":{cursor:"row-resize",backgroundImage:"linear-gradient(rgba(0, 114, 206, 0), rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1))",backgroundSize:"100% 3px"}},"&.vertical":{width:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"1px 100%",backgroundPosition:"left",height:"100%",marginRight:"-10px","&:not(.disabled):hover":{cursor:"col-resize",backgroundImage:"linear-gradient(to left, rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1), rgba(0, 114, 206, 0.35))",backgroundSize:"3px 100%"}}}}}))),xE=250,CE=e=>"horizontal"===e,SE=e=>{let{className:t,children:r,orientation:n,primary:a,defaultSize:o,size:i,minSize:l,maxSize:s,allowResize:c,debounceInterval:u=xE,onChange:p}=e;const d=OE(),m=(0,km.useTheme)(),[y,g]=(0,E.useState)(null),[f,h]=(0,E.useState)(!0),v=(0,E.useCallback)((()=>h(!0)),[]),x=(0,E.useCallback)((()=>h(!1)),[]),C=()=>CE(n)?null==y?void 0:y.clientHeight:null==y?void 0:y.clientWidth,S=(0,E.useCallback)((0,O.debounce)((e=>{const t=C();p({percentageSize:e/t*100+"%",isMaxSize:+s>0?e===s:e===t+s,isMinSize:e===l,size:e})}),u),[p,n,s,y]),w=(0,E.useMemo)((()=>({transition:m.transitions.create(CE(n)?"height":"width",{easing:m.transitions.easing.sharp,duration:m.transitions.duration.leavingScreen})})),[n,m]);return"number"==typeof i&&i<0&&(i=(C()||0)+i),b().createElement("div",{ref:g,className:T()(d.container,t)},b().createElement(TE.Z,{split:n,size:i,primary:a,allowResize:c,onChange:S,defaultSize:o,minSize:l,maxSize:s,onDragStarted:x,onDragFinished:v,pane1Style:f?w:void 0},r))};SE.displayName="ResizablePanes";const wE=(0,Op.Z)({"entityType-overflow":{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},"entityType-small":{padding:"1px 4px",fontSize:"10px",lineHeight:"normal",marginRight:"12px",borderRadius:"2px",flexShrink:0},"entityType-medium":{padding:"2px 8px 3px",borderRadius:"2px",fontSize:"13px",fontWeight:500,lineHeight:"15px",marginRight:"16px",flexShrink:0}}),AE=e=>{let{entity:t,className:r,size:n="small"}=e;const a=wE(),o=(0,S.AH)(),i=(0,O.getEntityType)(o,t.type),l=(i?(0,O.getPropWithInheritance)(o,i,"typeColor"):null)||O.theme.palette.primary.main,s=(0,O.getEntityTypeLabel)(o,t);return b().createElement(dd.Y,{value:s,placement:"top"},b().createElement(Ay(),{style:{backgroundColor:l,color:O.utils.Colors.getColor(l)?"#FFFFFF":"#212121"},className:T()(a[`entityType-${n}`],a["entityType-overflow"],r),component:"div"},s))},RE=e=>e&&e.scrollIntoView({block:"end",behavior:"smooth"}),_E=e=>{e&&clearTimeout(e)},IE=(e,t)=>{if(e&&t){const r=e.offsetTop,n=e.offsetTop+e.clientHeight,{clientHeight:a,scrollTop:o}=t;return r>=0&&n>o&&n<o+a}};var NE=r(55962);const DE=(0,Op.Z)((e=>({"@keyframes animate":{from:{background:"transparent"},"66%":{background:"#f2e68e"},"100%":{background:"transparent"}},highlighted:{animationName:"$animate",animationDuration:"3s",animationIterationCount:1},item:{display:"flex",minHeight:"40px",borderBottom:"1px solid rgba(0, 0, 0, 0.1)",flexDirection:"row","&:after":{content:"",minHeight:"inherit",fontSize:0},"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"}},clickable:{cursor:"pointer"},selected:{background:(0,km.alpha)(e.palette.primary.main,.12),"&:hover":{background:(0,km.alpha)(e.palette.primary.main,.24)}},inactive:{background:e.inactiveBackground,"&:hover":{background:e.inactiveHoverBackground},"&$selected":{background:e.inactiveSelectedBackground,"&:hover":{background:e.inactiveSelectedHoverBackground}}},justImported:{backgroundColor:"#FFFBEB !important"},avatar:{marginLeft:"20px"},image:{height:"32px",width:"32px",marginTop:"8px",marginBottom:"7px"},info:{marginLeft:"20px",flexGrow:1,display:"flex",flexDirection:"column",justifyContent:"center",fontSize:"13px",width:"100%",overflow:"hidden",overflowWrap:"break-word",wordWrap:"break-word"},label:{fontSize:"13px",lineHeight:"15px",fontWeight:500,color:e.palette.primary.main,marginRight:"17px",textDecoration:"none"},secondaryLabel:{marginRight:"12px"},businessCard:{color:"rgba(0, 0, 0, 0.54)"},secondRow:{display:"flex",marginTop:"2px",alignItems:"center",color:"rgba(0, 0, 0, 0.54)",fontSize:"12px"}}))),PE=e=>{let{entities:t,entityToHighlight:r,selectedEntityUri:n,onEntityClick:a,onEntityHover:o,entitiesImportStatus:i,entityButtonsRenderer:l}=e;const s=DE(),c=(0,E.useRef)(null),u=(0,E.useRef)(null),p=(0,S.AH)();return(0,NE.D)((()=>{if(r){var e;const n=null===(e=c.current)||void 0===e?void 0:e.querySelectorAll(`[data-entity-uri='${r}']`);if(_E(u.current),(null==n?void 0:n.length)>0){var t;const e=null===(t=c.current)||void 0===t?void 0:t.parentElement;IE(n[0],e)||(RE(n[0]),u.current=setTimeout((()=>{IE(n[0],e)||RE(n[0])}),1e3))}}return()=>{_E(u.current)}}),[r]),b().createElement("div",{ref:c},(t||[]).map((e=>{const t=(0,O.getLabel)(e.label),c=e.secondaryLabel,u=(0,O.getBusinessCardAttributesText)(p,e),d=(0,O.isActiveObject)(e),m=e.uri,y=(0,O.getEntityUriForLink)(e),g=(0,R.prop)(m,i);return b().createElement("div",{key:m,className:T()(s.item,{[s.clickable]:!!a,[s.selected]:m===n,[s.highlighted]:m===r,[s.inactive]:!d,[s.justImported]:g===Cm.SUCCESS}),onClick:a?()=>a(m):void 0,onMouseEnter:o?()=>o(m):void 0,onMouseLeave:o?()=>o(null):void 0,"data-entity-uri":m},b().createElement(w,{entity:e,avatarClassName:s.avatar,imageClassName:s.image}),b().createElement("div",{className:s.info},b().createElement("div",null,b().createElement(Wd,{value:y,className:s.label},t),c&&b().createElement("span",{className:s.secondaryLabel},c," "),u&&b().createElement("span",{className:s.businessCard},u)),b().createElement("div",{className:s.secondRow},b().createElement(AE,{entity:e}),b().createElement("div",null,(0,O.getEntityId)(e)))),l&&l(e))})))};var kE=r(92255);function LE(){return LE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},LE.apply(this,arguments)}function UE(){return UE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},UE.apply(this,arguments)}function jE(){return jE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jE.apply(this,arguments)}function FE(){return FE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},FE.apply(this,arguments)}const ME=(0,Op.Z)((e=>({root:{display:"flex",flex:"1 1 auto",flexWrap:"nowrap",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"10px",overflow:"auto",height:"100%",minHeight:"350px",boxSizing:"border-box","&$root_small":{minHeight:"160px"},"& $text":{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"24px",letterSpacing:"0.25px",textAlign:"center"},"& $secondaryText":{color:e.palette.text.secondary,fontSize:"15px",fontWeight:300,lineHeight:"18px",letterSpacing:"0.11px",textAlign:"center",paddingTop:"3px"}},root_small:{},embedded:{flexShrink:0,width:"190px",height:"190px",padding:"8px"},full:{width:"256px",height:"256px"},textBox:{display:"flex",flexDirection:"column",alignItems:"center",maxWidth:500,marginTop:"16px"},text:{},secondaryText:{},button:{minHeight:36,minWidth:64,maxWidth:500,padding:"10px 16px",borderRadius:"2px",boxShadow:"0 0 2px 0 rgba(0,0,0,0.12), 0 2px 2px 0 rgba(0,0,0,0.24), 0 0 8px 0 rgba(0,0,0,0.12), 0 8px 8px 0 rgba(0,0,0,0.24)",fontSize:"14px",fontWeight:500,lineHeight:"16px",marginTop:"24px"}})));function VE(){return VE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},VE.apply(this,arguments)}let BE=function(e){return e.full="full",e.embedded="embedded",e.small="small",e}({});const zE={SEARCH_RESULTS:e=>b().createElement("svg",LE({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),b().createElement("defs",null,b().createElement("radialGradient",{cx:"50%",cy:"100%",fx:"50%",fy:"100%",r:"81.681%",gradientTransform:"matrix(.98998 0 0 .612 .005 .388)",id:"EmptySearchResults_svg__c"},b().createElement("stop",{stopColor:"#00BFFF",stopOpacity:.5,offset:"0%"}),b().createElement("stop",{stopColor:"#9EE8FF",stopOpacity:0,offset:"100%"})),b().createElement("radialGradient",{cx:"50%",cy:"111.651%",fx:"50%",fy:"111.651%",r:"87.693%",gradientTransform:"matrix(0 -.97693 .7263 0 -.31 1.605)",id:"EmptySearchResults_svg__f"},b().createElement("stop",{stopColor:"#91F8E5",stopOpacity:.6,offset:"0%"}),b().createElement("stop",{stopColor:"#14F7FF",stopOpacity:0,offset:"100%"})),b().createElement("radialGradient",{cx:"50%",cy:"103.659%",fx:"50%",fy:"103.659%",r:"90.207%",gradientTransform:"matrix(0 -1 2.23905 0 -1.821 1.537)",id:"EmptySearchResults_svg__g"},b().createElement("stop",{stopColor:"#FFF",offset:"0%"}),b().createElement("stop",{stopColor:"#73FAFF",stopOpacity:.21,offset:"59.38%"}),b().createElement("stop",{stopColor:"#14F7FF",stopOpacity:0,offset:"100%"})),b().createElement("linearGradient",{x1:"50%",y1:"170.771%",x2:"50%",y2:"10.303%",id:"EmptySearchResults_svg__e"},b().createElement("stop",{stopColor:"#91F8E5",offset:"0%"}),b().createElement("stop",{stopColor:"#99FCFF",stopOpacity:0,offset:"100%"})),b().createElement("filter",{x:"-25.9%",y:"-26.2%",width:"151.8%",height:"152.3%",filterUnits:"objectBoundingBox",id:"EmptySearchResults_svg__d"},b().createElement("feGaussianBlur",{stdDeviation:15,in:"SourceGraphic"})),b().createElement("circle",{id:"EmptySearchResults_svg__a",cx:128,cy:128,r:128})),b().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},b().createElement("mask",{id:"EmptySearchResults_svg__b",fill:"#fff"},b().createElement("use",{xlinkHref:"#EmptySearchResults_svg__a"})),b().createElement("use",{fillOpacity:.2,fill:"#A792CD",xlinkHref:"#EmptySearchResults_svg__a"}),b().createElement("g",{mask:"url(#EmptySearchResults_svg__b)"},b().createElement("g",{transform:"translate(56 34)"},b().createElement("g",{opacity:.9,strokeWidth:1,fill:"#FFF"},b().createElement("path",{d:"M0 6.99C0 3.13 3.137 0 7 0h247.067c3.866 0 7 3.144 7 6.99v169.353c0 3.86-3.137 6.99-7 6.99H7c-3.866 0-7-3.143-7-6.99V6.99z"}),b().createElement("path",{d:"M13 25.99c0-3.86 3.137-6.99 7-6.99h247.067c3.866 0 7 3.144 7 6.99v169.353c0 3.86-3.137 6.99-7 6.99H20c-3.866 0-7-3.143-7-6.99V25.99z",opacity:.4})),b().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 45.833)"},b().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),b().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),b().createElement("path",{d:"M10.334 1.091c5.707 0 10.334 4.627 10.334 10.334v.067c0 5.707-4.627 10.333-10.334 10.333S0 17.2 0 11.492v-.067C0 5.718 4.627 1.091 10.334 1.091z",fill:"#E3EBF4"}),b().createElement("path",{d:"M35.365.861h69.768a3.82 3.82 0 010 7.639H35.365a3.82 3.82 0 010-7.639z",fill:"#B1AABD",opacity:.5}),b().createElement("path",{d:"M34.274 15.048h126.164a2.728 2.728 0 010 5.456H34.274a2.728 2.728 0 110-5.456z",fill:"#B1AABD",opacity:.43}),b().createElement("path",{d:"M33.182 24.869H73.89a1.637 1.637 0 110 3.274H33.182a1.637 1.637 0 010-3.274z",fill:"#B1AABD",opacity:.2})),b().createElement("rect",{fill:"#645F6D",opacity:.5,x:21.756,y:17.46,width:87.022,height:12.004,rx:6.002}),b().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 87.302)"},b().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),b().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),b().createElement("rect",{fill:"#E3EBF4",x:0,y:1.091,width:20.668,height:20.734,rx:10.334}),b().createElement("path",{d:"M35.365.861h82.647a3.82 3.82 0 010 7.639H35.365a3.82 3.82 0 010-7.639z",fill:"#B1AABD",opacity:.5}),b().createElement("path",{d:"M34.274 15.048H174.58a2.728 2.728 0 010 5.456H34.274a2.728 2.728 0 110-5.456z",fill:"#B1AABD",opacity:.43}),b().createElement("path",{d:"M33.182 24.869h113.119a1.637 1.637 0 110 3.274H33.182a1.637 1.637 0 010-3.274z",fill:"#B1AABD",opacity:.2})),b().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 128.77)"},b().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),b().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),b().createElement("path",{d:"M10.334 1.091c5.707 0 10.334 4.627 10.334 10.334v.067c0 5.707-4.627 10.333-10.334 10.333S0 17.2 0 11.492v-.067C0 5.718 4.627 1.091 10.334 1.091z",fill:"#E3EBF4"}),b().createElement("path",{d:"M35.365.861h110.929a3.82 3.82 0 010 7.639H35.365a3.82 3.82 0 010-7.639z",fill:"#B1AABD",opacity:.5}),b().createElement("path",{d:"M34.274 15.048h92.443a2.728 2.728 0 010 5.456H34.274a2.728 2.728 0 110-5.456z",fill:"#B1AABD",opacity:.43}),b().createElement("path",{d:"M33.182 24.869H73.89a1.637 1.637 0 110 3.274H33.182a1.637 1.637 0 010-3.274z",fill:"#B1AABD",opacity:.2})))),b().createElement("g",{mask:"url(#EmptySearchResults_svg__b)"},b().createElement("path",{fill:"#446275",d:"M72.246 84.033l8.66 5-35.5 61.488-8.66-5-12.556-24.729-51.307-29.622 20.431-35.388 50.648 29.242z"}),b().createElement("path",{d:"M62.906 120.21l-80.091-46.24 10.5-18.188 50.647 29.242 28.284-.99 8.66 5-18 31.176z",fillOpacity:.2,fill:"#FFF"}),b().createElement("path",{d:"M27.566 75.558L3.877 109.065l-5.013-2.895 26.045-32.146 2.657 1.534zm9.467 5.466L13.345 114.53l-5.014-2.895L34.377 79.49l2.656 1.534zm8.158 4.71l-22.32 34.297-5.013-2.895L43.903 84.99l1.288.744z",fill:"#527585"}),b().createElement("path",{d:"M11.524 90.544l13.385-16.52 2.657 1.534-12.174 17.22-3.868-2.234zm9.467 5.467L34.377 79.49l2.656 1.534-12.174 17.22-3.868-2.233zm9.527 5.5L43.903 84.99l1.288.744-11.47 17.626-3.203-1.85z",fill:"#76A2B5",opacity:.6}),b().createElement("path",{d:"M.355 59.848l-23.689 33.507-5.013-2.895 26.045-32.146 2.657 1.534zm9.468 5.466L-13.866 98.82l-5.013-2.895L7.166 63.78l2.657 1.534zm8.158 4.71L-4.34 104.32l-5.014-2.895L16.692 69.28l1.289.744z",fillOpacity:.1,fill:"#000"}),b().createElement("g",null,b().createElement("path",{fill:"url(#EmptySearchResults_svg__c)",opacity:.993,filter:"url(#EmptySearchResults_svg__d)",d:"M.63 0h173.74L123 172H52z",transform:"rotate(120 90.404 138.861)"}),b().createElement("path",{fill:"url(#EmptySearchResults_svg__e)",opacity:.3,d:"M4 9h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),b().createElement("path",{fill:"url(#EmptySearchResults_svg__f)",opacity:.3,d:"M4 2h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),b().createElement("path",{fill:"url(#EmptySearchResults_svg__g)",d:"M4 9h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),b().createElement("path",{fill:"#FFF",opacity:.196,d:"M212.363 205.344l-1 1.732L60.418 124.52l4.977-8.62z"})),b().createElement("path",{fill:"#76A2B5",d:"M73.112 84.533l-35.5 61.488-.866-.5 35.5-61.488z"}),b().createElement("path",{fill:"#F3F3F3",d:"M80.906 89.033l-35.5 61.488-.866-.5 35.5-61.488z"}),b().createElement("path",{fill:"#538196",d:"M55.112 115.71l-17.5 30.311-.866-.5 17.5-30.31z"})))),SELECT_ATTRIBUTES:e=>b().createElement("svg",UE({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),b().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.1}),b().createElement("mask",{id:"SelectAttributes_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},b().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),b().createElement("g",{mask:"url(#SelectAttributes_svg__a)"},b().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#SelectAttributes_svg__paint0_linear_0_19219)"}),b().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M187.761 56.865l58.639 58.639v148.871H93.383L52 225.083V56.865h135.761z",fill:"url(#SelectAttributes_svg__paint1_linear_0_19219)"}),b().createElement("path",{opacity:.06,fillRule:"evenodd",clipRule:"evenodd",d:"M47 58h202a7 7 0 017 7v157a7 7 0 01-7 7H47a7 7 0 01-7-7V65a7 7 0 017-7z",fill:"#000"}),b().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50 56h201a5 5 0 015 5v157a5 5 0 01-5 5H50a5 5 0 01-5-5V61a5 5 0 015-5z",fill:"#fff"}),b().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 72.635a3 3 0 013-3H150a3 3 0 110 6h-41.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),b().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 84.635a3 3 0 013-3h64.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),b().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 163a3 3 0 013-3H150a3 3 0 110 6h-41.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),b().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 175a3 3 0 013-3h64.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),b().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 193a3 3 0 013-3H190a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),b().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 205a3 3 0 013-3h74.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),b().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M138.376 103a3 3 0 013-3H223a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),b().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M138 115a3 3 0 013-3h64.205a3 3 0 110 6H141a3 3 0 01-3-3z",fill:"#979797"}),b().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),b().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),b().createElement("circle",{cx:120,cy:106,r:6,fill:"#B6C7DB"}),b().createElement("circle",{cx:120,cy:136,r:6,fill:"#B6C7DB"}),b().createElement("circle",{cx:67,cy:169,r:9,fill:"#B6C7DB"}),b().createElement("circle",{cx:67,cy:199,r:9,fill:"#B6C7DB"}),b().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M138.376 133a3 3 0 013-3H223a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),b().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M138 145a3 3 0 013-3h74.205a3 3 0 110 6H141a3 3 0 01-3-3z",fill:"#979797"}),b().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M92.514 108v-8h-2V140.365h11.178v-2h-9.178V110h9.178v-2h-9.178z",fill:"#2B98F0"}),b().createElement("path",{opacity:.54,fillRule:"evenodd",clipRule:"evenodd",d:"M95.071 77l-3.535 3.535L88 77h7.071z",fill:"#000"}),b().createElement("path",{opacity:.6,fillRule:"evenodd",clipRule:"evenodd",d:"M50 22h186a6 6 0 016 6v18a6 6 0 01-6 6H50a6 6 0 01-6-6V28a6 6 0 016-6z",fill:"#fff"}),b().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M58 37a6 6 0 016-6h70a6 6 0 110 12H64a6 6 0 01-6-6zM148 37a6 6 0 016-6h10a6 6 0 110 12h-10a6 6 0 01-6-6z",fill:"#979797"})),b().createElement("defs",null,b().createElement("linearGradient",{id:"SelectAttributes_svg__paint0_linear_0_19219",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},b().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),b().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),b().createElement("linearGradient",{id:"SelectAttributes_svg__paint1_linear_0_19219",x1:266.117,y1:181.111,x2:154.882,y2:77.681,gradientUnits:"userSpaceOnUse"},b().createElement("stop",{stopOpacity:.01}),b().createElement("stop",{offset:1})))),NO_DATA:e=>b().createElement("svg",jE({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),b().createElement("defs",null,b().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"NoData_svg__b"},b().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:0,offset:"0%"}),b().createElement("stop",{stopColor:"#F4F4F4",offset:"100%"})),b().createElement("linearGradient",{x1:"69.573%",y1:"86.747%",x2:"38.144%",y2:"33.403%",id:"NoData_svg__d"},b().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),b().createElement("stop",{stopColor:"#000",offset:"100%"})),b().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"NoData_svg__e"},b().createElement("stop",{stopColor:"#EEFBFF",offset:"0%"}),b().createElement("stop",{stopColor:"#0072CE",offset:"100%"})),b().createElement("filter",{x:"-7.7%",y:"-7.5%",width:"115.3%",height:"115%",filterUnits:"objectBoundingBox",id:"NoData_svg__f"},b().createElement("feOffset",{dx:0,dy:2,in:"SourceAlpha",result:"shadowOffsetOuter1"}),b().createElement("feGaussianBlur",{stdDeviation:2,in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),b().createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0",type:"matrix",in:"shadowBlurOuter1",result:"shadowMatrixOuter1"}),b().createElement("feMerge",null,b().createElement("feMergeNode",{in:"shadowMatrixOuter1"}),b().createElement("feMergeNode",{in:"SourceGraphic"}))),b().createElement("circle",{id:"NoData_svg__a",cx:128,cy:128,r:128})),b().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},b().createElement("mask",{id:"NoData_svg__c",fill:"#fff"},b().createElement("use",{xlinkHref:"#NoData_svg__a"})),b().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#NoData_svg__a"}),b().createElement("path",{fill:"url(#NoData_svg__b)",mask:"url(#NoData_svg__c)",d:"M0 9h256v247H0z"}),b().createElement("g",{mask:"url(#NoData_svg__c)"},b().createElement("g",{transform:"translate(29 37)"},b().createElement("g",{opacity:.9,strokeWidth:1,fill:"#FFF"},b().createElement("path",{fillOpacity:.8,opacity:.5,d:"M14.565 8h228.144v176.476H14.565z"}),b().createElement("path",{d:"M0 8.01C0 3.586 3.576 0 7.997 0h223.838a7.997 7.997 0 017.997 8.01v152.401c0 4.424-3.577 8.01-7.997 8.01H7.997A7.997 7.997 0 010 160.411V8.01z"})),b().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 42.105)"},b().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),b().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),b().createElement("path",{d:"M9.493 1.003a9.493 9.493 0 019.494 9.493v.06a9.493 9.493 0 01-18.987 0v-.06a9.493 9.493 0 019.493-9.493z",fill:"#E3EBF4"}),b().createElement("path",{d:"M32.488.791h64.093a3.509 3.509 0 110 7.018H32.488a3.509 3.509 0 110-7.018z",fill:"#B1AABD",opacity:.5}),b().createElement("path",{d:"M31.486 13.824h115.902a2.506 2.506 0 010 5.012H31.486a2.506 2.506 0 010-5.012z",fill:"#B1AABD",opacity:.43}),b().createElement("path",{d:"M30.483 22.846H67.88a1.504 1.504 0 110 3.008H30.483a1.504 1.504 0 110-3.008z",fill:"#B1AABD",opacity:.2})),b().createElement("rect",{fill:"#645F6D",opacity:.5,x:19.986,y:16.04,width:79.944,height:11.028,rx:5.514}),b().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 80.2)"},b().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),b().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),b().createElement("rect",{fill:"#E3EBF4",x:0,y:1.003,width:18.987,height:19.048,rx:9.493}),b().createElement("path",{d:"M32.488.791h75.925a3.509 3.509 0 010 7.018H32.488a3.509 3.509 0 110-7.018z",fill:"#B1AABD",opacity:.5}),b().createElement("path",{d:"M31.486 13.824h128.893a2.506 2.506 0 110 5.012H31.486a2.506 2.506 0 010-5.012z",fill:"#B1AABD",opacity:.43}),b().createElement("path",{d:"M30.483 22.846h103.918a1.504 1.504 0 010 3.008H30.483a1.504 1.504 0 110-3.008z",fill:"#B1AABD",opacity:.2})),b().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 118.296)"},b().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),b().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),b().createElement("path",{d:"M9.493 1.003a9.493 9.493 0 019.494 9.493v.06a9.493 9.493 0 01-18.987 0v-.06a9.493 9.493 0 019.493-9.493z",fill:"#E3EBF4"}),b().createElement("path",{d:"M32.488.791h101.906a3.509 3.509 0 010 7.018H32.488a3.509 3.509 0 110-7.018z",fill:"#B1AABD",opacity:.5}),b().createElement("path",{d:"M31.486 13.824h84.924a2.506 2.506 0 010 5.012H31.486a2.506 2.506 0 010-5.012z",fill:"#B1AABD",opacity:.43}),b().createElement("path",{d:"M30.483 22.846H67.88a1.504 1.504 0 110 3.008H30.483a1.504 1.504 0 110-3.008z",fill:"#B1AABD",opacity:.2})))),b().createElement("g",{mask:"url(#NoData_svg__c)"},b().createElement("path",{d:"M154.445 45.134v154.072H36.625V45.134h.811C35.508 62.52 41.07 80.609 54.12 93.944c22.74 23.235 59.61 23.235 82.352 0 13.05-13.335 18.612-31.424 16.683-48.81h1.29z",fill:"url(#NoData_svg__d)",opacity:.1,transform:"rotate(-30 291.014 34.548)"}),b().createElement("path",{d:"M27.473 93.234c17.964 18.355 47.09 18.355 65.054 0s17.964-48.113 0-66.468c-17.964-18.355-47.09-18.355-65.054 0s-17.964 48.113 0 66.468z",fill:"url(#NoData_svg__e)",opacity:.2,transform:"translate(70 86)"}),b().createElement("g",{filter:"url(#NoData_svg__f)",strokeWidth:1,fill:"none",transform:"translate(70 86)"},b().createElement("path",{d:"M59.697 0c32.97 0 59.697 26.746 59.697 59.738 0 15.185-5.662 29.047-14.988 39.587l51.204 51.24a89.336 89.336 0 01-10.097 9.392l-51.38-51.416c-9.73 6.888-21.61 10.936-34.436 10.936C26.727 119.477 0 92.73 0 59.738 0 26.746 26.727 0 59.697 0zm0 17.756c-23.17 0-41.953 18.796-41.953 41.982s18.783 41.982 41.953 41.982 41.953-18.796 41.953-41.982-18.783-41.982-41.953-41.982z",fill:"#B5C8C9"}),b().createElement("path",{d:"M21.508 105.656C8.365 94.698 0 78.196 0 59.738 0 26.746 26.727 0 59.697 0c18.444 0 34.935 8.37 45.885 21.523l-9.794 9.8c-8.408-10.68-21.45-17.537-36.091-17.537-25.361 0-45.92 20.573-45.92 45.952 0 14.652 6.852 27.702 17.525 36.117l-9.794 9.8z",fillOpacity:.4,fill:"#FFF"})),b().createElement("path",{d:"M97.473 179.234c17.964 18.355 47.09 18.355 65.054 0s17.964-48.113 0-66.468c-17.964-18.355-47.09-18.355-65.054 0s-17.964 48.113 0 66.468z",fill:"#D9F5FF",opacity:.4,style:{mixBlendMode:"soft-light"}}),b().createElement("path",{d:"M123.885 158.736c0-3.929.444-7.03 1.332-9.304.888-2.274 2.328-4.245 4.32-5.914 1.99-1.668 3.504-3.195 4.54-4.581 1.037-1.386 1.555-2.913 1.555-4.581 0-4.064-1.75-6.095-5.248-6.095-1.614 0-2.92.592-3.915 1.776-.996 1.184-1.52 2.785-1.574 4.803H111.25c.054-5.382 1.75-9.573 5.086-12.574 3.337-3 8.02-4.5 14.047-4.5 6.001 0 10.65 1.386 13.946 4.157 3.297 2.772 4.945 6.714 4.945 11.827 0 2.234-.444 4.265-1.332 6.095-.888 1.83-2.315 3.7-4.279 5.61l-4.642 4.32c-1.318 1.265-2.233 2.563-2.745 3.895-.51 1.332-.793 3.02-.847 5.066h-11.545zm-1.655 12.27c0-1.99.72-3.625 2.16-4.904 1.44-1.278 3.236-1.917 5.389-1.917 2.152 0 3.949.64 5.388 1.917 1.44 1.279 2.16 2.913 2.16 4.905 0 1.991-.72 3.626-2.16 4.904-1.44 1.278-3.236 1.917-5.388 1.917-2.153 0-3.95-.639-5.389-1.917-1.44-1.278-2.16-2.913-2.16-4.904z",fillOpacity:.87,fill:"#000",style:{mixBlendMode:"overlay"}}),b().createElement("path",{d:"M123.885 158.736c0-3.929.444-7.03 1.332-9.304.888-2.274 2.328-4.245 4.32-5.914 1.99-1.668 3.504-3.195 4.54-4.581 1.037-1.386 1.555-2.913 1.555-4.581 0-4.064-1.75-6.095-5.248-6.095-1.614 0-2.92.592-3.915 1.776-.996 1.184-1.52 2.785-1.574 4.803H111.25c.054-5.382 1.75-9.573 5.086-12.574 3.337-3 8.02-4.5 14.047-4.5 6.001 0 10.65 1.386 13.946 4.157 3.297 2.772 4.945 6.714 4.945 11.827 0 2.234-.444 4.265-1.332 6.095-.888 1.83-2.315 3.7-4.279 5.61l-4.642 4.32c-1.318 1.265-2.233 2.563-2.745 3.895-.51 1.332-.793 3.02-.847 5.066h-11.545zm-1.655 12.27c0-1.99.72-3.625 2.16-4.904 1.44-1.278 3.236-1.917 5.389-1.917 2.152 0 3.949.64 5.388 1.917 1.44 1.279 2.16 2.913 2.16 4.905 0 1.991-.72 3.626-2.16 4.904-1.44 1.278-3.236 1.917-5.388 1.917-2.153 0-3.95-.639-5.389-1.917-1.44-1.278-2.16-2.913-2.16-4.904z",fillOpacity:.38,fill:"#3C74B4"})))),ERROR:e=>b().createElement("svg",FE({width:88,height:88,viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),b().createElement("mask",{id:"Error_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:88,height:88},b().createElement("path",{d:"M44 88c24.3 0 44-19.7 44-44S68.3 0 44 0 0 19.7 0 44s19.7 44 44 44z",fill:"#fff"})),b().createElement("g",{mask:"url(#Error_svg__a)"},b().createElement("path",{d:"M44 88c24.3 0 44-19.7 44-44S68.3 0 44 0 0 19.7 0 44s19.7 44 44 44z",fill:"#CAC4D5",fillOpacity:.3}),b().createElement("path",{opacity:.3,fillRule:"evenodd",clipRule:"evenodd",d:"M19.987 6.73l49.449 6.072a.687.687 0 01.596.767l-7.845 63.888a.688.688 0 01-.766.6L7.214 71.4a.688.688 0 01-.599-.763l.408-3.326L19.987 6.73z",fill:"#fff"}),b().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M1.267 25.921l45.86-19.466a.687.687 0 01.9.366l25.15 59.251a.61.61 0 01-.386.84L22.34 82.765a.719.719 0 01-.887-.445l-20.185-56.4z",fill:"#fff"}),b().createElement("path",{d:"M65.631 9.23H11.017a.688.688 0 00-.687.687v64.37c0 .38.307.687.687.687h54.614c.38 0 .688-.308.688-.687V9.917a.688.688 0 00-.688-.688z",fill:"#F9F9F9"}),b().createElement("path",{opacity:.1,fillRule:"evenodd",clipRule:"evenodd",d:"M14.885 34.95l3.105-1.666 7.31-4.025 8.852 3.472 7.89-5.223 8.036-2.628 8.113 5.193 3.352-10.255v16.967H14.935l-.05-1.835z",fill:"#9C6CF0"}),b().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M14.885 32.331l3.105-3.761 7.31 4.31 8.852 1.656 7.89-2.205 8.036 1.827 8.113-12.643 3.352.742V36.36H14.935l-.05-4.029z",fill:"#FA82AA"}),b().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M14.885 34.946l3.105.432 7.31 1.01 8.852-5.117 7.89 3.675 8.036 1.839 8.113-1.839 3.352.811v1.028H14.935l-.05-1.839z",fill:"#4DBEE9"}),b().createElement("path",{opacity:.1,fillRule:"evenodd",clipRule:"evenodd",d:"M61.543 35.288l-.05 1.497H14.885v-5.239l3.352-.276 8.114 4.697 8.036-.679 7.889.82 8.852-.616 7.31-1.601 3.105 1.397z",fill:"#4DBEE9"}),b().createElement("path",{d:"M21.036 40.178h-5.09a.636.636 0 000 1.272h5.09a.636.636 0 100-1.272z",fill:"#ACACAC"}),b().createElement("path",{opacity:.3,fillRule:"evenodd",clipRule:"evenodd",d:"M16.582 55.872c.703 0 1.273.57 1.273 1.273V69.02a1.272 1.272 0 11-2.545 0V57.144c0-.702.57-1.272 1.272-1.272zM25.914 55.872c.702 0 1.272.57 1.272 1.273V69.02a1.272 1.272 0 11-2.545 0V57.144c0-.702.57-1.272 1.273-1.272zM39.91 55.872c.703 0 1.273.57 1.273 1.273V69.02a1.272 1.272 0 11-2.545 0V57.144c0-.702.57-1.272 1.273-1.272zM21.248 55.872c.702 0 1.272.57 1.272 1.273V69.02a1.273 1.273 0 01-2.545 0V57.144c0-.702.57-1.272 1.273-1.272zM35.245 55.872c.703 0 1.273.57 1.273 1.273V69.02a1.272 1.272 0 11-2.545 0V57.144c0-.702.57-1.272 1.272-1.272zM30.58 55.872c.702 0 1.272.57 1.272 1.273V69.02a1.272 1.272 0 11-2.545 0V57.144c0-.702.57-1.272 1.272-1.272zM44.577 55.872c.702 0 1.272.57 1.272 1.273V69.02a1.273 1.273 0 01-2.545 0V57.144c0-.702.57-1.272 1.273-1.272z",fill:"#BDBDBD"}),b().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.582 65.628c.703 0 1.273.57 1.273 1.272v2.121a1.272 1.272 0 11-2.545 0v-2.12c0-.703.57-1.273 1.272-1.273zM25.914 62.658c.702 0 1.272.57 1.272 1.273v5.09a1.272 1.272 0 11-2.545 0v-5.09c0-.703.57-1.273 1.273-1.273zM39.91 65.628c.703 0 1.273.57 1.273 1.272v2.121a1.272 1.272 0 11-2.545 0v-2.12c0-.703.57-1.273 1.273-1.273zM21.248 66.477c.702 0 1.272.57 1.272 1.272v1.273a1.273 1.273 0 01-2.545 0v-1.273c0-.703.57-1.272 1.273-1.272z",fill:"#4DBEE9"}),b().createElement("path",{d:"M36.518 65.628a1.272 1.272 0 00-2.545 0v3.393a1.272 1.272 0 102.545 0v-3.393zM31.852 62.234a1.272 1.272 0 10-2.545 0v6.787a1.272 1.272 0 102.545 0v-6.787z",fill:"#4DBEE9"}),b().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M44.577 60.962c.702 0 1.272.57 1.272 1.272v6.787a1.273 1.273 0 01-2.545 0v-6.787c0-.702.57-1.272 1.273-1.272z",fill:"#4DBEE9"}),b().createElement("path",{d:"M18.915 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#9C6CF0"}),b().createElement("path",{opacity:.5,d:"M34.185 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),b().createElement("path",{opacity:.3,d:"M49.454 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),b().createElement("path",{opacity:.8,d:"M26.55 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#FB6597"}),b().createElement("path",{d:"M41.82 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),b().createElement("path",{opacity:.2,d:"M57.09 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),b().createElement("path",{opacity:.5,fillRule:"evenodd",clipRule:"evenodd",d:"M16.582 19.818h4.666a.424.424 0 110 .849h-4.666a.424.424 0 110-.849zM31.851 19.818h4.666a.424.424 0 010 .849h-4.666a.424.424 0 110-.849zM47.121 19.818h4.666a.424.424 0 010 .849h-4.666a.424.424 0 010-.849zM24.217 19.818h4.665a.424.424 0 010 .849h-4.665a.424.424 0 010-.849zM39.486 19.818h4.666a.424.424 0 110 .849h-4.666a.424.424 0 110-.849zM54.756 19.818h4.666a.424.424 0 110 .849h-4.666a.424.424 0 110-.849z",fill:"#ACACAC"}),b().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.946 43.571h5.09a.636.636 0 110 1.273h-5.09a.636.636 0 010-1.273zM15.946 46.116h5.09a.636.636 0 010 1.273h-5.09a.636.636 0 010-1.273zM15.946 48.661h5.09a.636.636 0 010 1.273h-5.09a.636.636 0 110-1.273zM23.58 43.571h5.09a.636.636 0 110 1.273h-5.09a.636.636 0 010-1.273zM23.58 46.116h5.09a.636.636 0 010 1.273h-5.09a.636.636 0 010-1.273zM23.58 48.661h5.09a.636.636 0 010 1.273h-5.09a.636.636 0 110-1.273zM49.454 43.571h11.028a.636.636 0 010 1.273H49.454a.636.636 0 010-1.273zM49.454 46.116h11.028a.636.636 0 010 1.273H49.454a.636.636 0 010-1.273zM49.454 48.661h11.028a.636.636 0 010 1.273H49.454a.636.636 0 110-1.273zM31.215 43.571h15.27a.636.636 0 110 1.273h-15.27a.636.636 0 010-1.273zM31.215 46.116h15.27a.636.636 0 010 1.273h-15.27a.636.636 0 010-1.273zM31.215 48.661h15.27a.636.636 0 010 1.273h-15.27a.636.636 0 010-1.273zM15.946 51.206h5.09a.636.636 0 110 1.272h-5.09a.636.636 0 110-1.272zM23.58 51.206h5.09a.636.636 0 110 1.272h-5.09a.636.636 0 110-1.272zM49.454 51.206h11.028a.636.636 0 010 1.272H49.454a.636.636 0 110-1.272zM31.215 51.206h15.27a.636.636 0 110 1.272h-15.27a.636.636 0 010-1.272z",fill:"#E9E9E9"}),b().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.878 55.872h5.09a.636.636 0 110 1.273h-5.09a.636.636 0 110-1.273z",fill:"#ACACAC"}),b().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.878 59.69h11.029a.636.636 0 010 1.272H49.878a.636.636 0 110-1.273zM49.878 62.234h11.029a.636.636 0 010 1.273H49.878a.636.636 0 010-1.273zM49.878 64.78h11.029a.636.636 0 010 1.272H49.878a.636.636 0 010-1.273z",fill:"#E9E9E9"}),b().createElement("path",{d:"M54.968 67.324h-5.09a.636.636 0 000 1.273h5.09a.636.636 0 000-1.273z",fill:"#E9E9E9"}),b().createElement("g",{filter:"url(#Error_svg__filter0_d)"},b().createElement("path",{d:"M57.406 74.25c9.493 0 17.188-7.695 17.188-17.188 0-9.492-7.695-17.187-17.188-17.187-9.492 0-17.187 7.695-17.187 17.188 0 9.492 7.695 17.187 17.187 17.187z",fill:"#000"})),b().createElement("path",{d:"M57.406 74.25c9.493 0 17.188-7.695 17.188-17.188 0-9.492-7.695-17.187-17.188-17.187-9.492 0-17.187 7.695-17.187 17.188 0 9.492 7.695 17.187 17.187 17.187z",fill:"#F25252"}),b().createElement("path",{opacity:.15,fillRule:"evenodd",clipRule:"evenodd",d:"M57.406 34.719c12.34 0 22.344 10.003 22.344 22.343S69.746 79.406 57.406 79.406c-12.34 0-22.343-10.003-22.343-22.344 0-12.34 10.003-22.343 22.343-22.343zm-.172 2.406c-10.916 0-19.765 8.85-19.765 19.766 0 10.916 8.85 19.765 19.765 19.765C68.151 76.656 77 67.806 77 56.891c0-10.917-8.85-19.766-19.766-19.766z",fill:"#F25252"}),b().createElement("path",{opacity:.3,fillRule:"evenodd",clipRule:"evenodd",d:"M57.406 38.844c10.062 0 18.219 8.157 18.219 18.218 0 10.062-8.157 18.22-18.219 18.22-10.062 0-18.218-8.158-18.218-18.22 0-10.061 8.156-18.218 18.218-18.218zm0 2.043c-8.933 0-16.175 7.242-16.175 16.175 0 8.934 7.242 16.176 16.175 16.176 8.934 0 16.176-7.242 16.176-16.175 0-8.934-7.242-16.176-16.176-16.176z",fill:"#F25252"}),b().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M57.406 26.469C74.303 26.469 88 40.166 88 57.062c0 16.897-13.697 30.594-30.594 30.594-16.896 0-30.593-13.697-30.593-30.594 0-16.896 13.697-30.593 30.593-30.593zm-.172 3.437c-14.903 0-26.984 12.082-26.984 26.985 0 14.903 12.081 26.984 26.984 26.984 14.903 0 26.985-12.081 26.985-26.984 0-14.903-12.082-26.985-26.985-26.985z",fill:"#F25252"}),b().createElement("path",{d:"M57.406 71.844c8.164 0 14.782-6.618 14.782-14.781 0-8.164-6.618-14.782-14.782-14.782-8.163 0-14.781 6.618-14.781 14.782 0 8.163 6.618 14.78 14.781 14.78z",fill:"#FF6A6A"}),b().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M58.298 46.448L75.18 63.331l-9.114 12.078h-2.029l-7.582-7.582 1.006-3.178.837-18.2z",fill:"url(#Error_svg__paint0_linear)"}),b().createElement("g",{filter:"url(#Error_svg__filter1_d)"},b().createElement("path",{d:"M57.406 68.063a1.719 1.719 0 100-3.438 1.719 1.719 0 000 3.438z",fill:"#000"})),b().createElement("path",{d:"M57.406 68.063a1.719 1.719 0 100-3.438 1.719 1.719 0 000 3.438z",fill:"#fff"}),b().createElement("g",{filter:"url(#Error_svg__filter2_d)"},b().createElement("path",{d:"M57.406 46.063c.95 0 1.719.769 1.719 1.718v12.375a1.719 1.719 0 11-3.438 0V47.781c0-.949.77-1.718 1.72-1.718z",fill:"#000"})),b().createElement("path",{d:"M57.406 46.063c.95 0 1.719.769 1.719 1.718v12.375a1.719 1.719 0 11-3.438 0V47.781c0-.949.77-1.718 1.72-1.718z",fill:"#fff"})),b().createElement("defs",null,b().createElement("filter",{id:"Error_svg__filter0_d",x:36.219,y:37.875,width:42.375,height:42.375,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},b().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),b().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),b().createElement("feOffset",{dy:2}),b().createElement("feGaussianBlur",{stdDeviation:2}),b().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"}),b().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),b().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),b().createElement("filter",{id:"Error_svg__filter1_d",x:51.688,y:62.625,width:11.438,height:11.438,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},b().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),b().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),b().createElement("feOffset",{dy:2}),b().createElement("feGaussianBlur",{stdDeviation:2}),b().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"}),b().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),b().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),b().createElement("filter",{id:"Error_svg__filter2_d",x:51.688,y:44.063,width:11.438,height:23.813,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},b().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),b().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),b().createElement("feOffset",{dy:2}),b().createElement("feGaussianBlur",{stdDeviation:2}),b().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"}),b().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),b().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),b().createElement("linearGradient",{id:"Error_svg__paint0_linear",x1:68.438,y1:71.571,x2:60.119,y2:58.801,gradientUnits:"userSpaceOnUse"},b().createElement("stop",{stopOpacity:0}),b().createElement("stop",{offset:1})))),LOADING:e=>b().createElement("svg",VE({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),b().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.03}),b().createElement("mask",{id:"EmptyLoading_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},b().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),b().createElement("g",{mask:"url(#EmptyLoading_svg__a)"},b().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#EmptyLoading_svg__paint0_linear_2978_41880)"}),b().createElement("g",{fillRule:"evenodd",clipRule:"evenodd"},b().createElement("path",{d:"M40.755 44.17C40.755 38.002 45.76 33 51.92 33h251.675c6.167 0 11.166 5.001 11.166 11.17v160.596H40.755V44.171z",fill:"#5E7282"}),b().createElement("path",{d:"M50.371 43.106h255.685V195.71H50.371V43.106z",fill:"url(#EmptyLoading_svg__paint1_linear_2978_41880)"}),b().createElement("path",{d:"M15.545 208.914c2.321.469 4.723.716 7.183.716H338.75c.22 0 .439-.002.658-.006-7.061 8.445-17.67 13.816-29.524 13.816H45.655c-12.111 0-22.916-5.597-29.968-14.349l-.142-.177z",fill:"#BDCBD8"}),b().createElement("path",{d:"M339.015 204.883v4.966H15v-4.966h324.015z",fill:"#D4DCDF"}),b().createElement("path",{d:"M201.107 213.991h-45.221a11.176 11.176 0 01-11.046-9.449h67.314a11.172 11.172 0 01-11.047 9.449z",fill:"url(#EmptyLoading_svg__paint2_linear_2978_41880)"})),b().createElement("g",{filter:"url(#EmptyLoading_svg__filter0_d_2978_41880)"},b().createElement("rect",{x:81.703,y:99,width:170,height:26,rx:8,fill:"#D1E6FF"}),b().createElement("rect",{x:84.703,y:102,width:164,height:20,rx:5,stroke:"#fff",strokeWidth:6})),b().createElement("g",{filter:"url(#EmptyLoading_svg__filter1_d_2978_41880)"},b().createElement("mask",{id:"EmptyLoading_svg__b",fill:"#fff"},b().createElement("rect",{x:81,y:105,width:108,height:14,rx:2})),b().createElement("rect",{x:81,y:105,width:108,height:14,rx:2,fill:"#61A3F1"}),b().createElement("rect",{x:81,y:105,width:108,height:14,rx:2,stroke:"#4A90E2",strokeWidth:8,mask:"url(#EmptyLoading_svg__b)"})),b().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M122.703 74a3 3 0 013-3h81.625a3 3 0 010 6h-81.625a3 3 0 01-3-3z",fill:"#B6C7DB"}),b().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M146.703 86a3 3 0 013-3h34a3 3 0 110 6h-34a3 3 0 01-3-3zM136.703 139a3 3 0 013-3h54a3 3 0 110 6h-54a3 3 0 01-3-3z",fill:"#979797"}),b().createElement("path",{opacity:.1,fillRule:"evenodd",clipRule:"evenodd",d:"M112.703 151a3 3 0 013-3h103a3 3 0 110 6h-103a3 3 0 01-3-3zM124.703 163a3 3 0 013-3h79a3 3 0 110 6h-79a3 3 0 01-3-3z",fill:"#979797"}),b().createElement("g",{filter:"url(#EmptyLoading_svg__filter2_ddd_2978_41880)"},b().createElement("path",{fill:"#A0C1D7",d:"M70.703 64h11v8h-11z"}),b().createElement("rect",{x:62,y:59,width:28,height:8,rx:1,fill:"#BDD4E3"}),b().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.23 160.5c20.704 20.703 54.27 20.703 74.973 0 20.703-20.703 20.703-54.27 0-74.973-20.703-20.703-54.27-20.703-74.973 0-20.703 20.703-20.703 54.27 0 74.973z",fill:"#BDD4E3"}),b().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M113.427 85.988c20.463 20.652 20.404 53.981-.175 74.561-20.432 20.431-53.432 20.635-74.115.613l-.446-.439 74.736-74.735z",fill:"#A0C1D7"}),b().createElement("path",{opacity:.144,fillRule:"evenodd",clipRule:"evenodd",d:"M75.037 175.385c29.402 0 53.236-23.834 53.236-53.236a54.67 54.67 0 00-.106-3.399L100.45 91.037l-55.142 58.396 25.814 25.811c1.293.094 2.598.141 3.915.141z",fill:"url(#EmptyLoading_svg__paint3_linear_2978_41880)"}),b().createElement("circle",{cx:75.94,cy:123.237,r:44.723,fill:"#91B0C2"}),b().createElement("g",{filter:"url(#EmptyLoading_svg__filter3_d_2978_41880)"},b().createElement("circle",{r:42.793,transform:"matrix(-1 0 0 1 75.94 123.237)",fill:"#F7F4FF"})),b().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M105.043 175.309l-10.298.861-20.313-20.152.863-2.292-9.973-9.982 18.679-6.882h-4.308l-8.943-8.951 4.545-10.532L94.35 90.74l37.888 37.162c-.343 20.088-11.146 37.627-27.195 47.407z",fill:"url(#EmptyLoading_svg__paint4_linear_2978_41880)"}),b().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M67.703 123a8 8 0 0112.362-6.707l14.477-25.145A36.828 36.828 0 0075.703 86c-20.434 0-37 16.565-37 37h29z",fill:"url(#EmptyLoading_svg__paint5_angular_2978_41880)"}),b().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M94.297 90.6l.24.138s-12.45 35.125-12.811 35.752a6.92 6.92 0 01-11.985-6.92c.361-.626 24.556-28.97 24.556-28.97z",fill:"#323232"}),b().createElement("circle",{cx:75.94,cy:123.237,r:2.896,fill:"#EEEBF6"}),b().createElement("circle",{cx:96.211,cy:148.655,r:2.574,fill:"#A0C3D7"}),b().createElement("circle",{cx:107.15,cy:131.924,r:2.574,fill:"#A0C3D7"}),b().createElement("rect",{x:62.427,y:135.592,width:27.027,height:10.039,rx:3,fill:"#A0C3D7"}),b().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M85.914 170.534H75.112l-21.605-21.472 2.126-2.775v-1.01L42.8 132.523l2.853-2.529 40.261 40.54z",fill:"url(#EmptyLoading_svg__paint6_linear_2978_41880)"}),b().createElement("path",{opacity:.02,fillRule:"evenodd",clipRule:"evenodd",d:"M96.362 136.555h-4.988l-38.126-38.01 2.853-2.53 40.261 40.54z",fill:"url(#EmptyLoading_svg__paint7_linear_2978_41880)"}),b().createElement("path",{opacity:.02,fillRule:"evenodd",clipRule:"evenodd",d:"M116.746 129.006h-4.988L73.632 90.995l2.853-2.53 40.261 40.541z",fill:"url(#EmptyLoading_svg__paint8_linear_2978_41880)"}),b().createElement("path",{opacity:.02,fillRule:"evenodd",clipRule:"evenodd",d:"M85.793 152.41h-4.988l-38.126-38.011 2.852-2.53 40.262 40.541z",fill:"url(#EmptyLoading_svg__paint9_linear_2978_41880)"}),b().createElement("circle",{cx:75.618,cy:155.734,r:2.574,fill:"#A0C3D7"}),b().createElement("circle",{cx:55.026,cy:148.655,r:2.574,fill:"#A0C3D7"}),b().createElement("circle",{cx:44.73,cy:131.924,r:2.574,fill:"#A0C3D7"}),b().createElement("g",{fill:"#A0C3D7"},b().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 96.21 97.363)"}),b().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 107.149 114.094)"}),b().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 75.618 90.284)"}),b().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 55.026 97.363)"}),b().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 44.73 114.094)"})))),b().createElement("defs",null,b().createElement("linearGradient",{id:"EmptyLoading_svg__paint0_linear_2978_41880",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},b().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),b().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),b().createElement("linearGradient",{id:"EmptyLoading_svg__paint1_linear_2978_41880",x1:178.214,y1:43.106,x2:178.214,y2:195.709,gradientUnits:"userSpaceOnUse"},b().createElement("stop",{stopColor:"#F2F9FB"}),b().createElement("stop",{offset:1,stopColor:"#fff"})),b().createElement("linearGradient",{id:"EmptyLoading_svg__paint2_linear_2978_41880",x1:178.497,y1:204.542,x2:178.497,y2:213.991,gradientUnits:"userSpaceOnUse"},b().createElement("stop",{stopColor:"#90AABF"}),b().createElement("stop",{offset:1,stopColor:"#869DAE"})),b().createElement("linearGradient",{id:"EmptyLoading_svg__paint3_linear_2978_41880",x1:154.275,y1:146.574,x2:96.683,y2:91.352,gradientUnits:"userSpaceOnUse"},b().createElement("stop",{stopOpacity:.01}),b().createElement("stop",{offset:1})),b().createElement("linearGradient",{id:"EmptyLoading_svg__paint4_linear_2978_41880",x1:60.762,y1:143.327,x2:114.747,y2:176.019,gradientUnits:"userSpaceOnUse"},b().createElement("stop",{stopOpacity:.87}),b().createElement("stop",{offset:1,stopOpacity:.01})),b().createElement("linearGradient",{id:"EmptyLoading_svg__paint6_linear_2978_41880",x1:90.287,y1:154.267,x2:68.53,y2:131.301,gradientUnits:"userSpaceOnUse"},b().createElement("stop",{stopOpacity:.01}),b().createElement("stop",{offset:1})),b().createElement("linearGradient",{id:"EmptyLoading_svg__paint7_linear_2978_41880",x1:100.735,y1:120.288,x2:78.978,y2:97.322,gradientUnits:"userSpaceOnUse"},b().createElement("stop",{stopOpacity:.01}),b().createElement("stop",{offset:1})),b().createElement("linearGradient",{id:"EmptyLoading_svg__paint8_linear_2978_41880",x1:121.119,y1:112.739,x2:99.362,y2:89.773,gradientUnits:"userSpaceOnUse"},b().createElement("stop",{stopOpacity:.01}),b().createElement("stop",{offset:1})),b().createElement("linearGradient",{id:"EmptyLoading_svg__paint9_linear_2978_41880",x1:90.166,y1:136.143,x2:68.409,y2:113.177,gradientUnits:"userSpaceOnUse"},b().createElement("stop",{stopOpacity:.01}),b().createElement("stop",{offset:1})),b().createElement("filter",{id:"EmptyLoading_svg__filter0_d_2978_41880",x:77.703,y:96,width:178,height:34,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},b().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),b().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),b().createElement("feOffset",{dy:1}),b().createElement("feGaussianBlur",{stdDeviation:2}),b().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"}),b().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),b().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),b().createElement("filter",{id:"EmptyLoading_svg__filter1_d_2978_41880",x:77,y:102,width:116,height:22,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},b().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),b().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),b().createElement("feOffset",{dy:1}),b().createElement("feGaussianBlur",{stdDeviation:2}),b().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"}),b().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),b().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),b().createElement("filter",{id:"EmptyLoading_svg__filter2_ddd_2978_41880",x:-13.297,y:28,width:181.534,height:189.17,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},b().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),b().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),b().createElement("feMorphology",{radius:4,operator:"erode",in:"SourceAlpha",result:"effect1_dropShadow_2978_41880"}),b().createElement("feOffset",{dy:7}),b().createElement("feGaussianBlur",{stdDeviation:4}),b().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.600156 0 0 0 0 0.745337 0 0 0 0 0.8625 0 0 0 0.1 0"}),b().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),b().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),b().createElement("feMorphology",{radius:4,operator:"dilate",in:"SourceAlpha",result:"effect2_dropShadow_2978_41880"}),b().createElement("feOffset",{dy:5}),b().createElement("feGaussianBlur",{stdDeviation:16}),b().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0.447059 0 0 0 0 0.807843 0 0 0 0.06 0"}),b().createElement("feBlend",{mode:"normal",in2:"effect1_dropShadow_2978_41880",result:"effect2_dropShadow_2978_41880"}),b().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),b().createElement("feMorphology",{radius:2,operator:"dilate",in:"SourceAlpha",result:"effect3_dropShadow_2978_41880"}),b().createElement("feOffset",{dy:12}),b().createElement("feGaussianBlur",{stdDeviation:8.5}),b().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0.447059 0 0 0 0 0.807843 0 0 0 0.06 0"}),b().createElement("feBlend",{mode:"normal",in2:"effect2_dropShadow_2978_41880",result:"effect3_dropShadow_2978_41880"}),b().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect3_dropShadow_2978_41880",result:"shape"})),b().createElement("filter",{id:"EmptyLoading_svg__filter3_d_2978_41880",x:29.148,y:78.444,width:93.585,height:93.585,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},b().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),b().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),b().createElement("feOffset",{dy:2}),b().createElement("feGaussianBlur",{stdDeviation:2}),b().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"}),b().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),b().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),b().createElement("radialGradient",{id:"EmptyLoading_svg__paint5_angular_2978_41880",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"rotate(-56.035 152.55 -12.515) scale(43.4058 65.5062)"},b().createElement("stop",{stopColor:"#CFE8FF"}),b().createElement("stop",{offset:.599,stopColor:"#D1F2F9",stopOpacity:0}))))},HE=e=>{let{variant:t=BE.full,LogoRenderer:r=zE.SEARCH_RESULTS,text:n,secondaryText:a,buttonTitle:o,onClick:i=R.identity,access:l}=e;const s=ME(),c=l&&o;return b().createElement("div",{className:T()(s.root,s[`root_${t}`])},b().createElement(r,{className:s[`${t}`]}),b().createElement("div",{className:s.textBox},b().createElement(Ay(),{variant:"h5",classes:{h5:s.text}},n),a&&b().createElement(Ay(),{variant:"subtitle1",classes:{subtitle1:s.secondaryText}},a)),c&&b().createElement(dE(),{className:s.button,variant:"contained",color:"primary",onClick:i},o))};var YE=r(87378);class WE extends b().Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e}),console.error(e)}render(){const{children:e,error:t}=this.props;return this.state.error?t:e}}const GE=(0,Op.Z)({container:{flexGrow:1,display:"flex",flexDirection:"column",position:"relative",overflow:"hidden","& .Resizer.disabled":{display:"none"}},pagination:{flexGrow:0,height:"52px"},listContainer:{overflowY:"auto"},tableContainer:{display:"flex",flexDirection:"column",height:"100%"},resizablePanesWrapper:{flexGrow:1,height:0},pane:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",overflow:"hidden"}});var qE=r(46089),ZE=r.n(qE);const $E=(0,Op.Z)((e=>({button:{"&.MuiButtonGroup-grouped":{minWidth:"30px",padding:"8px 8px",justifyContent:"start",fill:"rgba(0,0,0,0.54)",textTransform:"none",color:"rgba(0,0,0,0.87)",borderColor:"rgba(0,0,0,0.12)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)"},"&:not(:last-of-type):hover":{borderRightColor:"transparent"},"&$current":{"& $icon":{color:e.palette.primary.main},backgroundColor:(0,km.alpha)(e.palette.primary.main,.12),fill:e.palette.primary.main,color:e.palette.primary.main,"&:hover":{backgroundColor:(0,km.alpha)(e.palette.primary.main,.24),borderRightColor:"transparent"}}}},icon:{color:"rgba(0,0,0,0.54)",width:"20px",height:"20px","& + $title":{marginLeft:"8px"}},title:{fontSize:"13px",lineHeight:"15px",letterSpacing:0},current:{}}))),KE=(0,md.T)(dE()),XE=e=>{let{className:t,classes:r={},modes:n=[],modeId:a,onChange:o}=e;const i=$E();return b().createElement(ZE(),{className:t},n.map((e=>{let{id:t,title:n,tooltipTitle:l,Icon:s,disabled:c}=e;return b().createElement(KE,{disabled:c,showForDisabled:c&&!!l,key:String(t),className:T()(i.button,{[i.current]:a===t},r.button),tooltipTitle:l,onClick:(u=t,()=>o(u)),"data-reltio-id":`reltio-search-mode-${t}`},s&&b().createElement(s,{className:i.icon}),n&&b().createElement("div",{className:i.title},n));var u})))},QE=(0,Op.Z)((()=>({button:{"&.MuiButtonGroup-grouped":{minWidth:"90px",padding:"8px 12px"}}})));function JE(){return JE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},JE.apply(this,arguments)}const eb=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return b().createElement("svg",JE({width:"25",height:"24",viewBox:"0 0 25 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),b().createElement("defs",null,b().createElement("path",{d:"M19 4H5c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM7 18H5v-8h2v8zM7 8H5V6h2v2zm6 10H9v-8h4v8zm0-10H9V6h4v2zm6 10h-4v-8h4v8zm0-10h-4V6h4v2z",id:"svg3365802068a"})),b().createElement("g",{stroke:"none",strokeWidth:"1"},b().createElement("g",{transform:"translate(.2)"},b().createElement("mask",{id:"svg3365802068b",fill:"#fff"},b().createElement("use",{xlinkHref:"#svg3365802068a"})),b().createElement("g",{mask:"url(#svg3365802068b)"},b().createElement("g",null,b().createElement("g",null,b().createElement("path",{d:"M0 0h24v24H0z"})))))))};function tb(){return tb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tb.apply(this,arguments)}const rb=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return b().createElement("svg",tb({width:"25",height:"24",viewBox:"0 0 25 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),b().createElement("defs",null,b().createElement("path",{d:"M20 15.5v3H9v-3h11zm-14 0a1 1 0 011 1v1a1 1 0 01-1 1H5a1 1 0 01-1-1v-1a1 1 0 011-1h1zm14-5v3H9v-3h11zm-14 0a1 1 0 011 1v1a1 1 0 01-1 1H5a1 1 0 01-1-1v-1a1 1 0 011-1h1zm14-5v3H9v-3h11zm-14 0a1 1 0 011 1v1a1 1 0 01-1 1H5a1 1 0 01-1-1v-1a1 1 0 011-1h1z",id:"svg4195527304a"})),b().createElement("g",{stroke:"none",strokeWidth:"1"},b().createElement("g",{transform:"translate(.2)"},b().createElement("mask",{id:"svg4195527304b",fill:"#fff"},b().createElement("use",{xlinkHref:"#svg4195527304a"})),b().createElement("g",{mask:"url(#svg4195527304b)"},b().createElement("path",{d:"M0 0h24v24H0z"})))))},nb=e=>{switch(e){case $.ll.TABLE:return eb;case $.ll.LIST:return rb;default:return fE()}},ab=[{id:$.ll.TABLE,tooltipTitle:po().text("Table view"),title:po().text("Table"),Icon:nb($.ll.TABLE)},{id:$.ll.LIST,tooltipTitle:po().text("List view"),title:po().text("List"),Icon:nb($.ll.LIST)}],ob=e=>{let{className:t}=e;const r=QE(),n=(0,Ep.useDispatch)(),a=(0,Ep.useSelector)(Po.XM);return b().createElement(XE,{className:t,classes:{button:r.button},modes:ab,modeId:a,onChange:e=>{a!==e&&n((e=>({type:Ie,payload:e}))(e))}})};ob.propTypes={className:hp().string};const ib=ob;var lb=r(81085),sb=r.n(lb),cb=r(48139),ub=r.n(cb);const pb="DATA_TENANTS_UPDATED",db=e=>t=>({type:e,payload:t}),mb=(db(pb),null),yb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:mb,t=arguments.length>1?arguments[1]:void 0;return t.type===pb?t.payload||mb:e},gb="TENANTS_UPDATED",fb=(db(gb),null),hb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fb,t=arguments.length>1?arguments[1]:void 0;return t.type===gb?t.payload||fb:e},Eb="METADATA_LOADED";let bb=function(e){return e.OPEN_ENTITY="OPEN_ENTITY",e.NEW_ENTITY_SHOWN="NEW_ENTITY_SHOWN",e.ENTITY_DELETION_FINISHED="ENTITY_DELETION_FINISHED",e.OPEN_PERSPECTIVE="OPEN_PERSPECTIVE",e.UI_CONFIG_LOADED="UI_CONFIG_LOADED",e.NEW_UI_CONFIG_LOADED="NEW_UI_CONFIG_LOADED",e.PATHS_SET="PATHS_SET",e.UI_PATH_SET="UI_PATH_SET",e.LOCALIZATION_LOADED="LOCALIZATION_LOADED",e.LOCALE_ATTRIBUTE_PRESENTATION_LOADED="LOCALE_ATTRIBUTE_PRESENTATION_LOADED",e.AUTOCLOSE_INTERVAL_LOADED="AUTOCLOSE_INTERVAL_LOADED",e.SET_PREFER_REACT="SET_PREFER_REACT",e.OPEN_CONSOLE_APP="OPEN_CONSOLE_APP",e.OPEN_APP_FROM_CHOCOLATE_BAR="OPEN_APP_FROM_CHOCOLATE_BAR",e.NUMBER_FORMAT_UPDATED="NUMBER_FORMAT_UPDATED",e.OPEN_GRAPH="OPEN_GRAPH",e.DATE_MASK_UPDATED="DATE_MASK_UPDATED",e.DATE_TIME_MASK_UPDATED="DATE_TIME_MASK_UPDATED",e.OPEN_SEARCH="OPEN_SEARCH",e.OPEN_DASHBOARD="OPEN_DASHBOARD",e.OPEN_HISTORY_EVENT="OPEN_HISTORY_EVENT",e.KEYS_SET="KEYS_SET",e.OPEN_PIVOTING_PERSPECTIVE="OPEN_PIVOTING_PERSPECTIVE",e.ERROR_SET="ERROR_SET",e.SHOW_NOTIFICATION="SHOW_NOTIFICATION",e.CLOSE_NOTIFICATION="CLOSE_NOTIFICATION",e.CLEAR_NOTIFICATIONS="CLEAR_NOTIFICATIONS",e.DOCUMENTATION_SET="DOCUMENTATION_SET",e.OPEN_NEW_ENTITY_WITH_AUTHORING="OPEN_NEW_ENTITY_WITH_AUTHORING",e.OPEN_PREVIOUS_PAGE="OPEN_PREVIOUS_PAGE",e.NAVIGATE="NAVIGATE",e.ADD_DASHBOARD_EXTERNAL_VIEW="ADD_DASHBOARD_EXTERNAL_VIEW",e.SET_USE_SHARED_PREFERENCES="SET_USE_SHARED_PREFERENCES",e}({});function vb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Tb(e,t,r[t])}))}return e}function Tb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ob={},xb=(0,R.pipe)(O.normalizeMetadata,O.parseMetadata,O.localizeMetadata),Cb=(0,R.map)(O.localizeMetadata),Sb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ob,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Eb:{const{tenant:r,metadata:n}=t.payload;return vb({},e,{[r]:xb(n)})}case bb.LOCALIZATION_LOADED:return Cb(e);default:return e}};let wb=function(e){return e.ADD_ATTRIBUTES="ADD_ATTRIBUTES",e.MODIFY_ATTRIBUTE="MODIFY_ATTRIBUTE",e.REMOVE_ATTRIBUTE="REMOVE_ATTRIBUTE",e.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES="REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES",e.ADD_NEXT_PAGE_ATTRIBUTE_VALUES="ADD_NEXT_PAGE_ATTRIBUTE_VALUES",e.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES="PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES",e.ADD_DEFAULT_VALUES="ADD_DEFAULT_VALUES",e.SAVE_PROFILE="SAVE_PROFILE",e.SAVE_DRAFT="SAVE_DRAFT",e.VALIDATE_PROFILE="VALIDATE_PROFILE",e.PROFILE_SAVED="PROFILE_SAVED",e}({});const Ab=db(wb.ADD_ATTRIBUTES),Rb=db(wb.ADD_DEFAULT_VALUES),_b=db(wb.MODIFY_ATTRIBUTE),Ib=db(wb.REMOVE_ATTRIBUTE),Nb=db(wb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES),Db=db(wb.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES),Pb=db(wb.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES),kb=db(wb.SAVE_PROFILE),Lb=db(wb.SAVE_DRAFT),Ub=db(wb.PROFILE_SAVED),jb=db(wb.VALIDATE_PROFILE);let Fb=function(e){return e.DEPENDENT_LOOKUPS_STRUCTURE_SET="DEPENDENT_LOOKUPS_STRUCTURE_SET",e.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED="DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED",e.DEPENDENT_LOOKUPS_EDITORS_BLOCKED="DEPENDENT_LOOKUPS_EDITORS_BLOCKED",e.DEPENDENT_LOOKUPS_EDITOR_TOUCHED="DEPENDENT_LOOKUPS_EDITOR_TOUCHED",e}({});const Mb=db(Fb.DEPENDENT_LOOKUPS_STRUCTURE_SET),Vb=db(Fb.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED),Bb=db(Fb.DEPENDENT_LOOKUPS_EDITORS_BLOCKED),zb=db(Fb.DEPENDENT_LOOKUPS_EDITOR_TOUCHED);let Hb=function(e){return e.MODE_UPDATED="MODE_UPDATED",e.MODE_CANCEL_EDITING="MODE_CANCEL_EDITING",e.MODE_EDITING_CANCELED="MODE_EDITING_CANCELED",e}({});function Yb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Wb(e,t,r[t])}))}return e}function Wb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Gb={structure:{},editors:{},initedTypeUris:[]},qb="SEARCH_RESULTS_SET",Zb="KEYWORD_UPDATED",$b="UPDATE_STATE",Kb="ACTIVITY_FILTER_UPDATED",Xb="GLOBAL_FILTER_UPDATED",Qb="SEARCH_OPTIONS_UPDATED",Jb="SET_SEARCH_OPTIONS_CONFIG",ev="SET_SEARCH_PROVIDER_DATA",tv="SET_SEARCH_NAVIGATION_DATA",rv="UPDATE_SEARCH_NAVIGATION_DATA_FIELDS",nv=db(qb),av=db(Zb),ov=db($b),iv=db("SAVE_STATE"),lv=db(Kb),sv=db(Xb),cv=db(Qb),uv=db(Jb),pv=db(ev),dv=db(tv),mv=db(rv),yv=db("UPDATE_SEARCH_NAVIGATION_DATA_ON_MERGE"),gv=(0,R.path)(["globalFilter","savedSearchesUris"]),fv="searchNavigation";function*hv(){const e=yield(0,Fa.Ys)(OI.selectors.getSearchNavigationData),t=yield(0,Fa.Ys)(OI.selectors.getSearchProviderData);sessionStorage.setItem(fv,JSON.stringify({searchNavigationData:e,searchProviderData:t}))}function*Ev(){let e;try{e=JSON.parse(sessionStorage.getItem(fv))||{}}catch(t){e={}}const{searchNavigationData:t,searchProviderData:r}=e;t&&r&&(yield(0,Fa.gz)(pv(r)),yield(0,Fa.gz)(dv(t)))}const bv=[function*(){yield(0,Fa.Fm)([tv,rv,bb.OPEN_ENTITY],hv)},function*(){yield(0,Fa.RE)(Ev)}];function vv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Tv(e,t,r[t])}))}return e}function Tv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ov={searchResults:[],keyword:null,searchOptions:{searchByOv:!1,ovOnly:!1},activityFilter:"active",globalFilter:{query:null,savedSearchesUris:[],isMuted:!0},searchProviderData:null,searchNavigationData:null},xv=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ov,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case qb:return vv({},e,{searchResults:t.payload});case Zb:{const r=(0,R.pick)(["value","isRawFilter"],t.payload||{});return vv({},e,{keyword:(0,R.isEmpty)(r)?null:r})}case $b:return vv({},Ov,{keyword:(0,R.isNil)(t.payload.keyword)||(0,R.isEmpty)(t.payload.keyword)?null:t.payload.keyword,searchOptions:t.payload.searchOptions||e.searchOptions,activityFilter:e.activityFilter,globalFilter:e.globalFilter,searchNavigationData:e.searchNavigationData,searchProviderData:e.searchProviderData});case Kb:return vv({},e,{activityFilter:t.payload});case Xb:return vv({},e,{globalFilter:(0,O.isEmptyValue)(t.payload)?Ov.globalFilter:t.payload});case Qb:return vv({},e,{searchOptions:vv({},e.searchOptions,t.payload)});case Jb:{const r=!!t.payload.showSearchByOv;return vv({},e,{searchOptions:{searchByOv:r,ovOnly:r}})}case ev:return vv({},e,{searchProviderData:t.payload});case tv:return vv({},e,{searchNavigationData:t.payload});case rv:return vv({},e,{searchNavigationData:vv({},e.searchNavigationData,t.payload)});case bb.OPEN_ENTITY:{var r;const n=(0,O.removeDtssPrefixFromEntityUri)(t.payload.uri);return"navigation"===t.payload.source||n===(null===(r=e.searchNavigationData)||void 0===r?void 0:r.uri)?e:vv({},e,{searchNavigationData:null})}default:return e}},Cv=e=>{let{uri:t,source:r=null,screen:n="profile"}=e;return{type:bb.OPEN_ENTITY,payload:{uri:t,source:r,screen:n}}},Sv=e=>{let{entity:t}=e;return{type:bb.NEW_ENTITY_SHOWN,payload:{entity:t}}},wv=db(bb.ENTITY_DELETION_FINISHED),Av=db(bb.OPEN_PERSPECTIVE),Rv=e=>({type:bb.SHOW_NOTIFICATION,payload:e}),_v=e=>({type:bb.CLOSE_NOTIFICATION,payload:e}),Iv=db(bb.CLEAR_NOTIFICATIONS),Nv=db(bb.PATHS_SET),Dv=db(bb.UI_PATH_SET),Pv=db(bb.UI_CONFIG_LOADED),kv=db(bb.NEW_UI_CONFIG_LOADED),Lv=db(bb.LOCALE_ATTRIBUTE_PRESENTATION_LOADED),Uv=db(bb.AUTOCLOSE_INTERVAL_LOADED),jv=db(bb.SET_PREFER_REACT),Fv=db(bb.NUMBER_FORMAT_UPDATED),Mv=(e,t,r)=>({type:bb.OPEN_CONSOLE_APP,payload:{name:e,path:t,query:r}}),Vv=db(bb.OPEN_APP_FROM_CHOCOLATE_BAR),Bv=db(bb.OPEN_GRAPH),zv=db(bb.LOCALIZATION_LOADED),Hv=db(bb.DATE_MASK_UPDATED),Yv=db(bb.DATE_TIME_MASK_UPDATED),Wv=e=>({type:bb.OPEN_SEARCH,payload:"searchState"in e?e:{searchState:e}}),Gv=e=>({type:bb.OPEN_DASHBOARD,payload:e}),qv=db(bb.OPEN_HISTORY_EVENT),Zv=db(bb.OPEN_NEW_ENTITY_WITH_AUTHORING),$v=db(bb.OPEN_PREVIOUS_PAGE),Kv=db(bb.NAVIGATE),Xv=db(bb.KEYS_SET),Qv=db(bb.OPEN_PIVOTING_PERSPECTIVE),Jv=db(bb.ERROR_SET),eT=db(bb.DOCUMENTATION_SET),tT=db(bb.ADD_DASHBOARD_EXTERNAL_VIEW),rT=db(bb.SET_USE_SHARED_PREFERENCES);function nT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){aT(e,t,r[t])}))}return e}function aT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oT=(0,R.path)(["paths","imagePath"]),iT=(0,R.path)(["paths","exportPath"]),lT=(0,R.path)(["paths","apiPath"]),sT=(0,R.path)(["paths","uiPath"]),cT=(0,R.path)(["paths","reltioPath"]),uT=(0,R.path)(["paths","dtssPath"]),pT=(0,R.path)(["paths","exportDQPath"]),dT=(0,R.either)((0,R.path)(["newConfig","properties","workflow","path"]),(0,R.path)(["paths","workflowPath"])),mT=(0,R.prop)("paths"),yT=(0,R.path)(["paths","workflowEnvironmentURL"]),gT=(0,R.path)(["paths","collaborationPath"]),fT=(0,R.path)(["paths","imageServicePath"]),hT=(0,R.path)(["paths","dvfPath"]),ET=(0,R.path)(["paths","validationServicePath"]),bT=(0,R.path)(["paths","adminToolsPath"]),vT=(0,R.path)(["paths","mlDqPath"]),TT=(0,Dc.createSelector)((e=>(0,R.path)(["newConfig","properties","attributes","presentation"])(e)),(()=>O.intl.getLocale()),(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return nT({},e,(0,O.getSpecialAttributesPresentation)(e,t))})),OT=(0,R.either)((0,R.path)(["config","com.reltio.plugins.entity.EntityRequestSettings","defaultMaxValues"]),(0,R.path)(["newConfig","properties","entity","maxValuesInResponse"])),xT=(0,R.path)(["numberFormat"]),CT=(0,R.either)((0,R.path)(["newConfig","properties","masks","dateMask"]),(0,R.path)(["dateMask"])),ST=(0,R.path)(["notifications"]),wT=(0,R.either)((0,R.path)(["newConfig","properties","masks","dateTimeMask"]),(0,R.path)(["dateTimeMask"])),AT=(0,R.path)(["newConfig","properties","requestProvider"]),RT=["config","com.reltio.plugins.pivoting.PivotingSettings","pivotingAttributes"],_T=(0,R.chain)((0,R.prop)("attributeTypes")),IT=(0,R.ifElse)((0,R.hasPath)(RT),(0,R.path)(RT),(0,R.pipe)((0,R.pathOr)([],["newConfig","pivoting"]),_T)),NT=(0,R.either)((0,R.path)(["config","com.reltio.plugins.imageattribute.fieldsorder"]),(0,R.path)(["newConfig","properties","image","attributeFieldsOrder"])),DT=(0,R.either)((0,R.path)(["config","com.reltio.plugins.ui.LookupAutocomplete"]),(0,R.path)(["newConfig","properties","lookups","autocomplete"])),PT=(0,R.path)(["keys","googleMapKey"]),kT=(0,R.path)(["keys","icpLicenseKey"]),LT=(0,R.pathOr)("",["documentation","releaseNotes"]),UT=["config","com.reltio.plugins.entity.ValidationServiceLevels","levels"],jT=(0,R.ifElse)((0,R.hasPath)(UT),(0,R.path)(UT),(0,R.path)(["newConfig","properties","validation","levels"])),FT=(0,R.ifElse)((0,R.hasPath)(["config","com.reltio.plugins.entity.Validation","validateReadMode"]),(0,R.path)(["config","com.reltio.plugins.entity.Validation","validateReadMode"]),(0,R.pathOr)(!0,["newConfig","properties","validation","validateReadMode"])),MT=(0,R.pathOr)(!1,["newConfig","properties","validation","validateRelations"]),VT=(0,R.pathOr)(!1,["newConfig","properties","validation","validateReferenceEntityInReadMode"]),BT=(0,R.either)((0,R.path)(["config","com.reltio.plugins.workflow.configuration","enabled"]),(0,R.path)(["newConfig","properties","workflow","enabled"])),zT=(0,R.path)(["error"]),HT=(0,R.path)(["paths","servicesPath"]),YT=(0,R.path)(["newConfig"]),WT=(0,R.path)(["newConfig","layout"]),GT=(0,R.path)(["newConfig","profile"]),qT=(0,R.pathOr)(!0,["newConfig","properties","showEntityId"]),ZT=(0,R.path)(["newConfig","properties","release"]),$T=(0,R.path)(["newConfig","properties","logo"]),KT=(0,R.path)(["newConfig","properties","headerColor"]),XT=(0,R.path)(["newConfig","properties","showSearchByOv"]),QT=(0,R.path)(["newConfig","properties","showAttributeDescription"]),JT=(0,R.path)(["newConfig","properties","attributes","sorting"]),eO=(0,R.path)(["newConfig","properties","profileCheckUpdate"]),tO=(0,R.pathOr)(!1,["newConfig","properties","aiAssistant","enabled"]),rO=(0,R.pathOr)(500,["newConfig","properties","aiAssistant","messagesPerDay"]),nO=(0,R.path)(["newConfig","properties","aiAssistant","skills"]),aO=(0,R.path)(["newConfig","properties","aiAssistant","historyBufferSize"]),oO=(0,R.pathOr)(!1,["newConfig","properties","queryEstimator","enabled"]),iO=(0,R.pathOr)(!1,["newConfig","properties","sharedPreferences","enabled"]);function lO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){sO(e,t,r[t])}))}return e}function sO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cO={},uO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:cO,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case bb.PATHS_SET:return lO({},e,{paths:t.payload});case bb.UI_PATH_SET:return(0,R.evolve)({paths:(0,R.assoc)("uiPath",t.payload)},e);case bb.UI_CONFIG_LOADED:return lO({},e,{config:t.payload});case bb.NEW_UI_CONFIG_LOADED:return lO({},e,{newConfig:t.payload});case bb.LOCALE_ATTRIBUTE_PRESENTATION_LOADED:return(0,R.evolve)({newConfig:{properties:{attributes:{presentation:(0,R.assoc)(O.LOCALE_ATTRIBUTE_PRESENTATION,t.payload)}}}},e);case bb.AUTOCLOSE_INTERVAL_LOADED:return lO({},e,{autoCloseInterval:t.payload});case bb.NUMBER_FORMAT_UPDATED:return lO({},e,{numberFormat:t.payload});case bb.DATE_MASK_UPDATED:return lO({},e,{dateMask:t.payload});case bb.DATE_TIME_MASK_UPDATED:return lO({},e,{dateTimeMask:t.payload});case bb.KEYS_SET:return lO({},e,{keys:t.payload});case bb.ERROR_SET:return lO({},e,{error:t.payload});case bb.DOCUMENTATION_SET:return lO({},e,{documentation:t.payload});case bb.SHOW_NOTIFICATION:return lO({},e,{notifications:[...e.notifications||[],t.payload]});case bb.CLOSE_NOTIFICATION:return(0,R.evolve)({notifications:(0,R.reject)((0,R.propEq)("id",t.payload))},e);case bb.CLEAR_NOTIFICATIONS:return lO({},e,{notifications:[]});case bb.SET_USE_SHARED_PREFERENCES:return lO({},e,{useSharedPreferences:t.payload});default:return e}},pO="USER_UPDATED",dO=(db(pO),null),mO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dO,t=arguments.length>1?arguments[1]:void 0;return t.type===pO?t.payload||dO:e},yO="TENANT_UPDATED",gO="TENANT_NAME_UPDATED",fO=(db(yO),db(gO),(0,R.prop)("id")),hO=(0,R.prop)("name");function EO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){bO(e,t,r[t])}))}return e}function bO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case yO:return EO({},e,{id:t.payload});case gO:return EO({},e,{name:t.payload});default:return e}},TO="ENVIRONMENT_UPDATED",OO="ENVIRONMENT_ALIAS_UPDATED",xO=(db(TO),db(OO),(0,R.prop)("id")),CO=(0,R.prop)("alias");function SO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){wO(e,t,r[t])}))}return e}function wO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const AO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case TO:return SO({},e,{id:t.payload});case OO:return SO({},e,{alias:t.payload});default:return e}},RO=e=>e.dataTenants,_O=e=>e.tenants,IO=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vC(e);return e.metadata&&e.metadata[t]},NO=e=>e.tenant,DO=e=>e.environment,PO=e=>e.user,kO=e=>e.ui,LO=e=>e.profile,UO=e=>e.search,jO=e=>ER(LO(e)),FO=e=>DR(LO(e)),MO=e=>PR(LO(e)),VO=(e,t)=>BR(LO(e),t),BO=(e,t,r)=>FR(LO(e),t,r),zO=(e,t,r)=>MR(LO(e),t,r),HO=(e,t,r)=>jR(LO(e),t,r),YO=(e,t)=>zR(LO(e),t),WO=e=>HR(LO(e)),GO=(e,t,r)=>VR(LO(e),t,r),qO=e=>xR(LO(e)),ZO=e=>vR(LO(e)),$O=e=>UR(LO(e)),KO=e=>y_(LO(e)),XO=e=>g_(LO(e)),QO=e=>f_(LO(e)),JO=e=>h_(LO(e)),ex=e=>E_(LO(e)),tx=(e,t)=>kR(LO(e),t),rx=(e,t)=>LR(LO(e),t),nx=e=>bR(LO(e)),ax=(e,t)=>b_(LO(e),t),ox=(e,t,r)=>{let{uri:n}=r;return e_(LO(e),t,n)},ix=(e,t,r)=>{let{uri:n}=r;return t_(LO(e),t,n)},lx=(e,t,r)=>r_(LO(e),t,r),sx=e=>oT(kO(e)),cx=e=>lT(kO(e)),ux=e=>iT(kO(e)),px=e=>sT(kO(e)),dx=e=>cT(kO(e)),mx=e=>fT(kO(e)),yx=e=>bT(kO(e)),gx=e=>TT(kO(e)),fx=e=>xT(kO(e)),hx=e=>OT(kO(e)),Ex=e=>(e=>e.autoCloseInterval)(kO(e)),bx=e=>CT(kO(e)),vx=e=>wT(kO(e)),Tx=e=>AT(kO(e)),Ox=e=>ST(kO(e)),xx=e=>IT(kO(e)),Cx=e=>NT(kO(e)),Sx=e=>DT(kO(e)),wx=e=>PT(kO(e)),Ax=e=>kT(kO(e)),Rx=e=>jT(kO(e)),_x=e=>FT(kO(e)),Ix=e=>MT(kO(e)),Nx=e=>VT(kO(e)),Dx=e=>tO(kO(e)),Px=e=>rO(kO(e)),kx=e=>nO(kO(e)),Lx=e=>aO(kO(e)),Ux=e=>iO(kO(e)),jx=e=>(e=>e.searchResults)(UO(e)),Fx=e=>(e=>e.keyword)(UO(e)),Mx=e=>O.getActivityFilter(UO(e)),Vx=e=>O.getSearchOptions(UO(e)),Bx=e=>(e=>e.searchProviderData)(UO(e)),zx=e=>(e=>e.searchNavigationData)(UO(e)),Hx=(e,t)=>O.getGlobalSearchRequestOptions(UO(e),t),Yx=e=>O.getStringifiedSearchOptions(UO(e)),Wx=e=>(e=>e.globalFilter)(UO(e)),Gx=e=>O.getGlobalFilterQuery(UO(e)),qx=e=>gv(UO(e)),Zx=e=>SR(LO(e)),$x=e=>YR(LO(e)),Kx=e=>WR(LO(e)),Xx=e=>GR(LO(e)),Qx=e=>TR(LO(e)),Jx=(e,t)=>qR(LO(e),t),eC=(e,t)=>ZR(LO(e),t),tC=(e,t)=>$R(LO(e),t),rC=(e,t,r)=>KR(LO(e),t,r),nC=(e,t,r)=>XR(LO(e),t,r),aC=(e,t,r)=>QR(LO(e),t,r),oC=(e,t)=>JR(LO(e),t),iC=e=>oT(kO(e))||lT(kO(e)),lC=e=>(e=>null==e?void 0:e.username)(PO(e)),sC=e=>(e=>null==e?void 0:e.roles)(PO(e)),cC=e=>OR(LO(e)),uC=(e,t)=>n_(LO(e),t),pC=(e,t)=>a_(LO(e),t),dC=(e,t)=>o_(LO(e),t),mC=e=>i_(LO(e)),yC=(e,t,r)=>l_(LO(e),t,r),gC=(e,t)=>s_(LO(e),t),fC=e=>wR(LO(e)),hC=e=>RR(LO(e)),EC=e=>_R(LO(e)),bC=e=>C_(LO(e),zS(e)),vC=e=>fO(NO(e)),TC=e=>hO(NO(e)),OC=e=>xO(DO(e)),xC=e=>CO(DO(e)),CC=e=>uT(kO(e)),SC=e=>pT(kO(e)),wC=e=>dT(kO(e)),AC=e=>mT(kO(e)),RC=e=>yT(kO(e)),_C=e=>BT(kO(e)),IC=e=>gT(kO(e)),NC=e=>hT(kO(e)),DC=e=>ET(kO(e)),PC=e=>vT(kO(e)),kC=(0,Dc.createSelector)(PO,vC,O.canUserRegisterConfigEnvironments),LC=(0,Dc.createSelector)(PO,vC,O.canUserCreateWorkflowConfigJar),UC=(0,Dc.createSelector)(PO,vC,O.canUserCreateWorkflowEnvironmentConfigJar),jC=(0,Dc.createSelector)(PO,vC,O.canUserExecuteWorkflowJobs),FC=(0,Dc.createSelector)(PO,vC,O.canUserExecuteWorkflowJobsSyncBusinessProcessData),MC=(0,Dc.createSelector)(PO,vC,O.canUserExecuteWorkflowJobsTerminateProcessInstance),VC=(0,Dc.createSelector)(PO,vC,O.canUserExecuteWorkflowJobsUpdateTasks),BC=(0,Dc.createSelector)(PO,vC,O.canUserExecuteWorkflowJobsValidateTasks),zC=(0,Dc.createSelector)(PO,vC,O.canUserManageWorkflowDefinition),HC=(0,Dc.createSelector)(PO,vC,O.canUserManageWorkflowEnvironmentDefinition),YC=(0,Dc.createSelector)(PO,vC,O.canUserReadWorkflowDataTask),WC=(0,Dc.createSelector)(PO,vC,O.canUserUpdateProcessInstance),GC=(0,Dc.createSelector)(PO,vC,O.canUserUpdateWorkflowDataTask),qC=(0,Dc.createSelector)(PO,vC,O.canUserViewProcessInstanceSearchQuery),ZC=(0,Dc.createSelector)(PO,vC,O.canUserViewWorkflowConfigJar),$C=(0,Dc.createSelector)(PO,vC,O.canUserViewWorkflowDefinition),KC=(0,Dc.createSelector)(PO,vC,O.canUserViewWorkflowEnvironmentConfigJar),XC=(0,Dc.createSelector)(PO,vC,O.canUserViewWorkflowJobs),QC=(0,Dc.createSelector)(PO,vC,O.canUserMakeExport),JC=(0,Dc.createSelector)(PO,vC,O.canUserMakeActivitiesExport),eS=(0,Dc.createSelector)(PO,vC,O.canUserImportEntitiesFromDT),tS=(0,Dc.createSelector)(PO,vC,O.canUserReadEntitiesFromDT),rS=(0,Dc.createSelector)(PO,vC,O.canUserStartProcessInstanceFromQuery),nS=(0,Dc.createSelector)(PO,vC,O.canUserMakeBulkUpdate),aS=(0,Dc.createSelector)(PO,vC,O.canUserDeleteProfiles),oS=(0,Dc.createSelector)(PO,vC,O.canUserOpenDataLoader),iS=(0,Dc.createSelector)(PO,vC,O.canUserGetDQStatistic),lS=(0,Dc.createSelector)(PO,vC,O.canUserReadDVF),sS=(0,Dc.createSelector)(IC,JO,((e,t)=>!!e&&!t)),cS=(0,Dc.createSelector)(wC,_C,((e,t)=>!!e&&!!t)),uS=(e,t)=>{var r;return null===(r=IR(LO(e)))||void 0===r?void 0:r.find((0,R.propEq)("id",t))},pS=(e,t)=>Boolean(uS(e,t)),dS=e=>pS(e,O.SidePanelViewId.Workflow),mS=e=>pS(e,O.SidePanelViewId.Discussion),yS=e=>pS(e,O.SidePanelViewId.History),gS=e=>pS(e,O.SidePanelViewId.DB),fS=e=>{var t,r;return null!==(t=null===(r=uS(e,O.SidePanelViewId.DB))||void 0===r?void 0:r.views)&&void 0!==t?t:[]},hS=e=>CR(LO(e)),ES=e=>c_(LO(e)),bS=(e,t)=>u_(LO(e),t),vS=e=>p_(LO(e)),TS=e=>d_(LO(e)),OS=(e,t)=>m_(LO(e),t),xS=e=>zT(kO(e)),CS=(e,t)=>{const r=IO(e),n=Zx(e),a=jO(e),{nextEntry:o,inRelations:i=[],outRelations:l=[]}=t,s=n===O.Mode.Editing||n===O.Mode.Suggesting,c=n===O.Mode.Suggesting&&(0,O.isTempUri)(null==a?void 0:a.uri),u=zS(e);if(!s||c&&!u||o||!a)return!1;{const e=(0,O.checkMetadataForUpdate)(n,(0,O.getEntityType)(r,a.type)),t=i.concat(l).map((e=>(0,O.getRelationType)(r,e.uri||e))).some((0,R.both)((0,O.checkMetadataForCreate)(n),(0,O.checkMetadataForUpdate)(n)));return e&&t}},SS=(0,Dc.createSelector)(jO,Kx,QO,KO,O.getProfileEntityWithHistoryDiff),wS=(0,Dc.createSelector)(jO,Kx,QO,O.getProfileEntityWithoutHistoryDiff),AS=e=>HT(kO(e)),RS=e=>YT(kO(e)),_S=e=>WT(kO(e)),IS=e=>GT(kO(e)),NS=e=>qT(kO(e)),DS=e=>ZT(kO(e)),PS=e=>LT(kO(e)),kS=e=>$T(kO(e)),LS=e=>KT(kO(e)),US=e=>XT(kO(e)),jS=e=>QT(kO(e)),FS=e=>JT(kO(e)),MS=e=>eO(kO(e)),VS=(e,t)=>((e,t)=>(0,O.getAuthoringItemsFromLayoutByEntityType)(GT(e),t))(kO(e),t),BS=(e,t)=>((e,t)=>(0,R.path)(["newConfig","properties","cleanse",t])(e))(kO(e),t),zS=e=>{const t=jO(e),r=VS(e,null==t?void 0:t.type);return!(0,O.isEmptyValue)(r)},HS=e=>oO(kO(e)),YS=e=>NR(LO(e));let WS=function(e){return e.MODIFIED_ENTITY_CREATED="MODIFIED_ENTITY_CREATED",e.MODIFIED_ENTITY_DELETED="MODIFIED_ENTITY_DELETED",e.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET="MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET",e.MODIFIED_ENTITIES_RESET="MODIFIED_ENTITIES_RESET",e.CLEANSE_LOADING="CLEANSE_LOADING",e}({}),GS=function(e){return e.RELATIONS_LOADED="RELATIONS_LOADED",e.REMOVE_RELATION="REMOVE_RELATION",e.EDIT_RELATION="EDIT_RELATION",e.ADD_RELATION="ADD_RELATION",e.OPEN_RELATION_EDITOR="OPEN_RELATION_EDITOR",e.CLOSE_RELATION_EDITOR="CLOSE_RELATION_EDITOR",e.SET_RELATION_TYPE="SET_RELATION_TYPE",e.SET_RELATION_ENTITY="SET_RELATION_ENTITY",e.SET_INITIAL_INFO="SET_INITIAL_INFO",e.IGNORE_RELATION="IGNORE_RELATION",e.SECOND_LEVEL_RELATIONS_LOADED="SECOND_LEVEL_RELATIONS_LOADED",e}({});var qS=r(51095);const ZS=(e,t)=>e.find((0,R.pipe)(O.getRelationUriFromConnection,(0,R.equals)(t))),$S=(e,t)=>(0,R.path)([t,"connections"],e),KS=r.n(qS)()($S,((e,t)=>(0,R.path)([t,"drafts"],e)),((e,t,r)=>r),(function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const{addedConnections:a=[],editedConnections:o=[],removedUris:i=[],ignoredRelationData:l=[]}=r,s=(0,R.pipe)(O.getRelationUriFromConnection,R.equals,(0,R.find)(R.__,i)),c=l.map((e=>e.relationUri)),u=(0,R.pipe)(O.getRelationUriFromConnection,R.equals,(0,R.find)(R.__,c)),p=e=>(0,R.pipe)((0,R.eqBy)(O.getRelationUriFromConnection),(0,R.find)(R.__,o),(0,R.unless)(R.isNil,O.markEdited))(e),d=n?(null===(e=t.find((e=>e.entity.entityUri===n)))||void 0===e?void 0:e.connections)||[]:t,m=a.filter((0,R.propEq)("parentEntityUri",n));return m.map(O.markNew).concat(d.filter((e=>!m.some((0,R.pipe)(O.getRelationUriFromConnection,(0,R.equals)((0,O.getRelationUriFromConnection)(e)))))).map((0,R.pipe)((0,R.either)(p,R.identity),(0,R.when)(s,O.markRemoved),(0,R.when)(u,O.markIgnored))))}))(((e,t,r)=>t+r)),XS=(e,t,r)=>{const n=(0,O.getTempRelations)(e,t);return ZS(n,r)};function*QS(e){yield(0,Fa.gw)(0);const t=e.payload,r=yield(0,Fa.Ys)(IO),n=yield(0,Fa.Ys)(ES),a=[t.type],o=yield(0,Fa.Ys)(vS),i=(0,O.initDependentLookups)({structure:n,metadata:r,typeUris:a,alreadyAddedTypeUris:o}),l=(0,O.populateDependentLookupsFromEntity)({structure:i,metadata:r,entityOrRelation:t});yield(0,Fa.gz)(Mb(l)),yield(0,Fa.gz)(Vb(a))}function*JS(e,t){const r=(0,O.getBaseUri)(e);return(0,O.isRelationUri)(r)?yield(0,Fa.Ys)(zO,t,r):yield(0,Fa.Ys)(tx,r)}function*ew(e){const{attributeType:t,metadata:r,parentUri:n,viewId:a}=e.payload,o=yield(0,Fa.RE)(JS,n,a),i=yield(0,Fa.Ys)(ES);if(o)if(t){const e=(0,O.findAttributeValuesByTypeUri)(r,o,t.uri).filter((e=>{let{uri:t}=e;return t.startsWith(n)}))[0],a=(0,O.addValueToDependentLookups)({structure:i,attributeValue:e});yield(0,Fa.gz)(Mb(a))}else{const e=[o.type],t=yield(0,Fa.Ys)(vS),n=(0,O.initDependentLookups)({structure:i,metadata:r,typeUris:e,alreadyAddedTypeUris:t}),a=(0,O.populateDependentLookupsFromEntity)({structure:n,metadata:r,entityOrRelation:o});yield(0,Fa.gz)(Mb(a)),yield(0,Fa.gz)(Vb(e))}}function*tw(e){const t=e.payload,r=yield(0,Fa.Ys)(IO),n=yield(0,Fa.Ys)(ES);let a=n;for(const e of t){const{attributeType:t,parentUri:o,viewId:i}=e;if((0,O.isAttributeTypeInDependentLookups)(n,t.uri)){const e=yield(0,Fa.RE)(JS,o,i);e&&(a=(0,O.syncAttributeTypeWithDependentLookups)({structure:a,entityOrRelation:e,attrTypeUri:t.uri,metadata:r}))}}a!==n&&(yield(0,Fa.gz)(Mb(a)))}function*rw(e){let{structure:t,attributeType:r,value:n}=e;if((0,O.isReference)(r)&&n){const e=(0,O.getReferencedEntityUriFromAttrValue)(n);if((0,O.isTempUri)(e))return yield(0,Fa.RE)(iw,t,e)}return t}function*nw(e){let{structure:t,uri:r,attributeType:n,value:a}=e,o=(0,O.removeValuesFromDependentLookups)({structure:t,uri:r});if(o=yield(0,Fa.RE)(rw,{structure:o,attributeType:n,value:a}),o=(0,O.addValueToDependentLookups)({structure:o,attributeValue:a}),(0,O.isReference)(n)&&a){const e=(0,O.getReferencedEntityUriFromAttrValue)(a);(0,O.isTempUri)(e)&&(o=yield(0,Fa.RE)(ow,o,e))}o!==t&&(yield(0,Fa.gz)(Mb(o)))}function*aw(e){yield(0,Fa.gw)(0);const{attributeType:t,uri:r,viewId:n,silent:a,value:o}=e.payload,i=yield(0,Fa.Ys)(ES),l=yield(0,Fa.RE)(JS,r,n);if(l&&(0,O.isAttributeTypeInDependentLookups)(i,t.uri)){const{value:n,lookupCode:o}=e.payload.value,l=o||n;a||(yield(0,Fa.rM)(cw,i,{type:t.uri,uri:r,lookupValue:l}));const s=(0,O.addValueToDependentLookups)({structure:i,attributeValue:{type:t.uri,value:l,uri:r}});yield(0,Fa.gz)(Mb(s))}l&&(0,O.isComplexAttribute)(t.type)&&(yield(0,Fa.RE)(nw,{structure:i,uri:r,attributeType:t,value:o}))}function*ow(e,t){const r=yield(0,Fa.Ys)(IO),n=yield(0,Fa.Ys)(tx,t);if(!n)return e;const a=yield(0,Fa.Ys)(nx),o=(0,O.findRelatedTemporaryEntities)(a,n);let i=e;for(const e of[n,...o])i=(0,O.populateDependentLookupsFromEntity)({structure:i,metadata:r,entityOrRelation:e});return i}function*iw(e,t){const r=yield(0,Fa.Ys)(tx,t),n=yield(0,Fa.Ys)(nx),a=(0,O.findRelatedTemporaryEntities)(n,r).map((0,R.prop)("uri"));let o=e;for(const e of[t,...a])o=(0,O.removeValuesFromDependentLookups)({structure:o,uri:e});return o}function*lw(e){const{attributeType:t,uri:r,attributeValue:n,viewId:a}=e.payload,o=yield(0,Fa.Ys)(ES),i=(0,O.isAttributeTypeInDependentLookups)(o,t.uri);if(yield(0,Fa.RE)(JS,r,a)){i&&(yield(0,Fa.rM)(cw,o,{type:t.uri,uri:r,lookupValue:""}));let e=i||(0,O.isComplexAttribute)(t)?(0,O.removeValuesFromDependentLookups)({structure:o,uri:r}):o;e=yield(0,Fa.RE)(rw,{structure:e,attributeType:t,value:n}),e!==o&&(yield(0,Fa.gz)(Mb(e)))}}function*sw(e){yield(0,Fa.gw)(0);const t=yield(0,Fa.Ys)(ES),r=yield(0,Fa.RE)(iw,t,e.payload);yield(0,Fa.gz)(Mb(r))}function*cw(e,t){const r=yield(0,Fa.Ys)(IO),n=yield(0,Fa.Ys)(nx),a=yield(0,Fa.Ys)(tC),o=yield(0,Fa.Ys)(FO),i=yield(0,Fa.Ys)(Sx),l=yield(0,Fa.Ys)(TS),s=(0,O.getDependentLookupStateForValueUri)({structure:e,typeUri:t.type,valueUri:t.uri,modifiedEntities:n,connections:a,entityUri:o,config:i,editorsState:l});if(s.length>0){const e=s.map((e=>e.uri));yield(0,Fa.gz)(Bb({uris:e,isBlocked:!0}));try{const e=yield(0,Fa.RE)(O.cascadeUpdate,s,t);for(const n of e){const{type:e,uri:a,lookupValue:o,displayName:i}=n,l=(yield(0,Fa.Ys)(oC,(0,O.getBaseUri)(a)))[0],s=yield(0,Fa.RE)(JS,a,l);s&&(0,O.findAttributeValueByUri)(s,a)&&a!==t.uri&&(yield(0,Fa.gz)(_b({attributeType:(0,O.findAttributeTypeByUri)(r,e),uri:a,value:{value:i||"",lookupCode:o||""},silent:!0,viewId:l})))}}catch(e){console.warn(e)}yield(0,Fa.gz)(Bb({uris:e,isBlocked:!1}))}}function*uw(e){const t=e.payload.connection,r=(0,O.getEntityUriFromConnection)(t);if((0,O.isTempUri)(r)&&(yield(0,Fa.Ys)(tx,r))){yield(0,Fa.qn)(Fb.DEPENDENT_LOOKUPS_STRUCTURE_SET);const e=yield(0,Fa.Ys)(ES),t=yield(0,Fa.RE)(ow,e,r);yield(0,Fa.gz)(Mb(t))}}function*pw(e){const t=e.payload.relationUri,r=yield(0,Fa.Ys)(ES),n=(0,O.removeValuesFromDependentLookups)({structure:r,uri:t});yield(0,Fa.gz)(Mb(n))}function*dw(e){const t=e.payload.id,r=e.payload.relationUri;if(0===(yield(0,Fa.Ys)(oC,r)).length){const e=yield(0,Fa.Ys)(ES);let n=(0,O.removeValuesFromDependentLookups)({structure:e,uri:r});const a=yield(0,Fa.Ys)(HO,t),o=ZS(a,r),i=(0,O.getEntityUriFromConnection)(o);(0,O.isTempUri)(i)&&(n=yield(0,Fa.RE)(iw,n,i)),yield(0,Fa.gz)(Mb(n))}}const mw=[function*(){yield(0,Fa.ib)(WS.MODIFIED_ENTITY_CREATED,QS)},function*(){yield(0,Fa.ib)(WS.MODIFIED_ENTITY_DELETED,sw)},function*(){yield(0,Fa.ib)(wb.ADD_DEFAULT_VALUES,ew)},function*(){yield(0,Fa.ib)(wb.ADD_ATTRIBUTES,tw)},function*(){yield(0,Fa.ib)(wb.MODIFY_ATTRIBUTE,aw)},function*(){yield(0,Fa.ib)(wb.REMOVE_ATTRIBUTE,lw)},function*(){yield(0,Fa.ib)(GS.OPEN_RELATION_EDITOR,uw)},function*(){yield(0,Fa.ib)(GS.SET_RELATION_TYPE,pw)},function*(){yield(0,Fa.ib)(GS.CLOSE_RELATION_EDITOR,dw)}];let yw=function(e){return e.ENTITY_LOADED="ENTITY_LOADED",e.DEFAULT_PROFILE_PIC_SET="DEFAULT_PROFILE_PIC_SET",e.LOAD_ENTITY="LOAD_ENTITY",e.ENTITY_CREATION_REQUESTED="ENTITY_CREATION_REQUESTED",e.ENTITY_CREATION_WITH_AUTHORING_REQUESTED="ENTITY_CREATION_WITH_AUTHORING_REQUESTED",e.ENTITY_REMOVE_REQUESTED="ENTITY_REMOVE_REQUESTED",e.CLEAR_ENTITY="CLEAR_ENTITY",e.CLONE_ENTITY="CLONE_ENTITY",e.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED="ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED",e}({});const gw=(e,t)=>({type:yw.ENTITY_LOADED,payload:{entity:e,keepErrors:t}}),fw=db(yw.DEFAULT_PROFILE_PIC_SET),hw=db(yw.LOAD_ENTITY),Ew=db(yw.ENTITY_CREATION_REQUESTED),bw=db(yw.ENTITY_CREATION_WITH_AUTHORING_REQUESTED),vw=db(yw.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED),Tw=db(yw.ENTITY_REMOVE_REQUESTED),Ow=db(yw.CLONE_ENTITY),xw=db(yw.CLEAR_ENTITY),Cw=e=>null==e?void 0:e.uri,Sw=(0,Dc.createSelector)((e=>null==e?void 0:e.dataTenant),Cw,((e,t)=>(0,O.getEntityUriForLink)({dataTenant:e,uri:t})));function ww(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Aw(e,t,r[t])}))}return e}function Aw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Rw={};let _w=function(e){return e.ERRORS_SET="ERRORS_SET",e.REMOVE_ERROR="REMOVE_ERROR",e.ERROR_DEACTIVATED="ERROR_DEACTIVATED",e}({});const Iw=db(_w.ERROR_DEACTIVATED),Nw=db(_w.ERRORS_SET);function Dw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Pw(e,t,r[t])}))}return e}function Pw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kw=[];let Lw=function(e){return e.HISTORY_DIFF_SET="HISTORY_DIFF_SET",e.HISTORY_DIFF_CLEARED="HISTORY_DIFF_CLEARED",e.HISTORY_EVENT_SET="HISTORY_EVENT_SET",e.HISTORY_EVENT_CLEARED="HISTORY_EVENT_CLEARED",e.HISTORY_SLICE_SET="HISTORY_SLICE_SET",e.HISTORY_MODE_SET="HISTORY_MODE_SET",e}({});const Uw=db(Lw.HISTORY_DIFF_SET),jw=db(Lw.HISTORY_DIFF_CLEARED),Fw=db(Lw.HISTORY_EVENT_SET),Mw=db(Lw.HISTORY_EVENT_CLEARED),Vw=db(Lw.HISTORY_SLICE_SET),Bw=db(Lw.HISTORY_MODE_SET);function zw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Hw(e,t,r[t])}))}return e}function Hw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Yw={mode:O.HistoryMode.Current};let Ww=function(e){return e.PROFILE_LAST_LOADED_TIME_UPDATE="PROFILE_LAST_LOADED_TIME_UPDATE",e}({});db(Ww.PROFILE_LAST_LOADED_TIME_UPDATE);let Gw=function(e){return e.LOOKUPS_LOADED="LOOKUPS_LOADED",e.LOOKUPS_FOR_TYPE_RESOLVED="LOOKUPS_FOR_TYPE_RESOLVED",e.LOOKUPS_LIST_RESOLVED="LOOKUPS_LIST_RESOLVED",e}({});const qw=db(Gw.LOOKUPS_LOADED),Zw=db(Gw.LOOKUPS_FOR_TYPE_RESOLVED),$w=db(Gw.LOOKUPS_LIST_RESOLVED);function Kw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Xw(e,t,r[t])}))}return e}function Xw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qw={},Jw=(e,t)=>({type:Hb.MODE_UPDATED,payload:{mode:e,silent:t}}),eA=db(Hb.MODE_CANCEL_EDITING),tA=db(Hb.MODE_EDITING_CANCELED),rA=O.isSuggestMode,nA=(O.isEditMode,O.isViewMode),aA=O.isEditableMode,oA=O.Mode.Viewing,iA=db(WS.MODIFIED_ENTITY_CREATED),lA=db(WS.MODIFIED_ENTITY_DELETED),sA=db(WS.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET),cA=db(WS.MODIFIED_ENTITIES_RESET),uA=db(WS.CLEANSE_LOADING);function pA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){dA(e,t,r[t])}))}return e}function dA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mA={};function yA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gA(e,t,r[t])}))}return e}function gA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*fA(e){const{values:t,parentUri:r,attributeTypeUri:n,attributeTypeName:a}=e.payload;let o=t;const i=yield(0,Fa.Ys)(jO);if(r===i.uri){const e=(0,O.getAttributeSource)(n),r=(0,R.pipe)((0,R.pathOr)([],[e,a]),(0,R.map)((0,R.prop)("uri")))(i),l=(0,R.intersection)(r,t.map((0,R.prop)("uri")));o=t.filter((e=>!l.includes(e.uri)))}o.length&&(yield(0,Fa.gz)(Nb(yA({},e.payload,{values:o}))))}function*hA(){return{apiPath:yield(0,Fa.Ys)(cx),tenant:yield(0,Fa.Ys)(vC)}}function*EA(e){const{attributeTypeName:t,attributeTypeUri:r}=e.payload,n=yield(0,Fa.RE)(hA);try{const a=yield(0,Fa.RE)(O.getPagedEntity,yA({},e.payload,n)),o=(0,O.getAttributeSource)(r),i=(0,R.pathOr)([],[o,t],a);yield(0,Fa.gz)(Db(yA({},e.payload,{values:i})))}catch(e){console.warn(e),yield(0,Fa.gz)(Jv((0,O.getRequestErrorMessage)(e,po().text("Something went wrong"))))}}function*bA(e){var t;const{attributeType:r,value:n,uri:a}=e.payload,o=r.uri,i=(0,O.getBaseUri)(o),l=yield(0,Fa.Ys)(BS,i);if(!l)return;const s=yield(0,Fa.Ys)(IO),c=(0,O.getEntityType)(s,i),u=null==c||null===(t=c.cleanseConfig)||void 0===t?void 0:t.infos;if(!u)return;const p=(0,O.getCleanseType)(l,o);if(!(0,O.hasCleanseTypeInEntityType)(p,u))return;const d=(0,O.getCleanseAttributes)(l);if(null!=d&&d.includes(o)){yield(0,Fa.gz)(uA({isLoading:!0}));try{const e=yield(0,Fa.RE)(O.cleanseData,{cleanseType:p.split("/cleanse/infos/")[1],type:i,attributes:{[r.name]:[{type:o,value:n}]}}),t=(0,O.getBaseUri)(a),l=yield(0,Fa.Ys)(tx,t);if((0,O.hasCleanseStatus)(e))if((0,O.isUnverifiedCleanse)(e))yield(0,Fa.gz)(Jv((0,R.path)(O.CLEANSE_STATUS_ERROR_PATH,e)));else if(l){const{attributes:r}=e,n=(0,O.prepareCleansedAttributes)(t,r);yield(0,Fa.gz)(iA(yA({},l,{attributes:yA({},l.attributes,n)})))}}catch(e){console.warn(e),yield(0,Fa.gz)(Jv((0,O.getRequestErrorMessage)(e,po().text("Something went wrong"))))}yield(0,Fa.gz)(uA({isLoading:!1}))}}const vA=[function*(){yield(0,Fa.ib)(wb.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES,EA)},function*(){yield(0,Fa.ib)(wb.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES,fA)},function*(){yield(0,Fa.ib)(wb.MODIFY_ATTRIBUTE,bA)}],TA=db(GS.RELATIONS_LOADED),OA=db(GS.SECOND_LEVEL_RELATIONS_LOADED),xA=(0,R.curry)(((e,t)=>({type:GS.REMOVE_RELATION,payload:{id:e,relationUri:t}}))),CA=(0,R.curry)(((e,t)=>({type:GS.IGNORE_RELATION,payload:{id:e,ignoredRelationData:t}}))),SA=(0,R.curry)(((e,t)=>({type:GS.ADD_RELATION,payload:{id:e,connection:t}}))),wA=(0,R.curry)(((e,t)=>({type:GS.EDIT_RELATION,payload:{id:e,connection:t}}))),AA=(0,R.curry)(((e,t)=>({type:GS.OPEN_RELATION_EDITOR,payload:{id:e,connection:t}}))),RA=(0,R.curry)(((e,t)=>({type:GS.CLOSE_RELATION_EDITOR,payload:{id:e,relationUri:t}}))),_A=(0,R.curry)(((e,t,r)=>({type:GS.SET_RELATION_TYPE,payload:{id:e,relationUri:t,relationType:r}}))),IA=(0,R.curry)(((e,t,r)=>({type:GS.SET_RELATION_ENTITY,payload:{id:e,relationUri:t,entityInfo:r}}))),NA=(0,R.curry)(((e,t,r)=>({type:GS.SET_INITIAL_INFO,payload:{id:e,relationUri:t,tempEntity:r}})));function DA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){PA(e,t,r[t])}))}return e}function PA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kA={},LA={removedUris:[],addedConnections:[],editedConnections:[],ignoredRelationData:[]},UA=(e,t,r)=>{if((0,R.pathEq)([...(0,O.getRelationToAddPath)(e),"relation","relationUri"],t,r))return(0,O.getRelationToAddPath)(e);{const n=((0,R.path)((0,O.getRelationsToEditPath)(e),r)||[]).findIndex((0,R.pathEq)(["relation","relationUri"],t));return n>=0?[...(0,O.getRelationsToEditPath)(e),n]:null}},jA=(e,t,r)=>{const n=UA(e,t,r);return n?(0,R.lensPath)([...n,"relation"]):null},FA=(0,R.pipe)(jA,(e=>(0,R.compose)(e,(0,R.lensProp)("object"))));let MA=function(e){return e.TREES_RESET_INITIAL_TREES="TREES_RESET_INITIAL_TREES",e.TREES_RESTORE_FROM_INITIAL_TREES="TREES_RESTORE_FROM_INITIAL_TREES",e.TREES_STATE_RESTORED="TREES_STATE_RESTORED",e.TREES_STATE_SAVED="TREES_STATE_SAVED",e.TREE_ACTIVENESS_DATE_CHANGED="TREE_ACTIVENESS_DATE_CHANGED",e.TREE_CHANGED="TREE_CHANGED",e.TREE_CHILDREN_LOADED="TREE_CHILDREN_LOADED",e.TREE_CHILDREN_LOADING="TREE_CHILDREN_LOADING",e.TREE_COMMANDS_CLEARED="TREE_COMMANDS_CLEARED",e.TREE_CURRENT_ENTITY_SHOWN="TREE_CURRENT_ENTITY_SHOWN",e.TREE_ENTITIES_MAPPING_LOADED="TREE_ENTITIES_MAPPING_LOADED",e.TREE_LOADED="TREE_LOADED",e.TREE_LOADED_WITH_ERROR="TREE_LOADED_WITH_ERROR",e.TREE_LOADING="TREE_LOADING",e.TREE_NODE_CREATED="TREE_NODE_CREATED",e.TREE_NODE_EDITED="TREE_NODE_EDITED",e.TREE_NODE_EDITING_APPLIED="TREE_NODE_EDITING_APPLIED",e.TREE_NODE_EDITING_CANCELED="TREE_NODE_EDITING_CANCELED",e.TREE_NODE_EDITING_STARTED="TREE_NODE_EDITING_STARTED",e.TREE_NODE_ENTITY_CHANGED="TREE_NODE_ENTITY_CHANGED",e.TREE_NODE_EXPANDED="TREE_NODE_EXPANDED",e.TREE_NODE_NEW_CHILD_EDITING_APPLIED="TREE_NODE_NEW_CHILD_EDITING_APPLIED",e.TREE_NODE_NEW_CHILD_EDITING_CANCELED="TREE_NODE_NEW_CHILD_EDITING_CANCELED",e.TREE_NODE_NEW_CHILD_EDITING_STARTED="TREE_NODE_NEW_CHILD_EDITING_STARTED",e.TREE_NODE_NEW_PARENT_EDITING_APPLIED="TREE_NODE_NEW_PARENT_EDITING_APPLIED",e.TREE_NODE_NEW_PARENT_EDITING_CANCELED="TREE_NODE_NEW_PARENT_EDITING_CANCELED",e.TREE_NODE_NEW_PARENT_EDITING_STARTED="TREE_NODE_NEW_PARENT_EDITING_STARTED",e.TREE_NODE_RELATION_TYPE_CHANGED="TREE_NODE_RELATION_TYPE_CHANGED",e.TREE_NODE_REMOVED="TREE_NODE_REMOVED",e.TREE_SECONDARY_LABEL_SHOWN="TREE_SECONDARY_LABEL_SHOWN",e.TREE_SCROLL_TO_NODE_RESET="TREE_SCROLL_TO_NODE_RESET",e.TREE_SORTED="TREE_SORTED",e.TREE_REFRESHED="TREE_REFRESHED",e.TREE_RELATION_CREATED="TREE_RELATION_CREATED",e.TREE_RELATION_EDITED="TREE_RELATION_EDITED",e.TREE_RELATION_REMOVED="TREE_RELATION_REMOVED",e.TREE_RELATION_REPOINTED="TREE_RELATION_REPOINTED",e.TREE_CANCEL_CHILDREN_LOADING="TREE_CANCEL_CHILDREN_LOADING",e}({});db(MA.TREE_LOADED),db(MA.TREE_LOADED_WITH_ERROR),db(MA.TREE_LOADING),db(MA.TREE_SCROLL_TO_NODE_RESET);const VA=db(MA.TREE_COMMANDS_CLEARED),BA=(db(MA.TREE_CHILDREN_LOADING),db(MA.TREE_CURRENT_ENTITY_SHOWN),db(MA.TREE_REFRESHED),db(MA.TREE_NODE_EXPANDED),db(MA.TREE_RELATION_REMOVED),db(MA.TREE_NODE_REMOVED),db(MA.TREE_SECONDARY_LABEL_SHOWN),db(MA.TREE_ENTITIES_MAPPING_LOADED),db(MA.TREE_CHANGED)),zA=(db(MA.TREE_NODE_EDITED),db(MA.TREE_ACTIVENESS_DATE_CHANGED),db(MA.TREE_RELATION_REPOINTED),db(MA.TREE_RELATION_CREATED),db(MA.TREE_NODE_CREATED),db(MA.TREE_RELATION_EDITED),db(MA.TREE_NODE_EDITED),db(MA.TREE_NODE_EDITING_STARTED),db(MA.TREE_NODE_EDITING_APPLIED),db(MA.TREE_NODE_EDITING_CANCELED),db(MA.TREE_NODE_NEW_PARENT_EDITING_STARTED),db(MA.TREE_NODE_NEW_PARENT_EDITING_APPLIED),db(MA.TREE_NODE_NEW_PARENT_EDITING_CANCELED),db(MA.TREE_NODE_NEW_CHILD_EDITING_STARTED),db(MA.TREE_NODE_NEW_CHILD_EDITING_APPLIED),db(MA.TREE_NODE_NEW_CHILD_EDITING_CANCELED),db(MA.TREE_NODE_RELATION_TYPE_CHANGED),db(MA.TREE_NODE_ENTITY_CHANGED),db(MA.TREE_SORTED),db(MA.TREES_STATE_SAVED),db(MA.TREES_STATE_RESTORED),db(MA.TREE_CHILDREN_LOADED),db(MA.TREES_RESTORE_FROM_INITIAL_TREES)),HA=db(MA.TREES_RESET_INITIAL_TREES),YA=(db(MA.TREE_CANCEL_CHILDREN_LOADING),(0,R.path)(["common","commands"]));var WA=r(76665);function GA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qA(e,t,r[t])}))}return e}function qA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ZA=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if((0,R.path)(["entity","uri"],e)===t)return r.forEach((e=>e.expanded=!0)),e;if(e.children)for(const n of e.children){const a=ZA(n,t,r.concat(e));if(a)return a}},$A=(e,t)=>{const r=Object.keys(e).reduce(((r,n)=>{const a=e[n];return t[n]&&(a.parent=(0,R.uniq)([].concat(a.parent).concat(t[n].parent).filter(R.identity))),r[n]=a,r}),{});return Object.keys(t).forEach((e=>{r[e]||(r[e]=t[e])})),r},KA=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=(0,R.reject)((0,R.prop)("loading")),n=r(e);return t.forEach((t=>{e.find((e=>(0,R.path)(["entity","uri"],e)===t.entity.uri))||n.push(t)})),n},XA=(e,t)=>{if(e&&e.children){const r=e.children.findIndex((e=>{let{nodeId:r}=e;return r===t}));r>-1&&e.children.splice(r,1)}},QA=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;e&&e.children&&e.children.splice(r,0,t)},JA=e=>{let{path:t,value:r,object:n}=e,a=n;for(let e=0;e<t.length;e++){const n=t[e];e===t.length-1?a[n]="function"==typeof r?r(a[n]):r:(a[n]=a[n]||("number"==typeof n?[]:{}),a=a[n])}},eR=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;e[t]=r,e.children&&e.children.forEach((e=>eR(e,t,r)))},tR=e=>({entity:e.entity,relation:e.relation}),rR=e=>{let{id:t,draft:r,node:n}=e;JA({path:["editingConnections",n.relation.uri],object:r[t],value:tR(n)})},nR=e=>{let{id:t,draft:r,node:n,entity:a}=e;JA({path:["editingConnections",n.relation.uri,"entity"],object:r[t],value:a})},aR=e=>{let{id:t,draft:r,node:n,relationTypeUri:a}=e;JA({path:["editingConnections",n.relation.uri,"relation"],object:r[t],value:e=>GA({},e,{type:a,attributes:{}})})},oR=e=>{let{id:t,draft:r,relationUri:n}=e;delete r[t].editingConnections[n]},iR=e=>{let{id:t,draft:r,relationUri:n}=e;return r[t].editingConnections[n]},lR=e=>{delete e.editingMode,delete e.relatedEntity,delete e.initialConnection},sR=e=>{let{id:t,draft:r,currentNode:n}=e;const a=r[t].root;if(a===n)r[t].root=n.children[0],r[t].root.children=r[t].root.children||[],r[t].root.children.push(...n.children.slice(1));else{const e=(0,O.findParentNodeById)(a,n.nodeId);XA(e,n.nodeId)}},cR=(e,t,r)=>{const n=[e,"editingConnections",t,"relation"];return(0,R.path)(n,r)?(0,R.lensPath)(n):null},uR=(0,R.pick)(["showSecondaryLabel","sortField","sortOrder"]),pR=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return $A(e,t.reduce(((e,t)=>GA({},e,{[t.entity.uri]:(0,R.pick)(["entity","parent","relations"],t)})),{}))},dR=e=>({entity:(0,R.pick)(["uri","type","label","secondaryLabel"],e.entity),parent:[],relations:[(0,R.pick)(["uri","type"],e.relation)]});function mR(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){yR(e,t,r[t])}))}return e}function yR(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gR={common:{commands:[]},trees:{},initialTrees:{}};let fR=function(e){return e.ENTITY_RELATED_ATTRIBUTES_ADDED="ENTITY_RELATED_ATTRIBUTES_ADDED",e}({});db(fR.ENTITY_RELATED_ATTRIBUTES_ADDED);const hR={},ER=e=>e.entity,bR=e=>e.modifiedEntities,vR=e=>e.errors,TR=e=>e.relations,OR=e=>e.trees,xR=e=>e.lookups,CR=e=>e.dependentLookups,SR=e=>e.mode,wR=e=>e.lastLoadedTime,AR=e=>e.history,RR=e=>e.operation,_R=e=>e.views,IR=e=>e.sidePanelViews,NR=e=>e.hiddenAttributes,DR=e=>Cw(ER(e)),PR=e=>Sw(ER(e)),kR=(e,t)=>((e,t)=>t&&e[t])(bR(e),t),LR=(e,t)=>((e,t)=>t&&e[t]&&e[t].defaultProfilePic)(bR(e),t),UR=e=>(0,R.keys)(TR(e)),jR=(e,t,r)=>KS(TR(e),t,r),FR=(e,t,r)=>XS(TR(e),t,r),MR=(e,t,r)=>((e,t,r)=>{const n=XS(e,t,r);return(0,O.getRelationObjectFromConnection)(n)})(TR(e),t,r),VR=(e,t,r)=>((e,t,r)=>{const n=(0,R.pipe)((0,R.pathOr)([],[t,"drafts","addedConnections"]),(0,R.filter)((0,R.pipe)(O.getRelationUriFromConnection,O.isTempUri)),(0,R.when)((0,R.always)(r),(0,R.filter)((0,R.propEq)("parentEntityUri",r))),R.length)(e);return((e,t,r)=>r?(0,R.pipe)((0,R.path)([t,"connections"]),(0,R.find)((e=>{let{entity:t}=e;return t.entityUri===r})),(0,R.pathOr)(0,["total"]))(e):(0,R.pathOr)(0,[t,"total"],e))(e,t,r)+n})(TR(e),t,r),BR=(e,t)=>$S(TR(e),t),zR=(e,t)=>O.getDraftsForSaveByViewId(TR(e),t),HR=e=>(e=>(0,R.keys)(e).reduce(((t,r)=>{const{addedConnections:n,editedConnections:a}=(0,O.getDraftsForSaveByViewId)(e,r);return(0,R.pipe)(R.concat,(0,R.map)(O.getEntityUriFromConnection),(0,R.filter)(O.isTempUri),(0,R.concat)(t))(n,a)}),[]))(TR(e)),YR=e=>aA(SR(e)),WR=e=>nA(SR(e)),GR=e=>rA(SR(e)),qR=(e,t)=>O.getRelationToAddByViewId(TR(e),t),ZR=(e,t)=>O.getRelationsToEditByViewId(TR(e),t),$R=(e,t)=>O.getAllRelationsToAddAndEdit(TR(e),t),KR=(e,t,r)=>O.getAllRelationsToSave(TR(e),t,r),XR=(e,t,r)=>O.getInitialConnectionTempEntity(e.relations,t,r),QR=(e,t,r)=>O.getInitialConnection(e.relations,t,r),JR=(e,t)=>((e,t)=>Object.keys(e).filter((r=>{const n=(0,O.getTempRelations)(e,r);return!!ZS(n,t)})))(TR(e),t),e_=(e,t,r)=>((e,t,r)=>(0,R.pipe)((0,R.filter)((0,R.allPass)([(0,R.propEq)("parentUri",t),(0,R.propEq)("attributeTypeUri",r),(0,R.pipe)((0,R.prop)("uri"),R.isEmpty)])),(0,R.map)((0,R.prop)("message")),(0,R.join)(". "))(e))(vR(e),t,r),t_=(e,t,r)=>((e,t,r)=>(0,R.filter)((0,R.allPass)([(0,R.propEq)("parentUri",t),(0,R.propEq)("attributeTypeUri",r),(0,R.pipe)((0,R.prop)("uri"),R.isEmpty,R.not)]))(e))(vR(e),t,r),r_=(e,t,r)=>O.getCachedActiveErrorsForAttributesPager(vR(e),t,r),n_=(e,t)=>((e,t)=>e.trees[t])(OR(e),t),a_=(e,t)=>((e,t)=>(0,R.path)(["trees",t,"root"],e))(OR(e),t),o_=(e,t)=>((e,t)=>(0,R.path)(["trees",t,"total"],e))(OR(e),t),i_=e=>YA(OR(e)),l_=(e,t,r)=>((e,t,r)=>(0,R.path)(["trees",t,"editingConnections",r],e))(OR(e),t,r),s_=(e,t)=>((e,t)=>(0,R.pipe)((0,R.prop)("trees"),(0,R.when)((0,R.always)(t),(0,R.pick)(t)),R.values,(0,R.map)((0,R.pipe)((0,R.prop)("editingConnections"),R.values)),R.flatten,(0,R.reject)(R.isNil))(e))(OR(e),t),c_=e=>(e=>e.structure)(CR(e)),u_=(e,t)=>O.getDependentLookupsStructureNode(CR(e),t),p_=e=>(e=>e.initedTypeUris)(CR(e)),d_=e=>(e=>e.editors)(CR(e)),m_=(e,t)=>O.getDependentLookupEditorState(CR(e),t),y_=e=>(e=>e.diff)(AR(e)),g_=e=>(e=>e.event)(AR(e)),f_=e=>(e=>e.slice)(AR(e)),h_=e=>(e=>!(0,O.isEmptyValue)(e.slice))(AR(e)),E_=e=>(e=>e.mode)(AR(e)),b_=(e,t)=>((e,t)=>e[t])((e=>e.entityRelatedAttributes)(e),t),v_=(0,Dc.createSelector)(ER,(e=>kR(e,DR(e))),((e,t)=>!(!e||!t||(0,O.isEmptyValue)((0,O.collectAllDiffs)(e,t,!0))))),T_=(0,Dc.createSelector)(OR,(e=>{const t=YA(e),r=(0,O.getNotAppliedTreeCommands)((0,R.reject)((0,R.propSatisfies)(O.isEmptyValue,"root"),e.trees));return!(0,O.isEmptyValue)(t)||!(0,O.isEmptyValue)(r)})),O_=(0,Dc.createSelector)(TR,(e=>(0,R.keys)(e).reduce(((t,r)=>t||!(0,R.all)(O.isEmptyValue)((0,R.values)(O.getDraftsForSaveByViewId(e,r)))),!1))),x_=(0,Dc.createSelector)(v_,O_,T_,((e,t,r)=>e||t||r)),C_=(0,Dc.createSelector)(SR,ER,x_,((e,t)=>t),((e,t,r,n)=>!(e===O.Mode.Viewing||!t)&&((0,O.isTempUri)(t.uri)&&!n||r)));let S_=function(e){return e.PROFILE_OPERATION_UPDATE="PROFILE_OPERATION_UPDATE",e}({});const w_=db(S_.PROFILE_OPERATION_UPDATE),A_=e=>{let{metadata:t,modifiedEntities:r,connections:n=[],errors:a}=e;return a.filter((e=>{let{attributeType:t,type:r}=e;return t&&!(0,O.isRequired)(t)&&r===O.ErrorType.missed})).filter((e=>{let{attributeType:a,parentUri:o}=e;const i=(0,O.getBaseUri)(o),l=(0,O.isEntityUri)(o)?r[i]:(0,O.findConnectionRelationObjectByRelationUri)(n,i),s=l&&(0,O.findAttributeValuesByTypeUri)(t,l,a.uri,!0);return null==s?void 0:s.some((e=>{let{parent:t,attrValues:r}=e;return t.uri===o&&0===r.length}))})).map((e=>{let{attributeType:t,parentUri:r}=e;return{attributeType:t,parentUri:r}}))},R_=e=>(0,O.getProfileViewsIdsByTypes)(e,[O.ProfileViewType.Relations,O.ProfileViewType.RelationsTable]);function __(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){I_(e,t,r[t])}))}return e}function I_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*N_(){const e=yield(0,Fa.Ys)(OI.selectors.getEntity),t=yield(0,Fa.Ys)(OI.selectors.getMode),r=yield(0,Fa.Ys)(OI.selectors.getEntityUri),n=yield(0,Fa.Ys)(OI.selectors.getMetadata),a=yield(0,Fa.Ys)(OI.selectors.getModifiedEntity,r),o=yield(0,Fa.Ys)(OI.selectors.getModifiedEntities),i=yield(0,Fa.Ys)(OI.selectors.getProfileViews);return{entity:e,modifiedEntity:t===O.Mode.Viewing?e:a,entityUri:r,metadata:n,modifiedEntities:t===O.Mode.Viewing?{[r]:e}:o,profileViews:i,mode:t}}function*D_(){return __({},yield(0,Fa.RE)(N_),{validationServicePath:yield(0,Fa.Ys)(OI.selectors.getValidationServicePath),tenant:yield(0,Fa.Ys)(OI.selectors.getTenant),severity:yield(0,Fa.Ys)(OI.selectors.getValidationServiceSeverityLevels)})}function*P_(){const{entityUri:e,metadata:t,modifiedEntities:r,modifiedEntity:n,profileViews:a}=yield(0,Fa.RE)(N_),o=R_(a),i=(0,O.getProfileViewsIdsByTypes)(a,[O.ProfileViewType.HierarchyTree]),l=yield(0,Fa.Ys)(rC,o,!0),s=yield(0,Fa.Ys)(OI.selectors.getRelations),c=yield(0,Fa.Ys)(OI.selectors.getAllTreesEditingConnections,i);return[...(0,O.validateEntityLocally)(t,r,n,(0,O.isAvailableAttributeTypeForProfile)(a)),...l.flatMap((e=>(0,O.validateConnection)(t,r,e))),...c.flatMap((e=>(0,O.validateHierarchyConnection)(t,e)))].map((n=>__({},n,{path:(0,O.evaluateErrorPath)({entityUri:e,metadata:t,connections:l,entitiesMap:r,relationsState:s,relationViewsIds:o},n.uri||n.parentUri)})))}function*k_(){const{entityUri:e,metadata:t,modifiedEntity:r,mode:n,validationServicePath:a}=yield(0,Fa.RE)(D_);if(a&&(0,O.shouldUseValidationService)(t,r.type)){const r=yield(0,Fa.RE)((0,O.isTempUri)(e)?U_:j_),{modifiedEntities:a}=yield(0,Fa.RE)(N_),o=(0,R.pipe)(O.convertValidationServiceErrors,(0,R.uniqBy)(O.getErrorUniqKey))(r,{entityUri:e,metadata:t,entitiesMap:a});if(n!==O.Mode.Viewing){const e=A_({metadata:t,modifiedEntities:a,errors:o});e.length&&(yield(0,Fa.gz)(Ab(e)))}return o}return[]}function L_(e){return console.warn("Validation service error",e),[]}function*U_(){const{mode:e,modifiedEntity:t,modifiedEntities:r,validationServicePath:n,tenant:a,severity:o}=yield(0,Fa.RE)(D_),i=(0,O.prepareEntityForValidation)(t,r);try{return yield(0,Fa.RE)(O.validateEntity,{validationServicePath:n,entity:i,tenant:a,severity:o,options:(0,R.reject)(R.isNil,[O.ValidationServiceOption.preserveURIs,e===O.Mode.Editing?O.ValidationServiceOption.validateDataPermissions:null])})}catch(e){return L_(e)}}function*j_(){var e;const{entityUri:t,mode:r,entity:n,modifiedEntity:a,modifiedEntities:o,validationServicePath:i,metadata:l,tenant:s,severity:c}=yield(0,Fa.RE)(D_),u=yield(0,Fa.Ys)(OI.selectors.getValidateReferenceEntityInReadMode),p=(0,O.getEntityType)(l,n.type),d=null===(e=null==p?void 0:p.forceOvForUiUpdates)||void 0===e||e,m=r===O.Mode.Viewing?[]:(0,O.collectDiffForValidation)(n,a,o,d);try{return yield(0,Fa.RE)(O.validateEntityChanges,{validationServicePath:i,uri:t,diff:m,tenant:s,severity:c,options:(0,R.reject)(R.isNil,[O.ValidationServiceOption.preserveURIs,O.ValidationServiceOption.updateAttributeUpdateDates,r===O.Mode.Editing?O.ValidationServiceOption.validateDataPermissions:null,r===O.Mode.Viewing&&u?O.ValidationServiceOption.validateReferenceEntityAttribute:null])})}catch(e){return L_(e)}}function*F_(){const{entityUri:e,metadata:t,mode:r,modifiedEntity:n,modifiedEntities:a,validationServicePath:o,tenant:i,severity:l,profileViews:s}=yield(0,Fa.RE)(D_),c=yield(0,Fa.Ys)(OI.selectors.getValidateRelations);if(o&&c){const c=R_(s),u=(yield(0,Fa.Ys)(rC,c)).filter((e=>(0,O.shouldUseValidationService)(t,e.relation.relationType)));if(u.length>0){let s=[];const p=(0,O.prepareConnectionsForValidation)(u,n,a,t);try{const e=yield(0,Fa.RE)(O.validateRelations,{validationServicePath:o,body:p,tenant:i,severity:l,options:(0,R.reject)(R.isNil,[O.ValidationServiceOption.preserveURIs,r===O.Mode.Editing?O.ValidationServiceOption.validateDataPermissions:null])});s=Object.values(e.validated).flat()}catch(e){return L_(e)}const d=yield(0,Fa.Ys)(OI.selectors.getModifiedEntities),m=yield(0,Fa.Ys)(OI.selectors.getRelations),y=(0,R.pipe)(O.convertValidationServiceErrors,(0,R.uniqBy)(O.getErrorUniqKey))(s,{entityUri:e,metadata:t,entitiesMap:d,connections:u,relationsState:m,relationViewsIds:c}),g=A_({metadata:t,modifiedEntities:d,connections:u,errors:y});return g.length&&(yield(0,Fa.gz)(Ab(g))),y}}return[]}function*M_(){const e=yield(0,Fa.RE)(P_),[t,r]=yield(0,Fa.$6)([(0,Fa.RE)(k_),(0,Fa.RE)(F_)]),n=(0,R.uniqBy)(O.getErrorUniqKey,[...e,...t,...r]);return yield(0,Fa.gz)(Nw(n)),0===n.filter(O.isCriticalError).length}let V_=function(e){return e.PROFILE_VIEWS_SET="PROFILE_VIEWS_SET",e}({});function B_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){z_(e,t,r[t])}))}return e}function z_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*H_(e){const t=yield(0,Fa.Ys)(OI.selectors.getMetadata),r=yield(0,Fa.Ys)(OI.selectors.getMode);switch(e.type){case GS.OPEN_RELATION_EDITOR:{const{id:n,connection:a}=e.payload;a.relation.relationType&&(yield(0,Fa.gz)(Rb({viewId:n,metadata:t,mode:r,parentUri:a.relation.object.uri})));break}case wb.ADD_ATTRIBUTES:{const n=e.payload;for(const e of n){const{attributeType:n,parentUri:a,viewId:o}=e;(0,O.isComplexAttribute)(n)&&(yield(0,Fa.gz)(Rb({viewId:o,attributeType:n,parentUri:a,metadata:t,mode:r})))}break}case GS.SET_RELATION_TYPE:{const{id:n,relationUri:a}=e.payload;yield(0,Fa.gz)(Rb({viewId:n,metadata:t,mode:r,parentUri:a}));break}case MA.TREE_NODE_RELATION_TYPE_CHANGED:{var n;const{id:a,node:o}=e.payload;yield(0,Fa.gz)(Rb({viewId:a,metadata:t,mode:r,parentUri:null==o||null===(n=o.relation)||void 0===n?void 0:n.uri}));break}}}function*Y_(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=yield(0,Fa.Ys)(cC),n=(0,O.getNotAppliedTreeCommands)(null==r?void 0:r.trees),a=yield(0,Fa.Ys)(mC),o=(0,O.optimizeCommands)([...a,...n]);if(null!=o&&o.length){const r=(0,R.when)((0,R.always)(t),(0,O.replaceTempUriInCommands)(t))(o);yield(0,Fa.RE)(e,r),yield(0,Fa.gz)(VA())}}function*W_(e){var t;const r=yield(0,Fa.Ys)(jO),n=yield(0,Fa.Ys)(FO),a=yield(0,Fa.Ys)(tx,n),o=yield(0,Fa.Ys)(IO),i=(0,O.getEntityType)(o,r.type),l=null===(t=null==i?void 0:i.forceOvForUiUpdates)||void 0===t||t,s=(0,O.collectAllDiffs)(r,a,l);return(0,O.prepareAttrDiff)(e,s)}function*G_(e){const t=yield(0,Fa.Ys)(WO),r=yield(0,Fa.Ys)(nx),n=yield(0,Fa.Ys)(FO),a=yield(0,Fa.Ys)(tx,n),o=(0,O.findAllTemporaryRefEntityURI)(a),i=(0,R.concat)(o,t);return yield(0,Fa.RE)(O.saveTemporaryEntities,r,i,e)}function*q_(e,t,r){const n=e.getDCRObjectUris(),a=yield(0,Fa.Ys)(wC),o=yield(0,Fa.Ys)(RC),i=yield(0,Fa.Ys)(vC);if(null!=n&&n.length){const l=yield(0,Fa.RE)(O.startProcessInstance,{workflowPath:a,processType:t?"authoring":"dataChangeRequestReview",objectURIs:(0,R.uniq)([r,...n,e.getDCRUri()]).filter((0,R.complement)(R.isNil)),tenant:i,environment:o});"OK"!==(null==l?void 0:l.status)&&console.warn(l)}}function*Z_(e,t,r,n){const a=yield(0,Fa.Ys)(YO,r),o=(0,O.createRelationsCommandsFromConnections)(a,n,t);o.length&&(yield(0,Fa.RE)(e,o))}function*$_(e,t,r){const n=yield(0,Fa.Ys)($O),a=yield(0,Fa.Ys)(FO);for(const o of n)yield(0,Fa.rM)(Z_,e,r||a,o,t)}function*K_(e){if(!e.hasNewUri())return;const t=yield(0,Fa.Ys)(cC);for(const[r,n]of Object.entries(t.trees))if(n.root){const t=t=>(0,R.when)((0,R.prop)("uri"),(0,R.assoc)("uri",e.getUri(null==t?void 0:t.uri)))(t),a=(0,O.mapTree)(n.root,{nodeProcessing:e=>(0,R.pipe)((e=>B_({},e)),(0,R.unless)((0,R.has)("editingMode"),(0,R.evolve)({relation:t,relations:(0,R.map)(t)})))(e)});(0,R.equals)(n.root,a)||(yield(0,Fa.gz)(BA({id:r,tree:a})))}}function*X_(){try{var e;const t=yield(0,Fa.Ys)(Xx),{commandExecutor:r,dcrProcessor:n,relationUriProcessor:a}=(0,O.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:null}),o=yield(0,Fa.RE)(G_,n);yield(0,Fa.$6)([(0,Fa.RE)(Y_,r),(0,Fa.RE)($_,r,o)]),yield(0,Fa.RE)(K_,a);const i=yield(0,Fa.RE)(W_,o),l=yield(0,Fa.Ys)(FO);let s;if(null!=i&&i.length&&(s=yield(0,Fa.RE)(O.entityCumulativeUpdate,{uri:l,diff:i,uriPreprocessor:n.enhanceUriWithDCR})),t||(0,O.isChangeRequestUri)(null===(e=s)||void 0===e?void 0:e.uri))s&&n.updateDCRUriFromResponse(s),yield(0,Fa.RE)(q_,n,!1,l),yield(0,Fa.gz)(zA()),window.alert(po().text("Your changes are saved as pending and have been sent for review"));else if(s){yield(0,Fa.gz)(gw(s));const{trees:e}=yield(0,Fa.Ys)(OI.selectors.getTrees),t=(0,O.updateTreesWithNewEntity)((0,R.pick)(["uri","label","secondaryLabel","type"],s),e);for(const e of t)yield(0,Fa.gz)(BA({id:e.id,tree:e.root}))}yield(0,Fa.gz)(Jw(O.Mode.Viewing)),yield(0,Fa.gz)(Ub())}catch(e){yield(0,Fa.gz)(Jv((0,O.getRequestErrorMessage)(e,po().text("Something went wrong"))))}}function*Q_(){yield(0,Fa.qn)(yw.ENTITY_LOADED),yield(0,Fa.gz)(Ub())}function*J_(e,t){const r=yield(0,Fa.Ys)(FO),n=yield(0,Fa.Ys)(OI.selectors.getModifiedEntity,r),{commandExecutor:a,dcrProcessor:o}=(0,O.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:e}),i=yield(0,Fa.RE)(G_,o),l=yield(0,Fa.RE)(O.saveTemporaryEntity,n,i,o);return yield(0,Fa.$6)([(0,Fa.RE)(Y_,a,{[r]:l}),(0,Fa.RE)($_,a,i,l)]),{savedEntityUri:l,dcrProcessor:o}}function*eI(){const e=yield(0,Fa.Ys)(FO),t=yield(0,Fa.Ys)(OI.selectors.getModifiedEntity,e);if((0,O.isEmptyEntity)(t)){const e=(0,$e.x0)();return yield(0,Fa.gz)(Rv({id:e,text:po().text("Please fill out some fields."),actions:[]})),!1}return!0}function*tI(){try{const e=yield(0,Fa.Ys)(Xx);if(!(yield(0,Fa.RE)(eI)))return;const{dcrProcessor:t,savedEntityUri:r}=yield(0,Fa.RE)(J_,null,e);e&&(yield(0,Fa.RE)(q_,t),window.alert(po().text("Your changes are saved as pending and have been sent for review"))),yield(0,Fa.gz)(Jw(O.Mode.Viewing)),e?(yield(0,Fa.gz)(Av()),yield(0,Fa.gz)(xw())):(yield(0,Fa.gz)(Cv({uri:r})),yield(0,Fa.rM)(Q_))}catch(e){yield(0,Fa.gz)(Jv((0,O.getRequestErrorMessage)(e,po().text("Something went wrong"))))}}function*rI(e){const t=yield(0,Fa.RE)(O.getDataChangeRequest,e),r=(0,R.pipe)((0,R.prop)("changes"),R.values,R.flatten,(0,R.pluck)("id"))(t);try{yield(0,Fa.$6)(r.map((t=>(0,Fa.RE)(O.deleteChangeRequestItem,{dcrUri:e,changeItemId:t}))))}catch(e){yield(0,Fa.gz)(Jv((0,O.getRequestErrorMessage)(e,po().text("Something went wrong"))))}}function*nI(e,t){yield(0,Fa.RE)(rI,e);const{savedEntityUri:r}=yield(0,Fa.RE)(J_,e,!0),n=yield(0,Fa.Ys)(wC),a=yield(0,Fa.Ys)(RC),o=yield(0,Fa.Ys)(vC);yield(0,Fa.RE)(O.runTaskAction,{workflowPath:n,environment:a,tenant:o,taskId:t,action:"Approve"}),yield(0,Fa.gz)(Jw(O.Mode.Viewing)),yield(0,Fa.gz)(Cv({uri:r})),yield(0,Fa.rM)(Q_)}function*aI(e){const{dcrUri:t,userAction:r,taskId:n}=e.payload;try{if(!(yield(0,Fa.RE)(eI)))return;yield(0,Fa.gz)(Jw("saveDraft"===r?O.Mode.Suggesting:O.Mode.Editing,!0)),yield(0,Fa.gz)(w_(O.Operation.Saving));const e=yield(0,Fa.RE)(M_);if("saveDraft"===r){if(t)yield(0,Fa.RE)(rI,t),yield(0,Fa.RE)(J_,t,!0);else{const{dcrProcessor:e}=yield(0,Fa.RE)(J_,null,!0);yield(0,Fa.RE)(q_,e,!0);const t=e.getDCRUri();yield(0,Fa.gz)(Kv({url:"../authoring",searchParams:{entityUri:`${t}`},options:{replace:!0,state:{keepErrors:!0}}}))}window.alert(po().text("Your changes are saved as pending and have been sent for review"))}else if(e)if(t)yield(0,Fa.RE)(nI,t,n);else{const{savedEntityUri:e}=yield(0,Fa.RE)(J_,null,!1);yield(0,Fa.gz)(Jw(O.Mode.Viewing)),yield(0,Fa.gz)(Cv({uri:e})),yield(0,Fa.rM)(Q_)}else e||(yield(0,Fa.gz)(Jw(O.Mode.Suggesting,!0)))}catch(e){yield(0,Fa.gz)(Jw(O.Mode.Suggesting,!0)),yield(0,Fa.gz)(Jv((0,O.getRequestErrorMessage)(e,po().text("Something went wrong"))))}yield(0,Fa.gz)(w_(null))}function*oI(){if(yield(0,Fa.gz)(w_(O.Operation.Saving)),yield(0,Fa.RE)(M_)){const e=yield(0,Fa.Ys)(FO);(0,O.isTempUri)(e)?yield(0,Fa.RE)(tI):yield(0,Fa.RE)(X_)}yield(0,Fa.gz)(w_(null))}function*iI(e){const{mode:t,silent:r}=e.payload;if(t!==O.Mode.Viewing&&!r){const e=yield(0,Fa.Ys)(OI.selectors.getEntity),r=yield(0,Fa.Ys)(OI.selectors.getModifiedEntity,null==e?void 0:e.uri),n=yield(0,Fa.Ys)(OI.selectors.getMetadata);if(e&&!r&&n){const r=yield(0,Fa.Ys)(OI.selectors.getProfileViews),a=yield(0,Fa.Ys)(OI.selectors.getUIConfig),o=yield(0,Fa.Ys)(OI.selectors.getUserRoles),i=(0,O.addToEntityRequiredAttributes)({entity:e,metadata:n,mode:t,attrTypeFilter:(0,R.both)((0,O.isAvailableAttributeTypeForProfile)(r||[]),(0,O.getProfileAttributeConfigPermissionsChecker)(a,e.type,o,[O.ConfigPermissions.READ,O.ConfigPermissions.CREATE]))});yield(0,Fa.gz)(iA(i));const l=yield(0,Fa.Ys)(OI.selectors.getModifiedEntities),s=yield(0,Fa.Ys)(OI.selectors.getProfileErrors),c=A_({metadata:n,modifiedEntities:l,errors:s});c.length&&(yield(0,Fa.gz)(Ab(c)))}}}function*lI(e){const{entityTypeUri:t}=e.payload,r=yield(0,Fa.Ys)(OI.selectors.getMetadata),n=(0,O.getEntityType)(r,t),a=yield(0,Fa.Ys)(OI.selectors.getUIConfig),o=yield(0,Fa.Ys)(OI.selectors.getUserRoles),i=(0,O.getProfileAttributeConfigPermissionsChecker)(a,t,o,[O.ConfigPermissions.READ,O.ConfigPermissions.CREATE]),l=((null==n?void 0:n.attributes)||[]).filter((e=>i(e))),s=(0,O.checkMetadataForCreate)(O.Mode.Editing,n)?O.Mode.Editing:O.Mode.Suggesting,c=(0,O.createTemporaryEntity)({entityTypeUri:t,attributeTypes:l,metadata:r,mode:s});yield(0,Fa.gz)(Sv({entity:c})),yield(0,Fa.gz)(gw(c)),yield(0,Fa.gz)(Jw(O.Mode.Viewing)),yield(0,Fa.gw)(0),(yield(0,Fa.Ys)(OI.selectors.getProfileViews))||(yield(0,Fa.qn)(V_.PROFILE_VIEWS_SET)),yield(0,Fa.gz)(Jw(s)),yield(0,Fa.gz)(HA())}function*sI(e){const{entityTypeUri:t}=e.payload,r=yield(0,Fa.Ys)(OI.selectors.getMetadata),n=(0,O.getEntityType)(r,t),a=(0,R.prop)("attributes",n),o=(0,O.checkMetadataForCreate)(O.Mode.Suggesting,n)?O.Mode.Suggesting:O.Mode.Editing,i=(0,O.createTemporaryEntity)({entityTypeUri:t,attributeTypes:a,metadata:r,mode:o});yield(0,Fa.gz)(Zv({entity:i})),yield(0,Fa.gz)(gw(i)),yield(0,Fa.gz)(Jw(o))}function*cI(e){const{mainEntityUri:t,tempEntities:r,keepErrors:n}=e.payload,[[a],o]=(0,R.partition)((0,R.propEq)("uri",t),r);for(const e of o)yield(0,Fa.gz)(iA(e));yield(0,Fa.gz)(gw(a,n)),yield(0,Fa.gz)(Jw(O.Mode.Suggesting))}function*uI(e){const{payload:{entityUri:t,data:r}}=e;yield(0,Fa.gz)(w_(O.Operation.Cloning));try{const e=yield(0,Fa.RE)(O.cloneEntity,t,r);yield(0,Fa.gz)(Sv({entity:e})),yield(0,Fa.gz)(gw(e)),yield(0,Fa.gz)(Jw(O.Mode.Editing)),yield(0,Fa.gz)(HA());const n=(0,$e.x0)(),a=yield(0,Fa.Ys)(OI.selectors.getMetadata),o=(0,O.getEntityType)(a,e.type),i=(0,O.checkMetadataForDelete)(O.Mode.Editing,o);yield(0,Fa.gz)(Rv({id:n,type:"cloneAction",autoHideDuration:1e4,text:po().text("Profile is cloned successfully. You can modify the attributes if required."),actions:i?[{label:po().text("Undo"),needConfirmation:!0,confirmationText:po().text("Are you sure you want to undo the cloning process?"),confirmationDescription:po().text("Undoing the cloning process will delete the cloned profile. Are you sure you want to proceed?"),applyAction:Tw({entityUri:e.uri}),cancelAction:_v(n)}]:[]}))}catch(e){yield(0,Fa.gz)(Jv((0,O.getRequestErrorMessage)(e,po().text("Something went wrong"))))}yield(0,Fa.gz)(w_(null))}function*pI(e){const{entityUri:t}=e.payload;if(!(0,O.isTempUri)(t))try{yield(0,Fa.RE)(O.removeEntity,t),yield(0,Fa.gz)(wv())}catch(e){yield(0,Fa.gz)(Jv((0,O.getRequestErrorMessage)(e,po().text("Something went wrong"))))}}function*dI(){(yield(0,Fa.Ys)(bC))&&!confirm(po().text("Are you sure you want to cancel changes for this Profile?"))||(yield(0,Fa.gz)(tA()))}const mI=[function*(){yield(0,Fa.A7)([Hb.MODE_CANCEL_EDITING],dI)},function*(){yield(0,Fa.ib)([GS.OPEN_RELATION_EDITOR,wb.ADD_ATTRIBUTES,GS.SET_RELATION_TYPE,MA.TREE_NODE_RELATION_TYPE_CHANGED],H_)},function*(){yield(0,Fa.A7)([wb.SAVE_PROFILE],oI)},function*(){yield(0,Fa.ib)([Hb.MODE_UPDATED],iI)},function*(){yield(0,Fa.ib)([yw.ENTITY_CREATION_REQUESTED],lI)},function*(){yield(0,Fa.Fm)([wb.VALIDATE_PROFILE],M_)},function*(){yield(0,Fa.ib)([yw.ENTITY_REMOVE_REQUESTED],pI)},function*(){yield(0,Fa.ib)([yw.CLONE_ENTITY],uI)},function*(){yield(0,Fa.ib)([yw.ENTITY_CREATION_WITH_AUTHORING_REQUESTED],sI)},function*(){yield(0,Fa.ib)([yw.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED],cI)},function*(){yield(0,Fa.A7)([wb.SAVE_DRAFT],aI)}],yI=(db(V_.PROFILE_VIEWS_SET),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return t.type===V_.PROFILE_VIEWS_SET?t.payload:e});let gI=function(e){return e.SIDE_PANEL_VIEWS_LOADED="SIDE_PANEL_VIEWS_LOADED",e}({});db(gI.SIDE_PANEL_VIEWS_LOADED);const fI=[];let hI=function(e){return e.HIDDEN_ATTRIBUTES_UPDATED="HIDDEN_ATTRIBUTES_UPDATED",e.HIDDEN_ATTRIBUTES_RESET="HIDDEN_ATTRIBUTES_RESET",e}({});const EI=db(hI.HIDDEN_ATTRIBUTES_UPDATED),bI=db(hI.HIDDEN_ATTRIBUTES_RESET),vI={},TI=(0,A.combineReducers)({dependentLookups:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Gb,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Hb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,O.isViewMode)(r)&&!n?Gb:e}case Fb.DEPENDENT_LOOKUPS_STRUCTURE_SET:return Yb({},e,{structure:t.payload});case Fb.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED:{const r=t.payload;return Yb({},e,{initedTypeUris:(0,R.uniq)(e.initedTypeUris.concat(r))})}case Fb.DEPENDENT_LOOKUPS_EDITORS_BLOCKED:{const{uris:r,isBlocked:n}=t.payload,a=e.editors,o=r.reduce(((e,t)=>Yb({},e,{[t]:Yb({},e[t],{isBlocked:n})})),a);return Yb({},e,{editors:o})}case Fb.DEPENDENT_LOOKUPS_EDITOR_TOUCHED:{const{uri:r,isTouched:n}=t.payload;return(0,R.assocPath)(["editors",r,"isTouched"],n,e)}default:return e}},entity:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rw,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case yw.ENTITY_LOADED:return t.payload.entity;case yw.DEFAULT_PROFILE_PIC_SET:return"object"==typeof t.payload&&null!==t.payload?ww({},e,{defaultProfilePic:t.payload.uri,defaultProfilePicValue:t.payload}):e;case wb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:o}=t.payload,i=(0,O.getAttributeSource)(a);if(r===e.uri){const t=(0,R.lensPath)([i,n]);return(0,R.over)(t,(0,R.pipe)((0,R.defaultTo)([]),(0,R.concat)(R.__,o)),e)}return e}case yw.CLEAR_ENTITY:return Rw;default:return e}},errors:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:kw,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case _w.ERRORS_SET:return t.payload;case _w.ERROR_DEACTIVATED:{const r=t.payload,n=e.findIndex((e=>(0,O.getErrorId)(e)===r)),a=(0,R.lensPath)([n]);return(0,R.over)(a,(0,R.assoc)("deactivated",!0),e)}case wb.REMOVE_ATTRIBUTE:{const{uri:r}=t.payload;return e.map((e=>e.uri===r||(0,O.areOneHierarchyUris)(e.parentUri,r)?Dw({},e,{deactivated:!0}):e))}case Hb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,O.isViewMode)(r)&&!n?kw:e}case yw.ENTITY_LOADED:{const{keepErrors:r}=t.payload;return r?e:kw}default:return e}},history:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Yw,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Lw.HISTORY_DIFF_SET:return zw({},e,{diff:t.payload});case Lw.HISTORY_DIFF_CLEARED:return zw({},e,{diff:Yw.diff});case Lw.HISTORY_EVENT_SET:return zw({},e,{event:t.payload});case bb.NEW_ENTITY_SHOWN:case bb.OPEN_ENTITY:case Lw.HISTORY_EVENT_CLEARED:return zw({},Yw,{mode:e.mode});case Lw.HISTORY_SLICE_SET:return zw({},e,{slice:t.payload});case Lw.HISTORY_MODE_SET:return zw({},e,{mode:t.payload});default:return e}},lastLoadedTime:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ww.PROFILE_LAST_LOADED_TIME_UPDATE:case yw.ENTITY_LOADED:return Date.now();default:return e}},lookups:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qw,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Gw.LOOKUPS_LOADED:return t.payload;case Gw.LOOKUPS_FOR_TYPE_RESOLVED:{const{type:r,values:n}=t.payload;return Kw({},e,{[r]:Kw({},e[r],n)})}case Gw.LOOKUPS_LIST_RESOLVED:return t.payload.reduce(((e,t)=>Object.keys(t).reduce(((e,r)=>Kw({},e,{[r]:Kw({},e[r],t[r])})),e)),e);case"UI_RESET":return Kw({},Qw);default:return e}},mode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oA,t=arguments.length>1?arguments[1]:void 0;return t.type===Hb.MODE_UPDATED?t.payload.mode:e},modifiedEntities:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:mA,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case WS.MODIFIED_ENTITY_CREATED:{const r=t.payload;return pA({},e,{[r.uri]:r})}case WS.MODIFIED_ENTITY_DELETED:{const r=t.payload;return(0,R.omit)([r],e)}case WS.MODIFIED_ENTITIES_RESET:return mA;case Hb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,O.isViewMode)(r)&&!n?mA:e}case WS.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET:{const{entityUri:r,value:n}=t.payload;return r?pA({},e,{[r]:pA({},e[r],{defaultProfilePic:n.uri,defaultProfilePicValue:n})}):e}case wb.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t,o=(0,O.getBaseUri)(n);if((0,O.isEntityUri)(o)){const t=e[o];return e[o]||console.error(`ADD_ATTRIBUTES. parentUri - ${n}, state: ${JSON.stringify(e)}`),(0,O.isEntitySpecialAttrType)(r)?pA({},e,{[o]:(0,O.addEntitySpecialAttribute)({entity:t,attributeType:r})}):pA({},e,{[o]:(0,O.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a})})}return e}),e);case wb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:o}=t.payload,i=(0,O.getAttributeSource)(a);if((0,O.isEntityUri)(r)&&r in e){const t=(0,R.lensPath)([r,i,n]);return(0,R.over)(t,(0,R.pipe)((0,R.defaultTo)([]),(0,R.concat)(R.__,o)),e)}return e}case wb.MODIFY_ATTRIBUTE:{const{attributeType:r,uri:n,value:a}=t.payload,o=(0,O.getBaseUri)(n);if((0,O.isEntityUri)(o)){const t=e[o];return e[o]&&e[o].attributes||console.error(`MODIFY_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,O.isEntitySpecialAttrType)(r)?pA({},e,{[o]:(0,O.editEntitySpecialAttribute)({entity:t,attributeType:r,value:a})}):pA({},e,{[o]:(0,O.editAttribute)({entity:t,attributeType:r,uri:n,value:a})})}return e}case wb.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n}=t.payload,a=(0,O.getBaseUri)(n);if((0,O.isEntityUri)(n)){const t=e[a];return e[a]||console.error(`REMOVE_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,O.isEntitySpecialAttrType)(r)?pA({},e,{[a]:(0,O.removeEntitySpecialAttribute)({entity:t,attributeType:r})}):pA({},e,{[a]:(0,O.removeAttribute)({entity:t,attributeType:r,uri:n})})}return e}case wb.ADD_DEFAULT_VALUES:{const{attributeType:r,parentUri:n,metadata:a,mode:o}=t.payload,i=(0,O.getBaseUri)(n);if((0,O.isEntityUri)(i)){const t=(0,O.getEditableAttributeTypeSubAttributes)(a,r);return(0,R.over)((0,R.lensProp)(i),(0,O.addDefaultValuesToComplexAttribute)({attributeType:r,subAttributes:t,metadata:a,mode:o,parentUri:n}),e)}return e}default:return e}},relations:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:kA,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case yw.ENTITY_LOADED:return{};case GS.RELATIONS_LOADED:{const{id:r,connections:n=[],total:a,mode:o}=t.payload;return(0,R.pipe)((0,R.assocPath)([r,"connections"],n),(0,R.assocPath)([r,"total"],a),(0,R.when)((0,R.both)((0,R.complement)((0,R.hasPath)([r,"drafts"])),(0,R.always)((0,O.isEditableMode)(o))),(0,R.assocPath)([r,"drafts"],LA)))(e)}case GS.SECOND_LEVEL_RELATIONS_LOADED:{const{id:r,connections:n,parentEntityUri:a,total:o}=t.payload,i=(0,R.path)([r,"connections"],e).map((e=>{const{entityUri:t}=e.entity;return t===a?DA({},e,{total:o,connections:n.map((e=>DA({},e,{parentEntityUri:a})))}):e}));return(0,R.assocPath)([r,"connections"],i,e)}case Hb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return n?e:(0,R.map)(nA(r)?(0,R.omit)(["drafts","relationsToEdit","relationToAdd"]):(0,R.assoc)("drafts",LA),e)}case GS.REMOVE_RELATION:{const{id:r,relationUri:n}=t.payload,a=(0,R.pipe)(O.getRelationUriFromConnection,(0,R.equals)(n)),o=(0,R.path)([r,"connections"],e),i=!((0,O.isTempUri)(n)||null!=o&&o.some((e=>e.suggested&&e.relation.relationUri===n)));return(0,R.evolve)({[r]:{drafts:(0,R.evolve)({removedUris:i?(0,R.append)(n):R.identity,addedConnections:(0,R.reject)(a),editedConnections:(0,R.reject)(a)})}},e)}case GS.IGNORE_RELATION:{const{id:r,ignoredRelationData:n}=t.payload;return(0,R.evolve)({[r]:{drafts:(0,R.evolve)({ignoredRelationData:(0,R.append)(n)})}},e)}case GS.ADD_RELATION:{const{id:r,connection:n}=t.payload,a=(0,R.omit)(["isNew"],n);return(0,R.evolve)({[r]:(0,R.pipe)((0,R.when)((0,R.propSatisfies)(R.isNil,"drafts"),(0,R.assocPath)(["drafts"],LA)),(0,R.evolve)({drafts:{addedConnections:(0,R.prepend)(a)}}))},e)}case GS.EDIT_RELATION:{const{id:r,connection:n}=t.payload,a=(0,R.eqBy)(O.getRelationUriFromConnection,n);if((0,O.isTempUri)((0,O.getRelationUriFromConnection)(n))){const t=e=>{const t=e.findIndex(a);return t>=0?(0,R.update)(t,n,e):e};return(0,R.evolve)({[r]:{drafts:(0,R.evolve)({addedConnections:t})}},e)}{const t=e=>{const t=e.findIndex(a);return t>=0?(0,R.update)(t,n,e):[...e,n]};return(0,R.evolve)({[r]:{drafts:(0,R.evolve)({editedConnections:t})}},e)}}case GS.OPEN_RELATION_EDITOR:{const{id:r,connection:n}=t.payload,a=n.initial?n:DA({},n,{initial:{connection:n}});if(a.isNew){const t=(0,O.getRelationToAddPath)(r);return(0,R.path)(t,e)?e:(0,R.assocPath)(t,a,e)}{const t=(0,R.lensPath)((0,O.getRelationsToEditPath)(r)),n=(0,R.eqBy)((0,R.path)(["relation","relationUri"]),a);return(0,R.over)(t,(0,R.pipe)((0,R.defaultTo)([]),(0,R.unless)((0,R.find)(n),(0,R.append)(a))),e)}}case GS.SET_INITIAL_INFO:{const{id:r,relationUri:n,tempEntity:a}=t.payload,o=UA(r,n,e);return(0,R.assocPath)([...o,"initial","modifiedEntity"],a,e)}case GS.CLOSE_RELATION_EDITOR:{const{id:r,relationUri:n}=t.payload,a=(0,R.pathEq)(["relation","relationUri"],n);return(0,R.evolve)({[r]:{relationToAdd:(0,R.when)(a,(0,R.always)(null)),relationsToEdit:(0,R.reject)(a)}},e)}case GS.SET_RELATION_TYPE:{const{id:r,relationUri:n,relationType:a}=t.payload,o=UA(r,n,e);if(o){const t=[...o,"relation"],r=(0,R.lensPath)(t);return(0,R.over)(r,(0,O.applyRelationTypeObject)(a),e)}return e}case wb.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:o}=t,i=(0,O.getBaseUri)(n),l=jA(o,i,e);if(l&&(0,O.isRelationUri)(i)){if((0,O.isActivenessAttrType)(r)){const t=(0,R.view)(l,e),n=(0,O.addEntitySpecialAttribute)({entity:t,attributeType:r});return(0,R.set)(l,n,e)}{const t=FA(o,i,e),l=(0,R.view)(t,e);l||console.error(`relations.ADD_ATTRIBUTES. viewId - ${o}, relationUri - ${i}, state: ${JSON.stringify(e)}`);const s=(0,O.addAttribute)({entity:l,attributeType:r,parentUri:n,index:a});return(0,R.set)(t,s,e)}}return e}),e);case wb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,values:a,viewId:o}=t.payload;if(!(0,O.isRelationUri)(r))return e;const i=(0,O.getBaseUri)(r),l=UA(o,i,e),s=(0,R.lensPath)([...l,"relation","object","attributes",n]);return(0,R.over)(s,(0,R.pipe)((0,R.defaultTo)([]),(0,R.append)(a)),e)}case wb.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:o}=t.payload,i=(0,O.getBaseUri)(a),l=jA(n,i,e);if(l&&(0,O.isRelationUri)(i)){if((0,O.isActivenessAttrType)(r)){const t=(0,R.view)(l,e),n=(0,O.editEntitySpecialAttribute)({entity:t,attributeType:r,value:o});return(0,R.set)(l,n,e)}{const t=FA(n,i,e),l=(0,R.view)(t,e);l||console.error(`relations.MODIFY_ATTRIBUTE. viewId - ${n}, relationUri - ${i}, state: ${JSON.stringify(e)}`);const s=(0,O.editAttribute)({entity:l,attributeType:r,uri:a,value:o});return(0,R.set)(t,s,e)}}return e}case wb.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,o=(0,O.getBaseUri)(n),i=jA(a,o,e);if(i&&(0,O.isRelationUri)(o)){if((0,O.isActivenessAttrType)(r)){const t=(0,R.view)(i,e),n=(0,O.removeEntitySpecialAttribute)({entity:t,attributeType:r});return(0,R.set)(i,n,e)}{const t=FA(a,o,e),i=(0,R.view)(t,e);i||console.error(`relations.REMOVE_ATTRIBUTE. viewId - ${a}, relationUri - ${o}, state: ${JSON.stringify(e)}`);const l=(0,O.removeAttribute)({entity:i,attributeType:r,uri:n});return(0,R.set)(t,l,e)}}return e}case GS.SET_RELATION_ENTITY:{const{id:r,relationUri:n,entityInfo:a}=t.payload,o=UA(r,n,e);if(o){const t=[...o,"entity"],r=(0,R.lensPath)(t),{uri:n,label:i,type:l}=a,s=(0,R.isEmpty)(a)?{}:{entityUri:n,entityLabel:i,entityType:l,object:{uri:n,label:i,type:l}};return(0,R.set)(r,s,e)}return e}case wb.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:o,mode:i}=t.payload,l=(0,O.getBaseUri)(a);if((0,O.isRelationUri)(l)){const t=UA(r,l,e);if(t){if(n){const r=[...t,"relation","object"],l=(0,O.getAttributeTypeSubAttributes)(o,n);return(0,R.over)((0,R.lensPath)(r),(0,O.addDefaultValuesToComplexAttribute)({attributeType:n,subAttributes:l,metadata:o,mode:i,parentUri:a}),e)}{const r=[...t,"relation","object","attributes"],n=[...t,"relation","object","type"],l=(0,R.view)((0,R.lensPath)(n),e),{attributes:s=[]}=(0,O.getRelationType)(o,l);return(0,R.over)((0,R.lensPath)(r),(0,O.addDefaultValuesToAttributes)({metadata:o,mode:i,attributeTypes:s,parentUri:a}),e)}}return e}return e}default:return e}},trees:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gR,t=arguments.length>1?arguments[1]:void 0;return(0,WA.ZP)(e,(r=>{switch(t.type){case Hb.MODE_UPDATED:{const{mode:e,silent:n}=t.payload;if(n)break;Object.keys(null==r?void 0:r.trees).forEach((e=>{eR(r.trees[e].root,"showDetails",!1)})),(0,O.isViewMode)(e)&&(r.common.commands=[],r.initialTrees={}),(0,O.isEditableMode)(e)&&(r.initialTrees=mR({},r.trees));break}case Hb.MODE_EDITING_CANCELED:case MA.TREES_RESTORE_FROM_INITIAL_TREES:r.trees=mR({},r.initialTrees);break;case MA.TREES_RESET_INITIAL_TREES:r.initialTrees={};break;case yw.ENTITY_LOADED:return gR;case MA.TREE_LOADED_WITH_ERROR:{const{id:e,errorMessage:n}=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].errorMessage=n,r.trees[e].loading=!1,delete r.trees[e].root,delete r.trees[e].entitiesMap;break}case MA.TREE_LOADING:{const e=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].loading=!0;break}case MA.TREE_CHILDREN_LOADING:{const{id:e,parentId:n,nodeId:a}=t.payload,o=r.trees[e].root,i=(0,O.findNodeById)(o,n);i.pending=!1,i.children=(i.children||[]).concat({entity:{},loading:!0,nodeId:a});break}case MA.TREE_CHILDREN_LOADED:{const{children:e,id:n,parentId:a}=t.payload,o=r.trees[n].root,i=(0,O.findNodeById)(o,a);i&&(i.children=KA(i.children,e),delete i.pending);break}case MA.TREE_NODE_REMOVED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root,o=(0,O.findParentNodeById)(a,n);XA(o||a,n);break}case MA.TREE_NODE_CREATED:{const{id:e,parentId:n,node:a}=t.payload,o=r.trees[e].root,i=(0,O.findNodeById)(o,n)||o,l=i.children.length;QA(i,a,l);break}case MA.TREE_NODE_EDITED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,o=(0,O.findNodeById)(a,n.nodeId),i=Object.keys(n);for(const e of i)o[e]=n[e];break}case MA.TREE_NODE_EDITING_STARTED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,o=(0,O.findNodeById)(a,n.nodeId),i=(0,O.findParentNodeById)(a,n.nodeId);o&&i&&(o.editingMode=O.NODE_EDITING_MODES.editing,o.relatedEntity=i.entity,delete o.loading,o.initialConnection=tR(o),rR({id:e,draft:r.trees,node:o}));break}case MA.TREE_NODE_EDITING_APPLIED:{const{id:e,node:a}=t.payload,o=r.trees[e].root,i=(0,O.findNodeById)(o,a.nodeId),l=iR({id:e,draft:r.trees,relationUri:a.relation.uri});var n;i&&l&&(lR(i),i.entity.uri!==l.entity.uri&&null!==(n=i.children)&&void 0!==n&&n.length&&(delete i.children,i.pending=!0),i.entity=l.entity,i.relation=l.relation,oR({id:e,draft:r.trees,relationUri:a.relation.uri}));break}case MA.TREE_NODE_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,o=(0,O.findNodeById)(a,n.nodeId);o&&(lR(o),oR({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case MA.TREE_NODE_NEW_PARENT_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,o=r.trees[e].root,i=(0,O.findNodeById)(o,n.nodeId);if(a.relatedEntity=i.entity,a.relatedNodeId=i.nodeId,a.editingMode=O.NODE_EDITING_MODES.addingParent,o===i)a.children=[o],r.trees[e].root=a;else{const e=(0,O.findParentNodeById)(o,n.nodeId),t=e.children.findIndex((e=>i===e));QA(e,a,t)}a.initialConnection=tR(a),rR({id:e,draft:r.trees,node:a});break}case MA.TREE_NODE_NEW_PARENT_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,o=(0,O.findNodeById)(a,n.nodeId),i=(0,O.findNodeById)(a,n.relatedNodeId),l=iR({id:e,draft:r.trees,relationUri:n.relation.uri});o&&l&&(sR({id:e,draft:r.trees,currentNode:o}),i.parent=i.parent||[],i.parent.push(l.entity.uri),i.relations=i.relations||[],i.relations.push(l.relation),r.trees[e].entitiesMap=pR(r.trees[e].entitiesMap,[i,dR(l)]),oR({id:e,draft:r.trees,relationUri:o.relation.uri}));break}case MA.TREE_NODE_NEW_PARENT_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,o=(0,O.findNodeById)(a,n.nodeId);o&&(sR({id:e,draft:r.trees,currentNode:o}),oR({id:e,draft:r.trees,relationUri:o.relation.uri}));break}case MA.TREE_NODE_NEW_CHILD_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,o=r.trees[e].root,i=(0,O.findNodeById)(o,n.nodeId);a.relatedEntity=i.entity,a.editingMode=O.NODE_EDITING_MODES.addingChild,a.parent=[i.entity.uri],a.directParentUri=i.entity.uri,i.children=i.children||[],i.children.unshift(a),i.expanded=!0,a.initialConnection=tR(a),rR({id:e,draft:r.trees,node:a});break}case MA.TREE_NODE_NEW_CHILD_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,o=(0,O.findParentNodeById)(a,n.nodeId),i=(0,O.findNodeById)(o,n.nodeId),l=iR({id:e,draft:r.trees,relationUri:n.relation.uri});o&&i&&l&&(lR(i),i.entity=l.entity,i.relation=l.relation,i.relations=[l.relation],oR({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case MA.TREE_NODE_NEW_CHILD_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,o=(0,O.findParentNodeById)(a,n.nodeId);o&&(XA(o,n.nodeId),oR({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case MA.TREE_NODE_RELATION_TYPE_CHANGED:{const{id:e,node:n,relationTypeUri:a}=t.payload,o=iR({id:e,draft:r.trees,relationUri:n.relation.uri}).relation.type;o!==a&&(o&&nR({id:e,draft:r.trees,node:n,entity:null}),aR({id:e,draft:r.trees,node:n,relationTypeUri:a}));break}case MA.TREE_NODE_ENTITY_CHANGED:{const{id:e,node:n,entity:a}=t.payload;nR({id:e,draft:r.trees,node:n,entity:a});break}case wb.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:o}=t,i=(0,O.getBaseUri)(n),l=cR(o,i,e.trees);if(l&&(0,O.isRelationUri)(i)){const t=(0,R.view)(l,e.trees);if((0,O.isActivenessAttrType)(r)){const n=(0,O.addEntitySpecialAttribute)({entity:t,attributeType:r});return mR({},e,{trees:(0,R.set)(l,n,e.trees)})}{const o=(0,O.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a});return mR({},e,{trees:(0,R.set)(l,o,e.trees)})}}return e}),e);case wb.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:o}=t.payload,i=(0,O.getBaseUri)(a),l=cR(n,i,e.trees);if(l&&(0,O.isRelationUri)(i)){const t=(0,R.view)(l,e.trees);if((0,O.isActivenessAttrType)(r)){const n=(0,O.editEntitySpecialAttribute)({entity:t,attributeType:r,value:o});return mR({},e,{trees:(0,R.set)(l,n,e.trees)})}{const n=(0,O.editAttribute)({entity:t,attributeType:r,uri:a,value:o});return mR({},e,{trees:(0,R.set)(l,n,e.trees)})}}return e}case wb.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,o=(0,O.getBaseUri)(n),i=cR(a,o,e.trees);if(i&&(0,O.isRelationUri)(o)){const t=(0,R.view)(i,e.trees);if((0,O.isActivenessAttrType)(r)){const n=(0,O.removeEntitySpecialAttribute)({entity:t,attributeType:r});return mR({},e,{trees:(0,R.set)(i,n,e.trees)})}{const a=(0,O.removeAttribute)({entity:t,attributeType:r,uri:n});return mR({},e,{trees:(0,R.set)(i,a,e.trees)})}}return e}case wb.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:o,mode:i}=t.payload,l=(0,O.getBaseUri)(a),s=cR(r,l,e.trees);if((0,O.isRelationUri)(l)&&s){if(n){const t=(0,O.getAttributeTypeSubAttributes)(o,n);return mR({},e,{trees:(0,R.over)(s,(0,O.addDefaultValuesToComplexAttribute)({attributeType:n,subAttributes:t,metadata:o,mode:i,parentUri:a}),e.trees)})}{const t=(0,R.compose)(s,(0,R.lensPath)(["attributes"])),r=(0,R.compose)(s,(0,R.lensPath)(["type"])),n=(0,R.view)(r,e.trees),{attributes:l=[]}=(0,O.getRelationType)(o,n);return mR({},e,{trees:(0,R.over)(t,(0,O.addDefaultValuesToAttributes)({metadata:o,mode:i,attributeTypes:l,parentUri:a}),e.trees)})}}return e}case MA.TREE_ENTITIES_MAPPING_LOADED:{const{id:e,entitiesSubMap:n}=t.payload,a=r.trees[e].entitiesMap;r.trees[e].entitiesMap=$A(a,n);break}case MA.TREE_LOADED:{const{tree:e,id:n,graphTypes:a,activenessDate:o,isReversed:i}=t.payload,l=uR(r.trees[n]||{});r.trees[n]=mR({},l,e,{graphTypes:a,activenessDate:o,isReversed:i}),delete r.trees[n].errorMessage,r.trees[n].loading=!1;break}case MA.TREE_SORTED:{const{id:e,typesLabelsMap:n={},sortField:a,sortOrder:o}=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].sortField=a,r.trees[e].sortOrder=o,r.trees[e].root&&(r.trees[e].root=(0,O.mapTree)(r.trees[e].root,{childrenProcessing:(0,O.sortTreeChildren)({sortField:a,sortOrder:o,typesLabelsMap:n})}));break}case MA.TREE_SECONDARY_LABEL_SHOWN:{const{id:e,show:n}=t.payload;r.trees[e].showSecondaryLabel=n,r.trees[e].root=mR({},r.trees[e].root);break}case MA.TREES_STATE_RESTORED:{const e=t.payload;Object.keys(e).forEach((t=>{r.trees[t]=r.trees[t]||{},r.trees[t]=mR({},r.trees[t],e[t]),r.trees[t].root&&(r.trees[t].root=mR({},r.trees[t].root))}));break}case MA.TREE_CHANGED:{const{id:e,tree:n}=t.payload;r.trees[e].root=n;break}case MA.TREE_REFRESHED:{const e=t.payload;r.trees[e].root=mR({},r.trees[e].root);break}case MA.TREE_NODE_EXPANDED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root;(0,O.findNodeById)(a,n).expanded=!0;break}case MA.TREE_CURRENT_ENTITY_SHOWN:{const{id:n,uri:a=(0,R.path)(["entity","uri"],e)}=t.payload;if(r.trees[n]){const e=ZA(r.trees[n].root,a);r.trees[n].scrollTo=e}break}case MA.TREE_SCROLL_TO_NODE_RESET:{const e=t.payload;r.trees[e]&&(r.trees[e].scrollTo=null);break}case MA.TREE_ACTIVENESS_DATE_CHANGED:{const{id:e,activenessDate:n}=t.payload;r.trees[e].activenessDate=n;break}case MA.TREE_RELATION_REPOINTED:{const{entity:e,relation:n,newParent:a,isReversed:o}=t.payload,i=(0,R.prop)("uri"),l=i(e),s=i(a),c=(0,O.createRelationRepointCommand)({entityUri:l,relation:n,newEntityUri:s,isReversed:o});r.common.commands.push(c);break}case MA.TREE_RELATION_REMOVED:{const{relationUri:e}=t.payload;if((0,O.isTempUri)(e))r.common.commands=(0,R.reject)((0,O.isRelationCommandForUri)(e),r.common.commands);else{const t=(0,O.createRelationDeleteCommand)({relationUri:e});r.common.commands.push(t)}break}case MA.TREE_RELATION_CREATED:{const{entityUri:e,relation:n,parentEntityUri:a}=t.payload,o=(0,O.createRelationCreateCommand)({parentUri:a,relation:n,entityUri:e});r.common.commands.push(o);break}case MA.TREE_RELATION_EDITED:{const{oldRelation:e,newRelation:n,entityUri:a,newEntityUri:o,isReversed:i}=t.payload,l=o?(0,O.createRelationRepointCommand)({entityUri:a,newEntityUri:o,relation:n,isReversed:i}):(0,O.createRelationUpdateCommand)({oldRelation:e,newRelation:n});r.common.commands.push(l);break}case MA.TREE_COMMANDS_CLEARED:r.common.commands=[];break;case MA.TREE_CANCEL_CHILDREN_LOADING:{const{id:e,parentId:n}=t.payload,a=r.trees[e].root,o=(0,O.findNodeById)(a,n);o&&(o.pending=!0,delete o.expanded,delete o.children);break}}}))},operation:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return t.type===S_.PROFILE_OPERATION_UPDATE?t.payload:e},views:yI,sidePanelViews:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fI,t=arguments.length>1?arguments[1]:void 0;return t.type===gI.SIDE_PANEL_VIEWS_LOADED?t.payload:e},entityRelatedAttributes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hR,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case fR.ENTITY_RELATED_ATTRIBUTES_ADDED:{const{attributeTypeUri:r,entityUri:n,attributes:a}=t.payload;return(0,R.assocPath)([r,n],a,e)}case Hb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,O.isViewMode)(r)&&!n?hR:e}default:return e}},hiddenAttributes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vI,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case hI.HIDDEN_ATTRIBUTES_UPDATED:{const{uri:r,hiddenAttributes:n}=t.payload;return(0,R.assoc)(r,n,e)}case hI.HIDDEN_ATTRIBUTES_RESET:return(0,R.dissoc)(t.payload,e);default:return e}}}),OI={getModule:()=>({id:"mdm",reducerMap:{dataTenants:yb,tenants:hb,metadata:Sb,profile:TI,tenant:vO,environment:AO,user:mO,ui:uO,search:xv},sagas:[...vA,...mw,...mI,...bv]}),selectors:c},xI=OI,CI=e=>{let{className:t}=e;const r=(0,Ep.useDispatch)(),n=(0,Ep.useSelector)(Po.qx),a=(0,Ep.useSelector)(xI.selectors.getGoogleMapKey),o=(0,E.useMemo)((()=>((e,t)=>(0,R.when)((0,R.always)(!t),(0,R.reject)((0,R.propEq)("id",$.om.MAP)))(e))([{id:$.om.MAP,tooltipTitle:po().text("View map"),Icon:ub()},{id:$.om.PROFILE,tooltipTitle:po().text("View entity details"),Icon:sb()}],a)),[a]);return b().createElement(XE,{className:t,modes:o,modeId:n,onChange:e=>{r(Io(n!==e?e:null))}})};CI.propTypes={className:hp().string};const SI=CI,wI=()=>b().createElement("div",{className:Ad},b().createElement("div",{className:"Headers-styles-title--TvsMA"},po().text("Profiles")),b().createElement("div",{className:Rd},b().createElement(ib,null),b().createElement(SI,{className:_d})));var AI=r(12932),RI=r.n(AI),_I=r(83754),II=r.n(_I);const NI=(0,Op.Z)({tabsRoot:{width:"100%"},tabsScrollButton:{flex:"0 0 24px"},tabRoot:{fontSize:"0.875rem",padding:"7px 18px 5px","@media (min-width: 960px)":{minWidth:"inherit"},"&$disabled":{pointerEvents:"auto"}},labelWrapper:{whiteSpace:"nowrap",letterSpacing:"normal",display:"flex",flexDirection:"row",width:"100%"},label:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:500},disabled:{}});function DI(){return DI=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},DI.apply(this,arguments)}function PI(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const kI=e=>{let{value:t,tabs:r=[],onChange:n,tabClasses:a}=e,o=PI(e,["value","tabs","onChange","tabClasses"]);const i=NI(),l=(e,t)=>b().createElement("span",{className:i.labelWrapper},b().createElement(dd.Y,{value:e},b().createElement("span",{className:i.label},e)),t);return b().createElement(RI(),DI({value:t,onChange:(e,t)=>n(t),classes:{root:i.tabsRoot,scrollButtons:i.tabsScrollButton},indicatorColor:"primary",textColor:"primary",variant:"scrollable",scrollButtons:!0},o,{allowScrollButtonsMobile:!0}),r.map((e=>{let{label:t,value:r,additionalLabel:n,dataReltioId:o}=e,s=PI(e,["label","value","additionalLabel","dataReltioId"]);return b().createElement(II(),DI({classes:a||{root:i.tabRoot,disabled:i.disabled},key:r,value:r,label:l(t,n),"data-reltio-id":o},s))})))};function LI(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class UI extends E.PureComponent{constructor(){super(...arguments),this.getTabsData=()=>{const{tenantObject:e,tableViewTabs:t,selectedEntityTypes:r,metadata:n}=this.props,a=(0,Jy.ZK)(t,e);return(0,Do.nx)(n,a,r).map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){LI(e,t,r[t])}))}return e}({},e,{additionalLabel:b().createElement("span",{className:"Headers-styles-number--trErH"},"(",void 0===e.number?po().text("N/A"):(0,lo.k7)(e.number),")")})))},this.onTabChange=e=>{this.props.dispatch(Co(e))},this.onSelectColumns=e=>{const{dispatch:t,entityTypeTab:r,columnsForEntityType:n}=this.props;return t(xo(r,e,n))},this.renderTabs=()=>{const{entityTypeTab:e}=this.props;return b().createElement("div",{className:"Headers-styles-tabsContainer--lhDXc"},b().createElement(kI,{value:e,tabs:this.getTabsData(),onChange:this.onTabChange}))}}render(){const{entityTypeTab:e,columnsForEntityType:t}=this.props;return b().createElement("div",{className:Ad},this.renderTabs(),b().createElement("div",{className:Rd},b().createElement(Dd,{entityTypeUri:e,headColumns:t,onSelectColumns:this.onSelectColumns,"data-reltio-id":"reltio-search-table-add-remove-column",disabled:!e,showForDisabled:!0}),b().createElement(sh(),{orientation:"vertical",className:"Headers-styles-splitter--sCvn6"}),b().createElement(ib,null),b().createElement(SI,{className:_d})))}}UI.propTypes={metadata:O.MetadataType,dispatch:hp().func,selectedEntityTypes:hp().array,tableViewTabs:hp().array,entityTypeTab:hp().string,columnsForEntityType:hp().array,tenantObject:hp().object};const jI=(0,Ep.connect)((e=>{const t=(0,Po.o4)(e);return{metadata:P().selectors.getMetadata(e),selectedEntityTypes:(0,N.DX)(e),tableViewTabs:(0,Po.gu)(e),entityTypeTab:t,columnsForEntityType:(0,Po.Gv)(e,t),tenantObject:(0,so.t9)(e)}}))(UI);function FI(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class MI extends b().PureComponent{constructor(){super(...arguments),this.entitiesTableRef=this.props.basicTableRef||b().createRef(),this.state={resizeDebounceDelay:void 0},this.sortHandle=e=>{let{field:t,order:r}=e;this.props.dispatch((e=>{let{field:t,order:r,entityTypeUri:n}=e;return{type:L.Z.CHANGE_SORT,payload:{field:t,order:r,entityTypeUri:n}}})({field:r?t:null,order:r,entityTypeUri:this.props.entityTypeUri}))},this.reorderingHandle=e=>{let{what:t,where:r}=e;const{entityTypeUri:n,dispatch:a,headColumns:o}=this.props;a(((e,t)=>({type:Se,payload:{entityTypeUri:e,columns:t}}))(n,(0,R.move)(t.columnIndex,r.columnIndex,o)))},this.changeColumnsListHandle=e=>{let{columns:t}=e;const{entityTypeUri:r,dispatch:n,headColumns:a}=this.props;n(xo(r,t,a))},this.changeColumnsSizeHandle=e=>{const{headColumns:t,entityTypeUri:r,dispatch:n}=this.props,a=t.map(((t,r)=>{var n;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){FI(e,t,r[t])}))}return e}({},t,{size:e[r].size,autoResize:(null!==(n=t.autoResize)&&void 0!==n?n:0!==r)&&!e[r].manuallyChanged})}));n(((e,t)=>({type:we,payload:{entityTypeUri:e,columns:t}}))(r,a)),this.setState({resizeDebounceDelay:void 0})},this.logger=e=>{this.props.dispatch({type:"TABLE_LOG",payload:e})}}componentDidUpdate(e){const{headColumns:t,sortField:r,sortOrder:n,entities:a,entityTypeUri:o}=this.props;this.entitiesTableRef.current&&(t.length!==(0,R.path)(["headColumns","length"],e)||(0,R.difference)((0,R.omit)(["size"],t),(0,R.omit)(["size"],e.headColumns)).length>0||r!==e.sortField||n!==e.sortOrder||a!==e.entities)&&this.entitiesTableRef.current.resetScrollbarPosition(),e.entityTypeUri!==o&&this.setState({resizeDebounceDelay:0})}render(){const{entities:e,entityToHighlight:t,onScroll:r,entityTypeUri:n,headColumns:a,sortField:o,sortOrder:i,additionalColumns:l,selectedEntityUri:s,dndColumnReorderingEnabled:c,onEntityClick:u,onEntityHover:p,entitiesImportStatus:d,onEntityImportStatusChange:m}=this.props;return b().createElement(my,{entities:e,entityToHighlight:t,selectedEntityUri:s,onScroll:r,onSort:this.sortHandle,onEntityClick:u,onEntityHover:p,entityTypeUri:n,headColumns:a,sortField:o,sortOrder:i,dndColumnReorderingEnabled:c,onReorderingColumn:this.reorderingHandle,entitiesTableRef:this.entitiesTableRef,onChangeColumnsList:this.changeColumnsListHandle,onChangeColumnsSize:this.changeColumnsSizeHandle,additionalColumns:l,entitiesImportStatus:d,onEntityImportStatusChange:m,logger:this.logger,resizeDebounceDelay:this.state.resizeDebounceDelay})}}MI.propTypes={entities:hp().array,entityToHighlight:hp().string,selectedEntityUri:hp().string,headColumns:hp().array,onScroll:hp().func,entityTypeUri:hp().string,sortField:hp().string,sortOrder:hp().oneOf([Pd.oy,Pd.U9]),dndColumnReorderingEnabled:hp().bool,dispatch:hp().func,additionalColumns:hp().arrayOf(hp().shape({id:hp().string,label:hp().string})),onEntityClick:hp().func,onEntityHover:hp().func,entitiesImportStatus:hp().object,onEntityImportStatusChange:hp().func,basicTableRef:hp().shape({current:hp().object})},MI.defaultProps={entities:[],headColumns:[]};const VI=(0,ph.Z)(Do.oq),BI=(0,Ep.connect)((e=>{const t=(0,Po.tB)(e),r=(0,Po.Gv)(e,t),n=P().selectors.getMetadata(e),a=VI(n,t,r);return{sortField:(0,so.NW)(e,{entityTypeUri:(0,Po.o4)(e)}),sortOrder:(0,so.L9)(e,{entityTypeUri:(0,Po.o4)(e)}),dndColumnReorderingEnabled:!(0,Po.Ue)(e),headColumns:r,entityTypeUri:t,additionalColumns:a}}))(MI);var zI=r(14058),HI=r.n(zI);const YI=(0,Op.Z)((()=>({container:{position:"relative",height:"100%",width:"100%"},closeButton:{position:"absolute",top:"7px",left:"7px",zIndex:1}}))),WI=(0,Op.Z)((e=>({profileBandWrapper:{flexShrink:0},profileBand:{display:"flex",padding:"16px 12px 16px 16px",alignItems:"flex-start",backgroundColor:"#fff",boxShadow:"0px 1px 0px rgba(0, 0, 0, 0.12)",marginBottom:"1px","&:after":{content:'""',minHeight:"inherit",fontSize:0}},inactive:{background:e.inactiveBackground},profileIcon:{marginRight:"12px"},imageProfileIcon:{width:"48px",height:"48px"},profileInfo:{display:"flex",flexDirection:"column",flex:"1 1 50%"},badge:{},label:{lineHeight:"1.2",letterSpacing:"0.25px",color:e.palette.text.primary,wordBreak:"break-word","&+ $specialInfo":{marginTop:"4px"}},secondaryLabel:{display:"inline-flex",color:e.palette.text.primary,marginTop:"2px",lineHeight:"16px",fontSize:"14px",fontWeight:400,"&+ $businessCard":{marginLeft:"12px"}},businessCard:{color:e.palette.text.secondary,display:"inline-flex",fontSize:"14px",marginTop:"4px",lineHeight:"1.2"},specialInfo:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",width:"100%",marginTop:"8px"},entityType:{display:"flex",flexWrap:"wrap"},entityId:{fontSize:"13px",color:e.palette.text.secondary,whiteSpace:"nowrap",cursor:"pointer","&:hover":{textDecoration:"underline"}}}))),GI=e=>{let{className:t,entity:r,children:n,classes:a,renderLabel:o=R.identity}=e;const i=WI({classes:a}),l=(0,S.AH)(),s=(0,S.QQ)(),c=(0,E.useCallback)((()=>{navigator.clipboard.writeText((0,O.getEntityId)(r))}),[r]);if((0,R.isNil)(r))return null;const u=(0,O.getLabel)(r.label),p=r.secondaryLabel,d=(0,O.getBusinessCardAttributesText)(l,r),m=(0,O.isActiveObject)(r),y=r.uri,g=(0,O.getEntityId)(r);return b().createElement("div",{className:T()(i.profileBandWrapper,t)},b().createElement("div",{className:T()(i.profileBand,{[i.inactive]:!m}),"data-entity-uri":y},b().createElement(w,{key:r.uri,entity:r,avatarClassName:i.profileIcon,imageClassName:i.imageProfileIcon}),b().createElement("div",{className:i.profileInfo},b().createElement("div",null,b().createElement(Ay(),{variant:"h6",className:i.label},o(u)),p&&b().createElement(Ay(),{variant:"subtitle2",className:i.secondaryLabel},p),d&&b().createElement(Ay(),{variant:"subtitle1",className:i.businessCard},d)),b().createElement("div",{className:i.specialInfo},b().createElement("div",{className:i.entityType},b().createElement(AE,{entity:r,size:"medium",className:i.badge}),!(0,O.isTempUri)(y)&&s&&b().createElement(Gg(),{title:po().text("Copy to clipboard")},b().createElement(Ay(),{display:"inline",variant:"body2",className:i.entityId,onClick:c},po().text("Entity ID"),": ",g))))),n&&b().createElement("div",null,n)))},qI=b().createContext(!1);qI.displayName="BlockImageGalleryDialogContext";var ZI=r(31574),$I=r.n(ZI);const KI=b().createContext([]);var XI=r(24436),QI=r.n(XI);function JI(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){eN(e,t,r[t])}))}return e}function eN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tN=(0,Op.Z)((e=>({basicViewPaper:JI({display:"flex",flexDirection:"column"},e.basicView)})));function rN(){return rN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rN.apply(this,arguments)}const nN=(0,E.forwardRef)(((e,t)=>{let{children:r,className:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className"]);const o=tN();return b().createElement(QI(),rN({ref:t,className:n,classes:{root:o.basicViewPaper}},a),r)}));nN.displayName="BasicView";var aN=r(52574);const oN="1px solid #AFD4E9",iN=(0,Op.Z)({decorator:{marginLeft:8,borderLeft:oN,"&:last-child":{borderLeft:"none","&:before":{borderLeft:oN}},"&:before":{top:0,height:14,width:5,borderBottom:oN,content:'""',display:"block",left:"0"},"&$plain":{"&:before":{width:0}}},plain:{},wrapper:{marginLeft:16,marginTop:-8}}),lN=e=>{let{className:t,children:r,plain:n=!1,enabled:a=!1}=e;const o=iN();return a?b().createElement("div",{"data-reltio-id":"branch-decorator",className:T()(o.decorator,{[o.plain]:n},t)},b().createElement("div",{className:o.wrapper},r)):b().createElement(b().Fragment,null,r)},sN="commentsContainerVisibilityArea",cN=b().createContext([]);cN.displayName="RelatedObjectUrisContext";const uN=()=>{},pN=b().createContext({comments:[],commentsMap:null,currentComment:null,updateCommentState:uN,clearCommentState:uN,getCommentState:()=>({}),getComment:uN,getComments:()=>new Promise(uN),getCommentsCount:uN,createComment:()=>new Promise(uN),editComment:()=>new Promise(uN),createReply:()=>new Promise(uN),resolveThread:uN,reOpenThread:uN,clearCurrentComment:uN,deleteComment:uN,sending:!1,loading:!1,pageToken:null,deleteReply:uN,editReply:()=>new Promise(uN)});function dN(){return dN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dN.apply(this,arguments)}pN.displayName="CollaborationContext";const mN=e=>b().createElement("svg",dN({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),b().createElement("path",{d:"M2.8 1h14.4c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1z"})),yN=(0,Op.Z)((()=>({root:{position:"relative",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"4px",cursor:"pointer"},icon:{"&:hover":{fillOpacity:.7}}})));function gN(){return gN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gN.apply(this,arguments)}const fN=b().forwardRef(((e,t)=>{let{children:r,tooltipTitle:n,icon:a,onClick:o,className:i}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","tooltipTitle","icon","onClick","className"]);const s=yN();return b().createElement(Gg(),{title:n},b().createElement("div",gN({ref:t,className:T()(s.root,i),onClick:o},l),b().createElement(a,{className:s.icon}),r))}));fN.displayName="BasicCommentButton";const hN=(0,Op.Z)({childrenWrapper:{position:"absolute",width:"100%",height:"100%",lineHeight:"15px",display:"flex",alignItems:"center",justifyContent:"center",top:"-2px",left:0,right:0,bottom:0,color:"white",fontSize:"10px",pointerEvents:"none"}}),EN=b().forwardRef(((e,t)=>{let{children:r,onClick:n}=e;const a=hN();return b().createElement(fN,{ref:t,tooltipTitle:po().text("Show comment"),icon:mN,onClick:n,"data-reltio-id":"reltio-comment-button"},b().createElement("div",{className:a.childrenWrapper},r))}));function bN(){return bN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bN.apply(this,arguments)}EN.displayName="CommentButton";const vN=e=>b().createElement("svg",bN({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),b().createElement("path",{d:"M2.8 14.653L3.853 13.6H17.2V2.8H2.8v11.853zM17.2 1c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1h14.4zm-6.3 3.6H9.1v2.699L6.4 7.3v1.8l2.7-.001V11.8h1.8V9.099l2.7.001V7.3l-2.7-.001V4.6z"})),TN=e=>{let{className:t,onClick:r}=e;return b().createElement(fN,{className:t,onClick:r,tooltipTitle:po().text("Add comment"),icon:vN})};var ON=r(94511),xN=r.n(ON),CN=r(7421);const SN=(0,Op.Z)((e=>{const t=e.palette.background.paper;return{paper:{backgroundColor:t,maxWidth:1e3},popper:{'&[data-popper-placement*="bottom"] $arrow':{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},'&[data-popper-placement*="top"] $arrow':{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},'&[data-popper-placement*="right"] $arrow':{left:0,marginLeft:"-0.71em",height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},'&[data-popper-placement*="left"] $arrow':{right:0,marginRight:"-0.71em",height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}},arrow:{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t,"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",boxShadow:e.shadows[1],backgroundColor:"currentColor",transform:"rotate(45deg)"}}}}));function wN(){return wN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wN.apply(this,arguments)}const AN=e=>{let{children:t,className:r,classes:n,transition:a}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className","classes","transition"]);const i=SN(),l=a?xN():b().Fragment,[s,c]=(0,E.useState)(null);return b().createElement(CN.Z,wN({className:T()(i.popper,r),modifiers:[{name:"preventOverflow",enabled:!0,options:{rootBoundary:"viewport",padding:14,altAxis:!0}},{name:"arrow",enabled:!0,options:{element:s,padding:4}}],transition:a,excludeAnchorFromBackdrop:!1},o),(e=>{let{TransitionProps:r}=e;return b().createElement(l,r,b().createElement(QI(),{className:T()(i.paper,null==n?void 0:n.root)},b().createElement("span",{className:T()(i.arrow,null==n?void 0:n.arrow),ref:c}),t))}))};var RN=r(93526),_N=r.n(RN);const IN=(0,Op.Z)((e=>({menuItem:{minHeight:"32px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}}))),NN=(0,md.T)(Jp()),DN=(0,E.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=R.identity}=e;const a=IN(),{disabled:o,text:i,tooltip:l,onClick:s,id:c="",selectable:u,selected:p}=r;return b().createElement(NN,{tooltipTitle:l,showForDisabled:!0,classes:{root:a.menuItem},onClick:e=>{n(e),s(e)},disabled:o,ref:t,"data-modal":!0,"data-reltio-id":`reltio-search-menu-item${c}`},u&&b().createElement(Xp(),{checked:p,color:"primary"}),b().createElement(Ay(),{classes:{root:a.menuText}},i))}));DN.displayName="DefaultMenuItemRenderer";const PN=(0,Op.Z)((e=>({buttonRoot:{"&$selected":{color:e.palette.action.active,backgroundColor:(0,km.alpha)(e.palette.action.active,.12),"&:hover":{backgroundColor:(0,km.alpha)(e.palette.action.active,.15)}}},selected:{},paper:{minWidth:"112px"}})));function kN(){return kN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kN.apply(this,arguments)}function LN(e){let{className:t,menuId:r,buttonComponent:n=dE(),buttonContent:a,menuItems:o=[],buttonProps:i={},popoverProps:l={},onMenuOpen:s=R.identity,onMenuClose:c=R.identity,MenuItemRenderer:u=DN}=e;const p=n,d=PN(),m=(0,E.useRef)(),[y,g]=(0,E.useState)(!1);(0,NE.D)((()=>{y?s():c()}),[y]);const f=(0,E.useCallback)((e=>{null==e||e.stopPropagation(),g((e=>!e))}),[]);return b().createElement(b().Fragment,null,b().createElement(p,kN({"data-reltio-id":"drop-down-menu-button",ref:m,className:T()(d.buttonRoot,{[d.selected]:y},t),onClick:f,"aria-pressed":y,"aria-controls":y?r:void 0,"aria-haspopup":"true"},i),a),b().createElement(_N(),kN({id:r,variant:"menu",open:y,autoFocus:!1,classes:{paper:d.paper},anchorEl:m.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:2,MenuListProps:{autoFocusItem:y}},l),o.map(((e,t)=>b().createElement(u,{item:e,key:t,onMenuClose:f})))))}const UN=(e,t)=>{(0,E.useEffect)((()=>{if(t){var r,n,a,o;const t=null===(r=e.current)||void 0===r||null===(n=r.value)||void 0===n?void 0:n.length;null===(a=e.current)||void 0===a||a.focus(),null===(o=e.current)||void 0===o||o.setSelectionRange(t,t)}}),[e,t])},jN=(e,t)=>{const r=e.relatedObjectUris.indexOf(t);if(r>=0)return e.relatedObjectUris[1-r]},FN=e=>`${po().date(e,"LT")} ${po().date(e,"LL")}`,MN=e=>`comment/${e.commentId}`,VN=(e,t)=>`comment/${e.commentId}/reply/${t.replyId}`,BN=(e,t)=>{let r=e;for(const e of t)r=r.split(`+${e}`).join(`@[${e}](${e})`);return r},zN=b().createContext({});zN.displayName="EntitiesMapContext";const HN=(0,Op.Z)((e=>({title:{marginBottom:"10px",color:e.palette.divider,fontSize:"12px",lineHeight:"14px"},label:{paddingLeft:"9px",borderLeft:"1px solid #D8D8D8",fontSize:"13px",color:e.palette.text.primary,lineHeight:"15px"},link:{color:e.palette.primary.main,textDecoration:"none"}})));function YN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const WN=e=>{let{comment:t,className:r}=e;const n=HN(),a=(0,E.useContext)(zN),o=(0,S.AH)(),i=(0,S.eh)();return b().createElement($I(),{className:r},(()=>{switch(t.objectType){case O.CollaborationObjectTypes.ENTITY_ATTRIBUTE:{const e=(0,O.getAttributeTypeUriByValueUri)(t.objectId,i.type),r=(0,O.findAttributeTypeByUri)(o,e);return b().createElement(b().Fragment,null,b().createElement(Ay(),{className:n.title},po().text("Selected attribute:")),b().createElement(Ay(),{className:n.label},null==r?void 0:r.label))}case O.CollaborationObjectTypes.RELATION_ATTRIBUTE:{const e=t.relatedObjectUris.find((0,R.startsWith)("configuration/relationTypes")),r=e&&(0,O.getAttributeTypeUriByValueUri)(t.objectId,e),a=r&&(0,O.findAttributeTypeByUri)(o,r);return b().createElement(b().Fragment,null,b().createElement(Ay(),{className:n.title},po().text("Selected attribute:")),b().createElement(Ay(),{className:n.label},null==a?void 0:a.label))}case O.CollaborationObjectTypes.ENTITY:return b().createElement(b().Fragment,null,b().createElement(Ay(),{className:n.title},po().text("Selected profile:")),b().createElement(Wd,{className:T()(n.label,n.link),value:(0,O.getEntityUriForLink)(i)},(0,O.getLabel)(i.label)));case O.CollaborationObjectTypes.RELATION:{const e=jN(t,i.uri),r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){YN(e,t,r[t])}))}return e}({},a[e]||{},{uri:e});return b().createElement(b().Fragment,null,b().createElement(Ay(),{className:n.title},po().text("Selected relation:")),b().createElement(Ay(),{className:n.label},b().createElement(Wd,{className:n.link,value:(0,O.getEntityUriForLink)(i)},(0,O.getLabel)(i.label)),e&&b().createElement(b().Fragment,null,` ${po().text("to")} `,b().createElement(Wd,{className:n.link,value:(0,O.getEntityUriForLink)(r)},r.label?(0,O.getLabel)(r.label):(0,O.getEntityId)(r)))))}case O.CollaborationObjectTypes.POTENTIAL_MATCH:{var e;const r=jN(t,i.uri),o={uri:r,label:null===(e=a[r])||void 0===e?void 0:e.label};return b().createElement(b().Fragment,null,b().createElement(Ay(),{className:n.title},po().text("Selected potential match:")),b().createElement(Ay(),{className:n.label},b().createElement(Wd,{className:n.link,value:(0,O.getEntityUriForLink)(i)},(0,O.getLabel)(i.label)),r&&b().createElement(b().Fragment,null,` ${po().text("and")} `,b().createElement(Wd,{className:n.link,value:(0,O.getEntityUriForLink)(o)},o.label?(0,O.getLabel)(o.label):(0,O.getEntityId)(o)))))}default:return null}})())},GN=b().createContext([]);GN.displayName="UsersContext";const qN=(0,Op.Z)((e=>({root:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",wordBreak:"break-word"}}))),ZN=e=>{let{comment:t,className:r}=e;const n=qN(),a=(0,E.useContext)(GN);return b().createElement(Ay(),{className:T()(n.root,r)},function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>e,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"+";const a=[];let o="",i=!1;for(let l=0;l<=e.length;l++){const s=e[l],c=e[l+1],u=l===e.length-1;o+=s,s===n&&0===l&&(i=!0),i&&t.includes(o.slice(n.length))&&(i=!1,a.push(r(o)),o=""),c===n&&(i=!0,a.push(o),o=""),u&&a.push(o)}return a}(t.content,t.namedUsers,(e=>{const t=a.find((t=>t.username===e.slice(1)));return t?b().createElement(jy(),{href:`mailto:${t.email}`,underline:"hover"},e):e})).map(((e,t)=>b().createElement(E.Fragment,{key:t},e))))},$N=(0,Op.Z)((e=>({root:{width:"32px",height:"32px",fontSize:"12px",color:e.palette.text.secondary,backgroundColor:"rgba(144, 164, 174, 0.2)"}})));function KN(){return KN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},KN.apply(this,arguments)}const XN=e=>{let{className:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","children"]);const a=$N();return b().createElement(C(),KN({},n,{className:T()(a.root,t)}),r.split(".").map((e=>e[0].toUpperCase())).join(""))};var QN=r(2271);const JN=r(47503).$+1,eD=(0,Op.Z)((e=>({root:{backgroundColor:"#fff",fontFamily:"Roboto"},mentionsControl:{fontSize:"13px"},mentionsHighlighter:{padding:"10px 22px",border:"1px solid transparent !important","&::before":{content:e=>{let{placeholder:t}=e;return t&&`"${t}"`}}},mentionsInput:{borderRadius:"2px",border:"1px solid rgba(0,0,0,0.12)",padding:"10px 22px",outline:0,overflow:"auto !important"},mentionsSuggestions:{padding:"8px 0",zIndex:JN+"!important",borderRadius:"4px",backgroundColor:"#fafafa !important",boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",transform:"translateY(-100%)"},mentionsSuggestionsList:{maxHeight:"200px",overflowY:"scroll"},mentionsSuggestionsItem:{padding:"6px 12px",color:e.palette.text.primary,fontSize:"13px",transition:e.transitions.create(["background-color"]),"&:hover, &--focused":{backgroundColor:"rgba(0,0,0,0.04)"}},mention:{position:"relative",zIndex:1,color:e.palette.primary.main,textShadow:"1px 1px 1px white, 1px -1px 1px white, -1px 1px 1px white, -1px -1px 1px white",pointerEvents:"none"}})));function tD(){return tD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tD.apply(this,arguments)}const rD=e=>{let{onChange:t,className:r,value:n,placeholder:a}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onChange","className","value","placeholder"]);const i=eD({placeholder:n?"":a}),l=(0,E.useContext)(GN);return b().createElement("div",{className:T()(i.root,r)},b().createElement(QN.r,tD({},o,{value:n,placeholder:a,onChange:(e,r,n,a)=>{t(r,n,(0,R.uniq)(a.map((e=>{let{display:t}=e;return t.slice(1)}))))},className:"mentionsTextArea",suggestionsPortalHost:document.body,classNames:{mentionsTextArea__input:i.mentionsInput,mentionsTextArea__highlighter:i.mentionsHighlighter,mentionsTextArea__control:i.mentionsControl,mentionsTextArea__suggestions:i.mentionsSuggestions,mentionsTextArea__suggestions__list:i.mentionsSuggestionsList,mentionsTextArea__suggestions__item:i.mentionsSuggestionsItem}}),b().createElement(QN.p,{trigger:"+",data:l.map((e=>{let{username:t}=e;return{id:t,display:t}})),displayTransform:(e,t)=>`+${t}`,appendSpaceOnAdd:!0,className:i.mention})))},nD=(0,Op.Z)({root:e=>{let{isEditing:t}=e;return{padding:t?"6px 6px 6px 0":" 6px 6px 6px 8px",borderRadius:"4px",backgroundColor:t?"transparent":"rgba(0,114,206,0.06)"}},textField:e=>{let{isEditing:t}=e;return{width:t?"100%":"calc(100% - 40px)"}},form:{marginBottom:0},main:{display:"flex",alignItems:"center"},avatar:{marginRight:"8px"},buttons:e=>{let{isEditing:t}=e;return{marginLeft:t?"0":"40px",marginTop:"8px"}},button:{"& + $button":{marginLeft:"8px"}}}),aD=e=>{switch(e){case"open":return po().text("Reply...");case"resolved":return po().text("Adding a comment will re-open this");default:return""}},oD=e=>{let{inputRef:t,className:r,uri:n,relatedObjectUris:a,objectType:o,popperRef:i,comment:l,reply:s,isEditingComment:c,isEditingReply:u,onCancel:p}=e;const d=c||u,m=nD({isEditing:d}),[y,g]=(0,E.useState)(!1),{createReply:f,createComment:h,sending:v,editComment:O,editReply:x,getCommentState:C,updateCommentState:w,clearCommentState:A}=(0,E.useContext)(pN),_=(0,S.qg)(),I=(e=>{let{comment:t,reply:r,isEditingComment:n,isEditingReply:a}=e;return(0,R.isNil)(t)?"comment/new":n?MN(t):a?VN(t,r):(e=>`comment/${e.commentId}/reply/new`)(t)})({comment:l,reply:s,isEditingComment:c,isEditingReply:u}),N=(e=>{let{comment:t,reply:r,isEditingComment:n,isEditingReply:a}=e;const o=n?t:a?r:null,{content:i="",namedUsers:l=[]}=o||{};return{value:BN(i,l),plainTextValue:i,mentions:l}})({comment:l,reply:s,isEditingComment:c,isEditingReply:u}),{value:D=N.value,plainTextValue:P=N.plainTextValue,mentions:k=N.mentions}=C(n,I),L=""!==D.trim(),U=y||L,j=null==l?void 0:l.status,F=()=>{null==p||p(),A(n,I)};(0,E.useEffect)((()=>{i&&i.current.forceUpdate()}),[i,U]);const M=d?"small":"medium";return b().createElement($I(),{className:T()(m.root,r)},b().createElement("form",{onSubmit:e=>(e.preventDefault(),(0,R.cond)([[(0,R.always)(!l),()=>h({content:P,namedUsers:k,objectType:o,uri:n,relatedObjectUris:a})],[(0,R.always)(c),()=>O({content:P,namedUsers:k,commentId:l.commentId,objectType:o,replies:l.replies,relatedObjectUris:a,uri:n})],[(0,R.always)(u),()=>x({content:P,namedUsers:k,commentId:l.commentId,replyId:s.replyId})],[R.T,()=>f({content:P,namedUsers:k,commentId:l.commentId,action:"open"===l.status?"none":"reopen",uri:n})]])().then(F).catch(console.log)),className:m.form},b().createElement($I(),{className:m.main},!d&&b().createElement(XN,{classes:{root:m.avatar}},_),b().createElement(rD,{className:m.textField,disabled:v,onChange:(e,t,r)=>w(n,I,{value:e,plainTextValue:t,mentions:r}),inputRef:t,value:D,onFocus:()=>g(!0),onBlur:()=>g(!1),placeholder:aD(j)})),U&&b().createElement($I(),{className:m.buttons},b().createElement(dE(),{className:m.button,variant:"contained",color:"primary",disabled:!L||v,type:"submit",size:M},((e,t,r)=>t||r?po().text("Edit"):"open"===e||"resolved"===e?po().text("Reply"):po().text("Comment"))(j,c,u)),b().createElement(dE(),{disabled:v,onClick:()=>F(),className:m.button,variant:"outlined",color:"primary",size:M},po().text("Cancel")))))},iD=(0,Op.Z)((e=>({header:{display:"flex"},avatar:{marginRight:"8px"},username:{marginBottom:"1px",color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},createdAt:{marginTop:"3px",marginRight:"4px",color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},body:{marginLeft:"40px"},commentTarget:{marginTop:"-15px",overflowWrap:"break-word"},message:{marginTop:"12px"},dropdownMenu:{zIndex:"3000 !important"},buttons:{marginTop:"15px",marginBottom:"12px",display:"flex","& $button + $button":{marginLeft:"10px"}},button:{fontSize:"13px",lineHeight:"15px"}}))),lD=e=>{let{onReply:t,className:r,uri:n,comment:a,relatedObjectUris:o,objectType:i}=e;const l=iD(),s=(0,E.useRef)(),c=(0,S.qg)(),{commentId:u,createdBy:p,createdTime:d,status:m}=a,y="resolved"===m,g=p===c,{resolveThread:f,reOpenThread:h,sending:v,deleteComment:T,updateCommentState:O,getCommentState:x}=(0,E.useContext)(pN),C=MN(a),{isEditing:w}=x(n,C),A=(0,E.useCallback)((e=>O(n,C,{isEditing:e})),[C,O,n]);UN(s,w);const R=(0,E.useMemo)((()=>y?[{text:po().text("Delete"),onClick:()=>T({uri:n,commentId:u})}]:[{text:po().text("Edit"),onClick:()=>A(!0)},{text:po().text("Delete"),onClick:()=>T({uri:n,commentId:u})}]),[u,T,y,A,n]),_=b().createElement(oD,{inputRef:s,uri:n,relatedObjectUris:o,objectType:i,onCancel:()=>A(!1),isEditingComment:w,comment:a});return b().createElement($I(),{className:r},b().createElement($I(),{className:l.header},b().createElement(XN,{classes:{root:l.avatar}},p),b().createElement($I(),{width:"100%"},b().createElement(Ay(),{className:l.username},p)),b().createElement(Ay(),{className:l.createdAt},FN(d)),g&&b().createElement(LN,{buttonComponent:Cd.k,buttonProps:{icon:Fd(),tooltipTitle:po().text("Open menu")},popoverProps:{PopoverClasses:{root:l.dropdownMenu}},menuItems:R,menuId:"collaboration-comment-menu"})),b().createElement($I(),{className:l.body},b().createElement(WN,{comment:a,className:l.commentTarget}),w?_:b().createElement(ZN,{comment:a,className:l.message}),b().createElement($I(),{className:l.buttons},b().createElement(jy(),{className:l.button,onClick:t,component:"button",underline:"hover"},po().text("Reply")),!y&&b().createElement(jy(),{disabled:v,className:l.button,onClick:()=>{f({commentId:u,uri:n})},component:"button",underline:"hover"},po().text("Resolve")),y&&b().createElement(jy(),{disabled:v,className:l.button,onClick:()=>{h({commentId:u,uri:n})},component:"button",underline:"hover"},po().text("Re-open")))))},sD=(0,Op.Z)((e=>({root:{display:"flex",padding:"8px",borderRadius:"4px",backgroundColor:"rgba(0,114,206,0.06)"},avatar:{marginRight:"8px"},replyArea:{width:"calc(100% - 60px)"},header:{display:"flex",marginBottom:"8px"},username:{color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},message:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px"},createdAt:{color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},marked:{marginLeft:"8px",color:e.palette.text.secondary,fontSize:"13px",fontStyle:"italic",lineHeight:"15px"}}))),cD=e=>{let{className:t,reply:r,uri:n,comment:a,popperRef:o}=e;const i=(0,E.useRef)(),l=(0,S.qg)(),{createdBy:s,action:c,createdTime:u}=r,p=s===l&&"resolved"!==a.status,{deleteReply:d,updateCommentState:m,getCommentState:y}=(0,E.useContext)(pN),g=VN(a,r),{isEditing:f}=y(n,g),h=(0,E.useCallback)((e=>m(n,g,{isEditing:e})),[g,m,n]);UN(i,f);const v=sD(),O=(0,E.useMemo)((()=>[{text:po().text("Edit"),onClick:()=>h(!0)},{text:po().text("Delete"),onClick:()=>d({uri:n,commentId:a.commentId,reply:r})}]),[d,n,a.commentId,r,h]),x=b().createElement(oD,{inputRef:i,popperRef:o,uri:n,onCancel:()=>h(!1),isEditingReply:f,reply:r,comment:a});return b().createElement($I(),{className:T()(v.root,t)},b().createElement(XN,{classes:{root:v.avatar}},s),b().createElement($I(),{className:v.replyArea},b().createElement($I(),{className:v.header},b().createElement(Ay(),{className:v.username},s),"resolve"===c&&b().createElement(Ay(),{className:v.marked},po().text("Marked as resolved")),"reopen"===c&&b().createElement(Ay(),{className:v.marked},po().text("Re-opened"))),"resolve"!==c&&(f?x:b().createElement(ZN,{className:v.message,comment:r})),b().createElement(Ay(),{className:v.createdAt},FN(u))),p&&b().createElement(LN,{buttonComponent:Cd.k,buttonProps:{icon:Fd(),tooltipTitle:po().text("Open menu")},menuItems:O,menuId:"collaboration-comment-menu"}))},uD=(0,Op.Z)((()=>({root:{maxWidth:"100%",padding:"8px 4px 10px 16px"},messages:{},repliedComment:{marginBottom:"2px"},replies:{marginLeft:"40px"},sendMessageArea:{marginLeft:"40px"},comment:{}}))),pD=(0,E.memo)((e=>{let{uri:t,relatedObjectUris:r,objectType:n,classes:a,popperRef:o,messagesRef:i,comment:l}=e;const s=(0,E.useRef)(),c=uD({classes:a}),u=b().createElement(oD,{className:c.sendMessageArea,inputRef:s,popperRef:o,uri:t,relatedObjectUris:r,objectType:n,comment:l});return b().createElement($I(),{className:c.root},l&&b().createElement(b().Fragment,null,b().createElement("div",{className:c.messages,ref:i},b().createElement(lD,{comment:l,uri:t,onReply:()=>{s.current.focus()},className:c.comment,relatedObjectUris:r,objectType:n}),b().createElement($I(),{className:c.replies},l.replies.map((e=>b().createElement(cD,{key:e.replyId,className:c.repliedComment,reply:e,uri:t,comment:l}))))),u),!l&&u)})),dD=(0,Op.Z)((e=>({root:{},header:{display:"flex",alignItems:"center",height:"48px",paddingLeft:"16px",paddingRight:"8px"},headerInfo:{marginRight:"auto",display:"flex",alignItems:"center"},title:{marginRight:"15px",color:e.palette.text.primary,fontSize:"16px"},counter:{paddingLeft:"15px",borderLeft:"1px solid rgba(0,0,0,0.12)",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"24px"},resolveButton:{zIndex:3e3,"&:hover":{backgroundColor:"transparent"}},popper:{width:"424px",borderRadius:"0 0 4px 4px"},collaborationItem:{padding:"0 0 10px 0"},comment:e=>{let{hasScroll:t}=e;return{marginLeft:"16px",marginRight:t?"2px":"8px"}},replies:e=>{let{hasScroll:t}=e;return{marginLeft:"8px",marginRight:t?"2px":"8px"}},sendMessageArea:e=>{let{hasScroll:t,scrollWidth:r}=e;return{marginLeft:"8px",marginRight:t?r+2:"8px"}},messages:{maxHeight:"400px",overflowY:"auto"}}))),mD=e=>{let{uri:t,relatedObjectUris:r,objectType:n,anchorEl:a,onClose:o,open:i,comment:l}=e;const[s,c]=(0,E.useState)(0),u=dD({scrollWidth:s,hasScroll:0!==s}),p=(0,E.useRef)(null),{resolveThread:d,loading:m,sending:y}=(0,E.useContext)(pN),g=1+(null==l?void 0:l.replies.length);return b().createElement(AN,{popperRef:p,anchorEl:a,open:i,placement:"right-start",onClose:o,className:u.popper},b().createElement($I(),{className:u.header},b().createElement($I(),{className:u.headerInfo},b().createElement(Ay(),{className:u.title},po().text("Comments")),l&&!m&&b().createElement(Ay(),{className:u.counter},po().number(g)," ",1===g?po().text("item"):po().text("items"))),l&&!m&&b().createElement(Cd.k,{className:u.resolveButton,size:"S",onClick:()=>{d({commentId:l.commentId,uri:t})},disabled:y,showForDisabled:!0,tooltipTitle:po().text("Resolve"),icon:Om(),color:"primary"})),!m&&b().createElement(pD,{popperRef:p,messagesRef:e=>{e&&c(e.offsetWidth-e.clientWidth)},classes:{root:u.collaborationItem,replies:u.replies,sendMessageArea:u.sendMessageArea,messages:u.messages,comment:u.comment},uri:t,relatedObjectUris:r,objectType:n,comment:l}))},yD=(0,Op.Z)((()=>({root:{display:"flex",alignItems:"start"},addButton:{visibility:"hidden","&$showAlways":{visibility:"visible"},".commentsContainerVisibilityArea:hover &":{visibility:"visible"}},showAlways:{}}))),gD=e=>{let{className:t,uri:r,objectType:n,relatedObjectUris:a,onChangePopupVisibility:o,allowOnlyOneComment:i=!1,showAlways:l=!1}=e;const s=yD(),[c,u]=(0,E.useState)(null),[p,d]=(0,E.useState)(!1),m=p&&Boolean(c),{currentComment:y,commentsMap:g,getComment:f,clearCurrentComment:h,objectTypes:v}=(0,E.useContext)(pN),O=!!g&&(!v||v.includes(n)),x=((null==g?void 0:g[r])||[]).filter((e=>{let{status:t}=e;return"resolved"!==t})).reverse(),C=!i||i&&0===x.length,S=null===y&&m;(0,NE.D)((()=>{o&&o(m)}),[m]);const w=(0,E.useContext)(cN),A=(0,E.useMemo)((()=>w?[...a,...w]:a),[w,a]);return O&&b().createElement("div",{className:T()(s.root,t)},C&&b().createElement(TN,{className:T()(s.addButton,{[s.showAlways]:l||S}),onClick:e=>{u(e.currentTarget),d(!0)}}),x.map((e=>{let{replies:t,commentId:r}=e;return b().createElement(EN,{ref:r===(null==y?void 0:y.commentId)?u:null,key:r,onClick:()=>(e=>{f(e),d(!0)})(r)},1+t)})),b().createElement(mD,{anchorEl:c,open:m,onClose:()=>{u(null),h(),d(!1)},uri:r,relatedObjectUris:A,objectType:n,comment:y}))},fD=(0,Op.Z)({label:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"16px"}});function hD(){return hD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hD.apply(this,arguments)}const ED=e=>{let{label:t,isRequired:r,className:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","isRequired","className"]);const o=fD();return b().createElement(Ay(),hD({className:T()(o.label,n),component:"span"},a),t,r&&b().createElement(ud,null))},bD=b().createContext(null);bD.displayName="EntityContext";const vD=(0,Op.Z)((e=>({container:{height:"16px",borderColor:(0,km.alpha)(e.palette.primary.main,.54)},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px",color:e.palette.primary.main}}))),TD=(0,md.T)(ef()),OD=e=>{let{className:t,attributeType:r,nonOvValues:n=[],nonOvTotal:a}=e;const o=vD(),i=(0,S.ax)("openEntity"),l=((e,t,r)=>{var n;const a=null==t||null===(n=t[0])||void 0===n?void 0:n.uri,o=a?(0,O.getEntityUriFromAttributeUri)(a):null;if(o&&(0,O.isEntityUri)(o)){const t=(0,O.getEntityUriFromAttributeUri)(r.uri);if(!e||e.type===t)return{uri:o,type:t};const n=(0,O.getParentUri)(a),i=(0,O.findAttributeValueByUri)(e,n);return{uri:(0,O.getReferencedEntityUriFromAttrValue)(i),type:t}}return e?{uri:e.uri,type:e.type}:null})((0,E.useContext)(bD),n,r),s=(0,S.fC)(null==l?void 0:l.type),c=(0,E.useCallback)((()=>{i({uri:l.uri,screen:"sources"})}),[i,l]);if(!a)return null;const u=n.length?n.map(((e,t)=>b().createElement("div",{key:t},(0,O.isComplexAttribute)(r)?(0,O.getLabel)(e.label):b().createElement($d.x,{value:(0,O.getAttributeValue)(e),dataTypeDefinition:(0,O.getAttrDataTypeDefinition)(r),rich:!1})))):null;return b().createElement(TD,{tooltipTitle:u,tooltipPlacement:"bottom",label:`+ ${a}`,variant:"outlined",onClick:null!=l&&l.uri&&s?c:void 0,classes:{root:T()(o.container,t),label:o.label}})};function xD(){return xD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xD.apply(this,arguments)}const CD=e=>b().createElement("svg",xD({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),b().createElement("path",{d:"M5.417 9.5h1.166V8.333H5.417V9.5zM6 .167A5.835 5.835 0 00.167 6 5.835 5.835 0 006 11.833 5.835 5.835 0 0011.833 6 5.835 5.835 0 006 .167zm0 10.5A4.673 4.673 0 011.333 6 4.673 4.673 0 016 1.333 4.673 4.673 0 0110.667 6 4.673 4.673 0 016 10.667zM6 2.5a2.333 2.333 0 00-2.333 2.333h1.166A1.17 1.17 0 016 3.667a1.17 1.17 0 011.167 1.166c0 1.167-1.75 1.021-1.75 2.917h1.166c0-1.313 1.75-1.458 1.75-2.917A2.333 2.333 0 006 2.5z",fill:"#000",fillOpacity:.54})),SD=b().createContext({showDescription:!1,showNavigateToGraph:!0});SD.displayName="FeaturesContext";const wD=(0,Op.Z)((()=>({icon:{display:"inline-flex",marginLeft:"8px",verticalAlign:"middle"}}))),AD=e=>{let{className:t,description:r}=e;const{showDescription:n}=(0,E.useContext)(SD),a=wD();return r&&n?b().createElement(Gg(),{title:r,placement:"bottom"},b().createElement("span",{"data-reltio-id":"reltio-description-icon",className:T()(a.icon,t)},b().createElement(CD,null))):null},RD=b().createContext({appearance:void 0,attributes:void 0,roles:void 0,tags:void 0});RD.displayName="HistoryDiffContext";const _D=b().createContext({highlightedValuesUris:[],highlightedClassName:""});function ID(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}_D.displayName="HighlightedValuesContext";const ND=(e,t,r,n)=>{const a=((e,t)=>{const r=t.find((t=>t.uri===e.uri));return r&&Array.isArray(r.children)?r.children:[]})(e,r);let o=(null==e?void 0:e.attributes)||(null==e?void 0:e.analyticsAttributes)||[];return a.length&&(o=o.filter((e=>a.includes(e.uri)))),o.reduce(((e,a)=>{const o=DD(t[a.name],n,r);return o&&o.length&&(Array.isArray(o[0])?e.push({[a.uri]:o[0]}):e.push({[a.uri]:o})),e}),[])},DD=(e,t,r)=>{if(e&&0!==e.length)return e.reduce(((e,n)=>{if("type"in n&&n.type){const a="lookupCode"in n?n.lookupCode:n.value,o=(0,O.findAttributeTypeByUri)(t,n.type);a&&"object"!=typeof a&&(0,O.isOv)(n)?e.push(PD(a,o)):a&&"object"==typeof a&&!Array.isArray(a)&&e.push(ND(o,a,r,t))}return e}),[])},PD=(e,t)=>{switch(null==t?void 0:t.type){case O.DataTypes.TYPE_DATE:return new Date(e).getTime();case O.DataTypes.TYPE_TIMESTAMP:return isNaN(Number(e))?new Date(e).getTime():new Date(Number(e)).getTime();default:return e}};function kD(){return kD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kD.apply(this,arguments)}const LD=e=>b().createElement("svg",kD({width:11,height:11,viewBox:"0 0 11 11"},e),b().createElement("path",{d:"M2.514 5h2.314V3l2.5 2.5-2.5 2.5V6h-3.8a4.5 4.5 0 10.73-3H.6a5.5 5.5 0 11-.577 3H0V5H2.514z",fill:"#6CACE4",stroke:"none",strokeWidth:1,fillRule:"evenodd"})),UD=(0,Op.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}}))),jD=(0,E.forwardRef)(((e,t)=>{let{value:r,attributeType:n,children:a,className:o,onClick:i}=e;const l=UD(),{generatePivotingUrl:s}=(0,E.useContext)(Hd),c=s({uiPath:(0,S.Qh)(),uri:n.uri,value:JSON.stringify(r)}),u=(0,E.useCallback)((e=>{(0,bp.rR)(e)||(i(),e.preventDefault()),e.stopPropagation()}),[i]);return b().createElement("a",{ref:t,href:c,onClick:u,className:T()(l.link,o)},a)}));jD.displayName="PivotingUriLink";const FD=jD,MD=(0,Op.Z)((e=>({container:{backgroundColor:"white",width:"360px",minWidth:"360px",maxWidth:"720px"},header:{display:"flex",height:"48px",alignItems:"center",justifyContent:"space-between",paddingLeft:"16px"},title:{color:e.palette.text.primary,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"19px"},entityTypeLabel:{color:"rgba(0,0,0,0.67)",fontSize:"14px",paddingLeft:"16px",paddingBottom:"12px",lineHeight:"16px"},divider:{height:"24px",width:"1px",backgroundColor:"rgba(0,0,0,0.12)"},headerCount:{color:e.palette.text.secondary,fontSize:"14px",letterSpacing:"0.24px",lineHeight:"28px",width:"210px"},body:{borderBottom:"1px solid rgba(0,0,0,0.12)",padding:"0 16px 8px"},footer:{display:"flex",alignItems:"center",height:"32px",paddingLeft:"16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"16px"},profileIcon:{height:"16px",width:"16px"},entityContainer:{display:"flex",flexDirection:"row",alignItems:"center"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px",textDecoration:"none",paddingLeft:"8px",wordBreak:"break-word"},seeAllButton:{cursor:"pointer"}}))),VD=e=>{let{attributeType:t,label:r,entities:n,generatedValue:a,onSeeAllClick:o,total:i}=e;const l=MD(),s=i>6,c=Boolean(r);return b().createElement("div",{className:l.container},b().createElement("div",{className:l.header},b().createElement("div",{className:l.title},po().text("Pivot profiles")),b().createElement("div",{className:l.divider}),b().createElement("div",{className:l.headerCount},po().number(i,"0,0")+" "+(1===i?po().text("item"):po().text("items")))),c&&b().createElement("div",{className:l.entityTypeLabel},r),b().createElement("div",{className:l.body},n.map((e=>b().createElement("div",{key:e.uri,className:l.entityContainer},b().createElement(w,{entity:e,avatarClassName:l.profileIcon}),b().createElement(Wd,{className:l.entityLabel,value:(0,O.getEntityUriForLink)(e)},(0,O.getLabel)(e.label)))))),s&&b().createElement("div",{className:l.footer},b().createElement(FD,{value:a,attributeType:t,className:l.seeAllButton,onClick:o},po().text("See all"))))},BD=(0,Op.Z)((e=>({icon:{marginRight:"8px",verticalAlign:"middle",width:"12px",height:"12px"},content:{color:e.palette.primary.main,cursor:"pointer",lineHeight:"16px"}}))),zD=(0,Op.Z)({tooltip:{backgroundColor:"white",boxShadow:"0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12), 0 2px 4px -1px rgba(0,0,0,0.2)",padding:0,borderRadius:"4px",maxWidth:"none"},arrow:{"&::before":{backgroundColor:"white"}}}),HD=e=>{let{value:t,attributeType:r,children:n,className:a}=e;const o=zD(),i=BD(),l=(0,E.useContext)(KI)||[],s=(0,S.ax)("openPivotingPerspective"),c=(0,S.AH)()||{},u=(0,O.isNested)(r)?ND(r,t.value,l,c):PD(t.lookupCode||t.value,r),p=l.some((e=>{let{uri:t}=e;return t===r.uri}))&&(Array.isArray(u)&&u.length||!Array.isArray(u)&&!(0,R.isNil)(u)),d=l.find((e=>{let{uri:t}=e;return t===r.uri})),m=null==d?void 0:d.popup,y=p?Array.isArray(u)?u.map((e=>Object.fromEntries(Object.entries(e).map((e=>{let[t,r]=e;return[(0,O.getLastUriPart)(t),r]}))))):((e,t)=>[{[e.name]:t}])(r,u):void 0,g=()=>{s({value:y,attributeType:r})},{entities:f,total:h,loadPivotingData:v}=(e=>{let{value:t,attributeType:r,entityType:n}=e;const[a,o]=(0,E.useState)([]),[i,l]=(0,E.useState)(0),s=(0,Hh._)(),c=(0,S.eh)(),u=(0,S.mU)(),p=n||(null==c?void 0:c.type),d=(0,E.useMemo)((()=>(0,O.convertPivotingValueToSearchFilters)({value:t,attributeType:r,entityType:p})),[r,p,t]),m=(0,E.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ID(e,t,r[t])}))}return e}({max:6,sort:"label"},u||{})),[u]),y=(0,E.useCallback)((()=>{s(Promise.all([(0,O.getFilteredEntities)({filters:d,options:m}),(0,O.getTotals)({filters:d,options:m})])).then((e=>{const[t,{total:r}]=e;o(Array.isArray(t)?t:[]),l(r)})).catch((()=>{o([]),l(0)}))}),[d,m,s]);return{entities:a,total:i,loadPivotingData:y}})({attributeType:r,value:u,entityType:null==m?void 0:m.entityType});return p?b().createElement(Gg(),{arrow:!0,placement:"right-start",classes:o,disableInteractive:!1,onOpen:v,title:b().createElement(VD,{generatedValue:y,attributeType:r,label:null==m?void 0:m.label,onSeeAllClick:g,entities:f,total:h})},b().createElement("span",{className:a},b().createElement(LD,{className:i.icon}),b().createElement(FD,{onClick:g,className:i.content,value:y,attributeType:r},n))):b().createElement(b().Fragment,null,n)};function YD(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){WD(e,t,r[t])}))}return e}function WD(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const GD=(0,Op.Z)((e=>({root:{display:"flex",alignItems:"start",justifyContent:"space-between"},commentsContainer:{height:"15px",marginRight:"-4px"},attributeValue:{verticalAlign:"middle",wordBreak:"break-all"},updateAttribute:YD({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},O.historyPalettes[O.HistoryOperations.updateAttribute],{"& > a":{color:O.historyPalettes[O.HistoryOperations.updateAttribute].color}}),insertAttribute:YD({width:"fit-content"},O.historyPalettes[O.HistoryOperations.insertAttribute],{"& > a":{color:O.historyPalettes[O.HistoryOperations.insertAttribute].color}}),deleteAttribute:YD({width:"fit-content",padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},O.historyPalettes[O.HistoryOperations.deleteAttribute],{"& > a":{color:O.historyPalettes[O.HistoryOperations.deleteAttribute].color}}),multilineAttribute:{width:"fit-content"},ovFalse:e.inactive}))),qD=e=>{let{className:t,attributeType:r=null,attributeValue:n,inlined:a}=e;const o=GD(),{highlightedValuesUris:i=[],highlightedClassName:l}=(0,E.useContext)(_D),{appearance:s}=(0,E.useContext)(RD),c=(0,O.getHistoryAppearanceByUri)(n.uri,s),u=(0,O.getHistoryAttributeClassName)(c),p=b().createElement($d.x,{value:(0,O.getAttributeValue)(n),dataTypeDefinition:(0,O.getAttrDataTypeDefinition)(r)}),d=(0,O.isRelationUri)(n.uri)?O.CollaborationObjectTypes.RELATION_ATTRIBUTE:O.CollaborationObjectTypes.ENTITY_ATTRIBUTE;return a||u?b().createElement("div",{className:T()(t,{[l]:i.includes(n.uri)})},b().createElement(HD,{value:n,attributeType:r,key:n.uri,className:T()({[o.multilineAttribute]:!a})},b().createElement("span",{className:T()(o.attributeValue,o[u],{[o.ovFalse]:!(0,O.isOv)(n)}),"data-reltio-id":"reltio-attribute-value"},p))):b().createElement("div",{className:T()(t,o.root,sN,{[l]:i.includes(n.uri)})},b().createElement(HD,{value:n,attributeType:r,key:n.uri},b().createElement("span",{className:T()(o.attributeValue,{[o.ovFalse]:!(0,O.isOv)(n)}),"data-reltio-id":"reltio-attribute-value"},p)),b().createElement(gD,{className:o.commentsContainer,uri:n.uri,relatedObjectUris:(0,O.createRelatedObjectUris)(d,{uri:n.uri}),objectType:d}))};var ZD=r(84419),$D=r.n(ZD);const KD=(0,Op.Z)({expandButton:{"&:hover":{backgroundColor:"transparent"}},expandIcon:{transition:"transform .15s ease"},expanded:{transform:"rotate(90deg)"}});function XD(){return XD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},XD.apply(this,arguments)}const QD=e=>{const t=KD(),{expanded:r,className:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["expanded","className"]);return b().createElement(Dp.T,XD({icon:$D(),size:"XXS",disableRipple:!0,iconClassName:T()(t.expandIcon,{[t.expanded]:r}),className:T()(n,t.expandButton),"data-reltio-id":"arrow-expand-button"},a))},JD=(0,Op.Z)((e=>({complexContainer:{marginTop:"1px"},labelContainer:{display:"flex",minHeight:"18px"},label:{display:"inline-flex",fontSize:"13px",lineHeight:"16px",letterSpacing:"normal",marginLeft:"2px"},spacer:{flex:1},ovFalse:e.inactive})));function eP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tP=e=>{let{attributeTypesList:t,attributeValue:r,label:n,expanded:a=!1,children:o,showNonOv:i,attributeType:l,LabelRenderer:s,RightSlot:c}=e;const u=JD(),p=r.uri,[d,m]=(0,E.useState)(!1),{highlightedValuesUris:y=[],highlightedClassName:g}=(0,E.useContext)(_D);(0,E.useEffect)((()=>{m(a)}),[a]);const f=(t||[]).some((e=>(0,O.isAnalyticAttribute)(e))),h=(0,E.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){eP(e,t,r[t])}))}return e}({attributes:f?null:r.value,analyticsAttributes:f?r.value:null},(0,O.isSpecialAttribute)(l)?r.value:{})),[r,f,l]),v=(0,O.isRelationUri)(r.uri)?O.CollaborationObjectTypes.RELATION_ATTRIBUTE:O.CollaborationObjectTypes.ENTITY_ATTRIBUTE;return b().createElement("div",{className:u.complexContainer},b().createElement("div",{className:T()(u.labelContainer,sN)},b().createElement(QD,{onClick:()=>m((e=>!e)),expanded:d}),s?b().createElement(s,{attributeType:l,attributeValue:r}):b().createElement(b().Fragment,null,b().createElement(Ay(),{component:"span",variant:"body2",classes:{body2:u.label},className:T()({[g]:y.includes(r.uri),[u.ovFalse]:!(0,O.isOv)(r)}),"data-reltio-id":"reltio-attribute-complex-label"},n),b().createElement("div",{className:u.spacer}),c&&b().createElement(c,{attributeType:l,attributeValue:r}),b().createElement(gD,{uri:r.uri,relatedObjectUris:(0,O.createRelatedObjectUris)(v,{uri:r.uri}),objectType:v}))),d&&b().createElement(BF,{attrTypes:t,entity:h,drawLines:!0,parentUri:p,showNonOv:i},o))};tP.propTypes={children:hp().node,label:hp().oneOfType([hp().string,hp().node]),attributeTypesList:hp().arrayOf(O.AttributeTypeType),attributeValue:hp().oneOfType([O.NestedAttributeValueType,O.ReferenceAttributeValueType]),expanded:hp().bool,showNonOv:hp().bool,attributeType:O.AttributeTypeType,LabelRenderer:hp().elementType,RightSlot:hp().elementType};var rP=r(71896);function nP(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){aP(e,t,r[t])}))}return e}function aP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oP=(0,Op.Z)({label:{textDecoration:"none",verticalAlign:"middle"},updateAttribute:nP({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},O.historyPalettes[O.HistoryOperations.updateAttribute]),insertAttribute:nP({width:"fit-content"},O.historyPalettes[O.HistoryOperations.insertAttribute]),deleteAttribute:nP({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},O.historyPalettes[O.HistoryOperations.deleteAttribute]),pivotingTooltip:{marginLeft:"4px"}});function iP(){return iP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iP.apply(this,arguments)}const lP=e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=oP(),{appearance:o}=(0,E.useContext)(RD),i=(0,E.useMemo)((()=>{const e=(0,O.getHistoryAppearanceByUri)(t.uri,o),n=(0,O.getHistoryAttributeClassName)(e),i=t.label?t.label:(0,O.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return b().createElement(HD,{className:a.pivotingTooltip,value:t,attributeType:r},b().createElement($I(),{component:"span",className:T()(a[n],a.label)},b().createElement(rP.Z,{text:(0,O.getLabel)(i)})))}),[o,a,t,r]);return b().createElement(tP,iP({label:i,attributeValue:t,attributeTypesList:(0,O.getAttributeTypeSubAttributes)({},r),attributeType:r},n))};lP.propTypes=O.NestedAttributeType;const sP=(0,E.memo)(lP);var cP=r(24217),uP=r(16782);const pP=(0,Op.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}})));function dP(){return dP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dP.apply(this,arguments)}const mP=e=>{const t=pP(),r=(0,uP.GV)(),{href:n,className:a}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["href","className"]),i=T()(t.link,a);return r&&n?b().createElement(cP.rU,dP({to:n.replace(window.location.origin,""),className:i},o)):b().createElement("a",dP({href:n,className:i},o))};function yP(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gP(e,t,r[t])}))}return e}function gP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fP=(0,Op.Z)((e=>({relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary},updateAttribute:yP({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},O.historyPalettes[O.HistoryOperations.updateAttribute]),insertAttribute:yP({width:"fit-content"},O.historyPalettes[O.HistoryOperations.insertAttribute]),deleteAttribute:yP({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},O.historyPalettes[O.HistoryOperations.deleteAttribute]),ovFalse:e.inactive})));function hP(){return hP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hP.apply(this,arguments)}const EP=(0,E.memo)((e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=fP(),o=(0,S.AH)(),i=(0,S.Qh)(),l=(0,O.getReferencedEntityUriFromAttrValue)(t),s=(0,E.useMemo)((()=>(0,O.getAttributeTypeSubAttributes)(o,r)),[r,o]),{appearance:c}=(0,E.useContext)(RD),{generateEntityUrl:u}=(0,E.useContext)(Hd),p=(0,E.useMemo)((()=>{const e=(0,O.getHistoryAppearanceByUri)(t.uri,c),r=(0,O.getHistoryAttributeClassName)(e),n=null!=l&&l.startsWith("changeRequests")?"dcrReview":"profile";return b().createElement(mP,{href:(0,O.isEmptyValue)(c)?u({uiPath:i,uri:l,screen:n}):void 0,className:T()(a[r],{[a.ovFalse]:!(0,O.isOv)(t)})},b().createElement(rP.Z,{text:(0,O.getLabel)(t.label)}),t.relationshipLabel&&b().createElement("span",{className:a.relationshipLabel},b().createElement(rP.Z,{text:t.relationshipLabel})))}),[t,c,i,l,a,u]);return b().createElement(tP,hP({attributeTypesList:s,attributeValue:t,label:p,attributeType:r},n))}));EP.displayName="ReferenceAttribute";const bP=e=>{const{attributeType:t}=e;return class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case O.DataTypes.TYPE_NESTED:return b().createElement(sP,t);case O.DataTypes.TYPE_REFERENCE:return b().createElement(EP,t);default:return b().createElement(qD,t)}}}.build(t,e)};function vP(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){TP(e,t,r[t])}))}return e}function TP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const OP="13px",xP="16px",CP={titleRow:{display:"inline-block",minHeight:"16px"},title:{wordBreak:"break-all",verticalAlign:"middle"},ovIcon:{marginLeft:"8px",textIndent:0},descriptionIcon:{textIndent:0}},SP=(0,Op.Z)({paddingWrapper:{paddingTop:"3px",paddingBottom:"5px","&:last-child":{paddingBottom:"2px"}},paddingWrapperWithLines:{paddingBottom:"1px","&:last-child":{paddingBottom:"2px"}}}),wP=(0,Op.Z)(vP({wrapper:{fontSize:OP,lineHeight:xP},collaborationWrapper:{display:"flex",alignItems:"start",minHeight:"18px",justifyContent:"space-between"},attribute:{marginLeft:"8px",paddingLeft:"4px",paddingRight:"4px",display:"inline",overflow:"hidden",whiteSpace:"pre-wrap",wordBreak:"break-word"},titleIcon:{width:"16px",height:"16px",marginRight:"8px",marginLeft:"1px",color:"rgba(0, 0, 0, 0.38)",verticalAlign:"middle"}},CP)),AP=(0,Op.Z)(vP({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",fontSize:OP,lineHeight:xP},attribute:{"&:last-child":{marginBottom:0},paddingLeft:"4px",paddingRight:"4px",marginLeft:"5px",marginBottom:"4px",whiteSpace:"pre-wrap",wordBreak:"break-word"},attributes:{alignSelf:"stretch"},titleRow:vP({},CP.titleRow,{marginBottom:"3px"})},CP)),RP=e=>{let{value:t,nonVisibleValues:r,attributeType:n,titleClassName:a,contentClassName:o,showNonOv:i,totalNonVisibleValues:l}=e;const s=wP(),{label:c,description:u}=n,p=(0,O.isRelationUri)(t.uri)?O.CollaborationObjectTypes.RELATION_ATTRIBUTE:O.CollaborationObjectTypes.ENTITY_ATTRIBUTE;return b().createElement("div",{"data-reltio-id":"one-line-renderer",className:T()(s.collaborationWrapper,sN)},b().createElement("div",{className:T()(s.titleRow,s.wrapper)},b().createElement(ED,{label:c,className:T()(s.title,a),"data-reltio-id":"reltio-attribute-label"}),b().createElement(AD,{description:u,className:s.descriptionIcon}),b().createElement(OD,{nonOvValues:r,attributeType:n,className:s.ovIcon,nonOvTotal:l}),b().createElement(bP,{className:T()(s.attribute,o),attributeValue:t,attributeType:n,showNonOv:i,inlined:!0})),b().createElement(gD,{uri:t.uri,relatedObjectUris:(0,O.createRelatedObjectUris)(p,{uri:t.uri}),objectType:p}))};var _P=r(33062),IP=r.n(_P);const NP=(0,Op.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),DP=e=>{let{moreNumber:t,valueNumber:r,onClick:n}=e;const a=NP();return b().createElement(jy(),{"data-reltio-id":"show-more",component:"button",variant:"caption",className:a.link,onClick:n,underline:"none"},b().createElement(IP(),{className:a.icon}),t&&r?po().text("Show ${moreNumber} more of remaining ${valueNumber} value",{moreNumber:t,valueNumber:r}):po().text("Show more"))};var PP=r(86800),kP=r.n(PP);const LP=(0,Op.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),UP=e=>{let{onClick:t}=e;const r=LP();return b().createElement(jy(),{component:"button",variant:"caption",className:r.link,onClick:t,underline:"none"},b().createElement(kP(),{className:r.icon}),po().text("Show less"))},jP=e=>{let{max:t,values:r,nonVisibleValues:n,totalVisibleValues:a,attributeType:o,parentUri:i,requestNextPageOfAttributeValues:l,titleClassName:s,contentClassName:c,showNonOv:u,totalNonVisibleValues:p}=e;const d=AP(),[m,y]=(0,E.useState)(t),g=t<a,f=g&&m<a,h=g&&m>=a,{label:v,description:O}=o,x=r.slice(0,m),C=a-m;return b().createElement("div",{"data-reltio-id":"multi-line-renderer",className:d.wrapper},b().createElement("div",{className:d.titleRow},b().createElement(ED,{label:v,className:T()(d.title,s),"data-reltio-id":"reltio-attribute-label"}),b().createElement(AD,{description:O}),b().createElement(OD,{nonOvValues:n,attributeType:o,className:d.ovIcon,nonOvTotal:p})),b().createElement("div",{className:d.attributes},x.map((e=>b().createElement(bP,{key:e.uri,className:T()(d.attribute,c),attributeValue:e,attributeType:o,showNonOv:u})))),f&&b().createElement(DP,{moreNumber:(0,R.min)(t,C),valueNumber:C,onClick:()=>{r.length<a&&l({parentUri:i,attributeTypeUri:o.uri,attributeTypeName:o.name,values:r,defaultMaxValues:t}),y(m+t)}}),h&&b().createElement(UP,{onClick:()=>{y(t)}}))};var FP=r(88941),MP=r.n(FP);function VP(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){BP(e,t,r[t])}))}return e}function BP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zP=(0,Op.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:VP({width:"fit-content"},O.historyPalettes[O.HistoryOperations.insertAttribute]),deleteAttribute:VP({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},O.historyPalettes[O.HistoryOperations.deleteAttribute])}),HP=e=>{let{value:t}=e;const r=zP(),{appearance:n}=(0,E.useContext)(RD),a=(0,S.AH)(),o=(0,O.getHistoryAppearanceBySpecialAttributeValue)("roles",t,n),i=(0,O.getHistoryAttributeClassName)(o);return b().createElement("span",{className:T()(r.attributeValue,r[i])},(0,O.getRoleLabel)(a,t))},YP=e=>{let{className:t,values:r,Component:n,dataReltioId:a}=e;return b().createElement("div",{className:t,"data-reltio-id":a},r.map(((e,t)=>b().createElement(E.Fragment,{key:e},b().createElement(n,{value:e}),t<r.length-1&&", "))))},WP=e=>{let{className:t,values:r}=e;return b().createElement(YP,{values:r,className:t,dataReltioId:"reltio-attribute-value",Component:HP})};function GP(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qP(e,t,r[t])}))}return e}function qP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ZP=(0,Op.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:GP({width:"fit-content"},O.historyPalettes[O.HistoryOperations.insertAttribute]),deleteAttribute:GP({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},O.historyPalettes[O.HistoryOperations.deleteAttribute])}),$P=e=>{let{value:t}=e;const r=ZP(),n=(0,E.useContext)(bD),{appearance:a}=(0,E.useContext)(RD),{generateTagUrl:o}=(0,E.useContext)(Hd),i=(0,S.eh)(),l=(0,S.Qh)(),s=(0,O.getHistoryAppearanceBySpecialAttributeValue)("tags",t,a),c=(0,O.getHistoryAttributeClassName)(s),u=n||i;return b().createElement(mP,{className:T()(r.attributeValue,r[c]),href:o({uiPath:l,tag:t,entityUri:u.dataTenant?(0,O.getDataTenantEntityUri)(u):u.uri})},t)},KP=e=>{let{className:t,values:r}=e;return b().createElement(YP,{values:r,className:t,dataReltioId:"reltio-attribute-value",Component:$P})},XP=e=>{let{values:t,attributeType:r}=e;const n=wP(),{label:a}=r;return b().createElement("div",{"data-reltio-id":"special-renderer",className:T()(n.titleRow,n.wrapper)},(o=n.titleIcon,r.uri===O.EntityAttrTypes.tags.uri?b().createElement(MP(),{className:o}):null),b().createElement(ED,{label:a,className:n.title,"data-reltio-id":"reltio-attribute-label"}),(e=>{switch(r.uri){case O.EntityAttrTypes.tags.uri:return b().createElement(KP,{className:e,values:t});case O.EntityAttrTypes.roles.uri:return b().createElement(WP,{className:e,values:t});default:return b().createElement(bP,{className:e,attributeValue:{value:t[0],uri:""},attributeType:r,inlined:!0})}})(n.attribute));var o};var QP=r(97986),JP=r.n(QP);function ek(){return ek=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ek.apply(this,arguments)}const tk=e=>b().createElement("svg",ek({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},b().createElement("path",{d:"M0 0h24v24H0z"}),b().createElement("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zm-4.5-9l2.5 3.096V18H5l4.5-5.5 2.5 3.01L16.5 10zm-8-4a1.5 1.5 0 110 3 1.5 1.5 0 010-3z",fillOpacity:.12,fill:"#000",fillRule:"nonzero"}))),rk={SMALL:{imageWidth:114,imageHeight:114},MEDIUM:{imageWidth:162,imageHeight:162},LARGE:{imageWidth:192,imageHeight:192},OVERRIDE:{imageWidth:"unset",imageHeight:"unset"}};var nk=r(39034);const ak=(0,Op.Z)((e=>({root:{position:"relative"},image:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,objectFit:"cover",verticalAlign:"bottom"}},defaultContainer:{display:"flex",alignItems:"center",backgroundColor:"rgb(247, 247, 247)"},defaultImage:{width:"40px",height:"40px",marginLeft:"auto",marginRight:"auto",color:e.palette.text.secondary},hideImage:{display:"none"}})));function ok(){return ok=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ok.apply(this,arguments)}const ik=(0,E.memo)((e=>{const{src:t,className:r,containerClassName:n,size:a=rk.SMALL,overlay:o=null}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["src","className","containerClassName","size","overlay"]),l=a||rk.SMALL,s=ak(l),[c,u]=(0,E.useState)(nk.o.LOADING);(0,E.useEffect)((()=>{u(nk.o.LOADING)}),[t]);const p=c===nk.o.LOADING,d=c===nk.o.LOADED;return c===nk.o.ERROR?b().createElement("div",ok({className:T()(s.defaultContainer,s.image,r)},i),b().createElement(JP(),{className:s.defaultImage})):b().createElement("div",{className:T()(s.root,n)},!(0,O.isEmptyValue)(t)&&b().createElement("img",ok({src:t,className:T()(s.image,r,{[s.hideImage]:p}),onLoad:()=>{u(nk.o.LOADED)},onError:()=>{u(nk.o.ERROR)},alt:"image"},i)),p&&b().createElement("div",ok({className:T()(s.defaultContainer,s.image,r)},i),b().createElement(tk,{className:s.defaultImage})),d&&o)})),lk={imageMargin:4,imageWidth:rk.SMALL.imageWidth,imageHeight:rk.SMALL.imageHeight};var sk=r(59849),ck=r.n(sk),uk=r(47867),pk=r.n(uk),dk=r(93643),mk=r.n(dk);const yk=(0,Op.Z)((()=>({thumbnails:{marginLeft:"12px",marginBottom:"12px",marginTop:"auto",width:"calc(100vw - 364px)",overflowX:"auto",overflowY:"hidden"},gridContainer:{width:"100%"},thumb:{width:"96px",height:"96px",cursor:"pointer",userSelect:"none"},inactiveThumb:{filter:"brightness(0.5)"}}))),gk=e=>{let{attributeValues:t,setAttributeValueIndex:r,attributeValueIndex:n}=e;const a=yk(),o=(0,E.useRef)(null);return(0,E.useEffect)((()=>{if(null!=o&&o.current){const e=o.current.scrollLeft,t=o.current.offsetWidth+e,r=96*n+16*n+12;t<r?o.current.scroll&&(r>t+96+16?o.current.scroll(r,0):o.current.scroll(112+e,0)):e+96>r&&o.current.scroll&&o.current.scroll(r-96,0)}}),[n,o]),b().createElement("div",{ref:o,className:a.thumbnails},b().createElement(mk(),{container:!0,wrap:"nowrap",direction:"row",spacing:1,className:a.gridContainer},t.map(((e,t)=>{let{uri:o,value:i}=e;return b().createElement(mk(),{item:!0,key:o},b().createElement(ik,{onClick:()=>r(t),className:T()(a.thumb,{[a.inactiveThumb]:n!==t}),src:(0,O.getImageAttributeOvThumbnailUrl)({value:i})}))}))))},fk=(0,Op.Z)((e=>({root:{display:"flex",alignContent:"center",flexDirection:"column"},main:{position:"relative",padding:"0 86px",marginTop:"auto"},mainImageContainer:{display:"flex",alignContent:"center",height:"100%",width:"100%"},mainImage:{maxWidth:"calc(100vw - 512px)",maxHeight:"calc(100vh - 192px)",margin:"0 auto",userSelect:"none"},arrowButton:{backgroundColor:e.palette.divider,color:"white","&:hover":{backgroundColor:e.palette.divider}},arrowButtonPrev:{position:"absolute",top:"50%",left:"16px",transform:"translateY(-50%)"},arrowButtonNext:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)"}}))),hk=e=>{let{className:t,attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:a}=e;const o=fk(),i=r[n],l=(0,O.getImageAttributeOvPreviewUrl)(i);return b().createElement("div",{className:T()(o.root,t)},b().createElement("div",{className:o.main},n>0&&b().createElement(Dp.T,{icon:ck(),className:T()(o.arrowButton,o.arrowButtonPrev),onClick:()=>{a(n-1)},size:"XL"}),b().createElement(ik,{containerClassName:o.mainImageContainer,className:o.mainImage,size:l&&rk.OVERRIDE,src:l}),n!==r.length-1&&b().createElement(Dp.T,{icon:pk(),className:T()(o.arrowButton,o.arrowButtonNext),onClick:()=>{a(n+1)},size:"XL"})),b().createElement(gk,{attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:a}))};var Ek=r(71884),bk=r.n(Ek);const vk=(0,R.curry)(((e,t)=>(0,R.filter)((t=>(t.label||t.name).toLowerCase().includes(e.toLowerCase())))(t))),Tk=e=>{let{attrTypes:t,filter:r="",sortingFn:n}=e;return(0,R.pipe)(vk(r),(0,R.sort)(n),(0,R.map)((e=>({item:{id:e.uri,label:e.label||e.name,attrType:e}}))))(t)};var Ok=function(e){return e.parent="parent",e.attributes="attributes",e}(Ok||{});const xk=(0,Op.Z)({moreAttributes:{display:"flex",paddingBottom:"6px","&$dense":{padding:0}},dense:{},popupContainer:{},moreAttributesPopup:{"&$popupContainer":{}},moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginTop:"8px",marginLeft:"-4px",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},subHeader:{backgroundColor:"rgb(245, 245, 245)",padding:"0 16px",margin:0,display:"flex",alignItems:"center",color:"rgba(0,0,0,0.84)",fontSize:"14px",fontWeight:500},noResultsCaptionContainer:{position:"absolute",top:0,bottom:0,left:0,right:0,display:"flex",justifyContent:"center",alignItems:"center"}}),Ck=e=>{let{label:t,popupTitle:r=t,data:n,parent:a,dense:o,onApply:i}=e;const l=xk(),s=(0,E.useRef)(),[c,u]=(0,E.useState)(!1),[p,d]=(0,E.useState)(""),[m,y]=(0,E.useState)([]),{items:g,hasGroups:f,parentGroupLength:h,attributesGroupLength:v}=(e=>{let{data:t,parent:r,filter:n}=e;const a=(0,S.mT)(),o=Boolean(r),i=(0,E.useMemo)((()=>a===O.SortingStrategy.ASC_BY_NAME?(e,t)=>{var r;return null==e||null===(r=e.label)||void 0===r?void 0:r.localeCompare(null==t?void 0:t.label)}:(e,t)=>0),[a]),l=(0,E.useMemo)((()=>o?Tk({attrTypes:[r],filter:n,sortingFn:i}):[]),[o,r,n,i]),s=(0,E.useMemo)((()=>o&&null!=l&&l.length?[{item:{id:Ok.parent,label:po().text("Parent")},items:l}]:[]),[o,l]),c=(0,E.useMemo)((()=>Tk({attrTypes:t,filter:n,sortingFn:i})),[t,n,i]),u=(0,E.useMemo)((()=>o&&null!=c&&c.length?[{item:{id:Ok.attributes,label:po().text("Attributes")},items:c}]:c),[o,c]),p=(0,E.useMemo)((()=>Vp((s||[]).concat(u))),[s,u]),d=s.length,m=u.length;return{items:p,hasGroups:o,parentGroupLength:d,attributesGroupLength:m}})({data:n,parent:a,filter:p}),x=(0,E.useCallback)(((e,t)=>{y((0,R.ifElse)((0,R.always)(t),(0,R.append)(e),(0,R.reject)((0,R.propEq)("id",e.id)))(m))}),[m]),C=(0,E.useCallback)(((e,t)=>t.items?40:28),[]),w=(0,E.useCallback)((e=>{let{item:t}=e;x(t,(0,R.not)((0,R.any)((0,R.propEq)("id",t.id))(m)))}),[x,m]),{focusIndex:A,handleKeyDown:_}=qp({items:g,open:c,onSelectFocusedItem:w,selectedItems:m}),I=(0,E.useRef)(null);I.current=A;const N=f?(h?1:0)+(v?1:0):0,D=g.length-N,P=Math.min(255,28*D+40*N),k=Math.max(140,P+112),L=(0,E.useCallback)(((e,t,r)=>{var n;let{item:a,level:o=0}=t;const i=(0,R.any)((0,R.propEq)("id",a.id))(m),l=I.current===r;return b().createElement(hd,{key:a.uri,onClick:x,checked:i,level:o,data:a,label:b().createElement(Ed.o,{text:a.label,highlight:p}),labelInText:a.label,style:e,isFocused:l,isRequired:!(null===(n=a.attrType)||void 0===n||!n.required),LogoIcon:a.LogoIcon})}),[p,x,m]),U=(0,E.useCallback)(((e,t)=>b().createElement(oy(),{component:"div",className:l.subHeader,style:e,key:`group-${t.item.id}`},t.item.label)),[]);return b().createElement("div",{className:T()(l.moreAttributes,{[l.dense]:o})},b().createElement(dE(),{color:"primary",onClick:()=>u(!c),ref:s,className:l.moreButton},b().createElement(bk(),{classes:{root:l.icon}}),b().createElement("div",{className:l.buttonLabel},t)),b().createElement(Mp,{open:c,className:T()(l.moreAttributesPopup,l.popupContainer),anchorEl:s.current,onClose:(0,R.pipe)((()=>{m.length>0&&i((0,R.pluck)("attrType",m))}),(()=>u(!1)),(()=>d("")),(()=>y([]))),onSearch:d,containerHeight:k,title:r,containerWidth:320,searchInputOnKeyDown:_},b().createElement(Gp,{getItemSize:C,renderItem:L,renderGroupTitle:U,disableHorizontalScrollbar:!0,items:g,height:P,focusIndex:A}),0===g.length&&b().createElement("div",{className:l.noResultsCaptionContainer},b().createElement(Ay(),{variant:"caption",display:"block",gutterBottom:!0},po().text("No results found")))))},Sk=b().createContext({canCreate:!0,canUpdate:!0,canDelete:!0});Sk.displayName="ConfigPermissionsContext";const wk=e=>{const{canCreate:t,canUpdate:r,canDelete:n}=(0,E.useContext)(Sk),a=(0,O.isTempUri)(e);return(0,E.useMemo)((()=>({canCreate:t,canUpdate:a||r,canDelete:a||n})),[a,t,r,n])},Ak={get CreationTime(){return po().text("Creation Time")},get CreationDate(){return po().text("Creation Date")},get Dimensions(){return po().text("Dimensions")},get MimeType(){return po().text("Mime Type")},get Size(){return po().text("Size")},get Url(){return po().text("Full image URL (S3)")},get UrlPreview(){return po().text("Preview image URL (S3)")},get UrlThumbnail(){return po().text("Small image URL (S3)")},get CdnUrl(){return po().text("Full image URL (CDN)")},get CdnUrlPreview(){return po().text("Preview image URL (CDN)")},get CdnUrlThumbnail(){return po().text("Small image URL (CDN)")}},Rk=function(){let{value:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail","MimeType"].includes(t)?(0,R.path)([t,0,"value"],e):"CreationDate"===t&&(0,R.path)(["CreationTimestamp",0,"value"],e)?za()(e.CreationTimestamp[0].value).format("MM-DD-YYYY"):"CreationTime"===t&&(0,R.path)(["CreationTimestamp",0,"value"],e)?za()(e.CreationTimestamp[0].value).format("HH:mm:ss"):"Dimensions"===t&&(0,R.path)(["Height",0,"value"],e)&&(0,R.path)(["Width",0,"value"],e)?`${e.Height[0].value} x ${e.Width[0].value} ${po().text("pixels")}`:"Size"===t&&(0,R.path)(["Size",0,"value"],e)?`${(Number(e.Size[0].value)/1e3).toFixed(2)} KB`:void 0},_k=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter((e=>{let{system:t}=e;return!t}))},Ik=(e,t)=>{const{includeNames:r=[],excludeNames:n=[],order:a=[]}=t,o=r.length?e.filter((e=>r.includes(e))):e.filter((e=>!n.includes(e)));return 0===a.length?o:o.sort(((e,t)=>{const r=a.indexOf(e),n=a.indexOf(t);return-1===r&&-1!==n?1:-1===n&&-1!==r?-1:r-n}))},Nk=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;const n=_k(t.attributes);return Ik(Object.keys(e.value||{}),r).reduce(((t,r)=>{const a=n.find((e=>{let{name:t}=e;return t===r}));return a?[...t,{attrType:a,values:e.value[r]}]:t}),[])},Dk=e=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail"].includes(e),Pk=(0,Op.Z)({title:{marginBottom:"10px",color:"white",fontSize:"18px",lineHeight:"21px","&$canAdd":{marginBottom:"3px"}},divider:{width:"100%",height:"1px",borderColor:"rgba(255,255,255,0.12)"},canAdd:{}}),kk=e=>{let{attributeType:t,onAddAttributes:r,uri:n}=e;const a=Pk(),o=_k(t.attributes),{canCreate:i}=(0,E.useContext)(Sk),l=i&&Boolean(r);return b().createElement($I(),null,b().createElement(Ay(),{className:T()(a.title,{[a.canAdd]:l})},po().text("Meta info")),l&&b().createElement(E.Fragment,null,b().createElement(Ck,{label:po().text("Attributes"),data:o,dense:!1,onApply:e=>{r&&r(e.map((e=>({attributeType:e,parentUri:n}))))}}),b().createElement(sh(),{className:a.divider})))},Lk=(0,Op.Z)((e=>({root:{fontSize:"13px",letterSpacing:0,lineHeight:"15px",marginBottom:"11px"},title:{color:"rgba(255,255,255,0.54)",marginRight:"12px",float:"left"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"},link:{color:e.palette.primary.main,textDecoration:"none"}}))),Uk=e=>{let{title:t,content:r,isLink:n,children:a}=e;const o=Lk();return b().createElement("div",{className:o.root},b().createElement("span",{className:o.title},t),n?b().createElement("a",{className:o.link,href:r},po().text("link")):b().createElement("span",{className:o.content},r||a))},jk=(0,Op.Z)({root:{padding:"10px 0"},title:{color:"rgba(255,255,255,0.54)",fontSize:"13px"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"}}),Fk=e=>{let{attributeValue:t,attributeType:r,imageAttributeFieldsOrder:n}=e;const a=jk(),o=(0,S.xH)(),i=(l=t,s=n,Ik(Object.keys(Ak),s).map((e=>Rk(l,e)?{title:Ak[e],value:Rk(l,e),isLink:Dk(e)}:null)).filter(Boolean));var l,s;const c=Nk(t,r,n);return b().createElement($I(),{className:a.root},i.map((e=>{let{title:t,value:r,isLink:n}=e;return b().createElement(Uk,{key:t,isLink:n,title:t,content:r})})),o&&c.map((e=>{let{attrType:r,values:n}=e;return b().createElement(MF,{key:r.uri,attributeType:r,drawLines:!1,values:n,titleClassName:a.title,contentClassName:a.content,parentUri:t.uri})})))},Mk=(0,Op.Z)((e=>({caption:{display:"flex",color:e.palette.error.main,fontSize:"12px",lineHeight:"16px"}}))),Vk=e=>{let{className:t,message:r}=e;const n=Mk();return r?b().createElement(Ay(),{variant:"caption",className:T()(n.caption,t)},r):null};var Bk=r(66826),zk=r.n(Bk),Hk=r(54508),Yk=r(70485),Wk=r.n(Yk),Gk=r(53167),qk=r.n(Gk);const Zk=(0,Op.Z)({wrapper:{width:"100%"},helperText:{margin:"3px 0 1px 12px"}});function $k(){return $k=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$k.apply(this,arguments)}const Kk=(0,E.memo)((e=>{let{errorMessage:t,children:r,className:n,classes:a}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["errorMessage","children","className","classes"]);const i=Zk(),l=!!t;return b().createElement(Wk(),$k({variant:"standard",className:T()(i.wrapper,n,null==a?void 0:a.root),error:!0},o),r,l&&b().createElement(qk(),{className:T()(i.helperText,null==a?void 0:a.helperText)},b().createElement(Vk,{message:t})))}));Kk.displayName="ErrorWrapper";const Xk=(e,t,r,n)=>{const a=(0,R.pipe)(O.getEntityType,(0,R.defaultTo)({}),(0,R.props)(["attributes","analyticsAttributes"]),(0,R.reject)(R.isNil),R.flatten,(0,R.concat)(R.__,(0,R.pipe)(R.values,(0,R.reject)((0,R.propEq)("uri",O.EntityAttrTypes.id.uri)))(O.EntityAttrTypes)))(e,t);return r.length?a.filter((e=>{let{uri:t}=e;return r.includes(t)})):a.filter((e=>{let{uri:t}=e;return!n.includes(t)}))},Qk=(e,t)=>(0,R.partition)((0,R.pipe)((0,R.path)(["attrType","uri"]),(0,R.includes)(R.__,e)),t),Jk=(0,R.eqBy)((0,R.pick)(["fieldName","uri","entityTypeUri"])),eL=(e,t)=>t&&!!t.find(Jk(e)),tL=(0,R.curry)(((e,t,r)=>{const n=((e,t)=>{const{type:r}=(0,O.getAttrDataTypeDefinition)(e);switch(r){case O.DataTypes.TYPE_BOOLEAN:case O.DataTypes.TYPE_BOOLEAN_RADIO:case O.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t.toString();case O.DataTypes.TYPE_DATE:return t&&za()(t).format("YYYY-MM-DD")||"";case O.DataTypes.TYPE_TIMESTAMP:return t&&za()(t).utc().format()||"";case O.DataTypes.TYPE_ACTIVENESS_DATE:case O.DataTypes.TYPE_LOCAL_DATE:return t&&t.valueOf();default:return t||""}})(t,r);return{value:n,uri:e.uri,attributeType:t}})),rL=b().createContext({enabled:!1,queueSizeThreshold:0});rL.Provider.propTypes={value:hp().shape({enabled:hp().bool,queueSizeThreshold:hp().number})},rL.displayName="AsyncMountContext";let nL=0;const aL=()=>{const e=(0,E.useRef)(!0),{enabled:t,queueSizeThreshold:r=0}=(0,E.useContext)(rL),[n,a]=(0,E.useState)(!t||t&&nL<r);e.current&&nL++;const o=(0,E.useRef)();return(0,E.useEffect)((()=>{if(nL--,!n)return o.current=setTimeout((()=>{a(!0)}),0),()=>clearTimeout(o.current)}),[]),e.current=!1,n};function oL(){return oL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oL.apply(this,arguments)}var iL=r(50548);const lL=b().createContext(!1);lL.displayName="ProfilePerspectiveViewContext";let sL=function(e){return e.Error="Error",e.NewAttribute="NewAttribute",e.NewView="NewView",e}({});const cL=e=>e===sL.Error,uL=b().createContext({element:null,type:null,highlightView:bp.ZT,highlightError:bp.ZT,highlightAttribute:bp.ZT,scrollIntoRef:bp.ZT});function pL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){dL(e,t,r[t])}))}return e}function dL(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mL={content:'""',position:"absolute",left:"-1000px",top:"0px",width:"5000px",height:"calc(100% - 10px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},yL=(0,Op.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlightError:{"&::before":pL({},mL,{background:"rgba(255, 0, 0, 0.06)"})},highlightWarning:{"&::before":pL({},mL,{background:"rgba(228, 151, 0, 0.08)"})},simpleAttribute:{position:"relative","&::before":{top:"-4px",height:"calc(100% + 8px)"}}}))),gL=e=>{let{highlightedError:t,isSimple:r=!1}=e;const n=yL(),a=(0,E.useRef)(null),o=(0,R.pathOr)(O.ErrorSeverity.ERROR,["element","severity"])(t),i=T()({[n.highlightError]:o===O.ErrorSeverity.ERROR,[n.highlightWarning]:o===O.ErrorSeverity.WARNING,[n.simpleAttribute]:r});return(0,E.useEffect)((()=>{t&&t.scrollIntoRef(a)}),[t]),t?{ref:a,errorClassName:i}:{ref:a}};var fL=r(51894);const hL=(0,Op.Z)((e=>({wrapper:{width:"100%"},errorWrapper:{alignSelf:"stretch"},editor:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px",position:"relative"},"editor-value":{flex:"1 1 auto"},"editor-read-only-value":{marginLeft:"12px",display:"flex",alignItems:"center",color:e.palette.text.primary},"editor-actions":{display:"flex",alignItems:"center",paddingLeft:"8px"},addButton:{marginRight:"-8px"},button:{color:e.palette.text.secondary},placeholder:{height:"50px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary}})));function EL(){return EL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},EL.apply(this,arguments)}const bL=e=>{let{className:t,attributeValue:r,attributeType:n,isReltioCrosswalk:a,ownError:o,mode:i,onAddOneMore:l,onDeleteAttribute:s,onChangeAttribute:c,onDeactivateError:u,additionalControlsRenderer:p,state:d,highlightedError:m,isEmptyEditor:y=!1}=e,g=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValue","attributeType","isReltioCrosswalk","ownError","mode","onAddOneMore","onDeleteAttribute","onChangeAttribute","onDeactivateError","additionalControlsRenderer","state","highlightedError","isEmptyEditor"]);const f=hL(),h="deleted"===d,v="edited"===d,x=(0,O.isEditableMode)(i),{canCreate:C,canEdit:w,canDelete:A}=(e=>{let{attributeType:t,attributeValue:r,isReltioCrosswalk:n,mode:a}=e;const{canCreate:o,canUpdate:i,canDelete:l}=wk(r.uri);return{canCreate:o&&(0,O.checkCanCreateAttribute)({attributeType:t,mode:a}),canEdit:i&&(0,O.checkCanEditAttribute)({attributeType:t,attributeValue:r,mode:a,isReltioCrosswalk:n}),canDelete:l&&(0,O.checkCanDeleteAttribute)({attributeType:t,attributeValue:r,mode:a,isReltioCrosswalk:n})}})({attributeValue:r,attributeType:n,mode:i,isReltioCrosswalk:a}),_=w&&x,I=(0,O.getErrorMessage)(o),N=(0,S.ZI)(r,n),{ref:D,errorClassName:P}=gL({highlightedError:m,isSimple:!0});(0,E.useEffect)((()=>{y&&(0,O.isDependentLookupAttrType)(n)&&!(0,R.has)("lookupCode",r)&&c({attributeType:n,uri:r.uri,value:r.value,silent:!0})}),[y]);const k=(0,E.useMemo)((()=>(0,O.getAttrDataTypeDefinition)(n)),[n]),L=(0,E.useMemo)((()=>((e,t)=>{let{type:r}=t;const{value:n,lookupCode:a}=e||{};switch(r){case O.DataTypes.TYPE_BOOLEAN:case O.DataTypes.TYPE_BOOLEAN_RADIO:case O.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,O.parseBoolean)(n);case O.DataTypes.TYPE_DATE:return n&&O.utils.dates.toLocalDate(n)||null;case O.DataTypes.TYPE_LOCAL_DATE:case O.DataTypes.TYPE_TIMESTAMP:case O.DataTypes.TYPE_ACTIVENESS_DATE:return n&&new Date(n)||null;case O.DataTypes.TYPE_DEPENDENT_LOOKUP:case O.DataTypes.TYPE_LOOKUP:return{value:n,lookupCode:a};default:return n}})(r,k)),[r,k]),U=(0,E.useCallback)((()=>{o&&u((0,O.getErrorId)(o))}),[o,u]),j=(0,E.useCallback)((0,R.pipe)(tL(r,n),c,U),[r,n,c,U]),F=!!l&&C&&!n.singleValue,M=!h&&!!s&&A,V=!!I,B=h?{disabled:!0,isCrossedOut:!0}:{},z=(0,E.useContext)(lL),{autopopulationContextValue:H}=(e=>{let{enabled:t,attributeTypeUri:r,valueUri:n}=e;const a=(0,S.ax)("dependentLookupsEditorTouched"),o=(0,S.Pl)(),i=(0,S.h0)(n),l=t&&(0,O.isAutopopulationEnabled)(o,r),s=l?n:null,{isTouched:c=!1}=l&&i||{},u=(0,E.useCallback)((e=>{a({uri:e,isTouched:!0})}),[a]);return{autopopulationContextValue:(0,E.useMemo)((()=>s?{id:s,isTouched:c,onTouch:u}:null),[s,c,u])}})({enabled:z&&(0,O.isDependentLookupAttrType)(n),attributeTypeUri:null==n?void 0:n.uri,valueUri:r.uri});return b().createElement("div",{ref:D,className:T()(f.editor,t,P)},b().createElement(Kk,{errorMessage:I,className:f.errorWrapper},b().createElement("div",{className:T()(f["editor-value"],{[f.deleted]:h},{[f["editor-read-only-value"]]:!_}),"data-reltio-id":"reltio-attribute-value"},_?b().createElement(fL.m.Provider,{value:H},b().createElement(Hk.Z,EL({fieldName:(0,O.attributeUriToSearchUri)(n.uri),value:L,dataTypeDefinition:k,error:V,onChange:j,fullWidth:!0},N,g,B))):b().createElement($d.x,{value:(0,O.getAttributeValue)(r),dataTypeDefinition:k}))),b().createElement("div",{className:f["editor-actions"]},v&&b().createElement(Ay(),{variant:"caption",className:f.editedLabel},"(",po().text("edited"),")"),F&&b().createElement(Dp.T,{icon:bk(),onClick:l,size:"L",className:T()(f.addButton,f.button),"data-reltio-id":"reltio-add-one-more-simple-attribute-button"}),p&&p({attributeType:n,attributeValue:r}),M&&b().createElement(Dp.T,{className:f.button,icon:zk(),onClick:()=>{s({uri:r.uri,attributeType:n}),(0,O.getErrorType)(o)!==O.ErrorType.missed&&U()},size:"L","data-reltio-id":"reltio-delete-simple-attribute-button"})))};bL.propTypes={className:hp().string,attributeValue:O.SimpleAttributeValueType,attributeType:O.AttributeTypeType,ownError:O.AttributeErrorType,isReltioCrosswalk:hp().bool,state:hp().oneOf(["deleted","edited"]),mode:O.ModeType,onAddOneMore:hp().func,onDeleteAttribute:hp().func,onChangeAttribute:hp().func,onDeactivateError:hp().func,additionalControlsRenderer:hp().func,highlightedError:hp().object,isEmptyEditor:hp().bool};const vL=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=(0,E.forwardRef)(((r,n)=>aL()?b().createElement(e,oL({},r,{ref:n})):t&&b().createElement(t,oL({},r,{ref:n}))));return r.displayName="WithAsyncMount",r}((0,iL.l)(uL,((e,t)=>{let{attributeValue:r}=t;const{element:n,type:a}=e||{};return{highlightedError:cL(a)&&(null==n?void 0:n.uri)===r.uri?e:null}}),bL),(()=>{const e=hL();return b().createElement("div",{className:e.placeholder})})),TL=[O.EntityAttrTypes.roles.uri,O.EntityAttrTypes.tags.uri],OL=b().createContext(null),xL=b().createContext(null);function CL(){return CL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},CL.apply(this,arguments)}function SL(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wL=e=>{let{parentAttributeType:t,attrTypes:r,entity:n,parentUri:a,showEmptyEditors:o,mode:i,crosswalks:l,drawLines:s,children:c,className:u,alwaysVisibleTypeUris:p=TL,onAddAttributes:d,onChangeAttribute:m,onDeleteAttribute:y,additionalControlsRenderer:g,showNonOv:f,highlightAttribute:h}=e;const v=(0,S.jN)(),T=(0,E.useMemo)((()=>r.filter((e=>!v.includes(e.uri)))),[r,v]),{attributes:x={}}=n,[C,w]=(0,E.useState)({}),A=(0,E.useCallback)(((e,t)=>{w((r=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){SL(e,t,r[t])}))}return e}({},r,{[e]:t})))}),[]);(0,E.useEffect)((()=>{w({})}),[a]);const{canCreate:_}=(0,E.useContext)(Sk),I=(0,E.useMemo)((()=>_&&t&&(0,O.checkCanCreateAttribute)({attributeType:t,mode:i})),[t,i,_]),N=((e,t,r,n)=>e.filter((e=>{const a=((e,t)=>{const{attributes:r={},analyticsAttributes:n={}}=t;return(0,R.cond)([[O.isSpecialAttribute,(0,R.always)(t)],[(0,R.both)(O.isAnalyticAttribute,(0,R.always)(n)),(0,R.always)(n)],[R.T,(0,R.always)(r)]])(e)})(e,t),o=(e=>(0,O.isSpecialAttribute)(e)?"uri":"name")(e);return!((e.singleValue||(0,O.isRoleAttrType)(e)||(0,O.isTagAttrType)(e))&&((0,R.has)(e[o])(a)||r&&(null==n||!n[e.uri])))})))((0,E.useMemo)((()=>_?(0,O.getCreatableAttributeTypes)(i,T):[]),[T,i,_]),n,o,C),D=(0,E.useContext)(OL),P=(0,E.useMemo)((()=>(0,O.getAttributesListForEditMode)(T,i,n,o,f,D,_)),[T,i,n,o,f,D,_]),[k,L]=(0,E.useMemo)((()=>Qk(p,P)),[P,p]),U=(0,E.useCallback)((e=>{d(e.map((e=>({attributeType:e,parentUri:e===t?(0,O.getParentUri)(a):a})))),h((0,R.last)(e),sL.NewAttribute)}),[d,a,t]),j={enabled:s},F=(0,E.useMemo)((()=>({hasDeletionsMap:C,setHasDeletions:A})),[C,A]);return b().createElement("div",{className:u},c&&b().createElement(lN,j,c),b().createElement(lN,CL({},j,{plain:!0}),N.length>0&&b().createElement(Ck,{label:po().text("More attributes"),onApply:U,dense:s,data:N,parent:I&&t})),b().createElement(xL.Provider,{value:F},L.concat(k).map((e=>{let{attrType:t,values:r}=e;return b().createElement(Xj,{key:`${t.uri}_${a}`,attributeType:t,drawLines:s,values:r,paging:(0,R.path)(["paging",t.uri],x),parentUri:a,showEmptyEditors:o,mode:i,crosswalks:l,onAddAttributes:d,onChangeAttribute:m,onDeleteAttribute:y,additionalControlsRenderer:g,showNonOv:f})}))))};wL.propTypes={parentAttributeType:hp().object,attrTypes:hp().array,entity:hp().object,parentUri:hp().string,children:hp().node,showEmptyEditors:hp().bool,mode:O.ModeType,crosswalks:hp().array,drawLines:hp().bool,showNonOv:hp().bool,className:hp().string,alwaysVisibleTypeUris:hp().array,onAddAttributes:hp().func,onChangeAttribute:hp().func,onDeleteAttribute:hp().func,additionalControlsRenderer:hp().func,highlightAttribute:hp().func};const AL=(0,iL.l)(uL,(e=>{const{highlightAttribute:t}=e||{};return{highlightAttribute:t}}),wL),RL=(0,Op.Z)((e=>({complexWrapper:{position:"relative"},editor:{display:"flex",flex:1,height:"36px",alignItems:"center"},label:{flex:1,marginLeft:"2px",marginTop:"2px",fontSize:"13px",lineHeight:"15px"},actions:{display:"flex",alignItems:"center"},titleContainer:{display:"flex",flex:1,minHeight:"20px"},expandButton:{marginTop:"2px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary},errorWrapperHelperText:{marginLeft:0}})));function _L(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const IL=e=>{let{label:t,attributeTypesList:r,attributeType:n,attributeValue:a,children:o,errors:i,ownError:l,mode:s,metadata:c,crosswalks:u,lazy:p,showEmptyEditors:d,onAddOneMore:m,onAddAttributes:y,onDeleteAttribute:g,onChangeAttribute:f,additionalControlsRenderer:h,hideDeleteButton:v,state:x,showNonOv:C,isHighlightedPath:S,highlightedError:w,expanded:A=!1}=e;const R=RL(),_="deleted"===x,I="edited"===x,N=a.uri,D=(0,O.isTempUri)(N),P=D||A,[k,L]=(0,E.useState)(P),{ref:U,errorClassName:j}=gL({highlightedError:w});(0,E.useEffect)((()=>{S&&L(!0)}),[S]),(0,E.useEffect)((()=>{L(P)}),[P]);const{canDelete:F}=wk(a.uri),M=(0,E.useMemo)((()=>F&&(0,O.checkCanDeleteAttribute)({attributeType:n,attributeValue:a,mode:s,metadata:c,isReltioCrosswalk:(0,O.isReltioCrosswalk)(u,a)})),[n,a,s,c,u,F]),V=!_&&!v&&!!g&&M,B=(0,E.useMemo)((()=>(0,O.hasAttributeDescendantsWithErrors)(a,i)),[i,a]);(0,E.useEffect)((()=>{B&&L(!0)}),[i,B]),(0,E.useEffect)((()=>{_&&L(!1)}),[_]);const z=(r||[]).some((e=>(0,O.isAnalyticAttribute)(e))),H=(0,E.useMemo)((()=>({attributes:z?null:a.value,analyticsAttributes:z?a.value:null})),[a,z]),Y=(0,O.getErrorMessage)(l)||B&&po().text("Has an incorrect value")||"";return p?b().createElement(dE(),{variant:"text",color:"primary",onClick:m},"Create attribute"):b().createElement("div",{ref:U,className:T()(R.complexWrapper,j)},b().createElement("div",{className:R.editor},b().createElement("div",{className:R.titleContainer},b().createElement(QD,{onClick:()=>L((e=>!e)),expanded:k,className:R.expandButton,disabled:_}),b().createElement(Kk,{errorMessage:Y,classes:{helperText:R.errorWrapperHelperText}},b().createElement("div",{className:T()(R.label,{[R.deleted]:_}),"data-reltio-id":"reltio-attribute-complex-label"},t))),b().createElement("div",{className:R.actions},I&&b().createElement(Ay(),{variant:"caption",className:R.editedLabel},"(",po().text("edited"),")"),h&&h({attributeType:n,attributeValue:a}),V&&b().createElement(Dp.T,{icon:zk(),onClick:()=>g({uri:N,attributeType:n,attributeValue:a}),size:"L","data-reltio-id":"reltio-delete-complex-attribute-button"}))),k&&b().createElement(AL,{parentAttributeType:n,attrTypes:r,entity:H,showEmptyEditors:d||D,drawLines:!0,parentUri:N,mode:s,crosswalks:u,onAddAttributes:y,onChangeAttribute:f,onDeleteAttribute:g,additionalControlsRenderer:h,showNonOv:C},o))};IL.propTypes=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){_L(e,t,r[t])}))}return e}({label:hp().string,children:hp().node,attributeTypesList:hp().arrayOf(O.AttributeTypeType),attributeValue:hp().oneOfType([O.NestedAttributeValueType,O.ReferenceAttributeValueType]),highlightedError:hp().object,isHighlightedPath:hp().bool},O.ComplexAttributeType);const NL=(0,iL.l)(uL,((e,t)=>{let{attributeValue:r}=t;const{element:n,type:a}=e||{},o=cL(a);return{highlightedError:o&&(null==n?void 0:n.uri)===r.uri?e:null,isHighlightedPath:o&&(0,R.pipe)((0,R.propOr)([],"path"),(0,R.any)((0,R.pathEq)(["value","uri"],r.uri)))(n)}}),IL);function DL(){return DL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},DL.apply(this,arguments)}const PL=(0,E.memo)((e=>{const{attributeValue:t,attributeType:r}=e,n=(0,O.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return b().createElement(NL,DL({label:(0,O.getLabel)(n),attributeTypesList:r.attributes||r.analyticsAttributes},e))}));PL.propTypes=O.NestedAttributeType,PL.displayName="NestedAttributeEditor";var kL=r(62880);const LL=(0,Op.Z)((e=>({addLabel:{display:"flex",padding:"0 7px",height:"35px",alignItems:"center",fontSize:"13px",fontWeight:"500",color:e.palette.primary.main,cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",borderTop:"solid 1px rgba(0, 0, 0, 0.14)",backgroundColor:"rgba(0, 0, 0, 0.03)"},addIcon:{height:"18px",width:"18px",padding:"0 9px"}}))),UL=e=>{const{selectProps:{onCreate:t,createLabel:r,inputValue:n,components:a},children:o}=e,i=LL();return b().createElement(Tg.h,e,o,r&&!(0,R.prop)("Group",a)&&b().createElement("span",{className:i.addLabel,onClick:()=>t(n)},b().createElement(bk(),{className:i.addIcon}),r))};UL.propTypes={children:hp().element.isRequired,selectProps:hp().object.isRequired};const jL=(0,Op.Z)({singleValue:{fontSize:"14px",lineHeight:"16px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:"17px"}});function FL(){return FL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},FL.apply(this,arguments)}const ML=e=>{const{selectProps:{menuIsOpen:t},innerProps:r,children:n}=e,a=jL();return!t&&b().createElement(Ay(),FL({className:a.singleValue},r),n)};function VL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){BL(e,t,r[t])}))}return e}function BL(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}ML.propTypes={children:hp().node,innerProps:hp().object};const zL=(0,Op.Z)({control:{height:"auto"},dropdownIndicator:{boxSizing:"content-box",transition:"transform .15s ease",padding:e=>(e.height-24)/2+"px 12px",cursor:"pointer",color:"rgba(0, 0, 0, 0.54)"},valueContainer:{marginLeft:"16px",width:0},formControl:{margin:0},filledInputRoot:{backgroundColor:"rgba(0, 0, 0, 0.03)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}},filledInputUnderline:{"&:before":{display:"none"}},inputLabel:{color:"rgba(0,0,0,0.6)",fontSize:"14px",paddingLeft:"4px","&.shrink":{paddingLeft:"4px"}}}),HL={menu:e=>VL({},e,{borderRadius:"0 0 4px 4px",backgroundColor:"#FFFFFFFF",boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",margin:0}),menuList:e=>VL({},e,{maxHeight:"208px",padding:"8px 0"}),group:e=>VL({},e,{padding:"0 0 8px 0"}),input:e=>VL({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:"16px 0 0",padding:0}),option:e=>VL({},e,{fontSize:"13px",lineHeight:"15px",height:"32px"})},YL={menuList:e=>VL({},e,{padding:0})},WL={input:e=>VL({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:0,padding:0})};function GL(){return GL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},GL.apply(this,arguments)}function qL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ZL(e,t,r[t])}))}return e}function ZL(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $L=e=>{let{value:t,label:r,createLabel:n,getOptions:a,options:o,height:i=46,onChange:l=R.identity,onCreate:s,onClear:c=R.identity,components:u,textFieldInputRef:p,TextFieldProps:d,classes:m}=e,y=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","label","createLabel","getOptions","options","height","onChange","onCreate","onClear","components","textFieldInputRef","TextFieldProps","classes"]);const g=zL({height:i}),[f,h]=(0,E.useState)(!1),v=(0,E.useRef)(null),x=a?lg:og.Z,C=(0,R.prop)("ClearIndicator",u)?{}:{IndicatorSeparator:bp.Vd,ClearIndicator:bp.Vd},S=s?(e,t)=>{s(e,t),h(!1)}:void 0,w=(0,R.prop)("Group",u)?YL:{},A=(0,R.isEmpty)(r)?WL:{},_=qL({},HL,w,A),I=qL({},g,m);return b().createElement(x,GL({placeholder:"",defaultOptions:!0},y,{value:(0,R.defaultTo)(null,t),loadOptions:a,options:o,cacheOptions:!0,onChange:l,onCreate:S,onClear:c,createLabel:n,classes:I,styles:_,components:qL({DropdownIndicator:kL.G,LoadingIndicator:bp.Vd,SingleValue:ML,Menu:UL},C,u),menuPlacement:"auto",TextFieldProps:qL({},d,{label:r,variant:"filled",size:"small",classes:qL({},(0,R.prop)("classes",d),{root:T()(g.formControl,(0,R.path)(["classes","root"],d))}),inputProps:qL({},(0,R.prop)("inputProps",d)),InputProps:qL({},(0,R.prop)("InputProps",d),{classes:qL({},(0,R.path)(["InputProps","classes"],d),{root:T()(g.filledInputRoot,(0,R.path)(["InputProps","classes","root"],d)),underline:T()({[g.filledInputUnderline]:(0,O.isEmptyValue)(t)},(0,R.path)(["InputProps","classes","underline"],d)),focused:T()("focused",(0,R.path)(["InputProps","classes","focused"],d))})}),InputLabelProps:qL({},(0,R.prop)("InputLabelProps",d),{classes:qL({},(0,R.path)(["InputLabelProps","classes"],d),{root:T()(g.inputLabel,(0,R.path)(["InputLabelProps","classes","root"],d)),shrink:T()("shrink",(0,R.path)(["InputLabelProps","classes","shrink"],d))}),shrink:!(0,O.isEmptyValue)(t)||void 0}),ref:p||v}),inputRef:p||v,menuIsOpen:f,onMenuOpen:()=>h(!0),onMenuClose:()=>h(!1)}))},KL={value:hp().oneOfType([hp().object,hp().array]),label:hp().string.isRequired,getOptions:hp().func,options:hp().array,onChange:hp().func,onCreate:hp().func,onClear:hp().func,createLabel:hp().string,components:hp().object,textFieldInputRef:hp().object,TextFieldProps:hp().object,height:hp().number,classes:hp().object};$L.propTypes=KL;var XL=r(98018);function QL(){return QL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},QL.apply(this,arguments)}const JL=e=>{const t=(0,S.$H)()||"";return b().createElement(XL.ZP,QL({},e,{storagePath:(r=t,r.endsWith("/")?r:r+"/")}));var r},eU=(0,Op.Z)({entityContainer:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0},entityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.87)",cursor:"pointer",lineHeight:"15px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},emptyEntityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.6)",lineHeight:"15px",marginLeft:"16px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",cursor:"default"},entityAvatar:{transform:"scale(0.5)",marginLeft:"8px",marginRight:"11px"},entitySecondaryLabel:{color:"rgba(0,0,0,0.6)"}});function tU(){return tU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tU.apply(this,arguments)}const rU=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:a}=e;const o=eU(),{uri:i,entityType:l,label:s,secondaryLabel:c}=a;return""!==i?b().createElement(Jp(),tU({className:o.entityContainer,ref:t,key:i,onClick:()=>n({label:s,uri:i,entityType:l})},r),b().createElement(JL,{className:o.entityAvatar,entityType:l}),b().createElement(dd.Y,{value:`${s}${c?", "+c:""}`},b().createElement("span",{className:o.entityLabel},s,c&&b().createElement("span",{className:o.entitySecondaryLabel},", ",c)))):b().createElement(Jp(),tU({className:o.entityContainer,ref:t,key:i},r,{disabled:!0}),b().createElement("span",{className:o.emptyEntityLabel},po().text("No results found")))};rU.propTypes={innerRef:hp().oneOfType([hp().oneOf([null]),hp().func,hp().shape({current:hp().any.isRequired})]),innerProps:hp().object.isRequired,selectOption:hp().func.isRequired,data:hp().shape({uri:hp().string.isRequired,label:hp().string.isRequired,entityType:O.EntityType.isRequired})};const nU=(0,Op.Z)((e=>({singleValue:{color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",paddingTop:"18px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},linkValue:{cursor:"pointer",color:e.palette.primary.main,textDecoration:"none",pointerEvents:"all"}}))),aU=e=>{let{selectProps:{currentEntityType:t,menuIsOpen:r,disableLinkClick:n},children:a,data:o}=e;const i=nU(),l=(0,S.ax)("openEntity"),s=(0,S.Qh)(),{generateEntityUrl:c}=(0,E.useContext)(Hd),u=(0,O.isTempUri)(o.entityUri)?{className:i.singleValue,component:"span"}:{className:T()(i.singleValue,i.linkValue),onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),n?e.preventDefault():(0,bp.rR)(e)||(l({uri:o.entityUri}),e.preventDefault())},href:c({uiPath:s,uri:o.entityUri}),component:"a"};return r?null:b().createElement(Ay(),u,(0,O.isTempUri)(o.entityUri)?po().text(`New ${t.label} will be created`):(0,O.getLabel)(a))},oU=(0,Op.Z)({clearIcon:{cursor:"pointer",height:"20px",width:"20px"}}),iU=e=>{const{selectProps:{onClear:t}}=e,r=oU();return b().createElement(uE(),{onClick:t,size:"large"},b().createElement(HI(),{className:r.clearIcon}))};iU.propTypes={selectProps:hp().object.isRequired};var lU=r(81997);const sU=(0,Op.Z)((e=>({addLabel:{color:e.palette.primary.main,display:"flex",fontWeight:"500",cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},groupHeading:{fontSize:"13px",height:"36px",padding:"0 16px",display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.03)"},addIcon:{height:"18px",width:"18px",padding:"0 9px"}}))),{Group:cU}=lU.F,uU=e=>{const{selectProps:{inputValue:t,onCreate:r},data:n,children:a}=e,o=sU();return b().createElement(cU,e,b().createElement("div",{className:o.groupHeading},b().createElement("span",null,n.label),r&&b().createElement("span",{onClick:()=>r(t,n.entityType),className:o.addLabel},b().createElement(bk(),{className:o.addIcon}),po().text(`Create ${t?`"${t}" as `:""}new ${n.label}`))),a)};uU.propTypes={selectProps:hp().object.isRequired,data:hp().object,children:hp().array};const pU=e=>e&&e.attributes,dU=e=>{let{entityUri:t,entityType:r,mode:n,attributeTypesSelectionStrategy:a=pU}=e;const o=(0,S.ax)("addAttributes"),i=(0,S.ax)("removeAttribute"),l=(0,S.ax)("modifyAttribute"),s=(0,S.vc)(t),c=(0,E.useMemo)((()=>a(r)),[a,r]);return s?b().createElement(AL,{key:s.uri,attrTypes:c,entity:s,showEmptyEditors:!0,drawLines:!0,parentUri:s.uri,mode:n,crosswalks:s.crosswalks,onAddAttributes:o,onChangeAttribute:l,onDeleteAttribute:i}):null};function mU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yU=(0,Op.Z)({creatorWrapper:{marginTop:"20px"}});function gU(){return gU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gU.apply(this,arguments)}function fU(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){hU(e,t,r[t])}))}return e}function hU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EU(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const bU=e=>{let{entity:t={},entityTypesUris:r=[],mode:n,max:a,onChange:o,onCreate:i,metadata:l,globalSearchRequestOptions:s,attributeTypesSelectionStrategy:c,disableLinkClick:u=!1}=e,p=EU(e,["entity","entityTypesUris","mode","max","onChange","onCreate","metadata","globalSearchRequestOptions","attributeTypesSelectionStrategy","disableLinkClick"]);const d=yU(),[m,y]=(0,E.useState)(""),g=(0,E.useMemo)((()=>r.map((e=>(0,O.getEntityType)(l,e))).filter(O.isAvailableEntityType)),[r,l]),f=fU({},s,{max:a}),h=i?(e,t)=>{i(t||r[0],e),y("")}:void 0,v=e=>{null!==e&&(y(""),o(e))},T=(0,E.useMemo)((()=>1!==g.length),[g]),x=((0,R.isEmpty)(t)?g[0]:(0,O.getEntityType)(l,t.entityType))||{},C=i&&po().text(`Create ${m?`"${m}" as `:""}new ${x.label}`),S=po().text(`Select ${1===g.length?`${g[0].label} `:""}profile`),w=!(0,R.isEmpty)(t)&&(0,O.isTempUri)(t.entityUri),A=T?{Group:uU,GroupHeading:bp.Vd}:{},_=w?{ClearIndicator:iU}:{},{TextFieldProps:I}=p,N=EU(p,["TextFieldProps"]),D=(0,E.useMemo)((()=>fU({},I||{},{"data-reltio-id":"reltio-entity-selector"})),[I]);return b().createElement(b().Fragment,null,b().createElement($L,gU({value:(0,R.isEmpty)(t)?void 0:t,inputValue:m,onInputChange:e=>{y(e)},getOptions:e=>(0,O.typeAheadSearch)(g,e,f).then(((e,t)=>r=>{const n=r.map((t=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){mU(e,t,r[t])}))}return e}({},t,{label:(0,O.getLabel)(t.label),entityType:e.find((e=>{let{uri:r}=e;return r===t.type}))}))),a=e=>(0,R.isEmpty)(e)?[{label:"",uri:"",entityType:{}}]:e,o=t?e:e.filter((e=>n.some((t=>t.type===e.uri))));return o.length>1?o.map((e=>({label:e.label,entityType:e.uri,options:a(n.filter((t=>t.type===e.uri)))}))):a(n)})(g,i)),getOptionLabel:(0,R.prop)("entityLabel"),onChange:v,onCreate:h,onClear:()=>{v({})},label:S,createLabel:C,components:fU({Option:rU,SingleValue:aU},A,_),currentEntityType:x,isClearable:!0,disableLinkClick:u,TextFieldProps:D},N)),w&&b().createElement("div",{className:d.creatorWrapper},b().createElement(dU,{mode:n,attributeTypesSelectionStrategy:c,entityType:x,entityUri:t.entityUri})))};bU.propTypes={entity:O.ConnectionEntityType,entityTypesUris:hp().arrayOf(hp().string),max:hp().number,mode:O.ModeType,dispatch:hp().func,metadata:O.MetadataType,onChange:hp().func.isRequired,onCreate:hp().func,attributeTypesSelectionStrategy:hp().func,globalSearchRequestOptions:hp().object,disableLinkClick:hp().bool};const vU=(0,Op.Z)({item:{marginBottom:"20px"},dense:{marginBottom:0}});function TU(){return TU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},TU.apply(this,arguments)}function OU(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xU(e,t,r[t])}))}return e}function xU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const CU=e=>{const t=vU(),{highlightedError:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["highlightedError"]),{attributeValue:a,attributeType:o,mode:i,crosswalks:l,errors:s,onChangeAttribute:c}=n,u=(0,E.useRef)(a),{ref:p,errorClassName:d}=gL({highlightedError:r,isSimple:!0}),m=(0,O.getReferencedEntityUriFromAttrValue)(a),y=(0,S.ax)("entityDeleted"),g=(0,S.ax)("entityCreated"),f=(0,S.ax)("errorDeactivated"),h=(0,S.vc)(m),v=(0,O.isTempUri)(m)?h:null,x=(0,S.AH)(),C=(0,S.mU)(["ovOnly"]),w=(0,O.getReferencedEntityFromAttrValue)(a),A=(0,O.getReferencedRelationFromAttrValue)(a),_=(0,O.getReferencedEntityTypeUriFromAttrType)(o),I=(0,O.getEntityType)(x,_),N=v?(0,O.evaluateDeepEntityLabel)(v,I.dataLabelPattern):a.label,D=(0,E.useMemo)((()=>[_]),[_]),P=(0,E.useMemo)((()=>(0,O.addReferencedRelationCrosswalks)(l,A)),[l,A]),k=(0,E.useMemo)((()=>(0,O.getReferencedEntityActiveError)(a,s)),[a,s]),L=(0,E.useMemo)((()=>w&&{entityUri:(0,O.getReferencedEntityUri)(w),entityType:(0,O.getReferencedEntityTypeUri)(w),entityLabel:a.label}),[w,a.label]),U=(0,E.useMemo)((()=>(0,O.getReferencedRelationAttrTypesUris)(o).map((e=>(0,O.findAttributeTypeByUri)(x,e))).filter(R.identity)),[o,x]),j=(0,E.useCallback)((e=>(0,O.referencedEntityAttributeTypesSelectionStrategy)(o,e)),[o]),F=(0,E.useCallback)((e=>{v&&y(v.uri);const t=u.current,r=!(0,R.isEmpty)(e)&&e.uri===(0,O.getReferencedEntityUriFromAttrValue)(t),n=OU({},a,{label:e.label,refEntity:r?t.refEntity:(0,O.convertReferencedEntityForAttrValue)(e),refRelation:r?t.refRelation:(0,O.createReferencedRelationForAttrValue)(a)});c({value:n,attributeType:o,uri:a.uri}),k&&f((0,O.getErrorId)(k))}),[a,o,v,c,y,f,k]),M=(0,E.useCallback)(((e,t)=>{const r=(0,R.pipe)(j,(0,O.getCreatableAttributeTypes)(i))(I),n=(0,O.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:r,metadata:x,mode:i});F(n),g(n)}),[j,i,I,x,F,g]),{canCreate:V,canUpdate:B}=wk(a.uri),z=(0,E.useMemo)((()=>B&&(0,O.checkCanEditAttribute)({attributeType:o,attributeValue:a,mode:i,isReltioCrosswalk:(0,O.isReltioCrosswalk)(l,a)})),[o,a,i,l,B]),H=(0,E.useMemo)((()=>V&&(0,O.checkMetadataForCreate)(i,I)),[i,I,V]),Y=(0,O.getErrorMessage)(k);return b().createElement(NL,TU({},n,{label:(0,O.getLabel)(N),attributeTypesList:U,crosswalks:P,metadata:x}),b().createElement("div",{ref:p,className:d},b().createElement(Kk,{errorMessage:Y},b().createElement(bU,{className:T()(t.item,{[t.dense]:Y||L&&(0,O.isTempUri)(L.entityUri)}),entity:L||{},entityTypesUris:D,max:20,globalSearchRequestOptions:C,mode:i,isDisabled:!z,onChange:F,onCreate:H?M:void 0,metadata:x,attributeTypesSelectionStrategy:j}))))};CU.propTypes=OU({},O.ReferenceAttributeType,{highlightedError:hp().object});const SU=(0,iL.l)(uL,((e,t)=>{let{attributeValue:r,attributeType:n}=t;const{element:a,type:o}=e||{};return{highlightedError:cL(o)&&(0,O.isAttributeTypeError)(a,r.uri,n.uri)?e:null}}),CU);function wU(){return wU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wU.apply(this,arguments)}const AU=(0,E.forwardRef)(((e,t)=>{const{className:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);return b().createElement("div",{ref:t,"data-reltio-id":"reltio-edit-attribute",className:r},class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case O.DataTypes.TYPE_NESTED:return b().createElement(PL,t);case O.DataTypes.TYPE_REFERENCE:return b().createElement(SU,t);default:{const e=(0,R.omit)(["showEmptyEditors","onAddAttributes","lazy","errors","crosswalks","showNonOv","expanded"],t);return b().createElement(vL,wU({isReltioCrosswalk:(0,O.isReltioCrosswalk)(t.crosswalks,t.attributeValue)},e))}}}}.build(e.attributeType,n))}));AU.displayName="EditModeAttribute";const RU=e=>po().text("${value}",{value:1===e?po().text("value"):po().text("values")}),_U=(0,R.has)("minValue"),IU=(0,R.has)("maxValue"),NU=(0,R.pipe)(IU,R.not),DU=(0,R.propSatisfies)((e=>1===e),"minValue"),PU=e=>{let{minValue:t}=e;return po().text("This attribute can have minimum ${minValue} ${minValueCaption}",{minValue:po().number(t,"0"),minValueCaption:RU(t)})},kU=e=>{let{maxValue:t}=e;return po().text("This attribute can have maximum ${maxValue} ${maxValueCaption}",{maxValue:po().number(t,"0"),maxValueCaption:RU(t)})},LU=(0,R.cond)([[R.isNil,(0,R.always)("")],[e=>{let{minValue:t,maxValue:r}=e;return t&&t===r},e=>{let{minValue:t}=e;return po().text("This attribute should have ${minValue} ${minValueCaption}",{minValue:po().number(t,"0"),minValueCaption:RU(t)})}],[(0,R.allPass)([DU,IU]),kU],[(0,R.allPass)([DU,NU]),(0,R.always)("")],[(0,R.allPass)([_U,IU]),e=>{let{minValue:t,maxValue:r}=e;return po().text("${minCardinality} and maximum ${maxValue} ${maxValueCaption}",{minCardinality:PU({minValue:t}),maxValue:po().number(r,"0"),maxValueCaption:RU(r)})}],[IU,kU],[_U,PU],[R.T,(0,R.always)("")]]),UU=(0,Op.Z)((()=>({caption:{fontSize:"0.7rem",opacity:.54}}))),jU=e=>{let{cardinality:t}=e;const r=UU(),n=LU(t);return n?b().createElement(Ay(),{variant:"caption",className:r.caption},n):null};function FU(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){MU(e,t,r[t])}))}return e}function MU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const VU={content:'""',position:"absolute",left:"-1000px",top:"-4px",width:"5000px",height:"calc(100% + 8px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},BU=(0,Op.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlighted:{"&::before":FU({},VU,{background:"rgba(228, 151, 0, 0.08)"}),position:"relative"}}))),zU=e=>{const t=BU(),r=(0,E.useRef)(null);return(0,E.useEffect)((()=>{e&&e.scrollIntoRef(r)}),[e]),e?{ref:r,highlightedClassName:t.highlighted}:{ref:r}},HU=(0,R.filter)((0,R.propSatisfies)(O.isTempUri,"uri")),YU=(0,Op.Z)((e=>({caption:{fontSize:"0.7rem",opacity:.54},wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",position:"relative"},attributesWrapper:{width:"100%",marginBottom:"10px"},imagesWrapper:{paddingBottom:"10px",width:"100%"},link:{display:"flex",marginTop:4},"svg-icon__root":{fontSize:"1rem"},title:{fontSize:"12px",lineHeight:"14px",paddingLeft:"12px",verticalAlign:"middle",wordBreak:"break-all",color:e.palette.text.secondary},typeError:{marginLeft:"12px"},ovIcon:{marginLeft:"8px",textIndent:0},titleWrapper:{display:"inline-block",paddingBottom:"3px"},errorWrapper:{paddingBottom:"10px"}}))),WU=e=>{let{max:t,values:r,attributeType:n,parentUri:a,mode:o,drawLines:i,showEmptyEditors:l,errorMessage:s,errors:c,paging:u,crosswalks:p,showNonOv:d,nonVisibleValues:m,highlightedError:y,highlightedAttribute:g,onAddAttributes:f,onDeleteAttribute:h,onChangeAttribute:v,onDeactivateError:x,additionalControlsRenderer:C,requestNextPageOfAttributeValues:S}=e;const w=YU(),[A,_]=(0,E.useState)(t),[I,N]=(0,E.useState)(!1),{label:D,required:P,cardinality:k,name:L,uri:U,description:j}=n,F=(0,O.isEditableMode)(o),{ref:M,errorClassName:V}=gL({highlightedError:y}),{ref:B,highlightedClassName:z}=zU(g),H=(0,E.useContext)(OL),Y=(0,E.useMemo)((()=>null==H?void 0:H.includes(U)),[U,H]),W=(0,O.isEmptyValue)(r),G=(!I&&l||P||Y)&&W,q=(0,E.useRef)((0,O.createNewAttribute)({parentUri:a,attributeType:(0,R.omit)(["defaultValue"],n)})),Z=(0,E.useCallback)((()=>{_(A+1);const e=e=>({parentUri:a,index:A,attributeType:e});if(G&&!(0,O.isComplexAttribute)(n.type)){const t=[e((0,R.omit)(["defaultValue"],n)),e(n)];return f(t)}return f([e(n)])}),[A,f,a,n,G]),$=(0,E.useCallback)((0,R.pipe)(h,R.T,N),[h,N]);if(W&&!G)return null;if(G&&W&&(r=[q.current]),(0,O.isEmptyValue)(r))return null;const K=(HU(r)||[]).length,X=d?"totalValues":"totalOvValues",Q=(0,R.ifElse)((0,R.has)(X),(0,R.pipe)((0,R.prop)(X),(0,R.add)(K)),(0,R.always)(r.length))(u),J=null!=u&&u.totalValues?u.totalValues-Q:null==m?void 0:m.length,ee=t<Q,te=ee&&A<Q,re=ee&&A>=Q,ne=r.slice(0,A),ae=ne?ne.length-1:0,oe=Q-A;return b().createElement(lN,{enabled:i},b().createElement("div",{ref:M,className:T()(w.wrapper,V)},b().createElement("div",{className:w.titleWrapper},b().createElement(ED,{label:D,isRequired:P,className:w.title,"data-reltio-id":"reltio-attribute-label"}),b().createElement(AD,{description:j}),b().createElement(OD,{nonOvValues:m,attributeType:n,className:w.ovIcon,nonOvTotal:J})),F&&b().createElement(jU,{cardinality:k}),F&&b().createElement(Vk,{message:s,className:w.typeError}),b().createElement("div",{className:w.attributesWrapper},ne.map(((e,t)=>b().createElement(AU,{key:e.uri,attributeValue:e,attributeType:n,lazy:G&&!P,showEmptyEditors:l,errors:c,ownError:(0,O.getAttributeOwnError)(e,t,n.uri,c),mode:o,crosswalks:p,onAddOneMore:ae===t?Z:null,onAddAttributes:f,onDeleteAttribute:$,onChangeAttribute:v,onDeactivateError:x,additionalControlsRenderer:C,className:0===t?z:null,ref:0===t?B:null,isEmptyEditor:G}))),te&&b().createElement(DP,{moreNumber:(0,R.min)(t,oe),valueNumber:oe,onClick:()=>{r.length<Q&&S({parentUri:a,attributeTypeUri:U,attributeTypeName:L,values:r,defaultMaxValues:t}),_(A+t)}}),re&&b().createElement(UP,{onClick:()=>{_(t)}}))))};WU.displayName="AttributeRenderer";const GU=(0,E.memo)(WU),qU=(0,Op.Z)({value:{color:"rgba(0, 0, 0, 0.87)"},placeholder:{color:"rgba(0, 0, 0, 0.38)",fontSize:"14px !important"}}),ZU=e=>{let{selectProps:{menuIsOpen:t},data:{label:r}}=e;const n=qU();return!t&&b().createElement(Ay(),{variant:"body2",classes:{root:n.value}},r)};ZU.propTypes={selectProps:hp().shape({menuIsOpen:hp().bool}),data:hp().shape({label:hp().string})};const $U=ZU;function KU(){return KU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},KU.apply(this,arguments)}const XU=e=>{const t=qU(),{innerProps:r={},children:n}=e;return b().createElement(Ay(),KU({className:t.placeholder},r),n)};function QU(){return QU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},QU.apply(this,arguments)}XU.propTypes={children:hp().node,innerProps:hp().object,selectProps:hp().object.isRequired};const JU={SingleValue:$U,Placeholder:XU},ej=(0,E.memo)((e=>{let t=QU({},e);return b().createElement($L,QU({components:JU},t))})),tj=(0,Op.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},roleContainer:{width:"100%"},valueContainer:{marginLeft:"8px",width:0},deleteButton:{marginLeft:"8px"}}),rj={MultiValue:xg._},nj=e=>{let{values:t,onChange:r,onDelete:n}=e;const a=tj(),o=(0,S.AH)(),i=(0,S.eh)(),l=i.uri,s=(0,O.getRolesForEntityType)(o,i.type).map((e=>({value:e.uri,label:e.label}))),c=(t||[]).map((e=>{var t;return{value:e,label:(null===(t=s.find((0,R.propEq)("value",e)))||void 0===t?void 0:t.label)||(0,O.getLastUriPart)(e)}})),u=(0,E.useCallback)((e=>{const t=(null==e?void 0:e.map((0,R.prop)("value")))||[];r({value:t,attributeType:O.EntityAttrTypes.roles,uri:l})}),[l,r]),p=(0,E.useCallback)((()=>{n({uri:l,attributeType:O.EntityAttrTypes.roles})}),[l,n]);return b().createElement("div",{className:a.container,"data-reltio-id":"reltio-attribute-value"},b().createElement(ej,{label:"",height:40,isMulti:!0,options:s,value:c,onChange:u,components:rj,classes:a,className:a.roleContainer}),!!n&&b().createElement(Dp.T,{"data-reltio-id":"reltio-roles-delete-button",className:a.deleteButton,icon:zk(),onClick:p,size:"L"}))};var aj=r(56333);const oj=(0,Op.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},deleteButton:{marginLeft:"8px"}});function ij(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){lj(e,t,r[t])}))}return e}function lj(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sj=e=>{let{className:t,values:r,onChange:n,onDelete:a}=e;const o=oj(),i=(0,S.lG)(),l=(0,S.mU)(),s=(0,E.useCallback)((async(e,t,r)=>{const n=await(0,O.getFacetedAttributeData)({fieldName:"tags",searchValue:e,options:ij({},l,{max:t,pageNo:r})});return Object.keys(n.tags)}),[l]),c=(0,E.useCallback)((e=>{n({value:e,attributeType:O.EntityAttrTypes.tags,uri:i})}),[n,i]),u=(0,E.useCallback)((()=>{a({uri:i,attributeType:O.EntityAttrTypes.tags})}),[i,a]);return b().createElement("div",{className:o.container,"data-reltio-id":"reltio-attribute-value"},b().createElement(aj.p,{fullWidth:!0,multiple:!0,variant:"filled",className:t,value:r||[],onChange:c,getSuggestions:s}),!!a&&b().createElement(Dp.T,{"data-reltio-id":"reltio-tags-delete-button",className:o.deleteButton,icon:zk(),onClick:u,size:"L"}))};function cj(){return cj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cj.apply(this,arguments)}function uj(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pj=(0,iL.l)(xL,((e,t)=>{let{attributeType:r}=t;const{hasDeletionsMap:n,setHasDeletions:a}=e||{};return{hasDeletions:n?Boolean(n[null==r?void 0:r.uri]):void 0,setHasDeletions:a}}),(e=>{let{values:t,attributeType:r,parentUri:n,mode:a,errorMessage:o,onDeleteAttribute:i,onChangeAttribute:l,showEmptyEditors:s,hasDeletions:c,setHasDeletions:u,highlightedAttribute:p}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","attributeType","parentUri","mode","errorMessage","onDeleteAttribute","onChangeAttribute","showEmptyEditors","hasDeletions","setHasDeletions","highlightedAttribute"]);const m=YU(),{label:y,required:g,cardinality:f}=r,h=(0,O.isEditableMode)(a),[v,x]=(0,E.useState)(!1),C=(0,E.useCallback)((e=>{x(e),null==u||u(r.uri,e)}),[r.uri,u]),S=void 0!==c?c:v,w=(0,E.useCallback)((0,R.pipe)(i,R.T,C),[i,C]),A=(0,O.isEmptyValue)(t),_=!S&&s&&A,I=(0,E.useRef)((0,O.createNewAttribute)({parentUri:n,attributeType:r})),{ref:N,highlightedClassName:D}=zU(p);return(0,O.isActivenessAttrType)(r)&&A&&!_?null:b().createElement("div",{ref:N,className:T()(D,m.wrapper)},b().createElement(ED,{label:y,isRequired:g,className:T()(m.title,m.titleWrapper),"data-reltio-id":"reltio-attribute-label"}),h&&b().createElement(jU,{cardinality:f}),h&&b().createElement(Vk,{message:o}),b().createElement($I(),{className:m.attributesWrapper},(()=>{switch(r.uri){case O.EntityAttrTypes.tags.uri:return b().createElement(sj,{values:t,onDelete:w,onChange:l});case O.EntityAttrTypes.roles.uri:return b().createElement(nj,{values:t,onDelete:w,onChange:l});default:{const e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){uj(e,t,r[t])}))}return e}({},I.current,{value:t[0]||""});return b().createElement(AU,cj({attributeValue:e,attributeType:r,mode:a,onDeleteAttribute:w,onChangeAttribute:l},d))}}})()))}));var dj=r(57517),mj=r.n(dj);function yj(){return yj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yj.apply(this,arguments)}const gj=e=>b().createElement("svg",yj({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),b().createElement("defs",null,b().createElement("path",{d:"M19 16v3H5v-3H3v3c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-3h-2zm-6-3.33l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2v9.67z",id:"Download_svg__a"})),b().createElement("g",{transform:"translate(-3 -3)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},b().createElement("mask",{id:"Download_svg__b",fill:"#fff"},b().createElement("use",{xlinkHref:"#Download_svg__a"})),b().createElement("path",{fillOpacity:.54,fill:"#fff",mask:"url(#Download_svg__b)",d:"M0 0h24v24H0z"})));var fj=r(76550),hj=r.n(fj),Ej=r(29367),bj=r.n(Ej);const vj=(0,Op.Z)((()=>({root:{fontSize:"24px",color:"#fff"}}))),Tj=e=>{let{checked:t,className:r,onClick:n}=e;const a=vj(),o=t?bj():hj();return b().createElement(o,{className:T()(a.root,r),onClick:n})},Oj=(0,Op.Z)((()=>({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"0.2s linear all","&:not($selected):not($selectionMode):hover":{backgroundColor:"rgba(0,0,0,0.6)"},userSelect:"none"},selected:{backgroundColor:"rgba(0,114,206,0.6)"},selectionMode:{cursor:"pointer","&:not($selected)":{backgroundColor:"rgba(0,0,0,0.6)"}},button:{padding:0,width:"100px",height:"36px",color:"#fff",fontSize:"14px",fontWeight:500,lineHeight:"16px",border:"1px solid rgba(255,255,255,0.25)",backgroundColor:"rgba(98,2,238,0)"},checkedIcon:{position:"absolute",left:"4px",top:"4px",cursor:"pointer"},actions:{display:"flex",alignItems:"center",position:"absolute",top:"4px",right:"4px"},actionButton:{color:"#fff",fontSize:"24px"},dropDownMenuButton:{margin:"0 2px 0 8px"}}))),xj=(0,E.memo)((e=>{const{id:t,canBeSelected:r=!1,selected:n=!1,selectionMode:a=!1,onDeselect:o=bp.ZT,onSelect:i=bp.ZT,onShareLink:l,onSetAsDefault:s,onDelete:c,onDownload:u=bp.ZT,onClick:p}=e,d=Oj(),[m,y]=(0,E.useState)(!1),{canDelete:g}=wk(t),f=(0,E.useMemo)((()=>[{text:po().text("Share link"),onClick:l},{text:po().text("Set as default"),onClick:s},{text:po().text("Delete"),onClick:g&&c}].filter((0,R.prop)("onClick"))),[l,s,c,g]),h=e=>()=>(0,R.ifElse)((0,R.equals)(!0),o,i)(e),v=r&&(n||m||a),O=!a&&!n&&m,x=r&&n;return b().createElement("div",{className:T()(d.overlay,{[d.selected]:n,[d.selectionMode]:a}),onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),onClick:a?h(n):e=>{e.currentTarget===e.target&&p()},"data-reltio-id":"image-actions-overlay"},v&&b().createElement(Tj,{className:d.checkedIcon,checked:n,onClick:h(n)}),O&&b().createElement("div",{className:d.actions},b().createElement(Dp.T,{onClick:u,className:d.actionButton,icon:gj}),b().createElement(LN,{menuId:`image-overlay-actions-${t}`,buttonComponent:Dp.T,buttonProps:{icon:Fd(),className:T()(d.actionButton,d.dropDownMenuButton)},menuItems:f})),x&&b().createElement(dE(),{className:d.button,variant:"outlined",onClick:o},po().text("Deselect")))}));var Cj=r(70251),Sj=r.n(Cj),wj=r(1937),Aj=r.n(wj);const Rj=(0,Op.Z)((e=>({root:{width:"328px"},paper:{width:"100%",height:"40px",display:"flex",alignItems:"center",boxShadow:"none",backgroundColor:"rgba(0,0,0,0.03)"},inputRoot:{flex:1},input:{padding:"0 12px",fontSize:"14px","&:placeholder":{color:e.palette.text.secondary}},errorMessage:{marginTop:"8px",fontSize:"12px",color:e.palette.error.main}}))),_j=e=>0===e.trim().length,Ij=e=>{let{onSend:t}=e;const r=Rj(),[n,a]=(0,E.useState)(""),[o,i]=(0,E.useState)(null);return b().createElement($I(),{className:r.root},b().createElement(QI(),{className:r.paper},b().createElement(Aj(),{value:n,onChange:e=>{const t=e.target.value,r=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/).test(t);a(t),r||_j(t)?i(null):i(po().text("URL is not correct"))},classes:{root:r.inputRoot,input:r.input},placeholder:po().text("Paste an image URL here")}),b().createElement(dE(),{disabled:Boolean(o)||_j(n),variant:"outlined",color:"primary",onClick:()=>{t(n),a(""),i(null)}},po().text("Send"))),o&&b().createElement(Ay(),{className:r.errorMessage},o))};var Nj=r(65680),Dj=r(83997);const Pj=["image/png","image/jpeg","image/tiff","image/gif","image/bmp"],kj=e=>{let{className:t,onAppendFile:r}=e;return b().createElement(b().Fragment,null,b().createElement("input",{onInput:e=>{r&&r(e.currentTarget.files[0])},style:{display:"none"},accept:Pj.join(","),id:"upload-image-button","data-reltio-id":"upload-image-button",type:"file"}),b().createElement("label",{htmlFor:"upload-image-button"},b().createElement(dE(),{className:t,variant:"contained",color:"primary",component:"span"},po().text("Select image"))))};function Lj(){return Lj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lj.apply(this,arguments)}const Uj=e=>b().createElement("svg",Lj({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),b().createElement("defs",null,b().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__c"},b().createElement("stop",{stopColor:"#FFF",offset:"0%"}),b().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),b().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__d"},b().createElement("stop",{stopColor:"#FFF",offset:"0%"}),b().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),b().createElement("linearGradient",{x1:"67.572%",y1:"54.952%",x2:"15.212%",y2:"13.907%",id:"UploadIcon_svg__e"},b().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),b().createElement("stop",{stopColor:"#000",offset:"100%"})),b().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__f"},b().createElement("stop",{stopColor:"#B8EDFF",offset:"0%"}),b().createElement("stop",{stopColor:"#53ACDE",offset:"100%"})),b().createElement("circle",{id:"UploadIcon_svg__a",cx:128,cy:128,r:128})),b().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},b().createElement("mask",{id:"UploadIcon_svg__b",fill:"#fff"},b().createElement("use",{xlinkHref:"#UploadIcon_svg__a"})),b().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#UploadIcon_svg__a"}),b().createElement("g",{mask:"url(#UploadIcon_svg__b)"},b().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(-1 9)"},b().createElement("path",{d:"M0 107.268c0 35.579 28.703 64.409 64.173 64.409h139.021c29.578 0 53.497-24.035 53.497-53.635 0-28.356-21.935-51.562-49.705-53.515C199.577 27.705 167.2 0 128.346 0 97.425 0 70.59 17.582 57.171 43.274 25.027 46.767 0 74.117 0 107.268z",fill:"#FFF",opacity:.3}),b().createElement("ellipse",{fill:"url(#UploadIcon_svg__c)",opacity:.4,cx:64.553,cy:107.664,rx:61.43,ry:62.336}),b().createElement("path",{d:"M127.979 8.91c38.773 0 70.206 31.895 70.206 71.24 0 39.346-31.433 71.241-70.206 71.241-6.067 0-11.954-.78-17.57-2.249 9.688-11.019 15.574-25.551 15.574-41.478 0-33.7-26.352-61.153-59.286-62.299C78.714 23.611 101.654 8.91 127.98 8.91z",fill:"url(#UploadIcon_svg__d)",opacity:.4})),b().createElement("path",{fill:"url(#UploadIcon_svg__e)",opacity:.12,d:"M82.093 128.474l38.374 37.966-10.666 18.958 72.714 71.94 63.578-57.537v-6.11l-71.107-70.352H97.22z",transform:"translate(-1 9)"}),b().createElement("path",{fill:"url(#UploadIcon_svg__f)",d:"M151.004 128.29v57.591h-40.836V128.29H81l49.5-49.409L180 128.29z",transform:"translate(-1 9)"})))),jj=(0,Op.Z)((e=>({root:{padding:"36px 0 29px"},isActive:{backgroundColor:"rgba(0,114,206,0.12)"},icon:{width:"190px",height:"190px",marginBottom:"24px"},title:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"24px"},description:{marginBottom:"24px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),Fj=e=>{let{onAppendFile:t,className:r}=e;const n=jj(),[{canDrop:a,isOver:o},i]=(0,Nj.useDrop)({accept:[Dj.FILE],drop:e=>{e&&t(e.files[0])},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),l=a&&o;return b().createElement("div",{ref:i,className:T()(n.root,{[n.isActive]:l},r)},b().createElement(Uj,{className:n.icon}),b().createElement(Ay(),{className:n.title},po().text("Drag an image here")),b().createElement(Ay(),{className:n.description},po().text("Acceptable image types would include JPG, PNG, TIFF, GIF, BMP. Maximum image size: ${MAX_IMAGE_SIZE}Mb",{MAX_IMAGE_SIZE:20})),b().createElement(kj,{onAppendFile:t}))},Mj=(0,Op.Z)((e=>({root:{width:"100%",display:"flex",alignItems:"center",padding:"0 30px",boxSizing:"border-box"},border:{borderBottom:`1px solid ${e.palette.text.primary}`,flex:1,opacity:.12},text:{padding:"0 10px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),Vj=e=>{let{children:t,className:r}=e;const n=Mj();return b().createElement($I(),{className:T()(n.root,r)},b().createElement($I(),{className:n.border}),b().createElement(Ay(),{className:n.text},t),b().createElement($I(),{className:n.border}))},Bj=(0,Op.Z)({closeIcon:{color:"#fff"}}),zj=e=>{let{error:t,onClose:r}=e;const n=Bj();return b().createElement(sE(),{open:Boolean(t),onClose:r,message:t,action:b().createElement(Cd.k,{className:n.closeIcon,tooltipTitle:po().text("Close"),icon:_p(),onClick:r})})},Hj=(0,Op.Z)((e=>({root:{},dialogPaper:{position:"relative",maxWidth:"480px"},title:{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px",padding:"16px"},body:{display:"flex",flexDirection:"column",alignItems:"center",padding:"0 8px 49px",textAlign:"center"},targetBox:{marginBottom:"8px"},divider:{marginBottom:"28px"}}))),Yj=e=>{let{open:t,onClose:r,onUpload:n}=e;const a=Hj(),[o,i]=(0,E.useState)(!1),[l,s]=(0,E.useState)(null),c=(0,S.qD)(),u=(0,S.fN)(),p=(0,S.Uv)(),d=e=>{i(!0),(0,O.uploadImage)({image:e,imageServicePath:c,environment:u,tenant:p}).then((e=>{n(e),r()})).catch((e=>{s((0,O.getRequestErrorMessage)(e,po().text("Something went wrong")))})).finally((()=>i(!1)))};return b().createElement(Sj(),{open:t,onClose:r,classes:{paper:a.dialogPaper}},b().createElement(Ay(),{className:a.title},po().text("Add new image")),b().createElement($I(),{className:a.body},b().createElement(Fj,{className:a.targetBox,onAppendFile:e=>{if(!e)return s(po().text("No image selected."));const t=Number((e.size/1024/1024).toFixed(2)),r=Pj.includes(e.type);t>20?s(po().text("File size exceeds configured max file size.")):r?d(e):s(po().text("File format is not supported."))}}),b().createElement(Vj,{className:a.divider},po().text("or")),b().createElement(Ij,{onSend:e=>{d(e)}})),o&&b().createElement(YE.Z,null),b().createElement(zj,{error:l,onClose:()=>s(null)}))},Wj=(0,Op.Z)((()=>({root:{width:"100%"},image:e=>{let{imageMargin:t}=e;return{marginRight:t,cursor:"pointer","&:last-child":{marginRight:0}}},uploadContainer:e=>{let{imageMargin:t,imageWidth:r,imageHeight:n}=e;return{backgroundColor:"white",width:r,height:n,cursor:"pointer",border:"1px dashed #0072CE",boxSizing:"border-box",marginRight:t,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},uploadButton:{width:"50px",height:"50px"},uploadIcon:{fontSize:"36px"}}))),Gj={},qj=e=>{let{attributeType:t={},attributeValues:r=[],onDeleteAttribute:n,onChangeAttribute:a,requestNextPageOfAttributeValues:o,parentUri:i,paging:l,showNonOv:s,imageSize:c=lk}=e;const u=Wj(c),[p,d]=(0,E.useState)(!1),m=(0,S.ax)("setDefaultProfilePicForModifiedEntity"),y=(0,S.eh)()||Gj,g=(0,S.AU)(y.uri),{canCreate:f}=(0,E.useContext)(Sk),h=(0,E.useCallback)((()=>{d((e=>!e))}),[]),v=(0,E.useCallback)((e=>{const r=(0,O.generateUri)(i,t.name),n={};for(const a in e){const o=(t.attributes||[]).find((e=>{let{name:t}=e;return t===a}));o&&(n[a]=[{uri:(0,O.generateUri)(r,o.name),ov:!0,value:e[a],type:o.uri}])}a({attributeType:t,uri:r,value:n})}),[a,i,t]),T=(0,E.useCallback)((e=>{if(n(e),g===e.uri){var t;const n=(null===(t=r[0])||void 0===t?void 0:t.uri)===e.uri?r[1]:r[0];m({entityUri:y.uri,value:n||{}})}}),[n,y,g,r,m]),x=(e,r)=>{const{onOpenImageGalleryDialog:n,onDownload:a,onShareLink:o,onSetAsDefault:i}=e,l=(0,O.getImageAttributeOvUrl)(r),{uri:s}=r;return b().createElement(xj,{id:s,onShareLink:()=>o(l),onSetAsDefault:()=>i(r),onDelete:()=>T({uri:s,attributeType:t}),onDownload:()=>a([l]),onClick:()=>n(s)})};return b().createElement("div",{className:u.root,"data-reltio-id":"image-line-edit-mode"},b().createElement(NF,{attributeValues:r,attributeType:t,renderImage:e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=(0,O.getImageAttributeOvThumbnailUrl)(t),{uri:n}=t,{onOpenImageGalleryDialog:a}=e;return b().createElement("div",{className:u.image,key:n},b().createElement(ik,{src:r,overlay:x(e,t),onClick:()=>a(n),size:{imageWidth:c.imageWidth,imageHeight:c.imageHeight},"data-reltio-id":"reltio-attribute-value"}))},overlay:!0,countFixedItems:f?1:0,onUpload:h,onDeleteAttribute:T,imageSize:c,requestNextPageOfAttributeValues:o,paging:l,parentUri:i,showNonOv:s},f&&b().createElement("div",{className:u.uploadContainer,onClick:h},b().createElement(Dp.T,{className:u.uploadButton,iconClassName:u.uploadIcon,icon:mj(),"data-reltio-id":"reltio-upload-image-button"}))),b().createElement(Yj,{open:p,onUpload:v,onClose:h}))},Zj=e=>{let{attributeType:t,attributeValues:r,paging:n,parentUri:a,showNonOv:o,onDeleteAttribute:i,onChangeAttribute:l,requestNextPageOfAttributeValues:s,highlightedAttribute:c,error:u,highlightedError:p,onDeactivateError:d}=e;const m=YU(),{label:y,description:g,required:f}=t,{ref:h,highlightedClassName:v}=zU(c),{ref:x,errorClassName:C}=gL({highlightedError:p}),S=(0,E.useCallback)((()=>{u&&d&&d((0,O.getErrorId)(u))}),[u,d]);return b().createElement("div",{ref:h,className:T()(m.wrapper,v)},b().createElement("div",{ref:x,className:T()(m.imagesWrapper,C)},b().createElement("div",{className:m.titleWrapper},b().createElement(ED,{className:m.title,label:y,"data-reltio-id":"reltio-attribute-label",isRequired:f}),b().createElement(AD,{description:g})),b().createElement(Kk,{errorMessage:null==u?void 0:u.message,className:m.errorWrapper},b().createElement(qj,{attributeValues:r,attributeType:t,paging:n,onDeleteAttribute:i,parentUri:a,onChangeAttribute:(0,R.pipe)(l,S),requestNextPageOfAttributeValues:s,showNonOv:o}))))};let $j=function(e){return e.imageLine="imageLine",e.special="special",e.default="default",e}({});function Kj(){return Kj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kj.apply(this,arguments)}const Xj=(0,iL.l)(uL,((e,t)=>{let{attributeType:r,parentUri:n}=t;const{element:a,type:o}=e||{},i=(e=>e===sL.NewAttribute)(o)&&a.uri===r.uri;return{highlightedAttribute:i?e:null,highlightedError:cL(o)&&(0,O.isAttributeTypeError)(a,n,r.uri)?e:null}}),(e=>{var t;let{values:r,attributeType:n,mode:a=O.Mode.Viewing,crosswalks:o,drawLines:i,paging:l={},parentUri:s,max:c,showEmptyEditors:u,showNonOv:p,highlightedError:d,highlightedAttribute:m,onAddAttributes:y,onDeleteAttribute:g,onChangeAttribute:f,additionalControlsRenderer:h}=e;const E=(0,S.ax)("errorDeactivated"),v=(0,S.ax)("requestNextPageOfAttributeValues"),T=(0,S.Jz)(s,n),x=(0,S.Xj)(),C=(0,S.vd)(),w=(0,O.getAttributePagerActiveTypeErrorMessage)(s,n,x),A=null!==(t=null!=c?c:C)&&void 0!==t?t:1/0,_=(0,R.partition)(O.isOv),[I,N]=_(r),D=p?r:I,P=p?[]:N,k={errorMessage:w,errors:T,mode:a,parentUri:s,onAddAttributes:y,onDeleteAttribute:g,onChangeAttribute:f,onDeactivateError:E,additionalControlsRenderer:h,showEmptyEditors:u,highlightedError:d,highlightedAttribute:m};return(()=>{switch((0,R.cond)([[O.isSpecialAttribute,(0,R.always)($j.special)],[O.isImage,(0,R.always)($j.imageLine)],[R.T,(0,R.always)($j.default)]])(n)){case $j.special:return b().createElement(lN,{enabled:i},b().createElement(pj,Kj({values:D,attributeType:n},k)));case $j.imageLine:return b().createElement(lN,{enabled:i},b().createElement(Zj,{attributeValues:D,attributeType:n,paging:l,onDeleteAttribute:g,parentUri:s,onChangeAttribute:f,requestNextPageOfAttributeValues:v,showNonOv:p,highlightedAttribute:m,error:(0,O.getAttributeErrorByTypeUri)(n.uri,T),highlightedError:d,onDeactivateError:E}));default:return b().createElement(GU,Kj({values:D,attributeType:n,max:A,paging:l,crosswalks:o,drawLines:i,requestNextPageOfAttributeValues:v,showNonOv:p,nonVisibleValues:P},k))}})()})),Qj=(0,Op.Z)({root:{},form:{padding:"10px 0"},divider:{width:"100%",height:"1px",borderColor:"rgba(255,255,255,0.12)"},actions:{display:"flex",justifyContent:"flex-end",marginTop:"4px"},cancelButton:{color:"white",marginRight:"8px"}}),Jj=e=>{let{attributeType:t,imageAttributeFieldsOrder:r,attributeValue:n,hasChanges:a,onDeleteAttribute:o,onChangeAttribute:i,onAddAttributes:l,onCancel:s,onApply:c,mode:u}=e;const p=Qj(),d=Nk(n,t,r),m=0!==d.length||0===d.length&&a;return b().createElement($I(),{className:p.root},b().createElement($I(),{className:p.form},d.map((e=>{let{attrType:t,values:r}=e;return b().createElement(Xj,{key:t.uri,parentUri:n.uri,attributeType:t,values:r,showEmptyEditors:(0,O.isTempUri)(n.uri),mode:u,drawLines:!1,onDeleteAttribute:o,onChangeAttribute:i,onAddAttributes:l})}))),m&&b().createElement(b().Fragment,null,b().createElement(sh(),{className:p.divider}),b().createElement($I(),{className:p.actions},b().createElement(dE(),{disabled:!a,onClick:s,className:p.cancelButton},po().text("Cancel")),b().createElement(dE(),{disabled:!a,onClick:c,color:"primary"},po().text("Apply")))))},eF={palette:{mode:"dark",primary:O.theme.palette.primary,secondary:O.theme.palette.secondary}},tF=(0,km.createTheme)(eF),rF=e=>{let{imageAttributeFieldsOrder:t,attributeType:r,attributeValue:n}=e;const a=(0,S.YA)(),o=(0,S.o_)(),{addAttributes:i,changeAttribute:l,deleteAttribute:s,clearLocalChanges:c,applyLocalChanges:u,attributeValue:p,hasChanges:d}=(e=>{let{initialAttributeValue:t,attributeType:r}=e;const n=(0,S.ax)("modifyAttribute"),[a,o]=(0,E.useState)(t);(0,E.useEffect)((()=>{o(t)}),[t]);const i=!(0,R.equals)(a,t),l=(0,E.useCallback)((e=>{o((t=>e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,O.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a,nestingLevel:1})}),t)))}),[]),s=(0,E.useCallback)((e=>{let{value:t,attributeType:r,uri:n}=e;o((e=>(0,O.editAttribute)({entity:e,attributeType:r,uri:n,value:t,nestingLevel:1})))}),[]),c=(0,E.useCallback)((e=>{let{attributeType:t,uri:r}=e;o((e=>(0,O.removeAttribute)({entity:e,attributeType:t,uri:r,nestingLevel:1})))}),[]);return{addAttributes:l,changeAttribute:s,deleteAttribute:c,clearLocalChanges:(0,E.useCallback)((()=>{o(t)}),[t]),applyLocalChanges:(0,E.useCallback)((()=>{n({value:a,attributeType:r,uri:a.uri})}),[a,r,n]),attributeValue:a,hasChanges:i}})({attributeType:r,initialAttributeValue:n});return b().createElement(km.ThemeProvider,{theme:tF},b().createElement($I(),null,b().createElement(kk,{attributeType:r,uri:null==p?void 0:p.uri,onAddAttributes:o?i:void 0}),b().createElement(Fk,{attributeType:r,attributeValue:p,imageAttributeFieldsOrder:t}),o&&b().createElement(Jj,{mode:a,imageAttributeFieldsOrder:t,attributeType:r,attributeValue:p,hasChanges:d,onDeleteAttribute:s,onChangeAttribute:l,onAddAttributes:i,onCancel:c,onApply:u})))},nF=(0,Op.Z)((e=>({root:{position:"relative",backgroundColor:"#333",maxHeight:"calc(100vh - 64px)",overflow:"hidden"},header:{display:"flex",alignItems:"center",height:"56px",paddingLeft:"16px",boxShadow:`0 1px 0 0 ${e.palette.divider}`},headerTitle:{color:"rgba(255, 255, 255, 0.87)",fontSize:"16px",lineHeight:"19px"},bodyWrapper:{maxHeight:"calc(100% - 56px)",overflow:"auto"},body:{padding:"16px"},formControlLabel:{marginLeft:0,marginBottom:"27px"},checkboxLabel:{marginLeft:"8px",color:"rgba(255,255,255,0.87)",fontSize:"13px",lineHeight:"15px"},checkbox:{color:"white",padding:0}}))),aF=e=>{let{className:t,attributeValue:r,handleSetAsDefault:n,attributeType:a}=e;const o=nF(),[i,l]=(0,E.useState)(!1),s=(0,S.eh)()||{},c=(0,S.vc)(null==s?void 0:s.uri)||{},u=(0,S.xH)(),p=(0,S.uO)()||{},d=u?s:c,m=p[null==s?void 0:s.type]||(null==p?void 0:p.default)||{};(0,E.useEffect)((()=>{l((null==d?void 0:d.defaultProfilePic)===(null==r?void 0:r.uri))}),[null==r?void 0:r.uri,d]);const y=(0,E.useCallback)((()=>{n(r.uri)}),[null==r?void 0:r.uri]);return b().createElement($I(),{className:T()(o.root,t)},b().createElement($I(),{className:o.header},b().createElement(Ay(),{className:o.headerTitle},po().text("Details"))),b().createElement($I(),{className:o.bodyWrapper},b().createElement($I(),{className:o.body},b().createElement(Bh(),{classes:{root:o.formControlLabel,label:o.checkboxLabel},control:b().createElement(Xp(),{className:o.checkbox,checked:i,onChange:y}),label:po().text("Set as default")}),b().createElement(rF,{attributeType:a,imageAttributeFieldsOrder:m,attributeValue:r}))))},oF=(0,Op.Z)((()=>({root:{display:"flex",width:"100%",overflowY:"auto",height:"calc(100vh - 64px)"},main:{flex:"1 0 auto"},details:{width:"340px"}}))),iF=e=>{let{attributeValues:t=[],currentAttributeValueUri:r,setCurrentAttributeValueUri:n,handleSetAsDefault:a,attributeType:o}=e;const[i,l]=(0,E.useState)(0);(0,E.useEffect)((()=>{s(r?t.findIndex((e=>e.uri===r)):0)}),[r,t]);const s=(0,E.useCallback)((e=>{var r;l(e),n(null===(r=t[e])||void 0===r?void 0:r.uri)}),[t]),c=oF();return b().createElement($I(),{className:c.root},b().createElement(hk,{attributeValueIndex:i,setAttributeValueIndex:s,attributeValues:t,className:c.main}),b().createElement(aF,{handleSetAsDefault:a,attributeValue:t[i],className:c.details,attributeType:o}))};var lF=r(60480),sF=r.n(lF),cF=r(54886),uF=r.n(cF),pF=r(86038),dF=r.n(pF),mF=r(39178),yF=r.n(mF);function gF(){return gF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gF.apply(this,arguments)}const fF=e=>b().createElement("svg",gF({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),b().createElement("defs",null,b().createElement("path",{d:"M14 5a1 1 0 011 1v12a1 1 0 01-1 1H4a1 1 0 01-1-1V6a1 1 0 011-1h10zm6 12v2h-3v-2h3zm2-4v2h-5v-2h5zm0-4v2h-5V9h5zm0-4v2h-5V5h5z",id:"Details_svg__a"})),b().createElement("g",{stroke:"none",strokeWidth:1,fillRule:"evenodd"},b().createElement("mask",{id:"Details_svg__b",fill:"#fff"},b().createElement("use",{xlinkHref:"#Details_svg__a"})),b().createElement("path",{mask:"url(#Details_svg__b)",d:"M0 0h24v24H0z"}))),hF=(0,Op.Z)((()=>({paper:{backgroundColor:"rgba(0, 0, 0, .85)"},backdrop:{backgroundColor:"transparent"},toolbar:{paddingLeft:"20px",paddingRight:"20px"},appBar:{position:"relative",background:"linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%)"},closeButton:{marginRight:"28px"},closeIcon:{fontSize:"24px",color:"#fff"},headerLeft:{display:"flex",alignItems:"center",flex:2},headerCenter:{display:"flex",justifyContent:"center",flex:1},headerRight:{flex:2,display:"flex",justifyContent:"flex-end",alignItems:"center"},modeSwitcher:{backgroundColor:"#fff"},content:{padding:0}})));let EF=function(e){return e.GALLERY_MODE="gallery",e.DETAILS_MODE="details",e}({});const bF=e=>{let{open:t,mode:r,children:n,header:a,onClose:o,onChangeMode:i}=e;const l=hF(),s=(0,E.useMemo)((()=>[{id:EF.GALLERY_MODE,title:po().text("Gallery"),Icon:yF()},{id:EF.DETAILS_MODE,title:po().text("Details"),Icon:fF}]),[]);return b().createElement(Sj(),{classes:{paper:l.paper},open:t,BackdropProps:{className:l.backdrop},fullScreen:!0},b().createElement(uF(),{classes:{colorPrimary:l.appBar}},b().createElement(dF(),{className:l.toolbar},b().createElement($I(),{className:l.headerLeft},b().createElement(Cd.k,{tooltipTitle:po().text("Close"),onClick:o,className:l.closeButton,iconClassName:l.closeIcon,icon:_p()}),null==a?void 0:a.left),b().createElement($I(),{className:l.headerCenter},b().createElement(XE,{modes:s,modeId:r,onChange:i,className:l.modeSwitcher})),b().createElement($I(),{className:l.headerRight},null==a?void 0:a.right))),b().createElement(sF(),{className:l.content},n))},vF=(0,Op.Z)((()=>({root:{padding:"0 24px",overflowY:"auto",height:"calc(100vh - 64px)"},item:{padding:"2px"}}))),TF=e=>{let{items:t,selectedItems:r,onSelectImage:n,onDeselectImage:a,onShareLink:o,onSetAsDefault:i,onDownload:l,onClickImage:s,onDelete:c}=e;const u=vF(),p=e=>b().createElement(xj,{id:e,selected:r.includes(e),selectionMode:0!==r.length,onSelect:()=>n(e),onDeselect:()=>a(e),onShareLink:()=>o(e),onSetAsDefault:()=>i(e),onDownload:()=>l(e),onClick:()=>s(e),onDelete:c?()=>c(e):void 0,canBeSelected:!0});return b().createElement($I(),{className:u.root},b().createElement(mk(),{container:!0},t.map((e=>{let{id:t,src:r}=e;return b().createElement(mk(),{key:t,classes:{item:u.item},item:!0},b().createElement(ik,{size:rk.LARGE,onClick:()=>s(t),src:r,overlay:p(t)}))}))))},OF=(0,Op.Z)((e=>({selectButton:{fontSize:"14px",fontWeight:500,color:e.palette.primary.main,textTransform:"uppercase"}}))),xF=e=>{let{selectedItems:t,items:r,onSelectAll:n,onClearAll:a}=e;const o=OF(),i=t.length===r.length;return b().createElement(jy(),{component:"button",underline:"none",classes:{button:o.selectButton},onClick:i?a:n},i?po().text("Clear selection"):po().text("Select all images"))};var CF=r(70997),SF=r.n(CF);const wF=(0,Op.Z)((()=>({downloadButton:{color:"#fff",fontSize:"24px",marginLeft:"30px"},shareButton:{color:"#fff",fontSize:"24px",marginLeft:"21px"},deleteButton:{color:"#fff",fontSize:"24px",marginLeft:"24px"},divider:{height:"31px",width:"1px",marginLeft:"10px",backgroundColor:"rgba(255,255,255,0.38)"}}))),AF=e=>{let{onDownload:t,onShare:r,onUpload:n,onDelete:a}=e;const o=wF();return b().createElement(b().Fragment,null,n&&b().createElement(dE(),{variant:"contained",color:"primary",onClick:n,startIcon:b().createElement(mj(),null)},po().text("Upload")),t&&n&&b().createElement("div",{className:o.divider}),t&&b().createElement(Cd.k,{className:o.downloadButton,tooltipTitle:po().text("Download selected items"),icon:gj,onClick:t}),r&&b().createElement(Cd.k,{className:o.shareButton,tooltipTitle:po().text("Copy link"),icon:SF(),onClick:r}),a&&b().createElement(Cd.k,{className:o.deleteButton,tooltipTitle:po().text("Delete selected items"),icon:zk(),onClick:a}))},RF=e=>{let{attributeValues:t,open:r,onClose:n,currentAttributeValueUri:a,setCurrentAttributeValueUri:o,attributeType:i,onDownload:l,onShareLink:s,onSetAsDefault:c,onUpload:u,onDeleteAttribute:p}=e;const[d,m]=(0,E.useState)([]),[y,g]=(0,E.useState)(EF.GALLERY_MODE),f=(0,S.xH)();(0,E.useEffect)((()=>{g(a?EF.DETAILS_MODE:EF.GALLERY_MODE)}),[a]);const h=t.map((e=>({src:(0,O.getImageAttributeOvThumbnailUrl)(e),downloadURL:(0,O.getImageAttributeOvUrl)(e),id:e.uri}))),v=e=>{s(h.find((0,R.propEq)("id",e)).downloadURL)},T=e=>{const r=t.find((t=>{let{uri:r}=t;return r===e}));c(r)},x=e=>{p({uri:e,attributeType:i})},{canCreate:C,canDelete:w}=(0,E.useContext)(Sk),A=y===EF.GALLERY_MODE,_=y===EF.DETAILS_MODE,I=d.length>0,N=_||A&&I,D=()=>A?d:[a],P=D().every((e=>(0,O.isTempUri)(e)||w)),k=!f&&N&&P,L=!f&&C&&(_||A&&!I),U=A&&I&&b().createElement(xF,{items:h,selectedItems:d,onClearAll:()=>{m([])},onSelectAll:()=>{m((0,R.pluck)("id",h))}}),j=b().createElement(AF,{onDelete:k?()=>{D().forEach((e=>{x(e)})),d.length&&m([])}:void 0,onDownload:N?()=>{const e=A?(0,R.pipe)((0,R.filter)((e=>{let{id:t}=e;return d.includes(t)})),(0,R.pluck)("downloadURL"))(h):[h.find((0,R.propEq)("id",a)).downloadURL];l(e)}:void 0,onShare:_?()=>{v(a)}:void 0,onUpload:L?u:void 0});return b().createElement(bF,{mode:y,open:r,onChangeMode:g,header:{left:U,right:j},onClose:n},A&&b().createElement(TF,{items:h,selectedItems:d,onSelectImage:e=>{m((t=>[...t,e]))},onDeselectImage:e=>{m((t=>t.filter((t=>t!==e))))},onShareLink:v,onSetAsDefault:T,onDownload:e=>{l([h.find((0,R.propEq)("id",e)).downloadURL])},onClickImage:e=>{o(e),g(EF.DETAILS_MODE)},onDelete:f?void 0:x}),_&&b().createElement(iF,{handleSetAsDefault:T,setCurrentAttributeValueUri:o,currentAttributeValueUri:a,attributeValues:t,attributeType:i}))},_F=(0,Op.Z)((e=>({imageBox:{position:"relative",display:"flex",width:"100%",flexGrow:1,flexShrink:0,flexWrap:"nowrap",marginTop:"2px",overflow:"hidden"},moreButtonContainer:e=>{let{imageWidth:t,imageHeight:r}=e;return{backgroundColor:"white",width:t,height:r,position:"absolute",right:0,cursor:"pointer"}},moreButton:t=>{let{imageWidth:r,imageHeight:n}=t;return{display:"flex",justifyContent:"center",alignItems:"center",width:r,height:n,backgroundColor:(0,km.alpha)(e.palette.primary.main,.06)}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}})));function IF(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const NF=e=>{let{attributeType:t,attributeValues:r=[],renderImage:n,overlay:a=!1,countFixedItems:o=0,children:i,onUpload:l,onDeleteAttribute:s,imageSize:c=lk,paging:u,parentUri:p,showNonOv:d,requestNextPageOfAttributeValues:m}=e;const y=_F(c);(0,E.useEffect)((()=>{if(u&&m){const e=d?u.totalOvValues:u.totalValues;e>r.length&&m({parentUri:p,attributeTypeUri:t.uri,attributeTypeName:t.name,values:[],defaultMaxValues:e})}}),[u,m,t,p,r.length,d]);const g=(0,E.useRef)(),[f,h]=(0,E.useState)(0),[v,T]=(0,E.useState)(0),x=(0,E.useContext)(qI),[C,w]=(0,E.useState)(!1),[A,R]=(0,E.useState)(),_=(0,S.ax)("setDefaultProfilePicForEntity"),I=(0,S.ax)("setDefaultProfilePicForModifiedEntity"),N=(0,S.eh)()||{},D=(0,S.xH)(),P=(0,E.useCallback)((e=>{const{imageMargin:t,imageWidth:n}=c,a=Math.floor((e+t)/(n+t))-o,i=e+t-(a+o)*(n+t)<8;h(a),r.length>a?T(r.length-a+(i?1:0)):T(0)}),[r.length,o,c]),k=(0,E.useCallback)((e=>{P(e),g.current=e}),[P]);(0,E.useEffect)((()=>{g.current&&P(g.current)}),[r.length,P]);const L=(0,E.useCallback)((e=>{x||(R(e),w(!0))}),[x]),U=(0,E.useCallback)((()=>{w(!1)}),[]),j=e=>(e=>{e.forEach(((e,t)=>{try{if((e=>!!(e=>e.indexOf("://")>0||0===e.indexOf("//"))(e)&&new URL(e).host!==location.host)(e)){const r=document.createElement("iframe");r.setAttribute("style","display: none;"),r.setAttribute("src",e),document.body.appendChild(r),setTimeout((()=>document.body.removeChild(r)),3e4*(t+1))}else{const t=document.createElement("a");t.href=e,t.download=(e=>e.split("/").pop())(e),document.body.appendChild(t),t.click(),document.body.removeChild(t)}}catch(e){console.error(e)}}))})(e),F=e=>navigator.clipboard.writeText(e),M=(0,E.useCallback)((e=>{D?(0,O.insertDefaultImageByAttrUri)(N.uri,e.uri).then((t=>{let{status:r}=t;"success"===r&&_(e)})):I({entityUri:N.uri,value:e})}),[D,N.uri,_,I]),V=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){IF(e,t,r[t])}))}return e}({onOpenImageGalleryDialog:L},a&&{onDownload:j,onShareLink:F,onSetAsDefault:M});return b().createElement(b().Fragment,null,b().createElement(zp.Z,{handleWidth:!0,onResize:k}),b().createElement(RF,{attributeValues:r,open:C,onClose:U,setCurrentAttributeValueUri:R,currentAttributeValueUri:A,attributeType:t,onDownload:j,onShareLink:F,onSetAsDefault:M,onUpload:l,onDeleteAttribute:s}),b().createElement("div",{className:y.imageBox},i,r.slice(0,f).map(n(V)),v>0&&b().createElement("div",{className:y.moreButtonContainer},b().createElement("div",{className:y.moreButton,onClick:()=>L()},b().createElement(Ay(),{className:y.number},`+${v}`)))))},DF=(0,Op.Z)((e=>({image:e=>{let{imageMargin:t,imageHeight:r,imageWidth:n}=e;return{marginRight:t,width:n,height:r,cursor:"pointer","&:last-child":{marginRight:0}}},deleteAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,background:`url('${(0,O.svg2Url)('<svg xmlns="http://www.w3.org/2000/svg" style="stroke: #D1051E; stroke-width: 1" viewBox="0 0 114 114">\n\t<line x1="5" y1="109" x2="109" y2="5" />\n</svg>')}') no-repeat`,backgroundColor:O.historyPalettes[O.HistoryOperations.deleteAttribute].backgroundColor,pointerEvents:"none"}},updateAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:O.historyPalettes[O.HistoryOperations.updateAttribute].backgroundColor,pointerEvents:"none"}},deleteAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${O.historyPalettes[O.HistoryOperations.deleteAttribute].color}`,outlineOffset:"-3px"}},insertAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${O.historyPalettes[O.HistoryOperations.insertAttribute].color}`,outlineOffset:"-3px"}},updateAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${O.historyPalettes[O.HistoryOperations.updateAttribute].color}`,outlineOffset:"-3px"}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,padding:"36px 8px",textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}}))),PF=e=>{let{attributeType:t,attributeValues:r=[],paging:n,parentUri:a,requestNextPageOfAttributeValues:o,showNonOv:i,imageSize:l=lk}=e;const s=DF(l),{appearance:c}=(0,E.useContext)(RD);return b().createElement(NF,{attributeValues:r,attributeType:t,renderImage:e=>{let{onOpenImageGalleryDialog:t}=e;return e=>{const r=(0,O.getImageAttributeOvThumbnailUrl)(e),{uri:n}=e,a=(0,O.getHistoryAppearanceByUri)(n,c),o=(0,O.getHistoryAttributeClassName)(a);return b().createElement("div",{className:T()(s.image,{[s[o+"Image"]]:o}),key:n,"data-reltio-id":"reltio-attribute-value"},b().createElement(ik,{onClick:()=>t(n),className:s[o],src:r,size:{imageWidth:l.imageWidth,imageHeight:l.imageHeight}}))}},imageSize:l,requestNextPageOfAttributeValues:o,paging:n,parentUri:a,showNonOv:i})},kF=e=>{let{attributeType:t,attributeValues:r,paging:n,parentUri:a,showNonOv:o,requestNextPageOfAttributeValues:i}=e;const l=AP(),{label:s,description:c}=t;return b().createElement(b().Fragment,null,b().createElement("div",{className:l.titleRow},b().createElement(ED,{className:l.title,label:s,"data-reltio-id":"reltio-attribute-label"}),b().createElement(AD,{className:l.descriptionIcon,description:c})),b().createElement(PF,{attributeValues:r,attributeType:t,paging:n,parentUri:a,requestNextPageOfAttributeValues:i,showNonOv:o}))},LF="oneLine",UF="multiLine",jF="imageLine",FF="special",MF=(0,E.memo)((e=>{var t;let{values:r,attributeType:n,drawLines:a,paging:o={},parentUri:i,max:l,titleClassName:s,contentClassName:c,showNonOv:u}=e;const p=SP(),d=(0,S.ax)("requestNextPageOfAttributeValues"),m=(0,S.vd)(),y=null!==(t=null!=l?l:m)&&void 0!==t?t:1/0,g=(0,R.partition)(O.isOv);if(!r||!r.length)return null;const[f,h]=g(r),E=u?r:f,v=u?[]:h,x=u?"totalValues":"totalOvValues",C=(0,R.ifElse)((0,R.has)(x),(0,R.prop)(x),(0,R.always)(E.length))(o),w=null!=o&&o.totalValues?o.totalValues-C:v.length,A=1===C&&!(0,O.isComplexAttribute)(n);return b().createElement(lN,{enabled:a,className:T()({[p.paddingWrapperWithLines]:a})},b().createElement("div",{className:T()({[p.paddingWrapper]:!a})},(()=>{switch((0,R.cond)([[O.isSpecialAttribute,(0,R.always)(FF)],[O.isImage,(0,R.always)(jF)],[(0,R.always)(A),(0,R.always)(LF)],[R.T,(0,R.always)(UF)]])(n)){case LF:return b().createElement(RP,{value:E[0],nonVisibleValues:v,totalNonVisibleValues:w,attributeType:n,titleClassName:s,contentClassName:c,showNonOv:u});case UF:return b().createElement(jP,{values:E,nonVisibleValues:v,totalVisibleValues:C,totalNonVisibleValues:w,attributeType:n,parentUri:i,max:y,requestNextPageOfAttributeValues:d,titleClassName:s,contentClassName:c,showNonOv:u});case jF:return b().createElement(kF,{attributeValues:E,attributeType:n,paging:o,parentUri:i,requestNextPageOfAttributeValues:d,showNonOv:u});case FF:return b().createElement(XP,{values:E,attributeType:n})}})()))})),VF=e=>{let{attrTypes:t,entity:r,parentUri:n,drawLines:a,children:o,className:i,max:l,alwaysVisibleTypeUris:s=TL,showNonOv:c}=e;const u=(0,S.jN)(),p=(0,E.useMemo)((()=>t.filter((e=>!u.includes(e.uri)))),[t,u]),[d,m]=(0,E.useState)(l||1/0),y=(0,E.useMemo)((()=>(0,O.getAttributesListForReadMode)(p,r,c)),[p,r,c]),[g,f]=(0,E.useMemo)((()=>Qk(s,y)),[y,s]),h=f.slice(0,d),v=l&&h.length<f.length,T=l&&h.length>=f.length&&l<h.length,x={enabled:a};return b().createElement("div",{className:i},o&&b().createElement(lN,x,o),h.concat(g).map((e=>{let{attrType:t,values:o}=e;return b().createElement(MF,{key:t.uri,attributeType:t,drawLines:a,values:o,paging:(0,R.path)(["paging",t.uri],r.attributes),parentUri:n,showNonOv:c})})),v&&b().createElement(DP,{onClick:()=>{m(1/0)}}),T&&b().createElement(UP,{onClick:()=>{m(l)}}))};VF.displayName="ReadOnlyAttributesList";const BF=(0,E.memo)(VF),zF=(0,Op.Z)({attributesContainer:{padding:"8px 16px"},noCaption:{paddingTop:"16px"},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"}}),HF=e=>{let{className:t,entity:r={},caption:n="",excludeUris:a=[],includeUris:o=[],attributesCount:i}=e;const l=zF(),s=(0,S.AH)(),c=(0,S.xK)(),u=(0,E.useMemo)((()=>Xk(s,r.type,o,a)),[a,o,s,r]),p=i||16,d=(0,O.getAttributesListForReadMode)(u,r).filter((e=>{let{values:t}=e;return!(0,O.isEmptyValue)(t)})).length>0;return d||!(0,O.isEmptyValue)(n)?b().createElement(KI.Provider,{value:c},b().createElement(nN,{className:t},n&&b().createElement(aN.I,{title:n}),b().createElement($I(),{className:T()(l.attributesContainer,{[l.noCaption]:!n})},d?b().createElement(BF,{entity:r,attrTypes:u,parentUri:r.uri,drawLines:!1,max:p}):b().createElement(Ay(),{className:l.noData},po().text("No data found"))))):null},YF=(0,Op.Z)({attributesContainer:{overflow:"hidden",padding:"8px 16px"},noCaption:{paddingTop:"16px"}}),WF=e=>{let{className:t,mode:r,entity:n,caption:a="",excludeUris:o=[],includeUris:i=[],pinnedAttributes:l}=e;const s=YF(),c=(0,S.ax)("addAttributes"),u=(0,S.ax)("modifyAttribute"),p=(0,S.ax)("removeAttribute"),d=(0,S.AH)(),m=(0,S.R2)(),y=(0,S.vc)(n.uri)||{},g=(0,E.useMemo)((()=>(0,O.getPinnedAttributesForUser)(l,m)),[l,m]),f=(0,E.useMemo)((()=>Xk(d,y.type,i,o)),[o,i,d,y.type]);return b().createElement(nN,{className:t},a&&b().createElement(aN.I,{title:a}),b().createElement($I(),{className:T()(s.attributesContainer,{[s.noCaption]:!a})},b().createElement(OL.Provider,{value:g},b().createElement(AL,{entity:y,attrTypes:f,parentUri:y.uri,drawLines:!1,mode:r,showEmptyEditors:(0,O.isTempUri)(y.uri),crosswalks:y.crosswalks,onAddAttributes:c,onChangeAttribute:u,onDeleteAttribute:p}))))};function GF(){return GF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},GF.apply(this,arguments)}const qF=e=>{let{attributesCount:t,pinnedAttributes:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributesCount","pinnedAttributes"]);const a=(0,S.Fr)(),o=(0,S.YA)(),i=n.entity||a,l=n.mode||o;return b().createElement(bD.Provider,{value:i},(0,O.isViewMode)(l)?b().createElement(HF,GF({},n,{attributesCount:t,entity:i})):b().createElement(WF,GF({},n,{mode:l,pinnedAttributes:r,entity:i})))},ZF=(0,Op.Z)((()=>({container:{display:"flex",flexDirection:"column",height:"100%"},scrollWrapper:{flexGrow:1,overflowY:"auto",backgroundColor:"#FAFAFA"},attributesView:{margin:"16px"},emptyState:{height:"100%",backgroundColor:"#FAFAFA"},profileBand:{paddingLeft:48,backgroundColor:"rgba(0,114,206,0.06)"}}))),$F=()=>{const e=ZF(),t=(0,Ep.useSelector)(ac),r=(0,Ep.useSelector)(rc);return b().createElement(b().Fragment,null,r&&b().createElement(YE.Z,null),t?b().createElement("div",{className:e.container},b().createElement(GI,{entity:t,classes:{profileBand:e.profileBand}}),b().createElement("div",{className:e.scrollWrapper},b().createElement(qI.Provider,{value:!0},b().createElement(qF,{className:e.attributesView,entity:t,mode:O.Mode.Viewing})))):b().createElement("div",{className:e.emptyState},b().createElement(HE,{LogoRenderer:zE.NO_DATA,text:po().text("No data to display."),secondaryText:po().text("Select a profile and view preview details here."),variant:BE.embedded})))},KF="circle",XF="polygon",QF={fillColor:"rgb(242,82,82)",fillOpacity:.1,strokeWeight:2,strokeColor:"#F25252",clickable:!1,editable:!0,zIndex:1},JF={mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1},eM=.001,tM=b().createContext({});tM.displayName="EntityMarkerContext";var rM=r(17871),nM=r(47111);const aM=e=>{let{children:t,className:r,position:n,map:a}=e;const[o,i]=(0,E.useState)(null);return(0,E.useEffect)((()=>{const e=document.createElement("div"),t=a.controls[n].length;return a.controls[n].push(e),i(e),()=>{a.controls[n].removeAt(t)}}),[a,n]),(0,E.useEffect)((()=>{o&&r&&o.classList.add(r)}),[r,o]),o?(0,nM.createPortal)(t,o):null};var oM=r(518),iM=r.n(oM);function lM(){return lM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lM.apply(this,arguments)}const sM=e=>b().createElement("svg",lM({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},e),b().createElement("path",{d:"M10.61 8.568A1.666 1.666 0 119.432 7.39l3.656-3.657a6.668 6.668 0 101.179 1.179L10.61 8.568zm-7.503 6.325A8.333 8.333 0 1114.893 3.107 8.333 8.333 0 013.107 14.893z",fill:"#000",stroke:"none",strokeWidth:1,fillRule:"evenodd",opacity:.54}));function cM(){return cM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cM.apply(this,arguments)}const uM=e=>b().createElement("svg",cM({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),b().createElement("defs",null,b().createElement("path",{d:"M18.29 11.44a1.49 1.49 0 012.12 0l1.15 1.15c.59.58.59 1.53 0 2.12L16.27 20H13v-3.27zM18.174 4c0 1.71-.26 3.285-.932 4.563-.946 1.798-2.609 2.724-4.906 2.46l-.855-.116c-4.382-.544-6.626.53-6.626 3.609 0 1.968 1.105 2.924 3.267 3.304.692.121 1.306.165 2.234.176L11 18v2l-.698-.003c-1.016-.013-1.71-.063-2.526-.206-3.018-.53-4.921-2.176-4.921-5.274 0-4.819 3.71-6.378 9.52-5.505 1.575.237 2.506-.255 3.098-1.38.451-.858.666-2.02.697-3.307L16.174 4h2zM18 13.97l-3.45 3.45v1.03h1.03L19.03 15 18 13.97z",id:"Draw_svg__a"})),b().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},b().createElement("mask",{id:"Draw_svg__b",fill:"#fff"},b().createElement("use",{xlinkHref:"#Draw_svg__a"})),b().createElement("g",{mask:"url(#Draw_svg__b)",fill:"#000",fillOpacity:.54},b().createElement("path",{d:"M0 0h24v24H0z"})))),pM=(0,Op.Z)({container:{margin:"2px",display:"flex",alignItems:"center"},button:{color:"rgba(0,0,0,0.54)",padding:0,height:"24px",width:"24px",minWidth:0},icon:{width:"20px",height:"20px"}}),dM=(0,md.T)(dE()),mM=e=>{let{drawingMode:t,drawingModes:r=[],hasActiveOverlay:n,onDrawingModeChanged:a,onClearOverlay:o}=e;const i=pM(),l=e=>()=>{a(e)};return b().createElement("div",{className:i.container},t||n?b().createElement(dM,{tooltipTitle:po().text("Clear area"),className:i.button,onClick:n?o:l(null)},b().createElement(iM(),{className:i.icon})):r.map((e=>{const t=(e=>{switch(e){case KF:return sM;case XF:return uM;default:return null}})(e);return b().createElement(dM,{tooltipTitle:po().text("Draw area"),key:e,className:i.button,onClick:l(e)},b().createElement(t,{className:i.icon}))})))},yM=(0,Op.Z)({container:{height:"28px",marginRight:"7px",marginLeft:0},label:{fontSize:"11px",alignSelf:"center",lineHeight:"13px",marginLeft:"2px",letterSpacing:0},checkbox:{width:"20px",height:"20px",boxSizing:"content-box",padding:"5px","& svg":{width:"16px",height:"16px"}}}),gM=e=>{let{isSearchOnMapMove:t,onChangeIsSearchOnMapMove:r}=e;const n=yM();return b().createElement(Bh(),{classes:{root:n.container,label:n.label},control:b().createElement(Xp(),{checked:t,onChange:e=>{r(e.target.checked)},className:n.checkbox}),label:po().text("Search as I move the map")})},fM=e=>{const t=e.getBounds(),r=t.getNorthEast(),n=t.getSouthWest(),a=r.lat(),o=r.lng(),i=n.lat(),l=n.lng(),s=[],c=[];if(!(180===o&&-180===l||-180===o&&180===l)){const e=t.getCenter();s.push([a,e.lng()]),c.push([i,e.lng()])}return[[a,o],...s,[a,l],[i,l],...c,[i,o]]},hM=e=>{switch(e){case KF:return window.google.maps.drawing.OverlayType.CIRCLE;case XF:return window.google.maps.drawing.OverlayType.POLYGON;default:return null}},EM=(e,t,r)=>{if(t.path){const n=r||new window.google.maps.LatLngBounds;t.path.forEach((e=>{let{lat:t,lng:r}=e;return n.extend(new window.google.maps.LatLng(t,r))})),e.fitBounds(n)}},bM=(0,Op.Z)((e=>({image:{width:"40px",height:"40px"},info:{marginLeft:"12px",overflow:"hidden",display:"flex",flexDirection:"column"},label:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:400,fontSize:"13px",lineHeight:"15px",color:e.palette.primary.main},secondaryLabel:{marginTop:"4px",fontWeight:400,fontSize:"10px",lineHeight:"12px",color:e.palette.text.secondary,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},link:{textDecoration:"none"},thirdRow:{display:"flex",overflow:"hidden",alignItems:"center",marginTop:"auto",paddingTop:"4px"},entityId:{display:"flex",overflow:"hidden",alignItems:"baseline",whiteSpace:"nowrap",fontWeight:400,fontSize:"12px",lineHeight:"16px"},entityIdLabel:{color:e.palette.text.secondary},entityIdValue:{marginLeft:"8px",color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis","&[aria-describedby]":{cursor:"pointer","&:hover":{textDecoration:"underline"}}}}))),vM=e=>{let{entity:t,classes:r={}}=e;const n=bM(),{secondaryLabel:a,label:o}=r,i=(0,O.getLabel)(t.label),{secondaryLabel:l}=t,s=(0,E.useCallback)((()=>{navigator.clipboard.writeText((0,O.getEntityId)(t))}),[t]);return b().createElement(b().Fragment,null,b().createElement(w,{entity:t,imageClassName:n.image}),b().createElement("div",{className:n.info},b().createElement(Wd,{value:(0,O.getEntityUriForLink)(t),className:n.link},b().createElement(dd.Y,{value:i,placement:"top",showOnExceededHeight:!0},b().createElement("div",{className:T()(n.label,o)},i))),l&&b().createElement(dd.Y,{value:l,placement:"top",showOnExceededHeight:!0},b().createElement("div",{className:T()(n.secondaryLabel,a)},l)),b().createElement("div",{className:n.thirdRow},b().createElement(AE,{entity:t,size:"medium"}),b().createElement("div",{className:n.entityId,onClick:s},b().createElement("div",{className:n.entityIdLabel},po().text("ID:")),b().createElement(dd.Y,{value:`Copy to clipboard ${(0,O.getEntityId)(t)}`,placement:"top"},b().createElement("div",{className:n.entityIdValue},(0,O.getEntityId)(t)))))))},TM=(0,Op.Z)({"@keyframes keyframes-wave":{"0%":{transform:"translateX(-100%)"},"60%":{transform:"translateX(100%)"},"100%":{transform:"translateX(100%)"}},wave:{overflow:"hidden",position:"relative","&:after":{top:"0",left:"0",right:"0",bottom:"0",content:'""',position:"absolute",animation:"$keyframes-wave 1.6s linear 0.5s infinite",transform:"translateX(-100%)",background:"linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.04), transparent);"}},avatar:{flex:"none",width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.11)"},info:{marginLeft:"12px",flex:"auto"},label:{width:"40%",height:"15px",borderRadius:"2px",backgroundColor:"rgba(0, 0, 0, 0.11)"},secondaryLabel:{marginTop:"4px",width:"100%",height:"12px",borderRadius:"2px",backgroundColor:"rgba(0, 0, 0, 0.11)"},thirdRow:{marginTop:"4px",width:"60%",height:"24px",borderRadius:"2px",backgroundColor:"rgba(0, 0, 0, 0.11)"}}),OM=()=>{const e=TM();return b().createElement(b().Fragment,null,b().createElement("div",{className:T()(e.avatar,e.wave)}),b().createElement("div",{className:e.info},b().createElement("div",{className:T()(e.label,e.wave)}),b().createElement("div",{className:T()(e.secondaryLabel,e.wave)}),b().createElement("div",{className:T()(e.thirdRow,e.wave)})))},xM=(0,Op.Z)({container:{display:"flex",padding:"16px",overflow:"hidden"}});function CM(){return CM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},CM.apply(this,arguments)}const SM=(0,E.memo)((e=>{let{entity:t,classes:r={},variant:n="normal"}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","classes","variant"]);const o=xM(),{container:i}=r;return b().createElement("div",CM({className:T()(o.container,i)},a),"normal"===n?b().createElement(vM,{entity:t,classes:r}):b().createElement(OM,null))})),wM=(0,Op.Z)({popper:{maxWidth:"263px",minWidth:"150px",boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)",backgroundColor:"white",borderRadius:"2px"}});function AM(){return AM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},AM.apply(this,arguments)}const RM=(0,O.svg2Url)('<?xml version="1.0" encoding="UTF-8"?>\n<svg width="22px" height="32px" viewBox="0 0 22 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>View / Map / Marker / Large (hover)</title>\n <defs>\n <radialGradient cx="50%" cy="50.2950175%" fx="50%" fy="50.2950175%" r="49.7049825%" gradientTransform="translate(0.500000,0.502950),scale(0.777778,1.000000),rotate(90.000000),scale(1.000000,1.293560),translate(-0.500000,-0.502950)" id="radialGradient-1">\n <stop stop-color="#000000" offset="0%"></stop>\n <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop>\n </radialGradient>\n <path d="M21,0 C21.5522847,-1.01453063e-16 22,0.44771525 22,1 L22,21 C22,21.5522847 21.5522847,22 21,22 L15.7283832,22.0012846 C15.5422129,22.2445529 15.3664776,22.4802332 15.1984183,22.7122576 C13.7560833,24.7035592 13,26.2846074 13,27.5 L13,27.5 L12.9945143,27.6492623 C12.9181651,28.6841222 12.0543618,29.5 11,29.5 C9.8954305,29.5 9,28.6045695 9,27.5 L9,27.5 L8.99485006,27.3298651 C8.91582184,26.0024976 7.93016704,24.2171459 6.23940611,22.000704 L1,22 C0.44771525,22 6.76353751e-17,21.5522847 0,21 L0,1 C-6.76353751e-17,0.44771525 0.44771525,1.01453063e-16 1,0 L21,0 Z" id="path-2"></path>\n </defs>\n <g id="View-/-Map-/-Marker-/-Large-(hover)" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <ellipse id="Oval" fill="url(#radialGradient-1)" opacity="0.32" cx="11" cy="28.5" rx="6" ry="4.66666667"></ellipse>\n <mask id="mask-3" fill="white">\n <use xlink:href="#path-2"></use>\n </mask>\n <use id="Path-2" fill="#FFFFFF" xlink:href="#path-2"></use>\n <rect id="Entity-type" fill="#24A8E8" mask="url(#mask-3)" x="0" y="0" width="22" height="32"></rect>\n <path d="M20,2 L20,20 L14.755,20 L14.6905172,20.0815309 C14.3562717,20.5012516 14.0578656,20.8886742 13.7817711,21.2616986 L13.5786724,21.5390469 C11.92787,23.8181606 11.079024,25.6311217 11.0052669,27.2674145 L11.0052669,27.2674145 L11,27.5 L10.9968324,27.3203844 C10.9285422,25.3781621 9.75347502,23.1598866 7.22124201,20.0010865 L2,20 L2,2 L20,2 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero" mask="url(#mask-3)"></path>\n </g>\n</svg>'),_M=(0,O.svg2Url)('<?xml version="1.0" encoding="UTF-8"?>\n<svg width="22px" height="32px" viewBox="0 0 22 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>View / Map / Marker / Large</title>\n <defs>\n <radialGradient cx="50%" cy="50.2950175%" fx="50%" fy="50.2950175%" r="49.7049825%" gradientTransform="translate(0.500000,0.502950),scale(0.777778,1.000000),rotate(90.000000),scale(1.000000,1.293560),translate(-0.500000,-0.502950)" id="radialGradient-1">\n <stop stop-color="#000000" offset="0%"></stop>\n <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop>\n </radialGradient>\n <path d="M20,1 C20.5522847,1 21,1.44771525 21,2 L21,20 C21,20.5522847 20.5522847,21 20,21 L15.2374606,21.0021908 C14.9306693,21.3935449 14.6510143,21.7632851 14.3885453,22.1256523 C12.8309725,24.2760522 12,26.0137017 12,27.5 C12,28.0522847 11.5522847,28.5 11,28.5 C10.4477153,28.5 10,28.0522847 10,27.5 C10,25.7886708 8.84033182,23.6810997 6.73798027,21.0014567 L2,21 C1.44771525,21 1,20.5522847 1,20 L1,2 C1,1.44771525 1.44771525,1 2,1 L20,1 Z" id="path-2"></path>\n </defs>\n <g id="View-/-Map-/-Marker-/-Large" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <ellipse id="Oval" fill="url(#radialGradient-1)" opacity="0.12" cx="11" cy="28.5" rx="4.5" ry="3.5"></ellipse>\n <path d="M21,0 C21.5522847,-1.01453063e-16 22,0.44771525 22,1 L22,21 C22,21.5522847 21.5522847,22 21,22 L15.7283832,22.0012846 C15.5422129,22.2445529 15.3664776,22.4802332 15.1984183,22.7122576 C13.7560833,24.7035592 13,26.2846074 13,27.5 L13,27.5 L12.9945143,27.6492623 C12.9181651,28.6841222 12.0543618,29.5 11,29.5 C9.8954305,29.5 9,28.6045695 9,27.5 L9,27.5 L8.99485006,27.3298651 C8.91582184,26.0024976 7.93016704,24.2171459 6.23940611,22.000704 L1,22 C0.44771525,22 6.76353751e-17,21.5522847 0,21 L0,1 C-6.76353751e-17,0.44771525 0.44771525,1.01453063e-16 1,0 L21,0 Z" id="Path-3" fill="#FFFFFF"></path>\n <mask id="mask-3" fill="white">\n <use xlink:href="#path-2"></use>\n </mask>\n <use id="Path-2" fill="#FFFFFF" fill-rule="nonzero" xlink:href="#path-2"></use>\n <rect id="Entity-type" fill="#24A8E8" mask="url(#mask-3)" x="0" y="0" width="22" height="32"></rect>\n </g>\n</svg>'),IM=(0,E.memo)((e=>{let{marker:t,onClick:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["marker","onClick"]);const a=wM(),o=(0,E.useRef)(),[i,l]=(0,E.useState)(!1),{activeEntityUri:s}=(0,E.useContext)(tM),c=(0,R.pathEq)(["entity","uri"],s,t),u={lat:t.point.lat,lng:t.point.lng},p=(0,E.useCallback)((0,O.debounce)(l,50),[]),d=(0,E.useCallback)((()=>p(!0)),[p]),m=(0,E.useCallback)((()=>p(!1)),[p]),y=(0,E.useCallback)((()=>r(t)),[r,t]);return b().createElement(b().Fragment,null,b().createElement(CN.Z,{anchorEl:o.current,open:i,className:a.popper,modal:!1,placement:"top"},b().createElement(SM,{entity:t.entity,onMouseOver:d,onMouseOut:m})),b().createElement(rM.Jx,AM({icon:{url:i||c?RM:_M,scaledSize:new google.maps.Size(22,32)},position:u,onClick:y,visible:!1!==t.visible,onMouseOver:d,onMouseOut:m},n)),b().createElement(rM.vD,{options:{alignBottom:!0,pane:"mapPane",pixelOffset:new google.maps.Size(0,-40),closeBoxURL:"",enableEventPropagation:!0,disableAutoPan:!0},position:u},b().createElement("span",{ref:o})))})),NM=(0,Op.Z)({mapControlContainer:{borderRadius:"2px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.15)",margin:"10px"}});function DM(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){PM(e,t,r[t])}))}return e}function PM(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kM=["drawing"],LM=e=>{let{markers:t=[],mapKey:r,defaultZoom:n,defaultCenter:a,loadingElement:o,isSearchOnMapMove:i,isSearchEnabled:l,activeOverlay:s,overlayOptions:c={},drawingModes:u=[],markerClusterer:p,markerClustererOptions:d,mapOptions:m={},mapContainerClassName:y,onMapBoundsChanged:g=bp.ZT,onOverlayUpdated:f=bp.ZT,onMarkerClicked:h=bp.ZT}=e;const v=NM(),{isLoaded:T,loadError:O}=(0,rM.Ji)({googleMapsApiKey:r,libraries:kM}),x=(0,E.useRef)(null),[C,S]=(0,E.useState)(null),[w,A]=(0,E.useState)(null),[_,I]=(0,E.useState)(null);(e=>{let{markers:t,activeOverlay:r,isSearchOnMapMove:n,map:a}=e;const o=Boolean(a&&window.google),i=(0,pg.D)(t),l=(0,pg.D)(r),s=(0,pg.D)(o);(0,E.useEffect)((()=>{const e=i!==t,c=s!==o,u=o&&r&&(l!==r||c);o&&!n&&t.length&&(e||c)?((e,t,r)=>{const n=new window.google.maps.LatLngBounds;if(e.forEach((e=>n.extend(e.point))),1===e.length){const e=n.getCenter();n.extend(new window.google.maps.LatLng(e.lat()+eM,e.lng()+eM)),n.extend(new window.google.maps.LatLng(e.lat()-eM,e.lng()-eM))}t.fitBounds(n),r&&EM(t,r,n)})(t,a,r):u&&EM(a,r)}),[o,t,r])})({markers:t,activeOverlay:s,map:C,isSearchOnMapMove:i});const N=(0,E.useMemo)((()=>DM({},QF,c)),[c]),D=(0,E.useMemo)((()=>DM({},JF,m)),[m]),P=(0,E.useCallback)((e=>{g(e?fM(C):null),I(null),clearTimeout(x.current)}),[C,g]),k=(0,E.useCallback)((()=>{clearTimeout(x.current)}),[]),L=(0,E.useCallback)((()=>{i&&g(fM(C))}),[i,C,g]),U=(0,E.useCallback)((()=>{i&&(clearTimeout(x.current),x.current=setTimeout(L,1e3))}),[L,i]),j=(0,E.useCallback)(((e,t)=>{var r;const n=t||w&&{type:XF,overlay:w};if((0,R.isEmpty)(n))return;const{overlay:a,type:o}=n,i={[XF]:()=>a.getPath().getArray().map((e=>[e.lat(),e.lng()])),[KF]:()=>({radius:a.getRadius()/1e3,center:a.getCenter()})},l=null===(r=i[o])||void 0===r?void 0:r.call(i);l&&f({data:l,type:o})}),[f,w]),F=(0,E.useCallback)((e=>t=>{j(null,{type:e,overlay:t}),t.setMap(null),I(null)}),[j]),M=(0,E.useCallback)((()=>{f(null)}),[f]),V=e=>t.filter((0,R.prop)("point")).map((t=>b().createElement(IM,{key:t.id,marker:t,clusterer:e,onClick:h})));if(O)return null;if(!T)return o;const B=l&&Boolean(u.length),z=C&&l&&Boolean(u.length),H=C&&l,Y=!hM(_)&&s&&(0,R.propEq)("type",XF,s);return b().createElement(rM.b6,{mapTypeId:window.google.maps.MapTypeId.ROADMAP,options:D,onLoad:S,zoom:n,center:a,onZoomChanged:k,onDragStart:k,onIdle:U,mapContainerClassName:y},z&&b().createElement(aM,{className:v.mapControlContainer,position:window.google.maps.ControlPosition.TOP_RIGHT,map:C},b().createElement(mM,{hasActiveOverlay:!!s,drawingModes:u,drawingMode:_,onDrawingModeChanged:I,onClearOverlay:M})),H&&b().createElement(aM,{className:v.mapControlContainer,position:window.google.maps.ControlPosition.TOP_CENTER,map:C},b().createElement(gM,{onChangeIsSearchOnMapMove:P,isSearchOnMapMove:i})),p?(W=d,b().createElement(rM.XL,{options:W},V)):V(),Y&&b().createElement(rM.mg,{onLoad:A,path:s.path,editable:!0,options:N,onMouseUp:j,onDragEnd:j}),B&&b().createElement(rM.j_,{onPolygonComplete:F(XF),onCircleComplete:F(KF),drawingMode:hM(_),options:{drawingControl:!1,circleOptions:N,polygonOptions:N}}));var W},UM=(e,t)=>Math.abs(e-t)<1,jM=(0,R.curry)(((e,t,r)=>{const n=t.map((t=>{let{position:r}=t;const n=e.find((e=>{let{point:t}=e;return UM(r.lat(),t.lat)&&UM(r.lng(),t.lng)}));return(0,R.propOr)("","label",n)})),a=(n.length>2?n.slice(0,2).concat("..."):n).join("\n");let o=0;const i=t.length.toString();let l=i;for(;0!==l;)l=parseInt(l/10,10),o++;return o=Math.min(o,r),{text:i,index:o,title:a}})),FM=[],MM=(0,R.pipe)((0,R.path)(["point","lat"]),(0,R.both)((0,R.gt)(90),(0,R.lt)(-90))),VM={[O.MAP_SEARCH_TYPES.geoPolygon]:XF,[O.MAP_SEARCH_TYPES.geoLocation]:KF},BM=e=>e&&e.length?[...e,e[0]]:e,zM=e=>e[0].map((e=>{let[t,r]=e;return{lat:t,lng:r}})).slice(0,-1),HM=(0,Op.Z)((()=>({container:{height:"100%",width:"100%",position:"relative"},fullHeight:{height:"100%"}}))),YM=()=>{const e=HM(),t=(0,Ep.useSelector)(P().selectors.getMetadata),r=(0,Ep.useSelector)(so.Qr),n=(0,Ep.useSelector)(Po.AO),a=(0,Ep.useSelector)(P().selectors.getGoogleMapKey),{markers:o,loading:i,onMarkerClicked:l}=(e=>{let{searchResults:t,metadata:r,mapKey:n}=e;t=t||FM;const a=(0,Ep.useDispatch)(),[o,i]=(0,E.useState)([]),[l,s]=(0,E.useState)(!1),c=(0,E.useRef)(),u=(0,E.useRef)(),p=(0,E.useCallback)((e=>{a({type:Ee,payload:e||null})}),[a]),d=(0,E.useCallback)((()=>{clearTimeout(u.current),clearTimeout(c.current)}),[]);return(0,E.useEffect)((()=>{s(!0),(0,O.resolve)(r,t,n).then((e=>{s(!1),i(e.filter(MM))})).catch((()=>{s(!1),i([])}))}),[t,r,n]),{markers:o,loading:l,onMarkerClicked:(0,E.useCallback)((e=>{const t=(0,R.path)(["entity","uri"],e);d(),p(),c.current=setTimeout((()=>p(t)),0),u.current=setTimeout(p,3e3)}),[d,p])}})({searchResults:r,metadata:t,mapKey:a}),{isSearchEnabled:s,activeOverlay:c,onOverlayUpdated:u,isSearchOnMapMove:p,onMapBoundsChanged:d}=(()=>{const e=(0,Ep.useDispatch)(),t=(0,Ep.useSelector)(so.Qy),r=(0,Ep.useSelector)(so.bt),n=(0,Ep.useSelector)(Po.d7),[a,o]=(0,E.useState)(!1),i=(0,E.useCallback)((t=>{let r=null,n=null;if(t){const{data:e,type:a}=t;switch(a){case KF:{const{center:t,radius:a}=e;r=[t.lng(),t.lat(),a],n=O.MAP_SEARCH_TYPES.geoLocation;break}case XF:r=BM(e),n=O.MAP_SEARCH_TYPES.geoPolygon}}o(!1),e(eo(r,n))}),[e]),l=(0,E.useCallback)((t=>{o(!!t),e(eo(BM(t),t&&O.MAP_SEARCH_TYPES.onMapMove))}),[e]),s=VM[r],c=(0,E.useMemo)((()=>n&&s&&t.length?{path:s===XF?zM(t):null,type:s}:null),[n,t,s]);return(0,E.useEffect)((()=>{(c||0===t.length)&&o(!1)}),[t,c]),{isSearchEnabled:n,onOverlayUpdated:i,activeOverlay:c,isSearchOnMapMove:a,onMapBoundsChanged:l}})(),m=(0,E.useMemo)((()=>b().createElement("div",{className:e.fullHeight},b().createElement(YE.Z,null))),[e]),y=(0,E.useMemo)((()=>({gridSize:60,maxZoom:9,calculator:jM(o)})),[o]),g=(0,E.useMemo)((()=>({activeEntityUri:n})),[n]),f=(0,E.useMemo)((()=>({lat:0,lng:0})),[]),h=(0,E.useMemo)((()=>[XF]),[]);return a?b().createElement("div",{className:e.container},i&&b().createElement(YE.Z,null),b().createElement(tM.Provider,{value:g},b().createElement(LM,{loadingElement:m,defaultZoom:1,defaultCenter:f,onOverlayUpdated:u,onMarkerClicked:l,activeOverlay:c,markers:o,fullscreenControl:!1,markerClusterer:!0,markerClustererOptions:y,drawingModes:h,isSearchOnMapMove:p,onMapBoundsChanged:d,isSearchEnabled:s,mapContainerClassName:e.fullHeight,mapKey:a}))):null},WM=(0,md.T)(Dp.T),GM=e=>{switch(e){case $.om.PROFILE:return po().text("Hide entity details");case $.om.MAP:return po().text("Hide map")}},qM=()=>{const e=YI(),t=(0,Ep.useDispatch)(),r=(0,Ep.useSelector)(Po.qx),n=r===$.om.MAP,a=(0,Ep.useSelector)(P().selectors.getGoogleMapKey),o=(0,E.useCallback)((()=>t(Io(null))),[t]);return(0,E.useEffect)((()=>{!a&&n&&o()}),[a,n,o]),b().createElement("div",{className:e.container},b().createElement(WM,{tooltipTitle:GM(r),tooltipPlacement:"bottom-start",size:"L",icon:HI(),className:e.closeButton,onClick:o}),(e=>{switch(e){case $.om.PROFILE:return b().createElement($F,null);case $.om.MAP:return b().createElement(YM,null)}})(r))},ZM=e=>{let{className:t,loading:r,entities:n,entityTypeTab:a,quantity:o,rowsPerPage:i,page:l,entityToHighlight:s,selectedEntityUri:c,mode:u,previewPanelMode:p,isPreviewPanelOpen:d,dispatch:m}=e;const y=GE(),g=(0,E.useRef)(),[f,h]=(0,E.useState)("50%"),v=(0,Do.gj)(u),x=p===$.om.PROFILE,C=p===$.om.MAP,[S,w]=(0,E.useState)({}),A=(0,E.useCallback)(((e,t)=>{w((0,R.assoc)(e,t))}),[]);(0,E.useEffect)((()=>{g.current&&(g.current.scrollTop=0)}),[n]),(0,E.useEffect)((()=>{x&&((0,O.isEmptyValue)(n)?m(ic(null)):!(0,R.prop)(0,n)||c&&n.map((0,R.prop)("uri")).includes(c)||m(ic(n[0].uri)))}),[m,x,c,n]),(0,E.useEffect)((()=>{!x&&c&&m(lc(null))}),[m,c,x]);const _=(0,E.useCallback)((e=>m(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;return{type:L.Z.CHANGE_PAGE,payload:{pageNumber:e,debounceTime:t,entityTypeUri:r}}}(e,250,a))),[m,a]),I=(0,E.useCallback)((e=>m(((e,t)=>({type:L.Z.CHANGE_ROWS_PER_PAGE,payload:{number:e,entityTypeUri:t}}))(e,a))),[m,a]),N=(0,E.useCallback)((e=>m(ic(e))),[m]),D=(0,E.useCallback)((0,O.debounce)((e=>m({type:be,payload:e})),50),[m]),P=(0,E.useCallback)((e=>{let{percentageSize:t}=e;return h(t)}),[]),k=e=>{const t=(0,R.prop)(e.uri,S);return b().createElement(Im,{entity:e,entityImportStatus:t,onEntityImportStatusChange:A})},U=(0,E.useRef)(null);return b().createElement("div",{className:T()(y.container,t)},r&&b().createElement(YE.Z,null),(0,Do.gj)(u)?b().createElement(jI,{quantity:o}):b().createElement(wI,null),b().createElement(SE,{className:y.resizablePanesWrapper,orientation:"vertical",size:d?f:"100%",minSize:480,maxSize:-480,allowResize:d,onChange:P},b().createElement("div",{className:y.pane},b().createElement(WE,{error:b().createElement(HE,{LogoRenderer:zE.ERROR,text:po().text("Something went wrong."),variant:BE.embedded})},(()=>{const e=s||null;return o?b().createElement("div",{className:v?y.tableContainer:y.listContainer,ref:g},v?b().createElement(BI,{entities:n,entityToHighlight:e,selectedEntityUri:c,entityTypeUri:a,onEntityClick:x?N:void 0,onEntityHover:C?D:void 0,entitiesImportStatus:S,onEntityImportStatusChange:A,basicTableRef:U}):b().createElement(PE,{entities:n,entityToHighlight:e,selectedEntityUri:c,onEntityClick:x?N:void 0,onEntityHover:C?D:void 0,entitiesImportStatus:S,entityButtonsRenderer:k}),o>$.Tu[0]&&b().createElement("div",{className:y.pagination},b().createElement(kE.Z,{count:o,rowsPerPageOptions:$.Tu,rowsPerPage:i||$.Tu[0],page:l||0,onChangePage:_,onChangeRowsPerPage:I,basicTableRef:U}))):b().createElement(HE,{LogoRenderer:zE.SEARCH_RESULTS,text:po().text("No results found."),secondaryText:po().text("Try adjusting your search or filter to find what you're looking for."),variant:BE.embedded})})())),b().createElement("div",{className:y.pane},b().createElement(qM,null))))};ZM.propTypes={page:hp().number,quantity:hp().number,rowsPerPage:hp().number,entities:hp().array,loading:hp().bool,dispatch:hp().func,entityToHighlight:hp().string,mode:hp().string,entityTypeTab:hp().string,className:hp().string,isPreviewPanelOpen:hp().bool,previewPanelMode:hp().oneOf(Object.values($.om)),selectedEntityUri:hp().string},ZM.defaultProps={quantity:0,entities:[]};const $M=(0,Ep.connect)((e=>{const t=(0,Po.tB)(e);return{quantity:(0,so.NU)(e,{entityTypeUri:t}),page:(0,so.fx)(e,{entityTypeUri:t}),rowsPerPage:(0,so.Uz)(e,{entityTypeUri:t}),entities:(0,so.BP)(e,{entityTypeUri:t}),loading:(0,so.gP)(e),entityToHighlight:(0,Po.Dn)(e),mode:(0,Po.XM)(e),entityTypeTab:t,previewPanelMode:(0,Po.qx)(e),isPreviewPanelOpen:(0,Po.jr)(e),selectedEntityUri:nc(e)}}))(ZM);var KM=r(4539),XM=r.n(KM),QM=r(4494);const JM=(0,Op.Z)({root:{height:"32px",borderRadius:"18px",backgroundColor:"rgba(0,0,0,0.10)",margin:"4px",maxWidth:"380px",flexShrink:"0",border:"none","&:focus":{"background-color":"rgb(206, 206, 206)"},"&:first-child":{marginLeft:0},"& $deleteIcon":{color:"rgba(0,0,0,0.38)",margin:"0 5px 0 0px",height:"18px",width:"18px"}},deleteIcon:{},label:{paddingLeft:"8px",paddingRight:"8px",overflow:"hidden"},labelContainer:{display:"flex",overflow:"hidden"},title:{color:"rgba(0,0,0,0.67)",marginRight:"6px"},values:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),eV=e=>{const t=JM(),r=e.values&&e.values.join(", ");return b().createElement(ef(),{label:b().createElement("div",{className:t.labelContainer},e.title&&b().createElement("div",{className:t.title},e.title,": "),e.values&&b().createElement(dd.Y,{value:r},b().createElement("div",{className:t.values},r))),onDelete:e.onDelete,variant:"outlined",deleteIcon:b().createElement(rf(),{"data-reltio-id":"facet-bar-chip-delete"}),classes:{root:t.root,deleteIcon:t.deleteIcon,label:t.label}})};eV.propTypes={classes:hp().object,title:hp().string,values:hp().array,onDelete:hp().func};const tV=eV;class rV extends E.PureComponent{constructor(){super(...arguments),this.state={anchorEl:null},this.handleClick=e=>{const{currentTarget:t}=e;this.setState((e=>({anchorEl:e.anchorEl?null:t})))},this.handleClose=e=>{e.stopPropagation(),this.setState({anchorEl:null})}}render(){const{classes:e,items:t}=this.props,{anchorEl:r}=this.state,n=Boolean(r),a=n?"moreButtonPopper":null;return b().createElement(E.Fragment,null,b().createElement(dE(),{"aria-describedby":a,color:"primary",variant:"contained",classes:{root:e.root,label:e.label},onClick:this.handleClick},po().text(`+ ${t.length}`)),b().createElement(CN.Z,{id:a,open:n,onClose:this.handleClose,anchorEl:r,placement:"bottom-start"},b().createElement(QI(),{elevation:2,classes:{root:e.popperContent}},this.props.items)))}}rV.propTypes={classes:hp().object,items:hp().array},rV.defaultProps={items:[]};const nV=mh()((()=>({root:{flexShrink:0,minHeight:"32px",opacity:"0.54",padding:"8px",minWidth:"35px",borderRadius:"8px"},label:{fontSize:"13px",lineHeight:"15px"},popperContent:{display:"flex",flexDirection:"column",alignItems:"flex-start",padding:"8px"}})))(rV);var aV=r(74635),oV=r.n(aV),iV=r(42670),lV=r(96177),sV=r.n(lV),cV=r(96858);const uV=(0,Op.Z)({dialogRoot:{minWidth:"600px",minHeight:"280px"},dialogTitle:{paddingTop:"19px"},dialogContentRoot:{paddingTop:"14px",display:"flex",flexDirection:"column"},dialogField:{marginTop:"0px",marginBottom:"24px"},dialogInput:{paddingTop:"21px",paddingBottom:"7px"},dialogFont:{fontSize:"14px"},dialogActions:{padding:"0 8px 8px 0"}});function pV(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){dV(e,t,r[t])}))}return e}function dV(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mV(){return mV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mV.apply(this,arguments)}const yV=e=>{let{isOpen:t,isAvailableUpdate:r,isChangedSavedSearch:n,currentSavedSearch:a,onClose:o,onSave:i,onUpdate:l}=e;const s=uV(),[c,u]=(0,E.useState)(""),[p,d]=(0,E.useState)($.ib.private),m=r&&a&&c===a.name,y=m&&a.isPublic===(p===$.ib.public)&&!n,g=(0,E.useCallback)((e=>{u(e.target.value)}),[]),f=(0,E.useCallback)((e=>{d(e)}),[]),h=(0,E.useCallback)((()=>m?l({share:p}):i({name:c,share:p})),[c,i,l,p,m]),v={InputProps:{classes:{input:T()(s.dialogInput,s.dialogFont)}},InputLabelProps:{classes:{root:s.dialogFont}}};return(0,E.useEffect)((()=>{if(t){const e=r?a.name:"",t=r&&a.isPublic?$.ib.public:$.ib.private;u(e),d(t)}}),[t,r,a]),b().createElement(Sj(),{onClose:o,open:t,PaperProps:{classes:{root:s.dialogRoot}}},b().createElement(oV(),{classes:{root:s.dialogTitle}},po().text("Save search")),b().createElement(sF(),{classes:{root:s.dialogContentRoot}},b().createElement(iV.H,mV({classes:{root:s.dialogField},label:po().text("Name"),required:!0,variant:"filled",value:c,onInput:g,size:"small",autoFocus:!0},v)),b().createElement(cV.k,{entries:$.m2,TextFieldProps:pV({classes:{root:s.dialogField},required:!0,label:po().text("Share with"),variant:"filled",size:"small"},v),value:p,onChange:f})),b().createElement(sV(),{classes:{root:s.dialogActions},disableSpacing:!0},b().createElement(dE(),{onClick:o},po().text("Cancel")),b().createElement(dE(),{color:"primary",onClick:h,disabled:m?y:0===c.length},m?po().text("Save"):po().text("Save as"))))};yV.propTypes={isOpen:hp().bool,isAvailableUpdate:hp().bool,isChangedSavedSearch:hp().bool,currentSavedSearch:hp().object,onClose:hp().func.isRequired,onSave:hp().func.isRequired,onUpdate:hp().func.isRequired};const gV=(0,Ep.connect)((e=>{const t=(0,Ti.LA)(e);return{isOpen:(0,Po.jd)(e),isAvailableUpdate:!(0,R.isNil)(t)&&(0,Ti.Jv)(e),isChangedSavedSearch:(0,Ti.WH)(e),currentSavedSearch:t}}),{onClose:()=>To(!1),onSave:e=>({type:ar,payload:e}),onUpdate:e=>({type:lr,payload:e})})(yV);var fV=r(11400);function hV(){return hV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hV.apply(this,arguments)}const EV=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return b().createElement("svg",hV({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},r),b().createElement("path",{fill:"#000",fillOpacity:".54",fillRule:"evenodd",d:"M7.596 3.561A5.963 5.963 0 019 3.4c1.164 0 2.195.3 3.093.902l.99-.99a7.287 7.287 0 00-1.353-.76A6.816 6.816 0 009 2c-.74 0-1.447.107-2.12.322l.716 1.239zm-2.007-.675A6.948 6.948 0 002.551 6.27 6.816 6.816 0 002 9c0 .968.184 1.878.551 2.73a7.069 7.069 0 001.497 2.223 7.07 7.07 0 002.222 1.496 6.689 6.689 0 001.73.483v-1.828a6.272 6.272 0 00-.19.356 5.213 5.213 0 01-1.479-.534 5.44 5.44 0 01-1.251-.936 4.848 4.848 0 011.059-.367A5.106 5.106 0 017.25 12.5h.306c.1 0 .219.012.359.035L8 12.451v-1.305a6.4 6.4 0 00-2.308.147 7.568 7.568 0 00-1.487.542 4.735 4.735 0 01-.604-1.33A5.547 5.547 0 013.4 9c0-1.563.542-2.888 1.627-3.973a5.66 5.66 0 011.25-.951l-.688-1.19zm9.86 3.384c.238.552.399 1.129.483 1.73H14.52a5.305 5.305 0 00-1.365-2.781l.98-.98A7.1 7.1 0 0115.45 6.27zm-2.056 1.488c.076.076.145.157.204.242h-2.894c.06-.085.128-.166.205-.242a1.69 1.69 0 011.242-.508c.49 0 .904.17 1.242.508zM9.7 7.6c0 .137-.01.27-.03.4H9a1 1 0 00-1 1v.94c-.235.073-.485.11-.75.11a2.36 2.36 0 01-1.732-.718A2.36 2.36 0 014.8 7.6c0-.677.24-1.254.718-1.732A2.36 2.36 0 017.25 5.15c.677 0 1.254.24 1.732.717A2.36 2.36 0 019.7 7.6zm-1.706.744a1.013 1.013 0 01-.744.306c-.292 0-.54-.102-.744-.306A1.013 1.013 0 016.2 7.6c0-.292.102-.54.306-.744.204-.204.452-.306.744-.306s.54.102.744.306c.204.204.306.452.306.744s-.102.54-.306.744zM22 20.667v-8L19.333 10h-8c-.366 0-.68.13-.941.392a1.284 1.284 0 00-.392.941v9.334c0 .366.13.68.392.941.26.261.575.392.941.392h9.334c.366 0 .68-.13.941-.392.261-.26.392-.575.392-.941zm-4.583-1.25A1.929 1.929 0 0116 20a1.929 1.929 0 01-1.417-.583A1.929 1.929 0 0114 18c0-.556.194-1.028.583-1.417A1.929 1.929 0 0116 16c.556 0 1.028.194 1.417.583.389.39.583.861.583 1.417s-.194 1.028-.583 1.417zm.583-4.75h-6V12h6v2.667z",clipRule:"evenodd"}))},bV=(0,Op.Z)({button:{marginRight:"-4px"},dialogRoot:{minWidth:"600px",minHeight:"280px"},dialogContentRoot:{display:"flex",flexDirection:"column",gap:"20px"}}),vV=()=>{const e=bV(),t=(0,Ep.useStore)(),[r,n]=(0,E.useState)(!1),[a,o]=(0,E.useState)(!1),i=(0,E.useCallback)((()=>n(!1)),[]),l=(0,E.useCallback)((()=>n(!0)),[]),s=(0,E.useCallback)((async(e,r,n)=>{const a=t.getState(),l=(0,xi.Z)(a),s=(0,Ti.Cc)(a,!0);o(!0);try{await(0,O.createSavedSearch)([{name:e,description:r,isPublic:n,query:s,uiState:l,type:O.SavedSearchType.SEGMENTATION}]),o(!1),i()}catch(e){(0,co.U)(e,{defaultMessage:po().text("Something went wrong while saving of the segment")}),o(!1)}}),[t,i]);return b().createElement(b().Fragment,null,b().createElement(Cd.k,{icon:EV,size:"L",onClick:l,tooltipTitle:po().text("Save as segment"),className:e.button}),b().createElement(fV.L,{isOpen:r,isSaving:a,onClose:i,onSave:s}))};function TV(){return TV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},TV.apply(this,arguments)}const OV=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return b().createElement("svg",TV({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),b().createElement("g",null,b().createElement("path",{fill:"none",d:"M0 0h24v24H0z"})),b().createElement("g",null,b().createElement("path",{fillOpacity:".54",d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"})))};function xV(){return xV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xV.apply(this,arguments)}const CV=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return b().createElement("svg",xV({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),b().createElement("defs",null,b().createElement("path",{d:"M17 3H5a2 2 0 00-2 2v14a2 2 0 002 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z",id:"svg1966704254a"})),b().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},b().createElement("mask",{id:"svg1966704254b",fill:"#fff"},b().createElement("use",{xlinkHref:"#svg1966704254a"})),b().createElement("g",{mask:"url(#svg1966704254b)",fill:"#000",fillOpacity:".54"},b().createElement("path",{d:"M0 0h24v24H0z"}))))};function SV(){return SV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},SV.apply(this,arguments)}const wV=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return b().createElement("svg",SV({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),b().createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),b().createElement("path",{fillOpacity:".54",d:"M19.35 10.04A7.49 7.49 0 0012 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 000 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"}))};function AV(){return AV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},AV.apply(this,arguments)}const RV=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return b().createElement("svg",AV({width:"12",height:"24",viewBox:"0 0 12 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),b().createElement("defs",null,b().createElement("path",{d:"M6 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z",id:"svg2486556319a"})),b().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},b().createElement("mask",{id:"svg2486556319b",fill:"#fff"},b().createElement("use",{xlinkHref:"#svg2486556319a"})),b().createElement("g",{mask:"url(#svg2486556319b)",fill:"#000",fillOpacity:".54"},b().createElement("path",{d:"M0 0h12v24H0z"}))))};var _V=r(69199),IV=r.n(_V),NV=r(37290),DV=r.n(NV);const PV=e=>navigator.clipboard?navigator.clipboard.writeText(e):(e=>new Promise(((t,r)=>{const n=document.createElement("textarea");n.value=e,n.style.top="0",n.style.left="0",n.style.position="fixed",document.body.appendChild(n),n.focus(),n.select();try{document.execCommand("copy"),t()}catch(e){r(e)}document.body.removeChild(n)})))(e);function kV(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){LV(e,t,r[t])}))}return e}function LV(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const UV=(0,Op.Z)({title:{marginBottom:"-10px"},linkField:{margin:"10px 0"},linkInput:{textOverflow:"ellipsis",fontSize:"14px"}}),jV=e=>{let{open:t,onClose:r=bp.ZT}=e;const n=UV(),a=(e=>{let{enabled:t}=e;const[r,n]=(0,E.useState)(""),a=(0,Ep.useSelector)(xi.Z),o=(0,Ep.useSelector)(so.RO),i=(0,Ep.useSelector)(P().selectors.getServicesPath),l=(0,Ep.useSelector)(P().selectors.getUIPath);return(0,E.useEffect)((()=>{t?(0,O.rawRequest)(`${i}/searchLink`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(kV({},a,{currentTenant:o}))}).then((0,R.pipe)((0,R.prop)("link"),(0,O.getSearchLink)(l),n)).catch(mo):n("")}),[t]),r})({enabled:t});return b().createElement(Sj(),{open:t,onClose:r},b().createElement(oV(),{className:n.title},po().text("Share link with search results")),b().createElement(sF(),null,b().createElement(IV(),null,po().text("With the URL link, anyone can view these search results. Paste this link in email or IM for testing, analyze, sharing and more.")),b().createElement(DV(),{className:n.linkField,InputProps:{classes:{input:n.linkInput}},label:a?"URL":"",placeholder:po().text("Loading URL..."),value:a,variant:"filled",fullWidth:!0,size:"small"})),b().createElement(sV(),null,b().createElement(dE(),{onClick:r},po().text("Cancel")),b().createElement(dE(),{disabled:!a,onClick:(0,R.pipe)((()=>PV(a)),r),color:"primary",autoFocus:!0},po().text("Copy link"))))};jV.propTypes={open:hp().bool,onClose:hp().func};const FV=jV,MV=(0,Op.Z)((()=>({button:{marginRight:"-4px"},exportButtonDisabled:{opacity:"0.54"}}))),VV=e=>{let{customActions:t=[]}=e;const r=MV(),n=(0,Ep.useDispatch)(),a=(0,Ep.useSelector)(P().selectors.getUIConfig),o=(0,Ep.useSelector)(P().selectors.getCanUserMakeExport),i=(0,Ep.useSelector)(P().selectors.getCanUserOpenDataLoader),l=!!(0,O.findPerspectiveConfig)(O.ScreenType.Segmentation,a),s=!!(0,Ep.useSelector)(so.lF),{canExport:c}=(0,Ep.useSelector)(Po.MO),u=c&&o,p=(0,E.useCallback)((()=>{n({type:L.Z.EXPORT_RESULTS})}),[n]),d=(0,E.useCallback)((()=>{n({type:L.Z.OPEN_DATA_LOADER})}),[n]),m=(0,Ep.useSelector)(so.ai),y=(0,E.useCallback)((()=>{n(To(!0))}),[n]),g=[],[f]=(()=>{const e=(0,Ep.useSelector)(P().selectors.getCanUserStartProcessFromQuery),t=(0,Ep.useSelector)(P().selectors.getWorkflowPath),r=(0,Ep.useSelector)(P().selectors.getWorkflowEnvironmentUrl),n=(0,Ep.useSelector)(Po.FH),a=(0,Ep.useSelector)(P().selectors.getTenant),o=(0,Ep.useDispatch)(),i=(0,Ep.useSelector)(so.FR),{globalFilter:l}=(0,Ep.useSelector)(P().selectors.getGlobalSearchRequestOptions),s=(0,Ma._k)(i,[],l),c=(0,E.useCallback)((()=>{const{processType:e}=n;(0,O.startProcessFromQuery)({workflowPath:t,processType:e,searchString:s,tenant:a,environment:r}).then((()=>{o(_o({message:po().text("Match reviews successfully submitted. Go to Inbox to view their status."),actionToDispatch:D.ui.actions.openAppFromChocolateBar("Inbox"),actionLabel:po().text("Go to inbox"),autoHideDuration:null}))})).catch((e=>{mo(e)}))}),[n,t,s,a,r,o]),u=s.includes("matches")||s.includes("matchRules");return[e&&t&&n?{disabled:!u,text:po().text("Request Match Review"),tooltip:po().text("Filter on match rules or potential matches to enable Potential Match Review"),onClick:c,id:"-request-match-review"}:null]})();f&&g.push(f);const[h]=(()=>{const e={NO_ENTITY_TYPE:po().text("Please select exactly one entity type or switch to table mode")},t=(0,Ep.useDispatch)(),r=(0,Ep.useSelector)(Po.MO),n=(0,Ep.useSelector)(P().selectors.getCanUserMakeBulkUpdate),a=!!(0,Ep.useSelector)(so.lF),o=(0,Ep.useSelector)(Jc),i=!!o,l=Boolean(null==r?void 0:r.bulkUpdate),s=(0,Ep.useSelector)(P().selectors.getMetadata),c=(0,Ep.useSelector)(Po.Xf),u=l&&n&&!a?{disabled:!i||!(e=>(0,Va.wW)(s,{},c).some((t=>t.value===e)))(o),text:po().text("Bulk update"),tooltip:i?null:e.NO_ENTITY_TYPE,onClick:()=>t(No(!0)),id:"-bulk-update"}:null;return[u]})();h&&g.push(h);const[v,x]=(0,E.useState)(!1);return g.push({text:po().text("Share link"),onClick:()=>x(!0),id:"-share-link"}),g.push(...t),b().createElement(b().Fragment,null,i&&b().createElement(Cd.k,{icon:wV,size:"L",onClick:d,tooltipTitle:po().text("Load data"),className:r.button,"data-reltio-id":"reltio-search-actions-menu-load-data"}),u&&b().createElement(Cd.k,{icon:OV,size:"L",onClick:p,tooltipTitle:po().text("Export"),showForDisabled:!0,classes:{disabled:r.exportButtonDisabled},className:r.button,disabled:s,"data-reltio-id":"reltio-search-actions-menu-export"}),b().createElement(Cd.k,{tooltipTitle:po().text("Save"),showForDisabled:!0,className:T()({[r.button]:g.length>0}),disabled:!m,onClick:y,icon:CV,size:"L","data-reltio-id":"reltio-search-actions-menu-save"}),l&&b().createElement(vV,null),g.length>0&&b().createElement(LN,{buttonComponent:Dp.T,buttonProps:{icon:RV,size:"L","data-reltio-id":"reltio-search-actions-menu"},menuId:"custom-actions",menuItems:g}),b().createElement(gV,null),b().createElement(FV,{open:v,onClose:()=>x(!1)}))},BV="#FF1744",zV=(0,Op.Z)({indicatorWrapper:{width:0,height:"20px",position:"relative"},indicatorTooltipArea:{width:"10px",height:"20px"},indicator:{width:"3px",height:"3px",backgroundColor:BV,border:"1px solid",borderColor:BV,borderRadius:"3px",position:"absolute",right:"-7px"},wrapper:{display:"inline-flex",position:"relative",overflow:"hidden"},for:{color:"rgba(0,0,0,0.6)",marginLeft:"8px",marginRight:"8px"},label:{color:"rgba(0,0,0,0.87)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}),HV=()=>{const e=(0,Ep.useSelector)(Ti.LA),t=(0,Ep.useSelector)(Ti.WH),r=zV();if(!e)return null;const n=e.name;return b().createElement(b().Fragment,null,b().createElement("div",{className:r.wrapper},b().createElement(Ay(),{variant:"body2",component:"span",classes:{root:r.for}},po().text("for")),b().createElement(dd.Y,{value:n},b().createElement(Ay(),{variant:"body2",classes:{root:r.label}},n))),t&&b().createElement(Gg(),{title:po().text("Saved search has changed"),placement:"bottom"},b().createElement("div",{className:r.indicatorWrapper},b().createElement("div",{className:r.indicator}),b().createElement("div",{className:r.indicatorTooltipArea}))))},YV=(0,Op.Z)({wrapper:{display:"inline-flex",position:"relative",overflow:"hidden",color:"rgba(0,0,0,0.6)"},in:{marginLeft:"8px",marginRight:"8px"},label:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontWeight:500}}),WV=()=>{const e=YV(),t=(0,Ep.useSelector)(P().selectors.getDataTenants),r=t&&t.length>0,n=(0,Ep.useSelector)(so.t9),a=(0,Ep.useSelector)(P().selectors.getTenantName),o=n?n.label:a;return r&&b().createElement("div",{className:e.wrapper},b().createElement(Ay(),{variant:"body2",component:"span",classes:{root:e.in}},po().text("in")),b().createElement(dd.Y,{value:a},b().createElement(Ay(),{variant:"body2",classes:{root:e.label}},o)))};var GV=r(81877),qV=r.n(GV);const ZV=(0,Op.Z)({dialogPaper:{height:"70vh"},contentRoot:{padding:0,display:"flex",flexDirection:"column",overflow:"hidden"},tabContent:{display:"flex",flex:"1 1 auto"},tabsWrapper:{padding:"0 24px"}}),$V=(0,Op.Z)((e=>({container:{display:"flex",alignItems:"center",paddingTop:17,paddingBottom:11,paddingLeft:15,paddingRight:15},selected:{backgroundColor:(0,km.alpha)(e.palette.primary.main,.12)}}))),KV=(0,Op.Z)({main:{display:"flex",alignItems:"center",justifyContent:"space-between",flex:1},title:{display:"flex",alignItems:"center"},filterButton:{marginLeft:"10px",minWidth:0},deleteButton:{marginTop:"-5px"},searchBox:{flex:"1 1 auto",width:"100%",maxWidth:"323px"},flex1:{flex:1}}),XV=(0,Op.Z)({closeButton:{marginRight:"10px"}}),QV=e=>{let{onClose:t}=e;const r=XV();return b().createElement(Dp.T,{size:"L",icon:_p(),className:r.closeButton,onClick:t})};QV.propTypes={onClose:hp().func};const JV=QV,eB=e=>{let{selectedNumber:t,onDelete:r,onClose:n}=e;const a=KV();return b().createElement(b().Fragment,null,b().createElement("div",{className:T()(a.title,a.flex1)},b().createElement(JV,{onClose:n}),b().createElement(Ay(),{color:"primary"},po().text("Selected: ${count}",{count:t}))),b().createElement(Cd.k,{tooltipTitle:po().text("Delete"),size:"L",icon:zk(),className:a.deleteButton,onClick:r}))};eB.propTypes={selectedNumber:hp().number,onClose:hp().func,onDelete:hp().func};const tB=eB;function rB(){return rB=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rB.apply(this,arguments)}function nB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){aB(e,t,r[t])}))}return e}function aB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oB=e=>{let{classes:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes"]);const n=Pp({});return b().createElement(jp,rB({classes:nB({},t,{focused:n.white})},r))};var iB=r(34480),lB=r.n(iB);const sB=(0,Op.Z)((e=>({changedFiltersIndicator:{backgroundColor:(0,km.alpha)(e.palette.primary.main,.12)},popupContent:{paddingTop:"19px",paddingBottom:"10px",paddingLeft:"23px",paddingRight:"23px",width:"48%",maxWidth:"480px"},title:{marginBottom:"30px"},favoriteOnlyControlRoot:{marginTop:"27px"},favoriteOnlyControlLabel:{fontSize:"0.8rem"},favoriteOnlyCheckbox:{marginRight:"20px"},buttonsGroup:{display:"flex",justifyContent:"space-between",marginTop:"35px",marginLeft:"-11px",marginRight:"-11px"},cancelButton:{marginRight:"10px"},shareWithRoot:{padding:"20px 16px 7px",fontSize:"0.85rem"},shareWithLabel:{top:"-3px",left:"4px"},shareWithMenuItem:{fontSize:"0.85rem"}}))),cB=e=>e?$.ib.public:$.ib.private,uB=e=>e===$.ib.public,pB=e=>{let{className:t,findPublic:r,favoriteOnly:n,onChangeFilters:a}=e;const o=sB(),i=(0,E.useRef)(),[l,s]=(0,E.useState)(!1),[c,u]=(0,E.useState)(r),[p,d]=(0,E.useState)(n);(0,E.useEffect)((()=>{u(r),d(n)}),[r,n]);const m=(0,E.useCallback)((()=>s((e=>!e))),[]),y=(0,E.useCallback)((e=>d(e.target.checked)),[]),g=(0,E.useCallback)((()=>{a({findPublic:c,favoriteOnly:p}),m()}),[m,a,c,p]),f=(0,E.useCallback)((()=>{u(r),d(n),m()}),[m,r,n]),h=(0,E.useCallback)((()=>{u(!0),d(!1)}),[]),v=!0===c&&!1===p;return b().createElement(b().Fragment,null,b().createElement(dE(),{ref:i,color:v?"inherit":"primary",classes:{root:t,textPrimary:o.changedFiltersIndicator},onClick:m},b().createElement(lB(),null)),b().createElement(Tp(),{open:l,classes:{paper:o.popupContent},anchorEl:i.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},b().createElement(Ay(),{className:o.title,variant:"h6"},po().text("Filter")),b().createElement(cV.k,{entries:$.m2,TextFieldProps:{InputLabelProps:{classes:{root:o.shareWithLabel}},label:po().text("Shared with"),variant:"filled"},classes:{root:o.shareWithRoot,menuItem:o.shareWithMenuItem},fullWidth:!0,value:cB(c),onChange:(0,R.pipe)(uB,u)}),b().createElement(Bh(),{classes:{root:o.favoriteOnlyControlRoot,label:o.favoriteOnlyControlLabel},control:b().createElement(Xp(),{className:o.favoriteOnlyCheckbox,checked:p,onChange:y}),label:po().text("Show favorites only")}),b().createElement("div",{className:o.buttonsGroup},b().createElement(dE(),{onClick:h,disabled:v},po().text("Clear all")),b().createElement("div",null,b().createElement(dE(),{onClick:f,className:o.cancelButton},po().text("Cancel")),b().createElement(dE(),{onClick:g,color:"primary"},po().text("Apply"))))))};pB.propTypes={className:hp().string,findPublic:hp().bool,favoriteOnly:hp().bool,onChangeFilters:hp().func,onChangeFavoriteOnly:hp().func};const dB=(0,Ep.connect)((e=>({findPublic:(0,Ti.kU)(e),favoriteOnly:(0,Ti.VS)(e)})),{onChangeFilters:e=>{let{findPublic:t,favoriteOnly:r}=e;return{type:yr,payload:{findPublic:t,favoriteOnly:r}}}})(pB),mB=e=>{let{type:t,onSearch:r,placeholder:n,onClose:a}=e;const o=KV();return b().createElement(b().Fragment,null,b().createElement("div",{className:o.main},b().createElement("div",{className:o.title},b().createElement(JV,{onClose:a}),b().createElement(Ay(),{variant:"h6"},po().text("Saved & recent searches"))),b().createElement("div",{className:o.searchBox},b().createElement(oB,{fullWidth:!0,onSearch:r,placeholder:n}))),t===$.uJ.saved&&b().createElement(dB,{className:o.filterButton}))};mB.propTypes={type:hp().oneOf(Object.values($.uJ)),onClose:hp().func,onSearch:hp().func,placeholder:hp().string};const yB=mB,gB=e=>{let{type:t,selectedNumber:r,onClose:n,dispatch:a}=e;const o=$V(),i=(0,E.useCallback)((()=>{const e=t===$.uJ.saved?{type:wr}:{type:zr};a(e)}),[t,a]),l=(0,E.useCallback)((0,O.debounce)((e=>{const r=t===$.uJ.saved?{type:Ir,payload:e}:{type:Gr,payload:e};a(r)}),500),[t,a]),s=(0,R.cond)([[(0,R.equals)($.uJ.saved),(0,R.always)(po().text("Search name"))],[(0,R.equals)($.uJ.recent),(0,R.always)(po().text("Search for filtered entity types and attributes"))]])(t);return b().createElement(oV(),{className:T()(o.container,{[o.selected]:r})},r?b().createElement(tB,{selectedNumber:r,onDelete:i,onClose:n}):b().createElement(yB,{type:t,onSearch:l,onClose:n,placeholder:s}))};gB.propTypes={type:hp().oneOf(Object.values($.uJ)).isRequired,selectedNumber:hp().number,onClose:hp().func,dispatch:hp().func};const fB=(0,Ep.connect)(((e,t)=>({selectedNumber:t.type===$.uJ.saved?(0,Ti.g2)(e):Ls(e)})))(gB),hB="0.75rem",EB=(0,Op.Z)({tableWrapper:{display:"flex",flexDirection:"column",width:"100%",position:"relative","& $cellBorder":{borderLeft:"none",borderRight:"none"}},cellBorder:{},paginationRoot:{flexShrink:0,boxShadow:"none",borderTop:"1px solid rgba(0, 0, 0, 0.1)",fontSize:hB},paginationCaption:{fontSize:hB}});var bB=r(54622);const vB="0.8rem",TB=(0,Op.Z)((e=>{const t=(0,km.lighten)(e.palette.primary.main,.88),r=(0,km.alpha)(t,0),n=(0,km.lighten)(e.palette.primary.main,.82),a={content:'""',position:"absolute",top:0,right:0,width:"40px",height:"100%",background:"linear-gradient(to right, rgba(255, 255, 255, 0.2), #fff 100%)",pointerEvents:"none","div.hoveredRow &":{background:"linear-gradient(to right, rgba(238, 238, 238, 0), rgba(238, 238, 238, 1) 100%)"},"$checkedRowCell &":{background:`linear-gradient(to right, ${r}, ${t} 100%)`},"div.hoveredRow $checkedRowCell &":{background:`linear-gradient(to right, ${(0,km.alpha)(n,0)}, ${n} 100%)`}};return{defaultWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:"0 22px",fontSize:vB,display:"flex",alignItems:"center",height:"100%","&:after":a},numberWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:"0 24px 0 22px",fontSize:vB,justifyContent:"flex-end",display:"flex",alignItems:"center",height:"100%"},nameWithStar:{display:"flex",alignItems:"center",height:"100%",paddingLeft:"6px","& $editNameButton":{display:"none"},"div.hoveredRow & $editNameButton":{display:"flex"}},leftButtonWrapper:{},deleteButton:{visibility:"hidden",marginRight:"2px"},totalWithButtonsWrapper:{justifyContent:"flex-end",display:"flex",alignItems:"center",height:"100%","& $numberWrapper":{paddingRight:"8px"},"div.hoveredRow & $deleteButton":{visibility:"visible"}},nameTextEditorRoot:{margin:0},nameInput:{fontSize:vB,"&::-ms-clear":{display:"none"}},nameContainer:{flex:1,overflow:"hidden"},editing:{},editNameButton:{},searchName:{cursor:"pointer",lineHeight:"29px",position:"relative",whiteSpace:"nowrap",overflow:"hidden",fontSize:vB,"&:after":a},clickableArea:{cursor:"pointer"},starButton:{marginLeft:"-7px",marginRight:"3px",visibility:"hidden","div.hoveredRow &$enabledButton":{visibility:"visible"}},checkedStarButton:{visibility:"visible",color:"#F5A623 !important"},filterButton:{"$editing &":{marginRight:"2px"},marginLeft:"-7px",marginRight:"10px",visibility:"hidden","div.hoveredRow &$enabledButton":{visibility:"visible"},"& svg":{fill:"rgba(0,0,0,0.56)"}},checkedFilterButton:{visibility:"visible","& svg":{fill:e.palette.primary.main}},enabledButton:{},headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"0.75rem",borderBottom:"1px solid rgba(0,0,0,.1)",color:"rgba(0,0,0,0.6)",fontWeight:500,"&>div":{padding:"0 4px 0 22px"},"& $headLabel":{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}},totalHeadCell:{justifyContent:"flex-end",marginRight:"45px"},nameHeadCell:{paddingLeft:"39px"},headLabel:{},checkbox:{paddingLeft:"11px"},sharingWrapper:{paddingLeft:"22px",display:"flex",alignItems:"center",height:"100%"},sharingRoot:{flexShrink:1,maxWidth:"100%"},sharingInput:{fontSize:vB},sharingMenuItem:{fontSize:vB,minWidth:"100px"},sharingDisabled:{color:"rgba(0,0,0,0.89)",paddingRight:"0 !important"},sharingIconDisabled:{display:"none"},rowCell:{height:"100%"},checkedRowCell:{backgroundColor:t,"div.hoveredRow &":{backgroundColor:n}},invisibleOnHoverCommon:{height:"100%","&$invisibleOnHover":{pointerEvents:"none","div.hoveredRow &":{color:"transparent"}}},invisibleOnHover:{},tooltip:e.tooltip,tooltipSection:{marginBottom:"5px"},tooltipSectionHeader:{margin:"5px 0",fontSize:"11px",fontWeight:500},tooltipText:{opacity:.7,fontSize:"10px"}}})),OB=e=>{let{mode:t}=e;const r=TB(),n=(0,Ep.useDispatch)(),a=t===$.uJ.saved?Ti.tc:Us,o=(0,Ep.useSelector)(a),i=t===$.uJ.saved?Ti.hY:js,l=(0,Ep.useSelector)(i),s=(0,E.useCallback)((()=>{t===$.uJ.saved?n(l?hi():{type:fr}):n(l?xs():{type:Vr})}),[n,l,t]);return b().createElement("div",{className:T()(r.headCell,r.checkbox)},b().createElement(Xp(),{indeterminate:!o&&l,checked:o,onChange:s}))};OB.propTypes={mode:hp().string};const xB=(0,Md.q)((0,R.pick)(["mode"]))(OB),CB=e=>{const t=t=>{const r=TB(),{rowValue:{checked:n}}=t;return b().createElement("div",{className:T()(r.rowCell,{[r.checkedRowCell]:n})},b().createElement(e,t))};return t.propTypes={rowValue:hp().shape({checked:hp().bool})},t},SB=(0,md.T)(Xp()),wB=e=>{let{value:t=!1,rowValue:{uri:r,isOwnSearch:n},onClick:a}=e;const o=TB(),i=!n;return b().createElement("div",{className:T()(o.headCell,o.checkbox)},b().createElement(SB,{showForDisabled:!0,tooltipTitle:i&&po().text("Cannot edit because you're not the owner"),tooltipPlacement:"bottom-start",disabled:i,checked:t,onChange:e=>a(r,e.target.checked)}))};wB.propTypes={value:hp().bool,rowValue:hp().shape({uri:hp().string,isOwnSearch:hp().bool}),onClick:hp().func};const AB=(0,Md.q)((e=>{let{onSelectItem:t}=e;return{onClick:t}}))(CB(wB));var RB=r(92332);function _B(){return _B=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_B.apply(this,arguments)}function IB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){NB(e,t,r[t])}))}return e}function NB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const DB=e=>{let{className:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);const n=TB(),{headCellData:a}=r;return b().createElement("div",{className:T()(n.headCell,t)},b().createElement(RB.default,_B({},r,{headCellData:IB({},a,{label:b().createElement(dd.Y,{value:a.label},b().createElement("div",{className:n.headLabel},a.label))})})))};DB.propTypes={className:hp().string,headCellData:hp().shape({id:hp().string,label:hp().oneOfType([hp().string,hp().node]),sortable:hp().bool,resizable:hp().bool,className:hp().string,initialWidth:hp().number,minWidth:hp().number,autoResize:hp().bool,renderer:hp().func})};const PB=DB;function kB(){return kB=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kB.apply(this,arguments)}const LB=e=>{const t=TB();return b().createElement(PB,kB({className:t.nameHeadCell},e))};LB.propTypes={headCellData:hp().shape({id:hp().string,label:hp().oneOfType([hp().string,hp().node]),sortable:hp().bool,resizable:hp().bool,className:hp().string,initialWidth:hp().number,minWidth:hp().number,autoResize:hp().bool,renderer:hp().func})};const UB=LB;var jB=r(18122),FB=r.n(jB),MB=r(62839),VB=r.n(MB);function BB(){return BB=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},BB.apply(this,arguments)}const zB=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return b().createElement("svg",BB({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),b().createElement("g",null,b().createElement("path",{d:"M0 0h24m0 24H0",fill:"none"}),b().createElement("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39A.998.998 0 0018.95 4H5.04c-.83 0-1.3.95-.79 1.61z"}),b().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})))};function HB(){return HB=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},HB.apply(this,arguments)}const YB=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return b().createElement("svg",HB({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),b().createElement("g",null,b().createElement("path",{d:"M0 0h24m0 24H0",fill:"none"}),b().createElement("path",{d:"M7 6h10l-5.01 6.3L7 6zm-2.75-.39C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39A.998.998 0 0018.95 4H5.04c-.83 0-1.3.95-.79 1.61z"}),b().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})))};var WB=r(74492),GB=r.n(WB),qB=r(72246),ZB=r.n(qB);const $B=e=>{let{value:t,rowValue:{uri:r,isFavorite:n,isOwnSearch:a,isEditing:o,isGlobalFilter:i},onStarClick:l,onGlobalClick:s,onApply:c,onChangeName:u,onSetEditing:p}=e;const d=TB(),m=a&&!o,[y,g]=(0,E.useState)(t);(0,E.useEffect)((()=>{g(t)}),[t]);const f=(0,E.useCallback)((()=>{u(r,y)}),[r,y,u]),h=(0,E.useCallback)((()=>l(r,!n)),[l,r,n]),v=(0,E.useCallback)((()=>s(r,!i)),[s,r,i]),O=(0,E.useCallback)((()=>p(r,!0)),[p,r]),x=(0,E.useCallback)((()=>c(r)),[c,r]),C=(0,R.cond)([[(0,R.always)(a),(0,R.always)(po().text("Mark as favorite"))],[(0,R.always)(n),(0,R.always)(po().text("Cannot ummark because you're not the owner"))],[R.T,(0,R.always)("")]])();return b().createElement("div",{className:T()(d.nameWithStar,{[d.editing]:o})},b().createElement(Cd.k,{showForDisabled:!0,tooltipTitle:C,tooltipPlacement:a?"bottom":"bottom-start",disabled:!a,className:T()(d.starButton,{[d.checkedStarButton]:n},{[d.enabledButton]:a}),size:"M",icon:n?FB():VB(),onClick:h}),b().createElement(Cd.k,{tooltipTitle:i?po().text("Remove Global filter"):po().text("Set as Global filter"),className:T()(d.filterButton,d.enabledButton,{[d.checkedFilterButton]:i}),size:"M",icon:i?zB:YB,onClick:v}),b().createElement("div",{className:d.nameContainer},o?b().createElement(ZB(),{onClickAway:f},b().createElement("div",null,b().createElement(iV.H,{variant:"filled",hiddenLabel:!0,size:"small",fullWidth:!0,autoFocus:!0,classes:{root:d.nameTextEditorRoot},InputProps:{classes:{input:d.nameInput}},value:y,onInput:e=>g(e.target.value),onKeyDown:(0,R.when)((0,R.propEq)("keyCode",13),f)}))):b().createElement(dd.Y,{value:t},b().createElement("div",{className:d.searchName,onClick:x},t))),m&&b().createElement(Cd.k,{tooltipTitle:po().text("Edit"),className:d.editNameButton,size:"M",icon:GB(),onClick:O}))};$B.propTypes={value:hp().string,rowValue:hp().shape({uri:hp().string,isFavorite:hp().bool,isOwnSearch:hp().bool,isEditing:hp().bool,isGlobalFilter:hp().bool}),onStarClick:hp().func,onGlobalClick:hp().func,onApply:hp().func,onChangeName:hp().func,onSetEditing:hp().func};const KB=(0,Md.q)((e=>{let{onChangeIsFavorite:t,onChangeIsGlobal:r,onSearchApply:n,onSetItemEditing:a,onChangeItemName:o}=e;return{onStarClick:t,onGlobalClick:r,onApply:n,onSetEditing:a,onChangeName:o}}))(CB($B)),XB=e=>{let{value:t,rowValue:{uri:r,isOwnSearch:n},onChange:a}=e;const o=TB(),i=(0,E.useCallback)((e=>{const n=uB(e);n!==t&&a(r,n)}),[r,t,a]);return b().createElement("div",{className:o.sharingWrapper},b().createElement(cV.k,{entries:$.m2,value:cB(t),onChange:i,disableUnderline:!0,disabled:!n,MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},elevation:3},TextFieldProps:{classes:{root:o.sharingRoot}},classes:{root:o.sharingInput,menuItem:o.sharingMenuItem,disabled:o.sharingDisabled,icon:T()({[o.sharingIconDisabled]:!n})}}))};XB.propTypes={value:hp().bool,rowValue:hp().shape({uri:hp().string,isOwnSearch:hp().bool}),onChange:hp().func};const QB=(0,Md.q)((e=>{let{onChangeIsPublic:t}=e;return{onChange:t}}))(CB(XB)),JB=e=>{let{value:t,rowValue:r,onClick:n}=e;const a=TB(),o=n?()=>n(r):()=>{};return b().createElement(dd.Y,{value:t},b().createElement("div",{className:T()(a.defaultWrapper,{[a.clickableArea]:n}),onClick:o},t))};JB.propTypes={value:hp().any,rowValue:hp().object,onClick:hp().func};const ez=CB(JB);function tz(){return tz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tz.apply(this,arguments)}const rz=e=>{const{rowValue:{updateDate:t,createDate:r}}=e,n=t||r;return b().createElement(ez,tz({},e,{value:n&&po().date(n,"L")}))};rz.propTypes={rowValue:hp().shape({updateDate:hp().number,createDate:hp().number})};const nz=rz,az=e=>{let{values:t}=e;return(0,R.pipe)((0,R.cond)([[R.isNil,R.T],[Array.isArray,(0,R.pipe)(R.flatten,R.isEmpty)],[R.T,R.isEmpty]]),R.not)(t)},oz=(0,R.curry)(((e,t)=>(0,R.path)(["facetsData",t.fieldName,"values","length"],e)>0)),iz=e=>e&&e.slice(1).join(" / "),lz=(e,t,r)=>(e[t]||(e[t]={title:t,attributes:[]}),e[t].attributes=(0,R.uniq)(e[t].attributes.concat(r)),e),sz=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.flatMap((e=>e.attributes)).filter(az).reduce(((e,t)=>{let{data:{title:r,groupName:n,pathToTitle:a}}=t;const o=iz(a)||r;return lz(e,n,o)}),{})},cz=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e.facetsConfigs||[]).filter((0,R.pipe)(O.isTypeFacet,R.not)).filter(oz(e)).reduce(((e,t)=>{const r=(0,R.path)(["pathToTitle",0],t)||po().text("Special"),n=iz(t.pathToTitle)||t.title;return lz(e,r,n)}),{})},uz=e=>{let{rowValue:{uiState:t}}=e;const r=TB(),n=(0,E.useMemo)((()=>function(){let{facets:e,advanced:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const r=t?sz(t):cz(e);return Object.values(r)}catch(e){return[]}}(t)),[t]),a=(0,E.useMemo)((()=>(e=>e.flatMap((e=>e.attributes)).length)(n)),[n]),o=!!n.length&&b().createElement("div",null,n.map((e=>{let{title:t,attributes:n}=e;return b().createElement("div",{key:t,className:r.tooltipSection},b().createElement("h6",{className:r.tooltipSectionHeader},t),n.map((e=>b().createElement("div",{key:e,className:r.tooltipText},e))))})));return b().createElement("div",{className:r.numberWrapper},(i=a,o?b().createElement(Gg(),{title:o,classes:{tooltip:r.tooltip},disableFocusListener:!0,disableTouchListener:!0},b().createElement("span",null,i)):i));var i};uz.propTypes={rowValue:hp().shape({uiState:hp().shape({facets:hp().object,advanced:hp().array})})};const pz=CB(uz);function dz(){return dz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dz.apply(this,arguments)}const mz=e=>{const t=TB();return b().createElement(PB,dz({className:t.totalHeadCell},e))};mz.propTypes={headCellData:hp().shape({id:hp().string,label:hp().oneOfType([hp().string,hp().node]),sortable:hp().bool,resizable:hp().bool,className:hp().string,initialWidth:hp().number,minWidth:hp().number,autoResize:hp().bool,renderer:hp().func})};const yz=mz;var gz=r(67520),fz=r.n(gz);const hz=e=>{let{value:t}=e;const r=TB();return b().createElement(dd.Y,{value:t},b().createElement("div",{className:r.numberWrapper},po().number(t)))};hz.propTypes={value:hp().number};const Ez=CB(hz),bz=e=>{const t=TB(),{rowValue:{isTotalLoading:r,isOwnSearch:n,uri:a},onDeleteItem:o,onLoadTotalForItem:i,value:l}=e,s=(0,E.useCallback)((()=>{o(a)}),[o,a]),c=n?po().text("Delete"):po().text("Cannot delete because you're not the owner"),u=r?po().text("Loading data"):po().text("Load data"),p=(0,E.useCallback)((()=>{i(a)}),[i,a]),d=r||-1===l;return b().createElement("div",{className:t.totalWithButtonsWrapper},d?b().createElement(Cd.k,{showForDisabled:!0,tooltipTitle:u,tooltipPlacement:"bottom-end",disabled:r,size:"L",icon:fz(),onClick:p}):b().createElement(Ez,e),b().createElement(Cd.k,{showForDisabled:!0,className:t.deleteButton,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:!n,size:"L",icon:zk(),onClick:s}))};bz.propTypes={value:hp().number,rowIndex:hp().number,rowValue:hp().shape({isOwnSearch:hp().bool,isTotalLoading:hp().bool,uri:hp().string}),onDeleteItem:hp().func,onLoadTotalForItem:hp().func};const vz=(0,Md.q)((e=>{let{onDeleteItem:t,onLoadTotalForItem:r}=e;return{onDeleteItem:t,onLoadTotalForItem:r}}))(CB(bz));function Tz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Oz={rowCellValueRenderer:ez,headCellRenderer:PB,autoResize:!1},xz=[{id:"checked",label:"",initialWidth:55,headCellRenderer:xB,rowCellValueRenderer:AB},{id:"name",get label(){return po().text("Name")},autoResize:!0,headCellRenderer:UB,rowCellValueRenderer:KB,sortable:!0},{id:"isPublic",get label(){return po().text("Shared with")},rowCellValueRenderer:QB},{id:"owner",get label(){return po().text("Created by")},initialWidth:260},{id:"updateDate",get label(){return po().text("Last modified")},rowCellValueRenderer:nz,sortable:!0},{id:"attributes",get label(){return po().text("Filtered attributes")},rowCellValueRenderer:pz},{id:"total",get label(){return po().text("Number of profiles")},headCellRenderer:yz,rowCellValueRenderer:vz,initialWidth:194}].map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Tz(e,t,r[t])}))}return e}({},Oz,e)));function Cz(){return Cz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Cz.apply(this,arguments)}function Sz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wz=e=>{let{items:t,total:r,sorting:n,page:a,rowsPerPage:o,loading:i,searchValue:l,globalFilterSavedSearchesUris:s=[],onSearchApply:c,onChangeIsFavorite:u,onChangeIsPublic:p,onChangeIsGlobal:d,onChangeRowsPerPage:m,onChangePage:y,onSelectItem:g,onDeselectAllItems:f,onDeleteItem:h,onChangeItemName:v,onSetItemEditing:T,onLoadTotalForItem:x,onSort:C}=e;const S=EB(),w=(0,E.useMemo)((()=>({cellBorder:S.cellBorder})),[S]),[A,R]=(0,E.useState)(null),[_,I]=(0,E.useState)(null),N=(0,E.useRef)(null);(0,E.useEffect)((()=>f),[f]);const D=(0,E.useCallback)((e=>{s.includes(e)?I(e):h(e)}),[s,h]),P=(0,E.useMemo)((()=>({mode:$.uJ.saved,onSelectItem:g,onChangeIsFavorite:u,onChangeIsGlobal:d,onSearchApply:c,onSetItemEditing:T,onChangeItemName:v,onDeleteItem:D,onLoadTotalForItem:x,onChangeIsPublic:p})),[D,g,u,d,x,c,T,v,p]),k=(0,E.useMemo)((()=>(0,O.isEmptyValue)(l)?{LogoRenderer:zE.SELECT_ATTRIBUTES,text:po().text("No saved searches."),secondaryText:po().text("Save time by creating saved searches for queries you regularly search for.")}:{LogoRenderer:zE.SEARCH_RESULTS,text:po().text("No results found."),secondaryText:po().text("Try adjusting your search or filter to find what you're looking for.")}),[l]),L=(0,E.useMemo)((()=>t.map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Sz(e,t,r[t])}))}return e}({},e,{isGlobalFilter:s.includes(e.uri)})))),[t,s]);return b().createElement("div",{className:S.tableWrapper},r>0?b().createElement(b().Fragment,null,b().createElement(kd.M,{columnsData:xz,rowsData:L,context:P,sorting:n,getRowCellHeight:null,defaultColumnWidth:140,defaultColumnMinWidth:140,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,onSort:C,hoverRowIndex:A,onRowHover:R,classes:w,ref:N}),b().createElement(kE.Z,{classes:{root:S.paginationRoot,caption:S.paginationCaption},count:r,rowsPerPageOptions:$.Tu,rowsPerPage:o,onChangeRowsPerPage:m,page:a,onChangePage:y,basicTableRef:N}),b().createElement(bB.U,{open:!!_,title:po().text("Keep the global filter?"),content:po().text("The saved search you are deleting is being used as a global filter in your tenant. Do you want to keep the global filter?"),discardCaption:po().text("NO, remove it"),saveCaption:po().text("YES, KEEP GLOBAL FILTER"),onCancel:()=>I(null),onDiscard:()=>{d(_,!1),h(_),I(null)},onSave:()=>{h(_),I(null)}})):b().createElement(HE,Cz({},k,{variant:BE.embedded})),i&&b().createElement(YE.Z,null))};wz.propTypes={items:hp().arrayOf(hp().shape({uri:hp().string,name:hp().string,isPublic:hp().bool,isFavorite:hp().bool,isOwnSearch:hp().bool,isEditing:hp().bool,checked:hp().bool,owner:hp().string,updateDate:hp().number,query:hp().string})),total:hp().number,sorting:Ug.nI,page:hp().number,rowsPerPage:hp().number,loading:hp().bool,searchValue:hp().string,globalFilterSavedSearchesUris:hp().arrayOf(hp().string),onSearchApply:hp().func,onChangeIsFavorite:hp().func,onChangeIsPublic:hp().func,onChangeIsGlobal:hp().func,onChangeRowsPerPage:hp().func,onChangePage:hp().func,onSelectItem:hp().func,onDeselectAllItems:hp().func,onDeleteItem:hp().func,onChangeItemName:hp().func,onSetItemEditing:hp().func,onSort:hp().func};const Az=(0,Ep.connect)((e=>({items:(0,Ti.gg)(e),total:(0,Ti.Yi)(e),sorting:(0,Ti.rT)(e),page:(0,Ti.wH)(e),rowsPerPage:(0,Ti.s6)(e),loading:(0,Ti.w7)(e),searchValue:(0,Ti.U3)(e),globalFilterSavedSearchesUris:P().selectors.getGlobalFilterSavedSearchesUris(e)})),{onSearchApply:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$.XU;return{type:Nr,payload:{uri:e,debounceTime:t}}},onChangeIsFavorite:(e,t)=>({type:vr,payload:{uri:e,isFavorite:t}}),onChangeIsPublic:(e,t)=>({type:Er,payload:{uri:e,isPublic:t}}),onChangeIsGlobal:(e,t)=>({type:Or,payload:{uri:e,isGlobalFilter:t}}),onChangeRowsPerPage:e=>({type:mr,payload:e}),onChangePage:e=>({type:dr,payload:e}),onSelectItem:(e,t)=>({type:gr,payload:{uri:e,checked:t}}),onDeselectAllItems:hi,onDeleteItem:e=>({type:Ar,payload:e}),onChangeItemName:(e,t)=>({type:xr,payload:{uri:e,name:t}}),onSetItemEditing:(e,t)=>({type:Sr,payload:{uri:e,isEditing:t}}),onLoadTotalForItem:e=>({type:Pr,payload:e}),onSort:e=>({type:kr,payload:e})})(wz),Rz=e=>{let{value:t=!1,rowValue:{createdDate:r},onClick:n}=e;const a=TB();return b().createElement("div",{className:T()(a.headCell,a.checkbox)},b().createElement(Xp(),{checked:t,onChange:e=>n(r,e.target.checked)}))};Rz.propTypes={value:hp().bool,rowValue:hp().shape({createdDate:hp().number}),onClick:hp().func};const _z=(0,Md.q)((e=>{let{onSelectItem:t}=e;return{onClick:t}}))(CB(Rz));function Iz(){return Iz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Iz.apply(this,arguments)}const Nz=e=>{const{rowValue:{createdDate:t}}=e,r=t;return b().createElement(ez,Iz({},e,{value:r&&po().date(r,"L LT")}))};Nz.propTypes={rowValue:hp().shape({createdDate:hp().number}),onClick:hp().func};const Dz=(0,Md.q)((e=>{let{onSearchApply:t}=e;return{onClick:t}}))(Nz),Pz=e=>{const t=TB(),{rowValue:r,onDeleteItem:n,onLoadTotalForItem:a,value:o}=e,{isTotalLoading:i,createdDate:l}=r,s=(0,E.useCallback)((()=>{n(r)}),[n,r]),c=i?po().text("Loading data"):po().text("Load data"),u=(0,E.useCallback)((()=>{a(l)}),[a,l]),p=i||-1===o;return b().createElement("div",{className:t.totalWithButtonsWrapper},p?b().createElement(Cd.k,{showForDisabled:!0,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:i,size:"L",icon:fz(),onClick:u}):b().createElement(Ez,e),b().createElement(Cd.k,{className:t.deleteButton,tooltipTitle:po().text("Delete"),tooltipPlacement:"bottom-end",size:"L",icon:zk(),onClick:s}))};Pz.propTypes={value:hp().number,rowValue:hp().shape({isTotalLoading:hp().bool,createdDate:hp().number}),onDeleteItem:hp().func,onLoadTotalForItem:hp().func};const kz=(0,Md.q)((e=>{let{onDeleteItem:t,onLoadTotalForItem:r}=e;return{onDeleteItem:t,onLoadTotalForItem:r}}))(CB(Pz)),Lz=(0,Md.q)((e=>{let{onSearchApply:t}=e;return{onClick:t}}))(ez);function Uz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jz={rowCellValueRenderer:ez,headCellRenderer:PB,autoResize:!1},Fz=[{id:"checked",label:"",initialWidth:55,headCellRenderer:xB,rowCellValueRenderer:_z},{id:"createdDate",get label(){return po().text("Created")},rowCellValueRenderer:Dz,initialWidth:256},{id:"name",get label(){return po().text("Query")},autoResize:!0,rowCellValueRenderer:Lz,minWidth:150},{id:"total",get label(){return po().text("Record count")},rowCellValueRenderer:kz,headCellRenderer:yz,initialWidth:150}].map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Uz(e,t,r[t])}))}return e}({},jz,e)));function Mz(){return Mz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mz.apply(this,arguments)}const Vz=e=>{let{items:t,loading:r,filterWord:n,onSelectItem:a,onDeselectAllItems:o,onSearchApply:i,onDeleteItem:l,onLoadTotalForItem:s}=e;const c=EB(),u=(0,E.useMemo)((()=>({cellBorder:c.cellBorder})),[c]),[p,d]=(0,E.useState)(null);(0,E.useEffect)((()=>o),[o]);const m=(0,E.useMemo)((()=>({mode:$.uJ.recent,onSelectItem:a,onSearchApply:i,onDeleteItem:l,onLoadTotalForItem:s})),[l,s,a,i]),y=(0,E.useMemo)((()=>(0,O.isEmptyValue)(n)?{LogoRenderer:zE.SELECT_ATTRIBUTES,text:po().text("No recent searches."),secondaryText:po().text("Your recent search history will appear here.")}:{LogoRenderer:zE.SEARCH_RESULTS,text:po().text("No results found."),secondaryText:po().text("Try adjusting your search or filter to find what you're looking for.")}),[n]);return b().createElement("div",{className:c.tableWrapper},t.length>0?b().createElement(kd.M,{columnsData:Fz,rowsData:t,context:m,getRowCellHeight:null,defaultColumnWidth:50,defaultColumnMinWidth:50,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,hoverRowIndex:p,onRowHover:d,classes:u}):b().createElement(HE,Mz({},y,{variant:BE.embedded})),r&&b().createElement(YE.Z,null))};Vz.propTypes={items:hp().arrayOf(hp().shape({uri:hp().string,name:hp().string,isPublic:hp().bool,isFavorite:hp().bool,isOwnSearch:hp().bool,checked:hp().bool,owner:hp().string,createdDate:hp().number,query:hp().string})),loading:hp().bool,filterWord:hp().string,onSelectItem:hp().func,onSearchApply:hp().func,onDeselectAllItems:hp().func,onDeleteItem:hp().func};const Bz=(0,Ep.connect)((e=>({items:Ps(e),loading:ks(e),filterWord:Ns(e)})),{onSearchApply:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$.XU;return{type:Kr,payload:{search:e,debounceTime:t}}},onSelectItem:(e,t)=>({type:Mr,payload:{searchCreatedDate:e,checked:t}}),onDeselectAllItems:xs,onDeleteItem:e=>({type:Yr,payload:e}),onLoadTotalForItem:e=>({type:$r,payload:e})})(Vz),zz=e=>{let{open:t,onClose:r}=e;const n=ZV(),a=(0,Ep.useDispatch)(),o=(0,E.useMemo)((()=>[{value:$.uJ.saved,label:po().text("Saved searches"),content:b().createElement(Az,null),dataReltioId:"reltio-search-saved-searches"},{value:$.uJ.recent,label:po().text("Recent searches"),content:b().createElement(Bz,null),dataReltioId:"reltio-search-recent-searches"}]),[]),[i,l]=(0,E.useState)(o[0].value);return(0,E.useEffect)((()=>{t&&(i===$.uJ.saved?a({type:sr}):a({type:Ur}))}),[t,a,i]),b().createElement(Sj(),{classes:{paper:n.dialogPaper},fullWidth:!0,maxWidth:"lg",open:t,onClose:r},b().createElement(fB,{type:i,onClose:r}),b().createElement(sF(),{classes:{root:n.contentRoot}},b().createElement("div",{className:n.tabsWrapper},b().createElement(kI,{value:i,tabs:o,onChange:l,scrollButtons:"auto"})),b().createElement("div",{className:n.tabContent},o.find((0,R.propEq)("value",i)).content)))};zz.propTypes={open:hp().bool,onClose:hp().func};const Hz=zz,Yz=(0,Op.Z)((()=>({button:{display:"flex",alignItems:"center",whiteSpace:"nowrap",borderColor:"rgba(0, 0, 0, 0.12)"},buttonText:{letterSpacing:0},compact:{paddingTop:"2px",paddingBottom:"2px",marginRight:"-8px",marginLeft:"4px"}}))),Wz=e=>{let{showTypography:t}=e;const r=Yz(),n=(0,Ep.useDispatch)(),a=(0,Ep.useSelector)(Po.tm),o=po().text("Saved & recent searches"),i=(0,E.useCallback)((()=>n(vo(!0))),[n]),l=(0,E.useCallback)((()=>n(vo(!1))),[n]);return b().createElement(b().Fragment,null,b().createElement(Gg(),{title:t?"":o},b().createElement(dE(),{className:r.button,variant:"outlined",startIcon:b().createElement(qV(),{className:T()({[r.compact]:!t}),color:"action"}),onClick:i,"data-reltio-id":"reltio-search-saved-and-recent-search"},t&&b().createElement(Ay(),{variant:"button",color:"textPrimary",className:r.buttonText},o))),b().createElement(Hz,{open:a,onClose:l}))},Gz=(0,Op.Z)((()=>({container:{display:"flex",flexDirection:"column",position:"relative",paddingLeft:"16px",paddingRight:"20px"},header:{height:"63px",display:"flex",alignItems:"center"},captionWrapper:{marginTop:"-2px",paddingLeft:"8px",flexShrink:0},profileText:{paddingLeft:"8px",color:"rgba(0,0,0,0.6)"},profileNumber:{fontWeight:600},facetsBar:{display:"flex",alignItems:"center",flexGrow:1,marginBottom:"12px",marginTop:"-8px"},showBar:{display:"flex",overflow:"hidden"},clearButton:{marginRight:"auto",marginLeft:"14px"},splitter:{marginRight:"15px",marginLeft:"1px",height:"32px"},searchBarControls:{display:"flex",alignItems:"center",width:"100%",justifyContent:"flex-end"}}))),qz="search",Zz="geoLocation",$z={},Kz=()=>{const e=Gz(),t=(0,Ep.useDispatch)(),r=(0,Ep.useSelector)(N.Mp),n=(0,Ep.useSelector)(N.X0),a=(0,Ep.useSelector)(so.Qw)||$z,o=(0,Ep.useSelector)(P().selectors.getSearchKeyword),i=(0,Ep.useSelector)(P().selectors.getDateMask),l=(0,Ep.useSelector)(P().selectors.getDateTimeMask),s=(0,Ep.useSelector)(P().selectors.getAttributesPresentation)||$z,c=(0,Ep.useSelector)(Po.IJ),u=(0,Ep.useSelector)((e=>(0,so.NU)(e,{entityTypeUri:void 0}))),p=(0,Ep.useSelector)(ti.go),d=(0,E.useContext)(QM._),[m,y]=(0,E.useState)([]),[g,f]=(0,E.useState)(0),[h,v]=(0,E.useState)(!1),T=(0,E.useRef)(null),[x,C]=(0,E.useState)(!0);(0,E.useEffect)((()=>{y(S())}),[r,n,a,o]),(0,E.useEffect)((()=>{f(m.length),v(!0)}),[m]),(0,E.useEffect)((()=>{if(h){const e=_();f(e),v(!1)}}),[h,n]);const S=(0,E.useCallback)((()=>{const e=Object.values((0,Va.t8)(n,r)).filter((e=>e.values&&e.values.length)).map((e=>{const t=e.title||e.hiddenTitle,r=(0,Va.MI)([...e.data||[],...e.filteredData||[]],(0,R.path)(["attrType","type"],e)===O.DataTypes.TYPE_DATE?e.values.map((e=>e.map((e=>O.utils.dates.toLocalDate(e).getTime())))):e.values.map((0,O.mapFilterValue)((0,O.applyPresentationStrategyToValue)((e=>(0,O.getNumberFormat)((0,O.getAttrDataTypeDefinition)(e.attrType),s,O.intl.getLocale()).strategy)(e)))),e.type,{dateMask:i,dateTimeMask:l});return{fieldName:e.fieldName,title:t,values:r}}));o&&e.push({fieldName:qz,title:po().text("Search"),values:[o.value]});const{values:[t]=[],type:c}=(0,R.pathOr)({},["mapSearch"],a);return t&&e.push({fieldName:Zz,values:(0,O.getMapSearchValues)(c,t),title:(0,O.getMapSearchLabel)(c)}),e}),[r,n,a,o,s,i,l]),w=(0,E.useCallback)((()=>{f(m.length),v(!0)}),[m]),A=(0,E.useCallback)((e=>{C(e>=410)}),[]),_=(0,E.useCallback)((()=>{if(!T.current)return 0;const{firstChild:e,offsetLeft:t,offsetWidth:r}=T.current,n=t+r;return([...e.childNodes]||[]).filter((a=n,e=>e.offsetLeft+e.offsetWidth<=a)).length;var a}),[T]),I=(0,E.useCallback)((e=>r=>{switch(r.stopPropagation(),e){case qz:t(D.search.actions.keywordUpdated(null));break;case Zz:t(eo(null));break;default:t(no(e,[]))}}),[t]),k=(0,E.useCallback)((()=>{t(Ka({silent:!0})),t(D.search.actions.keywordUpdated({debounceTime:$.XU}))}),[t]),L=(0,E.useMemo)((()=>m.map((e=>b().createElement(tV,{key:e.fieldName,title:e.title,values:e.values,onDelete:I(e.fieldName)})))),[m,I]),U=L.slice(0,g),j=L.slice(g),F=(0,R.when)((0,R.propEq)("length",1),(0,R.reject)(O.isEmptySearchGroup))(p),M=0===L.length&&0===F.length;return b().createElement("div",{className:e.container,"data-reltio-id":"search-bar"},b().createElement("div",{className:e.header},b().createElement("div",{className:e.captionWrapper,"data-reltio-id":"search-bar-total-profiles"},b().createElement(Ay(),{component:"span",classes:{body1:e.profileNumber}},po().number(u,"0,0")),b().createElement(Ay(),{variant:"body2",component:"span",classes:{root:e.profileText}},po().text("total profiles"))),b().createElement(WV,null),b().createElement(HV,null),b().createElement(dE(),{color:"primary",className:e.clearButton,onClick:k,disabled:M,"data-reltio-id":"reltio-search-clear"},po().text("clear")),!d&&b().createElement("div",{className:e.searchBarControls,"data-reltio-id":"search-bar-controls"},b().createElement(zp.Z,{handleWidth:!0,onResize:A}),b().createElement(VV,null),b().createElement(sh(),{orientation:"vertical",className:e.splitter}),b().createElement(Wz,{showTypography:x}))),b().createElement(zp.Z,{handleWidth:!0,onResize:w}),b().createElement(XM(),{in:!c&&g>0,timeout:500},b().createElement("div",{ref:T,className:e.facetsBar,"data-reltio-id":"search-facets-bar"},b().createElement("div",{className:e.showBar},U),j.length>0&&b().createElement(nV,{items:j}))))},Xz=(0,Op.Z)({title:{flexGrow:1},collapseIcon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"collapseIcon--inverted":{transform:"rotate(-180deg)"},backButtonContainer:{margin:"12px"},collapseButton:{padding:"8px",marginRight:"12px"},toolBar:{minHeight:0,flexShrink:1,overflow:"hidden"}}),Qz=e=>{let{onBackBtnClick:t}=e;const r=Xz();return b().createElement(dF(),{disableGutters:!0,classes:{root:r.toolBar}},b().createElement(Cd.k,{tooltipTitle:po().text("Switch to basic mode"),size:"L",icon:HI(),className:r.backButtonContainer,onClick:t}),b().createElement(Ay(),{variant:"subtitle1",className:r.title},po().text("Advanced search")))};Qz.propTypes={onBackBtnClick:hp().func};const Jz=Qz,eH=(0,Op.Z)({resultQueryPanel:{background:"#E3E7E9",display:"flex",flex:"0 0 auto",alignItems:"center"},resultQuery:{flexGrow:1,padding:"10px 10px 10px 24px",fontSize:"12px",lineHeight:"16px",color:"rgba(0,0,0,0.38)"},queryContainer:{height:"auto",maxHeight:"48px",paddingRight:"24px",paddingTop:"4px",overflow:"auto"},queryContainerMinHeight:{maxHeight:"18px"},query:{cursor:"pointer"},noQuery:{color:"#000000"},actionsPanel:{display:"flex",paddingRight:"12px"},collapseButton:{marginRight:"-4px"}}),tH=(0,Op.Z)((e=>({query:{color:e.palette.text.secondary,fontSize:"12px",letterSpacing:0,lineHeight:"16px"},[O.READABLE_QUERY_PRIMITIVE_TYPES.entityTypeLabel]:{color:"#03904A"},[O.READABLE_QUERY_PRIMITIVE_TYPES.attributeLabel]:{color:"#059BEA"},[O.READABLE_QUERY_PRIMITIVE_TYPES.specialAttributeLabel]:{color:"#EA05CF"},[O.READABLE_QUERY_PRIMITIVE_TYPES.attributeFilter]:{color:"#7F00FF"},[O.READABLE_QUERY_PRIMITIVE_TYPES.attributeValue]:{color:"#000000"}})));function rH(){return rH=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rH.apply(this,arguments)}const nH=(0,E.forwardRef)(((e,t)=>{let{readableQuery:r=[],className:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["readableQuery","className"]);const o=tH();return b().createElement("span",rH({ref:t,className:T()(o.query,n),"data-reltio-id":"search-readable-query"},a),r.map(((e,t)=>{let{type:r,text:n}=e;return b().createElement("span",{key:t,className:o[r]},n)})))}));nH.displayName="ReadableSearchQuery";const aH=nH;var oH=r(82466),iH=r.n(oH);const lH=(0,Op.Z)({collapseIcon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"collapseIcon--inverted":{transform:"rotate(-180deg)"}});function sH(){return sH=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sH.apply(this,arguments)}const cH=e=>{let{collapseBtnActive:t,onCollapseBtnClick:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["collapseBtnActive","onCollapseBtnClick"]);const a=lH();return b().createElement(Cd.k,sH({size:"L",icon:iH(),tooltipTitle:t?po().text("Collapse panel"):po().text("Expand panel"),onClick:r,iconClassName:T()(a.collapseIcon,{[a["collapseIcon--inverted"]]:!t}),"data-reltio-id":"reltio-search-advanced-search-collapse-panel"},n))};cH.propTypes={backBtnDisabled:hp().bool,onBackBtnClick:hp().func,collapseBtnActive:hp().bool,onCollapseBtnClick:hp().func};const uH=cH;var pH=r(89808),dH=r.n(pH),mH=r(19820),yH=r.n(mH);function gH(){return gH=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gH.apply(this,arguments)}const fH=e=>{let{isFullscreen:t=!1,onClick:r=R.identity}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isFullscreen","onClick"]);return b().createElement(Cd.k,gH({size:"L",icon:t?yH():dH(),tooltipTitle:t?po().text("Exit full screen"):po().text("Full screen"),onClick:r,"data-reltio-id":"reltio-search-advanced-search-full-screen"},n))};fH.propTypes={isFullscreen:hp().bool,onClick:hp().func};const hH=fH,EH=e=>{let{groups:t,hasMinSize:r,lookups:n,metadata:a,attributesPresentation:o,collapseBtnActive:i,isFullscreen:l,onCollapseBtnClick:s,onFullScreenBtnClick:c,keyword:u,map:p,dispatch:d}=e;const m=eH(),[y,g]=(0,E.useState)(0),[f,h]=(0,E.useState)(0),v=(0,E.useMemo)((()=>(0,Ma.Jk)((0,ht.P0)(a,t))),[a,t]),x=(0,O.buildReadableQuery)(a,o,n,t,u,p),C=po().text("Copy to clipboard"),[S,w]=(0,E.useState)(C),A=(0,E.useCallback)((0,O.debounce)((()=>{d({type:gt})}),500),[d]),R=(0,E.useCallback)((()=>{PV((0,O.buildReadableQueryToString)(a,o,n,t,u,p)).then((()=>w(po().text("Query was copied")))).catch((()=>w(po().text("Error"))))}),[t,o,n,a,u,p]),_=(0,E.useCallback)((()=>{w(C)}),[C]),I=(0,E.useCallback)((e=>{g(e.clientX),h(e.clientY)}),[]);(0,NE.D)(A,[A,v]);const N=(0,E.useMemo)((()=>({anchorEl:{clientWidth:1,clientHeight:1,getBoundingClientRect:()=>({left:y,bottom:f,height:1,right:y,width:1,top:f})}})),[y,f]);return b().createElement("div",{className:m.resultQueryPanel},b().createElement("div",{className:m.resultQuery},po().text("Search query"),b().createElement("div",{className:T()(m.queryContainer,{[m.queryContainerMinHeight]:r})},x.length>0?b().createElement(Gg(),{key:S,title:S,onClose:_,PopperProps:N},b().createElement(aH,{readableQuery:x,onMouseEnter:I,onClick:R,className:m.query})):b().createElement("span",{className:m.noQuery},po().text("Build your search and view your search query here")))),b().createElement("div",{className:m.actionsPanel},b().createElement(uH,{collapseBtnActive:i,onCollapseBtnClick:s,className:m.collapseButton}),b().createElement(hH,{isFullscreen:l,onClick:c})))};EH.propTypes={groups:hp().arrayOf(hp().shape({id:hp().string,attributes:hp().arrayOf(hp().shape({values:hp().array,data:hp().object,filter:hp().string,operator:hp().string})),operator:hp().string})),lookups:hp().object,hasMinSize:hp().bool,attributesPresentation:hp().object,collapseBtnActive:hp().bool,isFullscreen:hp().bool,onCollapseBtnClick:hp().func,onFullScreenBtnClick:hp().func,metadata:O.MetadataType,keyword:O.KeywordSearchType,map:Fg,dispatch:hp().func};const bH=EH,vH={position:"absolute",width:1,background:"rgba(43, 152, 240, 0.3)",height:16,left:36};function TH(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){OH(e,t,r[t])}))}return e}function OH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xH=(0,Op.Z)((e=>({container:{backgroundColor:e.palette.background.default,transition:"flex-grow 0.35s ease",flexGrow:1,flexBasis:0,overflow:"hidden",display:"flex",flexDirection:"column"},button:{paddingLeft:23,fontSize:"14px",position:"relative"},scrollWrapper:{overflow:"auto",flex:"1 0 0px",padding:"0 60px"},groupsContainer:{margin:"0 auto",width:"100%",maxWidth:"1280px"},apply:{background:e.palette.background.default,textAlign:"right",padding:"15px 45px"},icon:{height:18,width:18,marginRight:"9px"},verticalOperatorLine:TH({},vH),upperLine:{marginTop:-18},searchByOvContainer:{marginLeft:-6,marginBottom:-14}})));var CH=r(28345),SH=r.n(CH);const wH="46px",AH=(0,Op.Z)((e=>({readOnlyLogicOperatorContainer:{display:"flex",alignItems:"center",marginRight:"40px",width:"76px",fontSize:"14px",color:e.palette.text.secondary,maxHeight:wH},readOnlyFilter:{display:"flex",alignItems:"center",fontSize:"14px",color:e.palette.text.secondary,width:"50px",marginLeft:"12px",maxHeight:wH}})));var RH=r(68157);const _H=e=>{let{className:t,rowData:r}=e;const n=AH();return b().createElement("div",{className:T()(n.readOnlyLogicOperatorContainer,t)},r&&r.operator?(0,RH.capitalize)(r.operator):po().text("Where"))};_H.propTypes={className:hp().string,rowData:hp().object};const IH=_H,NH=e=>{let{className:t,rowData:r}=e;const n=AH();return b().createElement("div",{className:T()(n.readOnlyFilter,t)},r&&r.filter?(0,O.getFilterOptionLabel)(r.filter):po().text("equals"))},DH=(0,Op.Z)((()=>({row:{display:"flex",marginBottom:"12px"},rowItem:{paddingRight:"10px",display:"flex"},fullWidth:{flexGrow:"1",flexBasis:"0",overflow:"hidden"},hidden:{visibility:"hidden"}})));const PH=e=>{let{classes:t={},rowData:r,previousRowData:n,LogicOperatorComponent:a=IH,AttributeSelectorComponent:o,FilterSelectorComponent:i=NH,ValuesEditorComponent:l,ActionsComponent:s,filterSelectorRef:c,attributeSelectorProps:u={}}=e,p=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes","rowData","previousRowData","LogicOperatorComponent","AttributeSelectorComponent","FilterSelectorComponent","ValuesEditorComponent","ActionsComponent","filterSelectorRef","attributeSelectorProps"]);const d=DH();return b().createElement("div",{className:T()(d.row,t.root),"data-reltio-id":"query-builder-row"},b().createElement(a,{className:t.logicOperatorContainer,rowContext:p,rowData:n}),b().createElement("div",{className:T()(d.rowItem,t.attributeSelectorContainer)},b().createElement(o,{attributeSelectorProps:u,rowContext:p,rowData:r})),b().createElement("div",{className:T()(d.rowItem,t.filterSelectorContainer)},b().createElement(i,{textFieldInputRef:c,rowContext:p,rowData:r})),b().createElement("div",{className:T()(d.rowItem,d.fullWidth,t.valuesEditorContainer)},b().createElement(l,{rowContext:p,rowData:r})),b().createElement("div",{className:T()(d.rowItem,t.actionsContainer,{[d.hidden]:!r})},b().createElement(s,{rowContext:p,rowData:r})))};PH.propTypes={classes:hp().shape({root:hp().string,logicOperatorContainer:hp().string,attributeSelectorContainer:hp().string,filterSelectorContainer:hp().string,valuesEditorContainer:hp().string,actionsContainer:hp().string}),rowData:Ug.Xw,previousRowData:Ug.Xw,LogicOperatorComponent:hp().elementType,AttributeSelectorComponent:hp().elementType,FilterSelectorComponent:hp().elementType,ValuesEditorComponent:hp().elementType,ActionsComponent:hp().elementType,filterSelectorRef:hp().object,attributeSelectorProps:hp().shape({onRestoreFocus:hp().func,onOpen:hp().func,disablePopoverRestoreFocus:hp().bool})};const kH=(0,E.memo)(PH);function LH(){return LH=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},LH.apply(this,arguments)}const UH=e=>{let{className:t,rowClasses:r,rowsData:n,lastRowAttributeSelectorProps:a,filterSelectorRef:o,filterSelectorRefIndex:i}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","rowClasses","rowsData","lastRowAttributeSelectorProps","filterSelectorRef","filterSelectorRefIndex"]);const s=(e,t,n)=>{const s=t>0?(0,R.path)([t-1],n):null,c=t===n.length?{attributeSelectorProps:a}:{};return b().createElement(kH,LH({key:e&&e.id,rowData:e,previousRowData:s,classes:r,filterSelectorRef:t===i?o:void 0},l,c))};return b().createElement("div",{className:t},n.map(s),s(null,n.length,n))};UH.propTypes={className:hp().string,rowClasses:hp().shape({root:hp().string,logicOperatorContainer:hp().string,attributeSelectorContainer:hp().string,filterSelectorContainer:hp().string,valuesEditorContainer:hp().string,actionsContainer:hp().string}),rowsData:hp().arrayOf(Ug.Xw),LogicOperatorComponent:hp().elementType,AttributeSelectorComponent:hp().elementType,FilterSelectorComponent:hp().elementType,ValuesEditorComponent:hp().elementType,ActionsComponent:hp().elementType,filterSelectorRef:hp().object,filterSelectorRefIndex:hp().number,lastRowAttributeSelectorProps:hp().shape({onRestoreFocus:hp().func,onOpen:hp().func,disablePopoverRestoreFocus:hp().bool})};const jH=(0,E.memo)(UH),FH=(0,Op.Z)((()=>({select:{padding:"6px 16px 7px"},dropDown:{width:"100px","&:before":{content:"none !important"}}})));function MH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const VH=e=>{let{className:t,value:r,onChange:n}=e;const a=FH(),o=O.operatorOptions.map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){MH(e,t,r[t])}))}return e}({},e,{label:po().text(e.label)})));return b().createElement(cV.k,{className:T()(a.dropDown,t),classes:a,value:r,entries:o,onChange:n})};function BH(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zH(e,t,r[t])}))}return e}function zH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const HH=(0,Op.Z)((e=>({title:{},rows:{},actions:{},container:{backgroundColor:e.palette.background.paper,padding:"18px 16px 0",position:"relative",margin:"16px 0 19px","& $title":{color:e.palette.text.hint,fontSize:12,marginBottom:20},"& $rows":{display:"flex",flexDirection:"column"},"& $actions":{position:"absolute",top:16,right:16,paddingTop:0},"&:after, &:before":{content:"",width:1,height:16,position:"absolute",top:"100%",left:35,background:"rgba(43, 152, 240, .3)"},"&:before":{top:"initial",bottom:"100%"},"&:first-child":{marginTop:0,"&:before":{content:"none"}}},entityTypeSelector:{width:"394px",height:"46px"},entityTypeSelectorContainer:{marginBottom:"20px"},logicOperator:{position:"relative",paddingLeft:16,"&:before":{}},verticalOperatorLine:BH({},vH),upperLine:{marginTop:-18},lowerLine:{marginBottom:-16,bottom:0}}))),YH="46px",WH=(0,Op.Z)((e=>({row:{marginBottom:"20px","&:hover $actions":{opacity:1}},logicOperatorContainer:{marginTop:"7px",marginRight:"40px",width:"100px"},logicOperator:{fontSize:"14px",color:e.palette.text.secondary},logicOperatorPlaceholder:{paddingLeft:"16px",paddingTop:"10px"},attributeSelect:{width:"254px",height:YH},filterSelect:{width:"190px"},valuesWrapper:{width:"100%",display:"flex",minHeight:YH,alignItems:"flex-start",boxSizing:"border-box"},actions:{opacity:"0",transition:"opacity 0.3s",paddingTop:"13px",width:"88px",height:"24px",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:"0",marginLeft:"8px","& >span":{cursor:"pointer",display:"flex"},"& $actionIcon":{cursor:"pointer",color:"rgba(0, 0, 0, .54)"}},actionIcon:{}}))),GH=(0,Op.Z)({listLabelContainer:{display:"flex",alignItems:"center",position:"relative",overflow:"hidden",whiteSpace:"nowrap",justifyContent:"space-between",height:"100%",width:"100%"},listLabel:{visibility:"hidden",position:"absolute",overflow:"hidden"},visibleItemsLabel:{textOverflow:"ellipsis",marginRight:"5px",overflow:"hidden",flex:1,flexBasis:"auto"},hiddenCount:{color:"rgba(0,0,0,0.87)",fontSize:"13px",lineHeight:"15px",padding:"5px 8px",borderRadius:"16px",backgroundColor:"rgba(0,0,0,.12)"}}),qH=(e,t)=>{const{childNodes:r,clientLeft:n,clientWidth:a}=t;if(r.length>0){const[t]=Array.from(r),o=document.createRange();o.setStart(t,0);for(let r=0;r<e.length;r++){o.setEnd(t,o.endOffset+e[r].length);const{width:i}=o.getBoundingClientRect();if(n+i>a)return r;r!==e.length-1&&o.setEnd(t,o.endOffset+", ".length)}}return-1},ZH=e=>e.join(", "),$H=e=>`calc(${(0,R.isNil)(e)?"100%":`${e}px`} - 35px)`,KH=e=>{let{list:t,maxWidth:r}=e;const n=GH(),a=(0,E.useRef)(),[o,i]=(0,E.useState)(0);(0,E.useEffect)((()=>{i(((e,t)=>{const r=e.length,n=((e,t)=>{if(t){const r=qH(e,t);return-1===r?0:e.length-r}return 0})(e,t);return r-Math.max(1,r-n)})(t,a.current))}),[t]);const l=ZH(t),s=o>0,c=s?ZH(t.slice(0,-o)):l;return b().createElement(Gg(),{title:s?l:""},b().createElement("div",{className:n.listLabelContainer},b().createElement("div",{style:{width:$H(r)},className:n.listLabel,ref:a},l),b().createElement("div",{className:n.visibleItemsLabel},c),s&&b().createElement("div",{className:n.hiddenCount},`+${o}`)))};function XH(){return XH=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},XH.apply(this,arguments)}const QH=(0,R.always)(32),JH=(0,E.memo)((e=>{let{selectedItems:t,onItemClick:r,focusIndex:n,width:a,height:o}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedItems","onItemClick","focusIndex","width","height"]);return b().createElement(Gp,XH({getItemSize:QH,renderItem:(e,a,o)=>{let{item:i}=a;const l=!!t.find((e=>i.uri===e)),s=o===n;return b().createElement(hd,{key:i.uri,onClick:r,checked:l,data:i,label:b().createElement(Ed.o,{text:i.label,highlight:i.filterText}),labelInText:i.label,style:e,isFocused:s,hideIcon:!0,LogoIcon:i.LogoIcon})},focusIndex:n,fixedTitle:!1,disableHorizontalScrollbar:!0,width:a,height:o},i))}));JH.displayName="SelectMetadataTypesList";const eY=(0,Op.Z)({root:{borderRadius:"4px 4px 0 0",margin:0,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},inputLabel:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%",cursor:"pointer",top:"calc(50% - 23px)"},inputText:{display:"flex",flexGrow:1,alignItems:"center",height:"25px",width:"calc(100% - 53px)",paddingTop:"18px",paddingBottom:"4px",color:"rgba(0,0,0,0.87)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},input:{width:0,cursor:"pointer","&.Mui-disabled":{backgroundColor:"transparent",cursor:"default"},"&$emptyInput":{width:"100%"}},emptyInput:{},disabledInput:{},disabledPointer:{},disabledUnderline:{},inputRoot:{flex:1,paddingRight:"4px",fontSize:"14px",letterSpacing:0,lineHeight:"16px",cursor:"pointer","&$disabledInput":{backgroundColor:"rgba(0, 0, 0, 0.03)",cursor:"pointer","&$disabledPointer":{cursor:"default"},"&$disabledUnderline::before":{borderBottomStyle:"solid"}}},icon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"popup-opened-icon":{transform:"rotate(-180deg)"}});function tY(){return tY=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tY.apply(this,arguments)}function rY(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){nY(e,t,r[t])}))}return e}function nY(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const aY=(0,E.memo)((e=>{let{placeholder:t,classes:r={},items:n,selectedItemsUris:a,onChange:o,ListLabelProps:i={},disabled:l,enableEmptyValueUnderline:s,single:c,label:u,dataReltioId:p,selectionPopupTitle:d}=e;const m=eY(),[y,g]=(0,E.useState)(!1),f=(0,E.useCallback)((()=>g(!0)),[]),h=(0,E.useCallback)((()=>g(!1)),[]),[v,x]=(0,E.useState)(""),C=(0,E.useCallback)((()=>x("")),[]),S=(0,E.useCallback)((0,R.pipe)(C,h),[h,C]),w=n.filter((e=>{let{label:t}=e;return O.utils.strings.search(t,v)})).map(((e,t)=>({item:{item:rY({},e,{filterText:v})},index:t}))),A=(0,E.useMemo)((()=>(0,R.pipe)((0,R.map)((e=>n.find((0,R.propEq)("uri",e)))),(0,R.reject)(R.isNil),(0,R.pluck)("label"))(a)),[a,n]),_=(0,E.useCallback)(((e,t)=>{c?(o(t?[e.uri]:[]),S()):o(t?a.concat(e.uri):a.filter((t=>t!==e.uri)))}),[a,o,c,S]),I=(0,E.useCallback)((e=>{let{item:t}=e;const r=!a.includes(t.uri);_(t,r)}),[a,_]),{focusIndex:N,handleKeyDown:D}=qp({items:w,open:y,onSelectFocusedItem:I,selectedItems:a,onClose:S}),P=(0,E.useRef)(),k=P.current?P.current.getBoundingClientRect().width:0,L=Math.max(k,255),U=0===a.length;return b().createElement(b().Fragment,null,b().createElement(DV(),{label:u,ref:P,InputProps:{startAdornment:U&&!t?null:b().createElement("div",{className:T()(m.inputText,r.inputText)},U?b().createElement("div",null,t):b().createElement(KH,tY({},i,{list:A}))),classes:{root:m.inputRoot,input:T()(m.input,r.input,{[m.emptyInput]:U&&!t}),disabled:T()(m.disabledInput,{[m.disabledPointer]:l}),underline:m.disabledUnderline},endAdornment:b().createElement(Dp.T,{size:"L",icon:My(),iconClassName:T()(m.icon,{[m["popup-opened-icon"]]:y}),disabled:l}),readOnly:!0,disableUnderline:U&&!s},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:T()(m.inputLabel,r.label)}},value:"",onClick:l?void 0:f,classes:{root:T()(m.root,r.root)},size:"small",variant:"filled",disabled:l,"data-reltio-id":p}),b().createElement(Mp,{open:y,anchorEl:P.current,onClose:S,onSearch:x,title:d,containerWidth:L,containerHeight:355,searchInputOnKeyDown:D,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":`${p}-popup`}},b().createElement(JH,{items:w,onItemClick:_,selectedItems:a,width:L,height:245,focusIndex:N})))}));aY.displayName="MetadataTypesSelector";const oY=(0,E.memo)((e=>{let{entityTypes:t,selectedEntityTypes:r,single:n,placeholder:a,enableEmptyValueUnderline:o,onChange:i,classes:l={},ListLabelProps:s={},disabled:c=!1}=e;const u=(0,E.useMemo)((()=>t.filter(O.isAvailableEntityType)),[t]);return b().createElement(aY,{items:u,selectedItemsUris:r,single:n,placeholder:a,enableEmptyValueUnderline:o,onChange:i,classes:l,ListLabelProps:s,disabled:c,label:po().text("Entity type"),dataReltioId:"entity-type-selector",selectionPopupTitle:po().text("Select entity types")})}));oY.displayName="EntityTypesSelector";const iY=e=>{let{selectedEntityTypes:t,onChange:r,classes:n={},ListLabelProps:a={}}=e;const o=(0,Ep.useSelector)(P().selectors.getMetadata),i=(0,Ep.useSelector)(so.t9),l=(0,Ep.useSelector)(Po.Xf),s=(0,E.useCallback)(l?e=>{let{uri:t}=e;return l.includes(t)}:R.identity,[l]),c=(0,E.useMemo)((()=>o.entityTypes.filter(s).sort(l?(0,O.orderByArrayComparator)(l,"uri"):e=>0).filter((e=>{let{uri:t}=e;return(0,O.isAvailableEntityTypeForDataTenant)(i,t)}))),[o,i,s,l]);return b().createElement(oY,{classes:n,entityTypes:c,onChange:r,selectedEntityTypes:t,ListLabelProps:a,placeholder:po().text("All"),enableEmptyValueUnderline:!0})};iY.propTypes={selectedEntityTypes:hp().arrayOf(hp().string).isRequired,onChange:hp().func.isRequired,classes:hp().shape({root:hp().string,label:hp().string}),ListLabelProps:hp().shape({maxWidth:hp().number})};const lY=iY,sY=(0,Op.Z)({attribute:{cursor:"pointer",lineHeight:"16px",flexBasis:"100%",display:"flex",alignItems:"center",padding:"0 10px 0 16px",width:"calc(100% - 32px)","&$attributeWithValue":{borderBottom:"1px solid rgba(0,0,0,0.38)"},"&$disabled":{cursor:"default"}},disabled:{},attributeWithValue:{},noSelect:{},name:{fontSize:"14px",color:"rgba(0,0,0,0.87)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",direction:"rtl",textAlign:"left",flex:"1 0",width:"0","& $noSelect":{color:"rgba(0,0,0,0.38)"},"&$disabled":{color:"rgba(0,0,0,0.26)","& $noSelect":{color:"rgba(0,0,0,0.26)"}}}}),cY=(0,R.either)((0,R.prop)("title"),(0,R.prop)("fieldName")),uY=e=>{let{value:t,getLabel:r=cY,onSelectAttributeClick:n,disabled:a=!1}=e;const o=sY(),i=t&&r(t);return b().createElement("div",{onClick:a?void 0:n,className:T()(o.attribute,{[o.attributeWithValue]:!!i},{[o.disabled]:a})},b().createElement(dd.Y,{value:i},b().createElement("div",{className:T()(o.name,{[o.disabled]:a})},i||b().createElement("span",{className:o.noSelect},po().text("Select attribute")))),b().createElement(Dp.T,{size:"M",icon:My(),disabled:a}))},pY=(0,Op.Z)({subHeader:{backgroundColor:"#f5f5f5",padding:"0 16px",margin:0,display:"flex",alignItems:"center",color:"rgba(0,0,0,0.84)",fontSize:"14px",fontWeight:500}});function dY(){return dY=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dY.apply(this,arguments)}function mY(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){yY(e,t,r[t])}))}return e}function yY(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gY=(0,E.memo)((e=>{let{selectedAttributes:t,onItemClick:r,focusIndex:n,hideCheckBox:a}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedAttributes","onItemClick","focusIndex","hideCheckBox"]);const i=pY(),l=(0,S.AH)();return b().createElement(Gp,dY({getItemSize:(e,t)=>t.items?40:28,renderItem:(e,o,i)=>{let{item:l,level:s,groupId:c,groupName:u}=o;const p=eL(l,t),d=i===n;return b().createElement(hd,{key:`item-${c}-${l.fieldName}`,onClick:r,checked:p,data:mY({},l,{groupName:u}),notSelectable:l.notSelectable,hideCheckBox:a,label:b().createElement(Ed.o,{text:l.title,highlight:l.filterText}),labelInText:l.title,level:s,style:e,isFocused:d,groupId:c,LogoIcon:l.LogoIcon})},renderGroupTitle:(e,t)=>b().createElement(oy(),{component:"div",className:i.subHeader,style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&b().createElement(hh,{group:t.item,metadata:l}),t.item.title),focusIndex:n},o))}));function fY(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){hY(e,t,r[t])}))}return e}function hY(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const EY=(e,t)=>e.title.toLowerCase().includes(t.toLowerCase()),bY=(e,t)=>EY(e,t)||(e.children||[]).some((e=>bY(e,t))),vY=(e,t)=>e.findIndex(Jk(t)),TY=(0,O.getMaxItemWidth)("title"),OY=function(e,t,r,n){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const i=EY(e,n);return[{item:n?fY({},e,{filterText:n}):e,level:a,groupId:t,groupName:r}].concat(e.children?e.children.filter((e=>o||i||bY(e,n))).flatMap((e=>OY(e,t,r,n,a+1,o||i))):[]).flat()},xY=(0,R.curry)(((e,t)=>t.map((t=>({item:t,items:t.attributes.filter((t=>bY(t,e))).map((r=>OY(r,t.id,t.title,e)))}))).filter((e=>e.items.length)))),CY=(0,Op.Z)({selector:{minWidth:"200px",width:"100%",alignItems:"stretch",background:"rgba(0,0,0, 0.0267)",boxSizing:"border-box",borderRadius:"4px",display:"flex"}}),SY=(0,E.memo)((e=>{let{className:t,itemsGroups:r,value:n,getLabel:a,onSelect:o,onRestoreFocus:i=R.identity,onOpenPopup:l=R.identity,disableRestoreFocus:s=!1,disableEnforceFocus:c=!1,single:u=!1,ungroup:p=!1,disabled:d=!1,hideCheckBox:m=!1}=e;const y=CY(),[g,f]=(0,E.useState)(null),h=(0,E.useCallback)((()=>f(null)),[]),v=!!g,[O,x]=(0,E.useState)(""),C=(0,E.useCallback)((()=>x("")),[]),[S,w]=(0,E.useState)([]),A=(0,E.useCallback)((()=>w([])),[]),_=(0,E.useMemo)((()=>xY(O,r)),[r,O]),I=(0,E.useMemo)((()=>(0,R.pipe)((0,R.when)((0,R.always)(p),(0,R.chain)((0,R.pipe)((0,R.prop)("items"),R.flatten,(0,R.map)((0,R.pick)(["item","level"]))))),Vp)(_)),[p,_]),N=(0,E.useMemo)((()=>Math.max(TY(_),308)),[_]),D=(0,R.pipe)((0,R.tap)((0,R.pipe)(A,C,h)),i),P=(0,E.useRef)(),k=(0,E.useCallback)(((e,t)=>{o({checked:t,attribute:e,index:t?S.length:vY(S,e),selectedAttributes:S}),u?(w(t?[e]:[]),D({})):(w((e=>{let{attribute:t,selectedAttributes:r,checked:n}=e;return n?r.concat(t):r.filter((e=>!Jk(t,e)))})({selectedAttributes:S,attribute:e,checked:t})),P.current&&P.current.focus())}),[S,o,u,D,P]),L=(0,E.useCallback)((e=>{let{onListItemClick:t,selectedAttributes:r}=e;return e=>{let{item:n,groupData:a}=e;const o=eL(n,r);t(fY({},n,{groupName:a.groupName}),!o)}})({onListItemClick:k,selectedAttributes:S}),[k,S]),{focusIndex:U,handleKeyDown:j}=qp({items:I,open:v,onSelectFocusedItem:L,selectedItems:S,onClose:D});return b().createElement("div",{className:T()(y.selector,t),"data-reltio-id":"attribute-selector"},b().createElement(uY,{value:n,getLabel:a,onSelectAttributeClick:e=>{l(),f(e.currentTarget)},disabled:d}),b().createElement(Mp,{open:v,anchorEl:g,onClose:D,onSearch:x,title:po().text("Select attribute"),containerWidth:N,containerHeight:507,searchInputOnKeyDown:j,anchorOrigin:{horizontal:"right",vertical:"bottom"},searchInputRef:P,disableRestoreFocus:s,disableEnforceFocus:c},b().createElement(gY,{items:I,onItemClick:k,selectedAttributes:S,width:N,height:400,focusIndex:U,hideCheckBox:m})))}));var wY=r(80349);function AY(){return AY=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},AY.apply(this,arguments)}const RY=(0,E.memo)((e=>{let{entityTypes:t,recommendedAttributes:r,showReferencedEntityAttributes:n=!0,firstLevelAttributesFilter:a}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entityTypes","recommendedAttributes","showReferencedEntityAttributes","firstLevelAttributesFilter"]);const i=(0,Ep.useSelector)(P().selectors.getMetadata),l=(0,Ep.useSelector)(so.t9),s=(0,Ep.useSelector)(P().selectors.getCanUserReadWorkflowDataTask),c=(0,Ep.useSelector)(Po.Xf),u=(0,Ep.useSelector)(P().selectors.getDataTenants),p=(0,E.useMemo)((()=>(0,R.pipe)(wY.s1,(0,R.when)((0,R.always)(!n),wY.a),(0,U.ED)(l))({allowedEntityTypes:c,firstLevelAttributesFilter:a},i,t,r,u,s)),[t,i,l,c,a,r,n,u,s]);return b().createElement(SY,AY({},o,{itemsGroups:p}))})),_Y=e=>{let{rowData:t,rowContext:{entityTypes:r,dispatchGroupAction:n},attributeSelectorProps:a={}}=e;const o=WH(),i=t&&t.id,l=(0,E.useCallback)((e=>{n(qi,i,e)}),[i,n]),s=(0,E.useCallback)((e=>(0,O.getSearchGroupAttributeLabel)({data:e})),[]);return b().createElement(RY,{className:o.attributeSelect,value:t&&t.data,getLabel:s,entityTypes:r,onSelect:l,onRestoreFocus:a.onRestoreFocus,onOpenPopup:a.onOpen,disableRestoreFocus:a.disablePopoverRestoreFocus,disableEnforceFocus:a.disablePopoverRestoreFocus})};_Y.propTypes={rowData:Ug.Xw,rowContext:hp().shape({entityTypes:hp().arrayOf(hp().string),dispatchGroupAction:hp().func}),attributeSelectorProps:hp().shape({onRestoreFocus:hp().func,onOpen:hp().func,disablePopoverRestoreFocus:hp().bool})};const IY=(0,E.memo)(_Y);function NY(){return NY=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},NY.apply(this,arguments)}const DY=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return b().createElement("svg",NY({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",focusable:"false"},r),b().createElement("defs",null,b().createElement("path",{d:"M20.222 6C21.21 6 22 6.8 22 7.778v12.444C22 21.2 21.209 22 20.222 22H7.778C6.79 22 6 21.2 6 20.222V7.778C6 6.8 6.791 6 7.778 6h12.444zM8 8v12h12V8H8zM4 18H2V4c0-1.1.9-2 2-2h14v2H4v14z",id:"svg397942461a"})),b().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},b().createElement("g",null,b().createElement("g",{transform:"translate(-2 -2)"},b().createElement("mask",{id:"svg397942461b",fill:"#fff"},b().createElement("use",{xlinkHref:"#svg397942461a"})),b().createElement("g",{mask:"url(#svg397942461b)",fill:"#000",fillOpacity:".54"},b().createElement("path",{d:"M0 0h24v24H0z"}))))))},PY=e=>!(e&&e.data),kY=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r}}=e;const n=WH(),a=t&&t.id,o=(0,E.useCallback)((()=>r(Ki,a)),[a,r]),i=(0,E.useCallback)((()=>r(Xi,a)),[a,r]),l=(0,E.useCallback)((()=>r(Hi,a)),[a,r]);return t&&b().createElement("div",{className:T()(n.actions)},b().createElement(Gg(),{title:po().text("Add"),placement:"bottom"},b().createElement(SH(),{className:n.actionIcon,onClick:l})),!PY(t)&&b().createElement(Gg(),{title:po().text("Duplicate"),placement:"bottom"},b().createElement("div",{className:n.actionIcon,tabIndex:-1},b().createElement(DY,{onClick:i,tabIndex:-1}))),b().createElement(Gg(),{title:po().text("Delete"),placement:"bottom"},b().createElement(_p(),{onClick:o,className:n.actionIcon})))};kY.propTypes={rowData:Ug.Xw,rowContext:hp().shape({dispatchGroupAction:hp().func})};const LY=(0,E.memo)(kY),UY={BY_LABEL:(0,r(51774).c)({stringify:(0,R.prop)("label")})},jY=e=>{let{className:t,attribute:r,textFieldInputRef:n,isDisabled:a,height:o,onChange:i}=e;const l=(0,R.pipe)(O.getFilterOptionLabel,RH.capitalize);return b().createElement(ej,{label:"",placeholder:po().text("Equals"),className:t,value:a?void 0:{value:r.filter,label:l(r.filter)},options:r&&r.data&&r.data.filterOptions.map((e=>({value:e,label:l(e)})))||[],height:o,onChange:i,isDisabled:a,filterOption:UY.BY_LABEL,textFieldInputRef:n})};jY.propTypes={className:hp().string,attribute:Ug.Xw,textFieldInputRef:hp().object,isDisabled:hp().bool,onChange:hp().func,height:hp().number};const FY=(0,E.memo)(jY),MY=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r},textFieldInputRef:n}=e;const a=WH(),o=t&&t.id,i=(0,E.useCallback)((e=>r(Qi,o,e.value)),[r,o]);return b().createElement(FY,{className:a.filterSelect,attribute:t,textFieldInputRef:n,isDisabled:PY(t),onChange:i})};MY.propTypes={rowData:Ug.Xw,rowContext:hp().shape({dispatchGroupAction:hp().func}),textFieldInputRef:hp().object};const VY=(0,E.memo)(MY);var BY=r(24629);const zY=(0,Op.Z)({input:{margin:0,paddingBottom:"4px !important",paddingTop:"2px !important",borderRadius:"4px"},multipleInput:{minHeight:"46px",margin:0,padding:100},root:{borderRadius:"4px 4px 0 0",padding:0,display:"flex",alignItems:"center",margin:0},boolRoot:{borderRadius:"4px 4px",padding:11,display:"flex",alignItems:"center"},dateRoot:{borderRadius:"4px 4px 0 0",margin:0},booleanRadioEditor:{paddingLeft:"11px"}}),HY=e=>{let{attribute:t,groupId:r,onChange:n,updateValues:a,filterValues:o}=e;const{values:i,data:{attrType:l,fieldName:s}={},id:c}=t,u=(0,Ep.useSelector)((e=>(0,ti.Sw)(e,r,c)))||{},p=(0,Ep.useSelector)((e=>(0,ti.Ly)(e))),d=(0,Ep.useSelector)((e=>(0,so.Sg)(e,s)));(0,E.useEffect)((()=>{p&&a()}),[i,p,d]),(0,E.useEffect)((()=>{p||a()}),[i,p]);const m=(0,E.useMemo)((()=>(0,R.propOr)([],0,i)),[i]),y=(0,E.useCallback)((0,R.pipe)(O.wrapInArray,n),[n]),{default:g,filtered:f}=u;return!g&&l?b().createElement("div",{className:"ValuesEditor-styles-loadingWrapper--_rOmn"},b().createElement(Em(),{size:20,className:"ValuesEditor-styles-loading--mLFVu"})):b().createElement(Yg,{values:m,defaultOptions:g,filteredOptions:f,onChange:y,getSuggestions:o,tabSelectsValue:!1,canLoadMore:!(0,Va.tW)(t.data)})};HY.propTypes={attribute:Ug.Xw.isRequired,groupId:hp().string,onChange:hp().func,updateValues:hp().func,filterValues:hp().func};const YY=HY,WY=e=>{let{attribute:t,dispatchGroupAction:r,groupId:n}=e;const{values:a,data:{attrType:o,fieldName:i}={},filter:l}=t,s=zY(),c=(0,O.isTypeaheadAttrType)(o)||(0,R.allPass)([(0,R.propSatisfies)((0,R.either)(R.isNil,O.isEntityTypeUri),"uri"),(0,R.prop)("faceted"),(0,R.propEq)("type",O.DataTypes.TYPE_BLOB)])(o),u=(0,O.isEnumAttrType)(o)||(0,O.isLookupAttrType)(o),p=e=>r(Ji,t.id,e);if((c||u)&&(0,O.isMultiValueOption)(l)){const e=()=>r(rl,t),a=e=>{let{value:n,pageNumber:a,currentOptions:o}=e;return r(el,{attribute:t,value:n,debounceTime:500,pageNumber:a,currentOptions:o})};return b().createElement(YY,{attribute:t,groupId:n,onChange:p,filterValues:a,updateValues:e})}{const e=u?{type:O.DataTypes.TYPE_STRING}:(0,O.getAttrDataTypeDefinition)(o),t=(0,O.getDataTypeDefinitionForFilterValue)(e,l),r=(0,O.isDateType)(t.type)&&!(0,O.isDateRangeFilterOption)(l)&&s.dateRoot||(0,O.isBooleanType)(t.type)&&s.boolRoot||s.root;return b().createElement(BY.n,{filter:{filter:l,fieldName:i,values:a||[]},onChange:p,dataTypeDefinition:t,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:s.input},disableUnderline:(0,R.isNil)(a)||(0,R.isEmpty)((0,R.flatten)(a))}},color:"primary",booleanRadioEditorClassName:s.booleanRadioEditor,classes:{root:r},orientation:"horizontal"})}};WY.propTypes={attribute:Ug.Xw.isRequired,groupId:hp().string,dispatchGroupAction:hp().func};const GY=(0,E.memo)(WY),qY=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r,groupId:n}}=e;const a=WH(),o=t&&(0,O.checkIfOptionHasValues)(t.filter);return b().createElement("div",{className:a.valuesWrapper,"data-reltio-id":"advanced-search-values-editor-wrapper"},!PY(t)&&o&&b().createElement(GY,{attribute:t,dispatchGroupAction:r,groupId:n}))};qY.propTypes={rowData:Ug.Xw,rowContext:hp().shape({dispatchGroupAction:hp().func,groupId:hp().string})};const ZY=(0,E.memo)(qY),$Y=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r}}=e;const n=WH(),a=t&&t.id,o=t&&t.operator,i=(0,E.useCallback)((e=>r(Zi,a,e)),[r,a]);return b().createElement("div",{className:n.logicOperatorContainer},o?b().createElement(VH,{className:n.logicOperator,value:o,onChange:i}):b().createElement("div",{className:T()(n.logicOperator,n.logicOperatorPlaceholder)},po().text("Where")))};$Y.propTypes={rowData:Ug.Xw,rowContext:hp().shape({dispatchGroupAction:hp().func})};const KY=(0,E.memo)($Y);function XY(){return XY=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},XY.apply(this,arguments)}const QY=e=>{let{showLogicOperator:t,group:{id:r,attributes:n,operator:a,entityTypes:o=[]},dispatch:i,onAddEmptyGroup:l}=e,s=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["showLogicOperator","group","dispatch","onAddEmptyGroup"]);const c=HH(),u=WH(),p=(0,E.useCallback)((()=>i({type:tt,payload:{groupId:r,id:(0,$e.x0)()}})),[r,i]),d=(0,E.useCallback)((()=>i({type:Je,payload:{groupId:r}})),[r,i]),m=(0,E.useCallback)((e=>i(((e,t)=>({type:Qe,payload:{groupId:e,operator:t}}))(r,e))),[r,i]),y=(0,E.useCallback)((e=>i(((e,t)=>({type:Ke,payload:{groupId:e,entityTypes:t}}))(r,e))),[r,i]),g=(0,E.useCallback)((function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return i(e(r,...n))}),[r,i]),f=(0,E.useRef)(null),h=(0,E.useRef)(null),v=(0,E.useRef)(null);v.current=n.length;const O=(0,E.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),f.current&&h.current!==v.current&&(f.current.querySelector("input").focus(),h.current=null)}),[]),x=(0,E.useCallback)((()=>{h.current=n.length}),[n.length]),C=(0,E.useMemo)((()=>[{text:po().text("Add set"),onClick:l,id:"-group-add-set"},{text:po().text("Duplicate set"),onClick:p,id:"-group-duplicate-set"},{text:po().text("Delete set"),onClick:d,id:"-group-delete-set"}]),[l,p,d]),S=(0,E.useMemo)((()=>({root:u.row})),[u]),w=(0,E.useMemo)((()=>({onRestoreFocus:O,onOpen:x,disablePopoverRestoreFocus:!!O})),[O,x]);return b().createElement(b().Fragment,null,b().createElement("div",XY({className:c.container},s),b().createElement("div",{className:c.title},po().text("Set")),b().createElement("div",{className:c.entityTypeSelectorContainer},b().createElement(lY,{classes:{root:c.entityTypeSelector},selectedEntityTypes:o,onChange:y})),b().createElement("div",{className:c.rows},b().createElement(jH,{rowClasses:S,rowsData:n,AttributeSelectorComponent:IY,FilterSelectorComponent:VY,ValuesEditorComponent:ZY,ActionsComponent:LY,LogicOperatorComponent:KY,filterSelectorRefIndex:h.current,filterSelectorRef:f,lastRowAttributeSelectorProps:w,entityTypes:o,groupId:r,dispatchGroupAction:g}),b().createElement("div",{className:c.actions},b().createElement(LN,{menuId:`query-builder-group-actions-${r}`,buttonComponent:Dp.T,buttonProps:{icon:Fd(),size:"L","data-reltio-id":"reltio-search-query-builder-group-actions"},menuItems:C})))),t&&b().createElement("div",{className:c.logicOperator},b().createElement("div",{className:T()(c.verticalOperatorLine,c.upperLine)}),b().createElement("div",{className:T()(c.verticalOperatorLine,c.lowerLine)}),b().createElement(VH,{value:a,onChange:m})))};QY.propTypes={showLogicOperator:hp().bool,group:hp().shape({id:hp().string,attributes:hp().arrayOf(Ug.Xw),entityTypes:hp().arrayOf(hp().string),operator:hp().string}),onAddEmptyGroup:hp().func,dispatch:hp().func};const JY=(0,E.memo)(QY),eW=e=>{let{groups:t,uiConfigShowSearchByOv:r,dispatch:n}=e;const a=xH(),o=(0,E.useRef)(null),i=(0,E.useRef)(null),l=(0,E.useCallback)((()=>n({type:et,payload:{group:er([])}})),[n]);return(0,E.useEffect)((()=>{if(0===t.length)l();else if(!(0,R.isNil)(i.current)&&i.current<t.length&&o.current){const e=o.current.childNodes;e[e.length-2].scrollIntoView({behavior:"smooth"})}i.current=t.length}),[t.length,l]),b().createElement("div",{className:a.scrollWrapper},b().createElement("div",{className:a.groupsContainer,ref:o},r&&b().createElement("div",{className:a.searchByOvContainer},b().createElement(kh,{variant:"queryGroups"})),t.map(((e,t,r)=>b().createElement(JY,{key:e.id,group:e,dispatch:n,showLogicOperator:t!==r.length-1,onAddEmptyGroup:l,"data-reltio-id":`reltio-search-advansed-search-group-builder-${t}`}))),b().createElement("div",{className:a.button},b().createElement("div",{className:T()(a.verticalOperatorLine,a.upperLine)}),b().createElement(dE(),{onClick:l,color:"primary",size:"small","data-reltio-id":"reltio-search-advanced-search-add-set-button"},b().createElement(SH(),{color:"primary",className:a.icon,fontSize:"small"}),po().text("ADD SET")))))};eW.propTypes={groups:hp().array,dispatch:hp().func,uiConfigShowSearchByOv:hp().bool};const tW=(0,Ep.connect)((e=>{var t;return{groups:(0,ti.go)(e),uiConfigShowSearchByOv:null!==(t=P().selectors.getShowSearchByOv(e))&&void 0!==t?t:(0,Po.cC)(e)}}))(eW),rW=D.search.actions.updateState({}),nW=e=>{let{open:t,onClose:r}=e;const n=(0,Ep.useDispatch)(),a=(0,E.useCallback)((()=>{r(),n(rW)}),[n,r]),o=(0,E.useCallback)((()=>{r(),n(To(!0,rW))}),[n,r]),i=(0,Ep.useSelector)(Ti.LA),l=(0,Ep.useSelector)(so.ai),s=(0,Ep.useSelector)(Ti.WH),c=(0,Ep.useSelector)(Ti.Jv),u=i?c&&!s:!l;return b().createElement(bB.U,{open:t,title:po().text("Search filters cannot be displayed in Quick filters"),content:po().text("You have advanced filters that cannot be displayed in Quick filters. Save your search or clear your filters to go to Quick filters."),discardCaption:po().text("Clear search"),saveCaption:po().text("Save search"),disabledSave:u,onCancel:r,onDiscard:a,onSave:o})};nW.propTypes={open:hp().bool,onClose:hp().func};const aW=nW,oW=e=>{let{metadata:t,attributesPresentation:r,lookups:n,groups:a,keyword:o,map:i,onClose:l,collapsed:s,isFullscreen:c,onCollapse:u,onExpand:p,onFullscreen:d,dataTenants:m,dispatch:y}=e;const g=xH(),[f,h]=(0,E.useState)(!1),v=(0,R.ifElse)((0,R.always)(Ya(t,a,m)),(0,R.pipe)(l,p),(()=>h(!0)));return b().createElement("div",{className:g.container},b().createElement(Jz,{onBackBtnClick:v}),b().createElement(tW,null),b().createElement(bH,{groups:a,lookups:n,dispatch:y,metadata:t,attributesPresentation:r,hasMinSize:s,collapseBtnActive:!s,isFullscreen:c,onCollapseBtnClick:s?p:u,onFullScreenBtnClick:c?p:d,keyword:o,map:i}),b().createElement(aW,{open:f,onClose:()=>h(!1)}))};oW.propTypes={metadata:O.MetadataType,lookups:hp().object,attributesData:hp().object,groups:hp().array,keyword:O.KeywordSearchType,map:Fg,onClose:hp().func,collapsed:hp().bool,isFullscreen:hp().bool,onCollapse:hp().func,onExpand:hp().func,onFullscreen:hp().func,dispatch:hp().func,attributesPresentation:hp().object,dataTenants:hp().arrayOf(O.DataTenantType)};const iW=(0,Ep.connect)((e=>({metadata:P().selectors.getMetadata(e),attributesPresentation:P().selectors.getAttributesPresentation(e),groups:(0,ti.go)(e),lookups:P().selectors.getLookups(e),keyword:P().selectors.getSearchKeyword(e),map:(0,so.vH)(e),dataTenants:P().selectors.getDataTenants(e)})))(oW),lW="calc(100% - 53px)",sW=e=>{let{isOpenAdvancedSearch:t,onCloseAdvancedSearch:r}=e;const n=vE(),[a,o]=(0,E.useState)(!1),[i,l]=(0,E.useState)("50%"),s=(0,E.useCallback)((()=>{o(!0),l("120px")}),[]),c=(0,E.useCallback)((()=>{o(!1),l("50%")}),[]),u=(0,E.useCallback)((e=>{let{percentageSize:t,isMaxSize:r,isMinSize:n}=e;o(n),l(r?lW:t)}),[]),p=(0,E.useCallback)((()=>{o(!1),l(lW)}),[]),d=b().createElement(b().Fragment,null,b().createElement(Kz,null),b().createElement(sh(),{className:n.divider})),m=b().createElement(b().Fragment,null,d,b().createElement(iW,{collapsed:a,isFullscreen:i===lW,onClose:r,onCollapse:s,onExpand:c,onFullscreen:p}));return b().createElement(SE,{className:n.resizablePanesWrapper,orientation:"horizontal",size:t?i:0,minSize:120,maxSize:-53,allowResize:t,onChange:u},b().createElement("div",{className:n.pane},t&&m),b().createElement("div",{className:n.pane},!t&&d,b().createElement($M,null)))};sW.propTypes={isOpenAdvancedSearch:hp().bool,onCloseAdvancedSearch:hp().func};const cW=sW;function uW(){return uW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uW.apply(this,arguments)}const pW=e=>b().createElement("svg",uW({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b().createElement("path",{d:"M2 0h13v2H8v19h12V6h-9V4h11v19H2V0zm9 8h7v2h-7V8zm0 4h7v2h-7v-2zm0 4h7v2h-7v-2zM4 4v2h2V4H4zm0 8v2h2v-2H4zm0-4v2h2V8H4zm0 8v2h2v-2H4z",fill:"#000",stroke:"none",strokeWidth:1,fillRule:"evenodd"})),dW=(0,Op.Z)((()=>({labelWrapper:{height:"24px",display:"inline-flex",alignItems:"center"},tenantIcon:{height:"24px",width:"24px",marginRight:"4px",opacity:.38},tenantLabel:{lineHeight:"15px",fontSize:"13px",color:"rgba(0,0,0,0.38)"}}))),mW=e=>{let{className:t}=e;const r=dW(),n=(0,S.xz)(),a=(0,S.fN)(),o=`${n}${a?" - "+a.toUpperCase():""}`;return b().createElement("div",{className:T()(r.labelWrapper,t)},b().createElement(pW,{className:r.tenantIcon,"data-reltio-id":"reltio-tenant-icon"}),b().createElement(Ay(),{className:r.tenantLabel},o))},yW=(0,Op.Z)((e=>({container:{display:"flex",flexDirection:"row",minHeight:"64px",flexShrink:0,alignItems:"center",paddingRight:"14px"},entityTypeTitle:{fontSize:"18px",letterSpacing:0,lineHeight:"21px",marginRight:"16px",flexShrink:0},profileText:{color:e.palette.text.secondary,fontSize:"14px",lineHeight:"28px",flexShrink:0},profileNumber:{color:e.palette.text.secondary,fontWeight:600,paddingLeft:"3px",paddingRight:"8px",flexShrink:0},splitter:{marginRight:"15px",marginLeft:"18px",height:"32px"},clearButton:{marginRight:"auto",marginLeft:"14px",flexShrink:0},searchBox:{flex:"1 1 auto",width:"100%",maxWidth:"538px"},searchQueryContainer:{display:"flex",flexDirection:"column",minHeight:"50px",flexShrink:0,paddingLeft:"24px",paddingRight:"14px",alignItems:"flex-start",color:e.palette.text.secondary,fontSize:"12px",letterSpacing:0,lineHeight:"14px"},searchQuery:{paddingTop:"6px"},borderBottom:{borderBottom:"1px solid rgba(0,0,0,0.1)"}}))),gW=()=>{const e=yW(),t=(0,Ep.useSelector)(P().selectors.getMetadata),r=(0,Ep.useSelector)(Jc),n=(0,Ep.useSelector)(Xc),a=(0,Ep.useSelector)(pu),o=(0,Ep.useSelector)(so.hX),i=(0,Ep.useSelector)(du),l=(0,Ep.useSelector)(cu),s=(0,O.getEntityTypeLabel)(t,{type:r}),c=(0,Ep.useSelector)(uu),u=(0,Ep.useDispatch)(),p=(()=>{const e=(0,Ep.useSelector)(P().selectors.getMetadata),t=(0,Ep.useSelector)(P().selectors.getLookups),r=(0,Ep.useSelector)(P().selectors.getAttributesPresentation),n=(0,Ep.useSelector)(ti.go),a=(0,Ep.useSelector)(P().selectors.getSearchKeyword),o=(0,Ep.useSelector)(so.vH),i=(0,Ep.useSelector)(P().selectors.getDataTenants),l=(0,Ep.useSelector)(N.X0),s=(0,Ep.useSelector)(N.Mp),c=(0,E.useMemo)((()=>Object.values((0,Va.t8)(l,s))),[l,s]);return(0,E.useMemo)((()=>{const l=(0,R.isEmpty)(n)?(0,nl.h)(e,i,c):n;return(e=>!(1===e.length&&(0,R.isEmpty)(e[0].attributes)&&1===e[0].entityTypes.length))(l)||o||a?(0,O.buildReadableQuery)(e,r,t,l,a,o):[]}),[a,o,e,i,r,n,c,t])})();(0,E.useEffect)((()=>{0!==o&&(a&&i>=o||!a&&i<=0)&&u(fc())}),[a,o,i,u]);const d=(0,E.useCallback)((e=>u(((e,t)=>({type:Bn,payload:{filterText:e,debounceTime:t}}))(e,$.XU))),[u]);return b().createElement(b().Fragment,null,b().createElement(dF(),{className:T()(e.container,{[e.borderBottom]:n>0})},b().createElement(Ay(),{component:"span",className:e.entityTypeTitle},s),b().createElement(sh(),{orientation:"vertical",className:e.splitter}),b().createElement(Ay(),{component:"span",className:e.profileNumber},po().number(i,"0,0")),b().createElement(Ay(),{variant:"body2",component:"span",className:e.profileText},po().text(" profiles are selected for bulk edit.")),0===n&&b().createElement(b().Fragment,null,b().createElement(dE(),{color:"primary",className:e.clearButton,onClick:()=>{u(fc())},"data-reltio-id":"reltio-search-bulk-update-"+(a?"select-all-profiles":"clear-selection")},a?`${po().text("Select all")} ${po().number(o,"0,0")} ${po().text("profiles")}`:po().text("Clear selection")),b().createElement(jp,{classes:{root:e.searchBox},value:c,onSearch:d,"data-reltio-id":"reltio-search-bulk-update-search-input"}),b().createElement(sh(),{orientation:"vertical",className:e.splitter}),b().createElement(Dd,{entityTypeUri:r,headColumns:l,onSelectColumns:e=>{const t=(0,Do.tU)(e,l);u(bc(e)),t&&u(gc())},"data-reltio-id":"reltio-search-bulk-update-add-remove-columns"}))),0===n&&!(0,R.isEmpty)(p)&&b().createElement(dF(),{className:e.searchQueryContainer},po().text("Search query"),b().createElement(aH,{readableQuery:p,className:e.searchQuery})))},fW=(0,Op.Z)({wrapper:{flexGrow:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",backgroundColor:"#fafafa",boxSizing:"border-box",padding:30},container:{width:"100%",flex:"1 1 auto",maxWidth:1320,backgroundColor:"white",borderRadius:2,padding:"16px 0 50px",display:"flex",flexDirection:"column"}}),hW="1px solid #e4e4e4",EW=(0,Op.Z)((e=>({mainRowContent:{display:"flex",alignItems:"center","&>*":{marginRight:8}},row:{borderBottom:hW,padding:"17px 34px","&:last-child":{borderBottom:"none"},"&$withoutLine":{borderBottom:"none",paddingTop:"9px",paddingBottom:"9px"}},withoutLine:{},attrSelector:{width:254,height:40,flexShrink:0},operationSelector:{width:190,marginRight:26,flexShrink:0},icons:{flexGrow:0,marginLeft:-5,display:"flex"},actionIcon:{marginRight:2},actionIconActive:{"& svg > g > path":{fill:e.palette.primary.main,fillOpacity:1}}})));function bW(){return bW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bW.apply(this,arguments)}const vW=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return b().createElement("svg",bW({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),b().createElement("defs",null,b().createElement("path",{id:"svg3533951039a",d:"M15 6v5l2 2v2h-4v4l-.992 1L11 19v-4H7v-2l2-2V6H8V4h8v2z"})),b().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},b().createElement("mask",{id:"svg3533951039b",fill:"#fff"},b().createElement("use",{xlinkHref:"#svg3533951039a"})),b().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg3533951039b)",d:"M0 0h24v24H0z"})))};function TW(){return TW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},TW.apply(this,arguments)}const OW=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return b().createElement("svg",TW({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),b().createElement("defs",null,b().createElement("path",{d:"M9 4a5.002 5.002 0 011 9.9V18h5.24a2.2 2.2 0 110 2H10c-1.11 0-2-.89-2-2v-4.1A5.002 5.002 0 019 4zm.5 2.5h-1v2h-2v1h2v2h1v-2h2v-1h-2v-2z",id:"svg1464898421a"})),b().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},b().createElement("mask",{id:"svg1464898421b",fill:"#fff"},b().createElement("use",{xlinkHref:"#svg1464898421a"})),b().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1464898421b)",d:"M0 0h24v24H0z"})))},xW={flex:"0 0 auto"},CW=(0,Op.Z)({container:{flexGrow:1,display:"flex",alignItems:"center",margin:0},singleEditor:{marginRight:5,maxWidth:334},editor:{maxWidth:334,marginBottom:0},editorValue:{width:"100%",marginRight:"8px"},to:{color:"#696969",padding:"0 16px 0 7px"},type_Timestamp:xW,type_Boolean:xW,type_Date:xW}),SW=e=>{let{id:t,groupId:r,operation:n,operationParameters:a}=e;const o=CW(),i=(0,Ep.useDispatch)(),l=a.attributeTypeData.attributeType,s=(0,E.useMemo)((()=>(0,O.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:l})),[l]),c=(0,E.useCallback)((e=>(0,R.mergeLeft)((0,R.ifElse)((0,R.hasPath)(["lookupCode"]),R.identity,(0,R.objOf)("value"))(e),s)),[s]),u=(0,E.useCallback)((e=>n=>i(xc({id:t,groupId:r,operationParameters:{[e]:n.value}}))),[t,r,i]),p=qc(n).map((e=>{const t=T()(o.editor,o[`type_${l.type}`]);return l.uri?b().createElement(vL,{key:e,className:t,mode:O.Mode.Editing,attributeType:l,attributeValue:c((0,R.path)([e],a)),onChangeAttribute:u(e)}):b().createElement("div",{key:e,className:T()(t,o.editorValue)},b().createElement(Hk.Z,{fieldName:a.attributeTypeData.fieldName,value:a[e],dataTypeDefinition:(0,O.getAttrDataTypeDefinition)(l),onChange:(0,R.pipe)((0,R.objOf)("value"),u(e)),fullWidth:!0}))}));return 2===p.length&&p.splice(1,0,b().createElement("div",{key:"to",className:o.to},po().text("with"))),p.length?b().createElement("div",{className:T()(o.container,1===p.length&&o.singleEditor,o[`type_${l.type}`])},p):null};SW.propTypes={id:hp().string,groupId:hp().string,operation:hp().string,operationParameters:hp().object};const wW=(0,E.memo)(SW),AW=(0,R.curry)(((e,t,r)=>(0,R.assoc)(t,(0,R.prop)(e,r),(0,R.dissoc)(e,r)))),RW=(0,R.pipe)((0,R.pick)(["fieldName","title","pathToTitle","attrType"]),AW("attrType","attributeType")),_W=(0,R.unless)(R.isNil,AW("attributeType","attrType")),IW=e=>(0,R.last)(e.type.split("/")),NW=e=>({attributes:{[IW(e)]:[e]}}),DW=(e,t)=>{const r=IW(e);return t.attributes[r][0]},PW=e=>{let{attributeValue:t,onChange:r}=e;const n=(0,E.useRef)(t);n.current=t;const a=(0,E.useCallback)((e=>{let{value:t,attributeType:a,uri:o}=e;const i=NW(n.current),l=(0,O.editAttribute)({entity:i,attributeType:a,uri:o,value:t});r(DW(n.current,l))}),[r]),o=(0,E.useCallback)((e=>{let{attributeType:t,uri:a}=e;const o=NW(n.current),i=(0,O.removeAttribute)({entity:o,attributeType:t,uri:a});r(DW(n.current,i))}),[r]),i=(0,E.useCallback)((e=>{const t=NW(n.current),a=e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,O.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a})}),t);r(DW(n.current,a))}),[r]),l=(0,E.useCallback)((e=>{const t=(e=>{let{parentAttributeValue:t,uri:r}=e;const n=r.split(t.uri+"/")[1].split("/"),a=[];for(;n.length;){a.push("value");const e=n.shift(),r=n.shift();a.push(e);const o=(0,R.view)((0,R.lensPath)(a),t);if(!o)return null;const i=o.findIndex((e=>{let{uri:t}=e;return t.endsWith("/"+r)}));a.push(i)}return a.length?(a.push("pin"),(0,R.over)((0,R.lensPath)(a),R.not,t)):null})({parentAttributeValue:n.current,uri:e});t&&r(t)}),[r]);return{onChangeAttribute:a,onDeleteAttribute:o,onAddAttributes:i,onTogglePin:l}},kW=(0,Op.Z)((e=>({pinIcon:{marginRight:"-8px"},pinIconActive:{"& svg > g > path":{fill:e.palette.primary.main,fillOpacity:1}}}))),LW=e=>{let{onTogglePin:t,subAttributeValue:r}=e;const n=kW();return b().createElement(Cd.k,{icon:vW,onClick:()=>t(r.uri),size:"L",className:T()(n.pinIcon,r.pin&&n.pinIconActive)})};LW.propTypes={onTogglePin:hp().func,subAttributeValue:hp().oneOfType([O.SimpleAttributeValueType,O.NestedAttributeValueType])};const UW=(0,R.curry)(((e,t,r)=>{let{attributeValue:n}=r;return n.uri!==e&&b().createElement(LW,{onTogglePin:t,subAttributeValue:n})}));function jW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const FW=e=>{let{attributeType:t,attributeValue:r,onChange:n}=e;const a=(0,Ep.useSelector)(P().selectors.getMetadata),o=(0,E.useMemo)((()=>{const e=(0,O.getAttributeTypeSubAttributes)(a,t),r=(0,O.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:t});return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jW(e,t,r[t])}))}return e}({},r,{value:(0,O.createDefaultValues)({attributeTypes:e,parentUri:r.uri,mode:O.Mode.Editing})})}),[t,a]),i=r||o,{onChangeAttribute:l,onDeleteAttribute:s,onAddAttributes:c,onTogglePin:u}=PW({attributeValue:i,onChange:n}),p=(0,E.useCallback)(UW(i.uri,u),[i.uri,u]);return b().createElement(PL,{attributeType:t,attributeValue:i,showEmptyEditors:!0,mode:O.Mode.Editing,metadata:a,onAddAttributes:c,onDeleteAttribute:s,onChangeAttribute:l,hideDeleteButton:!0,additionalControlsRenderer:p})};FW.propTypes={attributeType:O.AttributeTypeType,attributeValue:O.NestedAttributeValueType,onChange:hp().func};const MW=FW,VW=(0,Op.Z)((()=>({entitySelector:{marginTop:"10px",width:"100%",maxWidth:"452px","& $entitySelectorInputLabel":{transform:"translate(12px, 13px)"}},entitySelectorInputLabel:{}}))),BW=e=>{let{attributeType:t,value:r,onChange:n}=e;const a=VW(),o=(0,Ep.useDispatch)(),i=O.Mode.Editing,l=(0,O.getReferencedEntityTypeUriFromAttrType)(t),s=(0,Ep.useSelector)(P().selectors.getMetadata),c=(0,Ep.useSelector)((e=>P().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),u=(0,E.useCallback)((e=>(0,O.referencedEntityAttributeTypesSelectionStrategy)(t,e)),[t]),p=(0,R.prop)("entityUri",r),d=(0,E.useCallback)((e=>{const{uri:t,type:r,label:a}=e;(0,O.isTempUri)(p)&&o(D.profile.modifiedEntities.actions.entityDeleted(p)),n((0,R.isEmpty)(e)?null:{entityUri:t,entityType:r,entityLabel:a})}),[o,n,p]),m=(0,E.useCallback)(((e,t)=>{const r=(0,O.getEntityType)(s,l),n=(0,R.pipe)(u,(0,O.getCreatableAttributeTypes)(i))(r),a=(0,O.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:n,metadata:s,mode:i});d(a),o(D.profile.modifiedEntities.actions.entityCreated(a))}),[o,d,u,s,i,l]);return b().createElement(bU,{className:a.entitySelector,entity:r,entityTypesUris:(0,lo.l0)(l),metadata:s,max:20,globalSearchRequestOptions:c,onChange:d,onCreate:m,height:40,disableLinkClick:!0,attributeTypesSelectionStrategy:u,mode:i,TextFieldProps:{InputLabelProps:{classes:{marginDense:a.entitySelectorInputLabel}}}})};BW.propTypes={attributeType:O.AttributeTypeType,value:hp().shape({entityUri:hp().string,entityType:hp().string,entityLabel:hp().string}),onChange:hp().func};const zW=BW;function HW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const YW=e=>{let{attributeType:t,attributeValue:r,onChange:n}=e;const a=(0,Ep.useSelector)(P().selectors.getMetadata),o=(0,E.useMemo)((()=>{const e=(0,O.getEditableAttributeTypeSubAttributes)(a,t),r=(0,O.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:t});return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){HW(e,t,r[t])}))}return e}({},r,{value:(0,O.createDefaultValues)({attributeTypes:e,parentUri:r.uri,mode:O.Mode.Editing})})}),[t,a]),i=r||o,{onChangeAttribute:l,onDeleteAttribute:s,onAddAttributes:c,onTogglePin:u}=PW({attributeValue:i,onChange:n}),p=(0,E.useCallback)(UW(i.uri,u),[i.uri,u]);return b().createElement(SU,{attributeType:t,attributeValue:i,showEmptyEditors:!0,mode:O.Mode.Editing,metadata:a,onAddAttributes:c,onDeleteAttribute:s,onChangeAttribute:l,hideDeleteButton:!0,additionalControlsRenderer:p})};YW.propTypes={attributeType:O.AttributeTypeType,attributeValue:O.NestedAttributeValueType,onChange:hp().func};const WW=YW;function GW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qW={enabled:!0,queueSizeThreshold:5},ZW=e=>{let{id:t,operation:r,operationParameters:n,groupId:a,groupAttributeType:o,hasConditions:i}=e;const l=EW(),s=(0,Ep.useDispatch)(),c=(0,Ep.useSelector)(Jc),u=(0,lo.l0)(c),p=(0,E.useCallback)((e=>{let{attribute:r,checked:n}=e;n&&s((e=>{let{id:t,groupId:r,attribute:n}=e;return{type:Wn,payload:{id:t,groupId:r,attribute:n}}})({id:t,groupId:a,attribute:RW(r)}))}),[t,a,s]),d=(0,E.useCallback)((e=>{s(xc({id:t,groupId:a,operationParameters:{attributeValue:e}}))}),[s,t,a]),m=(0,E.useCallback)((()=>{s((e=>{let{id:t,groupId:r}=e;return{type:ra,payload:{id:t,groupId:r}}})({id:t,groupId:a}))}),[t,a,s]),y=(0,E.useCallback)((()=>{s((e=>{let{id:t,groupId:r}=e;return{type:na,payload:{id:t,groupId:r}}})({id:t,groupId:a}))}),[t,a,s]),g=(0,E.useCallback)((()=>{s(Oc({id:t,groupId:a}))}),[t,a,s]),f=(0,E.useCallback)((e=>{s((e=>{let{id:t,groupId:r,operation:n}=e;return{type:Gn,payload:{id:t,groupId:r,operation:n}}})({id:t,groupId:a,operation:e.value}))}),[t,a,s]),h=(0,R.prop)("pin",n),v=(0,R.prop)("addNestedAttribute",n),x=(0,R.prop)("attributeTypeData",n),C=(0,R.path)(["attributeTypeData","attributeType"],n),S=(0,O.isComplexAttribute)(C)&&[$.Vh.AddNew,$.Vh.ReplaceAllWith,$.Vh.RepointReference].includes(r),w=o&&C&&C.uri===o.uri,A=[$.Vh.AddNew,$.Vh.ReplaceAllWith,$.Vh.FindAndReplace].includes(r)&&!(null==C||!C.uri),_=a&&!w&&r===$.Vh.AddNew&&!(0,O.isReference)(o);(0,E.useEffect)((()=>{h&&!A&&m()}),[A,h,m]),(0,E.useEffect)((()=>{v&&!_&&y()}),[_,v,y]);const I=(0,E.useMemo)((()=>{return C?(e=C,t=i&&w,(0,R.cond)([[(0,R.both)(O.isNested,(0,R.always)(t)),(0,R.always)((0,R.without)([$.Vh.AddNew,$.Vh.ReplaceAllWith],$.DY))],[O.isNested,(0,R.always)($.DY)],[(0,R.both)(O.isReference,(0,R.always)(t)),(0,R.always)((0,R.without)([$.Vh.AddNew],$.hS))],[O.isReference,(0,R.always)($.hS)],[R.T,(0,R.always)($.pG)]])(e)).map((e=>({value:$.Vh[e],label:$.WN[e]}))):[];var e,t}),[i,C,w]),N=I.find((e=>e.value===r));(0,E.useEffect)((()=>{!N&&I[0]&&x&&f(I[0])}),[I,N,x,f]);const D=r&&x,P=(0,E.useMemo)((()=>_W(x)),[x]),k=(0,E.useCallback)(o?(0,wY.xM)(o):(0,R.ifElse)(wY.XF,(0,R.pipe)((0,R.pathEq)(["fieldName"],"tags")),(0,R.pipe)((0,R.prop)("attrType"),(0,R.both)((0,R.complement)(O.isImage),(0,R.complement)(O.isAnalyticAttribute)))),[o]),L=(0,E.useCallback)((e=>(0,O.getSearchGroupAttributeLabel)({data:e})),[]);return b().createElement("div",{className:T()(l.row,{[l.withoutLine]:!!a})},b().createElement("div",{className:l.mainRowContent},b().createElement(RY,{className:l.attrSelector,single:!0,showReferencedEntityAttributes:!1,entityTypes:u,value:P,onSelect:p,firstLevelAttributesFilter:k,ungroup:!!a,getLabel:L}),b().createElement(ej,{label:"",isDisabled:!P,placeholder:po().text("Select operation"),className:l.operationSelector,value:N,options:I,height:40,onChange:f}),D&&b().createElement(b().Fragment,null,!S&&b().createElement(wW,{id:t,groupId:a,operation:r,operationParameters:n}),b().createElement("div",{className:l.icons},A&&b().createElement(Cd.k,{className:T()(l.actionIcon,h&&l.actionIconActive),size:"M",tooltipTitle:po().text("Make this Operational Value"),icon:vW,onClick:m}),_&&b().createElement(Cd.k,{className:T()(l.actionIcon,v&&l.actionIconActive),size:"M",tooltipTitle:po().text("Create parent attribute if none exists"),icon:OW,onClick:y}),b().createElement(Cd.k,{size:"M",tooltipTitle:po().text("Delete"),icon:_p(),onClick:g})))),D&&S&&b().createElement(rL.Provider,{value:qW},r===$.Vh.RepointReference?b().createElement(zW,{attributeType:C,value:n.attributeValue,onChange:d}):(0,O.isNested)(C)?b().createElement(MW,{attributeType:C,attributeValue:n.attributeValue,onChange:d}):(0,O.isReference)(C)?b().createElement(WW,{attributeType:C,attributeValue:n.attributeValue,onChange:d}):null))};ZW.propTypes=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){GW(e,t,r[t])}))}return e}({},Mg,{groupId:hp().string,groupAttributeType:O.AttributeTypeType,hasConditions:hp().bool});const $W=(0,E.memo)(ZW);var KW=r(80510),XW=r.n(KW);const QW=(0,Op.Z)((e=>({complexRow:{borderBottom:hW,padding:"10px 34px 17px","&:last-child":{borderBottom:"none"}},header:{display:"flex",alignItems:"center",marginBottom:"4px"},actionsBlock:{marginTop:"2px",marginLeft:"-34px",marginRight:"-34px"},attributeLabel:{fontSize:"14px",fontWeight:500,color:e.palette.text.secondary},conditionsToggleButton:{marginTop:"1px",marginLeft:"6px",display:"flex",alignItems:"center"},conditionsToggleIcon:{marginRight:"8px",width:"18px",height:"18px",marginTop:"-1px"}}))),JW=(0,Op.Z)((e=>({caption:{color:e.palette.text.secondary},conditions:{backgroundColor:"rgba(0,0,0,0.032)",padding:"20px 15px",margin:"7px 0"}}))),eG="40px",tG=(0,Op.Z)((()=>({row:{"&:hover $actions":{opacity:1}},logicOperatorContainer:{maxHeight:"40px"},attributeSelect:{width:"254px",height:eG},filterSelect:{width:"190px"},valuesWrapper:{width:"100%",display:"flex",minHeight:eG,alignItems:"flex-start",boxSizing:"border-box"},actions:{opacity:"0",transition:"opacity 0.3s",paddingTop:"8px",height:"24px",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:"0"}})));function rG(){return rG=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rG.apply(this,arguments)}const nG=(0,E.memo)((e=>{let{attributeType:t,showReferencedEntityAttributes:r,subattributesGroupTitle:n,additionalItemsGroups:a}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeType","showReferencedEntityAttributes","subattributesGroupTitle","additionalItemsGroups"]);const i=(0,Ep.useSelector)(P().selectors.getMetadata),l=t.uri.split("/").slice(0,3).join("/"),s=(0,lo.l0)(l),c=(0,E.useCallback)((0,wY.xM)(t),[t]),u=(0,E.useMemo)((()=>(0,R.pipe)(wY.s1,(0,R.when)((0,R.always)(!r),wY.a),(0,R.map)((0,R.evolve)({attributes:(0,R.pathOr)([],[0,"children"]),title:(0,R.when)((0,R.always)(n),(0,R.always)(n))})),(0,R.when)((0,R.always)(a),(0,R.concat)(a)))({firstLevelAttributesFilter:c},i,s)),[a,n,r,s,i,c]);return b().createElement(SY,rG({},o,{ungroup:!a,itemsGroups:u}))}));function aG(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){oG(e,t,r[t])}))}return e}function oG(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iG=(e,t)=>(0,Ha.nT)(`${$.E_}_group`,po().text("Profile"),[aG({},(0,Ha.o)(aG({title:(0,O.getEntityTypeLabel)(t,{type:(0,O.getReferencedEntityTypeUriFromAttrType)(e)}),fieldName:$.E_},e)),{enforcedFilterOptions:[O.FilterOptions.EQUALS]})]),lG=e=>{let{rowData:t,rowContext:{attributeType:r,dispatchGroupAction:n},attributeSelectorProps:a={}}=e;const o=tG(),i=(0,Ep.useSelector)(P().selectors.getMetadata),l=t&&t.id,s=(0,E.useMemo)((()=>(0,O.isReference)(r)?[iG(r,i)]:null),[r,i]),c=(0,E.useCallback)((e=>{n(Ac,l,e)}),[l,n]);return b().createElement(nG,{className:o.attributeSelect,value:t&&t.data,attributeType:r,additionalItemsGroups:s,subattributesGroupTitle:(0,O.isReference)(r)?po().text("Reference attributes"):"",onSelect:c,onRestoreFocus:a.onRestoreFocus,onOpenPopup:a.onOpen,disableRestoreFocus:a.disablePopoverRestoreFocus,disableEnforceFocus:a.disablePopoverRestoreFocus})};lG.propTypes={rowData:Ug.Xw,rowContext:hp().shape({attributeType:O.AttributeTypeType,dispatchGroupAction:hp().func}),attributeSelectorProps:hp().shape({onRestoreFocus:hp().func,onOpen:hp().func,disablePopoverRestoreFocus:hp().bool})};const sG=(0,E.memo)(lG),cG=e=>!(e&&e.data),uG=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r},textFieldInputRef:n}=e;const a=tG(),o=t&&t.id,i=(0,E.useCallback)((e=>r(_c,o,e.value)),[r,o]);return b().createElement(FY,{height:40,className:a.filterSelect,attribute:t,textFieldInputRef:n,isDisabled:cG(t),onChange:i})};uG.propTypes={rowData:Ug.Xw,rowContext:hp().shape({dispatchGroupAction:hp().func}),textFieldInputRef:hp().object};const pG=(0,E.memo)(uG),dG=(0,Op.Z)({input:{margin:0,borderRadius:"4px"},root:{borderRadius:"4px 4px 0 0",padding:0,display:"flex",alignItems:"center",margin:0},entitySelector:{width:"100%","& $entitySelectorInputLabel":{transform:"translate(12px, 13px)"}},entitySelectorInputLabel:{}}),mG=(0,R.pathEq)(["data","fieldName"],$.E_),yG=e=>{let{condition:t,dispatchGroupAction:r}=e;const{values:n=[],data:{attrType:a,fieldName:o}={},filter:i}=t,l=dG(),s=(0,E.useCallback)((e=>r(Ic,t.id,e)),[r,t.id]),c=(0,O.getAttrDataTypeDefinition)(a),u=(0,O.getDataTypeDefinitionForFilterValue)(c,i),p=(0,Ep.useSelector)(P().selectors.getMetadata),d=(0,Ep.useSelector)((e=>P().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),m=(0,E.useCallback)((e=>{let{uri:t,type:r,label:n}=e;return s([{entityUri:t,entityType:r,entityLabel:n}])}),[s]);return mG(t)?b().createElement(bU,{className:l.entitySelector,entity:n[0],entityTypesUris:(0,lo.l0)((0,O.getReferencedEntityTypeUriFromAttrType)(a)),metadata:p,max:20,globalSearchRequestOptions:d,onChange:m,height:40,disableLinkClick:!0,TextFieldProps:{InputLabelProps:{classes:{marginDense:l.entitySelectorInputLabel}}}}):b().createElement(BY.n,{filter:{filter:i,fieldName:o,values:n||[]},onChange:s,dataTypeDefinition:u,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:l.input}}},color:"primary",classes:{root:l.root},orientation:"horizontal"})};yG.propTypes={condition:Ug.Xw.isRequired,dispatchGroupAction:hp().func};const gG=(0,E.memo)(yG),fG=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r}}=e;const n=tG(),a=cG(t),o=t&&(0,O.checkIfOptionHasValues)(t.filter);return b().createElement("div",{className:n.valuesWrapper},!a&&o&&b().createElement(gG,{condition:t,dispatchGroupAction:r}))};fG.propTypes={rowData:Ug.Xw,rowContext:hp().shape({dispatchGroupAction:hp().func})};const hG=(0,E.memo)(fG),EG=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r}}=e;const n=tG(),a=t&&t.id,o=(0,E.useCallback)((()=>r(Rc,a)),[a,r]);return t&&b().createElement("div",{className:n.actions},b().createElement(Cd.k,{tooltipTitle:po().text("Delete"),tooltipPlacement:"bottom",icon:_p(),size:"M",onClick:o}))};EG.propTypes={rowData:Ug.Xw,rowContext:hp().shape({dispatchGroupAction:hp().func})};const bG=(0,E.memo)(EG),vG=e=>{let{attributeType:t,conditions:r,groupId:n}=e;const a=JW(),o=tG(),i=(0,Ep.useDispatch)(),l=(0,E.useCallback)((function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];return i(e(n,...r))}),[n,i]),s=(0,E.useMemo)((()=>({root:o.row,logicOperatorContainer:o.logicOperatorContainer})),[o]);return b().createElement(b().Fragment,null,b().createElement(Ay(),{variant:"caption",component:"div",className:a.caption},po().text("If the following conditions are met")),b().createElement(jH,{className:a.conditions,rowClasses:s,rowsData:r,AttributeSelectorComponent:sG,FilterSelectorComponent:pG,ValuesEditorComponent:hG,ActionsComponent:bG,attributeType:t,dispatchGroupAction:l}),b().createElement(Ay(),{variant:"caption",component:"div",className:a.caption},po().text("Then perform the change")))};vG.propTypes={attributeType:O.AttributeTypeType,conditions:hp().arrayOf(Ug.Xw),groupId:hp().string};const TG=vG;function OG(){return OG=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},OG.apply(this,arguments)}const xG=e=>{let{id:t,fieldName:r,actions:n,conditions:a}=e;const o=QW(),i=(0,Ep.useDispatch)(),l=(0,Ep.useSelector)(Jc),s=(0,Ep.useSelector)(P().selectors.getMetadata),c=(0,E.useMemo)((()=>{const e=(0,O.searchUriToAttrUri)(r,l);return(0,O.findAttributeTypeByUri)(s,e,l)}),[s,r,l]),u=(0,E.useCallback)((()=>i({type:$n,payload:t})),[t,i]),p=!!a,d=((e,t)=>(0,R.any)((0,R.both)((0,R.pipe)((0,R.prop)("operation"),(0,R.includes)(R.__,[$.Vh.AddNew,$.Vh.ReplaceAllWith])),(0,R.pathEq)(["operationParameters","attributeTypeData","attributeType","uri"],t.uri)))(e))(n,c);(0,E.useEffect)((()=>{p||0!==n.length||i(Oc({id:t}))}),[t,p,n.length,i]);const m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return b().createElement($W,OG({key:e.id},e,{groupId:t,groupAttributeType:c,hasConditions:p}))};return b().createElement("div",{className:o.complexRow},b().createElement("div",{className:o.header},b().createElement("div",{className:o.attributeLabel},c.label),b().createElement(dE(),{disabled:d,color:"primary",className:o.conditionsToggleButton,onClick:u},p?b().createElement(b().Fragment,null,b().createElement(XW(),{className:o.conditionsToggleIcon}),po().text("Remove")," "):b().createElement(b().Fragment,null,b().createElement(SH(),{className:o.conditionsToggleIcon}),po().text("Add")," "),po().text("conditions"))),a&&b().createElement(TG,{attributeType:c,conditions:a,groupId:t}),b().createElement("div",{className:o.actionsBlock},n.map(m),m()))};xG.propTypes=Vg;const CG=(0,E.memo)(xG);function SG(){return SG=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},SG.apply(this,arguments)}const wG=e=>{const t=(e=>e.actions?CG:$W)(e);return b().createElement(t,SG({key:e.id},e))},AG=()=>{const e=fW(),t=(0,Ep.useSelector)(yu);return b().createElement("div",{className:e.wrapper},b().createElement("div",{className:e.container},t.map(wG),b().createElement($W,null)))};var RG=r(99261),_G=r.n(RG),IG=r(26518),NG=r.n(IG),DG=r(60158),PG=r.n(DG),kG=r(61887),LG=r.n(kG);const UG=(0,Op.Z)((()=>({container:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},placeholder:{flex:1},stepper:{padding:"0 24px",flex:2},stepButton:{margin:"-20px -16px",padding:"20px 16px","& svg text":{textAnchor:"middle"}},buttons:{flex:1,display:"flex",justifyContent:"flex-end"},backButton:{marginRight:"8px",border:"1px solid rgba(0, 0, 0, 0.23)"},progressButtonWrapper:{position:"relative"},progress:{position:"absolute",left:"calc(50% - 12px)",top:"calc(50% - 12px)"},errorLabel:{color:"#dd2c00 !important"},warningLabel:{color:"#f9a825 !important"}})));function jG(){return jG=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jG.apply(this,arguments)}const FG=e=>{let{isInProgress:t,disabled:r,circularColor:n="primary",className:a,children:o,onClick:i}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isInProgress","disabled","circularColor","className","children","onClick"]);const s=UG();return b().createElement(dE(),jG({},l,{className:T()(s.progressButtonWrapper,a),onClick:i,disabled:r||t}),o,t&&b().createElement("div",{className:s.progress,"data-reltio-id":"reltio-circular-load-indicator"},b().createElement(Em(),{size:24,color:n})))},MG=e=>{let{activeStep:t,steps:r,isPending:n=!1,shouldCompleteSteps:a=!0,onConfirm:o,onChangeStep:i}=e;const l=UG(),s=t===r.length-1,c=e=>{e!==t&&i(e)},u=(0,R.propOr)(!0,"enabled"),p=e=>{if(e>0){const t=e-1;u(r[t])?c(t):p(t)}},d=e=>{if(e<r.length-1){const t=e+1;u(r[t])?c(t):d(t)}},m=s&&!!o,y=m||(0,R.any)(u,(0,R.drop)(t+1,r));return b().createElement("div",{className:l.container},b().createElement("div",{className:l.placeholder}),b().createElement(_G(),{nonLinear:!0,activeStep:t,className:l.stepper},r.map(((e,r)=>{let{label:o,enabled:i=!0,hasError:s,hasWarning:u}=e;const p=!i||n,d=a&&!p&&r<t;return b().createElement(NG(),{key:o,completed:d,disabled:p},b().createElement(PG(),{className:l.stepButton,onClick:()=>c(r),"data-reltio-id":`reltio-search-bulk-update-${r}`},b().createElement(LG(),{error:s||u,classes:{error:s?l.errorLabel:l.warningLabel}},o)))}))),b().createElement("div",{className:l.buttons},t>0&&b().createElement(dE(),{variant:"outlined",className:l.backButton,onClick:()=>p(t),disabled:n,"data-reltio-id":"reltio-search-bulk-update-back"},po().text("Back")),b().createElement(FG,{variant:"contained",color:"primary",disabled:!y,isInProgress:n,onClick:s?o:()=>d(t),"data-reltio-id":"reltio-search-bulk-update-"+(s?"confirm":"continue")},m?po().text("Confirm"):po().text("Continue"))))},VG=()=>{const e=(0,Ep.useDispatch)(),t=(0,Ep.useSelector)(Xc),r=(0,Ep.useSelector)(mu),n=(0,Ep.useSelector)(Kc),a=!(0,R.isNil)(n),o=(0,Ep.useSelector)(hu),i=(0,Ep.useSelector)(Eu),l=[{label:po().text("Select profiles")},{label:po().text("Select operation"),enabled:r},{label:po().text("Define changes"),enabled:r&&a&&n===$.dV.UpdateProfiles},{label:po().text("Review changes"),enabled:r&&a&&(o||n===$.dV.DeleteProfiles)}];return b().createElement(MG,{activeStep:t,steps:l,isPending:i,onChangeStep:t=>e((e=>({type:In,payload:e}))(t)),onConfirm:()=>e({type:aa})})},BG=(0,Op.Z)((()=>({appBar:{boxShadow:"none"},toolbar:{background:"white",borderBottom:"1px solid rgba(0,0,0,0.1)",boxSizing:"border-box",paddingLeft:"21px"},title:{fontSize:"1.1rem",display:"inline-flex",alignItems:"center"},closeButton:{marginRight:"10px"}}))),zG=e=>{let{children:t,onClose:r}=e;const n=BG();return b().createElement(uF(),{position:"static",color:"default",className:n.appBar},b().createElement(dF(),{className:n.toolbar},b().createElement(Cd.k,{edge:"start",tooltipTitle:po().text("Close"),"aria-label":po().text("Close"),icon:_p(),onClick:r,className:n.closeButton,size:"L","data-reltio-id":"reltio-search-bulk-update-close"}),b().createElement(Ay(),{variant:"h6",className:n.title},t)),b().createElement(dF(),{className:n.toolbar},b().createElement(VG,null)))};zG.propTypes={children:hp().node,onClose:hp().func};const HG=zG,YG=(0,Op.Z)((()=>({tableContainer:{position:"relative",height:"100%",display:"flex",flexDirection:"column",backgroundColor:"#fff"},pagination:{flexGrow:0,borderTop:"1px solid rgba(0, 0, 0, 0.1)",height:"52px",boxShadow:"none"}}))),WG=(0,R.equals)($.v6.include);function GG(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qG=()=>{const e=YG(),t=(0,Ep.useDispatch)(),r=(0,Ep.useSelector)(P().selectors.getMetadata),n=(0,Ep.useSelector)(Jc),a=(0,Ep.useSelector)(cu),o=(0,Ep.useSelector)(nu),i=(0,Ep.useSelector)(lu),l=(0,Ep.useSelector)(su),s=(0,Ep.useSelector)(tu),c=(0,Ep.useSelector)(ou),u=(0,Ep.useSelector)(iu),p=(0,Ep.useSelector)(Qc),d=(0,Ep.useSelector)(au),m=(0,Ep.useSelector)(ru),y=(0,E.useMemo)((()=>((e,t,r)=>(0,R.pipe)((0,R.map)((0,R.prop)("uri")),WG(e)?(0,R.intersection)(t):(0,R.without)(t))(r))(m,d,o)),[m,d,o]),g=((e,t)=>0!==e.length&&(e.length===t.length||null))(y,o),f=(0,E.useMemo)((()=>(0,Do.oq)(r,n,a)),[r,n,a]),h=(0,E.useCallback)((e=>{let{field:r,order:n}=e;return t((e=>{let{field:t,order:r}=e;return{type:Fn,payload:{field:t,order:r}}})({field:n?r:null,order:n}))}),[t]),v=(0,E.useCallback)((e=>{let{what:r,where:n}=e;const o=(0,R.move)(r.columnIndex,n.columnIndex,a);t(bc(o))}),[t,a]),T=(0,E.useCallback)((e=>{let{columns:r}=e;const n=(0,Do.tU)(r,a);t(bc(r)),n&&t(gc())}),[t,a]),O=(0,E.useCallback)((e=>{const r=a.map(((t,r)=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){GG(e,t,r[t])}))}return e}({},t,{size:e[r].size})));t(bc(r))}),[t,a]),x=(0,E.useCallback)(((e,r)=>{t(e?((e,t)=>({type:Pn,payload:{uri:e,checked:t}}))(e,r):{type:kn,payload:!g})}),[g,t]),C=(0,E.useRef)(null);return b().createElement("div",{className:e.tableContainer},p&&b().createElement(YE.Z,null),b().createElement(my,{entities:o,entityTypeUri:n,headColumns:a,additionalColumns:f,canCheck:!0,onCheck:x,checkedEntitiesUris:y,headerCheckboxState:g,dndColumnReorderingEnabled:!0,sortField:i,sortOrder:l,onSort:h,onReorderingColumn:v,onChangeColumnsList:T,onChangeColumnsSize:O,entitiesTableRef:C}),s>$.Tu[0]&&b().createElement("div",{className:e.pagination},b().createElement(kE.Z,{count:s,rowsPerPageOptions:$.Tu,rowsPerPage:u||$.Tu[0],page:c||0,onChangePage:e=>t(Ec(e)),onChangeRowsPerPage:e=>t((e=>({type:Un,payload:e}))(e)),basicTableRef:C})))},ZG=(0,Op.Z)((e=>({tableContainer:{display:"flex",flexDirection:"column",backgroundColor:"#fff",width:"100%",margin:"30px 60px",padding:"24px"},title:{fontSize:"14px",fontWeight:500,letterSpacing:"0.1px",lineHeight:"24px",color:e.palette.text.secondary,marginBottom:"6px"},label:{color:e.palette.text.secondary,fontSize:"14px",letterSpacing:0,lineHeight:"32px",paddingLeft:"7px"},radioButton:{padding:"0 9px"}}))),$G=()=>{const e=ZG(),t=(0,Ep.useDispatch)(),r=(0,Ep.useSelector)(Kc),n=(0,Ep.useSelector)(P().selectors.getCanUserDeleteProfiles);(0,E.useEffect)((()=>{(0,R.isNil)(r)&&t(Tc($.dV.UpdateProfiles))}),[r,t]);const a=(0,R.pipe)(bp.NA,Tc,t);return b().createElement("div",{className:e.tableContainer},b().createElement(Ay(),{className:e.title},po().text("Choose Bulk Update Operation")),b().createElement(Mh(),{value:r,onChange:a},b().createElement(Bh(),{classes:{label:e.label},value:$.dV.UpdateProfiles,control:b().createElement(jh(),{className:e.radioButton}),label:po().text("Update Profiles - Update attribute values of selected profiles")}),b().createElement(Bh(),{disabled:!n,classes:{label:e.label},value:$.dV.DeleteProfiles,control:b().createElement(jh(),{className:e.radioButton}),label:po().text("Delete Profiles - Delete selected profiles")})))};var KG=r(49850),XG=r.n(KG),QG=r(28012),JG=r.n(QG),eq=r(18878),tq=r.n(eq),rq=r(70918),nq=r.n(rq),aq=r(51159),oq=r.n(aq),iq=r(35681),lq=r.n(iq);const sq=e=>{let{value:t,attributeType:r,lookups:n}=e;return(0,O.isLookupAttrType)(r)&&"string"==typeof t&&(t={lookupCode:t,value:(0,O.getResolvedLookupValue)(n,(0,O.getAttrTypeLookupCode)(r),t)}),b().createElement($d.x,{dataTypeDefinition:(0,O.getAttrDataTypeDefinition)(r),value:t})};sq.propTypes={value:hp().any,attributeType:O.AttributeTypeType,lookups:hp().object};const cq=sq,uq=e=>{let{operation:t}=e;return b().createElement(b().Fragment,null,$.WN[t])},pq=e=>{let{conditions:t,attributesPresentation:r,metadata:n,lookups:a}=e;if((0,O.isEmptyValue)(t))return b().createElement(b().Fragment,null,"-");const o=(0,O.buildAttributesReadableQuery)(n,r,a,t,!1);return b().createElement(aH,{readableQuery:o})},dq="8px",mq="1px",yq="1px solid #AFD4E9",gq=(0,Op.Z)((e=>({scaffoldsContainer:{height:"calc(100% + 24px)",margin:"-12px 0"},scaffold:{width:"32px",height:"100%",position:"relative",display:"inline-block",verticalAlign:"middle"},scaffoldFullVert:{"&:before":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:"100%",width:mq,left:dq,top:0,borderLeft:yq}},scaffoldHalfVert:{"&:before":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:"50%",width:mq,left:dq,top:0,borderLeft:yq}},scaffoldHor:{"&:after":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:mq,width:"5px",left:dq,top:"50%",borderBottom:yq}},noWrapContainer:{display:"inline-flex",verticalAlign:"middle",height:"100%",alignItems:"center","& > *":{flexShrink:0}},optionContainer:{width:"20px","& svg g path":{fill:e.palette.primary.main,fillOpacity:1},"& + &":{paddingLeft:"4px"}},opaque:{opacity:0},newIcon:{color:"#599E0E",marginLeft:"10px",borderRadius:"16px",padding:"2px 12px",border:"2px solid rgba(89,158,14,0.3)",fontSize:"10px",lineHeight:"16px"},nestedLabel:{width:"100%"}}))),fq=e=>{let{attributeTypeData:{pathToTitle:t,title:r}}=e;const n=gq();return Boolean(t&&t.length>2)?b().createElement(Qg,{placement:"bottom-start",pathToTitle:t},b().createElement("span",{className:n.nestedLabel},r)):r};fq.propTypes={attributeTypeData:hp().shape({title:hp().string,attributeType:O.AttributeTypeType})};const hq=fq;function Eq(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function bq(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vq(e,t,r[t])}))}return e}function vq(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tq={EMPTY:"empty",FULL_VERT:"full_vert",FULL_VERT_HOR:"full_vert_hor",HALF_VERT_HOR:"half_vert_hor"},Oq=e=>e.map(((t,r)=>(e=>{let{hasLowerSubAttrs:t,isFirstValue:r,isLastScaffold:n}=e;const a=n&&r;return t?a?Tq.FULL_VERT_HOR:Tq.FULL_VERT:a?Tq.HALF_VERT_HOR:Tq.EMPTY})(bq({},t,{isLastScaffold:r===e.length-1})))),xq=e=>{let{operation:t,operationParameters:r}=e;return(0,O.wrapInArrayIfNeeded)(bq({},r,{operation:t}))},Cq=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const a=(0,O.findAttributeTypeByUri)(e,t.type),o=a.label||a.name,i={attributeTypeData:{attributeType:a,title:o,pathToTitle:[...r,o]},scaffolds:Oq(n),pin:t.pin};if((0,O.isComplexAttribute)(a)){const a=Object.values(t.value),l=a.flatMap(((t,i)=>t.flatMap(((t,l)=>{const s={hasLowerSubAttrs:a.length-i-1>0,isFirstValue:0===l};return Cq(e,t,[...r,o],[...n,s])}))));return[i,...l]}return[bq({},i,{attributeValue:(0,O.getAttributeValue)(t)})]},Sq=(0,R.curry)(((e,t)=>{let{operation:r,operationParameters:n}=t;const{attributeValue:a,attributeTypeData:o}=n,i=Eq(n,["attributeValue","attributeTypeData"]),[l,...s]=Cq(e,a,o.pathToTitle.slice(0,-1));return[bq({},l,{operation:r},i),...s]})),wq=(0,R.curry)(((e,t)=>{let{operation:r,operationParameters:n}=t;const{attributeValue:a,attributeTypeData:o}=n,i=Eq(n,["attributeValue","attributeTypeData"]),[l,...s]=Cq(e,a,o.pathToTitle.slice(0,-1)),{label:c,refEntity:u}=a,[{objectURI:p,type:d}]=u;return[bq({},l,{operation:r},i,{attributeValue:{entityUri:p,entityLabel:c,entityType:d}}),...s]})),Aq=(0,R.curry)(((e,t)=>(0,R.cond)([[Yc,Sq(e)],[Wc,wq(e)],[R.T,xq]])(t))),Rq=(0,R.curry)(((e,t)=>(0,R.pipe)((0,R.defaultTo)([]),(0,R.chain)((0,R.ifElse)(Pc,(0,R.pipe)(kc,Rq(e)),Aq(e))))(t))),_q=e=>{let{scaffold:t}=e;const r=gq();return b().createElement("div",{className:T()(r.scaffold,{[r.scaffoldFullVert]:t===Tq.FULL_VERT||t===Tq.FULL_VERT_HOR,[r.scaffoldHalfVert]:t===Tq.HALF_VERT_HOR,[r.scaffoldHor]:t===Tq.FULL_VERT_HOR||t===Tq.HALF_VERT_HOR})})};_q.propTypes={scaffold:hp().oneOf((0,R.values)(Tq))};const Iq=e=>{let{scaffolds:t}=e;const r=gq();return b().createElement("div",{className:r.scaffoldsContainer},t.map(((e,t)=>b().createElement(_q,{key:t,scaffold:e}))))};Iq.propTypes={scaffolds:hp().arrayOf(_q.propTypes.scaffold)};const Nq=Iq,Dq=e=>{let{children:t}=e;const r=gq();return b().createElement("div",{className:r.noWrapContainer},t)};Dq.propTypes={children:hp().node};const Pq=Dq,kq=e=>{let{pin:t,addParent:r}=e;const n=gq();return b().createElement(Pq,null,b().createElement("div",{className:T()(n.optionContainer,{[n.opaque]:!t})},b().createElement(vW,null)),b().createElement("div",{className:T()(n.optionContainer,{[n.opaque]:!r})},b().createElement(OW,null)))};kq.propTypes={pin:hp().bool,addParent:hp().bool};const Lq=kq,Uq=e=>{let{entity:{entityLabel:t,entityUri:r},attributeType:n}=e;const a=gq(),o=(0,Ep.useSelector)((e=>P().selectors.getModifiedEntity(e,r)))||null,i=(0,Ep.useSelector)(P().selectors.getMetadata),l=(0,E.useCallback)((()=>{const e=(0,O.getReferencedEntityTypeUriFromAttrType)(n),t=(0,O.getEntityType)(i,e);return(0,O.evaluateDeepEntityLabel)(o,t.dataLabelPattern)}),[n,i,o]),s=o?l():t;return b().createElement(Pq,null,(0,O.getLabel)(s),(0,O.isTempUri)(r)&&b().createElement("div",{className:a.newIcon},po().text("New")))};Uq.propTypes={entity:O.ConnectionEntityType,attributeType:O.AttributeTypeType};const jq=Uq,Fq=(0,Op.Z)((()=>({tableContainer:{width:"90%",maxWidth:"1320px",margin:"30px auto",boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)"},table:{height:0,"& td, & th":{padding:"12px",overflowWrap:"anywhere"},"& th":{fontSize:"12px"},"& td":{fontSize:"13px"},"& tr":{"& > *:first-child":{paddingLeft:"24px"},"& > *:last-child":{paddingRight:"24px"}}},attributeColumn:{width:"35%"},conditionColumn:{width:"20%"},operatorColumn:{width:"10%"},valueColumn:{width:"15%"},optionsColumn:{width:"5%"}}))),Mq=()=>{const e=Fq(),t=(0,Ep.useSelector)(gu),r=(0,Ep.useSelector)(P().selectors.getMetadata),n=(0,Ep.useSelector)(P().selectors.getAttributesPresentation),a=(0,Ep.useSelector)(P().selectors.getLookups),o=(0,E.useMemo)((()=>Rq(r,t)),[t,r]);return b().createElement(nq(),{className:e.tableContainer,component:QI()},b().createElement(XG(),{className:e.table},b().createElement(oq(),null,b().createElement(lq(),null,b().createElement(tq(),{className:e.attributeColumn},po().text("Attribute")),b().createElement(tq(),{className:e.conditionColumn},po().text("Condition")),b().createElement(tq(),{className:e.operatorColumn},po().text("Operator")),b().createElement(tq(),{className:e.valueColumn,colSpan:2}),b().createElement(tq(),{className:e.valueColumn}),b().createElement(tq(),{className:e.optionsColumn}))),b().createElement(JG(),null,o.map(((e,t)=>{let{scaffolds:o,attributeTypeData:i,conditions:l,operation:s,attributeValueToFind:c,attributeValue:u,pin:p,addNestedAttribute:d}=e;const m=!(0,R.isNil)(u),y=!(0,R.isNil)(c);return b().createElement(lq(),{key:t},b().createElement(tq(),null,b().createElement(Pq,null,o&&b().createElement(Nq,{scaffolds:o}),b().createElement(hq,{attributeTypeData:i}))),b().createElement(tq(),null,b().createElement(pq,{attributesPresentation:n,metadata:r,lookups:a,conditions:l})),b().createElement(tq(),null,s&&b().createElement(uq,{operation:s})),b().createElement(tq(),null,y&&b().createElement(cq,{lookups:a,attributeType:i.attributeType,value:c})),b().createElement(tq(),{align:"right"},y&&m&&b().createElement(Pq,null,b().createElement("span",null,po().text("with")))),b().createElement(tq(),null,m&&((0,O.isReference)(i.attributeType)?b().createElement(jq,{entity:u,attributeType:i.attributeType}):b().createElement(cq,{lookups:a,attributeType:i.attributeType,value:u}))),b().createElement(tq(),{align:"right"},b().createElement(Lq,{pin:p,addParent:d})))})))))},Vq=(0,Op.Z)((e=>({tableContainer:{display:"flex",flexDirection:"column",backgroundColor:"#fff",width:"100%",margin:"30px 60px",padding:"24px"},text:{paddingTop:"2px",paddingBottom:"1px","& p":{fontSize:"14px",lineHeight:"16px",margin:0,letterSpacing:0,color:e.palette.text.primary}}}))),Bq=()=>{const e=Vq(),t=(0,Ep.useSelector)(Kc),r=(0,Ep.useSelector)(du);return t===$.dV.UpdateProfiles?b().createElement(Mq,null):b().createElement("div",{className:e.tableContainer},b().createElement("div",{className:e.text},b().createElement("p",null,`${po().text("Please confirm that you wish to start deletion of the selected")}`,b().createElement("b",null,` ${po().number(r,"0,0")} `),po().text(" profiles.")),b().createElement("p",null,po().text("Click on Confirm to proceed."))))},zq=(0,Op.Z)((()=>({contentRoot:{padding:"0 0 5px",position:"relative",backgroundColor:"#FAFAFA"},tenantLabel:{marginLeft:"23px"}}))),Hq=()=>{const e=zq(),t=(0,Ep.useSelector)(Po.Ue),r=(0,Ep.useSelector)(Xc),n=(0,Ep.useDispatch)(),a=()=>n(No(!1));return b().createElement(Sj(),{fullScreen:!0,open:t,onClose:a,disableEnforceFocus:!0},b().createElement(HG,{onClose:a},po().text("Bulk update"),b().createElement(mW,{className:e.tenantLabel})),b().createElement(gW,null),b().createElement(sF(),{classes:{root:e.contentRoot}},(()=>{switch(r){case 0:return b().createElement(qG,null);case 1:return b().createElement($G,null);case 2:return b().createElement(AG,null);case 3:return b().createElement(Bq,null)}})()))},Yq="1px solid rgba(0, 0, 0, 0.33)",Wq=(0,Op.Z)((e=>({root:{fontFamily:"Roboto, Helvetica, Arial, sans-serif",display:"flex",overflow:"hidden",position:"absolute",top:0,left:0,bottom:0,right:0},drawer:{flex:"0 0 288px!important"},docked:{flex:"0 0 288px"},drawerPaper:{width:288,display:"flex",flexDirection:"column",position:"relative",borderRight:Yq},mainContent:{transition:e.transitions.create("margin",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),backgroundColor:"white",marginLeft:-288},"mainContent--shifted":{transition:e.transitions.create("margin",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.enteringScreen}),marginLeft:0},menuIcon:{width:"24px",height:"24px",flexShrink:0,marginRight:"12px"},goToActionIcon:{marginLeft:"12px"},buttonRoot:{flexShrink:0},buttonExtended:{width:"256px",margin:"8px 16px",padding:"12px",backgroundColor:"rgba(0,0,0,0)",boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)","&:hover":{backgroundColor:"rgba(0,0,0,0.1)"}},buttonLabel:{flexGrow:1,textAlign:"left",color:e.palette.text.secondary,fontSize:"14px",fontWeight:500,letterSpacing:0,lineHeight:"16px"},quickFilterRoot:{lineHeight:"16px",fontWeight:100,color:"rgba(0,0,0, 0.54)",letterSpacing:"normal",display:"flex",padding:"8px 0 16px 16px",flexShrink:0},withBottomBorder:{borderBottom:Yq,boxShadow:"0 1px 3px 0 rgba(0,0,0,0.12)"}}))),Gq=(0,md.T)(_y()),qq=(0,Ep.connect)((e=>({isReadyAppData:!!(0,Po.$s)(e),openAdvancedSearch:(0,Po.IJ)(e),tenant:P().selectors.getTenant(e)})))((e=>{let{openAdvancedSearch:t,isReadyAppData:r,tenant:n,dispatch:a}=e;const o=(0,E.useCallback)((()=>{a({type:k.k.CONVERT_FROM_ADVANCED_SEARCH}),a(Oo(!1))}),[a]),i=(0,E.useCallback)((()=>{a(Oo(!0)),a({type:ft})}),[a]),[l,s]=(0,E.useState)(!0),c=(0,E.useCallback)((e=>{s(e<=0)}),[]),u=Wq(),p=!t;return(0,E.useEffect)((()=>()=>O.memoizeWith.clearCache()),[n]),r?b().createElement(b().Fragment,null,b().createElement("div",{className:u.root},b().createElement(Cy,{variant:"persistent",anchor:"left",open:p,classes:{root:u.drawer,paper:u.drawerPaper,docked:u.docked},"data-reltio-id":"reltio-search-facet-search-panel"},b().createElement(Gq,{tooltipTitle:po().text("Switch to Advanced search"),tooltipPlacement:"bottom-end",variant:"extended",classes:{root:u.buttonRoot,extended:u.buttonExtended},onClick:i,"data-reltio-id":"reltio-search-advanced-search-button"},b().createElement(Ny(),{color:"primary",className:u.menuIcon}),b().createElement("span",{className:u.buttonLabel},po().text("Advanced search")),b().createElement(Py(),{color:"action",className:u.goToActionIcon})),b().createElement(Ay(),{variant:"button",classes:{root:T()(u.quickFilterRoot,{[u.withBottomBorder]:!l})}},po().text("Quick filters")),b().createElement(tE,{onScroll:c})),b().createElement(nE,{className:T()(u.mainContent,{[u["mainContent--shifted"]]:p})},b().createElement(cW,{isOpenAdvancedSearch:t,onCloseAdvancedSearch:o}))),b().createElement(Sy.O,null),b().createElement(iE,null),b().createElement(bE,null),b().createElement(Hq,null)):null})),Zq=Ey()({productionPrefix:"searchTable",disableGlobal:!0,seed:"srch"});O.userPreferencesComparator.register("searchState",((e,t)=>(0,O.looseEquals)((0,R.omit)(["query"],e),(0,R.omit)(["query"],t))));const $q=e=>{let{onResize:t=bp.ZT}=e;return b().createElement(yy.DynamicModuleLoader,{modules:[gp()]},b().createElement(vy(),{generateClassName:Zq},b().createElement(zp.Z,{handleHeight:!0,onResize:t}),b().createElement(fy._,{dateAdapter:gy.Q},b().createElement(qq,null))))}}}]);