@reltio/segmentation 1.4.27 → 1.4.29
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 +1 -0
- package/bundle.js +1 -1
- package/package.json +5 -5
- package/725.bundle.js +0 -1
- /package/{725.css → 564.css} +0 -0
package/725.bundle.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_reltio_segmentation=self.webpackChunk_reltio_segmentation||[]).push([[725],{48725:(e,t,r)=>{r.r(t),r.d(t,{ConfigureColumnsButton:()=>Nd,DEFAULT_SEARCH_SELECT:()=>Z.Tv,EntitiesTableWithConfigurableColumns:()=>dy,EntityAvatar:()=>S,ROWS_PER_PAGE_OPTIONS:()=>Z.Tu,buildQueryForAdvancedSearchGroups:()=>Fa.Jk,buildSelectFromColumns:()=>No.vw,collectSpecialColumns:()=>No.oX,createRecentSearch:()=>Ts,default:()=>zq,getActiveEntityTypeTab:()=>Do.tB,getAdditionalColumns:()=>No.oq,getDataTenant:()=>lo.lF,getEntityTypeLabel:()=>T.getEntityTypeLabel,getEntityTypeTab:()=>Do.o4,getModule:()=>yp,getPage:()=>lo.fx,getRowsPerPage:()=>lo.Uz,getSearchResultsMode:()=>Do.XM,getSearchUrlQuery:()=>vi.Cc,getSerializedSearchState:()=>Oi.Z,getTotal:()=>lo.NU,needRequestAfterColumnsChanges:()=>No.tU,parseSearchState:()=>ws.Z,queryBuilderHelpers:()=>n,queryBuilderSagas:()=>a,replaceSearchResultsColumns:()=>ws.f,showMoreResultsForEntityTypeAction:()=>Ka,showSavedSearchesDialogAction:()=>bo});var n={};r.r(n),r.d(n,{PROP_NAME_FILTER:()=>Tt,PROP_NAME_OPERATOR:()=>bt,PROP_NAME_VALUES:()=>vt,addAttributeAfter:()=>Dt,changeAttributeData:()=>Pt,createGetAttributeIndex:()=>Rt,createGetAttributeLens:()=>_t,createGetAttributeProp:()=>Nt,createGetAttributesLens:()=>At,createGetGroupLens:()=>wt,createSetAttributeProp:()=>It,defaultFindGroupPath:()=>St,deleteAttribute:()=>Lt,duplicateAttribute:()=>Ut,getAttributeData:()=>Ct,getAttributeObject:()=>xt,getEmptyAttributeObject:()=>Ot,setAttributeOperator:()=>kt,setFilter:()=>jt,setValues:()=>Ft});var a={};r.r(a),r.d(a,{toggleQueryBuilderAttributeSelect:()=>nl});var o={};r.r(o),r.d(o,{addAttributes:()=>wb,addDefaultValuesAction:()=>Ab,addNextPageOfAttributeValues:()=>Ib,modifyAttribute:()=>Rb,processNextPageOfAttributeValues:()=>Nb,profileSaved:()=>Lb,removeAttribute:()=>_b,requestNextPageOfAttributeValues:()=>Db,saveDraft:()=>kb,saveProfile:()=>Pb,validateProfile:()=>Ub});var i={};r.r(i),r.d(i,{dependentLookupsEditorTouched:()=>Bb,dependentLookupsEditorsBlocked:()=>Vb,dependentLookupsInitedTypeUrisAdded:()=>Mb,dependentLookupsStructureSet:()=>Fb});var l={};r.r(l),r.d(l,{activityFilterUpdated:()=>iv,globalFilterUpdated:()=>lv,keywordUpdated:()=>nv,saveState:()=>ov,searchResultsSet:()=>rv,setSearchNavigationData:()=>pv,setSearchOptionsConfig:()=>cv,setSearchProviderData:()=>uv,updateSearchNavigationDataFields:()=>dv,updateSearchNavigationDataOnMerge:()=>mv,updateSearchOptions:()=>sv,updateState:()=>av});var s={};r.r(s),r.d(s,{addDashboardExternalView:()=>eT,autocloseIntervalLoaded:()=>Lv,clearNotifications:()=>_v,closeNotification:()=>Rv,dateMaskUpdated:()=>zv,dateTimeMaskUpdated:()=>Hv,documentationSet:()=>Jv,entityDeletionFinished:()=>Sv,errorSet:()=>Qv,keysSet:()=>Kv,localeAttributePresentationLoaded:()=>kv,localizationLoaded:()=>Bv,navigateTo:()=>$v,newEntityShown:()=>Cv,newUiConfigLoaded:()=>Pv,numberFormatUpdated:()=>jv,openAppFromChocolateBar:()=>Mv,openConsoleApp:()=>Fv,openDashboard:()=>Wv,openEntity:()=>xv,openGraph:()=>Vv,openHistoryEvent:()=>Gv,openNewEntityWithAuthoring:()=>qv,openPerspective:()=>wv,openPivotingPerspective:()=>Xv,openPreviousPage:()=>Zv,openSearch:()=>Yv,pathsSet:()=>Iv,setPreferReact:()=>Uv,setUseSharedPreferences:()=>tT,showNotification:()=>Av,uiConfigLoaded:()=>Dv,uiPathSet:()=>Nv});var c={};r.r(c),r.d(c,{getAbsoluteImagePath:()=>oC,getActiveErrorsForAttributesPager:()=>ix,getActivityFilter:()=>Fx,getAdminToolsPath:()=>mx,getAiAssistantEnabled:()=>Nx,getAiAssistantHistoryBufferSize:()=>kx,getAiAssistantLimitPerDay:()=>Dx,getAiAssistantSkills:()=>Px,getAllRelationsToAddAndEdit:()=>eC,getAllRelationsToSave:()=>tC,getAllServicesPaths:()=>wC,getAllTreesEditingConnections:()=>yC,getApiPath:()=>sx,getAttributeTypeErrors:()=>ax,getAttributesErrors:()=>ox,getAttributesPresentation:()=>yx,getAttributesSortingStrategy:()=>jS,getAuthoringByEntityType:()=>MS,getAutoCloseInterval:()=>hx,getCanUserCreateWorkflowConfigJar:()=>kC,getCanUserCreateWorkflowEnvironmentConfigJar:()=>LC,getCanUserDeleteProfiles:()=>nS,getCanUserExecuteWorkflowJobs:()=>UC,getCanUserExecuteWorkflowJobsSyncBusinessProcessData:()=>jC,getCanUserExecuteWorkflowJobsTerminateProcessInstance:()=>FC,getCanUserExecuteWorkflowJobsUpdateTasks:()=>MC,getCanUserExecuteWorkflowJobsValidateTasks:()=>VC,getCanUserGetDQStatistic:()=>oS,getCanUserImportEntitiesFromDT:()=>JC,getCanUserMakeActivitiesExport:()=>QC,getCanUserMakeBulkUpdate:()=>rS,getCanUserMakeExport:()=>XC,getCanUserManageWorkflowDefinition:()=>BC,getCanUserManageWorkflowEnvironmentDefinition:()=>zC,getCanUserOpenDataLoader:()=>aS,getCanUserReadDVF:()=>iS,getCanUserReadEntitiesFromDT:()=>eS,getCanUserReadWorkflowDataTask:()=>HC,getCanUserRegisterConfigEnvironments:()=>PC,getCanUserStartProcessFromQuery:()=>tS,getCanUserUpdateProcessInstance:()=>YC,getCanUserUpdateWorkflowDataTask:()=>WC,getCanUserViewProcessInstanceSearchQuery:()=>GC,getCanUserViewWorkflowConfigJar:()=>qC,getCanUserViewWorkflowDefinition:()=>ZC,getCanUserViewWorkflowEnvironmentConfigJar:()=>$C,getCanUserViewWorkflowJobs:()=>KC,getCheckIfCanAddRelations:()=>xS,getCleanseByEntityType:()=>VS,getCollaborationPath:()=>_C,getConnectionsByViewId:()=>MO,getConnectionsTemporaryUrisForCreation:()=>YO,getConnectionsWithDraftsByViewId:()=>zO,getDBConnectorSideViews:()=>gS,getDVFPath:()=>IC,getDataTenants:()=>AO,getDateMask:()=>Ex,getDateTimeMask:()=>bx,getDependentLookupEditorState:()=>TS,getDependentLookupEditorsState:()=>vS,getDependentLookups:()=>fS,getDependentLookupsInitedTypeUris:()=>bS,getDependentLookupsStructure:()=>hS,getDependentLookupsStructureNode:()=>ES,getDocReleaseNotes:()=>DS,getDraftsForSaveByViewId:()=>HO,getDtssPath:()=>xC,getEditingOrAddingConnectionByViewIdAndRelationUri:()=>VO,getEditingOrAddingConnectionRelationObjectByViewIdAndRelationUri:()=>BO,getEntity:()=>UO,getEntityRelatedAttributesByAttributeTypeUri:()=>nx,getEntityUri:()=>jO,getEntityUriWithDataTenant:()=>FO,getEntityWithDiff:()=>CS,getEntityWithoutDiff:()=>SS,getEnvironment:()=>TC,getEnvironmentAlias:()=>OC,getEnvironmentObject:()=>NO,getExportDQPath:()=>CC,getExportPath:()=>cx,getGlobalFilter:()=>Yx,getGlobalFilterQuery:()=>Wx,getGlobalFilterSavedSearchesUris:()=>Gx,getGlobalSearchRequestOptions:()=>zx,getGoogleMapKey:()=>Sx,getHeaderColor:()=>kS,getHistoryDiff:()=>$O,getHistoryEvent:()=>KO,getHistoryMode:()=>JO,getHistorySlice:()=>XO,getIcpLicenseKey:()=>wx,getImageAttributesFieldsOrder:()=>xx,getImagePath:()=>lx,getImageServicePath:()=>dx,getInitialConnection:()=>nC,getInitialConnectionTempEntity:()=>rC,getIsAuthoringMode:()=>BS,getIsEditableMode:()=>Zx,getIsHistoryModeEnabled:()=>QO,getIsSuggestMode:()=>Kx,getIsViewMode:()=>$x,getLogo:()=>PS,getLookupAutocomplete:()=>Cx,getLookups:()=>GO,getMaxValuesInResponse:()=>fx,getMetadata:()=>_O,getMlDqPath:()=>DC,getMode:()=>qx,getModifiedEntities:()=>rx,getModifiedEntity:()=>ex,getModifiedEntityDefaultProfilePic:()=>tx,getNotifications:()=>Tx,getPivotingAttributes:()=>Ox,getProfile:()=>kO,getProfileCancelNeedConfirm:()=>EC,getProfileCheckUpdate:()=>FS,getProfileErrors:()=>qO,getProfileLastLoadedTime:()=>gC,getProfileOperation:()=>fC,getProfileViews:()=>hC,getQueryEstimatorEnabled:()=>zS,getRelationToAddByViewId:()=>Qx,getRelations:()=>Xx,getRelationsToEditByViewId:()=>Jx,getRelationsViewIds:()=>ZO,getReleaseVersion:()=>NS,getReltioPath:()=>px,getRequestProviderConfiguration:()=>vx,getSearch:()=>LO,getSearchKeyword:()=>jx,getSearchNavigationData:()=>Bx,getSearchOptions:()=>Mx,getSearchProviderData:()=>Vx,getSearchResults:()=>Ux,getServicesPath:()=>wS,getSharedPreferencesEnabled:()=>Lx,getShowAttributeDescription:()=>US,getShowEntityId:()=>IS,getShowSearchByOv:()=>LS,getStringifiedSearchOptions:()=>Hx,getTenant:()=>bC,getTenantName:()=>vC,getTenantObject:()=>IO,getTenants:()=>RO,getTotalByViewId:()=>WO,getTree:()=>cC,getTreeCommands:()=>dC,getTreeEditingConnection:()=>mC,getTreeRoot:()=>uC,getTreeTotal:()=>pC,getTrees:()=>sC,getUIConfig:()=>AS,getUIConfigLayout:()=>RS,getUIConfigProfile:()=>_S,getUIPath:()=>ux,getUi:()=>PO,getUiError:()=>OS,getUiNumberFormat:()=>gx,getUser:()=>DO,getUserName:()=>iC,getUserRoles:()=>lC,getValidateReadMode:()=>Rx,getValidateReferenceEntityInReadMode:()=>Ix,getValidateRelations:()=>_x,getValidationServicePath:()=>NC,getValidationServiceSeverityLevels:()=>Ax,getViewIdsForOpenRelation:()=>aC,getWorkflowConfigurationEnabled:()=>RC,getWorkflowEnvironmentUrl:()=>AC,getWorkflowPath:()=>SC,isCollaborationEnabled:()=>lS,isCollaborationSideViewEnabled:()=>dS,isDBConnectorSideViewEnabled:()=>yS,isHistorySideViewEnabled:()=>mS,isWorkflowEnabled:()=>sS,isWorkflowSideViewEnabled:()=>pS});var u={};r.r(u),r.d(u,{authoringDraftEntitiesLoaded:()=>Ew,clearEntity:()=>Tw,entityCloneRequested:()=>vw,entityCreationRequested:()=>fw,entityCreationWithAuthoringRequested:()=>hw,entityLoaded:()=>mw,entityRemoveRequested:()=>bw,loadEntity:()=>gw,setDefaultProfilePic:()=>yw});var p={};r.r(p),r.d(p,{errorDeactivated:()=>Rw,errorsSet:()=>_w});var d={};r.r(d),r.d(d,{clearHistoryDiff:()=>Lw,clearHistoryEvent:()=>jw,setHistoryDiff:()=>kw,setHistoryEvent:()=>Uw,setHistoryMode:()=>Mw,setHistorySlice:()=>Fw});var m={};r.r(m),r.d(m,{lookupsForTypeResolved:()=>Gw,lookupsListResolved:()=>qw,lookupsLoaded:()=>Ww});var y={};r.r(y),r.d(y,{modeCancelEditing:()=>Qw,modeEditingCanceled:()=>Jw,modeUpdated:()=>Xw});var g={};r.r(g),r.d(g,{cleanseLoading:()=>sA,entityCreated:()=>aA,entityDeleted:()=>oA,modifiedEntitiesReset:()=>lA,setDefaultProfilePic:()=>iA});var f={};r.r(f),r.d(f,{addRelation:()=>xA,closeRelationEditor:()=>wA,editRelation:()=>CA,ignoreRelation:()=>OA,openRelationEditor:()=>SA,relationsLoaded:()=>bA,removeRelation:()=>TA,secondLevelRelationsLoaded:()=>vA,setInitialInfo:()=>_A,setRelationEntity:()=>RA,setRelationType:()=>AA}),r(69448);var h=r(8156),E=r.n(h),b=r(78310),v=r.n(b),T=r(2396),O=r(55743),x=r.n(O),C=r(79358);const S=e=>{let{entity:t,avatarClassName:r,imageClassName:n}=e;const a=(0,C.AH)(),o=(0,C.$H)()||"",i=(0,T.getEntityImage)(a,o,t),l=(0,T.getAbsoluteImageUrl)(o,(0,T.getEntityTypeImage)(a,t.type)),s=e=>{e.target.onError=null,e.target.src=(0,T.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 E().createElement(x(),{className:v()(r,n),src:i,imgProps:{onError:s}},E().createElement("img",{className:n,src:l,alt:"fallback entity avatar",onError:s}))};var w=r(75580),A=r(73288),R=r(62391),_=r(9400),I=r(8523),N=r(42308),D=r.n(N),P=r(61882),k=r(26040),L=r(5950);function U(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){j(e,t,r[t])}))}return e}function j(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const F={facetsConfigs:[],facetsData:{},recommendedFacets:[],addedFacets:[]},M=(0,R.Ic)("facetsConfigs"),V=(0,R.Ic)("facetsData"),B=(0,R.Ic)("recommendedFacets"),z=(0,R.Ic)("addedFacets"),H=(e,t,r)=>Object.keys(e).reduce(((t,n)=>(0,A.prop)(n,t)?(0,R.ET)(n,r).set(t,e[n]):t),U({},t)),Y=e=>{let{state:t,facetsConfigs:r,addToEnd:n=!1,facetsData:a={}}=e;const o=r.filter((e=>e.fieldName)),i=M.get(t),l=M.set(t,n?i.concat(o):o.concat(i)),s=V.get(t),c=o.reduce(((e,t)=>U({},e,{[t.fieldName]:(0,_.DV)(t.fieldName,a[t.fieldName])})),U({},s));return V.set(l,c)},W=(e,t)=>{const r=V.get(e),n=M.get(e),a=U({},r);t.forEach((e=>{delete a[e]}));const o=V.set(e,a);return M.set(o,n.filter((e=>!t.includes(e.fieldName))))},G=e=>{let{facetFieldName:t,values:r,state:n}=e;const a=[...(0,I.jK)(t),"values"];return(0,R.ET)(...a).set(n,r)},q=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:F,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case P.k.CREATE_FACETS:{const{facetsConfigs:r,addToEnd:n}=t.payload;return Y({state:e,facetsConfigs:r,addToEnd:n})}case N.search.constants.UPDATE_STATE:{const{facetsConfigs:e=[],facetsData:r={}}=t.payload.facets||{facetsConfigs:[]};return Y({state:F,facetsConfigs:e,facetsData:r})}case P.k.DESTROY_FACETS:{const r=t.payload||[];return W(e,r)}case P.k.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;return G({facetFieldName:r,values:n,state:e})}case P.k.SHOW_MORE_ENTITY_TYPES:{const{show:r}=t.payload,n="type",a=(0,I.jK)(n);if(r)return(0,R.ET)(...a,"showAllItems").set(e,r);{const t=(0,R.ET)(...a);return t.set(e,(0,A.omit)(["showAllItems"],t.get(e)))}}case P.k.CLEAR_ALL_VALUES:case k.Z.CLEAR_ALL:{const t=V.get(e),r=Object.keys(t).reduce(((e,t)=>U({},e,{[t]:[]})),{}),n=H(r,t,"values");return V.set(e,n)}case P.k.UPDATE_DATA:{const r=t.payload||{},n=V.get(e),a=H(r,n,"data");return V.set(e,a)}case P.k.UPDATE_FILTERED_DATA:{const r=t.payload||{},n=V.get(e),a=H(r,n,"filteredData");return V.set(e,a)}case P.k.DESTROY_FILTERED_DATA:{const r=t.payload||{},n=(0,I.jK)(r);if((0,A.path)(n,e)){const t=(0,R.ET)(...n),r=U({},t.get(e));if(r.filteredData)return delete r.filteredData,t.set(e,r)}break}case P.k.SET_RECOMMENDED_FACETS_LIST:return B.set(e,t.payload||[]);case P.k.HIGHLIGHT_ADDED_FACETS:return z.set(e,t.payload);case P.k.CLEAR_HIGHLIGHT_ADDED_FACETS:return z.set(e,[]);case"UI_RESET":return U({},F);case k.Z.CHANGE_CURRENT_TENANT:{const{isDataTenant:r,tenantObject:n}=t.payload;if(r){const t=M.get(e),r=V.get(e),a=(0,L.ci)(n,t),o=(0,A.pluck)("fieldName",a),i=(0,A.pipe)((0,A.pick)(o),(0,L.AZ)(n))(r);return V.set(M.set(e,a),i)}return e}}return e};var Z=r(71403);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){K(e,t,r[t])}))}return e}function K(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const X={searchResults:null,searchResultsByEntityTypes:{},total:0,page:0,sortField:null,sortOrder:null,rowsPerPage:Z.Tu[0],loading:!1,searchParams:{searchBoxInput:{fieldName:"attributes",filter:"containsWordStartingWith"},mapSearch:{fieldName:"geoLocation",type:"geoLocation",filter:"range",values:[]}},currentTenant:null},Q=(0,R.Ic)("searchResults"),J=(0,R.Ic)("total"),ee=(0,R.Ic)("page"),te=(0,R.Ic)("rowsPerPage"),re=(0,R.Ic)("sortField"),ne=(0,R.Ic)("sortOrder"),ae=(0,R.Ic)("loading"),oe=(0,R.ET)("searchParams","mapSearch","values"),ie=(0,R.ET)("searchParams","mapSearch","type"),le=(0,R.ET)("searchParams","mapSearch","fieldName"),se=(0,R.Ic)("searchResultsByEntityTypes"),ce=e=>se.compose((0,R.ET)(e,"page")),ue=(e,t)=>{let{entityTypeUri:r,field:n,order:a}=e;if(r){const e=se.compose((0,R.ET)(r,"sortField")),o=se.compose((0,R.ET)(r,"sortOrder")),i=e.set(t,n);return o.set(i,a)}{const e=re.set(t,n);return ne.set(e,a)}},pe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:X,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case k.Z.UPDATE_ENTITIES:{const{searchResults:r,entityTypeUri:n}=t.payload;return n?se.compose((0,R.ET)(n,"searchResults")).set(e,r):Q.set(e,r)}case k.Z.UPDATE_TOTAL:return J.set(e,t.payload);case k.Z.CHANGE_PAGE:{const{entityTypeUri:r,pageNumber:n}=t.payload;return r?ce(r).set(e,n):ee.set(e,n)}case k.Z.RESET_PAGE:{const{entityTypeUri:r}=t.payload,n=ee.set(e,0);return r?ce(r).set(n,0):n}case k.Z.CHANGE_ROWS_PER_PAGE:{const{entityTypeUri:r,number:n}=t.payload;if(r){const t=se.compose((0,R.ET)(r,"rowsPerPage")),a=ce(r).set(e,0);return t.set(a,n)}{const t=ee.set(e,0);return te.set(t,n)}}case k.Z.CHANGE_SORT:return ue(t.payload,e);case k.Z.CHANGE_LOADING:return ae.set(e,t.payload);case N.search.constants.UPDATE_STATE:{const{values:r=[],searchType:n=T.MAP_SEARCH_TYPES.geoPolygon}=t.payload.map||{};let a=oe.set(X,r);if(a=ie.set(a,n),a=le.set(a,(0,T.mapSearchTypeToFieldName)(n)),t.payload.view){const{entityTypeTab:e,sortField:r,sortOrder:n}=t.payload.view;a=ue({entityTypeUri:e,field:r,order:n},a)}return $({},a,{currentTenant:t.payload.currentTenant||e.currentTenant,searchOptions:t.payload.searchOptions||e.searchOptions})}case"UI_RESET":return $({},X);case k.Z.MAP_CHANGE_VALUE:{const{value:r,searchType:n}=t.payload;let a=ie.set(e,n);return a=le.set(a,(0,T.mapSearchTypeToFieldName)(n)),oe.set(a,r?[r]:[])}case k.Z.CLEAR_RESULTS:{const r=t.payload;if(r){let t=Q.set(e,void 0);const n=se.get(e);return se.set(t,{[r]:n[r]})}return se.set(e,{})}case k.Z.CLEAR_ALL:return oe.set(e,[]);case k.Z.CHANGE_CURRENT_TENANT:return $({},e,{currentTenant:t.payload.tenantObject.id})}return e},de="UI_SHOW_MORE_FACETS_POPUP",me="UI_SHOW_SAVED_SEARCHES_DIALOG",ye="UI_SHOW_SAVE_SEARCH_DIALOG",ge="UI_SHOW_ADVANCED_SEARCH",fe="UI_SHOW_BULK_UPDATE",he="UI_SET_MARKER",Ee="UI_SET_HOVERED_ENTITY_URI",be="UI_SET_ACTIVE_ADDITIONAL_SEARCH",ve="UI_SET_SEARCH_RESULTS_COLUMNS",Te="UI_CHANGE_SEARCH_RESULTS_COLUMNS",Oe="UI_SET_ENTITY_TYPE_TAB",xe="UI_UPDATE_TABLE_VIEW_TABS",Ce="UI_CHANGE_ORDER_SEARCH_RESULTS_COLUMNS",Se="UI_CHANGE_SIZES_SEARCH_RESULTS_COLUMNS",we="UI_SET_LOADING",Ae="UI_CLEAR_NOTIFICATION",Re="UI_SET_NOTIFICATION",_e="UI_SET_SEARCH_RESULTS_MODE",Ie="UI_SET_PREVIEW_PANEL_MODE",Ne={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},De=(0,R.Ic)("showMoreFacetsPopup"),Pe=(0,R.Ic)("showSavedSearchesDialog"),ke=(0,R.Ic)("showSaveSearchDialog"),Le=(0,R.Ic)("showAdvancedSearch"),Ue=(0,R.Ic)("showBulkUpdate"),je=(0,R.Ic)("activeAdditionalSearch"),Fe=(0,R.Ic)("activeMarker"),Me=(0,R.Ic)("hoveredEntityUri"),Ve=(0,R.Ic)("searchResultsMode"),Be=(0,R.Ic)("previewPanelMode"),ze=(0,R.Ic)("searchResultsColumns"),He=(0,R.Ic)("entityTypeTab"),Ye=(0,R.Ic)("tableViewTabs"),We=(0,R.Ic)("loading"),Ge=(0,R.Ic)("notification"),qe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ne,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case de:return De.set(e,t.payload);case me:return Pe.set(e,t.payload);case ye:return ke.set(e,t.payload.show);case ge:return Le.set(e,t.payload);case fe:return Ue.set(e,t.payload);case be:{const r=je.get(e)===t.payload?null:t.payload;return je.set(e,r)}case he:return Fe.set(e,t.payload);case Ee:return Me.set(e,t.payload);case _e:return Ve.set(e,t.payload);case ve:return ze.set(e,t.payload);case Te:{const{entityTypeUri:r,columns:n}=t.payload;return ze.compose((0,R.Ic)(r)).set(e,n)}case Se:{const{entityTypeUri:r,columns:n}=t.payload;return ze.compose((0,R.Ic)(r)).set(e,n)}case Ce:{const{entityTypeUri:r,columns:n}=t.payload;return ze.compose((0,R.Ic)(r)).set(e,n)}case Ie:return Be.set(e,t.payload);case Oe:return He.set(e,t.payload.entityTypeUri);case xe:return Ye.set(e,t.payload);case P.k.UPDATE_DATA:if((0,A.has)("type",t.payload))return Ye.set(e,t.payload.type);break;case P.k.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;if("type"===r&&n.length){const t=He.get(e);if(!n.includes(t))return He.set(e,n[0])}break}case"UI_RESET":return Ne;case we:return We.set(e,t.payload);case Re:return Ge.set(e,t.payload);case Ae:return Ge.set(e,null);case N.search.constants.UPDATE_STATE:{let r=Le.set(e,(0,A.has)("advanced",t.payload));if(t.payload.view){const{searchResultsMode:e,entityTypeTab:n,searchResultsColumns:a,previewPanelMode:o}=t.payload.view;r=Ve.set(r,e),r=He.set(r,n),(0,T.isEmptyValue)(a)||(r=ze.set(r,a)),r=Be.set(r,o)}return t.payload.showSavedSearchesDialog&&(r=Pe.set(r,t.payload.showSavedSearchesDialog)),r}}return e};var Ze=r(37164);const $e="ADVANCED_SEARCH_SET_GROUP_ENTITY_TYPES",Ke="ADVANCED_SEARCH_VERIFY_GROUP_ENTITY_TYPES",Xe="ADVANCED_SEARCH_SET_GROUP_OPERATOR",Qe="ADVANCED_SEARCH_DELETE_GROUP",Je="ADVANCED_SEARCH_ADD_GROUP",et="ADVANCED_SEARCH_DUPLICATE_GROUP",tt="ADVANCED_SEARCH_ADD_ATTRIBUTE_AFTER",rt="ADVANCED_SEARCH_CHANGE_ATTRIBUTE_DATA",nt="ADVANCED_SEARCH_TOGGLE_ATTRIBUTE_SELECT",at="ADVANCED_SEARCH_SET_ATTRIBUTE_OPERATOR",ot="ADVANCED_SEARCH_DELETE_ATTRIBUTE",it="ADVANCED_DELETE_ATTRIBUTE_AND_VERIFY_GROUP_ENTITY_TYPES",lt="ADVANCED_SEARCH_DUPLICATE_ATTRIBUTE",st="ADVANCED_SEARCH_SET_FILTER",ct="ADVANCED_SEARCH_SET_VALUES",ut="ADVANCED_SEARCH_ATTRIBUTE_SET_VALUES",pt="ADVANCED_SEARCH_ATTRIBUTE_FILTER_VALUES",dt="ADVANCED_SEARCH_ATTRIBUTE_SET_FILTERED_VALUES",mt="ADVANCED_SEARCH_ATTRIBUTE_UPDATE_VALUES",yt="ADVANCED_SEARCH_UPDATE",gt="ADVANCED_SEARCH_CONVERT_FROM_FACETS";var ft=r(81253);function ht(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){Et(e,t,r[t])}))}return e}function Et(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bt="operator",vt="values",Tt="filter",Ot=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,Ze.x0)();return{[bt]:Z.YL.value,id:e}},xt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,Ze.x0)();const r=Ct(e);return{data:r,[bt]:Z.YL.value,[Tt]:(0,A.pathOr)("",["filterOptions",0],r),id:t}},Ct=e=>ht({},e,{filterOptions:e.enforcedFilterOptions||(0,T.getFilterOptionsForQueryBuilder)(e.attrType,e.fieldName)}),St=(0,A.curry)(((e,t)=>{const r=t.findIndex((t=>t.id===e));return r>-1?[r]:null})),wt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:St;return(r,n)=>{const a=(0,R.ET)(...e).get(r),o=t(n,a);return!!o&&(0,R.ET)(...e,...o)}},At=(e,t)=>(r,n)=>{const a=e(r,n);return a&&a.compose((0,R.Ic)(t))},Rt=e=>(t,r,n)=>{const a=e(t,r);return a?a.get(t).findIndex((e=>e.id===n)):-1},_t=e=>(t,r,n)=>{const a=e(t,r),o=Rt(e)(t,r,n);return-1!==o?a.compose((0,R.ET)(o)):null},It=e=>(t,r,n,a,o)=>{const i=e(t,r,n);if(i){const e=ht({},i.get(t));return e[a]=o,i.set(t,e)}return t},Nt=e=>(t,r,n,a)=>{const o=e(t,r,n);if(o)return o.get(t)[a]},Dt=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,ht({},a,{operator:e[o].operator})),e[o]=ht({},e[o],{operator:Z.YL.value})):e.push(a),l.set(t,e)}return t},Pt=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,Tt,a.filterOptions[0])),l=o(l,r,n,vt,[]),o(l,r,n,"data",a);{const e=i(t,r,n);return e&&(l=e.set(l,Ot(n))),l}},kt=e=>{let{state:t,groupId:r,attributeId:n,operator:a,setAttributeProp:o}=e;return o(t,r,n,bt,a)},Lt=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,A.remove)(r,1,e),a=n[r-1],i=e[r];return a&&(n[r-1]=ht({},a,{operator:i.operator})),o.set(t,n)}}return t},Ut=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(ht({},e[r],{id:a})),i.set(t,e)}return t},jt=e=>{let{state:t,groupId:r,attributeId:n,filter:a,getAttributeProp:o,setAttributeProp:i}=e;const l=o(t,r,n,Tt),s=(0,T.isCompatibleFilters)(l,a)?t:i(t,r,n,vt,[]);return i(s,r,n,Tt,a)},Ft=e=>{let{state:t,groupId:r,attributeId:n,values:a,setAttributeProp:o}=e;return o(t,r,n,vt,a)};function Mt(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){Vt(e,t,r[t])}))}return e}function Vt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Bt={searchParams:{groups:[]},attributesData:{}},zt="entityTypes",Ht="attributes",Yt="autoAddedEntityTypes",Wt=["groups"],Gt=(0,R.ET)(...Wt),qt=wt(Wt),Zt=At(qt,Ht),$t=Rt(Zt),Kt=_t(Zt),Xt=It(Kt),Qt=Nt(Kt),Jt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(0,Ze.x0)();return{[Ht]:e.map((e=>xt(e))),[bt]:Z.qx.value,[zt]:t,id:r}},er=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Bt.attributesData,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case dt:{const{groupId:r,attributeId:n,values:a}=t.payload;return(0,A.assocPath)([r,n,"filtered"],a,e)}case Qe:{const{groupId:r}=t.payload;return(0,A.dissoc)(r,e)}case ot:{const{groupId:r,attributeId:n}=t.payload;return(0,A.dissocPath)([r,n],e)}case et:{const{groupId:r,id:n}=t.payload,a=e[r];return a?(0,A.assoc)(n,a,e):e}case lt:{const{groupId:r,attributeId:n,id:a}=t.payload,o=(0,A.path)([r,n],e);return o?(0,A.assocPath)([r,a],o,e):e}case k.Z.CLEAR_ALL:case N.search.constants.UPDATE_STATE:return Bt.attributesData;default:return e}},tr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Bt.searchParams,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Je:{const{group:r}=t.payload,n=[...Gt.get(e)];return n.push(r),Gt.set(e,n)}case Xe:{const{groupId:r,operator:n}=t.payload,a=qt(e,r);if(a){const t=Mt({},a.get(e));return t[bt]=n,a.set(e,t)}return e}case $e:{const{groupId:r,entityTypes:n}=t.payload,a=qt(e,r);if(a){const t=Mt({},a.get(e));return t.entityTypes=n,t.autoAddedEntityTypes=[],t.attributes=[],a.set(e,t)}return e}case Ke:{const{groupId:r}=t.payload,n=qt(e,r);if(n){const t=n.get(e),{entityTypes:r,autoAddedEntityTypes:a}=(0,ft.tg)((0,ft.r8)(t.attributes||[]),t.entityTypes,t.autoAddedEntityTypes);return n.set(e,Mt({},t,{[zt]:r,[Yt]:a}))}return e}case Qe:{const{groupId:r}=t.payload,n=[...Gt.get(e)],a=n.findIndex((e=>e.id===r));if(a>-1){const t=(0,A.remove)(a,1,n),r=t[a-1],o=n[a];return r&&(t[a-1]=Mt({},r,{operator:o.operator})),Gt.set(e,t)}return e}case et:{const{groupId:r,id:n}=t.payload,a=[...Gt.get(e)],o=a.findIndex((e=>e.id===r));return o>-1?(a.push(Mt({},a[o],{id:n})),Gt.set(e,a)):e}case tt:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return Dt({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:Zt,getAttributeIndex:$t})}case rt:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return Pt({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:Xt,getAttributeLens:Kt})}case at:{const{groupId:r,attributeId:n,operator:a}=t.payload;return kt({state:e,groupId:r,attributeId:n,operator:a,setAttributeProp:Xt})}case ot:{const{groupId:r,attributeId:n}=t.payload;return Lt({state:e,groupId:r,attributeId:n,getAttributesLens:Zt})}case lt:{const{groupId:r,attributeId:n,id:a}=t.payload;return Ut({state:e,groupId:r,attributeId:n,id:a,getAttributesLens:Zt})}case st:{const{groupId:r,attributeId:n,filter:a}=t.payload;return jt({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:Qt,setAttributeProp:Xt})}case ct:{const{groupId:r,attributeId:n,values:a}=t.payload;return Ft({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:Xt})}case k.Z.CLEAR_ALL:return Bt.searchParams;case N.search.constants.UPDATE_STATE:{const{advanced:e=[]}=t.payload;return Gt.set(Bt.searchParams,e)}default:return e}},rr=(e,t)=>{const r=((e,t)=>{if(t.type===ut){var r;const{groupId:n,attributeId:a,values:o}=t.payload;return((null===(r=[...Gt.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,A.assocPath)(["attributesData",n,a,"default"],o,e):e}return e})((0,w.combineReducers)({searchParams:tr,attributesData:er})(e,t),t);return r},nr="SAVED_SEARCHES_CREATE",ar="SAVED_SEARCHES_SET_CURRENT",or="SAVED_SEARCHES_SET_CHANGE_INDICATOR",ir="SAVED_SEARCHES_UPDATE",lr="SAVED_SEARCHES_LOAD",sr="SAVED_SEARCHES_SET_TOTAL",cr="SAVED_SEARCHES_SET_ITEMS",ur="SAVED_SEARCHES_SET_ITEM_TOTAL",pr="SAVED_SEARCHES_SET_PAGE",dr="SAVED_SEARCHES_SET_ROWS_PER_PAGE",mr="SAVED_SEARCHES_SET_FILTERS",yr="SAVED_SEARCHES_SELECT_ITEM",gr="SAVED_SEARCHES_SELECT_ALL_ITEMS",fr="SAVED_SEARCHES_DESELECT_ALL_ITEMS",hr="SAVED_SEARCHES_MARK_PUBLIC_REQUEST",Er="SAVED_SEARCHES_MARK_PUBLIC",br="SAVED_SEARCHES_MARK_FAVORITE_REQUEST",vr="SAVED_SEARCHES_MARK_FAVORITE",Tr="SAVED_SEARCHES_MARK_GLOBAL_FILTER_REQUEST",Or="SAVED_SEARCHES_CHANGE_ITEM_NAME_REQUEST",xr="SAVED_SEARCHES_CHANGE_ITEM_NAME",Cr="SAVED_SEARCHES_SET_EDITING",Sr="SAVED_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",wr="SAVED_SEARCHES_DELETE_ITEM_REQUEST",Ar="SAVED_SEARCHES_DELETE_ITEMS",Rr="SAVED_SEARCHES_SET_LOADING",_r="SAVED_SEARCHES_SET_SEARCH_VALUE",Ir="SAVED_SEARCHES_APPLY_ITEM",Nr="SAVED_SEARCHES_SET_TOTAL_LOADING",Dr="SAVED_SEARCHES_LOAD_TOTAL",Pr="SAVED_SEARCHES_TOGGLE_SORT",kr="RECENT_SEARCHES_CREATE",Lr="RECENT_SEARCHES_LOAD",Ur="RECENT_SEARCHES_SET_ITEMS",jr="RECENT_SEARCHES_SET_ITEM_TOTAL",Fr="RECENT_SEARCHES_SELECT_ITEM",Mr="RECENT_SEARCHES_SELECT_ALL_ITEMS",Vr="RECENT_SEARCHES_DESELECT_ALL_ITEMS",Br="RECENT_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",zr="RECENT_SEARCHES_DELETE_ITEMS",Hr="RECENT_SEARCHES_DELETE_ITEM_REQUEST",Yr="RECENT_SEARCHES_SET_LOADING",Wr="RECENT_SEARCHES_SET_SEARCH_VALUE",Gr="RECENT_SEARCHES_SET_LAST_SAVED",qr="RECENT_SEARCHES_SET_TOTAL_LOADING",Zr="RECENT_SEARCHES_LOAD_TOTAL",$r="RECENT_SEARCHES_APPLY_ITEM";function Kr(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){Xr(e,t,r[t])}))}return e}function Xr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qr={currentSearch:null,postSavingAction:null,changeIndicator:!1,items:[],loading:!1,total:0,page:0,rowsPerPage:Z.Tu[0],searchValue:"",findPublic:!0,favoriteOnly:!1,sorting:{order:Z.rX.DESC,field:Z.KY.updateDate}},Jr=(0,R.Ic)("changeIndicator"),en=(0,R.Ic)("items"),tn=(0,R.Ic)("total"),rn=(0,R.Ic)("page"),nn=(0,R.Ic)("loading"),an=(0,R.Ic)("postSavingAction"),on=(0,R.Ic)("sorting"),ln=(e,t,r)=>{const n=en.get(r).findIndex((e=>e.uri===t)),a=en.compose((0,R.ET)([n])),o=a.get(r);return a.set(r,e(o))},sn=e=>e===Z.rX.DESC?Z.rX.ASC:Z.rX.DESC,cn=(e,t,r)=>(0,A.evolve)({page:(0,A.always)(0),[e]:(0,A.always)(t)},r),un=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qr,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ar:return(0,A.evolve)({currentSearch:(0,A.always)(t.payload),changeIndicator:null===t.payload?(0,A.always)(!1):A.identity},e);case k.Z.CLEAR_ALL:return(0,A.evolve)({currentSearch:(0,A.always)(null),changeIndicator:(0,A.always)(!1)},e);case or:return Jr.set(e,t.payload);case sr:return tn.set(e,t.payload);case pr:return rn.set(e,t.payload);case dr:return cn("rowsPerPage",t.payload,e);case mr:{const{findPublic:r,favoriteOnly:n}=t.payload;return(0,A.evolve)({page:(0,A.always)(0),findPublic:(0,A.always)(r),favoriteOnly:(0,A.always)(n)},e)}case cr:return en.set(e,t.payload);case yr:{const{uri:r,checked:n}=t.payload;return ln((e=>Kr({},e,{checked:n})),r,e)}case fr:{const t=en.get(e);return en.set(e,t.map((0,A.omit)(["checked"])))}case gr:{const t=en.get(e);return en.set(e,t.map((0,A.ifElse)((0,A.prop)("isOwnSearch"),(0,A.assoc)("checked",!0),A.identity)))}case Ar:{const r=t.payload,n=en.get(e),a=tn.set(e,tn.get(e)-r.length);return en.set(a,n.filter((e=>!r.includes(e.uri))))}case Er:{const{uri:r,isPublic:n}=t.payload;return ln((e=>Kr({},e,{isPublic:n})),r,e)}case vr:{const{uri:r,isFavorite:n}=t.payload;return ln((e=>Kr({},e,{isFavorite:n})),r,e)}case ur:{const{uri:r,total:n}=t.payload;return ln((e=>Kr({},e,{total:n})),r,e)}case Cr:{const{uri:r,isEditing:n}=t.payload;return ln((e=>Kr({},e,{isEditing:n})),r,e)}case Or:{const{uri:r}=t.payload;return ln((0,A.omit)(["isEditing"]),r,e)}case xr:{const{uri:r,name:n}=t.payload;return ln((e=>Kr({},e,{name:n})),r,e)}case Rr:return nn.set(e,t.payload);case Wr:case _r:return cn("searchValue",t.payload,e);case lr:return Kr({},e,{page:0,findPublic:!0,favoriteOnly:!1});case Pr:{const r=t.payload,n=(0,A.path)(["sorting","field"],e),a=(0,A.path)(["sorting","order"],e);return on.set(e,{field:r,order:sn(r===n?a:null)})}case Nr:{const{uri:r,isLoading:n}=t.payload;return ln((e=>Kr({},e,{isTotalLoading:n})),r,e)}case ye:return an.set(e,t.payload.postSavingAction);case me:return cn("searchValue",Qr.searchValue,e)}return e};function pn(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){dn(e,t,r[t])}))}return e}function dn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mn={items:[],filterWord:null,loading:!1,lastSavedRecentSearch:null},yn=(0,R.Ic)("items"),gn=(0,R.Ic)("loading"),fn=(0,R.Ic)("filterWord"),hn=(0,R.Ic)("lastSavedRecentSearch"),En=(e,t,r)=>{const n=yn.get(r).findIndex((e=>e.createdDate===t)),a=yn.compose((0,R.ET)([n])),o=a.get(r);return a.set(r,e(o))},bn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:mn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case _r:case Wr:return fn.set(e,t.payload);case Ur:return yn.set(e,t.payload);case Fr:{const{searchCreatedDate:r,checked:n}=t.payload;return En((e=>pn({},e,{checked:n})),r,e)}case Vr:{const t=yn.get(e);return yn.set(e,t.map((0,A.omit)(["checked"])))}case Mr:{const t=yn.get(e);return yn.set(e,t.map((0,A.assoc)("checked",!0)))}case zr:{const r=(t.payload||[]).map((0,A.prop)("createdDate")),n=yn.get(e);return yn.set(e,n.filter((e=>!r.includes(e.createdDate))))}case jr:{const{searchCreatedDate:r,total:n}=t.payload;return En((e=>pn({},e,{total:n})),r,e)}case Yr:return gn.set(e,t.payload);case Gr:return hn.set(e,t.payload);case qr:{const{searchCreatedDate:r,isLoading:n}=t.payload;return En((e=>pn({},e,{isTotalLoading:n})),r,e)}case me:return fn.set(e,mn.filterWord)}return e},vn="ENTITY_SET_LOADING",Tn="ENTITY_LOAD_ENTITY_REQUEST",On="ENTITY_SET_SELECTED_ENTITY_URI",xn="ENTITY_SET_ENTITY",Cn={loading:!1,selectedEntityUri:null,entity:null},Sn=(0,R.Ic)("loading"),wn=(0,R.Ic)("selectedEntityUri"),An=(0,R.Ic)("entity"),Rn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Cn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case vn:return Sn.set(e,t.payload);case On:return wn.set(e,t.payload);case xn:return An.set(e,t.payload);case N.profile.constants.ProfileActions.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:o}=t.payload,i=(0,T.getAttributeSource)(a);if(e.entity&&r===e.entity.uri){const t=(0,A.lensPath)(["entity",i,n]);return(0,A.over)(t,(0,A.pipe)((0,A.defaultTo)([]),(0,A.concat)(A.__,o)),e)}return e}case N.search.constants.SEARCH_RESULTS_SET:if((0,T.isEmptyValue)(t.payload)){const t=An.set(e,Cn.entity);return wn.set(t,Cn.selectedEntityUri)}return e}return e},_n="BULK_UPDATE_SET_ACTIVE_STEP",In="BULK_UPDATE_INIT",Nn="BULK_UPDATE_TOGGLE_SELECTION_MODE",Dn="BULK_UPDATE_SELECT_ENTITY",Pn="BULK_UPDATE_SELECT_ALL_ENTITIES_ON_PAGE",kn="BULK_UPDATE_SET_LOADING",Ln="BULK_UPDATE_CHANGE_ROWS_PER_PAGE",Un="BULK_UPDATE_CHANGE_PAGE",jn="BULK_UPDATE_CHANGE_SORT",Fn="BULK_UPDATE_CHANGE_COLUMNS",Mn="BULK_UPDATE_UPDATE_ENTITIES",Vn="BULK_UPDATE_SET_FILTER_TEXT",Bn="BULK_UPDATE_SET_TOTAL",zn="UPDATE_BULK_UPDATE_CURRENT_ENTITIES",Hn="BULK_UPDATE_SET_OPERATION",Yn="BULK_UPDATE_SET_ACTION_ATTRIBUTE",Wn="BULK_UPDATE_SET_ACTION_OPERATION",Gn="BULK_UPDATE_ADD_OPERATION_PARAMETERS",qn="BULK_UPDATE_DELETE_ACTION",Zn="BULK_UPDATE_TOGGLE_CONDITIONS",$n="BULK_UPDATE_ADD_CONDITION_AFTER",Kn="BULK_UPDATE_CHANGE_CONDITION_DATA",Xn="BULK_UPDATE_TOGGLE_CONDITION_SELECT",Qn="BULK_UPDATE_DELETE_CONDITION",Jn="BULK_UPDATE_SET_CONDITION_FILTER",ea="BULK_UPDATE_SET_CONDITION_VALUES",ta="BULK_UPDATE_TOGGLE_ACTION_PIN",ra="BULK_UPDATE_TOGGLE_ACTION_ADD_NESTED",na="BULK_UPDATE_CONFIRM",aa="BULK_UPDATE_SET_REQUEST_PENDING";function oa(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){ia(e,t,r[t])}))}return e}function ia(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const la={objects:{selectionMode:Z.v6.exclude,selectedEntities:[],entities:[],total:0,page:0,rowsPerPage:Z.Tu[0],filterText:"",sortOrder:null,sortField:null,selectedColumns:[]},actions:[],operation:null,activeStep:0,loading:!1,requestPending:!1},sa=(0,R.Ic)("activeStep"),ca=(0,R.Ic)("operation"),ua=(0,R.Ic)("loading"),pa=(0,R.Ic)("requestPending"),da=(0,R.ET)("objects","total"),ma=(0,R.ET)("objects","page"),ya=(0,R.ET)("objects","rowsPerPage"),ga=(0,R.ET)("objects","selectionMode"),fa=(0,R.ET)("objects","entities"),ha=(0,R.ET)("objects","selectedEntities"),Ea=(0,R.ET)("objects","filterText"),ba=e=>ga.get(e)===Z.v6.include,va=(0,R.ET)("objects","sortOrder"),Ta=(0,R.ET)("objects","sortField"),Oa=(0,R.ET)("objects","selectedColumns"),xa=["actions"],Ca=(0,R.ET)(...xa),Sa=e=>{let{groupId:t,state:r}=e;if(t){const e=Ca.get(r).findIndex((e=>e.id===t));if(-1!==e)return[...xa,e,"actions"]}return xa},wa=(e,t)=>({id:(0,Ze.x0)(),operation:e,operationParameters:t}),Aa=e=>((0,A.path)(["attributeTypeData","fieldName"],e)||[]).split(".").slice(0,2).join("."),Ra=(e,t)=>({id:(0,Ze.x0)(),fieldName:Aa(t),actions:[wa(e,t)]}),_a=e=>{let{state:t,id:r,groupId:n,operation:a,operationParameters:o,togglePin:i,toggleAddNested:l}=e;const s=Sa({state:t,groupId:n}),c=(0,R.ET)(...s).get(t),u=!n&&(0,A.prop)("attributeTypeData",o)&&(e=>{let{attributeType:t,fieldName:r=""}=e;return(0,T.isComplexAttribute)(t)||r.split(".").length>2})(o.attributeTypeData);if(r){const e=c.findIndex((e=>e.id===r)),n=(0,R.ET)(...s,e),d=oa({},n.get(t));if(a&&d.operation!==a){if(d.operationParameters){const e=[d.operation,a].includes(Z.Vh.RepointReference)?[]:Z.KJ[a];d.operationParameters=(0,A.omit)((0,A.without)(e,["attributeValue","attributeValueToFind"]),d.operationParameters)}d.operation=a}return o&&(d.operationParameters=(0,A.reject)(A.isNil,oa({},d.operationParameters,o))),i&&(d.operationParameters=oa({},d.operationParameters,{pin:!(0,A.path)(["operationParameters","pin"],d)})),l&&(d.operationParameters=oa({},d.operationParameters,{addNestedAttribute:!(0,A.path)(["operationParameters","addNestedAttribute"],d)})),n.set(t,u?Ra((p=d).operation,p.operationParameters):d)}{const e=(0,A.reject)(A.isNil,o),r=u?Ra(a,e):wa(a,e);return(0,R.ET)(...s,c.length).set(t,r)}var p},Ia=wt(xa),Na=At(Ia,"conditions"),Da=Rt(Na),Pa=_t(Na),ka=It(Pa),La=Nt(Pa),Ua=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:la,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case _n:return sa.set(e,t.payload);case In:return oa({},la,{objects:oa({},la.objects,t.payload)});case Mn:return fa.set(e,t.payload);case Nn:{const t=ga.set(e,ba(e)?Z.v6.exclude:Z.v6.include);return ha.set(t,[])}case Dn:{const{uri:r,checked:n}=t.payload,a=ha.get(e),o=ba(e);return ha.set(e,!!n==!!o?(0,A.uniq)(a.concat(r)):(0,A.without)(r,a))}case Pn:{const r=t.payload,n=ba(e),a=ha.get(e),o=fa.get(e).map((0,A.prop)("uri"));return ha.set(e,!!r==!!n?(0,A.uniq)(a.concat(o)):(0,A.without)(o,a))}case kn:return ua.set(e,t.payload);case Un:return ma.set(e,t.payload);case Ln:{const r=ma.set(e,0);return ya.set(r,t.payload)}case jn:{const{order:r,field:n}=t.payload,a=Ta.set(e,n);return va.set(a,r)}case Fn:return Oa.set(e,t.payload);case Bn:return da.set(e,t.payload);case Vn:{const{filterText:r}=t.payload;return Ea.set(e,r)}case Hn:return ca.set(e,t.payload);case Yn:{const{id:r,groupId:n,attribute:a}=t.payload;return _a({state:e,id:r,groupId:n,operationParameters:{attributeTypeData:a,attributeValue:null,attributeValueToFind:null,pin:null,addNestedAttribute:null}})}case Wn:{const{id:r,groupId:n,operation:a}=t.payload;return _a({state:e,id:r,groupId:n,operation:a})}case Gn:{const{id:r,groupId:n,operationParameters:a}=t.payload;return _a({state:e,id:r,groupId:n,operationParameters:a})}case ta:{const{id:r,groupId:n}=t.payload;return _a({state:e,id:r,groupId:n,togglePin:!0})}case ra:{const{id:r,groupId:n}=t.payload;return _a({state:e,id:r,groupId:n,toggleAddNested:!0})}case qn:{const{id:r,groupId:n}=t.payload,a=Sa({state:e,groupId:n}),o=(0,R.ET)(...a),i=o.get(e);return o.set(e,i.filter((e=>e.id!==r)))}case Zn:{const r=t.payload,n=Ca.get(e).findIndex((e=>e.id===r)),a=(0,R.ET)(...xa,n),o=a.get(e);return a.set(e,o.conditions?(0,A.omit)(["conditions"],o):(0,A.assoc)("conditions",[],o))}case $n:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return Dt({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:Na,getAttributeIndex:Da})}case Kn:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return Pt({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:ka,getAttributeLens:Pa})}case Qn:{const{groupId:r,attributeId:n}=t.payload;return Lt({state:e,groupId:r,attributeId:n,getAttributesLens:Na})}case Jn:{const{groupId:r,attributeId:n,filter:a}=t.payload;return jt({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:La,setAttributeProp:ka})}case ea:{const{groupId:r,attributeId:n,values:a}=t.payload;return Ft({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:ka})}case aa:return pa.set(e,t.payload)}return e};var ja=r(85383),Fa=r(82349),Ma=r(12848),Va=r(33192),Ba=r.n(Va),za=r(17848);const Ha=(e,t,r)=>{const n=Ya(t);if(n.length){const o=Ga(e,t,r),i=Wa(e,t,r),l=i.every((e=>(0,T.isTypeSearchGroupAttribute)({data:e})||o.some((0,A.eqProps)("fieldName",e)))),s=(0,T.areAllOperatorsAnd)(t),c=(0,T.areAllOperatorsAnd)(n),u=n.every((e=>{let{filter:t,data:{attrType:r={}}}=e;return[T.FilterOptions.EQUALS,T.FilterOptions.IN_RANGE,T.FilterOptions.FULL_TEXT,T.FilterOptions.ON,T.FilterOptions.WITHIN].includes(t)||T.FilterOptions.EXISTS===t&&(0,T.isBooleanType)(r.type)})),p=(a=n,!Object.values(a.reduce(((e,t)=>{let{data:{fieldName:r},filter:n,values:a}=t;return n===T.FilterOptions.EQUALS&&(0,A.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},Ya=e=>e.flatMap((e=>e.attributes)).filter((0,A.has)("data")),Wa=(e,t,r)=>{const n=Ya(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,_.eC)(e,[a],[],r).find((e=>e.fieldName===o))||{}:(0,za.zH)(o,r)||{},c=!(0,A.isNil)(s)&&s.faceted?((e,t,r,n)=>{if(![T.FilterOptions.EQUALS,T.FilterOptions.IN_RANGE].includes(t)&&![T.FilterOptions.ON,T.FilterOptions.WITHIN].includes(t)||!Array.isArray(e)||(0,T.isEmptyValue)(e[0]))return(0,T.isBooleanType)(n)&&t===T.FilterOptions.EXISTS?[!0,!1]:e&&!(0,T.isEmptyValue)(e[0])?[e[0]]:[];switch(r){case T.FACET_TYPES.NUMERIC_RANGE_FACET:return((e,t)=>{switch(t){case T.FilterOptions.EQUALS:return e.map((e=>[e,e]));case T.FilterOptions.IN_RANGE:return e.some(T.isEmptyValue)?[]:[e]}})(e[0],t);case T.FACET_TYPES.DATE_RANGE_FACET:return((e,t)=>{switch(t){case T.FilterOptions.ON:{const t=Ba()(e),r=!(0,T.isTimestampBasedType)(n);return[[T.utils.dates.getStartOfDay(t,r),T.utils.dates.getEndOfDay(t,r)]]}case T.FilterOptions.WITHIN:return(0,T.isDateRangeValue)(e)?[(0,T.getDateRangeByValue)(e)]:e.some(T.isEmptyValue)?[]:[e]}})(e[0],t);default:return e[0]}})(l,i,(0,T.getFacetTypeForAttrType)(s),s.type):l;return(0,A.isNil)(c)||(t[o]=(0,A.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},Ga=(e,t,r)=>{const n=(0,ft.VO)(t);return(0,_.eC)(e,n,[],r)},qa=(e,t)=>({type:k.Z.UPDATE_ENTITIES,payload:{searchResults:e,entityTypeUri:t}}),Za=()=>({type:k.Z.REFRESH_DISPLAYED_ENTITIES}),$a=e=>{let{silent:t}=e;return{type:k.Z.CLEAR_ALL,payload:{silent:t}}},Ka=e=>{let{entityTypeUri:t,keywordValue:r}=e;return{type:k.Z.SHOW_MORE_RESULTS_FOR_ENTITY_TYPE,payload:{entityTypeUri:t,keywordValue:r}}},Xa=e=>({type:k.Z.UPDATE_TOTAL,payload:e}),Qa=e=>({type:k.Z.CHANGE_LOADING,payload:e}),Ja=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:k.Z.MAP_CHANGE_VALUE,payload:{value:e,searchType:t,silent:r}}},eo=(e,t)=>({type:P.k.CREATE_FACETS,payload:{facetsConfigs:e,addToEnd:t}}),to=e=>({type:P.k.DESTROY_FACETS,payload:e}),ro=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:P.k.CHANGE_VALUES,payload:{facetFieldName:e,values:t,silent:r}}},no=e=>({type:P.k.UPDATE_DATA,payload:e}),ao=e=>({type:P.k.UPDATE_FILTERED_DATA,payload:e}),oo=e=>{let{facetsToAdd:t,fieldNamesToDelete:r,changedEntityTypes:n,addToEnd:a}=e;return{type:P.k.HANDLE_CONFIGS_CHANGES,payload:{facetsToAdd:t,fieldNamesToDelete:r,changedEntityTypes:n,addToEnd:a}}};var io=r(5236),lo=r(54145),so=r(49656),co=r(65751),uo=r.n(co);const po=e=>{(0,so.U)(e,{title:uo().text("Server Error"),defaultMessage:uo().text("Something went wrong...")})};var mo=r(69021);const yo=(e,t,r)=>`${e}/recommend/${r}/${t}`,go=e=>e&&1===e.length?e[0]:null,fo=e=>[e].filter((0,A.complement)(T.isComplexAttribute)).map((0,A.compose)(Fa.$9,(0,A.prop)("uri"))).concat((e.children||[]).map(fo)).flat(1/0);function*ho(){const e=yield(0,ja.RE)(Zl),t=yield(0,ja.Ys)(D().selectors.getTenant),r=yield(0,ja.Ys)(D().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,Fa._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:yo(r,n,a),options:{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}}}})(e,0,yield(0,ja.Ys)(D().selectors.getServicesPath),t,r);let a;try{a=yield(0,ja.RE)(T.rawRequest,n.url,n.options),a=a.filter((e=>"type"!==e)).slice(0,5)}catch(e){a=[]}const o=yield(0,ja.Ys)(D().selectors.getMetadata),i=yield(0,ja.Ys)(I.DX);a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=go(arguments.length>2?arguments[2]:void 0),n=r&&(0,T.getEntityType)(e,r),a=(0,mo.vf)(e,n||{}).map(fo).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=go(n);if(t){const r=((0,T.getEntityType)(e,t).defaultFacetedAttributes||[]).map((r=>(0,T.findAttributeTypeByUri)(e,r,t))).filter((e=>e&&(0,T.isReadableAttribute)(e)&&!(0,T.isComplexAttribute)(e))).map((0,A.prop)("uri")).map(Fa.$9).filter(a);o=o.concat(r)}if(o.length<i){const e=(0,_.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,ja.gz)((s=a,{type:P.k.SET_RECOMMENDED_FACETS_LIST,payload:s}))}const Eo=e=>({type:de,payload:e}),bo=e=>({type:me,payload:e}),vo=(e,t)=>({type:ye,payload:{show:e,postSavingAction:t}}),To=e=>({type:ge,payload:e}),Oo=(e,t,r)=>({type:Te,payload:{entityTypeUri:e,columns:t,prevColumns:r}}),xo=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:Oe,payload:{entityTypeUri:e,silent:t}}},Co=e=>({type:xe,payload:e}),So=()=>({type:Ae}),wo=e=>({type:Re,payload:e}),Ao=e=>wo({payload:{message:e,action:null},type:Z.GT.info}),Ro=e=>{let{message:t,actionLabel:r,actionToDispatch:n,autoHideDuration:a}=e;return wo({payload:{message:t,action:{actionLabel:r,actionToDispatch:n},autoHideDuration:a},type:Z.GT.info})},_o=e=>({type:Ie,payload:e}),Io=e=>({type:fe,payload:e});var No=r(90503),Do=r(82877);const Po=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=>T.utils.strings.search(r,t)||T.utils.strings.search(e[r].displayName,t)))},ko=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)}},Lo=(e,t)=>e===t,Uo=new class{constructor(){this.isLookupValueResolveTaskRunning=(0,A.curry)(((e,t)=>(0,A.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,A.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,A.uniqWith)(Lo,t)}clearTasks(){this._lookupValuesResolveTasks=Object.create(null)}};function*jo(e){const t=Uo.getRunningTasks(e);t.length>0&&(yield(0,ja.v_)(t))}function*Fo(e){try{const t=e.flatMap((e=>{let{type:t,codeValues:r}=e;return r.map((e=>({type:t,codeValue:e})))})),r=yield(0,ja.rM)(T.resolveLookupsList,t);Uo.addTask(e,r);const n=(yield(0,ja.v_)(r)).reduce(((e,t)=>{const[r]=Object.keys(t),[n]=Object.keys(t[r]),a=(0,A.lensPath)([r,n]),o=(0,A.path)([r,n],t);return(0,A.set)(a,o,e)}),{});for(const e in n)yield(0,ja.gz)(N.profile.lookups.actions.lookupsForTypeResolved({type:e,values:n[e]}))}catch(e){console.warn(e)}finally{Uo.deleteTask(e)}}function*Mo(e){if((0,A.isEmpty)(e))return;const t=e.map((e=>{let{type:t,codeValues:r}=e;const n=Uo.isLookupValueResolveTaskRunning(t);return{type:t,codeValues:r.filter((0,A.complement)(n))}})).filter((e=>{let{codeValues:t}=e;return t.length>0}));t.length>0&&(yield(0,ja.RE)(Fo,t)),yield(0,ja.RE)(jo,e)}function*Vo(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Z.cu,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const a=!t&&1===n,o=`${e}${r}`,i=a&&ko.getRunningTask(o);if(i)yield(0,ja.v_)(i);else try{const i=yield(0,ja.rM)(T.getDependentLookups,{type:e,displayNamePrefix:t,max:r,offset:r*(n-1)});a&&ko.addTask(o,i);const l=yield(0,ja.v_)(i);yield(0,ja.gz)(N.profile.lookups.actions.lookupsForTypeResolved({type:e,values:l.codeValues[e]}))}catch(e){console.warn(e)}finally{a&&ko.deleteTask(o)}}const Bo=(e,t,r)=>e.slice((r-1)*t,t*r);function*zo(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const a=yield(0,ja.Ys)(D().selectors.getLookups),o=Po(a[e],t);if(o.length>=r*n)return Bo(o,r,n);yield(0,ja.RE)(Vo,e,t,r,n);const i=yield(0,ja.Ys)(D().selectors.getLookups);return Bo(Po(i[e],t),r,n)}const Ho=(e,t)=>Object.keys(e).filter((e=>(0,Ma.iL)(e,t))).reduce(((r,n)=>(r[(0,Ma.iL)(n,t).fieldName]=e[n],r)),{});function Yo(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}function*Go(e,t,r){if((0,A.isEmpty)(e))return;const n=yield(0,ja.Ys)(D().selectors.getLookups),a=yield(0,ja.Ys)(D().selectors.getMetadata),o=Ho(r,e),i=yield(0,ja.Ys)(Do.Xf);yield(0,ja.gz)(t((0,Ma.HC)(a,o,e,n,{allowedEntityTypes:i})))}function*qo(e,t,r){try{const n=yield(0,ja.RE)(kl,e.url,e.options),[a,o]=(0,A.partition)(_._H,t);yield(0,ja.rM)(Go,o,r,n),yield(0,ja.RE)(Jo,a,n),yield(0,ja.RE)(Go,a,r,n)}catch(e){console.warn(e)}}function*Zo(e,t,r){e=Yo({},e,{includeFilter:[]});const n=yield(0,ja.Ys)(D().selectors.getGlobalSearchRequestOptions),a=(0,Fa.aw)([e],t,[e.fieldName],n);yield(0,ja.RE)(qo,a,[e],r)}const $o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.filter((t=>{let{label:r}=t;return T.utils.strings.search(r,e)}))},Ko=(e,t)=>$o(t,e).map((0,A.prop)("value"));function*Xo(e,t,r,n){const a=Yo({},e),o=[...t];if((0,_._H)(a)){const t=(0,T.getAttrTypeLookupCode)(e.attrType);a.includeFilter=yield(0,ja.RE)(zo,t,r,(0,A.propOr)(Z.cu,"pageSize",a),a.pageNumber)}else if("sourceSystems"===a.fieldName){const{sources:e}=yield(0,ja.Ys)(D().selectors.getMetadata);a.includeFilter=((e,t)=>$o(t,e).map((e=>{let{uri:t}=e;return(0,T.getLastUriPart)(t)})))(e,r)}else if((0,_.S9)(a)){const t=yield(0,ja.Ys)(D().selectors.getMetadata),n=(0,T.getEntityType)(t,a.entityTypeUri)||{},o=(0,A.pipe)((0,A.propOr)([],"displayedItems"),(0,A.filter)((0,A.propEq)("isRaw",!0)))(e);a.includeFilter=[...(i=n.matchGroups,l=r,$o(l,i).map((0,A.prop)("uri"))),...Ko(o,r)]}else a.disableIncludeFilter=!0,o.push({values:[r],fieldName:e.fieldName,filter:"containsWordStartingWith",forceInclude:!0});var i,l;const s=yield(0,ja.Ys)(D().selectors.getGlobalSearchRequestOptions),c=(0,Fa.aw)([a],o,[e.fieldName],s);yield(0,ja.RE)(Qo,c,e,a.includeFilter,n)}function*Qo(e,t,r,n){try{const a=yield(0,ja.RE)(kl,e.url,e.options),o=yield(0,ja.Ys)(D().selectors.getLookups),i=Ho(a,[t]);if(r){const e=t.fieldName;i[e]=(0,Ma.AX)(i[e],r)}const l=yield(0,ja.Ys)(D().selectors.getMetadata),s=yield(0,ja.Ys)(Do.Xf);yield(0,ja.gz)(n((0,Ma.HC)(l,i,[t],o,{allowedEntityTypes:s})))}catch(e){console.warn(e)}}function*Jo(e,t){const r=yield(0,ja.Ys)(D().selectors.getLookups),n=(0,Ma.U4)(e,r),a=((e,t,r)=>{const n=((e,t)=>(0,A.pipe)(Object.entries,(0,A.reduce)(((e,r)=>{let[n,a]=r;const o=t.find((0,A.propEq)("fieldName",n));if(!o)return e;const{attrType:i}=o,l=(0,T.getAttrTypeLookupCode)(i);return e[l]={type:l,codeValues:(0,A.uniq)([...(0,A.pathOr)([],[l,"codeValues"],e),...Object.keys(a)])},e}),{}),A.values)(e))(e,t);return(0,T.getUnresolvedLookupsList)(r,n)})(t,e,r),o=(0,T.mergeLookupsLists)(n,a);o.length&&(yield(0,ja.RE)(Mo,o))}var ei=r(59295);function ti(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){ri(e,t,r[t])}))}return e}function ri(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*ni(){const e=yield(0,ja.Ys)(D().selectors.getMetadata),t=yield(0,ja.Ys)(Do.Xf),r=yield(0,ja.Ys)(Do.sl);return(0,No.wM)(e,t,r)}const ai=e=>t=>{let{value:r}=t;return!e.length||e.includes(r)};function*oi(e){e=e||(yield(0,ja.Ys)(lo.FR));const t=yield(0,ja.Ys)(Do.XM);if((0,No.gj)(t)){const t=yield(0,ja.Ys)(D().selectors.getMetadata),r=yield(0,ja.Ys)(ei.V6),n=(0,_.$t)(t),a=yield(0,ja.Ys)(D().selectors.getGlobalSearchRequestOptions),o=(0,Fa.aw)([n],e,[n.fieldName],a),i=e=>{let{type:t=[]}=e;const n=t.filter(ai(r));return Co(n)};yield(0,ja.RE)(qo,o,[n],i)}else yield(0,ja.gz)(Co([]))}function*ii(){const e=yield(0,ja.Ys)(D().selectors.getMetadata),t=yield(0,ja.Ys)(Do.Xf),r=yield(0,ja.Ys)(ei.V6);return(0,Ma.wW)(e,{},t).filter(ai(r))}function*li(){const e=yield(0,ja.Ys)(D().selectors.getMetadata),t=yield(0,ja.RE)(ni),r=yield(0,ja.Ys)(Do.uJ),n=(0,No.oX)().map((0,A.prop)("id")),a=(0,A.pipe)((0,A.map)((0,A.filter)((0,A.pipe)((0,A.prop)("id"),(0,A.cond)([[(0,A.includes)("."),A.T],[(0,A.includes)(A.__,n),A.T],[A.T,A.F]])))),A.toPairs,(0,A.map)((t=>{let[r,n]=t;return[r,(0,No.Wh)(e,r,(0,A.map)((0,A.prop)("id"),n)).map(((e,t)=>{const r=n.find((0,A.propEq)("id",e.id)),{size:a,autoResize:o=0!==t&&!a}=r||{};return(0,A.reject)(A.isNil,ti({},e,{size:a,autoResize:o}))}))]})),A.fromPairs)(r),o=!(0,A.equals)(r,a),i=Object.keys(t),l=Object.keys(a);var s;!o&&(0,A.equals)(new Set(i),new Set(l))||(yield(0,ja.gz)((s=ti({},t,(0,A.pick)(i,a)),{type:ve,payload:s})))}function*si(){const e=yield(0,ja.Ys)(D().selectors.getMetadata),t=yield(0,ja.Ys)(I.DX),r=(yield(0,ja.Ys)(Do.IJ))?yield(0,ja.RE)(ii):yield(0,ja.RE)(os),n=(0,No.nx)(e,r,t).map((0,A.prop)("value")),a=yield(0,ja.Ys)(Do.o4);n.includes(a)||(yield(0,ja.gz)(xo(n[0],!0)))}function*ci(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{silent:t}=e.payload||{};if(!t){const e=yield(0,ja.Ys)(Do.tB),t=yield(0,ja.Ys)(lo.t9);if((0,T.isAvailableEntityTypeForDataTenant)(t,e)){const t=yield(0,ja.Ys)(lo.BP,{entityTypeUri:e});(0,A.isNil)(t)&&(yield(0,ja.gz)(Za()))}else yield(0,ja.gz)(qa([],e))}}function*ui(e){const t=e.payload;yield(0,ja.RE)(ci,e);const r=yield(0,ja.Ys)(Do.gu);if((0,No.gj)(t)&&0===r.length){const e=yield(0,ja.RE)(ii);yield(0,ja.gz)(Co(e)),yield(0,ja.RE)(oi)}}function*pi(){const e=yield(0,ja.Ys)(Do.qx),t=yield(0,ja.Ys)(lo.Qy);e!==Z.om.MAP&&t.length&&(yield(0,ja.gz)(Ja(null)))}function*di(e){const t=(0,T.removeDtssPrefixFromEntityUri)(e.payload.uri),r=yield(0,ja.Ys)(Do.tB),n=((yield(0,ja.Ys)(lo.BP,{entityTypeUri:r}))||[]).map((0,A.prop)("uri")),a=(yield(0,ja.Ys)(lo.fx,{entityTypeUri:r}))||0,o=(yield(0,ja.Ys)(lo.Uz,{entityTypeUri:r}))||Z.Tu[0],i=n.indexOf(t)+a*o,l=yield(0,ja.Ys)(lo.NU,{entityTypeUri:r}),s=yield(0,ja.Ys)(D().selectors.getTenant),c=yield(0,ja.Ys)(lo.lF);yield(0,ja.gz)(N.search.actions.setSearchNavigationData({uri:t,index:i,total:l,tenant:c||s,cache:n}))}const mi=[function*(){yield(0,ja.Fm)(Oe,ci)},function*(){yield(0,ja.Fm)(_e,ui)},function*(){yield(0,ja.Fm)([$e,Ke,Qe],si)},function*(){yield(0,ja.Fm)(Ie,pi)},function*(){yield(0,ja.Fm)(N.ui.constants.UIActions.OPEN_ENTITY,di)}],yi=e=>({type:ar,payload:e}),gi=e=>({type:or,payload:e}),fi=()=>({type:fr}),hi=e=>({type:Ar,payload:e}),Ei=e=>({type:Rr,payload:e}),bi=(e,t)=>({type:Nr,payload:{uri:e,isLoading:t}});var vi=r(90533),Ti=r(86374),Oi=r(4898);function xi(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){Ci(e,t,r[t])}))}return e}function Ci(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Si(){yield(0,ja.gz)(Ei(!0));try{const t=yield(0,ja.Ys)(D().selectors.getUserName),r=e=>xi({},e,{isOwnSearch:t===e.owner}),n=yield(0,ja.RE)(wi),{result:a=[],total:o}=yield(0,ja.RE)(T.getSavedSearches,n);yield(0,ja.gz)((e=>({type:sr,payload:e}))(o));const i=yield(0,ja.Ys)(D().selectors.getMetadata),l=yield(0,ja.Ys)(D().selectors.getDataTenants),s=yield(0,ja.Ys)(D().selectors.getCanUserReadWorkflowDataTask);yield(0,ja.gz)((e=a.map(r).map((0,Ti.z7)(i,l,s)),{type:cr,payload:e})),yield(0,ja.gz)(Ei(!1)),yield(0,ja.RE)(_i,a)}catch(e){yield(0,ja.gz)(Ei(!1))}var e}function*wi(){const e=yield(0,ja.Ys)(vi.s6),t=yield(0,ja.Ys)(vi.wH),r=yield(0,ja.Ys)(vi.U3),n=yield(0,ja.Ys)(vi.VS),a=yield(0,ja.Ys)(vi.kU),{field:o,order:i}=yield(0,ja.Ys)(vi.rT);return{offset:e*t,max:e,containsWordStartingWith:r,favoriteOnly:n,findPublic:a,countResults:!1,sortBy:Z.PW[o],sortOrder:i}}function*Ai(e){const t=yield(0,ja.Ys)(vi.EH,e.payload);yield(0,ja.RE)(Ri,t)}function*Ri(e,t){yield(0,ja.gz)(bi(e.uri,!0));try{const{total:r}=yield(0,ja.RE)(T.getTotalsForQuery,(0,T.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,ja.gz)(((e,t)=>({type:ur,payload:{uri:e,total:t}}))(e.uri,r))}catch(e){po(e)}yield(0,ja.gz)(bi(e.uri,!1))}function*_i(e){const t=yield(0,ja.Ys)(D().selectors.getQueryEstimatorEnabled);return yield(0,ja.$6)(e.map((e=>(0,ja.RE)(Ri,e,t))))}function*Ii(e){const{uri:t,isPublic:r}=e.payload,n=yield(0,ja.Ys)(vi.EH,t);if(n){yield(0,ja.gz)(Ei(!0));try{yield(0,ja.RE)(T.markSavedSearchAsPublic,(0,Ti.Tp)(n),r),yield(0,ja.gz)(((e,t)=>({type:Er,payload:{uri:e,isPublic:t}}))(t,r))}catch(e){po(e)}yield(0,ja.gz)(Ei(!1))}}function*Ni(e){const{uri:t,isFavorite:r}=e.payload,n=yield(0,ja.Ys)(vi.EH,t);if(n){yield(0,ja.gz)(Ei(!0));try{yield(0,ja.RE)(T.markSavedSearchAsFavorite,(0,Ti.Tp)(n),r),yield(0,ja.gz)(((e,t)=>({type:vr,payload:{uri:e,isFavorite:t}}))(t,r))}catch(e){po(e)}yield(0,ja.gz)(Ei(!1))}}function*Di(e){const{uri:t,isGlobalFilter:r}=e.payload,n=yield(0,ja.Ys)(vi.EH,t);if(n){const e=(0,Ti.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,T.isObject)("2.0"===t.version?t:t.state)||!r?yield(0,ja.gz)(((e,t)=>({type:"SAVED_SEARCHES_MARK_GLOBAL_FILTER",payload:{savedSearch:e,isGlobalFilter:t}}))(xi({},a,{uiState:t,query:(0,T.replacePlaceholdersInQuery)((0,A.propOr)("","query",a))}),r)):(0,so.U)({errorMessage:"Saved Search is incorrect"},{title:uo().text("Saved Search can't be mark as global")})}}function*Pi(e){const{uri:t,name:r}=e.payload,n=yield(0,ja.Ys)(vi.EH,t);if(n&&r!==n.name){yield(0,ja.gz)(Ei(!0));try{yield(0,ja.RE)(T.updateSavedSearch,xi({},(0,Ti.Tp)(n),{name:r})),yield(0,ja.gz)(((e,t)=>({type:xr,payload:{uri:e,name:t}}))(t,r))}catch(e){po(e)}yield(0,ja.gz)(Ei(!1))}}function*ki(){const e=yield(0,ja.Ys)(vi.Kh);yield(0,ja.gz)(Ei(!0));try{yield(0,ja.$6)(e.map((e=>(0,ja.RE)(T.deleteSavedSearch,e)))),yield(0,ja.gz)(hi(e.map((0,A.prop)("uri"))))}catch(e){po(e)}yield(0,ja.gz)(Ei(!1))}function*Li(e){const t=e.payload;yield(0,ja.gz)(Ei(!0));try{yield(0,ja.RE)(T.deleteSavedSearch,{uri:t}),yield(0,ja.gz)(hi([t]))}catch(e){po(e)}yield(0,ja.gz)(Ei(!1))}function*Ui(){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,ja.Ys)(vi.Cc,e),n=yield(0,ja.Ys)(Oi.Z,t);return{query:r,uiState:n}}function*ji(e){let{payload:{name:t,share:r}}=e;const{query:n,uiState:a}=yield(0,ja.RE)(Ui,!0),o={isFavorite:!1,isPublic:r===Z.ib.public,name:t,query:n,uiState:a},i=yield(0,ja.Ys)(vi.tp);yield(0,ja.gz)(vo(!1));try{yield(0,ja.gz)(Ao(uo().text("Saving search...")));const e=yield(0,ja.RE)(T.createSavedSearch,[o]);e[0].successful?(yield(0,ja.gz)(yi(e[0].object)),yield(0,ja.gz)(gi(!1)),yield(0,ja.gz)(Ao(uo().text("Search saved successfully"))),i&&(yield(0,ja.gz)(i))):po(e)}catch(e){po(e)}}function*Fi(e){const{uri:t,debounceTime:r}=e.payload;yield(0,ja.gz)(bo(!1));const n=yield(0,ja.Ys)(vi.EH,t),a=(0,vi.In)(n)||{},{errors:o}=a;o&&o.length?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,so.U)(e,{message:uo().text("Saved Search can't be applied")})}(o):(yield(0,ja.gz)(yi(n)),(yield(0,ja.Ys)(lo.lF))&&(a.currentTenant=yield(0,ja.Ys)(D().selectors.getTenant)),yield(0,ja.gz)(N.search.actions.updateState(xi({},a,{debounceTime:r}))),yield(0,ja.qn)(k.Z.STATE_UPDATED))}const Mi=[function*(){yield(0,ja.Fm)([lr,pr,dr,_r,mr,Pr],Si)},function*(){const e={[hr]:Ii,[br]:Ni,[wr]:Li,[Sr]:ki,[Or]:Pi,[Tr]:Di},t=yield(0,ja.ZO)(Object.keys(e));for(;;){const r=yield(0,ja.qn)(t);yield(0,ja.RE)(e[r.type],r)}},function*(){yield(0,ja.Fm)([nr],ji)},function*(){yield(0,ja.Fm)([Ir],Fi)},function*(){yield(0,ja.ib)([Dr],Ai)}];function*Vi(e){try{yield(0,ja.RE)(T.createActivity,{label:T.ACTIVITY_TYPES.userSearch,description:JSON.stringify({activity:e,version:"2.0"})})}catch(e){console.warn(e)}}const Bi=e=>({type:Ke,payload:{groupId:e}}),zi=(e,t)=>({type:tt,payload:{groupId:e,attributeId:t,attribute:Ot()}}),Hi=(e,t,r)=>({type:tt,payload:{groupId:e,attributeId:t,attribute:xt(r)}}),Yi=(e,t,r)=>({type:rt,payload:{groupId:e,attributeId:t,attributeData:Ct(r)}}),Wi=(e,t)=>({type:rt,payload:{groupId:e,attributeId:t,attributeData:null}}),Gi=(e,t,r)=>({type:nt,payload:{groupId:e,attributeId:t,selectInfo:r}}),qi=(e,t,r)=>({type:at,payload:{groupId:e,attributeId:t,operator:r}}),Zi=(e,t)=>({type:ot,payload:{groupId:e,attributeId:t}}),$i=(e,t)=>({type:it,payload:{groupId:e,attributeId:t}}),Ki=(e,t)=>({type:lt,payload:{groupId:e,attributeId:t,id:(0,Ze.x0)()}}),Xi=(e,t,r)=>({type:st,payload:{groupId:e,attributeId:t,filter:r}}),Qi=(e,t,r)=>({type:ct,payload:{groupId:e,attributeId:t,values:r}}),Ji=(e,t)=>{let{attribute:r,value:n,debounceTime:a=0,pageNumber:o=1,currentOptions:i}=t;return{type:pt,payload:{groupId:e,attribute:r,value:n,debounceTime:a,pageNumber:o,currentOptions:i}}},el=(e,t,r)=>({type:dt,payload:{groupId:e,attributeId:t,values:r}}),tl=(e,t)=>({type:mt,payload:{groupId:e,attribute:t}});var rl=r(44006);function*nl(e){let{groups:t,findGroupPath:r=St,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,A.pipe)(r(a),(0,A.path)(A.__,t),(0,A.propOr)([],n))(t),h=e=>(0,A.path)([e,"id"],f),E=f.findIndex((0,A.propEq)("id",o));if(o&&0===u)if(s)yield(0,ja.gz)(m(a,o,c));else{let e=p[u+1];e?(yield(0,ja.gz)(m(a,o,e)),yield(0,ja.gz)(g(a,h(E+1)))):yield(0,ja.gz)(y(a,o))}else{const e=p.length-u,t=o?E+u:f.length-e;s?yield(0,ja.gz)(d(a,h(t-1),c)):yield(0,ja.gz)(g(a,h(t)))}}function al(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){ol(e,t,r[t])}))}return e}function ol(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*il(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,ja.Ys)(ei.go),o={addAttributeAfter:Hi,changeAttribute:Yi,clearAttribute:Wi,deleteAttribute:Zi};yield(0,ja.RE)(nl,{groups:a,attributesPropName:"attributes",groupId:t,attributeId:r,selectInfo:n,actions:o}),yield(0,ja.gz)(Bi(t))}function*ll(e){const{attribute:t,groupId:r}=e.payload,n=yield(0,ja.Ys)(ei._7,r),a=yield(0,ja.Ys)(D().selectors.getGlobalSearchRequestOptions),{data:{fieldName:o},values:i}=t,l=yield(0,ja.Ys)(lo.L7,n,o),s=al({},t.data,{values:i?(0,A.flatten)(i):void 0,pageSize:t.data.pageSize+1}),c=(0,Fa.aw)([s],l,[],a);yield(0,ja.RE)(qo,c,[s],(e=>((e,t,r)=>({type:ut,payload:{groupId:e,attributeId:t,values:r}}))(r,t.id,e[o])))}function*sl(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,ja.gz)(el(o,t.id,void 0));else{a&&(yield(0,ja.gw)(a));const e=yield(0,ja.Ys)(ei.ad,o,t.id),c=e=>el(o,t.id,i.concat(e[s]));if(r){const a=l?[{values:[l],fieldName:"type",filter:"equals"}]:[],o=yield(0,ja.Ys)(lo.L7,a,s);yield(0,ja.rM)(Xo,al({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),o,r,c)}else{const r=yield(0,ja.Ys)(ei._7,o),a=yield(0,ja.Ys)(lo.L7,r,s);yield(0,ja.rM)(Zo,al({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),a,c)}}}function*cl(){const e=yield(0,ja.Ys)(D().selectors.getSearchKeyword),t=yield(0,ja.Ys)(lo.vH),r=yield(0,ja.RE)(Zl),n=yield(0,ja.Ys)(D().selectors.getMetadata),a=yield(0,ja.Ys)(D().selectors.getDataTenants),o=(0,rl.h)(n,a,r);yield(0,ja.gz)(N.search.actions.updateState({advanced:o,keyword:e,map:t}))}function*ul(e){const{groupId:t,attributeId:r}=e.payload;yield(0,ja.gz)(Zi(t,r)),yield(0,ja.gz)(Bi(t))}function*pl(){if(yield(0,ja.Ys)(Do.IJ)){const e=yield(0,ja.Ys)(ei.go),t=yield(0,ja.Ys)(Do.Xf);for(const r of e){const e=r.entityTypes||[];if((t?e.filter((e=>t.includes(e))):e).length!==e.length){yield(0,ja.gz)($a({silent:!0}));break}}}}const dl=[function*(){yield(0,ja.ib)([nt],il)},function*(){yield(0,ja.Fm)([pt],sl)},function*(){yield(0,ja.ib)(gt,cl)},function*(){yield(0,ja.ib)(mt,ll)},function*(){yield(0,ja.ib)([it],ul)}];function ml(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){yl(e,t,r[t])}))}return e}function yl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*gl(){const e=yield(0,ja.Ys)(lo.FR);yield(0,ja.RE)(hl);const t=yield(0,ja.Ys)(Do.tB);var r;yield(0,ja.gz)((r=t,{type:k.Z.RESET_PAGE,payload:{entityTypeUri:r}})),yield(0,ja.rM)($l,e),yield(0,ja.rM)(Cl,e),(yield(0,ja.Ys)(Do.IJ))?yield(0,ja.rM)(oi,e):yield(0,ja.rM)(ho)}function*fl(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,ja.gw)(t));const r=yield(0,ja.Ys)(lo.FR);yield(0,ja.rM)(El,r)}function*hl(){const e=yield(0,ja.Ys)(Do.tB);var t;yield(0,ja.gz)((t=e,{type:k.Z.CLEAR_RESULTS,payload:t}))}function*El(e){const t=yield(0,ja.Ys)(D().selectors.getMetadata),r=yield(0,ja.Ys)(Do.tB),n=yield(0,ja.Ys)(lo.fx,{entityTypeUri:r}),a=yield(0,ja.Ys)(lo.Uz,{entityTypeUri:r}),o=yield(0,ja.Ys)(lo.L9,{entityTypeUri:r}),i=yield(0,ja.Ys)(lo.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,ja.RE)(xl,r);c=(0,A.uniq)(c.concat(a).concat((0,Fa.kx)(t,s,[Fa.cI]))),l=!0}else c=(0,A.uniq)(c.concat((0,Fa.kx)(t,s,[Fa.Bo,Fa.cI]))),l=!1;const u=ml({page:n,rowsPerPage:a,sortOrder:o,sortField:i,forceOvOnly:l},yield(0,ja.Ys)(D().selectors.getGlobalSearchRequestOptions),{select:c}),p=(0,Fa.XP)(s,u),d=yield(0,ja.Ys)(lo.lF);yield(0,ja.gz)(Qa(!0));try{let e;if(d){const t=(0,Fa.kH)(s,u);e=yield(0,ja.RE)(kl,t)}else{const t=(0,Fa.Lv)(s,u);e=yield(0,ja.RE)(kl,Z.NV,t)}Array.isArray(e)||(e=[]),yield(0,ja.RE)(bl,(0,A.reject)(A.isNil,{query:p,sortField:i,sortOrder:o,dataTenant:d})),e=yield(0,ja.RE)(Pl,e),yield(0,ja.gz)(qa(e,r))}catch(e){yield(0,ja.gz)(qa([],r))}yield(0,ja.gz)(Qa(!1))}function*bl(e){var t;yield(0,ja.gz)((t=e.query,{type:k.Z.UPDATE_URL,payload:t}));const r=yield(0,ja.Ys)(D().selectors.getSearchProviderData);(0,A.equals)(null==r?void 0:r.data,e)||(yield(0,ja.gz)(N.search.actions.setSearchNavigationData(null))),yield(0,ja.gz)(N.search.actions.setSearchProviderData({type:"search",data:e}))}function*vl(e){const{columns:t,prevColumns:r}=e.payload;if((0,No.tU)(t,r)){const e=yield(0,ja.Ys)(Do.o4),t=(yield(0,ja.Ys)(lo.BP,{entityTypeUri:e})).map((e=>e.uri)),r=yield(0,ja.RE)(xl,e),n=yield(0,ja.Ys)(lo.FR),a=yield(0,ja.Ys)(D().selectors.getGlobalSearchRequestOptions),o=(0,Fa.aG)(t,n,ml({select:r},a));yield(0,ja.gz)(Qa(!0));try{let t=yield(0,ja.RE)(kl,o.url,o.options);t=yield(0,ja.RE)(Pl,t),yield(0,ja.gz)(qa(t,e))}catch(t){yield(0,ja.gz)(qa([],e)),po(t)}yield(0,ja.gz)(Qa(!1))}}function*Tl(){const e=yield(0,ja.Ys)(Do.tB),t=yield(0,ja.Ys)(lo.BP,{entityTypeUri:e});t&&(yield(0,ja.gz)(N.search.actions.searchResultsSet(t)))}function*Ol(e){const{entityTypeUri:t,keywordValue:r}=e.payload;yield(0,ja.gz)(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return{type:P.k.CLEAR_ALL_VALUES,payload:{silent:e}}}(!0)),yield(0,ja.gz)(ro("type",[t],!0)),yield(0,ja.gz)(N.search.actions.keywordUpdated({value:r,isRawFilter:!1}))}function*xl(e){const t=yield(0,ja.Ys)(Do.Gv,e);return(0,No.vw)(t)}function*Cl(e){const t=yield(0,ja.Ys)(D().selectors.getGlobalSearchRequestOptions),r=(0,Fa.Vg)(e,[],t);try{const e=yield(0,ja.RE)(kl,Z.jS,{method:"POST",body:JSON.stringify(r)});yield(0,ja.gz)(Xa(e.total))}catch(e){yield(0,ja.gz)(Xa(0))}}function*Sl(){yield(0,ja.RE)(Al);const e=yield(0,ja.RE)(Ui,!0);(0,A.isEmpty)(e.query)||(yield(0,ja.RE)(Vi,e))}const wl=[ut];function*Al(){for(;yield(0,ja.Ys)(ei.UM);)yield(0,ja.qn)(wl)}function*Rl(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,ja.gw)(t)),(0,Ma.$L)(e)&&(yield(0,ja.RE)(ts)),(0,A.pathOr)(!1,["payload","silent"],e)||(yield(0,ja.RE)(gl),yield(0,ja.RE)(Sl))}function*_l(e){var t;const r=(0,A.path)(["payload","searchOptions"],e),n=(0,A.path)(["payload","errors"],e),a=(0,A.pathOr)(0,["payload","debounceTime"],e);n&&n.length&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,so.U)(e,{message:uo().text("Can't apply search state")})}(n),!(null!==(t=yield(0,ja.Ys)(D().selectors.getShowSearchByOv))&&void 0!==t?t:yield(0,ja.Ys)(Do.cC))&&r&&r.searchByOv&&(yield(0,ja.gz)(N.search.actions.updateSearchOptions({searchByOv:!1,ovOnly:!1}))),yield(0,ja.RE)(as),yield(0,ja.RE)(pl),yield(0,ja.RE)(li),yield(0,ja.RE)(si),yield(0,ja.RE)(Il),yield(0,ja.gz)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{type:k.Z.STATE_UPDATED,payload:{debounceTime:e}}}(a))}function*Il(){const e=yield(0,ja.Ys)(Do.d7),t=yield(0,ja.Ys)(lo.Qy);!e&&t.length&&(yield(0,ja.gz)(Ja(null,null,!0)))}function*Nl(){const e=yield(0,ja.Ys)(lo.A7),{activityFilter:t,globalFilter:r}=yield(0,ja.Ys)(D().selectors.getGlobalSearchRequestOptions),n=yield(0,ja.Ys)(D().selectors.getSearchOptions),a=n&&n.searchByOv,o=[(0,Fa.s4)(e,[],{globalFilter:r})];a&&o.push("options=searchByOv"),t&&o.push(`activeness=${t}`);const i=o.filter(A.identity).join("&"),l=new URLSearchParams(i);if(yield(0,ja.Ys)(D().selectors.getSharedPreferencesEnabled)){const e=yield(0,ja.Ys)(D().selectors.getServicesPath),t=yield(0,ja.Ys)(D().selectors.getTenant),r=yield(0,ja.Ys)(D().selectors.getEnvironment),n=yield(0,ja.Ys)(D().selectors.getUserName),a=yield(0,ja.Ys)(Do.XM),o=yield(0,ja.Ys)(Do.uJ),i=(0,A.pipe)((0,A.map)((0,A.pipe)((0,A.map)((0,A.path)(["attrType","uri"])),(0,A.reject)(T.isEmptyValue))),(0,A.reject)(A.isEmpty)),s="searchExportData",c={name:s,tenant:t,environment:r,user:n,servicesPath:e,value:{searchResultsColumnsUris:(0,No.gj)(a)?i(o):void 0}};try{yield(0,ja.RE)(T.setSharedPreferences,c),l.set("sharedPreferenceName",s)}catch(e){po(e)}}yield(0,ja.gz)(N.ui.actions.openConsoleApp("Export","entities",l.toString()))}function*Dl(){yield(0,ja.gz)(N.ui.actions.openConsoleApp("Data Loader","projects"))}function*Pl(e){const t=yield(0,ja.Ys)(lo.lF);return e&&t?e.map((0,T.enrichEntityWithDataTenant)(t)):e}function*kl(e,t){const r=yield(0,ja.Ys)(D().selectors.getTenant),n=yield(0,ja.Ys)(lo.lF),a=yield(0,ja.Ys)(D().selectors.getDtssPath);return yield(0,ja.RE)(Fa.Es,{url:e,options:t,customerTenant:r,dataTenant:n,dtssPath:a})}const Ll=[P.k.CHANGE_VALUES,N.search.constants.KEYWORD_UPDATED,k.Z.REFRESH,P.k.CLEAR_ALL_VALUES,k.Z.MAP_CHANGE_VALUE,k.Z.CLEAR_ALL,k.Z.STATE_UPDATED,yt,N.search.constants.SEARCH_OPTIONS_UPDATED,N.search.constants.ACTIVITY_FILTER_UPDATED,N.search.constants.GLOBAL_FILTER_UPDATED,k.Z.CHANGE_CURRENT_TENANT],Ul=[function*(){yield(0,ja.Fm)(Ll,Rl)},function*(){yield(0,ja.Fm)([k.Z.CHANGE_PAGE,k.Z.RESET_PAGE,k.Z.CHANGE_ROWS_PER_PAGE,k.Z.REFRESH_DISPLAYED_ENTITIES,k.Z.CHANGE_SORT],fl)},function*(){yield(0,ja.Fm)(Te,vl)},function*(){yield(0,ja.Fm)([k.Z.UPDATE_ENTITIES,Oe,_e],Tl)},function*(){yield(0,ja.Fm)(k.Z.SHOW_MORE_RESULTS_FOR_ENTITY_TYPE,Ol)},function*(){yield(0,ja.Fm)(N.search.constants.UPDATE_STATE,_l)},function*(){yield(0,ja.Fm)(k.Z.EXPORT_RESULTS,Nl)},function*(){yield(0,ja.Fm)(k.Z.OPEN_DATA_LOADER,Dl)}];var jl=r(56906);function Fl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Ml(e,t){try{const[r,n]=yield(0,ja.RE)(Vl,e,[]);if((0,A.isNil)(r)||(0,A.isNil)(n))yield(0,ja.gz)(no({[e.fieldName]:[]}));else{const[a,o]=(0,Ma.dG)(e.type),i=(0,Ma.q7)(a,r),l=(0,Ma.q7)(o,n),s=(0,io.Oz)(e.attrType&&e.attrType.type),[c,u]=s.greaterThan(i,l)?[l,i]:[i,l],p=yield(0,ja.RE)(Bl,e,c,u,t),d={[e.fieldName]:p};yield(0,ja.gz)(no(d))}}catch(e){console.warn(e)}}function*Vl(e,t){const r=yield(0,ja.Ys)(D().selectors.getGlobalSearchRequestOptions),n=(0,Fa.rN)(e,t,[e.fieldName],r),a=yield(0,ja.RE)(kl,n.url,n.options),o=Ho(a,[e]),{min:i,max:l,count:s}=(0,Ma.Kn)(o,[e])[e.fieldName];return s?[(0,_.bB)(e)?0:i,l]:[]}function*Bl(e,t,r,n){const a=e.attrType&&e.attrType.type,o=(0,jl.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){Fl(e,t,r[t])}))}return e}({interval:i,offset:t},yield(0,ja.Ys)(D().selectors.getGlobalSearchRequestOptions)),s=(0,Fa.ti)(e,n,[e.fieldName],l),c=yield(0,ja.RE)(kl,s.url,s.options),u=yield(0,ja.Ys)(D().selectors.getMetadata),p=Ho(c,[e]),d=(0,Ma.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 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 Hl={matches:Fa.dW,"dtPotentialMatches.matches":Fa.dW,"potentialMatches.matchScore":Fa._9};function*Yl(e,t){try{const[r,n]=yield(0,ja.RE)(Vl,e,[]);if((0,A.isNil)(r)||(0,A.isNil)(n))yield(0,ja.gz)(no({[e.fieldName]:[]}));else{const[a,o]=(0,Ma.dG)(e.type),i=(0,Ma.q7)(a,r),l=(0,Ma.q7)(o,n),s=yield(0,ja.RE)(Wl,e,i,l,t),c={[e.fieldName]:s};yield(0,ja.gz)(no(c))}}catch(e){console.warn(e)}}function*Wl(e,t,r,n){const a=yield(0,ja.Ys)(D().selectors.getGlobalSearchRequestOptions),o=Math.min(5,r-t+1),i=yield(0,ja.RE)(T.rawRequest,Hl[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){zl(e,t,r[t])}))}return e}({},a,{dataTenant:e.dataTenant})));return i.map((e=>({number:e.count,value:[e.from,e.to]})))}function Gl(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){ql(e,t,r[t])}))}return e}function ql(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Zl(){const e=yield(0,ja.Ys)(I.X0),t=yield(0,ja.Ys)(I.Mp);return Object.values((0,Ma.t8)(e,t))}function*$l(e){const t=yield(0,ja.RE)(Zl),[r,n]=(0,A.partition)(_.bB,t);let[a,o]=(0,A.partition)(T.isRangeFacet,n);for(let t=0;t<r.length;t++)yield(0,ja.rM)(Yl,r[t],e);for(let t=0;t<a.length;t++)yield(0,ja.rM)(Ml,a[t],e);const[i,l]=(0,A.partition)((e=>e.values&&e.values.length),o);for(let t=0;t<i.length;t++)yield(0,ja.rM)(Xl,i[t],e);const[s,c]=(0,A.partition)(_.DT,l);for(const t of s)yield(0,ja.rM)(Ql,[t],e);c.length&&(yield(0,ja.rM)(Ql,c,e))}function*Kl(e){const t=yield(0,ja.Ys)(lo.FR),[r,n]=(0,A.partition)(_.bB,e.payload),[a,o]=(0,A.partition)(T.isRangeFacet,n),[i,l]=(0,A.partition)(_.DT,o);for(let e=0;e<r.length;e++)yield(0,ja.rM)(Yl,r[e],t);for(let e=0;e<a.length;e++)yield(0,ja.rM)(Ml,a[e],t);for(const e of i)yield(0,ja.rM)(Ql,[e],t);l.length&&(yield(0,ja.rM)(Ql,l,t))}function*Xl(e,t,r){const n=yield(0,ja.Ys)(D().selectors.getGlobalSearchRequestOptions),a=(0,Fa.aw)([Gl({},e,{pageSize:e.pageSize+1})],t,[e.fieldName],n,r);yield(0,ja.RE)(Jl,a,[e])}function*Ql(e,t,r){const n=yield(0,ja.Ys)(D().selectors.getGlobalSearchRequestOptions),a=(0,Fa.aw)(e.map((e=>Gl({},e,{pageSize:e.pageSize+1}))),t,[],n,r);yield(0,ja.RE)(Jl,a,e)}function*Jl(e,t){yield(0,ja.RE)(qo,e,t,no)}function*es(e){const{facetFieldName:t,value:r,debounceTime:n,pageNumber:a=1,currentOptions:o=[]}=e.payload;if(""===r&&1===a)yield(0,ja.gz)((e=>({type:P.k.DESTROY_FILTERED_DATA,payload:e}))(t));else{const e=yield(0,ja.Ys)(I.X0),i=yield(0,ja.Ys)(I.Mp),l=Gl({},(0,Ma.t8)(e,i)[t]);if("type"===t){const e={[t]:[...l.data.filter((e=>e.label.toLowerCase().includes(r.toLowerCase())))]};yield(0,ja.gz)(ao(e))}else{n&&(yield(0,ja.gw)(n));const e=yield(0,ja.Ys)(lo.FR),i=yield(0,ja.Ys)(I.rM,t),s=e=>ao({[t]:o.concat(e[t])});r?yield(0,ja.rM)(Xo,Gl({},l,{displayedItems:i,pageNumber:a,pageSize:l.pageSize+1}),e,r,s):yield(0,ja.rM)(Zo,Gl({},l,{pageNumber:a,pageSize:l.pageSize+1}),e,s)}}}function*ts(){const e=yield(0,ja.Ys)(I.DX),t=t=>t.entityTypeUri&&t.entityTypeUri!==e[0],r=yield(0,ja.Ys)(I.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,ja.gz)(to(n)))}}function*rs(e){const{facetsToAdd:t=[],fieldNamesToDelete:r=[],changedEntityTypes:n,addToEnd:a=!1}=e.payload;if(t.length||r.length){t.length&&(yield(0,ja.gz)(eo(t,a)));const e=yield(0,ja.RE)(Zl);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,ja.gz)(to(r))}if(null!=n)yield(0,ja.gz)(ro("type",n));else if(i)yield(0,ja.gz)(function(){let{debounceTime:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:k.Z.REFRESH,payload:{debounceTime:e}}}());else if(t.length){const r=e.filter((e=>t.some((t=>e.fieldName.startsWith(t.fieldName)))));yield(0,ja.gz)((o=r,{type:P.k.REQUEST_GIVEN_FACETS_DATA,payload:o}))}}var o}function*ns(){const e=yield(0,ja.Ys)(D().selectors.getSearchKeyword),t=yield(0,ja.Ys)(lo.vH),r=yield(0,ja.Ys)(ei.go),n=yield(0,ja.Ys)(D().selectors.getMetadata),a=yield(0,ja.Ys)(D().selectors.getDataTenants);if(Ha(n,r,a)){const o=((e,t,r)=>{const n=Ga(e,t,r),a=Wa(e,t,r),o=(0,A.pipe)(A.flatten,A.uniq)((0,ft.VO)(t)),i=(0,_.$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,Ma.Kk)({values:l})?{values:l,showAllItems:!0}:{values:l})}});var l})(n,r,a);yield(0,ja.gz)(N.search.actions.updateState({facets:o,keyword:e,map:t}))}}function*as(){if(!(yield(0,ja.Ys)(Do.IJ))){const e=yield(0,ja.Ys)(D().selectors.getMetadata);if((yield(0,ja.Ys)(I.Mp)).some(T.isTypeFacet)){const e=yield(0,ja.Ys)(Do.Xf),t=yield(0,ja.Ys)(I.DX);(e?t.filter((t=>e.includes(t))):t).length!==t.length&&(yield(0,ja.gz)($a({silent:!0})))}else{const t=[(0,_.$t)(e)];yield(0,ja.gz)(eo(t))}}}function*os(){const e=yield(0,ja.Ys)(D().selectors.getMetadata),t=yield(0,ja.Ys)(I.X0),r=(0,Ma.t8)({type:t.type},[(0,_.$t)(e)]).type.data.reduce(((e,t)=>(e[(0,T.getLastUriPart)(t.value)]=t.number,e)),{}),n=yield(0,ja.Ys)(Do.Xf);return(0,Ma.wW)(e,r,n)}const is=[function*(){yield(0,ja.Fm)([P.k.FILTER_FACET_DATA],es)},function*(){yield(0,ja.ib)(P.k.REQUEST_GIVEN_FACETS_DATA,Kl)},function*(){yield(0,ja.ib)(P.k.HANDLE_CONFIGS_CHANGES,rs)},function*(){yield(0,ja.ib)(P.k.CONVERT_FROM_ADVANCED_SEARCH,ns)}];function ls(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ss=e=>{const t=["view","searchResultsColumns"],r=(0,A.pathOr)({},t,e),n=(0,A.map)((0,A.map)((0,A.pipe)((0,A.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){ls(e,t,r[t])}))}return e}({},e,{attrType:{uri:(0,A.pathOr)("",["attrType","uri"],e)}}):e))),r),a=(0,A.lensPath)(t),o=(0,A.omit)(["sortField","sortOrder","entityTypeTab"],e.view),i=(0,A.lensPath)(["view"]),l=["keyword"],s=(0,A.pathOr)("",l,e),c=(0,A.lensPath)(l),u=["map"],p=(0,A.pathOr)("",u,e),d=(0,A.lensPath)(u);return(0,A.pipe)((0,A.omit)(["searchOptions"]),(0,A.set)(i,o),(0,A.set)(a,n),(0,A.set)(c,s),(0,A.set)(d,p))(e)};function cs(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){us(e,t,r[t])}))}return e}function us(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*ps(e){let{payload:{share:t}}=e;const{query:r,uiState:n}=yield(0,ja.RE)(Ui,!0),a=cs({},yield(0,ja.Ys)(vi.LA),{isPublic:t===Z.ib.public,query:r,uiState:n}),o=yield(0,ja.Ys)(vi.tp);yield(0,ja.gz)(vo(!1));try{yield(0,ja.gz)(Ao(uo().text("Updating search..."))),yield(0,ja.RE)(T.updateSavedSearch,a),yield(0,ja.gz)(gi(!1)),yield(0,ja.gz)(Ao(uo().text("Search updated successfully"))),o&&(yield(0,ja.gz)(o))}catch(e){po(e)}}function*ds(){const e=yield(0,ja.Ys)(vi.LA);if(!e)return void(yield(0,ja.gz)(gi(!1)));const t=yield(0,ja.Ys)(D().selectors.getMetadata),r=yield(0,ja.Ys)(D().selectors.getDataTenants),n=yield(0,ja.Ys)(D().selectors.getCanUserReadWorkflowDataTask),{uiState:a}=(0,Ti.z7)(t,r,n,yield(0,ja.RE)(Ui)),o=(e=>{let{savedUiState:t,actualUiState:r}=e;const n=ss(t),a=ss(r);if(!(0,A.equals)(n,a))return!1;if((0,A.path)(["view","searchResultsMode"],t)===Z.ll.TABLE){const e=["view","sortField"],n=["view","sortOrder"],a=["view","entityTypeTab"],o=(0,A.path)(e,t),i=(0,A.path)(e,r),l=(0,A.path)(n,t),s=(0,A.path)(n,r),c=(0,A.path)(a,t),u=(0,A.path)(a,r);if(!(0,A.equals)(o,i)||!(0,A.equals)(l,s)||!(0,A.equals)(c,u))return!1}const o=["searchOptions"],i=(0,A.pathOr)(null,o,t),l=(0,A.pathOr)(null,o,r);return!!((0,A.isNil)(i)||(0,A.isNil)(l)||(0,A.equals)(i,l))})({savedUiState:e.uiState,actualUiState:a});yield(0,ja.gz)(gi(!o))}function*ms(e){const t=yield(0,ja.Ys)(vi.LA);if(t)switch(e.type){case xr:case Er:case vr:t.uri===e.payload.uri&&(yield(0,ja.gz)(yi(cs({},t,e.payload))));break;case Ar:(0,A.includes)(t.uri,e.payload)&&(yield(0,ja.gz)(yi(null)));break;case ir:yield(0,ja.gz)(yi(cs({},t,{isPublic:e.payload.share===Z.ib.public})));break;default:(yield(0,ja.Ys)(lo.kw))&&(yield(0,ja.gz)(yi(null)))}}function*ys(e){const t=yield(0,ja.Ys)(vi.EH,e);if(t)return t;const r=yield(0,ja.Ys)(D().selectors.getMetadata),n=yield(0,ja.Ys)(D().selectors.getDataTenants),a=yield(0,ja.Ys)(D().selectors.getCanUserReadWorkflowDataTask);try{const t=yield(0,ja.RE)(T.getSavedSearch,(0,Ti.tk)(e));return(0,Ti.z7)(r,n,a,t)}catch(e){return po(e),null}}function*gs(e){const t=(0,A.path)(["payload","currentSavedSearchUri"],e);if(!t)return;const r=yield(0,ja.Ys)(vi.LA);if((0,A.prop)("uri",r)===t)return;const n=yield(0,ja.RE)(ys,t);n&&(yield(0,ja.gz)(yi(n)),yield(0,ja.RE)(ds))}const fs=[...Ll,Oe,k.Z.CHANGE_SORT,_e,Te,Se,Ce,Ie,P.k.CREATE_FACETS,P.k.DESTROY_FACETS,P.k.SHOW_MORE_ENTITY_TYPES],hs=[function*(){yield(0,ja.Fm)(fs,ds)},function*(){yield(0,ja.Fm)([ir],ps)},function*(){yield(0,ja.Fm)([xr,Er,vr,Ar,ir,...Ll],ms)},function*(){yield(0,ja.Fm)(N.search.constants.UPDATE_STATE,gs)}];function Es(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*bs(){yield(0,ja.gw)(500);const{uiState:e,query:t}=yield(0,ja.RE)(Ui,!1,!0),r=yield(0,ja.Ys)(vi.LA);yield(0,ja.gz)(N.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){Es(e,t,r[t])}))}return e}({},e,{query:t,currentSavedSearchUri:(0,A.path)(["uri"],r)})))}function*vs(){yield(0,ja.qn)(N.search.constants.UPDATE_STATE);const e=(0,A.reject)((0,A.includes)(A.__,[k.Z.REFRESH]),fs);yield(0,ja.Fm)([ar,...e],bs)}const Ts=e=>({type:kr,payload:e}),Os=()=>({type:Vr}),xs=e=>({type:zr,payload:e}),Cs=e=>({type:Yr,payload:e}),Ss=(e,t)=>({type:qr,payload:{searchCreatedDate:e,isLoading:t}});var ws=r(97010),As=r(73667);const Rs=(0,A.path)([Z.Jf,"recentSearches"]),_s=e=>Rs(e).items,Is=e=>Rs(e).filterWord,Ns=(0,A.curry)(((e,t)=>!e||t&&t.name.toLocaleLowerCase().includes(e.toLocaleLowerCase()))),Ds=e=>(0,A.pipe)(_s,(0,A.filter)(Ns(Is(e))))(e),Ps=e=>Rs(e).loading,ks=(0,As.Rm)(_s),Ls=(0,As.d1)(_s),Us=(0,As.Ky)(_s),js=(0,As.$y)(_s),Fs=e=>Rs(e).lastSavedRecentSearch,Ms=(e,t)=>_s(e).find((0,A.propEq)("createdDate",t)),Vs=(0,A.path)(["advancedSearch","searchParams","groups"]),Bs=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,A.chain)((0,A.prop)("attributes")),r=(0,A.filter)((0,A.has)("values")),n=(0,A.pipe)(Vs,t,r),a=(0,A.pipe)((0,A.prop)("values"),(0,A.map)((0,A.prop)("label")),(0,A.join)(", ")),o=(0,A.path)(["data","title"]),i=(0,A.pathEq)(["data","fieldName"],"type"),l=(0,A.find)(i),s=(0,A.pipe)(l,(0,A.when)(A.identity,a)),c=(0,A.pipe)((0,A.reject)(i),(0,A.map)(o),(0,A.reject)(A.isNil),(0,A.join)(", ")),u=e=>[s(e),c(e)].filter(A.identity).join(" - ");return u(n(e))},zs=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,A.prop)("facets"),r=(0,A.prop)("facetsData"),n=(0,A.prop)("facetsConfigs"),a=(0,A.prop)("values"),o=(0,A.prop)("label"),i=(0,A.prop)("title"),l=(0,A.pipe)(a,(e=>e&&e.length>0)),s=e=>(0,A.pipe)((0,A.propOr)([],"data"),(0,A.find)((0,A.propEq)("value",e)),(0,A.defaultTo)({}),o),c=(0,A.curry)(((e,r)=>(0,A.pipe)(t,n,(0,A.find)((0,A.propEq)("fieldName",r)),(0,A.defaultTo)({}),i)(e))),u=(0,Ma.XK)(e),p=[];u&&p.push(a(u).map(s).map((e=>e(u))).join(", "));const d=(0,A.pipe)(t,r,A.values,(0,A.reject)(T.isTypeFacet),(0,A.filter)(l),(0,A.map)((0,A.prop)("fieldName"))),m=(0,A.pipe)(d,(0,A.map)(c(e))),y=m(e);return y.length>0&&p.push(y.join(", ")),p.filter(A.identity).join(" - ")};function Hs(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){Ys(e,t,r[t])}))}return e}function Ys(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Ws(){yield(0,ja.gz)(Cs(!0));try{const t=yield(0,ja.Ys)(D().selectors.getTenant),r=yield(0,ja.Ys)(D().selectors.getEnvironment),n=yield(0,ja.Ys)(D().selectors.getServicesPath),{result:a=[]}=yield(0,ja.RE)(T.getRecentSearches,{environment:r,tenant:t,servicesPath:n}),o=(0,A.sort)((0,A.descend)((0,A.prop)("createdDate")))(a);yield(0,ja.gz)((e=o,{type:Ur,payload:e})),yield(0,ja.gz)(Cs(!1)),yield(0,ja.RE)(Zs,o)}catch(e){po(e),yield(0,ja.gz)(Cs(!1))}var e}function*Gs(e){const t=yield(0,ja.Ys)(Ms,e.payload);yield(0,ja.RE)(qs,t)}function*qs(e,t){yield(0,ja.gz)(Ss(e.createdDate,!0));try{const{total:r}=yield(0,ja.RE)(T.getTotalsForQuery,(0,T.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,ja.gz)(((e,t)=>({type:jr,payload:{searchCreatedDate:e,total:t}}))(e.createdDate,r))}catch(e){po(e)}yield(0,ja.gz)(Ss(e.createdDate,!1))}function*Zs(e){const t=yield(0,ja.Ys)(D().selectors.getQueryEstimatorEnabled);return yield(0,ja.$6)(e.map((e=>(0,ja.RE)(qs,e,t))))}function*$s(){const e=yield(0,ja.Ys)(js),t=yield(0,ja.Ys)(D().selectors.getServicesPath);yield(0,ja.gz)(Cs(!0));try{yield(0,ja.$6)(e.map((e=>(0,ja.RE)(T.deleteRecentSearch,Hs({},e,{servicesPath:t}))))),yield(0,ja.gz)(xs(e))}catch(e){po(e)}yield(0,ja.gz)(Cs(!1))}function*Ks(e){const t=e.payload,r=yield(0,ja.Ys)(D().selectors.getServicesPath);yield(0,ja.gz)(Cs(!0));try{yield(0,ja.RE)(T.deleteRecentSearch,Hs({},t,{servicesPath:r})),yield(0,ja.gz)(xs([t]))}catch(e){po(e)}yield(0,ja.gz)(Cs(!1))}function*Xs(){const{query:e,uiState:t}=yield(0,ja.RE)(Ui,!0),r=yield(0,ja.Ys)(Do.$s),n=yield(0,ja.Ys)(Fs),a=yield(0,ja.Ys)(lo.kw),o=yield(0,ja.Ys)(D().selectors.getTenant),i=yield(0,ja.Ys)(D().selectors.getEnvironment),l=yield(0,ja.Ys)(D().selectors.getServicesPath),s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Vs(e);return t&&t.length>0?Bs(e):zs(e)}(r),c=(0,T.getHash)(e),u={query:e,state:t,name:s,environment:i,tenant:o};try{if(n!==c&&!a){const e=yield(0,ja.RE)(T.createRecentSearch,u,l);e.success?yield(0,ja.gz)((e=>({type:Gr,payload:e}))(c)):po(e)}}catch(e){po(e)}}function*Qs(e){const{search:t,debounceTime:r}=e.payload;yield(0,ja.gz)(bo(!1));const n=yield(0,ja.Ys)(D().selectors.getMetadata),a=yield(0,ja.Ys)(D().selectors.getDataTenants),o=yield(0,ja.Ys)(D().selectors.getCanUserReadWorkflowDataTask);let i={};try{i=(0,A.pipe)(ws.Z,(0,ws.f)(null))(n,JSON.parse(t.state),{},a,o)}catch(e){i={}}(yield(0,ja.Ys)(lo.lF))&&(i.currentTenant=yield(0,ja.Ys)(D().selectors.getTenant)),yield(0,ja.gz)(N.search.actions.updateState(Hs({},i,{debounceTime:r})))}const Js=e=>{let{type:t,payload:r={}}=e;return t===N.search.constants.KEYWORD_UPDATED&&!(null==r||!r.saveToRecent)},ec=[function*(){yield(0,ja.Fm)([Lr],Ws)},function*(){yield(0,ja.ib)(Br,$s)},function*(){yield(0,ja.Fm)([N.ui.constants.UIActions.OPEN_ENTITY,nr,ir,kr,k.Z.CHANGE_PAGE,k.Z.CHANGE_ROWS_PER_PAGE,k.Z.EXPORT_RESULTS,Js],Xs)},function*(){yield(0,ja.Fm)([$r],Qs)},function*(){yield(0,ja.ib)([Zr],Gs)},function*(){yield(0,ja.ib)(Hr,Ks)}],tc=e=>e[Z.Jf].entity.loading,rc=e=>e[Z.Jf].entity.selectedEntityUri,nc=e=>e[Z.Jf].entity.entity,ac=e=>({type:vn,payload:e}),oc=e=>({type:Tn,payload:e}),ic=e=>({type:On,payload:e}),lc=e=>({type:xn,payload:e});function*sc(e){if(yield(0,ja.Ys)(lo.lF)){const t=yield(0,ja.RE)(kl,(0,T.getDtssEntityUrl)(e));return(yield(0,ja.RE)(Pl,t))[0]}return yield(0,ja.RE)(T.getEntity,e)}function*cc(e){const t=e.payload;(yield(0,ja.Ys)(rc))!==t&&(yield(0,ja.gz)(ic(t)));const r=yield(0,ja.Ys)(nc);if(yield(0,ja.gz)(ac(!0)),(0,A.isNil)(t))yield(0,ja.gz)(lc(null));else if(!r||r.uri!==t)try{const e=yield(0,ja.RE)(sc,t);yield(0,ja.gz)(lc(e))}catch(e){n=e,(0,so.U)(n,{defaultMessage:uo().text("Can't load entity")}),yield(0,ja.gz)(lc(null))}var n;yield(0,ja.gz)(ac(!1))}const uc=[function*(){yield(0,ja.Fm)(Tn,cc)}];function*pc(e){const t="type"===(0,A.path)(["payload","facetFieldName"],e),r=(0,A.path)(["payload","values"],e);if(!t||1!==(0,A.length)(r))return;const n=yield(0,ja.Ys)(D().selectors.getMetadata),a=(0,T.getEntityType)(n,r[0]),o=a.defaultFacetedAttributes||[];if(o.length>0){const e=yield(0,ja.Ys)(I.Mp),t=t=>{let{fieldName:r}=t;return(0,A.none)((0,A.propEq)("fieldName",r),e)},r=(0,mo.vf)(n,a).map((e=>(0,mo.NG)(n,e,a.uri,"",_.u7))),i=o.reduce(((e,n)=>{const a=(0,T.attributeUriToSearchUri)(n),o=(0,_.zy)(r,a);return o&&t(o)?e.concat(o.children?(0,mo.jj)(o).filter(t):o):e}),[]);i.length>0&&(yield(0,ja.gz)(eo(i,!0)))}}const dc=[function*(){yield(0,ja.Fm)(P.k.CHANGE_VALUES,pc)}],mc=e=>({type:Mn,payload:e}),yc=()=>({type:zn}),gc=()=>({type:Nn}),fc=e=>({type:kn,payload:e}),hc=e=>({type:Un,payload:e}),Ec=e=>({type:Fn,payload:e}),bc=e=>({type:Bn,payload:e}),vc=e=>({type:Hn,payload:e}),Tc=e=>{let{id:t,groupId:r}=e;return{type:qn,payload:{id:t,groupId:r}}},Oc=e=>{let{id:t,groupId:r,operationParameters:n}=e;return{type:Gn,payload:{id:t,groupId:r,operationParameters:n}}},xc=(e,t,r)=>({type:$n,payload:{groupId:e,attributeId:t,attribute:xt(r)}}),Cc=(e,t,r)=>({type:Kn,payload:{groupId:e,attributeId:t,attributeData:Ct(r)}}),Sc=(e,t)=>({type:Kn,payload:{groupId:e,attributeId:t,attributeData:null}}),wc=(e,t,r)=>({type:Xn,payload:{groupId:e,attributeId:t,selectInfo:r}}),Ac=(e,t)=>({type:Qn,payload:{groupId:e,attributeId:t}}),Rc=(e,t,r)=>({type:Jn,payload:{groupId:e,attributeId:t,filter:r}}),_c=(e,t,r)=>({type:ea,payload:{groupId:e,attributeId:t,values:r}}),Ic=e=>({type:aa,payload:e});var Nc=r(97698);const Dc=(0,A.has)("actions"),Pc=e=>e.actions.map((0,A.assocPath)(["operationParameters","conditions"],e.conditions)),kc=(0,A.path)(["operationParameters","attributeTypeData","attributeType"]),Lc=(0,A.path)(["operationParameters","attributeTypeData","fieldName"]),Uc=(0,A.path)(["operationParameters","pin"]),jc=(0,A.path)(["operationParameters","addNestedAttribute"]),Fc=(0,A.path)(["operationParameters","attributeValue"]),Mc=(0,A.path)(["operationParameters","attributeValueToFind"]),Vc=(0,A.anyPass)([(0,A.equals)(Z.Vh.AddNew),(0,A.equals)(Z.Vh.ReplaceAllWith)]),Bc=(0,A.anyPass)([(0,A.equals)(Z.Vh.AddNew),(0,A.equals)(Z.Vh.ReplaceAllWith),(0,A.equals)(Z.Vh.FindAndReplace)]),zc=(0,A.equals)(Z.Vh.AddNew),Hc=(0,A.both)((0,A.pipe)(kc,T.isNested),(0,A.pipe)((0,A.prop)("operation"),Vc)),Yc=(0,A.both)((0,A.pipe)(kc,T.isReference),(0,A.pipe)((0,A.prop)("operation"),zc)),Wc=(0,A.both)((0,A.pipe)(Fc,T.isLookupAttrType),(0,A.pipe)((0,A.prop)("operation"),Bc));function Gc(e){switch(e){case Z.Vh.AddNew:case Z.Vh.RepointReference:case Z.Vh.ReplaceAllWith:return["attributeValue"];case Z.Vh.FindAndReplace:return["attributeValueToFind","attributeValue"];case Z.Vh.FindAndRemove:return["attributeValueToFind"];default:return[]}}const qc=e=>{if(!e.operation||!e.operationParameters)return!1;const t=Hc(e),r=Yc(e),n=Gc(e.operation);for(let a of n){const n=e.operationParameters[a];if((0,T.isEmptyValue)(n)||r&&(0,T.isEmptyValue)((0,T.getReferencedEntityFromAttrValue)(n))||t&&(0,T.isEmptyValue)((0,T.cleanAttributesWith)({deleteEmptyComplex:!0})(n.value)))return!1}return!0},Zc=e=>{const t=Hc(e),r=Yc(e);return t||r?Gc(e.operation).reduce(((e,t)=>{const r=["operationParameters",t,"value"];if((0,A.path)(r,e)){const t=(0,A.lensPath)(r);return(0,A.over)(t,(0,T.cleanAttributesWith)({deleteEmptyComplex:!0}),e)}return e}),e):e},$c=e=>e[Z.Jf].bulkUpdate.operation,Kc=e=>e[Z.Jf].bulkUpdate.activeStep,Xc=e=>e[Z.Jf].bulkUpdate.loading,Qc=e=>{const t=(0,Do.IJ)(e)?(0,ei.V6)(e):(0,I.DX)(e),r=(0,Do.tB)(e);return r||1===t.length?r||t[0]:null},Jc=(0,A.path)([Z.Jf,"bulkUpdate","objects"]),eu=e=>Jc(e).total,tu=e=>Jc(e).selectionMode,ru=e=>Jc(e).entities,nu=e=>Jc(e).selectedEntities,au=e=>Jc(e).page,ou=e=>Jc(e).rowsPerPage,iu=e=>Jc(e).sortField,lu=e=>Jc(e).sortOrder,su=e=>Jc(e).selectedColumns,cu=e=>Jc(e).filterText,uu=(0,A.pipe)(tu,(0,A.equals)(Z.v6.include)),pu=(0,A.ifElse)(uu,(0,A.pipe)(nu,A.length),(e=>{const t=nu(e).length;return(0,lo.hX)(e)-t})),du=(0,A.pipe)(pu,(0,A.gt)(A.__,0)),mu=e=>e[Z.Jf].bulkUpdate.actions,yu=(0,Nc.createSelector)(mu,(0,A.pipe)((0,A.map)((0,A.ifElse)(Dc,(0,A.evolve)({actions:(0,A.pipe)((0,A.map)(Zc),(0,A.filter)(qc))}),Zc)),(0,A.filter)((0,A.ifElse)(Dc,(0,A.pipe)((0,A.path)(["actions","length"]),(0,A.gt)(A.__,0)),qc)))),gu=(0,Nc.createSelector)(mu,(0,A.pipe)((0,A.map)((0,A.when)(Dc,(0,A.prop)("actions"))),A.flatten)),fu=e=>{const t=gu(e);return 0!==t.length&&t.every(qc)},hu=e=>e[Z.Jf].bulkUpdate.requestPending,Eu=(0,T.getUrisForSaving)((e=>(0,A.equals)(e.slice(-3),["operationParameters","attributeValue","entityUri"]))),bu=(0,A.curry)(((e,t,r)=>{const n=(0,A.pipe)(Eu,(0,A.find)((t=>(0,A.pathSatisfies)((t=>t===e),t,r))))(r);return n?(0,A.set)((0,A.lensPath)(n),t,r):r})),vu=(e,t,r)=>(0,A.pipe)(bu(e,t),(0,A.when)((e=>e===r),(0,T.replaceTemporaryRefEntityURI)(e,t)))(r),Tu=(0,A.pathEq)(["data","fieldName"],Z.E_),Ou=(0,A.pipe)((0,A.path)(["values",0,"entityUri"]),(0,A.objOf)("uri"),T.getEntityId,T.wrapInQuotes),xu=e=>[{attributes:e,operator:"or"}],Cu=(0,A.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===Z.Vp.AddAttribute&&l--,o.length||(o=a.slice(-1),l++);const s=`${(0,A.repeat)("parent.",Math.max(0,l)).join("")}attributes.${o.join(".")}`;return(0,A.assocPath)(["data","fieldName"],s,r)})))),Su=(0,A.curry)(((e,t,r)=>{const n=((e,t,r)=>{const[n,a]=(0,A.partition)(Tu,e),o=(0,A.pipe)(Cu(t,r),xu,Fa.Jk)(a),i=n.length?(e=>`in(${Z.E_}, ${e.map(Ou).join(",")})`)(n):"";return o&&i?`${o} and ${i}`:o||i})(e,t,r.operation);return(0,A.isEmpty)(n)?r:(0,A.ifElse)((0,A.pipe)((0,A.path)(["operationParameters","valueFilter"]),T.isEmptyValue),(0,A.assocPath)(["operationParameters","valueFilter"],n),(0,A.evolve)({operationParameters:{valueFilter:(0,A.concat)(A.__,` and (${n})`)}}))(r)}));var wu=r(9828);function Au(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){Ru(e,t,r[t])}))}return e}function Ru(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _u=e=>{const t=(0,A.pipe)((0,A.pick)(["pin"]),(0,A.assoc)("value",Iu(e)))(e);return(0,wu.Kn)(t.value)?Object.keys(t.value).reduce(((e,r)=>(e.value=Au({},e.value,{[r]:t.value[r].map(_u)}),e)),t):t},Iu=(0,A.when)(wu.Kn,(0,A.ifElse)((0,A.has)("lookupCode"),(0,A.prop)("lookupCode"),(0,A.prop)("value"))),Nu=(0,A.cond)([[Hc,(0,A.pipe)(Fc,_u)],[Yc,(0,A.pipe)(Fc,(e=>{const{refEntity:t=[],refRelation:r=[]}=e;return Au({refEntity:(0,A.pipe)(A.head,(0,A.pick)(["objectURI"]))(t),refRelation:(0,A.pipe)(A.head,(0,A.pick)(["type"]))(r)},_u(e))}))],[Wc,(0,A.pipe)(Fc,Iu)],[A.T,Fc]]),Du=(0,A.pipe)(Nu,(0,A.assocPath)(["operationParameters","attributeValue"])),Pu=(0,A.ifElse)(Uc,(()=>(0,A.assocPath)(["operationParameters","pin"],!0)),(()=>A.identity)),ku=(0,A.ifElse)(jc,(()=>(0,A.assocPath)(["operationParameters","addNestedAttribute"],!0)),(()=>A.identity)),Lu=(0,A.pipe)(Mc,(0,A.ifElse)(A.isNil,(()=>A.identity),(0,A.pipe)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return`equals(value, '${Iu(e)}')`}),(0,A.assocPath)(["operationParameters","valueFilter"])))),Uu=(0,A.pipe)(Fc,(0,A.prop)("entityUri"),(0,A.assocPath)(["operationParameters","referencedEntity","uri"])),ju=(e,t)=>({operationParameters:{attributeURI:e},operation:t}),Fu=(e,t)=>(0,A.pipe)(ju,Du(e),Pu(e),ku(e))(t,Z.Vp.AddAttribute),Mu=(e,t)=>(0,A.pipe)(ju,Lu(e))(t,Z.Vp.DeleteAttribute),Vu=(e,t)=>(0,A.pipe)(ju,Du(e),Pu(e),Lu(e))(t,Z.Vp.UpdateAttribute),Bu=(e,t)=>(0,A.pipe)(ju,Uu(e))(t,Z.Vp.RepointReferencedEntity),zu=(e,t)=>(0,A.reject)(A.isNil,{operationParameters:e,operation:t}),Hu=e=>zu({tags:[Fc(e)]},Z.Vp.AddTags),Yu=e=>zu({newValue:Fc(e),oldValue:Mc(e)},Z.Vp.ReplaceTag),Wu=e=>zu({tags:[Mc(e)]},Z.Vp.DeleteTags),Gu=()=>zu(null,Z.Vp.ClearTags),qu=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===Z.v6.include?{list:a,activeness:i}:{filter:(0,A.pipe)(Fa.XP,(0,T.addGlobalFilterToQuery)(l))(t),excludeList:a,options:o,activeness:i}},Zu=(0,A.curry)(((e,t)=>(0,A.chain)((0,A.ifElse)(Dc,(0,A.pipe)(Pc,Zu(e)),$u(e)))(t))),$u=(0,A.curry)(((e,t)=>{const r=(0,A.pathOr)([],["operationParameters","conditions"],t),n=Lc(t);return(0,A.pipe)(Xu(e),(0,A.map)(Su(r,n)))(t)})),Ku=(0,A.curry)((e=>(0,A.propEq)("operation",e))),Xu=(0,A.curry)(((e,t)=>{const r=Lc(t),n=r.includes(".")?(0,T.searchUriToAttrUri)(r,e):r,a=r===T.EntityAttrTypes.tags.uri;return(0,A.cond)([[(0,A.both)((0,A.always)(a),Ku(Z.Vh.AddNew)),()=>[Hu(t)]],[(0,A.both)((0,A.always)(a),Ku(Z.Vh.Clear)),()=>[Gu()]],[(0,A.both)((0,A.always)(a),Ku(Z.Vh.ReplaceAllWith)),()=>[Gu(),Hu(t)]],[(0,A.both)((0,A.always)(a),Ku(Z.Vh.FindAndReplace)),()=>[Yu(t)]],[(0,A.both)((0,A.always)(a),Ku(Z.Vh.FindAndRemove)),()=>[Wu(t)]],[Ku(Z.Vh.AddNew),()=>[Fu(t,n)]],[Ku(Z.Vh.Clear),()=>[Mu(t,n)]],[Ku(Z.Vh.ReplaceAllWith),()=>[Mu(t,n),Fu(t,n)]],[Ku(Z.Vh.FindAndReplace),()=>[Vu(t,n)]],[Ku(Z.Vh.FindAndRemove),()=>[Mu(t,n)]],[Ku(Z.Vh.RepointReference),()=>[Bu(t,n)]]])(t)}));function Qu(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){Ju(e,t,r[t])}))}return e}function Ju(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*ep(e){if(e.payload){const e=yield(0,ja.Ys)(Do.tB);let r;do{if(r=yield(0,ja.Ys)(lo.BP,{entityTypeUri:e}),r)break;yield(0,ja.qn)(k.Z.UPDATE_ENTITIES)}while(!r);const n=yield(0,ja.Ys)(Qc),a=yield(0,ja.Ys)(lo.fx,{entityTypeUri:e}),o=yield(0,ja.Ys)(lo.Uz,{entityTypeUri:e}),i=(yield(0,ja.Ys)(lo.L9,{entityTypeUri:e}))||void 0,l=yield(0,ja.Ys)(lo.NW,{entityTypeUri:e}),s=(yield(0,ja.RE)(ni))[n].filter((0,A.pipe)((0,A.prop)("id"),T.isAttributeSearchUri,A.not)),c=e?yield(0,ja.Ys)(Do.Gv,e):s,u=yield(0,ja.Ys)(lo.NU,{entityTypeUri:e});yield(0,ja.gz)((t={page:a,rowsPerPage:o,sortOrder:i,sortField:l,selectedColumns:c,total:u,entities:r},{type:In,payload:t}))}var t}function*tp(e){const t=yield(0,ja.Ys)(D().selectors.getMetadata),r=yield(0,ja.Ys)(au),n=yield(0,ja.Ys)(ou),a=yield(0,ja.Ys)(lu),o=yield(0,ja.Ys)(iu),i=yield(0,ja.RE)(pp),l=(0,A.uniq)(i.concat((0,Fa.kx)(t,e))),s=Qu({page:r,rowsPerPage:n,sortOrder:a,sortField:o,forceOvOnly:!0},yield(0,ja.Ys)(D().selectors.getGlobalSearchRequestOptions),{select:l}),c=(0,Fa.Lv)(e,s);yield(0,ja.gz)(fc(!0));try{const e=yield(0,ja.RE)(T.rawRequest,Z.NV,c);yield(0,ja.gz)(mc(e))}catch(e){console.warn(e),yield(0,ja.gz)(mc([]))}yield(0,ja.gz)(fc(!1))}function*rp(){const e=yield(0,ja.Ys)(cu),t=yield(0,ja.RE)(up,e);yield(0,ja.rM)(tp,t)}function*np(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{debounceTime:t}=e.payload||{};t&&(yield(0,ja.gw)(t));const r=yield(0,ja.Ys)(cu),n=yield(0,ja.RE)(up,r);yield(0,ja.gz)(hc(0)),yield(0,ja.rM)(ap,n)}function*ap(e){const t=yield(0,ja.Ys)(D().selectors.getGlobalSearchRequestOptions),r=(0,Fa.Vg)(e,[],t);try{const e=yield(0,ja.RE)(T.rawRequest,Z.jS,{method:"POST",body:JSON.stringify(r)});yield(0,ja.gz)(bc(e.total))}catch(e){console.warn(e),yield(0,ja.gz)(bc(0))}}function*op(){const e=(yield(0,ja.Ys)(ru)).map((e=>e.uri)),t=yield(0,ja.RE)(pp),r=yield(0,ja.Ys)(cu),n=yield(0,ja.RE)(up,r),a=yield(0,ja.Ys)(D().selectors.getGlobalSearchRequestOptions),o=(0,Fa.aG)(e,n,Qu({select:t},a));yield(0,ja.gz)(fc(!0));try{const e=yield(0,ja.RE)(T.rawRequest,o.url,o.options);yield(0,ja.gz)(mc(e))}catch(e){console.warn(e),yield(0,ja.gz)(mc([]))}yield(0,ja.gz)(fc(!1))}function*ip(e){try{yield(0,ja.RE)(T.rawRequest,e.url,e.options),yield(0,ja.gz)(Io(!1)),yield(0,ja.gz)(Ro({message:uo().text("Bulk update is currently in progress. You'll receive an email notification once completed.\nGo to Tenant Management to view the status."),actionLabel:uo().text("Tenant Management"),actionToDispatch:N.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?uo().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||uo().text("Something went wrong...")),yield(0,ja.gz)((t=r,wo({payload:{message:t,action:{actionToDispatch:So()}},type:Z.GT.error})))}var t}function*lp(){const e=yield(0,ja.Ys)($c);e===Z.dV.UpdateProfiles?yield(0,ja.RE)(sp):e===Z.dV.DeleteProfiles&&(yield(0,ja.RE)(cp))}function*sp(){yield(0,ja.gz)(Ic(!0));const e=yield(0,ja.Ys)(Qc),t=yield(0,ja.Ys)(Jc);let r=yield(0,ja.Ys)(yu);const n=yield(0,ja.RE)(up),a=yield(0,ja.Ys)(D().selectors.getGlobalSearchRequestOptions),o=yield(0,ja.Ys)(D().selectors.getModifiedEntities),i=((e,t)=>{const r=(0,T.findAllTemporaryRefEntityURI)(t),n=(a=t,(0,A.pipe)(Eu,(0,T.getPathsWithTempUri)(a),(0,A.map)((e=>(0,A.path)(e,a))))(a));var a;return r.concat(n).filter((t=>e[t]))})(o,r);if(i.length>0){const e=yield(0,ja.RE)(T.saveTemporaryEntities,o,i);for(const[t,n]of Object.entries(e))r=vu(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:qu(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:Zu(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,ja.RE)(ip,l),yield(0,ja.gz)(Ic(!1))}function*cp(){yield(0,ja.gz)(Ic(!0));const e=function(e,t,r){const n={objects:qu(e,t,r)};return{url:"/entities/_delete?sendMail=true",options:{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}}}(yield(0,ja.Ys)(Jc),yield(0,ja.RE)(up),yield(0,ja.Ys)(D().selectors.getGlobalSearchRequestOptions));yield(0,ja.RE)(ip,e),yield(0,ja.gz)(Ic(!1))}function*up(e){const t=yield(0,ja.Ys)(lo.FR),r={fieldName:"type",filter:"equals",values:[yield(0,ja.Ys)(Qc)]};let n=t.filter((e=>"type"!==e.fieldName)).concat(r);return e&&(n=n.concat({fieldName:"attributes",filter:"containsWordStartingWith",values:[e]})),n}function*pp(){const e=yield(0,ja.Ys)(su);return(0,No.vw)(e)}function*dp(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,ja.Ys)(mu),o={addAttributeAfter:xc,changeAttribute:Cc,clearAttribute:Sc,deleteAttribute:Ac};yield(0,ja.RE)(nl,{groups:a,attributesPropName:"conditions",groupId:t,attributeId:r,selectInfo:n,actions:o})}const mp=[function*(){yield(0,ja.Fm)(fe,ep)},function*(){yield(0,ja.Fm)([Un,Ln,jn],rp)},function*(){yield(0,ja.Fm)(Vn,np)},function*(){yield(0,ja.Fm)(zn,op)},function*(){yield(0,ja.ib)(Xn,dp)},function*(){yield(0,ja.ib)(na,lp)}],yp=()=>({id:Z.Jf,reducerMap:{[Z.Jf]:(0,w.combineReducers)({ui:qe,search:pe,facets:q,advancedSearch:rr,savedSearches:un,recentSearches:bn,entity:Rn,bulkUpdate:Ua})},sagas:[...Ul,...is,...mi,...dl,...Mi,...ec,...hs,vs,...uc,...dc,...mp]});var gp=r(95099),fp=r.n(gp),hp=r(34756),Ep=r(79573),bp=r(23625),vp=r.n(bp),Tp=r(42950);const Op=(0,Tp.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 xp=r(53732),Cp=r.n(xp),Sp=r(88214),wp=r.n(Sp),Ap=r(14294),Rp=r.n(Ap),_p=r(4501),Ip=r.n(_p),Np=r(18538);const Dp=(0,Tp.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 Pp(){return Pp=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},Pp.apply(this,arguments)}function kp(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){Lp(e,t,r[t])}))}return e}function Lp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Up=(0,h.memo)((e=>{let{value:t,autofocus:r,onSearch:n=Ep.ZT,rootRef:a,classes:o={},height:i,placeholder:l=uo().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=Dp({height:i}),[u,p]=(0,h.useState)(""),d=(0,A.pipe)((0,A.tap)(n),p),m=(0,A.isNil)(t)?u:t;return E().createElement(Cp(),Pp({startAdornment:E().createElement(wp(),{position:"start"},E().createElement(Ip(),{className:c.icon})),endAdornment:E().createElement(wp(),{position:"end"},m.length>0&&E().createElement(Np.T,{icon:Rp(),className:c.clearButton,onClick:()=>d("")})),autoFocus:r,classes:kp({},o,{input:v()(c.input,o.input),root:v()(c.container,o.root)}),placeholder:l,value:m,onChange:(0,A.pipe)(Ep.NA,d),disableUnderline:!0,ref:a},s))}));function jp(){return jp=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},jp.apply(this,arguments)}const Fp=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=Op({containerWidth:l,containerHeight:s}),f=E().createElement(E().Fragment,null,!a&&E().createElement("div",{className:g.header},t),!o&&E().createElement(Up,{onSearch:n,autofocus:!0,onKeyDown:c,inputRef:p,classes:{root:g.searchInputContainer},placeholder:uo().text("Search & add attributes"),height:40}));return E().createElement(vp(),jp({anchorOrigin:d,transformOrigin:m},y),E().createElement("div",{className:v()(g.container,r),style:{width:l}},"top"===i&&f,E().createElement("div",{className:g.list},u),"bottom"===i&&f))},Mp=e=>{const t=e=>(0,A.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 Vp=r(50166),Bp=r(88267);const zp=(0,Tp.Z)({stickyTitlesWrapper:{position:"absolute",top:0,"& > div":{zIndex:1,position:"absolute",top:0,width:"100%",visibility:"hidden"}}}),Hp=e=>e.titleItemIndex===e.index,Yp=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=zp(),y=(0,h.useRef)(null),g=(0,h.useRef)(null),f=(0,h.useRef)(null),b=(0,h.useRef)([0]),v={topMargin:0},T=(0,h.useMemo)((()=>!u||(t||[]).some((e=>null!==e.titleItemIndex))),[t,u]),O=(0,h.useCallback)((e=>{const n=b.current.length;let a=0;t.slice(n-1,e+1).forEach(((e,t)=>{const o=n+t-1;t>0&&(b.current[o]=b.current[o-1]+a),a=r(o,e.item)}))}),[r,t]),x=(0,h.useCallback)((e=>t[e].titleItemIndex),[t]),C=(0,h.useCallback)((e=>t[e]),[t]);(0,h.useEffect)((()=>{requestAnimationFrame((()=>{y.current&&y.current.scrollTo(0)}))}),[t.length]),(0,h.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:b.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,b,t,y]);const S=()=>{f.current&&g.current&&(f.current.style.width=g.current.offsetWidth+"px")},w=(0,h.useCallback)((e=>{let r=null,n=0;return t.some(((t,a)=>{O(a+10);const o=b.current[a+1];return e>=n&&e<o&&(r={index:a,offset:n,listItem:t}),n=o,r})),r}),[O,b,t]),A=(0,h.useCallback)((e=>r(e,C(e).item)),[C,r]),R=(0,h.useCallback)((e=>{let{index:t,style:r,data:o}=e;const i=C(t);return i.item&&(Hp(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,h.useRef)(null),o=(0,h.useRef)(null),i=(0,h.useCallback)((e=>{let{visibleStartIndex:t,visibleStopIndex:r}=e;a.current=t,o.current=r}),[]);return(0,h.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,h.useCallback)((()=>t.filter((e=>Hp(e))).map((e=>(e=>E().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 E().createElement(E().Fragment,null,E().createElement("div",{ref:f,className:m.stickyTitlesWrapper},l&&I()),d&&g.current&&E().createElement(Bp.Z,{handleHeight:!0,onResize:d,targetDomEl:g.current}),E().createElement(Vp.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&&Hp(u.listItem)&&(p=c-(u.offset-n));break;case"backward":{const e=i>-1&&(d=i,t.findIndex(((e,t)=>Hp(e)&&d<t))),r=(e=>(O(e),b.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))};Yp.propTypes={items:fp().arrayOf(fp().object).isRequired,getItemSize:fp().func.isRequired,renderItem:fp().func.isRequired,width:fp().oneOfType([fp().number,fp().string]),height:fp().number.isRequired,renderGroupTitle:fp().func,fixedTitle:fp().bool,hideSubtitles:fp().bool,itemKey:fp().func,disableHorizontalScrollbar:fp().bool,focusIndex:fp().number,onInnerContainerResize:fp().func};const Wp=Yp,Gp=e=>{let{items:t,open:r,onSelectFocusedItem:n,selectedItems:a,onClose:o}=e;const[i,l]=(0,h.useState)(null),s=(0,h.useRef)(!1),c=(0,h.useCallback)((e=>{let r=null===e?c(-1):e;for(;null!==e&&r<t.length&&(r<=e||r>=0&&Hp(t[r]));)r+=1;return r!==t.length?r:c(-1)}),[t]),u=(0,h.useCallback)((e=>{let r=null===e?t.length-1:e;for(;null!==e&&r>=0&&(r>=e||Hp(t[r]));)r-=1;return r<0?t.length-1:r}),[t]),p=(0,h.useCallback)((()=>{if(!(0,A.isNil)(i)){const e=t[i].item;!e.item.notSelectable&&n({item:e.item,groupData:e})}}),[n,t,i]),d=(0,h.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,h.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 qp=r(85746),Zp=r.n(qp),$p=r(22811),Kp=r.n($p),Xp=r(93222),Qp=r.n(Xp);function Jp(){return Jp=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},Jp.apply(this,arguments)}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)}const td=e=>E().createElement("svg",ed({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),E().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 rd(){return rd=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},rd.apply(this,arguments)}const nd=e=>E().createElement("svg",rd({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),E().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 ad(){return ad=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},ad.apply(this,arguments)}const od=e=>E().createElement("svg",ad({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),E().createElement("rect",{fill:"#000",x:9,y:9,width:6,height:6,rx:1,stroke:"none",strokeWidth:1,fillRule:"evenodd"})),id=(0,Tp.Z)({icon:{opacity:.29,width:"16px",height:"16px",flexShrink:0,marginRight:"6px",marginLeft:"8px"}}),ld=e=>{let{attrType:t={}}=e;const r=id(),n=(e=>{switch(e.type){case T.DataTypes.TYPE_IMAGE:case T.DataTypes.TYPE_NESTED:return td;case T.DataTypes.TYPE_REFERENCE:return nd;default:return od}})(t);return E().createElement(n,{className:r.icon})},sd=(0,Tp.Z)({mark:{color:"red"}}),cd=()=>{const e=sd();return E().createElement("span",{className:e.mark},"*")},ud=e=>{let{margin:t,level:r,className:n,children:a}=e;return null!=r?E().createElement("div",{style:{marginLeft:r*t},className:n},a):a};var pd=r(1063),dd=r(85740);const md=(0,Tp.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"}}),yd=(0,dd.T)((e=>E().createElement("svg",Jp({width:13,height:18,viewBox:"0 0 13 18",xmlns:"http://www.w3.org/2000/svg"},e),E().createElement("g",{transform:"translate(-3 -1)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},E().createElement("path",{fill:"#FF4081",d:"M5.833 10h3.75v6.667l-3.75 1.666z"}),E().createElement("path",{fill:"#CE0C4E",d:"M13.333 10v8.333l-3.75-1.666V10z"}),E().createElement("circle",{fill:"#FFC058",cx:9.583,cy:7.917,r:6.25}),E().createElement("circle",{fill:"#FFCD7B",cx:9.583,cy:7.917,r:5.417}),E().createElement("path",{fill:"#FFFBB5",d:"M8.333 11.667L5 8.462l.933-.898 2.4 2.308L13.4 5l.933.897z"}))))),gd=e=>{let{groupId:t,data:r,checked:n=!1,isFocused:a=!1,isRequired:o=!1,label:i,labelInText:l,level:s,onClick:c=Ep.ZT,hideCheckBox:u=!1,hideIcon:p=!1,notSelectable:d=!1,disableHorizontalScrollbar:m=!1,style:y={},subItemMargin:g=20,LogoIcon:f,className:h,disableNonSelectable:b,disableGutters:O}=e;const x=md(),{attrType:C}=r||{},S=!(u&&(0,T.isNested)(C)||d),w=!!f;return E().createElement(pd.Y,{value:l||i,className:x.itemTooltip,placement:"bottom-end"},E().createElement(Qp(),{className:v()(x.container,x.listItem,{[x.defaultCursor]:!S},h),onClick:S?()=>c(r,!n,t):void 0,style:y,dense:!0,disabled:b&&d,classes:{focusVisible:x.listItemFocus,selected:x.listItemFocus},selected:a,tabIndex:-1,disableGutters:O},!u&&E().createElement(Kp(),{checked:n,disableRipple:!0,disabled:!S,className:v()(x.checkbox,{[x.checked]:n}),tabIndex:-1}),E().createElement(ud,{margin:g,level:s,className:x.marginWrapper},E().createElement(E().Fragment,null,!p&&(e=>"recommended"===t?E().createElement(yd,{className:x.recommendedIcon,tooltipTitle:uo().text("Recommended"),showForDisabled:!0}):E().createElement(ld,{attrType:e}))(C),E().createElement("div",{className:v()(x.itemTextWrapper,{[x.marginText]:p})},w&&E().createElement(f,{className:x.logoIcon}),E().createElement(Zp(),{primary:E().createElement(E().Fragment,null,i,o&&E().createElement(cd,null)),className:x.itemText})))),S&&m&&E().createElement("div",{className:x.itemAfter})))};gd.defaultName="AttributeListItem";const fd=(0,h.memo)(gd);var hd=r(49940);const Ed=(0,Tp.Z)({popupContainer:{},container:{"&$popupContainer":{height:"408px",minWidth:"200px"}}});function bd(){return bd=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},bd.apply(this,arguments)}function vd(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){Td(e,t,r[t])}))}return e}function Td(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Od=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,h.useCallback)((e=>e.label.toLowerCase().includes(l.toLowerCase())),[l]),y=(0,h.useCallback)((e=>m(e)||(e.children||[]).some(y)),[m]),g=(0,h.useMemo)((()=>{const e=(0,A.curry)(((e,r,n,a)=>[{item:vd({},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?A.map:A.chain)(o,i)};return t}),[l,p,y]),f=(0,h.useCallback)((e=>e.map((e=>({item:e,items:g(e.attributes,e.id,e.label)}))).filter((e=>e.items.length))),[g]),b=(0,h.useCallback)((e=>{let{item:t}=e;s(t,!c.find((e=>e.id===t.id||e.id.includes(`${t.id}.`))))}),[s,c]),O=(0,h.useMemo)((()=>(p?f:g)(n)),[n,p,f,g]),x=(0,h.useMemo)((()=>Mp(O)),[O]),{focusIndex:C,handleKeyDown:S}=Gp({items:x,open:t,onSelectFocusedItem:b,selectedItems:c}),w=(0,h.useRef)(null);w.current=C;const R=(0,h.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 E().createElement(fd,{key:n.id,onClick:s,checked:o,level:a,data:n,label:E().createElement(hd.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,T.getMaxItemWidth)("label")(O)||308,I=Ed();return E().createElement(Fp,bd({open:t,className:v()(I.container,I.popupContainer),anchorEl:r,onClose:o,onSearch:a,title:i,containerWidth:_,searchInputOnKeyDown:S},d),E().createElement(Wp,{height:300,renderItem:R,items:x,hideSubtitles:!0,getItemSize:()=>32,containerWidth:_,focusIndex:C,renderGroupTitle:p}))};Od.propTypes={open:fp().bool,hideCheckBox:fp().bool,anchorEl:fp().any,selected:fp().array,data:fp().array,filterText:fp().string,titleText:fp().string,onClose:fp().func,onListItemClick:fp().func,onSearch:fp().func,renderGroupTitle:fp().func},Od.defaultProps={data:[],selected:[],titleText:uo().text("Show/hide columns"),filterText:""};var xd=r(97179);function Cd(){return Cd=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},Cd.apply(this,arguments)}const Sd=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 E().createElement("svg",Cd({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},r),E().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",opacity:".54"},E().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"})))},wd="Headers-styles-container--Zbdka",Ad="Headers-styles-actionsBar--RXMy4",Rd="Headers-styles-previewSwitcher--Ppqem";function _d(){return _d=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},_d.apply(this,arguments)}const Id=e=>{let{entityTypeUri:t,headColumns:r=[],onSelectColumns:n=Ep.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,h.useState)(null),[l,s]=(0,h.useState)(""),c=(0,hp.useSelector)(D().selectors.getMetadata),u=()=>{i(null),s("")},p=(0,h.useCallback)(((e,a)=>{const o=(0,No.kF)(c,t),i=(0,No.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 E().createElement(E().Fragment,null,E().createElement(xd.k,_d({tooltipTitle:uo().text("Show/hide columns"),size:"M",icon:Sd,onClick:e=>i(e.currentTarget),className:"Headers-styles-headerIcon--c2qe7"},a)),(()=>{const e=(0,No.kF)(c,t);return E().createElement(Od,{open:!!o,anchorEl:o,data:e,onListItemClick:p,selected:r,filterText:l,onClose:u,onSearch:s})})())};Id.propTypes={entityTypeUri:fp().string,headColumns:fp().array,onSelectColumns:fp().func};const Nd=Id;var Dd=r(45053),Pd=r(29722),kd=r(27618),Ld=r.n(kd),Ud=r(98515),jd=r.n(Ud),Fd=r(29289);const Md=e=>{let{headCellData:t,headIndex:r,sortOrder:n,sortField:a,sortHandler:o,canCheck:i,onCheck:l,headerCheckboxState:s,openConfigColumnPopup:c}=e;return E().createElement("div",{className:v()("HeadCellRenderer-styles-headCellContentWrapper--L6RrQ",(0,A.path)(["wrapperClassName"],t))},t&&i&&E().createElement(Kp(),{className:"HeadCellRenderer-styles-checkbox--qQEHg",checked:s||!1,indeterminate:null===s,onChange:()=>l()}),E().createElement("div",{className:"HeadCellRenderer-styles-labelWrapper--cmclk"},t&&(t.sortable?E().createElement(Ld(),{active:Boolean(n&&a===t.id),direction:n,onClick:o,classes:{root:"HeadCellRenderer-styles-sortLabel--NZx3o"},component:"div"},t.label):t.label)),c&&E().createElement("div",{className:"HeadCellRenderer-styles-menuButtonWrapper--aBNeR"},E().createElement(Np.T,{icon:jd(),onClick:c,size:"S","data-column-index":r})))};Md.propTypes={headCellData:fp().shape({id:fp().string,label:fp().oneOfType([fp().string,fp().node]),sortable:fp().bool}),headIndex:fp().number,sortOrder:fp().string,sortField:fp().string,sortHandler:fp().func,canCheck:fp().bool,onCheck:fp().func,headerCheckboxState:fp().oneOf([!0,!1,null]),openConfigColumnPopup:fp().func};const Vd=(0,Fd.q)((0,A.pick)(["openConfigColumnPopup"]))(Md),Bd=(0,Fd.q)((0,A.pick)(["openConfigColumnPopup","canCheck","onCheck","headerCheckboxState"]))(Md),zd=E().createContext({generateEntityUrl:T.generateEntityUrlForOldMode,generatePivotingUrl:T.generatePivotingUrlForOldMode,generateTagUrl:T.generateTagUrlForOldMode});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)}zd.displayName="UrlGeneratorsContext";const Yd=(0,h.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,h.useContext)(zd),c=(0,C.ax)("openEntity"),u=(0,C.Qh)(),p=(0,h.useCallback)((e=>{(0,Ep.rR)(e)||(c({uri:r,screen:a}),e.preventDefault()),e.stopPropagation()}),[c,a,r]);return E().createElement("a",Hd({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}));Yd.displayName="EntityUriLink";const Wd={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"},Gd=e=>{let{value:t={}}=e;const r=(0,T.getLabel)(t.label);return E().createElement("div",{className:v()(Wd.defaultWrapper,Wd.profileWrapper)},E().createElement(S,{avatarClassName:Wd.entityAvatar,imageClassName:Wd.entityAvatarImage,entity:t}),E().createElement(Yd,{value:(0,T.getEntityUriForLink)(t),className:Wd.entityLabel},r))};Gd.propTypes={value:fp().object};const qd=Gd;var Zd=r(56755);const $d=e=>{let{value:t,columnData:{dataTypeDefinition:r}}=e;return E().createElement("div",{className:Wd.defaultWrapper},r?E().createElement(Zd.x,{value:t,dataTypeDefinition:r}):t)};$d.propTypes={value:fp().any,columnData:fp().object};const Kd=$d,Xd=(e,t,r)=>{const n=(0,T.getEntityTypeGraphIcon)(e,{type:t});return(0,T.getAbsoluteImageUrl)(r,n)};let Qd=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 Jd(){return Jd=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},Jd.apply(this,arguments)}const em=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,h.useState)(null);(0,h.useEffect)((()=>{l(r?Qd.ICON_MODE:Qd.TEXT_MODE)}),[r,n]);const s=()=>{l(Qd.ERROR_MODE)};switch(i){case Qd.ICON_MODE:return E().createElement(x(),Jd({className:v()(t,null==a?void 0:a.iconRoot),src:r,onError:s},o));case Qd.TEXT_MODE:case Qd.ERROR_MODE:return E().createElement(x(),Jd({className:v()(t,null==a?void 0:a.textRoot)},o),n);default:return null}},tm=e=>{let{value:t}=e;const r=(0,hp.useSelector)(D().selectors.getMetadata),n=(0,hp.useSelector)(D().selectors.getApiPath),a=(0,hp.useSelector)(D().selectors.getImagePath);return t&&E().createElement("div",{className:v()(Wd.defaultWrapper,Wd.referenceWrapper)},E().createElement(em,{className:Wd.referenceIcon,icon:Xd(r,t.refEntity.type,a||n)}),E().createElement(Yd,{value:t.refEntity.objectURI,className:Wd.referenceContent},(0,T.getLabel)(t.label)))};tm.propTypes={value:fp().object};const rm=tm,nm=e=>{e.stopPropagation()},am=e=>{const{value:t}=e;return E().createElement("div",{className:Wd.blobWrapper,onScroll:nm},t)};am.propTypes={value:fp().any};const om=am,im=e=>{let{value:t}=e;const r=(0,T.getImageAttributeOvThumbnailUrl)({value:t});return r&&E().createElement("div",{className:Wd.imageWrapper},E().createElement("img",{src:r}))};im.propTypes={value:fp().object};const lm=im,sm=e=>{if("label"===e.id)return qd;switch((0,A.path)(["attrType","type"],e)){case"Reference":return rm;case"Blob":return om;case"Image":return lm}return Kd};function cm(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}function pm(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 dm=(0,A.split)("."),mm=["entityId"],ym=e=>!mm.includes(e.id),gm=e=>{if((0,T.isAttributeSearchUri)(e)){const[,...t]=dm(e);return t.length>1?t.slice(0,-1):null}return null};var fm=r(57526),hm=r.n(fm),Em=r(18567),bm=r.n(Em),vm=r(99272),Tm=r.n(vm);const Om=(0,Tp.Z)({root:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px"},check:{color:"#8CC152"}});let xm=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 Cm=e=>{let{classes:t={},tooltip:r="",onClick:n=Ep.ZT,mode:a=xm.INIT}=e;const o=Om();return E().createElement("div",{className:v()(o.root,t.root)},(()=>{switch(a){case xm.INIT:return E().createElement(xd.k,{className:t.button,size:"M",tooltipTitle:r,icon:bm(),onClick:n});case xm.PROGRESS:return E().createElement(hm(),{className:t.spinner,size:24});case xm.SUCCESS:return E().createElement(Tm(),{className:v()(o.check,t.check)});default:return null}})())};function Sm(){return Sm=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},Sm.apply(this,arguments)}const wm=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,hp.useSelector)(D().selectors.getDtssPath),l=(0,hp.useSelector)(D().selectors.getTenant);return E().createElement(Cm,Sm({},o,{mode:r,tooltip:uo().text("Import this record"),onClick:e=>{e.stopPropagation(),n(xm.PROGRESS),(0,T.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(xm.SUCCESS),setTimeout((()=>n(xm.DONE)),a)})).catch((()=>{n(xm.INIT),(0,so.U)(undefined,{title:uo().text("Import Error"),message:uo().text("Record can't be imported")})}))}}))};wm.propTypes={entity:T.EntityType,importStatus:fp().oneOf((0,A.values)(xm)),onImportStatusChange:fp().func,hideDelay:fp().number};const Am=wm,Rm=(0,Tp.Z)({importButtonPlaceholder:{display:"flex",alignItems:"center",padding:"0 10px",width:"24px",flexShrink:0,position:"relative"}}),_m=e=>{let{entity:t,entityImportStatus:r,onEntityImportStatusChange:n}=e;const a=Rm(),o=(0,hp.useSelector)(D().selectors.getMetadata),i=(0,hp.useSelector)(D().selectors.getCanUserImportEntitiesFromDT),l=(0,T.isDataTenantEntity)(t)&&i,s=(0,T.getEntityType)(o,t.type),c=(0,T.checkCanImportEntityOfType)(s)&&!(0,T.isEntityImportedToCT)(t),u=r&&r!==xm.DONE||c;return E().createElement(E().Fragment,null,l&&E().createElement("div",{className:a.importButtonPlaceholder},u&&E().createElement(Am,{entity:t,importStatus:r,onImportStatusChange:e=>n(t.uri,e)})))},Im=e=>{let{entity:t,isSelectedEntity:r,isHighlightedEntity:n,entityImportStatus:a,onEntityImportStatusChange:o}=e;return E().createElement("div",{className:v()(Wd.entityButtons,{[Wd.selectedEntityButtons]:r,[Wd.justImportedEntityButtons]:a===xm.SUCCESS,[Wd.highlightedEntityButtons]:n})},E().createElement(_m,{entity:t,entityImportStatus:a,onEntityImportStatusChange:o}))};Im.propTypes={entity:fp().object,isSelectedEntity:fp().bool,isHighlightedEntity:fp().bool,entityImportStatus:fp().oneOf(Object.values(xm)),onEntityImportStatusChange:fp().func};const Nm=(0,Fd.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}}))(Im);var Dm=r(72326),Pm=r(67655);function km(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){Lm(e,t,r[t])}))}return e}function Lm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Um={height:"100%",display:"flex",flexDirection:"column"},jm=(0,Tp.Z)((e=>({inactiveCell:km({background:e.inactiveBackground},Um,{"&$selectedRowCell":{background:e.inactiveSelectedBackground}}),selectedRowCell:km({background:(0,Pm.lighten)(e.palette.primary.main,.88)},Um),clickable:km({cursor:"pointer"},Um),justImported:km({backgroundColor:"#FFFBEB !important"},Um)}))),Fm={entity:fp().object,isSelected:fp().bool,onEntityClick:fp().func,isJustImported:fp().bool},Mm=(0,Tp.Z)({checkboxWrapper:{display:"flex",alignItems:"center"},checkbox:{marginRight:"-8px",marginLeft:"11px"}});const Vm={onCheck:fp().func,isChecked:fp().bool,hasCheckbox:fp().bool},Bm=(0,Tp.Z)({collapser:{marginLeft:"-2px"}});var zm=r(18021),Hm=r(8835),Ym=r.n(Hm);const Wm=(0,Tp.Z)({collapseButton:{cursor:"pointer"},expandLess:{transform:"rotate( -180deg )"}});function Gm(){return Gm=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},Gm.apply(this,arguments)}const qm=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=Wm(),o={icon:Ym(),className:a.collapseButton,iconClassName:v()({[a.expandLess]:t})},i={tooltipTitle:r};return E().createElement(xd.k,Gm({"data-reltio-id":"collapse-button"},o,i,n))},Zm=(0,Tp.Z)((()=>({hidden:{visibility:"hidden"}}))),$m=e=>{let{rowIndex:t,rowValue:r,className:n}=e;const a=Zm(),{toggleRowCollapse:o,getIsRowCollapsible:i,getIsRowCollapsed:l}=(0,h.useContext)(zm.x),s=i(r),c=l(t);return E().createElement(qm,{className:v()(n,{[a.hidden]:!s}),isOpen:!c,onClick:e=>{o(t),e.stopPropagation()}})};const Km={hasCollapseButton:fp().bool},Xm=(0,A.pipe)((e=>{const t=t=>{const r=Bm(),{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?E().createElement("div",{className:"cellWithCollapser"},E().createElement($m,{className:r.collapser,rowIndex:i,rowValue:o}),E().createElement(e,a)):E().createElement(e,a)};return t.propTypes=Km,t}),(e=>{const t=t=>{const r=Mm(),{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?E().createElement("div",{className:v()(r.checkboxWrapper,"cellWithCheckbox")},E().createElement(Kp(),{className:r.checkbox,checked:a,onClick:e=>e.stopPropagation(),onChange:e=>n(l.uri,e.target.checked)}),E().createElement(e,i)):E().createElement(e,i)};return t.propTypes=Vm,t}),(e=>{const t=t=>{const r=jm(),{rowValue:{rawValue:n},isSelected:a,onEntityClick:o,isJustImported:i}=t,l=o?()=>o(n.uri):void 0,s=n&&!(0,T.isActiveObject)(n);return l||s||a||i?E().createElement("div",{className:v()({[r.inactiveCell]:s},{inactiveCell:s},{[r.selectedRowCell]:a},{selectedRowCell:a},{[r.clickable]:!!l},{[r.justImported]:i},{justImported:i}),onClick:l},E().createElement(e,t)):E().createElement(e,t)};return t.propTypes=Fm,t}),(0,Fd.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]===xm.SUCCESS,onEntityClick:r}})))(Dm.DN),Qm=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,A.path)(["dataTypeDefinition","type"],t)){case"Reference":return 28*n+17;case"Blob":return 100*n;case"Image":return 76*n+17;default:return a}},Jm=(0,h.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:b,logger:v,canCheck:O,checkedEntitiesUris:x,headerCheckboxState:C,onCheck:S,openConfigColumnPopup:w,resizeDebounceDelay:R}=e;const _=(0,h.useMemo)((()=>({highlightRow:"highlightedSelector",dragColumnHead:Wd.dragColumnHead,dragColumnBody:Wd.dragColumnBody,draggableHeadCell:Wd.draggableHeadCell,cellWrapper:Wd.cellWrapper})),[]),I=(0,hp.useSelector)(D().selectors.getMetadata),[N,P]=(0,h.useState)(null),k=(0,h.useCallback)((e=>{P(e),y&&y((0,A.path)([e,"uri"],n))}),[y,n]),L=(0,h.useRef)();(0,h.useImperativeHandle)(t,(()=>({resetScrollbarPosition:()=>{L.current&&L.current.resetScrollbarPosition({resetLeft:!1})}})));const U=(0,h.useCallback)((e=>{m&&e===d?m===Dd.oy?p({field:e,order:Dd.U9}):p({field:e}):p({field:e,order:Dd.oy})}),[p,d,m]),j=(0,h.useCallback)((e=>{const t=(0,A.prop)(e,n);return t?E().createElement(Nm,{entity:t,rowIndex:e}):null}),[n]),F=(0,h.useCallback)((e=>E().createElement(Xm,e)),[]),M=!!y,V=!!p,B=(0,h.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=pm(e,["attrType"]);const i=0===r;return cm({},o,{dataTypeDefinition:a&&(0,T.getAttrDataTypeDefinition)(a),resizable:!0,autoResize:null!==(n=o.autoResize)&&void 0!==n?n:!i,draggable:!i,sortable:t&&ym(o),nestedPath:gm(o.id),headCellRenderer:i?Bd:Vd,rowCellValueRenderer:sm(cm({},o,{attrType:a}))})}))}(r,V)),[r,V]),z=(0,h.useMemo)((()=>((e,t,r)=>(r||[]).map((e=>(0,A.pipe)((0,A.reduce)(((t,r)=>(0,A.assoc)(r.id,((e,t,r)=>{switch(t.id){case"label":return r;case"entityId":return(0,T.getEntityId)(r);default:{const[e,...n]=dm(t.id);return(0,A.pipe)((0,A.prop)(e),(0,T.getOvAttributeValuesByPath)(n))(r)}}})(0,r,e),t)),{}),(0,A.assoc)("rawValue",e))(t))))(0,r,n)),[I,r,n]),H=a?n.findIndex((0,A.propEq)("uri",a)):-1,Y=(0,h.useMemo)((()=>({onEntityClick:g,selectedEntityUri:o,highlightedEntityIndex:H,entitiesImportStatus:f,onEntityImportStatusChange:b,canCheck:O,checkedEntitiesUris:x,headerCheckboxState:C,onCheck:S,openConfigColumnPopup:w})),[x,f,C,H,O,S,g,b,o,w]);return E().createElement(Pd.M,{fixFirstColumn:!0,onScroll:u,rowsData:z,columnsData:B,onSort:U,highlightRow:-1!==H?H:null,ref:L,sortFieldClassName:Wd.sortableCell,containerClassName:Wd.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!=R?R:150,onRowHover:M?k:void 0,hoverStateEnabled:M,hoverRowIndex:N,renderRowOverlay:j,logger:v,context:Y,maxRowValuesCount:2,renderRowCell:F,getRowCellHeight:Qm})}));Jm.propTypes={entities:fp().array,entityToHighlight:fp().string,selectedEntityUri:fp().string,headColumns:fp().array,columnsSize:fp().array,onScroll:fp().func,onSort:fp().func,onReorderingColumn:fp().func,onChangeColumnsSize:fp().func,dndColumnReorderingEnabled:fp().bool,onEntityClick:fp().func,onEntityHover:fp().func,sortField:fp().string,sortOrder:fp().oneOf([Dd.oy,Dd.U9]),entitiesImportStatus:fp().object,onEntityImportStatusChange:fp().func,logger:fp().func,canCheck:fp().bool,checkedEntitiesUris:fp().arrayOf(fp().string),headerCheckboxState:fp().oneOf([!0,!1,null]),onCheck:fp().func,openConfigColumnPopup:fp().func,resizeDebounceDelay:fp().number},Jm.defaultProps={entities:[],headColumns:[]},Jm.displayName="EntitiesTable";const ey=(0,h.memo)(Jm);var ty=r(4437),ry=r.n(ty),ny=r(5106),ay=r.n(ny);const oy="left",iy="right",ly="hide",sy={[oy]:uo().text("Insert 1 left"),[iy]:uo().text("Insert 1 right"),[ly]:uo().text("Hide column")},cy=e=>{let{open:t,anchorEl:r,onClick:n,onClose:a,actions:o}=e;return E().createElement(vp(),{open:t,anchorEl:r,onClose:a},E().createElement(ry(),{component:"div"},o.map(((e,t)=>((e,t,r)=>E().createElement(ay(),{button:!0,component:"div",key:r,onClick:t},E().createElement(Zp(),{primary:sy[e],primaryTypographyProps:{variant:"body2"}})))(e,(e=>()=>{n(e)})(e),t)))))};cy.propTypes={open:fp().bool,anchorEl:fp().any,onClick:fp().func,onClose:fp().func,actions:fp().array};const uy=cy;class py extends E().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 oy:this.openAddColumnPopup({newColumnPlaceIndex:t});break;case iy:this.openAddColumnPopup({newColumnPlaceIndex:t+1});break;case ly: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,T.memoizeWith)(py.getMemoIdForColumnSize,py.getColumnSizeFromHeadColumns)}static getColumnSizeFromHeadColumns(e){return e.map((e=>({id:e.id,size:e.size})))}static getMemoIdForColumnSize(e,t){return`${t}${(0,A.toString)(e.map((e=>(0,A.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:b,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 E().createElement(E().Fragment,null,E().createElement(ey,{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:b,logger:v,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:x,onCheck:C,openConfigColumnPopup:this.openConfigColumnPopup,resizeDebounceDelay:S}),E().createElement(Od,{open:w,anchorEl:R,data:p,onListItemClick:this.addColumnHandler,filterText:_,onClose:this.closeAddColumnPopup,onSearch:this.setFilterText,hideCheckBox:!0,titleText:co.text("Add column")}),E().createElement(uy,{onClick:this.configColumnHandler,onClose:this.closeConfigColumnPopup,anchorEl:R,open:A,actions:I>0?[oy,iy,ly]:[iy]}))}}py.propTypes={entities:fp().array,entityToHighlight:fp().string,selectedEntityUri:fp().string,entityTypeUri:fp().string,headColumns:fp().array,dndColumnReorderingEnabled:fp().bool,onScroll:fp().func,onSort:fp().func,onReorderingColumn:fp().func,onChangeColumnsSize:fp().func,onChangeColumnsList:fp().func,onEntityClick:fp().func,onEntityHover:fp().func,sortField:fp().string,sortOrder:fp().oneOf([Dd.oy,Dd.U9]),entitiesTableRef:fp().shape({current:fp().shape({resetScrollbarPosition:fp().func})}),additionalColumns:fp().arrayOf(fp().shape({id:fp().string,label:fp().string})),entitiesImportStatus:fp().object,onEntityImportStatusChange:fp().func,logger:fp().func,canCheck:fp().bool,checkedEntitiesUris:fp().arrayOf(fp().string),headerCheckboxState:fp().oneOf([!0,!1,null]),onCheck:fp().func};const dy=py;var my=r(66780),yy=r(9366),gy=r(41633),fy=r(79881),hy=r.n(fy),Ey=r(93962),by=r.n(Ey),vy=r(45995),Ty=r.n(vy);function Oy(){return Oy=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},Oy.apply(this,arguments)}const xy=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,h.useState)(t),i=(0,Pm.useTheme)().transitions.duration.leavingScreen;return(0,h.useEffect)((()=>{if(t!==a){if(!t){const e=setTimeout((()=>{o(!1)}),i);return()=>clearTimeout(e)}o(!0)}}),[t,i,a]),E().createElement(Ty(),Oy({open:t},n),a&&r)};xy.displayName="Drawer";var Cy=r(418),Sy=r(18759),wy=r.n(Sy),Ay=r(30122),Ry=r.n(Ay),_y=r(43410),Iy=r.n(_y),Ny=r(93416),Dy=r.n(Ny);function Py(){return Py=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},Py.apply(this,arguments)}const ky=(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 E().createElement(e,Py({config:t,onChange:(o=t.fieldName,e=>{n(ro(o,e))}),onClose:t.showDeleteButton?(e=>()=>{n(oo({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:P.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:fp().func,isRecommended:fp().bool},r};var Ly=r(52004),Uy=r.n(Ly),jy=r(58282),Fy=r.n(jy);const My=(0,Tp.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)"}}))),Vy=e=>{let{active:t,onClick:r,className:n}=e;const a=My();return E().createElement(Uy(),{className:v()(a.viewMoreLessLink,n),onClick:r,underline:"none"},E().createElement(Fy(),{className:v()(a.arrow,{[a.rotated]:t})}),t?uo().text("View less"):uo().text("View more"))};Vy.propTypes={active:fp().bool,onClick:fp().func,className:fp().string};const By=Vy;var zy=r(50592),Hy=r(23888),Yy=r.n(Hy);const Wy=(0,Tp.Z)((e=>({bar:{backgroundColor:e.palette.secondary.main,opacity:.12,position:"absolute",minHeight:"20px",minWidth:"5px",borderRadius:"2px",top:0,left:0,height:"100%"}}))),Gy=e=>(0,A.is)(Number,e),qy=e=>{let{className:t,width:r=0,maxWidth:n}=e;const a=Wy(),o=(0,h.useCallback)((e=>(n?100*e/n:0)+"%"),[n]);return r?E().createElement("div",{className:v()(a.bar,t),style:{width:Gy(r)?o(r):r}}):null},Zy=(0,Tp.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 $y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ky={showColorBar:!0,hasOnlyButton:!1},Xy=e=>{let{config:t,data:r=[],values:n=[],onChange:a=io.ZT}=e;const o=Zy();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){$y(e,t,r[t])}))}return e}({},Ky,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 E().createElement("div",{className:o.listContainer},r.map((e=>E().createElement("div",{key:e.value,className:v()(o.item,{[o.disabled]:!e.number&&!n.includes(e.value)}),"data-reltio-id":"search-facets-list-row"},(e=>E().createElement(Kp(),{className:v()(o.checkbox,{[o.checked]:n.includes(e.value)}),checked:n.includes(e.value),onChange:i(e.value),value:e.value,color:"primary"}))(e),E().createElement("div",{className:o.info,onClick:i(e.value)},(e=>E().createElement(qy,{className:v()({[o.checkedBar]:n.includes(e.value)}),width:e.number,maxWidth:l}))(e),E().createElement("div",{className:v()(o.textInfo)},E().createElement("div",{className:o.text},e.label),E().createElement("div",{className:o.count},void 0===e.number?uo().text("N/A"):(0,io.k7)(e.number,5e3))),t.hasOnlyButton&&(e=>{return E().createElement(Yy(),{className:o.buttonONLY,onClick:(t=e.value,e=>{e.stopPropagation(),a([t])})},uo().text("ONLY"));var t})(e))))))};var Qy=r(1441);const Jy=(0,Tp.Z)((()=>({container:{overflow:"hidden",display:"flex",flexGrow:1,flexDirection:"column",fontSize:"13px"},noData:{marginLeft:"16px"},viewMoreLess:{paddingLeft:"20px"}}))),eg=e=>{let{config:t,data:r=[],values:n=[],onChange:a}=e;const o=Jy(),i=(0,hp.useDispatch)(),l=(0,h.useCallback)((e=>{let{show:t}=e;i((e=>{let{show:t,silent:r}=e;return{type:P.k.SHOW_MORE_ENTITY_TYPES,payload:{show:t,silent:r}}})({show:t}))}),[i]),s=(0,hp.useSelector)((e=>(0,I.jC)(t,e))),c=(0,hp.useSelector)(lo.t9),u=r.length>Z.wP,p=(0,h.useCallback)((()=>{l({show:!s})}),[l,s]),d=(0,h.useMemo)((()=>{const e=s?r:r.slice(0,Z.wP);return(0,Qy.ZK)(e,c)}),[r,s,c]);return E().createElement("div",{className:o.container},r.length>0?E().createElement(E().Fragment,null,E().createElement(Xy,{data:d,values:n,onChange:a,config:t}),u&&E().createElement(By,{active:s,onClick:p,className:o.viewMoreLess})):E().createElement(zy.K,{variant:"noData",className:o.noData}))};var tg=r(70347),rg=r(52935);const ng=(0,rg.Z)(tg.ZP);var ag=r(81697),og=r(27308);const ig=(0,rg.Z)(og.ZP);function lg(){return lg=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},lg.apply(this,arguments)}function sg(e){const{innerProps:t,innerRef:r,children:n,isFocused:a,isSelected:o,selectProps:{classes:i},label:l}=e;return E().createElement(Qp(),lg({className:v()(i.option,{[i["option--selected"]]:o}),ref:r,selected:a,component:"div"},t),E().createElement(Kp(),{color:"primary",checked:o}),E().createElement(pd.Y,{value:l},E().createElement("div",{className:i["option--item"]},n)))}sg.propTypes={children:fp().node,innerProps:fp().shape({id:fp().string.isRequired,key:fp().string,onClick:fp().func.isRequired,onMouseMove:fp().func.isRequired,onMouseOver:fp().func.isRequired,tabIndex:fp().number.isRequired}).isRequired,innerRef:fp().oneOfType([fp().oneOf([null]),fp().func,fp().shape({current:fp().any.isRequired})]),isFocused:fp().bool.isRequired,isSelected:fp().bool.isRequired,label:fp().string,selectProps:fp().shape({classes:fp().shape({option:fp().string})})};const cg={Option:sg};var ug=r(62127);const pg=e=>{let t=null==e?void 0:e.parentElement;for(;t;){if(t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null},dg=(e,t,r,n)=>e&&t<e&&n.getBoundingClientRect().bottom>r.getBoundingClientRect().bottom;function mg(){return mg=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},mg.apply(this,arguments)}function yg(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}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 fg=(0,Tp.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 hg=0;function Eg(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?ng:n?ig:ag.Z,[m,y]=(0,h.useState)(""),g=fg((0,A.omit)(["classes"],e)),f="custom-select-"+hg++,b=(0,h.useRef)();!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;const r=(0,ug.D)(null==e?void 0:e.length);(0,h.useEffect)((()=>{const n=setTimeout((()=>{const n=pg(null==t?void 0:t.current);var a;n&&dg(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,A.either)((0,A.path)(["select","controlRef"]),(0,A.path)(["select","select","controlRef"]))(e.current)),t})(b));const v=yg({},cg,o),T=(0,Ep.ze)(g,i),O=yg({indicatorSeparator:e=>yg({},e,{margin:"10px 0"}),loadingIndicator:e=>yg({},e,{display:a?e.display:"none"}),loadingMessage:e=>yg({},e,{fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif'})},l),x=t?{inputId:f,TextFieldProps:yg({label:t,InputLabelProps:{htmlFor:f,shrink:!(!e.value||!e.value.length)||void 0,className:T.label}},e.TextFieldProps)}:{};return E().createElement(d,mg({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:b},x,p))}Eg.defaultProps={creatable:!1,cacheOptions:!0,components:{},classes:{},placeholder:"",loadingIndicator:!1,onInputChange:()=>{},onChange:()=>{}},Eg.propTypes={creatable:fp().bool,cacheOptions:fp().bool,defaultOptions:fp().bool,value:fp().arrayOf(fp().shape({label:fp().string.isRequired,value:fp().any})),options:fp().arrayOf(fp().shape({label:fp().string.isRequired,value:fp().any})),onChange:fp().func,onInputChange:fp().func,placeholder:fp().string,label:fp().string,loadingIndicator:fp().bool,components:fp().shape({ClearIndicator:fp().func,Control:fp().func,DropdownIndicator:fp().func,DownChevron:fp().func,CrossIcon:fp().func,Group:fp().func,GroupHeading:fp().func,IndicatorsContainer:fp().func,IndicatorSeparator:fp().func,Input:fp().func,LoadingIndicator:fp().func,Menu:fp().func,MenuList:fp().func,MenuPortal:fp().func,LoadingMessage:fp().func,NoOptionsMessage:fp().func,MultiValue:fp().func,MultiValueContainer:fp().func,MultiValueLabel:fp().func,MultiValueRemove:fp().func,Option:fp().func,Placeholder:fp().func,SelectContainer:fp().func,SingleValue:fp().func,ValueContainer:fp().func}),classes:fp().shape({control:fp().string,valueContainer:fp().string,multiValue:fp().string,noOptionsMessage:fp().string,singleValue:fp().string,placeholder:fp().string,menu:fp().string,clearIndicator:fp().string,dropdownIndicator:fp().string,option:fp().string,"option--selected":fp().string,label:fp().string}),styles:fp().shape({clearIndicator:fp().func,container:fp().func,control:fp().func,dropdownIndicator:fp().func,group:fp().func,groupHeading:fp().func,indicatorsContainer:fp().func,indicatorSeparator:fp().func,input:fp().func,loadingIndicator:fp().func,loadingMessage:fp().func,menu:fp().func,menuList:fp().func,menuPortal:fp().func,multiValue:fp().func,multiValueLabel:fp().func,multiValueRemove:fp().func,noOptionsMessage:fp().func,option:fp().func,placeholder:fp().func,singleValue:fp().func,valueContainer:fp().func}),TextFieldProps:fp().object,getOptions:fp().func,menuPlacement:fp().string,menuPortalTarget:fp().object,menuShouldBlockScroll:fp().bool,captureMenuScroll:fp().bool,getOptionValue:fp().func,isSearchable:fp().bool,inputRef:fp().shape({current:fp().object})};const bg=Eg;var vg=r(80959),Tg=r(88640),Og=r(25386),xg=r(59428),Cg=r(47823);const Sg=(0,Tp.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 wg(){return wg=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},wg.apply(this,arguments)}const Ag=e=>{const{innerProps:t,innerRef:r,data:n,isSelected:a,isFocused:o,selectProps:{classes:i}}=e,l=Sg(),s=(0,A.has)("width",n),c=(0,A.has)("number",n);return E().createElement(Qp(),wg({className:i.option,classes:{root:l.item,selected:l.itemSelected},ref:r,component:"div",selected:o,disableGutters:!0},t),E().createElement(Kp(),{checked:a,color:"primary",disableRipple:!0,classes:{root:l.checkbox}}),E().createElement("div",{className:l.infobox},E().createElement("div",{className:l.textbox},E().createElement(pd.Y,{value:n.label},E().createElement("div",{className:l.text},n.label)),c&&E().createElement("div",{className:l.number},(0,io.k7)(n.number,5e3))),s&&E().createElement(qy,{className:v()(l.colorBar,{[l.selectedColorBar]:a}),width:n.width})))};Ag.propTypes={innerProps:fp().shape({id:fp().string.isRequired,key:fp().string,onClick:fp().func.isRequired,onMouseMove:fp().func.isRequired,onMouseOver:fp().func.isRequired,tabIndex:fp().number.isRequired}).isRequired,innerRef:fp().oneOfType([fp().oneOf([null]),fp().func,fp().shape({current:fp().any.isRequired})]),isSelected:fp().bool.isRequired,isFocused:fp().bool.isRequired,selectProps:fp().shape({classes:fp().shape({option:fp().string})}),data:fp().shape({value:fp().string,label:fp().string.isRequired,number:fp().number}).isRequired};const Rg=Ag,_g=e=>{const{selectProps:{classes:t}}=e;return E().createElement(zy.K,{variant:"noData",className:t.noOptionsMessage})};_g.propTypes={selectProps:fp().object.isRequired};const Ig=_g;function Ng(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){Dg(e,t,r[t])}))}return e}function Dg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Pg={container:e=>Ng({},e,{width:"100%"}),menuList:e=>Ng({},e,{maxHeight:"240px",padding:"8px 0"}),menu:e=>Ng({},e,{maxHeight:"240px"})},kg=(0,Tp.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 Lg=r(53862);const Ug=fp().shape({value:fp().string.isRequired,label:fp().string.isRequired,number:fp().number}),jg=(fp().shape({default:fp().array,filtered:fp().array}),fp().shape({values:fp().array,searchType:fp().oneOf(Object.values(T.MAP_SEARCH_TYPES))})),Fg={id:fp().string,operation:fp().string,operationParameters:fp().shape({attributeTypeData:fp().shape({pathToTitle:fp().arrayOf(fp().string),title:fp().string,attributeType:T.AttributeTypeType}),attributeValue:fp().oneOfType([fp().string,T.LookupValueType,T.NestedAttributeValueType,T.ReferenceAttributeValueType]),attributeValueToFind:fp().oneOfType([fp().string,T.LookupValueType]),pin:fp().bool,addNestedAttribute:fp().bool})},Mg={id:fp().string,fieldName:fp().string,conditions:fp().arrayOf(Lg.Xw),actions:fp().arrayOf(fp().shape(Fg))};function Vg(){return Vg=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},Vg.apply(this,arguments)}function Bg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zg=e=>{let{values:t=[],defaultOptions:r=[],filteredOptions:n,onChange:a=A.identity,getSuggestions:o,showBar:i=!0,showNumberInValue:l=!1,classes:s={},styles:c={},canLoadMore:u=!0,max:p=Z.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=kg(),[y,g]=(0,h.useState)(""),[f,b]=(0,h.useState)(1),[v,O]=(0,h.useState)(!1),x=(0,h.useRef)(null),C=(0,h.useRef)(!1),S=(0,h.useRef)(!1),w=(n||[]).concat(r),R=e=>w.find((t=>t.value===e))||{value:e,label:e},_=e=>l&&(0,A.has)("number",e)?(0,A.assoc)("formattedNumber",(0,T.formatNumberAsMetric)((0,A.prop)("number",e),5e3),e):e,I=(0,A.pipe)((e=>{if(i&&e.length&&(0,A.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){Bg(e,t,r[t])}))}return e}({},e,{width:N(e.number,t)})))}return e}),(0,A.uniqBy)((0,A.prop)("value"))),N=(e,t)=>(t?100*e/t:0)+"%",D=(0,T.debounce)(((e,t)=>{let{action:r}=t;e!==y&&"set-value"!==r&&(g(e),b(1),C.current=!1,O(!0),o({value:e,pageNumber:1}))}),250),P=n||r,k=(0,h.useCallback)((()=>{O(!0),o({value:y,pageNumber:f+1,currentOptions:P}),C.current=!0}),[y,f,o,P]);(0,h.useEffect)((()=>{O(!1),C.current&&(b((e=>e+1)),C.current=!1)}),[n]),(0,h.useEffect)((()=>{S.current||(O(!1),b(1),C.current=!1,o({value:"",pageNumber:1})),S.current=!1}),[r]);const L=(0,h.useMemo)((()=>P.slice(0,f*p)),[P,f,p]),U=u&&P.length>L.length;return E().createElement(bg,Vg({filterOption:(e,t)=>{let{label:r,value:n}=e;return T.utils.strings.search(r,t)||T.utils.strings.search(n,t)},value:(e=>(0,T.wrapInArrayIfNeeded)(e).map(R).map(_))(t),onChange:(0,A.pipe)((0,A.tap)((()=>{S.current=!0})),(0,A.defaultTo)([]),(0,A.pluck)("value"),a),options:I(L),onInputChange:D,classes:(0,A.mergeRight)(m,s),styles:(0,A.mergeRight)(Pg,c),TextFieldProps:{InputProps:{disableUnderline:!0},ref:x},inputRef:x,components:{Option:Rg,NoOptionsMessage:Ig,Menu:vg.h,DropdownIndicator:Tg.K,MultiValue:Og._,MenuList:xg.d},menuPlacement:"bottom",menuListFooter:U&&E().createElement(Cg.X,{loading:v,onClick:k})},d))};zg.propTypes={values:fp().array,defaultOptions:fp().arrayOf(Ug),filteredOptions:fp().arrayOf(Ug),onChange:fp().func.isRequired,getSuggestions:fp().func.isRequired,showBar:fp().bool,showNumberInValue:fp().bool,classes:fp().object,styles:fp().object,canLoadMore:fp().bool,max:fp().number};const Hg=(0,h.memo)(zg);var Yg=r(43627),Wg=r.n(Yg);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){qg(e,t,r[t])}))}return e}function qg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zg=(0,A.range)(2,10).reduce(((e,t)=>Gg({},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)"}}})),{}),$g=(0,Tp.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":Gg({fontSize:"10px",lineHeight:"11px",fontWeight:500,color:"rgba(255, 255, 255, 0.7)",marginTop:"4px"},Zg,{"&:last-child":{color:"white"}}),"& li + li":{marginTop:"2px"}}}})));function Kg(){return Kg=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},Kg.apply(this,arguments)}const Xg=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=$g(),o=null!=t&&t.length?E().createElement("div",{className:a.tooltipContent},E().createElement("p",null,(0,A.last)(t)),t.length>2&&E().createElement("ul",null,t.map((e=>E().createElement("li",{key:e},e))))):"";return E().createElement(Wg(),Kg({title:o,disableFocusListener:!0,classes:{tooltip:a.tooltip}},n),r)};var Qg=r(96091),Jg=r.n(Qg),ef=r(35635),tf=r.n(ef);const rf=(0,Tp.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 nf(){return nf=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},nf.apply(this,arguments)}const af=(0,dd.T)(tf()),of=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=rf();return E().createElement(Jg(),nf({className:a.root,label:uo().number(t),onDelete:r,variant:"outlined",classes:{root:a.root,outlined:a.outlined,deleteIcon:a.deleteIcon,label:a.label},deleteIcon:E().createElement(af,{tooltipTitle:uo().text("Clear")})},n))},lf=(0,Tp.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 sf(){return sf=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},sf.apply(this,arguments)}const cf=e=>{let{title:t="",chipLabel:r=0,onDelete:n,pathToTitle:a,onClick:o}=e;const i=lf(),l=Boolean(a&&a.length>2),s=l?Xg:pd.Y,c=l?{pathToTitle:a}:{value:t};return E().createElement("div",{className:i.container,onClick:o},l&&E().createElement(Xg,sf({placement:"bottom-start"},c),E().createElement("div",{className:i.parent},a[a.length-2])),E().createElement("div",{className:i.titleContainer},E().createElement(s,sf({placement:"bottom-start"},c),E().createElement("span",{className:i.title},t)),0!==r&&E().createElement("div",{className:i.chip},E().createElement(of,{label:r,onDelete:n}))))};function uf(){return uf=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},uf.apply(this,arguments)}const pf=(0,Tp.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}}))),df=(0,dd.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 E().createElement("svg",uf({width:"13",height:"18",viewBox:"0 0 13 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},r),E().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},E().createElement("g",null,E().createElement("g",null,E().createElement("g",null,E().createElement("g",{transform:"translate(-3 -1)"},E().createElement("g",null,E().createElement("path",{fill:"#FF4081",d:"M5.833 10h3.75v6.667l-3.75 1.666z"}),E().createElement("path",{fill:"#CE0C4E",d:"M13.333 10v8.333l-3.75-1.666V10z"})),E().createElement("circle",{fill:"#FFC058",cx:"9.583",cy:"7.917",r:"6.25"}),E().createElement("circle",{fill:"#FFCD7B",cx:"9.583",cy:"7.917",r:"5.417"}),E().createElement("path",{fill:"#FFFBB5",d:"M8.333 11.667L5 8.462l.933-.898 2.4 2.308L13.4 5l.933.897z"})))))))})),mf=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=pf(),[p,d]=(0,h.useState)(l),m=()=>{d(!p)};return E().createElement("div",{className:v()(u.facetContainer,{[u.openedFacetContainer]:p,[u.closedFacetContainer]:!p,[u.highlighted]:s}),"data-reltio-id":`search-facet-container-${t}`},E().createElement("div",{className:u.titleContainer},E().createElement(xd.k,{tooltipTitle:uo().text("Remove"),icon:Rp(),onClick:o,className:u.iconButton,size:"XXS"}),c&&E().createElement(df,{className:u.recommendedIcon,tooltipTitle:uo().text("Recommended"),showForDisabled:!0}),E().createElement(cf,{title:t,pathToTitle:a,chipLabel:r,onDelete:n,onClick:m}),E().createElement(qm,{onClick:m,isOpen:p,className:u.iconButton,size:"S",tooltipTitle:p?uo().text("Collapse attribute"):uo().text("Expand attribute"),tooltipPlacement:"bottom-end"})),p?i:null)},yf=(0,Tp.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"}}))),gf=e=>{let{config:t,data:r=[],filteredData:n,values:a=[],isHighlighted:o,isRecommended:i,onSearch:l=A.identity,onChange:s,onClose:c}=e;const u=yf();return E().createElement(mf,{title:t.title,pathToTitle:t.pathToTitle,onClose:c,chipLabel:a.length,onDeleteChip:()=>s([]),isHighlighted:o,isRecommended:i},E().createElement(Hg,{values:a,defaultOptions:r,filteredOptions:n,onChange:s,getSuggestions:l,isClearable:!1,showBar:!1,showNumberInValue:!0,classes:u,placeholder:uo().text("All values"),canLoadMore:!(0,Ma.tW)(t)}))};var ff=r(19014),hf=r(15608),Ef=r.n(hf);const bf=(0,Tp.Z)((e=>({root:{borderRadius:4,padding:"15px 0"},rail:{backgroundColor:(0,Pm.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,Pm.alpha)(e.palette.primary.main,.12)}`,"@media (hover: none)":{boxShadow:"none"}},"&$active":{boxShadow:`0px 0px 0px 9px ${(0,Pm.alpha)(e.palette.primary.main,.12)}`},"&::after":{left:-10,top:-10,right:-10,bottom:-10}},focusVisible:{},active:{},track:{borderRadius:4}}))),vf=(0,Tp.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"}}))),Tf=e=>{let{children:t,open:r,value:n}=e;const a=vf();return E().createElement(Wg(),{open:r,enterTouchDelay:0,placement:"top",title:n,classes:{tooltipPlacementTop:a.tooltipPlacementTop,tooltip:a.tooltip}},t)};function Of(){return Of=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},Of.apply(this,arguments)}Tf.propTypes={children:fp().element.isRequired,open:fp().bool.isRequired,value:fp().string.isRequired};const xf=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=bf();return E().createElement("div",{className:i},E().createElement(Ef(),Of({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:Tf},size:"small",component:"div"},l)))};xf.propTypes={min:fp().oneOfType([fp().number,fp().string]).isRequired,max:fp().oneOfType([fp().number,fp().string]).isRequired,range:fp().array.isRequired,onChange:fp().func,onAfterChange:fp().func,className:fp().string};const Cf=xf;var Sf=r(18205),wf=r(19406),Af=r(55484),Rf=r(25556),_f=r(3131),If=r(27741),Nf=r(42400),Df=r(11011);const Pf=(0,Tp.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"}}))),kf=e=>{let{payload:t,formatter:r,active:n}=e;const a=Pf();if(n){const{payload:{label:e},value:n}=t[0];return E().createElement("div",{className:a.tooltip},E().createElement("div",{className:a.number},r(n)),E().createElement("div",{className:a.value},e))}return null},Lf=(0,Tp.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 Uf(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=>{let{data:t=[],range:r=[],domain:n,color:a=T.theme.palette.primary.main,tickFormatterX:o,tickFormatterY:i}=e;const l=Lf(),[s,c]=(0,h.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){Uf(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 E().createElement(Sf.h,null,E().createElement(wf.v,{data:p,margin:{top:12,right:0,left:0,bottom:0},onMouseEnter:d,onMouseLeave:d,onMouseMove:d,className:l.barChart},E().createElement(Af.q,{vertical:!1,stroke:"#f2f2f2"}),E().createElement(Rf.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 E().createElement("text",{x:0===n?t-i:t+i,y:r+4,textAnchor:0===n?"start":"end"},`${o(a)}`)}}),E().createElement(_f.B,{width:38,domain:[0,"auto"],axisLine:!1,tickLine:!1,tickSize:0,tickMargin:4,tickCount:6,tickFormatter:i}),E().createElement(If.u,{cursor:{fill:"rgb(255,255,255)"},content:E().createElement(kf,{formatter:i}),isAnimationActive:!1}),E().createElement(Nf.$,{dataKey:"number",isAnimationActive:!1},t.map(((e,t)=>E().createElement(Df.b,{key:`cell-${t}`,fill:a,fillOpacity:u(e,t)}))))))},Ff="NumericRangeFacet-styles-numberEditorInputRoot--djW3k",Mf="NumericRangeFacet-styles-numberEditorRoot--DVXqx",Vf="NumericRangeFacet-styles-input--Nl2tx";function Bf(){return Bf=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},Bf.apply(this,arguments)}class zf extends h.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,A.path)([0,0],r))&&n.equals(i[1],(0,A.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,A.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,A.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,jl.C)(a),l=(0,io.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,T.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 E().createElement(mf,{title:e.title,pathToTitle:e.pathToTitle,onClose:a,isHighlighted:r,isRecommended:n},E().createElement("div",{className:"NumericRangeFacet-styles-data--kL9q5"},y.length>0?E().createElement(E().Fragment,null,E().createElement("div",{className:"NumericRangeFacet-styles-barChartContainer--t9NkG","data-reltio-id":"search-bar-chart-with-selection"},E().createElement(jf,{data:y,range:g,tickFormatterX:m,tickFormatterY:p.formatNumberForRangeFacet,domain:[f,h]})),E().createElement(Cf,{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}),E().createElement("div",{className:"NumericRangeFacet-styles-inputsContainer--mU0_m"},E().createElement(ff.c,{value:c,onChange:this.onLowerBoundChanged,onFocus:this.onFocus,integer:!d,format:o,variant:"filled",classes:{root:Mf},InputProps:{classes:{root:Ff,input:Vf}}}),E().createElement(ff.c,{value:u,onChange:this.onUpperBoundChanged,onFocus:this.onFocus,integer:!d,format:o,variant:"filled",classes:{root:Mf},InputProps:{classes:{root:Ff,input:Vf}}}))):E().createElement(zy.K,{variant:"noData"})))}}zf.propTypes={data:fp().array,values:fp().array,config:fp().object,isHighlighted:fp().bool,isRecommended:fp().bool,onClose:fp().func,onChange:fp().func,numberFormat:fp().shape({decimalSeparator:fp().string,thousandSeparator:fp().string,prefix:fp().string,suffix:fp().string,decimalScale:fp().number})},zf.defaultProps={config:{},data:[],values:[]};const Hf=(0,hp.connect)((e=>({numberFormat:D().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,hp.useSelector)(D().selectors.getAttributesPresentation),{strategy:c}=(0,T.getNumberFormat)((0,T.getAttrDataTypeDefinition)(r.attrType),s,T.intl.getLocale()),u=(0,h.useMemo)((()=>null==a?void 0:a.map((0,A.evolve)({value:(0,A.map)((0,T.applyPresentationStrategyToValue)(c))}))),[a,c]),p=(0,h.useMemo)((()=>null==n?void 0:n.map((0,T.mapFilterValue)((0,T.applyPresentationStrategyToValue)(c)))),[n,c]),d=(0,h.useCallback)((e=>{const t=null==e?void 0:e.map((0,T.mapFilterValue)((0,T.revertPresentationStrategyForValue)(c)));o(t)}),[c,o]);return E().createElement(e,Bf({data:u,values:p,onChange:d,config:r,numberFormat:i&&(0,A.omit)(["strategy",i])},l))};return t.displayName="WithCustomizedData",t})(zf));var Yf=r(21669);const Wf=(0,Tp.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 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,t)=>(0,A.pathOr)(null,[t],e),Zf=e=>e&&new Date(e),$f=e=>e&&e.getTime(),Kf=e=>{let{values:t,minDate:r,maxDate:n,onChange:a}=e;const[o,i]=(0,h.useState)(null),[l,s]=(0,h.useState)(null),c=(0,h.useRef)((0,Ze.x0)()),u=(0,h.useRef)((0,Ze.x0)()),p=Wf();E().useEffect((()=>{i(qf(t,0)),s(qf(t,1))}),[t]);const d=(e,t)=>{(0,A.isNil)(e)||(0,A.isNil)(t)||a(e>t?[[t,e]]:[[e,t]])},m={minDate:Zf(r),maxDate:Zf(n)};return E().createElement("div",{className:p.container},E().createElement(Yf.Q,Gf({label:uo().text("Start Date"),value:Zf(o),onChange:e=>{const t=$f(e);i(t),d(t,l)},slotProps:{textField:{id:c.current,className:p.dateEditor}}},m)),E().createElement(Yf.Q,Gf({label:uo().text("End Date"),value:Zf(l),onChange:e=>{const t=$f(e);s(t),d(o,t)},slotProps:{textField:{id:u.current,className:p.dateEditor},popper:{placement:"bottom-end"}}},m)))};function Xf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qf=e=>t=>e===T.DataTypes.TYPE_DATE?T.utils.dates.toLocalDate(t).getTime():t,Jf=(0,Tp.Z)({barChartContainer:{position:"relative",height:"190px",paddingTop:"6px",width:"100%",overflow:"hidden"},dateRangeChooserWrapper:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"12px",width:"100%"}}),eh=(0,jl.C)(),th=e=>{let{data:t=[],values:r=[],config:n,onChange:a,isHighlighted:o,isRecommended:i,onClose:l}=e;const s=Jf(),c=(0,A.path)(["attrType","type"],n),u=(0,h.useCallback)((e=>{const n=e.map((0,T.mapFilterValue)((o=c,e=>o===T.DataTypes.TYPE_DATE?T.utils.dates.toUtcDate(e).getTime():e)));var o;if(!(0,A.equals)(r,n)){const[e,r]=eh.getBarDomain(t),o=c===T.DataTypes.TYPE_DATE,i=n.map((e=>[T.utils.dates.getStartOfDay(e[0],o),T.utils.dates.getEndOfDay(e[1],o)])),l=eh.getRange(i,t);a([l.length?l:[e,r]])}}),[t,a,c,r]),p=(0,h.useMemo)((()=>{return t.map((e=c,t=>{if(Array.isArray(t.value)){const r=t.value.map(Qf(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){Xf(e,t,r[t])}))}return e}({},t,{value:r,label:r.map(T.formatDate).join(" - ")})}}));var e}),[t,c]),[d,m]=(0,h.useMemo)((()=>[eh.getBarDomain(p),eh.getRange(r.map((0,T.mapFilterValue)(Qf(c))),p)]),[p,c,r]);return E().createElement(mf,{title:n.title,pathToTitle:n.pathToTitle,onClose:l,isHighlighted:o,isRecommended:i},t.length>0?E().createElement(E().Fragment,null,E().createElement("div",{className:s.barChartContainer},E().createElement(jf,{data:p,range:m,tickFormatterX:T.formatDate,tickFormatterY:eh.formatNumberForRangeFacet,domain:d})),E().createElement("div",{className:s.dateRangeChooserWrapper},E().createElement(Kf,{values:m,onChange:u}))):E().createElement(zy.K,{variant:"noData"}))};function rh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class nh{static getWidget(e){switch(e.type){case T.FACET_TYPES.ENTITY_TYPE_FACET:return eg;case T.FACET_TYPES.WITH_DROPDOWN_CHECKBOXES_FACET:return gf;case T.FACET_TYPES.NUMERIC_RANGE_FACET:return Hf;case T.FACET_TYPES.DATE_RANGE_FACET:return th;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){rh(e,t,r[t])}))}return e}({},nh.getDefaultConfig(),e),r=nh.getWidget(t);return r?(e=>{const r=ky(e,t);return nh.connectData(r,t)})(r):null}}nh.getDefaultConfig=()=>({autofocus:!1,showDeleteButton:!0}),nh.connectData=(e,t)=>(0,hp.connect)((e=>({data:(0,I.X7)(t,e),values:(0,I.N1)(t,e),filteredData:(0,I.VP)(t,e),isHighlighted:(0,I.$t)(t.fieldName,e),isRecommended:(0,I.TH)(t.fieldName,e)})))(e);const ah=(0,A.allPass)([(0,A.propSatisfies)(A.isEmpty,"configs"),(0,A.pathEq)(["group","hasCollapseButton"],!0)]),oh=(0,A.reject)(ah);var ih=r(66825),lh=r.n(ih);const sh=(0,Tp.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"}}),ch=e=>{let{title:t="",iconSrc:r="",isOpen:n=!0,hasCollapseButton:a=!0,leftIcon:o,onCollapse:i}=e;const l=sh();return E().createElement("div",{className:l.titleBox},E().createElement("div",{className:l.title},o&&E().createElement("div",{className:l.leftIcon},o),r&&E().createElement(x(),{src:r,className:l.avatar}),E().createElement(pd.Y,{value:t},E().createElement("span",{className:l.text},t))),a&&E().createElement(qm,{isOpen:n,onClick:i,className:l.collapseIcon,size:"S"}))};var uh=r(36631),ph=r(1230),dh=r.n(ph);const mh=e=>{let{facet:t,selectedFacets:r}=e;return!!r.find((e=>e.fieldName===t.fieldName||e.fieldName.includes(`${t.fieldName}.`)))},yh=e=>{let{facet:t,selectedFacets:r}=e;return mh({facet:t,selectedFacets:r})||(0,_.OP)(t)&&t.children&&t.children.some((e=>mh({facet:e,selectedFacets:r})))},gh=(0,Tp.Z)({icon:{maxHeight:"25px",maxWidth:"25px",marginRight:"16px"}}),fh=e=>{let{group:t,metadata:r}=e;const n=gh(),a=(0,C.$H)(),o=(0,T.getEntityTypeGraphIcon)(r,{type:t.id}),i=(0,T.getAbsoluteImageUrl)(a,o);return E().createElement(em,{className:n.icon,icon:i,avatarText:t.title[0]})};function hh(){return hh=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},hh.apply(this,arguments)}const Eh=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,h.useRef)(null);i.current=n;const l=(0,h.useRef)(null);l.current=r;const s=(0,h.useCallback)(((e,r,n)=>{let{item:a,level:o,groupId:s}=r;const c=yh({facet:a,selectedFacets:i.current}),u=l.current===n;return E().createElement(fd,{key:`item-${s}-${a.fieldName}`,onClick:t,data:a,label:E().createElement(hd.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,h.useCallback)(((e,t)=>E().createElement(ay(),{component:"div",className:"MoreFacetsPopup-styles-subHeader--h1vGz",style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&E().createElement(fh,{metadata:a,group:t.item}),t.item.title)),[a]),u=(0,h.useCallback)(((e,t)=>t.items?40:28),[]);return E().createElement(Wp,hh({getItemSize:u,renderGroupTitle:c,renderItem:s,focusIndex:r},o,{disableHorizontalScrollbar:!0}))};Eh.propTypes={focusIndex:fp().number,selectedFacets:fp().array,onListItemClick:fp().func,metadata:T.MetadataType};const bh=Eh;function vh(){return vh=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},vh.apply(this,arguments)}const Th=574,Oh=e=>{let{metadata:t,open:r,selectedFacets:n,data:a=[],onListItemClick:o,lastFacetClicked:i={},width:l,height:s=Th}=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,h.useState)(464),d=s-110;(0,h.useEffect)((()=>{p(d)}),[d]);const m=(0,h.useCallback)(((e,t)=>p((0,A.clamp)(56,d,t))),[d]),y=(0,h.useRef)();(0,h.useEffect)((()=>{const e=(0,A.path)(["current","updatePosition"],y);e&&e()}),[u]);const g=(0,h.useCallback)((function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return[{type:"item",item:e,moveTo:(0,A.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,h.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]),b=(0,h.useMemo)((()=>f(a)),[a,f]),v=(0,h.useMemo)((()=>(0,mo.LG)(b)),[b]),O=(0,h.useCallback)((e=>{let{item:t,groupData:r}=e;o(t,!yh({facet:t,selectedFacets:n}),r.groupId)}),[o,n]),{focusIndex:x,handleKeyDown:C}=Gp({items:v,open:r,onSelectFocusedItem:O,selectedItems:n}),S=Math.max(l||(0,T.getMaxItemWidth)("title")(b),240);return E().createElement(Fp,vh({open:r,action:y,title:uo().text("Select attribute"),containerWidth:S,searchInputOnKeyDown:C,containerHeight:110+u},c),E().createElement(bh,{focusIndex:x,selectedFacets:n,onListItemClick:o,metadata:t,containerWidth:S,items:v,height:u,onInnerContainerResize:m}),0===v.length&&E().createElement("div",{className:"MoreFacetsPopup-styles-noResultsCaptionContainer--ChfND"},E().createElement(wy(),{variant:"caption",display:"block",gutterBottom:!0},uo().text("No results found"))))};Oh.propTypes={metadata:T.MetadataType,open:fp().bool,selectedFacets:fp().array,data:fp().array,onListItemClick:fp().func,lastFacetClicked:fp().shape({facetConfig:fp().object,groupId:fp().string}),width:fp().number,height:fp().number};const xh=Oh;function Ch(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){Sh(e,t,r[t])}))}return e}function Sh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class wh extends h.PureComponent{constructor(e){super(e),this.state={filterText:"",lastFacetClicked:{},addedFacets:[]},this.showSearchInput=()=>this.searchInputRootRef.current.scrollIntoView(!0),this.openPopup=()=>this.props.dispatch(Eo(!0)),this.closePopup=()=>{this.props.dispatch(Eo(!1)),this.props.dispatch(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:P.k.HIGHLIGHT_ADDED_FACETS,payload:e}}(this.state.addedFacets)),this.setState({addedFacets:[]}),setTimeout((()=>{this.props.dispatch({type:P.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=>Ch({},e,{hide:!this.filterItemsTree(e),filterText:this.state.filterText}))).map((e=>{const t=this.getFilteredFacets(e.children);return(0,A.isEmpty)(t)?e:Ch({},e,{children:t})})),this.filterItemsInGroups=e=>e.map((e=>Ch({},e,{facets:this.getFilteredFacets(e.facets)}))),this.rejectNotAllowedEntityTypes=e=>t=>t.filter((t=>{let{id:r}=t;return!(0,T.isEntityTypeUri)(r)||e.includes(r)})),this.toggleSelectedFacet=(e,t)=>{const{facetsConfigs:r,selectedEntityTypes:n,dispatch:a}=this.props,o=(0,mo.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,A.uniq)(i.filter((e=>e.entityTypeUri)).map((e=>e.entityTypeUri)).concat(n)),s=i.filter((0,A.complement)(_.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,A.prop)("fieldName")),u),a(oo({facetsToAdd:c,fieldNamesToDelete:u,changedEntityTypes:(0,A.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,uh.Z)(_.tI),this.handleInputFocus=()=>{this.showSearchInput(),this.openPopup()},this.searchInputRootRef=E().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,A.pipe)((0,A.when)((0,A.always)(e),this.filterItemsInGroups),(0,A.when)((0,A.always)(c),this.rejectNotAllowedEntityTypes(c)),(0,L.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,Th),f={vertical:y,horizontal:"right"};return E().createElement(h.Fragment,null,E().createElement(Up,{classes:{root:a.inputContainer},onSearch:this.setFilterText,onFocus:this.handleInputFocus,rootRef:this.searchInputRootRef,value:e,placeholder:uo().text("Search & add attributes"),height:40,"data-reltio-id":"reltio-search-more-facets-search-input"}),E().createElement(xh,{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}))}}wh.propTypes={metadata:T.MetadataType,open:fp().bool,facetsConfigs:fp().array,recommendedFacets:fp().array,selectedEntityTypes:fp().array,dispatch:fp().func,classes:fp().object,dataTenantObject:T.DataTenantType,allowedEntityTypes:fp().array,dataTenants:fp().arrayOf(T.DataTenantType)},wh.defaultProps={selectedEntityTypes:[],facetsConfigs:[]};const Ah=(0,hp.connect)((e=>({metadata:D().selectors.getMetadata(e),open:(0,Do.ds)(e),facetsConfigs:(0,I.Mp)(e),recommendedFacets:(0,I.ER)(e),selectedEntityTypes:(0,I.DX)(e),dataTenantObject:(0,lo.t9)(e),allowedEntityTypes:(0,Do.Xf)(e),dataTenants:D().selectors.getDataTenants(e)})))(dh()((()=>({inputContainer:{margin:"4px 16px 16px",flexShrink:"0"}})))(wh)),Rh=(0,Tp.Z)({facetGroupContainer:{display:"flex",flexShrink:0,flexDirection:"column","& + hr":{marginTop:8},"& + &":{marginTop:"8px"}}});function _h(){return _h=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},_h.apply(this,arguments)}const Ih=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=Rh(),[o,i]=(0,h.useState)(!0);return E().createElement("div",{className:a.facetGroupContainer},E().createElement(ch,_h({isOpen:o,onCollapse:e=>{i(!o)}},n)),t&&E().createElement(E().Fragment,null,E().createElement(Ah,null),E().createElement(lh(),null)),o&&r)},Nh=(0,Tp.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}}),Dh=e=>{let{variant:t="facetsPanel",searchOptions:r={},dispatch:n}=e;const{root:a,labelRoot:o,checkboxRoot:i,checkboxRootQueryGroups:l}=Nh(),s=r.searchByOv,c=(0,h.useCallback)((()=>{n(N.search.actions.updateSearchOptions({searchByOv:!s,ovOnly:!s}))}),[s,n]),u=uo().text("Search by OV only");return E().createElement("div",{className:a,onClick:c},E().createElement(Kp(),{classes:{root:v()(i,{[l]:"queryGroups"===t})},checked:s,color:"primary"}),E().createElement(pd.Y,{value:u},E().createElement(wy(),{variant:"body2",classes:{root:o}},u)))};Dh.propTypes={searchOptions:fp().shape({searchByOv:fp().bool,ovOnly:fp().bool}),variant:fp().oneOf(["facetsPanel","queryGroups"]),dispatch:fp().func};const Ph=(0,hp.connect)((e=>({searchOptions:D().selectors.getSearchOptions(e)})))(Dh);var kh=r(8007),Lh=r(64927),Uh=r.n(Lh),jh=r(73707),Fh=r.n(jh),Mh=r(93463),Vh=r.n(Mh);const Bh=(0,Tp.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 zh=r(19701);const Hh=e=>{let{tenantObject:t,isDataTenant:r,className:n}=e;const a=(e=>{let{tenantObject:t,isDataTenant:r}=e;const n=(0,zh._)(),[a,o]=(0,h.useState)(0),i=(0,hp.useSelector)(D().selectors.getGlobalSearchRequestOptions),l=r?t:null,s=(0,hp.useSelector)((e=>(0,lo.E2)(e,[],l))),c=JSON.stringify((0,Fa.Vg)(s,[],i)),u=(0,hp.useSelector)(D().selectors.getDtssPath),p=(0,hp.useSelector)(D().selectors.getTenant);return(0,h.useEffect)((()=>{n((0,Fa.Es)({url:Z.jS,options:{method:"POST",body:c},customerTenant:p,dataTenant:(0,A.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 E().createElement("div",{className:n},(0,io.k7)(a))};Hh.propTypes={className:fp().string,tenantObject:fp().object.isRequired,isDataTenant:fp().bool};const Yh=Hh;function Wh(){return Wh=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},Wh.apply(this,arguments)}const Gh=e=>{let{customerTenantObject:t,currentTenant:r,dataTenants:n,changeCurrentTenant:a,openAdvancedSearch:o}=e;const i=Bh(),l=(0,A.pipe)((0,A.map)((e=>{let{id:t,label:r}=e;return{value:t,label:r}})),(0,A.prepend)({value:t.id,label:t.name}))(n),s=e=>{const r=e!==t.id;return{isDataTenant:r,tenantObject:r?n.find((0,A.propEq)("id",e)):t}},c=r||t.id;return E().createElement("div",{className:i.tenantFacet},E().createElement(ch,{title:uo().text("Tenants"),hasCollapseButton:!1}),E().createElement(Fh(),{className:i.radioGroup,value:c,onChange:(0,A.pipe)(Ep.NA,s,a)},l.map((e=>{let{value:t,label:r}=e;return E().createElement("div",{className:i.tenantContainer,key:t},E().createElement(Vh(),{classes:{root:i.radioLabelRoot,label:i.radioLabel},value:t,label:r||t,control:E().createElement(Uh(),{className:i.radioButton,color:"primary"})}),!o&&E().createElement(Yh,Wh({className:i.total},s(t))))}))))};Gh.propTypes={customerTenantObject:fp().shape({id:fp().string,name:fp().string}),currentTenant:fp().string,dataTenants:fp().arrayOf(T.DataTenantType),changeCurrentTenant:fp().func,openAdvancedSearch:fp().bool};const qh={changeCurrentTenant:e=>{let{tenantObject:t,isDataTenant:r}=e;return{type:k.Z.CHANGE_CURRENT_TENANT,payload:{tenantObject:t,isDataTenant:r}}}},Zh=(0,hp.connect)((e=>({dataTenants:D().selectors.getDataTenants(e),customerTenantObject:D().selectors.getTenantObject(e),currentTenant:(0,lo.RO)(e),openAdvancedSearch:(0,Do.IJ)(e)})),qh)(Gh),$h=(0,Tp.Z)({root:{display:"flex",flexDirection:"column",overflow:"auto",height:"100%"}});function Kh(){return Kh=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},Kh.apply(this,arguments)}const Xh=(0,T.memoizeWith)((e=>e.fieldName),nh.build),Qh=e=>{let{group:t,configs:r}=e;return E().createElement(Ih,Kh({},t,{key:t.title}),(e=>e.map((e=>({Facet:Xh(e),id:e.fieldName}))).filter((e=>{let{Facet:t}=e;return t})).map((e=>{let{Facet:t,id:r}=e;return E().createElement(t,{key:r})})))(r))};Qh.propTypes={group:fp().object,configs:fp().array};const Jh=e=>{let{facetsConfigs:t=[],metadata:r,onScroll:n,uiConfigShowSearchByOv:a,showTenantFacet:o}=e;const{root:i}=$h(),l=(0,h.useRef)(null),s=(0,h.useCallback)((e=>{n(l.current.scrollTop,e)}),[n]),c=((e,t)=>{const[r,n]=(0,A.partition)(T.isTypeFacet,t),a=[{group:{title:uo().text("Entity types"),hasCollapseButton:!1},configs:r},{group:{title:uo().text("Attributes"),hasCollapseButton:!1,hasSearchAttributesField:!0},configs:n}];return oh(a)})(0,t),u=(0,A.head)(c),p=(0,A.tail)(c),d=l.current,m=(0,h.useMemo)((()=>({element:d,priority:["top","bottom"]})),[d]);return E().createElement("div",{ref:l,className:i,onScroll:s},E().createElement(kh.p.Provider,{value:m},a&&E().createElement(Ph,null),o&&E().createElement(E().Fragment,null,E().createElement(Zh,null),E().createElement(lh(),null)),u&&Qh(u),E().createElement(lh(),null),p.map(((e,t)=>E().createElement(Qh,Kh({},e,{key:t}))))))};Jh.propTypes={metadata:T.MetadataType,facetsConfigs:fp().array,onScroll:fp().func,dispatch:fp().func,uiConfigShowSearchByOv:fp().bool,showTenantFacet:fp().bool};const eE=(0,hp.connect)((e=>{var t;const r=D().selectors.getDataTenants(e);return{metadata:D().selectors.getMetadata(e),facetsConfigs:(0,I.Mp)(e),uiConfigShowSearchByOv:null!==(t=D().selectors.getShowSearchByOv(e))&&void 0!==t?t:(0,Do.cC)(e),showTenantFacet:r&&r.length>0,tenant:D().selectors.getTenant(e)}}))(Jh),tE=e=>{let{children:t,className:r}=e;return E().createElement("div",{className:v()("MainContent-styles-mainContent--Ha5me",r)},t)};tE.propTypes={children:fp().node,className:fp().string};const rE=tE;var nE=r(33788);const aE=(0,Tp.Z)({container:{backgroundColor:"#fff",opacity:.37,position:"fixed",width:"100%",height:"100%",top:0,left:0,display:"flex",justifyContent:"center",alignItems:"center"}}),oE=()=>{const e=(0,hp.useSelector)(Do.Kv),{container:t}=aE();return e?E().createElement("div",{className:t},E().createElement(nE.Z,{size:160})):null};var iE=r(54596),lE=r.n(iE),sE=r(49233),cE=r.n(sE),uE=r(35206),pE=r.n(uE),dE=r(81733),mE=r.n(dE),yE=r(68290),gE=r.n(yE);const fE=(0,Tp.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"},[Z.GT.error]:{backgroundColor:e.palette.error.dark}})));function hE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const EE=()=>{const e=(0,hp.useDispatch)(),t=(0,hp.useSelector)(Do.v6),r=(0,hp.useSelector)(D().selectors.getAutoCloseInterval),n=t&&t.payload.autoHideDuration||r&&1e3*r||5e3,a=fE(),o=(0,h.useRef)(null),i=(0,h.useCallback)((()=>{e(So())}),[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){hE(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,h.useCallback)((()=>{p&&e(p)}),[p,e]),m=(0,h.useMemo)((()=>l===Z.GT.error?E().createElement(cE(),{key:"close","aria-label":"Close",color:"inherit",className:a.close,onClick:d,size:"large"},E().createElement(Rp(),null)):u?E().createElement(pE(),{color:"primary",size:"small",onClick:d},u.actionLabel):null),[a,l,u,d]);return E().createElement(mE(),{container:document.body},E().createElement(lE(),{key:c+l,anchorOrigin:{vertical:"bottom",horizontal:"center"},autoHideDuration:n,open:Boolean(t),onClose:i,ContentProps:{classes:{root:v()(a.snackbar,a[l]),message:a.message}},message:E().createElement("div",{className:a.messageContent},l===Z.GT.error&&E().createElement(gE(),{className:a.icon}),c),classes:{anchorOriginBottomCenter:a.anchorSnackBar},action:m}))},bE=(0,Tp.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 vE=r(31396);const TE=(0,Tp.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%"}}}}}))),OE=250,xE=e=>"horizontal"===e,CE=e=>{let{className:t,children:r,orientation:n,primary:a,defaultSize:o,size:i,minSize:l,maxSize:s,allowResize:c,debounceInterval:u=OE,onChange:p}=e;const d=TE(),m=(0,Pm.useTheme)(),[y,g]=(0,h.useState)(null),[f,b]=(0,h.useState)(!0),O=(0,h.useCallback)((()=>b(!0)),[]),x=(0,h.useCallback)((()=>b(!1)),[]),C=()=>xE(n)?null==y?void 0:y.clientHeight:null==y?void 0:y.clientWidth,S=(0,h.useCallback)((0,T.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,h.useMemo)((()=>({transition:m.transitions.create(xE(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),E().createElement("div",{ref:g,className:v()(d.container,t)},E().createElement(vE.Z,{split:n,size:i,primary:a,allowResize:c,onChange:S,defaultSize:o,minSize:l,maxSize:s,onDragStarted:x,onDragFinished:O,pane1Style:f?w:void 0},r))};CE.displayName="ResizablePanes";const SE=(0,Tp.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}}),wE=e=>{let{entity:t,className:r,size:n="small"}=e;const a=SE(),o=(0,C.AH)(),i=(0,T.getEntityType)(o,t.type),l=(i?(0,T.getPropWithInheritance)(o,i,"typeColor"):null)||T.theme.palette.primary.main,s=(0,T.getEntityTypeLabel)(o,t);return E().createElement(pd.Y,{value:s,placement:"top"},E().createElement(wy(),{style:{backgroundColor:l,color:T.utils.Colors.getColor(l)?"#FFFFFF":"#212121"},className:v()(a[`entityType-${n}`],a["entityType-overflow"],r),component:"div"},s))},AE=e=>e&&e.scrollIntoView({block:"end",behavior:"smooth"}),RE=e=>{e&&clearTimeout(e)},_E=(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 IE=r(55962);const NE=(0,Tp.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,Pm.alpha)(e.palette.primary.main,.12),"&:hover":{background:(0,Pm.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"}}))),DE=e=>{let{entities:t,entityToHighlight:r,selectedEntityUri:n,onEntityClick:a,onEntityHover:o,entitiesImportStatus:i,entityButtonsRenderer:l}=e;const s=NE(),c=(0,h.useRef)(null),u=(0,h.useRef)(null),p=(0,C.AH)();return(0,IE.D)((()=>{if(r){var e;const n=null===(e=c.current)||void 0===e?void 0:e.querySelectorAll(`[data-entity-uri='${r}']`);if(RE(u.current),(null==n?void 0:n.length)>0){var t;const e=null===(t=c.current)||void 0===t?void 0:t.parentElement;_E(n[0],e)||(AE(n[0]),u.current=setTimeout((()=>{_E(n[0],e)||AE(n[0])}),1e3))}}return()=>{RE(u.current)}}),[r]),E().createElement("div",{ref:c},(t||[]).map((e=>{const t=(0,T.getLabel)(e.label),c=e.secondaryLabel,u=(0,T.getBusinessCardAttributesText)(p,e),d=(0,T.isActiveObject)(e),m=e.uri,y=(0,T.getEntityUriForLink)(e),g=(0,A.prop)(m,i);return E().createElement("div",{key:m,className:v()(s.item,{[s.clickable]:!!a,[s.selected]:m===n,[s.highlighted]:m===r,[s.inactive]:!d,[s.justImported]:g===xm.SUCCESS}),onClick:a?()=>a(m):void 0,onMouseEnter:o?()=>o(m):void 0,onMouseLeave:o?()=>o(null):void 0,"data-entity-uri":m},E().createElement(S,{entity:e,avatarClassName:s.avatar,imageClassName:s.image}),E().createElement("div",{className:s.info},E().createElement("div",null,E().createElement(Yd,{value:y,className:s.label},t),c&&E().createElement("span",{className:s.secondaryLabel},c," "),u&&E().createElement("span",{className:s.businessCard},u)),E().createElement("div",{className:s.secondRow},E().createElement(wE,{entity:e}),E().createElement("div",null,(0,T.getEntityId)(e)))),l&&l(e))})))};var PE=r(92255);function kE(){return kE=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},kE.apply(this,arguments)}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)}const FE=(0,Tp.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 ME(){return ME=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},ME.apply(this,arguments)}let VE=function(e){return e.full="full",e.embedded="embedded",e.small="small",e}({});const BE={SEARCH_RESULTS:e=>E().createElement("svg",kE({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),E().createElement("defs",null,E().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"},E().createElement("stop",{stopColor:"#00BFFF",stopOpacity:.5,offset:"0%"}),E().createElement("stop",{stopColor:"#9EE8FF",stopOpacity:0,offset:"100%"})),E().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"},E().createElement("stop",{stopColor:"#91F8E5",stopOpacity:.6,offset:"0%"}),E().createElement("stop",{stopColor:"#14F7FF",stopOpacity:0,offset:"100%"})),E().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"},E().createElement("stop",{stopColor:"#FFF",offset:"0%"}),E().createElement("stop",{stopColor:"#73FAFF",stopOpacity:.21,offset:"59.38%"}),E().createElement("stop",{stopColor:"#14F7FF",stopOpacity:0,offset:"100%"})),E().createElement("linearGradient",{x1:"50%",y1:"170.771%",x2:"50%",y2:"10.303%",id:"EmptySearchResults_svg__e"},E().createElement("stop",{stopColor:"#91F8E5",offset:"0%"}),E().createElement("stop",{stopColor:"#99FCFF",stopOpacity:0,offset:"100%"})),E().createElement("filter",{x:"-25.9%",y:"-26.2%",width:"151.8%",height:"152.3%",filterUnits:"objectBoundingBox",id:"EmptySearchResults_svg__d"},E().createElement("feGaussianBlur",{stdDeviation:15,in:"SourceGraphic"})),E().createElement("circle",{id:"EmptySearchResults_svg__a",cx:128,cy:128,r:128})),E().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},E().createElement("mask",{id:"EmptySearchResults_svg__b",fill:"#fff"},E().createElement("use",{xlinkHref:"#EmptySearchResults_svg__a"})),E().createElement("use",{fillOpacity:.2,fill:"#A792CD",xlinkHref:"#EmptySearchResults_svg__a"}),E().createElement("g",{mask:"url(#EmptySearchResults_svg__b)"},E().createElement("g",{transform:"translate(56 34)"},E().createElement("g",{opacity:.9,strokeWidth:1,fill:"#FFF"},E().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"}),E().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})),E().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 45.833)"},E().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),E().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),E().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"}),E().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}),E().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}),E().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})),E().createElement("rect",{fill:"#645F6D",opacity:.5,x:21.756,y:17.46,width:87.022,height:12.004,rx:6.002}),E().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 87.302)"},E().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),E().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),E().createElement("rect",{fill:"#E3EBF4",x:0,y:1.091,width:20.668,height:20.734,rx:10.334}),E().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}),E().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}),E().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})),E().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 128.77)"},E().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),E().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),E().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"}),E().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}),E().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}),E().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})))),E().createElement("g",{mask:"url(#EmptySearchResults_svg__b)"},E().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"}),E().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"}),E().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"}),E().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}),E().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"}),E().createElement("g",null,E().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)"}),E().createElement("path",{fill:"url(#EmptySearchResults_svg__e)",opacity:.3,d:"M4 9h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),E().createElement("path",{fill:"url(#EmptySearchResults_svg__f)",opacity:.3,d:"M4 2h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),E().createElement("path",{fill:"url(#EmptySearchResults_svg__g)",d:"M4 9h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),E().createElement("path",{fill:"#FFF",opacity:.196,d:"M212.363 205.344l-1 1.732L60.418 124.52l4.977-8.62z"})),E().createElement("path",{fill:"#76A2B5",d:"M73.112 84.533l-35.5 61.488-.866-.5 35.5-61.488z"}),E().createElement("path",{fill:"#F3F3F3",d:"M80.906 89.033l-35.5 61.488-.866-.5 35.5-61.488z"}),E().createElement("path",{fill:"#538196",d:"M55.112 115.71l-17.5 30.311-.866-.5 17.5-30.31z"})))),SELECT_ATTRIBUTES:e=>E().createElement("svg",LE({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),E().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.1}),E().createElement("mask",{id:"SelectAttributes_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},E().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),E().createElement("g",{mask:"url(#SelectAttributes_svg__a)"},E().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#SelectAttributes_svg__paint0_linear_0_19219)"}),E().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)"}),E().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"}),E().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"}),E().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"}),E().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"}),E().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"}),E().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"}),E().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"}),E().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"}),E().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"}),E().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"}),E().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),E().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),E().createElement("circle",{cx:120,cy:106,r:6,fill:"#B6C7DB"}),E().createElement("circle",{cx:120,cy:136,r:6,fill:"#B6C7DB"}),E().createElement("circle",{cx:67,cy:169,r:9,fill:"#B6C7DB"}),E().createElement("circle",{cx:67,cy:199,r:9,fill:"#B6C7DB"}),E().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"}),E().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"}),E().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"}),E().createElement("path",{opacity:.54,fillRule:"evenodd",clipRule:"evenodd",d:"M95.071 77l-3.535 3.535L88 77h7.071z",fill:"#000"}),E().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"}),E().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"})),E().createElement("defs",null,E().createElement("linearGradient",{id:"SelectAttributes_svg__paint0_linear_0_19219",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},E().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),E().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),E().createElement("linearGradient",{id:"SelectAttributes_svg__paint1_linear_0_19219",x1:266.117,y1:181.111,x2:154.882,y2:77.681,gradientUnits:"userSpaceOnUse"},E().createElement("stop",{stopOpacity:.01}),E().createElement("stop",{offset:1})))),NO_DATA:e=>E().createElement("svg",UE({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),E().createElement("defs",null,E().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"NoData_svg__b"},E().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:0,offset:"0%"}),E().createElement("stop",{stopColor:"#F4F4F4",offset:"100%"})),E().createElement("linearGradient",{x1:"69.573%",y1:"86.747%",x2:"38.144%",y2:"33.403%",id:"NoData_svg__d"},E().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),E().createElement("stop",{stopColor:"#000",offset:"100%"})),E().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"NoData_svg__e"},E().createElement("stop",{stopColor:"#EEFBFF",offset:"0%"}),E().createElement("stop",{stopColor:"#0072CE",offset:"100%"})),E().createElement("filter",{x:"-7.7%",y:"-7.5%",width:"115.3%",height:"115%",filterUnits:"objectBoundingBox",id:"NoData_svg__f"},E().createElement("feOffset",{dx:0,dy:2,in:"SourceAlpha",result:"shadowOffsetOuter1"}),E().createElement("feGaussianBlur",{stdDeviation:2,in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),E().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"}),E().createElement("feMerge",null,E().createElement("feMergeNode",{in:"shadowMatrixOuter1"}),E().createElement("feMergeNode",{in:"SourceGraphic"}))),E().createElement("circle",{id:"NoData_svg__a",cx:128,cy:128,r:128})),E().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},E().createElement("mask",{id:"NoData_svg__c",fill:"#fff"},E().createElement("use",{xlinkHref:"#NoData_svg__a"})),E().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#NoData_svg__a"}),E().createElement("path",{fill:"url(#NoData_svg__b)",mask:"url(#NoData_svg__c)",d:"M0 9h256v247H0z"}),E().createElement("g",{mask:"url(#NoData_svg__c)"},E().createElement("g",{transform:"translate(29 37)"},E().createElement("g",{opacity:.9,strokeWidth:1,fill:"#FFF"},E().createElement("path",{fillOpacity:.8,opacity:.5,d:"M14.565 8h228.144v176.476H14.565z"}),E().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"})),E().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 42.105)"},E().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),E().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),E().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"}),E().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}),E().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}),E().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})),E().createElement("rect",{fill:"#645F6D",opacity:.5,x:19.986,y:16.04,width:79.944,height:11.028,rx:5.514}),E().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 80.2)"},E().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),E().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),E().createElement("rect",{fill:"#E3EBF4",x:0,y:1.003,width:18.987,height:19.048,rx:9.493}),E().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}),E().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}),E().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})),E().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 118.296)"},E().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),E().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),E().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"}),E().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}),E().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}),E().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})))),E().createElement("g",{mask:"url(#NoData_svg__c)"},E().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)"}),E().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)"}),E().createElement("g",{filter:"url(#NoData_svg__f)",strokeWidth:1,fill:"none",transform:"translate(70 86)"},E().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"}),E().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"})),E().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"}}),E().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"}}),E().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=>E().createElement("svg",jE({width:88,height:88,viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),E().createElement("mask",{id:"Error_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:88,height:88},E().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"})),E().createElement("g",{mask:"url(#Error_svg__a)"},E().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}),E().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"}),E().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"}),E().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"}),E().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"}),E().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"}),E().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"}),E().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"}),E().createElement("path",{d:"M21.036 40.178h-5.09a.636.636 0 000 1.272h5.09a.636.636 0 100-1.272z",fill:"#ACACAC"}),E().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"}),E().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"}),E().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"}),E().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"}),E().createElement("path",{d:"M18.915 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#9C6CF0"}),E().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"}),E().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"}),E().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"}),E().createElement("path",{d:"M41.82 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),E().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"}),E().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"}),E().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"}),E().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"}),E().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"}),E().createElement("path",{d:"M54.968 67.324h-5.09a.636.636 0 000 1.273h5.09a.636.636 0 000-1.273z",fill:"#E9E9E9"}),E().createElement("g",{filter:"url(#Error_svg__filter0_d)"},E().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"})),E().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"}),E().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"}),E().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"}),E().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"}),E().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"}),E().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)"}),E().createElement("g",{filter:"url(#Error_svg__filter1_d)"},E().createElement("path",{d:"M57.406 68.063a1.719 1.719 0 100-3.438 1.719 1.719 0 000 3.438z",fill:"#000"})),E().createElement("path",{d:"M57.406 68.063a1.719 1.719 0 100-3.438 1.719 1.719 0 000 3.438z",fill:"#fff"}),E().createElement("g",{filter:"url(#Error_svg__filter2_d)"},E().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"})),E().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"})),E().createElement("defs",null,E().createElement("filter",{id:"Error_svg__filter0_d",x:36.219,y:37.875,width:42.375,height:42.375,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},E().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),E().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"}),E().createElement("feOffset",{dy:2}),E().createElement("feGaussianBlur",{stdDeviation:2}),E().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"}),E().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),E().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),E().createElement("filter",{id:"Error_svg__filter1_d",x:51.688,y:62.625,width:11.438,height:11.438,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},E().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),E().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"}),E().createElement("feOffset",{dy:2}),E().createElement("feGaussianBlur",{stdDeviation:2}),E().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"}),E().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),E().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),E().createElement("filter",{id:"Error_svg__filter2_d",x:51.688,y:44.063,width:11.438,height:23.813,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},E().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),E().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"}),E().createElement("feOffset",{dy:2}),E().createElement("feGaussianBlur",{stdDeviation:2}),E().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"}),E().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),E().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),E().createElement("linearGradient",{id:"Error_svg__paint0_linear",x1:68.438,y1:71.571,x2:60.119,y2:58.801,gradientUnits:"userSpaceOnUse"},E().createElement("stop",{stopOpacity:0}),E().createElement("stop",{offset:1})))),LOADING:e=>E().createElement("svg",ME({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),E().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.03}),E().createElement("mask",{id:"EmptyLoading_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},E().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),E().createElement("g",{mask:"url(#EmptyLoading_svg__a)"},E().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#EmptyLoading_svg__paint0_linear_2978_41880)"}),E().createElement("g",{fillRule:"evenodd",clipRule:"evenodd"},E().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"}),E().createElement("path",{d:"M50.371 43.106h255.685V195.71H50.371V43.106z",fill:"url(#EmptyLoading_svg__paint1_linear_2978_41880)"}),E().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"}),E().createElement("path",{d:"M339.015 204.883v4.966H15v-4.966h324.015z",fill:"#D4DCDF"}),E().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)"})),E().createElement("g",{filter:"url(#EmptyLoading_svg__filter0_d_2978_41880)"},E().createElement("rect",{x:81.703,y:99,width:170,height:26,rx:8,fill:"#D1E6FF"}),E().createElement("rect",{x:84.703,y:102,width:164,height:20,rx:5,stroke:"#fff",strokeWidth:6})),E().createElement("g",{filter:"url(#EmptyLoading_svg__filter1_d_2978_41880)"},E().createElement("mask",{id:"EmptyLoading_svg__b",fill:"#fff"},E().createElement("rect",{x:81,y:105,width:108,height:14,rx:2})),E().createElement("rect",{x:81,y:105,width:108,height:14,rx:2,fill:"#61A3F1"}),E().createElement("rect",{x:81,y:105,width:108,height:14,rx:2,stroke:"#4A90E2",strokeWidth:8,mask:"url(#EmptyLoading_svg__b)"})),E().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"}),E().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"}),E().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"}),E().createElement("g",{filter:"url(#EmptyLoading_svg__filter2_ddd_2978_41880)"},E().createElement("path",{fill:"#A0C1D7",d:"M70.703 64h11v8h-11z"}),E().createElement("rect",{x:62,y:59,width:28,height:8,rx:1,fill:"#BDD4E3"}),E().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"}),E().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"}),E().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)"}),E().createElement("circle",{cx:75.94,cy:123.237,r:44.723,fill:"#91B0C2"}),E().createElement("g",{filter:"url(#EmptyLoading_svg__filter3_d_2978_41880)"},E().createElement("circle",{r:42.793,transform:"matrix(-1 0 0 1 75.94 123.237)",fill:"#F7F4FF"})),E().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)"}),E().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)"}),E().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"}),E().createElement("circle",{cx:75.94,cy:123.237,r:2.896,fill:"#EEEBF6"}),E().createElement("circle",{cx:96.211,cy:148.655,r:2.574,fill:"#A0C3D7"}),E().createElement("circle",{cx:107.15,cy:131.924,r:2.574,fill:"#A0C3D7"}),E().createElement("rect",{x:62.427,y:135.592,width:27.027,height:10.039,rx:3,fill:"#A0C3D7"}),E().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)"}),E().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)"}),E().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)"}),E().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)"}),E().createElement("circle",{cx:75.618,cy:155.734,r:2.574,fill:"#A0C3D7"}),E().createElement("circle",{cx:55.026,cy:148.655,r:2.574,fill:"#A0C3D7"}),E().createElement("circle",{cx:44.73,cy:131.924,r:2.574,fill:"#A0C3D7"}),E().createElement("g",{fill:"#A0C3D7"},E().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 96.21 97.363)"}),E().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 107.149 114.094)"}),E().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 75.618 90.284)"}),E().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 55.026 97.363)"}),E().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 44.73 114.094)"})))),E().createElement("defs",null,E().createElement("linearGradient",{id:"EmptyLoading_svg__paint0_linear_2978_41880",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},E().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),E().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),E().createElement("linearGradient",{id:"EmptyLoading_svg__paint1_linear_2978_41880",x1:178.214,y1:43.106,x2:178.214,y2:195.709,gradientUnits:"userSpaceOnUse"},E().createElement("stop",{stopColor:"#F2F9FB"}),E().createElement("stop",{offset:1,stopColor:"#fff"})),E().createElement("linearGradient",{id:"EmptyLoading_svg__paint2_linear_2978_41880",x1:178.497,y1:204.542,x2:178.497,y2:213.991,gradientUnits:"userSpaceOnUse"},E().createElement("stop",{stopColor:"#90AABF"}),E().createElement("stop",{offset:1,stopColor:"#869DAE"})),E().createElement("linearGradient",{id:"EmptyLoading_svg__paint3_linear_2978_41880",x1:154.275,y1:146.574,x2:96.683,y2:91.352,gradientUnits:"userSpaceOnUse"},E().createElement("stop",{stopOpacity:.01}),E().createElement("stop",{offset:1})),E().createElement("linearGradient",{id:"EmptyLoading_svg__paint4_linear_2978_41880",x1:60.762,y1:143.327,x2:114.747,y2:176.019,gradientUnits:"userSpaceOnUse"},E().createElement("stop",{stopOpacity:.87}),E().createElement("stop",{offset:1,stopOpacity:.01})),E().createElement("linearGradient",{id:"EmptyLoading_svg__paint6_linear_2978_41880",x1:90.287,y1:154.267,x2:68.53,y2:131.301,gradientUnits:"userSpaceOnUse"},E().createElement("stop",{stopOpacity:.01}),E().createElement("stop",{offset:1})),E().createElement("linearGradient",{id:"EmptyLoading_svg__paint7_linear_2978_41880",x1:100.735,y1:120.288,x2:78.978,y2:97.322,gradientUnits:"userSpaceOnUse"},E().createElement("stop",{stopOpacity:.01}),E().createElement("stop",{offset:1})),E().createElement("linearGradient",{id:"EmptyLoading_svg__paint8_linear_2978_41880",x1:121.119,y1:112.739,x2:99.362,y2:89.773,gradientUnits:"userSpaceOnUse"},E().createElement("stop",{stopOpacity:.01}),E().createElement("stop",{offset:1})),E().createElement("linearGradient",{id:"EmptyLoading_svg__paint9_linear_2978_41880",x1:90.166,y1:136.143,x2:68.409,y2:113.177,gradientUnits:"userSpaceOnUse"},E().createElement("stop",{stopOpacity:.01}),E().createElement("stop",{offset:1})),E().createElement("filter",{id:"EmptyLoading_svg__filter0_d_2978_41880",x:77.703,y:96,width:178,height:34,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},E().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),E().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"}),E().createElement("feOffset",{dy:1}),E().createElement("feGaussianBlur",{stdDeviation:2}),E().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"}),E().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),E().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),E().createElement("filter",{id:"EmptyLoading_svg__filter1_d_2978_41880",x:77,y:102,width:116,height:22,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},E().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),E().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"}),E().createElement("feOffset",{dy:1}),E().createElement("feGaussianBlur",{stdDeviation:2}),E().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"}),E().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),E().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),E().createElement("filter",{id:"EmptyLoading_svg__filter2_ddd_2978_41880",x:-13.297,y:28,width:181.534,height:189.17,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},E().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),E().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"}),E().createElement("feMorphology",{radius:4,operator:"erode",in:"SourceAlpha",result:"effect1_dropShadow_2978_41880"}),E().createElement("feOffset",{dy:7}),E().createElement("feGaussianBlur",{stdDeviation:4}),E().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"}),E().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),E().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"}),E().createElement("feMorphology",{radius:4,operator:"dilate",in:"SourceAlpha",result:"effect2_dropShadow_2978_41880"}),E().createElement("feOffset",{dy:5}),E().createElement("feGaussianBlur",{stdDeviation:16}),E().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"}),E().createElement("feBlend",{mode:"normal",in2:"effect1_dropShadow_2978_41880",result:"effect2_dropShadow_2978_41880"}),E().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"}),E().createElement("feMorphology",{radius:2,operator:"dilate",in:"SourceAlpha",result:"effect3_dropShadow_2978_41880"}),E().createElement("feOffset",{dy:12}),E().createElement("feGaussianBlur",{stdDeviation:8.5}),E().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"}),E().createElement("feBlend",{mode:"normal",in2:"effect2_dropShadow_2978_41880",result:"effect3_dropShadow_2978_41880"}),E().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect3_dropShadow_2978_41880",result:"shape"})),E().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"},E().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),E().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"}),E().createElement("feOffset",{dy:2}),E().createElement("feGaussianBlur",{stdDeviation:2}),E().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"}),E().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),E().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),E().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)"},E().createElement("stop",{stopColor:"#CFE8FF"}),E().createElement("stop",{offset:.599,stopColor:"#D1F2F9",stopOpacity:0}))))},zE=e=>{let{variant:t=VE.full,LogoRenderer:r=BE.SEARCH_RESULTS,text:n,secondaryText:a,buttonTitle:o,onClick:i=A.identity,access:l}=e;const s=FE(),c=l&&o;return E().createElement("div",{className:v()(s.root,s[`root_${t}`])},E().createElement(r,{className:s[`${t}`]}),E().createElement("div",{className:s.textBox},E().createElement(wy(),{variant:"h5",classes:{h5:s.text}},n),a&&E().createElement(wy(),{variant:"subtitle1",classes:{subtitle1:s.secondaryText}},a)),c&&E().createElement(pE(),{className:s.button,variant:"contained",color:"primary",onClick:i},o))};var HE=r(87378);class YE extends E().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 WE=(0,Tp.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 GE=r(46089),qE=r.n(GE);const ZE=(0,Tp.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,Pm.alpha)(e.palette.primary.main,.12),fill:e.palette.primary.main,color:e.palette.primary.main,"&:hover":{backgroundColor:(0,Pm.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:{}}))),$E=(0,dd.T)(pE()),KE=e=>{let{className:t,classes:r={},modes:n=[],modeId:a,onChange:o}=e;const i=ZE();return E().createElement(qE(),{className:t},n.map((e=>{let{id:t,title:n,tooltipTitle:l,Icon:s,disabled:c}=e;return E().createElement($E,{disabled:c,showForDisabled:c&&!!l,key:String(t),className:v()(i.button,{[i.current]:a===t},r.button),tooltipTitle:l,onClick:(u=t,()=>o(u)),"data-reltio-id":`reltio-search-mode-${t}`},s&&E().createElement(s,{className:i.icon}),n&&E().createElement("div",{className:i.title},n));var u})))},XE=(0,Tp.Z)((()=>({button:{"&.MuiButtonGroup-grouped":{minWidth:"90px",padding:"8px 12px"}}})));function QE(){return QE=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},QE.apply(this,arguments)}const JE=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 E().createElement("svg",QE({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),E().createElement("defs",null,E().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"})),E().createElement("g",{stroke:"none",strokeWidth:"1"},E().createElement("g",{transform:"translate(.2)"},E().createElement("mask",{id:"svg3365802068b",fill:"#fff"},E().createElement("use",{xlinkHref:"#svg3365802068a"})),E().createElement("g",{mask:"url(#svg3365802068b)"},E().createElement("g",null,E().createElement("g",null,E().createElement("path",{d:"M0 0h24v24H0z"})))))))};function eb(){return eb=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},eb.apply(this,arguments)}const tb=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 E().createElement("svg",eb({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),E().createElement("defs",null,E().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"})),E().createElement("g",{stroke:"none",strokeWidth:"1"},E().createElement("g",{transform:"translate(.2)"},E().createElement("mask",{id:"svg4195527304b",fill:"#fff"},E().createElement("use",{xlinkHref:"#svg4195527304a"})),E().createElement("g",{mask:"url(#svg4195527304b)"},E().createElement("path",{d:"M0 0h24v24H0z"})))))},rb=e=>{switch(e){case Z.ll.TABLE:return JE;case Z.ll.LIST:return tb;default:return gE()}},nb=[{id:Z.ll.TABLE,tooltipTitle:uo().text("Table view"),title:uo().text("Table"),Icon:rb(Z.ll.TABLE)},{id:Z.ll.LIST,tooltipTitle:uo().text("List view"),title:uo().text("List"),Icon:rb(Z.ll.LIST)}],ab=e=>{let{className:t}=e;const r=XE(),n=(0,hp.useDispatch)(),a=(0,hp.useSelector)(Do.XM);return E().createElement(KE,{className:t,classes:{button:r.button},modes:nb,modeId:a,onChange:e=>{a!==e&&n((e=>({type:_e,payload:e}))(e))}})};ab.propTypes={className:fp().string};const ob=ab;var ib=r(81085),lb=r.n(ib),sb=r(48139),cb=r.n(sb);const ub="DATA_TENANTS_UPDATED",pb=e=>t=>({type:e,payload:t}),db=(pb(ub),null),mb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:db,t=arguments.length>1?arguments[1]:void 0;return t.type===ub?t.payload||db:e},yb="TENANTS_UPDATED",gb=(pb(yb),null),fb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gb,t=arguments.length>1?arguments[1]:void 0;return t.type===yb?t.payload||gb:e},hb="METADATA_LOADED";let Eb=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 bb(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){vb(e,t,r[t])}))}return e}function vb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tb={},Ob=(0,A.pipe)(T.normalizeMetadata,T.parseMetadata,T.localizeMetadata),xb=(0,A.map)(T.localizeMetadata),Cb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Tb,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case hb:{const{tenant:r,metadata:n}=t.payload;return bb({},e,{[r]:Ob(n)})}case Eb.LOCALIZATION_LOADED:return xb(e);default:return e}};let Sb=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 wb=pb(Sb.ADD_ATTRIBUTES),Ab=pb(Sb.ADD_DEFAULT_VALUES),Rb=pb(Sb.MODIFY_ATTRIBUTE),_b=pb(Sb.REMOVE_ATTRIBUTE),Ib=pb(Sb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES),Nb=pb(Sb.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES),Db=pb(Sb.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES),Pb=pb(Sb.SAVE_PROFILE),kb=pb(Sb.SAVE_DRAFT),Lb=pb(Sb.PROFILE_SAVED),Ub=pb(Sb.VALIDATE_PROFILE);let jb=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 Fb=pb(jb.DEPENDENT_LOOKUPS_STRUCTURE_SET),Mb=pb(jb.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED),Vb=pb(jb.DEPENDENT_LOOKUPS_EDITORS_BLOCKED),Bb=pb(jb.DEPENDENT_LOOKUPS_EDITOR_TOUCHED);let zb=function(e){return e.MODE_UPDATED="MODE_UPDATED",e.MODE_CANCEL_EDITING="MODE_CANCEL_EDITING",e.MODE_EDITING_CANCELED="MODE_EDITING_CANCELED",e}({});function Hb(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){Yb(e,t,r[t])}))}return e}function Yb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wb={structure:{},editors:{},initedTypeUris:[]},Gb="SEARCH_RESULTS_SET",qb="KEYWORD_UPDATED",Zb="UPDATE_STATE",$b="ACTIVITY_FILTER_UPDATED",Kb="GLOBAL_FILTER_UPDATED",Xb="SEARCH_OPTIONS_UPDATED",Qb="SET_SEARCH_OPTIONS_CONFIG",Jb="SET_SEARCH_PROVIDER_DATA",ev="SET_SEARCH_NAVIGATION_DATA",tv="UPDATE_SEARCH_NAVIGATION_DATA_FIELDS",rv=pb(Gb),nv=pb(qb),av=pb(Zb),ov=pb("SAVE_STATE"),iv=pb($b),lv=pb(Kb),sv=pb(Xb),cv=pb(Qb),uv=pb(Jb),pv=pb(ev),dv=pb(tv),mv=pb("UPDATE_SEARCH_NAVIGATION_DATA_ON_MERGE"),yv=(0,A.path)(["globalFilter","savedSearchesUris"]),gv="searchNavigation";function*fv(){const e=yield(0,ja.Ys)(gI.selectors.getSearchNavigationData),t=yield(0,ja.Ys)(gI.selectors.getSearchProviderData);sessionStorage.setItem(gv,JSON.stringify({searchNavigationData:e,searchProviderData:t}))}function*hv(){let e;try{e=JSON.parse(sessionStorage.getItem(gv))||{}}catch(t){e={}}const{searchNavigationData:t,searchProviderData:r}=e;t&&r&&(yield(0,ja.gz)(uv(r)),yield(0,ja.gz)(pv(t)))}const Ev=[function*(){yield(0,ja.Fm)([ev,tv,Eb.OPEN_ENTITY],fv)},function*(){yield(0,ja.RE)(hv)}];function bv(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){vv(e,t,r[t])}))}return e}function vv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tv={searchResults:[],keyword:null,searchOptions:{searchByOv:!1,ovOnly:!1},activityFilter:"active",globalFilter:{query:null,savedSearchesUris:[],isMuted:!0},searchProviderData:null,searchNavigationData:null},Ov=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Tv,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Gb:return bv({},e,{searchResults:t.payload});case qb:{const r=(0,A.pick)(["value","isRawFilter"],t.payload||{});return bv({},e,{keyword:(0,A.isEmpty)(r)?null:r})}case Zb:return bv({},Tv,{keyword:(0,A.isNil)(t.payload.keyword)||(0,A.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 $b:return bv({},e,{activityFilter:t.payload});case Kb:return bv({},e,{globalFilter:(0,T.isEmptyValue)(t.payload)?Tv.globalFilter:t.payload});case Xb:return bv({},e,{searchOptions:bv({},e.searchOptions,t.payload)});case Qb:{const r=!!t.payload.showSearchByOv;return bv({},e,{searchOptions:{searchByOv:r,ovOnly:r}})}case Jb:return bv({},e,{searchProviderData:t.payload});case ev:return bv({},e,{searchNavigationData:t.payload});case tv:return bv({},e,{searchNavigationData:bv({},e.searchNavigationData,t.payload)});case Eb.OPEN_ENTITY:{var r;const n=(0,T.removeDtssPrefixFromEntityUri)(t.payload.uri);return"navigation"===t.payload.source||n===(null===(r=e.searchNavigationData)||void 0===r?void 0:r.uri)?e:bv({},e,{searchNavigationData:null})}default:return e}},xv=e=>{let{uri:t,source:r=null,screen:n="profile"}=e;return{type:Eb.OPEN_ENTITY,payload:{uri:t,source:r,screen:n}}},Cv=e=>{let{entity:t}=e;return{type:Eb.NEW_ENTITY_SHOWN,payload:{entity:t}}},Sv=pb(Eb.ENTITY_DELETION_FINISHED),wv=pb(Eb.OPEN_PERSPECTIVE),Av=e=>({type:Eb.SHOW_NOTIFICATION,payload:e}),Rv=e=>({type:Eb.CLOSE_NOTIFICATION,payload:e}),_v=pb(Eb.CLEAR_NOTIFICATIONS),Iv=pb(Eb.PATHS_SET),Nv=pb(Eb.UI_PATH_SET),Dv=pb(Eb.UI_CONFIG_LOADED),Pv=pb(Eb.NEW_UI_CONFIG_LOADED),kv=pb(Eb.LOCALE_ATTRIBUTE_PRESENTATION_LOADED),Lv=pb(Eb.AUTOCLOSE_INTERVAL_LOADED),Uv=pb(Eb.SET_PREFER_REACT),jv=pb(Eb.NUMBER_FORMAT_UPDATED),Fv=(e,t,r)=>({type:Eb.OPEN_CONSOLE_APP,payload:{name:e,path:t,query:r}}),Mv=pb(Eb.OPEN_APP_FROM_CHOCOLATE_BAR),Vv=pb(Eb.OPEN_GRAPH),Bv=pb(Eb.LOCALIZATION_LOADED),zv=pb(Eb.DATE_MASK_UPDATED),Hv=pb(Eb.DATE_TIME_MASK_UPDATED),Yv=e=>({type:Eb.OPEN_SEARCH,payload:"searchState"in e?e:{searchState:e}}),Wv=e=>({type:Eb.OPEN_DASHBOARD,payload:e}),Gv=pb(Eb.OPEN_HISTORY_EVENT),qv=pb(Eb.OPEN_NEW_ENTITY_WITH_AUTHORING),Zv=pb(Eb.OPEN_PREVIOUS_PAGE),$v=pb(Eb.NAVIGATE),Kv=pb(Eb.KEYS_SET),Xv=pb(Eb.OPEN_PIVOTING_PERSPECTIVE),Qv=pb(Eb.ERROR_SET),Jv=pb(Eb.DOCUMENTATION_SET),eT=pb(Eb.ADD_DASHBOARD_EXTERNAL_VIEW),tT=pb(Eb.SET_USE_SHARED_PREFERENCES);function rT(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){nT(e,t,r[t])}))}return e}function nT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const aT=(0,A.path)(["paths","imagePath"]),oT=(0,A.path)(["paths","exportPath"]),iT=(0,A.path)(["paths","apiPath"]),lT=(0,A.path)(["paths","uiPath"]),sT=(0,A.path)(["paths","reltioPath"]),cT=(0,A.path)(["paths","dtssPath"]),uT=(0,A.path)(["paths","exportDQPath"]),pT=(0,A.either)((0,A.path)(["newConfig","properties","workflow","path"]),(0,A.path)(["paths","workflowPath"])),dT=(0,A.prop)("paths"),mT=(0,A.path)(["paths","workflowEnvironmentURL"]),yT=(0,A.path)(["paths","collaborationPath"]),gT=(0,A.path)(["paths","imageServicePath"]),fT=(0,A.path)(["paths","dvfPath"]),hT=(0,A.path)(["paths","validationServicePath"]),ET=(0,A.path)(["paths","adminToolsPath"]),bT=(0,A.path)(["paths","mlDqPath"]),vT=(0,Nc.createSelector)((e=>(0,A.path)(["newConfig","properties","attributes","presentation"])(e)),(()=>T.intl.getLocale()),(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return rT({},e,(0,T.getSpecialAttributesPresentation)(e,t))})),TT=(0,A.either)((0,A.path)(["config","com.reltio.plugins.entity.EntityRequestSettings","defaultMaxValues"]),(0,A.path)(["newConfig","properties","entity","maxValuesInResponse"])),OT=(0,A.path)(["numberFormat"]),xT=(0,A.either)((0,A.path)(["newConfig","properties","masks","dateMask"]),(0,A.path)(["dateMask"])),CT=(0,A.path)(["notifications"]),ST=(0,A.either)((0,A.path)(["newConfig","properties","masks","dateTimeMask"]),(0,A.path)(["dateTimeMask"])),wT=(0,A.path)(["newConfig","properties","requestProvider"]),AT=["config","com.reltio.plugins.pivoting.PivotingSettings","pivotingAttributes"],RT=(0,A.chain)((0,A.prop)("attributeTypes")),_T=(0,A.ifElse)((0,A.hasPath)(AT),(0,A.path)(AT),(0,A.pipe)((0,A.pathOr)([],["newConfig","pivoting"]),RT)),IT=(0,A.either)((0,A.path)(["config","com.reltio.plugins.imageattribute.fieldsorder"]),(0,A.path)(["newConfig","properties","image","attributeFieldsOrder"])),NT=(0,A.either)((0,A.path)(["config","com.reltio.plugins.ui.LookupAutocomplete"]),(0,A.path)(["newConfig","properties","lookups","autocomplete"])),DT=(0,A.path)(["keys","googleMapKey"]),PT=(0,A.path)(["keys","icpLicenseKey"]),kT=(0,A.pathOr)("",["documentation","releaseNotes"]),LT=["config","com.reltio.plugins.entity.ValidationServiceLevels","levels"],UT=(0,A.ifElse)((0,A.hasPath)(LT),(0,A.path)(LT),(0,A.path)(["newConfig","properties","validation","levels"])),jT=(0,A.ifElse)((0,A.hasPath)(["config","com.reltio.plugins.entity.Validation","validateReadMode"]),(0,A.path)(["config","com.reltio.plugins.entity.Validation","validateReadMode"]),(0,A.pathOr)(!0,["newConfig","properties","validation","validateReadMode"])),FT=(0,A.pathOr)(!1,["newConfig","properties","validation","validateRelations"]),MT=(0,A.pathOr)(!1,["newConfig","properties","validation","validateReferenceEntityInReadMode"]),VT=(0,A.either)((0,A.path)(["config","com.reltio.plugins.workflow.configuration","enabled"]),(0,A.path)(["newConfig","properties","workflow","enabled"])),BT=(0,A.path)(["error"]),zT=(0,A.path)(["paths","servicesPath"]),HT=(0,A.path)(["newConfig"]),YT=(0,A.path)(["newConfig","layout"]),WT=(0,A.path)(["newConfig","profile"]),GT=(0,A.pathOr)(!0,["newConfig","properties","showEntityId"]),qT=(0,A.path)(["newConfig","properties","release"]),ZT=(0,A.path)(["newConfig","properties","logo"]),$T=(0,A.path)(["newConfig","properties","headerColor"]),KT=(0,A.path)(["newConfig","properties","showSearchByOv"]),XT=(0,A.path)(["newConfig","properties","showAttributeDescription"]),QT=(0,A.path)(["newConfig","properties","attributes","sorting"]),JT=(0,A.path)(["newConfig","properties","profileCheckUpdate"]),eO=(0,A.pathOr)(!1,["newConfig","properties","aiAssistant","enabled"]),tO=(0,A.pathOr)(500,["newConfig","properties","aiAssistant","messagesPerDay"]),rO=(0,A.path)(["newConfig","properties","aiAssistant","skills"]),nO=(0,A.path)(["newConfig","properties","aiAssistant","historyBufferSize"]),aO=(0,A.pathOr)(!1,["newConfig","properties","queryEstimator","enabled"]),oO=(0,A.pathOr)(!1,["newConfig","properties","sharedPreferences","enabled"]);function iO(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){lO(e,t,r[t])}))}return e}function lO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sO={},cO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:sO,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Eb.PATHS_SET:return iO({},e,{paths:t.payload});case Eb.UI_PATH_SET:return(0,A.evolve)({paths:(0,A.assoc)("uiPath",t.payload)},e);case Eb.UI_CONFIG_LOADED:return iO({},e,{config:t.payload});case Eb.NEW_UI_CONFIG_LOADED:return iO({},e,{newConfig:t.payload});case Eb.LOCALE_ATTRIBUTE_PRESENTATION_LOADED:return(0,A.evolve)({newConfig:{properties:{attributes:{presentation:(0,A.assoc)(T.LOCALE_ATTRIBUTE_PRESENTATION,t.payload)}}}},e);case Eb.AUTOCLOSE_INTERVAL_LOADED:return iO({},e,{autoCloseInterval:t.payload});case Eb.NUMBER_FORMAT_UPDATED:return iO({},e,{numberFormat:t.payload});case Eb.DATE_MASK_UPDATED:return iO({},e,{dateMask:t.payload});case Eb.DATE_TIME_MASK_UPDATED:return iO({},e,{dateTimeMask:t.payload});case Eb.KEYS_SET:return iO({},e,{keys:t.payload});case Eb.ERROR_SET:return iO({},e,{error:t.payload});case Eb.DOCUMENTATION_SET:return iO({},e,{documentation:t.payload});case Eb.SHOW_NOTIFICATION:return iO({},e,{notifications:[...e.notifications||[],t.payload]});case Eb.CLOSE_NOTIFICATION:return(0,A.evolve)({notifications:(0,A.reject)((0,A.propEq)("id",t.payload))},e);case Eb.CLEAR_NOTIFICATIONS:return iO({},e,{notifications:[]});case Eb.SET_USE_SHARED_PREFERENCES:return iO({},e,{useSharedPreferences:t.payload});default:return e}},uO="USER_UPDATED",pO=(pb(uO),null),dO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pO,t=arguments.length>1?arguments[1]:void 0;return t.type===uO?t.payload||pO:e},mO="TENANT_UPDATED",yO="TENANT_NAME_UPDATED",gO=(pb(mO),pb(yO),(0,A.prop)("id")),fO=(0,A.prop)("name");function hO(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){EO(e,t,r[t])}))}return e}function EO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bO=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 mO:return hO({},e,{id:t.payload});case yO:return hO({},e,{name:t.payload});default:return e}},vO="ENVIRONMENT_UPDATED",TO="ENVIRONMENT_ALIAS_UPDATED",OO=(pb(vO),pb(TO),(0,A.prop)("id")),xO=(0,A.prop)("alias");function CO(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 wO=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 vO:return CO({},e,{id:t.payload});case TO:return CO({},e,{alias:t.payload});default:return e}},AO=e=>e.dataTenants,RO=e=>e.tenants,_O=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bC(e);return e.metadata&&e.metadata[t]},IO=e=>e.tenant,NO=e=>e.environment,DO=e=>e.user,PO=e=>e.ui,kO=e=>e.profile,LO=e=>e.search,UO=e=>fR(kO(e)),jO=e=>_R(kO(e)),FO=e=>IR(kO(e)),MO=(e,t)=>FR(kO(e),t),VO=(e,t,r)=>LR(kO(e),t,r),BO=(e,t,r)=>UR(kO(e),t,r),zO=(e,t,r)=>kR(kO(e),t,r),HO=(e,t)=>MR(kO(e),t),YO=e=>VR(kO(e)),WO=(e,t,r)=>jR(kO(e),t,r),GO=e=>TR(kO(e)),qO=e=>ER(kO(e)),ZO=e=>PR(kO(e)),$O=e=>p_(kO(e)),KO=e=>d_(kO(e)),XO=e=>m_(kO(e)),QO=e=>y_(kO(e)),JO=e=>g_(kO(e)),ex=(e,t)=>NR(kO(e),t),tx=(e,t)=>DR(kO(e),t),rx=e=>hR(kO(e)),nx=(e,t)=>f_(kO(e),t),ax=(e,t,r)=>{let{uri:n}=r;return XR(kO(e),t,n)},ox=(e,t,r)=>{let{uri:n}=r;return QR(kO(e),t,n)},ix=(e,t,r)=>JR(kO(e),t,r),lx=e=>aT(PO(e)),sx=e=>iT(PO(e)),cx=e=>oT(PO(e)),ux=e=>lT(PO(e)),px=e=>sT(PO(e)),dx=e=>gT(PO(e)),mx=e=>ET(PO(e)),yx=e=>vT(PO(e)),gx=e=>OT(PO(e)),fx=e=>TT(PO(e)),hx=e=>(e=>e.autoCloseInterval)(PO(e)),Ex=e=>xT(PO(e)),bx=e=>ST(PO(e)),vx=e=>wT(PO(e)),Tx=e=>CT(PO(e)),Ox=e=>_T(PO(e)),xx=e=>IT(PO(e)),Cx=e=>NT(PO(e)),Sx=e=>DT(PO(e)),wx=e=>PT(PO(e)),Ax=e=>UT(PO(e)),Rx=e=>jT(PO(e)),_x=e=>FT(PO(e)),Ix=e=>MT(PO(e)),Nx=e=>eO(PO(e)),Dx=e=>tO(PO(e)),Px=e=>rO(PO(e)),kx=e=>nO(PO(e)),Lx=e=>oO(PO(e)),Ux=e=>(e=>e.searchResults)(LO(e)),jx=e=>(e=>e.keyword)(LO(e)),Fx=e=>T.getActivityFilter(LO(e)),Mx=e=>T.getSearchOptions(LO(e)),Vx=e=>(e=>e.searchProviderData)(LO(e)),Bx=e=>(e=>e.searchNavigationData)(LO(e)),zx=(e,t)=>T.getGlobalSearchRequestOptions(LO(e),t),Hx=e=>T.getStringifiedSearchOptions(LO(e)),Yx=e=>(e=>e.globalFilter)(LO(e)),Wx=e=>T.getGlobalFilterQuery(LO(e)),Gx=e=>yv(LO(e)),qx=e=>xR(kO(e)),Zx=e=>BR(kO(e)),$x=e=>zR(kO(e)),Kx=e=>HR(kO(e)),Xx=e=>bR(kO(e)),Qx=(e,t)=>YR(kO(e),t),Jx=(e,t)=>WR(kO(e),t),eC=(e,t)=>GR(kO(e),t),tC=(e,t,r)=>qR(kO(e),t,r),rC=(e,t,r)=>ZR(kO(e),t,r),nC=(e,t,r)=>$R(kO(e),t,r),aC=(e,t)=>KR(kO(e),t),oC=e=>aT(PO(e))||iT(PO(e)),iC=e=>(e=>null==e?void 0:e.username)(DO(e)),lC=e=>(e=>null==e?void 0:e.roles)(DO(e)),sC=e=>vR(kO(e)),cC=(e,t)=>e_(kO(e),t),uC=(e,t)=>t_(kO(e),t),pC=(e,t)=>r_(kO(e),t),dC=e=>n_(kO(e)),mC=(e,t,r)=>a_(kO(e),t,r),yC=(e,t)=>o_(kO(e),t),gC=e=>CR(kO(e)),fC=e=>wR(kO(e)),hC=e=>AR(kO(e)),EC=e=>T_(kO(e),BS(e)),bC=e=>gO(IO(e)),vC=e=>fO(IO(e)),TC=e=>OO(NO(e)),OC=e=>xO(NO(e)),xC=e=>cT(PO(e)),CC=e=>uT(PO(e)),SC=e=>pT(PO(e)),wC=e=>dT(PO(e)),AC=e=>mT(PO(e)),RC=e=>VT(PO(e)),_C=e=>yT(PO(e)),IC=e=>fT(PO(e)),NC=e=>hT(PO(e)),DC=e=>bT(PO(e)),PC=(0,Nc.createSelector)(DO,bC,T.canUserRegisterConfigEnvironments),kC=(0,Nc.createSelector)(DO,bC,T.canUserCreateWorkflowConfigJar),LC=(0,Nc.createSelector)(DO,bC,T.canUserCreateWorkflowEnvironmentConfigJar),UC=(0,Nc.createSelector)(DO,bC,T.canUserExecuteWorkflowJobs),jC=(0,Nc.createSelector)(DO,bC,T.canUserExecuteWorkflowJobsSyncBusinessProcessData),FC=(0,Nc.createSelector)(DO,bC,T.canUserExecuteWorkflowJobsTerminateProcessInstance),MC=(0,Nc.createSelector)(DO,bC,T.canUserExecuteWorkflowJobsUpdateTasks),VC=(0,Nc.createSelector)(DO,bC,T.canUserExecuteWorkflowJobsValidateTasks),BC=(0,Nc.createSelector)(DO,bC,T.canUserManageWorkflowDefinition),zC=(0,Nc.createSelector)(DO,bC,T.canUserManageWorkflowEnvironmentDefinition),HC=(0,Nc.createSelector)(DO,bC,T.canUserReadWorkflowDataTask),YC=(0,Nc.createSelector)(DO,bC,T.canUserUpdateProcessInstance),WC=(0,Nc.createSelector)(DO,bC,T.canUserUpdateWorkflowDataTask),GC=(0,Nc.createSelector)(DO,bC,T.canUserViewProcessInstanceSearchQuery),qC=(0,Nc.createSelector)(DO,bC,T.canUserViewWorkflowConfigJar),ZC=(0,Nc.createSelector)(DO,bC,T.canUserViewWorkflowDefinition),$C=(0,Nc.createSelector)(DO,bC,T.canUserViewWorkflowEnvironmentConfigJar),KC=(0,Nc.createSelector)(DO,bC,T.canUserViewWorkflowJobs),XC=(0,Nc.createSelector)(DO,bC,T.canUserMakeExport),QC=(0,Nc.createSelector)(DO,bC,T.canUserMakeActivitiesExport),JC=(0,Nc.createSelector)(DO,bC,T.canUserImportEntitiesFromDT),eS=(0,Nc.createSelector)(DO,bC,T.canUserReadEntitiesFromDT),tS=(0,Nc.createSelector)(DO,bC,T.canUserStartProcessInstanceFromQuery),rS=(0,Nc.createSelector)(DO,bC,T.canUserMakeBulkUpdate),nS=(0,Nc.createSelector)(DO,bC,T.canUserDeleteProfiles),aS=(0,Nc.createSelector)(DO,bC,T.canUserOpenDataLoader),oS=(0,Nc.createSelector)(DO,bC,T.canUserGetDQStatistic),iS=(0,Nc.createSelector)(DO,bC,T.canUserReadDVF),lS=(0,Nc.createSelector)(_C,QO,((e,t)=>!!e&&!t)),sS=(0,Nc.createSelector)(SC,RC,((e,t)=>!!e&&!!t)),cS=(e,t)=>{var r;return null===(r=RR(kO(e)))||void 0===r?void 0:r.find((0,A.propEq)("id",t))},uS=(e,t)=>Boolean(cS(e,t)),pS=e=>uS(e,T.SidePanelViewId.Workflow),dS=e=>uS(e,T.SidePanelViewId.Discussion),mS=e=>uS(e,T.SidePanelViewId.History),yS=e=>uS(e,T.SidePanelViewId.DB),gS=e=>{var t,r;return null!==(t=null===(r=cS(e,T.SidePanelViewId.DB))||void 0===r?void 0:r.views)&&void 0!==t?t:[]},fS=e=>OR(kO(e)),hS=e=>i_(kO(e)),ES=(e,t)=>l_(kO(e),t),bS=e=>s_(kO(e)),vS=e=>c_(kO(e)),TS=(e,t)=>u_(kO(e),t),OS=e=>BT(PO(e)),xS=(e,t)=>{const r=_O(e),n=qx(e),a=UO(e),{nextEntry:o,inRelations:i=[],outRelations:l=[]}=t,s=n===T.Mode.Editing||n===T.Mode.Suggesting,c=n===T.Mode.Suggesting&&(0,T.isTempUri)(null==a?void 0:a.uri),u=BS(e);if(!s||c&&!u||o||!a)return!1;{const e=(0,T.checkMetadataForUpdate)(n,(0,T.getEntityType)(r,a.type)),t=i.concat(l).map((e=>(0,T.getRelationType)(r,e.uri||e))).some((0,A.both)((0,T.checkMetadataForCreate)(n),(0,T.checkMetadataForUpdate)(n)));return e&&t}},CS=(0,Nc.createSelector)(UO,$x,XO,$O,T.getProfileEntityWithHistoryDiff),SS=(0,Nc.createSelector)(UO,$x,XO,T.getProfileEntityWithoutHistoryDiff),wS=e=>zT(PO(e)),AS=e=>HT(PO(e)),RS=e=>YT(PO(e)),_S=e=>WT(PO(e)),IS=e=>GT(PO(e)),NS=e=>qT(PO(e)),DS=e=>kT(PO(e)),PS=e=>ZT(PO(e)),kS=e=>$T(PO(e)),LS=e=>KT(PO(e)),US=e=>XT(PO(e)),jS=e=>QT(PO(e)),FS=e=>JT(PO(e)),MS=(e,t)=>((e,t)=>(0,T.getAuthoringItemsFromLayoutByEntityType)(WT(e),t))(PO(e),t),VS=(e,t)=>((e,t)=>(0,A.path)(["newConfig","properties","cleanse",t])(e))(PO(e),t),BS=e=>{const t=UO(e),r=MS(e,null==t?void 0:t.type);return!(0,T.isEmptyValue)(r)},zS=e=>aO(PO(e));let HS=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}({}),YS=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 WS=r(51095);const GS=(e,t)=>e.find((0,A.pipe)(T.getRelationUriFromConnection,(0,A.equals)(t))),qS=(e,t)=>(0,A.path)([t,"connections"],e),ZS=r.n(WS)()(qS,((e,t)=>(0,A.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,A.pipe)(T.getRelationUriFromConnection,A.equals,(0,A.find)(A.__,i)),c=l.map((e=>e.relationUri)),u=(0,A.pipe)(T.getRelationUriFromConnection,A.equals,(0,A.find)(A.__,c)),p=e=>(0,A.pipe)((0,A.eqBy)(T.getRelationUriFromConnection),(0,A.find)(A.__,o),(0,A.unless)(A.isNil,T.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,A.propEq)("parentEntityUri",n));return m.map(T.markNew).concat(d.filter((e=>!m.some((0,A.pipe)(T.getRelationUriFromConnection,(0,A.equals)((0,T.getRelationUriFromConnection)(e)))))).map((0,A.pipe)((0,A.either)(p,A.identity),(0,A.when)(s,T.markRemoved),(0,A.when)(u,T.markIgnored))))}))(((e,t,r)=>t+r)),$S=(e,t,r)=>{const n=(0,T.getTempRelations)(e,t);return GS(n,r)};function*KS(e){yield(0,ja.gw)(0);const t=e.payload,r=yield(0,ja.Ys)(_O),n=yield(0,ja.Ys)(hS),a=[t.type],o=yield(0,ja.Ys)(bS),i=(0,T.initDependentLookups)({structure:n,metadata:r,typeUris:a,alreadyAddedTypeUris:o}),l=(0,T.populateDependentLookupsFromEntity)({structure:i,metadata:r,entityOrRelation:t});yield(0,ja.gz)(Fb(l)),yield(0,ja.gz)(Mb(a))}function*XS(e,t){const r=(0,T.getBaseUri)(e);return(0,T.isRelationUri)(r)?yield(0,ja.Ys)(BO,t,r):yield(0,ja.Ys)(ex,r)}function*QS(e){const{attributeType:t,metadata:r,parentUri:n,viewId:a}=e.payload,o=yield(0,ja.RE)(XS,n,a),i=yield(0,ja.Ys)(hS);if(o)if(t){const e=(0,T.findAttributeValuesByTypeUri)(r,o,t.uri).filter((e=>{let{uri:t}=e;return t.startsWith(n)}))[0],a=(0,T.addValueToDependentLookups)({structure:i,attributeValue:e});yield(0,ja.gz)(Fb(a))}else{const e=[o.type],t=yield(0,ja.Ys)(bS),n=(0,T.initDependentLookups)({structure:i,metadata:r,typeUris:e,alreadyAddedTypeUris:t}),a=(0,T.populateDependentLookupsFromEntity)({structure:n,metadata:r,entityOrRelation:o});yield(0,ja.gz)(Fb(a)),yield(0,ja.gz)(Mb(e))}}function*JS(e){const t=e.payload,r=yield(0,ja.Ys)(_O),n=yield(0,ja.Ys)(hS);let a=n;for(const e of t){const{attributeType:t,parentUri:o,viewId:i}=e;if((0,T.isAttributeTypeInDependentLookups)(n,t.uri)){const e=yield(0,ja.RE)(XS,o,i);e&&(a=(0,T.syncAttributeTypeWithDependentLookups)({structure:a,entityOrRelation:e,attrTypeUri:t.uri,metadata:r}))}}a!==n&&(yield(0,ja.gz)(Fb(a)))}function*ew(e){let{structure:t,attributeType:r,value:n}=e;if((0,T.isReference)(r)&&n){const e=(0,T.getReferencedEntityUriFromAttrValue)(n);if((0,T.isTempUri)(e))return yield(0,ja.RE)(aw,t,e)}return t}function*tw(e){let{structure:t,uri:r,attributeType:n,value:a}=e,o=(0,T.removeValuesFromDependentLookups)({structure:t,uri:r});if(o=yield(0,ja.RE)(ew,{structure:o,attributeType:n,value:a}),o=(0,T.addValueToDependentLookups)({structure:o,attributeValue:a}),(0,T.isReference)(n)&&a){const e=(0,T.getReferencedEntityUriFromAttrValue)(a);(0,T.isTempUri)(e)&&(o=yield(0,ja.RE)(nw,o,e))}o!==t&&(yield(0,ja.gz)(Fb(o)))}function*rw(e){yield(0,ja.gw)(0);const{attributeType:t,uri:r,viewId:n,silent:a,value:o}=e.payload,i=yield(0,ja.Ys)(hS),l=yield(0,ja.RE)(XS,r,n);if(l&&(0,T.isAttributeTypeInDependentLookups)(i,t.uri)){const{value:n,lookupCode:o}=e.payload.value,l=o||n;a||(yield(0,ja.rM)(lw,i,{type:t.uri,uri:r,lookupValue:l}));const s=(0,T.addValueToDependentLookups)({structure:i,attributeValue:{type:t.uri,value:l,uri:r}});yield(0,ja.gz)(Fb(s))}l&&(0,T.isComplexAttribute)(t.type)&&(yield(0,ja.RE)(tw,{structure:i,uri:r,attributeType:t,value:o}))}function*nw(e,t){const r=yield(0,ja.Ys)(_O),n=yield(0,ja.Ys)(ex,t);if(!n)return e;const a=yield(0,ja.Ys)(rx),o=(0,T.findRelatedTemporaryEntities)(a,n);let i=e;for(const e of[n,...o])i=(0,T.populateDependentLookupsFromEntity)({structure:i,metadata:r,entityOrRelation:e});return i}function*aw(e,t){const r=yield(0,ja.Ys)(ex,t),n=yield(0,ja.Ys)(rx),a=(0,T.findRelatedTemporaryEntities)(n,r).map((0,A.prop)("uri"));let o=e;for(const e of[t,...a])o=(0,T.removeValuesFromDependentLookups)({structure:o,uri:e});return o}function*ow(e){const{attributeType:t,uri:r,attributeValue:n,viewId:a}=e.payload,o=yield(0,ja.Ys)(hS),i=(0,T.isAttributeTypeInDependentLookups)(o,t.uri);if(yield(0,ja.RE)(XS,r,a)){i&&(yield(0,ja.rM)(lw,o,{type:t.uri,uri:r,lookupValue:""}));let e=i||(0,T.isComplexAttribute)(t)?(0,T.removeValuesFromDependentLookups)({structure:o,uri:r}):o;e=yield(0,ja.RE)(ew,{structure:e,attributeType:t,value:n}),e!==o&&(yield(0,ja.gz)(Fb(e)))}}function*iw(e){yield(0,ja.gw)(0);const t=yield(0,ja.Ys)(hS),r=yield(0,ja.RE)(aw,t,e.payload);yield(0,ja.gz)(Fb(r))}function*lw(e,t){const r=yield(0,ja.Ys)(_O),n=yield(0,ja.Ys)(rx),a=yield(0,ja.Ys)(eC),o=yield(0,ja.Ys)(jO),i=yield(0,ja.Ys)(Cx),l=yield(0,ja.Ys)(vS),s=(0,T.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,ja.gz)(Vb({uris:e,isBlocked:!0}));try{const e=yield(0,ja.RE)(T.cascadeUpdate,s,t);for(const n of e){const{type:e,uri:a,lookupValue:o,displayName:i}=n,l=(yield(0,ja.Ys)(aC,(0,T.getBaseUri)(a)))[0],s=yield(0,ja.RE)(XS,a,l);s&&(0,T.findAttributeValueByUri)(s,a)&&a!==t.uri&&(yield(0,ja.gz)(Rb({attributeType:(0,T.findAttributeTypeByUri)(r,e),uri:a,value:{value:i||"",lookupCode:o||""},silent:!0,viewId:l})))}}catch(e){console.warn(e)}yield(0,ja.gz)(Vb({uris:e,isBlocked:!1}))}}function*sw(e){const t=e.payload.connection,r=(0,T.getEntityUriFromConnection)(t);if((0,T.isTempUri)(r)&&(yield(0,ja.Ys)(ex,r))){yield(0,ja.qn)(jb.DEPENDENT_LOOKUPS_STRUCTURE_SET);const e=yield(0,ja.Ys)(hS),t=yield(0,ja.RE)(nw,e,r);yield(0,ja.gz)(Fb(t))}}function*cw(e){const t=e.payload.relationUri,r=yield(0,ja.Ys)(hS),n=(0,T.removeValuesFromDependentLookups)({structure:r,uri:t});yield(0,ja.gz)(Fb(n))}function*uw(e){const t=e.payload.id,r=e.payload.relationUri;if(0===(yield(0,ja.Ys)(aC,r)).length){const e=yield(0,ja.Ys)(hS);let n=(0,T.removeValuesFromDependentLookups)({structure:e,uri:r});const a=yield(0,ja.Ys)(zO,t),o=GS(a,r),i=(0,T.getEntityUriFromConnection)(o);(0,T.isTempUri)(i)&&(n=yield(0,ja.RE)(aw,n,i)),yield(0,ja.gz)(Fb(n))}}const pw=[function*(){yield(0,ja.ib)(HS.MODIFIED_ENTITY_CREATED,KS)},function*(){yield(0,ja.ib)(HS.MODIFIED_ENTITY_DELETED,iw)},function*(){yield(0,ja.ib)(Sb.ADD_DEFAULT_VALUES,QS)},function*(){yield(0,ja.ib)(Sb.ADD_ATTRIBUTES,JS)},function*(){yield(0,ja.ib)(Sb.MODIFY_ATTRIBUTE,rw)},function*(){yield(0,ja.ib)(Sb.REMOVE_ATTRIBUTE,ow)},function*(){yield(0,ja.ib)(YS.OPEN_RELATION_EDITOR,sw)},function*(){yield(0,ja.ib)(YS.SET_RELATION_TYPE,cw)},function*(){yield(0,ja.ib)(YS.CLOSE_RELATION_EDITOR,uw)}];let dw=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 mw=(e,t)=>({type:dw.ENTITY_LOADED,payload:{entity:e,keepErrors:t}}),yw=pb(dw.DEFAULT_PROFILE_PIC_SET),gw=pb(dw.LOAD_ENTITY),fw=pb(dw.ENTITY_CREATION_REQUESTED),hw=pb(dw.ENTITY_CREATION_WITH_AUTHORING_REQUESTED),Ew=pb(dw.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED),bw=pb(dw.ENTITY_REMOVE_REQUESTED),vw=pb(dw.CLONE_ENTITY),Tw=pb(dw.CLEAR_ENTITY),Ow=e=>null==e?void 0:e.uri,xw=(0,Nc.createSelector)((e=>null==e?void 0:e.dataTenant),Ow,((e,t)=>(0,T.getEntityUriForLink)({dataTenant:e,uri:t})));function Cw(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){Sw(e,t,r[t])}))}return e}function Sw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ww={};let Aw=function(e){return e.ERRORS_SET="ERRORS_SET",e.REMOVE_ERROR="REMOVE_ERROR",e.ERROR_DEACTIVATED="ERROR_DEACTIVATED",e}({});const Rw=pb(Aw.ERROR_DEACTIVATED),_w=pb(Aw.ERRORS_SET);function Iw(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){Nw(e,t,r[t])}))}return e}function Nw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Dw=[];let Pw=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 kw=pb(Pw.HISTORY_DIFF_SET),Lw=pb(Pw.HISTORY_DIFF_CLEARED),Uw=pb(Pw.HISTORY_EVENT_SET),jw=pb(Pw.HISTORY_EVENT_CLEARED),Fw=pb(Pw.HISTORY_SLICE_SET),Mw=pb(Pw.HISTORY_MODE_SET);function Vw(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){Bw(e,t,r[t])}))}return e}function Bw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zw={mode:T.HistoryMode.Current};let Hw=function(e){return e.PROFILE_LAST_LOADED_TIME_UPDATE="PROFILE_LAST_LOADED_TIME_UPDATE",e}({});pb(Hw.PROFILE_LAST_LOADED_TIME_UPDATE);let Yw=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 Ww=pb(Yw.LOOKUPS_LOADED),Gw=pb(Yw.LOOKUPS_FOR_TYPE_RESOLVED),qw=pb(Yw.LOOKUPS_LIST_RESOLVED);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){$w(e,t,r[t])}))}return e}function $w(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={},Xw=(e,t)=>({type:zb.MODE_UPDATED,payload:{mode:e,silent:t}}),Qw=pb(zb.MODE_CANCEL_EDITING),Jw=pb(zb.MODE_EDITING_CANCELED),eA=T.isSuggestMode,tA=(T.isEditMode,T.isViewMode),rA=T.isEditableMode,nA=T.Mode.Viewing,aA=pb(HS.MODIFIED_ENTITY_CREATED),oA=pb(HS.MODIFIED_ENTITY_DELETED),iA=pb(HS.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET),lA=pb(HS.MODIFIED_ENTITIES_RESET),sA=pb(HS.CLEANSE_LOADING);function cA(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){uA(e,t,r[t])}))}return e}function uA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pA={};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){mA(e,t,r[t])}))}return e}function mA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*yA(e){const{values:t,parentUri:r,attributeTypeUri:n,attributeTypeName:a}=e.payload;let o=t;const i=yield(0,ja.Ys)(UO);if(r===i.uri){const e=(0,T.getAttributeSource)(n),r=(0,A.pipe)((0,A.pathOr)([],[e,a]),(0,A.map)((0,A.prop)("uri")))(i),l=(0,A.intersection)(r,t.map((0,A.prop)("uri")));o=t.filter((e=>!l.includes(e.uri)))}o.length&&(yield(0,ja.gz)(Ib(dA({},e.payload,{values:o}))))}function*gA(){return{apiPath:yield(0,ja.Ys)(sx),tenant:yield(0,ja.Ys)(bC)}}function*fA(e){const{attributeTypeName:t,attributeTypeUri:r}=e.payload,n=yield(0,ja.RE)(gA);try{const a=yield(0,ja.RE)(T.getPagedEntity,dA({},e.payload,n)),o=(0,T.getAttributeSource)(r),i=(0,A.pathOr)([],[o,t],a);yield(0,ja.gz)(Nb(dA({},e.payload,{values:i})))}catch(e){console.warn(e),yield(0,ja.gz)(Qv((0,T.getRequestErrorMessage)(e,uo().text("Something went wrong"))))}}function*hA(e){var t;const{attributeType:r,value:n,uri:a}=e.payload,o=r.uri,i=(0,T.getBaseUri)(o),l=yield(0,ja.Ys)(VS,i);if(!l)return;const s=yield(0,ja.Ys)(_O),c=(0,T.getEntityType)(s,i),u=null==c||null===(t=c.cleanseConfig)||void 0===t?void 0:t.infos;if(!u)return;const p=(0,T.getCleanseType)(l,o);if(!(0,T.hasCleanseTypeInEntityType)(p,u))return;const d=(0,T.getCleanseAttributes)(l);if(null!=d&&d.includes(o)){yield(0,ja.gz)(sA({isLoading:!0}));try{const e=yield(0,ja.RE)(T.cleanseData,{cleanseType:p.split("/cleanse/infos/")[1],type:i,attributes:{[r.name]:[{type:o,value:n}]}}),t=(0,T.getBaseUri)(a),l=yield(0,ja.Ys)(ex,t);if((0,T.hasCleanseStatus)(e))if((0,T.isUnverifiedCleanse)(e))yield(0,ja.gz)(Qv((0,A.path)(T.CLEANSE_STATUS_ERROR_PATH,e)));else if(l){const{attributes:r}=e,n=(0,T.prepareCleansedAttributes)(t,r);yield(0,ja.gz)(aA(dA({},l,{attributes:dA({},l.attributes,n)})))}}catch(e){console.warn(e),yield(0,ja.gz)(Qv((0,T.getRequestErrorMessage)(e,uo().text("Something went wrong"))))}yield(0,ja.gz)(sA({isLoading:!1}))}}const EA=[function*(){yield(0,ja.ib)(Sb.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES,fA)},function*(){yield(0,ja.ib)(Sb.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES,yA)},function*(){yield(0,ja.ib)(Sb.MODIFY_ATTRIBUTE,hA)}],bA=pb(YS.RELATIONS_LOADED),vA=pb(YS.SECOND_LEVEL_RELATIONS_LOADED),TA=(0,A.curry)(((e,t)=>({type:YS.REMOVE_RELATION,payload:{id:e,relationUri:t}}))),OA=(0,A.curry)(((e,t)=>({type:YS.IGNORE_RELATION,payload:{id:e,ignoredRelationData:t}}))),xA=(0,A.curry)(((e,t)=>({type:YS.ADD_RELATION,payload:{id:e,connection:t}}))),CA=(0,A.curry)(((e,t)=>({type:YS.EDIT_RELATION,payload:{id:e,connection:t}}))),SA=(0,A.curry)(((e,t)=>({type:YS.OPEN_RELATION_EDITOR,payload:{id:e,connection:t}}))),wA=(0,A.curry)(((e,t)=>({type:YS.CLOSE_RELATION_EDITOR,payload:{id:e,relationUri:t}}))),AA=(0,A.curry)(((e,t,r)=>({type:YS.SET_RELATION_TYPE,payload:{id:e,relationUri:t,relationType:r}}))),RA=(0,A.curry)(((e,t,r)=>({type:YS.SET_RELATION_ENTITY,payload:{id:e,relationUri:t,entityInfo:r}}))),_A=(0,A.curry)(((e,t,r)=>({type:YS.SET_INITIAL_INFO,payload:{id:e,relationUri:t,tempEntity:r}})));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){NA(e,t,r[t])}))}return e}function NA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const DA={},PA={removedUris:[],addedConnections:[],editedConnections:[],ignoredRelationData:[]},kA=(e,t,r)=>{if((0,A.pathEq)([...(0,T.getRelationToAddPath)(e),"relation","relationUri"],t,r))return(0,T.getRelationToAddPath)(e);{const n=((0,A.path)((0,T.getRelationsToEditPath)(e),r)||[]).findIndex((0,A.pathEq)(["relation","relationUri"],t));return n>=0?[...(0,T.getRelationsToEditPath)(e),n]:null}},LA=(e,t,r)=>{const n=kA(e,t,r);return n?(0,A.lensPath)([...n,"relation"]):null},UA=(0,A.pipe)(LA,(e=>(0,A.compose)(e,(0,A.lensProp)("object"))));let jA=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}({});pb(jA.TREE_LOADED),pb(jA.TREE_LOADED_WITH_ERROR),pb(jA.TREE_LOADING),pb(jA.TREE_SCROLL_TO_NODE_RESET);const FA=pb(jA.TREE_COMMANDS_CLEARED),MA=(pb(jA.TREE_CHILDREN_LOADING),pb(jA.TREE_CURRENT_ENTITY_SHOWN),pb(jA.TREE_REFRESHED),pb(jA.TREE_NODE_EXPANDED),pb(jA.TREE_RELATION_REMOVED),pb(jA.TREE_NODE_REMOVED),pb(jA.TREE_SECONDARY_LABEL_SHOWN),pb(jA.TREE_ENTITIES_MAPPING_LOADED),pb(jA.TREE_CHANGED)),VA=(pb(jA.TREE_NODE_EDITED),pb(jA.TREE_ACTIVENESS_DATE_CHANGED),pb(jA.TREE_RELATION_REPOINTED),pb(jA.TREE_RELATION_CREATED),pb(jA.TREE_NODE_CREATED),pb(jA.TREE_RELATION_EDITED),pb(jA.TREE_NODE_EDITED),pb(jA.TREE_NODE_EDITING_STARTED),pb(jA.TREE_NODE_EDITING_APPLIED),pb(jA.TREE_NODE_EDITING_CANCELED),pb(jA.TREE_NODE_NEW_PARENT_EDITING_STARTED),pb(jA.TREE_NODE_NEW_PARENT_EDITING_APPLIED),pb(jA.TREE_NODE_NEW_PARENT_EDITING_CANCELED),pb(jA.TREE_NODE_NEW_CHILD_EDITING_STARTED),pb(jA.TREE_NODE_NEW_CHILD_EDITING_APPLIED),pb(jA.TREE_NODE_NEW_CHILD_EDITING_CANCELED),pb(jA.TREE_NODE_RELATION_TYPE_CHANGED),pb(jA.TREE_NODE_ENTITY_CHANGED),pb(jA.TREE_SORTED),pb(jA.TREES_STATE_SAVED),pb(jA.TREES_STATE_RESTORED),pb(jA.TREE_CHILDREN_LOADED),pb(jA.TREES_RESTORE_FROM_INITIAL_TREES)),BA=pb(jA.TREES_RESET_INITIAL_TREES),zA=(pb(jA.TREE_CANCEL_CHILDREN_LOADING),(0,A.path)(["common","commands"]));var HA=r(76665);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){WA(e,t,r[t])}))}return e}function WA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const GA=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if((0,A.path)(["entity","uri"],e)===t)return r.forEach((e=>e.expanded=!0)),e;if(e.children)for(const n of e.children){const a=GA(n,t,r.concat(e));if(a)return a}},qA=(e,t)=>{const r=Object.keys(e).reduce(((r,n)=>{const a=e[n];return t[n]&&(a.parent=(0,A.uniq)([].concat(a.parent).concat(t[n].parent).filter(A.identity))),r[n]=a,r}),{});return Object.keys(t).forEach((e=>{r[e]||(r[e]=t[e])})),r},ZA=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,A.reject)((0,A.prop)("loading")),n=r(e);return t.forEach((t=>{e.find((e=>(0,A.path)(["entity","uri"],e)===t.entity.uri))||n.push(t)})),n},$A=(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)}},KA=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;e&&e.children&&e.children.splice(r,0,t)},XA=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])}},QA=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=>QA(e,t,r)))},JA=e=>({entity:e.entity,relation:e.relation}),eR=e=>{let{id:t,draft:r,node:n}=e;XA({path:["editingConnections",n.relation.uri],object:r[t],value:JA(n)})},tR=e=>{let{id:t,draft:r,node:n,entity:a}=e;XA({path:["editingConnections",n.relation.uri,"entity"],object:r[t],value:a})},rR=e=>{let{id:t,draft:r,node:n,relationTypeUri:a}=e;XA({path:["editingConnections",n.relation.uri,"relation"],object:r[t],value:e=>YA({},e,{type:a,attributes:{}})})},nR=e=>{let{id:t,draft:r,relationUri:n}=e;delete r[t].editingConnections[n]},aR=e=>{let{id:t,draft:r,relationUri:n}=e;return r[t].editingConnections[n]},oR=e=>{delete e.editingMode,delete e.relatedEntity,delete e.initialConnection},iR=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,T.findParentNodeById)(a,n.nodeId);$A(e,n.nodeId)}},lR=(e,t,r)=>{const n=[e,"editingConnections",t,"relation"];return(0,A.path)(n,r)?(0,A.lensPath)(n):null},sR=(0,A.pick)(["showSecondaryLabel","sortField","sortOrder"]),cR=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return qA(e,t.reduce(((e,t)=>YA({},e,{[t.entity.uri]:(0,A.pick)(["entity","parent","relations"],t)})),{}))},uR=e=>({entity:(0,A.pick)(["uri","type","label","secondaryLabel"],e.entity),parent:[],relations:[(0,A.pick)(["uri","type"],e.relation)]});function pR(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){dR(e,t,r[t])}))}return e}function dR(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mR={common:{commands:[]},trees:{},initialTrees:{}};let yR=function(e){return e.ENTITY_RELATED_ATTRIBUTES_ADDED="ENTITY_RELATED_ATTRIBUTES_ADDED",e}({});pb(yR.ENTITY_RELATED_ATTRIBUTES_ADDED);const gR={},fR=e=>e.entity,hR=e=>e.modifiedEntities,ER=e=>e.errors,bR=e=>e.relations,vR=e=>e.trees,TR=e=>e.lookups,OR=e=>e.dependentLookups,xR=e=>e.mode,CR=e=>e.lastLoadedTime,SR=e=>e.history,wR=e=>e.operation,AR=e=>e.views,RR=e=>e.sidePanelViews,_R=e=>Ow(fR(e)),IR=e=>xw(fR(e)),NR=(e,t)=>((e,t)=>t&&e[t])(hR(e),t),DR=(e,t)=>((e,t)=>t&&e[t]&&e[t].defaultProfilePic)(hR(e),t),PR=e=>(0,A.keys)(bR(e)),kR=(e,t,r)=>ZS(bR(e),t,r),LR=(e,t,r)=>$S(bR(e),t,r),UR=(e,t,r)=>((e,t,r)=>{const n=$S(e,t,r);return(0,T.getRelationObjectFromConnection)(n)})(bR(e),t,r),jR=(e,t,r)=>((e,t,r)=>{const n=(0,A.pipe)((0,A.pathOr)([],[t,"drafts","addedConnections"]),(0,A.filter)((0,A.pipe)(T.getRelationUriFromConnection,T.isTempUri)),(0,A.when)((0,A.always)(r),(0,A.filter)((0,A.propEq)("parentEntityUri",r))),A.length)(e);return((e,t,r)=>r?(0,A.pipe)((0,A.path)([t,"connections"]),(0,A.find)((e=>{let{entity:t}=e;return t.entityUri===r})),(0,A.pathOr)(0,["total"]))(e):(0,A.pathOr)(0,[t,"total"],e))(e,t,r)+n})(bR(e),t,r),FR=(e,t)=>qS(bR(e),t),MR=(e,t)=>T.getDraftsForSaveByViewId(bR(e),t),VR=e=>(e=>(0,A.keys)(e).reduce(((t,r)=>{const{addedConnections:n,editedConnections:a}=(0,T.getDraftsForSaveByViewId)(e,r);return(0,A.pipe)(A.concat,(0,A.map)(T.getEntityUriFromConnection),(0,A.filter)(T.isTempUri),(0,A.concat)(t))(n,a)}),[]))(bR(e)),BR=e=>rA(xR(e)),zR=e=>tA(xR(e)),HR=e=>eA(xR(e)),YR=(e,t)=>T.getRelationToAddByViewId(bR(e),t),WR=(e,t)=>T.getRelationsToEditByViewId(bR(e),t),GR=(e,t)=>T.getAllRelationsToAddAndEdit(bR(e),t),qR=(e,t,r)=>T.getAllRelationsToSave(bR(e),t,r),ZR=(e,t,r)=>T.getInitialConnectionTempEntity(e.relations,t,r),$R=(e,t,r)=>T.getInitialConnection(e.relations,t,r),KR=(e,t)=>((e,t)=>Object.keys(e).filter((r=>{const n=(0,T.getTempRelations)(e,r);return!!GS(n,t)})))(bR(e),t),XR=(e,t,r)=>((e,t,r)=>(0,A.pipe)((0,A.filter)((0,A.allPass)([(0,A.propEq)("parentUri",t),(0,A.propEq)("attributeTypeUri",r),(0,A.pipe)((0,A.prop)("uri"),A.isEmpty)])),(0,A.map)((0,A.prop)("message")),(0,A.join)(". "))(e))(ER(e),t,r),QR=(e,t,r)=>((e,t,r)=>(0,A.filter)((0,A.allPass)([(0,A.propEq)("parentUri",t),(0,A.propEq)("attributeTypeUri",r),(0,A.pipe)((0,A.prop)("uri"),A.isEmpty,A.not)]))(e))(ER(e),t,r),JR=(e,t,r)=>T.getCachedActiveErrorsForAttributesPager(ER(e),t,r),e_=(e,t)=>((e,t)=>e.trees[t])(vR(e),t),t_=(e,t)=>((e,t)=>(0,A.path)(["trees",t,"root"],e))(vR(e),t),r_=(e,t)=>((e,t)=>(0,A.path)(["trees",t,"total"],e))(vR(e),t),n_=e=>zA(vR(e)),a_=(e,t,r)=>((e,t,r)=>(0,A.path)(["trees",t,"editingConnections",r],e))(vR(e),t,r),o_=(e,t)=>((e,t)=>(0,A.pipe)((0,A.prop)("trees"),(0,A.when)((0,A.always)(t),(0,A.pick)(t)),A.values,(0,A.map)((0,A.pipe)((0,A.prop)("editingConnections"),A.values)),A.flatten,(0,A.reject)(A.isNil))(e))(vR(e),t),i_=e=>(e=>e.structure)(OR(e)),l_=(e,t)=>T.getDependentLookupsStructureNode(OR(e),t),s_=e=>(e=>e.initedTypeUris)(OR(e)),c_=e=>(e=>e.editors)(OR(e)),u_=(e,t)=>T.getDependentLookupEditorState(OR(e),t),p_=e=>(e=>e.diff)(SR(e)),d_=e=>(e=>e.event)(SR(e)),m_=e=>(e=>e.slice)(SR(e)),y_=e=>(e=>!(0,T.isEmptyValue)(e.slice))(SR(e)),g_=e=>(e=>e.mode)(SR(e)),f_=(e,t)=>((e,t)=>e[t])((e=>e.entityRelatedAttributes)(e),t),h_=(0,Nc.createSelector)(fR,(e=>NR(e,_R(e))),((e,t)=>!(!e||!t||(0,T.isEmptyValue)((0,T.collectAllDiffs)(e,t,!0))))),E_=(0,Nc.createSelector)(vR,(e=>{const t=zA(e),r=(0,T.getNotAppliedTreeCommands)((0,A.reject)((0,A.propSatisfies)(T.isEmptyValue,"root"),e.trees));return!(0,T.isEmptyValue)(t)||!(0,T.isEmptyValue)(r)})),b_=(0,Nc.createSelector)(bR,(e=>(0,A.keys)(e).reduce(((t,r)=>t||!(0,A.all)(T.isEmptyValue)((0,A.values)(T.getDraftsForSaveByViewId(e,r)))),!1))),v_=(0,Nc.createSelector)(h_,b_,E_,((e,t,r)=>e||t||r)),T_=(0,Nc.createSelector)(xR,fR,v_,((e,t)=>t),((e,t,r,n)=>!(e===T.Mode.Viewing||!t)&&((0,T.isTempUri)(t.uri)&&!n||r)));let O_=function(e){return e.PROFILE_OPERATION_UPDATE="PROFILE_OPERATION_UPDATE",e}({});const x_=pb(O_.PROFILE_OPERATION_UPDATE),C_=e=>{let{metadata:t,modifiedEntities:r,connections:n=[],errors:a}=e;return a.filter((e=>{let{attributeType:t,type:r}=e;return t&&!(0,T.isRequired)(t)&&r===T.ErrorType.missed})).filter((e=>{let{attributeType:a,parentUri:o}=e;const i=(0,T.getBaseUri)(o),l=(0,T.isEntityUri)(o)?r[i]:(0,T.findConnectionRelationObjectByRelationUri)(n,i),s=l&&(0,T.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}}))},S_=e=>(0,T.getProfileViewsIdsByTypes)(e,[T.ProfileViewType.Relations,T.ProfileViewType.RelationsTable]);function w_(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){A_(e,t,r[t])}))}return e}function A_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*R_(){const e=yield(0,ja.Ys)(gI.selectors.getEntity),t=yield(0,ja.Ys)(gI.selectors.getMode),r=yield(0,ja.Ys)(gI.selectors.getEntityUri),n=yield(0,ja.Ys)(gI.selectors.getMetadata),a=yield(0,ja.Ys)(gI.selectors.getModifiedEntity,r),o=yield(0,ja.Ys)(gI.selectors.getModifiedEntities),i=yield(0,ja.Ys)(gI.selectors.getProfileViews);return{entity:e,modifiedEntity:t===T.Mode.Viewing?e:a,entityUri:r,metadata:n,modifiedEntities:t===T.Mode.Viewing?{[r]:e}:o,profileViews:i,mode:t}}function*__(){return w_({},yield(0,ja.RE)(R_),{validationServicePath:yield(0,ja.Ys)(gI.selectors.getValidationServicePath),tenant:yield(0,ja.Ys)(gI.selectors.getTenant),severity:yield(0,ja.Ys)(gI.selectors.getValidationServiceSeverityLevels)})}function*I_(){const{entityUri:e,metadata:t,modifiedEntities:r,modifiedEntity:n,profileViews:a}=yield(0,ja.RE)(R_),o=S_(a),i=(0,T.getProfileViewsIdsByTypes)(a,[T.ProfileViewType.HierarchyTree]),l=yield(0,ja.Ys)(tC,o,!0),s=yield(0,ja.Ys)(gI.selectors.getRelations),c=yield(0,ja.Ys)(gI.selectors.getAllTreesEditingConnections,i);return[...(0,T.validateEntityLocally)(t,r,n,(0,T.isAvailableAttributeTypeForProfile)(a)),...l.flatMap((e=>(0,T.validateConnection)(t,r,e))),...c.flatMap((e=>(0,T.validateHierarchyConnection)(t,e)))].map((n=>w_({},n,{path:(0,T.evaluateErrorPath)({entityUri:e,metadata:t,connections:l,entitiesMap:r,relationsState:s,relationViewsIds:o},n.uri||n.parentUri)})))}function*N_(){const{entityUri:e,metadata:t,modifiedEntity:r,mode:n,validationServicePath:a}=yield(0,ja.RE)(__);if(a&&(0,T.shouldUseValidationService)(t,r.type)){const r=yield(0,ja.RE)((0,T.isTempUri)(e)?P_:k_),{modifiedEntities:a}=yield(0,ja.RE)(R_),o=(0,A.pipe)(T.convertValidationServiceErrors,(0,A.uniqBy)(T.getErrorUniqKey))(r,{entityUri:e,metadata:t,entitiesMap:a});if(n!==T.Mode.Viewing){const e=C_({metadata:t,modifiedEntities:a,errors:o});e.length&&(yield(0,ja.gz)(wb(e)))}return o}return[]}function D_(e){return console.warn("Validation service error",e),[]}function*P_(){const{mode:e,modifiedEntity:t,modifiedEntities:r,validationServicePath:n,tenant:a,severity:o}=yield(0,ja.RE)(__),i=(0,T.prepareEntityForValidation)(t,r);try{return yield(0,ja.RE)(T.validateEntity,{validationServicePath:n,entity:i,tenant:a,severity:o,options:(0,A.reject)(A.isNil,[T.ValidationServiceOption.preserveURIs,e===T.Mode.Editing?T.ValidationServiceOption.validateDataPermissions:null])})}catch(e){return D_(e)}}function*k_(){var e;const{entityUri:t,mode:r,entity:n,modifiedEntity:a,modifiedEntities:o,validationServicePath:i,metadata:l,tenant:s,severity:c}=yield(0,ja.RE)(__),u=yield(0,ja.Ys)(gI.selectors.getValidateReferenceEntityInReadMode),p=(0,T.getEntityType)(l,n.type),d=null===(e=null==p?void 0:p.forceOvForUiUpdates)||void 0===e||e,m=r===T.Mode.Viewing?[]:(0,T.collectDiffForValidation)(n,a,o,d);try{return yield(0,ja.RE)(T.validateEntityChanges,{validationServicePath:i,uri:t,diff:m,tenant:s,severity:c,options:(0,A.reject)(A.isNil,[T.ValidationServiceOption.preserveURIs,T.ValidationServiceOption.updateAttributeUpdateDates,r===T.Mode.Editing?T.ValidationServiceOption.validateDataPermissions:null,r===T.Mode.Viewing&&u?T.ValidationServiceOption.validateReferenceEntityAttribute:null])})}catch(e){return D_(e)}}function*L_(){const{entityUri:e,metadata:t,mode:r,modifiedEntity:n,modifiedEntities:a,validationServicePath:o,tenant:i,severity:l,profileViews:s}=yield(0,ja.RE)(__),c=yield(0,ja.Ys)(gI.selectors.getValidateRelations);if(o&&c){const c=S_(s),u=(yield(0,ja.Ys)(tC,c)).filter((e=>(0,T.shouldUseValidationService)(t,e.relation.relationType)));if(u.length>0){let s=[];const p=(0,T.prepareConnectionsForValidation)(u,n,a,t);try{const e=yield(0,ja.RE)(T.validateRelations,{validationServicePath:o,body:p,tenant:i,severity:l,options:(0,A.reject)(A.isNil,[T.ValidationServiceOption.preserveURIs,r===T.Mode.Editing?T.ValidationServiceOption.validateDataPermissions:null])});s=Object.values(e.validated).flat()}catch(e){return D_(e)}const d=yield(0,ja.Ys)(gI.selectors.getModifiedEntities),m=yield(0,ja.Ys)(gI.selectors.getRelations),y=(0,A.pipe)(T.convertValidationServiceErrors,(0,A.uniqBy)(T.getErrorUniqKey))(s,{entityUri:e,metadata:t,entitiesMap:d,connections:u,relationsState:m,relationViewsIds:c}),g=C_({metadata:t,modifiedEntities:d,connections:u,errors:y});return g.length&&(yield(0,ja.gz)(wb(g))),y}}return[]}function*U_(){const e=yield(0,ja.RE)(I_),[t,r]=yield(0,ja.$6)([(0,ja.RE)(N_),(0,ja.RE)(L_)]),n=(0,A.uniqBy)(T.getErrorUniqKey,[...e,...t,...r]);return yield(0,ja.gz)(_w(n)),0===n.filter(T.isCriticalError).length}let j_=function(e){return e.PROFILE_VIEWS_SET="PROFILE_VIEWS_SET",e}({});function F_(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){M_(e,t,r[t])}))}return e}function M_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*V_(e){const t=yield(0,ja.Ys)(gI.selectors.getMetadata),r=yield(0,ja.Ys)(gI.selectors.getMode);switch(e.type){case YS.OPEN_RELATION_EDITOR:{const{id:n,connection:a}=e.payload;a.relation.relationType&&(yield(0,ja.gz)(Ab({viewId:n,metadata:t,mode:r,parentUri:a.relation.object.uri})));break}case Sb.ADD_ATTRIBUTES:{const n=e.payload;for(const e of n){const{attributeType:n,parentUri:a,viewId:o}=e;(0,T.isComplexAttribute)(n)&&(yield(0,ja.gz)(Ab({viewId:o,attributeType:n,parentUri:a,metadata:t,mode:r})))}break}case YS.SET_RELATION_TYPE:{const{id:n,relationUri:a}=e.payload;yield(0,ja.gz)(Ab({viewId:n,metadata:t,mode:r,parentUri:a}));break}case jA.TREE_NODE_RELATION_TYPE_CHANGED:{var n;const{id:a,node:o}=e.payload;yield(0,ja.gz)(Ab({viewId:a,metadata:t,mode:r,parentUri:null==o||null===(n=o.relation)||void 0===n?void 0:n.uri}));break}}}function*B_(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=yield(0,ja.Ys)(sC),n=(0,T.getNotAppliedTreeCommands)(null==r?void 0:r.trees),a=yield(0,ja.Ys)(dC),o=(0,T.optimizeCommands)([...a,...n]);if(null!=o&&o.length){const r=(0,A.when)((0,A.always)(t),(0,T.replaceTempUriInCommands)(t))(o);yield(0,ja.RE)(e,r),yield(0,ja.gz)(FA())}}function*z_(e){var t;const r=yield(0,ja.Ys)(UO),n=yield(0,ja.Ys)(jO),a=yield(0,ja.Ys)(ex,n),o=yield(0,ja.Ys)(_O),i=(0,T.getEntityType)(o,r.type),l=null===(t=null==i?void 0:i.forceOvForUiUpdates)||void 0===t||t,s=(0,T.collectAllDiffs)(r,a,l);return(0,T.prepareAttrDiff)(e,s)}function*H_(e){const t=yield(0,ja.Ys)(YO),r=yield(0,ja.Ys)(rx),n=yield(0,ja.Ys)(jO),a=yield(0,ja.Ys)(ex,n),o=(0,T.findAllTemporaryRefEntityURI)(a),i=(0,A.concat)(o,t);return yield(0,ja.RE)(T.saveTemporaryEntities,r,i,e)}function*Y_(e,t){const r=e.getDCRObjectUris(),n=yield(0,ja.Ys)(SC),a=yield(0,ja.Ys)(AC),o=yield(0,ja.Ys)(bC);if(null!=r&&r.length){const i=yield(0,ja.RE)(T.startProcessInstance,{workflowPath:n,processType:"dataChangeRequestReview",objectURIs:(0,A.uniq)([t,...r,e.getDCRUri()]).filter((0,A.complement)(A.isNil)),tenant:o,environment:a});"OK"!==(null==i?void 0:i.status)&&console.warn(i)}}function*W_(e,t,r,n){const a=yield(0,ja.Ys)(HO,r),o=(0,T.createRelationsCommandsFromConnections)(a,n,t);o.length&&(yield(0,ja.RE)(e,o))}function*G_(e,t,r){const n=yield(0,ja.Ys)(ZO),a=yield(0,ja.Ys)(jO);for(const o of n)yield(0,ja.rM)(W_,e,r||a,o,t)}function*q_(e){if(!e.hasNewUri())return;const t=yield(0,ja.Ys)(sC);for(const[r,n]of Object.entries(t.trees))if(n.root){const t=t=>(0,A.when)((0,A.prop)("uri"),(0,A.assoc)("uri",e.getUri(null==t?void 0:t.uri)))(t),a=(0,T.mapTree)(n.root,{nodeProcessing:e=>(0,A.pipe)((e=>F_({},e)),(0,A.unless)((0,A.has)("editingMode"),(0,A.evolve)({relation:t,relations:(0,A.map)(t)})))(e)});(0,A.equals)(n.root,a)||(yield(0,ja.gz)(MA({id:r,tree:a})))}}function*Z_(){try{var e;const t=yield(0,ja.Ys)(Kx),{commandExecutor:r,dcrProcessor:n,relationUriProcessor:a}=(0,T.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:null}),o=yield(0,ja.RE)(H_,n);yield(0,ja.$6)([(0,ja.RE)(B_,r),(0,ja.RE)(G_,r,o)]),yield(0,ja.RE)(q_,a);const i=yield(0,ja.RE)(z_,o),l=yield(0,ja.Ys)(jO);let s;if(null!=i&&i.length&&(s=yield(0,ja.RE)(T.entityCumulativeUpdate,{uri:l,diff:i,uriPreprocessor:n.enhanceUriWithDCR})),t||(0,T.isChangeRequestUri)(null===(e=s)||void 0===e?void 0:e.uri))s&&n.updateDCRUriFromResponse(s),yield(0,ja.RE)(Y_,n,l),yield(0,ja.gz)(VA()),window.alert(uo().text("Your changes are saved as pending and have been sent for review"));else if(s){yield(0,ja.gz)(mw(s));const{trees:e}=yield(0,ja.Ys)(gI.selectors.getTrees),t=(0,T.updateTreesWithNewEntity)((0,A.pick)(["uri","label","secondaryLabel","type"],s),e);for(const e of t)yield(0,ja.gz)(MA({id:e.id,tree:e.root}))}yield(0,ja.gz)(Xw(T.Mode.Viewing)),yield(0,ja.gz)(Lb())}catch(e){yield(0,ja.gz)(Qv((0,T.getRequestErrorMessage)(e,uo().text("Something went wrong"))))}}function*$_(){yield(0,ja.qn)(dw.ENTITY_LOADED),yield(0,ja.gz)(Lb())}function*K_(e,t){const r=yield(0,ja.Ys)(jO),n=yield(0,ja.Ys)(gI.selectors.getModifiedEntity,r),{commandExecutor:a,dcrProcessor:o}=(0,T.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:e}),i=yield(0,ja.RE)(H_,o),l=yield(0,ja.RE)(T.saveTemporaryEntity,n,i,o);return yield(0,ja.$6)([(0,ja.RE)(B_,a,{[r]:l}),(0,ja.RE)(G_,a,i,l)]),{savedEntityUri:l,dcrProcessor:o}}function*X_(){const e=yield(0,ja.Ys)(jO),t=yield(0,ja.Ys)(gI.selectors.getModifiedEntity,e);if((0,T.isEmptyEntity)(t)){const e=(0,Ze.x0)();return yield(0,ja.gz)(Av({id:e,text:uo().text("Please fill out some fields."),actions:[]})),!1}return!0}function*Q_(){try{const e=yield(0,ja.Ys)(Kx);if(!(yield(0,ja.RE)(X_)))return;const{dcrProcessor:t,savedEntityUri:r}=yield(0,ja.RE)(K_,null,e);e&&(yield(0,ja.RE)(Y_,t),window.alert(uo().text("Your changes are saved as pending and have been sent for review"))),yield(0,ja.gz)(Xw(T.Mode.Viewing)),e?(yield(0,ja.gz)(wv()),yield(0,ja.gz)(Tw())):(yield(0,ja.gz)(xv({uri:r})),yield(0,ja.rM)($_))}catch(e){yield(0,ja.gz)(Qv((0,T.getRequestErrorMessage)(e,uo().text("Something went wrong"))))}}function*J_(e){const t=yield(0,ja.RE)(T.getDataChangeRequest,e),r=(0,A.pipe)((0,A.prop)("changes"),A.values,A.flatten,(0,A.pluck)("id"))(t);try{yield(0,ja.$6)(r.map((t=>(0,ja.RE)(T.deleteChangeRequestItem,{dcrUri:e,changeItemId:t}))))}catch(e){yield(0,ja.gz)(Qv((0,T.getRequestErrorMessage)(e,uo().text("Something went wrong"))))}}function*eI(e,t){yield(0,ja.RE)(J_,e);const{savedEntityUri:r}=yield(0,ja.RE)(K_,e,!0),n=yield(0,ja.Ys)(SC),a=yield(0,ja.Ys)(AC),o=yield(0,ja.Ys)(bC);yield(0,ja.RE)(T.runTaskAction,{workflowPath:n,environment:a,tenant:o,taskId:t,action:"Approve"}),yield(0,ja.gz)(Xw(T.Mode.Viewing)),yield(0,ja.gz)(xv({uri:r})),yield(0,ja.rM)($_)}function*tI(e){const{dcrUri:t,userAction:r,taskId:n}=e.payload;try{if(!(yield(0,ja.RE)(X_)))return;yield(0,ja.gz)(Xw("saveDraft"===r?T.Mode.Suggesting:T.Mode.Editing,!0)),yield(0,ja.gz)(x_(T.Operation.Saving));const e=yield(0,ja.RE)(U_);if("saveDraft"===r){if(t)yield(0,ja.RE)(J_,t),yield(0,ja.RE)(K_,t,!0);else{const{dcrProcessor:e}=yield(0,ja.RE)(K_,null,!0);yield(0,ja.RE)(Y_,e);const t=e.getDCRUri();yield(0,ja.gz)($v({url:"../authoring",searchParams:{entityUri:`${t}`},options:{replace:!0,state:{keepErrors:!0}}}))}window.alert(uo().text("Your changes are saved as pending and have been sent for review"))}else if(e)if(t)yield(0,ja.RE)(eI,t,n);else{const{savedEntityUri:e}=yield(0,ja.RE)(K_,null,!1);yield(0,ja.gz)(Xw(T.Mode.Viewing)),yield(0,ja.gz)(xv({uri:e})),yield(0,ja.rM)($_)}else e||(yield(0,ja.gz)(Xw(T.Mode.Suggesting,!0)))}catch(e){yield(0,ja.gz)(Xw(T.Mode.Suggesting,!0)),yield(0,ja.gz)(Qv((0,T.getRequestErrorMessage)(e,uo().text("Something went wrong"))))}yield(0,ja.gz)(x_(null))}function*rI(){if(yield(0,ja.gz)(x_(T.Operation.Saving)),yield(0,ja.RE)(U_)){const e=yield(0,ja.Ys)(jO);(0,T.isTempUri)(e)?yield(0,ja.RE)(Q_):yield(0,ja.RE)(Z_)}yield(0,ja.gz)(x_(null))}function*nI(e){const{mode:t,silent:r}=e.payload;if(t!==T.Mode.Viewing&&!r){const e=yield(0,ja.Ys)(gI.selectors.getEntity),r=yield(0,ja.Ys)(gI.selectors.getModifiedEntity,null==e?void 0:e.uri),n=yield(0,ja.Ys)(gI.selectors.getMetadata);if(e&&!r&&n){const r=yield(0,ja.Ys)(gI.selectors.getProfileViews),a=yield(0,ja.Ys)(gI.selectors.getUIConfig),o=yield(0,ja.Ys)(gI.selectors.getUserRoles),i=(0,T.addToEntityRequiredAttributes)({entity:e,metadata:n,mode:t,attrTypeFilter:(0,A.both)((0,T.isAvailableAttributeTypeForProfile)(r||[]),(0,T.getProfileAttributeConfigPermissionsChecker)(a,e.type,o,[T.ConfigPermissions.READ,T.ConfigPermissions.CREATE]))});yield(0,ja.gz)(aA(i));const l=yield(0,ja.Ys)(gI.selectors.getModifiedEntities),s=yield(0,ja.Ys)(gI.selectors.getProfileErrors),c=C_({metadata:n,modifiedEntities:l,errors:s});c.length&&(yield(0,ja.gz)(wb(c)))}}}function*aI(e){const{entityTypeUri:t}=e.payload,r=yield(0,ja.Ys)(gI.selectors.getMetadata),n=(0,T.getEntityType)(r,t),a=yield(0,ja.Ys)(gI.selectors.getUIConfig),o=yield(0,ja.Ys)(gI.selectors.getUserRoles),i=(0,T.getProfileAttributeConfigPermissionsChecker)(a,t,o,[T.ConfigPermissions.READ,T.ConfigPermissions.CREATE]),l=((null==n?void 0:n.attributes)||[]).filter((e=>i(e))),s=(0,T.checkMetadataForCreate)(T.Mode.Editing,n)?T.Mode.Editing:T.Mode.Suggesting,c=(0,T.createTemporaryEntity)({entityTypeUri:t,attributeTypes:l,metadata:r,mode:s});yield(0,ja.gz)(Cv({entity:c})),yield(0,ja.gz)(mw(c)),yield(0,ja.gz)(Xw(T.Mode.Viewing)),yield(0,ja.gw)(0),(yield(0,ja.Ys)(gI.selectors.getProfileViews))||(yield(0,ja.qn)(j_.PROFILE_VIEWS_SET)),yield(0,ja.gz)(Xw(s)),yield(0,ja.gz)(BA())}function*oI(e){const{entityTypeUri:t}=e.payload,r=yield(0,ja.Ys)(gI.selectors.getMetadata),n=(0,T.getEntityType)(r,t),a=(0,A.prop)("attributes",n),o=(0,T.checkMetadataForCreate)(T.Mode.Suggesting,n)?T.Mode.Suggesting:T.Mode.Editing,i=(0,T.createTemporaryEntity)({entityTypeUri:t,attributeTypes:a,metadata:r,mode:o});yield(0,ja.gz)(qv({entity:i})),yield(0,ja.gz)(mw(i)),yield(0,ja.gz)(Xw(o))}function*iI(e){const{mainEntityUri:t,tempEntities:r,keepErrors:n}=e.payload,[[a],o]=(0,A.partition)((0,A.propEq)("uri",t),r);for(const e of o)yield(0,ja.gz)(aA(e));yield(0,ja.gz)(mw(a,n)),yield(0,ja.gz)(Xw(T.Mode.Suggesting))}function*lI(e){const{payload:{entityUri:t,data:r}}=e;yield(0,ja.gz)(x_(T.Operation.Cloning));try{const e=yield(0,ja.RE)(T.cloneEntity,t,r);yield(0,ja.gz)(Cv({entity:e})),yield(0,ja.gz)(mw(e)),yield(0,ja.gz)(Xw(T.Mode.Editing)),yield(0,ja.gz)(BA());const n=(0,Ze.x0)(),a=yield(0,ja.Ys)(gI.selectors.getMetadata),o=(0,T.getEntityType)(a,e.type),i=(0,T.checkMetadataForDelete)(T.Mode.Editing,o);yield(0,ja.gz)(Av({id:n,type:"cloneAction",autoHideDuration:1e4,text:uo().text("Profile is cloned successfully. You can modify the attributes if required."),actions:i?[{label:uo().text("Undo"),needConfirmation:!0,confirmationText:uo().text("Are you sure you want to undo the cloning process?"),confirmationDescription:uo().text("Undoing the cloning process will delete the cloned profile. Are you sure you want to proceed?"),applyAction:bw({entityUri:e.uri}),cancelAction:Rv(n)}]:[]}))}catch(e){yield(0,ja.gz)(Qv((0,T.getRequestErrorMessage)(e,uo().text("Something went wrong"))))}yield(0,ja.gz)(x_(null))}function*sI(e){const{entityUri:t}=e.payload;if(!(0,T.isTempUri)(t))try{yield(0,ja.RE)(T.removeEntity,t),yield(0,ja.gz)(Sv())}catch(e){yield(0,ja.gz)(Qv((0,T.getRequestErrorMessage)(e,uo().text("Something went wrong"))))}}function*cI(){(yield(0,ja.Ys)(EC))&&!confirm(uo().text("Are you sure you want to cancel changes for this Profile?"))||(yield(0,ja.gz)(Jw()))}const uI=[function*(){yield(0,ja.A7)([zb.MODE_CANCEL_EDITING],cI)},function*(){yield(0,ja.ib)([YS.OPEN_RELATION_EDITOR,Sb.ADD_ATTRIBUTES,YS.SET_RELATION_TYPE,jA.TREE_NODE_RELATION_TYPE_CHANGED],V_)},function*(){yield(0,ja.A7)([Sb.SAVE_PROFILE],rI)},function*(){yield(0,ja.ib)([zb.MODE_UPDATED],nI)},function*(){yield(0,ja.ib)([dw.ENTITY_CREATION_REQUESTED],aI)},function*(){yield(0,ja.Fm)([Sb.VALIDATE_PROFILE],U_)},function*(){yield(0,ja.ib)([dw.ENTITY_REMOVE_REQUESTED],sI)},function*(){yield(0,ja.ib)([dw.CLONE_ENTITY],lI)},function*(){yield(0,ja.ib)([dw.ENTITY_CREATION_WITH_AUTHORING_REQUESTED],oI)},function*(){yield(0,ja.ib)([dw.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED],iI)},function*(){yield(0,ja.A7)([Sb.SAVE_DRAFT],tI)}],pI=(pb(j_.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===j_.PROFILE_VIEWS_SET?t.payload:e});let dI=function(e){return e.SIDE_PANEL_VIEWS_LOADED="SIDE_PANEL_VIEWS_LOADED",e}({});pb(dI.SIDE_PANEL_VIEWS_LOADED);const mI=[],yI=(0,w.combineReducers)({dependentLookups:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Wb,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case zb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,T.isViewMode)(r)&&!n?Wb:e}case jb.DEPENDENT_LOOKUPS_STRUCTURE_SET:return Hb({},e,{structure:t.payload});case jb.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED:{const r=t.payload;return Hb({},e,{initedTypeUris:(0,A.uniq)(e.initedTypeUris.concat(r))})}case jb.DEPENDENT_LOOKUPS_EDITORS_BLOCKED:{const{uris:r,isBlocked:n}=t.payload,a=e.editors,o=r.reduce(((e,t)=>Hb({},e,{[t]:Hb({},e[t],{isBlocked:n})})),a);return Hb({},e,{editors:o})}case jb.DEPENDENT_LOOKUPS_EDITOR_TOUCHED:{const{uri:r,isTouched:n}=t.payload;return(0,A.assocPath)(["editors",r,"isTouched"],n,e)}default:return e}},entity:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ww,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case dw.ENTITY_LOADED:return t.payload.entity;case dw.DEFAULT_PROFILE_PIC_SET:return"object"==typeof t.payload&&null!==t.payload?Cw({},e,{defaultProfilePic:t.payload.uri,defaultProfilePicValue:t.payload}):e;case Sb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:o}=t.payload,i=(0,T.getAttributeSource)(a);if(r===e.uri){const t=(0,A.lensPath)([i,n]);return(0,A.over)(t,(0,A.pipe)((0,A.defaultTo)([]),(0,A.concat)(A.__,o)),e)}return e}case dw.CLEAR_ENTITY:return ww;default:return e}},errors:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Dw,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Aw.ERRORS_SET:return t.payload;case Aw.ERROR_DEACTIVATED:{const r=t.payload,n=e.findIndex((e=>(0,T.getErrorId)(e)===r)),a=(0,A.lensPath)([n]);return(0,A.over)(a,(0,A.assoc)("deactivated",!0),e)}case Sb.REMOVE_ATTRIBUTE:{const{uri:r}=t.payload;return e.map((e=>e.uri===r||(0,T.areOneHierarchyUris)(e.parentUri,r)?Iw({},e,{deactivated:!0}):e))}case zb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,T.isViewMode)(r)&&!n?Dw:e}case dw.ENTITY_LOADED:{const{keepErrors:r}=t.payload;return r?e:Dw}default:return e}},history:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zw,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Pw.HISTORY_DIFF_SET:return Vw({},e,{diff:t.payload});case Pw.HISTORY_DIFF_CLEARED:return Vw({},e,{diff:zw.diff});case Pw.HISTORY_EVENT_SET:return Vw({},e,{event:t.payload});case Eb.NEW_ENTITY_SHOWN:case Eb.OPEN_ENTITY:case Pw.HISTORY_EVENT_CLEARED:return Vw({},zw,{mode:e.mode});case Pw.HISTORY_SLICE_SET:return Vw({},e,{slice:t.payload});case Pw.HISTORY_MODE_SET:return Vw({},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 Hw.PROFILE_LAST_LOADED_TIME_UPDATE:case dw.ENTITY_LOADED:return Date.now();default:return e}},lookups: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 Yw.LOOKUPS_LOADED:return t.payload;case Yw.LOOKUPS_FOR_TYPE_RESOLVED:{const{type:r,values:n}=t.payload;return Zw({},e,{[r]:Zw({},e[r],n)})}case Yw.LOOKUPS_LIST_RESOLVED:return t.payload.reduce(((e,t)=>Object.keys(t).reduce(((e,r)=>Zw({},e,{[r]:Zw({},e[r],t[r])})),e)),e);case"UI_RESET":return Zw({},Kw);default:return e}},mode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:nA,t=arguments.length>1?arguments[1]:void 0;return t.type===zb.MODE_UPDATED?t.payload.mode:e},modifiedEntities:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pA,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case HS.MODIFIED_ENTITY_CREATED:{const r=t.payload;return cA({},e,{[r.uri]:r})}case HS.MODIFIED_ENTITY_DELETED:{const r=t.payload;return(0,A.omit)([r],e)}case HS.MODIFIED_ENTITIES_RESET:return pA;case zb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,T.isViewMode)(r)&&!n?pA:e}case HS.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET:{const{entityUri:r,value:n}=t.payload;return r?cA({},e,{[r]:cA({},e[r],{defaultProfilePic:n.uri,defaultProfilePicValue:n})}):e}case Sb.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t,o=(0,T.getBaseUri)(n);if((0,T.isEntityUri)(o)){const t=e[o];return e[o]||console.error(`ADD_ATTRIBUTES. parentUri - ${n}, state: ${JSON.stringify(e)}`),(0,T.isEntitySpecialAttrType)(r)?cA({},e,{[o]:(0,T.addEntitySpecialAttribute)({entity:t,attributeType:r})}):cA({},e,{[o]:(0,T.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a})})}return e}),e);case Sb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:o}=t.payload,i=(0,T.getAttributeSource)(a);if((0,T.isEntityUri)(r)&&r in e){const t=(0,A.lensPath)([r,i,n]);return(0,A.over)(t,(0,A.pipe)((0,A.defaultTo)([]),(0,A.concat)(A.__,o)),e)}return e}case Sb.MODIFY_ATTRIBUTE:{const{attributeType:r,uri:n,value:a}=t.payload,o=(0,T.getBaseUri)(n);if((0,T.isEntityUri)(o)){const t=e[o];return e[o]&&e[o].attributes||console.error(`MODIFY_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,T.isEntitySpecialAttrType)(r)?cA({},e,{[o]:(0,T.editEntitySpecialAttribute)({entity:t,attributeType:r,value:a})}):cA({},e,{[o]:(0,T.editAttribute)({entity:t,attributeType:r,uri:n,value:a})})}return e}case Sb.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n}=t.payload,a=(0,T.getBaseUri)(n);if((0,T.isEntityUri)(n)){const t=e[a];return e[a]||console.error(`REMOVE_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,T.isEntitySpecialAttrType)(r)?cA({},e,{[a]:(0,T.removeEntitySpecialAttribute)({entity:t,attributeType:r})}):cA({},e,{[a]:(0,T.removeAttribute)({entity:t,attributeType:r,uri:n})})}return e}case Sb.ADD_DEFAULT_VALUES:{const{attributeType:r,parentUri:n,metadata:a,mode:o}=t.payload,i=(0,T.getBaseUri)(n);if((0,T.isEntityUri)(i)){const t=(0,T.getEditableAttributeTypeSubAttributes)(a,r);return(0,A.over)((0,A.lensProp)(i),(0,T.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]:DA,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case dw.ENTITY_LOADED:return{};case YS.RELATIONS_LOADED:{const{id:r,connections:n=[],total:a,mode:o}=t.payload;return(0,A.pipe)((0,A.assocPath)([r,"connections"],n),(0,A.assocPath)([r,"total"],a),(0,A.when)((0,A.both)((0,A.complement)((0,A.hasPath)([r,"drafts"])),(0,A.always)((0,T.isEditableMode)(o))),(0,A.assocPath)([r,"drafts"],PA)))(e)}case YS.SECOND_LEVEL_RELATIONS_LOADED:{const{id:r,connections:n,parentEntityUri:a,total:o}=t.payload,i=(0,A.path)([r,"connections"],e).map((e=>{const{entityUri:t}=e.entity;return t===a?IA({},e,{total:o,connections:n.map((e=>IA({},e,{parentEntityUri:a})))}):e}));return(0,A.assocPath)([r,"connections"],i,e)}case zb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return n?e:(0,A.map)(tA(r)?(0,A.omit)(["drafts","relationsToEdit","relationToAdd"]):(0,A.assoc)("drafts",PA),e)}case YS.REMOVE_RELATION:{const{id:r,relationUri:n}=t.payload,a=(0,A.pipe)(T.getRelationUriFromConnection,(0,A.equals)(n)),o=(0,A.path)([r,"connections"],e),i=!((0,T.isTempUri)(n)||null!=o&&o.some((e=>e.suggested&&e.relation.relationUri===n)));return(0,A.evolve)({[r]:{drafts:(0,A.evolve)({removedUris:i?(0,A.append)(n):A.identity,addedConnections:(0,A.reject)(a),editedConnections:(0,A.reject)(a)})}},e)}case YS.IGNORE_RELATION:{const{id:r,ignoredRelationData:n}=t.payload;return(0,A.evolve)({[r]:{drafts:(0,A.evolve)({ignoredRelationData:(0,A.append)(n)})}},e)}case YS.ADD_RELATION:{const{id:r,connection:n}=t.payload,a=(0,A.omit)(["isNew"],n);return(0,A.evolve)({[r]:(0,A.pipe)((0,A.when)((0,A.propSatisfies)(A.isNil,"drafts"),(0,A.assocPath)(["drafts"],PA)),(0,A.evolve)({drafts:{addedConnections:(0,A.prepend)(a)}}))},e)}case YS.EDIT_RELATION:{const{id:r,connection:n}=t.payload,a=(0,A.eqBy)(T.getRelationUriFromConnection,n);if((0,T.isTempUri)((0,T.getRelationUriFromConnection)(n))){const t=e=>{const t=e.findIndex(a);return t>=0?(0,A.update)(t,n,e):e};return(0,A.evolve)({[r]:{drafts:(0,A.evolve)({addedConnections:t})}},e)}{const t=e=>{const t=e.findIndex(a);return t>=0?(0,A.update)(t,n,e):[...e,n]};return(0,A.evolve)({[r]:{drafts:(0,A.evolve)({editedConnections:t})}},e)}}case YS.OPEN_RELATION_EDITOR:{const{id:r,connection:n}=t.payload,a=n.initial?n:IA({},n,{initial:{connection:n}});if(a.isNew){const t=(0,T.getRelationToAddPath)(r);return(0,A.path)(t,e)?e:(0,A.assocPath)(t,a,e)}{const t=(0,A.lensPath)((0,T.getRelationsToEditPath)(r)),n=(0,A.eqBy)((0,A.path)(["relation","relationUri"]),a);return(0,A.over)(t,(0,A.pipe)((0,A.defaultTo)([]),(0,A.unless)((0,A.find)(n),(0,A.append)(a))),e)}}case YS.SET_INITIAL_INFO:{const{id:r,relationUri:n,tempEntity:a}=t.payload,o=kA(r,n,e);return(0,A.assocPath)([...o,"initial","modifiedEntity"],a,e)}case YS.CLOSE_RELATION_EDITOR:{const{id:r,relationUri:n}=t.payload,a=(0,A.pathEq)(["relation","relationUri"],n);return(0,A.evolve)({[r]:{relationToAdd:(0,A.when)(a,(0,A.always)(null)),relationsToEdit:(0,A.reject)(a)}},e)}case YS.SET_RELATION_TYPE:{const{id:r,relationUri:n,relationType:a}=t.payload,o=kA(r,n,e);if(o){const t=[...o,"relation"],r=(0,A.lensPath)(t);return(0,A.over)(r,(0,T.applyRelationTypeObject)(a),e)}return e}case Sb.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:o}=t,i=(0,T.getBaseUri)(n),l=LA(o,i,e);if(l&&(0,T.isRelationUri)(i)){if((0,T.isActivenessAttrType)(r)){const t=(0,A.view)(l,e),n=(0,T.addEntitySpecialAttribute)({entity:t,attributeType:r});return(0,A.set)(l,n,e)}{const t=UA(o,i,e),l=(0,A.view)(t,e);l||console.error(`relations.ADD_ATTRIBUTES. viewId - ${o}, relationUri - ${i}, state: ${JSON.stringify(e)}`);const s=(0,T.addAttribute)({entity:l,attributeType:r,parentUri:n,index:a});return(0,A.set)(t,s,e)}}return e}),e);case Sb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,values:a,viewId:o}=t.payload;if(!(0,T.isRelationUri)(r))return e;const i=(0,T.getBaseUri)(r),l=kA(o,i,e),s=(0,A.lensPath)([...l,"relation","object","attributes",n]);return(0,A.over)(s,(0,A.pipe)((0,A.defaultTo)([]),(0,A.append)(a)),e)}case Sb.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:o}=t.payload,i=(0,T.getBaseUri)(a),l=LA(n,i,e);if(l&&(0,T.isRelationUri)(i)){if((0,T.isActivenessAttrType)(r)){const t=(0,A.view)(l,e),n=(0,T.editEntitySpecialAttribute)({entity:t,attributeType:r,value:o});return(0,A.set)(l,n,e)}{const t=UA(n,i,e),l=(0,A.view)(t,e);l||console.error(`relations.MODIFY_ATTRIBUTE. viewId - ${n}, relationUri - ${i}, state: ${JSON.stringify(e)}`);const s=(0,T.editAttribute)({entity:l,attributeType:r,uri:a,value:o});return(0,A.set)(t,s,e)}}return e}case Sb.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,o=(0,T.getBaseUri)(n),i=LA(a,o,e);if(i&&(0,T.isRelationUri)(o)){if((0,T.isActivenessAttrType)(r)){const t=(0,A.view)(i,e),n=(0,T.removeEntitySpecialAttribute)({entity:t,attributeType:r});return(0,A.set)(i,n,e)}{const t=UA(a,o,e),i=(0,A.view)(t,e);i||console.error(`relations.REMOVE_ATTRIBUTE. viewId - ${a}, relationUri - ${o}, state: ${JSON.stringify(e)}`);const l=(0,T.removeAttribute)({entity:i,attributeType:r,uri:n});return(0,A.set)(t,l,e)}}return e}case YS.SET_RELATION_ENTITY:{const{id:r,relationUri:n,entityInfo:a}=t.payload,o=kA(r,n,e);if(o){const t=[...o,"entity"],r=(0,A.lensPath)(t),{uri:n,label:i,type:l}=a,s=(0,A.isEmpty)(a)?{}:{entityUri:n,entityLabel:i,entityType:l,object:{uri:n,label:i,type:l}};return(0,A.set)(r,s,e)}return e}case Sb.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:o,mode:i}=t.payload,l=(0,T.getBaseUri)(a);if((0,T.isRelationUri)(l)){const t=kA(r,l,e);if(t){if(n){const r=[...t,"relation","object"],l=(0,T.getAttributeTypeSubAttributes)(o,n);return(0,A.over)((0,A.lensPath)(r),(0,T.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,A.view)((0,A.lensPath)(n),e),{attributes:s=[]}=(0,T.getRelationType)(o,l);return(0,A.over)((0,A.lensPath)(r),(0,T.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]:mR,t=arguments.length>1?arguments[1]:void 0;return(0,HA.ZP)(e,(r=>{switch(t.type){case zb.MODE_UPDATED:{const{mode:e,silent:n}=t.payload;if(n)break;Object.keys(null==r?void 0:r.trees).forEach((e=>{QA(r.trees[e].root,"showDetails",!1)})),(0,T.isViewMode)(e)&&(r.common.commands=[],r.initialTrees={}),(0,T.isEditableMode)(e)&&(r.initialTrees=pR({},r.trees));break}case zb.MODE_EDITING_CANCELED:case jA.TREES_RESTORE_FROM_INITIAL_TREES:r.trees=pR({},r.initialTrees);break;case jA.TREES_RESET_INITIAL_TREES:r.initialTrees={};break;case dw.ENTITY_LOADED:return mR;case jA.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 jA.TREE_LOADING:{const e=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].loading=!0;break}case jA.TREE_CHILDREN_LOADING:{const{id:e,parentId:n,nodeId:a}=t.payload,o=r.trees[e].root,i=(0,T.findNodeById)(o,n);i.pending=!1,i.children=(i.children||[]).concat({entity:{},loading:!0,nodeId:a});break}case jA.TREE_CHILDREN_LOADED:{const{children:e,id:n,parentId:a}=t.payload,o=r.trees[n].root,i=(0,T.findNodeById)(o,a);i&&(i.children=ZA(i.children,e),delete i.pending);break}case jA.TREE_NODE_REMOVED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root,o=(0,T.findParentNodeById)(a,n);$A(o||a,n);break}case jA.TREE_NODE_CREATED:{const{id:e,parentId:n,node:a}=t.payload,o=r.trees[e].root,i=(0,T.findNodeById)(o,n)||o,l=i.children.length;KA(i,a,l);break}case jA.TREE_NODE_EDITED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,o=(0,T.findNodeById)(a,n.nodeId),i=Object.keys(n);for(const e of i)o[e]=n[e];break}case jA.TREE_NODE_EDITING_STARTED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,o=(0,T.findNodeById)(a,n.nodeId),i=(0,T.findParentNodeById)(a,n.nodeId);o&&i&&(o.editingMode=T.NODE_EDITING_MODES.editing,o.relatedEntity=i.entity,delete o.loading,o.initialConnection=JA(o),eR({id:e,draft:r.trees,node:o}));break}case jA.TREE_NODE_EDITING_APPLIED:{const{id:e,node:a}=t.payload,o=r.trees[e].root,i=(0,T.findNodeById)(o,a.nodeId),l=aR({id:e,draft:r.trees,relationUri:a.relation.uri});var n;i&&l&&(oR(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,nR({id:e,draft:r.trees,relationUri:a.relation.uri}));break}case jA.TREE_NODE_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,o=(0,T.findNodeById)(a,n.nodeId);o&&(oR(o),nR({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case jA.TREE_NODE_NEW_PARENT_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,o=r.trees[e].root,i=(0,T.findNodeById)(o,n.nodeId);if(a.relatedEntity=i.entity,a.relatedNodeId=i.nodeId,a.editingMode=T.NODE_EDITING_MODES.addingParent,o===i)a.children=[o],r.trees[e].root=a;else{const e=(0,T.findParentNodeById)(o,n.nodeId),t=e.children.findIndex((e=>i===e));KA(e,a,t)}a.initialConnection=JA(a),eR({id:e,draft:r.trees,node:a});break}case jA.TREE_NODE_NEW_PARENT_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,o=(0,T.findNodeById)(a,n.nodeId),i=(0,T.findNodeById)(a,n.relatedNodeId),l=aR({id:e,draft:r.trees,relationUri:n.relation.uri});o&&l&&(iR({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=cR(r.trees[e].entitiesMap,[i,uR(l)]),nR({id:e,draft:r.trees,relationUri:o.relation.uri}));break}case jA.TREE_NODE_NEW_PARENT_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,o=(0,T.findNodeById)(a,n.nodeId);o&&(iR({id:e,draft:r.trees,currentNode:o}),nR({id:e,draft:r.trees,relationUri:o.relation.uri}));break}case jA.TREE_NODE_NEW_CHILD_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,o=r.trees[e].root,i=(0,T.findNodeById)(o,n.nodeId);a.relatedEntity=i.entity,a.editingMode=T.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=JA(a),eR({id:e,draft:r.trees,node:a});break}case jA.TREE_NODE_NEW_CHILD_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,o=(0,T.findParentNodeById)(a,n.nodeId),i=(0,T.findNodeById)(o,n.nodeId),l=aR({id:e,draft:r.trees,relationUri:n.relation.uri});o&&i&&l&&(oR(i),i.entity=l.entity,i.relation=l.relation,i.relations=[l.relation],nR({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case jA.TREE_NODE_NEW_CHILD_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,o=(0,T.findParentNodeById)(a,n.nodeId);o&&($A(o,n.nodeId),nR({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case jA.TREE_NODE_RELATION_TYPE_CHANGED:{const{id:e,node:n,relationTypeUri:a}=t.payload,o=aR({id:e,draft:r.trees,relationUri:n.relation.uri}).relation.type;o!==a&&(o&&tR({id:e,draft:r.trees,node:n,entity:null}),rR({id:e,draft:r.trees,node:n,relationTypeUri:a}));break}case jA.TREE_NODE_ENTITY_CHANGED:{const{id:e,node:n,entity:a}=t.payload;tR({id:e,draft:r.trees,node:n,entity:a});break}case Sb.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:o}=t,i=(0,T.getBaseUri)(n),l=lR(o,i,e.trees);if(l&&(0,T.isRelationUri)(i)){const t=(0,A.view)(l,e.trees);if((0,T.isActivenessAttrType)(r)){const n=(0,T.addEntitySpecialAttribute)({entity:t,attributeType:r});return pR({},e,{trees:(0,A.set)(l,n,e.trees)})}{const o=(0,T.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a});return pR({},e,{trees:(0,A.set)(l,o,e.trees)})}}return e}),e);case Sb.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:o}=t.payload,i=(0,T.getBaseUri)(a),l=lR(n,i,e.trees);if(l&&(0,T.isRelationUri)(i)){const t=(0,A.view)(l,e.trees);if((0,T.isActivenessAttrType)(r)){const n=(0,T.editEntitySpecialAttribute)({entity:t,attributeType:r,value:o});return pR({},e,{trees:(0,A.set)(l,n,e.trees)})}{const n=(0,T.editAttribute)({entity:t,attributeType:r,uri:a,value:o});return pR({},e,{trees:(0,A.set)(l,n,e.trees)})}}return e}case Sb.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,o=(0,T.getBaseUri)(n),i=lR(a,o,e.trees);if(i&&(0,T.isRelationUri)(o)){const t=(0,A.view)(i,e.trees);if((0,T.isActivenessAttrType)(r)){const n=(0,T.removeEntitySpecialAttribute)({entity:t,attributeType:r});return pR({},e,{trees:(0,A.set)(i,n,e.trees)})}{const a=(0,T.removeAttribute)({entity:t,attributeType:r,uri:n});return pR({},e,{trees:(0,A.set)(i,a,e.trees)})}}return e}case Sb.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:o,mode:i}=t.payload,l=(0,T.getBaseUri)(a),s=lR(r,l,e.trees);if((0,T.isRelationUri)(l)&&s){if(n){const t=(0,T.getAttributeTypeSubAttributes)(o,n);return pR({},e,{trees:(0,A.over)(s,(0,T.addDefaultValuesToComplexAttribute)({attributeType:n,subAttributes:t,metadata:o,mode:i,parentUri:a}),e.trees)})}{const t=(0,A.compose)(s,(0,A.lensPath)(["attributes"])),r=(0,A.compose)(s,(0,A.lensPath)(["type"])),n=(0,A.view)(r,e.trees),{attributes:l=[]}=(0,T.getRelationType)(o,n);return pR({},e,{trees:(0,A.over)(t,(0,T.addDefaultValuesToAttributes)({metadata:o,mode:i,attributeTypes:l,parentUri:a}),e.trees)})}}return e}case jA.TREE_ENTITIES_MAPPING_LOADED:{const{id:e,entitiesSubMap:n}=t.payload,a=r.trees[e].entitiesMap;r.trees[e].entitiesMap=qA(a,n);break}case jA.TREE_LOADED:{const{tree:e,id:n,graphTypes:a,activenessDate:o,isReversed:i}=t.payload,l=sR(r.trees[n]||{});r.trees[n]=pR({},l,e,{graphTypes:a,activenessDate:o,isReversed:i}),delete r.trees[n].errorMessage,r.trees[n].loading=!1;break}case jA.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,T.mapTree)(r.trees[e].root,{childrenProcessing:(0,T.sortTreeChildren)({sortField:a,sortOrder:o,typesLabelsMap:n})}));break}case jA.TREE_SECONDARY_LABEL_SHOWN:{const{id:e,show:n}=t.payload;r.trees[e].showSecondaryLabel=n,r.trees[e].root=pR({},r.trees[e].root);break}case jA.TREES_STATE_RESTORED:{const e=t.payload;Object.keys(e).forEach((t=>{r.trees[t]=r.trees[t]||{},r.trees[t]=pR({},r.trees[t],e[t]),r.trees[t].root&&(r.trees[t].root=pR({},r.trees[t].root))}));break}case jA.TREE_CHANGED:{const{id:e,tree:n}=t.payload;r.trees[e].root=n;break}case jA.TREE_REFRESHED:{const e=t.payload;r.trees[e].root=pR({},r.trees[e].root);break}case jA.TREE_NODE_EXPANDED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root;(0,T.findNodeById)(a,n).expanded=!0;break}case jA.TREE_CURRENT_ENTITY_SHOWN:{const{id:n,uri:a=(0,A.path)(["entity","uri"],e)}=t.payload;if(r.trees[n]){const e=GA(r.trees[n].root,a);r.trees[n].scrollTo=e}break}case jA.TREE_SCROLL_TO_NODE_RESET:{const e=t.payload;r.trees[e]&&(r.trees[e].scrollTo=null);break}case jA.TREE_ACTIVENESS_DATE_CHANGED:{const{id:e,activenessDate:n}=t.payload;r.trees[e].activenessDate=n;break}case jA.TREE_RELATION_REPOINTED:{const{entity:e,relation:n,newParent:a,isReversed:o}=t.payload,i=(0,A.prop)("uri"),l=i(e),s=i(a),c=(0,T.createRelationRepointCommand)({entityUri:l,relation:n,newEntityUri:s,isReversed:o});r.common.commands.push(c);break}case jA.TREE_RELATION_REMOVED:{const{relationUri:e}=t.payload;if((0,T.isTempUri)(e))r.common.commands=(0,A.reject)((0,T.isRelationCommandForUri)(e),r.common.commands);else{const t=(0,T.createRelationDeleteCommand)({relationUri:e});r.common.commands.push(t)}break}case jA.TREE_RELATION_CREATED:{const{entityUri:e,relation:n,parentEntityUri:a}=t.payload,o=(0,T.createRelationCreateCommand)({parentUri:a,relation:n,entityUri:e});r.common.commands.push(o);break}case jA.TREE_RELATION_EDITED:{const{oldRelation:e,newRelation:n,entityUri:a,newEntityUri:o,isReversed:i}=t.payload,l=o?(0,T.createRelationRepointCommand)({entityUri:a,newEntityUri:o,relation:n,isReversed:i}):(0,T.createRelationUpdateCommand)({oldRelation:e,newRelation:n});r.common.commands.push(l);break}case jA.TREE_COMMANDS_CLEARED:r.common.commands=[];break;case jA.TREE_CANCEL_CHILDREN_LOADING:{const{id:e,parentId:n}=t.payload,a=r.trees[e].root,o=(0,T.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===O_.PROFILE_OPERATION_UPDATE?t.payload:e},views:pI,sidePanelViews:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:mI,t=arguments.length>1?arguments[1]:void 0;return t.type===dI.SIDE_PANEL_VIEWS_LOADED?t.payload:e},entityRelatedAttributes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gR,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case yR.ENTITY_RELATED_ATTRIBUTES_ADDED:{const{attributeTypeUri:r,entityUri:n,attributes:a}=t.payload;return(0,A.assocPath)([r,n],a,e)}case zb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,T.isViewMode)(r)&&!n?gR:e}default:return e}}}),gI={getModule:()=>({id:"mdm",reducerMap:{dataTenants:mb,tenants:fb,metadata:Cb,profile:yI,tenant:bO,environment:wO,user:dO,ui:cO,search:Ov},sagas:[...EA,...pw,...uI,...Ev]}),selectors:c},fI=gI,hI=e=>{let{className:t}=e;const r=(0,hp.useDispatch)(),n=(0,hp.useSelector)(Do.qx),a=(0,hp.useSelector)(fI.selectors.getGoogleMapKey),o=(0,h.useMemo)((()=>((e,t)=>(0,A.when)((0,A.always)(!t),(0,A.reject)((0,A.propEq)("id",Z.om.MAP)))(e))([{id:Z.om.MAP,tooltipTitle:uo().text("View map"),Icon:cb()},{id:Z.om.PROFILE,tooltipTitle:uo().text("View entity details"),Icon:lb()}],a)),[a]);return E().createElement(KE,{className:t,modes:o,modeId:n,onChange:e=>{r(_o(n!==e?e:null))}})};hI.propTypes={className:fp().string};const EI=hI,bI=()=>E().createElement("div",{className:wd},E().createElement("div",{className:"Headers-styles-title--TvsMA"},uo().text("Profiles")),E().createElement("div",{className:Ad},E().createElement(ob,null),E().createElement(EI,{className:Rd})));var vI=r(12932),TI=r.n(vI),OI=r(83754),xI=r.n(OI);const CI=(0,Tp.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 SI(){return SI=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},SI.apply(this,arguments)}function wI(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 AI=e=>{let{value:t,tabs:r=[],onChange:n,tabClasses:a}=e,o=wI(e,["value","tabs","onChange","tabClasses"]);const i=CI(),l=(e,t)=>E().createElement("span",{className:i.labelWrapper},E().createElement(pd.Y,{value:e},E().createElement("span",{className:i.label},e)),t);return E().createElement(TI(),SI({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=wI(e,["label","value","additionalLabel","dataReltioId"]);return E().createElement(xI(),SI({classes:a||{root:i.tabRoot,disabled:i.disabled},key:r,value:r,label:l(t,n),"data-reltio-id":o},s))})))};function RI(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class _I extends h.PureComponent{constructor(){super(...arguments),this.getTabsData=()=>{const{tenantObject:e,tableViewTabs:t,selectedEntityTypes:r,metadata:n}=this.props,a=(0,Qy.ZK)(t,e);return(0,No.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){RI(e,t,r[t])}))}return e}({},e,{additionalLabel:E().createElement("span",{className:"Headers-styles-number--trErH"},"(",void 0===e.number?uo().text("N/A"):(0,io.k7)(e.number),")")})))},this.onTabChange=e=>{this.props.dispatch(xo(e))},this.onSelectColumns=e=>{const{dispatch:t,entityTypeTab:r,columnsForEntityType:n}=this.props;return t(Oo(r,e,n))},this.renderTabs=()=>{const{entityTypeTab:e}=this.props;return E().createElement("div",{className:"Headers-styles-tabsContainer--lhDXc"},E().createElement(AI,{value:e,tabs:this.getTabsData(),onChange:this.onTabChange}))}}render(){const{entityTypeTab:e,columnsForEntityType:t}=this.props;return E().createElement("div",{className:wd},this.renderTabs(),E().createElement("div",{className:Ad},E().createElement(Nd,{entityTypeUri:e,headColumns:t,onSelectColumns:this.onSelectColumns,"data-reltio-id":"reltio-search-table-add-remove-column",disabled:!e,showForDisabled:!0}),E().createElement(lh(),{orientation:"vertical",className:"Headers-styles-splitter--sCvn6"}),E().createElement(ob,null),E().createElement(EI,{className:Rd})))}}_I.propTypes={metadata:T.MetadataType,dispatch:fp().func,selectedEntityTypes:fp().array,tableViewTabs:fp().array,entityTypeTab:fp().string,columnsForEntityType:fp().array,tenantObject:fp().object};const II=(0,hp.connect)((e=>{const t=(0,Do.o4)(e);return{metadata:D().selectors.getMetadata(e),selectedEntityTypes:(0,I.DX)(e),tableViewTabs:(0,Do.gu)(e),entityTypeTab:t,columnsForEntityType:(0,Do.Gv)(e,t),tenantObject:(0,lo.t9)(e)}}))(_I);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}class DI extends E().PureComponent{constructor(){super(...arguments),this.entitiesTableRef=this.props.basicTableRef||E().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:k.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:Ce,payload:{entityTypeUri:e,columns:t}}))(n,(0,A.move)(t.columnIndex,r.columnIndex,o)))},this.changeColumnsListHandle=e=>{let{columns:t}=e;const{entityTypeUri:r,dispatch:n,headColumns:a}=this.props;n(Oo(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){NI(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:Se,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,A.path)(["headColumns","length"],e)||(0,A.difference)((0,A.omit)(["size"],t),(0,A.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 E().createElement(dy,{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})}}DI.propTypes={entities:fp().array,entityToHighlight:fp().string,selectedEntityUri:fp().string,headColumns:fp().array,onScroll:fp().func,entityTypeUri:fp().string,sortField:fp().string,sortOrder:fp().oneOf([Dd.oy,Dd.U9]),dndColumnReorderingEnabled:fp().bool,dispatch:fp().func,additionalColumns:fp().arrayOf(fp().shape({id:fp().string,label:fp().string})),onEntityClick:fp().func,onEntityHover:fp().func,entitiesImportStatus:fp().object,onEntityImportStatusChange:fp().func,basicTableRef:fp().shape({current:fp().object})},DI.defaultProps={entities:[],headColumns:[]};const PI=(0,uh.Z)(No.oq),kI=(0,hp.connect)((e=>{const t=(0,Do.tB)(e),r=(0,Do.Gv)(e,t),n=D().selectors.getMetadata(e),a=PI(n,t,r);return{sortField:(0,lo.NW)(e,{entityTypeUri:(0,Do.o4)(e)}),sortOrder:(0,lo.L9)(e,{entityTypeUri:(0,Do.o4)(e)}),dndColumnReorderingEnabled:!(0,Do.Ue)(e),headColumns:r,entityTypeUri:t,additionalColumns:a}}))(DI);var LI=r(14058),UI=r.n(LI);const jI=(0,Tp.Z)((()=>({container:{position:"relative",height:"100%",width:"100%"},closeButton:{position:"absolute",top:"7px",left:"7px",zIndex:1}}))),FI=(0,Tp.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"}}}))),MI=e=>{let{className:t,entity:r,children:n,classes:a,renderLabel:o=A.identity}=e;const i=FI({classes:a}),l=(0,C.AH)(),s=(0,C.QQ)(),c=(0,h.useCallback)((()=>{navigator.clipboard.writeText((0,T.getEntityId)(r))}),[r]);if((0,A.isNil)(r))return null;const u=(0,T.getLabel)(r.label),p=r.secondaryLabel,d=(0,T.getBusinessCardAttributesText)(l,r),m=(0,T.isActiveObject)(r),y=r.uri,g=(0,T.getEntityId)(r);return E().createElement("div",{className:v()(i.profileBandWrapper,t)},E().createElement("div",{className:v()(i.profileBand,{[i.inactive]:!m}),"data-entity-uri":y},E().createElement(S,{key:r.uri,entity:r,avatarClassName:i.profileIcon,imageClassName:i.imageProfileIcon}),E().createElement("div",{className:i.profileInfo},E().createElement("div",null,E().createElement(wy(),{variant:"h6",className:i.label},o(u)),p&&E().createElement(wy(),{variant:"subtitle2",className:i.secondaryLabel},p),d&&E().createElement(wy(),{variant:"subtitle1",className:i.businessCard},d)),E().createElement("div",{className:i.specialInfo},E().createElement("div",{className:i.entityType},E().createElement(wE,{entity:r,size:"medium",className:i.badge}),!(0,T.isTempUri)(y)&&s&&E().createElement(Wg(),{title:uo().text("Copy to clipboard")},E().createElement(wy(),{display:"inline",variant:"body2",className:i.entityId,onClick:c},uo().text("Entity ID"),": ",g))))),n&&E().createElement("div",null,n)))},VI=E().createContext(!1);VI.displayName="BlockImageGalleryDialogContext";var BI=r(31574),zI=r.n(BI);const HI=E().createContext([]);var YI=r(24436),WI=r.n(YI);function GI(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){qI(e,t,r[t])}))}return e}function qI(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ZI=(0,Tp.Z)((e=>({basicViewPaper:GI({display:"flex",flexDirection:"column"},e.basicView)})));function $I(){return $I=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},$I.apply(this,arguments)}const KI=(0,h.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=ZI();return E().createElement(WI(),$I({ref:t,className:n,classes:{root:o.basicViewPaper}},a),r)}));KI.displayName="BasicView";var XI=r(52574);const QI="1px solid #AFD4E9",JI=(0,Tp.Z)({decorator:{marginLeft:8,borderLeft:QI,"&:last-child":{borderLeft:"none","&:before":{borderLeft:QI}},"&:before":{top:0,height:14,width:5,borderBottom:QI,content:'""',display:"block",left:"0"},"&$plain":{"&:before":{width:0}}},plain:{},wrapper:{marginLeft:16,marginTop:-8}}),eN=e=>{let{className:t,children:r,plain:n=!1,enabled:a=!1}=e;const o=JI();return a?E().createElement("div",{"data-reltio-id":"branch-decorator",className:v()(o.decorator,{[o.plain]:n},t)},E().createElement("div",{className:o.wrapper},r)):E().createElement(E().Fragment,null,r)},tN="commentsContainerVisibilityArea",rN=E().createContext([]);rN.displayName="RelatedObjectUrisContext";const nN=()=>{},aN=E().createContext({comments:[],commentsMap:null,currentComment:null,updateCommentState:nN,clearCommentState:nN,getCommentState:()=>({}),getComment:nN,getComments:()=>new Promise(nN),getCommentsCount:nN,createComment:()=>new Promise(nN),editComment:()=>new Promise(nN),createReply:()=>new Promise(nN),resolveThread:nN,reOpenThread:nN,clearCurrentComment:nN,deleteComment:nN,sending:!1,loading:!1,pageToken:null,deleteReply:nN,editReply:()=>new Promise(nN)});function oN(){return oN=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},oN.apply(this,arguments)}aN.displayName="CollaborationContext";const iN=e=>E().createElement("svg",oN({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),E().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"})),lN=(0,Tp.Z)((()=>({root:{position:"relative",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"4px",cursor:"pointer"},icon:{"&:hover":{fillOpacity:.7}}})));function sN(){return sN=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},sN.apply(this,arguments)}const cN=E().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=lN();return E().createElement(Wg(),{title:n},E().createElement("div",sN({ref:t,className:v()(s.root,i),onClick:o},l),E().createElement(a,{className:s.icon}),r))}));cN.displayName="BasicCommentButton";const uN=(0,Tp.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"}}),pN=E().forwardRef(((e,t)=>{let{children:r,onClick:n}=e;const a=uN();return E().createElement(cN,{ref:t,tooltipTitle:uo().text("Show comment"),icon:iN,onClick:n,"data-reltio-id":"reltio-comment-button"},E().createElement("div",{className:a.childrenWrapper},r))}));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="CommentButton";const mN=e=>E().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),E().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"})),yN=e=>{let{className:t,onClick:r}=e;return E().createElement(cN,{className:t,onClick:r,tooltipTitle:uo().text("Add comment"),icon:mN})};var gN=r(94511),fN=r.n(gN),hN=r(7421);const EN=(0,Tp.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 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)}const vN=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=EN(),l=a?fN():E().Fragment,[s,c]=(0,h.useState)(null);return E().createElement(hN.Z,bN({className:v()(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 E().createElement(l,r,E().createElement(WI(),{className:v()(i.paper,null==n?void 0:n.root)},E().createElement("span",{className:v()(i.arrow,null==n?void 0:n.arrow),ref:c}),t))}))};var TN=r(93526),ON=r.n(TN);const xN=(0,Tp.Z)((e=>({menuItem:{minHeight:"32px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}}))),CN=(0,dd.T)(Qp()),SN=(0,h.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=A.identity}=e;const a=xN(),{disabled:o,text:i,tooltip:l,onClick:s,id:c="",selectable:u,selected:p}=r;return E().createElement(CN,{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&&E().createElement(Kp(),{checked:p,color:"primary"}),E().createElement(wy(),{classes:{root:a.menuText}},i))}));SN.displayName="DefaultMenuItemRenderer";const wN=(0,Tp.Z)((e=>({buttonRoot:{"&$selected":{color:e.palette.action.active,backgroundColor:(0,Pm.alpha)(e.palette.action.active,.12),"&:hover":{backgroundColor:(0,Pm.alpha)(e.palette.action.active,.15)}}},selected:{},paper:{minWidth:"112px"}})));function AN(){return AN=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},AN.apply(this,arguments)}function RN(e){let{className:t,menuId:r,buttonComponent:n=pE(),buttonContent:a,menuItems:o=[],buttonProps:i={},popoverProps:l={},onMenuOpen:s=A.identity,onMenuClose:c=A.identity,MenuItemRenderer:u=SN}=e;const p=n,d=wN(),m=(0,h.useRef)(),[y,g]=(0,h.useState)(!1);(0,IE.D)((()=>{y?s():c()}),[y]);const f=(0,h.useCallback)((e=>{null==e||e.stopPropagation(),g((e=>!e))}),[]);return E().createElement(E().Fragment,null,E().createElement(p,AN({"data-reltio-id":"drop-down-menu-button",ref:m,className:v()(d.buttonRoot,{[d.selected]:y},t),onClick:f,"aria-pressed":y,"aria-controls":y?r:void 0,"aria-haspopup":"true"},i),a),E().createElement(ON(),AN({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)=>E().createElement(u,{item:e,key:t,onMenuClose:f})))))}const _N=(e,t)=>{(0,h.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])},IN=(e,t)=>{const r=e.relatedObjectUris.indexOf(t);if(r>=0)return e.relatedObjectUris[1-r]},NN=e=>`${uo().date(e,"LT")} ${uo().date(e,"LL")}`,DN=e=>`comment/${e.commentId}`,PN=(e,t)=>`comment/${e.commentId}/reply/${t.replyId}`,kN=(e,t)=>{let r=e;for(const e of t)r=r.split(`+${e}`).join(`@[${e}](${e})`);return r},LN=E().createContext({});LN.displayName="EntitiesMapContext";const UN=(0,Tp.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 jN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const FN=e=>{let{comment:t,className:r}=e;const n=UN(),a=(0,h.useContext)(LN),o=(0,C.AH)(),i=(0,C.eh)();return E().createElement(zI(),{className:r},(()=>{switch(t.objectType){case T.CollaborationObjectTypes.ENTITY_ATTRIBUTE:{const e=(0,T.getAttributeTypeUriByValueUri)(t.objectId,i.type),r=(0,T.findAttributeTypeByUri)(o,e);return E().createElement(E().Fragment,null,E().createElement(wy(),{className:n.title},uo().text("Selected attribute:")),E().createElement(wy(),{className:n.label},null==r?void 0:r.label))}case T.CollaborationObjectTypes.RELATION_ATTRIBUTE:{const e=t.relatedObjectUris.find((0,A.startsWith)("configuration/relationTypes")),r=e&&(0,T.getAttributeTypeUriByValueUri)(t.objectId,e),a=r&&(0,T.findAttributeTypeByUri)(o,r);return E().createElement(E().Fragment,null,E().createElement(wy(),{className:n.title},uo().text("Selected attribute:")),E().createElement(wy(),{className:n.label},null==a?void 0:a.label))}case T.CollaborationObjectTypes.ENTITY:return E().createElement(E().Fragment,null,E().createElement(wy(),{className:n.title},uo().text("Selected profile:")),E().createElement(Yd,{className:v()(n.label,n.link),value:(0,T.getEntityUriForLink)(i)},(0,T.getLabel)(i.label)));case T.CollaborationObjectTypes.RELATION:{const e=IN(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){jN(e,t,r[t])}))}return e}({},a[e]||{},{uri:e});return E().createElement(E().Fragment,null,E().createElement(wy(),{className:n.title},uo().text("Selected relation:")),E().createElement(wy(),{className:n.label},E().createElement(Yd,{className:n.link,value:(0,T.getEntityUriForLink)(i)},(0,T.getLabel)(i.label)),e&&E().createElement(E().Fragment,null,` ${uo().text("to")} `,E().createElement(Yd,{className:n.link,value:(0,T.getEntityUriForLink)(r)},r.label?(0,T.getLabel)(r.label):(0,T.getEntityId)(r)))))}case T.CollaborationObjectTypes.POTENTIAL_MATCH:{var e;const r=IN(t,i.uri),o={uri:r,label:null===(e=a[r])||void 0===e?void 0:e.label};return E().createElement(E().Fragment,null,E().createElement(wy(),{className:n.title},uo().text("Selected potential match:")),E().createElement(wy(),{className:n.label},E().createElement(Yd,{className:n.link,value:(0,T.getEntityUriForLink)(i)},(0,T.getLabel)(i.label)),r&&E().createElement(E().Fragment,null,` ${uo().text("and")} `,E().createElement(Yd,{className:n.link,value:(0,T.getEntityUriForLink)(o)},o.label?(0,T.getLabel)(o.label):(0,T.getEntityId)(o)))))}default:return null}})())},MN=E().createContext([]);MN.displayName="UsersContext";const VN=(0,Tp.Z)((e=>({root:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",wordBreak:"break-word"}}))),BN=e=>{let{comment:t,className:r}=e;const n=VN(),a=(0,h.useContext)(MN);return E().createElement(wy(),{className:v()(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?E().createElement(Uy(),{href:`mailto:${t.email}`,underline:"hover"},e):e})).map(((e,t)=>E().createElement(h.Fragment,{key:t},e))))},zN=(0,Tp.Z)((e=>({root:{width:"32px",height:"32px",fontSize:"12px",color:e.palette.text.secondary,backgroundColor:"rgba(144, 164, 174, 0.2)"}})));function HN(){return HN=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},HN.apply(this,arguments)}const YN=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=zN();return E().createElement(x(),HN({},n,{className:v()(a.root,t)}),r.split(".").map((e=>e[0].toUpperCase())).join(""))};var WN=r(2271);const GN=r(47503).$+1,qN=(0,Tp.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:GN+"!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 ZN(){return ZN=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},ZN.apply(this,arguments)}const $N=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=qN({placeholder:n?"":a}),l=(0,h.useContext)(MN);return E().createElement("div",{className:v()(i.root,r)},E().createElement(WN.r,ZN({},o,{value:n,placeholder:a,onChange:(e,r,n,a)=>{t(r,n,(0,A.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}}),E().createElement(WN.p,{trigger:"+",data:l.map((e=>{let{username:t}=e;return{id:t,display:t}})),displayTransform:(e,t)=>`+${t}`,appendSpaceOnAdd:!0,className:i.mention})))},KN=(0,Tp.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"}}}),XN=e=>{switch(e){case"open":return uo().text("Reply...");case"resolved":return uo().text("Adding a comment will re-open this");default:return""}},QN=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=KN({isEditing:d}),[y,g]=(0,h.useState)(!1),{createReply:f,createComment:b,sending:T,editComment:O,editReply:x,getCommentState:S,updateCommentState:w,clearCommentState:R}=(0,h.useContext)(aN),_=(0,C.qg)(),I=(e=>{let{comment:t,reply:r,isEditingComment:n,isEditingReply:a}=e;return(0,A.isNil)(t)?"comment/new":n?DN(t):a?PN(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:kN(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}=S(n,I),L=""!==D.trim(),U=y||L,j=null==l?void 0:l.status,F=()=>{null==p||p(),R(n,I)};(0,h.useEffect)((()=>{i&&i.current.forceUpdate()}),[i,U]);const M=d?"small":"medium";return E().createElement(zI(),{className:v()(m.root,r)},E().createElement("form",{onSubmit:e=>(e.preventDefault(),(0,A.cond)([[(0,A.always)(!l),()=>b({content:P,namedUsers:k,objectType:o,uri:n,relatedObjectUris:a})],[(0,A.always)(c),()=>O({content:P,namedUsers:k,commentId:l.commentId,objectType:o,replies:l.replies,relatedObjectUris:a,uri:n})],[(0,A.always)(u),()=>x({content:P,namedUsers:k,commentId:l.commentId,replyId:s.replyId})],[A.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},E().createElement(zI(),{className:m.main},!d&&E().createElement(YN,{classes:{root:m.avatar}},_),E().createElement($N,{className:m.textField,disabled:T,onChange:(e,t,r)=>w(n,I,{value:e,plainTextValue:t,mentions:r}),inputRef:t,value:D,onFocus:()=>g(!0),onBlur:()=>g(!1),placeholder:XN(j)})),U&&E().createElement(zI(),{className:m.buttons},E().createElement(pE(),{className:m.button,variant:"contained",color:"primary",disabled:!L||T,type:"submit",size:M},((e,t,r)=>t||r?uo().text("Edit"):"open"===e||"resolved"===e?uo().text("Reply"):uo().text("Comment"))(j,c,u)),E().createElement(pE(),{disabled:T,onClick:()=>F(),className:m.button,variant:"outlined",color:"primary",size:M},uo().text("Cancel")))))},JN=(0,Tp.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"}}))),eD=e=>{let{onReply:t,className:r,uri:n,comment:a,relatedObjectUris:o,objectType:i}=e;const l=JN(),s=(0,h.useRef)(),c=(0,C.qg)(),{commentId:u,createdBy:p,createdTime:d,status:m}=a,y="resolved"===m,g=p===c,{resolveThread:f,reOpenThread:b,sending:v,deleteComment:T,updateCommentState:O,getCommentState:x}=(0,h.useContext)(aN),S=DN(a),{isEditing:w}=x(n,S),A=(0,h.useCallback)((e=>O(n,S,{isEditing:e})),[S,O,n]);_N(s,w);const R=(0,h.useMemo)((()=>y?[{text:uo().text("Delete"),onClick:()=>T({uri:n,commentId:u})}]:[{text:uo().text("Edit"),onClick:()=>A(!0)},{text:uo().text("Delete"),onClick:()=>T({uri:n,commentId:u})}]),[u,T,y,A,n]),_=E().createElement(QN,{inputRef:s,uri:n,relatedObjectUris:o,objectType:i,onCancel:()=>A(!1),isEditingComment:w,comment:a});return E().createElement(zI(),{className:r},E().createElement(zI(),{className:l.header},E().createElement(YN,{classes:{root:l.avatar}},p),E().createElement(zI(),{width:"100%"},E().createElement(wy(),{className:l.username},p)),E().createElement(wy(),{className:l.createdAt},NN(d)),g&&E().createElement(RN,{buttonComponent:xd.k,buttonProps:{icon:jd(),tooltipTitle:uo().text("Open menu")},popoverProps:{PopoverClasses:{root:l.dropdownMenu}},menuItems:R,menuId:"collaboration-comment-menu"})),E().createElement(zI(),{className:l.body},E().createElement(FN,{comment:a,className:l.commentTarget}),w?_:E().createElement(BN,{comment:a,className:l.message}),E().createElement(zI(),{className:l.buttons},E().createElement(Uy(),{className:l.button,onClick:t,component:"button",underline:"hover"},uo().text("Reply")),!y&&E().createElement(Uy(),{disabled:v,className:l.button,onClick:()=>{f({commentId:u,uri:n})},component:"button",underline:"hover"},uo().text("Resolve")),y&&E().createElement(Uy(),{disabled:v,className:l.button,onClick:()=>{b({commentId:u,uri:n})},component:"button",underline:"hover"},uo().text("Re-open")))))},tD=(0,Tp.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"}}))),rD=e=>{let{className:t,reply:r,uri:n,comment:a,popperRef:o}=e;const i=(0,h.useRef)(),l=(0,C.qg)(),{createdBy:s,action:c,createdTime:u}=r,p=s===l&&"resolved"!==a.status,{deleteReply:d,updateCommentState:m,getCommentState:y}=(0,h.useContext)(aN),g=PN(a,r),{isEditing:f}=y(n,g),b=(0,h.useCallback)((e=>m(n,g,{isEditing:e})),[g,m,n]);_N(i,f);const T=tD(),O=(0,h.useMemo)((()=>[{text:uo().text("Edit"),onClick:()=>b(!0)},{text:uo().text("Delete"),onClick:()=>d({uri:n,commentId:a.commentId,reply:r})}]),[d,n,a.commentId,r,b]),x=E().createElement(QN,{inputRef:i,popperRef:o,uri:n,onCancel:()=>b(!1),isEditingReply:f,reply:r,comment:a});return E().createElement(zI(),{className:v()(T.root,t)},E().createElement(YN,{classes:{root:T.avatar}},s),E().createElement(zI(),{className:T.replyArea},E().createElement(zI(),{className:T.header},E().createElement(wy(),{className:T.username},s),"resolve"===c&&E().createElement(wy(),{className:T.marked},uo().text("Marked as resolved")),"reopen"===c&&E().createElement(wy(),{className:T.marked},uo().text("Re-opened"))),"resolve"!==c&&(f?x:E().createElement(BN,{className:T.message,comment:r})),E().createElement(wy(),{className:T.createdAt},NN(u))),p&&E().createElement(RN,{buttonComponent:xd.k,buttonProps:{icon:jd(),tooltipTitle:uo().text("Open menu")},menuItems:O,menuId:"collaboration-comment-menu"}))},nD=(0,Tp.Z)((()=>({root:{maxWidth:"100%",padding:"8px 4px 10px 16px"},messages:{},repliedComment:{marginBottom:"2px"},replies:{marginLeft:"40px"},sendMessageArea:{marginLeft:"40px"},comment:{}}))),aD=(0,h.memo)((e=>{let{uri:t,relatedObjectUris:r,objectType:n,classes:a,popperRef:o,messagesRef:i,comment:l}=e;const s=(0,h.useRef)(),c=nD({classes:a}),u=E().createElement(QN,{className:c.sendMessageArea,inputRef:s,popperRef:o,uri:t,relatedObjectUris:r,objectType:n,comment:l});return E().createElement(zI(),{className:c.root},l&&E().createElement(E().Fragment,null,E().createElement("div",{className:c.messages,ref:i},E().createElement(eD,{comment:l,uri:t,onReply:()=>{s.current.focus()},className:c.comment,relatedObjectUris:r,objectType:n}),E().createElement(zI(),{className:c.replies},l.replies.map((e=>E().createElement(rD,{key:e.replyId,className:c.repliedComment,reply:e,uri:t,comment:l}))))),u),!l&&u)})),oD=(0,Tp.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"}}))),iD=e=>{let{uri:t,relatedObjectUris:r,objectType:n,anchorEl:a,onClose:o,open:i,comment:l}=e;const[s,c]=(0,h.useState)(0),u=oD({scrollWidth:s,hasScroll:0!==s}),p=(0,h.useRef)(null),{resolveThread:d,loading:m,sending:y}=(0,h.useContext)(aN),g=1+(null==l?void 0:l.replies.length);return E().createElement(vN,{popperRef:p,anchorEl:a,open:i,placement:"right-start",onClose:o,className:u.popper},E().createElement(zI(),{className:u.header},E().createElement(zI(),{className:u.headerInfo},E().createElement(wy(),{className:u.title},uo().text("Comments")),l&&!m&&E().createElement(wy(),{className:u.counter},uo().number(g)," ",1===g?uo().text("item"):uo().text("items"))),l&&!m&&E().createElement(xd.k,{className:u.resolveButton,size:"S",onClick:()=>{d({commentId:l.commentId,uri:t})},disabled:y,showForDisabled:!0,tooltipTitle:uo().text("Resolve"),icon:Tm(),color:"primary"})),!m&&E().createElement(aD,{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}))},lD=(0,Tp.Z)((()=>({root:{display:"flex",alignItems:"start"},addButton:{visibility:"hidden","&$showAlways":{visibility:"visible"},".commentsContainerVisibilityArea:hover &":{visibility:"visible"}},showAlways:{}}))),sD=e=>{let{className:t,uri:r,objectType:n,relatedObjectUris:a,onChangePopupVisibility:o,allowOnlyOneComment:i=!1,showAlways:l=!1}=e;const s=lD(),[c,u]=(0,h.useState)(null),[p,d]=(0,h.useState)(!1),m=p&&Boolean(c),{currentComment:y,commentsMap:g,getComment:f,clearCurrentComment:b,objectTypes:T}=(0,h.useContext)(aN),O=!!g&&(!T||T.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,IE.D)((()=>{o&&o(m)}),[m]);const w=(0,h.useContext)(rN),A=(0,h.useMemo)((()=>w?[...a,...w]:a),[w,a]);return O&&E().createElement("div",{className:v()(s.root,t)},C&&E().createElement(yN,{className:v()(s.addButton,{[s.showAlways]:l||S}),onClick:e=>{u(e.currentTarget),d(!0)}}),x.map((e=>{let{replies:t,commentId:r}=e;return E().createElement(pN,{ref:r===(null==y?void 0:y.commentId)?u:null,key:r,onClick:()=>(e=>{f(e),d(!0)})(r)},1+t)})),E().createElement(iD,{anchorEl:c,open:m,onClose:()=>{u(null),b(),d(!1)},uri:r,relatedObjectUris:A,objectType:n,comment:y}))},cD=(0,Tp.Z)({label:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"16px"}});function uD(){return uD=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},uD.apply(this,arguments)}const pD=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=cD();return E().createElement(wy(),uD({className:v()(o.label,n),component:"span"},a),t,r&&E().createElement(cd,null))},dD=E().createContext(null);dD.displayName="EntityContext";const mD=(0,Tp.Z)((e=>({container:{height:"16px",borderColor:(0,Pm.alpha)(e.palette.primary.main,.54)},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px",color:e.palette.primary.main}}))),yD=(0,dd.T)(Jg()),gD=e=>{let{className:t,attributeType:r,nonOvValues:n=[],nonOvTotal:a}=e;const o=mD(),i=(0,C.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,T.getEntityUriFromAttributeUri)(a):null;if(o&&(0,T.isEntityUri)(o)){const t=(0,T.getEntityUriFromAttributeUri)(r.uri);if(!e||e.type===t)return{uri:o,type:t};const n=(0,T.getParentUri)(a),i=(0,T.findAttributeValueByUri)(e,n);return{uri:(0,T.getReferencedEntityUriFromAttrValue)(i),type:t}}return e?{uri:e.uri,type:e.type}:null})((0,h.useContext)(dD),n,r),s=(0,C.fC)(null==l?void 0:l.type),c=(0,h.useCallback)((()=>{i({uri:l.uri,screen:"sources"})}),[i,l]);if(!a)return null;const u=n.length?n.map(((e,t)=>E().createElement("div",{key:t},(0,T.isComplexAttribute)(r)?(0,T.getLabel)(e.label):E().createElement(Zd.x,{value:(0,T.getAttributeValue)(e),dataTypeDefinition:(0,T.getAttrDataTypeDefinition)(r),rich:!1})))):null;return E().createElement(yD,{tooltipTitle:u,tooltipPlacement:"bottom",label:`+ ${a}`,variant:"outlined",onClick:null!=l&&l.uri&&s?c:void 0,classes:{root:v()(o.container,t),label:o.label}})};function fD(){return fD=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},fD.apply(this,arguments)}const hD=e=>E().createElement("svg",fD({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),E().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})),ED=E().createContext({showDescription:!1,showNavigateToGraph:!0});ED.displayName="FeaturesContext";const bD=(0,Tp.Z)((()=>({icon:{display:"inline-flex",marginLeft:"8px",verticalAlign:"middle"}}))),vD=e=>{let{className:t,description:r}=e;const{showDescription:n}=(0,h.useContext)(ED),a=bD();return r&&n?E().createElement(Wg(),{title:r,placement:"bottom"},E().createElement("span",{"data-reltio-id":"reltio-description-icon",className:v()(a.icon,t)},E().createElement(hD,null))):null},TD=E().createContext({appearance:void 0,attributes:void 0,roles:void 0,tags:void 0});TD.displayName="HistoryDiffContext";const OD=E().createContext({highlightedValuesUris:[],highlightedClassName:""});function xD(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}OD.displayName="HighlightedValuesContext";const CD=(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=SD(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}),[])},SD=(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,T.findAttributeTypeByUri)(t,n.type);a&&"object"!=typeof a&&(0,T.isOv)(n)?e.push(wD(a,o)):a&&"object"==typeof a&&!Array.isArray(a)&&e.push(CD(o,a,r,t))}return e}),[])},wD=(e,t)=>{switch(null==t?void 0:t.type){case T.DataTypes.TYPE_DATE:return new Date(e).getTime();case T.DataTypes.TYPE_TIMESTAMP:return isNaN(Number(e))?new Date(e).getTime():new Date(Number(e)).getTime();default:return e}};function AD(){return AD=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},AD.apply(this,arguments)}const RD=e=>E().createElement("svg",AD({width:11,height:11,viewBox:"0 0 11 11"},e),E().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"})),_D=(0,Tp.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}}))),ID=(0,h.forwardRef)(((e,t)=>{let{value:r,attributeType:n,children:a,className:o,onClick:i}=e;const l=_D(),{generatePivotingUrl:s}=(0,h.useContext)(zd),c=s({uiPath:(0,C.Qh)(),uri:n.uri,value:JSON.stringify(r)}),u=(0,h.useCallback)((e=>{(0,Ep.rR)(e)||(i(),e.preventDefault()),e.stopPropagation()}),[i]);return E().createElement("a",{ref:t,href:c,onClick:u,className:v()(l.link,o)},a)}));ID.displayName="PivotingUriLink";const ND=ID,DD=(0,Tp.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"}}))),PD=e=>{let{attributeType:t,label:r,entities:n,generatedValue:a,onSeeAllClick:o,total:i}=e;const l=DD(),s=i>6,c=Boolean(r);return E().createElement("div",{className:l.container},E().createElement("div",{className:l.header},E().createElement("div",{className:l.title},uo().text("Pivot profiles")),E().createElement("div",{className:l.divider}),E().createElement("div",{className:l.headerCount},uo().number(i,"0,0")+" "+(1===i?uo().text("item"):uo().text("items")))),c&&E().createElement("div",{className:l.entityTypeLabel},r),E().createElement("div",{className:l.body},n.map((e=>E().createElement("div",{key:e.uri,className:l.entityContainer},E().createElement(S,{entity:e,avatarClassName:l.profileIcon}),E().createElement(Yd,{className:l.entityLabel,value:(0,T.getEntityUriForLink)(e)},(0,T.getLabel)(e.label)))))),s&&E().createElement("div",{className:l.footer},E().createElement(ND,{value:a,attributeType:t,className:l.seeAllButton,onClick:o},uo().text("See all"))))},kD=(0,Tp.Z)((e=>({icon:{marginRight:"8px",verticalAlign:"middle",width:"12px",height:"12px"},content:{color:e.palette.primary.main,cursor:"pointer",lineHeight:"16px"}}))),LD=(0,Tp.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"}}}),UD=e=>{let{value:t,attributeType:r,children:n,className:a}=e;const o=LD(),i=kD(),l=(0,h.useContext)(HI)||[],s=(0,C.ax)("openPivotingPerspective"),c=(0,C.AH)()||{},u=(0,T.isNested)(r)?CD(r,t.value,l,c):wD(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,A.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,T.getLastUriPart)(t),r]}))))):((e,t)=>[{[e.name]:t}])(r,u):void 0,g=()=>{s({value:y,attributeType:r})},{entities:f,total:b,loadPivotingData:v}=(e=>{let{value:t,attributeType:r,entityType:n}=e;const[a,o]=(0,h.useState)([]),[i,l]=(0,h.useState)(0),s=(0,zh._)(),c=(0,C.eh)(),u=(0,C.mU)(),p=n||(null==c?void 0:c.type),d=(0,h.useMemo)((()=>(0,T.convertPivotingValueToSearchFilters)({value:t,attributeType:r,entityType:p})),[r,p,t]),m=(0,h.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){xD(e,t,r[t])}))}return e}({max:6,sort:"label"},u||{})),[u]),y=(0,h.useCallback)((()=>{s(Promise.all([(0,T.getFilteredEntities)({filters:d,options:m}),(0,T.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?E().createElement(Wg(),{arrow:!0,placement:"right-start",classes:o,disableInteractive:!1,onOpen:v,title:E().createElement(PD,{generatedValue:y,attributeType:r,label:null==m?void 0:m.label,onSeeAllClick:g,entities:f,total:b})},E().createElement("span",{className:a},E().createElement(RD,{className:i.icon}),E().createElement(ND,{onClick:g,className:i.content,value:y,attributeType:r},n))):E().createElement(E().Fragment,null,n)};function jD(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){FD(e,t,r[t])}))}return e}function FD(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const MD=(0,Tp.Z)((e=>({root:{display:"flex",alignItems:"start",justifyContent:"space-between"},commentsContainer:{height:"15px",marginRight:"-4px"},attributeValue:{verticalAlign:"middle",wordBreak:"break-all"},updateAttribute:jD({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},T.historyPalettes[T.HistoryOperations.updateAttribute],{"& > a":{color:T.historyPalettes[T.HistoryOperations.updateAttribute].color}}),insertAttribute:jD({width:"fit-content"},T.historyPalettes[T.HistoryOperations.insertAttribute],{"& > a":{color:T.historyPalettes[T.HistoryOperations.insertAttribute].color}}),deleteAttribute:jD({width:"fit-content",padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},T.historyPalettes[T.HistoryOperations.deleteAttribute],{"& > a":{color:T.historyPalettes[T.HistoryOperations.deleteAttribute].color}}),multilineAttribute:{width:"fit-content"},ovFalse:e.inactive}))),VD=e=>{let{className:t,attributeType:r=null,attributeValue:n,inlined:a}=e;const o=MD(),{highlightedValuesUris:i=[],highlightedClassName:l}=(0,h.useContext)(OD),{appearance:s}=(0,h.useContext)(TD),c=(0,T.getHistoryAppearanceByUri)(n.uri,s),u=(0,T.getHistoryAttributeClassName)(c),p=E().createElement(Zd.x,{value:(0,T.getAttributeValue)(n),dataTypeDefinition:(0,T.getAttrDataTypeDefinition)(r)}),d=(0,T.isRelationUri)(n.uri)?T.CollaborationObjectTypes.RELATION_ATTRIBUTE:T.CollaborationObjectTypes.ENTITY_ATTRIBUTE;return a||u?E().createElement("div",{className:v()(t,{[l]:i.includes(n.uri)})},E().createElement(UD,{value:n,attributeType:r,key:n.uri,className:v()({[o.multilineAttribute]:!a})},E().createElement("span",{className:v()(o.attributeValue,o[u],{[o.ovFalse]:!(0,T.isOv)(n)}),"data-reltio-id":"reltio-attribute-value"},p))):E().createElement("div",{className:v()(t,o.root,tN,{[l]:i.includes(n.uri)})},E().createElement(UD,{value:n,attributeType:r,key:n.uri},E().createElement("span",{className:v()(o.attributeValue,{[o.ovFalse]:!(0,T.isOv)(n)}),"data-reltio-id":"reltio-attribute-value"},p)),E().createElement(sD,{className:o.commentsContainer,uri:n.uri,relatedObjectUris:(0,T.createRelatedObjectUris)(d,{uri:n.uri}),objectType:d}))};var BD=r(84419),zD=r.n(BD);const HD=(0,Tp.Z)({expandButton:{"&:hover":{backgroundColor:"transparent"}},expandIcon:{transition:"transform .15s ease"},expanded:{transform:"rotate(90deg)"}});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)}const WD=e=>{const t=HD(),{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 E().createElement(Np.T,YD({icon:zD(),size:"XXS",disableRipple:!0,iconClassName:v()(t.expandIcon,{[t.expanded]:r}),className:v()(n,t.expandButton),"data-reltio-id":"arrow-expand-button"},a))},GD=(0,Tp.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 qD(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ZD=e=>{let{attributeTypesList:t,attributeValue:r,label:n,expanded:a=!1,children:o,showNonOv:i,attributeType:l,LabelRenderer:s,RightSlot:c}=e;const u=GD(),p=r.uri,[d,m]=(0,h.useState)(!1),{highlightedValuesUris:y=[],highlightedClassName:g}=(0,h.useContext)(OD);(0,h.useEffect)((()=>{m(a)}),[a]);const f=(t||[]).some((e=>(0,T.isAnalyticAttribute)(e))),b=(0,h.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){qD(e,t,r[t])}))}return e}({attributes:f?null:r.value,analyticsAttributes:f?r.value:null},(0,T.isSpecialAttribute)(l)?r.value:{})),[r,f,l]),O=(0,T.isRelationUri)(r.uri)?T.CollaborationObjectTypes.RELATION_ATTRIBUTE:T.CollaborationObjectTypes.ENTITY_ATTRIBUTE;return E().createElement("div",{className:u.complexContainer},E().createElement("div",{className:v()(u.labelContainer,tN)},E().createElement(WD,{onClick:()=>m((e=>!e)),expanded:d}),s?E().createElement(s,{attributeType:l,attributeValue:r}):E().createElement(E().Fragment,null,E().createElement(wy(),{component:"span",variant:"body2",classes:{body2:u.label},className:v()({[g]:y.includes(r.uri),[u.ovFalse]:!(0,T.isOv)(r)}),"data-reltio-id":"reltio-attribute-complex-label"},n),E().createElement("div",{className:u.spacer}),c&&E().createElement(c,{attributeType:l,attributeValue:r}),E().createElement(sD,{uri:r.uri,relatedObjectUris:(0,T.createRelatedObjectUris)(O,{uri:r.uri}),objectType:O}))),d&&E().createElement(kF,{attrTypes:t,entity:b,drawLines:!0,parentUri:p,showNonOv:i},o))};ZD.propTypes={children:fp().node,label:fp().oneOfType([fp().string,fp().node]),attributeTypesList:fp().arrayOf(T.AttributeTypeType),attributeValue:fp().oneOfType([T.NestedAttributeValueType,T.ReferenceAttributeValueType]),expanded:fp().bool,showNonOv:fp().bool,attributeType:T.AttributeTypeType,LabelRenderer:fp().elementType,RightSlot:fp().elementType};var $D=r(71896);function KD(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){XD(e,t,r[t])}))}return e}function XD(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const QD=(0,Tp.Z)({label:{textDecoration:"none",verticalAlign:"middle"},updateAttribute:KD({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},T.historyPalettes[T.HistoryOperations.updateAttribute]),insertAttribute:KD({width:"fit-content"},T.historyPalettes[T.HistoryOperations.insertAttribute]),deleteAttribute:KD({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},T.historyPalettes[T.HistoryOperations.deleteAttribute]),pivotingTooltip:{marginLeft:"4px"}});function JD(){return JD=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},JD.apply(this,arguments)}const eP=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=QD(),{appearance:o}=(0,h.useContext)(TD),i=(0,h.useMemo)((()=>{const e=(0,T.getHistoryAppearanceByUri)(t.uri,o),n=(0,T.getHistoryAttributeClassName)(e),i=t.label?t.label:(0,T.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return E().createElement(UD,{className:a.pivotingTooltip,value:t,attributeType:r},E().createElement(zI(),{component:"span",className:v()(a[n],a.label)},E().createElement($D.Z,{text:(0,T.getLabel)(i)})))}),[o,a,t,r]);return E().createElement(ZD,JD({label:i,attributeValue:t,attributeTypesList:(0,T.getAttributeTypeSubAttributes)({},r),attributeType:r},n))};eP.propTypes=T.NestedAttributeType;const tP=(0,h.memo)(eP);var rP=r(24217),nP=r(16782);const aP=(0,Tp.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}})));function oP(){return oP=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},oP.apply(this,arguments)}const iP=e=>{const t=aP(),r=(0,nP.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=v()(t.link,a);return r&&n?E().createElement(rP.rU,oP({to:n.replace(window.location.origin,""),className:i},o)):E().createElement("a",oP({href:n,className:i},o))};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){sP(e,t,r[t])}))}return e}function sP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cP=(0,Tp.Z)((e=>({relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary},updateAttribute:lP({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},T.historyPalettes[T.HistoryOperations.updateAttribute]),insertAttribute:lP({width:"fit-content"},T.historyPalettes[T.HistoryOperations.insertAttribute]),deleteAttribute:lP({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},T.historyPalettes[T.HistoryOperations.deleteAttribute]),ovFalse:e.inactive})));function uP(){return uP=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},uP.apply(this,arguments)}const pP=(0,h.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=cP(),o=(0,C.AH)(),i=(0,C.Qh)(),l=(0,T.getReferencedEntityUriFromAttrValue)(t),s=(0,h.useMemo)((()=>(0,T.getAttributeTypeSubAttributes)(o,r)),[r,o]),{appearance:c}=(0,h.useContext)(TD),{generateEntityUrl:u}=(0,h.useContext)(zd),p=(0,h.useMemo)((()=>{const e=(0,T.getHistoryAppearanceByUri)(t.uri,c),r=(0,T.getHistoryAttributeClassName)(e),n=null!=l&&l.startsWith("changeRequests")?"dcrReview":"profile";return E().createElement(iP,{href:(0,T.isEmptyValue)(c)?u({uiPath:i,uri:l,screen:n}):void 0,className:v()(a[r],{[a.ovFalse]:!(0,T.isOv)(t)})},E().createElement($D.Z,{text:(0,T.getLabel)(t.label)}),t.relationshipLabel&&E().createElement("span",{className:a.relationshipLabel},E().createElement($D.Z,{text:t.relationshipLabel})))}),[t,c,i,l,a,u]);return E().createElement(ZD,uP({attributeTypesList:s,attributeValue:t,label:p,attributeType:r},n))}));pP.displayName="ReferenceAttribute";const dP=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 T.DataTypes.TYPE_NESTED:return E().createElement(tP,t);case T.DataTypes.TYPE_REFERENCE:return E().createElement(pP,t);default:return E().createElement(VD,t)}}}.build(t,e)};function mP(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){yP(e,t,r[t])}))}return e}function yP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gP="13px",fP="16px",hP={titleRow:{display:"inline-block",minHeight:"16px"},title:{wordBreak:"break-all",verticalAlign:"middle"},ovIcon:{marginLeft:"8px",textIndent:0},descriptionIcon:{textIndent:0}},EP=(0,Tp.Z)({paddingWrapper:{paddingTop:"3px",paddingBottom:"5px","&:last-child":{paddingBottom:"2px"}},paddingWrapperWithLines:{paddingBottom:"1px","&:last-child":{paddingBottom:"2px"}}}),bP=(0,Tp.Z)(mP({wrapper:{fontSize:gP,lineHeight:fP},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"}},hP)),vP=(0,Tp.Z)(mP({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",fontSize:gP,lineHeight:fP},attribute:{"&:last-child":{marginBottom:0},paddingLeft:"4px",paddingRight:"4px",marginLeft:"5px",marginBottom:"4px",whiteSpace:"pre-wrap",wordBreak:"break-word"},attributes:{alignSelf:"stretch"},titleRow:mP({},hP.titleRow,{marginBottom:"3px"})},hP)),TP=e=>{let{value:t,nonVisibleValues:r,attributeType:n,titleClassName:a,contentClassName:o,showNonOv:i,totalNonVisibleValues:l}=e;const s=bP(),{label:c,description:u}=n,p=(0,T.isRelationUri)(t.uri)?T.CollaborationObjectTypes.RELATION_ATTRIBUTE:T.CollaborationObjectTypes.ENTITY_ATTRIBUTE;return E().createElement("div",{"data-reltio-id":"one-line-renderer",className:v()(s.collaborationWrapper,tN)},E().createElement("div",{className:v()(s.titleRow,s.wrapper)},E().createElement(pD,{label:c,className:v()(s.title,a),"data-reltio-id":"reltio-attribute-label"}),E().createElement(vD,{description:u,className:s.descriptionIcon}),E().createElement(gD,{nonOvValues:r,attributeType:n,className:s.ovIcon,nonOvTotal:l}),E().createElement(dP,{className:v()(s.attribute,o),attributeValue:t,attributeType:n,showNonOv:i,inlined:!0})),E().createElement(sD,{uri:t.uri,relatedObjectUris:(0,T.createRelatedObjectUris)(p,{uri:t.uri}),objectType:p}))};var OP=r(33062),xP=r.n(OP);const CP=(0,Tp.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),SP=e=>{let{moreNumber:t,valueNumber:r,onClick:n}=e;const a=CP();return E().createElement(Uy(),{"data-reltio-id":"show-more",component:"button",variant:"caption",className:a.link,onClick:n,underline:"none"},E().createElement(xP(),{className:a.icon}),t&&r?uo().text("Show ${moreNumber} more of remaining ${valueNumber} value",{moreNumber:t,valueNumber:r}):uo().text("Show more"))};var wP=r(86800),AP=r.n(wP);const RP=(0,Tp.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),_P=e=>{let{onClick:t}=e;const r=RP();return E().createElement(Uy(),{component:"button",variant:"caption",className:r.link,onClick:t,underline:"none"},E().createElement(AP(),{className:r.icon}),uo().text("Show less"))},IP=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=vP(),[m,y]=(0,h.useState)(t),g=t<a,f=g&&m<a,b=g&&m>=a,{label:T,description:O}=o,x=r.slice(0,m),C=a-m;return E().createElement("div",{"data-reltio-id":"multi-line-renderer",className:d.wrapper},E().createElement("div",{className:d.titleRow},E().createElement(pD,{label:T,className:v()(d.title,s),"data-reltio-id":"reltio-attribute-label"}),E().createElement(vD,{description:O}),E().createElement(gD,{nonOvValues:n,attributeType:o,className:d.ovIcon,nonOvTotal:p})),E().createElement("div",{className:d.attributes},x.map((e=>E().createElement(dP,{key:e.uri,className:v()(d.attribute,c),attributeValue:e,attributeType:o,showNonOv:u})))),f&&E().createElement(SP,{moreNumber:(0,A.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)}}),b&&E().createElement(_P,{onClick:()=>{y(t)}}))};var NP=r(88941),DP=r.n(NP);function PP(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){kP(e,t,r[t])}))}return e}function kP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const LP=(0,Tp.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:PP({width:"fit-content"},T.historyPalettes[T.HistoryOperations.insertAttribute]),deleteAttribute:PP({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},T.historyPalettes[T.HistoryOperations.deleteAttribute])}),UP=e=>{let{value:t}=e;const r=LP(),{appearance:n}=(0,h.useContext)(TD),a=(0,C.AH)(),o=(0,T.getHistoryAppearanceBySpecialAttributeValue)("roles",t,n),i=(0,T.getHistoryAttributeClassName)(o);return E().createElement("span",{className:v()(r.attributeValue,r[i])},(0,T.getRoleLabel)(a,t))},jP=e=>{let{className:t,values:r,Component:n,dataReltioId:a}=e;return E().createElement("div",{className:t,"data-reltio-id":a},r.map(((e,t)=>E().createElement(h.Fragment,{key:e},E().createElement(n,{value:e}),t<r.length-1&&", "))))},FP=e=>{let{className:t,values:r}=e;return E().createElement(jP,{values:r,className:t,dataReltioId:"reltio-attribute-value",Component:UP})};function MP(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){VP(e,t,r[t])}))}return e}function VP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const BP=(0,Tp.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:MP({width:"fit-content"},T.historyPalettes[T.HistoryOperations.insertAttribute]),deleteAttribute:MP({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},T.historyPalettes[T.HistoryOperations.deleteAttribute])}),zP=e=>{let{value:t}=e;const r=BP(),n=(0,h.useContext)(dD),{appearance:a}=(0,h.useContext)(TD),{generateTagUrl:o}=(0,h.useContext)(zd),i=(0,C.eh)(),l=(0,C.Qh)(),s=(0,T.getHistoryAppearanceBySpecialAttributeValue)("tags",t,a),c=(0,T.getHistoryAttributeClassName)(s),u=n||i;return E().createElement(iP,{className:v()(r.attributeValue,r[c]),href:o({uiPath:l,tag:t,entityUri:u.dataTenant?(0,T.getDataTenantEntityUri)(u):u.uri})},t)},HP=e=>{let{className:t,values:r}=e;return E().createElement(jP,{values:r,className:t,dataReltioId:"reltio-attribute-value",Component:zP})},YP=e=>{let{values:t,attributeType:r}=e;const n=bP(),{label:a}=r;return E().createElement("div",{"data-reltio-id":"special-renderer",className:v()(n.titleRow,n.wrapper)},(o=n.titleIcon,r.uri===T.EntityAttrTypes.tags.uri?E().createElement(DP(),{className:o}):null),E().createElement(pD,{label:a,className:n.title,"data-reltio-id":"reltio-attribute-label"}),(e=>{switch(r.uri){case T.EntityAttrTypes.tags.uri:return E().createElement(HP,{className:e,values:t});case T.EntityAttrTypes.roles.uri:return E().createElement(FP,{className:e,values:t});default:return E().createElement(dP,{className:e,attributeValue:{value:t[0],uri:""},attributeType:r,inlined:!0})}})(n.attribute));var o};var WP=r(97986),GP=r.n(WP);function qP(){return qP=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},qP.apply(this,arguments)}const ZP=e=>E().createElement("svg",qP({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),E().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},E().createElement("path",{d:"M0 0h24v24H0z"}),E().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"}))),$P={SMALL:{imageWidth:114,imageHeight:114},MEDIUM:{imageWidth:162,imageHeight:162},LARGE:{imageWidth:192,imageHeight:192},OVERRIDE:{imageWidth:"unset",imageHeight:"unset"}};var KP=r(39034);const XP=(0,Tp.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 QP(){return QP=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},QP.apply(this,arguments)}const JP=(0,h.memo)((e=>{const{src:t,className:r,containerClassName:n,size:a=$P.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||$P.SMALL,s=XP(l),[c,u]=(0,h.useState)(KP.o.LOADING);(0,h.useEffect)((()=>{u(KP.o.LOADING)}),[t]);const p=c===KP.o.LOADING,d=c===KP.o.LOADED;return c===KP.o.ERROR?E().createElement("div",QP({className:v()(s.defaultContainer,s.image,r)},i),E().createElement(GP(),{className:s.defaultImage})):E().createElement("div",{className:v()(s.root,n)},!(0,T.isEmptyValue)(t)&&E().createElement("img",QP({src:t,className:v()(s.image,r,{[s.hideImage]:p}),onLoad:()=>{u(KP.o.LOADED)},onError:()=>{u(KP.o.ERROR)},alt:"image"},i)),p&&E().createElement("div",QP({className:v()(s.defaultContainer,s.image,r)},i),E().createElement(ZP,{className:s.defaultImage})),d&&o)})),ek={imageMargin:4,imageWidth:$P.SMALL.imageWidth,imageHeight:$P.SMALL.imageHeight};var tk=r(59849),rk=r.n(tk),nk=r(47867),ak=r.n(nk),ok=r(93643),ik=r.n(ok);const lk=(0,Tp.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)"}}))),sk=e=>{let{attributeValues:t,setAttributeValueIndex:r,attributeValueIndex:n}=e;const a=lk(),o=(0,h.useRef)(null);return(0,h.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]),E().createElement("div",{ref:o,className:a.thumbnails},E().createElement(ik(),{container:!0,wrap:"nowrap",direction:"row",spacing:1,className:a.gridContainer},t.map(((e,t)=>{let{uri:o,value:i}=e;return E().createElement(ik(),{item:!0,key:o},E().createElement(JP,{onClick:()=>r(t),className:v()(a.thumb,{[a.inactiveThumb]:n!==t}),src:(0,T.getImageAttributeOvThumbnailUrl)({value:i})}))}))))},ck=(0,Tp.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%)"}}))),uk=e=>{let{className:t,attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:a}=e;const o=ck(),i=r[n],l=(0,T.getImageAttributeOvPreviewUrl)(i);return E().createElement("div",{className:v()(o.root,t)},E().createElement("div",{className:o.main},n>0&&E().createElement(Np.T,{icon:rk(),className:v()(o.arrowButton,o.arrowButtonPrev),onClick:()=>{a(n-1)},size:"XL"}),E().createElement(JP,{containerClassName:o.mainImageContainer,className:o.mainImage,size:l&&$P.OVERRIDE,src:l}),n!==r.length-1&&E().createElement(Np.T,{icon:ak(),className:v()(o.arrowButton,o.arrowButtonNext),onClick:()=>{a(n+1)},size:"XL"})),E().createElement(sk,{attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:a}))};var pk=r(71884),dk=r.n(pk);const mk=(0,A.curry)(((e,t)=>(0,A.filter)((t=>(t.label||t.name).toLowerCase().includes(e.toLowerCase())))(t))),yk=e=>{let{attrTypes:t,filter:r="",sortingFn:n}=e;return(0,A.pipe)(mk(r),(0,A.sort)(n),(0,A.map)((e=>({item:{id:e.uri,label:e.label||e.name,attrType:e}}))))(t)};var gk=function(e){return e.parent="parent",e.attributes="attributes",e}(gk||{});const fk=(0,Tp.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"}}),hk=e=>{let{label:t,popupTitle:r=t,data:n,parent:a,dense:o,onApply:i}=e;const l=fk(),s=(0,h.useRef)(),[c,u]=(0,h.useState)(!1),[p,d]=(0,h.useState)(""),[m,y]=(0,h.useState)([]),{items:g,hasGroups:f,parentGroupLength:b,attributesGroupLength:O}=(e=>{let{data:t,parent:r,filter:n}=e;const a=(0,C.mT)(),o=Boolean(r),i=(0,h.useMemo)((()=>a===T.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,h.useMemo)((()=>o?yk({attrTypes:[r],filter:n,sortingFn:i}):[]),[o,r,n,i]),s=(0,h.useMemo)((()=>o&&null!=l&&l.length?[{item:{id:gk.parent,label:uo().text("Parent")},items:l}]:[]),[o,l]),c=(0,h.useMemo)((()=>yk({attrTypes:t,filter:n,sortingFn:i})),[t,n,i]),u=(0,h.useMemo)((()=>o&&null!=c&&c.length?[{item:{id:gk.attributes,label:uo().text("Attributes")},items:c}]:c),[o,c]),p=(0,h.useMemo)((()=>Mp((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,h.useCallback)(((e,t)=>{y((0,A.ifElse)((0,A.always)(t),(0,A.append)(e),(0,A.reject)((0,A.propEq)("id",e.id)))(m))}),[m]),S=(0,h.useCallback)(((e,t)=>t.items?40:28),[]),w=(0,h.useCallback)((e=>{let{item:t}=e;x(t,(0,A.not)((0,A.any)((0,A.propEq)("id",t.id))(m)))}),[x,m]),{focusIndex:R,handleKeyDown:_}=Gp({items:g,open:c,onSelectFocusedItem:w,selectedItems:m}),I=(0,h.useRef)(null);I.current=R;const N=f?(b?1:0)+(O?1:0):0,D=g.length-N,P=Math.min(255,28*D+40*N),k=Math.max(140,P+112),L=(0,h.useCallback)(((e,t,r)=>{var n;let{item:a,level:o=0}=t;const i=(0,A.any)((0,A.propEq)("id",a.id))(m),l=I.current===r;return E().createElement(fd,{key:a.uri,onClick:x,checked:i,level:o,data:a,label:E().createElement(hd.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,h.useCallback)(((e,t)=>E().createElement(ay(),{component:"div",className:l.subHeader,style:e,key:`group-${t.item.id}`},t.item.label)),[]);return E().createElement("div",{className:v()(l.moreAttributes,{[l.dense]:o})},E().createElement(pE(),{color:"primary",onClick:()=>u(!c),ref:s,className:l.moreButton},E().createElement(dk(),{classes:{root:l.icon}}),E().createElement("div",{className:l.buttonLabel},t)),E().createElement(Fp,{open:c,className:v()(l.moreAttributesPopup,l.popupContainer),anchorEl:s.current,onClose:(0,A.pipe)((()=>{m.length>0&&i((0,A.pluck)("attrType",m))}),(()=>u(!1)),(()=>d("")),(()=>y([]))),onSearch:d,containerHeight:k,title:r,containerWidth:320,searchInputOnKeyDown:_},E().createElement(Wp,{getItemSize:S,renderItem:L,renderGroupTitle:U,disableHorizontalScrollbar:!0,items:g,height:P,focusIndex:R}),0===g.length&&E().createElement("div",{className:l.noResultsCaptionContainer},E().createElement(wy(),{variant:"caption",display:"block",gutterBottom:!0},uo().text("No results found")))))},Ek=E().createContext({canCreate:!0,canUpdate:!0,canDelete:!0});Ek.displayName="ConfigPermissionsContext";const bk=e=>{const{canCreate:t,canUpdate:r,canDelete:n}=(0,h.useContext)(Ek),a=(0,T.isTempUri)(e);return(0,h.useMemo)((()=>({canCreate:t,canUpdate:a||r,canDelete:a||n})),[a,t,r,n])},vk={get CreationTime(){return uo().text("Creation Time")},get CreationDate(){return uo().text("Creation Date")},get Dimensions(){return uo().text("Dimensions")},get MimeType(){return uo().text("Mime Type")},get Size(){return uo().text("Size")},get Url(){return uo().text("Full image URL (S3)")},get UrlPreview(){return uo().text("Preview image URL (S3)")},get UrlThumbnail(){return uo().text("Small image URL (S3)")},get CdnUrl(){return uo().text("Full image URL (CDN)")},get CdnUrlPreview(){return uo().text("Preview image URL (CDN)")},get CdnUrlThumbnail(){return uo().text("Small image URL (CDN)")}},Tk=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,A.path)([t,0,"value"],e):"CreationDate"===t&&(0,A.path)(["CreationTimestamp",0,"value"],e)?Ba()(e.CreationTimestamp[0].value).format("MM-DD-YYYY"):"CreationTime"===t&&(0,A.path)(["CreationTimestamp",0,"value"],e)?Ba()(e.CreationTimestamp[0].value).format("HH:mm:ss"):"Dimensions"===t&&(0,A.path)(["Height",0,"value"],e)&&(0,A.path)(["Width",0,"value"],e)?`${e.Height[0].value} x ${e.Width[0].value} ${uo().text("pixels")}`:"Size"===t&&(0,A.path)(["Size",0,"value"],e)?`${(Number(e.Size[0].value)/1e3).toFixed(2)} KB`:void 0},Ok=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter((e=>{let{system:t}=e;return!t}))},xk=(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}))},Ck=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=Ok(t.attributes);return xk(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}),[])},Sk=e=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail"].includes(e),wk=(0,Tp.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:{}}),Ak=e=>{let{attributeType:t,onAddAttributes:r,uri:n}=e;const a=wk(),o=Ok(t.attributes),{canCreate:i}=(0,h.useContext)(Ek),l=i&&Boolean(r);return E().createElement(zI(),null,E().createElement(wy(),{className:v()(a.title,{[a.canAdd]:l})},uo().text("Meta info")),l&&E().createElement(h.Fragment,null,E().createElement(hk,{label:uo().text("Attributes"),data:o,dense:!1,onApply:e=>{r&&r(e.map((e=>({attributeType:e,parentUri:n}))))}}),E().createElement(lh(),{className:a.divider})))},Rk=(0,Tp.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"}}))),_k=e=>{let{title:t,content:r,isLink:n,children:a}=e;const o=Rk();return E().createElement("div",{className:o.root},E().createElement("span",{className:o.title},t),n?E().createElement("a",{className:o.link,href:r},uo().text("link")):E().createElement("span",{className:o.content},r||a))},Ik=(0,Tp.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"}}),Nk=e=>{let{attributeValue:t,attributeType:r,imageAttributeFieldsOrder:n}=e;const a=Ik(),o=(0,C.xH)(),i=(l=t,s=n,xk(Object.keys(vk),s).map((e=>Tk(l,e)?{title:vk[e],value:Tk(l,e),isLink:Sk(e)}:null)).filter(Boolean));var l,s;const c=Ck(t,r,n);return E().createElement(zI(),{className:a.root},i.map((e=>{let{title:t,value:r,isLink:n}=e;return E().createElement(_k,{key:t,isLink:n,title:t,content:r})})),o&&c.map((e=>{let{attrType:r,values:n}=e;return E().createElement(DF,{key:r.uri,attributeType:r,drawLines:!1,values:n,titleClassName:a.title,contentClassName:a.content,parentUri:t.uri})})))},Dk=(0,Tp.Z)((e=>({caption:{display:"flex",color:e.palette.error.main,fontSize:"12px",lineHeight:"16px"}}))),Pk=e=>{let{className:t,message:r}=e;const n=Dk();return r?E().createElement(wy(),{variant:"caption",className:v()(n.caption,t)},r):null};var kk=r(66826),Lk=r.n(kk),Uk=r(54508),jk=r(70485),Fk=r.n(jk),Mk=r(53167),Vk=r.n(Mk);const Bk=(0,Tp.Z)({wrapper:{width:"100%"},helperText:{margin:"3px 0 1px 12px"}});function zk(){return zk=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},zk.apply(this,arguments)}const Hk=(0,h.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=Bk(),l=!!t;return E().createElement(Fk(),zk({variant:"standard",className:v()(i.wrapper,n,null==a?void 0:a.root),error:!0},o),r,l&&E().createElement(Vk(),{className:v()(i.helperText,null==a?void 0:a.helperText)},E().createElement(Pk,{message:t})))}));Hk.displayName="ErrorWrapper";const Yk=(e,t,r,n)=>{const a=(0,A.pipe)(T.getEntityType,(0,A.defaultTo)({}),(0,A.props)(["attributes","analyticsAttributes"]),(0,A.reject)(A.isNil),A.flatten,(0,A.concat)(A.__,(0,A.pipe)(A.values,(0,A.reject)((0,A.propEq)("uri",T.EntityAttrTypes.id.uri)))(T.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)}))},Wk=(e,t)=>(0,A.partition)((0,A.pipe)((0,A.path)(["attrType","uri"]),(0,A.includes)(A.__,e)),t),Gk=(0,A.eqBy)((0,A.pick)(["fieldName","uri","entityTypeUri"])),qk=(e,t)=>t&&!!t.find(Gk(e)),Zk=(0,A.curry)(((e,t,r)=>{const n=((e,t)=>{const{type:r}=(0,T.getAttrDataTypeDefinition)(e);switch(r){case T.DataTypes.TYPE_BOOLEAN:case T.DataTypes.TYPE_BOOLEAN_RADIO:case T.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t.toString();case T.DataTypes.TYPE_DATE:return t&&Ba()(t).format("YYYY-MM-DD")||"";case T.DataTypes.TYPE_TIMESTAMP:return t&&Ba()(t).utc().format()||"";case T.DataTypes.TYPE_ACTIVENESS_DATE:case T.DataTypes.TYPE_LOCAL_DATE:return t&&t.valueOf();default:return t||""}})(t,r);return{value:n,uri:e.uri,attributeType:t}})),$k=E().createContext({enabled:!1,queueSizeThreshold:0});$k.Provider.propTypes={value:fp().shape({enabled:fp().bool,queueSizeThreshold:fp().number})},$k.displayName="AsyncMountContext";let Kk=0;const Xk=()=>{const e=(0,h.useRef)(!0),{enabled:t,queueSizeThreshold:r=0}=(0,h.useContext)($k),[n,a]=(0,h.useState)(!t||t&&Kk<r);e.current&&Kk++;const o=(0,h.useRef)();return(0,h.useEffect)((()=>{if(Kk--,!n)return o.current=setTimeout((()=>{a(!0)}),0),()=>clearTimeout(o.current)}),[]),e.current=!1,n};function Qk(){return Qk=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},Qk.apply(this,arguments)}var Jk=r(50548);const eL=E().createContext(!1);eL.displayName="ProfilePerspectiveViewContext";let tL=function(e){return e.Error="Error",e.NewAttribute="NewAttribute",e.NewView="NewView",e}({});const rL=e=>e===tL.Error,nL=E().createContext({element:null,type:null,highlightView:Ep.ZT,highlightError:Ep.ZT,highlightAttribute:Ep.ZT,scrollIntoRef:Ep.ZT});function aL(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){oL(e,t,r[t])}))}return e}function oL(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={content:'""',position:"absolute",left:"-1000px",top:"0px",width:"5000px",height:"calc(100% - 10px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},lL=(0,Tp.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlightError:{"&::before":aL({},iL,{background:"rgba(255, 0, 0, 0.06)"})},highlightWarning:{"&::before":aL({},iL,{background:"rgba(228, 151, 0, 0.08)"})},simpleAttribute:{position:"relative","&::before":{top:"-4px",height:"calc(100% + 8px)"}}}))),sL=e=>{let{highlightedError:t,isSimple:r=!1}=e;const n=lL(),a=(0,h.useRef)(null),o=(0,A.pathOr)(T.ErrorSeverity.ERROR,["element","severity"])(t),i=v()({[n.highlightError]:o===T.ErrorSeverity.ERROR,[n.highlightWarning]:o===T.ErrorSeverity.WARNING,[n.simpleAttribute]:r});return(0,h.useEffect)((()=>{t&&t.scrollIntoRef(a)}),[t]),t?{ref:a,errorClassName:i}:{ref:a}};var cL=r(51894);const uL=(0,Tp.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 pL(){return pL=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},pL.apply(this,arguments)}const dL=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=uL(),b="deleted"===d,O="edited"===d,x=(0,T.isEditableMode)(i),{canCreate:S,canEdit:w,canDelete:R}=(e=>{let{attributeType:t,attributeValue:r,isReltioCrosswalk:n,mode:a}=e;const{canCreate:o,canUpdate:i,canDelete:l}=bk(r.uri);return{canCreate:o&&(0,T.checkCanCreateAttribute)({attributeType:t,mode:a}),canEdit:i&&(0,T.checkCanEditAttribute)({attributeType:t,attributeValue:r,mode:a,isReltioCrosswalk:n}),canDelete:l&&(0,T.checkCanDeleteAttribute)({attributeType:t,attributeValue:r,mode:a,isReltioCrosswalk:n})}})({attributeValue:r,attributeType:n,mode:i,isReltioCrosswalk:a}),_=w&&x,I=(0,T.getErrorMessage)(o),N=(0,C.ZI)(r,n),{ref:D,errorClassName:P}=sL({highlightedError:m,isSimple:!0});(0,h.useEffect)((()=>{y&&(0,T.isDependentLookupAttrType)(n)&&!(0,A.has)("lookupCode",r)&&c({attributeType:n,uri:r.uri,value:r.value,silent:!0})}),[y]);const k=(0,h.useMemo)((()=>(0,T.getAttrDataTypeDefinition)(n)),[n]),L=(0,h.useMemo)((()=>((e,t)=>{let{type:r}=t;const{value:n,lookupCode:a}=e||{};switch(r){case T.DataTypes.TYPE_BOOLEAN:case T.DataTypes.TYPE_BOOLEAN_RADIO:case T.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,T.parseBoolean)(n);case T.DataTypes.TYPE_DATE:return n&&T.utils.dates.toLocalDate(n)||null;case T.DataTypes.TYPE_LOCAL_DATE:case T.DataTypes.TYPE_TIMESTAMP:case T.DataTypes.TYPE_ACTIVENESS_DATE:return n&&new Date(n)||null;case T.DataTypes.TYPE_DEPENDENT_LOOKUP:case T.DataTypes.TYPE_LOOKUP:return{value:n,lookupCode:a};default:return n}})(r,k)),[r,k]),U=(0,h.useCallback)((()=>{o&&u((0,T.getErrorId)(o))}),[o,u]),j=(0,h.useCallback)((0,A.pipe)(Zk(r,n),c,U),[r,n,c,U]),F=!!l&&S&&!n.singleValue,M=!b&&!!s&&R,V=!!I,B=b?{disabled:!0,isCrossedOut:!0}:{},z=(0,h.useContext)(eL),{autopopulationContextValue:H}=(e=>{let{enabled:t,attributeTypeUri:r,valueUri:n}=e;const a=(0,C.ax)("dependentLookupsEditorTouched"),o=(0,C.Pl)(),i=(0,C.h0)(n),l=t&&(0,T.isAutopopulationEnabled)(o,r),s=l?n:null,{isTouched:c=!1}=l&&i||{},u=(0,h.useCallback)((e=>{a({uri:e,isTouched:!0})}),[a]);return{autopopulationContextValue:(0,h.useMemo)((()=>s?{id:s,isTouched:c,onTouch:u}:null),[s,c,u])}})({enabled:z&&(0,T.isDependentLookupAttrType)(n),attributeTypeUri:null==n?void 0:n.uri,valueUri:r.uri});return E().createElement("div",{ref:D,className:v()(f.editor,t,P)},E().createElement(Hk,{errorMessage:I,className:f.errorWrapper},E().createElement("div",{className:v()(f["editor-value"],{[f.deleted]:b},{[f["editor-read-only-value"]]:!_}),"data-reltio-id":"reltio-attribute-value"},_?E().createElement(cL.m.Provider,{value:H},E().createElement(Uk.Z,pL({fieldName:(0,T.attributeUriToSearchUri)(n.uri),value:L,dataTypeDefinition:k,error:V,onChange:j,fullWidth:!0},N,g,B))):E().createElement(Zd.x,{value:(0,T.getAttributeValue)(r),dataTypeDefinition:k}))),E().createElement("div",{className:f["editor-actions"]},O&&E().createElement(wy(),{variant:"caption",className:f.editedLabel},"(",uo().text("edited"),")"),F&&E().createElement(Np.T,{icon:dk(),onClick:l,size:"L",className:v()(f.addButton,f.button),"data-reltio-id":"reltio-add-one-more-simple-attribute-button"}),p&&p({attributeType:n,attributeValue:r}),M&&E().createElement(Np.T,{className:f.button,icon:Lk(),onClick:()=>{s({uri:r.uri,attributeType:n}),(0,T.getErrorType)(o)!==T.ErrorType.missed&&U()},size:"L","data-reltio-id":"reltio-delete-simple-attribute-button"})))};dL.propTypes={className:fp().string,attributeValue:T.SimpleAttributeValueType,attributeType:T.AttributeTypeType,ownError:T.AttributeErrorType,isReltioCrosswalk:fp().bool,state:fp().oneOf(["deleted","edited"]),mode:T.ModeType,onAddOneMore:fp().func,onDeleteAttribute:fp().func,onChangeAttribute:fp().func,onDeactivateError:fp().func,additionalControlsRenderer:fp().func,highlightedError:fp().object,isEmptyEditor:fp().bool};const mL=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=(0,h.forwardRef)(((r,n)=>Xk()?E().createElement(e,Qk({},r,{ref:n})):t&&E().createElement(t,Qk({},r,{ref:n}))));return r.displayName="WithAsyncMount",r}((0,Jk.l)(nL,((e,t)=>{let{attributeValue:r}=t;const{element:n,type:a}=e||{};return{highlightedError:rL(a)&&(null==n?void 0:n.uri)===r.uri?e:null}}),dL),(()=>{const e=uL();return E().createElement("div",{className:e.placeholder})})),yL=[T.EntityAttrTypes.roles.uri,T.EntityAttrTypes.tags.uri],gL=E().createContext(null),fL=E().createContext(null);function hL(){return hL=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},hL.apply(this,arguments)}function EL(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bL=e=>{let{parentAttributeType:t,attrTypes:r,entity:n,parentUri:a,showEmptyEditors:o,mode:i,crosswalks:l,drawLines:s,children:c,className:u,alwaysVisibleTypeUris:p=yL,onAddAttributes:d,onChangeAttribute:m,onDeleteAttribute:y,additionalControlsRenderer:g,showNonOv:f,highlightAttribute:b}=e;const{attributes:v={}}=n,[O,x]=(0,h.useState)({}),C=(0,h.useCallback)(((e,t)=>{x((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){EL(e,t,r[t])}))}return e}({},r,{[e]:t})))}),[]);(0,h.useEffect)((()=>{x({})}),[a]);const{canCreate:S}=(0,h.useContext)(Ek),w=(0,h.useMemo)((()=>S&&t&&(0,T.checkCanCreateAttribute)({attributeType:t,mode:i})),[t,i,S]),R=((e,t,r,n)=>e.filter((e=>{const a=((e,t)=>{const{attributes:r={},analyticsAttributes:n={}}=t;return(0,A.cond)([[T.isSpecialAttribute,(0,A.always)(t)],[(0,A.both)(T.isAnalyticAttribute,(0,A.always)(n)),(0,A.always)(n)],[A.T,(0,A.always)(r)]])(e)})(e,t),o=(e=>(0,T.isSpecialAttribute)(e)?"uri":"name")(e);return!((e.singleValue||(0,T.isRoleAttrType)(e)||(0,T.isTagAttrType)(e))&&((0,A.has)(e[o])(a)||r&&(null==n||!n[e.uri])))})))((0,h.useMemo)((()=>S?(0,T.getCreatableAttributeTypes)(i,r):[]),[r,i,S]),n,o,O),_=(0,h.useContext)(gL),I=(0,h.useMemo)((()=>(0,T.getAttributesListForEditMode)(r,i,n,o,f,_,S)),[r,i,n,o,f,_,S]),[N,D]=(0,h.useMemo)((()=>Wk(p,I)),[I,p]),P=(0,h.useCallback)((e=>{d(e.map((e=>({attributeType:e,parentUri:e===t?(0,T.getParentUri)(a):a})))),b((0,A.last)(e),tL.NewAttribute)}),[d,a,t]),k={enabled:s},L=(0,h.useMemo)((()=>({hasDeletionsMap:O,setHasDeletions:C})),[O,C]);return E().createElement("div",{className:u},c&&E().createElement(eN,k,c),E().createElement(eN,hL({},k,{plain:!0}),R.length>0&&E().createElement(hk,{label:uo().text("More attributes"),onApply:P,dense:s,data:R,parent:w&&t})),E().createElement(fL.Provider,{value:L},D.concat(N).map((e=>{let{attrType:t,values:r}=e;return E().createElement(Yj,{key:`${t.uri}_${a}`,attributeType:t,drawLines:s,values:r,paging:(0,A.path)(["paging",t.uri],v),parentUri:a,showEmptyEditors:o,mode:i,crosswalks:l,onAddAttributes:d,onChangeAttribute:m,onDeleteAttribute:y,additionalControlsRenderer:g,showNonOv:f})}))))};bL.propTypes={parentAttributeType:fp().object,attrTypes:fp().array,entity:fp().object,parentUri:fp().string,children:fp().node,showEmptyEditors:fp().bool,mode:T.ModeType,crosswalks:fp().array,drawLines:fp().bool,showNonOv:fp().bool,className:fp().string,alwaysVisibleTypeUris:fp().array,onAddAttributes:fp().func,onChangeAttribute:fp().func,onDeleteAttribute:fp().func,additionalControlsRenderer:fp().func,highlightAttribute:fp().func};const vL=(0,Jk.l)(nL,(e=>{const{highlightAttribute:t}=e||{};return{highlightAttribute:t}}),bL),TL=(0,Tp.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 OL(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xL=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:b,hideDeleteButton:O,state:x,showNonOv:C,isHighlightedPath:S,highlightedError:w,expanded:A=!1}=e;const R=TL(),_="deleted"===x,I="edited"===x,N=a.uri,D=(0,T.isTempUri)(N),P=D||A,[k,L]=(0,h.useState)(P),{ref:U,errorClassName:j}=sL({highlightedError:w});(0,h.useEffect)((()=>{S&&L(!0)}),[S]),(0,h.useEffect)((()=>{L(P)}),[P]);const{canDelete:F}=bk(a.uri),M=(0,h.useMemo)((()=>F&&(0,T.checkCanDeleteAttribute)({attributeType:n,attributeValue:a,mode:s,metadata:c,isReltioCrosswalk:(0,T.isReltioCrosswalk)(u,a)})),[n,a,s,c,u,F]),V=!_&&!O&&!!g&&M,B=(0,h.useMemo)((()=>(0,T.hasAttributeDescendantsWithErrors)(a,i)),[i,a]);(0,h.useEffect)((()=>{B&&L(!0)}),[i,B]),(0,h.useEffect)((()=>{_&&L(!1)}),[_]);const z=(r||[]).some((e=>(0,T.isAnalyticAttribute)(e))),H=(0,h.useMemo)((()=>({attributes:z?null:a.value,analyticsAttributes:z?a.value:null})),[a,z]),Y=(0,T.getErrorMessage)(l)||B&&uo().text("Has an incorrect value")||"";return p?E().createElement(pE(),{variant:"text",color:"primary",onClick:m},"Create attribute"):E().createElement("div",{ref:U,className:v()(R.complexWrapper,j)},E().createElement("div",{className:R.editor},E().createElement("div",{className:R.titleContainer},E().createElement(WD,{onClick:()=>L((e=>!e)),expanded:k,className:R.expandButton,disabled:_}),E().createElement(Hk,{errorMessage:Y,classes:{helperText:R.errorWrapperHelperText}},E().createElement("div",{className:v()(R.label,{[R.deleted]:_}),"data-reltio-id":"reltio-attribute-complex-label"},t))),E().createElement("div",{className:R.actions},I&&E().createElement(wy(),{variant:"caption",className:R.editedLabel},"(",uo().text("edited"),")"),b&&b({attributeType:n,attributeValue:a}),V&&E().createElement(Np.T,{icon:Lk(),onClick:()=>g({uri:N,attributeType:n,attributeValue:a}),size:"L","data-reltio-id":"reltio-delete-complex-attribute-button"}))),k&&E().createElement(vL,{parentAttributeType:n,attrTypes:r,entity:H,showEmptyEditors:d||D,drawLines:!0,parentUri:N,mode:s,crosswalks:u,onAddAttributes:y,onChangeAttribute:f,onDeleteAttribute:g,additionalControlsRenderer:b,showNonOv:C},o))};xL.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){OL(e,t,r[t])}))}return e}({label:fp().string,children:fp().node,attributeTypesList:fp().arrayOf(T.AttributeTypeType),attributeValue:fp().oneOfType([T.NestedAttributeValueType,T.ReferenceAttributeValueType]),highlightedError:fp().object,isHighlightedPath:fp().bool},T.ComplexAttributeType);const CL=(0,Jk.l)(nL,((e,t)=>{let{attributeValue:r}=t;const{element:n,type:a}=e||{},o=rL(a);return{highlightedError:o&&(null==n?void 0:n.uri)===r.uri?e:null,isHighlightedPath:o&&(0,A.pipe)((0,A.propOr)([],"path"),(0,A.any)((0,A.pathEq)(["value","uri"],r.uri)))(n)}}),xL);function SL(){return SL=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},SL.apply(this,arguments)}const wL=(0,h.memo)((e=>{const{attributeValue:t,attributeType:r}=e,n=(0,T.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return E().createElement(CL,SL({label:(0,T.getLabel)(n),attributeTypesList:r.attributes||r.analyticsAttributes},e))}));wL.propTypes=T.NestedAttributeType,wL.displayName="NestedAttributeEditor";var AL=r(62880);const RL=(0,Tp.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"}}))),_L=e=>{const{selectProps:{onCreate:t,createLabel:r,inputValue:n,components:a},children:o}=e,i=RL();return E().createElement(vg.h,e,o,r&&!(0,A.prop)("Group",a)&&E().createElement("span",{className:i.addLabel,onClick:()=>t(n)},E().createElement(dk(),{className:i.addIcon}),r))};_L.propTypes={children:fp().element.isRequired,selectProps:fp().object.isRequired};const IL=(0,Tp.Z)({singleValue:{fontSize:"14px",lineHeight:"16px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:"17px"}});function NL(){return NL=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},NL.apply(this,arguments)}const DL=e=>{const{selectProps:{menuIsOpen:t},innerProps:r,children:n}=e,a=IL();return!t&&E().createElement(wy(),NL({className:a.singleValue},r),n)};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){kL(e,t,r[t])}))}return e}function kL(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}DL.propTypes={children:fp().node,innerProps:fp().object};const LL=(0,Tp.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"}}}),UL={menu:e=>PL({},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=>PL({},e,{maxHeight:"208px",padding:"8px 0"}),group:e=>PL({},e,{padding:"0 0 8px 0"}),input:e=>PL({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:"16px 0 0",padding:0}),option:e=>PL({},e,{fontSize:"13px",lineHeight:"15px",height:"32px"})},jL={menuList:e=>PL({},e,{padding:0})},FL={input:e=>PL({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:0,padding:0})};function ML(){return ML=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},ML.apply(this,arguments)}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}const zL=e=>{let{value:t,label:r,createLabel:n,getOptions:a,options:o,height:i=46,onChange:l=A.identity,onCreate:s,onClear:c=A.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=LL({height:i}),[f,b]=(0,h.useState)(!1),O=(0,h.useRef)(null),x=a?ig:ag.Z,C=(0,A.prop)("ClearIndicator",u)?{}:{IndicatorSeparator:Ep.Vd,ClearIndicator:Ep.Vd},S=s?(e,t)=>{s(e,t),b(!1)}:void 0,w=(0,A.prop)("Group",u)?jL:{},R=(0,A.isEmpty)(r)?FL:{},_=VL({},UL,w,R),I=VL({},g,m);return E().createElement(x,ML({placeholder:"",defaultOptions:!0},y,{value:(0,A.defaultTo)(null,t),loadOptions:a,options:o,cacheOptions:!0,onChange:l,onCreate:S,onClear:c,createLabel:n,classes:I,styles:_,components:VL({DropdownIndicator:AL.G,LoadingIndicator:Ep.Vd,SingleValue:DL,Menu:_L},C,u),menuPlacement:"auto",TextFieldProps:VL({},d,{label:r,variant:"filled",size:"small",classes:VL({},(0,A.prop)("classes",d),{root:v()(g.formControl,(0,A.path)(["classes","root"],d))}),inputProps:VL({},(0,A.prop)("inputProps",d)),InputProps:VL({},(0,A.prop)("InputProps",d),{classes:VL({},(0,A.path)(["InputProps","classes"],d),{root:v()(g.filledInputRoot,(0,A.path)(["InputProps","classes","root"],d)),underline:v()({[g.filledInputUnderline]:(0,T.isEmptyValue)(t)},(0,A.path)(["InputProps","classes","underline"],d)),focused:v()("focused",(0,A.path)(["InputProps","classes","focused"],d))})}),InputLabelProps:VL({},(0,A.prop)("InputLabelProps",d),{classes:VL({},(0,A.path)(["InputLabelProps","classes"],d),{root:v()(g.inputLabel,(0,A.path)(["InputLabelProps","classes","root"],d)),shrink:v()("shrink",(0,A.path)(["InputLabelProps","classes","shrink"],d))}),shrink:!(0,T.isEmptyValue)(t)||void 0}),ref:p||O}),inputRef:p||O,menuIsOpen:f,onMenuOpen:()=>b(!0),onMenuClose:()=>b(!1)}))},HL={value:fp().oneOfType([fp().object,fp().array]),label:fp().string.isRequired,getOptions:fp().func,options:fp().array,onChange:fp().func,onCreate:fp().func,onClear:fp().func,createLabel:fp().string,components:fp().object,textFieldInputRef:fp().object,TextFieldProps:fp().object,height:fp().number,classes:fp().object};zL.propTypes=HL;var YL=r(98018);function WL(){return WL=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},WL.apply(this,arguments)}const GL=e=>{const t=(0,C.$H)()||"";return E().createElement(YL.ZP,WL({},e,{storagePath:(r=t,r.endsWith("/")?r:r+"/")}));var r},qL=(0,Tp.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 ZL(){return ZL=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},ZL.apply(this,arguments)}const $L=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:a}=e;const o=qL(),{uri:i,entityType:l,label:s,secondaryLabel:c}=a;return""!==i?E().createElement(Qp(),ZL({className:o.entityContainer,ref:t,key:i,onClick:()=>n({label:s,uri:i,entityType:l})},r),E().createElement(GL,{className:o.entityAvatar,entityType:l}),E().createElement(pd.Y,{value:`${s}${c?", "+c:""}`},E().createElement("span",{className:o.entityLabel},s,c&&E().createElement("span",{className:o.entitySecondaryLabel},", ",c)))):E().createElement(Qp(),ZL({className:o.entityContainer,ref:t,key:i},r,{disabled:!0}),E().createElement("span",{className:o.emptyEntityLabel},uo().text("No results found")))};$L.propTypes={innerRef:fp().oneOfType([fp().oneOf([null]),fp().func,fp().shape({current:fp().any.isRequired})]),innerProps:fp().object.isRequired,selectOption:fp().func.isRequired,data:fp().shape({uri:fp().string.isRequired,label:fp().string.isRequired,entityType:T.EntityType.isRequired})};const KL=(0,Tp.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"}}))),XL=e=>{let{selectProps:{currentEntityType:t,menuIsOpen:r,disableLinkClick:n},children:a,data:o}=e;const i=KL(),l=(0,C.ax)("openEntity"),s=(0,C.Qh)(),{generateEntityUrl:c}=(0,h.useContext)(zd),u=(0,T.isTempUri)(o.entityUri)?{className:i.singleValue,component:"span"}:{className:v()(i.singleValue,i.linkValue),onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),n?e.preventDefault():(0,Ep.rR)(e)||(l({uri:o.entityUri}),e.preventDefault())},href:c({uiPath:s,uri:o.entityUri}),component:"a"};return r?null:E().createElement(wy(),u,(0,T.isTempUri)(o.entityUri)?uo().text(`New ${t.label} will be created`):(0,T.getLabel)(a))},QL=(0,Tp.Z)({clearIcon:{cursor:"pointer",height:"20px",width:"20px"}}),JL=e=>{const{selectProps:{onClear:t}}=e,r=QL();return E().createElement(cE(),{onClick:t,size:"large"},E().createElement(UI(),{className:r.clearIcon}))};JL.propTypes={selectProps:fp().object.isRequired};var eU=r(81997);const tU=(0,Tp.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:rU}=eU.F,nU=e=>{const{selectProps:{inputValue:t,onCreate:r},data:n,children:a}=e,o=tU();return E().createElement(rU,e,E().createElement("div",{className:o.groupHeading},E().createElement("span",null,n.label),r&&E().createElement("span",{onClick:()=>r(t,n.entityType),className:o.addLabel},E().createElement(dk(),{className:o.addIcon}),uo().text(`Create ${t?`"${t}" as `:""}new ${n.label}`))),a)};nU.propTypes={selectProps:fp().object.isRequired,data:fp().object,children:fp().array};const aU=e=>e&&e.attributes,oU=e=>{let{entityUri:t,entityType:r,mode:n,attributeTypesSelectionStrategy:a=aU}=e;const o=(0,C.ax)("addAttributes"),i=(0,C.ax)("removeAttribute"),l=(0,C.ax)("modifyAttribute"),s=(0,C.vc)(t),c=(0,h.useMemo)((()=>a(r)),[a,r]);return s?E().createElement(vL,{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 iU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lU=(0,Tp.Z)({creatorWrapper:{marginTop:"20px"}});function sU(){return sU=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},sU.apply(this,arguments)}function cU(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){uU(e,t,r[t])}))}return e}function uU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pU(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 dU=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=pU(e,["entity","entityTypesUris","mode","max","onChange","onCreate","metadata","globalSearchRequestOptions","attributeTypesSelectionStrategy","disableLinkClick"]);const d=lU(),[m,y]=(0,h.useState)(""),g=(0,h.useMemo)((()=>r.map((e=>(0,T.getEntityType)(l,e))).filter(T.isAvailableEntityType)),[r,l]),f=cU({},s,{max:a}),b=i?(e,t)=>{i(t||r[0],e),y("")}:void 0,v=e=>{null!==e&&(y(""),o(e))},O=(0,h.useMemo)((()=>1!==g.length),[g]),x=((0,A.isEmpty)(t)?g[0]:(0,T.getEntityType)(l,t.entityType))||{},C=i&&uo().text(`Create ${m?`"${m}" as `:""}new ${x.label}`),S=uo().text(`Select ${1===g.length?`${g[0].label} `:""}profile`),w=!(0,A.isEmpty)(t)&&(0,T.isTempUri)(t.entityUri),R=O?{Group:nU,GroupHeading:Ep.Vd}:{},_=w?{ClearIndicator:JL}:{},{TextFieldProps:I}=p,N=pU(p,["TextFieldProps"]),D=(0,h.useMemo)((()=>cU({},I||{},{"data-reltio-id":"reltio-entity-selector"})),[I]);return E().createElement(E().Fragment,null,E().createElement(zL,sU({value:(0,A.isEmpty)(t)?void 0:t,inputValue:m,onInputChange:e=>{y(e)},getOptions:e=>(0,T.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){iU(e,t,r[t])}))}return e}({},t,{label:(0,T.getLabel)(t.label),entityType:e.find((e=>{let{uri:r}=e;return r===t.type}))}))),a=e=>(0,A.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,A.prop)("entityLabel"),onChange:v,onCreate:b,onClear:()=>{v({})},label:S,createLabel:C,components:cU({Option:$L,SingleValue:XL},R,_),currentEntityType:x,isClearable:!0,disableLinkClick:u,TextFieldProps:D},N)),w&&E().createElement("div",{className:d.creatorWrapper},E().createElement(oU,{mode:n,attributeTypesSelectionStrategy:c,entityType:x,entityUri:t.entityUri})))};dU.propTypes={entity:T.ConnectionEntityType,entityTypesUris:fp().arrayOf(fp().string),max:fp().number,mode:T.ModeType,dispatch:fp().func,metadata:T.MetadataType,onChange:fp().func.isRequired,onCreate:fp().func,attributeTypesSelectionStrategy:fp().func,globalSearchRequestOptions:fp().object,disableLinkClick:fp().bool};const mU=(0,Tp.Z)({item:{marginBottom:"20px"},dense:{marginBottom:0}});function yU(){return yU=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},yU.apply(this,arguments)}function gU(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){fU(e,t,r[t])}))}return e}function fU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hU=e=>{const t=mU(),{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,h.useRef)(a),{ref:p,errorClassName:d}=sL({highlightedError:r,isSimple:!0}),m=(0,T.getReferencedEntityUriFromAttrValue)(a),y=(0,C.ax)("entityDeleted"),g=(0,C.ax)("entityCreated"),f=(0,C.ax)("errorDeactivated"),b=(0,C.vc)(m),O=(0,T.isTempUri)(m)?b:null,x=(0,C.AH)(),S=(0,C.mU)(["ovOnly"]),w=(0,T.getReferencedEntityFromAttrValue)(a),R=(0,T.getReferencedRelationFromAttrValue)(a),_=(0,T.getReferencedEntityTypeUriFromAttrType)(o),I=(0,T.getEntityType)(x,_),N=O?(0,T.evaluateDeepEntityLabel)(O,I.dataLabelPattern):a.label,D=(0,h.useMemo)((()=>[_]),[_]),P=(0,h.useMemo)((()=>(0,T.addReferencedRelationCrosswalks)(l,R)),[l,R]),k=(0,h.useMemo)((()=>(0,T.getReferencedEntityActiveError)(a,s)),[a,s]),L=(0,h.useMemo)((()=>w&&{entityUri:(0,T.getReferencedEntityUri)(w),entityType:(0,T.getReferencedEntityTypeUri)(w),entityLabel:a.label}),[w,a.label]),U=(0,h.useMemo)((()=>(0,T.getReferencedRelationAttrTypesUris)(o).map((e=>(0,T.findAttributeTypeByUri)(x,e))).filter(A.identity)),[o,x]),j=(0,h.useCallback)((e=>(0,T.referencedEntityAttributeTypesSelectionStrategy)(o,e)),[o]),F=(0,h.useCallback)((e=>{O&&y(O.uri);const t=u.current,r=!(0,A.isEmpty)(e)&&e.uri===(0,T.getReferencedEntityUriFromAttrValue)(t),n=gU({},a,{label:e.label,refEntity:r?t.refEntity:(0,T.convertReferencedEntityForAttrValue)(e),refRelation:r?t.refRelation:(0,T.createReferencedRelationForAttrValue)(a)});c({value:n,attributeType:o,uri:a.uri}),k&&f((0,T.getErrorId)(k))}),[a,o,O,c,y,f,k]),M=(0,h.useCallback)(((e,t)=>{const r=(0,A.pipe)(j,(0,T.getCreatableAttributeTypes)(i))(I),n=(0,T.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}=bk(a.uri),z=(0,h.useMemo)((()=>B&&(0,T.checkCanEditAttribute)({attributeType:o,attributeValue:a,mode:i,isReltioCrosswalk:(0,T.isReltioCrosswalk)(l,a)})),[o,a,i,l,B]),H=(0,h.useMemo)((()=>V&&(0,T.checkMetadataForCreate)(i,I)),[i,I,V]),Y=(0,T.getErrorMessage)(k);return E().createElement(CL,yU({},n,{label:(0,T.getLabel)(N),attributeTypesList:U,crosswalks:P,metadata:x}),E().createElement("div",{ref:p,className:d},E().createElement(Hk,{errorMessage:Y},E().createElement(dU,{className:v()(t.item,{[t.dense]:Y||L&&(0,T.isTempUri)(L.entityUri)}),entity:L||{},entityTypesUris:D,max:20,globalSearchRequestOptions:S,mode:i,isDisabled:!z,onChange:F,onCreate:H?M:void 0,metadata:x,attributeTypesSelectionStrategy:j}))))};hU.propTypes=gU({},T.ReferenceAttributeType,{highlightedError:fp().object});const EU=(0,Jk.l)(nL,((e,t)=>{let{attributeValue:r,attributeType:n}=t;const{element:a,type:o}=e||{};return{highlightedError:rL(o)&&(0,T.isAttributeTypeError)(a,r.uri,n.uri)?e:null}}),hU);function bU(){return bU=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},bU.apply(this,arguments)}const vU=(0,h.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 E().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 T.DataTypes.TYPE_NESTED:return E().createElement(wL,t);case T.DataTypes.TYPE_REFERENCE:return E().createElement(EU,t);default:{const e=(0,A.omit)(["showEmptyEditors","onAddAttributes","lazy","errors","crosswalks","showNonOv","expanded"],t);return E().createElement(mL,bU({isReltioCrosswalk:(0,T.isReltioCrosswalk)(t.crosswalks,t.attributeValue)},e))}}}}.build(e.attributeType,n))}));vU.displayName="EditModeAttribute";const TU=e=>uo().text("${value}",{value:1===e?uo().text("value"):uo().text("values")}),OU=(0,A.has)("minValue"),xU=(0,A.has)("maxValue"),CU=(0,A.pipe)(xU,A.not),SU=(0,A.propSatisfies)((e=>1===e),"minValue"),wU=e=>{let{minValue:t}=e;return uo().text("This attribute can have minimum ${minValue} ${minValueCaption}",{minValue:uo().number(t,"0"),minValueCaption:TU(t)})},AU=e=>{let{maxValue:t}=e;return uo().text("This attribute can have maximum ${maxValue} ${maxValueCaption}",{maxValue:uo().number(t,"0"),maxValueCaption:TU(t)})},RU=(0,A.cond)([[A.isNil,(0,A.always)("")],[e=>{let{minValue:t,maxValue:r}=e;return t&&t===r},e=>{let{minValue:t}=e;return uo().text("This attribute should have ${minValue} ${minValueCaption}",{minValue:uo().number(t,"0"),minValueCaption:TU(t)})}],[(0,A.allPass)([SU,xU]),AU],[(0,A.allPass)([SU,CU]),(0,A.always)("")],[(0,A.allPass)([OU,xU]),e=>{let{minValue:t,maxValue:r}=e;return uo().text("${minCardinality} and maximum ${maxValue} ${maxValueCaption}",{minCardinality:wU({minValue:t}),maxValue:uo().number(r,"0"),maxValueCaption:TU(r)})}],[xU,AU],[OU,wU],[A.T,(0,A.always)("")]]),_U=(0,Tp.Z)((()=>({caption:{fontSize:"0.7rem",opacity:.54}}))),IU=e=>{let{cardinality:t}=e;const r=_U(),n=RU(t);return n?E().createElement(wy(),{variant:"caption",className:r.caption},n):null};function NU(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){DU(e,t,r[t])}))}return e}function DU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const PU={content:'""',position:"absolute",left:"-1000px",top:"-4px",width:"5000px",height:"calc(100% + 8px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},kU=(0,Tp.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlighted:{"&::before":NU({},PU,{background:"rgba(228, 151, 0, 0.08)"}),position:"relative"}}))),LU=e=>{const t=kU(),r=(0,h.useRef)(null);return(0,h.useEffect)((()=>{e&&e.scrollIntoRef(r)}),[e]),e?{ref:r,highlightedClassName:t.highlighted}:{ref:r}},UU=(0,A.filter)((0,A.propSatisfies)(T.isTempUri,"uri")),jU=(0,Tp.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"}}))),FU=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:b,onChangeAttribute:O,onDeactivateError:x,additionalControlsRenderer:C,requestNextPageOfAttributeValues:S}=e;const w=jU(),[R,_]=(0,h.useState)(t),[I,N]=(0,h.useState)(!1),{label:D,required:P,cardinality:k,name:L,uri:U,description:j}=n,F=(0,T.isEditableMode)(o),{ref:M,errorClassName:V}=sL({highlightedError:y}),{ref:B,highlightedClassName:z}=LU(g),H=(0,h.useContext)(gL),Y=(0,h.useMemo)((()=>null==H?void 0:H.includes(U)),[U,H]),W=(0,T.isEmptyValue)(r),G=(!I&&l||P||Y)&&W,q=(0,h.useRef)((0,T.createNewAttribute)({parentUri:a,attributeType:(0,A.omit)(["defaultValue"],n)})),Z=(0,h.useCallback)((()=>{_(R+1);const e=e=>({parentUri:a,index:R,attributeType:e});if(G&&!(0,T.isComplexAttribute)(n.type)){const t=[e((0,A.omit)(["defaultValue"],n)),e(n)];return f(t)}return f([e(n)])}),[R,f,a,n,G]),$=(0,h.useCallback)((0,A.pipe)(b,A.T,N),[b,N]);if(W&&!G)return null;if(G&&W&&(r=[q.current]),(0,T.isEmptyValue)(r))return null;const K=(UU(r)||[]).length,X=d?"totalValues":"totalOvValues",Q=(0,A.ifElse)((0,A.has)(X),(0,A.pipe)((0,A.prop)(X),(0,A.add)(K)),(0,A.always)(r.length))(u),J=null!=u&&u.totalValues?u.totalValues-Q:null==m?void 0:m.length,ee=t<Q,te=ee&&R<Q,re=ee&&R>=Q,ne=r.slice(0,R),ae=ne?ne.length-1:0,oe=Q-R;return E().createElement(eN,{enabled:i},E().createElement("div",{ref:M,className:v()(w.wrapper,V)},E().createElement("div",{className:w.titleWrapper},E().createElement(pD,{label:D,isRequired:P,className:w.title,"data-reltio-id":"reltio-attribute-label"}),E().createElement(vD,{description:j}),E().createElement(gD,{nonOvValues:m,attributeType:n,className:w.ovIcon,nonOvTotal:J})),F&&E().createElement(IU,{cardinality:k}),F&&E().createElement(Pk,{message:s,className:w.typeError}),E().createElement("div",{className:w.attributesWrapper},ne.map(((e,t)=>E().createElement(vU,{key:e.uri,attributeValue:e,attributeType:n,lazy:G&&!P,showEmptyEditors:l,errors:c,ownError:(0,T.getAttributeOwnError)(e,t,n.uri,c),mode:o,crosswalks:p,onAddOneMore:ae===t?Z:null,onAddAttributes:f,onDeleteAttribute:$,onChangeAttribute:O,onDeactivateError:x,additionalControlsRenderer:C,className:0===t?z:null,ref:0===t?B:null,isEmptyEditor:G}))),te&&E().createElement(SP,{moreNumber:(0,A.min)(t,oe),valueNumber:oe,onClick:()=>{r.length<Q&&S({parentUri:a,attributeTypeUri:U,attributeTypeName:L,values:r,defaultMaxValues:t}),_(R+t)}}),re&&E().createElement(_P,{onClick:()=>{_(t)}}))))};FU.displayName="AttributeRenderer";const MU=(0,h.memo)(FU),VU=(0,Tp.Z)({value:{color:"rgba(0, 0, 0, 0.87)"},placeholder:{color:"rgba(0, 0, 0, 0.38)",fontSize:"14px !important"}}),BU=e=>{let{selectProps:{menuIsOpen:t},data:{label:r}}=e;const n=VU();return!t&&E().createElement(wy(),{variant:"body2",classes:{root:n.value}},r)};BU.propTypes={selectProps:fp().shape({menuIsOpen:fp().bool}),data:fp().shape({label:fp().string})};const zU=BU;function HU(){return HU=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},HU.apply(this,arguments)}const YU=e=>{const t=VU(),{innerProps:r={},children:n}=e;return E().createElement(wy(),HU({className:t.placeholder},r),n)};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)}YU.propTypes={children:fp().node,innerProps:fp().object,selectProps:fp().object.isRequired};const GU={SingleValue:zU,Placeholder:YU},qU=(0,h.memo)((e=>{let t=WU({},e);return E().createElement(zL,WU({components:GU},t))})),ZU=(0,Tp.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},roleContainer:{width:"100%"},valueContainer:{marginLeft:"8px",width:0},deleteButton:{marginLeft:"8px"}}),$U={MultiValue:Og._},KU=e=>{let{values:t,onChange:r,onDelete:n}=e;const a=ZU(),o=(0,C.AH)(),i=(0,C.eh)(),l=i.uri,s=(0,T.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,A.propEq)("value",e)))||void 0===t?void 0:t.label)||(0,T.getLastUriPart)(e)}})),u=(0,h.useCallback)((e=>{const t=(null==e?void 0:e.map((0,A.prop)("value")))||[];r({value:t,attributeType:T.EntityAttrTypes.roles,uri:l})}),[l,r]),p=(0,h.useCallback)((()=>{n({uri:l,attributeType:T.EntityAttrTypes.roles})}),[l,n]);return E().createElement("div",{className:a.container,"data-reltio-id":"reltio-attribute-value"},E().createElement(qU,{label:"",height:40,isMulti:!0,options:s,value:c,onChange:u,components:$U,classes:a,className:a.roleContainer}),!!n&&E().createElement(Np.T,{"data-reltio-id":"reltio-roles-delete-button",className:a.deleteButton,icon:Lk(),onClick:p,size:"L"}))};var XU=r(56333);const QU=(0,Tp.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},deleteButton:{marginLeft:"8px"}});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){ej(e,t,r[t])}))}return e}function ej(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tj=e=>{let{className:t,values:r,onChange:n,onDelete:a}=e;const o=QU(),i=(0,C.lG)(),l=(0,C.mU)(),s=(0,h.useCallback)((async(e,t,r)=>{const n=await(0,T.getFacetedAttributeData)({fieldName:"tags",searchValue:e,options:JU({},l,{max:t,pageNo:r})});return Object.keys(n.tags)}),[l]),c=(0,h.useCallback)((e=>{n({value:e,attributeType:T.EntityAttrTypes.tags,uri:i})}),[n,i]),u=(0,h.useCallback)((()=>{a({uri:i,attributeType:T.EntityAttrTypes.tags})}),[i,a]);return E().createElement("div",{className:o.container,"data-reltio-id":"reltio-attribute-value"},E().createElement(XU.p,{fullWidth:!0,multiple:!0,variant:"filled",className:t,value:r||[],onChange:c,getSuggestions:s}),!!a&&E().createElement(Np.T,{"data-reltio-id":"reltio-tags-delete-button",className:o.deleteButton,icon:Lk(),onClick:u,size:"L"}))};function rj(){return rj=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},rj.apply(this,arguments)}function nj(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const aj=(0,Jk.l)(fL,((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=jU(),{label:y,required:g,cardinality:f}=r,b=(0,T.isEditableMode)(a),[O,x]=(0,h.useState)(!1),C=(0,h.useCallback)((e=>{x(e),null==u||u(r.uri,e)}),[r.uri,u]),S=void 0!==c?c:O,w=(0,h.useCallback)((0,A.pipe)(i,A.T,C),[i,C]),R=(0,T.isEmptyValue)(t),_=!S&&s&&R,I=(0,h.useRef)((0,T.createNewAttribute)({parentUri:n,attributeType:r})),{ref:N,highlightedClassName:D}=LU(p);return(0,T.isActivenessAttrType)(r)&&R&&!_?null:E().createElement("div",{ref:N,className:v()(D,m.wrapper)},E().createElement(pD,{label:y,isRequired:g,className:v()(m.title,m.titleWrapper),"data-reltio-id":"reltio-attribute-label"}),b&&E().createElement(IU,{cardinality:f}),b&&E().createElement(Pk,{message:o}),E().createElement(zI(),{className:m.attributesWrapper},(()=>{switch(r.uri){case T.EntityAttrTypes.tags.uri:return E().createElement(tj,{values:t,onDelete:w,onChange:l});case T.EntityAttrTypes.roles.uri:return E().createElement(KU,{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){nj(e,t,r[t])}))}return e}({},I.current,{value:t[0]||""});return E().createElement(vU,rj({attributeValue:e,attributeType:r,mode:a,onDeleteAttribute:w,onChangeAttribute:l},d))}}})()))}));var oj=r(57517),ij=r.n(oj);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 sj=e=>E().createElement("svg",lj({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),E().createElement("defs",null,E().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"})),E().createElement("g",{transform:"translate(-3 -3)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},E().createElement("mask",{id:"Download_svg__b",fill:"#fff"},E().createElement("use",{xlinkHref:"#Download_svg__a"})),E().createElement("path",{fillOpacity:.54,fill:"#fff",mask:"url(#Download_svg__b)",d:"M0 0h24v24H0z"})));var cj=r(76550),uj=r.n(cj),pj=r(29367),dj=r.n(pj);const mj=(0,Tp.Z)((()=>({root:{fontSize:"24px",color:"#fff"}}))),yj=e=>{let{checked:t,className:r,onClick:n}=e;const a=mj(),o=t?dj():uj();return E().createElement(o,{className:v()(a.root,r),onClick:n})},gj=(0,Tp.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"}}))),fj=(0,h.memo)((e=>{const{id:t,canBeSelected:r=!1,selected:n=!1,selectionMode:a=!1,onDeselect:o=Ep.ZT,onSelect:i=Ep.ZT,onShareLink:l,onSetAsDefault:s,onDelete:c,onDownload:u=Ep.ZT,onClick:p}=e,d=gj(),[m,y]=(0,h.useState)(!1),{canDelete:g}=bk(t),f=(0,h.useMemo)((()=>[{text:uo().text("Share link"),onClick:l},{text:uo().text("Set as default"),onClick:s},{text:uo().text("Delete"),onClick:g&&c}].filter((0,A.prop)("onClick"))),[l,s,c,g]),b=e=>()=>(0,A.ifElse)((0,A.equals)(!0),o,i)(e),T=r&&(n||m||a),O=!a&&!n&&m,x=r&&n;return E().createElement("div",{className:v()(d.overlay,{[d.selected]:n,[d.selectionMode]:a}),onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),onClick:a?b(n):e=>{e.currentTarget===e.target&&p()},"data-reltio-id":"image-actions-overlay"},T&&E().createElement(yj,{className:d.checkedIcon,checked:n,onClick:b(n)}),O&&E().createElement("div",{className:d.actions},E().createElement(Np.T,{onClick:u,className:d.actionButton,icon:sj}),E().createElement(RN,{menuId:`image-overlay-actions-${t}`,buttonComponent:Np.T,buttonProps:{icon:jd(),className:v()(d.actionButton,d.dropDownMenuButton)},menuItems:f})),x&&E().createElement(pE(),{className:d.button,variant:"outlined",onClick:o},uo().text("Deselect")))}));var hj=r(70251),Ej=r.n(hj),bj=r(1937),vj=r.n(bj);const Tj=(0,Tp.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}}))),Oj=e=>0===e.trim().length,xj=e=>{let{onSend:t}=e;const r=Tj(),[n,a]=(0,h.useState)(""),[o,i]=(0,h.useState)(null);return E().createElement(zI(),{className:r.root},E().createElement(WI(),{className:r.paper},E().createElement(vj(),{value:n,onChange:e=>{const t=e.target.value,r=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/).test(t);a(t),r||Oj(t)?i(null):i(uo().text("URL is not correct"))},classes:{root:r.inputRoot,input:r.input},placeholder:uo().text("Paste an image URL here")}),E().createElement(pE(),{disabled:Boolean(o)||Oj(n),variant:"outlined",color:"primary",onClick:()=>{t(n),a(""),i(null)}},uo().text("Send"))),o&&E().createElement(wy(),{className:r.errorMessage},o))};var Cj=r(65680),Sj=r(83997);const wj=["image/png","image/jpeg","image/tiff","image/gif","image/bmp"],Aj=e=>{let{className:t,onAppendFile:r}=e;return E().createElement(E().Fragment,null,E().createElement("input",{onInput:e=>{r&&r(e.currentTarget.files[0])},style:{display:"none"},accept:wj.join(","),id:"upload-image-button","data-reltio-id":"upload-image-button",type:"file"}),E().createElement("label",{htmlFor:"upload-image-button"},E().createElement(pE(),{className:t,variant:"contained",color:"primary",component:"span"},uo().text("Select image"))))};function Rj(){return Rj=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},Rj.apply(this,arguments)}const _j=e=>E().createElement("svg",Rj({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),E().createElement("defs",null,E().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__c"},E().createElement("stop",{stopColor:"#FFF",offset:"0%"}),E().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),E().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__d"},E().createElement("stop",{stopColor:"#FFF",offset:"0%"}),E().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),E().createElement("linearGradient",{x1:"67.572%",y1:"54.952%",x2:"15.212%",y2:"13.907%",id:"UploadIcon_svg__e"},E().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),E().createElement("stop",{stopColor:"#000",offset:"100%"})),E().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__f"},E().createElement("stop",{stopColor:"#B8EDFF",offset:"0%"}),E().createElement("stop",{stopColor:"#53ACDE",offset:"100%"})),E().createElement("circle",{id:"UploadIcon_svg__a",cx:128,cy:128,r:128})),E().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},E().createElement("mask",{id:"UploadIcon_svg__b",fill:"#fff"},E().createElement("use",{xlinkHref:"#UploadIcon_svg__a"})),E().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#UploadIcon_svg__a"}),E().createElement("g",{mask:"url(#UploadIcon_svg__b)"},E().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(-1 9)"},E().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}),E().createElement("ellipse",{fill:"url(#UploadIcon_svg__c)",opacity:.4,cx:64.553,cy:107.664,rx:61.43,ry:62.336}),E().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})),E().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)"}),E().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)"})))),Ij=(0,Tp.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"}}))),Nj=e=>{let{onAppendFile:t,className:r}=e;const n=Ij(),[{canDrop:a,isOver:o},i]=(0,Cj.useDrop)({accept:[Sj.FILE],drop:e=>{e&&t(e.files[0])},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),l=a&&o;return E().createElement("div",{ref:i,className:v()(n.root,{[n.isActive]:l},r)},E().createElement(_j,{className:n.icon}),E().createElement(wy(),{className:n.title},uo().text("Drag an image here")),E().createElement(wy(),{className:n.description},uo().text("Acceptable image types would include JPG, PNG, TIFF, GIF, BMP. Maximum image size: ${MAX_IMAGE_SIZE}Mb",{MAX_IMAGE_SIZE:20})),E().createElement(Aj,{onAppendFile:t}))},Dj=(0,Tp.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"}}))),Pj=e=>{let{children:t,className:r}=e;const n=Dj();return E().createElement(zI(),{className:v()(n.root,r)},E().createElement(zI(),{className:n.border}),E().createElement(wy(),{className:n.text},t),E().createElement(zI(),{className:n.border}))},kj=(0,Tp.Z)({closeIcon:{color:"#fff"}}),Lj=e=>{let{error:t,onClose:r}=e;const n=kj();return E().createElement(lE(),{open:Boolean(t),onClose:r,message:t,action:E().createElement(xd.k,{className:n.closeIcon,tooltipTitle:uo().text("Close"),icon:Rp(),onClick:r})})},Uj=(0,Tp.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"}}))),jj=e=>{let{open:t,onClose:r,onUpload:n}=e;const a=Uj(),[o,i]=(0,h.useState)(!1),[l,s]=(0,h.useState)(null),c=(0,C.qD)(),u=(0,C.fN)(),p=(0,C.Uv)(),d=e=>{i(!0),(0,T.uploadImage)({image:e,imageServicePath:c,environment:u,tenant:p}).then((e=>{n(e),r()})).catch((e=>{s((0,T.getRequestErrorMessage)(e,uo().text("Something went wrong")))})).finally((()=>i(!1)))};return E().createElement(Ej(),{open:t,onClose:r,classes:{paper:a.dialogPaper}},E().createElement(wy(),{className:a.title},uo().text("Add new image")),E().createElement(zI(),{className:a.body},E().createElement(Nj,{className:a.targetBox,onAppendFile:e=>{if(!e)return s(uo().text("No image selected."));const t=Number((e.size/1024/1024).toFixed(2)),r=wj.includes(e.type);t>20?s(uo().text("File size exceeds configured max file size.")):r?d(e):s(uo().text("File format is not supported."))}}),E().createElement(Pj,{className:a.divider},uo().text("or")),E().createElement(xj,{onSend:e=>{d(e)}})),o&&E().createElement(HE.Z,null),E().createElement(Lj,{error:l,onClose:()=>s(null)}))},Fj=(0,Tp.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"}}))),Mj={},Vj=e=>{let{attributeType:t={},attributeValues:r=[],onDeleteAttribute:n,onChangeAttribute:a,requestNextPageOfAttributeValues:o,parentUri:i,paging:l,showNonOv:s,imageSize:c=ek}=e;const u=Fj(c),[p,d]=(0,h.useState)(!1),m=(0,C.ax)("setDefaultProfilePicForModifiedEntity"),y=(0,C.eh)()||Mj,g=(0,C.AU)(y.uri),{canCreate:f}=(0,h.useContext)(Ek),b=(0,h.useCallback)((()=>{d((e=>!e))}),[]),v=(0,h.useCallback)((e=>{const r=(0,T.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,T.generateUri)(r,o.name),ov:!0,value:e[a],type:o.uri}])}a({attributeType:t,uri:r,value:n})}),[a,i,t]),O=(0,h.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,T.getImageAttributeOvUrl)(r),{uri:s}=r;return E().createElement(fj,{id:s,onShareLink:()=>o(l),onSetAsDefault:()=>i(r),onDelete:()=>O({uri:s,attributeType:t}),onDownload:()=>a([l]),onClick:()=>n(s)})};return E().createElement("div",{className:u.root,"data-reltio-id":"image-line-edit-mode"},E().createElement(CF,{attributeValues:r,attributeType:t,renderImage:e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=(0,T.getImageAttributeOvThumbnailUrl)(t),{uri:n}=t,{onOpenImageGalleryDialog:a}=e;return E().createElement("div",{className:u.image,key:n},E().createElement(JP,{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:b,onDeleteAttribute:O,imageSize:c,requestNextPageOfAttributeValues:o,paging:l,parentUri:i,showNonOv:s},f&&E().createElement("div",{className:u.uploadContainer,onClick:b},E().createElement(Np.T,{className:u.uploadButton,iconClassName:u.uploadIcon,icon:ij(),"data-reltio-id":"reltio-upload-image-button"}))),E().createElement(jj,{open:p,onUpload:v,onClose:b}))},Bj=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=jU(),{label:y,description:g,required:f}=t,{ref:b,highlightedClassName:O}=LU(c),{ref:x,errorClassName:C}=sL({highlightedError:p}),S=(0,h.useCallback)((()=>{u&&d&&d((0,T.getErrorId)(u))}),[u,d]);return E().createElement("div",{ref:b,className:v()(m.wrapper,O)},E().createElement("div",{ref:x,className:v()(m.imagesWrapper,C)},E().createElement("div",{className:m.titleWrapper},E().createElement(pD,{className:m.title,label:y,"data-reltio-id":"reltio-attribute-label",isRequired:f}),E().createElement(vD,{description:g})),E().createElement(Hk,{errorMessage:null==u?void 0:u.message,className:m.errorWrapper},E().createElement(Vj,{attributeValues:r,attributeType:t,paging:n,onDeleteAttribute:i,parentUri:a,onChangeAttribute:(0,A.pipe)(l,S),requestNextPageOfAttributeValues:s,showNonOv:o}))))};let zj=function(e){return e.imageLine="imageLine",e.special="special",e.default="default",e}({});function Hj(){return Hj=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},Hj.apply(this,arguments)}const Yj=(0,Jk.l)(nL,((e,t)=>{let{attributeType:r,parentUri:n}=t;const{element:a,type:o}=e||{},i=(e=>e===tL.NewAttribute)(o)&&a.uri===r.uri;return{highlightedAttribute:i?e:null,highlightedError:rL(o)&&(0,T.isAttributeTypeError)(a,n,r.uri)?e:null}}),(e=>{var t;let{values:r,attributeType:n,mode:a=T.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 b=(0,C.ax)("errorDeactivated"),v=(0,C.ax)("requestNextPageOfAttributeValues"),O=(0,C.Jz)(s,n),x=(0,C.Xj)(),S=(0,C.vd)(),w=(0,T.getAttributePagerActiveTypeErrorMessage)(s,n,x),R=null!==(t=null!=c?c:S)&&void 0!==t?t:1/0,_=(0,A.partition)(T.isOv),[I,N]=_(r),D=p?r:I,P=p?[]:N,k={errorMessage:w,errors:O,mode:a,parentUri:s,onAddAttributes:y,onDeleteAttribute:g,onChangeAttribute:f,onDeactivateError:b,additionalControlsRenderer:h,showEmptyEditors:u,highlightedError:d,highlightedAttribute:m};return(()=>{switch((0,A.cond)([[T.isSpecialAttribute,(0,A.always)(zj.special)],[T.isImage,(0,A.always)(zj.imageLine)],[A.T,(0,A.always)(zj.default)]])(n)){case zj.special:return E().createElement(eN,{enabled:i},E().createElement(aj,Hj({values:D,attributeType:n},k)));case zj.imageLine:return E().createElement(eN,{enabled:i},E().createElement(Bj,{attributeValues:D,attributeType:n,paging:l,onDeleteAttribute:g,parentUri:s,onChangeAttribute:f,requestNextPageOfAttributeValues:v,showNonOv:p,highlightedAttribute:m,error:(0,T.getAttributeErrorByTypeUri)(n.uri,O),highlightedError:d,onDeactivateError:b}));default:return E().createElement(MU,Hj({values:D,attributeType:n,max:R,paging:l,crosswalks:o,drawLines:i,requestNextPageOfAttributeValues:v,showNonOv:p,nonVisibleValues:P},k))}})()})),Wj=(0,Tp.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"}}),Gj=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=Wj(),d=Ck(n,t,r),m=0!==d.length||0===d.length&&a;return E().createElement(zI(),{className:p.root},E().createElement(zI(),{className:p.form},d.map((e=>{let{attrType:t,values:r}=e;return E().createElement(Yj,{key:t.uri,parentUri:n.uri,attributeType:t,values:r,showEmptyEditors:(0,T.isTempUri)(n.uri),mode:u,drawLines:!1,onDeleteAttribute:o,onChangeAttribute:i,onAddAttributes:l})}))),m&&E().createElement(E().Fragment,null,E().createElement(lh(),{className:p.divider}),E().createElement(zI(),{className:p.actions},E().createElement(pE(),{disabled:!a,onClick:s,className:p.cancelButton},uo().text("Cancel")),E().createElement(pE(),{disabled:!a,onClick:c,color:"primary"},uo().text("Apply")))))},qj={palette:{mode:"dark",primary:T.theme.palette.primary,secondary:T.theme.palette.secondary}},Zj=(0,Pm.createTheme)(qj),$j=e=>{let{imageAttributeFieldsOrder:t,attributeType:r,attributeValue:n}=e;const a=(0,C.YA)(),o=(0,C.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,C.ax)("modifyAttribute"),[a,o]=(0,h.useState)(t);(0,h.useEffect)((()=>{o(t)}),[t]);const i=!(0,A.equals)(a,t),l=(0,h.useCallback)((e=>{o((t=>e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,T.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a,nestingLevel:1})}),t)))}),[]),s=(0,h.useCallback)((e=>{let{value:t,attributeType:r,uri:n}=e;o((e=>(0,T.editAttribute)({entity:e,attributeType:r,uri:n,value:t,nestingLevel:1})))}),[]),c=(0,h.useCallback)((e=>{let{attributeType:t,uri:r}=e;o((e=>(0,T.removeAttribute)({entity:e,attributeType:t,uri:r,nestingLevel:1})))}),[]);return{addAttributes:l,changeAttribute:s,deleteAttribute:c,clearLocalChanges:(0,h.useCallback)((()=>{o(t)}),[t]),applyLocalChanges:(0,h.useCallback)((()=>{n({value:a,attributeType:r,uri:a.uri})}),[a,r,n]),attributeValue:a,hasChanges:i}})({attributeType:r,initialAttributeValue:n});return E().createElement(Pm.ThemeProvider,{theme:Zj},E().createElement(zI(),null,E().createElement(Ak,{attributeType:r,uri:null==p?void 0:p.uri,onAddAttributes:o?i:void 0}),E().createElement(Nk,{attributeType:r,attributeValue:p,imageAttributeFieldsOrder:t}),o&&E().createElement(Gj,{mode:a,imageAttributeFieldsOrder:t,attributeType:r,attributeValue:p,hasChanges:d,onDeleteAttribute:s,onChangeAttribute:l,onAddAttributes:i,onCancel:c,onApply:u})))},Kj=(0,Tp.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}}))),Xj=e=>{let{className:t,attributeValue:r,handleSetAsDefault:n,attributeType:a}=e;const o=Kj(),[i,l]=(0,h.useState)(!1),s=(0,C.eh)()||{},c=(0,C.vc)(null==s?void 0:s.uri)||{},u=(0,C.xH)(),p=(0,C.uO)()||{},d=u?s:c,m=p[null==s?void 0:s.type]||(null==p?void 0:p.default)||{};(0,h.useEffect)((()=>{l((null==d?void 0:d.defaultProfilePic)===(null==r?void 0:r.uri))}),[null==r?void 0:r.uri,d]);const y=(0,h.useCallback)((()=>{n(r.uri)}),[null==r?void 0:r.uri]);return E().createElement(zI(),{className:v()(o.root,t)},E().createElement(zI(),{className:o.header},E().createElement(wy(),{className:o.headerTitle},uo().text("Details"))),E().createElement(zI(),{className:o.bodyWrapper},E().createElement(zI(),{className:o.body},E().createElement(Vh(),{classes:{root:o.formControlLabel,label:o.checkboxLabel},control:E().createElement(Kp(),{className:o.checkbox,checked:i,onChange:y}),label:uo().text("Set as default")}),E().createElement($j,{attributeType:a,imageAttributeFieldsOrder:m,attributeValue:r}))))},Qj=(0,Tp.Z)((()=>({root:{display:"flex",width:"100%",overflowY:"auto",height:"calc(100vh - 64px)"},main:{flex:"1 0 auto"},details:{width:"340px"}}))),Jj=e=>{let{attributeValues:t=[],currentAttributeValueUri:r,setCurrentAttributeValueUri:n,handleSetAsDefault:a,attributeType:o}=e;const[i,l]=(0,h.useState)(0);(0,h.useEffect)((()=>{s(r?t.findIndex((e=>e.uri===r)):0)}),[r,t]);const s=(0,h.useCallback)((e=>{var r;l(e),n(null===(r=t[e])||void 0===r?void 0:r.uri)}),[t]),c=Qj();return E().createElement(zI(),{className:c.root},E().createElement(uk,{attributeValueIndex:i,setAttributeValueIndex:s,attributeValues:t,className:c.main}),E().createElement(Xj,{handleSetAsDefault:a,attributeValue:t[i],className:c.details,attributeType:o}))};var eF=r(60480),tF=r.n(eF),rF=r(54886),nF=r.n(rF),aF=r(86038),oF=r.n(aF),iF=r(39178),lF=r.n(iF);function sF(){return sF=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},sF.apply(this,arguments)}const cF=e=>E().createElement("svg",sF({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),E().createElement("defs",null,E().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"})),E().createElement("g",{stroke:"none",strokeWidth:1,fillRule:"evenodd"},E().createElement("mask",{id:"Details_svg__b",fill:"#fff"},E().createElement("use",{xlinkHref:"#Details_svg__a"})),E().createElement("path",{mask:"url(#Details_svg__b)",d:"M0 0h24v24H0z"}))),uF=(0,Tp.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 pF=function(e){return e.GALLERY_MODE="gallery",e.DETAILS_MODE="details",e}({});const dF=e=>{let{open:t,mode:r,children:n,header:a,onClose:o,onChangeMode:i}=e;const l=uF(),s=(0,h.useMemo)((()=>[{id:pF.GALLERY_MODE,title:uo().text("Gallery"),Icon:lF()},{id:pF.DETAILS_MODE,title:uo().text("Details"),Icon:cF}]),[]);return E().createElement(Ej(),{classes:{paper:l.paper},open:t,BackdropProps:{className:l.backdrop},fullScreen:!0},E().createElement(nF(),{classes:{colorPrimary:l.appBar}},E().createElement(oF(),{className:l.toolbar},E().createElement(zI(),{className:l.headerLeft},E().createElement(xd.k,{tooltipTitle:uo().text("Close"),onClick:o,className:l.closeButton,iconClassName:l.closeIcon,icon:Rp()}),null==a?void 0:a.left),E().createElement(zI(),{className:l.headerCenter},E().createElement(KE,{modes:s,modeId:r,onChange:i,className:l.modeSwitcher})),E().createElement(zI(),{className:l.headerRight},null==a?void 0:a.right))),E().createElement(tF(),{className:l.content},n))},mF=(0,Tp.Z)((()=>({root:{padding:"0 24px",overflowY:"auto",height:"calc(100vh - 64px)"},item:{padding:"2px"}}))),yF=e=>{let{items:t,selectedItems:r,onSelectImage:n,onDeselectImage:a,onShareLink:o,onSetAsDefault:i,onDownload:l,onClickImage:s,onDelete:c}=e;const u=mF(),p=e=>E().createElement(fj,{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 E().createElement(zI(),{className:u.root},E().createElement(ik(),{container:!0},t.map((e=>{let{id:t,src:r}=e;return E().createElement(ik(),{key:t,classes:{item:u.item},item:!0},E().createElement(JP,{size:$P.LARGE,onClick:()=>s(t),src:r,overlay:p(t)}))}))))},gF=(0,Tp.Z)((e=>({selectButton:{fontSize:"14px",fontWeight:500,color:e.palette.primary.main,textTransform:"uppercase"}}))),fF=e=>{let{selectedItems:t,items:r,onSelectAll:n,onClearAll:a}=e;const o=gF(),i=t.length===r.length;return E().createElement(Uy(),{component:"button",underline:"none",classes:{button:o.selectButton},onClick:i?a:n},i?uo().text("Clear selection"):uo().text("Select all images"))};var hF=r(70997),EF=r.n(hF);const bF=(0,Tp.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)"}}))),vF=e=>{let{onDownload:t,onShare:r,onUpload:n,onDelete:a}=e;const o=bF();return E().createElement(E().Fragment,null,n&&E().createElement(pE(),{variant:"contained",color:"primary",onClick:n,startIcon:E().createElement(ij(),null)},uo().text("Upload")),t&&n&&E().createElement("div",{className:o.divider}),t&&E().createElement(xd.k,{className:o.downloadButton,tooltipTitle:uo().text("Download selected items"),icon:sj,onClick:t}),r&&E().createElement(xd.k,{className:o.shareButton,tooltipTitle:uo().text("Copy link"),icon:EF(),onClick:r}),a&&E().createElement(xd.k,{className:o.deleteButton,tooltipTitle:uo().text("Delete selected items"),icon:Lk(),onClick:a}))},TF=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,h.useState)([]),[y,g]=(0,h.useState)(pF.GALLERY_MODE),f=(0,C.xH)();(0,h.useEffect)((()=>{g(a?pF.DETAILS_MODE:pF.GALLERY_MODE)}),[a]);const b=t.map((e=>({src:(0,T.getImageAttributeOvThumbnailUrl)(e),downloadURL:(0,T.getImageAttributeOvUrl)(e),id:e.uri}))),v=e=>{s(b.find((0,A.propEq)("id",e)).downloadURL)},O=e=>{const r=t.find((t=>{let{uri:r}=t;return r===e}));c(r)},x=e=>{p({uri:e,attributeType:i})},{canCreate:S,canDelete:w}=(0,h.useContext)(Ek),R=y===pF.GALLERY_MODE,_=y===pF.DETAILS_MODE,I=d.length>0,N=_||R&&I,D=()=>R?d:[a],P=D().every((e=>(0,T.isTempUri)(e)||w)),k=!f&&N&&P,L=!f&&S&&(_||R&&!I),U=R&&I&&E().createElement(fF,{items:b,selectedItems:d,onClearAll:()=>{m([])},onSelectAll:()=>{m((0,A.pluck)("id",b))}}),j=E().createElement(vF,{onDelete:k?()=>{D().forEach((e=>{x(e)})),d.length&&m([])}:void 0,onDownload:N?()=>{const e=R?(0,A.pipe)((0,A.filter)((e=>{let{id:t}=e;return d.includes(t)})),(0,A.pluck)("downloadURL"))(b):[b.find((0,A.propEq)("id",a)).downloadURL];l(e)}:void 0,onShare:_?()=>{v(a)}:void 0,onUpload:L?u:void 0});return E().createElement(dF,{mode:y,open:r,onChangeMode:g,header:{left:U,right:j},onClose:n},R&&E().createElement(yF,{items:b,selectedItems:d,onSelectImage:e=>{m((t=>[...t,e]))},onDeselectImage:e=>{m((t=>t.filter((t=>t!==e))))},onShareLink:v,onSetAsDefault:O,onDownload:e=>{l([b.find((0,A.propEq)("id",e)).downloadURL])},onClickImage:e=>{o(e),g(pF.DETAILS_MODE)},onDelete:f?void 0:x}),_&&E().createElement(Jj,{handleSetAsDefault:O,setCurrentAttributeValueUri:o,currentAttributeValueUri:a,attributeValues:t,attributeType:i}))},OF=(0,Tp.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,Pm.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 xF(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const CF=e=>{let{attributeType:t,attributeValues:r=[],renderImage:n,overlay:a=!1,countFixedItems:o=0,children:i,onUpload:l,onDeleteAttribute:s,imageSize:c=ek,paging:u,parentUri:p,showNonOv:d,requestNextPageOfAttributeValues:m}=e;const y=OF(c);(0,h.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,h.useRef)(),[f,b]=(0,h.useState)(0),[v,O]=(0,h.useState)(0),x=(0,h.useContext)(VI),[S,w]=(0,h.useState)(!1),[A,R]=(0,h.useState)(),_=(0,C.ax)("setDefaultProfilePicForEntity"),I=(0,C.ax)("setDefaultProfilePicForModifiedEntity"),N=(0,C.eh)()||{},D=(0,C.xH)(),P=(0,h.useCallback)((e=>{const{imageMargin:t,imageWidth:n}=c,a=Math.floor((e+t)/(n+t))-o,i=e+t-(a+o)*(n+t)<8;b(a),r.length>a?O(r.length-a+(i?1:0)):O(0)}),[r.length,o,c]),k=(0,h.useCallback)((e=>{P(e),g.current=e}),[P]);(0,h.useEffect)((()=>{g.current&&P(g.current)}),[r.length,P]);const L=(0,h.useCallback)((e=>{x||(R(e),w(!0))}),[x]),U=(0,h.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,h.useCallback)((e=>{D?(0,T.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){xF(e,t,r[t])}))}return e}({onOpenImageGalleryDialog:L},a&&{onDownload:j,onShareLink:F,onSetAsDefault:M});return E().createElement(E().Fragment,null,E().createElement(Bp.Z,{handleWidth:!0,onResize:k}),E().createElement(TF,{attributeValues:r,open:S,onClose:U,setCurrentAttributeValueUri:R,currentAttributeValueUri:A,attributeType:t,onDownload:j,onShareLink:F,onSetAsDefault:M,onUpload:l,onDeleteAttribute:s}),E().createElement("div",{className:y.imageBox},i,r.slice(0,f).map(n(V)),v>0&&E().createElement("div",{className:y.moreButtonContainer},E().createElement("div",{className:y.moreButton,onClick:()=>L()},E().createElement(wy(),{className:y.number},`+${v}`)))))},SF=(0,Tp.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,T.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:T.historyPalettes[T.HistoryOperations.deleteAttribute].backgroundColor,pointerEvents:"none"}},updateAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:T.historyPalettes[T.HistoryOperations.updateAttribute].backgroundColor,pointerEvents:"none"}},deleteAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${T.historyPalettes[T.HistoryOperations.deleteAttribute].color}`,outlineOffset:"-3px"}},insertAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${T.historyPalettes[T.HistoryOperations.insertAttribute].color}`,outlineOffset:"-3px"}},updateAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${T.historyPalettes[T.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"}}))),wF=e=>{let{attributeType:t,attributeValues:r=[],paging:n,parentUri:a,requestNextPageOfAttributeValues:o,showNonOv:i,imageSize:l=ek}=e;const s=SF(l),{appearance:c}=(0,h.useContext)(TD);return E().createElement(CF,{attributeValues:r,attributeType:t,renderImage:e=>{let{onOpenImageGalleryDialog:t}=e;return e=>{const r=(0,T.getImageAttributeOvThumbnailUrl)(e),{uri:n}=e,a=(0,T.getHistoryAppearanceByUri)(n,c),o=(0,T.getHistoryAttributeClassName)(a);return E().createElement("div",{className:v()(s.image,{[s[o+"Image"]]:o}),key:n,"data-reltio-id":"reltio-attribute-value"},E().createElement(JP,{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})},AF=e=>{let{attributeType:t,attributeValues:r,paging:n,parentUri:a,showNonOv:o,requestNextPageOfAttributeValues:i}=e;const l=vP(),{label:s,description:c}=t;return E().createElement(E().Fragment,null,E().createElement("div",{className:l.titleRow},E().createElement(pD,{className:l.title,label:s,"data-reltio-id":"reltio-attribute-label"}),E().createElement(vD,{className:l.descriptionIcon,description:c})),E().createElement(wF,{attributeValues:r,attributeType:t,paging:n,parentUri:a,requestNextPageOfAttributeValues:i,showNonOv:o}))},RF="oneLine",_F="multiLine",IF="imageLine",NF="special",DF=(0,h.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=EP(),d=(0,C.ax)("requestNextPageOfAttributeValues"),m=(0,C.vd)(),y=null!==(t=null!=l?l:m)&&void 0!==t?t:1/0,g=(0,A.partition)(T.isOv);if(!r||!r.length)return null;const[f,h]=g(r),b=u?r:f,O=u?[]:h,x=u?"totalValues":"totalOvValues",S=(0,A.ifElse)((0,A.has)(x),(0,A.prop)(x),(0,A.always)(b.length))(o),w=null!=o&&o.totalValues?o.totalValues-S:O.length,R=1===S&&!(0,T.isComplexAttribute)(n);return E().createElement(eN,{enabled:a,className:v()({[p.paddingWrapperWithLines]:a})},E().createElement("div",{className:v()({[p.paddingWrapper]:!a})},(()=>{switch((0,A.cond)([[T.isSpecialAttribute,(0,A.always)(NF)],[T.isImage,(0,A.always)(IF)],[(0,A.always)(R),(0,A.always)(RF)],[A.T,(0,A.always)(_F)]])(n)){case RF:return E().createElement(TP,{value:b[0],nonVisibleValues:O,totalNonVisibleValues:w,attributeType:n,titleClassName:s,contentClassName:c,showNonOv:u});case _F:return E().createElement(IP,{values:b,nonVisibleValues:O,totalVisibleValues:S,totalNonVisibleValues:w,attributeType:n,parentUri:i,max:y,requestNextPageOfAttributeValues:d,titleClassName:s,contentClassName:c,showNonOv:u});case IF:return E().createElement(AF,{attributeValues:b,attributeType:n,paging:o,parentUri:i,requestNextPageOfAttributeValues:d,showNonOv:u});case NF:return E().createElement(YP,{values:b,attributeType:n})}})()))})),PF=e=>{let{attrTypes:t,entity:r,parentUri:n,drawLines:a,children:o,className:i,max:l,alwaysVisibleTypeUris:s=yL,showNonOv:c}=e;const[u,p]=(0,h.useState)(l||1/0),d=(0,h.useMemo)((()=>(0,T.getAttributesListForReadMode)(t,r,c)),[t,r,c]),[m,y]=(0,h.useMemo)((()=>Wk(s,d)),[d,s]),g=y.slice(0,u),f=l&&g.length<y.length,b=l&&g.length>=y.length&&l<g.length,v={enabled:a};return E().createElement("div",{className:i},o&&E().createElement(eN,v,o),g.concat(m).map((e=>{let{attrType:t,values:o}=e;return E().createElement(DF,{key:t.uri,attributeType:t,drawLines:a,values:o,paging:(0,A.path)(["paging",t.uri],r.attributes),parentUri:n,showNonOv:c})})),f&&E().createElement(SP,{onClick:()=>{p(1/0)}}),b&&E().createElement(_P,{onClick:()=>{p(l)}}))};PF.displayName="ReadOnlyAttributesList";const kF=(0,h.memo)(PF),LF=(0,Tp.Z)({attributesContainer:{padding:"8px 16px"},noCaption:{paddingTop:"16px"},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"}}),UF=e=>{let{className:t,entity:r={},caption:n="",excludeUris:a=[],includeUris:o=[],attributesCount:i}=e;const l=LF(),s=(0,C.AH)(),c=(0,C.xK)(),u=(0,h.useMemo)((()=>{const e=(0,T.getRuleBasedAttributes)(s,r.type),t=(0,T.getHiddenDynamicAttributes)(e,r);return(0,A.pipe)(Yk,(0,A.reject)((e=>{let{uri:r}=e;return t.includes(r)})))(s,r.type,o,a,t)}),[a,o,s,r]),p=i||16,d=(0,T.getAttributesListForReadMode)(u,r).filter((e=>{let{values:t}=e;return!(0,T.isEmptyValue)(t)})).length>0;return d||!(0,T.isEmptyValue)(n)?E().createElement(HI.Provider,{value:c},E().createElement(KI,{className:t},n&&E().createElement(XI.I,{title:n}),E().createElement(zI(),{className:v()(l.attributesContainer,{[l.noCaption]:!n})},d?E().createElement(kF,{entity:r,attrTypes:u,parentUri:r.uri,drawLines:!1,max:p}):E().createElement(wy(),{className:l.noData},uo().text("No data found"))))):null},jF=(0,Tp.Z)({attributesContainer:{overflow:"hidden",padding:"8px 16px"},noCaption:{paddingTop:"16px"}}),FF=e=>{let{className:t,mode:r,entity:n,caption:a="",excludeUris:o=[],includeUris:i=[],pinnedAttributes:l}=e;const s=jF(),c=(0,C.ax)("addAttributes"),u=(0,C.ax)("modifyAttribute"),p=(0,C.ax)("removeAttribute"),d=(0,C.AH)(),m=(0,C.R2)(),y=(0,C.vc)(n.uri)||{},g=(0,h.useMemo)((()=>(0,T.getPinnedAttributesForUser)(l,m)),[l,m]),f=(0,h.useMemo)((()=>Yk(d,y.type,i,o)),[o,i,d,y.type]);return E().createElement(KI,{className:t},a&&E().createElement(XI.I,{title:a}),E().createElement(zI(),{className:v()(s.attributesContainer,{[s.noCaption]:!a})},E().createElement(gL.Provider,{value:g},E().createElement(vL,{entity:y,attrTypes:f,parentUri:y.uri,drawLines:!1,mode:r,showEmptyEditors:(0,T.isTempUri)(y.uri),crosswalks:y.crosswalks,onAddAttributes:c,onChangeAttribute:u,onDeleteAttribute:p}))))};function MF(){return MF=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},MF.apply(this,arguments)}const VF=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,C.Fr)(),o=(0,C.YA)(),i=n.entity||a,l=n.mode||o;return E().createElement(dD.Provider,{value:i},(0,T.isViewMode)(l)?E().createElement(UF,MF({},n,{attributesCount:t,entity:i})):E().createElement(FF,MF({},n,{mode:l,pinnedAttributes:r,entity:i})))},BF=(0,Tp.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)"}}))),zF=()=>{const e=BF(),t=(0,hp.useSelector)(nc),r=(0,hp.useSelector)(tc);return E().createElement(E().Fragment,null,r&&E().createElement(HE.Z,null),t?E().createElement("div",{className:e.container},E().createElement(MI,{entity:t,classes:{profileBand:e.profileBand}}),E().createElement("div",{className:e.scrollWrapper},E().createElement(VI.Provider,{value:!0},E().createElement(VF,{className:e.attributesView,entity:t,mode:T.Mode.Viewing})))):E().createElement("div",{className:e.emptyState},E().createElement(zE,{LogoRenderer:BE.NO_DATA,text:uo().text("No data to display."),secondaryText:uo().text("Select a profile and view preview details here."),variant:VE.embedded})))},HF="circle",YF="polygon",WF={fillColor:"rgb(242,82,82)",fillOpacity:.1,strokeWeight:2,strokeColor:"#F25252",clickable:!1,editable:!0,zIndex:1},GF={mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1},qF=.001,ZF=E().createContext({});ZF.displayName="EntityMarkerContext";var $F=r(17871),KF=r(47111);const XF=e=>{let{children:t,className:r,position:n,map:a}=e;const[o,i]=(0,h.useState)(null);return(0,h.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,h.useEffect)((()=>{o&&r&&o.classList.add(r)}),[r,o]),o?(0,KF.createPortal)(t,o):null};var QF=r(518),JF=r.n(QF);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=>E().createElement("svg",eM({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},e),E().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 rM(){return rM=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},rM.apply(this,arguments)}const nM=e=>E().createElement("svg",rM({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),E().createElement("defs",null,E().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"})),E().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},E().createElement("mask",{id:"Draw_svg__b",fill:"#fff"},E().createElement("use",{xlinkHref:"#Draw_svg__a"})),E().createElement("g",{mask:"url(#Draw_svg__b)",fill:"#000",fillOpacity:.54},E().createElement("path",{d:"M0 0h24v24H0z"})))),aM=(0,Tp.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"}}),oM=(0,dd.T)(pE()),iM=e=>{let{drawingMode:t,drawingModes:r=[],hasActiveOverlay:n,onDrawingModeChanged:a,onClearOverlay:o}=e;const i=aM(),l=e=>()=>{a(e)};return E().createElement("div",{className:i.container},t||n?E().createElement(oM,{tooltipTitle:uo().text("Clear area"),className:i.button,onClick:n?o:l(null)},E().createElement(JF(),{className:i.icon})):r.map((e=>{const t=(e=>{switch(e){case HF:return tM;case YF:return nM;default:return null}})(e);return E().createElement(oM,{tooltipTitle:uo().text("Draw area"),key:e,className:i.button,onClick:l(e)},E().createElement(t,{className:i.icon}))})))},lM=(0,Tp.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"}}}),sM=e=>{let{isSearchOnMapMove:t,onChangeIsSearchOnMapMove:r}=e;const n=lM();return E().createElement(Vh(),{classes:{root:n.container,label:n.label},control:E().createElement(Kp(),{checked:t,onChange:e=>{r(e.target.checked)},className:n.checkbox}),label:uo().text("Search as I move the map")})},cM=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]]},uM=e=>{switch(e){case HF:return window.google.maps.drawing.OverlayType.CIRCLE;case YF:return window.google.maps.drawing.OverlayType.POLYGON;default:return null}},pM=(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)}},dM=(0,Tp.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"}}}}))),mM=e=>{let{entity:t,classes:r={}}=e;const n=dM(),{secondaryLabel:a,label:o}=r,i=(0,T.getLabel)(t.label),{secondaryLabel:l}=t,s=(0,h.useCallback)((()=>{navigator.clipboard.writeText((0,T.getEntityId)(t))}),[t]);return E().createElement(E().Fragment,null,E().createElement(S,{entity:t,imageClassName:n.image}),E().createElement("div",{className:n.info},E().createElement(Yd,{value:(0,T.getEntityUriForLink)(t),className:n.link},E().createElement(pd.Y,{value:i,placement:"top",showOnExceededHeight:!0},E().createElement("div",{className:v()(n.label,o)},i))),l&&E().createElement(pd.Y,{value:l,placement:"top",showOnExceededHeight:!0},E().createElement("div",{className:v()(n.secondaryLabel,a)},l)),E().createElement("div",{className:n.thirdRow},E().createElement(wE,{entity:t,size:"medium"}),E().createElement("div",{className:n.entityId,onClick:s},E().createElement("div",{className:n.entityIdLabel},uo().text("ID:")),E().createElement(pd.Y,{value:`Copy to clipboard ${(0,T.getEntityId)(t)}`,placement:"top"},E().createElement("div",{className:n.entityIdValue},(0,T.getEntityId)(t)))))))},yM=(0,Tp.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)"}}),gM=()=>{const e=yM();return E().createElement(E().Fragment,null,E().createElement("div",{className:v()(e.avatar,e.wave)}),E().createElement("div",{className:e.info},E().createElement("div",{className:v()(e.label,e.wave)}),E().createElement("div",{className:v()(e.secondaryLabel,e.wave)}),E().createElement("div",{className:v()(e.thirdRow,e.wave)})))},fM=(0,Tp.Z)({container:{display:"flex",padding:"16px",overflow:"hidden"}});function hM(){return hM=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},hM.apply(this,arguments)}const EM=(0,h.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=fM(),{container:i}=r;return E().createElement("div",hM({className:v()(o.container,i)},a),"normal"===n?E().createElement(mM,{entity:t,classes:r}):E().createElement(gM,null))})),bM=(0,Tp.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 vM(){return vM=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},vM.apply(this,arguments)}const TM=(0,T.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>'),OM=(0,T.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>'),xM=(0,h.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=bM(),o=(0,h.useRef)(),[i,l]=(0,h.useState)(!1),{activeEntityUri:s}=(0,h.useContext)(ZF),c=(0,A.pathEq)(["entity","uri"],s,t),u={lat:t.point.lat,lng:t.point.lng},p=(0,h.useCallback)((0,T.debounce)(l,50),[]),d=(0,h.useCallback)((()=>p(!0)),[p]),m=(0,h.useCallback)((()=>p(!1)),[p]),y=(0,h.useCallback)((()=>r(t)),[r,t]);return E().createElement(E().Fragment,null,E().createElement(hN.Z,{anchorEl:o.current,open:i,className:a.popper,modal:!1,placement:"top"},E().createElement(EM,{entity:t.entity,onMouseOver:d,onMouseOut:m})),E().createElement($F.Jx,vM({icon:{url:i||c?TM:OM,scaledSize:new google.maps.Size(22,32)},position:u,onClick:y,visible:!1!==t.visible,onMouseOver:d,onMouseOut:m},n)),E().createElement($F.vD,{options:{alignBottom:!0,pane:"mapPane",pixelOffset:new google.maps.Size(0,-40),closeBoxURL:"",enableEventPropagation:!0,disableAutoPan:!0},position:u},E().createElement("span",{ref:o})))})),CM=(0,Tp.Z)({mapControlContainer:{borderRadius:"2px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.15)",margin:"10px"}});function SM(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){wM(e,t,r[t])}))}return e}function wM(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const AM=["drawing"],RM=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=Ep.ZT,onOverlayUpdated:f=Ep.ZT,onMarkerClicked:b=Ep.ZT}=e;const v=CM(),{isLoaded:T,loadError:O}=(0,$F.Ji)({googleMapsApiKey:r,libraries:AM}),x=(0,h.useRef)(null),[C,S]=(0,h.useState)(null),[w,R]=(0,h.useState)(null),[_,I]=(0,h.useState)(null);(e=>{let{markers:t,activeOverlay:r,isSearchOnMapMove:n,map:a}=e;const o=Boolean(a&&window.google),i=(0,ug.D)(t),l=(0,ug.D)(r),s=(0,ug.D)(o);(0,h.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()+qF,e.lng()+qF)),n.extend(new window.google.maps.LatLng(e.lat()-qF,e.lng()-qF))}t.fitBounds(n),r&&pM(t,r,n)})(t,a,r):u&&pM(a,r)}),[o,t,r])})({markers:t,activeOverlay:s,map:C,isSearchOnMapMove:i});const N=(0,h.useMemo)((()=>SM({},WF,c)),[c]),D=(0,h.useMemo)((()=>SM({},GF,m)),[m]),P=(0,h.useCallback)((e=>{g(e?cM(C):null),I(null),clearTimeout(x.current)}),[C,g]),k=(0,h.useCallback)((()=>{clearTimeout(x.current)}),[]),L=(0,h.useCallback)((()=>{i&&g(cM(C))}),[i,C,g]),U=(0,h.useCallback)((()=>{i&&(clearTimeout(x.current),x.current=setTimeout(L,1e3))}),[L,i]),j=(0,h.useCallback)(((e,t)=>{var r;const n=t||w&&{type:YF,overlay:w};if((0,A.isEmpty)(n))return;const{overlay:a,type:o}=n,i={[YF]:()=>a.getPath().getArray().map((e=>[e.lat(),e.lng()])),[HF]:()=>({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,h.useCallback)((e=>t=>{j(null,{type:e,overlay:t}),t.setMap(null),I(null)}),[j]),M=(0,h.useCallback)((()=>{f(null)}),[f]),V=e=>t.filter((0,A.prop)("point")).map((t=>E().createElement(xM,{key:t.id,marker:t,clusterer:e,onClick:b})));if(O)return null;if(!T)return o;const B=l&&Boolean(u.length),z=C&&l&&Boolean(u.length),H=C&&l,Y=!uM(_)&&s&&(0,A.propEq)("type",YF,s);return E().createElement($F.b6,{mapTypeId:window.google.maps.MapTypeId.ROADMAP,options:D,onLoad:S,zoom:n,center:a,onZoomChanged:k,onDragStart:k,onIdle:U,mapContainerClassName:y},z&&E().createElement(XF,{className:v.mapControlContainer,position:window.google.maps.ControlPosition.TOP_RIGHT,map:C},E().createElement(iM,{hasActiveOverlay:!!s,drawingModes:u,drawingMode:_,onDrawingModeChanged:I,onClearOverlay:M})),H&&E().createElement(XF,{className:v.mapControlContainer,position:window.google.maps.ControlPosition.TOP_CENTER,map:C},E().createElement(sM,{onChangeIsSearchOnMapMove:P,isSearchOnMapMove:i})),p?(W=d,E().createElement($F.XL,{options:W},V)):V(),Y&&E().createElement($F.mg,{onLoad:R,path:s.path,editable:!0,options:N,onMouseUp:j,onDragEnd:j}),B&&E().createElement($F.j_,{onPolygonComplete:F(YF),onCircleComplete:F(HF),drawingMode:uM(_),options:{drawingControl:!1,circleOptions:N,polygonOptions:N}}));var W},_M=(e,t)=>Math.abs(e-t)<1,IM=(0,A.curry)(((e,t,r)=>{const n=t.map((t=>{let{position:r}=t;const n=e.find((e=>{let{point:t}=e;return _M(r.lat(),t.lat)&&_M(r.lng(),t.lng)}));return(0,A.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}})),NM=[],DM=(0,A.pipe)((0,A.path)(["point","lat"]),(0,A.both)((0,A.gt)(90),(0,A.lt)(-90))),PM={[T.MAP_SEARCH_TYPES.geoPolygon]:YF,[T.MAP_SEARCH_TYPES.geoLocation]:HF},kM=e=>e&&e.length?[...e,e[0]]:e,LM=e=>e[0].map((e=>{let[t,r]=e;return{lat:t,lng:r}})).slice(0,-1),UM=(0,Tp.Z)((()=>({container:{height:"100%",width:"100%",position:"relative"},fullHeight:{height:"100%"}}))),jM=()=>{const e=UM(),t=(0,hp.useSelector)(D().selectors.getMetadata),r=(0,hp.useSelector)(lo.Qr),n=(0,hp.useSelector)(Do.AO),a=(0,hp.useSelector)(D().selectors.getGoogleMapKey),{markers:o,loading:i,onMarkerClicked:l}=(e=>{let{searchResults:t,metadata:r,mapKey:n}=e;t=t||NM;const a=(0,hp.useDispatch)(),[o,i]=(0,h.useState)([]),[l,s]=(0,h.useState)(!1),c=(0,h.useRef)(),u=(0,h.useRef)(),p=(0,h.useCallback)((e=>{a({type:he,payload:e||null})}),[a]),d=(0,h.useCallback)((()=>{clearTimeout(u.current),clearTimeout(c.current)}),[]);return(0,h.useEffect)((()=>{s(!0),(0,T.resolve)(r,t,n).then((e=>{s(!1),i(e.filter(DM))})).catch((()=>{s(!1),i([])}))}),[t,r,n]),{markers:o,loading:l,onMarkerClicked:(0,h.useCallback)((e=>{const t=(0,A.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,hp.useDispatch)(),t=(0,hp.useSelector)(lo.Qy),r=(0,hp.useSelector)(lo.bt),n=(0,hp.useSelector)(Do.d7),[a,o]=(0,h.useState)(!1),i=(0,h.useCallback)((t=>{let r=null,n=null;if(t){const{data:e,type:a}=t;switch(a){case HF:{const{center:t,radius:a}=e;r=[t.lng(),t.lat(),a],n=T.MAP_SEARCH_TYPES.geoLocation;break}case YF:r=kM(e),n=T.MAP_SEARCH_TYPES.geoPolygon}}o(!1),e(Ja(r,n))}),[e]),l=(0,h.useCallback)((t=>{o(!!t),e(Ja(kM(t),t&&T.MAP_SEARCH_TYPES.onMapMove))}),[e]),s=PM[r],c=(0,h.useMemo)((()=>n&&s&&t.length?{path:s===YF?LM(t):null,type:s}:null),[n,t,s]);return(0,h.useEffect)((()=>{(c||0===t.length)&&o(!1)}),[t,c]),{isSearchEnabled:n,onOverlayUpdated:i,activeOverlay:c,isSearchOnMapMove:a,onMapBoundsChanged:l}})(),m=(0,h.useMemo)((()=>E().createElement("div",{className:e.fullHeight},E().createElement(HE.Z,null))),[e]),y=(0,h.useMemo)((()=>({gridSize:60,maxZoom:9,calculator:IM(o)})),[o]),g=(0,h.useMemo)((()=>({activeEntityUri:n})),[n]),f=(0,h.useMemo)((()=>({lat:0,lng:0})),[]),b=(0,h.useMemo)((()=>[YF]),[]);return a?E().createElement("div",{className:e.container},i&&E().createElement(HE.Z,null),E().createElement(ZF.Provider,{value:g},E().createElement(RM,{loadingElement:m,defaultZoom:1,defaultCenter:f,onOverlayUpdated:u,onMarkerClicked:l,activeOverlay:c,markers:o,fullscreenControl:!1,markerClusterer:!0,markerClustererOptions:y,drawingModes:b,isSearchOnMapMove:p,onMapBoundsChanged:d,isSearchEnabled:s,mapContainerClassName:e.fullHeight,mapKey:a}))):null},FM=(0,dd.T)(Np.T),MM=e=>{switch(e){case Z.om.PROFILE:return uo().text("Hide entity details");case Z.om.MAP:return uo().text("Hide map")}},VM=()=>{const e=jI(),t=(0,hp.useDispatch)(),r=(0,hp.useSelector)(Do.qx),n=r===Z.om.MAP,a=(0,hp.useSelector)(D().selectors.getGoogleMapKey),o=(0,h.useCallback)((()=>t(_o(null))),[t]);return(0,h.useEffect)((()=>{!a&&n&&o()}),[a,n,o]),E().createElement("div",{className:e.container},E().createElement(FM,{tooltipTitle:MM(r),tooltipPlacement:"bottom-start",size:"L",icon:UI(),className:e.closeButton,onClick:o}),(e=>{switch(e){case Z.om.PROFILE:return E().createElement(zF,null);case Z.om.MAP:return E().createElement(jM,null)}})(r))},BM=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=WE(),g=(0,h.useRef)(),[f,b]=(0,h.useState)("50%"),O=(0,No.gj)(u),x=p===Z.om.PROFILE,C=p===Z.om.MAP,[S,w]=(0,h.useState)({}),R=(0,h.useCallback)(((e,t)=>{w((0,A.assoc)(e,t))}),[]);(0,h.useEffect)((()=>{g.current&&(g.current.scrollTop=0)}),[n]),(0,h.useEffect)((()=>{x&&((0,T.isEmptyValue)(n)?m(oc(null)):!(0,A.prop)(0,n)||c&&n.map((0,A.prop)("uri")).includes(c)||m(oc(n[0].uri)))}),[m,x,c,n]),(0,h.useEffect)((()=>{!x&&c&&m(ic(null))}),[m,c,x]);const _=(0,h.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:k.Z.CHANGE_PAGE,payload:{pageNumber:e,debounceTime:t,entityTypeUri:r}}}(e,250,a))),[m,a]),I=(0,h.useCallback)((e=>m(((e,t)=>({type:k.Z.CHANGE_ROWS_PER_PAGE,payload:{number:e,entityTypeUri:t}}))(e,a))),[m,a]),N=(0,h.useCallback)((e=>m(oc(e))),[m]),D=(0,h.useCallback)((0,T.debounce)((e=>m({type:Ee,payload:e})),50),[m]),P=(0,h.useCallback)((e=>{let{percentageSize:t}=e;return b(t)}),[]),L=e=>{const t=(0,A.prop)(e.uri,S);return E().createElement(_m,{entity:e,entityImportStatus:t,onEntityImportStatusChange:R})},U=(0,h.useRef)(null);return E().createElement("div",{className:v()(y.container,t)},r&&E().createElement(HE.Z,null),(0,No.gj)(u)?E().createElement(II,{quantity:o}):E().createElement(bI,null),E().createElement(CE,{className:y.resizablePanesWrapper,orientation:"vertical",size:d?f:"100%",minSize:480,maxSize:-480,allowResize:d,onChange:P},E().createElement("div",{className:y.pane},E().createElement(YE,{error:E().createElement(zE,{LogoRenderer:BE.ERROR,text:uo().text("Something went wrong."),variant:VE.embedded})},(()=>{const e=s||null;return o?E().createElement("div",{className:O?y.tableContainer:y.listContainer,ref:g},O?E().createElement(kI,{entities:n,entityToHighlight:e,selectedEntityUri:c,entityTypeUri:a,onEntityClick:x?N:void 0,onEntityHover:C?D:void 0,entitiesImportStatus:S,onEntityImportStatusChange:R,basicTableRef:U}):E().createElement(DE,{entities:n,entityToHighlight:e,selectedEntityUri:c,onEntityClick:x?N:void 0,onEntityHover:C?D:void 0,entitiesImportStatus:S,entityButtonsRenderer:L}),o>Z.Tu[0]&&E().createElement("div",{className:y.pagination},E().createElement(PE.Z,{count:o,rowsPerPageOptions:Z.Tu,rowsPerPage:i||Z.Tu[0],page:l||0,onChangePage:_,onChangeRowsPerPage:I,basicTableRef:U}))):E().createElement(zE,{LogoRenderer:BE.SEARCH_RESULTS,text:uo().text("No results found."),secondaryText:uo().text("Try adjusting your search or filter to find what you're looking for."),variant:VE.embedded})})())),E().createElement("div",{className:y.pane},E().createElement(VM,null))))};BM.propTypes={page:fp().number,quantity:fp().number,rowsPerPage:fp().number,entities:fp().array,loading:fp().bool,dispatch:fp().func,entityToHighlight:fp().string,mode:fp().string,entityTypeTab:fp().string,className:fp().string,isPreviewPanelOpen:fp().bool,previewPanelMode:fp().oneOf(Object.values(Z.om)),selectedEntityUri:fp().string},BM.defaultProps={quantity:0,entities:[]};const zM=(0,hp.connect)((e=>{const t=(0,Do.tB)(e);return{quantity:(0,lo.NU)(e,{entityTypeUri:t}),page:(0,lo.fx)(e,{entityTypeUri:t}),rowsPerPage:(0,lo.Uz)(e,{entityTypeUri:t}),entities:(0,lo.BP)(e,{entityTypeUri:t}),loading:(0,lo.gP)(e),entityToHighlight:(0,Do.Dn)(e),mode:(0,Do.XM)(e),entityTypeTab:t,previewPanelMode:(0,Do.qx)(e),isPreviewPanelOpen:(0,Do.jr)(e),selectedEntityUri:rc(e)}}))(BM);var HM=r(4539),YM=r.n(HM),WM=r(4494);const GM=(0,Tp.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"}}),qM=e=>{const t=GM(),r=e.values&&e.values.join(", ");return E().createElement(Jg(),{label:E().createElement("div",{className:t.labelContainer},e.title&&E().createElement("div",{className:t.title},e.title,": "),e.values&&E().createElement(pd.Y,{value:r},E().createElement("div",{className:t.values},r))),onDelete:e.onDelete,variant:"outlined",deleteIcon:E().createElement(tf(),{"data-reltio-id":"facet-bar-chip-delete"}),classes:{root:t.root,deleteIcon:t.deleteIcon,label:t.label}})};qM.propTypes={classes:fp().object,title:fp().string,values:fp().array,onDelete:fp().func};const ZM=qM;class $M extends h.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 E().createElement(h.Fragment,null,E().createElement(pE(),{"aria-describedby":a,color:"primary",variant:"contained",classes:{root:e.root,label:e.label},onClick:this.handleClick},uo().text(`+ ${t.length}`)),E().createElement(hN.Z,{id:a,open:n,onClose:this.handleClose,anchorEl:r,placement:"bottom-start"},E().createElement(WI(),{elevation:2,classes:{root:e.popperContent}},this.props.items)))}}$M.propTypes={classes:fp().object,items:fp().array},$M.defaultProps={items:[]};const KM=dh()((()=>({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"}})))($M);var XM=r(74635),QM=r.n(XM),JM=r(42670),eV=r(96177),tV=r.n(eV),rV=r(96858);const nV=(0,Tp.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 aV(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){oV(e,t,r[t])}))}return e}function oV(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iV(){return iV=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},iV.apply(this,arguments)}const lV=e=>{let{isOpen:t,isAvailableUpdate:r,isChangedSavedSearch:n,currentSavedSearch:a,onClose:o,onSave:i,onUpdate:l}=e;const s=nV(),[c,u]=(0,h.useState)(""),[p,d]=(0,h.useState)(Z.ib.private),m=r&&a&&c===a.name,y=m&&a.isPublic===(p===Z.ib.public)&&!n,g=(0,h.useCallback)((e=>{u(e.target.value)}),[]),f=(0,h.useCallback)((e=>{d(e)}),[]),b=(0,h.useCallback)((()=>m?l({share:p}):i({name:c,share:p})),[c,i,l,p,m]),T={InputProps:{classes:{input:v()(s.dialogInput,s.dialogFont)}},InputLabelProps:{classes:{root:s.dialogFont}}};return(0,h.useEffect)((()=>{if(t){const e=r?a.name:"",t=r&&a.isPublic?Z.ib.public:Z.ib.private;u(e),d(t)}}),[t,r,a]),E().createElement(Ej(),{onClose:o,open:t,PaperProps:{classes:{root:s.dialogRoot}}},E().createElement(QM(),{classes:{root:s.dialogTitle}},uo().text("Save search")),E().createElement(tF(),{classes:{root:s.dialogContentRoot}},E().createElement(JM.H,iV({classes:{root:s.dialogField},label:uo().text("Name"),required:!0,variant:"filled",value:c,onInput:g,size:"small",autoFocus:!0},T)),E().createElement(rV.k,{entries:Z.m2,TextFieldProps:aV({classes:{root:s.dialogField},required:!0,label:uo().text("Share with"),variant:"filled",size:"small"},T),value:p,onChange:f})),E().createElement(tV(),{classes:{root:s.dialogActions},disableSpacing:!0},E().createElement(pE(),{onClick:o},uo().text("Cancel")),E().createElement(pE(),{color:"primary",onClick:b,disabled:m?y:0===c.length},m?uo().text("Save"):uo().text("Save as"))))};lV.propTypes={isOpen:fp().bool,isAvailableUpdate:fp().bool,isChangedSavedSearch:fp().bool,currentSavedSearch:fp().object,onClose:fp().func.isRequired,onSave:fp().func.isRequired,onUpdate:fp().func.isRequired};const sV=(0,hp.connect)((e=>{const t=(0,vi.LA)(e);return{isOpen:(0,Do.jd)(e),isAvailableUpdate:!(0,A.isNil)(t)&&(0,vi.Jv)(e),isChangedSavedSearch:(0,vi.WH)(e),currentSavedSearch:t}}),{onClose:()=>vo(!1),onSave:e=>({type:nr,payload:e}),onUpdate:e=>({type:ir,payload:e})})(lV);var cV=r(11400);function uV(){return uV=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},uV.apply(this,arguments)}const pV=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 E().createElement("svg",uV({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},r),E().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"}))},dV=(0,Tp.Z)({button:{marginRight:"-4px"},dialogRoot:{minWidth:"600px",minHeight:"280px"},dialogContentRoot:{display:"flex",flexDirection:"column",gap:"20px"}}),mV=()=>{const e=dV(),t=(0,hp.useStore)(),[r,n]=(0,h.useState)(!1),[a,o]=(0,h.useState)(!1),i=(0,h.useCallback)((()=>n(!1)),[]),l=(0,h.useCallback)((()=>n(!0)),[]),s=(0,h.useCallback)((async(e,r,n)=>{const a=t.getState(),l=(0,Oi.Z)(a),s=(0,vi.Cc)(a,!0);o(!0);try{await(0,T.createSavedSearch)([{name:e,description:r,isPublic:n,query:s,uiState:l,type:T.SavedSearchType.SEGMENTATION}]),o(!1),i()}catch(e){(0,so.U)(e,{defaultMessage:uo().text("Something went wrong while saving of the segment")}),o(!1)}}),[t,i]);return E().createElement(E().Fragment,null,E().createElement(xd.k,{icon:pV,size:"L",onClick:l,tooltipTitle:uo().text("Save as segment"),className:e.button}),E().createElement(cV.L,{isOpen:r,isSaving:a,onClose:i,onSave:s}))};function yV(){return yV=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},yV.apply(this,arguments)}const gV=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 E().createElement("svg",yV({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),E().createElement("g",null,E().createElement("path",{fill:"none",d:"M0 0h24v24H0z"})),E().createElement("g",null,E().createElement("path",{fillOpacity:".54",d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"})))};function fV(){return fV=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},fV.apply(this,arguments)}const hV=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 E().createElement("svg",fV({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),E().createElement("defs",null,E().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"})),E().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},E().createElement("mask",{id:"svg1966704254b",fill:"#fff"},E().createElement("use",{xlinkHref:"#svg1966704254a"})),E().createElement("g",{mask:"url(#svg1966704254b)",fill:"#000",fillOpacity:".54"},E().createElement("path",{d:"M0 0h24v24H0z"}))))};function EV(){return EV=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},EV.apply(this,arguments)}const bV=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 E().createElement("svg",EV({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),E().createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),E().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 vV(){return vV=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},vV.apply(this,arguments)}const TV=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 E().createElement("svg",vV({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),E().createElement("defs",null,E().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"})),E().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},E().createElement("mask",{id:"svg2486556319b",fill:"#fff"},E().createElement("use",{xlinkHref:"#svg2486556319a"})),E().createElement("g",{mask:"url(#svg2486556319b)",fill:"#000",fillOpacity:".54"},E().createElement("path",{d:"M0 0h12v24H0z"}))))};var OV=r(69199),xV=r.n(OV),CV=r(37290),SV=r.n(CV);const wV=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 AV(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){RV(e,t,r[t])}))}return e}function RV(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _V=(0,Tp.Z)({title:{marginBottom:"-10px"},linkField:{margin:"10px 0"},linkInput:{textOverflow:"ellipsis",fontSize:"14px"}}),IV=e=>{let{open:t,onClose:r=Ep.ZT}=e;const n=_V(),a=(e=>{let{enabled:t}=e;const[r,n]=(0,h.useState)(""),a=(0,hp.useSelector)(Oi.Z),o=(0,hp.useSelector)(lo.RO),i=(0,hp.useSelector)(D().selectors.getServicesPath),l=(0,hp.useSelector)(D().selectors.getUIPath);return(0,h.useEffect)((()=>{t?(0,T.rawRequest)(`${i}/searchLink`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(AV({},a,{currentTenant:o}))}).then((0,A.pipe)((0,A.prop)("link"),(0,T.getSearchLink)(l),n)).catch(po):n("")}),[t]),r})({enabled:t});return E().createElement(Ej(),{open:t,onClose:r},E().createElement(QM(),{className:n.title},uo().text("Share link with search results")),E().createElement(tF(),null,E().createElement(xV(),null,uo().text("With the URL link, anyone can view these search results. Paste this link in email or IM for testing, analyze, sharing and more.")),E().createElement(SV(),{className:n.linkField,InputProps:{classes:{input:n.linkInput}},label:a?"URL":"",placeholder:uo().text("Loading URL..."),value:a,variant:"filled",fullWidth:!0,size:"small"})),E().createElement(tV(),null,E().createElement(pE(),{onClick:r},uo().text("Cancel")),E().createElement(pE(),{disabled:!a,onClick:(0,A.pipe)((()=>wV(a)),r),color:"primary",autoFocus:!0},uo().text("Copy link"))))};IV.propTypes={open:fp().bool,onClose:fp().func};const NV=IV,DV=(0,Tp.Z)((()=>({button:{marginRight:"-4px"},exportButtonDisabled:{opacity:"0.54"}}))),PV=e=>{let{customActions:t=[]}=e;const r=DV(),n=(0,hp.useDispatch)(),a=(0,hp.useSelector)(D().selectors.getUIConfig),o=(0,hp.useSelector)(D().selectors.getCanUserMakeExport),i=(0,hp.useSelector)(D().selectors.getCanUserOpenDataLoader),l=!!(0,T.findPerspectiveConfig)(T.ScreenType.Segmentation,a),s=!!(0,hp.useSelector)(lo.lF),{canExport:c}=(0,hp.useSelector)(Do.MO),u=c&&o,p=(0,h.useCallback)((()=>{n({type:k.Z.EXPORT_RESULTS})}),[n]),d=(0,h.useCallback)((()=>{n({type:k.Z.OPEN_DATA_LOADER})}),[n]),m=(0,hp.useSelector)(lo.ai),y=(0,h.useCallback)((()=>{n(vo(!0))}),[n]),g=[],[f]=(()=>{const e=(0,hp.useSelector)(D().selectors.getCanUserStartProcessFromQuery),t=(0,hp.useSelector)(D().selectors.getWorkflowPath),r=(0,hp.useSelector)(D().selectors.getWorkflowEnvironmentUrl),n=(0,hp.useSelector)(Do.FH),a=(0,hp.useSelector)(D().selectors.getTenant),o=(0,hp.useDispatch)(),i=(0,hp.useSelector)(lo.FR),{globalFilter:l}=(0,hp.useSelector)(D().selectors.getGlobalSearchRequestOptions),s=(0,Fa._k)(i,[],l),c=(0,h.useCallback)((()=>{const{processType:e}=n;(0,T.startProcessFromQuery)({workflowPath:t,processType:e,searchString:s,tenant:a,environment:r}).then((()=>{o(Ro({message:uo().text("Match reviews successfully submitted. Go to Inbox to view their status."),actionToDispatch:N.ui.actions.openAppFromChocolateBar("Inbox"),actionLabel:uo().text("Go to inbox"),autoHideDuration:null}))})).catch((e=>{po(e)}))}),[n,t,s,a,r,o]),u=s.includes("matches")||s.includes("matchRules");return[e&&t&&n?{disabled:!u,text:uo().text("Request Match Review"),tooltip:uo().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[b]=(()=>{const e={NO_ENTITY_TYPE:uo().text("Please select exactly one entity type or switch to table mode")},t=(0,hp.useDispatch)(),r=(0,hp.useSelector)(Do.MO),n=(0,hp.useSelector)(D().selectors.getCanUserMakeBulkUpdate),a=!!(0,hp.useSelector)(lo.lF),o=(0,hp.useSelector)(Qc),i=!!o,l=Boolean(null==r?void 0:r.bulkUpdate),s=(0,hp.useSelector)(D().selectors.getMetadata),c=(0,hp.useSelector)(Do.Xf),u=l&&n&&!a?{disabled:!i||!(e=>(0,Ma.wW)(s,{},c).some((t=>t.value===e)))(o),text:uo().text("Bulk update"),tooltip:i?null:e.NO_ENTITY_TYPE,onClick:()=>t(Io(!0)),id:"-bulk-update"}:null;return[u]})();b&&g.push(b);const[O,x]=(0,h.useState)(!1);return g.push({text:uo().text("Share link"),onClick:()=>x(!0),id:"-share-link"}),g.push(...t),E().createElement(E().Fragment,null,i&&E().createElement(xd.k,{icon:bV,size:"L",onClick:d,tooltipTitle:uo().text("Load data"),className:r.button,"data-reltio-id":"reltio-search-actions-menu-load-data"}),u&&E().createElement(xd.k,{icon:gV,size:"L",onClick:p,tooltipTitle:uo().text("Export"),showForDisabled:!0,classes:{disabled:r.exportButtonDisabled},className:r.button,disabled:s,"data-reltio-id":"reltio-search-actions-menu-export"}),E().createElement(xd.k,{tooltipTitle:uo().text("Save"),showForDisabled:!0,className:v()({[r.button]:g.length>0}),disabled:!m,onClick:y,icon:hV,size:"L","data-reltio-id":"reltio-search-actions-menu-save"}),l&&E().createElement(mV,null),g.length>0&&E().createElement(RN,{buttonComponent:Np.T,buttonProps:{icon:TV,size:"L","data-reltio-id":"reltio-search-actions-menu"},menuId:"custom-actions",menuItems:g}),E().createElement(sV,null),E().createElement(NV,{open:O,onClose:()=>x(!1)}))},kV="#FF1744",LV=(0,Tp.Z)({indicatorWrapper:{width:0,height:"20px",position:"relative"},indicatorTooltipArea:{width:"10px",height:"20px"},indicator:{width:"3px",height:"3px",backgroundColor:kV,border:"1px solid",borderColor:kV,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"}}),UV=()=>{const e=(0,hp.useSelector)(vi.LA),t=(0,hp.useSelector)(vi.WH),r=LV();if(!e)return null;const n=e.name;return E().createElement(E().Fragment,null,E().createElement("div",{className:r.wrapper},E().createElement(wy(),{variant:"body2",component:"span",classes:{root:r.for}},uo().text("for")),E().createElement(pd.Y,{value:n},E().createElement(wy(),{variant:"body2",classes:{root:r.label}},n))),t&&E().createElement(Wg(),{title:uo().text("Saved search has changed"),placement:"bottom"},E().createElement("div",{className:r.indicatorWrapper},E().createElement("div",{className:r.indicator}),E().createElement("div",{className:r.indicatorTooltipArea}))))},jV=(0,Tp.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}}),FV=()=>{const e=jV(),t=(0,hp.useSelector)(D().selectors.getDataTenants),r=t&&t.length>0,n=(0,hp.useSelector)(lo.t9),a=(0,hp.useSelector)(D().selectors.getTenantName),o=n?n.label:a;return r&&E().createElement("div",{className:e.wrapper},E().createElement(wy(),{variant:"body2",component:"span",classes:{root:e.in}},uo().text("in")),E().createElement(pd.Y,{value:a},E().createElement(wy(),{variant:"body2",classes:{root:e.label}},o)))};var MV=r(81877),VV=r.n(MV);const BV=(0,Tp.Z)({dialogPaper:{height:"70vh"},contentRoot:{padding:0,display:"flex",flexDirection:"column",overflow:"hidden"},tabContent:{display:"flex",flex:"1 1 auto"},tabsWrapper:{padding:"0 24px"}}),zV=(0,Tp.Z)((e=>({container:{display:"flex",alignItems:"center",paddingTop:17,paddingBottom:11,paddingLeft:15,paddingRight:15},selected:{backgroundColor:(0,Pm.alpha)(e.palette.primary.main,.12)}}))),HV=(0,Tp.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}}),YV=(0,Tp.Z)({closeButton:{marginRight:"10px"}}),WV=e=>{let{onClose:t}=e;const r=YV();return E().createElement(Np.T,{size:"L",icon:Rp(),className:r.closeButton,onClick:t})};WV.propTypes={onClose:fp().func};const GV=WV,qV=e=>{let{selectedNumber:t,onDelete:r,onClose:n}=e;const a=HV();return E().createElement(E().Fragment,null,E().createElement("div",{className:v()(a.title,a.flex1)},E().createElement(GV,{onClose:n}),E().createElement(wy(),{color:"primary"},uo().text("Selected: ${count}",{count:t}))),E().createElement(xd.k,{tooltipTitle:uo().text("Delete"),size:"L",icon:Lk(),className:a.deleteButton,onClick:r}))};qV.propTypes={selectedNumber:fp().number,onClose:fp().func,onDelete:fp().func};const ZV=qV;function $V(){return $V=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},$V.apply(this,arguments)}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){XV(e,t,r[t])}))}return e}function XV(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const QV=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=Dp({});return E().createElement(Up,$V({classes:KV({},t,{focused:n.white})},r))};var JV=r(34480),eB=r.n(JV);const tB=(0,Tp.Z)((e=>({changedFiltersIndicator:{backgroundColor:(0,Pm.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"}}))),rB=e=>e?Z.ib.public:Z.ib.private,nB=e=>e===Z.ib.public,aB=e=>{let{className:t,findPublic:r,favoriteOnly:n,onChangeFilters:a}=e;const o=tB(),i=(0,h.useRef)(),[l,s]=(0,h.useState)(!1),[c,u]=(0,h.useState)(r),[p,d]=(0,h.useState)(n);(0,h.useEffect)((()=>{u(r),d(n)}),[r,n]);const m=(0,h.useCallback)((()=>s((e=>!e))),[]),y=(0,h.useCallback)((e=>d(e.target.checked)),[]),g=(0,h.useCallback)((()=>{a({findPublic:c,favoriteOnly:p}),m()}),[m,a,c,p]),f=(0,h.useCallback)((()=>{u(r),d(n),m()}),[m,r,n]),b=(0,h.useCallback)((()=>{u(!0),d(!1)}),[]),v=!0===c&&!1===p;return E().createElement(E().Fragment,null,E().createElement(pE(),{ref:i,color:v?"inherit":"primary",classes:{root:t,textPrimary:o.changedFiltersIndicator},onClick:m},E().createElement(eB(),null)),E().createElement(vp(),{open:l,classes:{paper:o.popupContent},anchorEl:i.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},E().createElement(wy(),{className:o.title,variant:"h6"},uo().text("Filter")),E().createElement(rV.k,{entries:Z.m2,TextFieldProps:{InputLabelProps:{classes:{root:o.shareWithLabel}},label:uo().text("Shared with"),variant:"filled"},classes:{root:o.shareWithRoot,menuItem:o.shareWithMenuItem},fullWidth:!0,value:rB(c),onChange:(0,A.pipe)(nB,u)}),E().createElement(Vh(),{classes:{root:o.favoriteOnlyControlRoot,label:o.favoriteOnlyControlLabel},control:E().createElement(Kp(),{className:o.favoriteOnlyCheckbox,checked:p,onChange:y}),label:uo().text("Show favorites only")}),E().createElement("div",{className:o.buttonsGroup},E().createElement(pE(),{onClick:b,disabled:v},uo().text("Clear all")),E().createElement("div",null,E().createElement(pE(),{onClick:f,className:o.cancelButton},uo().text("Cancel")),E().createElement(pE(),{onClick:g,color:"primary"},uo().text("Apply"))))))};aB.propTypes={className:fp().string,findPublic:fp().bool,favoriteOnly:fp().bool,onChangeFilters:fp().func,onChangeFavoriteOnly:fp().func};const oB=(0,hp.connect)((e=>({findPublic:(0,vi.kU)(e),favoriteOnly:(0,vi.VS)(e)})),{onChangeFilters:e=>{let{findPublic:t,favoriteOnly:r}=e;return{type:mr,payload:{findPublic:t,favoriteOnly:r}}}})(aB),iB=e=>{let{type:t,onSearch:r,placeholder:n,onClose:a}=e;const o=HV();return E().createElement(E().Fragment,null,E().createElement("div",{className:o.main},E().createElement("div",{className:o.title},E().createElement(GV,{onClose:a}),E().createElement(wy(),{variant:"h6"},uo().text("Saved & recent searches"))),E().createElement("div",{className:o.searchBox},E().createElement(QV,{fullWidth:!0,onSearch:r,placeholder:n}))),t===Z.uJ.saved&&E().createElement(oB,{className:o.filterButton}))};iB.propTypes={type:fp().oneOf(Object.values(Z.uJ)),onClose:fp().func,onSearch:fp().func,placeholder:fp().string};const lB=iB,sB=e=>{let{type:t,selectedNumber:r,onClose:n,dispatch:a}=e;const o=zV(),i=(0,h.useCallback)((()=>{const e=t===Z.uJ.saved?{type:Sr}:{type:Br};a(e)}),[t,a]),l=(0,h.useCallback)((0,T.debounce)((e=>{const r=t===Z.uJ.saved?{type:_r,payload:e}:{type:Wr,payload:e};a(r)}),500),[t,a]),s=(0,A.cond)([[(0,A.equals)(Z.uJ.saved),(0,A.always)(uo().text("Search name"))],[(0,A.equals)(Z.uJ.recent),(0,A.always)(uo().text("Search for filtered entity types and attributes"))]])(t);return E().createElement(QM(),{className:v()(o.container,{[o.selected]:r})},r?E().createElement(ZV,{selectedNumber:r,onDelete:i,onClose:n}):E().createElement(lB,{type:t,onSearch:l,onClose:n,placeholder:s}))};sB.propTypes={type:fp().oneOf(Object.values(Z.uJ)).isRequired,selectedNumber:fp().number,onClose:fp().func,dispatch:fp().func};const cB=(0,hp.connect)(((e,t)=>({selectedNumber:t.type===Z.uJ.saved?(0,vi.g2)(e):ks(e)})))(sB),uB="0.75rem",pB=(0,Tp.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:uB},paginationCaption:{fontSize:uB}});var dB=r(54622);const mB="0.8rem",yB=(0,Tp.Z)((e=>{const t=(0,Pm.lighten)(e.palette.primary.main,.88),r=(0,Pm.alpha)(t,0),n=(0,Pm.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,Pm.alpha)(n,0)}, ${n} 100%)`}};return{defaultWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:"0 22px",fontSize:mB,display:"flex",alignItems:"center",height:"100%","&:after":a},numberWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:"0 24px 0 22px",fontSize:mB,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:mB,"&::-ms-clear":{display:"none"}},nameContainer:{flex:1,overflow:"hidden"},editing:{},editNameButton:{},searchName:{cursor:"pointer",lineHeight:"29px",position:"relative",whiteSpace:"nowrap",overflow:"hidden",fontSize:mB,"&: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:mB},sharingMenuItem:{fontSize:mB,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"}}})),gB=e=>{let{mode:t}=e;const r=yB(),n=(0,hp.useDispatch)(),a=t===Z.uJ.saved?vi.tc:Ls,o=(0,hp.useSelector)(a),i=t===Z.uJ.saved?vi.hY:Us,l=(0,hp.useSelector)(i),s=(0,h.useCallback)((()=>{t===Z.uJ.saved?n(l?fi():{type:gr}):n(l?Os():{type:Mr})}),[n,l,t]);return E().createElement("div",{className:v()(r.headCell,r.checkbox)},E().createElement(Kp(),{indeterminate:!o&&l,checked:o,onChange:s}))};gB.propTypes={mode:fp().string};const fB=(0,Fd.q)((0,A.pick)(["mode"]))(gB),hB=e=>{const t=t=>{const r=yB(),{rowValue:{checked:n}}=t;return E().createElement("div",{className:v()(r.rowCell,{[r.checkedRowCell]:n})},E().createElement(e,t))};return t.propTypes={rowValue:fp().shape({checked:fp().bool})},t},EB=(0,dd.T)(Kp()),bB=e=>{let{value:t=!1,rowValue:{uri:r,isOwnSearch:n},onClick:a}=e;const o=yB(),i=!n;return E().createElement("div",{className:v()(o.headCell,o.checkbox)},E().createElement(EB,{showForDisabled:!0,tooltipTitle:i&&uo().text("Cannot edit because you're not the owner"),tooltipPlacement:"bottom-start",disabled:i,checked:t,onChange:e=>a(r,e.target.checked)}))};bB.propTypes={value:fp().bool,rowValue:fp().shape({uri:fp().string,isOwnSearch:fp().bool}),onClick:fp().func};const vB=(0,Fd.q)((e=>{let{onSelectItem:t}=e;return{onClick:t}}))(hB(bB));var TB=r(92332);function OB(){return OB=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},OB.apply(this,arguments)}function xB(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){CB(e,t,r[t])}))}return e}function CB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const SB=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=yB(),{headCellData:a}=r;return E().createElement("div",{className:v()(n.headCell,t)},E().createElement(TB.default,OB({},r,{headCellData:xB({},a,{label:E().createElement(pd.Y,{value:a.label},E().createElement("div",{className:n.headLabel},a.label))})})))};SB.propTypes={className:fp().string,headCellData:fp().shape({id:fp().string,label:fp().oneOfType([fp().string,fp().node]),sortable:fp().bool,resizable:fp().bool,className:fp().string,initialWidth:fp().number,minWidth:fp().number,autoResize:fp().bool,renderer:fp().func})};const wB=SB;function AB(){return AB=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},AB.apply(this,arguments)}const RB=e=>{const t=yB();return E().createElement(wB,AB({className:t.nameHeadCell},e))};RB.propTypes={headCellData:fp().shape({id:fp().string,label:fp().oneOfType([fp().string,fp().node]),sortable:fp().bool,resizable:fp().bool,className:fp().string,initialWidth:fp().number,minWidth:fp().number,autoResize:fp().bool,renderer:fp().func})};const _B=RB;var IB=r(18122),NB=r.n(IB),DB=r(62839),PB=r.n(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=>{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 E().createElement("svg",kB({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),E().createElement("g",null,E().createElement("path",{d:"M0 0h24m0 24H0",fill:"none"}),E().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"}),E().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})))};function UB(){return UB=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},UB.apply(this,arguments)}const jB=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 E().createElement("svg",UB({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),E().createElement("g",null,E().createElement("path",{d:"M0 0h24m0 24H0",fill:"none"}),E().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"}),E().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})))};var FB=r(74492),MB=r.n(FB),VB=r(72246),BB=r.n(VB);const zB=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=yB(),m=a&&!o,[y,g]=(0,h.useState)(t);(0,h.useEffect)((()=>{g(t)}),[t]);const f=(0,h.useCallback)((()=>{u(r,y)}),[r,y,u]),b=(0,h.useCallback)((()=>l(r,!n)),[l,r,n]),T=(0,h.useCallback)((()=>s(r,!i)),[s,r,i]),O=(0,h.useCallback)((()=>p(r,!0)),[p,r]),x=(0,h.useCallback)((()=>c(r)),[c,r]),C=(0,A.cond)([[(0,A.always)(a),(0,A.always)(uo().text("Mark as favorite"))],[(0,A.always)(n),(0,A.always)(uo().text("Cannot ummark because you're not the owner"))],[A.T,(0,A.always)("")]])();return E().createElement("div",{className:v()(d.nameWithStar,{[d.editing]:o})},E().createElement(xd.k,{showForDisabled:!0,tooltipTitle:C,tooltipPlacement:a?"bottom":"bottom-start",disabled:!a,className:v()(d.starButton,{[d.checkedStarButton]:n},{[d.enabledButton]:a}),size:"M",icon:n?NB():PB(),onClick:b}),E().createElement(xd.k,{tooltipTitle:i?uo().text("Remove Global filter"):uo().text("Set as Global filter"),className:v()(d.filterButton,d.enabledButton,{[d.checkedFilterButton]:i}),size:"M",icon:i?LB:jB,onClick:T}),E().createElement("div",{className:d.nameContainer},o?E().createElement(BB(),{onClickAway:f},E().createElement("div",null,E().createElement(JM.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,A.when)((0,A.propEq)("keyCode",13),f)}))):E().createElement(pd.Y,{value:t},E().createElement("div",{className:d.searchName,onClick:x},t))),m&&E().createElement(xd.k,{tooltipTitle:uo().text("Edit"),className:d.editNameButton,size:"M",icon:MB(),onClick:O}))};zB.propTypes={value:fp().string,rowValue:fp().shape({uri:fp().string,isFavorite:fp().bool,isOwnSearch:fp().bool,isEditing:fp().bool,isGlobalFilter:fp().bool}),onStarClick:fp().func,onGlobalClick:fp().func,onApply:fp().func,onChangeName:fp().func,onSetEditing:fp().func};const HB=(0,Fd.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}}))(hB(zB)),YB=e=>{let{value:t,rowValue:{uri:r,isOwnSearch:n},onChange:a}=e;const o=yB(),i=(0,h.useCallback)((e=>{const n=nB(e);n!==t&&a(r,n)}),[r,t,a]);return E().createElement("div",{className:o.sharingWrapper},E().createElement(rV.k,{entries:Z.m2,value:rB(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:v()({[o.sharingIconDisabled]:!n})}}))};YB.propTypes={value:fp().bool,rowValue:fp().shape({uri:fp().string,isOwnSearch:fp().bool}),onChange:fp().func};const WB=(0,Fd.q)((e=>{let{onChangeIsPublic:t}=e;return{onChange:t}}))(hB(YB)),GB=e=>{let{value:t,rowValue:r,onClick:n}=e;const a=yB(),o=n?()=>n(r):()=>{};return E().createElement(pd.Y,{value:t},E().createElement("div",{className:v()(a.defaultWrapper,{[a.clickableArea]:n}),onClick:o},t))};GB.propTypes={value:fp().any,rowValue:fp().object,onClick:fp().func};const qB=hB(GB);function ZB(){return ZB=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},ZB.apply(this,arguments)}const $B=e=>{const{rowValue:{updateDate:t,createDate:r}}=e,n=t||r;return E().createElement(qB,ZB({},e,{value:n&&uo().date(n,"L")}))};$B.propTypes={rowValue:fp().shape({updateDate:fp().number,createDate:fp().number})};const KB=$B,XB=e=>{let{values:t}=e;return(0,A.pipe)((0,A.cond)([[A.isNil,A.T],[Array.isArray,(0,A.pipe)(A.flatten,A.isEmpty)],[A.T,A.isEmpty]]),A.not)(t)},QB=(0,A.curry)(((e,t)=>(0,A.path)(["facetsData",t.fieldName,"values","length"],e)>0)),JB=e=>e&&e.slice(1).join(" / "),ez=(e,t,r)=>(e[t]||(e[t]={title:t,attributes:[]}),e[t].attributes=(0,A.uniq)(e[t].attributes.concat(r)),e),tz=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.flatMap((e=>e.attributes)).filter(XB).reduce(((e,t)=>{let{data:{title:r,groupName:n,pathToTitle:a}}=t;const o=JB(a)||r;return ez(e,n,o)}),{})},rz=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e.facetsConfigs||[]).filter((0,A.pipe)(T.isTypeFacet,A.not)).filter(QB(e)).reduce(((e,t)=>{const r=(0,A.path)(["pathToTitle",0],t)||uo().text("Special"),n=JB(t.pathToTitle)||t.title;return ez(e,r,n)}),{})},nz=e=>{let{rowValue:{uiState:t}}=e;const r=yB(),n=(0,h.useMemo)((()=>function(){let{facets:e,advanced:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const r=t?tz(t):rz(e);return Object.values(r)}catch(e){return[]}}(t)),[t]),a=(0,h.useMemo)((()=>(e=>e.flatMap((e=>e.attributes)).length)(n)),[n]),o=!!n.length&&E().createElement("div",null,n.map((e=>{let{title:t,attributes:n}=e;return E().createElement("div",{key:t,className:r.tooltipSection},E().createElement("h6",{className:r.tooltipSectionHeader},t),n.map((e=>E().createElement("div",{key:e,className:r.tooltipText},e))))})));return E().createElement("div",{className:r.numberWrapper},(i=a,o?E().createElement(Wg(),{title:o,classes:{tooltip:r.tooltip},disableFocusListener:!0,disableTouchListener:!0},E().createElement("span",null,i)):i));var i};nz.propTypes={rowValue:fp().shape({uiState:fp().shape({facets:fp().object,advanced:fp().array})})};const az=hB(nz);function oz(){return oz=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},oz.apply(this,arguments)}const iz=e=>{const t=yB();return E().createElement(wB,oz({className:t.totalHeadCell},e))};iz.propTypes={headCellData:fp().shape({id:fp().string,label:fp().oneOfType([fp().string,fp().node]),sortable:fp().bool,resizable:fp().bool,className:fp().string,initialWidth:fp().number,minWidth:fp().number,autoResize:fp().bool,renderer:fp().func})};const lz=iz;var sz=r(67520),cz=r.n(sz);const uz=e=>{let{value:t}=e;const r=yB();return E().createElement(pd.Y,{value:t},E().createElement("div",{className:r.numberWrapper},uo().number(t)))};uz.propTypes={value:fp().number};const pz=hB(uz),dz=e=>{const t=yB(),{rowValue:{isTotalLoading:r,isOwnSearch:n,uri:a},onDeleteItem:o,onLoadTotalForItem:i,value:l}=e,s=(0,h.useCallback)((()=>{o(a)}),[o,a]),c=n?uo().text("Delete"):uo().text("Cannot delete because you're not the owner"),u=r?uo().text("Loading data"):uo().text("Load data"),p=(0,h.useCallback)((()=>{i(a)}),[i,a]),d=r||-1===l;return E().createElement("div",{className:t.totalWithButtonsWrapper},d?E().createElement(xd.k,{showForDisabled:!0,tooltipTitle:u,tooltipPlacement:"bottom-end",disabled:r,size:"L",icon:cz(),onClick:p}):E().createElement(pz,e),E().createElement(xd.k,{showForDisabled:!0,className:t.deleteButton,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:!n,size:"L",icon:Lk(),onClick:s}))};dz.propTypes={value:fp().number,rowIndex:fp().number,rowValue:fp().shape({isOwnSearch:fp().bool,isTotalLoading:fp().bool,uri:fp().string}),onDeleteItem:fp().func,onLoadTotalForItem:fp().func};const mz=(0,Fd.q)((e=>{let{onDeleteItem:t,onLoadTotalForItem:r}=e;return{onDeleteItem:t,onLoadTotalForItem:r}}))(hB(dz));function yz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gz={rowCellValueRenderer:qB,headCellRenderer:wB,autoResize:!1},fz=[{id:"checked",label:"",initialWidth:55,headCellRenderer:fB,rowCellValueRenderer:vB},{id:"name",get label(){return uo().text("Name")},autoResize:!0,headCellRenderer:_B,rowCellValueRenderer:HB,sortable:!0},{id:"isPublic",get label(){return uo().text("Shared with")},rowCellValueRenderer:WB},{id:"owner",get label(){return uo().text("Created by")},initialWidth:260},{id:"updateDate",get label(){return uo().text("Last modified")},rowCellValueRenderer:KB,sortable:!0},{id:"attributes",get label(){return uo().text("Filtered attributes")},rowCellValueRenderer:az},{id:"total",get label(){return uo().text("Number of profiles")},headCellRenderer:lz,rowCellValueRenderer:mz,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){yz(e,t,r[t])}))}return e}({},gz,e)));function hz(){return hz=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},hz.apply(this,arguments)}function Ez(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bz=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:b,onChangeItemName:v,onSetItemEditing:O,onLoadTotalForItem:x,onSort:C}=e;const S=pB(),w=(0,h.useMemo)((()=>({cellBorder:S.cellBorder})),[S]),[A,R]=(0,h.useState)(null),[_,I]=(0,h.useState)(null),N=(0,h.useRef)(null);(0,h.useEffect)((()=>f),[f]);const D=(0,h.useCallback)((e=>{s.includes(e)?I(e):b(e)}),[s,b]),P=(0,h.useMemo)((()=>({mode:Z.uJ.saved,onSelectItem:g,onChangeIsFavorite:u,onChangeIsGlobal:d,onSearchApply:c,onSetItemEditing:O,onChangeItemName:v,onDeleteItem:D,onLoadTotalForItem:x,onChangeIsPublic:p})),[D,g,u,d,x,c,O,v,p]),k=(0,h.useMemo)((()=>(0,T.isEmptyValue)(l)?{LogoRenderer:BE.SELECT_ATTRIBUTES,text:uo().text("No saved searches."),secondaryText:uo().text("Save time by creating saved searches for queries you regularly search for.")}:{LogoRenderer:BE.SEARCH_RESULTS,text:uo().text("No results found."),secondaryText:uo().text("Try adjusting your search or filter to find what you're looking for.")}),[l]),L=(0,h.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){Ez(e,t,r[t])}))}return e}({},e,{isGlobalFilter:s.includes(e.uri)})))),[t,s]);return E().createElement("div",{className:S.tableWrapper},r>0?E().createElement(E().Fragment,null,E().createElement(Pd.M,{columnsData:fz,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}),E().createElement(PE.Z,{classes:{root:S.paginationRoot,caption:S.paginationCaption},count:r,rowsPerPageOptions:Z.Tu,rowsPerPage:o,onChangeRowsPerPage:m,page:a,onChangePage:y,basicTableRef:N}),E().createElement(dB.U,{open:!!_,title:uo().text("Keep the global filter?"),content:uo().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:uo().text("NO, remove it"),saveCaption:uo().text("YES, KEEP GLOBAL FILTER"),onCancel:()=>I(null),onDiscard:()=>{d(_,!1),b(_),I(null)},onSave:()=>{b(_),I(null)}})):E().createElement(zE,hz({},k,{variant:VE.embedded})),i&&E().createElement(HE.Z,null))};bz.propTypes={items:fp().arrayOf(fp().shape({uri:fp().string,name:fp().string,isPublic:fp().bool,isFavorite:fp().bool,isOwnSearch:fp().bool,isEditing:fp().bool,checked:fp().bool,owner:fp().string,updateDate:fp().number,query:fp().string})),total:fp().number,sorting:Lg.nI,page:fp().number,rowsPerPage:fp().number,loading:fp().bool,searchValue:fp().string,globalFilterSavedSearchesUris:fp().arrayOf(fp().string),onSearchApply:fp().func,onChangeIsFavorite:fp().func,onChangeIsPublic:fp().func,onChangeIsGlobal:fp().func,onChangeRowsPerPage:fp().func,onChangePage:fp().func,onSelectItem:fp().func,onDeselectAllItems:fp().func,onDeleteItem:fp().func,onChangeItemName:fp().func,onSetItemEditing:fp().func,onSort:fp().func};const vz=(0,hp.connect)((e=>({items:(0,vi.gg)(e),total:(0,vi.Yi)(e),sorting:(0,vi.rT)(e),page:(0,vi.wH)(e),rowsPerPage:(0,vi.s6)(e),loading:(0,vi.w7)(e),searchValue:(0,vi.U3)(e),globalFilterSavedSearchesUris:D().selectors.getGlobalFilterSavedSearchesUris(e)})),{onSearchApply:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Z.XU;return{type:Ir,payload:{uri:e,debounceTime:t}}},onChangeIsFavorite:(e,t)=>({type:br,payload:{uri:e,isFavorite:t}}),onChangeIsPublic:(e,t)=>({type:hr,payload:{uri:e,isPublic:t}}),onChangeIsGlobal:(e,t)=>({type:Tr,payload:{uri:e,isGlobalFilter:t}}),onChangeRowsPerPage:e=>({type:dr,payload:e}),onChangePage:e=>({type:pr,payload:e}),onSelectItem:(e,t)=>({type:yr,payload:{uri:e,checked:t}}),onDeselectAllItems:fi,onDeleteItem:e=>({type:wr,payload:e}),onChangeItemName:(e,t)=>({type:Or,payload:{uri:e,name:t}}),onSetItemEditing:(e,t)=>({type:Cr,payload:{uri:e,isEditing:t}}),onLoadTotalForItem:e=>({type:Dr,payload:e}),onSort:e=>({type:Pr,payload:e})})(bz),Tz=e=>{let{value:t=!1,rowValue:{createdDate:r},onClick:n}=e;const a=yB();return E().createElement("div",{className:v()(a.headCell,a.checkbox)},E().createElement(Kp(),{checked:t,onChange:e=>n(r,e.target.checked)}))};Tz.propTypes={value:fp().bool,rowValue:fp().shape({createdDate:fp().number}),onClick:fp().func};const Oz=(0,Fd.q)((e=>{let{onSelectItem:t}=e;return{onClick:t}}))(hB(Tz));function xz(){return xz=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},xz.apply(this,arguments)}const Cz=e=>{const{rowValue:{createdDate:t}}=e,r=t;return E().createElement(qB,xz({},e,{value:r&&uo().date(r,"L LT")}))};Cz.propTypes={rowValue:fp().shape({createdDate:fp().number}),onClick:fp().func};const Sz=(0,Fd.q)((e=>{let{onSearchApply:t}=e;return{onClick:t}}))(Cz),wz=e=>{const t=yB(),{rowValue:r,onDeleteItem:n,onLoadTotalForItem:a,value:o}=e,{isTotalLoading:i,createdDate:l}=r,s=(0,h.useCallback)((()=>{n(r)}),[n,r]),c=i?uo().text("Loading data"):uo().text("Load data"),u=(0,h.useCallback)((()=>{a(l)}),[a,l]),p=i||-1===o;return E().createElement("div",{className:t.totalWithButtonsWrapper},p?E().createElement(xd.k,{showForDisabled:!0,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:i,size:"L",icon:cz(),onClick:u}):E().createElement(pz,e),E().createElement(xd.k,{className:t.deleteButton,tooltipTitle:uo().text("Delete"),tooltipPlacement:"bottom-end",size:"L",icon:Lk(),onClick:s}))};wz.propTypes={value:fp().number,rowValue:fp().shape({isTotalLoading:fp().bool,createdDate:fp().number}),onDeleteItem:fp().func,onLoadTotalForItem:fp().func};const Az=(0,Fd.q)((e=>{let{onDeleteItem:t,onLoadTotalForItem:r}=e;return{onDeleteItem:t,onLoadTotalForItem:r}}))(hB(wz)),Rz=(0,Fd.q)((e=>{let{onSearchApply:t}=e;return{onClick:t}}))(qB);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}const Iz={rowCellValueRenderer:qB,headCellRenderer:wB,autoResize:!1},Nz=[{id:"checked",label:"",initialWidth:55,headCellRenderer:fB,rowCellValueRenderer:Oz},{id:"createdDate",get label(){return uo().text("Created")},rowCellValueRenderer:Sz,initialWidth:256},{id:"name",get label(){return uo().text("Query")},autoResize:!0,rowCellValueRenderer:Rz,minWidth:150},{id:"total",get label(){return uo().text("Record count")},rowCellValueRenderer:Az,headCellRenderer:lz,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){_z(e,t,r[t])}))}return e}({},Iz,e)));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 Pz=e=>{let{items:t,loading:r,filterWord:n,onSelectItem:a,onDeselectAllItems:o,onSearchApply:i,onDeleteItem:l,onLoadTotalForItem:s}=e;const c=pB(),u=(0,h.useMemo)((()=>({cellBorder:c.cellBorder})),[c]),[p,d]=(0,h.useState)(null);(0,h.useEffect)((()=>o),[o]);const m=(0,h.useMemo)((()=>({mode:Z.uJ.recent,onSelectItem:a,onSearchApply:i,onDeleteItem:l,onLoadTotalForItem:s})),[l,s,a,i]),y=(0,h.useMemo)((()=>(0,T.isEmptyValue)(n)?{LogoRenderer:BE.SELECT_ATTRIBUTES,text:uo().text("No recent searches."),secondaryText:uo().text("Your recent search history will appear here.")}:{LogoRenderer:BE.SEARCH_RESULTS,text:uo().text("No results found."),secondaryText:uo().text("Try adjusting your search or filter to find what you're looking for.")}),[n]);return E().createElement("div",{className:c.tableWrapper},t.length>0?E().createElement(Pd.M,{columnsData:Nz,rowsData:t,context:m,getRowCellHeight:null,defaultColumnWidth:50,defaultColumnMinWidth:50,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,hoverRowIndex:p,onRowHover:d,classes:u}):E().createElement(zE,Dz({},y,{variant:VE.embedded})),r&&E().createElement(HE.Z,null))};Pz.propTypes={items:fp().arrayOf(fp().shape({uri:fp().string,name:fp().string,isPublic:fp().bool,isFavorite:fp().bool,isOwnSearch:fp().bool,checked:fp().bool,owner:fp().string,createdDate:fp().number,query:fp().string})),loading:fp().bool,filterWord:fp().string,onSelectItem:fp().func,onSearchApply:fp().func,onDeselectAllItems:fp().func,onDeleteItem:fp().func};const kz=(0,hp.connect)((e=>({items:Ds(e),loading:Ps(e),filterWord:Is(e)})),{onSearchApply:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Z.XU;return{type:$r,payload:{search:e,debounceTime:t}}},onSelectItem:(e,t)=>({type:Fr,payload:{searchCreatedDate:e,checked:t}}),onDeselectAllItems:Os,onDeleteItem:e=>({type:Hr,payload:e}),onLoadTotalForItem:e=>({type:Zr,payload:e})})(Pz),Lz=e=>{let{open:t,onClose:r}=e;const n=BV(),a=(0,hp.useDispatch)(),o=(0,h.useMemo)((()=>[{value:Z.uJ.saved,label:uo().text("Saved searches"),content:E().createElement(vz,null),dataReltioId:"reltio-search-saved-searches"},{value:Z.uJ.recent,label:uo().text("Recent searches"),content:E().createElement(kz,null),dataReltioId:"reltio-search-recent-searches"}]),[]),[i,l]=(0,h.useState)(o[0].value);return(0,h.useEffect)((()=>{t&&(i===Z.uJ.saved?a({type:lr}):a({type:Lr}))}),[t,a,i]),E().createElement(Ej(),{classes:{paper:n.dialogPaper},fullWidth:!0,maxWidth:"lg",open:t,onClose:r},E().createElement(cB,{type:i,onClose:r}),E().createElement(tF(),{classes:{root:n.contentRoot}},E().createElement("div",{className:n.tabsWrapper},E().createElement(AI,{value:i,tabs:o,onChange:l,scrollButtons:"auto"})),E().createElement("div",{className:n.tabContent},o.find((0,A.propEq)("value",i)).content)))};Lz.propTypes={open:fp().bool,onClose:fp().func};const Uz=Lz,jz=(0,Tp.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"}}))),Fz=e=>{let{showTypography:t}=e;const r=jz(),n=(0,hp.useDispatch)(),a=(0,hp.useSelector)(Do.tm),o=uo().text("Saved & recent searches"),i=(0,h.useCallback)((()=>n(bo(!0))),[n]),l=(0,h.useCallback)((()=>n(bo(!1))),[n]);return E().createElement(E().Fragment,null,E().createElement(Wg(),{title:t?"":o},E().createElement(pE(),{className:r.button,variant:"outlined",startIcon:E().createElement(VV(),{className:v()({[r.compact]:!t}),color:"action"}),onClick:i,"data-reltio-id":"reltio-search-saved-and-recent-search"},t&&E().createElement(wy(),{variant:"button",color:"textPrimary",className:r.buttonText},o))),E().createElement(Uz,{open:a,onClose:l}))},Mz=(0,Tp.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"}}))),Vz="search",Bz="geoLocation",zz={},Hz=()=>{const e=Mz(),t=(0,hp.useDispatch)(),r=(0,hp.useSelector)(I.Mp),n=(0,hp.useSelector)(I.X0),a=(0,hp.useSelector)(lo.Qw)||zz,o=(0,hp.useSelector)(D().selectors.getSearchKeyword),i=(0,hp.useSelector)(D().selectors.getDateMask),l=(0,hp.useSelector)(D().selectors.getDateTimeMask),s=(0,hp.useSelector)(D().selectors.getAttributesPresentation)||zz,c=(0,hp.useSelector)(Do.IJ),u=(0,hp.useSelector)((e=>(0,lo.NU)(e,{entityTypeUri:void 0}))),p=(0,hp.useSelector)(ei.go),d=(0,h.useContext)(WM._),[m,y]=(0,h.useState)([]),[g,f]=(0,h.useState)(0),[b,v]=(0,h.useState)(!1),O=(0,h.useRef)(null),[x,C]=(0,h.useState)(!0);(0,h.useEffect)((()=>{y(S())}),[r,n,a,o]),(0,h.useEffect)((()=>{f(m.length),v(!0)}),[m]),(0,h.useEffect)((()=>{if(b){const e=_();f(e),v(!1)}}),[b,n]);const S=(0,h.useCallback)((()=>{const e=Object.values((0,Ma.t8)(n,r)).filter((e=>e.values&&e.values.length)).map((e=>{const t=e.title||e.hiddenTitle,r=(0,Ma.MI)([...e.data||[],...e.filteredData||[]],(0,A.path)(["attrType","type"],e)===T.DataTypes.TYPE_DATE?e.values.map((e=>e.map((e=>T.utils.dates.toLocalDate(e).getTime())))):e.values.map((0,T.mapFilterValue)((0,T.applyPresentationStrategyToValue)((e=>(0,T.getNumberFormat)((0,T.getAttrDataTypeDefinition)(e.attrType),s,T.intl.getLocale()).strategy)(e)))),e.type,{dateMask:i,dateTimeMask:l});return{fieldName:e.fieldName,title:t,values:r}}));o&&e.push({fieldName:Vz,title:uo().text("Search"),values:[o.value]});const{values:[t]=[],type:c}=(0,A.pathOr)({},["mapSearch"],a);return t&&e.push({fieldName:Bz,values:(0,T.getMapSearchValues)(c,t),title:(0,T.getMapSearchLabel)(c)}),e}),[r,n,a,o,s,i,l]),w=(0,h.useCallback)((()=>{f(m.length),v(!0)}),[m]),R=(0,h.useCallback)((e=>{C(e>=410)}),[]),_=(0,h.useCallback)((()=>{if(!O.current)return 0;const{firstChild:e,offsetLeft:t,offsetWidth:r}=O.current,n=t+r;return([...e.childNodes]||[]).filter((a=n,e=>e.offsetLeft+e.offsetWidth<=a)).length;var a}),[O]),P=(0,h.useCallback)((e=>r=>{switch(r.stopPropagation(),e){case Vz:t(N.search.actions.keywordUpdated(null));break;case Bz:t(Ja(null));break;default:t(ro(e,[]))}}),[t]),k=(0,h.useCallback)((()=>{t($a({silent:!0})),t(N.search.actions.keywordUpdated({debounceTime:Z.XU}))}),[t]),L=(0,h.useMemo)((()=>m.map((e=>E().createElement(ZM,{key:e.fieldName,title:e.title,values:e.values,onDelete:P(e.fieldName)})))),[m,P]),U=L.slice(0,g),j=L.slice(g),F=(0,A.when)((0,A.propEq)("length",1),(0,A.reject)(T.isEmptySearchGroup))(p),M=0===L.length&&0===F.length;return E().createElement("div",{className:e.container,"data-reltio-id":"search-bar"},E().createElement("div",{className:e.header},E().createElement("div",{className:e.captionWrapper,"data-reltio-id":"search-bar-total-profiles"},E().createElement(wy(),{component:"span",classes:{body1:e.profileNumber}},uo().number(u,"0,0")),E().createElement(wy(),{variant:"body2",component:"span",classes:{root:e.profileText}},uo().text("total profiles"))),E().createElement(FV,null),E().createElement(UV,null),E().createElement(pE(),{color:"primary",className:e.clearButton,onClick:k,disabled:M,"data-reltio-id":"reltio-search-clear"},uo().text("clear")),!d&&E().createElement("div",{className:e.searchBarControls,"data-reltio-id":"search-bar-controls"},E().createElement(Bp.Z,{handleWidth:!0,onResize:R}),E().createElement(PV,null),E().createElement(lh(),{orientation:"vertical",className:e.splitter}),E().createElement(Fz,{showTypography:x}))),E().createElement(Bp.Z,{handleWidth:!0,onResize:w}),E().createElement(YM(),{in:!c&&g>0,timeout:500},E().createElement("div",{ref:O,className:e.facetsBar,"data-reltio-id":"search-facets-bar"},E().createElement("div",{className:e.showBar},U),j.length>0&&E().createElement(KM,{items:j}))))},Yz=(0,Tp.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"}}),Wz=e=>{let{onBackBtnClick:t}=e;const r=Yz();return E().createElement(oF(),{disableGutters:!0,classes:{root:r.toolBar}},E().createElement(xd.k,{tooltipTitle:uo().text("Switch to basic mode"),size:"L",icon:UI(),className:r.backButtonContainer,onClick:t}),E().createElement(wy(),{variant:"subtitle1",className:r.title},uo().text("Advanced search")))};Wz.propTypes={onBackBtnClick:fp().func};const Gz=Wz,qz=(0,Tp.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"}}),Zz=(0,Tp.Z)((e=>({query:{color:e.palette.text.secondary,fontSize:"12px",letterSpacing:0,lineHeight:"16px"},[T.READABLE_QUERY_PRIMITIVE_TYPES.entityTypeLabel]:{color:"#03904A"},[T.READABLE_QUERY_PRIMITIVE_TYPES.attributeLabel]:{color:"#059BEA"},[T.READABLE_QUERY_PRIMITIVE_TYPES.specialAttributeLabel]:{color:"#EA05CF"},[T.READABLE_QUERY_PRIMITIVE_TYPES.attributeFilter]:{color:"#7F00FF"},[T.READABLE_QUERY_PRIMITIVE_TYPES.attributeValue]:{color:"#000000"}})));function $z(){return $z=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},$z.apply(this,arguments)}const Kz=(0,h.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=Zz();return E().createElement("span",$z({ref:t,className:v()(o.query,n),"data-reltio-id":"search-readable-query"},a),r.map(((e,t)=>{let{type:r,text:n}=e;return E().createElement("span",{key:t,className:o[r]},n)})))}));Kz.displayName="ReadableSearchQuery";const Xz=Kz;var Qz=r(82466),Jz=r.n(Qz);const eH=(0,Tp.Z)({collapseIcon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"collapseIcon--inverted":{transform:"rotate(-180deg)"}});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 rH=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=eH();return E().createElement(xd.k,tH({size:"L",icon:Jz(),tooltipTitle:t?uo().text("Collapse panel"):uo().text("Expand panel"),onClick:r,iconClassName:v()(a.collapseIcon,{[a["collapseIcon--inverted"]]:!t}),"data-reltio-id":"reltio-search-advanced-search-collapse-panel"},n))};rH.propTypes={backBtnDisabled:fp().bool,onBackBtnClick:fp().func,collapseBtnActive:fp().bool,onCollapseBtnClick:fp().func};const nH=rH;var aH=r(89808),oH=r.n(aH),iH=r(19820),lH=r.n(iH);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{isFullscreen:t=!1,onClick:r=A.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 E().createElement(xd.k,sH({size:"L",icon:t?lH():oH(),tooltipTitle:t?uo().text("Exit full screen"):uo().text("Full screen"),onClick:r,"data-reltio-id":"reltio-search-advanced-search-full-screen"},n))};cH.propTypes={isFullscreen:fp().bool,onClick:fp().func};const uH=cH,pH=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=qz(),[y,g]=(0,h.useState)(0),[f,b]=(0,h.useState)(0),O=(0,h.useMemo)((()=>(0,Fa.Jk)((0,ft.P0)(a,t))),[a,t]),x=(0,T.buildReadableQuery)(a,o,n,t,u,p),C=uo().text("Copy to clipboard"),[S,w]=(0,h.useState)(C),A=(0,h.useCallback)((0,T.debounce)((()=>{d({type:yt})}),500),[d]),R=(0,h.useCallback)((()=>{wV((0,T.buildReadableQueryToString)(a,o,n,t,u,p)).then((()=>w(uo().text("Query was copied")))).catch((()=>w(uo().text("Error"))))}),[t,o,n,a,u,p]),_=(0,h.useCallback)((()=>{w(C)}),[C]),I=(0,h.useCallback)((e=>{g(e.clientX),b(e.clientY)}),[]);(0,IE.D)(A,[A,O]);const N=(0,h.useMemo)((()=>({anchorEl:{clientWidth:1,clientHeight:1,getBoundingClientRect:()=>({left:y,bottom:f,height:1,right:y,width:1,top:f})}})),[y,f]);return E().createElement("div",{className:m.resultQueryPanel},E().createElement("div",{className:m.resultQuery},uo().text("Search query"),E().createElement("div",{className:v()(m.queryContainer,{[m.queryContainerMinHeight]:r})},x.length>0?E().createElement(Wg(),{key:S,title:S,onClose:_,PopperProps:N},E().createElement(Xz,{readableQuery:x,onMouseEnter:I,onClick:R,className:m.query})):E().createElement("span",{className:m.noQuery},uo().text("Build your search and view your search query here")))),E().createElement("div",{className:m.actionsPanel},E().createElement(nH,{collapseBtnActive:i,onCollapseBtnClick:s,className:m.collapseButton}),E().createElement(uH,{isFullscreen:l,onClick:c})))};pH.propTypes={groups:fp().arrayOf(fp().shape({id:fp().string,attributes:fp().arrayOf(fp().shape({values:fp().array,data:fp().object,filter:fp().string,operator:fp().string})),operator:fp().string})),lookups:fp().object,hasMinSize:fp().bool,attributesPresentation:fp().object,collapseBtnActive:fp().bool,isFullscreen:fp().bool,onCollapseBtnClick:fp().func,onFullScreenBtnClick:fp().func,metadata:T.MetadataType,keyword:T.KeywordSearchType,map:jg,dispatch:fp().func};const dH=pH,mH={position:"absolute",width:1,background:"rgba(43, 152, 240, 0.3)",height:16,left:36};function yH(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){gH(e,t,r[t])}))}return e}function gH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fH=(0,Tp.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:yH({},mH),upperLine:{marginTop:-18},searchByOvContainer:{marginLeft:-6,marginBottom:-14}})));var hH=r(28345),EH=r.n(hH);const bH="46px",vH=(0,Tp.Z)((e=>({readOnlyLogicOperatorContainer:{display:"flex",alignItems:"center",marginRight:"40px",width:"76px",fontSize:"14px",color:e.palette.text.secondary,maxHeight:bH},readOnlyFilter:{display:"flex",alignItems:"center",fontSize:"14px",color:e.palette.text.secondary,width:"50px",marginLeft:"12px",maxHeight:bH}})));var TH=r(68157);const OH=e=>{let{className:t,rowData:r}=e;const n=vH();return E().createElement("div",{className:v()(n.readOnlyLogicOperatorContainer,t)},r&&r.operator?(0,TH.capitalize)(r.operator):uo().text("Where"))};OH.propTypes={className:fp().string,rowData:fp().object};const xH=OH,CH=e=>{let{className:t,rowData:r}=e;const n=vH();return E().createElement("div",{className:v()(n.readOnlyFilter,t)},r&&r.filter?(0,T.getFilterOptionLabel)(r.filter):uo().text("equals"))},SH=(0,Tp.Z)((()=>({row:{display:"flex",marginBottom:"12px"},rowItem:{paddingRight:"10px",display:"flex"},fullWidth:{flexGrow:"1",flexBasis:"0",overflow:"hidden"},hidden:{visibility:"hidden"}})));const wH=e=>{let{classes:t={},rowData:r,previousRowData:n,LogicOperatorComponent:a=xH,AttributeSelectorComponent:o,FilterSelectorComponent:i=CH,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=SH();return E().createElement("div",{className:v()(d.row,t.root),"data-reltio-id":"query-builder-row"},E().createElement(a,{className:t.logicOperatorContainer,rowContext:p,rowData:n}),E().createElement("div",{className:v()(d.rowItem,t.attributeSelectorContainer)},E().createElement(o,{attributeSelectorProps:u,rowContext:p,rowData:r})),E().createElement("div",{className:v()(d.rowItem,t.filterSelectorContainer)},E().createElement(i,{textFieldInputRef:c,rowContext:p,rowData:r})),E().createElement("div",{className:v()(d.rowItem,d.fullWidth,t.valuesEditorContainer)},E().createElement(l,{rowContext:p,rowData:r})),E().createElement("div",{className:v()(d.rowItem,t.actionsContainer,{[d.hidden]:!r})},E().createElement(s,{rowContext:p,rowData:r})))};wH.propTypes={classes:fp().shape({root:fp().string,logicOperatorContainer:fp().string,attributeSelectorContainer:fp().string,filterSelectorContainer:fp().string,valuesEditorContainer:fp().string,actionsContainer:fp().string}),rowData:Lg.Xw,previousRowData:Lg.Xw,LogicOperatorComponent:fp().elementType,AttributeSelectorComponent:fp().elementType,FilterSelectorComponent:fp().elementType,ValuesEditorComponent:fp().elementType,ActionsComponent:fp().elementType,filterSelectorRef:fp().object,attributeSelectorProps:fp().shape({onRestoreFocus:fp().func,onOpen:fp().func,disablePopoverRestoreFocus:fp().bool})};const AH=(0,h.memo)(wH);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 _H=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,A.path)([t-1],n):null,c=t===n.length?{attributeSelectorProps:a}:{};return E().createElement(AH,RH({key:e&&e.id,rowData:e,previousRowData:s,classes:r,filterSelectorRef:t===i?o:void 0},l,c))};return E().createElement("div",{className:t},n.map(s),s(null,n.length,n))};_H.propTypes={className:fp().string,rowClasses:fp().shape({root:fp().string,logicOperatorContainer:fp().string,attributeSelectorContainer:fp().string,filterSelectorContainer:fp().string,valuesEditorContainer:fp().string,actionsContainer:fp().string}),rowsData:fp().arrayOf(Lg.Xw),LogicOperatorComponent:fp().elementType,AttributeSelectorComponent:fp().elementType,FilterSelectorComponent:fp().elementType,ValuesEditorComponent:fp().elementType,ActionsComponent:fp().elementType,filterSelectorRef:fp().object,filterSelectorRefIndex:fp().number,lastRowAttributeSelectorProps:fp().shape({onRestoreFocus:fp().func,onOpen:fp().func,disablePopoverRestoreFocus:fp().bool})};const IH=(0,h.memo)(_H),NH=(0,Tp.Z)((()=>({select:{padding:"6px 16px 7px"},dropDown:{width:"100px","&:before":{content:"none !important"}}})));function DH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const PH=e=>{let{className:t,value:r,onChange:n}=e;const a=NH(),o=T.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){DH(e,t,r[t])}))}return e}({},e,{label:uo().text(e.label)})));return E().createElement(rV.k,{className:v()(a.dropDown,t),classes:a,value:r,entries:o,onChange:n})};function kH(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){LH(e,t,r[t])}))}return e}function LH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const UH=(0,Tp.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:kH({},mH),upperLine:{marginTop:-18},lowerLine:{marginBottom:-16,bottom:0}}))),jH="46px",FH=(0,Tp.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:jH},filterSelect:{width:"190px"},valuesWrapper:{width:"100%",display:"flex",minHeight:jH,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:{}}))),MH=(0,Tp.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)"}}),VH=(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},BH=e=>e.join(", "),zH=e=>`calc(${(0,A.isNil)(e)?"100%":`${e}px`} - 35px)`,HH=e=>{let{list:t,maxWidth:r}=e;const n=MH(),a=(0,h.useRef)(),[o,i]=(0,h.useState)(0);(0,h.useEffect)((()=>{i(((e,t)=>{const r=e.length,n=((e,t)=>{if(t){const r=VH(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=BH(t),s=o>0,c=s?BH(t.slice(0,-o)):l;return E().createElement(Wg(),{title:s?l:""},E().createElement("div",{className:n.listLabelContainer},E().createElement("div",{style:{width:zH(r)},className:n.listLabel,ref:a},l),E().createElement("div",{className:n.visibleItemsLabel},c),s&&E().createElement("div",{className:n.hiddenCount},`+${o}`)))};function YH(){return YH=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},YH.apply(this,arguments)}const WH=(0,A.always)(32),GH=(0,h.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 E().createElement(Wp,YH({getItemSize:WH,renderItem:(e,a,o)=>{let{item:i}=a;const l=!!t.find((e=>i.uri===e)),s=o===n;return E().createElement(fd,{key:i.uri,onClick:r,checked:l,data:i,label:E().createElement(hd.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))}));GH.displayName="SelectMetadataTypesList";const qH=(0,Tp.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 ZH(){return ZH=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},ZH.apply(this,arguments)}function $H(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){KH(e,t,r[t])}))}return e}function KH(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,h.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=qH(),[y,g]=(0,h.useState)(!1),f=(0,h.useCallback)((()=>g(!0)),[]),b=(0,h.useCallback)((()=>g(!1)),[]),[O,x]=(0,h.useState)(""),C=(0,h.useCallback)((()=>x("")),[]),S=(0,h.useCallback)((0,A.pipe)(C,b),[b,C]),w=n.filter((e=>{let{label:t}=e;return T.utils.strings.search(t,O)})).map(((e,t)=>({item:{item:$H({},e,{filterText:O})},index:t}))),R=(0,h.useMemo)((()=>(0,A.pipe)((0,A.map)((e=>n.find((0,A.propEq)("uri",e)))),(0,A.reject)(A.isNil),(0,A.pluck)("label"))(a)),[a,n]),_=(0,h.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,h.useCallback)((e=>{let{item:t}=e;const r=!a.includes(t.uri);_(t,r)}),[a,_]),{focusIndex:N,handleKeyDown:D}=Gp({items:w,open:y,onSelectFocusedItem:I,selectedItems:a,onClose:S}),P=(0,h.useRef)(),k=P.current?P.current.getBoundingClientRect().width:0,L=Math.max(k,255),U=0===a.length;return E().createElement(E().Fragment,null,E().createElement(SV(),{label:u,ref:P,InputProps:{startAdornment:U&&!t?null:E().createElement("div",{className:v()(m.inputText,r.inputText)},U?E().createElement("div",null,t):E().createElement(HH,ZH({},i,{list:R}))),classes:{root:m.inputRoot,input:v()(m.input,r.input,{[m.emptyInput]:U&&!t}),disabled:v()(m.disabledInput,{[m.disabledPointer]:l}),underline:m.disabledUnderline},endAdornment:E().createElement(Np.T,{size:"L",icon:Fy(),iconClassName:v()(m.icon,{[m["popup-opened-icon"]]:y}),disabled:l}),readOnly:!0,disableUnderline:U&&!s},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:v()(m.inputLabel,r.label)}},value:"",onClick:l?void 0:f,classes:{root:v()(m.root,r.root)},size:"small",variant:"filled",disabled:l,"data-reltio-id":p}),E().createElement(Fp,{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`}},E().createElement(GH,{items:w,onItemClick:_,selectedItems:a,width:L,height:245,focusIndex:N})))}));XH.displayName="MetadataTypesSelector";const QH=(0,h.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,h.useMemo)((()=>t.filter(T.isAvailableEntityType)),[t]);return E().createElement(XH,{items:u,selectedItemsUris:r,single:n,placeholder:a,enableEmptyValueUnderline:o,onChange:i,classes:l,ListLabelProps:s,disabled:c,label:uo().text("Entity type"),dataReltioId:"entity-type-selector",selectionPopupTitle:uo().text("Select entity types")})}));QH.displayName="EntityTypesSelector";const JH=e=>{let{selectedEntityTypes:t,onChange:r,classes:n={},ListLabelProps:a={}}=e;const o=(0,hp.useSelector)(D().selectors.getMetadata),i=(0,hp.useSelector)(lo.t9),l=(0,hp.useSelector)(Do.Xf),s=(0,h.useCallback)(l?e=>{let{uri:t}=e;return l.includes(t)}:A.identity,[l]),c=(0,h.useMemo)((()=>o.entityTypes.filter(s).sort(l?(0,T.orderByArrayComparator)(l,"uri"):e=>0).filter((e=>{let{uri:t}=e;return(0,T.isAvailableEntityTypeForDataTenant)(i,t)}))),[o,i,s,l]);return E().createElement(QH,{classes:n,entityTypes:c,onChange:r,selectedEntityTypes:t,ListLabelProps:a,placeholder:uo().text("All"),enableEmptyValueUnderline:!0})};JH.propTypes={selectedEntityTypes:fp().arrayOf(fp().string).isRequired,onChange:fp().func.isRequired,classes:fp().shape({root:fp().string,label:fp().string}),ListLabelProps:fp().shape({maxWidth:fp().number})};const eY=JH,tY=(0,Tp.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)"}}}}),rY=(0,A.either)((0,A.prop)("title"),(0,A.prop)("fieldName")),nY=e=>{let{value:t,getLabel:r=rY,onSelectAttributeClick:n,disabled:a=!1}=e;const o=tY(),i=t&&r(t);return E().createElement("div",{onClick:a?void 0:n,className:v()(o.attribute,{[o.attributeWithValue]:!!i},{[o.disabled]:a})},E().createElement(pd.Y,{value:i},E().createElement("div",{className:v()(o.name,{[o.disabled]:a})},i||E().createElement("span",{className:o.noSelect},uo().text("Select attribute")))),E().createElement(Np.T,{size:"M",icon:Fy(),disabled:a}))},aY=(0,Tp.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 oY(){return oY=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},oY.apply(this,arguments)}function iY(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){lY(e,t,r[t])}))}return e}function lY(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sY=(0,h.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=aY(),l=(0,C.AH)();return E().createElement(Wp,oY({getItemSize:(e,t)=>t.items?40:28,renderItem:(e,o,i)=>{let{item:l,level:s,groupId:c,groupName:u}=o;const p=qk(l,t),d=i===n;return E().createElement(fd,{key:`item-${c}-${l.fieldName}`,onClick:r,checked:p,data:iY({},l,{groupName:u}),notSelectable:l.notSelectable,hideCheckBox:a,label:E().createElement(hd.o,{text:l.title,highlight:l.filterText}),labelInText:l.title,level:s,style:e,isFocused:d,groupId:c,LogoIcon:l.LogoIcon})},renderGroupTitle:(e,t)=>E().createElement(ay(),{component:"div",className:i.subHeader,style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&E().createElement(fh,{group:t.item,metadata:l}),t.item.title),focusIndex:n},o))}));function cY(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){uY(e,t,r[t])}))}return e}function uY(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pY=(e,t)=>e.title.toLowerCase().includes(t.toLowerCase()),dY=(e,t)=>pY(e,t)||(e.children||[]).some((e=>dY(e,t))),mY=(e,t)=>e.findIndex(Gk(t)),yY=(0,T.getMaxItemWidth)("title"),gY=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=pY(e,n);return[{item:n?cY({},e,{filterText:n}):e,level:a,groupId:t,groupName:r}].concat(e.children?e.children.filter((e=>o||i||dY(e,n))).flatMap((e=>gY(e,t,r,n,a+1,o||i))):[]).flat()},fY=(0,A.curry)(((e,t)=>t.map((t=>({item:t,items:t.attributes.filter((t=>dY(t,e))).map((r=>gY(r,t.id,t.title,e)))}))).filter((e=>e.items.length)))),hY=(0,Tp.Z)({selector:{minWidth:"200px",width:"100%",alignItems:"stretch",background:"rgba(0,0,0, 0.0267)",boxSizing:"border-box",borderRadius:"4px",display:"flex"}}),EY=(0,h.memo)((e=>{let{className:t,itemsGroups:r,value:n,getLabel:a,onSelect:o,onRestoreFocus:i=A.identity,onOpenPopup:l=A.identity,disableRestoreFocus:s=!1,disableEnforceFocus:c=!1,single:u=!1,ungroup:p=!1,disabled:d=!1,hideCheckBox:m=!1}=e;const y=hY(),[g,f]=(0,h.useState)(null),b=(0,h.useCallback)((()=>f(null)),[]),T=!!g,[O,x]=(0,h.useState)(""),C=(0,h.useCallback)((()=>x("")),[]),[S,w]=(0,h.useState)([]),R=(0,h.useCallback)((()=>w([])),[]),_=(0,h.useMemo)((()=>fY(O,r)),[r,O]),I=(0,h.useMemo)((()=>(0,A.pipe)((0,A.when)((0,A.always)(p),(0,A.chain)((0,A.pipe)((0,A.prop)("items"),A.flatten,(0,A.map)((0,A.pick)(["item","level"]))))),Mp)(_)),[p,_]),N=(0,h.useMemo)((()=>Math.max(yY(_),308)),[_]),D=(0,A.pipe)((0,A.tap)((0,A.pipe)(R,C,b)),i),P=(0,h.useRef)(),k=(0,h.useCallback)(((e,t)=>{o({checked:t,attribute:e,index:t?S.length:mY(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=>!Gk(t,e)))})({selectedAttributes:S,attribute:e,checked:t})),P.current&&P.current.focus())}),[S,o,u,D,P]),L=(0,h.useCallback)((e=>{let{onListItemClick:t,selectedAttributes:r}=e;return e=>{let{item:n,groupData:a}=e;const o=qk(n,r);t(cY({},n,{groupName:a.groupName}),!o)}})({onListItemClick:k,selectedAttributes:S}),[k,S]),{focusIndex:U,handleKeyDown:j}=Gp({items:I,open:T,onSelectFocusedItem:L,selectedItems:S,onClose:D});return E().createElement("div",{className:v()(y.selector,t),"data-reltio-id":"attribute-selector"},E().createElement(nY,{value:n,getLabel:a,onSelectAttributeClick:e=>{l(),f(e.currentTarget)},disabled:d}),E().createElement(Fp,{open:T,anchorEl:g,onClose:D,onSearch:x,title:uo().text("Select attribute"),containerWidth:N,containerHeight:507,searchInputOnKeyDown:j,anchorOrigin:{horizontal:"right",vertical:"bottom"},searchInputRef:P,disableRestoreFocus:s,disableEnforceFocus:c},E().createElement(sY,{items:I,onItemClick:k,selectedAttributes:S,width:N,height:400,focusIndex:U,hideCheckBox:m})))}));var bY=r(80349);function vY(){return vY=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},vY.apply(this,arguments)}const TY=(0,h.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,hp.useSelector)(D().selectors.getMetadata),l=(0,hp.useSelector)(lo.t9),s=(0,hp.useSelector)(D().selectors.getCanUserReadWorkflowDataTask),c=(0,hp.useSelector)(Do.Xf),u=(0,hp.useSelector)(D().selectors.getDataTenants),p=(0,h.useMemo)((()=>(0,A.pipe)(bY.s1,(0,A.when)((0,A.always)(!n),bY.a),(0,L.ED)(l))({allowedEntityTypes:c,firstLevelAttributesFilter:a},i,t,r,u,s)),[t,i,l,c,a,r,n,u,s]);return E().createElement(EY,vY({},o,{itemsGroups:p}))})),OY=e=>{let{rowData:t,rowContext:{entityTypes:r,dispatchGroupAction:n},attributeSelectorProps:a={}}=e;const o=FH(),i=t&&t.id,l=(0,h.useCallback)((e=>{n(Gi,i,e)}),[i,n]),s=(0,h.useCallback)((e=>(0,T.getSearchGroupAttributeLabel)({data:e})),[]);return E().createElement(TY,{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})};OY.propTypes={rowData:Lg.Xw,rowContext:fp().shape({entityTypes:fp().arrayOf(fp().string),dispatchGroupAction:fp().func}),attributeSelectorProps:fp().shape({onRestoreFocus:fp().func,onOpen:fp().func,disablePopoverRestoreFocus:fp().bool})};const xY=(0,h.memo)(OY);function CY(){return CY=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},CY.apply(this,arguments)}const SY=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 E().createElement("svg",CY({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),E().createElement("defs",null,E().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"})),E().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},E().createElement("g",null,E().createElement("g",{transform:"translate(-2 -2)"},E().createElement("mask",{id:"svg397942461b",fill:"#fff"},E().createElement("use",{xlinkHref:"#svg397942461a"})),E().createElement("g",{mask:"url(#svg397942461b)",fill:"#000",fillOpacity:".54"},E().createElement("path",{d:"M0 0h24v24H0z"}))))))},wY=e=>!(e&&e.data),AY=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r}}=e;const n=FH(),a=t&&t.id,o=(0,h.useCallback)((()=>r($i,a)),[a,r]),i=(0,h.useCallback)((()=>r(Ki,a)),[a,r]),l=(0,h.useCallback)((()=>r(zi,a)),[a,r]);return t&&E().createElement("div",{className:v()(n.actions)},E().createElement(Wg(),{title:uo().text("Add"),placement:"bottom"},E().createElement(EH(),{className:n.actionIcon,onClick:l})),!wY(t)&&E().createElement(Wg(),{title:uo().text("Duplicate"),placement:"bottom"},E().createElement("div",{className:n.actionIcon,tabIndex:-1},E().createElement(SY,{onClick:i,tabIndex:-1}))),E().createElement(Wg(),{title:uo().text("Delete"),placement:"bottom"},E().createElement(Rp(),{onClick:o,className:n.actionIcon})))};AY.propTypes={rowData:Lg.Xw,rowContext:fp().shape({dispatchGroupAction:fp().func})};const RY=(0,h.memo)(AY),_Y={BY_LABEL:(0,r(51774).c)({stringify:(0,A.prop)("label")})},IY=e=>{let{className:t,attribute:r,textFieldInputRef:n,isDisabled:a,height:o,onChange:i}=e;const l=(0,A.pipe)(T.getFilterOptionLabel,TH.capitalize);return E().createElement(qU,{label:"",placeholder:uo().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:_Y.BY_LABEL,textFieldInputRef:n})};IY.propTypes={className:fp().string,attribute:Lg.Xw,textFieldInputRef:fp().object,isDisabled:fp().bool,onChange:fp().func,height:fp().number};const NY=(0,h.memo)(IY),DY=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r},textFieldInputRef:n}=e;const a=FH(),o=t&&t.id,i=(0,h.useCallback)((e=>r(Xi,o,e.value)),[r,o]);return E().createElement(NY,{className:a.filterSelect,attribute:t,textFieldInputRef:n,isDisabled:wY(t),onChange:i})};DY.propTypes={rowData:Lg.Xw,rowContext:fp().shape({dispatchGroupAction:fp().func}),textFieldInputRef:fp().object};const PY=(0,h.memo)(DY);var kY=r(24629);const LY=(0,Tp.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"}}),UY=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,hp.useSelector)((e=>(0,ei.Sw)(e,r,c)))||{},p=(0,hp.useSelector)((e=>(0,ei.Ly)(e))),d=(0,hp.useSelector)((e=>(0,lo.Sg)(e,s)));(0,h.useEffect)((()=>{p&&a()}),[i,p,d]),(0,h.useEffect)((()=>{p||a()}),[i,p]);const m=(0,h.useMemo)((()=>(0,A.propOr)([],0,i)),[i]),y=(0,h.useCallback)((0,A.pipe)(T.wrapInArray,n),[n]),{default:g,filtered:f}=u;return!g&&l?E().createElement("div",{className:"ValuesEditor-styles-loadingWrapper--_rOmn"},E().createElement(hm(),{size:20,className:"ValuesEditor-styles-loading--mLFVu"})):E().createElement(Hg,{values:m,defaultOptions:g,filteredOptions:f,onChange:y,getSuggestions:o,tabSelectsValue:!1,canLoadMore:!(0,Ma.tW)(t.data)})};UY.propTypes={attribute:Lg.Xw.isRequired,groupId:fp().string,onChange:fp().func,updateValues:fp().func,filterValues:fp().func};const jY=UY,FY=e=>{let{attribute:t,dispatchGroupAction:r,groupId:n}=e;const{values:a,data:{attrType:o,fieldName:i}={},filter:l}=t,s=LY(),c=(0,T.isTypeaheadAttrType)(o)||(0,A.allPass)([(0,A.propSatisfies)((0,A.either)(A.isNil,T.isEntityTypeUri),"uri"),(0,A.prop)("faceted"),(0,A.propEq)("type",T.DataTypes.TYPE_BLOB)])(o),u=(0,T.isEnumAttrType)(o)||(0,T.isLookupAttrType)(o),p=e=>r(Qi,t.id,e);if((c||u)&&(0,T.isMultiValueOption)(l)){const e=()=>r(tl,t),a=e=>{let{value:n,pageNumber:a,currentOptions:o}=e;return r(Ji,{attribute:t,value:n,debounceTime:500,pageNumber:a,currentOptions:o})};return E().createElement(jY,{attribute:t,groupId:n,onChange:p,filterValues:a,updateValues:e})}{const e=u?{type:T.DataTypes.TYPE_STRING}:(0,T.getAttrDataTypeDefinition)(o),t=(0,T.getDataTypeDefinitionForFilterValue)(e,l),r=(0,T.isDateType)(t.type)&&!(0,T.isDateRangeFilterOption)(l)&&s.dateRoot||(0,T.isBooleanType)(t.type)&&s.boolRoot||s.root;return E().createElement(kY.n,{filter:{filter:l,fieldName:i,values:a||[]},onChange:p,dataTypeDefinition:t,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:s.input},disableUnderline:(0,A.isNil)(a)||(0,A.isEmpty)((0,A.flatten)(a))}},color:"primary",booleanRadioEditorClassName:s.booleanRadioEditor,classes:{root:r},orientation:"horizontal"})}};FY.propTypes={attribute:Lg.Xw.isRequired,groupId:fp().string,dispatchGroupAction:fp().func};const MY=(0,h.memo)(FY),VY=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r,groupId:n}}=e;const a=FH(),o=t&&(0,T.checkIfOptionHasValues)(t.filter);return E().createElement("div",{className:a.valuesWrapper,"data-reltio-id":"advanced-search-values-editor-wrapper"},!wY(t)&&o&&E().createElement(MY,{attribute:t,dispatchGroupAction:r,groupId:n}))};VY.propTypes={rowData:Lg.Xw,rowContext:fp().shape({dispatchGroupAction:fp().func,groupId:fp().string})};const BY=(0,h.memo)(VY),zY=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r}}=e;const n=FH(),a=t&&t.id,o=t&&t.operator,i=(0,h.useCallback)((e=>r(qi,a,e)),[r,a]);return E().createElement("div",{className:n.logicOperatorContainer},o?E().createElement(PH,{className:n.logicOperator,value:o,onChange:i}):E().createElement("div",{className:v()(n.logicOperator,n.logicOperatorPlaceholder)},uo().text("Where")))};zY.propTypes={rowData:Lg.Xw,rowContext:fp().shape({dispatchGroupAction:fp().func})};const HY=(0,h.memo)(zY);function YY(){return YY=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},YY.apply(this,arguments)}const WY=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=UH(),u=FH(),p=(0,h.useCallback)((()=>i({type:et,payload:{groupId:r,id:(0,Ze.x0)()}})),[r,i]),d=(0,h.useCallback)((()=>i({type:Qe,payload:{groupId:r}})),[r,i]),m=(0,h.useCallback)((e=>i(((e,t)=>({type:Xe,payload:{groupId:e,operator:t}}))(r,e))),[r,i]),y=(0,h.useCallback)((e=>i(((e,t)=>({type:$e,payload:{groupId:e,entityTypes:t}}))(r,e))),[r,i]),g=(0,h.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,h.useRef)(null),b=(0,h.useRef)(null),T=(0,h.useRef)(null);T.current=n.length;const O=(0,h.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),f.current&&b.current!==T.current&&(f.current.querySelector("input").focus(),b.current=null)}),[]),x=(0,h.useCallback)((()=>{b.current=n.length}),[n.length]),C=(0,h.useMemo)((()=>[{text:uo().text("Add set"),onClick:l,id:"-group-add-set"},{text:uo().text("Duplicate set"),onClick:p,id:"-group-duplicate-set"},{text:uo().text("Delete set"),onClick:d,id:"-group-delete-set"}]),[l,p,d]),S=(0,h.useMemo)((()=>({root:u.row})),[u]),w=(0,h.useMemo)((()=>({onRestoreFocus:O,onOpen:x,disablePopoverRestoreFocus:!!O})),[O,x]);return E().createElement(E().Fragment,null,E().createElement("div",YY({className:c.container},s),E().createElement("div",{className:c.title},uo().text("Set")),E().createElement("div",{className:c.entityTypeSelectorContainer},E().createElement(eY,{classes:{root:c.entityTypeSelector},selectedEntityTypes:o,onChange:y})),E().createElement("div",{className:c.rows},E().createElement(IH,{rowClasses:S,rowsData:n,AttributeSelectorComponent:xY,FilterSelectorComponent:PY,ValuesEditorComponent:BY,ActionsComponent:RY,LogicOperatorComponent:HY,filterSelectorRefIndex:b.current,filterSelectorRef:f,lastRowAttributeSelectorProps:w,entityTypes:o,groupId:r,dispatchGroupAction:g}),E().createElement("div",{className:c.actions},E().createElement(RN,{menuId:`query-builder-group-actions-${r}`,buttonComponent:Np.T,buttonProps:{icon:jd(),size:"L","data-reltio-id":"reltio-search-query-builder-group-actions"},menuItems:C})))),t&&E().createElement("div",{className:c.logicOperator},E().createElement("div",{className:v()(c.verticalOperatorLine,c.upperLine)}),E().createElement("div",{className:v()(c.verticalOperatorLine,c.lowerLine)}),E().createElement(PH,{value:a,onChange:m})))};WY.propTypes={showLogicOperator:fp().bool,group:fp().shape({id:fp().string,attributes:fp().arrayOf(Lg.Xw),entityTypes:fp().arrayOf(fp().string),operator:fp().string}),onAddEmptyGroup:fp().func,dispatch:fp().func};const GY=(0,h.memo)(WY),qY=e=>{let{groups:t,uiConfigShowSearchByOv:r,dispatch:n}=e;const a=fH(),o=(0,h.useRef)(null),i=(0,h.useRef)(null),l=(0,h.useCallback)((()=>n({type:Je,payload:{group:Jt([])}})),[n]);return(0,h.useEffect)((()=>{if(0===t.length)l();else if(!(0,A.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]),E().createElement("div",{className:a.scrollWrapper},E().createElement("div",{className:a.groupsContainer,ref:o},r&&E().createElement("div",{className:a.searchByOvContainer},E().createElement(Ph,{variant:"queryGroups"})),t.map(((e,t,r)=>E().createElement(GY,{key:e.id,group:e,dispatch:n,showLogicOperator:t!==r.length-1,onAddEmptyGroup:l,"data-reltio-id":`reltio-search-advansed-search-group-builder-${t}`}))),E().createElement("div",{className:a.button},E().createElement("div",{className:v()(a.verticalOperatorLine,a.upperLine)}),E().createElement(pE(),{onClick:l,color:"primary",size:"small","data-reltio-id":"reltio-search-advanced-search-add-set-button"},E().createElement(EH(),{color:"primary",className:a.icon,fontSize:"small"}),uo().text("ADD SET")))))};qY.propTypes={groups:fp().array,dispatch:fp().func,uiConfigShowSearchByOv:fp().bool};const ZY=(0,hp.connect)((e=>{var t;return{groups:(0,ei.go)(e),uiConfigShowSearchByOv:null!==(t=D().selectors.getShowSearchByOv(e))&&void 0!==t?t:(0,Do.cC)(e)}}))(qY),$Y=N.search.actions.updateState({}),KY=e=>{let{open:t,onClose:r}=e;const n=(0,hp.useDispatch)(),a=(0,h.useCallback)((()=>{r(),n($Y)}),[n,r]),o=(0,h.useCallback)((()=>{r(),n(vo(!0,$Y))}),[n,r]),i=(0,hp.useSelector)(vi.LA),l=(0,hp.useSelector)(lo.ai),s=(0,hp.useSelector)(vi.WH),c=(0,hp.useSelector)(vi.Jv),u=i?c&&!s:!l;return E().createElement(dB.U,{open:t,title:uo().text("Search filters cannot be displayed in Quick filters"),content:uo().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:uo().text("Clear search"),saveCaption:uo().text("Save search"),disabledSave:u,onCancel:r,onDiscard:a,onSave:o})};KY.propTypes={open:fp().bool,onClose:fp().func};const XY=KY,QY=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=fH(),[f,b]=(0,h.useState)(!1),v=(0,A.ifElse)((0,A.always)(Ha(t,a,m)),(0,A.pipe)(l,p),(()=>b(!0)));return E().createElement("div",{className:g.container},E().createElement(Gz,{onBackBtnClick:v}),E().createElement(ZY,null),E().createElement(dH,{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}),E().createElement(XY,{open:f,onClose:()=>b(!1)}))};QY.propTypes={metadata:T.MetadataType,lookups:fp().object,attributesData:fp().object,groups:fp().array,keyword:T.KeywordSearchType,map:jg,onClose:fp().func,collapsed:fp().bool,isFullscreen:fp().bool,onCollapse:fp().func,onExpand:fp().func,onFullscreen:fp().func,dispatch:fp().func,attributesPresentation:fp().object,dataTenants:fp().arrayOf(T.DataTenantType)};const JY=(0,hp.connect)((e=>({metadata:D().selectors.getMetadata(e),attributesPresentation:D().selectors.getAttributesPresentation(e),groups:(0,ei.go)(e),lookups:D().selectors.getLookups(e),keyword:D().selectors.getSearchKeyword(e),map:(0,lo.vH)(e),dataTenants:D().selectors.getDataTenants(e)})))(QY),eW="calc(100% - 53px)",tW=e=>{let{isOpenAdvancedSearch:t,onCloseAdvancedSearch:r}=e;const n=bE(),[a,o]=(0,h.useState)(!1),[i,l]=(0,h.useState)("50%"),s=(0,h.useCallback)((()=>{o(!0),l("120px")}),[]),c=(0,h.useCallback)((()=>{o(!1),l("50%")}),[]),u=(0,h.useCallback)((e=>{let{percentageSize:t,isMaxSize:r,isMinSize:n}=e;o(n),l(r?eW:t)}),[]),p=(0,h.useCallback)((()=>{o(!1),l(eW)}),[]),d=E().createElement(E().Fragment,null,E().createElement(Hz,null),E().createElement(lh(),{className:n.divider})),m=E().createElement(E().Fragment,null,d,E().createElement(JY,{collapsed:a,isFullscreen:i===eW,onClose:r,onCollapse:s,onExpand:c,onFullscreen:p}));return E().createElement(CE,{className:n.resizablePanesWrapper,orientation:"horizontal",size:t?i:0,minSize:120,maxSize:-53,allowResize:t,onChange:u},E().createElement("div",{className:n.pane},t&&m),E().createElement("div",{className:n.pane},!t&&d,E().createElement(zM,null)))};tW.propTypes={isOpenAdvancedSearch:fp().bool,onCloseAdvancedSearch:fp().func};const rW=tW;function nW(){return nW=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},nW.apply(this,arguments)}const aW=e=>E().createElement("svg",nW({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),E().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"})),oW=(0,Tp.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)"}}))),iW=e=>{let{className:t}=e;const r=oW(),n=(0,C.xz)(),a=(0,C.fN)(),o=`${n}${a?" - "+a.toUpperCase():""}`;return E().createElement("div",{className:v()(r.labelWrapper,t)},E().createElement(aW,{className:r.tenantIcon,"data-reltio-id":"reltio-tenant-icon"}),E().createElement(wy(),{className:r.tenantLabel},o))},lW=(0,Tp.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)"}}))),sW=()=>{const e=lW(),t=(0,hp.useSelector)(D().selectors.getMetadata),r=(0,hp.useSelector)(Qc),n=(0,hp.useSelector)(Kc),a=(0,hp.useSelector)(uu),o=(0,hp.useSelector)(lo.hX),i=(0,hp.useSelector)(pu),l=(0,hp.useSelector)(su),s=(0,T.getEntityTypeLabel)(t,{type:r}),c=(0,hp.useSelector)(cu),u=(0,hp.useDispatch)(),p=(()=>{const e=(0,hp.useSelector)(D().selectors.getMetadata),t=(0,hp.useSelector)(D().selectors.getLookups),r=(0,hp.useSelector)(D().selectors.getAttributesPresentation),n=(0,hp.useSelector)(ei.go),a=(0,hp.useSelector)(D().selectors.getSearchKeyword),o=(0,hp.useSelector)(lo.vH),i=(0,hp.useSelector)(D().selectors.getDataTenants),l=(0,hp.useSelector)(I.X0),s=(0,hp.useSelector)(I.Mp),c=(0,h.useMemo)((()=>Object.values((0,Ma.t8)(l,s))),[l,s]);return(0,h.useMemo)((()=>{const l=(0,A.isEmpty)(n)?(0,rl.h)(e,i,c):n;return(e=>!(1===e.length&&(0,A.isEmpty)(e[0].attributes)&&1===e[0].entityTypes.length))(l)||o||a?(0,T.buildReadableQuery)(e,r,t,l,a,o):[]}),[a,o,e,i,r,n,c,t])})();(0,h.useEffect)((()=>{0!==o&&(a&&i>=o||!a&&i<=0)&&u(gc())}),[a,o,i,u]);const d=(0,h.useCallback)((e=>u(((e,t)=>({type:Vn,payload:{filterText:e,debounceTime:t}}))(e,Z.XU))),[u]);return E().createElement(E().Fragment,null,E().createElement(oF(),{className:v()(e.container,{[e.borderBottom]:n>0})},E().createElement(wy(),{component:"span",className:e.entityTypeTitle},s),E().createElement(lh(),{orientation:"vertical",className:e.splitter}),E().createElement(wy(),{component:"span",className:e.profileNumber},uo().number(i,"0,0")),E().createElement(wy(),{variant:"body2",component:"span",className:e.profileText},uo().text(" profiles are selected for bulk edit.")),0===n&&E().createElement(E().Fragment,null,E().createElement(pE(),{color:"primary",className:e.clearButton,onClick:()=>{u(gc())},"data-reltio-id":"reltio-search-bulk-update-"+(a?"select-all-profiles":"clear-selection")},a?`${uo().text("Select all")} ${uo().number(o,"0,0")} ${uo().text("profiles")}`:uo().text("Clear selection")),E().createElement(Up,{classes:{root:e.searchBox},value:c,onSearch:d,"data-reltio-id":"reltio-search-bulk-update-search-input"}),E().createElement(lh(),{orientation:"vertical",className:e.splitter}),E().createElement(Nd,{entityTypeUri:r,headColumns:l,onSelectColumns:e=>{const t=(0,No.tU)(e,l);u(Ec(e)),t&&u(yc())},"data-reltio-id":"reltio-search-bulk-update-add-remove-columns"}))),0===n&&!(0,A.isEmpty)(p)&&E().createElement(oF(),{className:e.searchQueryContainer},uo().text("Search query"),E().createElement(Xz,{readableQuery:p,className:e.searchQuery})))},cW=(0,Tp.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"}}),uW="1px solid #e4e4e4",pW=(0,Tp.Z)((e=>({mainRowContent:{display:"flex",alignItems:"center","&>*":{marginRight:8}},row:{borderBottom:uW,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 dW(){return dW=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},dW.apply(this,arguments)}const mW=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 E().createElement("svg",dW({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),E().createElement("defs",null,E().createElement("path",{id:"svg3533951039a",d:"M15 6v5l2 2v2h-4v4l-.992 1L11 19v-4H7v-2l2-2V6H8V4h8v2z"})),E().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},E().createElement("mask",{id:"svg3533951039b",fill:"#fff"},E().createElement("use",{xlinkHref:"#svg3533951039a"})),E().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg3533951039b)",d:"M0 0h24v24H0z"})))};function yW(){return yW=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},yW.apply(this,arguments)}const gW=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 E().createElement("svg",yW({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),E().createElement("defs",null,E().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"})),E().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},E().createElement("mask",{id:"svg1464898421b",fill:"#fff"},E().createElement("use",{xlinkHref:"#svg1464898421a"})),E().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1464898421b)",d:"M0 0h24v24H0z"})))},fW={flex:"0 0 auto"},hW=(0,Tp.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:fW,type_Boolean:fW,type_Date:fW}),EW=e=>{let{id:t,groupId:r,operation:n,operationParameters:a}=e;const o=hW(),i=(0,hp.useDispatch)(),l=a.attributeTypeData.attributeType,s=(0,h.useMemo)((()=>(0,T.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:l})),[l]),c=(0,h.useCallback)((e=>(0,A.mergeLeft)((0,A.ifElse)((0,A.hasPath)(["lookupCode"]),A.identity,(0,A.objOf)("value"))(e),s)),[s]),u=(0,h.useCallback)((e=>n=>i(Oc({id:t,groupId:r,operationParameters:{[e]:n.value}}))),[t,r,i]),p=Gc(n).map((e=>{const t=v()(o.editor,o[`type_${l.type}`]);return l.uri?E().createElement(mL,{key:e,className:t,mode:T.Mode.Editing,attributeType:l,attributeValue:c((0,A.path)([e],a)),onChangeAttribute:u(e)}):E().createElement("div",{key:e,className:v()(t,o.editorValue)},E().createElement(Uk.Z,{fieldName:a.attributeTypeData.fieldName,value:a[e],dataTypeDefinition:(0,T.getAttrDataTypeDefinition)(l),onChange:(0,A.pipe)((0,A.objOf)("value"),u(e)),fullWidth:!0}))}));return 2===p.length&&p.splice(1,0,E().createElement("div",{key:"to",className:o.to},uo().text("with"))),p.length?E().createElement("div",{className:v()(o.container,1===p.length&&o.singleEditor,o[`type_${l.type}`])},p):null};EW.propTypes={id:fp().string,groupId:fp().string,operation:fp().string,operationParameters:fp().object};const bW=(0,h.memo)(EW),vW=(0,A.curry)(((e,t,r)=>(0,A.assoc)(t,(0,A.prop)(e,r),(0,A.dissoc)(e,r)))),TW=(0,A.pipe)((0,A.pick)(["fieldName","title","pathToTitle","attrType"]),vW("attrType","attributeType")),OW=(0,A.unless)(A.isNil,vW("attributeType","attrType")),xW=e=>(0,A.last)(e.type.split("/")),CW=e=>({attributes:{[xW(e)]:[e]}}),SW=(e,t)=>{const r=xW(e);return t.attributes[r][0]},wW=e=>{let{attributeValue:t,onChange:r}=e;const n=(0,h.useRef)(t);n.current=t;const a=(0,h.useCallback)((e=>{let{value:t,attributeType:a,uri:o}=e;const i=CW(n.current),l=(0,T.editAttribute)({entity:i,attributeType:a,uri:o,value:t});r(SW(n.current,l))}),[r]),o=(0,h.useCallback)((e=>{let{attributeType:t,uri:a}=e;const o=CW(n.current),i=(0,T.removeAttribute)({entity:o,attributeType:t,uri:a});r(SW(n.current,i))}),[r]),i=(0,h.useCallback)((e=>{const t=CW(n.current),a=e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,T.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a})}),t);r(SW(n.current,a))}),[r]),l=(0,h.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,A.view)((0,A.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,A.over)((0,A.lensPath)(a),A.not,t)):null})({parentAttributeValue:n.current,uri:e});t&&r(t)}),[r]);return{onChangeAttribute:a,onDeleteAttribute:o,onAddAttributes:i,onTogglePin:l}},AW=(0,Tp.Z)((e=>({pinIcon:{marginRight:"-8px"},pinIconActive:{"& svg > g > path":{fill:e.palette.primary.main,fillOpacity:1}}}))),RW=e=>{let{onTogglePin:t,subAttributeValue:r}=e;const n=AW();return E().createElement(xd.k,{icon:mW,onClick:()=>t(r.uri),size:"L",className:v()(n.pinIcon,r.pin&&n.pinIconActive)})};RW.propTypes={onTogglePin:fp().func,subAttributeValue:fp().oneOfType([T.SimpleAttributeValueType,T.NestedAttributeValueType])};const _W=(0,A.curry)(((e,t,r)=>{let{attributeValue:n}=r;return n.uri!==e&&E().createElement(RW,{onTogglePin:t,subAttributeValue:n})}));function IW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const NW=e=>{let{attributeType:t,attributeValue:r,onChange:n}=e;const a=(0,hp.useSelector)(D().selectors.getMetadata),o=(0,h.useMemo)((()=>{const e=(0,T.getAttributeTypeSubAttributes)(a,t),r=(0,T.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){IW(e,t,r[t])}))}return e}({},r,{value:(0,T.createDefaultValues)({attributeTypes:e,parentUri:r.uri,mode:T.Mode.Editing})})}),[t,a]),i=r||o,{onChangeAttribute:l,onDeleteAttribute:s,onAddAttributes:c,onTogglePin:u}=wW({attributeValue:i,onChange:n}),p=(0,h.useCallback)(_W(i.uri,u),[i.uri,u]);return E().createElement(wL,{attributeType:t,attributeValue:i,showEmptyEditors:!0,mode:T.Mode.Editing,metadata:a,onAddAttributes:c,onDeleteAttribute:s,onChangeAttribute:l,hideDeleteButton:!0,additionalControlsRenderer:p})};NW.propTypes={attributeType:T.AttributeTypeType,attributeValue:T.NestedAttributeValueType,onChange:fp().func};const DW=NW,PW=(0,Tp.Z)((()=>({entitySelector:{marginTop:"10px",width:"100%",maxWidth:"452px","& $entitySelectorInputLabel":{transform:"translate(12px, 13px)"}},entitySelectorInputLabel:{}}))),kW=e=>{let{attributeType:t,value:r,onChange:n}=e;const a=PW(),o=(0,hp.useDispatch)(),i=T.Mode.Editing,l=(0,T.getReferencedEntityTypeUriFromAttrType)(t),s=(0,hp.useSelector)(D().selectors.getMetadata),c=(0,hp.useSelector)((e=>D().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),u=(0,h.useCallback)((e=>(0,T.referencedEntityAttributeTypesSelectionStrategy)(t,e)),[t]),p=(0,A.prop)("entityUri",r),d=(0,h.useCallback)((e=>{const{uri:t,type:r,label:a}=e;(0,T.isTempUri)(p)&&o(N.profile.modifiedEntities.actions.entityDeleted(p)),n((0,A.isEmpty)(e)?null:{entityUri:t,entityType:r,entityLabel:a})}),[o,n,p]),m=(0,h.useCallback)(((e,t)=>{const r=(0,T.getEntityType)(s,l),n=(0,A.pipe)(u,(0,T.getCreatableAttributeTypes)(i))(r),a=(0,T.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:n,metadata:s,mode:i});d(a),o(N.profile.modifiedEntities.actions.entityCreated(a))}),[o,d,u,s,i,l]);return E().createElement(dU,{className:a.entitySelector,entity:r,entityTypesUris:(0,io.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}}}})};kW.propTypes={attributeType:T.AttributeTypeType,value:fp().shape({entityUri:fp().string,entityType:fp().string,entityLabel:fp().string}),onChange:fp().func};const LW=kW;function UW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jW=e=>{let{attributeType:t,attributeValue:r,onChange:n}=e;const a=(0,hp.useSelector)(D().selectors.getMetadata),o=(0,h.useMemo)((()=>{const e=(0,T.getEditableAttributeTypeSubAttributes)(a,t),r=(0,T.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){UW(e,t,r[t])}))}return e}({},r,{value:(0,T.createDefaultValues)({attributeTypes:e,parentUri:r.uri,mode:T.Mode.Editing})})}),[t,a]),i=r||o,{onChangeAttribute:l,onDeleteAttribute:s,onAddAttributes:c,onTogglePin:u}=wW({attributeValue:i,onChange:n}),p=(0,h.useCallback)(_W(i.uri,u),[i.uri,u]);return E().createElement(EU,{attributeType:t,attributeValue:i,showEmptyEditors:!0,mode:T.Mode.Editing,metadata:a,onAddAttributes:c,onDeleteAttribute:s,onChangeAttribute:l,hideDeleteButton:!0,additionalControlsRenderer:p})};jW.propTypes={attributeType:T.AttributeTypeType,attributeValue:T.NestedAttributeValueType,onChange:fp().func};const FW=jW;function MW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const VW={enabled:!0,queueSizeThreshold:5},BW=e=>{let{id:t,operation:r,operationParameters:n,groupId:a,groupAttributeType:o,hasConditions:i}=e;const l=pW(),s=(0,hp.useDispatch)(),c=(0,hp.useSelector)(Qc),u=(0,io.l0)(c),p=(0,h.useCallback)((e=>{let{attribute:r,checked:n}=e;n&&s((e=>{let{id:t,groupId:r,attribute:n}=e;return{type:Yn,payload:{id:t,groupId:r,attribute:n}}})({id:t,groupId:a,attribute:TW(r)}))}),[t,a,s]),d=(0,h.useCallback)((e=>{s(Oc({id:t,groupId:a,operationParameters:{attributeValue:e}}))}),[s,t,a]),m=(0,h.useCallback)((()=>{s((e=>{let{id:t,groupId:r}=e;return{type:ta,payload:{id:t,groupId:r}}})({id:t,groupId:a}))}),[t,a,s]),y=(0,h.useCallback)((()=>{s((e=>{let{id:t,groupId:r}=e;return{type:ra,payload:{id:t,groupId:r}}})({id:t,groupId:a}))}),[t,a,s]),g=(0,h.useCallback)((()=>{s(Tc({id:t,groupId:a}))}),[t,a,s]),f=(0,h.useCallback)((e=>{s((e=>{let{id:t,groupId:r,operation:n}=e;return{type:Wn,payload:{id:t,groupId:r,operation:n}}})({id:t,groupId:a,operation:e.value}))}),[t,a,s]),b=(0,A.prop)("pin",n),O=(0,A.prop)("addNestedAttribute",n),x=(0,A.prop)("attributeTypeData",n),C=(0,A.path)(["attributeTypeData","attributeType"],n),S=(0,T.isComplexAttribute)(C)&&[Z.Vh.AddNew,Z.Vh.ReplaceAllWith,Z.Vh.RepointReference].includes(r),w=o&&C&&C.uri===o.uri,R=[Z.Vh.AddNew,Z.Vh.ReplaceAllWith,Z.Vh.FindAndReplace].includes(r)&&!(null==C||!C.uri),_=a&&!w&&r===Z.Vh.AddNew&&!(0,T.isReference)(o);(0,h.useEffect)((()=>{b&&!R&&m()}),[R,b,m]),(0,h.useEffect)((()=>{O&&!_&&y()}),[_,O,y]);const I=(0,h.useMemo)((()=>{return C?(e=C,t=i&&w,(0,A.cond)([[(0,A.both)(T.isNested,(0,A.always)(t)),(0,A.always)((0,A.without)([Z.Vh.AddNew,Z.Vh.ReplaceAllWith],Z.DY))],[T.isNested,(0,A.always)(Z.DY)],[(0,A.both)(T.isReference,(0,A.always)(t)),(0,A.always)((0,A.without)([Z.Vh.AddNew],Z.hS))],[T.isReference,(0,A.always)(Z.hS)],[A.T,(0,A.always)(Z.pG)]])(e)).map((e=>({value:Z.Vh[e],label:Z.WN[e]}))):[];var e,t}),[i,C,w]),N=I.find((e=>e.value===r));(0,h.useEffect)((()=>{!N&&I[0]&&x&&f(I[0])}),[I,N,x,f]);const D=r&&x,P=(0,h.useMemo)((()=>OW(x)),[x]),k=(0,h.useCallback)(o?(0,bY.xM)(o):(0,A.ifElse)(bY.XF,(0,A.pipe)((0,A.pathEq)(["fieldName"],"tags")),(0,A.pipe)((0,A.prop)("attrType"),(0,A.both)((0,A.complement)(T.isImage),(0,A.complement)(T.isAnalyticAttribute)))),[o]),L=(0,h.useCallback)((e=>(0,T.getSearchGroupAttributeLabel)({data:e})),[]);return E().createElement("div",{className:v()(l.row,{[l.withoutLine]:!!a})},E().createElement("div",{className:l.mainRowContent},E().createElement(TY,{className:l.attrSelector,single:!0,showReferencedEntityAttributes:!1,entityTypes:u,value:P,onSelect:p,firstLevelAttributesFilter:k,ungroup:!!a,getLabel:L}),E().createElement(qU,{label:"",isDisabled:!P,placeholder:uo().text("Select operation"),className:l.operationSelector,value:N,options:I,height:40,onChange:f}),D&&E().createElement(E().Fragment,null,!S&&E().createElement(bW,{id:t,groupId:a,operation:r,operationParameters:n}),E().createElement("div",{className:l.icons},R&&E().createElement(xd.k,{className:v()(l.actionIcon,b&&l.actionIconActive),size:"M",tooltipTitle:uo().text("Make this Operational Value"),icon:mW,onClick:m}),_&&E().createElement(xd.k,{className:v()(l.actionIcon,O&&l.actionIconActive),size:"M",tooltipTitle:uo().text("Create parent attribute if none exists"),icon:gW,onClick:y}),E().createElement(xd.k,{size:"M",tooltipTitle:uo().text("Delete"),icon:Rp(),onClick:g})))),D&&S&&E().createElement($k.Provider,{value:VW},r===Z.Vh.RepointReference?E().createElement(LW,{attributeType:C,value:n.attributeValue,onChange:d}):(0,T.isNested)(C)?E().createElement(DW,{attributeType:C,attributeValue:n.attributeValue,onChange:d}):(0,T.isReference)(C)?E().createElement(FW,{attributeType:C,attributeValue:n.attributeValue,onChange:d}):null))};BW.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){MW(e,t,r[t])}))}return e}({},Fg,{groupId:fp().string,groupAttributeType:T.AttributeTypeType,hasConditions:fp().bool});const zW=(0,h.memo)(BW);var HW=r(80510),YW=r.n(HW);const WW=(0,Tp.Z)((e=>({complexRow:{borderBottom:uW,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"}}))),GW=(0,Tp.Z)((e=>({caption:{color:e.palette.text.secondary},conditions:{backgroundColor:"rgba(0,0,0,0.032)",padding:"20px 15px",margin:"7px 0"}}))),qW="40px",ZW=(0,Tp.Z)((()=>({row:{"&:hover $actions":{opacity:1}},logicOperatorContainer:{maxHeight:"40px"},attributeSelect:{width:"254px",height:qW},filterSelect:{width:"190px"},valuesWrapper:{width:"100%",display:"flex",minHeight:qW,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 $W(){return $W=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},$W.apply(this,arguments)}const KW=(0,h.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,hp.useSelector)(D().selectors.getMetadata),l=t.uri.split("/").slice(0,3).join("/"),s=(0,io.l0)(l),c=(0,h.useCallback)((0,bY.xM)(t),[t]),u=(0,h.useMemo)((()=>(0,A.pipe)(bY.s1,(0,A.when)((0,A.always)(!r),bY.a),(0,A.map)((0,A.evolve)({attributes:(0,A.pathOr)([],[0,"children"]),title:(0,A.when)((0,A.always)(n),(0,A.always)(n))})),(0,A.when)((0,A.always)(a),(0,A.concat)(a)))({firstLevelAttributesFilter:c},i,s)),[a,n,r,s,i,c]);return E().createElement(EY,$W({},o,{ungroup:!a,itemsGroups:u}))}));function XW(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){QW(e,t,r[t])}))}return e}function QW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const JW=(e,t)=>(0,za.nT)(`${Z.E_}_group`,uo().text("Profile"),[XW({},(0,za.o)(XW({title:(0,T.getEntityTypeLabel)(t,{type:(0,T.getReferencedEntityTypeUriFromAttrType)(e)}),fieldName:Z.E_},e)),{enforcedFilterOptions:[T.FilterOptions.EQUALS]})]),eG=e=>{let{rowData:t,rowContext:{attributeType:r,dispatchGroupAction:n},attributeSelectorProps:a={}}=e;const o=ZW(),i=(0,hp.useSelector)(D().selectors.getMetadata),l=t&&t.id,s=(0,h.useMemo)((()=>(0,T.isReference)(r)?[JW(r,i)]:null),[r,i]),c=(0,h.useCallback)((e=>{n(wc,l,e)}),[l,n]);return E().createElement(KW,{className:o.attributeSelect,value:t&&t.data,attributeType:r,additionalItemsGroups:s,subattributesGroupTitle:(0,T.isReference)(r)?uo().text("Reference attributes"):"",onSelect:c,onRestoreFocus:a.onRestoreFocus,onOpenPopup:a.onOpen,disableRestoreFocus:a.disablePopoverRestoreFocus,disableEnforceFocus:a.disablePopoverRestoreFocus})};eG.propTypes={rowData:Lg.Xw,rowContext:fp().shape({attributeType:T.AttributeTypeType,dispatchGroupAction:fp().func}),attributeSelectorProps:fp().shape({onRestoreFocus:fp().func,onOpen:fp().func,disablePopoverRestoreFocus:fp().bool})};const tG=(0,h.memo)(eG),rG=e=>!(e&&e.data),nG=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r},textFieldInputRef:n}=e;const a=ZW(),o=t&&t.id,i=(0,h.useCallback)((e=>r(Rc,o,e.value)),[r,o]);return E().createElement(NY,{height:40,className:a.filterSelect,attribute:t,textFieldInputRef:n,isDisabled:rG(t),onChange:i})};nG.propTypes={rowData:Lg.Xw,rowContext:fp().shape({dispatchGroupAction:fp().func}),textFieldInputRef:fp().object};const aG=(0,h.memo)(nG),oG=(0,Tp.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:{}}),iG=(0,A.pathEq)(["data","fieldName"],Z.E_),lG=e=>{let{condition:t,dispatchGroupAction:r}=e;const{values:n=[],data:{attrType:a,fieldName:o}={},filter:i}=t,l=oG(),s=(0,h.useCallback)((e=>r(_c,t.id,e)),[r,t.id]),c=(0,T.getAttrDataTypeDefinition)(a),u=(0,T.getDataTypeDefinitionForFilterValue)(c,i),p=(0,hp.useSelector)(D().selectors.getMetadata),d=(0,hp.useSelector)((e=>D().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),m=(0,h.useCallback)((e=>{let{uri:t,type:r,label:n}=e;return s([{entityUri:t,entityType:r,entityLabel:n}])}),[s]);return iG(t)?E().createElement(dU,{className:l.entitySelector,entity:n[0],entityTypesUris:(0,io.l0)((0,T.getReferencedEntityTypeUriFromAttrType)(a)),metadata:p,max:20,globalSearchRequestOptions:d,onChange:m,height:40,disableLinkClick:!0,TextFieldProps:{InputLabelProps:{classes:{marginDense:l.entitySelectorInputLabel}}}}):E().createElement(kY.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"})};lG.propTypes={condition:Lg.Xw.isRequired,dispatchGroupAction:fp().func};const sG=(0,h.memo)(lG),cG=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r}}=e;const n=ZW(),a=rG(t),o=t&&(0,T.checkIfOptionHasValues)(t.filter);return E().createElement("div",{className:n.valuesWrapper},!a&&o&&E().createElement(sG,{condition:t,dispatchGroupAction:r}))};cG.propTypes={rowData:Lg.Xw,rowContext:fp().shape({dispatchGroupAction:fp().func})};const uG=(0,h.memo)(cG),pG=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r}}=e;const n=ZW(),a=t&&t.id,o=(0,h.useCallback)((()=>r(Ac,a)),[a,r]);return t&&E().createElement("div",{className:n.actions},E().createElement(xd.k,{tooltipTitle:uo().text("Delete"),tooltipPlacement:"bottom",icon:Rp(),size:"M",onClick:o}))};pG.propTypes={rowData:Lg.Xw,rowContext:fp().shape({dispatchGroupAction:fp().func})};const dG=(0,h.memo)(pG),mG=e=>{let{attributeType:t,conditions:r,groupId:n}=e;const a=GW(),o=ZW(),i=(0,hp.useDispatch)(),l=(0,h.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,h.useMemo)((()=>({root:o.row,logicOperatorContainer:o.logicOperatorContainer})),[o]);return E().createElement(E().Fragment,null,E().createElement(wy(),{variant:"caption",component:"div",className:a.caption},uo().text("If the following conditions are met")),E().createElement(IH,{className:a.conditions,rowClasses:s,rowsData:r,AttributeSelectorComponent:tG,FilterSelectorComponent:aG,ValuesEditorComponent:uG,ActionsComponent:dG,attributeType:t,dispatchGroupAction:l}),E().createElement(wy(),{variant:"caption",component:"div",className:a.caption},uo().text("Then perform the change")))};mG.propTypes={attributeType:T.AttributeTypeType,conditions:fp().arrayOf(Lg.Xw),groupId:fp().string};const yG=mG;function gG(){return gG=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},gG.apply(this,arguments)}const fG=e=>{let{id:t,fieldName:r,actions:n,conditions:a}=e;const o=WW(),i=(0,hp.useDispatch)(),l=(0,hp.useSelector)(Qc),s=(0,hp.useSelector)(D().selectors.getMetadata),c=(0,h.useMemo)((()=>{const e=(0,T.searchUriToAttrUri)(r,l);return(0,T.findAttributeTypeByUri)(s,e,l)}),[s,r,l]),u=(0,h.useCallback)((()=>i({type:Zn,payload:t})),[t,i]),p=!!a,d=((e,t)=>(0,A.any)((0,A.both)((0,A.pipe)((0,A.prop)("operation"),(0,A.includes)(A.__,[Z.Vh.AddNew,Z.Vh.ReplaceAllWith])),(0,A.pathEq)(["operationParameters","attributeTypeData","attributeType","uri"],t.uri)))(e))(n,c);(0,h.useEffect)((()=>{p||0!==n.length||i(Tc({id:t}))}),[t,p,n.length,i]);const m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return E().createElement(zW,gG({key:e.id},e,{groupId:t,groupAttributeType:c,hasConditions:p}))};return E().createElement("div",{className:o.complexRow},E().createElement("div",{className:o.header},E().createElement("div",{className:o.attributeLabel},c.label),E().createElement(pE(),{disabled:d,color:"primary",className:o.conditionsToggleButton,onClick:u},p?E().createElement(E().Fragment,null,E().createElement(YW(),{className:o.conditionsToggleIcon}),uo().text("Remove")," "):E().createElement(E().Fragment,null,E().createElement(EH(),{className:o.conditionsToggleIcon}),uo().text("Add")," "),uo().text("conditions"))),a&&E().createElement(yG,{attributeType:c,conditions:a,groupId:t}),E().createElement("div",{className:o.actionsBlock},n.map(m),m()))};fG.propTypes=Mg;const hG=(0,h.memo)(fG);function EG(){return EG=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},EG.apply(this,arguments)}const bG=e=>{const t=(e=>e.actions?hG:zW)(e);return E().createElement(t,EG({key:e.id},e))},vG=()=>{const e=cW(),t=(0,hp.useSelector)(mu);return E().createElement("div",{className:e.wrapper},E().createElement("div",{className:e.container},t.map(bG),E().createElement(zW,null)))};var TG=r(99261),OG=r.n(TG),xG=r(26518),CG=r.n(xG),SG=r(60158),wG=r.n(SG),AG=r(61887),RG=r.n(AG);const _G=(0,Tp.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 IG(){return IG=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},IG.apply(this,arguments)}const NG=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=_G();return E().createElement(pE(),IG({},l,{className:v()(s.progressButtonWrapper,a),onClick:i,disabled:r||t}),o,t&&E().createElement("div",{className:s.progress,"data-reltio-id":"reltio-circular-load-indicator"},E().createElement(hm(),{size:24,color:n})))},DG=e=>{let{activeStep:t,steps:r,isPending:n=!1,shouldCompleteSteps:a=!0,onConfirm:o,onChangeStep:i}=e;const l=_G(),s=t===r.length-1,c=e=>{e!==t&&i(e)},u=(0,A.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,A.any)(u,(0,A.drop)(t+1,r));return E().createElement("div",{className:l.container},E().createElement("div",{className:l.placeholder}),E().createElement(OG(),{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 E().createElement(CG(),{key:o,completed:d,disabled:p},E().createElement(wG(),{className:l.stepButton,onClick:()=>c(r),"data-reltio-id":`reltio-search-bulk-update-${r}`},E().createElement(RG(),{error:s||u,classes:{error:s?l.errorLabel:l.warningLabel}},o)))}))),E().createElement("div",{className:l.buttons},t>0&&E().createElement(pE(),{variant:"outlined",className:l.backButton,onClick:()=>p(t),disabled:n,"data-reltio-id":"reltio-search-bulk-update-back"},uo().text("Back")),E().createElement(NG,{variant:"contained",color:"primary",disabled:!y,isInProgress:n,onClick:s?o:()=>d(t),"data-reltio-id":"reltio-search-bulk-update-"+(s?"confirm":"continue")},m?uo().text("Confirm"):uo().text("Continue"))))},PG=()=>{const e=(0,hp.useDispatch)(),t=(0,hp.useSelector)(Kc),r=(0,hp.useSelector)(du),n=(0,hp.useSelector)($c),a=!(0,A.isNil)(n),o=(0,hp.useSelector)(fu),i=(0,hp.useSelector)(hu),l=[{label:uo().text("Select profiles")},{label:uo().text("Select operation"),enabled:r},{label:uo().text("Define changes"),enabled:r&&a&&n===Z.dV.UpdateProfiles},{label:uo().text("Review changes"),enabled:r&&a&&(o||n===Z.dV.DeleteProfiles)}];return E().createElement(DG,{activeStep:t,steps:l,isPending:i,onChangeStep:t=>e((e=>({type:_n,payload:e}))(t)),onConfirm:()=>e({type:na})})},kG=(0,Tp.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"}}))),LG=e=>{let{children:t,onClose:r}=e;const n=kG();return E().createElement(nF(),{position:"static",color:"default",className:n.appBar},E().createElement(oF(),{className:n.toolbar},E().createElement(xd.k,{edge:"start",tooltipTitle:uo().text("Close"),"aria-label":uo().text("Close"),icon:Rp(),onClick:r,className:n.closeButton,size:"L","data-reltio-id":"reltio-search-bulk-update-close"}),E().createElement(wy(),{variant:"h6",className:n.title},t)),E().createElement(oF(),{className:n.toolbar},E().createElement(PG,null)))};LG.propTypes={children:fp().node,onClose:fp().func};const UG=LG,jG=(0,Tp.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"}}))),FG=(0,A.equals)(Z.v6.include);function MG(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const VG=()=>{const e=jG(),t=(0,hp.useDispatch)(),r=(0,hp.useSelector)(D().selectors.getMetadata),n=(0,hp.useSelector)(Qc),a=(0,hp.useSelector)(su),o=(0,hp.useSelector)(ru),i=(0,hp.useSelector)(iu),l=(0,hp.useSelector)(lu),s=(0,hp.useSelector)(eu),c=(0,hp.useSelector)(au),u=(0,hp.useSelector)(ou),p=(0,hp.useSelector)(Xc),d=(0,hp.useSelector)(nu),m=(0,hp.useSelector)(tu),y=(0,h.useMemo)((()=>((e,t,r)=>(0,A.pipe)((0,A.map)((0,A.prop)("uri")),FG(e)?(0,A.intersection)(t):(0,A.without)(t))(r))(m,d,o)),[m,d,o]),g=((e,t)=>0!==e.length&&(e.length===t.length||null))(y,o),f=(0,h.useMemo)((()=>(0,No.oq)(r,n,a)),[r,n,a]),b=(0,h.useCallback)((e=>{let{field:r,order:n}=e;return t((e=>{let{field:t,order:r}=e;return{type:jn,payload:{field:t,order:r}}})({field:n?r:null,order:n}))}),[t]),v=(0,h.useCallback)((e=>{let{what:r,where:n}=e;const o=(0,A.move)(r.columnIndex,n.columnIndex,a);t(Ec(o))}),[t,a]),T=(0,h.useCallback)((e=>{let{columns:r}=e;const n=(0,No.tU)(r,a);t(Ec(r)),n&&t(yc())}),[t,a]),O=(0,h.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){MG(e,t,r[t])}))}return e}({},t,{size:e[r].size})));t(Ec(r))}),[t,a]),x=(0,h.useCallback)(((e,r)=>{t(e?((e,t)=>({type:Dn,payload:{uri:e,checked:t}}))(e,r):{type:Pn,payload:!g})}),[g,t]),C=(0,h.useRef)(null);return E().createElement("div",{className:e.tableContainer},p&&E().createElement(HE.Z,null),E().createElement(dy,{entities:o,entityTypeUri:n,headColumns:a,additionalColumns:f,canCheck:!0,onCheck:x,checkedEntitiesUris:y,headerCheckboxState:g,dndColumnReorderingEnabled:!0,sortField:i,sortOrder:l,onSort:b,onReorderingColumn:v,onChangeColumnsList:T,onChangeColumnsSize:O,entitiesTableRef:C}),s>Z.Tu[0]&&E().createElement("div",{className:e.pagination},E().createElement(PE.Z,{count:s,rowsPerPageOptions:Z.Tu,rowsPerPage:u||Z.Tu[0],page:c||0,onChangePage:e=>t(hc(e)),onChangeRowsPerPage:e=>t((e=>({type:Ln,payload:e}))(e)),basicTableRef:C})))},BG=(0,Tp.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"}}))),zG=()=>{const e=BG(),t=(0,hp.useDispatch)(),r=(0,hp.useSelector)($c),n=(0,hp.useSelector)(D().selectors.getCanUserDeleteProfiles);(0,h.useEffect)((()=>{(0,A.isNil)(r)&&t(vc(Z.dV.UpdateProfiles))}),[r,t]);const a=(0,A.pipe)(Ep.NA,vc,t);return E().createElement("div",{className:e.tableContainer},E().createElement(wy(),{className:e.title},uo().text("Choose Bulk Update Operation")),E().createElement(Fh(),{value:r,onChange:a},E().createElement(Vh(),{classes:{label:e.label},value:Z.dV.UpdateProfiles,control:E().createElement(Uh(),{className:e.radioButton}),label:uo().text("Update Profiles - Update attribute values of selected profiles")}),E().createElement(Vh(),{disabled:!n,classes:{label:e.label},value:Z.dV.DeleteProfiles,control:E().createElement(Uh(),{className:e.radioButton}),label:uo().text("Delete Profiles - Delete selected profiles")})))};var HG=r(49850),YG=r.n(HG),WG=r(28012),GG=r.n(WG),qG=r(18878),ZG=r.n(qG),$G=r(70918),KG=r.n($G),XG=r(51159),QG=r.n(XG),JG=r(35681),eq=r.n(JG);const tq=e=>{let{value:t,attributeType:r,lookups:n}=e;return(0,T.isLookupAttrType)(r)&&"string"==typeof t&&(t={lookupCode:t,value:(0,T.getResolvedLookupValue)(n,(0,T.getAttrTypeLookupCode)(r),t)}),E().createElement(Zd.x,{dataTypeDefinition:(0,T.getAttrDataTypeDefinition)(r),value:t})};tq.propTypes={value:fp().any,attributeType:T.AttributeTypeType,lookups:fp().object};const rq=tq,nq=e=>{let{operation:t}=e;return E().createElement(E().Fragment,null,Z.WN[t])},aq=e=>{let{conditions:t,attributesPresentation:r,metadata:n,lookups:a}=e;if((0,T.isEmptyValue)(t))return E().createElement(E().Fragment,null,"-");const o=(0,T.buildAttributesReadableQuery)(n,r,a,t,!1);return E().createElement(Xz,{readableQuery:o})},oq="8px",iq="1px",lq="1px solid #AFD4E9",sq=(0,Tp.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:iq,left:oq,top:0,borderLeft:lq}},scaffoldHalfVert:{"&:before":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:"50%",width:iq,left:oq,top:0,borderLeft:lq}},scaffoldHor:{"&:after":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:iq,width:"5px",left:oq,top:"50%",borderBottom:lq}},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%"}}))),cq=e=>{let{attributeTypeData:{pathToTitle:t,title:r}}=e;const n=sq();return Boolean(t&&t.length>2)?E().createElement(Xg,{placement:"bottom-start",pathToTitle:t},E().createElement("span",{className:n.nestedLabel},r)):r};cq.propTypes={attributeTypeData:fp().shape({title:fp().string,attributeType:T.AttributeTypeType})};const uq=cq;function pq(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 dq(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){mq(e,t,r[t])}))}return e}function mq(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yq={EMPTY:"empty",FULL_VERT:"full_vert",FULL_VERT_HOR:"full_vert_hor",HALF_VERT_HOR:"half_vert_hor"},gq=e=>e.map(((t,r)=>(e=>{let{hasLowerSubAttrs:t,isFirstValue:r,isLastScaffold:n}=e;const a=n&&r;return t?a?yq.FULL_VERT_HOR:yq.FULL_VERT:a?yq.HALF_VERT_HOR:yq.EMPTY})(dq({},t,{isLastScaffold:r===e.length-1})))),fq=e=>{let{operation:t,operationParameters:r}=e;return(0,T.wrapInArrayIfNeeded)(dq({},r,{operation:t}))},hq=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,T.findAttributeTypeByUri)(e,t.type),o=a.label||a.name,i={attributeTypeData:{attributeType:a,title:o,pathToTitle:[...r,o]},scaffolds:gq(n),pin:t.pin};if((0,T.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 hq(e,t,[...r,o],[...n,s])}))));return[i,...l]}return[dq({},i,{attributeValue:(0,T.getAttributeValue)(t)})]},Eq=(0,A.curry)(((e,t)=>{let{operation:r,operationParameters:n}=t;const{attributeValue:a,attributeTypeData:o}=n,i=pq(n,["attributeValue","attributeTypeData"]),[l,...s]=hq(e,a,o.pathToTitle.slice(0,-1));return[dq({},l,{operation:r},i),...s]})),bq=(0,A.curry)(((e,t)=>{let{operation:r,operationParameters:n}=t;const{attributeValue:a,attributeTypeData:o}=n,i=pq(n,["attributeValue","attributeTypeData"]),[l,...s]=hq(e,a,o.pathToTitle.slice(0,-1)),{label:c,refEntity:u}=a,[{objectURI:p,type:d}]=u;return[dq({},l,{operation:r},i,{attributeValue:{entityUri:p,entityLabel:c,entityType:d}}),...s]})),vq=(0,A.curry)(((e,t)=>(0,A.cond)([[Hc,Eq(e)],[Yc,bq(e)],[A.T,fq]])(t))),Tq=(0,A.curry)(((e,t)=>(0,A.pipe)((0,A.defaultTo)([]),(0,A.chain)((0,A.ifElse)(Dc,(0,A.pipe)(Pc,Tq(e)),vq(e))))(t))),Oq=e=>{let{scaffold:t}=e;const r=sq();return E().createElement("div",{className:v()(r.scaffold,{[r.scaffoldFullVert]:t===yq.FULL_VERT||t===yq.FULL_VERT_HOR,[r.scaffoldHalfVert]:t===yq.HALF_VERT_HOR,[r.scaffoldHor]:t===yq.FULL_VERT_HOR||t===yq.HALF_VERT_HOR})})};Oq.propTypes={scaffold:fp().oneOf((0,A.values)(yq))};const xq=e=>{let{scaffolds:t}=e;const r=sq();return E().createElement("div",{className:r.scaffoldsContainer},t.map(((e,t)=>E().createElement(Oq,{key:t,scaffold:e}))))};xq.propTypes={scaffolds:fp().arrayOf(Oq.propTypes.scaffold)};const Cq=xq,Sq=e=>{let{children:t}=e;const r=sq();return E().createElement("div",{className:r.noWrapContainer},t)};Sq.propTypes={children:fp().node};const wq=Sq,Aq=e=>{let{pin:t,addParent:r}=e;const n=sq();return E().createElement(wq,null,E().createElement("div",{className:v()(n.optionContainer,{[n.opaque]:!t})},E().createElement(mW,null)),E().createElement("div",{className:v()(n.optionContainer,{[n.opaque]:!r})},E().createElement(gW,null)))};Aq.propTypes={pin:fp().bool,addParent:fp().bool};const Rq=Aq,_q=e=>{let{entity:{entityLabel:t,entityUri:r},attributeType:n}=e;const a=sq(),o=(0,hp.useSelector)((e=>D().selectors.getModifiedEntity(e,r)))||null,i=(0,hp.useSelector)(D().selectors.getMetadata),l=(0,h.useCallback)((()=>{const e=(0,T.getReferencedEntityTypeUriFromAttrType)(n),t=(0,T.getEntityType)(i,e);return(0,T.evaluateDeepEntityLabel)(o,t.dataLabelPattern)}),[n,i,o]),s=o?l():t;return E().createElement(wq,null,(0,T.getLabel)(s),(0,T.isTempUri)(r)&&E().createElement("div",{className:a.newIcon},uo().text("New")))};_q.propTypes={entity:T.ConnectionEntityType,attributeType:T.AttributeTypeType};const Iq=_q,Nq=(0,Tp.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%"}}))),Dq=()=>{const e=Nq(),t=(0,hp.useSelector)(yu),r=(0,hp.useSelector)(D().selectors.getMetadata),n=(0,hp.useSelector)(D().selectors.getAttributesPresentation),a=(0,hp.useSelector)(D().selectors.getLookups),o=(0,h.useMemo)((()=>Tq(r,t)),[t,r]);return E().createElement(KG(),{className:e.tableContainer,component:WI()},E().createElement(YG(),{className:e.table},E().createElement(QG(),null,E().createElement(eq(),null,E().createElement(ZG(),{className:e.attributeColumn},uo().text("Attribute")),E().createElement(ZG(),{className:e.conditionColumn},uo().text("Condition")),E().createElement(ZG(),{className:e.operatorColumn},uo().text("Operator")),E().createElement(ZG(),{className:e.valueColumn,colSpan:2}),E().createElement(ZG(),{className:e.valueColumn}),E().createElement(ZG(),{className:e.optionsColumn}))),E().createElement(GG(),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,A.isNil)(u),y=!(0,A.isNil)(c);return E().createElement(eq(),{key:t},E().createElement(ZG(),null,E().createElement(wq,null,o&&E().createElement(Cq,{scaffolds:o}),E().createElement(uq,{attributeTypeData:i}))),E().createElement(ZG(),null,E().createElement(aq,{attributesPresentation:n,metadata:r,lookups:a,conditions:l})),E().createElement(ZG(),null,s&&E().createElement(nq,{operation:s})),E().createElement(ZG(),null,y&&E().createElement(rq,{lookups:a,attributeType:i.attributeType,value:c})),E().createElement(ZG(),{align:"right"},y&&m&&E().createElement(wq,null,E().createElement("span",null,uo().text("with")))),E().createElement(ZG(),null,m&&((0,T.isReference)(i.attributeType)?E().createElement(Iq,{entity:u,attributeType:i.attributeType}):E().createElement(rq,{lookups:a,attributeType:i.attributeType,value:u}))),E().createElement(ZG(),{align:"right"},E().createElement(Rq,{pin:p,addParent:d})))})))))},Pq=(0,Tp.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}}}))),kq=()=>{const e=Pq(),t=(0,hp.useSelector)($c),r=(0,hp.useSelector)(pu);return t===Z.dV.UpdateProfiles?E().createElement(Dq,null):E().createElement("div",{className:e.tableContainer},E().createElement("div",{className:e.text},E().createElement("p",null,`${uo().text("Please confirm that you wish to start deletion of the selected")}`,E().createElement("b",null,` ${uo().number(r,"0,0")} `),uo().text(" profiles.")),E().createElement("p",null,uo().text("Click on Confirm to proceed."))))},Lq=(0,Tp.Z)((()=>({contentRoot:{padding:"0 0 5px",position:"relative",backgroundColor:"#FAFAFA"},tenantLabel:{marginLeft:"23px"}}))),Uq=()=>{const e=Lq(),t=(0,hp.useSelector)(Do.Ue),r=(0,hp.useSelector)(Kc),n=(0,hp.useDispatch)(),a=()=>n(Io(!1));return E().createElement(Ej(),{fullScreen:!0,open:t,onClose:a,disableEnforceFocus:!0},E().createElement(UG,{onClose:a},uo().text("Bulk update"),E().createElement(iW,{className:e.tenantLabel})),E().createElement(sW,null),E().createElement(tF(),{classes:{root:e.contentRoot}},(()=>{switch(r){case 0:return E().createElement(VG,null);case 1:return E().createElement(zG,null);case 2:return E().createElement(vG,null);case 3:return E().createElement(kq,null)}})()))},jq="1px solid rgba(0, 0, 0, 0.33)",Fq=(0,Tp.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:jq},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:jq,boxShadow:"0 1px 3px 0 rgba(0,0,0,0.12)"}}))),Mq=(0,dd.T)(Ry()),Vq=(0,hp.connect)((e=>({isReadyAppData:!!(0,Do.$s)(e),openAdvancedSearch:(0,Do.IJ)(e),tenant:D().selectors.getTenant(e)})))((e=>{let{openAdvancedSearch:t,isReadyAppData:r,tenant:n,dispatch:a}=e;const o=(0,h.useCallback)((()=>{a({type:P.k.CONVERT_FROM_ADVANCED_SEARCH}),a(To(!1))}),[a]),i=(0,h.useCallback)((()=>{a(To(!0)),a({type:gt})}),[a]),[l,s]=(0,h.useState)(!0),c=(0,h.useCallback)((e=>{s(e<=0)}),[]),u=Fq(),p=!t;return(0,h.useEffect)((()=>()=>T.memoizeWith.clearCache()),[n]),r?E().createElement(E().Fragment,null,E().createElement("div",{className:u.root},E().createElement(xy,{variant:"persistent",anchor:"left",open:p,classes:{root:u.drawer,paper:u.drawerPaper,docked:u.docked},"data-reltio-id":"reltio-search-facet-search-panel"},E().createElement(Mq,{tooltipTitle:uo().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"},E().createElement(Iy(),{color:"primary",className:u.menuIcon}),E().createElement("span",{className:u.buttonLabel},uo().text("Advanced search")),E().createElement(Dy(),{color:"action",className:u.goToActionIcon})),E().createElement(wy(),{variant:"button",classes:{root:v()(u.quickFilterRoot,{[u.withBottomBorder]:!l})}},uo().text("Quick filters")),E().createElement(eE,{onScroll:c})),E().createElement(rE,{className:v()(u.mainContent,{[u["mainContent--shifted"]]:p})},E().createElement(rW,{isOpenAdvancedSearch:t,onCloseAdvancedSearch:o}))),E().createElement(Cy.O,null),E().createElement(oE,null),E().createElement(EE,null),E().createElement(Uq,null)):null})),Bq=hy()({productionPrefix:"searchTable",disableGlobal:!0,seed:"srch"});T.userPreferencesComparator.register("searchState",((e,t)=>(0,T.looseEquals)((0,A.omit)(["query"],e),(0,A.omit)(["query"],t))));const zq=e=>{let{onResize:t=Ep.ZT}=e;return E().createElement(my.DynamicModuleLoader,{modules:[yp()]},E().createElement(by(),{generateClassName:Bq},E().createElement(Bp.Z,{handleHeight:!0,onResize:t}),E().createElement(gy._,{dateAdapter:yy.Q},E().createElement(Vq,null))))}}}]);
|